Perl

Auto Key Cipher

Cryptography has always been an interesting subject for me. Never really did much coding that involved it however. A little while back someone had asked for help writing a program that performs an Auto Key Cipher, so I figured I'd try my hand at making a proper cipher. I wrote two versions. One DLL, class based written in C# (with GUI). The other procedural based in Perl.

Image to Text

So I've always wanted to make a script that read an image, and spat out ASCII art of that image. A few semesters back I wrote one, and I figured I'd share it here.
#!/usr/bin/perl -w

use strict;
use GD;

## Open the image, and get its size
my $src = GD::Image->newFromPng('src.png', 1)
	or die('Failed to open image: '.$!);
my ($swidth, $sheight) = $src->getBounds();

## Print out the html header
open OUT, '>out.html';
print OUT qq#<!doctype><html><head><title>ASCII Art</title>

Tags:

Sine Waves

For some reason I really enjoy coding mathematical equations. This little script will graph a sine wave, and display some info on the wave as well. Here's some of the images it produced:

Tags:

Subscribe to RSS - Perl