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,862 other subscribers

Delphi code of the day…

Posted by jpluimers on 2017/09/11

I was debugging an issue where a Delphi SOAP implementation was shoe-horned into an Indy server and came across the [WayBackTWebRequest.UpdateMethodType Method.

The further you get down the if/then/else tree, the more often the indexed property Method is accessed, same for the conversion/comparison code.

property Method: string index 0 read GetStringVariable;

So if the HTTP method is POST (very common), then the calls are being made 3 times:

procedure TWebRequest.UpdateMethodType;
begin
{$IFDEF NEXTGEN}
  if Method = 'GET' then  { do not localize }
    FMethodType := mtGet
  else if Method = 'PUT' then   { do not localize }
    FMethodType := mtPut
  else if Method = 'POST' then  { do not localize }
    FMethodType := mtPost
  else if Method = 'HEAD' then  { do not localize }
    FMethodType := mtHead
  else if Method = 'DELETE' then  { do not localize }
    FMethodType := mtDelete
  else if Method = 'PATCH' then  { do not localize }
    FMethodType := mtPatch;
{$ELSE !NEXTGEN}
  if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'GET') = 0 then  { do not localize }
    FMethodType := mtGet
  else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'PUT') = 0 then   { do not localize }
    FMethodType := mtPut
  else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'POST') = 0 then  { do not localize }
    FMethodType := mtPost
  else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'HEAD') = 0 then  { do not localize }
    FMethodType := mtHead
  else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'DELETE') = 0 then  { do not localize }
    FMethodType := mtDelete
  else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'PATCH') = 0 then  { do not localize }
    FMethodType := mtPatch;
{$ENDIF NEXTGEN}
end;

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 4 Comments »

Terry L@u’s blog: Manage non-domain Hyper-V servers (Windows Server 2016 Technical Preview) by Hyper-V Manager

Posted by jpluimers on 2017/09/11

One day I will need this: Terry L@u’s blog: Manage non-domain Hyper-V servers (Windows Server 2016 Technical Preview) by Hyper-V Manager [WayBack]

Via: Matthijs ter Woord

–jeroen

Posted in Hyper-V, Power User, Virtualization, Windows, Windows Server 2016 | Leave a Comment »

W123 – Tacho-Reparatur – works for W116 odometer (kilometerteller) as well

Posted by jpluimers on 2017/09/11

Since the odometer of our W116 would stall every now and then, we had to repair it.  Luckily the instructions at W123 – Tacho-Reparatur [WayBack] work fine for a W116 as too.

It’s different between 450SEL and 450SEL 6.9 and contains a bunch of lightbulbs so for completeness some links that help fixing lighting issues:

–jeroen

Read the rest of this entry »

Posted in cars, LifeHacker, Power User, W116 | Leave a Comment »

Reminder to self: find out how to disable YouTube auto-play in Chrome 60 and up

Posted by jpluimers on 2017/09/08

Somewhere around Chrome 60, this extension stopped to work for YouTube videos: Disable HTML5 Autoplay – Chrome Web Store.

It’s [WayBackunmaintained now as Google is supposed to work on an own disable-autoplay function, but this fails too:

More reading:

–jeroen

Posted in Chrome, Google, Power User | Leave a Comment »

To every site out there asking me to whitelist them from my adblocker: No.

Posted by jpluimers on 2017/09/08

I totally agree with [WayBack] To every site out there asking me to whitelist them from my adblocker: No. – Kristian Köhntopp – Google+

To every site out there asking me to whitelist them from my adblocker: No.

Why I am running an Adblocker. Also, it does not matter any more what you do. Running an Adblocker is a necessity because of the things below.

“No exceptions”.

Because it’s over – it may be your site that is better, but I don’t care any more.

Just running an Adblocker, revoking JS and Plugin privileges, and blocking third party bullshit everywhere, because that’s a secure default and a significant cognitive simplification.

The group you are part of, if you want it or not, made that necessary. It’s the world your people created. You will have to live in it, no matter how much of an exception your site is.

–jeroen

Posted in Power User, Web Browsers | Leave a Comment »

Blacklist Filters on MikroTik RouterOS

Posted by jpluimers on 2017/09/08

Some blacklist filters you can use on Mikrotik RouterOS devices:

You might consider to use these instead of action=drop:

–jeroen

Read the rest of this entry »

Posted in Development, Internet, MikroTik, Power User, RouterOS, routers, Scripting, Software Development | 2 Comments »

One day I will find back my Casio 79QGS-39 Universal Calendar watch from the 1980s

Posted by jpluimers on 2017/09/08

I think it’s Jan Wildeboer that referred me to the vongestern Blog: Smartwatch 1986: Casio DBX-100 [WayBack] entry.

It’s about database watches (and also shows the DB-520 and DBC-610) which were of the first smart watch generations and reminded me I’ve misplaced my Casio 79QGS-39 Universal Calendar digital LCD watch from the same era (mine was chrome unlike some of the Casio 79QGS-39 images  around).

Back then smart watches were focusing on very few things, but did them well, unlike today where they try to be jack of all trades: Niemand braucht Computer in Uhren. Der Artikel fängt langsam an, aber macht gute Punkte zum Ende hin. – Kristian Köhntopp – Google+ [WayBack]

Hopefully one day I’ll find my smart watch back, get it working and can post some pictures. The battery should be easy to replace though:

–jeroen

Read the rest of this entry »

Posted in About, Geeky, LifeHacker, Personal, Power User | Leave a Comment »

How to Find Saved WiFi Passwords in Windows – Geeks Gyaan

Posted by jpluimers on 2017/09/07

How to Find Saved WiFi Passwords in Windows – Geeks Gyaan [WayBack]: the rescue is netsh [WayBack].

netsh wlan show profiles
netsh wlan show profile name=network-name key=clear

–jeroen

via: Easily find save WiFi passwords in Windows – Joe C. Hecht – Google+ [WayBack]

Posted in Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1 | 3 Comments »

Fedora BTRFS+Snapper PART 2: Full System Snapshot/Rollback « A Random Walk Down Tech Street

Posted by jpluimers on 2017/09/07

Interesting reads:

Need to research how I can fit noatime ino.

–jeroen

Posted in *nix, *nix-tools, btrfs, File-Systems, Power User | Leave a Comment »

how to filter name/value pairs under a registry key by name and value in PowerShell – Stack Overflow

Posted by jpluimers on 2017/09/06

A long time ago I asked this question how to filter name/value pairs under a registry key by name and value in PowerShell? – Stack Overflow [WayBack] but forgot to schedule a post about it.

It’s an interesting scenario, so lets start with a log of the outcome (it’s on my ix500 scanning VM which has Office15 a.k.a. Office 2013 installed) of this script:

$path = 'hkcu:\Software\Microsoft\Windows\CurrentVersion\Extensions'
$key = Get-Item $path
$key

$namevalues = $key | Select-Object -ExpandProperty Property | 
  ForEach-Object { 
    [PSCustomObject] @{ 
      Name = $_; 
      Value = $key.GetValue($_) 
    } 
  }
$namevalues | Format-Table

$matches = $namevalues | 
  Where-Object { 
    $_.Name -match '^xls' `
    -or $_.Value -match 'msaccess.exe$' 
  }
$matches | Format-Table

It outputs this:

Read the rest of this entry »

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