Archive

Archive for December, 2009

The Intel SU2300 does NOT have “SpeedStep” as you know it

December 31st, 2009

©1976, MGM

I’m mad as hell, and I’m not gonna take it any more!! (great movie, Network was…)

As if it wasn’t bad enough that Intel couldn’t write a driver that takes full advantage of the GMA500 in certain netbooks, now apparently they’ve resorted to sneakily “modifying” what “Enhanced SpeedStep” actually does.

I’m talking about the Celeron dual-core SU2300 processor in those fabulous “thin and light” notebooks that are quickly replacing netbooks so that everyone (except you) can make more money.

So, what’s the problem? The SU2300 does not have the “SpeedStep” that you think it does… which explains why no one can get it to work!

Read more…

Computers, Spare Me! ,

QuickFix: My program is running, but I can’t see the window on the desktop!

December 30th, 2009

Everyone has run into this problem at least once: you are running a program, and you minimize it to the task bar. Later, you try to restore the window by clicking the program on the task bar, and nothing happens.

You’re program is running, but its window has somehow moved outside the desktop area. Firefox – bless its flaming little heart – just loves to do this to me.

Since it was such an annoying problem, I managed to figure out a couple of ways to restore the “hidden” window…

Read more…

Computers ,

Fixing the “ActionMailer: Hostname not match server certificate” Error

December 21st, 2009

If you have a Rails app that sends e-mails, you are probably using ActionMailer. Unfortunately, starting with Rails 2.2.2, you may have encountered a wonderfully annoying little error that looks like this:

OpenSSL::SSL::SSLError (hostname was not match with the server certificate):
   /usr/lib/ruby/1.8/openssl/ssl.rb:123:in `post_connection_check'
   /usr/lib/ruby/1.8/net/smtp.rb:582:in `tlsconnect'
   /usr/lib/ruby/1.8/net/smtp.rb:562:in `do_start'
   /usr/lib/ruby/1.8/net/smtp.rb:525:in `start'
   [...]

The are quite a few sites out there that give monkey patches for this problem, but those aren’t very useful because the next time you upgrade Rails, the monkey patch gets obliterated and you’re back to square 1. And then you have to remember how you monkeyed with it the last time to get it working again. Ug…

Instead, fix it the right way!

Read more…

Programming ,

jQuery AJAX Form Submit for Dummies

December 14th, 2009

AJAX Form using jQuerySo you’ve decided to be supercool and use jQuery. That was a wise decision you made, because jQuery totally rocks. Especially in Rails apps, jQuery makes life a LOT simpler. Yes, you have to learn some JavaScript and some quasi-new syntax, but it’s still seriously powerful and convenient.

There’s only one problem: if you’re like me (i.e. JavaScript-impaired), you just couldn’t get your forms to submit via an AJAX call.

You’ve probably heard of something called the jQuery Form Plugin. It’s a bit overwhelming looking at all the options and trying to extract just the functionality you need if you aren’t a JS Jedi, though. And so, without further ado, I present to you jQuery Form Submission for Dummies!

Read more…

Programming ,

Increase the Performance of Fragment Caching in Rails

December 4th, 2009

Rails Caching OptimizationIf you use Rails on a high-traffic site, you know that as your number of users increases, you have three main options:

  1. Add servers to handle the load
  2. Optimize your queries
  3. Improve your caching scheme

You may be surprised to know that most people go for Door #1. It’s a lot easier. You don’t have to really do tons of work to rewrite your code and actually make it efficient. You don’t have to ditch “the Rails Way” and start actually thinking about what the database layer is doing to slow your site down to a crawl. And you don’t have to think about how Rails’ cache expiry functions actually work. Finally – and best of all – you can just pass the costs on to your customer, right??

I recently read an article that really slayed me. It was about a “niche site” that runs on Rails. They get 50 million hits a month, and they have SIX servers to handle the load, including multiple dedicated DB servers. I designed a Rails site that now gets 27 million hits a month, and it runs Rails on a single 1.86 GHz dual-core server with 3GB of RAM. By my calculations, the site could easily handle twice as many hits as it does now. Most of the time, the load is very low and the CPU and disk accesses hover at a few percent.

Of course, to achieve good performance, you can use things like Phusion Passenger. But that alone ain’t gonna cut it. You also have to optimize your queries, stop doing things The Rails Way and start thinking for yourself, and of course optimize your caching scheme.

In this episode, I’m going to tell you one very cool way to turbocharge your caching setup!

Read more…

Programming , ,