Tuesday, December 11, 2007

How To Walk Backwards to HTML 5

The more peeks I get at the HTML 5 spec, the more I dread it. We have barely shaken the last strongholds of crap-HTML since gaining some sanity some years ago. We put content in pages and we control style and layout in CSS, supposedly. Now, we see upcoming tags like article and nav and section, and all of it harks back to the days that were so dark in the web. I don't understand it.

If anything, we should take the suggestions of Douglas Crockford to heart. I want semantics in my content, not layout or anything related to it. I want themes and templates understood by the standard, not developed by a thousand projects in parallel resource squandering.

Any complaints I make about the upcoming HTML spec is completely trivialized by the fact that there is an upcoming HTML spec. Do you know how long it has been since any major shift in web formats? We're talking pre-Mozilla days here. I can't imagine the migration required with an internet the size we have today. The web makes a great platform, in my eyes, but upgrading the platform itself is working with the world's most ineffectively administrable network. Deploying can take years, even nearly to a decade.

We need to hold ourselves steady on the standards we can't even agree on today and just stop jumping on them. Break the foundations, crumble them down. Browsers are great at just working with what they're given. There is no such thing as an error, only being less affirmative. If we can take advantage of that, through arbitrary tags and attributes, we can really build something out of less.

Sunday, December 09, 2007

How To Not Open Your API Enough

So, I didn't see any opening for contributing in any useful way to the discussion about Google's new Chart API, until I read this post. How dare they call this service open. They should have been clear that their greed has lead them to secretly hide abilities of the service from the public, in an obvious attempt to corner the market on really cool graphs in web sites.

My theory is that they hope everyone uses their "Open" Chart API, which doesn't include the full service's abilities, so that their own charts, using the entire breadth of charting power, are inherently better than yours. Beware the wickedness of the corporate greed, my friend.

My sarcasm drips onto the floor. Now, I mean no disrespect to Marty, but this kind of post really does get under my skin from time to time. Maybe it just struck me at the wrong time. So what if Google has features they didn't document? So what if they use a different URL to access the API? Maybe the undocumented features are still in flux. Maybe they like to see how many people outside Google are using the charts. There are plenty of good reasons for everything he talks about them doing with this and claims it to have some anti-open nature, but I just don't see any of it.

For Google's Motivations This Means...

None of it really matters, in the end. Use the API or don't, but I don't see a gain for them in the parts of the API they are letting us use, nor do I care if they do gain. Gaining from something doesn't negate your ability to do it for the reasons outside your gain. My job involves writing software for a company that helps low-income families find affordable housing. I get paid for my job, so does that mean I can't lay claim to any good nature behind it?

Friday, December 07, 2007

How To Break Twitter


So I haven't realized it, but my twitters from the last day or so have gone unposted. Twitter pod is great, but its completely silent about authentication errors, apparently. The root of the problem is that I have two twitter accounts: ironfroggy and pythoncoders, which I intended as an aggregator of python twitter accounts. At the very least, a place to find other pythoners on twitter. Now, I haven't been keeping up on pythoncoders, so I decided to log in and update the followings, only to realize I forgot the password. Here in lies the cause of my troubles.

The twitter "reset password" form does not take a username. Oh, no, it takes an e-mail address, which I have two accounts with the same of. I crossed my fingers, went through the process, and seemed to be brought back to my ironfroggy account, so I decided to figure it out later.

Somehow, this process leaves the account with an unknown password, probably random or even null, or for some reason the fact that they accept multiple accounts with the same e-mail is not taken into account in code paths that should care about it.

I'm waiting for a solution, Twitter.

Wednesday, December 05, 2007

How To Join The Python/XKCD Rejoicing

I am saying nothing new here but I do this not for reddit votes, diggs, comments, or hits, but for love. This about a great online comic that completes my geek morning three days a week and the thing that lets me make all the big bucks: XKCD and Python, together at last.

Congratulations!

Tuesday, December 04, 2007

How To Insenstively File People Into Two Types

The development sub-blogosphere is abuzz with responses and responses to responses on the debate over splitting up developers into two camps. The core idea is that 20% of us care about software development and 80% of us just do our job and go home. We all like to think we're in the 20% and we probably are, because the 80% doesn't care enough to recognize the distinction. They might recognize those few geeks at the office who don't seem to have a life, of course. Is the debate centering around who is what group and what it means or that we are grouping so bluntly in the first place? Well, we are a binary loving people, after all.

For the 20% This Means...

We love to self comment. We're a relatively small slice of the populace spending an unusual amount of time talking about ourselves and this whole deal just exposes that. Who reads about the split between the developers that care and the developers that just pay the bills? Not the bill payers. Even if this all centers around what Mort can accomplish and what motivates him, he'll never read a word of it. Not much about this affects the 20% directly, so it leaves you wondering in this debate: what the hell is the point?

For the 80% This Means...

It means nothing to those who don't pay attention to what we're saying, and that is a defining characteristic of the people this whole thing centers around. We might be an inwardly reflecting collective of people, but this is the beginnings of the most important realization of our industry: that we are not our industry. Democratically speaking, we just want to do the job and go home. If we want all the improvements to process and quality we strive for, we need to make it for those of us, most of us, who don't give a damn about those very things.

