Got this from a friend: Sulfur Argon Calcium Samarium (SArCaSm): the Primary Elements of Humor.
Of course there is Iridium Oxygen Nitrogen Yttrium (IrONy) as well.
–jeroen
Posted by jpluimers on 2021/06/10
Got this from a friend: Sulfur Argon Calcium Samarium (SArCaSm): the Primary Elements of Humor.
Of course there is Iridium Oxygen Nitrogen Yttrium (IrONy) as well.
–jeroen
Posted in Fun, LifeHacker, Power User, Quotes | Leave a Comment »
Posted by jpluimers on 2021/06/10
I have been bitten by this a few times too much, so time to write it down:
When porting old Delphi code from the Delphi 7 and older era, the options were stored .dof (options) and .cfg (configuration) files.
More modern Delphi versions try to translate these files when generating the .dproj file, in a similar way as they try to upgrade older .dproj files to newer formats.
Many things can go wrong, including these ones I have bumped into multiple times:
DCC_DebugInformation having a 0 or false value, but not handling these values correctly (I remember problems around the Delphi XE5 era with this: When the Delphi XE5 commandline compiler fails with error F1026: File not found: ‘False.dpr’)DCC_OutputDependencies not being adhered to (no .d file is being emitted by the compiler), though for the .drc files, DCC_OutputDRCFile works fine)DCC_DebugInformation having a 1 value (Limited Debug information) instead of being absent (Debug information)DCC_SymbolReferenceInfo having a 1 value (Definitions Only) instead of being absent (Reference info)–jeroen
Posted in Delphi, Development, Software Development | 1 Comment »
Posted by jpluimers on 2021/06/09
I was not aware there could be a nullable [WayBack] rowversion (Transact-SQL) – SQL Server | Microsoft Docs, but it is possible:
Duplicate rowversion values can be generated by using the SELECT INTO statement in which a rowversioncolumn is in the SELECT list. We do not recommend using rowversion in this manner.
A nonnullable rowversion column is semantically equivalent to a binary(8) column. A nullable rowversion column is semantically equivalent to a varbinary(8) column.
You can use the rowversion column of a row to easily determine whether the row has had an update statement ran against it since the last time it was read. If an update statement is ran against the row, the rowversion value is updated. If no update statements are ran against the row, the rowversion value is the same as when it was previously read. To return the current rowversion value for a database, use @@DBTS.
You can add a rowversion column to a table to help maintain the integrity of the database when multiple users are updating rows at the same time. You may also want to know how many rows and which rows were updated without re-querying the table.
For example, assume that you create a table named
MyTest. You populate some data in the table by running the following Transact-SQL statements.
–jeroen
Posted in Database Development, Development, Software Development, SQL, SQL Server | Leave a Comment »
Posted by jpluimers on 2021/06/09
The state of text reading robots and AI a few years back; I doubt it has improved much since: [WayBack] Thread by @JFBonnefon: “It’s a big day today: I had a scientific manuscript rejected by a robot. Thread. The bot detected ❝a high level of textual overlap with previous literature […]”.
Basically, it detected all duplicates to be in non-relevant pieces.
Via: [WayBack] Michael Bolton on Twitter: “Thread. Machines read strings. They don’t understand context or intentions. This is how AI comes to stand for Anti-Intellectualism and Algorithmic Irresponsibility (the latter coined by @jamesmarcusbach).… “
Although I could not find that reference through [Archive.is] “Algorithmic Irresponsibility” – Google Search. I could only find two:
–jeroen
Posted in AI and ML; Artificial Intelligence & Machine Learning, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2021/06/09
For cleanup of .dproj files, I want to know the bit flags that TargetPlatforms can have.
For future reference empiric values for the flags that build the TargetedPlatforms (not to be confused with PlatformTargets) element content in the main PropertyGroup of a .dproj file in a table.
This might help creating an XSD for a .dproj file (Source: Reminder to self: make a start for an XSD that validates Delphi dproj files).
Absent cells means I have no idea if the values are relevant or what they could be.
Input for those is more than welcome.
| Bit# | TargetedPlatforms bit flag value |
Platform and $(Platform)value |
Meaning (dropdown value of “Select Platform” dialog) |
|---|---|---|---|
| 0 | 1 |
Win32 |
32-bit Windows |
| 1 | 2 |
Win64 |
64-bit Windows |
| 2 | 4 | ||
| 3 | 8 | ||
| 4 | 16 | ||
| 5 | 32 | ||
| 6 | 64 | ||
| 7 | 128 | ||
| 8 | 256 | ||
| 9 | 512 | ||
| 10 | 1024 |
iOSDevice64 |
iOS Device 64-bit |
| 11 | 2048 | ||
| 12 | 4096 |
($Platform) values still to cover:
AndroidLinux64OSX32iOSDevice32iOSSimulatorThere is only one place for TargetedPlatforms in the .dproj file: at the XPath /Project/PropertyGroup/TargetedPlatforms.
For getting the XPath, I used Notepad++ as described in my earlier blog post Getting the path of an XML node in your code editor.
It has the combined flags, so:
3 means Win32 and Win64 are enabled1025 means Win32 and iOSDevice64 are enabledThe Platform value (and thus $(Platform) value) is the one used in for example these elements or attributes:
/Project/PropertyGroup/Platform as currently selected platform/Project/PropertyGroup/@Condition as selectivity expression, for instance
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''"><PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">/Project/ProjectExtensions/BorlandProject/Platforms/Platform (all having for the value property with the Platform value) having a content of either True or False.
.dproj file to contain information for platforms that are not visible yet.The actual values of Platform also play a role in these places:
/Project/PropertyGroup/Base_Win64 containing the base settings for the Win64 platform so they can be derived for the Debug or Release builds./Project/PropertyGroup/@Condition for instance <PropertyGroup Condition="'$(Base_Win64)'!=''">/Project/ProjectExtensions/BorlandProject/Deployment/DeployFile/Platform/@Name for instance <Platform Name="iOSSimulator">Even worse: there are unneeded nodes present for bits in TargetPlatforms and /Project/ProjectExtensions/BorlandProject/Platforms/Platform being absent or having a content False for /Project/ProjectExtensions/BorlandProject/Platforms/Platform/@value other than the enabled bits in TargetPlatforms, for instance:
/Project/ProjectExtensions/BorlandProject/Deployment/DeployFile/Platform/Project/ProjectExtensions/BorlandProject/Deployment/ProjectRoot/@Platform/Project/ProjectExtensions/BorlandProject/Deployment/DeployClass/Platform/@Name (and the parent DeployClass subtrees)/Project/ProjectExtensions/BorlandProject/Platforms/Platform@valueSome examples of superfluous nodes when TargetPlarforms has a value of 1 (corresponding to Platform having a value of Win32:
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
Also, non relevant platforms are included in this node:
<Platforms> <Platform value="Win32">True</Platform> <Platform value="Win64">False</Platform> </Platforms>
The Deployment section is even worse; see for instance [WayBack] delphi – How manage or clean deploy section in dproj files? – Stack Overflow.
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 1 Comment »
Posted by jpluimers on 2021/06/08
With User Experience, perception plays a big role. It helps to understand how colors work: a difficult topic with amazing results like: “All the balls are the same color — and that color is brown!”
All pictures below are from the [WayBack] Chaz Firestone on Twitter: “All the balls are the same color — and that color is brown!… “ thread.
Original by [WayBack] David Novick (@NovickProf) | Twitter: Professor of Engineering Education and Leadership, the University of Texas at El Paso. Tweets cover innovation & entrepreneurship, improv, and color illusions. El Paso, TX.
[Archive.is] David Novick on Twitter: “A three-color confetti illusion with spheres, which appear to be yellowish, reddish, and purpleish but in fact have exactly the same light-brown base color (RGB 255,188,144). Shrinking the image increases the effect. Original png file is at .… “
A PNG of the original is at engineering.utep.edu/novick/colors and his dropbox, and is even more stunning than the Twitter dithered versions below.
Colors from the color picker tool by [WayBack] #therightwaye (@therightwaye) | Twitter:
Grey backgrounds by [WayBack] Joffan (@Joffan7) | Twitter:
The cool thing is that this is being used in product packaging to make the fruits and vegetables look more orange.
Carrots by [WayBack] Hanon Ondricek on Twitter: “Oh right! And baby carrot bags have orange stripes… #itrustnothingnow… “:
Oranges and grapefruits by [WayBack] Alexei Kojenov (@kojenov) | Twitter:
–jeroen
Posted in Color (software development), Development, Software Development, User Experience (ux) | Leave a Comment »
Posted by jpluimers on 2021/06/08
Uit een thread die een stuk onbenul aan de kaak stelde, kwam iets moois:
[WayBack] Max Verslakken 🌈 on Twitter: “‘Ik, een lopende persoon, bepaal wel effe voor mensen met een handicap wat er toegankelijk moet worden.’ Nieuwsflits: toegankelijkheid is een recht..…”:
Om precies te zijn: met de ratificatie van het #VNverdrag Handicap heeft Nederland als staat/overheid de plicht om toegankelijkheid te vergroten (zie vooral artikelen 4 en 9 van dit verdrag, wetten.overheid.nl/BWBV0004045/20…). Daarbij speelt ‘redelijk’ wel een rol, zie o.a. artikel 2. 1/22/2 Zo’n plicht was er nog niet voor private organisaties (zoals pretparken), maar die is er nu wel met Besluit Toegankelijkheid (zoek.officielebekendmakingen.nl/stb-2017-256.h…). Het is de plicht om ‘iets’ te doen voor algemene toegankelijkheid, waarbij ‘redelijk’ en ‘geleidelijk’ wel een rol spelen.Tot slot: in het Besluit Toegankelijkheid staan enkele voorbeelden, zie de toelichting bij artikel 6. Wat ‘redelijk’ is, hangt af van o.a. de omvang van de organisatie, zie artikel 7. Zo mag je van bijv. een grote supermarkt veel meer verwachten/eisen dan van een kleine bakkerij.Nog 1 P.S. 😉. Geert schrijft “alle attracties in een pretpark voor iedereen toegankelijk lukt niet”. Op korte termijn lukt dat idd niet, maar op langere tijd is veel mogelijk. Dat houdt die ‘geleidelijkheid’ in: niet alles hoeft meteen, maar er moet wel steeds vooruitgang zijn.
–jeroen Read the rest of this entry »
Posted in accessibility (a11y), Development, Software Development | Leave a Comment »
Posted by jpluimers on 2021/06/08
Too bad the whole mechanism involving TRegGroups.UnregisterModuleClasses is not documented anywhere
It is the underlying storage to support TClassFinder, which was introduced in Delphi 6, documented on-line in Delphi 2007, documented slightly in Delphi 2009, and since Delphi 2010 only one line of documentation was added (including the unchanged “instatiated”):
This is class
Classes.TClassFinder.
The
TClassFinderallows the list of registered persistent classes to be retrieved. Objects instatiated from persistent classes are those that can be stored (serialised) beyond the operation of the current application.
TClassFinderallows registered persistent classes to be retrieved.The
TClassFinderallows the list of registered persistent classes to be retrieved. Objects instatiated from persistent classes are those that can be stored (serialised) beyond the operation of the current application.
Back to TRegGroups.UnregisterModuleClasses: it takes a HMODULE parameter and ultimately gets called through the (since Delphi 2007) on-line documented [WayBack] Classes.UnRegisterModuleClasses Function
procedure UnRegisterModuleClasses(Module: HMODULE);Call UnRegisterModuleClasses to unregister all object classes that were registered by the module with the handle specified by the Module parameter. When a class is unregistered, it can’t be loaded or saved by the component streaming system.
After unregistering a class, its name can be reused to register another object class.
To get more context about the access violation, I used both the stack trace and a debugging watch for GetModuleName(Module) (using the [WayBack] SysUtils.GetModuleName Function).
In order to see which classes were registered by what module, I set a breakpoint at in TRegGroup.AddClass (which can be called through various code paths):
procedure TRegGroup.AddClass(AClass: TPersistentClass); begin FGroupClasses.Add(AClass); end;
HModuleThat gave me the class, but I also needed the HModule for a class, so I did a windows get module of currently executing code – Google Search, giving me these links, all C/C++ related:
I currently use the following trick (inspired from this forum):
const HMODULE GetCurrentModule() { MEMORY_BASIC_INFORMATION mbi = {0}; ::VirtualQuery( GetCurrentModule, &mbi, sizeof(mbi) ); return reinterpret_cast<HMODULE>(mbi.AllocationBase); }Is there a better way to do this that doesn’t look so hacky?
If you are using a Microsoft linker, you can take advantage of
a pseudovariable which the linker provides.EXTERN_C IMAGE_DOS_HEADER __ImageBase; #define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)The pseudovariable
__ImageBase
represents the DOS header of the module, which happens to
be what a Win32 module begins with.
In other words, it’s the base address of the module.
And the module base address is the same as itsHINSTANCE.
Here you already see some confusion: there is HINSTANCE and HMODULE. That’s a historic thing, as described by Raymond Chen in [WayBack] What is the difference between HINSTANCE and HMODULE? | The Old New Thing:
They mean the same thing today, but at one time they were quite different.
It all comes from 16-bit Windows.
In those days, a “module” represented a file on disk that had been loaded into memory, and the module “handle” was a handle to a data structure that described the parts of the file, where they come from, and where they had been loaded into memory (if at all). On the other hand an “instance” represented a “set of variables”.
One analogy that might (or might not) make sense is that a “module” is like the code for a C++ class – it describes how to construct an object, it implements the methods, it describes how the objects of the class behave. On the other hand, an “instance” is like a C++ object that belongs to that class – it describes the state of a particular instance of that object.
In C# terms, a “module” is like a “type” and an instance is like an “object”. (Except that modules don’t have things like “static members”, but it was a weak analogy anyway.)
GetModuleNameSearching for delphi “__ImageBase” – Google Search then got me [WayBack] c++ – Get DLL path at runtime – Stack Overflow with a nice Delphi related answer by [WayBack] Ian Boyd:
For Delphi users:
SysUtils.GetModuleName(hInstance); //Works; hInstance is a special global variable SysUtils.GetModuleName(0); //Fails; returns the name of the host exe process SysUtils.GetModuleName(GetModuleFilename(nil)); //Fails; returns the name of the host exe processIn case your Delphi doesn’t have SysUtils.GetModuleName, it is declared as:
...
This reassured my use of [WayBack] SysUtils.GetModuleName code was OK:
function GetModuleName(Module: HMODULE): string; var ModName: array[0..MAX_PATH] of Char; begin SetString(Result, ModName, GetModuleFileName(Module, ModName, Length(ModName))); end;
HInstance in DelphiThe example from Ian Boyd also brought back memories from long ago about the [WayBack] HInstance Variable – Delphi in a Nutshell [Book]:
Posted in Conference Topics, Conferences, Delphi, Development, Event, History, Software Development | Leave a Comment »
Posted by jpluimers on 2021/06/07
Via [Archive.is] CloudKey ESXi Appliance – Google Search:
–jeroen
Posted in *nix, Cloud Key, ESXi6, ESXi6.5, ESXi6.7, Internet, Network-and-equipment, Power User, Unifi-Ubiquiti, Virtualization, VMware, VMware ESXi | Leave a Comment »
Posted by jpluimers on 2021/06/07
Choices:
=lorem(...): Ramdom Lorem Ipsum text paragraphs.
=rand(...): Random English help text like paragraphs.
=rand.old(...): “The quick brown fox jumps over the lazy dog.” paragraphs (up until Word 2003, this was what rand(...) returned).
(...) parameters:
(x,y): x paragraphs of y sentences of text(y): y paragraphs of 3 sentences of text (lorem more towards 1, rand more towards 3)(): depends on the function:
=lorem(): 5 paragraphs of 3 sentences of text=rand(): 5 paragraphs of 3 sentences of text=rand.old(): 3 paragraphs of 3 sentences of textNote:
=rand(...)Based on:
Related: [WayBack] 10 awesome Lorem Ipsum alternatives – Justinmind via [WayBack] rand () in word – Microsoft Tech Community – 325554
For a random document demo, I usually do this:
=lorem(100,1) to get 100 paragraphs of 1 line of text–jeroen
Posted in Office, Office 2003, Office 2007, Office 2010, Office 2013, Office 2016, Power User, Word | Leave a Comment »