Posted by: kahgoh on: 21 July, 2008
In C, when you type cast an integer to a character, the character that is assigned is the ASCII character corresponding to that number. This property can be used to generate a set of random of characters, as follows:
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <time.h>
4
5 int main(int argc, char *argv[])
6 {
7 char randChar = ‘ ‘;
8 int counter = 0;
9 [...]
Posted by: kahgoh on: 19 July, 2008
While installing some packages in Ubuntu, I once installed installed the edubuntu-artkwork package. At the time, I was just looking for alternatives to the default Ubuntu themes that I had. Once it was installed, I was asked to reboot it. That was when I found out that the boot screen (Uslpash) image was replaced with [...]
Posted by: kahgoh on: 13 July, 2008
Before you can decrypt something, you have to generate it! You can generate encrypted data with OpenSSL on the commandline using the enc command. The encryption process requires a key and iv (initialisation vector) pair, which can be derived from a given passphrase. The enc command gives you the option of specifying, either the passphrase [...]
Posted by: kahgoh on: 1 July, 2008
In a previous post, I showed how to add listeners to buttons so that you can modify its text when its in focus or it has been clicked. The listener can be easily modified to show an alert dialog. You can use a ready-built dialog by using the AlertDialog.Builder class. The simplest way creating a [...]