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

Archive for 2018

Hunting for Beyond Compare on your system: bc.bat

Posted by jpluimers on 2018/10/23

For my archive bc.bat it finds Beyond Compare, then starts it with the given command line parameters. It prefers version 4 over version 3 and user settings over system settings:

:begin
@echo off
  setlocal
  IF /I %PROCESSOR_ARCHITECTURE% == amd64 goto :x64
  IF /I %PROCESSOR_ARCHITEW6432% == amd64 goto :x64
  goto :x86
:x64
  :: OS is 64bit
  set hkcuBaseKey=HKEY_CURRENT_USER\Software\Scooter Software\Beyond Compare
  set hklmBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Scooter Software\Beyond Compare
  
  goto :findBC
:x86
  :: OS is 32bit
  set hkcuBaseKey=HKEY_CURRENT_USER\Software\Scooter Software\Beyond Compare
  set hklmBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Scooter Software\Beyond Compare
  goto :findBC
:findBC
  :: https://gist.github.com/rojepp/634908
  :: http://stackoverflow.com/questions/5369528/windows-batch-reg-query-key-value-to-a-variable-but-do-not-display-error-if-key
  set SupportedBeyondCompareVersions=3, 4
  for %%v in (%SupportedBeyondCompareVersions%) do (
    for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hkcuBaseKey% %%v" /v ExePath 2^>NUL`) do (
      call :do set bcExe="%%d"
    )
  )
  if not [%bcExe%]==[] goto :foundBC
    for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hkcuBaseKey%" /v ExePath 2^>NUL`) do (
      call :do set bcExe="%%d"
    )
  if not [%bcExe%]==[] goto :foundBC
  for %%v in (%SupportedBeyondCompareVersions%) do (
    for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hklmBaseKey% %%v" /v ExePath 2^>NUL`) do (
      call :do set bcExe="%%d"
    )
  )
  if not [%bcExe%]==[] goto :foundBC
    for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hklmBaseKey%" /v ExePath 2^>NUL`) do (
      call :do set bcExe="%%d"
    )
:foundBC
  if [%bcExe%]==[] ( echo no bc.exe found in registry) else (
    echo bcExe=%bcExe%
    if exist %bcExe% start "Beyond Compare" %bcExe% %*
    if not exist %bcExe% echo not found: [%bcExe%]
  )
:exit
  endlocal
:end
  goto :eof
:do
  ::echo %*
  call %*
  goto :eof

–jeroen

Posted in Batch-Files, Beyond Compare, Development, Power User, Scripting, Software Development | Leave a Comment »

DIY Filament Sensor for your 3D Printer

Posted by jpluimers on 2018/10/23

Via:

–jeroen

Read the rest of this entry »

Posted in 3D printing, Development, Hardware Development, LifeHacker | Leave a Comment »

G+ thread: Do i need to create one TFormatSettings instance for every thread?

Posted by jpluimers on 2018/10/23

A very interesting thread at [WayBack] Do i need to create one TFormatSettings instance for each thread that needs it? If i want the same settings (for all threads), th… – Dany Marmur – Google+

It’s about:

Recommended reading!

It made me go back to these style guides (from oldest to newest):

And Stefan Glienke reminded me naming is always hard, so I found back these from a distant past:

Note most of the above Links point to (archives of) Delphi 2007 documentation as the behaviour is that old and that the below identifiers  were not mentioned in the thread.

The FormatSettings variable was introduced in Delphi XE but only documented in XE2 and up.

