Wednesday, May 11, 2011

My Latest Leet Program

Just for fun today I did an update of an EnglishToLeetSpeak translator I had written a couple years ago.  I noticed that when I posted my update, my post count was almost ironic.  :-)

For a sample of how it works, look at this paragraph from my previous post:

Before:

Spent some time today installing a barebones (ie. no desktop) version of Ubuntu on an old Acer Aspire One netbook.  Feels weird to refer to it as old, as it was only a few years ago....


After:

S|>en† So]V[e †!]V[e †o])ay !nS†aLL!nG a (3aRe(3oneS (!e. no ])eS|<†o|>) veRS!on of µ(3µn†µ on an oL]) aceR aS|>!Re one ne†(3oo|<.  feeLS UUe!R]) †o RefeR †o !† aS oL]), aS !† UUaS onLy a feUU yeaRS aGo....

Here's the code: 

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# leet.py
# an experiment in python to produce a good leet encoder
# that does not use a one-to-one mapping
# mFragin May 2011
# version 1.5 maps first and then substitutes, so
# each example is internally letter consistant

import random, string

myDefinitions = [["4","@","/-\\","∂","λ","a","A"],
["6","I3","ß","|:","(3","/3","b","B"],
["¢","(","©","c","C"],
["∂","])","[)","T)","cl","d","D"],
["€","£","ë","e","E"],
["]=","ph","|=","f","F"],
["6","(_+","9","(γ","(_-","cj","g","G"],
["/-/","]-[",")-(","|~|","]~[","}{","h","H"],
["!","|",":","i","I"],
["_|","_/","]","j","J"],
["|<","k","K"], ["1","|","|_","l","L"], ["|v|","]V[","(T)","|\\/|","/\\/\\","m","M"], ["|\\|","]\\[","~","n","N"], ["0","[]","¤","Ω","o","O"], ["|o","|>","p","P"],
["(_,)","0_","O,","q","Q"],
["12","®","|2","r","R"],
["5","$","§","s","S"],
["+","-|-","†","t","T"],
["|_|","L|","µ","u","U"],
["\\/","√","v","V"],
["vv","\\V/","\\X/","UU","w","W"],
["%","><","}{","x","X"], ["Ψ","¥","y","Y"], ["2","z","Z"]] myKeys = string.ascii_lowercase # Make a dictionary of the keys and values myDict =dict(zip(myKeys, myDefinitions)) # Get a string from user and make it lower case stringToConvert = raw_input("\nEnter a string: ").lower() leetString = "" variations = int(raw_input("\nHow many variations? ")) for i in range(variations): leetString = "" chosenLetters = {} for letter in stringToConvert: if letter in chosenLetters: leetString += chosenLetters[letter] elif letter in string.ascii_lowercase: choice = random.choice(myDict[letter]) leetString += choice chosenLetters[letter] = choice else: leetString += letter print leetString

Saturday, May 7, 2011

Ubuntu Command Line Only Installation

Spent some time today installing a barebones (ie. no desktop) version of Ubuntu on an old Acer Aspire One netbook.  Feels weird to refer to it as old, as it was only a few years ago that netbooks were hot as anything.  Of course then Microsoft felt the need to spread their OS virus onto all the Linux netbooks.  The rest is history--no one uses netbooks anymore.  So I guess Microsoft won, and lost. 

Pretty silly to imagine running Windows on a netbook....

Notes to self:
  1. I used Unetbootin and the Ubuntu Minimal Install iso image.
  2. Installed only the basic command line stuff
  3. Now to add CLISP and a few other things....

Thursday, April 28, 2011

Homebrew to the rescue--part two



Been having a terrible time lately with Text Wrangler in my Python class.  For some reason, Text Wrangler is causing a ton of problems handling whitespace correctly.  Of course we already Googled the heck out of the issue, set the expand tabs, etc....  The problem, however, is that TW is simply not that great if you've ever used Geany.

So now I at least have Geany on my MacBook.  Testing it for the lab.

Hard to blame students for being frustrated with a ton of "unexpected indent" errors.

Friday, April 22, 2011

Homebrew to the rescue!


I recently purchased a book on Lisp programming that looks quite good.  Getting CLISP installed on Mac OSX 10.6, however, was not easy--until I found Homebrew.

At first I had used MacPorts, but that was a bit painful.  After a few hours I finally gave up and figured I'd just limit my LISP programming to Ubuntu. 

Lately I have been writing a LOT of Python code.  Because of that, my "temporary" absence from using XCode and iOS dev has become ... well ... prolonged.  I simply can accomplish so much more in Python, and in one-tenth the time.

I dove in to Mac development with a positive attitude, despite using Ubuntu Linux for 99% of my computer work the last several years.  Sure, it's nice to have GarageBand and the hardware on a Mac that works so well with media projects.  But ... I miss Geany.  I miss the package manager in Ubuntu.  Most of all, though, I miss the feeling of using free and open-source software, and the fact that you are NEVER harassed by the software you use.

I left Windows long ago and have never looked back.  When I first came (back) to a Mac recently, I was happy to see how similar OSX was to Linux (or BSD).  Now, however, the differences are starting to accumulate. 


Anyway, at least Homebrew got me CLISP....

Monday, April 18, 2011

A Place for Our Stuff....

Remember George Carlin's great "a place for my stuff" act?  Well, I kind of feel that way now, as I consider letting my Dreamhost account (www.futureskyline.com) expire and take advantage of alternatives for posting my stuff. 

In particular, I'm looking into options for storing a bunch of Creative Commons stuff that my students and I would like to share with the world.  Things like incidental music for video games (both MIDI and audio files), images and sprites, and also a crapload of screencasts and instructional videos.

Wednesday, March 30, 2011

Getting better....



As you can see, the dungeon floor plan generator is getting better.  In fact, it's starting to look more and more like the dungeon floorplans I used to draw up on graph paper when I should have been paying more attention in high school.  :-)

Well, it's now Spring Break (already to the midpoint, actually), so I've had a little extra time to play around with some comp sci topics that I haven't really used much in the past.  Of course I've been having fun with genetic algorithms, but those were easy to learn for me, having a degree in biology.  Not as easy are artificial neural networks.  Haven't much experience with them, so this is new ground for me.  There are many situations, though, that I suspect lend themselves to neural networks more than, say, genetic algorithms.  Regardless, it will be fun to compare and contrast....

Sunday, March 20, 2011

Getting there....


Debugging this has been the usual nightmare: any time you nest loops for these, no matter how many times you've done this, you still get mixed up between rows, colums, i, j, x, and y.  Anyway, I just need to clean up the code a bit and make a few adjustments before I can start turning these into environments to explore using the keyboard....