4

Programming Comics: xkcd – 11th-Grade Activities


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

Hey, I can relate to today’s xkcd! It hits close to home:

image

 

And some more traveling down the Perl related memory lane (yeah, these are old, I know):

image 

image

Share
6

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

image Peteris Krumins is nothing short of a technical genius. Every single one of his blog posts is so detailed, one can write a book about it. He blogs about Linux, programming, and other tech stuff on his blog http://www.catonmat.net/.

A short while ago, Peteris posted his very thorough experience interviewing at Google. Needless to say, the level of detail is astounding. Unfortunately, he didn’t get the job but the post is very positive and informative. Here is the gist and a short excerpt:

  • There were 3 phone interviews and 5 on-site interviews.
  • Peteris flew in all the way from Latvia, fully sponsored by Google. They paid for his flight, hotel, transportation, and food – brilliant!
  • The interviews were very
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
1

Hadoop Primer – Yet Another Hadoop Introduction


Posted by Artem Russakovskii on October 20th, 2008 in Databases, Programming

image I just came upon a pretty good Hadoop introduction paper posted on Sun’s wiki. Apache Hadoop is a free Java software framework that supports data intensive distributed applications. It enables applications to work with thousands of nodes and petabytes of data. Hadoop was inspired by Google's MapReduce and Google File System (GFS) (wikipedia). I wouldn’t call it an alternative to mysql – they’re in completely different weight categories. I like to think of Hadoop as a complement – I think it’s closer to memcached in its functions than to mysql. Perhaps a hybrid of both but a unique beast nonetheless. If you’re serious about scaling, you owe it to yourself to start exploring Hadoop yesterday.

A couple of …

Share
5

My Notes On Learning Python Coming From Perl


Posted by Artem Russakovskii on October 9th, 2008 in Programming

Updated: November 5th, 2008

image

I’m learning Python. Since I’m currently primarily a Perl coder, I decided it’d be a good idea to post and keep track of my experiences coming from heavy Perl. I have a few reasons for learning Python, which are:

  • to see what else is out there and broaden my horizons.
  • to keep my brain active by feeding it new tasty information every day.
  • to become a more valuable employee and potential future candidate.
  • to learn a new language, especially one used by giants like Google.
  • to learn a new OO language, as I’m tired of Perl’s hacky OO.
  • to build GUI applications. GUI in Perl is a big pain. I’ll see about Python.

So, without further ado, here are the …

Share
13

MySQL Slave Lag (Delay) Explained And 7 Ways To Battle It


Posted by Artem Russakovskii on September 5th, 2008 in Databases, Programming

Updated: September 16th, 2012

