Last Ray of Hope Home of Kaluriel Hargrove

2Feb/12Off

First SMD Reflow

My iOS development license expired yesterday after I forgot to renew it. Since I hadn't received word back from Apple about it being reactivated, I decided to do some electronics.

Having recently buying an analog to digital converter and a prototype adaptor board for an SOIC, I decided to use my reflow tool I bought a few month back. One thing I didn't take into account was that my solder paste was out of date in November 2011, making it fairly thick and hard to separate.

Also it turns out the display on my reflow tool is in Fahrenheit, not Celsius.

I think it turned out rather well for my first one.

The second one however, a digital to analog converter, turned out far worse of a job. It is a TSSOP package - a fraction the size of the SOIC, and I have trouble with bridges being formed between pins, and my cheap solder wick was failing to remove them.

I'm unsure if the chips still work, as I took quite a while to get them in the correct position, but I was 40-60 degrees lower than the maximum soldering temperature. Hopefully I will have time to test them tomorrow.

TSSOP16 Adaptor

SOIC16 Adaptor

25Jan/12Off

Zynga pirate Tiny Tower

Zynga, as always, have stolen another game to call their own. After failing to acquire the small indie studio of 3, they decided that if can't beat them, steal their games join them.

I suppose being a company of 2700+, ideas are hard to come by.

[article link]

23Jan/12Off

Scammers are stealing my ideas

Last year I wrote a satirical piece about a single mom inventing cold fusion and defying the laws of physics.

Well apparently the same online scam artists have thought it was a great idea, and are now selling plans for a zero point energy device.

If you want to read the trash they've wrote this time, a Google of the Hojo Motor will surely bring it up. It is only a matter of time now before they start selling off pieces of dinosaur DNA claiming that you too can grow your own Jurassic Park, and Zoo Keepers don't want you to know about this.

Tagged as: , No Comments
19Jan/12Off

Wikipedia Blackout of 2012

Historians in the future will one day look back on this day, and realise that the 18th January 2012, was the most productive day in human history.

Tagged as: No Comments
5Jan/12Off

The International Obfuscated C Code Contest

I got told about this brilliant bit of code recently. It is a magic eye. Supposedly it will compile with a GCC compiler, I was unable to get it to in Visual Studio.

More similar code is on the official IO CCC website.

http://www.ioccc.org/

http://www.ioccc.org/years.html#2001_herrmann2

Tagged as: No Comments
2Nov/11Off

SprintfCat

On the train to Cardiff yesterday, I was creating a fixed function shader generator for the Athena engine. I kept using strcat() with if statements, and in a lot of places I kept using sprintf() then copying that in with strcat().

So I decided to make SprintfCat(), all the wonderful joy of sprintf, with the ability to concatenate with a already existant string like strcat.

//
//
size_t ath::SprintfCat( char * inoutBuffer, const size_t inBufferSize, const char * inFormat, ... )
{
	const size_t offset = StrLen( inoutBuffer );
	size_t ret = 0;
	va_list arg;
 
	//
	va_start( arg, inFormat );
	{
		ret = VSprintf( inoutBuffer + offset, inBufferSize - offset, inFormat, arg );
	}
	va_end( arg );
 
	//
	return offset + ret;
}

I had already created my own wrappers around strlen() and vsprintf(), the reason being the fault of Microsoft. With their implementation of the standard library, they decided to deprecate non-safe versions complain at you until you either used their own _s variants, or defined a certain preprocessor.

//
//
size_t ath::VSprintf( char * outBuffer, const size_t inBufferSize, const char * inFormat, va_list inArgs )
{
#ifndef ATH_PLATFORM_WINDOWS
	return vsnprintf( outBuffer, inBufferSize, inFormat, inArgs );
#else
	return vsprintf_s( outBuffer, inBufferSize, inFormat, inArgs );
#endif
}
 
//
//
size_t ath::StrLen( const char * inString )
{
	return strlen( inString );
}

While I do prefer to have safe versions, their _s variants are not present in the standard and so it makes the code not portable.

I'm still not quite sure about my naming convention for a variable that is an input and an output. While I do like the in or out prefix, I don't think inout looks right, being slightly too long. I wasn't a fan of io either. I have however grown to like the truncation of Athena namespace to ath.