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.

Thursday, March 26, 2009

Legal retainers: you never know how valuable they are until you have to use them.

To quote the title, "Legal retainers: you never know how valuable they are until you have to use them."

Seriously. For an LLC, it's much more cheaper and efficient then lugging around an attorney who just chills out all day until he has to write up a contract of some kind.

Tuesday, March 24, 2009

Slow going in the fjord of his mind.

If you look at my Spiced Incese Warehouse post below you'll notice that it has a few comments, probably by the owner or a shill perhaps. 

There are some deleted ones: two were posting someone's phone #, address, etc, and two that were just pure spam. Well, not pure spam. If you've been around the 'net long enough you'll occasionally find people who are essentially being paid by the hour to 'attack' a site in an attempt to render it unusuable. It never works, of course, but it's still kinda funny to watch.

Anyway, it's a classic case of not knowing how the Internet works. By commenting repeatedly and shilling in an attempt to sweep whatever under the covers, I don't think he's realized that he's raising the popularity of the articles in question. The blog post, for instance, fell off the front page for awhile, then suddenly found itself ranked 4th or 5th for the search term "spiced incense warehouse." It'll probably outrank his site in a few days if he keeps up the pressure -- I'm not sure if that's good or bad. Good in the sense that it would be hilarious, primarily because he did it to himself, and bad because then my blog post turns into one of those little battlegrounds where everyone with a keyboard converges and argues -- same thing happened with my 'oDesk vs RentACoder' review, which I won't link to since its mostly obsolete and I haven't tried RentACoder in forever.

Plus, I think he underestimates the intelligence of his potential customers. I showed some non-tech friends the original blog post and the comments, and they totally lol'd their eyes out (or so they assured me).

So, it made my ask myself, you know, what exactly is going on in this guy's mind? Is there some part in the back that tells him that making a fool of himself is the best course of action? Or, does he think he's not making a fool of himself at all?

