woensdag 31 januari 2007

Meet My Mom

In the past few weeks, I've been making some portraits. Some of them in a studio, others 'on location'.
I will post some of the results here and I'll start with a portrait of my mother.

These photographs are shot in her 'study room'; my mom loves painting and calligraphy (she's pretty good at it) and I wanted to express this in my photographs.

high iso portrait creative mother
Just a pity that she's holding the pen a little bit to high

high iso portrait creative mother2

The photos have been taken with ambient light (I don't like to use flash for location-portraits). I've used a Nikon D200 with a 50mm f/1.8 lens mounted on it. Since there was not too much light available, I've choosen a small aparture number and a high ISO setting. (The EXIF information is available in the picture; you can easily view it using Opanda IEXIF Viewer"). Despite the high ISO setting, I've to admit that I'm pleasantly surprised with the noise levels in these photo's.

zaterdag 20 januari 2007

Lambda expressions in .NET

In C# 3.0, there will be a new feature available: lambda expressions. This new feature was necessary to create the LINQ feature, which will also be introduced in C# 3.0

Today, I came across an interesting article written by Howard Dierking in where he explains what lambda expressions are, and how you can use them.
Very nice and clear article.


Seems that I've been tagged by Mike Nichols, so I'm supposed to come up with 5 things you don't know about me; here goes:

  • I've started playing music when I was about 8 or 9 years old. I've played guitar until I was about 16 years old. At that age, I stopped playing music. I didn't wan't to do it anymore. I was supposed to go to music classes each wednesday afternoon, and each saterday morning and I wanted to do other things during that time. :) Sometimes, I regret it though that I didn't continue with that guitar-thing. (I still have my guitar though, and maybe I'll pick it up again in the future)

  • I don't like cheese.
    Well, that's not completely true; I don't eat cheese 'as is', but I do like food that has cheese as an ingredient (pizza, croque monsieur, tiramissu, heck I even like cheese-burgers). I also like Cheetos. Weird huh?

  • I started programming relatively late. I was 17 years old when I wrote my first computer program.

  • I always wanted to become a pilot. Not on airliners, but a jet pilot. :) At age 16, I've sent a letter to the Belgian Air Force to enquire for more information about this. A few days later, I've received an information bundle about it. Unfortunately, I never took part in any of the 'promotions' of the Belgian Air Force. Maybe I was already realistic about my chances: there are only very few positions (about 4 each year) and numerous candidates.
    I haven't lost my interest in jets though; I still like to visit air-shows (although since a plane crashed at the Ostend Airshow in 1997, air-shows in Belgium aren't what they used to be...).
    If I would ever have the chance to be a passenger in a two-seater, I'd certainly do it!

  • I do like karting. Until a few years ago, I used to do it at least once a week. Unfortunately, I'm not able to keep up that frequency right now. I'm already happy if I can go karting once a month.
    I also dream of driving an open-wheel formula race car once (Formula One, Formula Ford, F3000, ... whatever

The 5 persons I'm tagging are: PJ van de Sande, Peter Veentjer, Jelle-Jan Van Veelen, Valentijn and Evan Hoff

woensdag 10 januari 2007

Left- and RightPadding in SQL Server

Although SQL Server contains a few string manipulation functions, there exists no function that allows you to left- or rightpad a string expression.
This is a bit of a pity, since left- and rightpadding is sometimes necessary.

But, no one stops you from creating your own LPAD and RPAD function offcourse; in fact, it is rather very simple. :)
Although SQL Server doesn't provide padding methods out of the box, it doesn't require a lot of work to pad a string.

For instance: suppose you have a variable @number, which contains a number. If you need to leftpad this string with zeroes so that it always contains 8 characters, you simply have to do this:

SELECT RIGHT ('00000000' + @number, 8)

If @number contains '81337', this statement will return '00081337'.

With this knowledge, it is pretty simple to create your own LPAD method. This is the code:

CREATE FUNCTION [dbo].[LPAD] (@string VARCHAR(8000), 
@length INT,
@paddingChar CHAR(1))
RETURN RIGHT (REPLICATE (@paddingChar, @length) + @string, @length)

Creating an RPAD function is very similar:

CREATE FUNCTION [dbo].[RPAD] (@string VARCHAR(8000),
@length INT,
@paddingChar CHAR(1))
RETURN LEFT (@string + REPLICATE (@paddingChar, @length), @length)

As you might have noticed, REPLICATE is a SQL Server function which repeats a specified characters a number of times. :)