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

Archive for 2015

Best Online XML Viewer, Formatter, Editor, Analyser, Beautify-Beautifier, Minify, Tree structure, Notepad, Marker

Posted by jpluimers on 2015/10/14

Thanks Joshep Prajapati for pointing me to this great page which can do a lot of XML related things:

Best Online XML Viewer, Formatter, Editor, Analyser, Beautify-Beautifier, Minify, Tree structure, Notepad, Marker.

–jeroen

via: Generate XSD from XML – XSD.EXE versus on-line tools – take 2 « The Wiert Corner.

Posted in Development, Software Development, XML, XML/XSD, XSD | 3 Comments »

ASCII and Unicode. Love and hate?

Posted by jpluimers on 2015/10/13

So I won’t forget:

Even though this does not work on most USA T-Shirt sites, it works on this Dutch one: T-Shirt Ontwerpen – t-shirt zelf ontwerpen | Spreadshirt.

–jeroen

PS:

Read the rest of this entry »

Posted in ASCII, Development, Encoding, Software Development, Unicode | Leave a Comment »

Books. Lots of books. In PDF.

Posted by jpluimers on 2015/10/12

Interesting: site:www.e-reading.link/bookreader.php – Google Search.

Likely highly illegal, but it has a lot of things in PDF that I already have on paper of stuff that is hard to get otherwise.

–jeroen 

Posted in LifeHacker, PDF, Power User | Leave a Comment »

Restore music and video from iPod: the iPod_Control\Music folder

Posted by jpluimers on 2015/10/09

When you’re not a frequent iTunes user, and recycle computer systems, then every once in a while you will get you in to a situation where you have Music on your iPod, but not on your PC any more.

Whereas iTunes is great at putting music on an iPod, it cannot get it back.

There are numerous paid tools to get the music from your iPod, but doing it manually is not that hard. Below are a few links to get you started, but they all come down to this:

  1. Your iPod has a hidden folder called iPod_Control in the root
  2. Inside the iPod_Control folder is a folder called Music
  3. Inside the Music folder, there are folders named with letters and numbers like F00
  4. Each numbered folder has media (music, video or even photos!) files with a strangely encoded name like B00N.mp3 or 3DUN.m4v with supported media extensions including mp3 m4a m4p jpg gif tif m4v mov.
  5. The media files contain meta data with song, artist, album, etc.

The steps to copy them back

  1. Do not erase your iPod when opening it in iTunes!
  2. Ensure you can mount your iPod as a disk (the “enable disk use” option in iTunes)
  3. Mount your iPod as a disk in Mac or PC
  4. Ensure you can view the hidden files
  5. Copy the Music folder including all subfolders to your Mac or PC
  6. Unhide the Music folder and all Music and Music/F* folders inside it using this chflags trick from Unhiding Unix Directories | Apple Support Communities:
    1. chflags nohidden Music
    2. chflags nohidden Music/F*
  7. Add these to your iTunes library and have iTunes re-generate the correct filenames from the meta-data

Some links explaining this in more detail:

–jeroen

Posted in Apple, iPod, iTunes, Mac, 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, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9 | 2 Comments »

Delphi books you should have or have read

Posted by jpluimers on 2015/10/08

