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 November, 2011

SQL Server 2000: export SQL Query Analyzer result data to Excel/CSV and more

Posted by jpluimers on 2011/11/16

I just visited a client which is still using SQL Server 2000, and not upgraded their tool set, nor allows different tools to be installed.

Which means back to basics, re-adjusting the project planning and frantically trying to remember things from the past.

Boy am I spoiled with a current toolset :)

This goes from simple things like saving a result set from the SQL Query Analyzer:

  1. Select a cell
  2. Press Ctrl-A to select all rows
  3. Right click in the grid and select “Copy” (to copy the cells as CSV) or “Save As” (to export the cells as CSV)

along the absence of support for XML, MARS, error handling (not even talking about spatial data!) to the way that in SQL Server 2000 DTS (Data Transformation Services) has its own mind of date/time format handing while importing stuff.

But it sure helps setting aims for the scheduled migration process to the far more current SQL Server 2008 R2 :)
(Mental note: migrating the SQL Server 2000 DTS packages to SQL Server 2008 R2 will be a challange).

Oh, some of the SQL Queries that come in handy when moving stuff around in an OTAP/DTAP environment:

1. Selecting relevant DTS packages (that are always in the MSDB database)

select
name
from msdb..sysdtspackages -- 2005: sysdtspackages90; 2008: sysssispackages
where
name like '%my-app-ID%'

2. Selecting relevant objects from a database (watch the xtype values that can exist in SQL Server 2000)

using my-database
select 
name, xtype
from 
sysobjects
where 
name like '%my-app-id%'
and xtype in ('U', 'V', 'TR', 'P', 'X') -- tables/views/triggers/procedures/xprocedures only
order by xtype, name

Blast from the past :)

–jeroen

via: export sql query analyzer data to excel SQL Server.

PS: For the statistics, SQL Server 2000 has been EOL for a while; mainstream support ended in 2008, extended support ends in 2013.

Posted in CSV, Database Development, Development, Software Development, SQL, SQL Server, SQL Server 2000 | Leave a Comment »

I was baffled…

Posted by jpluimers on 2011/11/15

When I saw code like this in a production app, I was speachless:

			if (matcher.Trim().Length > 0)
			{
				if (eesteWhere){sqlWhere += "WHERE ";eesteWhere = false;}
				else{sqlWhere += "AND ";}
				sqlWhere += "m.matcher like '" + matcher.Trim() + "%' ";
			}

Not once, twice, but hundred of fragments like these. Not generated, but hand copy-pasted. And the client thought they were running stable, reliable apps :(

This is soo XSCD ‘Exploits of a Mom‘ (aka Bobby Tables):

The department that wrote the code has been closed a while ago, but some serious refactoring time needs to be invested here, as all applications delivered by that department are vulnerable to SQL Exploits.

–jeroen

Posted in .NET, C#, C# 2.0, Database Development, Development, Software Development, SQL, SQL Server | Leave a Comment »

About to embark on the Akademik Sergey Vavilov in Ushuaia, Argentina for our antarctic adventure!

Posted by jpluimers on 2011/11/14

About to embark on the Akademik Sergey Vavilov in Ushuaia, Argentina for our antarctic adventure!

A great ship, still actively used for research purposes. We’re really looking forward to what we are going to see and do!

--jeroen

Posted in About, Antarctic, Personal, Travel | 1 Comment »

VMware fusion on MacBook Air with OS X Lion seems to hang when getting back from sleep – Super User

Posted by jpluimers on 2011/11/14

If you have reactions on the question below, please add them to the SuperUser.com thread when possible.

Every once in a while, my MacBook Air becomes unresponsive when it is sleeping and I open the lid.

It seems to only happen in these circumstances:

  • the MacBook air got into sleep modus because of closing the lid
  • VMware Fusion 4 (4.0.2 build 491587) is running full screen
  • The guest OS has a blank screen screen saver

When opening the lid, the backlight goes on, but the MacBook Air does not react on any key-combinations I tried.

I tried these, but to no avail:

  • press the Touchpad
  • press Control + Command
  • press Control + Command + Enter
  • press Command + Tab

The only thing that works is to press the Power button for 5+ seconds (forcing a hard power off) then reboot.

Two questions:

  • For anyone having seen similar bahviour: what circumstances did you have?
  • Any solution to this apart from first suspending the guest VM?

–jeroen

via: VMware fusion on MacBook Air with OS X Lion seems to hang when getting back from sleep – Super User.

Posted in Apple, Fusion, Mac OS X 10.7 Lion, MacBook, MacBook-Air, Power User, VMware | 2 Comments »

Not so convenient: after XP there is no more WebCam viewer in Windows (via: How can I take a picture with my webcam in Windows 7? – Super User)

Posted by jpluimers on 2011/11/14

Microsoft removed the WebCam viewer from Windows on all versions released after XP.
Very inconvenient, as it was very light weight, and most webcam software isn’t.

William describes in his answer to How can I take a picture with my webcam in Windows 7?, there is a small AMcap sample in the Microsoft DirectX SDK that works very well.
He also points to 2 download locations where you can get the compiled version (the SDK only has the source code).

–jeroen

Via: How can I take a picture with my webcam in Windows 7? – Super User, there is a

Posted in Power User, Windows, Windows 7, Windows Vista | Leave a Comment »

Handy when having Mac test VMs: How to rename your Mac? – MacRumors Forums

Posted by jpluimers on 2011/11/11

Having written how to run Mac OS X Lion in a VM, it is handy how to know to rename your Mac: networks don’t like having multiple machines with the same name :)

