Archive

Archive for the ‘Uncategorized’ Category

Get useragent in JSP file

October 28th, 2009 No comments

request.getHeader("user-agent");

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Java, Uncategorized Tags:

Mac not booting to CD/DVD or completing install of Snow Leopard

September 3rd, 2009 No comments

Just another so of bug that came up today when trying to upgrade to Snow Leopard. After the “pre-install” the Mac would reboot but eject the DVD and continue as normally. Trying other boot disks, even Ctrl+C would eject the disk and boot normally.

The issue was a third party mouse. Plugged back in my normal apple mouse and … wow .. back up and working!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Uncategorized Tags:

My new word …

July 12th, 2009 No comments

I don’t wish to take credit for it, but, I believe I was one of the early adopters.

FRANXIOUS

There … and my definition is frantically anxious ….

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Uncategorized Tags:

Khaaaaan ….

April 12th, 2009 No comments

Khan

Keeps me on the straight and narrow during work ( need to get Shatner on the other wall )

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Uncategorized Tags:

Convert Java Float into C/C++ Float

February 12th, 2009 No comments

If you have a float stored using writeFloat use the following to read it back into C

float aFloat;
unsigned char *pBytes;
pBytes = (unsigned char * )&aFloat;
pBytes[3] = _buffer[_offset++];
pBytes[2] = _buffer[_offset++];
pBytes[1] = _buffer[_offset++];
pBytes[0] = _buffer[_offset++];
return aFloat;

Assume that _buffer is your byte array or pointer to an unsigned char *, and that _offset is the offset in your data.

To read an integer value:

int i = ((_buffer[_offset]<<24)|(_buffer[_offset+1]<<16)|(_buffer[_offset+2]<<8)|(_buffer[_offset+3]));
_offset+=4;
return i;

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Uncategorized, XCode / C Tags: