Archive for May 2007

Three amazing visualization projects


Found by accident – as usually – while searching for something completely different.

Visuwords – visual dictionary, showing semantic relations between words.

Universe by Jonathan Harris.

Wikisky – detailed online sky map, showing the positions & basic characteristics of space objects using a Google Maps like interface.

And two great videos: the 4 minutes video summary on what Web2 actually means and very funny presentation about PowerPoint presentations.


Unified ID's for legacy database


I found a handy T-SQL trick that helped to solve the following problem: during datawarehouse creation, we needed to consolidate multiple data sources from databases belonging to two generations of system: older one using int identity keys, the newer one, designed for replication and distributed data scenarios using GUID’s as primary keys.

In the consolidated database, we needed to create single representation that would allow to store both new GUID based identities as well as old int-based keys. Direct conversion between UNIQUEIDENTIFIER type and int is not allowed. The following one liner will do the trick:


The “fake GUID’s” it creates from integers are easy to identify as they have leading zeros. If you for any reason do not like it, replace the 0 in first convert with any suitable number.

Using Wiki markup without a Wiki


Even with having Wiki as the main documentation repository, not all documentation ends up in a Wiki. Some documentation needs to be managed as part of the source tree – e.g. Readme’s, compilation instructions and similar. This information is usually either plain text or in some form of text processor format, mostly Microsoft Word compatible. Both have their selection of problems. Word documents are large, bloated, harder to version controlled and not readable in shell environment (try to cat or tail Word document :-)). The plain text format lacks visual structure and without headlines, bold/italic, font sizes etc is harder read.

Some projects I was working on were trying to use HTML as documentation format – but it was too hard to edit using “programmers editors” … and HTML generated by MS-Word is not much better than binary format from readability and version management perspectives.

One format that works amazingly well is a plain text with Wiki markup structure. There is wide selection of various markups, the one I like the best is the Textile markup (which is implemented by many Wiki systems, including Confluence). Textile is very easy to remember, us natural to read and gives the document enough structure without being in the way. Using Textile as “source markup” allows us to copy and paste the document content directly to the Wiki, should it be required. Textile can be also very easily transformed to full fledged HTML using libraries available for all languages of interest (in my case – C#, Java, Python, Ruby – and hopefully will find something for Objective-C as well) to convert it to HTML.

The best feature of using Textile is that some editors – namely TextMate on Mac – support Textile natively and show headings and font attributes properly even without pre-processing step. And with Preview function even generate HTML right away. The similar can be done using plugin in JEdit as well as in Notepad++ with this syntax file.

More programming quotes


“If it works, leave it alone — there’s no need to understand it.
If it fails, try to fix it — there’s no time to understand it.”

“A one-question geek test. If you get the joke, you’re a geek:
Seen on a California license plate on a VW Beetle: ‘FEATURE‘…”
— Joshua D. Wachs, Natural Intelligence Inc.

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” — Martin Golding.

“The only problem with troubleshooting is that sometimes trouble shoots back.”

“Who is this general ‘Failure‘ and why is he reading my disk ?”

“If Python is executable pseudocode, then perl is executable line noise.”

“The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.”

“C++: Hard to learn and built to stay that way.”

“I invented the term ‘Object-Oriented‘, and I can tell you I did not have C++ in mind.”
— Alan Kay, creator of Smalltalk

“There are two major products that come out of Berkeley: LSD and UNIX. We don’t believe this to be a coincidence.” — Jeremy S. Anderson.

“It is easier to port a shell than a shell script.” — Larry Wall.

“Unix is user-friendly. It’s just very selective about who its friends are.”

“The number of the beast — vi vi vi.”

Software and cathedrals are much the same – first we build them, then we pray.

If a million monkeys were typing on computers, one of them will eventually write a Java program. The rest of them will write Perl programs.

The camel has evolved to be relatively self-sufficient. On the other hand, the camel has not evolved to smell good. Neither has Perl.  — Larry Wall

PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil, perpetrated by skilled but perverted professionals.

It’s not at all important to get it right the first time. It’s vitally important to get it right the last time.
Andrew Hunt and David Thomas

Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. Laurence J. Peter

New kid on the block in race to be Flash killer


After Adobe’s Apollo and Microsoft’s Silverlight, Sun has addes own version of scriptable, interactive platform named JavaFX. Unlike the previous three (Flash included), this is going to be Open Sourced – under the Microsoft’s most hated license – GPL.

Now the race to replace Flash  really becomes  really interesting …

Differences between Visual Studio and SSMS


I am working on the BI modules for automotive data-analytics application these days. Which means that I am doing quite a bit coding and using T-SQL and in addition to Visual Studio 2005, I use quite often the Sql Server Management Studio for SQL Server 2005. In theory, both tools should be based on the Visual Studio IDE code base. Which is maybe true, but there are many quite annoying differences.

Some of the differences is available featureset. I wish there was single tool that had all the database features of both: strong scripting capabilities of SSMS and much better development support with debugging in VS-2005. One can understand that the tools were meant to serve different audiences, but why not make the SSMS a lightweight, trimmed down version of VS2005 targeting database and OLAP projects only ?

Some differences are really annoying though. One discovered today is related to GUID’s. Take the code sequence

Declare @MyGuid uniqueidentifier
set @MyGuid = NEWID()
select 'aaaaa', @MyGuid

You would expect that the result will be one row, consisting of value ‘aaaaa’ and some GUID, right ? Wrong. It is true only in SSMS as the picture shows:

SQL Server Management Studio

In Visual Studio 2005 SP1, the result looks like this:

Visual Studio without conversion

which on one side announces 1 row in resultset, but does show the same result as if the resultset was empty. As we found out, the problem is related to displaying the GUID value – if your resultset does not contain it, the row will show OK. Same result can be achieved using explicit conversion, as shown in the picture:

Visual Studio with conversion

Rails' ideas everywhere


Since I got through “Rails immersion”, I keep seeing the implementations of the same idea everywhere. Latest find is Subsonic, which implements Active Records in .NET space. Rather than writing more, see this screencast.