Archive for February, 2008

Calculate sha1-hash using javascript

Here’s a snippet to calculate a string’s sha1-hash using javascript. The sha1 hashes are compatible with php’s sha1 function. The snippet depends on the utf-8 encode function, see link at bottom of this page.[code language=javascript] function sha1 ( str ) { // * This script relys on the utf-8 encoding function // * example 1: [...]

More »

Javascript UTF-8 encoding

Here’s a little snippet to utf-8 encode a string using javascript.[code language=javascript] function utf8_encode ( str_data ) { // * usage: utf8_encode('programming.torensma.net'); // * returns: 'programming.torensma.net' str_data = str_data.replace(/\\r\\n/g,\"\\n\"); var utftext = \"\"; for (var n = 0; n < str_data.length; n++) { var c = str_data.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); [...]

More »

Security considerations for web developers

This article is intended for web developers, and as such we rarely have much use for public/private key pairs. But don’t despair! There is another class of much simpler one-way encryption you can start using today.||Digestion|| The concept of digestion focuses on reducing any stream of data do a fixed size, unintelligible but deterministic \”hash\”. [...]

More »

LoaderLock was detected

When trying to debug an app I was working on I got this strange error. Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang. On the web it is suggested to solve the problem [...]

More »

CHIP8 games and applications

Comming soon!

More »

CHIP8 emulator

[img a=left]files/media/Chip8-Emulator-(beta1)_smal.png” />I’ve been wanting to make an emulator for a long time, but I always though it to be way out of my league. Until I came across the specs for CHIP8.||What is CHIP8?|| CHIP-8 is an interpreted programming language, developed by the late Joseph Weisbecker. It was initially used on the COSMAC VIP [...]

More »

CHIP8 specifications

A CHIP-8 / SCHIP emulator||CHIP-8 features, The original CHIP-8|| CHIP-8 is a language interpreter which was used in the late 70′s and early 80′s on some small commercial computers like RCA’s TELMAC 1800 and COSMAC VIP, and these El-Cheapo \”Make-It-Yourself\” Hobbyist computers of these times like the ETI 660 and the DREAM 6800… CHIP-8 allowed [...]

More »

Convert Int to Hex and vice versa

[code language=c#]// unsigned int to hex uint uiValue = 200000; string str = String.Format(”{0:x2}”, uiValue); // hex to unsigned int int uiValue; string hexValue = “AFFE”; uiValue = System.Convert.ToUInt32(hexValue, 16);

More »

PHP tips & tricks

These are some common PHP and MySQL coding tips. I believe these are good do’s and don’ts, that most experienced coders would agree with, and not just my opinions. [note]In my examples, I’m using the new arrays ($_GET/$_POST/$_COOKIE/$_SERVER) because I’m assuming that you’re using at least PHP 4.1.0. If you have an older version, then [...]

More »

PHP

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

More »

Installing PHP on Windows Server 2003

Here are some issues I came across when installing PHP4 and 5 on a Windows box.Please read the installation instructions that come with either PHP4 or 5, I’m not going to repeat them here. I have PHP installed in d:\\php4 or d:\\php5, this might be different for you. ||PHP4 & 5|| Add the PHP installation [...]

More »