I sat down and thought about it for awhile -- I had just finished playing two crappy rounds of Halo Wars and didn't have much else to do until She Who Is Unknown returned, so, you know, why not? After a bit I came to the conclusion that he's one of those types who gets red in the face and acts irrationally without thinking. That probably explains the sudden quiet-time that occured while I was waiting to be served (which apparently isn't going to happen).  I've never worked a salaried job in my life, so I've never had the great misfortune to be exposed to those kinds of people, but I've read about them and of course I've had the usual antecdotal "you wouldn't BELIEVE what this bossy motherfucker did today!" story from friends.

On the plus side, his annoying behavior spurred me to change the way pages are cached on FearlessBlogging, which is neither fearless nor, technically, blogging. I actually had an entirely different concept for the site, but then realized it would be redundant and more-or-less worthless in the grand scheme of things.

The caching changes I made were to localize all of my caching logic in a cache sweeper. Oh god, I know what you're thinking, and no. Caching was implemented initially as a *very* quick (talking, 15 minutes) hack, which involved a lot of cut-and-pasting of code everywhere. Things got messy fast, and as a result somewhere along the lines, during a random site upgrade / bugfix, I broke the admin panel. I could mark posts as disabled, but particular portions of the cache wouldn't refresh, so they'd show up in the sidebar but still be unviewable. Yeah. Stupid, I know.

I also re-learned one important thing that I forgot: Never. Use. Page. Caching. In Rails. Ever. That shit causes boatloads of problems. Page-level caching in Rails is the goddamn devil. And there's no easy way to clean the cache, either, except to "manually" remove the files, as far as I know.

The moral of the story?

That stories don't have to have morals to be stories.

(oooh, yes I did just go there).

Thursday, March 19, 2009

Hotmail login doesn't do HTTPS by default. ^.^?!

So, I almost never use my Hotmail or Y!Mail accounts anymore.

Too much spam, obviously.

So, today, I did my monthly email check. Nothing but spam in the both of them.

But I did notice something funny.

Logging into Yahoo! Mail took me to an SSL protected page, where-as logging into Hotmail took me to a regular HTTP page.

Now, I was extra concious of where I was on the web because this morning my Mom got scammed; she followed one of those 'reset your password' emails and lost a couple hundred dollars from her Paypal account.

So I gave her a 20 minute lecture (again) on not following those links. Frankly, she got off real lucky -- as far as I know he only took money from her account, and not a lot at that. The scammer could have done way worse.

So, after my high-and-mighty lecture, I notice that Hotmail doesn't do HTTPS by default. I totally lawl'd.

I've become used to seeing the SSL certificate in the browser bar as a way of verifying I'm where I meant to be, even though that's not exactly what it means. So I found Hotmail's lack of security on the login landing page very... unusual.

That's the end of this blog post!

Sunday, March 15, 2009

Games I've been playing.

About a week ago, I purchased both Halo Wars and Tom Clancy's HAWX.

I purchased HAWX, an action-intense fighter-pilot game, because when I played the demo level, "Glass Hammer," I immediately thought back to Ace Combat 6 and, of course, Garuda team. I nabbed Halo Wars because the first two demo levels were OK and I thought it'd be an average RTS game I could stomach.

As it turns out, my expectations were completely fucked: Tom Clancy's HAWX was a total chore to get through once, and gut-wrenchingly boring the 2nd time around on "Elite." CO-OP mode is a little better: the missions are harder, and if everyone is playing on Elite mode some missions can be pretty fun (as long as everyone is playing with a headset). However, the game is full of more misses than missiles in the air (ha hah, why does a fighter plan have 82 missiles?!-style joke!). 

The storyline is a total mess, from its incredibly implausible premise, to its jerky storytelling method of hopping around the entire planet (planet meaning the United States and Tokyo). I'm going to get some hate for me ripping on the storyline while loving Ace Combat 6, but there's a big difference here, I'd like to think, and that is that Ace Combat 6 goes full-throttle into fantasy land, with its giant flying fortresses and city-sized rail-guns. HAWX clearly went for a super-realistic takes-place-in-the-near-future feel, going for a gritty story of nuclear threats with the overarching theme of capitalism taken to the extreme. Unfortunately the actual execution of the story is bullshit. Yes, bullshit. Go watch a friend play it if you really want to experience the roller-coaster of suck for yourself.

The game itself suffers from weapon-itus, meaning there are a ton of starter planes you use once, because the mission forces you to, and then never again; missions that DEMAND you bring a free-fall bomb, even though you can just as easily use multi-target air-to-ground missiles to do the same thing; missions that are incredibly easy but gimmicking -- one in particular involves having to aim your plane at a radar signal while flying through radar net gaps so large you could drive a fleet of trucks through, yet somehow bomber planes can't manage that themselves.

Oh, and then there's: bad scripting (I've inadvertantly broken several levels by destroying all the enemies before I was supposed to insert eye-roll here), bad dialogue (THE NUCLEAR MISSILE WILL GO OFF IN MINUTES CRENSHAW!!!!!!, WE HAVE ONLY MINUTES UNTIL THE INVASION ARRIVES CRENSHAW!!!!, BACKUP WILL BE HERE IN ONLY MINUTES CRENSHAW !!!, MY HOT POCKET WILL BE FINISHED IN ONLY MINUTES, CRENSHAW!!!), and an extremely annoying AWACs who announces EVERYTHING to you. If you miss with a rocket pod attack -- even one rocket -- you get to hear, "You missed the target!" even though that's on my fucking HUD and I clearly knew that by the lack of exploding enemies on the ground.

Did I mention the super anti-climatic finale levels? One of which is really just an interactive epilogue and a total waste of 10 minutes?

Ugh. Anyway.

As it turns out, the best mission of the game was the one in the demo: Glass Hammer.

Now, Halo Wars...

Halo Wars!

I'm no fanboy, and I wasn't even sure this was going to be a good game, since the first two levels are pretty much a snore-fest, but right after that the action and pacing starts to pick up. The controls are quick to learn, the gameplay challenging but not "goddamn cheating-computer!"-challenging, and the game itself is just genuinely fun. The cut-scenes are just long enough to tell a bit of story but not so long that you get bored watching them.

Even losing a mission and having to restart from the beginning is a pleasant experience: overall missions are about 30 minutes long, and the gameplay and strategies you can use are varied enough that it is actually kind of fun to lose, since it means you can try another technique. 

There's built-in CO-OP for all the levels, I think. Haven't gotten there yet -- just finished the campaign, but I'll definitely have to try... there's no way I'm going to save the citizens of Arcadia City all by myself.

The story is fairly solid, told with ingame communications and cut-scenes, typical gaming fair. There's nothing particularly epic about the story; it's just there to support the gameplay, which it does very nicely. There are a few unexplained WTFs at the end which I won't mention because of spoilers.