Here is a list of books that I think any serious Delphi developer should have or have read:

  • Julian Bucknall: The Tomes Of Delphi Algorithms And Data Structures (paperback, kindle)
    • Still a classic, focussing on the why and how of algorithms. Lots of it apply even outside the Delphi field.
  • Nick Hodges: Coding in Delphi (paperback, kindle/PDF)
    • Want to learn about the newest Delphi language features? Then this book is for you. If not and still using a Delphi XE* version, then you should consider a new job.
  • Danny Thorpe: Delphi Component Design (paperback; no eBook)
    • Despite its age, it is still current: it shows you how and why many designs in the RTL are they way they are. More importantly it shows how to use these designs in your code. Even the most advanced Delphi programmers can learn a thing or two here. Many of the new RTL/VCL/FMX developers can learn far more from it.
  • Daniele Teti: Delphi Cookbook (paperback, eBook)
    • Even though it is relatively young, it is a classic example of a good how-to book with many inspiring examples on how to get a variety of things done in both regular and mobile applications.
  • Cary Jensen: Delphi in Depth: ClientDataSets 2nd Edition (paperback, PDF)
    • Although ClientDataSet is rapidly becoming obsolete in newer Delphi versions, old Delphi code benefits from ClientDataSets a lot: definitely recommended if you have to maintain an existing codebase.
  • Marco Cantù: Essential Pascal (paperback, PDF not available any more since Marco started working for Embarcadero)
  • Chris Rolliston: Delphi XE2 Foundations (paperback, kindle parts 1/2/3)
    • It covers language and non-visual things well so it is pretty version agnostic.
  • Ray Lischner: Delphi in a Nutshell (paperback, kindle)
    • It still covers the best Object Pascal language description on paper (sans modern language features like generics and anonymous methods.

There are many other Delphi books out, but most are either version specific, bound to a narrow area of topics, outdated or not well written.

–jeroen 

Posted in Uncategorized | 1 Comment »

On Epsilon, MachineEpsilon, and relative differences – via: I was wondering, that what is the closest value to the Zero floating point can have – G+

Posted by jpluimers on 2015/10/07

A long time ago, there was an interesting discussion here: I was wondering, that what is the closest value to the Zero floating point can have.

Recently I needed to do some calculations on series where getting close to zero could become a problem.

  • Math seems to have an Epsilon of 1E-12.
  • Sytem.Types has Epsilon of 1E-30 and Epsilon2 of 1E-40.
  • XE4+ FMX has IsEssentiallyZero and IsNotEssentiallyZero for Single values.

In practice it depends a lot on what you are doing. Sometimes absolute Epsilons are best, but at other times relative difference is much more applicable.

Then there is also a Machine Epsilon: a way to derive an Epsilon from a data type that works in all languages and platforms.

–jeroen

Posted in .NET, Algorithms, C, C#, C++, Delphi, Development, Floating point handling, Software Development | 1 Comment »

Get the path to the most recent msbuild.exe from the registry.

Posted by jpluimers on 2015/10/06

Get the path to the most recent msbuild.exe from the registry:


@echo off
:: http://stackoverflow.com/questions/328017/path-to-msbuild
:: http://www.csharp411.com/where-to-find-msbuild-exe/
:: http://timrayburn.net/blog/visual-studio-2013-and-msbuild/
:: http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx
setlocal
:vswhereModernTry
:: https://github.com/Microsoft/vswhere/wiki/Find-MSBuild
:: Normal output example of `vswhere -legacy -latest -property installationPath` has no trailing back-slash:
:: `C:\Program Files (x86)\Microsoft Visual Studio 14.0\`
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
set InstallDir=%%i
)
:: without ENABLEEXTENSIONS, %InstallDir% is only available outside the above loop.
for %%v in (15.0, 14.0) do (
if exist "%InstallDir%\MSBuild\%%v\Bin\MSBuild.exe" (
set msBuildExe="%InstallDir%\MSBuild\%%v\Bin\MSBuild.exe"
goto :finish
)
)
:manualTry
:: order of the versions is important: get the most recent one
for %%v in (14.0, 12.0, 4.0, 3.5, 2.0) do (
for /f "usebackq tokens=2* delims= " %%c in (`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\%%v" /v MSBuildToolsPath`) do (
set msBuildExe="%%dMSBuild.exe"
goto :finish
)
)
:vswhereLegacyTry
:: -legacy is not compatible with -products or -requires
:: note there is no Visual Studio 13.0 (just like there is no Office 13.0) likely because USA superstition.
:: https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History
:: msbuild was introduced in Visual Studio 8.0: https://en.wikipedia.org/wiki/MSBuild#History
:: Legacy output example of `vswhere -legacy -latest -property installationPath` has trailing back-slash:
:: `C:\Program Files (x86)\Microsoft Visual Studio 14.0\`
for /f "usebackq tokens=*" %%i in (`vswhere -legacy -latest -property installationPath`) do (
set InstallDir=%%i
)
:: without ENABLEEXTENSIONS, %InstallDir% is only available outside the above loop.
for %%v in (14.0, 12.0, 11.0, 10.0, 9.0, 8.0) do (
if exist "%InstallDir%MSBuild\%%v\Bin\MSBuild.exe" (
set msBuildExe="%InstallDir%MSBuild\%%v\Bin\MSBuild.exe"
goto :finish
)
)
:: nothing found
:finish
endlocal & if not [%msBuildExe%]==[] if exist %msBuildExe% ( echo %msBuildExe% )


for /f "usebackq tokens=*" %%c in (`"%~dp0get-msbuildExe-path.bat"`) do (
call %%c %*
)

view raw

run-msbuild.bat

hosted with ❤ by GitHub

With help from:

Note

This needs adoption for Visual Studio 2017 (15.0) and up; see the comments at the above gist:

lextm commented on Mar 9, 2017  

Note that 15.0 (in VS2017) no longer registers itself at this registry key location, so this trick won’t simply work. vswhere is now recommended to locate MSBuild 15,

https://github.com/Microsoft/vswhere

n9 commented on May 17, 2017

Be sure to call vswhere -products * to get standalone installation of BuildTools. (See Microsoft/vswhere#61.)

–jeroen

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Delphi, Delphi 10 Seattle, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Fiber to Fiber speed beats Cable to Fiber speed by a factor 2 (all three internet connections are in the same house)

Posted by jpluimers on 2015/10/05

I’ve two fiber connections, one cable connection and one ADSL connection at home.

This is a traceroute from one fiber connection to the other over the outside network:

traceroute to snip.xs4all.nl (80.100.143.119), 64 hops max, 52 byte packets
 1  tomatortn66u (172.23.71.1)  0.951 ms  0.708 ms  0.638 ms
 2  fiber24315337241.heldenvannu.net (37.153.243.241)  1.135 ms  0.988 ms  0.974 ms
 3  rt121bb121-212-183.routit.net (212.121.121.183)  1.973 ms  1.976 ms  1.919 ms
 4  0-7-0-4-core2-a-tc1.routit.net (84.246.25.133)  2.711 ms  2.498 ms  2.517 ms
 5  0-7-0-4-core2-a-tc1.routit.net (84.246.25.133)  2.725 ms  2.674 ms  2.535 ms
 6  0-7-0-7-core4-a-tc2.routit.net (37.0.80.7)  3.048 ms  2.883 ms  2.712 ms
 7  1-2-inet1-tc2.routit.net (84.246.25.46)  2.767 ms  2.633 ms  2.514 ms
 8  ams-ix.tc2.xs4all.net (80.249.208.166)  2.676 ms  4.177 ms  2.775 ms
 9  0.ae5.xr3.3d12.xs4all.net (194.109.5.13)  2.987 ms  3.114 ms  11.387 ms
10  xe-8-1-0.dr11.xs4all.net (194.109.7.14)  6.188 ms
    xe-7-0-1.dr11.d12.xs4all.net (194.109.7.58)  3.320 ms
    xe-8-0-1.dr11.d12.xs4all.net (194.109.7.38)  3.206 ms
11  snip.xs4all.nl (80.100.143.119)  4.079 ms !X  3.960 ms !X  3.946 ms !X

This is the same but from my third connection (that will go away sooner than later): Cable.

traceroute to snip.xs4all.nl (80.100.143.119), 64 hops max, 52 byte packets
 1  www.asusnetwork.net (192.168.171.1)  1.016 ms  0.983 ms  0.938 ms
 2  * * *
 3  212.142.62.69 (212.142.62.69)  11.427 ms  8.361 ms  8.459 ms
 4  84.116.244.97 (84.116.244.97)  8.080 ms  10.405 ms  7.340 ms
 5  nl-ams09b-ri1-xe-10-2-0.aorta.net (84.116.130.22)  7.625 ms
    nl-ams09b-ri1-xe-8-0-0.aorta.net (84.116.130.2)  10.392 ms
    84.116.136.81 (84.116.136.81)  9.534 ms
 6  0.xe-1-2-0.xr1.tc2.xs4all.net (194.109.7.209)  8.315 ms  9.505 ms  9.684 ms
 7  0.ae5.xr3.3d12.xs4all.net (194.109.5.13)  9.508 ms
    0.ae4.xr4.1d12.xs4all.net (194.109.5.9)  9.565 ms
    0.ae5.xr3.3d12.xs4all.net (194.109.5.13)  9.459 ms
 8  xe-7-0-1.dr11.d12.xs4all.net (194.109.7.58)  8.547 ms  13.159 ms  9.893 ms
 9  snip.xs4all.nl (80.100.143.119)  9.710 ms !X  10.079 ms !X  8.121 ms !X

Finally there is ADSL (which will go even sooner):

snap:~ # traceroute snip.xs4all.nl
traceroute to snip.xs4all.nl (80.100.143.119), 30 hops max, 40 byte packets using UDP
 1  192.168.71.1 (192.168.71.1)  1.052 ms   0.554 ms   0.520 ms
 2  lo0.dr13.d12.xs4all.net (194.109.5.212)  17.767 ms   17.368 ms   17.123 ms
 3  1423.ae3.xr4.1d12.xs4all.net (194.109.7.137)  16.901 ms 1418.ae3.xr4.1d12.xs4all.net (194.109.7.17)  16.628 ms 1323.ae3.xr3.3d12.xs4all.net (194.109.7.141)  16.354 ms
 4  xe-8-1-0.dr11.xs4all.net (194.109.7.14)  15.961 ms xe7-0-0.dr11.d12.xs4all.net (194.109.7.170)  15.762 ms xe-8-1-0.dr11.xs4all.net (194.109.7.14)  15.283 ms
 5  snip.xs4all.nl (80.100.143.119)(N!)  15.914 ms (N!)  16.171 ms (N!)  15.710 ms

Cable is about twice as slow than Fiber.

ADSL is about three times as slow than Fiber.

–jeroen

Posted in fiber, Fritz!, Fritz!Box, Internet, Power User, routers, TomatoUSB | Leave a Comment »

Solution for My 6th generation nano plays same song over and over and will not suffle songs – via Apple Support Communities

Posted by jpluimers on 2015/10/05

Solution for:

My 6th generation nano plays same song over and over and will not shuffle songs or play them like it is supposed to skipping to next song. What do i need to do to get it back to normal?

peter’d in response to Karrojava:

If you have that second Nano, the one that is 1 3/4 inches, perfectly square, and your song is playing over and over, you need to put your finger on the double arrows that move to next song and swipe left. You’ll get the screen with the repeat loop, the genius icon and the shuffle icon and you’ll see that the repeat loop has a 1 showing. Just touch it and the one will disappear. It took me an hour to figure this out and I even got it twice and couldn’t figure out what I did. It isn’t in the current Nano instructions as the newer ones have easier access to these icons.

This is the sequence of screens from iPod nano in delhi | iPad in delhi | HP Laptop in delhi | Samsung Notebook | Chirag Desktop | Gaming Headphone | Apple, MAC Computers | VHS INFOTECH PVT. LTD.:

Playing song Playing song: swipe, then Repeat count; Genius; Shuffle mode Repeat count; Genius; Shuffle mode.

Note: this iPod doesn’t auto-roate so you use two fingers to rotate it 90 degrees on any screen

Rote the screen: use two fingers. Rote the screen:  Use two fingers to rorate the screen. Use two fingers to rorate the screen.

–jeroen

via

Posted in Apple, iPod, iPod Nano, Power User | Leave a Comment »

OnePlus One battery drain: 5.0 lollipop – Android 5.0 display keeps turning on with black and white notifications – Android Enthusiasts Stack Exchange

Posted by jpluimers on 2015/10/02

This was a huge battery drain for mmy Oneplus One running CM12: 5.0 lollipop – Android 5.0 display keeps turning on with black and white notifications – Android Enthusiasts Stack Exchange.

Posted in Android Devices, OnePlus One, Power User | Leave a Comment »