Until that, other global variables like the [WayBackSysUtils.DecimalSeparator Variable were used.

–jeroen

Read the rest of this entry »

Posted in Delphi, Development, internatiolanization (i18n) and localization (l10), Software Development | Leave a Comment »

Ole Albers: Just wanted to tell that the Google+ Optimizer now has a cross post to Diaspora…

Posted by jpluimers on 2018/10/23

Cool: [WayBack] Just wanted to tell that the Google+ Optimizer now has a cross post to Diaspora – Feature…. – Ole Albers – Google+.

Get it from [WayBack] Ghosttown – Optimizer – Chrome Web Store

The Google+ – Optimizer increases the user experience with Google+ until the bitter end…
With this extension you can modify and arrange your google+ stream just like you want.

Some of the Features:
* Remove unwanted content ("suggested contacts, youtube-comments,animated gifs...)
* Display additional content (stopwatch)
* Filter by Hashtag
* Autosave-Feature
* Bookmark-Feature
... and more

The first time you open a page on plus.google.com, you see this:

Then when you post a removable information bar:

That directs you to the configuration (either right click the icon, or follow http://hurz.me/gplusoptimizer), where in the main item, you can enter your diaspora host (in my case pluspora) information:

–jeroen

Posted in Chrome, G+: GooglePlus, Google, Power User, SocialMedia | Leave a Comment »

Nieuwere @Samsung_NL TVs gebruiken de OneRemote (soms ook Smart Remote genoemd) model BN59-01241A. Werken op die TVs ook de klassieke remotes zoals BN59-01223A die met oudere TVs werden meegeleverd?

Posted by jpluimers on 2018/10/22

Geen antwoord van Samsung op [WayBack] “Nieuwere @Samsung_NL TVs gebruiken de OneRemote (soms ook Smart Remote genoemd) model BN59-01241A. Werken op die TVs ook de klassieke remotes zoals N59-01223A die met oudere TVs werden meegeleverd?”

Gelukkig kwam ik dit tegen:

[WayBack] Reviews over Samsung UE50MU6100 – Coolblue – alles voor een glimlach

De afstandbediening is wel even wennen in gebruik, maar als je een oude Samsung afstandbediening hebt liggen werkt dit op deze tv en kun je dus de nummertoetsen gebruiken bij het zappen ;)

Later kwam Samsung alsnog met een antwoord:

[WayBack] Samsung Nederland on Twitter: “Hey Jeroen! De ‘normale’ afstandsbediening werkt ook gewoon op de nieuwere modellen! ^Nadia… “

Oh ja: Samsung maakt zowel 49, 50 als 55 inch versies: [WayBack] Comparison between: 49.5″ Samsung UE50MU6100, 48.5″ Samsung UE49MU6100, 54.6″ Samsung UE55MU6100.

Vergelijken in die MU61xxx serie blijft lastig. De 6100 kan meer dan de 6120 (bluetooth en voicecommand). De 6199 kan meer dan de 6179:

–jeroen

 

Posted in 4K Monitor, Displays, Hardware, Home Audio/Video, LifeHacker, MU6100, Power User, Samsung TV | Leave a Comment »

Hopefully this is now available: in March you could pre-order the PoE hat for the Raspberry Pi 3 B+ at ~ EUR 15.

Posted by jpluimers on 2018/10/22

Wow, EUR 15 is almost half the price of an Raspberry Pi 3 B+:

[WayBack] RPI3-MODBP-POE RASPBERRY-PI, Add-On Board, Power over Ethernet (PoE) HAT for Raspberry Pi 3 Model B+ | Farnell UK

Via:

–jeroen

Posted in Development, Hardware Development, Power User, Raspberry Pi | Leave a Comment »

The Analysis of Drive Issues – unRAID

Posted by jpluimers on 2018/10/22

Interesting info for any RAID system: [WayBackThe Analysis of Drive Issues – unRAID

Start with Drive problems by keyword.

–jeroen

Posted in Hardware, Power User, SAS/SATA | Leave a Comment »

Doctors disabled wireless in Dick Cheney’s pacemaker to thwart hacking – Naked Security

Posted by jpluimers on 2018/10/22

Medical devices are still vulnerable, five years after this became public:

Former US Vice President Dick Cheney’s doctors disabled his pacemaker’s wireless capabilities to thwart possible assassination attempts, he said in an interview with CBS’s ̶…

[WayBackDoctors disabled wireless in Dick Cheney’s pacemaker to thwart hacking – Naked Security

I knew they were, but never realised Dick Cheney had a modified one implanted.

Some people are more equal to others…

via: the below video “Freedom In My Heart And Everywhere” from the linux.conf.au 2012 Keynote by Karen Sandler.

–jeroen

Read the rest of this entry »

Posted in Development, Open Source, Power User, Security, Software Development | Leave a Comment »

Technical Note TN1150: HFS Plus Volume Format

Posted by jpluimers on 2018/10/21

TN1150: Describes the physical layout of an HFS Plus volume.

[WayBack] Techånical Note TN1150: HFS Plus Volume Format

Posted in Uncategorized | Leave a Comment »

wget and curl: downloads that sometimes fail

Posted by jpluimers on 2018/10/19

For my archive somewhere between cURL 7.21.0 and 7.34.0 it does not like to be started from an RDP based tsclient share:

C:\Users\jeroen\Downloads>\\tsclient\bin\curl.7.21.0.exe --remote-name https://www.xs4all.nl/index.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 86465    0 86465    0     0  60805      0 --:--:--  0:00:01 --:--:-- 70012

C:\Users\jeroen\Downloads>\\tsclient\bin\curl.7.34.0.exe --remote-name https://www.xs4all.nl/index.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: web.archive.org

C:\Users\jeroen\Downloads>\\tsclient\bin\curl.7.61.0.exe --remote-name https://www.xs4all.nl/index.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: www.xs4all.nl

C:\Users\jeroen\Downloads>copy \\tsclient\bin\curl.7.61.0.exe
        1 file(s) copied.

C:\Users\jeroen\Downloads>curl.7.61.0.exe --remote-name https://www.xs4all.nl/index.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    13    0    13    0     0     10      0 --:--:--  0:00:01 --:--:--    10

It fails the same way after net use B: \\tsclient\bin, so that does not matter.

The best link I could find until I got to the real problem was [WayBack] curl: (6) Could not resolve host: application – Stack Overflow which shows a different problem: properly quoting.

In addition to remote-name, you can also grab the file name from the headers using --remote-header-name, and --remote-time use the remote file time. The --location follows 302-redirects. You can see that in the example below which I build based on

[WayBack] unix – Curl to grab remote filename after following location – Stack Overflow: The remote side sends the filename using the Content-Disposition header.curl 7.21.2 or newer does this automatically if you specify –remote-header-name / -J.curl -O -J -L $url

C:\Users\jeroen\Downloads>b:\curl.7.21.0.exe --location --remote-name --remote-time --remote-header-name "https://web.archive.org/web/20180712073755if_/https://www.danielwolf.eu/?wpdmdl=1965"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 86465    0 86465    0     0  45748      0 --:--:--  0:00:01 --:--:-- 50772
curl: Saved to filename 'pkgWuppdiWP_DX102T_1-1-2.zip'

wget failed big time:

C:\Users\jeroen\Downloads>B:\wget.exe --no-check-certificate -v -v -v --content-disposition --restrict-file-names=windows "https://web.archive.org/web/20180712073755if_/https://www.danielwolf.eu/?wpdmdl=1965"
wget: Cannot read b:/.wgetrc (No such file or directory).
--2018-07-12 09:55:23--  https://web.archive.org/web/20180712073755if_/https://www.danielwolf.eu/?wpdmdl=1965
Resolving web.archive.org... 207.241.225.186
Connecting to web.archive.org|207.241.225.186|:443... failed: Invalid argument.
Retrying.

...

--2018-07-12 09:55:23--  (try:20)  https://web.archive.org/web/20180712073755if_/https://www.danielwolf.eu/?wpdmdl=1965
Connecting to web.archive.org|207.241.225.186|:443... failed: Invalid argument.
Giving up.

This is not caused by the filename (Windows does not like the ? question mark in output file names, so  – like & ampersand in file URLs – you have to quote the full URL, but also provide the --restrict-file-names=windows parameter; see [WayBack] wget – I can’t download files with “?” – Super User).

–jeroen

Posted in *nix, *nix-tools, cURL, Power User, wget | Leave a Comment »