Moved to Drupal
DrupalCampPDX
I took a break today from my work at Sticky building a website for a major sports apparel company that cannot be named, for DrupalCampPDX. Ben Kaplan and I did the keynote presentation this morning which was definitely an honor. I followed that up with a panel on best development practices which was a bit unplanned but went really well. This afternoon I'm doing a presentation on Views2 and Panels2, I'm a little freaked out on that since I've done zero preparation at this point.
Drupal6: Display block for one node type
This is a little snippet I came up with to get a block to show up on a single node type:
<?php
$menu = menu_get_item();
if ($menu['path'] == 'node/%' && isset($menu['page_arguments'][0]->type)) {
return $menu['page_arguments'][0]->type == 'story';
}
?>It uses the node type stored in the menu system so you don't have to match
arg(0) etc.
About that experience thing...
"There was a saying around the White House that if a place was too small, too poor, or too dangerous, the President couldn't go, so send the First Lady."
And Sinbad... and Sheryl Crow... and the First Daughter? Yeah, let's talk about experience and judgement some more.
Spring Break
Almost done with classes for the term. Got to do the presentation for my Capstone class tonight. I think next weekend I'm going to try to get down to Reno for the StickerGuy 15th Anniversary. I worked at StickerGuy in Chris McClendon place while he when went on tour back in 2000-something. It wasn't a good experience at the time but as Mr. Bynum always said:
"You either have good times or good stories."
And, at this point, they're good stories. So it'd be good to get down to Reno, see some old friends and bands that I hardly remember. I've gotta say that I'm most excited about seeing The Atomiks, The Scurvy Bastards, and Dragonfire -- the first two because they're great bands the latter because of this video I found on StickerGuy's MySpage:
Update: I totally forgot to mention that my little brother Charles and his friends Petar and Chuck are coming up this weekend. Petar wanted to see Agalloch play tomorrow night and I owe him big for helping me find a place to stay in Boston during DrupalCon. Should be a good time.
Getting PHP + GD working on Leopard (aka recompiling everything)
Here's my writeup on how to recompile PHP for Leopard to get GD working. The basic plan is recompile Apache and PHP from source. It may totally bork your system, I'm just writing it down so the next time I need to do this I can remember what I did. I wish I could give credit to all the places I stole bits from but I didn't do a good job of keeping notes early on.
DrupalCon Day 1
Made it out to Boston last night. I'd gotten upgraded to business class on the flight from Portland to NYC which was a nice treat. NYC to Boston in coach was a bit of a blow to my ego but the scenery made up for it. The highlight of the flight was looking out the window and seeing a white speck fly by, it was three white balloons. As the sun set we were flying through a beautify pink mist.
I'm staying with a friend of my brother's friends. Great place but it's an hour away from the conference center by train/bus so I was up early this morning. I've got a nice tickle in my throat so I hope I don't end up sick.
Here's the presentations I'm hoping to hit today:
Still need an Oink replacement
I still haven't found a decent replacement for Oink after it got shut down... or at least one that I can get an invite to. Do I have any sugar daddies (or mammas) out there that want to hook me up with an invite to waffles.fm or STMusic?
Update: got an STMusic invite!
Finally, applied to graduate
I spent an hour or so working my way through the school's bureaucracy to figure out how to apply to graduate. Met my CS Adviser... that I didn't know I had. I hadn't taken CS161 (Into to programming) and he helped me figure out how to get that waived. Once that was settled they pointed me in the right direction and I put in my papers to graduate at the end of the Spring term. Just need to finish up this term and then get my thesis taken care of and I'll finally be a college graduate.
Reason #902,423 why Java sucks
I've grown increasingly annoyed at Java over the years. I've taken to describing the language designer's philosophy as "If there's two ways of doing anything, pick the one that involves more typing".
All I want to do in take an array of numbers and convert it into a comma separated list, e.g. 1,2,3,4. Most modern languages make this easy:
- PHP:
implode(',', $data) - Perl:
join(",", $data) - Python:
",".join(data) - Ruby:
data.join(",") - .Net:
String.Join(",", data)
So how do you do it in Java? Well there's no built in method so you end up getting to write your own:
public static String join(String[] a, String separator) {
StringBuffer result = new StringBuffer();
if (a.length > 0) {
result.append(a[0]);
for (int i=1; i<a.length; i++) {
result.append(separator);
result.append(a[i]);
}
}
return result.toString();
}Maybe sometime around Java 9 they'll get around to adding it...
A smaller update
Been keeping busy. The dog keeps getting bigger and smarter. She's able to jump over the baby gates I've been using to pen her in the kitchen. She's also figured out how to stretch up and reach the counter so she can steal treats off of it while I'm not looking. But she's a great dog and I love her even when she is being a jerk.
Nick from NYC was out to visit last week. We had a good time and he was able to get all his stuff out of the basement of the old Russell Street house and mail it home. One of the highlights for me was last Friday when I hosted, what my friend Asia termed, Drew's Brews. Basically I invited a bunch of people over to help me drink the four gallons of porter that Steven and I brewed up. I'm hoping to repeat it again this weekend with a batch of pale ale.
This evening I went to Ignite Portland at the Bagdad Theater with Nick's friend Ingrid (who has a nice food blog). I was really impressed with the event, the speakers with the except the snake oil peddler who was trying to convince everyone that biodiesel is going to save us from our energy problems were all wonderful. I had a hard time picking favorites (though the history of the stick figure and why Germany loves David Hasselhoff stand out in my mind). I can't wait for the next one.
I just finished reading Queen of Candesce by Karl Schroeder. I'd read the prequel, Sun of Suns, last New Year's and loved it. I don't have the words to describe how amazing these books are. I'm just awestruck at the way he's able to construct a space opera that's convincing at every level; from the cloak and dagger intrigue of politics to the physics of constructing a city on the inside of a cylinder floating in air. In many ways it reminds me of the sweeping imagination and vision of the first Matrix movie (the big difference being that this sequel didn't suck).
A big update
It's been a while since I posted anything here. I'm a fan of bulleted lists so I'll just resort to one of those.
- Went to New York City. Stayed from Christmas to the 3rd and had a nice New Year's. Etta and I had some pretty major drama leading to...
- An un-engagement and break-up. No need to worry about planning a wedding now. Still need to call all the relatives... That said we're still talking, maybe we'll end up out on a date this weekend. What happens with Shasta and the house are open questions.
- Got a MacBook. The trusty old ThinkPad died. I'd sworn I wouldn't buy a Mac until they had a trackpad that you could right click. Someone had convinced me that the new Macs had two separate buttons in their trackpad but you and to enable the right clicking. Turns out they were full of shit and I'm left ctrl+clicking but it's still the best laptop I've ever owned. If you like UNIX then MacPorts.org is your new best friend.
- Booked a ticket to DruaplCon Boston. I used some frequent flyer miles. I don't have a place to stay or conference reservation but that kind of thing works itself out. When I went to the BeOS Developers Convention in Palo Alto back in '99 I ran out of money for a hotel room and slept in a park in the rain. I'm hoping to crash on someone's hotel room floor this time.
First post from the OLPC
I ordered one of the OLPC laptops through the G1G1 program back in November and after some miscommunication from the OLPC and screwups by FedEX it finally arrived. Several things--like opening it or connecting to a network--have been non-obvious but I'm pretty impressed overall. The keyboard is tiny.
Flex stops building the foo.html and foo-debug.html files
I've been trying to get up to speed on Adobe Flex for my CS Capstone project. I should mention, by some surprisingly enlightened decision, Adobe offers a free Flex license to students.
Everything was going great until I it suddenly stopped building the foo.html and foo-debug.html files that launch the foo.swf and foo-debug.swf files. Apparently other people ran into this too. I didn't figure out the proper fix for this but I developed a workaround based on a blog post by one of the Flex developers.
Basically, just rename the index.template.html to ${swf}.template.html and then do a clean rebuild. You should end up with bar.html and foo-test.html and be able to get back to work.
Replacing tabs with spaces in files
I've got a bunch of source code that I'd written with 4-character wide tabs. I needed to replace them with spaces. I'm ashamed to admit how long it took me to figure out.
#!/bin/sh
for i in *.[c,h]
do
expand -t4 $i > tabfree.txt && mv tabfree.txt "$i"
doneHopefully by posting this I'll save someone (read: me in six months) some time.






