Code Category

The ternary operator in Python

In: Code, Technology

The ternary operator of C is one of my favorite operators, it may be hard to read at times, but oh so useful.

(a ? b : c)

In python you can do this in three ways, the third way is only available in python 2.5 and up. It is essentially a ternary operator and doesn’t require [...]

My favorite passwordless ssh tutorial went offline, so here is my rehash of it.
Your server names will, of course, vary. Localhost is the machine you are currently on and, in my case, northisup.com is the server I’m SSHing into.

localhost$ ssh-keygen -t dsa
localhost$ cat ~/.ssh/id_dsa.pub | \
ssh northisup.com 'cat >> ~/.ssh/authorized_keys; \
chmod [...]

So I was hacking away at a turbogears project and thought ‘how cool would it be to visualize this?’ That thought lead to a short example of how to get the graphing visualization from google finance into your app. I used cherrypy to do the web serving for the example. Code after the break (sorry [...]

Python starter templates

In: Code

Over the past few months I have developed several patterns in the tools that I develop.
1) I like command line options.
2) I like to be able to run other command line programs and parse the output
Code after the break.

About me, Adam Hitchcock

This is my little corner of the Internet, welcome to it. It is my sounding horn for my views on democracy, the environment, security, computers, and code which is beautiful. I like to ask questions and study the wisdom of the crowd, the democratization of information, and why things are different this time around. I am a dog person, and I have been a Mac user since before it was cool.

Flickr PhotoStream

    100_2149100_2148100_2147100_2146100_2145100_2144100_2143100_2142100_2141100_2140100_2134100_2130100_2131100_2132100_2133100_2099

Where You At?

Follow Tweets