Joe Maller.com

Switching to Git

I resisted Git for a long time. It seemed a cultish thing with devout vocal followers and frequent mentions on Digg. I figured it would probably be a passing fad. I was wrong.

I drank the Kool-Aid and damn, it was tasty.

The first important thing to realize, especially when starting out and considering switching, is that Git works with existing Subversion repositories. That means the transition can be as simple as learning a few new commands, your repositories and servers don’t need to changing. Other team members don’t need to switch. If I had any other team members, this would be huge.

Of course, once you start using Git and see its potential, you’ll probably switch everything, convert your repositories and feel superior whenever you have to work with a Subversion hosted project.

Ultimately, Git is a revision control system and is fundamentally about preserving and protecting your working history. So feel free to experiment, it’s really hard to mess up.

It took me an afternoon to grasp the basic concepts of Git, or at least enough to use it in dumb-SVN mode. After about a week, I started to feel fairly comfortable.

I read a small mountain of weblog posts, documentation and the like, here are the ones I found most valuable:

And definitely watch Linus Torvalds’ Google talk about Git. It won’t tell you how to use Git, but he’s funny and the talk worth seeing.

Getting Git

While Git itself is easy to compile from source, getting the documentation manpages built on Mac OS X Leopard is a pain in the butt. I futzed around with it a little, but gave up halfway through installing a seemingly endless line of dependencies. The Mac binary installer works perfectly well and is kept up to date. I’d rather spend my time using Git than installing it.

Using Git

I was blown away by some of the stuff Git can do.

In the Google talk Linus pointed out how all SCM packages could do branching and branching wasn’t a problem. Merging was. Merging branches with Git is leprechauns and unicorns. It’s almost too easy. After a few days I found myself branching all over the place, constantly creating new branches to test any idea I was having. Folding those branches back in was almost always quick and painless.

Interactive line-by-line commits mean it’s possible to commit single lines from a file instead of the whole thing. This is great if you happen to go off on a bender and change a zillion different things between commits.

Cherry-picking is also great, and saved my butt when I created a pretzel of branch history. Using git-cherry-pick I was able to straighten out my history completely within Git using Git’s tools with no loss of work.

Conclusion

I started writing this post at the end of May, it’s now early July and I’ve been using Git for a few months with no regrets. The only time I hold my breath is when I’m pushing changes back to SVN, though it hasn’t glitched on me since early June. The speed and flexibility of Git are a constant pleasure to work with. The pain of merging branches, which used to take entire afternoons with SVN, has almost become an afterthought.

Share |

link: Jul 07, 2008 11:35 pm
posted in: misc.
Tags: , , ,

Really last minute WWDC predictions

Short this year, but I wanted to get something up.

  • New iPhone demo
  • iPhone not immediately available
  • 10.6 demo. No, this isn’t 10.5 SP1 (really!)
  • No new MacBook Pro, much as I want one
  • A cleaner architectural re-alignment of OS X from a developer perspective
  • Twitter will melt
  • AAPL will be up at the end of the day
  • I don’t see how they can launch the store until next week. Half the people here would be immediately flooded with support and administrative requests. There will be pre-launch resources available, but the store won’t launch right away.

    10.5 is great, but there are a lot of rough edges. The rumors about 10.6 being previewed are probably true, but I don’t think this will be a $129 upgrade. This will essentially be Service Pack 1. Apple isn’t Adobe, they won’t charge money to fix things that are broken.

    Twitter is going to add such a bizarre additional layer to this.

    And we’re walking in… or at least closer.

    Share |

    link: Jun 09, 2008 9:48 am
    posted in: misc.
    Tags: , , ,

On “seat meat” and padding your office

Dan Benjamin linked to a somewhat bizarre product, Thriving Office. While I can completely understand the thought behind this, the absurdity of it makes me a little sad.

I commented about how it was common to pad an office with “seat meat” for client visits. He then replied:

Is that really common? wow that’s a shame. I’d rather have no business than business based on false pretenses.

It depends on how it’s done. There’s nothing wrong with asking assorted freelancers to come in on a specific day. Especially if their being in the office helps convince a client that you’re big enough to handle an assignment, which then allows you to hire those same freelancers for that project.

