Saturday, November 28, 2009

Teach Yourself Programming in Ten Years

With regard to my current side projects at home, I've started to ponder graduate school. Grad school is something I'm always thinking about because I'd love to teach computer science at the college level at some point. Neural networks and genetic algorithms have always been interesting, but lately I've been thinking more about programming languages.

I've been doing a lot of Perl for the past several months and I think I've validated my preconceived notions about the language. Perl is one of those languages that fills programmers with a variety of emotions. It seems to be heavy at the opposite ends of the spectrum. People tend to either hate it or love it. Even within the Perl community, there seems to be strife about certain topics.

My opinion about Perl is an ambivalent one. I often feel like I'm the child in the middle of a divorce. The language has some great features and I have a lot of fun programming in it. On the other hand, it's a bastard language and I despise it. Either way, it's a great language to talk about in an academic manner.

Perl has dynamic and lexical scoping. You can program in an object oriented, imperative, or functional style. It also has mappings to Prolog, so you can program in a logical style if you like. For subroutines that are referentially transparent, you can use a memoization module. You can use closures, which means you can do currying. Virtually every programming languages concept is manifested in the language.

To bring the story to an end. This prompted me to Google for "programming languages graduate school". The first result from the search shows a list of the top ten graduate schools. UT is number 8 (woot!). The second result is the one I found most interesting:

http://norvig.com/21-days.html

I thought the page was an interesting read. Enjoy :)

Wednesday, November 18, 2009

dsh - distributed shell on Mac OSX

We have several hundred computers at work. One of the tools we use to interact with these machines is dsh, also known as dancer's shell or distributed shell. You can use dsh to run a command on a group of machines. For example, you could run the following command to find out what operating systems are running on a group of machines:
dsh "uname -a"
I'm going to give a short tutorial on how to set this up on the Mac for a group of machines with ssh available. First of all, I'm using MacPorts, so you'll need to have that installed before proceeding. With MacPorts installed, you can run the following command:
sudo port install dsh
After ports has done it's thing, you will need to create the proper directories:
mkdir -p ~/.dsh/group
The '-p' tells mkdir to create both .dsh and group directories. Neither of these directories existed for me. Now we need to create a 'group' file with the names of the machines we want to access:
vim ~/.dsh/group/testMachines
Add machine names to the file with one machine per line. For example:
pluto
mars
saturn
earth
You can create as many files in the ~/.dsh/group directory with this format. We will use these files to organize what machines we're sending commands to.

Now we need to create a config file:
vim ~/.dsh/dsh.conf
with the following contents:
verbose=0
remoteshell=ssh

waitshell=1 # whether to wait for execution
# 1 = run commands serially
# 0 = run commands in parallel

remoteshellopt=-lmmasters # mmasters is the login id for the machines
verbose=0
showmachinenames=1

The last thing we need to do is set up passwordless ssh for all the machines in our group file. Once that's done, we can start using dsh. Go ahead and give it a test drive:
dsh -g testMachines 'uname -a'
The -g argument tells dsh which group file we want to use.

Wednesday, November 11, 2009

Grails sql logging alternative

Someone just posted this on IRC. Nice write up.

http://btiernay.wordpress.com/2009/11/12/grails-sql-logging-from-the-command-line/

Perlin Noise

The talk at the JUG meeting last night sparked a memory about perlin noise. The talk had nothing to do with perlin noise, but there was some talk about filtering out noise from this device a person created to track your heartbeat. The person created the device using a Java Sunspot device and some off the shelf electronic components. I thought it was a fun presentation.

Back to the topic. All this talk about noise and filtering reminded me of perlin noise. I decided to find the page I used to implement my terrain generator for my graphics class at UT. This page was great because it also introduced me to how interpolation works.

I decided to look up some other information on interpolation and I thought I'd share this page. It has a lot of nice visualizations.

Grails build-test-data Plugin

This has to be one of the coolest plugins I've seen lately:

http://www.slideshare.net/tednaleid/grails-buildtestdata-plugin-1723277

Tuesday, November 10, 2009

DSP Book online

I went to a Java user group meeting tonight in Boulder and one of the talks was over the Java Sunspot. I thought it was really cool, despite the $700 starter kit. The speaker recommended the following site. It has the book available online.

http://www.dspguide.com/

The book describes some of the algorithms used in DSP programming.

Sunday, November 8, 2009

Data sets

I ran across this site and thought it was really cool. It has information on different datasets.

http://www.socrata.com/