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.

Wednesday, December 31, 2008

Preoptimization in real life.

So yesterday I went down to my local Subway (we actually have 2, but I don't go to one of them because it's a pain traffic-wise), and got in line. I had plenty of time to decide what I wanted; about two minutes since the small family in front of me was taking their time.

No sweat, even though I picked out what I wanted in about 10 seconds.

I spent the rest of the time thinking about how to phrase the sentence,

"I want a foot-long Subway Club on wheat."

But then I thought to myself, "If I say I want a foot long wheat Subway Club," she'll be able to get the sub bread before I finish speaking. Then I realized that, although that sentence is understandable, it is not very "correct." Would she understand immediately, or would it introduce a further delay in my sub making adventure? On the other hand, even if she did understand it immediately, would she even be able to react in time before I finished the sentence? Was the optimization even worth it?

I totally wasn't paying attention by then, so when she said "What do you want?" I kinda jerked in place and replied,

"Uh, a subway club. On wheat. Foot long wheat."

Tuesday, December 30, 2008

Importing OpenOffice files into Google Documents: Don't.

OR: what to do when Google Docs screws up your formatting (see end)
Seriously, don't do it.

First of all, the file upload size is much too small -- there's some ridiculously small cap, like 500kb. I got a document here, 1.1MB -- all text -- that just can't be imported. So now I got some documents in Google Docs, some documents out.

Secondly, and most importantly, Google Docs totally fucks up imported styles. Witness:

Now dude, I love me some Google Docs, but that just isn't fun. The only way to fix it, as far as I can tell, is to just "rewrite" those particular lines all over again. But I've got an entire document full of them and it ain't pretty business.

If I could do it all over again I'd just do a massive C/P job, which seems to preserve the formatting.

Still, it's not enough to make me give up Google Documents, which is excellent. I just hope they keep better backups than I do.

UPDATE:

I've cleverly deduced that for some parts of the document, Google Docs doesn't have a font set -- eg, you click into a paragraph and the 'font' drop-down is empty. If you select all of the document contents and set the font to something like Veranda for the whole document, it seems to correct the graphical glitches. Of course now the document doesn't look quite right, and it's still missing the linebreaks that the original document had, but at least now it's readable -- and, editable.

Saturday, December 27, 2008

Flex file uploads: no custom HTTP headers for you!

Stubbed my toe on this recently.

For some reason (unexplained, and it seems unlikely that this is an actual security issue) you can't have custom HTTP headers for file uploads in Flex 3.2 (possibly Flash as a whole). They state it in the documentation, to their credit, but it's more of an aside, tucked away at the end of an irrelevant paragraph, than a big red "HEY WE JUST CHOPPED OUT SOME FUNCTIONALITY YOU'D NORMALLY EXPECT TO BE THERE" warning.

For half a minute I thought I was in ruby and said to myself, "I'll just override this and inject the custom headers myself," then I realized where I was and went "D'oh!"

Monday, December 22, 2008

Aptana: Changing Ruby Interpreter on a per-project basis?

Anyone know of a way to change the Ruby Interpreter in Aptana for each individual project?

I've been wanting to give it another test drive and see how the latest version compares, but for the life of me I couldn't make this one simple thing happen. I've got multiple projects in both Ruby and jRuby, so not being able to easily switch is a big big pain.

I got as far as the "build path" bits, but I couldn't make those dance the way I wanted so I gave up and went back to NetBeans 6.5. Which works perfectly, but I'm not a fan of the default directory structure. If you use the "files" view instead of "projects" you lose a lot of functionality. :/

EDIT: "why not post on the Aptana forums?"

Because I forgot my username and password. And you can't get your password without supplying your username for some fucked up reason. So, basically I'm locked out of the forums. :)

"The Chrome."

That's what my mother's started calling The Internet ever sinced I set her up with a copy of Chrome.

She says, "Hey, have you been on The Chrome? Why don't you put The Chrome on dad's laptop, too?"

She misses one feature: auto-fill for forms. She found a toolbar somewhere that did it all by herself, and now she really mimsses it.

That and Hotmail support. She is not happy she has to go back to using "the blue one" for Hotmail.

Thursday, December 18, 2008

ThoughtBot Shoulda -- It Whups the RSpec's ass.

Anyone remember that?!

Heh, heh. Yeah, back when people used WinAMP... I guess they still might. I switched to WMP (gawd, I know), but then to Songbird when it finally stopped sucking (still sucks a little, to be honest).

Anyway, for newer Rails projects, I've completely replaced RSpec with Shoulda. It's nice, clean, readable, doesn't add anything extra to the Rails folder hierarchy, and best of all, it is filled with sweet-as-hell macros that take a lot of pressure off'a my tired fingers.

For non-Rails projects (I do those too!), they offer a gem, but I haven't used it yet.

It seems like every day that something exciting and awesome happens in the Ruby / Rails area, and everyone moves up to the next big thing... but I think that's because the next big thing is better than the thing you happen to be using at the moment.

Wednesday, December 17, 2008

SaaS RailsKit: I've hit my first WTF, and I don't think it will be my last.

(an hour in)

WTF #1: the way the database is boot-strapped.
WTF #2: "accounts.full_domain" -- ?! Yay for adding, requiring, and building code around things that not every SaaS app is going to need!
WTF #3: rdoc, motherfuckers. Get some.

Update:

Ugh. This thing was clearly modelled around 37signal-style SaaS. I can probably use most of it and just use dummy values to satisfy the bits that won't be used, but still.