Who are you online?
Oct 18, 2011 - 11 p.m.

I was reading an article discussing some comments made my moot - the guy who created 4chan and canv.as. He has some pretty strong feelings about anonymity and how it effects the way we interact with each other online. I think there is definitely a place for both identities in the online world. On this page, I'm obviously not too shy about my identity, but on other sites I take on a more pseudo-anonymous identity (reddit for example), as I think most people do.

The article got me thinking about how closely our online personas reflect our actual personalities. Are you as willing to speak out when going by your real name as you are when going under a pseudonym? I think I'm a bit more careful when using my real name, but for me, my pseudonym also has a bit of a reputation to maintain. To me, my pseudonym is a separate part of my identity, but still definitely "me". As a general rule, I try not to be a dick regardless of how personally liable I am for my statements, but I can see how it can be appealing to let loose completely in online form. When you are anonymous, there is almost no chance of suffering interpersonal consequences for your actions.

The article also reminded me of a conversation I had with my girlfriend a few days ago. She is still friends on facebook with an RA that she had our freshman year of college. He now lives in the midwest and is married to a girl he met through an online forum. The story goes that they were friends online, dated online for several years, and when college was over, he moved out there and married her. They had only met in person one time before they moved in together. I imagine that to many people, this sounds insane. How could you get along with someone that you had only met "for real" one time? It doesn't make a whole lot of sense. But what if you had put enough of yourself online that your interactions there were "for real"? I don't think that I've ever made a friend online, but I also don't think of my online self as my whole self. If you truly present your whole self, as I imagine the guy in our story does, then he wasn't moving in with someone he barely knew, he was moving in with someone he'd known (and dated) for years. It still seems a bit strange to me, but as we spend more time online and as younger people grow up not knowing a world without an online component, I think it will become more and more common.
A little (more) command line fun
Oct 7, 2011 - 12 a.m.

I've written about this before, but at the risk of contradicting myself in the future, I'm going to say I don't think I'll ever get tired of coming up with command line solutions to little problems. The beauty of unix is the way that you can stitch together programs to make your life easier.

It might be one of those things that I like because it makes me feel clever, but if that is case, so be it.

The problem I was trying to solve was simple. I needed the current version of an svn repository so I could insert it into another file during a build process. Since we're running the script inside an versioned directory, the command "svn info" will give us this.

[pwade@web48 philwadeorg]$ svn info
Path: .
URL: http://example.com/phil/trunk/philwadeorg
Repository Root: http://example.com/phil
Repository UUID: 6596c492-bec3-4f50-a8a2-b0ff2d2738bf
Revision: 445
Node Kind: directory
Schedule: normal
Last Changed Author: phil
Last Changed Rev: 384
Last Changed Date: 2010-12-14 09:37:56 -0600 (Tue, 14 Dec 2010)


Neat! We've got our revision right there: "Revision: 445". Too bad it's surrounded by a bunch of crap that we don't want. Grep lends a hand here.

[pwade@web48 philwadeorg]$ svn info | grep Revision
Revision: 445


Much closer now, but we want just the number, nothing else. The next tool we're going to grab is awk. If you're not using sed and awk, you really should be. Unix is all about moving around text, and sed and awk are all about manipulating that text, which, as you might imagine, comes in handy. My dad passed down the O'reilly Sed & Awk book when I started working, and it's been very useful. It sits on my shelf, and when I need to figure out something like this, I pull it down and make stuff happen.

Anyway. Awk. At the most basic level, awk just takes a line of input, and splits it into separate pieces, delimited by spaces. These are referred to like so: $1, $2, etc. For each line of input, awk will act upon those pieces how you want. In my case, all I want it to do is grab the second part of the line (the revision number) and print it out. Here we go.

[pwade@web48 philwadeorg]$ svn info | grep Revision | awk '{print $2}'
445


And there you have it. Our revision number from that big mess in just two simple steps. I was going to run this command from inside a python script, but it was actually easier to pass in the output as a argument to the script. Funny thing, that python command line library.

It should be noted you could probably solve this problem with just awk alone, or that there may be a way to get it out of just the svn command. I couldn't find an svn solution in my (admittedly short) search for one, and I think a pure awk solution would take a lot longer to cobble together.
bitbucket! etc!
Jun 11, 2011 - 04 p.m.

So I've phased back into doing some code writing in my spare time. I tend to go back and forth between really loving to write new code and just wanting to play Minecraft/veg out all the time. I like to think of the two activities as a rest from each other.

The last round of big coding resulted in Interflix, which I'm quite proud of, even though it isn't completely finished. I'm not sure that I will get around to finishing it, what with the official Netflix android app being released, so perhaps I'll just release the source.

Anyway, my current burst of activity involves tgrep, a challenge I saw on reddit and initially implemented in Python. Now I'm trying to re-implement it in C, which is a quite fun. I've been working in programming languages with "C style" syntax for most of my programming career, but never bothered to learn C. I thought this was a good opportunity to do so. It is a bit more challenging than I thought it would be.

Anyways, you can now follow along with my code adventures via my bitbucket account. Right now it's just tgrep and some project euler code, but I'll be putting anything non-proprietary that I do up there from now on.
Interflix
Dec 10, 2010 - 12 a.m.

Oh hello,
Just thought I'd stop in and say I've just released Interflix, a Netflix que management app for android phones. Here is the appbrain widget if you'd like to get it: If you'd just like to read a bit more about it, there is a link to the informational wiki page in the sidebar. As a side note, I've added the sidebar (over there on the left), and changed the styles around a little bit to be not quite so dark. I think I like it.
Ghost in the shell
Nov 11, 2010 - 05 p.m.

I recently needed to create eight Symfony templates for something at work. Quick breakdown: every page in Symfony is a combination of an action and a template. You create a function and follow a naming convention to create the corresponding template. So, the action "public function executeFoobar()" renders with the template "foorbarSuccess.php". It's a bit more complicated than that, but that's all you really need to know at the moment.

I had written this set of eight actions, and wanted to create all the templates. Normally, I just create the files by hand, but that's boring. The correct answer? Shell script.
[web@dnysnweb05:~/htdocs_symfony/symfony/apps/content/modules/minisites]$ grep Pretty ../actions/actions.class.php  | awk '{ print $3 }' | sed s/\(.*\/Success\.php/g | sed s/execute//g | sed s/P/p/ | awk '{ system("touch " $1) }'

Instead of writing "touch blahfile.php" eight times, I wrote the above. It probably took three times as long, but it was a hundred times as much fun, and if I had needed to create a thousand templates, it would have saved me a lot of time. The moral of the story is keep sharp in the shell. It might come in handy.