We’re doing this all on the command line.

1) Stop the server

sudo /sbin/SystemStarter stop postgresql-8.3

2) Remove menu shortcuts:

sudo rm -rf /Applications/PostgreSQL 8.3

3) Remove the ini file

sudo rm -rf /etc/postgres-reg.ini

4) Removing Startup Items

sudo rm -rf /Library/StartupItems/postgresql-8.3

5) Remove the data and installed files

sudo rm -rf /Library/PostgreSQL/8.3

6) Delete the user postgres

sudo dscl . delete /users/postgres

7) Remove the LaunchDaemon .plist

sudo rm /Library/LaunchDaemon/com.edb.launchd.postgresql-8.4.plist

If you’ve seen errors that look like this when building large and complex projects:

[compc] _SomeClass_mx_core_FlexModuleFactory.as(15): col: 14 Error: Interface method get preloadedRSLs in namespace mx.core:IFlexModuleFactory not implemented by class _SomeClass_mx_core_FlexModuleFactory.

or maybe this:

[compc] _SomeClass_mx_core_FlexModuleFactory.as(15): col: 14 Error: Interface method allowDomain in namespace mx.core:IFlexModuleFactory not implemented by class _SomeClass_mx_core_FlexModuleFactory.

It’s time to upgrade or downgrade your SDK to match what everyone else is using because somewhere, somehow, your SDKs are colliding unhappily. Probably you’ll need to update from something like 3.3 to 3.4 or 3.5.

These are the slides from a talk I gave last week at Lycoming College in Williamsport PA. Enjoy!

I gave a presentation on Flex 4 at PDXRIA last night and it was pretty fun (despite my getting the time wrong and showing up 20 minutes late for my talk). The slides are here.

I’m looking for interesting projects to work on. That interesting can be the UX, the concept, your company itself, or the people that you have working on the project already. If you have one or more of those things, let’s talk. We might get along well :)

That new Google programming language looks great doesn’t it? Just look at the promotional text:

Go attempts to combine the development speed of working in a dynamic language like Python with the performance and safety of a compiled language like C or C++.

Sounds great right? So I’m on 10.6 and I want to start playing with this thing! In trying to do so I learned that if you’ve installed Macports, you’ll need to uninstall and reinstall everything, following these instructions. You might see a warning like:
Python support for SSL and HTTPS is not installed
when you try to hg the Go code. You’ll want to do:
sudo port install py25-socket-ssl
but you won’t be able to because you need to uninstall and then reinstall every port you put on your computer in 10.5. Once you do that though (and it’s lengthy, I know) you can get mercurial working properly and install Go. I realize that this post is misnamed and is actually about how to get you Mercurial install working and upgrading MacPorts, but I ran into all this trying to get Go working.

And I like it. A lot. Just in case you all were wondering.

Recruiter Fun

Jim has sent you an InMail:
.net / WPF/silverlight/C# consulting position in NYC
Hi Josh,

We have you in our database, but unfortunately your number goes to some poor woman who says in her voicemail, “I am not Joshua Noble”. You might already know this. LOL…

I really wish Google voice had been around earlier. Or that I’d just hired a secretary. Instead, I intentionally wrote my phone number down wrong on my Dice resume because I didn’t want people calling me. Guess we all know how that turned out. Oops. Sorry ma’am.

Are tricks good? Sometimes, yeah. Are tricks bad? Sometimes, yeah. So when are they good and when are they bad? Totally depends on the coder, the context, and the trick. Take this one from last weeks Portland Ruby Brigade:

while gets
	prints if ($_~/^Igal:$/)..($_=n/^$/)
end

What do you see there? If you didn’t shrug then you’re either a) the guy who wrote it or b) a genius. What’s in there is not the range operator but the little known flip flop operator. Check it out;

irb(main):010:0> items = [3, 9, 5, 2, 2, 8, 5, 9, 2, 2]
=> [3, 9, 5, 2, 2, 8, 5, 9, 2, 2]
irb(main):011:0> puts items.collect {|item| item if (item < 4)..(item > 4)}
3
9

2
2
8

2
2