I have friends doing this job because they "know about computers" so it seemed like a good fit or simply heard that "programmers make a lot of money." They do not read blogs and they refuse to stop using Notepad. I'm finally seeing a small interest in running Linux, but that's only because it might be getting to be an easier alternative, not a more powerful one. I can't get them to read books, talk about software, or understand why version control is better than tossing the code into a zip file every now and then, if they even do that.

What this means for the Morts is only what we make it for them. None of the things we're saying matter in their world, so the only differences are going to be what we actively decide to do about it. If we really care about the end result of quality in the work we produce, then we're going to need to stop talking and start walking. Put policies in place, work your way into management, and plaster the bathrooms with Google Testing material. Witness in the name of giving a crap about the software you write!

In the End it all Means...

In the end it should teach us to be less self reflective. We can't keep debating inward. We need outreach programs. Inner city schools are taught the dangers of guns and drugs, but the code pushers of the world need us to push all the things on them we don't realize isn't known.

Worse Than Failure has all of its material because the 20 and the 80 never talk.

Sunday, December 02, 2007

How To Recover Lost Git Branches

Daniel, at work, ran into a problem of accidentally removing a branch he had just created and made a commit to, thus loosing the days work. This was actually the fault of our internal scripts to manage the branching and merging policy we've set up. By "internal" I mean that I wrote them and it was my fault his whole day of work was gone, so that left it up to me to figure out how to repair the situation and salvage the current commit back from the ether. I thought it might be good to document, in the case that anyone else needs to do this.

This works in the case of branch A existing and branch B being removed after a single commit on it and branch B being from A. This means we know commit A and we need to find an unnamed commit, what was B, to recover it.

I can demonstrate the recovery process with a simple transcript.

ironfroggy:/tmp ironfroggy$ mkdir A
ironfroggy:/tmp ironfroggy$ cd A
ironfroggy:/tmp/A ironfroggy$ git init
Initialized empty Git repository in .git/
ironfroggy:/tmp/A ironfroggy$ cat >> test
a b c
ironfroggy:/tmp/A ironfroggy$ git add test
ironfroggy:/tmp/A ironfroggy$ echo "commit 1" | git commit -m test
Created initial commit 5b2401e: test
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 test
ironfroggy:/tmp/A ironfroggy$ cat >> test
1 2 3
ironfroggy:/tmp/A ironfroggy$ git add test
ironfroggy:/tmp/A ironfroggy$ echo "commit 2" | git commit -m test
Created commit 08217dc: test
1 files changed, 1 insertions(+), 0 deletions(-)
ironfroggy:/tmp/A ironfroggy$ git reset --hard HEAD^
HEAD is now at 5b2401e... test
ironfroggy:/tmp/A ironfroggy$ git reflog show master
5b2401e... master@{0}: reset --hard HEAD^
08217dc... master@{1}: commit: test
ironfroggy:/tmp/A ironfroggy$ git log master
commit 5b2401e38d400c3039a53a036f2d98f75d544056
Author: Calvin Spealman
Date: Sun Dec 2 13:27:25 2007 -0500

test
ironfroggy:/tmp/A ironfroggy$ git log 08217dc
commit 08217dc6ef8f8117d6c9e4bca6fe7f18f78559b6
Author: Calvin Spealman
Date: Sun Dec 2 13:28:01 2007 -0500

test

commit 5b2401e38d400c3039a53a036f2d98f75d544056
Author: Calvin Spealman
Date: Sun Dec 2 13:27:25 2007 -0500

test
ironfroggy:/tmp/A ironfroggy$ git merge 08217dc6ef8f8117d6c9e4bca6fe7f18f78559b6
Updating 5b2401e..08217dc
Fast forward
test | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
ironfroggy:/tmp/A ironfroggy$ cat test
a b c
1 2 3


The red line is the dangerous move that lost your commit. Now, nothing is actually removed from the repository, except for when you perform a garbage collection, so I knew we could recover this somehow. After a short time looking through the docs and asking a question or two on IRC, I arrived at the solution. There are logs kept on the changes that happen to refs (or branches), so I could use that to see the log of when that commit happened. You can see that and the commit the follows when the reset occurs and undoes our commit. The commit id is in the short version, but if we look at the log of that commit, we get the full ID and can simply merge it back into our branch. A very clean solution, indeed.

For Daniel This Means...

He didn't loose his whole days work, but he should be doing local commits more often so that any problems with our scripts can't show up in the first place. At least the work was recovered, and in short time. He is saved, for one more day at least, from being a disgruntled co-worker.

For Git This Means...

I'd love to contribute, so I'm thinking the git-fsck command needs something that can do this for you. Some operation to locate child commits would be really useful in these situations. Once again, I'm very happy with the move to Git.
I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.

I am happily employed by the excellent Caktus Group, located in beautiful and friendly Carrboro, NC, where I work with Python, Django, and Javascript.

Blog Archive