Archive for the 'geek stuff' Category

disturbing iphone correlation

I have to do more testing to be sure, but I think I’ve noticed a disturbing correlation between days when I listen to music on my iPhone on the way to work, and days when my iPhone decides to randomly show “No Service” and disconnect itself from AT&T.

I don’t really use my phone as an iPod all that often, and this issue hasn’t shown itself all that often either.

Notably:

  • A power-cycle has (so far) always fixed the issue.
  • I usually just unplug my headphones when I get into work, having verified once or twice that this “turns off” music playback.

Anyone else noticed this?

MinneWordCamp anyone?

Even though it makes me cringe every time I look at the code, I have to admit that I <3 WordPress. That is why I added my name to the Sign Up list over at the MinneWordCamp wiki as soon as I heard about it this morning.

Con-damnation!

I was just reminded about Con of the North, which is a local gaming convention. I’ve been meaning to go for years, but I never really know when it is. Well, guess what, it’s this weekend.

But I’m already signed up for Frozen Perl on Saturday, so I’ll probably just pay the one-day fee, and go on Sunday or something. (I have plans Friday night to see Jumper with Florence.)

In con-pletely unrelated news, I am someone’s version of nice stuff.

BigText.org

I spent a bit of time (probably too little) one afternoon this week searching for a website that created ascii versions of text. Instead, I found a command line utility called FIGlet, and approximately 4 hours of dev time later, (including 3 hours after about 11:30pm last night), BigText.org was born onto the internets.

Feedback is welcome/desired. I’m especially curious whether anyone can break it, as obviously security is a concern.

UPDATE: There are many other web-based figlet servers out there. I’m glad I didn’t notice them until now. I probably would have given up.

Typography in Code: A Field Guide to Whitespace, Part 1

We all know what we like and what we don’t like when it comes to whitespace in programming. I can only speak for myself, but here are some elements to consider.

One of the universally accepted natures of code is to indent where appropriate, and this first installment of Typography in Code: A Field Guide to Whitespace will focus on the various incarnations of the all-important topic of (queue thundering god voice) indentation.

Topic: Tabs versus Spaces

This primordial, often invisible question is at the heart of the indentation beast. Like good and evil, right and wrong, vim and emacs — tabs and spaces are diametric opposites, warring factions facing one another across a never-ending epoch in which all our text files are smoking battlefields. One kicker is that both sides use ninja assassins. YOU CANNOT SEE THEM COMING, until… that is… you find them lurking in your legacy code, buried at the beginnings of lines near the ends of your files, like trip mines in long forgotten functions.

This is when you spend hours constructing that one perfect regex to rid your code of the enemy once and for all. (Also, unless, of course, you are one of those odd ducks who likes to see their whitespace characters. I respect you, even if you are crazy.)

Where I fall on this fence: My heart titters for tabs. But I didn’t always believe in them! I admit it, I was once an indentation swing state. But here’s why tabs are king for indenting: Tabs are like using semantic markup. We all (mostly) want code to all indent the same width (no matter what that width is), and a single tab character means that width. You can even change this width (tab stop) with a single command in any decent editor. This alone should be enough for the triumph of tabs over spaces.

Topic: How wide?

Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3. (Linus Torvalds, From Documentation/CodingStyle of Linux, via wikipedia)

This is a trickier beast. I believe in the power of four. It’s more legible (discernible) than two, especially across dozens of lines, and eight is just too wide a gap. With a tabstop of eight, you only get ten indentations before you’re out of 80 column width entirely! This is as opinionated as I get, since four just looks right to me, and I can’t really cite any good reasons for it. Just take it from me: you’re an IDIOT if you prefer anything else.

Yea, and the number of spaces to equal one tab shall be four. No less, and no more. The number shall not be three, and the number shall not be five. Fuck that the number shall definitely not be odd. The number shall not be two, and the number shall not be eight. The number shall be four.