Branding is fundamentally about crafting how other people perceive a company.

We dress up for meetings, as a sign of respect but also to give the client confidence in us. Is that superficial? Yes. But split-second instant judgements always are. Split-second judgements often make or break a deal.

An empty desk never says anything good about a business in the same way vacant storefronts or lots are bad things for a neighborhood.

As a business, it’s a whole package thing. We dress up. The office is cleaned. Seats are filled. Fresh flowers are put at the front desk. Nice baked goods and fruit are offered. Fresh coffee is brewed.

In a way, everything is a design problem. How a business communicates it’s own image is vital to it’s long term success.


Our sad GE Oven Saga

Normally I don’t like to use this site to vent or gripe, but I’m going to make an exception here.

For the past several months, the oven in our 3.5 year old GE Profile gas range (JGS968) has been half-broken. It leaks gas and won’t stay hot.

The problem is completely reproducible:

  1. Set oven to some common baking temperature, like 350°.
  2. About 5-10 minutes after the oven comes to temperature, the smell of gas will be noticeable. It has essentially “gone out”. The oven will start to lose temperature but the flow of gas seems to continue.

If the oven is turned off and restarted to again bake at 350°, the temperature will start out significantly below the 350° mark. Often, the temperature will then stall, never rising above the first sampled temperature.

The oven can be “re-lit” by rapidly opening and closing the door. Like a bellows. There is an audible ‘poomf’ and the temperature immediately starts rising again.

The stovetop burners work fine. The only time we smell gas is when trying to use the oven.

It should be obvious that this problem makes the oven nearly useless. Besides gassing everyone out of the room, it can’t hold a temperature so baking and slow-cooking are nearly-impossible. At least the broiler works.

I’m a repair guy, see I have a shirt.

So far we’ve had five visits from three different GE repairmen. Of the three, only one was worth paying. Of course we never saw that one again.

The first visit, way back in December, the guy came with some sort of gas-sniffing instrument, poked around for 5 minutes then told me to change the incoming gas line, that GE doesn’t cover that and it just cost me $100 for him to tell me that. I pointed out that there were no gas problems with the stove, which feeds from the same hose, but he insisted, swiped my credit card and left.

The second visit, was the nice and seemingly competent repair guy. After listening and poking around more than any of them, I’m seem to remember this was the only repairman who checked behind the oven, after asking a lot of questions (!), he replaced the igniter, and billed us for the part.

Third and fourth visits were the first guy again, but at least we’d been escalated so no more charges. First he determined it was a part which would need to be mailed to us. Part ordered, next visit scheduled. Next visit, part replaced. He waited a few minutes to be sure it worked, which wasn’t long enough, then left. We tried to cook dinner the next night and the problem was as bad as ever, or slightly worse.

Today I had the worst repair visit ever. After describing our completely reproducible problem in detail, the GE repairman told me that our problem was “not possible”, condescendingly implied that I was confusing the smell of a warm oven with the smell of gas and then left. Sure, I called GE customer service (800-386-1215) and constructively bitched them out, but it still cost me another half day and raised my blood pressure to Bruce Banner levels.

Our next repair is scheduled with an independent service company on April 1st. Fitting.

Epilogue


Fixing a Palm duplicate disaster

I recently came across an absolute disaster of a Palm Desktop data file while helping someone setup a new iPhone. It had 13,572 contacts, mostly duplicates. Judging from the number of obvious duplicate entries, my guess is the actual number will be somewhere around 2500 (it was).

Here is the process I used to automatically remove a lot of those duplicates and import the remainder into the Mac’s Address Book.

The first step is to get out of Palm Desktop as soon as possible. Select all contacts and export to a group VCard. This one was 3.4 MB.

Most of this will happen in Terminal, but a quick stop in BBEdit or TextWrangler will save a few steps later on. (TextMate tends to choke on big, non-UTF files.) The Palm export file is encoded in MacRoman. It’s 2008, pretty much any text that isn’t Unicode should be. I used TextWrangler to convert the encoding to UTF-8 no BOM (byte order marker).

VCards require Windows style CRLF line endings. While we could deal with those in Sed, we might as well just switch the file to Unix style LF endings in TextWrangler too. The TextWrangler bottom bar should switch from this:

MacRoman CRLF

To this:

utf8 LF

Now comes the magic.

While this could be done as an impossible-to-read one-line sed command, it’s easier to digest and debug as separate command files.

Here are the steps:

  1. Use Sed to join each individual VCard into a single line using a token to replace line feeds, output to intermediate file
  2. Sort and Uniq the result to remove obvious duplicates.
  3. Replace the tokens with line feeds

Below are the two sed command files I used. I ran these individually but they could easily be piped together into a one-line command.

vcard_oneline.sed:


# define the range we'll be working with
/BEGIN:VCARD/,/END:VCARD/ {

# define the loopback
:loop

# add the next line to the pattern buffer
N

# if pattern is not found, loopback and add more lines
/\nEND:VCARD$/! b loop

# replace newlines in multi-line pattern
s/\n/   %%%     /g
}

Run that like this:

sed -f vcard_oneline.sed palm_dump.vcf > vcards_oneline.txt

Then run that file through sort and uniq:

sort vcards_oneline.txt | uniq > vcards_clean.txt 

vcard_restore.sed:

# replace tokens with DOS style CRLF line endings
s/      %%%     /^M\
/g

# add the  before the LF at the end of the line
s/$/^M/

Run that with something like this:

sed -f vcard_restore.sed vcards_clean.txt > vcards_clean.vcf

After that last step, you should be able to drag the vcards_clean.vcf file into Address Book to import your vcards.

Suggestions for improvement are always welcomed.

Notes:

In VIM, type the tab character as control-v-i (hold control while pressing v then i), type the line break by typing control-v-enter.

iconv could be used to convert from MacRoman to UTF-8. TextWrangler just seemed easier at the time.

Palm Desktop appears to dump group VCards in input order, so duplicate entries were not grouped together. Running the output through sort visually reveals a ton of duplicates and makes it possible to use uniq to remove consecutive duplicates.

I had to quit and re-open Address Book once or twice before it would import the files.


Arcade Ambiance

This is what a good portion of my childhood sounded like, especially 1983. Andy Hofle has faithfully recreated the ambient soundtrack of coin-op arcades.

Share |

link: Feb 13, 2008 9:51 am
posted in: misc.
Tags: , ,

Microsoft and Yahoo: LAMP, meet WAMP

After the obvious desire to takeover Yahoo’s unmatched traffic, the thing that most struck me about Microsoft’s proposed Yahoo! acquisition was what they’d do with Yahoo’s extensive foundation of Open Source Software.

Historically, Microsoft has had a deep institutional phobia about OSS. But Yahoo! uses PHP extensively, and Rasmus Lerdorf, the creator of PHP, has worked at Yahoo! since 2002.

This seems to make no sense. Unless the OSS and PHP backend is something Microsoft wants.

On January 31st, Mary Jo Foley published notes from an interview with Sam Ramji, Microsoft’s Director of Platform Technology Strategy. Foley rightly highlighted this quote from Ramji:

“Our focus is getting OSS on top of Windows, and I’m focused on (providing) interoperability between the LAMP (Linux, Apache, MySQL, PHP) and Windows stacks.”

She also posted this PowerPoint slide:
LAMP, meet WAMP

Boom, as they say. Microsoft wants to legitimize Windows as the foundation for a parallel WAMP stack. What better way to prove the viability of WAMP than running the biggest PHP web site in the world?

Microsoft may have finally realized that Open Source can be seen as a competitor, but also as free labor. Google and Apple, along with Yahoo! realized that a long time ago. Why try and compete directly when you can subvert it by becoming the dominant platform that software runs on? Instant credibility, and instant influence.

So far we’ve only seen the first chapter of this story, or perhaps the first act of this tragedy. The next phase looks like it may turn out to be Microsoft, Google and others fighting over Yahoo’s unfortunate carcass and tearing it to shreds.

Steve Ballmer has giant brass balls and Microsoft most likely anticipated that Google would do something to interfere with the acquisition. Microsoft is on the move. This should be an interesting week.

Disclosure: I’m currently holding Yahoo! stock and have previously owned stock in Microsoft.



« Previous PageNext Page »