I finally finished this awesome game called Photoshop, let me send you a video [WayBack] I finally finished this awesome game called Photoshop, let me send you a video – The Old New Thing
–jeroen
Posted by jpluimers on 2021/02/01
I finally finished this awesome game called Photoshop, let me send you a video [WayBack] I finally finished this awesome game called Photoshop, let me send you a video – The Old New Thing
–jeroen
Posted in Uncategorized, Windows Development | Leave a Comment »
Posted by jpluimers on 2021/01/29
Interesting: [WayBack] Detecting what language or script a run of text is written in, redux – The Old New Thing.
Do not confuse language with the scripts in which one or more languages can be written, and much more is covered in it.
Related:
–jeroen
Posted in Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »
Posted by jpluimers on 2021/01/28
[WayBack] Nick Craver on Twitter: “1. “Are you ready to work on the auth code?” 2. New dev: “Hell yeah, bring it on!” 3.… “.
Relevant because security often is a nightmare:
Both threads are a good read.
–jeroen
Posted in .NET, Android, Development, Fun, Mobile Development, Software Development, Xamarin Studio | Leave a Comment »
Posted by jpluimers on 2021/01/28
Interesting read: [WayBack] Deciphering the Messages of Apple’s T2 Coprocessor | Duo Security.
Via:
–jeroen
Posted in Development, Security, Software Development | Leave a Comment »
Posted by jpluimers on 2021/01/28
If you have a class (like TMyClass) in the current unit, you can get the unit name as follows:
UnitName or UnitScope to get the unit nameTMyClass.UnitName or TMyClass.UnitScopeDelphi added UnitName [WayBack] and Delphi XE2 added UnitScope [Archive.is]. Their implementations are different, but I have not seen classes where the outcome is different.
The code below shows that when the underlying RTTI UnitName field inside a PTypeData referred by a PTypeInfo contains an @ sign, then UnitName takes the part before the @, and UnitScope the part after the @, but I have not yet seen units where the underlying field contains an @ sign.
If you have seen that, please let me know.
I needed this in order to research some unit initialisation order issues.
A post helpful with that was [WayBack] windows – Can I determine the order in which my units have been initialized? – Stack Overflow for which this comment by Ritsaert Hornstra is the most important bit:
Related: If you use a unit in the interface section you know that that unit will be initialized BEFORE the unit that uses that unit. When using units in the implementation section this is not the case. So usually when you are using a unit with a singleton in it, created in it’s initialization section, you should use that unit in the interface section to make sure that it is initialized before use.
There is also an answer [WayBack] by Remko Weijnen that shows how to hack the current initialisation order if you know the address of InitContext inside the System.InitUnits method.
Back to UnitName versus UnitScope, the code:
class function TObject.UnitName: string; var LClassInfo: Pointer; S: _PShortStr; begin LClassInfo := ClassInfo; if LClassInfo <> nil then begin S := @PClassData(PByte(LClassInfo) + 2 + PByte(PByte(LClassInfo) + 1)^).UnitName; if S^[1] <> '@' then Result := UTF8ToString(S^) else Result := UTF8ToString(Copy(S^, Pos(_ShortStr(':'), S^) + 1, MaxInt)); end else Result := ''; end; class function TObject.UnitScope: string; var LClassInfo: Pointer; S: _PShortStr; begin LClassInfo := ClassInfo; if LClassInfo <> nil then begin S := @PClassData(PByte(LClassInfo) + 2 + PByte(PByte(LClassInfo) + 1)^).UnitName; if S^[1] <> '@' then Result := UTF8ToString(S^) else Result := UTF8ToString(Copy(S^, 2, Pos(_ShortStr(':'), S^) - 2)); end else Result := ''; end;
Related:
–jeroen
Posted in Delphi, Development, Software Development | 1 Comment »
Posted by jpluimers on 2021/01/27
I am really glad this keynote got recorded. Still very relevant, it is as much about software development as it is about society.
Go watch it, as it gives you reason to think about your role in the software development process, and in the information fire hose at large.
Back in the days, David Intersimone was right when he created the regular blog post “Sip from the Firehose” (for early materials, see [WayBack] GetPublished – Author Information: Firehose).
The talk main thread is about current and ever growing overload of information which basically makes it disinformation, combined with the abundance of “AI” recording devices around you that basically make you the product.
Basically we reached all the tick marks of these books:
The session is not just about “how bad is the situation” (it is very), but also provides directions on how to get out of it for both people in the development process, as well as consumers, producers and sharers of information.
via:
–jeroen
Posted in .NET, Development, Opinions, Power User, Security, Software Development | Leave a Comment »
Posted by jpluimers on 2021/01/27
A while ago, I saw this tweet:
It mentions LISP (nowadays mostly called Lisp), likely because their derivatives like Scheme and Clojure still actively mention their ancestry.
ALGOL is not in the list, but has had so much influence on modern programming. So here the thread that followed:
–jeroen
Posted in ALGOL, Delphi, Development, LISP, Software Development | Leave a Comment »
Posted by jpluimers on 2021/01/27
On one of the sites, when having some Delphi package registration issues, the standard measure was to delete the complete Package Cache subtree (like HKEY_CURRENT_USER\Software\Embarcadero\BDS\17.0\Package Cache).
Since there is so little information about it, it is on my list of things to eventually research.
Some links I already found, but had no time for to fully read:
Hopefully the Cleaning package cache for Jcl110.bpl in this post will help me find more details.
Unrelated: You should not delete the folder C:\ProgramData\Package Cache\? – Super User, but matched my initial delphi registry “Package Cache” – Google Search.
Yup, I did it: I added an “Undocumented Delphi” category.
–jeroen
Posted in Delphi, Development, Software Development, Undocumented Delphi | Leave a Comment »
Posted by jpluimers on 2021/01/26
TL;DR
The examples in this post are specific for NUnit but, you can apply this pattern for safely running unit tests in parallel to any unit test framework that supports parallel execution.
To safely run tests in parallel, do the following:
- Mark your test fixtures with the
Parallelizableattribute and set the parallel scope toParallelScope.All.- Create a private class called
TestScopeand implementIDisposable.- Put all startup and clean-up logic inside the
TestScopeconstructor and.Dispose()method respectively.- Wrap your test code in a
using (var scope = new TestScope) { ... }block
From [WayBack] Run your unit tests in parallel with NUnit, which also covers:
Via: [WayBack] Sander Aernouts on Twitter: “Run unit tests in parallel with NUnit without having one test interfere with another test. https://t.co/FC0fNocGov”
–jeroen
Posted in .NET, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2021/01/26
[WayBack] datetime – Determine Whether Two Date Ranges Overlap – Stack Overflow answer by Charles Bretana with input from Baodad and tomosius.
TL;DR (proof is in the post)
(StartA <= EndB) and (EndA >= StartB)
Alternative (also from the post):
DateRangesOverlap = max(StartA,StartB) < min(EndA,EndB)
It gets complicated when the date boundaries for A and B can be out of order.
The post also covers that.
Related:
–jeroen
Posted in Development, Software Development | Leave a Comment »