Those blank spots are where the flipflop operator has been set to false. Still, I’m not a huge fan of that for readability reasons. It’s kind of like someone going Iron Chef at breakfast. Sometimes I just want toast, you know? Anyways, back to Peter Cooper and his bag o Ruby tricks. Some of them are pretty good. I like this:

# [*items] converts a single object into an array with that single object
# of converts an array back into, well, an array again
[*items].each do |item|
  # ...
end

Didn’t know that. Actually, that’s only the one I like most because I like a lot of them. 16 is good, 12, most of them. #8 though, that one gives me the heebie-jeebies.

does = is = { true => 'Yes', false => 'No' }
does[10 == 50]                       # => "No"
is[10 > 5]                           # => "Yes"

He admits it’s not the best example, but still, I’d hate to come across that. The nested ternary stuff freaks me out a tiny bit as well. So that brings me to another thing: I spend a lot of time reading code and writing code, but more reading it than writing it and more time using it than reading it. That gives me an order of preference: if you really are doing it for performance (note the quick discuss of the !! operator in the comments of Peters blog post, or some crazy ass inline ASM blitting code or whatever) then by all means have at it, homes. I will assume that you know your stuff backwards and forwards and that if I want to dig into what you’re doing I’ll be rewarded with sweet sweet nectar of performance gains. If you’re not getting a performance gain, because reading is #2 on my list of things, I’m inclined to say that maybe you should make it easier for me to read and understand. Not just me in particular, but me as in anybody else. Everybody has to know lots of programming languages today and it’s nice to speak in a way that everyone can understand given the multiple things they have to have floating around in their heads. Let’s try a not-entirely-accurate metaphor: everyone (pretty much) has to know English to do science. Now, I know English really well, does that mean I should go to the conference and start speaking to everyone in Joycean type punnery just because I can? Nah, probably won’t make many friends doing that. I should go and assume that it’s better to say: “Would you like to go for a walk around the campus after lunch?” than “Fancy a campus circumnavigation post-prandially?” or “Walkabout post-nosh?”. See, one’s more letters and words, but isn’t difficult for those who aren’t in my particular little group, my group being either people who know that I like to say things like “walkabout” for “walk around wherever we happen to be” and so on, or people who know I like fancy Latinate words (I actually don’t). That’s actually part of the sociological function of slangs and specialized languages: to tell you who’s in and who’s out. Back to programming languages, I’m not in on the Ruby world, and I’m definitely not in on the Perl world, so lots of the super-idiomatic things that can be done to condense without performance gain strike me as a bit funny, the same way parlor tricks strike me as funny: funny in the parlor, not in the not-parlor.

Re-Rubying myself

So the time has come for me to Re-Ruby myself. What, you may ask, OpenFrameworks, Arduino, and Processing not enough for you? Hacking around with Erlang, teaching myself some electrical engineering, and learning low-level C not good enough? Well, maybe. Maybe not. Anyways. I need a better web language. I’d like to say that it should be Python, and Python is awesome. But I know some Rails and I’m partial to it. And there’s a ton of fun friendly goofy silly stuff in Ruby. Were I a more serious person I’d be all over Django et al for everything I need but I’m not. So in order of name-dropping messing around for a day I started with:

Sinatra: I love you. I’d stop loving you if I actually had to do anything. I’d love you even more if I had a good idea for a nanosite.

Tokyo Cabinet: You and CouchDB. Are you CouchDB’s little brother? Not really. You’re different. I think you’re faster though that could just be me.

HAML: Nice. Stop freaking out about my indentations though. It’s lame.

MongoDB: TBD. Will I trade out TC for you?

Merb (again): Still like you a lot. Even though you’re less feature packed than Rails. That’ll all change soon though. Soon, all shall be…interesting.

DataMapper: Also TBD (note the .php at the end of their homesite, just for the irony of it)

So I’m definitely not making something important or even interesting to anyone else. Just a simple site to grab mentions of bikesnob from around certain places in the web. Like facebook. Totally silly, I know, but fun fun fun, and it’s a good learning exercise and that’s what I’m really looking for right now: some learning. And some fun. Oh, and by the way, I live in Oregon now. Go…em, Trailblazers (?) Whatever. It’s nice here.