Computers, Open-source, Software

Show matching git ref names

Have you ever fired up a git GUI and seen the lavbels next to commits indicating matching ref names? View my protip to find out how you can do this from the CLI:

https://coderwall.com/p/pxgokq

Computers, Open-source, Ruby, Web

Making Rails Routes Fantastic

I took a week off from work to move into our new house. It was a time of rest, and relaxation despite the chaos around what moving can bring. I’ve had a few personal projects on the back burner, but never seemed to have the time or the energy to make much progress. Recently a talk with a friend reminded me how important completing those pet projects can be for your personal happiness. I’m proud to present the completion of an idea I’ve had a for a while: Routastic.

What is Routastic? It serves as an interactive Rails routes editor. Simply, I got tired of the pattern of modifying config/routes.rb, then running rake routes and grepping for some result. This is completely inefficient. My inspiration came from the beautiful Rubular.com and its interactive regular expression building. Its quick. Its painless. Its a valuable tool for everyday programming.

Please check out http://routastic.herokuapp.com/ and let me know how I can improve it.

Special thanks to Avand Amiri for suggesting the name (despite the name screaming Web 2.0, it actually is quite memorable!)

Events, Family, Open-source, Personal, Software, Thoughts

Working for a Development Firm is Like Being a Rented Sports Car

As my last post alluded to, I am leaving my current development firm. The reason is primarily a boost in earning potential at another employer, but also a culture change. To explain the culture at a development firm I created this analogy:

Imagine you rent a Mustang, or a Corvette. (Of course you are gonna get the insurance!) What are you going to do with that car? Everything that you fucking can! You are gonna imprint the gas petal into the floorboard, and drive fast and wreckless. After all, you have to get every dime you can out of your rental before your time expires right?

Now imagine you own a Mustang, or a Corvette. Yeah, you would probably hot dog it, but it also your purchase, so if you wreck it, you are gonna be upset with yourself. In other words, you are going to maximize your purchase by caring for your vehicle, and obeying the speed limit (most of the time anyway).

I have just described the difference in my view of an internal development team, and an outsourced development team. Clients want to maximize that dollar when they outsource, which is done by getting the most work in the least amount of billable hours. They want the sports car rental. They aren’t going to set a moderate pace; they are going to speed! I’m not saying that all development firms, or all clients are like this (I’ve worked with great clients in the past). But I am saying there is a struggle between maximizing value and being realistic about what you promise.

How does a client pick your development firm? By your firm being the lowest bid. They understate the hours needed for the work. They over-promise features on an unrealistic deadline. When Company A quotes $100k under Company BCompany A gets the work. And the client isn’t going to be cool with missing deadlines, or cutting functionality. So now management is in a battle with the client who is pissed off because the original bid was unrealistic, and wants to rectify the problem. That shit rolls down hill to you – the developer.

And I can tell you, its not possible to write good code faster. Someone micro-managing me, asking me what I’m doing every five minutes isn’t making me any more productive.

There are lots of companies that push hard. You can make a good living working for these places as long as the compensation, or bonuses are commensurate with the work that you put in. But busting your ass all day, every day – every day feeling 10 hours long – every day being full of epic code pushes, and near impossible deadlines met in the 11th hour – that is a young man’s game. That is pretty appealing when you are 22, fresh out of college, and eager to prove yourself to the world. Stressing out at 4:50 on a Friday, trying to get something delivered while your wife and daughter patiently wait for you to get off work just isn’t worth it. I’d rather enjoy my time with them. I’m not mad about it – its just how the game is played.

Which is why this Sports Car is up for ownership. He is done with the rental game, being driven too hard, too long. He wants a nice garage somewhere, and a driver that just takes him out on Sundays for a trip around town. I want to spend time with my daughter while she is still young, instead of delivering some milestone that I wont remember in a month. If I wanted a stressful culture, I would have worked for a startup. Then at least I have some small chance of hitting it big when we get bought by Google.

Open-source, Personal, Software, Thoughts

The Great ICS Upgrade Scandle: Everyone Just Calm Down

