expletive inserted Does cursing make you feel better?

Odd Things Not to Forget, #1

When I was in college, the first off-campus housing we rented was this miserably disgusting two story house. It was amazing and perfect for us at the time. There were eleven of us. The top floor housed six lovely young ladies, the bottom floor five of us disgusting young men. Upon successful execution of our lease, our first task was to get the locks changed. Our landlord, New Brunswick’s Joe Chedid, a middle aged Lebanese man who as far as we could tell was both the Beer Baron and head slumlord of New Brunswick (I say slumlord in the nicest way possible, he really did hook us up) sent us to a locksmith on Easton Ave.

This locksmith. Wow. It was like stepping back in time. The poor man working there must have been at least 92 years old – without hyperbole. The shop itself was in worse shape than our newly signed house. Natural light had not graced the walls of that place in at least a decade, probably more. He moved as slowly as cold ketchup. Every gesture the man made was meticulously invoked as if  his hip would snap if he made the wrong move. He greeted us mumbling, but welcoming. He seemed quite nice actually, still doing his thing. He’s probably there right now still doing his thing at 102. The thing though was this. Before he started working on our locks (which he wanted to do right away while we waited, what service!) he sprayed WD-40 on his hands. We looked at him quizzically, which he must have gotten a lot of because he quickly and mumbly explained to us that the WD-40 helped his arthritis. Poor guy. We felt terrible for him, but also confused, so we sat there and watched him lube his hand before each lock he changed, and each new key he produced. He was of sounds enough mind to paper towel off his hands before picking up the pen to write the invoice.

At the time it became a perennial joke to us that this poor old man was methodically oiling himself to alleviate his arthritis but there was always a poignancy to the locksmith and his shop on Easton Avenue that I’ve felt to this day, but never really thought about in years. Reading Anil Dashes’ account of  almost being robbed dredged up the memory and it’s just one of those odd experiences I hope I never forget about. A recent map of the area suggests the locksmith is no longer there, I hope the old man is retired somewhere WD-40′ing his hands in preparation to raise a drink.

Printer FU

Note to self. If someone can’t print, check to make sure they have adequate hard drive space available. Ah netbooks. Also you can change the printer settings so the driver does not spool, just send directly to printer. Gah.

Some small improvements to facebook and twitter

facebook

I try to limit my time spent going to facebook.com both in length of visit and visits per day, but I still want to know when someone comments on something I post or liked or said somewhere so I have facebook email me whenever someone comments on something I post. Great. However what bugs the crap out of me is that even though I’ve already read their comment in my email, when I go back to facebook.com, I have tons of notification alerts; you know those pesky little red boxes showing how many unread items you have? Bah! Facebook! First, start sending me HTML emails, and then put a little transparent tracking image in them so you know when I’ve opened the email, I’ve read that item! Stop wasting my time!

twitter

If you’re anything like me, and you probably are if you are reading this then you probably access twitter from a number of different clients/places. I count four I use daily. 1) Twitter.com 2) Twitter iPhone app, 3) Tweetie on OSX at home and 4) at work. Now, why in the hell is it so difficult to store the id or timestamp of the last tweet I looked at somewhere on twitter servers, make it available via the API and let my clients auto scroll to wherever I was last in my timeline! WHY!?

I do this software development thing for a living, I know nothing is as easy as it seems, especially at the scale of facebook or twitter but these tiny tweaks would go a long way to adding that extra bit of magic to two services I use constantly.

MMS/tethering on iPhone 2G (3.1.2)

Finally. After what seems like a ridiculous amount of futzing around, MMS & tethering working on an iPhone 2G.

  1. If you’ve already attempted to get this working by screwing around with your phone, your best bet is to do a clean restore to 3.1.2. You should already know how to do this using pwnage tool. It’s really really easy, especially if your phone is already unlocked/jailbroken.
  2. Add cydia.iphonemod.com.br and cydia.pushfix.info to your Cydia sources
  3. Install “iPhone 2G: tethering, MMS and full Bluetooth” from Cydia
  4. Download the appropriate carrier settings zip files from modmyi.
  5. In terminal run [~] defaults write com.apple.iTunes carrier-testing -bool TRUE
  6. Unzip the file you downloaded earlier.
  7. Start iTunes and select your iPhone.
  8. Hold Option down while clicking the ‘Update’ button
  9. Select the appropriate ipcc file
  10. Reset your Network settings.

Voila! Why did I desperately need this? Nagios is sending us alert notifications through an email gateway and I’d much rather mess with my phone than figure out how to get nagios to only send me plain SMS. Goodbye G1, it’s been, um, slow.

DohSimpsons.com launched

Wherein Afshin and I attempt to watch and review every episode of The Simpsons. Wish us luck. And buy something damnit!

http://dohsimpsons.com/

Scan Mode for iTunes Script

So I was hacking on some Android stuff this weekend and I was immediately distracted by constantly having to flip the song on iTunes party mix DJ bullshit marketing name for shuffle mode. What I wanted was the equivalent of seek mode on car stereos. Where you basically press a button and every 10 seconds, it auto-flips to the next song until you tell it to stop.

OK, this can’t be that difficult right? Right. http://github.com/zackola/itunes-scan/tree/master

A few things. This is basically just a inline script written in Ruby. It uses RubyOSA as an event bridge to interact with iTunes. Although RubyOSA is pretty early, it worked great. You will also need Growl as this makes use of growlnotify to tell you what the track is on change. Also, this is best launched from Quicksilver, but before you do that, you need to turn on the “Run tasks in background option” under “Extras”.

