Updated: September 16th, 2012

Introduction

StackOverflow is an amazing site for coding questions. It was created by Joel Spolsky of joelonsoftware.com, Jeff Atwood of codinghorror.com, and some other incredibly smart guys who truly care about user experience. I have been a total fan of SO since it went mainstream and it's now a borderline addiction (you can see my StackOverflow badge on the right sidebar).

The Story

Update 6/21/09: This server is currently under very heavy load (10-200), even with caching plugins enabled. Please bear with me as I try to resolve the situation.

Feel free to bookmark this page and return to it later when the fires have been put out.

Update 06/21/09: I think I've got the situation …

Share
30

Swapping Column Values in MySQL


Posted by Artem Russakovskii on February 17th, 2009 in Databases, Linux, MySQL, Programming

Updated: September 16th, 2012

Today I had to swap 2 columns in one of my MySQL tables. The task, which seems easily accomplishable by a temp variable, proved to be a bit harder to complete. But only just a bit.

Here are my findings:

  1. The

    UPDATE swap_test SET x=y, y=x;

    approach doesn't work, as it'll just set both values to y.

    PostgreSQL seems to handle this query differently, as it apparently uses the old values throughout the whole query. [Reference]
  2. Here's a method that uses a temporary variable. Thanks to Antony from the comments for the "IS NOT NULL" tweak. Without it, the query works unpredictably. See the table schema at the end of the post. This method doesn't swap the values

Share
7

The Ultimate Programming Language – LOLCODE


Posted by Artem Russakovskii on December 16th, 2008 in Humor, Programming

image If you are a programmer, you, by definition, belong to the elite [awesome] human breed called geeks. If you know how to code in Python or Ruby, you might even think you’re pretty hot shit. But none of that compares in hotshitness to what you are about to learn.

Allow me to introduce LOLCODE – perhaps the most serious and, for some, cryptic, programming language. It is Turing-complete and uses an advanced compiler called Brainfuck (I’m still totally serious, and by the way if you’ve never heard of LOLCATS, then you’re not spending nearly enough time on the Internets. See the funny button that looks like a cross at the top right of your IE? Click it or your …

Share
0

Basement hackers compete to best Netflix recommendations $1M


Posted by Artem Russakovskii on November 30th, 2008 in Programming, Technology

image This is a great read by NY Times. An article on 6 pages rarely gets my full attention but this is one of them (though I detest the usage of "basement hacker").

Basement hackers and amateur mathematicians are competing to improve the program that Netflix uses to recommend DVDs — and to win $1 million in the process.

"THE “NAPOLEON DYNAMITE” problem is driving Len Bertoni crazy. Bertoni is a 51-year-old “semiretired” computer scientist who lives an hour outside Pittsburgh. In the spring of 2007, his sister-in-law e-mailed him an intriguing bit of news: Netflix, the Web-based DVD-rental company, was holding a contest to try to improve Cinematch, its “recommendation engine.” The prize: $1 million.

Cinematch is the bit

Share