Multiplayer can be hit or miss, depending on the mode. 1v1 is good, 2v2 or 3v3 can either be excellent or horrible. This is entirely dependent on the people you're playing with: I got a good team going my first few games, so we stuck together and decimated the enemy with good teamwork and communication. The next matches a few days later ended terribly. Players not communicating, some of them not even really playing "right" (new players, clearly). As this is an RTS, there's no solution to an AFK or non-responsive team-mate: you're going to lose, plan and simple. 2v2 lessens the odds of you having a doofus on your team, but doesn't quite have the huge epic battles that 3v3 brings to your door.

Still, multiplayer can be pretty sweet when it's all workin' right.

All in all, a very enjoyable game.

* * *

Also, have you ever wondered what would happen if a Blue Whale ate you?

Don't. It's a weird thought to have.

Friday, February 20, 2009

Oooh, Discover pisses me off.

I applied for a Discover debt consolidation loan about two weeks ago after reading one of their pre-qualified pamphlets that you get in the mail. "You're a winner now!" sorta bullshit. The only reason I went for it is because the rates were actually really nice in comparison to most of the crap I get in the mail. I've recently had some dental surgery that I've put on my credit cards and they've been gathering interest like dust bunnies ever since, so this seemed like a good way to consolidate both cards.

Easy, right? I'm pre-approved, right? Oh, I bet you know where this is going.

This is the first time since I've become self-employed that I actually got a rejection letter from a bank / credit card company. And the reasons, GOD THE REASONS, it's like someone accidently stamped 'UNAPPROVED' instead of 'APPROVED' and made up some reasons in a panic.

One of them was "excessive number of non installement/finance inquiries" which is the apparent result of Discover keep checking my credit report way too often, since this is the first time in about 9 months I've actually signed up for something credit / finance related.

I also got "too many revolving accounts," and "utilization on revolving accounts too high," which is fantastic, since I only have 3 credit cards; 1 card empty, and the other 2 with, together, a grand total of... $8,000. (dental surgery is _expensive_ when you don't have insurance).

By the way, I have a credit score of 700. I've been told that's not awful.

All together, car note included, I have about $15,000 worth of debt, maybe a little more (netflix + fastfood addiction). Man, you know the economy is in the shitter when a bank considers that too much debt.

Monday, February 16, 2009

When will Mobile Browsers be the new Mobile API?

As a forward, let me talk about the Palm Pre for a few minutes. Alternatively, you can just read that article I just linked to then skip a couple paragraphs.

The Palm Pre is heralded by some as the second coming of Palm. What makes this phone stand out the most is the fact that its operating system is essentially a web-browser that talks to the hardware underneath. It's user interface is HTML/CSS/JavaScript, built on standards blah blah blah. The thrust of it means that writing a Palm Pre app is as simple (or complex) as writing a webpage. For regular end users, this is probably meaningless; all that matters is that the phone looks good and moves quickly. For developers, however, it opens up a new realm of app-developing whup-ass. By making web-apps easier to create, the Palm Pre is enabling developers to make more apps with better quality for less investment.

Pretty much every developer, and several people who have no idea what they're doing, has a good grasp of HTML/CSS/JavaScript. This means that anyone can immediately dip their feet into Palm Pre and start developing. Ease of development is what made the Web explode, and the same potential is lying in wait for the Palm Pre.

So, when will Mobile Browsers be the new Mobile API?

The Palm Pre is very much a step in that direction: you talk to the Palm Pre OS using its JavaScript libraries, and you markup the application's user interface using HTML/CSS. There's only one catch: the application has to be installed first.

Why?

Why can't I, Arron Washington, Destroyer of Worlds and Small Celestial Bodies, visit http://maps.example.com, be prompted by the phone ("Hey Mr. World Smasher, this website would like to access your phone's GPS!"), and then have all the tight integration you would come to expect with an application on any website the Web cares to offer?

Imagine the potential awesomeness of that, being able to access a phone's features via JavaScript in a regular web page. You go to Google Maps Mobile, it asks for GPS access, you grant it, and voila': a whole new subset of features are available just for you, without having to download the app and update it every time a new release comes out.

With this kind of available integration, anyone can make their website "mobile enhanced" just by calling the phone's custom JavaScript libraries. With simple (DEAD SIMPLE) JavaScript integration, something as simple as a coupon site could deliver location-aware opportunities (sales in progress, 30% off!, etc) without having to make an application for every popular phone. Just point your browser at the site, authorize and it's there, all magically delicious 'n' shiznit.

Now, some privacy nuts will tell you, "Hey man, what happens if I enable a site to use my GPS to find my location? That's an invasion of my privacy!" I'll tell those folks, don't get in a boat with cannibals.

I think with the Palm Pre we're inching just a little bit closer to that. The whole awesome website-phone integration thing, not the boat full of cannibals thing.

Saturday, January 31, 2009

can_has_assets? A new Rails plugin for requiring stylesheets and javascript in views.

I sat down and scratched an itch I've had ever since I started developing Rails plugins: finding a way to require javascript / stylesheets on a per-view basis.

There's Needy Controllers, but that operates in your controllers, and me, being me, wanted to require the CSS and JS from the view, since I'm already hooked on the whole
<%= title "hello world" %>
in views idiom. (view-specific logic in views, basically)

So, I built can_has_assets as a way to scratch my itch. The master branch is currently acting as stable, and since the plugin is so simple, it probably won't be updated very often (or at all). Feel free to push if you do something interesting with it though.

Anyway, straight from the README:


CanHasAssets
============

can_has_assets is a super-simple way of requiring stylesheets and javascript files
from within views. It also supports inserting snippets of CSS and Javascript into
a page only once. Snippet support should really only be used for rapid prototyping,
though. :)

