Virginia Blows
That is all. Been here a week and while I’ve had fun, it feels like it’s been a month.
I miss my friends and my family that are in this area, but that’s still not enough for me to want to stay here for any meaningful length of time. But hey, it’s been like 13 months since last time, so it’s not all bad. I have a gracious host, fun coworkers, and also the internet.
But despite that, when I’m here it feels like I’m not living my own life. Maybe it has something to do with the fact that I couldn’t wait to leave when I moved away over two years ago, and now every time I come back that feeling quickly returns.
Blah… Whatever, bitches.
Actually, I think it’s your fault. Yes, you!
Here enjoy this: Someone ported mkdong to Perl. Not sure how I feel about that. Bittersweet?
Taking over the internet, one dong at a time.
09.4.09Blue Dongs for a Friday Afternoon
Today I wrote an awesome program called mkdong that will make a dong of your desired length and print it to your terminal, like this:
% ./mkdong usage: mkdong <length> % ./mkdong 5 ()/()/////D % ./mkdong 25 ()/()/////////////////////////DThat last one is impressive, isn’t it? Hmm… Yeah, it’s Friday. What do you want from me? I still got work done! Cool thing is if the dong is too big, well then it throws an error:
% ./mkdong 60 warning: a 60" dong is too big! cannot be longer than 40"!“What is the point of this?”, you might ask yourself. That’s a good question. I’ve been so busy with other shit lately that I’ve barely had time to code. I suppose I was itching to write something, anything… Dongs!!
It all started harmlessly enough with a silly AIM conversation with my coding buddy at work. We were talking about a bug, and well, read on and you’ll see. It regressed quickly.
So I took the stupidity and ran with it and mkdong was born!
The initial dongs were a little primitive and sickly looking. So I took his suggestion and improved their visual style. Here is how it turned out:
#!/usr/bin/env python
import sys
maxlen = 40
try: donglen = int(sys.argv[1]) except: print "usage: mkdong <length>" sys.exit()
if donglen > maxlen: print 'warning: a %s" dong is too big! cannot be longer than %s"!' % (donglen, maxlen) sys.exit() else: dong = '()/()' for i in range(1, donglen): dong += "\" dong += 'D'
print dong We laughed. We joked. We Tweeted. And then it regressed even further:
A feature request! I had to make it print in blue! But to do that I had to replace all of the “\” that make up the dong itself, with “/” so as to not have the ANSI escape codes eat up the extra backslashes. (Backslashes are interpreted characters, duh.) I also had to replace the print statement with a system call to echo -e so that the colorization would be interpreted. This is high tech shit, man!!
And then I released it to the public. So there you have it. Here is the final release of mkdong 2.0 for your pleasure:
#!/usr/bin/env python
import os, sys
maxlen = 40 color = '\\e[0;34m' # blue
try: donglen = int(sys.argv[1]) except: print "usage: mkdong <length>" sys.exit()
if donglen > maxlen: print 'warning: a %s" dong is too big! cannot be longer than %s"!' % (donglen, maxlen) sys.exit() else: dong = '()/()' for i in range(donglen): dong += '/' dong += 'D'
os.system('echo -e "%s%s"' % (color, dong)) Use it well. And remember they aren’t bugs, they’re dongs! Squish? Gross.
| Posted in Life, Python | 3 Comments »
| Posted in General | 1 Comment »