To control the starting/stopping of scanning I’m just saving a text file in ~/.trackscanner with the PID of the process that started the scanning. Sorry for littering your home directory and if anyone has a better idea of where to store this info I’d love to know. Sorry only tested on OS X at the moment.

What I Learned Today: Ack and Ephemerides

Been so busy there’s barely been any time to think about blogging. Today’s edition of What I Learned Today covers two totally separate topics. The first is:

Ack

Ack you say?! Yes. ack. Ack is a command line utility that searches through files for patterns of text. It’s like grep except…it’s more friendly, has some options turned on by default, as far as I can tell its faster too. Oh, and as the ack page points out, its one character shorter than grep. Plenty instructions over there on how to get it installed. I had macports running already to i just:

?>sudo port install p5-app-ack

and I was done in a minute.

Ephemerides

Right. So as some of you might know I’ve been working on this android app for my G1 that displays stars and constellations given the current date, time of day and your geographic location on Earth. I’ve gotten to the point where the stars are showing up, the constellation lines are being drawn, and shit generally looks correct. And then one of my co-workers of course says, “Hey, where’s the moon?”. At which point I throw miniature beach ball at him and say, fuck, I don’t know.

The star data had been pretty straight forward, given out (after some searching) with a RA and Declination that just worked (once you did some gnarly calculations). Data for planets and other objects in our solar sytem (ahem, Luna you ass) however was much harder to come by. I’d been looking on and off for the last week, and just couldn’t find the right information on how to calculate a RA and Declination I could use for the moon. Until today. I needed an Ephemeris. Which is just a fancy way of saying data table. Now if only someone could tell me how to calculate an Ephemeris, eh, maybe I don’t want to get into it. That’s OK, go fucking NASA! They’ll do it for you. Awesome, exactly what I needed. Mad props to ‘jim m’ on the astronomyforum.net moon forum for the tip.

Android MapView Permissions and Prerequisites

Apparently you need the:

<uses-permission android:name=”android.permission.ACCESS_COARSE_LOCATION”></uses-permission>
<uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION”></uses-permission>
<uses-permission android:name=”android.permission.INTERNET”></uses-permission>

in your manifest file. Wasted a day on that INTERNET one! I swear it was working yesterday without it, but today I was just getting a blank map grid.

Other gotchas about MapViews:

  1. In the manifest file, those <uses-permissions> elements should come before your <application> element
  2. In order to define a MapView in an XML layout file, you can’t use a <MapView> element. Instead, you must have a <com.google.android.maps.MapView/> element, and you need to have a android:apiKey attribute in there as well, with a valid android maps api key. Not intuitive.
  3. Activity.findViewById is a very useful function
  4. The only type of Activity that can show maps is a MapActivity

Abbreviated Summary of All Joel Spolsky Articles

  1. I worked at Microsoft
  2. I worked at Juno
  3. I learned stuff about software
  4. Buy my software

Why Git Rocks

I’ve been a longtime subversion user and before that Visual SourceSafe (ew gross), but at the new jobby job, it’s all git all the time. Being very used to the pretty awesome TortoiseSVN and ZigVersion gui clients for svn, I’ve been a bit hesitant to really dive into git, not really knowing what to expect out of the experience of using shell only tools, and in general understanding why git was designed, and what the big deal was vs. svn, cvs, and other traditional source control management tools. Now that I’ve spent some time making Terminal.app my bitch (fodder for another post I’m afraid), I realize (not fully yet of course) how awesome getting into git can be.

So here’s a quick list of why git rocks, or why I think it does anyhow, and why it’ll be my tool of choice, at work and at home for quite some time.

  1. When you initially start working on a project someone else has started, already in a repo somewhere, you need to clone it. This is approximate equivalent of svn checkout, pulling the project down to your machine. The really big deal though, is that you now have, on your machine, a complete copy of the repository, not just a checked out working directory, but a full repo! Yes! The entire history of the entire project, and every file in it on your little old machine. Because most work is done locally, git is fast.
  2. It’s pretty space efficient and smart about diffs. Check this quote ripped from the Peepcode PDF on git: “The Ruby on Rails Git repository download, which includes the full history of the project – every version of every file, weighs in at around 13M, which is not even twice the size of a single checkout of the project (~9M).  The Subversion server repository for the same project is about 115M.”
  3. No muss no fuss. With svn, you end up littering your working directory with tons of .svn directories. With git, there’s just one .git directory in the root of your project.
  4. Rebasing interactively. Re-order, split, edit commits and then send them on their way. Sounds pretty odd right? Check out the interactive mode section over at the git doc page.
  5. Branching, for the win. If you’re used to svn, sourcesafe, cvs, or most other traditional systems, when you hear “branch”, you probably want to curl up into a little ball and die. Nightmares of manually resolving hundreds of conflicts, cats and dogs living together, fire and brimstone! Blah! First of all, git was designed to reduce these headaches so almost every bit of development you do ends up being done in your own little branch. You can freely commit to your own branches and switch back and forth between branches at your leisure (git checkout), pull everyone elses recent commits into master, while not at all disrupting your own branches. Files that have been modified but not committed to any particular branch will follow you around as you checkout different branches. This threw me off at first, but makes life so much easier.

I highly recommend that Peepcode PDF, and if you are looking for something a bit shorter, Git Magic by Ben Lynn is wonderful.

← Before