I have been hearing an increasing amount of chatter lately about the infamous Ice Cream Sandwich (ICS) delays for Android. I want to discuss the actual impact, and propose some resolutions to this problem.

The article that inspired me to write this is Jason Perlow’s post “I’m sick to death of Android“. Hopefully that title is a hyperbole, but it does address the primary issue that I have with people complaining about ICS delays – I don’t see it as show stopping. Name me the new features that are in ICS? How is this OS upgrade going to change your day-to-day phone experience? Sure it would be nice, and there are probably plenty of small touches, but this isn’t revolutionary.

Jason is the (proud?) owner of a Motorola Xoom tablet, and the Samsung Galaxy Nexus. The former was recently acquired by Google, and the latter of which is a Google Experience handset, meant to be a developer reference device. He argues that not receiving timely updates has caused him to “throw in the towel”.

I can sympathize with him about not getting updates on his Galaxy Nexus device, as its primary marketing angle appears to be “first” when it comes to updates. If I had dropped the money on that phone, I would be upset if major updates weren’t being released. However, Galaxy Nexus already has ICS, and he is addressing other updates from “bugfix iterations”. Not too exciting. I feel less bad for him about his Motorola tablet. Unless Jason is clairvoyant, he didn’t buy the Motorola tablet because of its strong candidacy for timely updates from Google after they acquired Motorola.

The Problem

ICS was released by Google in October 2011, which has been six months ago, but still accounts for only 1.6% of distribution of Android versions. I can’t defend that. It is a red flag for major distribution problems. Apple’s iOS adoption rate reached 61% in only 15 days and people are tempted to draw a comparison. Google’s Android, and Apple’s iOS are both mobile phone platforms, however they are operating on completely different distribution models. Android was never meant to be a closed ecosystem like iOS. You can’t install iOS on non-Apple hardware. You can with Android.

I think a more apt comparison is between Google and Microsoft’s distribution models. Microsoft makes the Windows operating system, and hardware manufacturers install it on their devices. Its not exactly the same since Microsoft charges for upgrades, and you bypass the hardware vendor to install the upgrade on your device. The mobile carrier middle-man is also non-existent in the Microsoft model.

When Google releases an Android OS upgrade, and handset manufacturers push it to their own devices when they are ready. Further, the mobile carrier may withhold a device OTA update until it deems it is ready (or even necessary). Handset manufactures have clearly prioritized selling new devices over supporting current devices. I’m sure they have ran the numbers, and have made this decision because it yields the most profit. They are a business after all. Apple pushes these updates because they get a cut of every App Store sale, and a failure to upgrade a device is a potential loss of revenue.

Why would a mobile carrier dedicate resources into deploying an OTA update for devices that are “working just fine?”. It comes down to money again, and their decision is clear. Apple probably provides monetary, or exclusivity incentives to the mobile carrier to push their updates. There are many Android phones, but only one iPhone, so carriers probably acquiesce to Apple’s demands.

Solutions

So how can we make this work, without abandoning the entire Android concept over just this one issue?

Incentivise upgrades for carriers/handset vendors. What if OS updates were not free, like in the Microsoft model? A nominal free for upgrading may offset the costs of handset manufacturer, and carrier costs for supporting such an upgrade. Businesses like money, and Ice Cream Sandwich is worth something to me, especially given that most of us are locked into a two year contract anyway. I would rather put some money towards an upgrade now, then wait until my contract runs out to upgrade to a device that has the update.

Educate ourselves. There is no correlation between handset manufacturer’s sales and past performance on OS upgrades. This doesn’t seem to be an issue with the majority of consumers with Android devices. Without it affecting sales, there is little reason to divert resources into maintaining already sold devices.

Open the device boot-loaders. Maybe OS upgrades aren’t the responsibility of handset manufactures or mobile carriers at all, like in the Microsoft model. If people who wanted the OS upgrade had a way to load the update themselves, then this would act as a pressure release value for the current scenario. The idea of a locked boot-loader seems to be archaic anyways, and is rooted in fear. Let the consumer own their own device and do with it as they please.