It is easy:

  1. Apple icon
  2. System Preferences
  3. Sharing
  4. Computer Name
  5. Change
  6. Done

–jeroen

Via: How to rename your Mac? – MacRumors Forums.

Posted in Apple, Power User | Leave a Comment »

Deep Object Comparison Delphi – Stack Overflow

Posted by jpluimers on 2011/11/10

Last week there was an interesting question on Deep Object Comparison Delphi at Stack Overflow.

Two nice answers:

  1. Recursive new style RTTI based solution (comparing all data)
  2. Streaming using OmniXML and comparing the output (comparing only the relevant data)

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Allocating 4Gb+ of memory in x64 using Delphi XE2 Update 2: Unofficial fix for QC#100726 …

Posted by jpluimers on 2011/11/09

If you are creating x64 applications using Delphi XE2, have Update 2 installed, and are (potentially) allocating more than 4Gb of memory (QC report 100726), then you need the Unofficial fix for QC#100726, or use the latest version of FastMM (see below).

If you use Delphi XE2 (original release) or Update 1, then you don’t have problems in this scenario.

Thanks to FastMM author Pierre le Riche for providing this fix so quickly.

Note that the latest 4.x release of FastMM is now FastMM 4.99 and contains the same fix.

–jeroen

Via: Embarcadero Discussion Forums: Unofficial fix for QC#100726 ….

Posted in Delphi, Development, Mobile Development, Software Development | 4 Comments »

c# – Panel.Dock Fill ignoring other Panel.Dock setting – Stack Overflow

Posted by jpluimers on 2011/11/08

Every once in a a while I do WinForms development. On the .NET platform it still is the best way to create simple business applications that just, well: work.

WinForms apps are not fancy, but the actual users don’t care much, as long as they can their daily work done. They love fanciness of their mobile devices, but for stuff they use 8 hours a day, they just want something that works quickly, well and easily. So WinForms for a baseline is good.

WinForms historically has had two ways of automatically: Anchors and Dock (.NET 2 introduced another way using FlowLayoutPanel and TableLayoutPanel, but often they make things more complicated than needed).

One of the pitfalls of Docking is when you set Dock to Fill. Sometimes the affected control will be too large.
Every time that happens, I am baffled, as .NET is the only platform with that behaviour; I use other platforms too, and they don’t have this docking peculiarity (of course the have others, that’s the fun of using multiple platforms <g>).

The solution is simple:

  1. Right click on the control that misbehaves
  2. Choose “Bring to Front”
Done :)

–jeroen

Via: c# – Panel.Dock Fill ignoring other Panel.Dock setting – Stack Overflow.

Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Development, Software Development, VB.NET, WinForms | 2 Comments »

About Gmail’s new look: a few comments

Posted by jpluimers on 2011/11/07

Not sure I really like the “all new” black and white look where all of the screen looks the same, so no emphasis on the things that really matter.

Over time, you won’t be able so switch back, so you have to adapt to the new look & feel, and try the options to make it work for you the best.

So far, I switched to the “Compacrt” view, and chose the “Blue” theme to make emphasis on the mail list/content.

–jeroen

About Gmail’s new look.

Posted in GMail, Google, LifeHacker, Power User | Leave a Comment »