My first online article, an introduction to programming with libtiff for IBM DeveloperWorks. Reprinted by AUUG in their magazine. [tags: libtiff tiff graphics]
And then Nemo wanted weighted random numbers
Nemo then wanted weighted random numbers, so this item has been added to this page. The following script selects a random element from a weight list of options… #!/bin/bash # Copyright (c) Michael Still 2002 # Released under the terms of the GNU GPL # In this case, Nemo wants to be able to specify…
How good are bash random numbers anyway
How good are these random numbers anyway? I generated 100,000 random numbers between 1 and 10, and then had a look at their frequency: 1: 9964 2: 10009 3: 9978 4: 10015 5: 9997 6: 10020 7: 10011 8: 10008 9: 10006 10: 9992 I would say that this is probably close enough to random…
The challenge and the result
So, I was at a CLUG meeting last night, and one of the speakers had a whole bunch of bash scripts for XDM theming. Anyway, he was using a perl script to generate the random selection of the theme elements, and me and my big mouth offered that it could be done in bash itself….
Getting an arbitary item from a list
This script gets the specified element form the list on the command line… #!/bin/bash # Select a specified item from a list. Copyright (c) Michael Still 2002 # Released under the terms of the GNU GPL # $1 is the number to get, $* except for $1 is the list of options, delimited # by…
Getting a random number in bash
This script generates a bounded random number: #!/bin/bash # Generate a random number. Copyright (c) Michael Still 2002 # Released under the terms of the GNU GPL # # (Is it possible to copyright a single line of code?) # To quote from the rand manpage as to why we bound the random number this…
Example of DES encryption code
/****************************************************************************** desex.c, an example of how to use the openssl DES implementation… Data is input on stdin, and the enrypted information is output to stdout. Prompts appear on stderr… This is an example of the Electronic Code Book mode, which is predictable for known input, and is not recommended. Copyright (c) Michael Still 2001 Released…
Example of DES decryption code
/****************************************************************************** desex.c, an example of how to use the openssl DES implementation… Data is input on stdin, and the enrypted information is output to stdout. Prompts appear on stderr… This is an example of the Electronic Code Book mode, which is predictable for known input, and is not recommended. Copyright (c) Michael Still 2001 Released…
DES examples
This page contains some DES example code I wrote in reaction to a crypto tutorial I attended a while ago. I finally got around to putting the code online… The basic point of the code is it shows you how to use the DES calls within openssl. It also shows how the electronic code book…
Graphics programming with libtiff: black and white
My first online article, an introduction to programming with libtiff for IBM DeveloperWorks. [tags: libtiff tiff graphics]