Make a kickass OS upgrade, and drive consumer demand. Ice Cream Sandwich just seems so lackluster to me. (Maybe I stopped believing it was so cool to keep from going crazy). Short of a few new features, there isn’t anything game changing about this release. Android has plenty of problems that are within the realm of the OS to address. Give me greatly improved battery life, blazing fast performance, zero boot time, fantastic reception, FM radio, overclocking abilities; something – anything to get me excited about an upgrade. I don’t see ICS as changing the day-to-day use of my phone in any meaningful way, and thus I’m not rallying hard for it on my device. I can’t imagine I am alone in patiently waiting for this meek update.

Forget UI customizations; the differentiator should be upgrade latency. People have prophesied about the race-to-the-bottom happening for Android devices the same way it did for PCs. Manufacturers are differentiating themselves in meaningless ways, such as skinning the stock Android UI, or building useless shit that consumers don’t care about. These customizations prolong upgrade turnaround times, when in fact manufacturers should be doing the opposite. As OSNews.com’s Thom Holwerda states: ” they’re wasting considerable resources on useless and ugly crap that does nothing to benefit consumers. Android may have needed customisation a number of versions ago – but not today. ICS is ready as-is. TouchWiz and Samsung’s other customisations add nothing.”. Instead of scaping the bottom of the bucket for ideas on how to differentiate, lets have one manufacturer try this. Hopefully stronger sales would substantiate the idea that consumers care about OS upgrades.

Acknowledge that the lifespan of a phone is only two years. The predominate cell phone sale model in the US is one of subsidized hardware. You pay inflated monthly prices to offset the cost of a low up front purchase cost on your device. Most people upgrade devices at the end of their contract period, since the inflated subsidized price never drops anyway. It is in your best interest to have the latest and greatest because the current model is so abusive to consumers. This being said, the average lifespan of a phone is around two years. How many major OS releases will occur in that timespan? Probably just one. Maybe this short lifespan doesn’t justify the need to have these devices be upgraded at all. Remember that computer you may have bought because it had extra slots to upgrade the memory? Did you actually fill those slots, or just buy a newer faster computer a few years later instead?

Final Thought

So Jason, enjoy your 2.3 experience, because it is probably near identical to the 4.0 experience you are dying to get. I wouldn’t throw in the towel yet on Android because ICS is taking a while to come out. It will get here, and as soon as Google is hurt by lack of adoption they will take action. I hope that my solutions provide some food for thought on how to fix the current problem. Instead of compulsively pressing the “Software Update” option, I’m going to enjoy my experience, and stop letting the media dictate how I should feel. Though “fragmented” we Android users may be, an app targeting the 2.1 platform can be run on 97% of the current devices. That is what developers will be targeting, and I’m sure I’m not missing much from the other 3% of apps that I can’t run before I receive my update.

Computers, Open-source, Web

Configurable Javascript In Place Editor

Why do we need another in place edit library for Javascript? This one is different of course! This library allows for a high degree of customization due to its modular nature. Each action on an in place edit object (submitting on blur, adding a class on focus, toggling a label on click, etc) is complete isolated and designed to stack with each other. This allows for one library to accomplish a wide variety of in place edit functionality in the same project. You can even have different functionality on the same page if you wish.

Setup is a breeze. Just grab the latest copy of the Javascript library from https://github.com/bsimpson/in_place_edit. You will need to be using jQuery in your project, since this plugin depends on it to work. Once you have include both jQuery, and in_place_edit.js, you can initialize it like this:

  $(function() {
    $('.in_place_edit').inPlaceEdit();
  });

The argument passed is the CSS selector that contains the form on which you wish to use in place edit.

Next, we need to configure the form to tell it what actions we want it to perform. If we want basic edit in place functionality, we can add “submit_on_blur” to have the form submit when a blur event is received. Note that this only occurs if the contents of the form have changed, in order to save on the number of server posts.

<div class="in_place_edit" data-in_place_data="submit_on_blur">
  <form action="#" method="post">
    <input type="text" name="foo" value="foo" />
  </form>
</div>

The options are simple, and the combination are many. Check out the following options to see what you can do with your form fields on the DEMO page.

Happy in place editing!

Update: This plugin has been updated to be a jQuery plugin. Thanks to jsumners for providing lots of help!