The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

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

    Join 1,860 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 »

What’s New In Python 3.0

Posted by jpluimers on 2019/07/30

Old, but I keep bumping in old Python code that needs conversion to work in Python 3.x: [WayBackWhat’s New In Python 3.0 — Python 3.6.3 documentation.

Via: [WayBack] Version 3: History of Python – Wikipedia

–jeroen

Posted in Development, Python, Scripting, Software Development | Leave a Comment »

My website is marked as unsafe. How can I change this? | Facebook Help Community

Posted by jpluimers on 2019/07/29

For my link archive: [Archive.is] My website is marked as unsafe. How can I change this? | Facebook Help Community

Posted in Facebook, Power User, SocialMedia | Leave a Comment »

Logging to syslog on a VMware ESXi machine

Posted by jpluimers on 2019/07/29

Since “esxi write entry to syslog” didn’t return results on how to add new syslog entries, only how to configure syslog.

It was much easier than I hoped for:

logger TEST

With a default configuration this then ends up in /var/log/syslog.log:

grep TEST /var/log/syslog.log

2019-07-29T10:48:31Z root: TEST

Now I know the command, I found

–jeroen

Posted in Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

logging – Where is “/var/log/messages” on mac-osx? – Server Fault

Posted by jpluimers on 2019/07/29

logging – Where is “/var/log/messages” on mac-osx? – Server Fault

TL;DR: because most of it is in /var/log/system.log which is configured in /etc/asl.conf, but the documentation example about syslog.conf never got updated.

Long read

The example in syslog.conf is wrong at WayBack: Mac OS X Manual Page For syslog.conf(5) and man syslog.conf:

EXAMPLES
     A configuration file might appear as follows:
...
     # Log anything (except mail) of level info or higher.
     # Don't log private authentication messages!
     *.info;mail.none;authpriv.none          /var/log/messages
...
FILES
     /etc/syslog.conf  The syslogd(8) configuration file.

It still is when writing this [WayBack]syslog.conf(5) Mac OS X Manual Page, so you have to look at /etc/syslog.conf on a live system:

# Note that flat file logs are now configured in /etc/asl.conf

install.*                       @127.0.0.1:32376

which means the actual configuration is in /etc/asl.conf:

# Rules for /var/log/system.log
> system.log mode=0640 format=bsd rotate=seq compress file_max=5M all_max=50M
? [= Sender kernel] file system.log
? [<= Level notice] file system.log
? [= Facility auth] [<= Level info] file system.log
? [= Facility authpriv] [<= Level info] file system.log

Documentation at [WayBack] asl.conf(5) Mac OS X Manual Page indicates this:

NAME
     asl.conf -- configuration file for syslogd(8) and aslmanager(8)

DESCRIPTION
     The syslogd(8) server reads the /etc/asl.conf file at startup, and re-reads the file when it receives a HUP signal.  The aslmanager(8) daemon reads the file when it starts.  See the
     ASLMANAGER PARAMETER SETTINGS section for details on aslmanager-specific parameters.

Source

Based on [WayBacklogging – Where is “/var/log/messages” on mac-osx? – Server Fault:

Q:

When you read the man pages on Mac OS X, there are references to /var/log/messages, but if you look for the file, it doesn’t exist:

$ ls -l /var/log/messages
ls: /var/log/messages: No such file or directory

A:

2009 era: If you look at the actual /etc/syslog.conf instead of the man page, you see *.notice;authpriv,remoteauth,ftp,install.none;kern.debug;mai‌​l.crit /var/log/system.log

–jeroen

Posted in Apple, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, macOS 10.12 Sierra, OS X 10.10 Yosemite, OS X 10.11 El Capitan, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User | Leave a Comment »

Basically, all Harman Kardon amplifiers (including subwoofers) show power supply issues after a few years

Posted by jpluimers on 2019/07/26

Experienced first hand myself, all my Harman Kardon amplifier equipment (including subwoofer) have shown power supply issues after about 2 years of use.

Signs are devices not powering up any more, giving only a limited amount of power (for instance a subwoofer only blinking the power led), or intermittent shutdown failure (more often when it is warmer than 22 degrees Celsius).

There are companies making a living of just these power repairs (for instance Audiocare.nl who git all my defective equipment to work again for about EUR 100 per device: [WayBack] Harman Kardon – AudioCare.nl).

This is how you remove the power supplies:

The biggest issues are failing capacitors, and glue becoming conductive.

Related blog posts:

Some videos below the fold.

–jeroen

Read the rest of this entry »

Posted in BDS277, BDS580, Hardware, Harman Kardon, Home Audio/Video, Power User | Leave a Comment »