The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

    • RT @samgerrits: Caroline en asielzoekers, een tweeluik. Links: dwepen met een speldje gekregen van een Iraanse asielzoeker, rechts: nou ja… 3 hours ago
    • RT @delphijunkie: Yeah, nah. I'm good thanks Twitter. https://t.co/eTMPUoeSEa 3 hours ago
    • RT @d_feldman: Microsoft: We have world class AI research Google: We have world class AI research Meta: We’re one or two steps behind in AI… 3 hours ago
    • RT @SchipholWatch: Op dit moment is kerosine zo’n tien keer goedkoper dan alternatieve synthetische brandstof. De overheid moet dit prijsve… 4 hours ago
    • RT @jasongorman: One aspect of LLMs many folks overlook is the energy cost of training one. GPT-3 used an ~936 MWh and training it took 102… 4 hours ago
  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,178 other subscribers

Archive for July, 2019

New in 10.2.2: Component icons – Community Blogs – Embarcadero Community

Posted by jpluimers on 2019/07/31

A well balanced post that shows what you can attain by thinking in advance and remembering backward compatibility: [WayBack] New in 10.2.2: Component icons – Community Blogs – Embarcadero Community

Larger icons can now be in PNG format (future IDE versions will use 128×128 for HiDPI screens) so older IDE versions do not get confused. Since newer IDE versions prefer PNG over BMP icons, backward compatibility is easier.

Via: [WayBack] A look at the new component icons in 10.2.2.  – David Millington – Google+

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

It’s a blong, blong, blong road…: ‘What if?’ scenario analysis in the CPU window

Posted by jpluimers on 2019/07/31

Patching code at debug-time: [WayBackIt’s a blong, blong, blong road…: ‘What if?’ scenario analysis in the CPU window.

Remember:

  • There are dragons
  • Patching too many bytes will kill a kitten and likely your application.
  • Bytes in memory might not be what they seem, especially when having breakpoints (and the debugger frantically trying to set/remove $CC bytes for the INT 3 instruction)

I’ve done this for 20+ years and usually use the $90 byte (NOP instruction) though your experience may be different.

–jeroen

 

Posted in Debugging, Delphi, Development, Pascal, Software Development, Turbo Pascal | Leave a Comment »

Ternary operator in PowerShell – Stack Overflow

Posted by jpluimers on 2019/07/31

I like this built-in construct by fbehrens most:

$result = If ($condition) {"true"} Else {"false"}

Everything else is incidental complexity and thus to be avoided.

For use in or as an expression, not just an assignment, wrap it in $(), thus:

write-host $(If ($condition) {"true"} Else {"false"})

There are even more elegant constructs, but those require setting up an alias before using them.

Source: [WayBackTernary operator in PowerShell – Stack Overflow

–jeroen

Posted in CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »

Sometimes a race condition is in just two lines of code

Posted by jpluimers on 2019/07/30

A race condition can be this small:

if Assigned(Setting.OnChanged) then
  Setting.OnChanged(Setting);

If in between these lines, the value of Setting.OnChanged becomes nil, then you have an access violation.

It is a very slim, but real chance.

–jeroen

Posted in Delphi, Development, Multi-Threading / Concurrency, Software Development | 4 Comments »

scripting – Run Multiple Powershell Scripts Sequentially – on a Folder – Combine Scripts into a Master Script – Stack Overflow

Posted by jpluimers on 2019/07/30

Cool tip by mjolinor to execute the scripts 1.ps1, 2.ps1 and 3.ps1 from a master.ps1 script in the same directory:

&"$PSScriptroot\1.ps1"
&"$PSScriptroot\2.ps1"
&"$PSScriptroot\3.ps1"

Source: [WayBackscripting – Run Multiple Powershell Scripts Sequentially – on a Folder – Combine Scripts into a Master Script – Stack Overflow.

It uses $PSScriptroot which got introduced in PowerShell 2 in modules and extended in PowerShell 3 to be available in all scripts. More information in [WayBack] about_Automatic_Variables | Microsoft Docs

–jeroen

Posted in CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »

 
%d bloggers like this: