Posts tagged Nerd

A Little About Code Names

Throughout the internet, you’ll find a slew of geeks who refer to their projects by “code name.” Realistically, this isn’t GI Joe, so there’s no real reason to need a code name for your projects, right? I’m here to argue that.

Since I’m involved in several web endeavors, there is always a lot of development code on my computers. When I start something like a firsttube.com redesign or something much larger, like an OSNews redesign, it doesn’t make sense to have a hundred folders called “osnewsv4″ or somesuch littered about. I used to date the folders, but osnewsv4-tuesday doesn’t help. And something like osnewsv4-20071017 doesn’t help much either.

Now it gets even more complex: what if I build something and then decide to approach it differently? How will I know which folder is the one that contains relevant code? Enter codenames!

When I knew I was going to build a brand spankin’ new version of OSNews, I knew it would eventually be called version 4, so it made no sense to start calling the first code off my fingers “v4.” As it turns out, there were actually almost 10 versions of “OSNews version 4″ before we accepted a codebase. The first ones were much different in both look and feel and code. So, for my own organizational purposes, I use code names. All that matters is which code base eventually gets promoted to the “version 4″ title.

So, here a list of the codenames I’ve used on my projects in the past, going back as far as I can remember:

I used to maintain an open source weblog called Flip, which later become Small Axe. Although Flip 2.0 may have had a codename, I can’t remember or find any reference to it. Flip 2.1 was called Lobster. Flip 2.2 was called Shark, although I never released that code, largely because before I finished it, I released Flip 3.0, Turtle. Flip 3.1 was to be called Jackrabbit, but again, I never released it. Flip 4.0 earned the codename Blueberry, but it was merged into the first release of Small Axe. We’ll get back to Small Axe in a minute. The nicknames of Flip were entirely random, they meant nothing, except that I wanted the 2.x and 3.x family to be animals, and for 4.x, a complete rewrite, I decided to use fruits. That never materialized.

A large part of why verison of Flip went entirely unreleased is because the app became big and tough to handle. As a result, I stripped out the core of it and released “Flip Lite,” which was called “Red Squirrel.” There was a running joke in college about a “blue raccoon,” so “red squirrel” was a silent tribute. When Flip Lite 2 came about, it was called “Rivet Boy.” Here’s why I called it “rivet boy”.

Small Axe Weblog took over where Flip left off – I really need to get around to updating it, since I’ve probably worked up to v 0.7 by now! – but the roadmap, along with the codenames, are listed here. They are codenamed after the japanese Iron Chefs and their popular guests.

firsttube.com itself had codenames, some of the time. firsttube.com 3 was “Milky”. 3.1 was Crossbow because it was built to be cross-platform. 3.2 was Scoop Face, because it was inspired by Scoop. 3.3 was “Semi-Scoop”, much for the same reasons. 3.3.1 was “Flip”, because it was the first version to use code from the Flip project. 4.0 was lazily called “Lobster” because it was running Flip 2.1. 5.0 was “Linkfarm”, because it was – for the few weeks it lived – a link farm. 6.0 may or may not have actually had a codename when I built it, but it was listed in one directory as, “Wikitube”, because it ran phpwiki software. I merged it and my weblog for version 7.0, which, along with 8.0, didn’t earn codenames. The recently released firsttube.com 9.0 was called “Chalkboard,” because at one point, I thought the header looked like a chalkboard. Obviously, it doesn’t anymore.

On to OSNews: Again, these codenames are mine and mine only, they are neither “official,” nor even known the rest of the staff, as it was only as I was developing code that I used the codenames. The now defunct OSNews Meta Blog is actually Small Axe, so it was in a folder called “Small Axe.” We renamed it “meta blog” literally days before making it live.

The OSNews Staff Blog used to be called ftblogroller, and I actually still have the very first working version on my company’s intranet test server. The funny thing is, I chronicled it long ago on firsttube.com. That was the engine of the OSNews Staff Blog. It also powers the OSGalaxy site, although there I refer to it as “Galaxy,” I never actually got around to packaging it.

Jobs.OSNews, an experiment that everyone liked but nobody used, was called Meadow, only because it was green.

OSNews v4 had a few codenames on my computer. “NEW” was one of them, as was “TCO,” which was an acronym for “three column OSNews.” The one that eventually earned the title version 4 was Blueprint, because I threw everything away and literally started from scratch. Even the queries that fetch data were rewritten to be most efficient.

Two projects in the words: “Timber” is the codename of a module that does OSNews native polling. Why Timber? A poll takes a tally, tally like tally ho, like timber ho!. I didn’t say they made sense or were funny, I just said I used them.

Another project that has had several lives already is the iPhone optimized OSNews site. I have gone through several versions of this code as well. Recently, I tossed aside “iui-osnews” and “knox” to really work on project “McBragg.” Commander McBragg was the general in the Underdog cartoons. I seemed to remember him going on several safaris, so I stole his name for my code. McBragg’s javascript framework and CSS is not finished yet, but the underlying PHP appears to be sound, so I expect to finish that within the next few weeks.

As you can see, having codenames can help a develper understand what code he’s looking at. It would not help me at all to see a folder called “firsttube.com-20060722″ because I wouldn’t know what version of firsttube.com or whether the code was even used on the live site. But certainly, if I saw a subfolder in my OSNews directory called “mcbragg,” I’d know it has relevent code. I think there’s something to be said for categorizing your code that way, plus, it’s kinda cool to have codenames. Yeah, I said it.

Vista SP1 First Impression

Vista SP1 was over 435 megabytes for me, making it larger than any Microsoft Service Pack ever, larger than any Mac point release, larger than many OSes themselves. Installation took well over an hour in three stages, which is suspicious, as again, I’ve installed OSes in less time. But it went smoothly and did it all on its own, which was nice.


Click the link for a larger picture

Booting up, there’s nothing immediately different. I tried copying a 28MB file over the network to check on time. It copied the first half in light-speed, but then stopped. I called the guy whose machine I copied from: “Hey, did you just shut down?” His response, “Negative, I lost connection all of a sudden.” Uh-oh, I thought.

But alas, after he rebooted, I copied the latest ISO of gOS, which weighs in at 535MB, and it told me 60 seconds, and by jiminy, it took about 60 seconds.

Thus far – after 30 minutes use – I’ve only noticed one new feature, it appears Vista SP1 has some new “modes” of desktop wallpaper display, and can finally “stretch” wallpaper. Thanks God, because my larger secondary monitor always had stripes with Vista RTM.


Click the link for a larger picture

So, first impression? So far, so good. My biggest pet peeve – the abysmal network transfer speed – appears to have been quelled (potentially, we’ll need more data for a final conclusion). I’ve long since gotten used to the graphics and learned to enjoy the subtle fade-in/fade-out of apps. I still am warning people to stay clear of Vista for some time, and still have no plans to roll it out at work in the enterprise, but I certainly think that Vista is coming along. I think there’s a better shot that when Windows 7/IE8 come of age, people will be willing to rethink things on a larger scale.

Integers on the Intertubes

Some time ago, I wrote an application for my company. Like most weblets I’ve written, this used PHP and either MySQL or MSSQL for the backend. This particular application logged all phone calls. As part of the record, it would record the caller’s account number, which is a 5 or 6 digit integer.

So, I got a phone call from the director of our customer contact department this week. He was concerned about the reports. He made a decision last week that when a call came in that was a lead – in other words, a non-customer, that his people would fill the phone number from the caller ID into the account number field. But when he ran his export reports, he found that hisn techs had entered this phone number for ALL of the calls: 429-496-7295. That’s weird, he said. So he called me and asked why that was. I checked all the calls and most were from one woman, so my first instinct was “Check if her browser has autocomplete turned on”. But he swore that he tried it too and gotten the same result.

I checked the database and sure enough, it was right there: 429-496-7295, in all of the fields. So I went back to the code. In short, I took the input from the form, and declared it like this:

$accountnum = (int) $_POST['accountnum'];

Pretty straightforward: explicitly declare the type. So, I started my debugging by attempting to manually enter the data into the database. Sure enough: the account key field showed this: 4294967295.

So, I went back to the PHP and started by dumping out the raw SQL query:

INSERT INTO calls ('','x','x','x','4294967295','x','x');

What? So the database automatically converts it to this weird phone number and PHP does too? Suddenly it occured to me. One of the benefits of 64-bit computing is the ability to address more memory. There are limits to what can be done in 32-bit computing, and one is that integers have a limit! In this case, a database field called “integer” is limited to numbers between -2,147,483,648 and +2,147,483,647. It just so happens that the number is the same length as a US phone number – 10 digits. Changing the db field to “BIGINT” allowed me to manually run the SQL query and it worked. But the app still didn’t.

PHP’s int() and (int) $var syntaxes both conform to the integer limit. So I devised a work around:

$ac = $_POST['accountnum'];
if(!is_numeric($ac) { $ac = (int) $ac; }

It’s not gorgeous, but it will more than suffice for an internal app. We web programmers don’t usually have to deal with big integers, so it’s totally possible that web developers would never have had occasion to handle a situation like this. Here’s looking forward to native 64-bit for our next server, though.

Live Blogging the Birth: Chapter 1

We’re at the hospital. We were just admitted – now it’s just a waiting game.

PHPsuexec and My Adventure With Hostgator

I left for vacation on June 28, and before doing so, I took a quick glance over firsttube.com and jotted a quick blog post about it. firsttube.com was fully functional and officially dormant for 10 days as of June 28.

Imagine my surprise when on Monday, my wife said, “Hey, your site isn’t working!” The index page worked, but none of the other pages.

In short, my webhost, Hostgator decided to implement PHPsuexec. Here’s the gist of this awesome program: typically, your web server runs as the “nobody” user on a server, but you login as yourself, say your username is “jdough.” You need to use certain tricks, like using .htaccess files and chmodding to get around certain limitations. PHPSuexec makes php run *as you,* removing the need for world writable directories and creating a need for custom php.ini files to replace certain php directives in your .htacess files.

Since my site doesn’t use file extensions on most files, I used a directive called DefaultType to make everything PHP. This stopped functioning when Hostgator made the changes on Monday. Instead, every one of the pages that relied upon that value for parsing stopped working and started displaying HTTP error 500.

When I returned into town on Sunday, I opened a high priorityt ticket with Hostgator. An hour later, I called the support line and was told an admin would reply presently. An hour later, I replied to my confirmation email to their email support line. Another hour later, I called again. After 35 minutes on the phone, they finally helped me get the pages running. But images across the site were broken. They were generating parsing errors! They were being interpretted by PHP. Yikes! Another 25 minutes on the phone today resulted in new .htaccess files everywhere. I should tell you that today’s phone calls were with two “gators” who were both very friendly and helped me very enthusiastically.

Hostgator did not email me about these changes, even though they have my email address. They did not call me, even though they have my phone number. They did not post anything in my control panel, even though they can. Instead, they posted it in their own support forums and expected me to check it. A major change to the very core of the server behavior and they simply didn’t tell me. And as a result, my sites were down for a week plus. So if you tried visiting firsttube.com in that time, I’m sorry for the interruption: the view page, the print page, the comments page, and nearly every other meaningful page failed to parse.

If I were a business and monetized my site in any way, I would immediately cancel. But to be fair, Hostgator has unparalleled uptime, unmatched availability, awesome tools (cpanel based), a competitive rate, and a friendly support staff. So I decided to give them one more chance. They have burned all the trust they gained with me, and I will not be recommending them to anyone right now, but I am not taking my business elsewhere just yet.

PHPsuexec is a great tool that provides a nice security boost, but do some serious testing before you implement it. It can dramatically alter the way your websites work.

EW.com is a Terrible Website

If you want an example of how NOT to write a website, go no further than the disasterous ew.com. Entertainment Weekly is a magazine to which I subscribe. It contains generally good interviews and articles about TV, movies, books, and all sorts of other cultural phenomena. For a long time, one of the more compelling aspects of the subscription was the website, which includes the oft updated “Pop Watch Blog” and the daily “TV Watch” section.

First, let’s examine the URLs. From time to time, I want to email someone a link to an interesting piece. It would be nice to say “ew.com/tvwatch.” But alas, that doesn’t work.

This cryptic URL scheme is often used by big companies, but sucks for search engine standing: http://www.ew.com/ew/tv/tv_watch/0,,,00.html is a valid URL. So let’s review:

http://www.ew.com -> base URL
/ew/ -> a servlet, perhaps?
/tv/ -> a subdirectory, or an argument?
/tv_watch/ -> same as above…
0,,,00.html -> why God, why?

Aside from this, the webmasters decided to use two different commenting systems in the site, one for the Pop Watch Blog and one for TV watch and other articles. At least one is based on Typead, and it sucks with a capital SUCKS. It filtered out words like “Peter,” which makes for a silly looking post when you’re commenting on the main character on Heroes, Peter Petrelli. It also thinks all sorts of comments are spam, and tells you so, even when your post is completely legit. To post, you often have to play a game where you go back and tweak and re-submit, over and over, ad nauseum. This leads to about 50% successful posts, 50% gave up trying.

Then their TV Watch boards — they’re so bad I don’t even know where to begin. Posting is a complete hit or miss. You’d submit a post, it would go through a magical redirection and then your post would be gone. The back button wouldn’t work. And if you tricked it back, the textarea would be emptied. You could post over and over and it would give no explanation of what happened or why the post was declined. Every single item would be 3 legit posts followed by “this board sucks.” It got so bad it was unusable.

And finally, EW heard us. I thought.

They took their boards offline for 4 days. FOUR DAYS. Their board consists of only two fields: name and post. This is four fields in a database: id, time, name, text. If you want, “isVisible.” The boards are unthreaded. There is no HTML at all permitted. This should’ve taken a competent programmer about 1 day, perhaps hours at best. But for EW.com, after 4 days, what they released is still a giant stinker. Check out today’s American Idol review. If the comments come up at all (embedded in an iframe, for some reason, that may or may not load for you), nearly every comment is littered with “****” in the middle of words or in between them. Nothing is actually censored, mind you, it’s just a silly, stupid bug that should have been noticed early on. And long lines don’t wrap, they just keep going and create a horizontal screen scroller.

EW.com is a terrible website. It’s poorly designed. It’s poorly architechted. The page titles suck and make it hard to share links. The boards are terrible and unreliable. Outgoing links are all encapsulated in Javascript – so middle click is broken. If EW had any sense, they’d fire the entire web development staff and hire new people who can fix the complete mess that is their online presence.

I will be moving over to E! for my daily celebrity/entertainment/trash news. And I am very seriously considering cancelling my EW subscription.

Look At Me, I Am Cool Because I Am Valid

I was playing around the other day on one of the many news sites I visit and there was an article about can’t-miss web site “footers.” So, I checked out these masterful designs and what did I find? Nearly all of them had “Valid XHTML” and “Valid CSS” links on them. Most, like my humble little blog, had fancy little 80×15 buttons too. And then it hit me – WHY!?

I am sick and tired of these buttons. Honestly, I don’t give a crap if your stupid homegrown blog is valid code, so long as it renders properly in my browser. I’m not using an accessibility application, and I wouldn’t stop visiting a site if it weren’t properly semanitcally marked up. I bet you very few external apps will choke if you enter a URL with an & instead of a properly escaped &. XML needs to be validated. HTML and XHTML don’t. HTML has survived because of so many browsers having such a capable quirks mode. Frankly, as of right now, I find the entire validation link concept obnoxious.

Slapping some tag on your page does nothing for your reader – if they truly have a screen reader or some such device, it will either work or not, no checking for a silly button. If the browser is a text-only browser such as Elinks, it will either render or not, but ironically, it will not display your stupid “Valid” buttons.

Furthermore, for almost every blog, validity is a product of dynamically build pages and feeds born from a database backend, and unless you are doing lots of checking, validity can be comprimised by invalid input, regardless of the quality of code.

OSNews v3 was written to render in virtually every browser, and to do so, it uses Eugenia’s mix of HTML 2 and HTML 3, a subset often called C-HTML. The code is just plain ugly, but it works. And it sure as hell isn’t valid.

Maybe it’s blasphemous for a web programmer to say such things, but the fact remains, bragging about or advertising your validity is pointless, and I think most of your readers have trained themselves to ignore it. Also, if your code works and renders properly, what difference does it make?

I’m sure people out there disagree and will tell me why I’m wrong. But in the meantime, I will be removing the buttons from my site the next time I edit my blog code. Pffft.

OSNews 4, Yet Again

I have carried on more than I probably should about OSNews 4 recently, but it’s because I’ve been doing so much work on it. The site is mostly functional – nearly all the heaviest lifting is done, large parts are implemented and working.

As of today, we have AJAX moderation, super improved comment reply mechanism that allows you to quote an author, and a new, experimental system called “starring,” not stolen from Google but awfully like it. You can “star” stories much like a story bookmark, you can bookmark comments to later refer to, and you can “recommend” stories, which are stories you think other OSNews readers should check out.

I also added a nice touch feature – user avatars. I think avatars help users to recognize each other, and they add some “spice” to an otherwise simple look. I’m pretty excited about it, but obviously will not be building the upload form until my image resize scripts are ready. I generated my own avatar, now I need to find a nice way to resize in a secure fashion. It’s all very cool. To do what sites like Flickr do, I think I’d need Flash, so it’s pretty simple: you upload and I resize to avatar dimensions.

So moderation is all AJAX based now, which is really super cool, and works just like you’d expect – you can vote up or down, the score updates, the comment collapses when voting down… it’s exactly what I wanted when I envisioned it. Soon it will throw useful error messages instead of v3 error “codes.”

I hope to have the comment and submission forms working soon. If all goes well, we’ll do a public beta in February or March and rollout this spring. Promises to be very exciting.

OSNews v4 Logic

I was playing with an outlines of OSNews version 4 today. I have started sketching out some ideas that I intend to implement geared at making the site more consistent, easier to use, less complex, and less heavy from a code standpoint.

One of the major areas to improve is commenting. I am going to change the way threading works almost entirely.

First off, comments below your threshold will not disappear anymore. They will simply be collapsed and greyed out. Yes, this is a bit digg-ish, but we had to implement a lot of complex code in order to compensate for parent comments that were below threshold. So unless a comment is administratively hidden, they will show and be un-collapsable via Javascript (I don’t know if it will be AJAX or just Javascript div swapping). I think this is a better solution than we have today.

Secondly, moderation will definitely be AJAX-based.

Thirdly, I haven’t “cleared” this with David, but I think flat comments will be hard coded to view all in one page. It’s so much easier on the database to use a single, easy light query than to force several page loads and hit the db over and over.

Next, the comment template will be unified. Currently, there is a flat template, a threaded template, an admin flat template, an admin threaded template, and a reply template. I’m going to fix this nonsense.

In the process, I will clean up commenting. Comments use a ridiculous chain of includes just to produce a comment. This is the effect of hacked feature upon hacked feature of v3, and v4 will fix this.

Other changes: the user page will be streamlined to display user information as well as provide a base for recommendations, etc. Currently, it’s trying to be too many things.

Lastly, I intend to clean up the URLs. While preserving all valid links, I want the URLs to be prettier and not have file extensions. Jobs.OSNews is a good example of what I’d like to see via the URL.

Anyway, if you have thoughts about features, etc you’d like to see, feel free to leave a comment.

Reaction to Recent OSNews Pieces

I missed the hoopla over the last week stemming from Thom Holwerda’s piece on OSNews called Has the Desktop Linux Bubble Burst? His follow up piece, entitled On Favouritism, Apologies, and Black Helicopters, which sounds like the personal musings of a short story author, attempted to clarify his points.

I have a lot to say on this, so if you’re interested, read on for the meat.
More >