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 May, 2014

Using dsquery and dsget to get computer information from a domain

Posted by jpluimers on 2014/05/13

This article is a very brief example of how to use dsquery/dsget/find to get computer information from in the active direrctory of a domain.

The main aim for myself is to condense the information here, and have some links for background information.

If you have the right credentials then the below batch file works very well.

It uses these tools:

  • dsquery to query the active directory on your domain controller for the existence and Distinguished Name (or ID/path) of various objects (in this example dsquery computer to check if a computer exists in a domain)
  • dsget which can get you various detail information about an object (for instance dsget computer used in this example))
  • find to raise the correct errorlevel (and indicate if we indeed found a CN – or Common Name – from a distinguished name)

The ds* tools do not raise any errorlevel, so that’s what find is used for.

Further reading: Read the rest of this entry »

Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »

MacBook Air/Retina equivalent of Ctrl+Shift+Eject is Ctrl+Shift+Fn+Power (via: Apple Support Communities)

Posted by jpluimers on 2014/05/12

Recent Retina and MacBook Air’s do not have an optical drive, so they do without the Eject button on the keyboard.

The quick keyboard shortcut Control+Shift+Eject is not directly available, so what is the replacement?

A few people that answered this are jr00ck and Evil Rob:

For newer Retina and MacBook Air’s, control+shift+fn+power button replaces control+shift+eject.

In fact you can even press Fn+Power and get a small dialog that lets you choose what to do and offers a “Reopen windows when logging back in” checkbox:
Read the rest of this entry »

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, OS X 10.8 Mountain Lion, Power User | Leave a Comment »

TCP/IP 40th Anniversary

Posted by jpluimers on 2014/05/11

One day late, but still: happy TCP/IP 40th Anniversary.

Posted in Communications Development, Development, Internet protocol suite, Power User, TCP | Leave a Comment »

Solution for HP LaserJet 4050 Can’t select Tray 1 in driver (via: Enterprise Business Community)

Posted by jpluimers on 2014/05/09

This happened to a client as well: the stock Windows Vista PCL5 driver for an IP-connected HP LaserJet 4050TN would not allow you to select a paper tray. Not for default settings, nor for printing preferences.

The solution: download the HP PCL6 driver for Windows Vista from HP LaserJet 4050 Printer series –  Download drivers and software .

Question:

LJ 4050n – Can’t select Tray 1 in driver

I have a 4050n connected to a small LAN, with 3 XP-Pro SP2 machines. These all print directly using standard TCP/IP ports. They were installed using the PCL5e driver downloaded from HP ( 4.27.4050.410 12 Dec 2003 ) This all basically works.

The only problem is I cannot select tray 1. The ‘paper source’ drop-down is greyed out at ‘auto select’. Printer always prints from tray 2 ( A4 Plain. )

Answer:

Try the PCL6 for a 4000TN, the printer still works if a 4050 has a 4000 driver loaded, had similar problems just used the 4000 driver.

–jeroen

via: HP Communities – LJ 4050n – Can’t select Tray 1 in driver – Enterprise Business Community.

Posted in HP Printer Drivers, Power User, Printer drivers, Windows, Windows Vista | Leave a Comment »

This is madness. University textbook at full price but without ownership (via: Jan Wildeboer – Google+)

Posted by jpluimers on 2014/05/08

Having to buy a book at full price, then having to return it when your semester is finished sounds so wrong on so many levels, even if you get DRM licenses access to the content:

one of the best quotes on DRM ever: But, as Professor James Grimmelmann noted, “we know from sad experience that gerbils have better life expectancy than DRM platforms.”

–jeroen

via: Jan Wildeboer – Google+ – This is madness. University textbook at full price but….

Posted in Opinions | Leave a Comment »

.NET uses banker’s rounding as default as it follows IEEE 754 (via: Stack Overflow)

Posted by jpluimers on 2014/05/08

It is almost 3 years that Ostemar wrote an interesting answer on Stack Overflow to the question

Why does .NET use banker’s rounding as default? – Stack Overflow.

Few people (even many programmers don’t!) know about rounding and how it can influence software, let alone what bankers rounding does so lets set a few things straight first.

