My Notes On Learning Python Coming From Perl
Updated: January 2nd, 2017
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 …
MySQL Slave Lag (Delay) Explained And 7 Ways To Battle It
Updated: September 16th, 2012
Slave 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
…
Updated: September 5th, 2008
So Google Chrome – Google's attempt at an open source browser, came out yesterday and I took it out for a spin. At its heart is the Webkit engine (also open source) and Google Gears, powered by SQLite (can MySQL rival SQLite in applications like this?). Here are my thoughts.
- Fast – Chrome loads extremely fast, blazing even. Granted, my Firefox would probably load fast if I didn't have any addons as well. Sites like Amazon or Digg load very fast. New tabs open instantly.
- Slow – http://www.blinkx.com/videos/channel:itn, seems like the combination of flash and html (or JS) on one page makes scrolling and redrawing quite slow.
- Very fluid design – I love how the tabs flow around
…
Moving From Perl 5 to Perl 6 – What's New, Tutorial Style
Updated: August 28th, 2008
Newsflash: 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?):
Debugging Weird sshd Connection Problems + What Happens When You Stop sshd
So the other day I was setting up public key authentication for one of my users, which is usually very straightforward: generate a private/public key pair, stick the private key into user's .ssh dir, set dir permissions to 0700, private key permissions to 0600, stick the public key into the authorized_keys file on the server, and the job's done. However, this time, no matter what I was doing, the public key was being rejected or ignored and the system was moving on to the keyboard-interactive authentication.
Debugging on the client side with -v didn't help much:
How To Play FLVs In Media Player Classic (Including Fast Forwarding), Or Forget You, VLC
1. I want to download and play FLVs on my computer.
2. I don't want to use some crappy FLV player that only plays FLVs and has an interface from either 1995 or 2034 – I want to use my favorite player, like Media Player Classic.
3. Yes, VLC plays FLVs but it can't fast forward or rewind them. Yes, mplayer plays FLVs but I want a GUI. Yes, mplayer supports GUIs but they all pretty much suck. I don't particularly like VLC's or mplayer's interface – want to fight about it?
Enter the latest version of ffdshow. ffdshow is a decoding filter – think of it as a set of codecs for your media players. It supports …
How To Find Out The Number Of Videos On Youtube
Updated: September 16th, 2012
According to Wikipedia, in April 2008, the number of videos on Youtube was 83.4 million (ref: http://en.wikipedia.org/wiki/YouTube#cite_note-5). However, the link in the cite note now displays “*” video results 1 – 20 of millions, without showing the real count.
Here's one way I found to get an estimated, but relatively accurate, number of videos on the popular video sharing site Youtube. The idea is simple. Get this feed: http://gdata.youtube.com/feeds/api/videos/-/* and parse out the number inside the <opensearch:totalresults> tag.
So here it is: the number of videos on Youtube is currently fluctuating between about 141 million and 144 million. The number goes up and down, which points to the fact that these are estimates.
That's a whole boatload …
How To Fix symbol lookup error: /usr/sbin/httpd2-prefork: undefined symbol: apr_ldap_ssl_init
Apache stopped starting today for no apparent reason.
1 2 3 4 5 6 7 |
rcapache2 restart /usr/sbin/httpd2-prefork: symbol lookup error: /usr/sbin/httpd2-prefork: undefined symbol: apr_ldap_ssl_init Starting httpd2 (prefork) /usr/sbin/httpd2-prefork: symbol lookup error: /usr/sbin/httpd2-prefork: undefined symbol: apr_ldap_ssl_init The command line was: /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL failed |
The command line was:
/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
failed
So I tried reinstalling libapr and apache2-utils related stuff with no luck. ldconfig didn't help either. It's not until I looked at /usr/lib and relinked a few things that it started working. What the hell, SUSE?
As Matt Cutts (Google's SEO and search quality expert) wrote in his blog entry a few days ago, Google PageRank updates are underway. Google updates PR (Page Rank) quite rarely – every three months or so, and it's the most important thing a website operator should be concerned with when it comes to site promotion and popularity.
I'm happy to report that Beer Planet's PR went up yet again on this update, from 3 to 4 and my buddy Thaya's PR went up from 2 to 3. He's been blogging a lot more about WordPress, and I think he'll surpass me very soon, thanks to his ingenious plugins.
Is it time to check your site's PR? You …
How To Check If The Local SVN Revision Is Up-To-Date
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 |
UFC Heavyweight Contender vs Former Champion Of The World [VIDEO] – God Damn!
I just saw this on TV and had to look it up and post. The guy that looks like a tank made out of meat is Brock Lesnar. In his first UFC match, he's fighting the former UFC champion of the world, Frank Mir. At first it seems the outcome is clear but the fight surprisingly ends in mere one and a half minutes. Here's the replay: …
If you are experiencing a weird feeling in your pants, it's normal. Here's to hoping they won't fuck it up. http://www.imdb.com/title/tt0409459/…
Jason Bourne 4 is a Go, To Be Released in 2010
Updated: July 26th, 2008
One of my most favorite movie series is not over yet. This is excellent news!
Producer Frank Marshall revealed plans to begin shooting a fourth Jason Bourne movie next Summer, for release in 2010. Universal announced the project back in February, with director Paul Greengrass and star Matt Damon set to return. Marshall also confirmed that they will probably be creating an original story for the fourth film.