I’m not waking up in the morning anymore

It is impossible to get anything done with the social racket that takes place in daylight. I don’t know how programmers that do this stuff for a living actually get anything done.

Maybe thats why programming projects take forever to complete!

Advertisements

Funky little spinner (Ruby on Rails/Ajax)

Spinners and progress bars are the equivalent of chrome spinners on wheels. Having them makes you look cool. That and it keeps your users calm*.

In Rails, you can call

Element.show('spinner')

to show a spinner, and then

Element.hide('spinner')

it to make it vanish when you’ve completed your AJAX call. These things are included if you use the javascript :defaults.

Without going into the remote AJAX calls, where exactly do you get the spinner to come out, and where is spinner.gif that is all over the Internet?

Well, your spinner is typically a div that is a hidden element by default. When the AJAX call begins, it un-hides the element (along with whatever text is with it), and then (if you make it) resets its state (hides it) when complete. Through the power of DOM manipulation, you’re basically showing and hiding something on a page. What makes it a spinner is that it includes a moving graphic to give the user an illusion of progress.

There are multiple considerations when looking into adding a shiny spinner though:

0. Which spinner should I choose?
1. Where do you get a spinner? (Questionable facets include licensing/copyright considerations for the paranoid policy follower)
2. How do you insert it as hidden div?

Question #0:
As your Ajax call can complete at almost any time, its generally a good idea to have a continously running spinner that is both interesting, and has no apparent end.

Bad “spinners” (if they can be called that), are progress bars. Users are generally apt to see a progress bar as something which will end eventually. Although you can do what others have been doing thus far (and change the progress bar into an infinitely running one), you’ll only serve to annoy your users.

A better spinner is one that has no apparent start or end, which tells your user that your application hasn’t seized up and died. (Similar to the old form of Windows hardware detection, which would display a progress bar to show you that the system was alive and kicking)

Question #1:
A spinner can be had from pretty much anywhere nowadays. Unfortunately I will have to eat part of my previous question as I haven’t seen one under a particular license (but let me know if I missed something):

Here are a few that i’ve looked into:
http://www.ajaxload.info/ – A very cool website that dynamically generates a spinner for you, according to your preferences.
http://www.napyfab.com/ajax-indicators/ – A page of various moving spinners and progress bars. They’re all on one page, so if your browser gets an aneurysm from having too many moving things on screen, don’t click.

For the license paranoid, a quick G/Y search should do the trick.

Question #2:
The div looks something like this:
<div id=”spinner” style=”display:none;”>
Looking.. <img alt=”Spinner” src=”/images/spinner.gif?1174174309″>
</div>

Note, that you should drop the spinner into your Rails public/images folder. I’m working on not getting code munged here (its still a little bit difficult though)

* There is this story about a hotel which was dealing with elevator problems. Evidently, they wanted to install more elevators (a costly proposition back then, and today). What they did instead was install mirrors, and suddenly the complaints vanished. People were so engrossed by seeing themselves in the mirror that time passed by quickly.

Note: For the img tag, there is actually no need to reference the file directly — instead use the image_tag helper provided by Rails.

Radrails goes to Aptana

I didn’t catch on to this earlier, but it looks like Radrails is going to Aptana. The Radrails site is down at the moment, but a cached copy on Google announced the news.

The posting dated 03/08/2007 announces the takeover by Aptana, and that Aptana has currently setup a forum for the transition.

Radrails was an IDE for Ruby on Rails with a foundation on Eclipse. It combined the ability to create an entire Ruby on Rails project, link it with a CVS/Subversion repository though Subclipse, and create Mongrel/Webrick instances with a few clicks.

Aptana currently features something similar for JavaScript, HTML, and CSS; it’ll be interesting to see how this all turns out.

Aptana currently releases its own Web IDE under the Eclipse Public License, v1.0. A basic rundown of the Eclipse Public License is available on this Wikipedia entry.

Update: Radrails now redirects to an Aptana site. A notice was posted earlier stating that the move accidentally coincided with Radrails’ DNS servers going down at the same time. In any case, an archived version of the old site is still available and archived by Aptana. A roadmap of future development is also up, and the Radrails IDE is up for download once again.

Heatsinks + Thermal Grease + Force = not fun

…while removing the clips for the stock AMD heatsink, the CPU popped out of the socket attached to the heatsink. I feared that this might have resulted in damage (it normally does), so I checked the CPU’s pins..but it didn’t. I got lucky.

Normally I move the heatsink in a left/right motion carefully to get it off (without snapping the processor out of course), but the heatsink clips on the motherboard were being difficult, so I held the clip that I opened first while trying to open the other one. I wasn’t holding the other clip as tight as I thought, tugged a little on it, and right before my eyes the heatsink propped up with the processor in tow.

The real problem was that I applied thermal grease. My computers tend to stay on for long periods of time, and this helps with cooling considerably. Unfortunately, it turned into a glue like substance, attaching the CPU to its heatsink. This was just one of those times where I got unlucky, and lucky at the same time (the processor still works).

For this reason (and several others probably), AMD included thermal pads on their HSFs instead of getting people to apply thermal grease. Its much easier, and the installation is “passive” – you don’t need to do anything for the extra cooling.

Gender in technical documentation (and writing everywhere else perhaps)

Have you ever passed over a piece of text that said “this will really piss off your Administrator. She is likely to…” or “of course, you can give your DBA a cookie. He’ll appreciate it.”

People who are sensitive to how gender is used will generally pause in short stops there, wait a bit, reflect, and continue. Before somebody brought this up I never really realized it. I find myself doing it sometimes. Personally, I find that this is more of a nitpick than anything else (and to book authors it is).

