Software Development

What To Do With Old PC(s) ?

I’ve got a few Pentium 2 and Pentium 3 pc lying around, most have broken hard drive or blown up power supply. So what to do with them? I figure I can use them as “server” machine for my own casual development team (yes, code-for-fun :) . I brought a couple of new hard drive and a couple of power supply unit, total up to about RM500. This new hardware parts allow me to setup two P3 500 machine with 128MB RAM each (harvested from other dead PCs) and 160GB HDD space.

I’ve setup minimal CentOS installation on both machine, and then mediawiki + subversion + Track+ on 1 machine (god I love subversion), and samba server (primary for backup purposes) on another machine. The total disk space usage after the installation was about 400MB.

Although with the low hardware specs, this configuration seems to work for me and my team of 6 guys, regularly committing/editing/creating project development artifacts. Perhaps I’ll increase the RAM available on the machine with mediawiki when I manage to get some old RAM out from somewhere, since it does seems to go high on memory usage, especially upload of big files …etc…

This setup give us a minimal platform for project development collaboration, but ultimately, I would really love to see a full implementation of Microsoft Visual Team Suite… ^_^ (but of course it wont be a P3 with 128MB RAM, more like a multi processor server with GBs of RAMs… hm… need more $$$ )

True Type Font for Source Editing in VC6

I’ve been using Consolas true type font in VS2005 for a while now, and recently looking back at some legacy (but still profitable) project that is using VC6, the Courier New font type suddenly become so alienated that I wanted to change it to Consolas immediately.

To my surprise the Consolas font set is not being listed as a font that can be use under the Format tab, so I did a registry edit in the following location and hope that it work, and viola! It actually works : )

[code]HKEY_CURRENT_USER\
+ Software\Microsoft\
+ DevStudio\
+ 6.0\
+ Format\
+ Source Window\
+ FontFace="Consolas"[/code]

To Roman! C# Int to Roman Converter

Yeah… Had to convert an based 10 integer to roman representation, since .NET framework yet to have this included, I’ve translate the following from delphi knowledge base article. Works for me, and hope that it works for you too.

[code]public static string ToRoman( int _n )
{
if( _n <= 0 ) return "";

int [] Nums = { 1 , 4 , 5 , 9 , 10 , 40 ,
50, 90 , 100, 400, 500, 900, 1000};
string [] RomanNums = {"i", "iv", "v", "ix", "x", "xl",
"l", "xc", "c", "cd", "d", "cm", "m"};

string sRtn=""; int n = _n;
for(int i=Nums.Length-1; i>=0; --i)
{
while( n >= Nums[i] )
{
n-=Nums[i];
sRtn+=RomanNums[i];
}
}
return sRtn;
}[/code]

Magic of MS Access!

I’ve been on MS SQL, MySQL, Oracle for so long now… and today I’ve been ask to go through a legacy app to see if any of th code can be salvage (yeah right… my management think we’re running a scrap yard)…

And… ta-da ~ ~ ~ I found an interesting line:
[code]

INSERT INTO tblTmp
SELECT * FROM C:\Folder\Data\2006.mdb.tblFAX
WHERE (flag=1)

[/code]
Pay attention to the “C:\Folder\Data\2006.mdb.tblFAX”… Wow… I din’t even know such thing actually exist… @_@

Ini File Handler for C#

ini file is still my favorite config file to store settings and stuff… Although the big hoo-haa of XML and native support of XML reader for .NET, it’s still not as apealing to me, well… maybe my need just had not arrise yet…

Since I’m lazy to write my own wrapper around the ini file handling functions, and I don’t need the extra supports that NINI provides, I tried a couple of others, not so good because the behavior overite everyting in the existing ini file everytime you save, finally I’ve settle with IniReader from mentalis.org, of course that was after I change the name to IniHandler, and the name space to Util.IniHandler.