Soft-Dev
It is time to kick ass and chew bubblegum… but I’m all outta gum!
by admin on May.12, 2010, under Soft-Dev

It is human nature to take comfort in the fact that no matter what struggles you go through in life that there is always some poor miserable bastard that is worse off than you. It’s not a very nice sentiment, or something to be proud of; drawing comfort from others misfortunes, but whoever said human nature was a pure enlightened existence?
From a software development perspective I have always drawn comfort from 3D Realms and their ongoing development of the next installment of the Duke Nukem universe, aptly titled as ‘Duke Nukem Forever’, the title of which being the centerpiece for a great many jokes during the past 13 years of the games development.
I am not sure where or with whom the fate of the Duke Nukem franchise remains with, as the path seems to have cooled off after an official inquiry by the United States District Court over funds borrowed from third parties involved in the games development back in June 2009. From what I have read of the inquiry findings, the DNF team were very close to completing the game. Critics may argue that they were ‘very close’ a few years back too - from a software developer perspective, I can appreciate this and I have no doubt that 3D Realms were merely months away from the finishing posts. The trouble is, what can often happen during software development, and what has happened with a few of the projects I have been involved in, is that the finishing posts keep getting moved further back.
Like the developers of Duke Nukem Forever, I too have been merely months away from wrapping up a software project for the past few years.
It’s a scary thought, because I look at the software development to date, and the product has come so incredibly far since the first year of its development, very similar to 3D Realms efforts, and like the evidence would suggest from the various screen-shots taken from the Duke Nukem Forever project, my current software project of four years has never been so damn close to the finish line.
I just hope, unlike 3D Realms, the goal posts stop moving soon and that we finally win one for the home team.

Pixel me this
by admin on May.03, 2010, under Soft-Dev
If there’s one thing about the software development industry that will never cease to amaze me there is a solution for everything - you just need to stir deep enough in the pot.
In a rather embarrassing confession, one thing that always narked me about developing a product with no Microsoft Framework support is that I never managed to achieve the same level of quality when dealing with images.
For instance, coding in C, strictly adhering to Win32, no MFC or C++, to display an image, you first load the bitmap to a device context (DC) and then bitblt, or stretchblt (if you wanted to display it as a different size) to screen. Usually, more often than not, stretchblt would be used, as your display context would have zoom options etc, thereby requiring the image size to be adjustable. Now being mostly self taught - especially in the fundamentals of Win32 coding in C, i can vouch that a lot of the website resources available will stop at that point listed above, from a code perspective, what I described above looks as follows:
hDC = BeginPaint(hWnd, &Ps);
// Load the bitmap from the resource
bmpImage= LoadBitmap(hInst, MAKEINTRESOURCE(IDB_EXERCISING));
// Create a memory device compatible with the above DC variable
MemDC = CreateCompatibleDC(hDC);
// Select the new bitmap
SelectObject(MemDC, bmpImage);// Copy the bits from the memory DC into the current dc
StretchBlt(hDC, 10, 10, 450, 400, MemDC, 0, 0,800,790, SRCCOPY);// Restore the old bitmap
DeleteDC(MemDCExercising);
DeleteObject(bmpExercising);
EndPaint(hWnd, &Ps);
The result achieved at this point (is the image on the left seen above) full of scale artifacts, which of course, led to the frustration, since using higher level languages displayed the image perfectly. For a long time, I accepted this, after all, if there was a better way of doing it, online resources would surely say.
You can imagine the look on my face when I discovered a function call, as old as Stretchblt itself called ‘SetStretchBltMode’. Call this function just before the StretchBlt call and you go from a scale-artifact infested image to a crisp clear image, no matter what scale or distortion you apply.
SetStretchBltMode(Pd->Dc,HALFTONE);
StretchBlt(Pd->Dc, x, y, cx, cy, SrcDc, nXSrc, nYSrc, nSCx, nSCy, SRCCOPY);
More information available in MSDN Library
Visual Basic is the equivalent to Duplo in the Lego world.
by admin on Apr.30, 2010, under Personal, Philosophy, Soft-Dev
I feel privileged in the fact that I have a job that I both love and loath and challenges me on a daily basis. Metaphorically, I wear so many various hats throughout the day I would warrant my own hat stand. I am a marketing designer, project manager and first and foremost a software engineer, who spends better parts of the day inventing engineering feats that often come to mind during my morning slumber through peak hour traffic each day to work. Today was no different.
If I was to sacrifice all dignety that the title Software Engineer brings by using high-level development suites such as Visual Basic than this post wouldn’t exist, and the problems that I am challenged with on a daily basis would only be momentarily trivial, solved within moments with a frolic on Google. My daily work takes me to the depths of the Windows world, the world of the Win32 API using C/C++, a world that is now shrouded by fancy Frameworks and Foundation Classes.
Where Google may provide solutions a plenty for higher level programming delemas, when it comes to Win32 API in C, even the Microsoft MSDN library becomes vague with suggestions, and the majority of reliable documentation comes from software development books published back in 1995.
This does more often than not lead to frustration, and in fact is responsible for my embrace of the C# language; the simplicity of Visual Basic, but so much more powerful and integral than its Visual counterpart. No matter how voluptuous C# may seem at times, in a Software security sense, it doesn’t stand a chance against C, which is why no matter how tough times may seem, I power on in my dimly lit world.
When things go right, it is just as Hugh Jackman portrayed in Swordfish, and no, I am not referring to the scene where a hot blonde was going down on him whilst he was attempting to hack into the Military of Defense systems, rather the adrenaline rush you experience discovering you have solved a day or two long problem, doing a little victory dance to the beat of the music playing in the background and toasting your brilliance with a glass of wine or in my case tonight, Jack Daniels.
My day ended with the epifany: It is such hard work getting fancy results from a C application… I feel like I work in the boiler room of some steam ship, covered in Microsoft legacy crap, when all the squeaky framework apps like C# sit in first class with their tea and bickie!
To which a friend queried ‘Then where does Visual Basic stand?’
A smug grin formed across my face as I replied ‘in the form of the large duplo lego bricks that toddlers play with.’
Thought of the day:
by admin on Apr.30, 2010, under Soft-Dev
It is such hard work getting fancy results from a C application… I feel like I work in the boiler room of some steam ship, covered in Microsoft legacy crap, when all the squeaky framework apps like C# and C++ sit in first class with their tea and bickie!
Programming is 10% science, 20% ingenuity, and 70% getting the ingenuity to work with the science.
Filetype association in C#
by admin on Dec.10, 2009, under Soft-Dev
By night I keep myself occupied with travelling, seeing concerts or even sitting back with a bottle of Jacks philosophically reflecting on life. By day I am a software engineer, working for a R&D company developing software for driving rotary and laser engravers. I specialize in a wide variety of programming languages from the depths of the Windows API in C and C++ to the I don’t want to cause self harm way of C-Sharp (those who are familiar with both these lower and upper levels of programming will understand).
With each day innovatively programming and pushing through new barriers in my own programming experience, I like many others turn to the net in times of need, websites of the likes of msdn.microsoft.com/forums, codeproject.com and for more general terms Google.
Although some online research can easily span a great many hours, and possibly the occasional plea on a MSDN forum I feel compelled to give something back to the community, so Google bots, if you’re out there, please link this, it could save a great many people out there who want to ‘Associate filetypes programmatically for Windows 7, Vista and XP’. I couldn’t believe how difficult it was to find relevant information regarding this on the net, solutions not shrouded by DLLs, just a basic run of the mill C# solution that does what it says on the box. So here it goes:
This came about for the need to automatically associate files of a particular type in an installer I was developing for a software product. Here is the snippet related specifically to associating a filetype of your choosing.
|
private const int HWND_BROADCAST = 0xffff; [DllImport("user32.dll")]
public void CreateExtension(string ExtensionType) string AppType = ExtensionType + "_auto_file"; // ie abc_auto_file Registry.ClassesRoot.CreateSubKey("."+ExtensionType).SetValue("",AppType); Registry.CurrentUser.CreateSubKey(@"Software\Classes\."+ExtensionType).SetValue("",AppType); Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\."+ExtensionType).SetValue("",AppType); Registry.ClassesRoot.CreateSubKey(AppType+@"\shell\open\command").SetValue("","\""+InstallString+"\" \"%1\""); Registry.CurrentUser.CreateSubKey(@"Software\Classes\"+AppType+@"\shell\open\command").SetValue("","\""+InstallString+"\" \"%1\""); string UsersPath = ""; if (arinfo[keyid].Length > 12) // If the Key Name is over 12 Characters long } UsersPath = ""; if (arinfo[keyid].Length > 4) // If the Key Name is over 4 Characters long } // Refresh Registry
}
|
Life on Mars?
by admin on Feb.03, 2009, under Personal, Soft-Dev, The Road Ahead, Travel
Well here we are, what initially was to take only a day or two to transfer has ended up taking nearly a month and the job isn’t over yet; only about one quarter of entries have been transferred over thusfar.
So what have I been up to? Well, planning a trip to Russia for one, then greater Europe, resigning from my job, then not resigning, followed by putting off Europe for another year until the world economy sorts itself out. January has been a thrill of a ride to say the least, full of dreams of travel and adventure.
February so far has proven to be a far more mature month, with travel plans starting to take shape in the form of two international trips for 2009. September/October are still slated for the grand Russian adventure which came about through a girl I met a month or so earlier who also expressed interest in touring Russia, who coincidentally now is my gorgeous girlfriend.
Thinking back to that initial night I remember exactly what it was that first drew me to her; it was two things in fact, one being her incredible spirit of adventure, I found her passion for travel extremely alluring, the second was her gorgeous smile… I will never forget that night… anyway, I digress…
The second of the international trips planned is in fact slated first of the two. As of a week ago Michelle proposed a week and a half trip to Vietnam. Although only a week in its infancy the trip to ‘Nam’ is becoming seemingly realistic for May. Not only is Vietnam yet another amazing country that neither of us have yet had the pleasure of visiting but it will also prove to be rather insightful as to how well we travel together, a handy thing to know before investing a month into Russia later the same year. Though, through simple observation alone based on our desire to travel and explore I believe we will be great.
Of course all this travel needs to be financed, and although I have been purchasing a number of lotto tickets per week, currently I am still financing my life the old fashion way by pushing paper about, well, of the virtual kind at least. Work is going very well, and although working on a project for three and a bit years can be somewhat nerve wrecking at times, we are so close to the finish line it isn’t funny. Since the Visual Impact Image Expo in Sydney last year I have been busily fine tuning the software, creating printed media, cd covers and labels, help files and filming/editing videos for promotional DVDs. Currently half a dozen advanced beta’s (Preview Editions) of the program are in the field, the feedback has all been rather positive.
Just for a refreshing change I was approached by the Sales department of our parent company today to help with their new promotion for a product called Rowmark. Now I may only be a humble Software Engineer on paper, but I have made a point to lend my expertise in many other areas of the two companies I am associated with, including; project management roles, onsite customer service (not limited to software) and of course designing promotional media for our Sales department. So when Tom approached me today to share his ideas for the new campaign I was only all too thrilled to be a part of it. The theme for this year’s Romark launch: TopGear (yes, I am referring to the BBC Series TopGear). From what was loosely discussed the motto would go something along the lines of want top gear for your signage applications, look no further than Rowmark… or something along those lines, anyway, it’s a play-on-words thing using ‘Topgear’ as a keyword the design is to reference indirectly the infamous BBC series. I look forward to getting those creative juices going again; it can make the perfect break from mind numbing computer code.
Tonight was the first time I watched a complete episode of NCIS (well, I watched most of it), I really enjoyed what I saw of it. I am not completely sure just how much of the DNA research conducted in the episode was fictional; regardless though I found it quite fascinating that so much can be learnt from an individual based on a hair sample. By the end of it, the scientist was deducing the diet and what type of water the subject was drinking - most impressive stuff.
Anyway, I am going to cut my rambling here. Usually my posts are more subjective and particular than this but I have been meaning to make this ‘first’ entry for a while now, and well, 1.18am seemed like a great time to do just that.