Thursday, March 26, 2009

C/C++ win32 programming tutorials and open source projects

http://sourceforge.net/projects/sonne/
http://sourceforge.net/projects/cinputbox/
http://sourceforge.net/projects/win32net/
http://sourceforge.net/projects/notepad-plus/
http://sourceforge.net/projects/smartwin/
http://sourceforge.net/projects/radcpp/
http://sourceforge.net/projects/pwrgrid/
http://sourceforge.net/projects/gettext/
http://sourceforge.net/projects/gqview-win/
http://sourceforge.net/projects/win32gui/
http://sourceforge.net/projects/big3dsol/
http://sourceforge.net/projects/bhwindow/
http://sourceforge.net/projects/mancalacpp/
http://sourceforge.net/projects/win32-framework/

http://winprog.org/tutorial/
http://www.winprog.org/tutorial/msvc.html
http://www.relisoft.com/win32/index.htm
http://www.suite101.com/blog/leckyt/win32_programming_tutorial
http://www.functionx.com/win32/index.htm
http://www.functionx.com/win32/Lesson01.htm
http://www.nullterminator.net/opengl32.html
http://www.zetcode.com/tutorials/winapi/
http://www.vczx.com/tutorial/win32-tutorial/index.html
http://www.tenouk.com/cnwin32tutorials.html
http://www.sgi.com/products/software/opengl/examples/win32_tutorial/
http://www.geocities.com/Heartland/Meadows/9818/win32tut/index.html
http://www.relisoft.com/Win32/winnie.html

Monday, March 23, 2009

sunspider benchmark ie8, ff3.5, safari4, chrome

IE7
Total: 52562.6ms +/- 1.8%
IE8
Total: 8459.8ms +/- 0.3%
Safari4
Total: 1411.2ms +/- 0.6%
Chrome1
Total: 1783.6ms +/- 6.5%
Firefox
Total: 4727.8ms +/- 0.6%
FF3.0
Total: 4831.0ms +/- 3.6%
FF3.5
Total: 2551.4ms +/- 11.5%

Sunday, March 22, 2009

utf8 in mysql

select CONCAT('V',x'c3a1','zquez'), _utf8'Vázquez';

Same result

php - decutf8 decimal to utf8 entity

go to http://www.zedwood.com/unicode_table you will see a unicode table listed by htmlentity number.

echo decutf8(632);//prints ɸ which has htmlentity ɸ

function decutf8($str)
{
$bin = decbin($str);
$out = 127;
if (strlen($bin)<=7)
{
$bin=sprintf("%08d", $bin);
$out=bindec($bin);
}
else if (strlen($bin)<=11)
{
$bin=sprintf("%011d", $bin);
$out=bindec("110".substr($bin,0,5)."10".substr($bin,5,6));
}
else if (strlen($bin)<=16)
{
$bin=sprintf("%016d", $bin);
$out=bindec("1110".substr($bin,0,4)."10".substr($bin,4,6)."10".substr($bin,4,6));
}
else if (strlen($bin)<=21)
{
$bin=sprintf("%021d", $bin);
$out=bindec("11110".substr($bin,0,3)."10".substr($bin,3,6)."10".substr($bin,9,6)."10".substr($bin,15,6));
}

if ($out <=255)
return chr($out);
else if ($out <=(255 * 256) )
return chr($out/256).chr($out%256);
else if ($out <=(255 * 256 * 256) )
return chr($out/256).chr($out/256).chr($out%256);
else if ($out <=(255 * 256 * 256 * 256) )
return chr($out/256).chr($out/256).chr($out/256).chr($out%256);
}

Wednesday, March 11, 2009

javascript debugging in ie

Firebug rocks, and though there is a version for IE, it isn't the same. So in developing javascript heavy websites, it is always useful to have an IE brower around and debugging tools so you can figure out why your code is breaking in IE and not Firefox.

There are 3 ways to debug javascript in ie:
1. microsoft script debugger
2. visual studio .net
3. microsoft script editor (comes with office xp/2003)

Seeing as [2] and [3] both involve handing money over to micro$oft. We are left with [1]. The microsoft script debugger is no way related to the Internet Explorer Developer Toolbar

The Script Debugger is pretty sad but at least you can visually see what line of code your IE breaks on. It can still leave you scratching your head as to 'why' though. To enable it go to your "internet options" menu and hit uncheck the "Disable Script Debugging (Internet Explorer)" option.

Note to self: This breaks in IE7
var a = { width: 100, height :200 , };
While invalid syntax, IE7 should not be so delicate it gets tripped up by this. Allowing an extra comma in an array or dynamic object allows for cleaner code when generating javascript from another language.

debug ie6