Why is gender an issue?

Perhaps we have been moved toward gender equality so much that we are becoming hypersensitive toward single-gender selection in literature, and instead of being exclusive, we are becoming inclusive (using “s/he”, for example).

In most cases, people skate the issue by modifying their examples to use names, instead of genders (Joe, Jane, Jay, Matt, Ryan, Alice, Bob, etc).

Maybe we’re all just too sensitive. And maybe we shouldn’t open up this can of bees. (Penn and Teller)

Shifting the paradigm

To make a long story short, I recently logged out of Gmail, and discovered a link to this YouTube video. It was kind of cheesy, and a little corny, but it was watchable (it didn’t kill me).

The comments were full of bashing, swearing, and cursing by Gmail users who felt it their duty to voice how they felt ignored, and how Gmail’s sorting of information was the worst ever invented.

Interestingly enough, a paradigm shift is when a widely held belief (such as the theory in which the mind and body are separate a la Descarte) changes. It is often joked (and said) that for a paradigm shift to occur, those holding the current paradigm need to die off.

E-mail, like nearly everything else on the Internet was once very open and trusting. These systems were primarily designed in academia (the Linux kernel was designed by Linus Torvalds while he was a student), where “trust” was open, and as such security wasn’t that big of an issue back then. Information was cool, and sharing was even cooler. MTAs (the server(s) that you communicate to when you want to send e-mails) were often setup by default to relay e-mail (a large source of spam some years ago, now not as big of a problem as evidenced by the shutdown of ORDB) and nobody was none the wiser. We got used to it then, all this sharing and openness. It was cool.

E-mail evolved into what it is today, with .maildir folders, and Mbox files for storage. Without getting into specifics, the e-mail folder on many IMAP servers is nothing more than a directory structure which holds your e-mails. Have you ever seen a directory tree with the little pluses and minuses a la Explorer in Windows? Its just like that. Your e-mail is generally stored like that.

We’ve been using folders for a long time now, and the idea of the folder has become deeply ingrained in our sense of organization. Its natural. When an e-mail from Aunt Mag comes in, we put it in the Aunt Mag folder. When a reply to that NSA** off of Craigslist comes in, well..you delete it, and it goes away after you’re done with it.

Google called (and still is calling) for a paradigm shift, by simply changing the way we think about e-mail. It has not been without controversy.

Many technically aware people will probably recall when Gmail proposed using the content of e-mails to deliver advertising. Politicians and privacy advocates were beating their drums so loudly that they drowned out technical speakers with actual reason, than emotion.

At Google, there was a small paradigm-esque shift in the way they thought about advertising and e-mail too, although a very short one. Google’s senior management had first believed the very thing that many others had believed (parsing e-mails for advertising content was privacy intrusive). Initially, the idea was scrapped. The story* goes that a coder wrote in the system for contextual advertising anyway and linked them up with the e-mails. It was then re-presented to Google’s Larry and Sergey. They didn’t think it was so scary after seeing it again.

However, they probably realized what the world was thinking. The world was about to do the same thing when Gmail was released (into beta), except on a grander scale.

When Google got attention for their form of targeted advertising, people were in uproar. Senators got involved, and in general people donned their tin foil hats, clutching their copies of Orwell’s 1984. For many people, it seemed as if major corporations were coming down to take over the world.

To make a long story short, such parsing wasn’t new in the computer industry at all, it was automated, and to many computer scientists, trivial. Other agencies were doing the same form of contextual parsing in one form or another, and Google itself already had the e-mails. If they wanted to do something nefarious with them they could. Your own ISP could be doing the same thing, and so could Yahoo, or Hotmail. If you didn’t trust Google, how could you trust anybody else? Sure, you could run your own mail server but that entailed managing it. Software updates, spam maintenance, security tightening, backup issues, mail queues, load management..

E-mail (disregarding things like PGP signing/encryption) is an insecure medium, and one should not expect privacy when firing off e-mails through systems that are not within their direct control.

Going back to the YouTube video, labels, and such, are an interesting facet of how Gmail works. Instead of piling things into folders, you have labels. Aunt Mag no longer has a folder. She is in the same area as the NSA guy/girl down the street you go to every other week to have fun with**.

How is this different from a folder? A label’s feature is synonymous to a folder. When you click on a label it shows you all things that are labeled “xyz.” When you click on a folder, it shows you everything inside “xyz.”The archive is synonymous to clicking “show all e-mails” in your MUA (Mail User Agent, eg: Mozilla Firefox, Microsoft Outlook, etc).

Same same, no?

And if you’re wondering..I run my own mail system. But sometimes I get ticked off by it enough (managing a mail server can become a full-time job) that I just run stuff to my Gmail account.

* AFAIK, I do not have the original article/video and cannot find it. Please leave a comment with corrective material, and/or a link if you do know where to find it.
** No strings attached (I looked it up while browsing the best-of-craigslist).. your first interpretation of this is probably dead on.

Fun with Javascript and Checkboxes or how to check all your boxes (Ruby on Rails)

Multiple selection areas (where you’re deleting a set of things, hiding them) a la checkbox can seem a little daunting, especially in Rails where everything isn’t done The Way You’re Used To Doing It. Without going too deep, there is a little bit to be said about making all those little Javascript checkboxes toggle on and off without inserting any foreign Javascript outside of the defaults (prototype library, etc) that Rails provides.

Following off of a post on railsforum.com, I started with that and made a toggle box that might have broken a few rules, but can be generally dropped into any Rails application for full toggle switching with one input box.

http://snippets.dzone.com/posts/show/3651 (open in new window)