Installation
------------

script/plugin install git://github.com/radicaled/can_has_assets.git

Notes
-----

can_has_* will include a file or snippet only once -- it is safe to call these
methods multiple times, where-ever required.

Alternatives
------------

If you're looking for more control, consider Needy Controllers by Michael Bleigh:

http://github.com/mbleigh/needy-controllers/tree


Example
=======

In your layout:

<%= stylesheet_link_tag :can_has_assets %>
<%= javascript_include_tag :can_has_assets %>

In your views:

CSS
---
<% can_has_css 'css_file' %>

<% can_has_css :sample_snippet do %>
.item {
/* some fake example css here */
}

Javascript
----------
<% can_has_js 'js_file' %>

<% can_has_js :sample_snippet do %>
function helloWorld() {
alert("Hello, world!");
}
<% end %>

Thursday, January 29, 2009

Discipline + Git = good awesome funtime!

(inflammatory rant about some Git users follows)

Git is awesome. If you haven't tried it yet, you should use it for your next non-critical project. Even if you're trapped using Subversion at work, the git-svn bridge will get you by and no one will be the wiser.

Just remember one very, very important thing: Git is not The End All.

I say this because I've noticed that some people, after migrating to Git (or Github), completely lose all discipline.

No branches.

No tags.

For these people, there is nothing but The Master Branch (dramatic thunderstrike!). There is no stable or unstable; there is only the master branch and its whimsical nature. Will the project work today? Will it work tomorrow? Did it even work yesterday? Who knows.

Here's a hint that you've gone horribly awry: if people need to track down the latest "stable" commit you made to the master branch by checking the timestamp on your announcement via Twitter about it, then you've royally fucked up and need to re-evaluate.

Rant over, as abruptly as it began.

Tuesday, January 27, 2009

Tag Aliases: get them, people.

This has been on my mind ever since I made this identi.ca notice:

# vs # -- AKA, "Why Tag Aliases are needed in every tagging system."


You'll notice that Rails and RubyOnRails are two seperate tags -- even though they both reference the same topic. This almost inevitably comes up when you're dealing with a tagging system where individuals supply the tags in question. Is it #sn or #socialnetworking? #rails or #rubyonrails?

The first time I saw tag aliases in the wild, they were on an imageboard for porn. Yes, all innovations have their roots in porn. Porn is the great innovator! All hail porn!

Tag aliases evolved out of necessity in the world of web 2.0 pornography: when dealing with certain topics, say fetishes for example, there are often two ways to reference the same topic: the technical nomenclamature, and the common name. So, what do you tag it under? Both, of course. Under the hood, the system tags these tag aliases together and presents one uniform tag, which can the technical tag, the common-name tag, or both (for usability).

As I've demonstrated, tag aliases are useful for more than porn. When you're dealing with microblogging, for instance, do you want to use a short name, for space, or a long name, for usability / readability? Without tag aliases the community really has to decide on one or the other. With tag aliases, it's just a matter of personal preference -- you may not want to use the shorter version of a tag if you have a readership unfamiliar with the topic at hand, for example.