Truthfully, I don’t care what your tabstop is set to, as long as these things are true:

  1. I can set my tabstop to something different and the code doesn’t look all fucked up. This means, yes, tabs.
  2. Never use a combination of tabs and spaces. (Fuck you, default dreamweaver settings.)
  3. Tabs should never be used anywhere but at the beginnings of lines. (This violates #1, but is also a really bad practice for other reasons that maybe I’ll get into in a later article.)
  4. Consistency, consistency, consistency. (WTF BSD, WTF!?)

Extra Credit: Read (and care about) the wikipedia article on Indent Style.

Next topic: How many line breaks look the best: Between Function Definitions, In Functions, Around Comments, and more!

TypeSites

I love typography.

It’s true. I always have. I think think that, in the same way that most writers love words, for some of us, it just keeps cascading down. A love for prose and poetry leads to a love of words, which leads to a love of letters, which leads to a love of the shapes of letters… and then the spaces between letters… etc… etc…

Today my friend (and co-worker) Kyle launched http://www.typesites.com/, “a biweekly showcase of websites with interesting typographic design”. There’s just one review there… (for now), but it’s getting some attention already.

There was a brief time when I thought I would become a designer. But really I just wanted to shape letters on a page. I think this is part of the reason I ended up designing everything in black and white. For example, my brother Dan’s website, which I designed for him back in something like 2000, basically just uses his old email signature’s ascii art as navigation and design element. (I spent part of this last weekend re-vamping that site so he could use wordpress to manage his pages.)

In my present occupation, programming does actually fill some of these same needs. (I’m a bit of a syntax fascist, enforcing strict whitespace rules whenever I can.) Which leads me to an article on the typography of code, which another co-worker sent around the office today. I liked the article, but think it spent all its efforts on the fonts the author uses (or has used) to write code, which is really only one aspect of typography. I’m contemplating writing my own article, about the arrangement of code independent of font, a sort of field guide to whitespace in fixed width font environments. Then again, I’m lazy, so don’t expect it any time soon…

google reader… kicking more and more ass…

I was going to write this post about how I tried out iPhonify, and got google reader working on my iphone… but after cracking open Safari 3 for the first time, syncing my iPhone and verifying that yes, I did have iphonify in my bookmarks now, I opened up google.com/reader, and low and behold, I didn’t need iPhonify. Google reader has a sweet and simple iPhone skin already! God damn it was sweet. It was a bit on the simple side for my tastes thus far, but it was super fast, and super nice. I think the only “real” feature I missed was that I noticed it didn’t show my “read” posts at all… they just didn’t show up at all. On the real google reader they just get grayed out after you read em, which works for me, because I often want to go back to them after I’ve read them. Anyway, I was amazed. Google has read my mind again. Now I sound like a google fanatic. Google forever!

Ok, I probably shouldn’t really quit without saying that the wedding is LESS THAN TWO WEEKS AWAY NOW, MOTHERFUCKERS. Yes, I know that last probably made some of you uncomfortable, but tough nuts. I just woke up.

Yeah, so I also finished Thirteen weeks ago, and have since read Crooked Little Vein, (just finished it last night) all five of the Spiderwick Chronicles, Bridge to Terabithia (it made me cry, but didn’t have a damn bit of magic in it, lying movie trailers!!!), and No one belongs here more than you. Stories by Miranda July. That last was abso-fucking-lutely brilliant. She spins a damn twisted yarn, I tell ya.

Jason and I are going to attend this weekend’s podcamp, and try to get a comic book podcast started (probably after Florence and I get back from the honeymoon). That’s about it in terms of news. Ooooh, and Pete is blogging again over at Hanashimasen, in preparation for his impending sojourn to Japan. He’s my favorite writer-I-know. Yay!

first iPhone post

I’m writing this from my new iPhone. Florence got me a way-super-early birthday gift, presumably because she wanted me to have some time to play with it before the wedding… And then the almost two weeks we’ll be out of the country… Wouldn’t get to use it then either. Antway, it’s exciting. I literally have the internet at my fingertips.

word press tee-shirts, other spending

I would totally buy one of the new WP tee-shirts if they came in… you guessed it, black. The tee-shirts are simple and appealing, but only come in red. Yes, that’s right, one style, one color. Totally lame.

I’ve also been meaning to buy one of those cool greyscale firefox shirts.

On the other hand, Florence and I have been trying to save money for the wedding. It’s going to cost quite a bit more than we’d expected it to, but in spite of that, I splurged $25 this morning at amazon, buying the new Jasper Fforde novel, (and Phillip K. Dick’s Ubik because I’ve been meaning to read it, and it got me to free shipping).

I absolutely adore all of Fflorde’s novels, and hadn’t known this new one was out.

Last Friday at Midnight, Florence, Nate and I went down to Barnes & Noble for the big Harry Potter release night. Standing in line (or sitting in line) for over an hour wasn’t all that fun, but it gave me a chance to read the first of the Spiderwick Chronicles. (Nate read it too, we’d just watched the preview earlier that day.) I have to remember to request the rest of them from the library before the movie comes out. (Which reminds me I should really read the bridge to tarabithia someday… and then watch the movie.)

Anyway, I finished the final Harry Potter yesterday at lunch. It was the best of the bunch, as far as I remember. I teared up at the end. I was sitting on the stoop outside work, balancing a quesadilla on one knee, and the massive 759 page novel on the other. I can’t say enough about how good it was. J. K. Rowling (or her editors) did such a great job of making it fast paced and readable. It felt like she brought back nearly every character for at least a brief cameo (especially at the end), and tied up seemingly every loose end. It was a brilliant roller coaster of pure joy to read.

For someone who claims to like science fiction way better than fantasy, I’ve sure been on a fantasy kick lately. But it feels kind of wrong to go from Harry Potter straight into what I was going to read next… that Thirteen novel by Richard Morgan. I haven’t decided whether that’s ok.

LazyWeb wish: XML based auto ERD (in flash?)

I’d like to create my xml document, with generic items, and create some magical relationship attributes (or tree descendants), that specify where the relationships go. Seems like there should be stuff like this out there already… bonus points if it’s in flash and looks pretty. Even more bonus points if I can also specify an item’s date attribute and display the whole thing sorted by it.

Here’s the type of xml I’m currently imagining:


<item name="item 1" date="20070521">
    <relationship id="abc" />
</item>
<item name="item 2" date="20060211">
    <relationship id="abc" />
    <relationship id="123" />
</item>
<item name="item 3" date="19850101">
    <relationship id="123" />
</item>