Archive for December 2008

Ubuntu 8.10 Intrepid Ibex on IBM Thinkpad R30: Screen Resolution Problem (1024x768)

2008-12-21 by Administrator, tagged as linux

I just got my old IBM Thinkpad R30 back and I thought installing Ubuntu on it could be useful. So I downloaded the Desktop Edition Live-Install-CD thing and booted into the live system.
Disappointedly I discovered that the latest Ubuntu seems to have problems configuring the right resolution. The system would only let me choose 800×600 as a maximum but the display is capable of 1024×768. So I started searching the web and found descriptions of a bug. Still, all this seemed a little overdosed to me and searching around a little more I found another thread where a guy describes the problem of Xorg detecting the right display refresh rates.
So I figured out that I wouldn’t need all this xorg.conf stuff except the refresh rates and changed my original xorg.conf to look like this:

Section "Device"
	Identifier	"Configured Video Device"
EndSection

Section "Monitor"
	Identifier	"Configured Monitor"
	Option		"DPMS"
	HorizSync	28-49
	VertRefresh	43-72
EndSection

Section "Screen"
	Identifier	"Default Screen"
	Monitor		"Configured Monitor"
	Device		"Configured Video Device"
EndSection

The only lines I added are bold. And after I restarted X with [CTRL][ALT][DEL] I got the wanted resolution. Btw it is a Trident graphics chip but /var/log/Xorg.0.log showed that it is detected just fine.

T-SQL Simple Timestamp With Leading Zeros

2008-12-04 by Administrator, tagged as microsoft, programming

I just had to create a simple string in MS T-SQL that would look like the following:

200812041613
or
yyyymmddhhmm

I solved it this way but I have no idea if this is a good solution (comments welcome):

DECLARE @timestamp AS varchar(12)
-- Create Timestamp with leading zeros
-- Year
SET @timestamp = CONVERT( varchar(4), DATEPART(year, GETDATE() ) )
-- Month
IF DATEPART( month, GETDATE() ) < 10
	SET @timestamp = @timestamp + '0' + CONVERT( varchar, DATEPART( month, GETDATE() ) )
ELSE
	SET @timestamp = @timestamp + CONVERT(varchar(2), DATEPART( month, GETDATE() ) )
-- Day
IF DATEPART( day, GETDATE() ) < 10
	SET @timestamp = @timestamp + '0' + CONVERT(varchar, DATEPART( day, GETDATE() ) )
ELSE
	SET @timestamp = @timestamp + CONVERT(varchar(2), DATEPART( day, GETDATE() ) )
-- Hour
IF DATEPART( hour, GETDATE() ) < 10
	SET @timestamp = @timestamp + '0' + CONVERT(varchar, DATEPART( hour, GETDATE() ) )
ELSE
	SET @timestamp = @timestamp + CONVERT(varchar(2), DATEPART( hour, GETDATE() ) )
-- Minute
IF DATEPART( minute, GETDATE() ) < 10
	SET @timestamp = @timestamp + '0' + CONVERT(varchar, DATEPART( minute, GETDATE() ) )
ELSE
	SET @timestamp = @timestamp + CONVERT(varchar(2), DATEPART( minute, GETDATE() ) )
-- Done creating timestamp
print N'' + @timestamp