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.
Second star to the right, and straight on ‘til morning
by admin on Apr.08, 2010, under Personal
Well its now 12.49am, having just arrived home from a very long overdue boys night in consisting of pizza, beer and B-grade flicks of a particular genre; the film title ‘ Lesbian Vampire Killers’ pretty much says it all – a blokes night in just isn’t the same without hot scantily dressed vampire babes wreaking havoc in some remote English hamlet. Stumbling through the darkness as I made my way for the side gate I was distracted by the intense display of stellar phenomena above. I paused, letting out a sigh, one of both awe and disappointment; the light pollution of Perth had conditioned me. I could quite easily spend countless hours lost in thought just looking up into the night sky. Until this moment, I had forgotten how much I missed the country night sky.
While Michelle is off exploring the oriental culture of Hong Kong, I escaped the city to spend some much overdue quality time with my family, and also to get in touch with my inner child in the form of late nights of booze, tv and computer gaming.
This past week I have reconnected with my inner gaming self, having re-played through the entire Command and Conquer Red Alert 3 Campagin, mostly between the hours of 11pm and 5am. There was something so right about sitting in the theatre room with a bottle of Jacks, taking to the battlefield, obliterating Soviet and Empire of the Rising Sun forces with the leadership of the Allied Blonde-Bombshell Commander Lt Eva McKenna all splayed on 50 inches of high-definition plasma goodness.

