Archive
Mac not booting to CD/DVD or completing install of Snow Leopard
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!
My new word …
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 ….
Convert Java Float into C/C++ Float
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;