Friday, October 01, 2010

Dear would-be start-ups: an exit is not a business plan.

No. NO.

NO.

An exit is not a business plan. An exit is like some kind of Christmas surprise: it's instant money, winning a scratch-off lottery ticket when all you've got in your pocket is 32 cents and a half-used condom. Saying that your business plan is "to exit" is essentially saying that you've got gambling issues and need to check in to rehab.

I get a lot of offers for revenue sharing (my position being anywhere from developer to CTO) and the business plan almost always, invariably, bad. Very bad. But the worst are exits, where the founder plans to "float" on whatever savings and investments he can get on the slim hopes that he gets acquired and we have a major payday. It's insane.

Insane.

Stop doing it.

Because you know what the worst part about it is? Some of these people have very good ideas, great for monetization, but because they're so adamant about their major payday, they're going to end up with nothing instead of the something they could have had.

Monday, July 19, 2010

FGLRX + Black Bars at 1920x1200 (or 1920x1800).

When I first enabled hardware accelerated drivers in Ubuntu, I thought I had stumbled across an odd bug -- when I was using the default resolution (1920x1200), I had two black bars at the left and right side of my screen. I was totally stumped, and decided it was a driver bug.

Fast forward a month later, trying to enable hardware accelerated drivers again, and the same issue persists.

Well, apparently the fix is pretty trivial: Open up the "Catalyst Control Center" (in your System --> Preferences menu entry), select your current display, go to the adjustments tab, and for scaling options, move the slider all the way to the right (0% in other words). See attached picture.


Saturday, June 26, 2010

Separate vendor prefixes for CSS sucks

Seriously.

Here's my Sass mixins for some CSS3 stuff:

@mixin box-shadow($color, $radius = 1em) {
-moz-box-shadow: 0 0 $radius $color;
-webkit-box-shadow: 0 0 $radius $color;
box-shadow: 0 0 $radius $color;
}

@mixin transitions($properties, $duration, $delay = 0) {
-moz-transition-property: $properties;
-webkit-transition-property: $properties;
-o-transition-property: $properties;
transition-property: $properties;

-moz-transition-duration: $duration;
-webkit-transition-duration: $duration;
-o-transition-duration: $duration;
transition-duration: $duration;

-moz-transition-delay: $delay;
-webkit-transition-delay: $delay;
-o-transition-delay: $delay;
transition-delay: $delay;
}


and here's where they get used:

.post.snippet:hover {
@include transitions(background-color, 2s);
@include transitions(box-shadow, 2s);
@include transitions(-moz-box-shadow, 4s);
@include transitions(-webkit-box-shadow, 4s);
@include transitions(box-shadow, 4s);

@include box-shadow(#0481B5, 1em);
background-color: #0481B5;
}

Which results in this:

.post.snippet:hover {
-moz-transition-property: background-color;
-webkit-transition-property: background-color;
-o-transition-property: background-color;
transition-property: background-color;
-moz-transition-duration: 2s;
-webkit-transition-duration: 2s;
-o-transition-duration: 2s;
transition-duration: 2s;
-moz-transition-delay: 0;
-webkit-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0;
-moz-transition-property: box-shadow;
-webkit-transition-property: box-shadow;
-o-transition-property: box-shadow;
transition-property: box-shadow;
-moz-transition-duration: 2s;
-webkit-transition-duration: 2s;
-o-transition-duration: 2s;
transition-duration: 2s;
-moz-transition-delay: 0;
-webkit-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0;
-moz-transition-property: -moz-box-shadow;
-webkit-transition-property: -moz-box-shadow;
-o-transition-property: -moz-box-shadow;
transition-property: -moz-box-shadow;
-moz-transition-duration: 4s;
-webkit-transition-duration: 4s;
-o-transition-duration: 4s;
transition-duration: 4s;
-moz-transition-delay: 0;
-webkit-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0;
-moz-transition-property: -webkit-box-shadow;
-webkit-transition-property: -webkit-box-shadow;
-o-transition-property: -webkit-box-shadow;
transition-property: -webkit-box-shadow;
-moz-transition-duration: 4s;
-webkit-transition-duration: 4s;
-o-transition-duration: 4s;
transition-duration: 4s;
-moz-transition-delay: 0;
-webkit-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0;
-moz-transition-property: box-shadow;
-webkit-transition-property: box-shadow;
-o-transition-property: box-shadow;
transition-property: box-shadow;
-moz-transition-duration: 4s;
-webkit-transition-duration: 4s;
-o-transition-duration: 4s;
transition-duration: 4s;
-moz-transition-delay: 0;
-webkit-transition-delay: 0;
-o-transition-delay: 0;
transition-delay: 0;
-moz-box-shadow: 0 0 1em #0481b5;
-webkit-box-shadow: 0 0 1em #0481b5;
box-shadow: 0 0 1em #0481b5;
background-color: #0481B5; }


...

So, yeah: I'm switching to jQueryUI for most of the animation heavy lifting, now. Hopefully browsers start dropping the -moz, -o and -webkit for primary use and settle on -v (vendor) or something like that in the future. Maybe with fallbacks to their own prefixes in case someone really really really needs to specify that -moz handles it another way.

Wednesday, June 09, 2010

Rails 2.3.8 + HTML strings.

Be careful with doing concatenating inside of ERB views with Rails 2.3.8.

This recently broke an app that concat'd (via '+') two strings full of HTML. Before you ask, no, I don't know why anyone would do that in a view of all places.

The quick fix was to call String#html_safe on the second string (I didn't check to see if there was any other solution since the fix was urgent).

Without String#html_safe, what ended up happening was that the 2nd string's HTML was escaped -- thus breaking the app in a few places.

Sunday, June 06, 2010

I'm a Penguin.

For the past 2 years, I've been keeping my personal life Windows powered, and my development life Linux-powered.

No more!

As of two days ago, I have replaced my Windows machine with a shiny black Ubuntu box. Three years ago, when I purchased my Windows Vista laptop (thinking it couldn't be all that bad, HO HO HO WRONG), there were still several desktop applications that I used on a regular basis.

When I decided to upgrade again this year, I took a long, hard look at my desktop usage for a few days.

One desktop application (that runs fine under Wine, by the way), and Chrome. That's it -- my computing life essentially consists of nothing but webapps.

So when it came time to upgrade, I had a simple choice: Windows 7 or Ubuntu. I've long sinced used Ubuntu for my development PC, and I was very comfortable with it. It's got great hardware support and it's fast as hell (my developer machine is specc'd lower than my Windows laptop, yet performs much better).

So, given a choice between two almost identical operating systems in terms of functionality, which one do you choose?

The free one.

Thursday, May 20, 2010

I love Sproutcore, but I hate it.

Sproutcore is awesome -- it's a framework for building rich web applications. It's got a lot of nice widgets, the default theme is pretty, and it uses an MVC-style pattern.

The problem is, I hate it.

A long time ago, I used to be a desktop developer, primarily .NET apps. Unlike HTML, when you're creating the user interface for a desktop application, there's no markup language you can use, like HTML. Instead of this:


You write this:

b = Button.new();
b.Text = "Click me!";
b.Position = new Position(1,1);
canvas.addControl(b);

Now imagine a user interface full of buttons, tabs, and other things to play with, and you'll see where I'm going with the second half of this post title.

I HATE LAYING OUT USER INTERFACES IN SPROUTCORE.

Once you see how the UI is laid out in Sproutcore, it's like shell-shock; it immediately takes me back to the days of writing desktop app UIs, and that is terrible. I consider Sproutcore worse, though, because the end result of defining your UI through Sproutcore ends up being HTML! Man, I love me some exclamation marks, btw.

I mean, if we're going to render in browsers anyway, I think it'd be better to exploit what browsers already have, which is the DOM. Facebook does it with its tags, so I don't see why Sproutcore can't do it with its own tags. Will there be a slight delay as the custom tags get processed? Yeah. But the delay is minimal... and I'd deal with the delay rather than the misery of laying out UI elements in code.

And no, visual designers that just output the code for laying out a UI is not a substitute. Anyone who has done some heavy UI hacking knows that once you hit a certain point the designer just gets in the way -- and worse, all the designer-generated code is terrible, and trudging through it is like walking across hot coals.

So, I love Sproutcore, but when it comes to hacking out the user interface, it is not my cup of tea. For a few small internal applications, it's OK -- the UI drudgery isn't much -- but there's no way I'm breaking out a large interactive application using it.

Tuesday, April 27, 2010

I should've never stopped using Hoptoad.

Man, Exceptional is crap. The only reason I even deployed it for this project is because production is being hosted on Heroku and installing + configuring it was just a click.

Not worth the click, by the way, 'cuz not only does the free plan under deliver, but the premium plan is ridiculously priced compared to Hoptoad. For $10 less you get about 2x more than the equivalent Exceptional plan.

Now my only problem is cajoling clients to set up their own Hoptoad account (I do not like 'owning' accounts that have client data).

Sunday, April 25, 2010

Your code is not your product.

Your code is not your product, it will not make money rain from the sky, and letting contractors -- people you're paying -- see it will not be the end of your world.

Twitter was someone's weekend hack that made it big thanks to idea and execution, not the 4 hours someone spent coding it.

Your code is only worth what you paid for it.

Wednesday, March 31, 2010

Gnome Shell is a total win.

I been using Gnome Shell exclusively for the past few days on my development computer, and I gotta say, I love it to death. I was using the version of gnome-shell in the Ubuntu repos, and while it was OK, it wasn't particularly engaging or anything... but the Gnome Shell Testing PPA is freakin' awesome. It still needs some polish (there's annoying flicker every once in awhile, and the top bar freaks out when I switch to RubyMine), but it's streamlined the way I use my computer.

Two things I'm missing:
* a quick way to summon the activities tab for a search (which is how I start most apps)
* Ubuntu's special applets, what are they called, the indicator and the me menu?

I really do miss the "Me Menu" though. Here's hoping Lucid can integrate it with Gnome Shell somehow.

Other than that, it's a blast. I've really taken to snapping the mouse to the upper left to get that Expose-like windows discovery, and its pretty much replaced ALT-TAB and minimizing windows for me. The transition is fast and smooth; ALT-TAB feels especially clumsy after discovering windows this way.

I'm not too sold on the "sidebar" though (click your name, then click 'sidebar' to see it). Doesn't seem to do anything more than moving to the activities tab, and given how fast "Activities" responds to a quick mouse flick I'm not sure I'd even use the sidebar. I haven't been, so far.

Could definitely do with a smaller "recent items" and a bigger "applications" / favorite space, too.

Anyway, enough rambling. I have to go fix this "mysteriously broken" Vista laptop. You like that, yeah? "Mysteriously broken?" 'Cuz I sure as hell don't.

Sunday, March 28, 2010

Parents + Ubuntu

So, my parents use Linux now.

My dad, using my borrowed laptop; the old windows laptop he had ran for crap. My laptop is super old too, but it's got Ubuntu on it and it's dead simple to use. He's running 9.10 now, after I upgraded it. My mom's using my old netbook sometimes, which is running some bizarre off-brand distro that I'd like to nuke and put Ubuntu Netbook on it, if I can figure out how to get it to work.

Ubuntu's evolved to the point where my dad can use it for pretty much everything -- his proprietary FOREX trading software works alright in WINE (a little laggy starting up), he can play WMV videos in webpages (because he goes to those old government sites that still use it), the Internet is fast and compatible with Firefox... pretty cool. He even knows how to install security updates, though he tends to ignore the Update Manager dialog.

They're moving the close/min/max buttons to the left in Ubuntu 10.04, which everyone I'm sure has already heard about. I don't really care, because I'm going to change it back immediately, because I'm one of those people that don't really pay attention and occasionally hit the title bar instead of the menu bar, which is going to be an instant close/min/max given the circumstances.

I'm not so much worried about myself but worried for my parents. They're not on the computer a lot, so they don't have the sniper-like aim of regular computer users. The moment I saw a shot of the new button placement the first thing I saw in my mind was my dad trying to press one of the buttons in Firefox and hitting close window button instead.

Fortunately, OMG Ubuntu reports that for other themes, the window control buttons will remain on the right side of the screen. So, as long as I perform the distro upgrade myself, and make sure to change the theme to something else, it'll be fine.

But still, I don't like that Ubuntu's taken a step back and re-inserted me into the picture. Ubuntu was at the point where I wasn't needed: didn't have a codec to play a video? My dad figured out how to do that by himself, because all he had to do was click "find codec" and put in his password. Needed plugin for website? Firefox has it handled.

Now I gotta do the distro upgrade for him because he won't be able to figure out how to fix the booby-trapped window titlebars? Sheesh.

Oh well. Nobody's perfect, I guess.

EDIT: before I get any flak for this, let it be known: I don't care for "uniqueness." I'm a programmer. Functionality > Form.

Worst anime I've ever watched: Infinite RYVIUS

Infinite RYVIUS (wikipedia) has got to be the worst anime I've ever watched. It is in fact so bad that I commonly use it for reference when discussing stuff I hate, which is why I'm bothering to mention it even though I watched it a year and a half ago.

Spoiler free syonpsis: a bunch of space cadets become stranded on a massive warship while evacuating their disintegrating space station; order breaks down because the top cadets can't keep the rest of them in line while they try to find their way home, and it turns into Lord of the Flies in Space.

It started off strong, but midway through I just hated it. Loathed it. Something deep in my gut said, "This is a terrible, awful story."

When you tell a story like this, a story that makes you hate all of the characters, there's gotta be something worthwhile tucked away. Some little spark of hope or redemption that makes it worth-while. Infinite RYVIUS has none of this. Nothing. During an encounter with a hostile space-ship, I suddenly yelled "FUCK YAH!" when I thought the enemy space ship was actually going to sink them. That's how much I hated the whole thing.

But, being how I am, I ended up watching it through to the end. There's a happy ending, but it isn't enough to make the anime taste like anything other than goddamn awful.

So now you know: when I start rambling about kids and space and hoping the whole goddamn ship blows up into a million pieces, you'll know what I was talking about: Infinite RYVIUS.

Saturday, March 27, 2010

Prototype vs jQuery: are we still having this discussion?

Seriously, are we?

I literally don't know anyone that is still using Prototype for reasons other than, "that's what we started with."

Yeah, I guess I'm ragging on you if you're still using Prototype intentionally. Sorry, but it's pretty funny form my point of view. Take solace in the fact that nobody loves me, Prototypers.

Monday, January 04, 2010

Ubuntu makes you a software snob.

(update: some dude addresses my concerns about GetDeb here.)

Seriously.

After having used Ubuntu on both my netbook for almost a year now, it's turned me into a total software snob.

For instance, right now, at this very moment, I'm not installing Songbird. Now, there are plenty of ways to get Songbird on my netbook. But none of them are good enough.

Why?

There are no official debs. There are no official repositories. If you download Songbird from the official site, all you get is an archive. Which is fine if you want to unpack it by hand, fiddle with making a desktop short-cut and a menu entry by hand, as well as spending the time to find an OK-looking Songbird icon for the aforementioned short-cuts.

What? Excuse me?

Seriously, those are the two things that instantly came to mind when I realized that Songbird's official download was a freakin' archive file.

The fact that it wasn't available in the Ubuntu repositories wasn't all that bad: there's lots of software out there not in it, simply because there's so much software out there, period. But they don't even have their own official repository? Is Songbird so good that I'm supposed to do the download-and-extract dance every time a new release comes out?

Shit, I don't even do that with most Windows software -- I've got this copy of PowerArchiver that's almost 3 years old. I get an update alert every time I open it, but I'm not going out of my way to download and install a new copy of it. Sheesh.

There's GetDeb, but I'm not using it yet. I've got questions that the GetDeb site doesn't have answers for: who runs it? What releases do they package? Are program authors involved in any way? Are the programs modified before they land in the repository? As an issue of trust, I'm more willing to add repositories like Banshee's official PPA to Software Sources over a third-party I know nothing about.

So, yeah. No Songbird for me.

I know that in the time I've written this blog post I probably could have struggled to get Songbird integrated with Ubuntu properly... but that would still leave me with the issue of updating by hand. Something I consider especially annoying in an environment as advanced as Ubuntu.

On the upside, Songbird screenshots were pretty to look at, though.

Saturday, December 05, 2009

Rails source control: to check in db/schema.rb or not? ... Don't do it.

UPDATE:

Ignore everything below. A lot has changed since this blog post was written, and there are better / easier ways to sync up your schema.rb now than their were in 2009. And when in doubt, just run `rake db:schema:dump` when you get merge conflicts.

ORIGINAL:

The only argument for checking in schema.rb is that it's "faster."

Yeah, OK, whatever.

Don't check it into source control. It just leads to local development problems in the future, and possible production problems if you don't have CI, because cap deploy:migrations is going to run Rails migrations that might be broken because everyone primed the database using rake db:schema:load instead of rake db:migrations. Oh boy, does that sound like fun to you? Because it doesn't sound like fun to me.

Local development problems: consider Git, where everyone's got multiple branches. Someone's done some work in master, checked in their changed db/schema.rb. But oops, you've done some migration work too, and so now your db/schema.rb conflicts with the master db/schema.rb, and how do you end up resolving it? By nuking db/schema.rb and then running the new migrations to regenerate the file.

Which is an extra, unnecessary step because db/schema.rb is in source control.

Hurray.

Let's just keep db/schema.rb out of source control and save the 5 minutes.

Friday, October 09, 2009

How to hose a Rubygems in one simple step.

So, I had the unfortunate mispleasure of having to quickly solve The Mystery of the Hosed Rubygems Installation after installing 1 gem.

Apparently, the problem was with that gem's .gemspec file, in which the following line:

s.require_paths = %q{"lib"}

was the culprit. That one little caused the entire rubygems system to fail -- require failed, the `gem` command failed; basically everything related to Rubygems failed in one spectacular burst of flame.

The solution of course was to change it to

s.require_paths = ["lib"]

The problem being, Rubygems expects Gem::Specification#require_paths to always be an array, and, not bothering to check otherwise, tries to call Array#join. Apparently exceptions raised when parsing a gem's specification aren't caught anywhere in the system, so it hoses the whole thing top to bottom.

Saturday, August 29, 2009

jQuery.Form and its AJAX file upload gotchas.

Hit a few "gotcha, motherfucker!" moments with jQuery.Form while doing AJAX file uploads:

  • If you return an HTTP error, don't return any text (such as error details) -- it'll be interpreted as a successful call and won't handle your error callback.
  • If you return an HTTP error, don't reply on xhr.status from the error callback -- it'll be an unhelpful 0 for some reason.

Alternatives suck: returning an error code and checking to see what kind of data got returned from the call (is it an 'error' object or a model object?).

Wednesday, June 10, 2009

Argh, ShareThis!

Despite it's importance, this problem with ShareThis is almost totally undocumented: if you run your webserver locally and access it via "localhost"then the ShareThis widget won't work. You have to access it by an IP instead (127.0.0.1).

So if you get "SHARETHIS is null," "SHARETHIS is undefined," or "SHARETHIS is not defined," instead of spending an hour and a half pulling your hair out, just breathe deep and remember, there are still people out there who put all their code in a monotholic try/catch and fail silently.

Thursday, April 23, 2009

Arron on...

Arron Washington on Twitter.

Arron Washington on a mostly abandoned identi.ca account.

Arron Washington on a definitely abandoned Plurk account.

I seem to be turning into one of those people that collect social networks like rare Indian coins.

Friday, April 03, 2009

Busy busy!

Good Lord, I've been busy all month long and it's only getting worse.

Hell, I totally forgot that I had yet to do my taxes until I got some kind of automated email reminder today.

Have. Got. To. Keep. Going!

Wednesday, April 01, 2009

How much did I make from oDesk in 2008?

I recently tweeted that I made most of last year's income from oDesk.com.

Well, according to my accounting, from oDesk alone I made just shy of $40,000 last year.

That's pretty good, considering I took a short break, and when I got back into the swing of things I decided to only work about 20/hrs a week (sometimes more, depending on client need). It helps that I get more things done in 20hrs/wk than some people do for 40hrs/wk, though. :)

Obviously I could have made way more.

But besides being a valuable income stream, oDesk has given me something much more valuable than that: freedom. Freedom to work my own hours, sure, but more importantly, freedom to do what I want. And what I've always wanted to do is be an author. Yes, that's right, Mr. Computer Programmer wants to be Mr. Writer.

Since I started freelancing, I've never really had the time until recently to unlock all the thoughts bouncing around in my head and unleash them on the world. When I was in college, there were huge gaps between classes that I filled with anime, video games, writing and code. But when I started freelancing, an incessant nagging in the back of my head ('money! money! money!') kept driving me to spend all my free time thinking about work, working on work.

My free time became a narrow slot that I could only fill with one thing. Should I play a video game? Read a book, watch an anime, rent a DVD or write? My free time was so thin I felt like I'd cut myself if I wasn't careful with how I used it.

When a long term contract on oDesk ended in 2008, I was between jobs with nothing much to do. So I wrote a little as I browsed for jobs; I had enough in my savings account to skate by for months without work, if I wanted. I went back and revisited old works, frowned at how bad they were and toyed with them in my spare time. I kept peeking at job openings, but my A-game was absent when trying to land a few big, "easy" jobs.

Then I realized something: with my skills and expertises, I didn't have to spend every waking moment working. After all, people always need something done. 

So I said to myself, "Why not split my time between writing and work?"

So I did.

Because with oDesk, I could, and with oDesk, it was simple: apply to jobs that would take less than 20 hours a week. That's it. There are thousands of those jobs on oDesk -- maybe even tens of thousands. When one job ended, there was no mad scramble looking for new work. The market place there is huge. If you have talent then you've got a job waiting there for you. And me? I've got it up to HERE, baby. I made a hand symbol just now; you know, the hand at the neck thing to convey how much of IT I've got.

So, thanks to oDesk I can continue to spend time making kick-ass web stuff for clients, and use the rest to pull out my hair out over my insecurities about my writing or smashing my head against the wall because of writer's block or whatever weird thing it is that week that makes me think that every word spilled from my fingertips is crap.

But hey, that's freedom for you.