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 2014

On “Bad Habits to Kick : Using AS instead of = for column aliases” (via: Aaron Bertrand)

Posted by jpluimers on 2014/01/22

A while ago, I came across an interesting post Bad Habits to Kick : Using AS instead of = for column aliases by Aaron Bertrand, a major contributor on SQLblog.com – The SQL Server blog spot on the web.

The last link indicates my problem with this “AS” versus “=”: it is SQL Server specific.

So, if you mainly use SQL Server, then it is OK (or even preferable) to use “=” for aliasing columns in human written SQL as it makes spotting the names used much easier. Read the rest of this entry »

Posted in Access, Database Development, DB2, Development, Firebird, InterBase, MySQL, OracleDB, Paradox, PostgreSQL, SQL, SQL Server, Sybase | Leave a Comment »

Faking num lock, caps lock and scroll lock leds – About My Code

Posted by jpluimers on 2014/01/21

I remember doing this in DOS ages ago (in the Turbo Pascal 5 era) for exactly the same reason: flash the keyboard LEDs to indicate some event was happening, but I’ve yet to find back the source code.

Here is how to do it in Windows using either C# or C: Faking num lock, caps lock and scroll lock leds – About My Code.

–jeroen

via: c# – Way to turn on keyboard’s caps-lock light without actually turning on caps-lock? – Stack Overflow.

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, Development, Pascal, Software Development, Turbo Pascal | Leave a Comment »

How to identify MacBook models (regular, Air, Retina)

Posted by jpluimers on 2014/01/20

For finding the ModelId of your MacBook, in case you want to buy an OWC SSD upgrade:

–jeroen

Posted in Apple, Mac, MacBook, MacBook-Air, MacBook-Pro, Power User | Leave a Comment »

Google 2 factor authorization: “The code you entered didn’t verify. Learn more Tip: codes are time-dependent…”

Posted by jpluimers on 2014/01/18

Not sure what went wrong, but I could not use 2 factor authentication, but somehow the codes generated by the Google Authenticator didn’t work at all. When entering the codes, I got this message:

“The code you entered didn’t verify. Learn more Tip: codes are time-dependent. Make sure your phone is set to the correct local time.”

Of course both devices were having the same time, were in the same time zone, etc.

The “codes are time-dependent” – Google Search got me on the right track.

The fix was the second steps from this article (I updated the steps as some of the UI changed): Read the rest of this entry »

Posted in Google, GoogleAuthenticator, Power User | Tagged: , , | Leave a Comment »

SoftPerfect Network Scanner: fast and free network scanner

Posted by jpluimers on 2014/01/17

On my list of things to try: SoftPerfect Network Scanner: fast and free network scanner.

–jeroen

Posted in Network-and-equipment, Power User | Leave a Comment »

Word 2007/2010/2013: Enabling the Word Developer Tab on the ribbon (via: Andrew Coates ::: MSFT – Site Home – MSDN Blogs)

Posted by jpluimers on 2014/01/16

This is one of the things I tend to forget, as you do it once per machine, and the place to do it is not logical to me.

I mainly use it to quickly record a Macro (boy, I wish Office had a TemporaryMacro feature like Visual Studio had. Alas no more: Macro Recording/Playback has been removed in Visual Studio 2012).

The logical place for me would be to have a context-menu on the ribbon where you can enable the Developer tab.

Anyway, this is how to enable the Developer tab in Word 2007/2010/2013: Read the rest of this entry »

Posted in Development, Office, Office 2007, Office 2010, Office 2013, Power User, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, Word | Leave a Comment »

.NET/C#: you cannot do string? because Nullable is for value type, and string is a reference type

Posted by jpluimers on 2014/01/15

At clients, I see quite a few people being confused by this compiler error message:

Error 1 The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'System.Nullable'

One of the reasons about the confusion is that a string variable behaves like a value type, but in fact is a reference type because their values can consume a huge amount of memory (thanks User codekaizen).

A few interesting questions on that on StackOverflow:

Anyway, back to the error message above.

Lots of people are confused by it, just see a few questions on StackOverflow: Read the rest of this entry »

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, Development, Jon Skeet, Software Development | Leave a Comment »

Reminder: find out which Windows 7 drivers work for ScanSnap S510 from Fujitsu

Posted by jpluimers on 2014/01/14

One of the few Windows XP machines left is main usage is for the Fujitsu ScanSnap S510 scanner that I have been using for years: it is small, does duplex scanning, emits searchable PDFs through an embedded Adobe Acrobat and Abby ScanSnap Edition OCR license. The Scan button on the scanner “just works” and allows for a “Scan Now, organize later” workflow.

Just Works: if a user is logged in on the Windows machine, which usually is the case.

Next to that, it is used for internet browsing and remote desktop access to VMs in the various clouds: it is more than adequate for that with dual Dell UltraSharp U2407WFP monitors at 1920×1200. The extra 120 pixels over “modern” 1080p do make a difference you know.

I never bothered to upgrade the machine, as it works so nicely and I have had bad experience replacing systems that include embedded licenses: it usually doesn’t work.

Of course I could buy a new ScanSnap iX500, but I don’t want to increase the electronic waste unless I’ve researched if it is possible to get the ScanSnap S510 working on Windows 7 or 8.x, or even on one of my Macs.

So here are some links for further research on a light-weight solution: Read the rest of this entry »

Posted in Apple, Fujitsu ScanSnap, Hardware, ix500, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scanners, Windows, Windows 7, Windows 8 | 1 Comment »

SQL Server: strange way of getting query statistics.

Posted by jpluimers on 2014/01/14

Last year, I had a very odd project at a client.

Their monitoring software was quite odd, and there was no time to create/test/implement a module for it doing SQL query performance measurement any better.

The odd software had two ways of looking at queries:

  • in a succeed/fail fashion
  • in a count(*) fashion

Don’t ask why it was that way, the monitor was hysterically grown.

So below is a small query script that does what the odd monitoring software can do: provide a select with rows indicating the query response time.

What is does is insert into the #sma temporary table a number of records depending on the query duration.
The partition here is 1 record per 125 milliseconds, aiming for four partitions (green, yellow, orange, red) in half a second.

Note the maximum accuracy is about 3.3 milliseconds.

The script is based on these SQL server features:

I might add a try/catch to fake a finally in case the #sma insert fails. Read the rest of this entry »

Posted in Database Development, Development, SQL Server, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012 | Leave a Comment »

Steps for shrinking a vmware disk for a Windows guest VM inside VMware Workstation of VMware Fusion

Posted by jpluimers on 2014/01/13

Another one from the “missed schedule” series, this one was originally scheduled for 20130927.

These articles were not very clear on the actual steps to take:

The steps I tried: Read the rest of this entry »

Posted in Fusion, Power User, VMware, VMware Workstation, Windows, Windows 7, Windows 8 | Leave a Comment »