So why the hell do I only see tag aliases on random pr0n imageboards and not where they're needed in other portions of the web 2.0 space? It might be a matter of mechanics. Who gets to decide what tags are aliased, where? Is it a Wiki-like system, or a trust-based system like StackOverflow?

...

...

...

That is all.

Mozilla Ubiquity: Metacritic Script

I developed this rarely used script to search Metacritic way back when, as my first Ubiquity script. Ever since I got it working I just kinda left it there. It's a total hack and it'll break when they change the way the page renders, but you, dear viewer, might find it useful.

Yes, Mozilla Ubiquity does rock. However, having no API to your site does not rock. It is the exact opposite of rock, in fact!


function __searchMetaCritic(pblock, searchText) {
jQuery.get("http://www.metacritic.com/search/process?sb=0&tfs=all&ty=3&x=0&y=0&ts=" + escape(searchText),
function(response) {
var resultsREGXP = /\[0-9]\.(.*)\<\/p\>/gmi;
var results = response.match(resultsREGXP);
found = true;

if (results == null) {
var msg = 'No results for "${what}"';
var subs = {what: searchText};

pblock.innerHTML = CmdUtils.renderTemplate( msg, subs );
return;
}
var tempElement = CmdUtils.getHiddenWindow().document.createElementNS("http://www.w3.org/1999/xhtml", "div");

tempElement.innerHtml = '<link href="http://www.metacritic.com/general.css" rel="stylesheet" type="text/css">';
tempElement.innerHtml = tempElement.innerHtml + results.join('');

var msg = 'Searching for "${what}"
${results}';
var subs = {what: searchText, results: tempElement.innerHtml};

pblock.innerHTML = CmdUtils.renderTemplate( msg, subs );
});

}

CmdUtils.CreateCommand({
name: "metacritic",
takes: {"what": noun_arb_text},
preview: function(pblock, what) {
__searchMetaCritic(pblock, what.text);
var msg = 'Searching for "${what}"';
var subs = {what: what.text};

pblock.innerHTML = CmdUtils.renderTemplate( msg, subs );

},
execute: function(what) { __searchMetaCritic(what); }
});

Saturday, January 24, 2009

My moment of revenge against L4D exploiters. :)

Left 4 Dead is Valve's newest zombie survival horror game. Everyone loves it. People that don't are lying and really zombies in meatmasks.

Anyway, the game's got some issues due to its physics engine -- the most notable issue is in the Versus mode where it's possibly for enemy zombies to intentionally block paths, making it impossible for the zombie survivors to move forward. It's an exploit, and beyond that it's a stupid thing to do.

So today I had the great fortune of joining a team that was blocking the sewer hole on No Mercy 2 like a buncha douches... except, just as I was about to leave, I spawned as the car-throwing Tank right next to my exploiting team-mates.

I'll let you figure out what happened next. >:)

Monday, January 19, 2009

I don't want to talk to you if I need to sign up for something new to do it.

I've been getting real lazy about communicating with people on the Web. There are some things I just don't do anymore, for no other reason than I just don't have the patience.

Like, take this post from the OpenMicroBlogging mailing list. It's about OMB Spec 0.2. When I read it, I instantly had questions about #3, HTML-rendered notice content. A: what the hell does that mean, and B: won't that lock-in OMB consumers to a particular implementation of @ replies and # tags?

Yet, I just can't bring myself to sign up for the mailing list to ask. I don't want to mess with another account on another site for something so trivial. I just don't have it in me anymore. I've even started designing my own small sites to accept OpenID or whatever else I can get my hands on to avoid making a unique account for myself.

I guess I'm all username/password'd out.

As for OMB -- no link, can't find a portal site for it -- my interest is easy integration of microblogging into client sites. In my mind, if a client breeds a community site, integrate microblogging as a communication stream, and expose it via OMB so they can "reach out" as a community into the Web. It's still a big foggy in my mental about it. For now I've just been watching its progress in case a relevant scenario pops up.

Friday, January 16, 2009

Monetizing Yahoo! BOSS.

This isn't a post about how to make money using Yahoo! BOSS; rather, it's just a link to the current policy of monetizing Yahoo! BOSS through third-party methods (Google Adsense, basically). I'm posting it mostly because I looked for this information for a long time when I had the opportunity to use BOSS, but couldn't find it, so had to opt for a customized site search instead.