Rounding matters. Depending on the kinds of software you write, it matters a little, or a lot.

For instance, in these categories, it can matter an awful lot:

  • Financial applications
  • Statistical applications

Bankers rounding means rounding half even. Which means that #.5 will round to the even number closest to #.

In bankers rounding, 1.5 rounds to 2, 3.5 to 4 as does 4.5, -1.5 rounds to -2, -3.5 to -4 as does -4.5.

This is called “unbiased” because for reasonable distributions of y values, the expected (average) value of the rounded numbers is the same as that of the original numbers.

This is contrary to what the majority of people are accustomed to: Round half away from zero is taught in most countries (even for the Dutch, despite the alias “Dutch Rounding” for round half to even).

Round half away from zero rounds 1.5 rounds to 2, 3.5 to 4 and 4.5 to 5. Negative numbers round like this: -1.5 rounds to -2, -3.5 to -4 as does -4.5 to -5.

This is only free of overall bias if the original numbers are positive or negative with equal probability.

In short, .NET uses bankers rounding because it follows the IEEE 754 rounding rules.

This was his answer: Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, .NET CF, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | 3 Comments »

Fix by Christian S. – Moers for “KB2686509 repeatedly fails with Error code 0x8007F0F4” (via: Microsoft Community)

Posted by jpluimers on 2014/05/07

Thanks Christian S. – Moers for the fix for KB2686509 repeatedly failing and the answer below.

I’ve used it as the Microsof FixIt offered at You may receive a “0x8007F0F4” error code when you try to install updates from the Windows Update Web site or from the Microsoft Update Web site did not work on several systems. The fix by Christian did work on all those systems.

Note: it is possible you get the same error for KB2676562: MS12-034: Description of the security update for Windows kernel-mode drivers: May 8, 2012, as it is related to KB2686509: MS12-034: Description of the security update for CVE-2012-0181 in Windows XP and Windows Server 2003: May 8, 2012.

One of the symptoms is that your system contains the file %windor%\faultykeyboard.log containing a list of  missing keyboard layout DLL files or KBD files (one of my machines had these missing: kbdjpn.dll and kbdkor.dll).

The cause is that KB2686509 can have problems with registry keys stored here:

  • HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout
  • HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts

Christian wrote a batch file to fix it (named BatchFixKB2686509.cmd) which works splendid on the systems I had this error.

The batch file uses regedit /e to export parts of the registry, then writes a small .reg file to clear the keys and imports them with regedit /S, waits for you so you can install the update, then writes back the saved registry data.
So basically, it automatically performs the manual steps described at KB2686509 – Failure Due to Upgrade from Windows ME or 98 to Windows XP – TechNet Articles – United States (English) – TechNet Wiki.

His answer: Read the rest of this entry »

Posted in Batch-Files, Development, Keyboards and Keyboard Shortcuts, Power User, Scripting, Software Development, Windows, Windows XP | Leave a Comment »

ongoing by Tim Bray · Fat JSON

Posted by jpluimers on 2014/05/06

Plan C: JWalk. No, not jaywalk.

Trimming JSON results from Java: ongoing by Tim Bray · Fat JSON.

–jeroen

Posted in Development, Java, Java Platform, JavaScript/ECMAScript, JSON, Scripting, Software Development, Web Development | Leave a Comment »

Handy Chrome extension that surfaces NavTiming, render… (via: Ilya Grigorik – Google+)

Posted by jpluimers on 2014/05/06

Convenient: Ilya Grigorik – Google+ – Handy Chrome extension that surfaces NavTiming, render….

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

Recommended reads when dealing with Character Encodings in software

Posted by jpluimers on 2014/05/06

Apart from the mandatory Joel on Software article about Unicode and Character sets, these two articles are of great value too:

Fun to read from that blog is the Historical Technology  section including this article:

–jeroen

PS: The mandatory one is The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) – Joel on Software.

 

Posted in .NET, Ansi, ASCII, CP437/OEM 437/PC-8, Delphi, Development, EBCDIC, Encoding, ISO-8859, ISO8859, Shift JIS, Software Development, Unicode, UTF-8, UTF8, Windows-1252 | Leave a Comment »