Rather than expressing my creativity through software development, for yes, even whilst on leave I am guilty of dabbling, I instead composed and sent off for printing to AlbumWorks a photo album of my previous trip around the world, aptly titled ‘Long Way to Russia’. The ever quick Melbourne based printing group had the 50 page album completed and flown over with a week. Overall I am really impressed with the end result, and after a few grammatical corrections and one or two photo adjustments I am now ready to do a re-print. The album itself started as more of a photo expo-say of the trip, with a few sentences here and there. The further I got into the trip the sentences became paragraph exerts from my travel blog, the end result being half travel blog, half album. Although the end result is fantastic, I am now contemplating a new print with my complete travel blog. Perhaps I should then make one for Vietnam too?
I am so looking forward to Germany next year; exploration runs in my blood.
Time capsule
by admin on Jan.12, 2010, under Philosophy
The end is nigh. No I am not about to start preaching of revelations and the second coming, for the truth of the matter is we probably won’t last that long. We are quickly accelerating into a world where we attempt to destroy atoms by colliding them against one another just to see what lays beneath, where addressing the issue of road safety, rather than making the highways safer they simply lower the speed limit. A world where unless you grow it yourself, chances are your corn cob has spliced jellyfish DNA in it, making it more frost resilient. A world where each and every year children develop an allergy to something new, last year was peanuts; 2010 is bananas.
As we approach the height of the technological frontier forged by the creative geniuses of our generation’s time such as Bill Gates etc, we’re slowly rattling apart. The world, bent on religious warfare, with extremists turning to terror to alter the status quo. Where religious hot topics such as abortion and euthanasia are looked at negatively; by religious law, humans do not have the right to destroy a life. What about creation? What’s going to happen when teleportation and cloning become the new thing; does a clone have a soul? When the teleporter breaks down the subjects body at the molecular level and reassembles them on the other side do the newly assembled bodies have a soul? Will the church redefine their doctrine on souls so we can all get back to happy hour in these SciFi times?
Having just recovered from the second worst financial crisis in modern history the governments are still spilling billions of dollars into preventing global warming. But is the world warming up? If so, are we directly responsible or is it part of a natural cycle. Earth has been through an ice age before, is mankind going to fight Mother Nature and try to prevent the next blaming it on ‘Global Warming?’. Are we polluting the earth? Yes! Lets start with that, lets reduce the carbon emissions, but to it to clean the environment, don’t be too surprised if the climate around the world continues to change.
If aliens landed tomorrow, what would your first reaction be? To scream? To pick up a weapon? If this is true, pity the fool, you have seen too many alien invasion films. Chances are that a life form intelligent enough to venture into space has the cultural understanding of ethics and morals and not be interested in Armageddon.
Too many approaches to ideas and not enough order has lead the world into the chaos that it is today. Will we straighten ourselves up in time, or will we be the fate of some of our own Hollywood creations to the likes of ‘Resident Evil’?
Last Decade
by admin on Dec.30, 2009, under Personal, The Road Ahead
The swift stroke of the second hand past midnight on the 31st of December will bring to close the first decade of the new millennium. Looking back on this decade one could easily sum it up by ‘we survived’. The millennium bug, the latest of doomsday scenarios in the late 90’s didn’t turn out a single light bulb. Satan didn’t waltz through the streets of New York City Gabriel Byrne’s style (as portrayed in End of Days) in search of a bride, nor was time itself sucked through the heart of the TARDIS by the Master’s great design (the Doctor Who Movie), no, the sands of time simply slipped through the beginning of an even larger hourglass and a new millennia began.
December 31, 1999. 11.50PM:
Having just completed watching Final Destination and End of Days, my sister, along with our lifelong friends Clinton and Adrian began the countdown into the new millennium. Clinton and Adrian lived with their parents in Canning Vale; my Mum, Dad and sister made the trip up to Perth from Bunbury for the New Year celebration. We had a lot to celebrate, not only didn’t we all catch up nearly enough, perhaps once a year if we were lucky, Clinton had just completed his first year of upper-school (year 10), and I had successfully completed year 11, my first year at a new school, having moved from Esperance at the beginning of the year. My first year at Australind Senior High was a good one, I made many friends, some of which I recall meeting on the very first day have turned into some of the closest friends today. Well, by some I mean really mean one, but I do keep tabs on a few others every now and then.
As I reached toward the VCR to push in another cassette (the movie things we used before DVDs) my eye caught the LED time display, it was 11.55pm. Quickly we scurried around making sure our cups were full and the party poppers evenly distributed between the four of us. From 60 we started counting down, the momentum and excitement building up as we left the 50’s for the 40’s and then the 30’s. we counted down till about 25 where we were then flooded with ‘Happy New Year’ cheering and celebrations by our parents in the lounge down stairs – with that, we did a quick 10, 9 , 8, 7 , 6, 5, 4, 3, 2, 1 and joined in the celebration, toasting each other and popping our poppers; the big 2000 was upon us.
Since then nine New Year celebrations have gone by; none are remembered more clearly than the night of 1999 – just four mates celebrating together, no wild parties, girls or alcohol that I can recall. In fact perhaps it is because all the other new years’s since have involved copious amounts of alcohol that I simply cannot remember them? I can only recall a few; one camping at a Dam outside of Mandurah on the scarp – at midnight from our altitude we could clearly see the fireworks from Bunbury, Mandurah and Perth. Another on a farm, one at my rental in Eaton (which got quite messy) and a few more in Perth at various mate’s houses.
So at a glance, life after that night went a little like this; graduating class of 2000 from Australind SHS and enrolling into a four year Software Engineering course at Edith Cowan University in 2001. Entered a local website design competition, the result of which lead to more work and therefore the catalyist for launching my own business ‘Equinox Website and Graphic Design’ whilst still studying. By the end of 2002 I made purchase of my first NEW car, a metallic blue 2002 Kia Rio. In the years that followed the business grew and an appropriate renaming took place and the more generic titled ‘Equinox Studios’ was born in 2003 servicing not just websites, but other aspects of business, including IT support, stationary ie Letter heads, logos, business cards, magnets etc. In 2004 Equinox Studios came runner up in the Telstra small business awards. At around that same time I employed my then girlfriend of 2 years into the business to further expand the company into the Education department and development of a sports management system for sporting facilties to use to draw up fixtures for various sporting events. We took the prototype as far as Queensland. Later in 2005 we broadened our horizons with a trip to Los Angeles and Las Vegas. Not too long after this, my grandfather had to give up his car, a 1989 Mitsubishi Magna Elite. Being one of my all time dream cars, I bought it off him, selling my Kia Rio. Dispite the 13 year age downgrade, the Magna had more electrical features than the Rio ever did, not to mention a bigger engine and cruise control.
April 2006 saw me relocate to Perth, to begin work for a R&D software development firm having graduated with a degree in Software Engineering the year before. Months into the relocation my 4 year relationship came to an end, not able to withstand the long distance, and with it the future of Equinox Studios slowly but surely faded away. I closed down the company in 2007.
I stayed single for almost the better side of a year, avoiding women, instead getting my social life back on track that had been suffering, along with having plenty of time to spare to take up any projects I saw fit. Around this time I decided a few changes were in order, so getting my priorities right, I got a new car, then a new girl. My second new car ever; fourth overall; a 2007 red Mitsubishi Lancer Limited Edition sedan. Breaking up due to different life interests (ultimately we had nothing substantial in common, not even a TV show) I once again found myself single in early-mid 2008, but in a far happier state than I was in the prior breakup. For one, I didn’t avoid women and quite happily enjoyed the fruits of a single man’s lifestyle.
But life wasn’t all fun and flirtish, drifting between girls and cars; 2007 brought forth its fair share of shattering wake-up calls. On the sunny Saturday, the 27th day of January at 2pm, my Nanna passed away. She was the last of my grandparents, outliving them for a few years. I was very proud/honored to be able to be there in her final moments and the days leading up to it. When she breathed her last sigh her nursing home room suddenly fell very still, impervious to the 12 or so people, sons and daughters, grandchildren and cousins that surrounded her as she left this mortal realm for the next. She, like all my other grandparents will be missed.
A few months on my mum phoned me one evening, crying over the phone as she told me she had been diagnosed with breast cancer, my life at that moment stopped. For that whole evening, silence filled my surroundings, blurring everything out other than the uneven rhythm of my beating heart. I remember vividly talking a shower, and scrubbing myself down as someone with OCD would, never feeling clean. I wasn’t anywhere ready to go on with life without my mother. That year had to be the hardest I had ever lived through, though what I was feeling would of been nothing compared to what Mum was having to endure, throughout the treatment. I only wish that I spent more time at her side, to comfort her. I thank God every day for her making it through such a terrible year, and for her ever improving health.
Time, being the healer of all things, I eventually found myself at the end of 2008 on a paintball skirmish field, arranged through Renee, the high school friend I stayed in touch with and her co-worker friend. On the 30th of December that co-worker friend and I met up at the Broken Hill pub and shared quite a few drinks getting to know each other. Flirting wildly across the table; discussing exotic travel ideas of the likes of Russia. The evening ended by what I could only describe as fireworks – the most passionate and wild goodnight kiss in the car park. That was my new year’s kiss, for the very next day she set off on a week’s vacation to Singapore.
2009 brought on even more travel, with three overseas trips carried out; 9 weeks of annual leave. The first of which being a couple of weeks in Vietnam, the next a few days in Singapore followed by a mammoth 6 week trip around the world, including Russia.
So from starting out as something of an entrepreneur, to owing a handful of cars, skiing in Melbourne, various relationship pitfalls, supporting my mother through her cancer treatment, to traveling around the world, being at my grandparents sides, watching as they all moved onto the next realm, a lot has happened, a lot of life experiences some good, others horrible, all of which shaping me into who I am today..
I started this decade with three grandparents, no debt, not much travel experience, having owned one car and lived in zero houses by myself, no business experience nor that of love and ended with no grandparents, a bit too much debt that i am currently rectifying, having owned 4 cars, lived in 5 houses outside of home, a fair amount of travel and business experience not to mention the affairs of the heart.
Just what will this next decade bring?