Excerpted from this post about third-party monetization with Yahoo! BOSS:

Our current policy is, while we do not prevent you from implementing a third party monetization method in conjunction with your use of BOSS, we may at any time require you, for example, to implement and display Yahoo!'s Sponsored Search (or similar) advertising offering instead of a third party's. Alternatively, we are considering the option to pay a fee based on your use of the service; in this case, we would anticipate permitting the continued use of monetization methods from third parties.
Basically, Yahoo! reserves the right to fuck you up: any time, any place.

For small niche-like sites this is probably OK; they wouldn't bother trying to get any cheddar from you. If you run something moderately successful powered by BOSS you might have problems in the future.

I don't have a problem with having to display YPN ads or whatever. The real problem is not being able to support third-party monetization efforts. For instance, if you're running a site that makes good bread with CPA ads / Amazon affiliate links, removing those and replacing them with lesser YPN ads is a kick in your junk. What do you do then? Try to manage direct sales?

Something to think about.

Friday, January 09, 2009

The Microsoft Tag site...

...doesn't work in Firefox.

Even though it's powered by Silverlight, which means it should function identically in anything that runs Silverlight.

Seriously.

Visit http://www.microsoft.com/tag/ and try to click on 'Get it for your phone' or 'Make a tag' -- it Just Doesn't Work.

That is such a cold, cold burn.

Tuesday, January 06, 2009

Need design ideas? Surf Wordpress blogs.

I'm a terrible designer. As one of those people who can't close their eyes and imagine with clarity The Perfect Design, I'm forced to rely on other people who don't suck at makin' things pretty and useable.

One of the best resources I've found so far are Wordpress blogs. Some Wordpress blogs have the most ridiculously beautiful themes you will ever find. For instance, following a link from Hacker News got me to some dude's post about "Encouraged Commentary." Excellent ideas aside, the first thing that struck me was that his blog was freakin' beautiful. I mean, look at it. It is aesthetically pleasing and functional, to boot. Hell, look at what he does to images -- they're faded out until you roll over one, at which point the image becomes crisp and the caption pops up.

Another resource is the official Wordpress Themes site. Some gems hidden away in there.

I'm not saying steal these themes or anything -- far from it. But they can provide a jumping off point for the uncreative types to work with. For a certain site, I started with a pretty nice Wordpress theme and then modified it so much it looked nothing like the original... but without the original, I wouldn't have gotten even half as far as I did. It helps that most of the themes on the Wordpress site are liscensed liberally, even though I don't actually look at the underlying CSS. I actually cherry pick certain parts of the designs and incorporate them into one OK-looking site.

It provides enough momentum to get me going, at least.

Sinatra made me go ROOOOAARRRR.

So I wanted to give Sinatra a try today because I had to throw up, quite literally, a one-one dynamic webapp. No tests, no helpers, nothing -- just the one page with some Ruby-powered bits on the backend. The only reason I wanted Sinatra was because I wasn't in the mood to do a massive svn check-in of a vendored rails with the project.

So, sudo gem install sinatra and we're off to the races, right? Wrong. After about 10 minutes of debugging I realize that the Sinatra gem, a) doesn't work with the latest Rack (0.9), and b) seems to be updated infrequently judging by some blog posts I've read. They recommend grabbing Sinatra from github, but there's no stable Git branch available. I don't know if they're using the master branch as the stable branch or what. Doesn't matter, because I don't know what revision of Sinatra works with what copy of Rack. >:(

So I do the next best thing, which is to downgrade Rack to 0.4, which is what the Sinatra gem requires.

Which works. For a bit, until I need to serve up a static html file. I guess that functionality isn't in the Sinatra gem. Some blogs mention how to use the 'public/' directory, which I tried, and failed miserably at; I'm assuming that functionality is somewhere in the github version of Sinatra and not in the gem.

Right around that point I gave up and just cracked out a full-blown Rails project. I copied the logic over, had it up and running in about 7 minutes, which was a stark contrast to the ~2/hrs I spent trying to get Sinatra working.

Lesson?

Next time, just use the latest edge version of Sinatra and hope there are no bugs in it.

This time, I'll just waste two minutes watching the '...'s go by.

Friday, January 02, 2009

My Dirty Programming Secret #424

I develop Ruby on Rails...

...using Ubuntu...

...inside of a virtual machine.