January 2012
3 posts
Flash HTC Desire S HBOOT 2.00.0002
Download ROM, place as .zip on sd card
Unlock bootloader: www.htcdev.com/bootloader/unlock-instructions/
Get in fastboot mode, boot cwm: ./fastboot boot /tmp/recovery-clockwork-5.0.2.0-saga.img
Wipe
Install zips
Reboot
If stuck at loading screen: flash boot.img by hand./fastboot flash boot /tmp/boot.img
6 tags
ArrayBuffer Blob BinaryString conversion
You can speed up your javascript encryption stuff by using ArrayBuffers. However, if you want to convert it back to a binary string for other API calls, it’s really slow. At least if you do it by hand using something like
for(var i=0; i< view.length; ++i)
str += String.fromCharCode(view[i]);
Of course you can somewhat improve it by using a stringbuilder approach, like
function...
JavaScript: benchmark implications on sparse...
I tried to benchmark an encryption function by passing an empty array to it:
var data = new Array(10* 1024* 1024);
var start = (new Date).getTime();
rc4.secureEncrypt([1, 2, 3, 4, 5, 6,7,8,9,0], data);
var diff = (new Date).getTime() - start;
alert("spent "+diff+" ms on encryption");
It was slow, but I didn’t know why. I gradually debugged the code and discovered, that 90% of the time was...
December 2011
2 posts
4 tags
Filter useless wireless traffic
!(wlan.fc.type_subtype == 0x1d) && !(wlan.sa == $MY_ADDRESS) && !(wlan.fc.type_subtype == 0x08)
0x1d = beacon
0x08 = ack
by maik
3 tags
stringToBytes JavaScript Performance
Searching for a simple function to convert javascript strings to byte arrays, I stumbled over this stackoverflow answer.
While it’s implementation is correct, it has a significant performance problem. For large strings, the internal byte array is recreated too often. It’s somewhat similar to using the += operator on strings in java instead of using a StringBuilder. A faster function...