http://forge.mysql.com/w/images/1/1e/Dolphin_Laptop_cropped-386x222.jpgSlave delay can be a nightmare. I battle it every day and know plenty of people who curse the serialization problem of replication. For those who are not familiar with it, replication on MySQL slaves runs commands in series – one by one, while the master may run them in parallel. This fact usually causes bottlenecks. Consider these 2 examples:

  • Between 1 and 100 UPDATE queries are constantly running on the master in parallel. If the slave IO is only fast enough to handle 50 of them without lagging, as soon as 51 start running, the slaves starts to lag.
  • A more common problem is when one query takes an hour to run (let's say, it's an UPDATE with a
Share
8

Hug A Developer Day


Posted by Artem Russakovskii on September 1st, 2008 in Programming

Man, this video hits too close to home. Developers all over the world are in pain, so go ahead – hug one right now! Dedicated to all developers at blinkx, MySQL, and beyond.

Share
10

Moving From Perl 5 to Perl 6 – What's New, Tutorial Style


Posted by Artem Russakovskii on August 22nd, 2008 in Programming

Updated: August 28th, 2008

imageNewsflash: Perl 6 is not dead (in case you thought it was)!

I stumbled upon this most excellent series of posts by Moritz Lenz of perlgeek.de that describe the differences between Perl 5 and the upcoming Perl 6 (thanks to Andy Lester for the link). The posts are done in the form of tutorials, which helps comprehension. Simply awesome, Moritz.

It seems like Perl 6 is going to be a lot more object oriented, but such orientation is optional and not forced upon programmers, like in, say, Java. It warms my heart that I will be able to do this (you did see the new "say" function in Perl 5.10, right?):

1
2
3
my Num $x = 3.4;
say 

Share
3

How To Check If The Local SVN Revision Is Up-To-Date


Posted by Artem Russakovskii on July 23rd, 2008 in Linux, Programming

I've encountered a problem recently where I had to figure out if some checked out code is up-to-date with the svn repository, without actually running svn update. Unfortunately, svn update doesn't have a dry-run option, so I had to find another solution.

I came up with 2, depending on how detailed the information needs to be, which I'm about to share in this post.

1. If you want exact file and directory names, you can run:

svn status -u

If any files need updating, you will see a * before the file name.

svn status wc
M     wc/bar.c
A  +   wc/qax.c

svn status -u wc
M            965    wc/bar.c
       *     965    wc/foo.c
A  +         965    wc/qax.c
Status against revision:   981

Or

Share
4

How To SVN Update All Your WordPress Plugins In One Go


Posted by Artem Russakovskii on June 16th, 2008 in Beer Planet, Programming, Wordpress

If you're like me, most of your WordPress plugins are checked out into your plugins directory from the official WordPress SVN repository or some other one. I haven't updated any of mine for about a month and wanted to sync up everything quickly (including SVN externals). Here's a short command I ran to achieve that:

1
2
cd YOUR_BLOG_ROOT/wp-content/plugins;
find . -maxdepth 1 -type d -exec svn up {} \;

What this command does is finds the top level directories in your WordPress plugins directory, then applies the "svn update" command to each, one by one.

The result is something like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Share

Updated: June 1st, 2008

Recently I ran into major problems using GNU diff. It would crash with "diff: memory exhausted" after only a few minutes trying to process the differences between a couple 4.5GB files. Even a beefy box with 9GB of RAM would run out of it in minutes.

There is a different solution, however, that is not dependent on file sizes. Enter rdiff – rsync's backbone. You can read about it here: http://en.wikipedia.org/wiki/Rsync (search for rdiff).

The upsides of rdiff are:

  • with the same 4.5GB files, rdiff only ate about 66MB of RAM and scaled very well. It never crashed to date.
  • it is also MUCH faster than diff.
  • rdiff itself combines both diff and patch capabilities, so you can create deltas

Share
0

How To Install The Latest SOAP::Lite Using Perl CPAN


Posted by Artem Russakovskii on April 30th, 2008 in Programming

Apparently it's not straightforward to install SOAP::Lite, even using CPAN.

Check this out.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cpan[1]> install SOAP::Lite
CPAN: Storable loaded ok (v2.18)
Going to read /root/.cpan/Metadata
  Database was generated on Tue, 29 Apr 2008 18:29:45 GMT
CPAN: YAML loaded ok (v0.66)
Going to read /root/.cpan/build/
............................................................................DONE
Found 149 old builds, restored the state of 109
Warning: Cannot install SOAP::Lite, don't know what it is.
Try the command
 
    i /SOAP::Lite/
 
to find objects with matching identifiers.
CPAN: Time::HiRes loaded ok (v1.9713)

Huh? Okay…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cpan[2]> i /SOAP::Lite/
Module    ResourcePool::Command::SOAP::Lite::Call (MWS/ResourcePool-Resource-SOAP-Lite-1.0101.tar.gz)

Share

Updated: October 6th, 2009

I'm sure most Perl coders have to face this annoying problem at one point or another: how do you consistently get the return value out of a system call, be at executed via backticks or system()? Backticks return the output of the program with no error code in sight, while system() returns the error code but prints the output instead of putting it into a variable.

The best solution I could find to this problem to date was posted at http://www.perlmonks.org/?node_id=19119 and involved opening a piped filehandle. It worked quite well but always felt like a hack (which it was). Having used the new Perl 5.10 for a few months, I was shocked today to find this new variable that …

Share
3

Do NOT Use This Perl Module: Passwd::Unix


Posted by Artem Russakovskii on April 22nd, 2008 in Linux, Programming

Updated: April 29th, 2008

Update: The author of the module contacted me the same day and promised to fix it in the next version. Version 0.40 was indeed on cpan as promised, but I haven't tested it yet.

Passwd::Unix will corrupt your /etc/shadow file and rearrange login names and their corresponding password hashes.

The current version of Passwd::Unix corrupted my /etc/shadow upon only
calling the passwd() function. Immediately users started to report not
being able to login.

After examining the situation, I found that Passwd::Unix rearranges all
users in /etc/shadow in some way, but it only does it to the
usernames, and not the password hashes. Thus, you will get corrupted accounts. Moreover,
users are now able to login to one OTHER account, not …

Share