TrueHoop’s Stat Geek Smackdown 2009

With reference to this event, I’ve decided to take my own shot at predicting the outcome of the 2009 NBA Playoffs. 5 points are awarded for correctly picking the winner, with an additional 2 for correctly picking the number of games played.

First Round (27 out of 56 points)

LAL-UTA (LAL in 5) (7 points, LAL won 4-1)
DEN-NOH (NOH in 7) (0 points, DEN won 4-1)
DAL-SAS (DAL in 6) (5 points, DAL won 4-1)
HOU-POR (POR in 6) (0 points, HOU won 4-2)
CLE-DET (CLE in 5) (5 points, CLE won 4-0)
BOS-CHI (BOS in 6) (5 points, BOS won 4-3)
ORL-PHI (ORL in 5) (5 points, ORL won 4-2)
ATL-MIA (MIA in 6) (0 points, ATL won 4-3)

I picked Miami (Dwayne Wade), New Orleans (Chris Paul), Portland (Brandon Roy) over the Hawks, Nuggets and Rockets respectively. Emotional picks, of course. That won’t happen for the next round. The next four picks (LAL, CLE, BOS, DEN) are statistically superior, and have home court advantage.

Eastern/Western Conference Semi-Finals (19 out of 28 points)

HOU-LAL (LAL in 7) (7 points, LAL won 4-3)
DAL-DEN (DEN in 6) (5 points, DEN won 4-1)
ATL-CLE (CLE in 4) (7 points, CLE won 4-0)
ORL-BOS (BOS in 7) (0 points, ORL won 4-3)

I was spot on in picking Cleveland and Los Angeles. Los Angeles was a lucky one, as they played badly (but still won). I fully expected Nowitzki and the rest of the Mavericks to put up 6-game series, but instead it was over in just 5. I picked Boston over Orlando as the last game was to be played in Boston, to no avail. The conference Finals will be fairly easy to predict, albeit Lakers inconsistency notwithstanding. With Yao injured in Game 4, they should have wrapped the series in 5 or 6 games, but it took a Game 7 to decide the winner. The Nuggets won’t give them an easy time, but the combined output of Bryant, Gasol, Odom and (hopefully) Bynum should triumph over Billups and company. Despite their current popularity, Denver is still over-rated. For the Magic-Cleveland series, Howard and company should be easily dispatched by LeBron’s Cleveland in just 5 games. And if King James exacts his will, maybe it will be a sweep (again) So it (should be) the NBA’s dream match up Kobe’s Lakers versus LeBron’s Cavaliers after all. Cleveland are too strong, however, and LAL will be sent packing (just like last year) in 5, maybe 6 games, injuries/suspensions notwithstanding.

Eastern/Western Conference Finals (7 out of 14 points)

DEN-LAL (LAL in 6) (7 points, LAL won 4-2)
ORL-CLE (CLE in 5) (0 points, ORL won 4-2)

I picked the Lakers-Nuggets series correctly. Despite Cleveland’s statistical superiority, Orlando won that matchup, unfortunately. I’d even predicted Cleveland to win the NBA Finals in 6, but unfortunately that was not to be, so we have a new pick to make. Los Angeles is finally playing well, and this time round, they will prevail.

NBA Finals (5 out of  7 points)

LAL-ORL (LAL in 6) (5 points, LAL won 4-1)

Total (58 out of 105 points)

Of a maximum score of 105, I scored 58, 17 points off the pace off David Berri, the Stat Geek Smackdown 2009 winner. I picked New Orleans over Denver (Berri +5), Miami over Atlanta (Berri +7), and Boston over Orlando (Berri +7). Had I participated in the official contest, I would’ve placed 6th out of the 9 contestants.

So it was the Lakers whom triumphed in the end. My congratulations to Kobe, Gasol, Ariza, Odom and Fisher, the 5 players that had the most impact on the series. My condolences to the Magic, but Howard is young, and with the return of Nelson and the rise of Lee, he still has many opportunities to win. I do hope that Magic will offload Lewis (somehow) in the offseason, and resign Turkoglu and Gortat, for they are the players that (truly) contribute to the team.

Lewis, at $110,000,000 over 6 seasons, is a ridiculously overpaid scorer who shoots too much, and plays badly at his position of choice (power forward). I would sooner play Gortat/Howard together, for a truly “shock and awe” combination.

Alston, who was signed in light of Nelson’s injury, should also be traded/benched, along with Reddick, players whom simply do not play well enough at the guard position to warrant anything more than garbage minutes.

As I look towards the rest of the star players who’ve had disappointing postseasons, we’ve certainly not seen the last of LeBron James, Dwayne Wade and Chris Paul.

NBA game recaps, not game info!

With reference to this post, I decided to write my first Greasemonkey script.

I don’t subscribe to cable TV, so I get my sports news fix mostly by reading. Now that the NBA playoffs are in progress, I use NBA.com on a daily basis to read recaps like this one. I’m upset enough that the Lakers — one of the eight teams I’m rooting for — lost, without having to right-click “Game Scoreboard”, copy the link, and replace “gameinfo.html” with “recap.html” — which is what I’m most interested in, since I didn’t watch the match.

This is a pain, and since I can’t control NBA.com, I’ve written nba_recap_not_gameinfo, a Greasemonkey userscript to do it automatically for me.

This uses the excellent jQuery, of course, and since this blog does programming-related posts, we’ll take at the important (super-simple) part consists of just 3 lines of Javascript.

So we’ll look for a descendants of span with class “gamelinks”, and then we regex-replace “gameinfo” with “recap”.

jQuery("span.gamelinks a").each(function() {
var $this = $(this);
$this.attr("href", $this.attr("href").replace(/gameinfo/, "recap"));
});

Java plugin (Firefox) on MEPIS

I found this link useful. It helped me to get Java running in Firefox. The instructions are a bit outdated, so I thought to repost.

First we need Java installed:

apt-get install sun-java6-plugin

We go to the Firefox “plugins” folder, and rename for the existing (not working!) plugin with a .bak extension, and then create a symlink to the (hopefully working!) plugin:

cd /usr/lib/firefox/plugins
mv libjavaplugin.so libjavaplugin.so.bak
ln -s /usr/lib/jvm/java-6-sun-1.6.0.12/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin.so

You’ll need to restart Firefox for the changes to take effect. Hope this helps!

OCI_COMMIT_ON_SUCCESS

I received the following error in my CodeIgniter web application today:

Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS – assumed ‘OCI_COMMIT_ON_SUCCESS’ in …

today. It turns out that, in MEPIS at least, you need the packages bc, libaio, even if you’ve compiled support for oci8. I re-added the packages, restarted Apache and it worked, once again.

MEPIS 8 and Fujitsu Lifebook S7110

I previously wrote that MEPIS worked (sound, wired networking, wireless networking) out of the box for my IBM R52. FYI, the wireless card is the Intel PRO/Wireless 2200BG. I’d also previously detailed instructions on Debian “Etch”. What I didn’t state was that I would encounter issues where wlassistant would report that it was unable to get an IP address (via DHCP) whilst attempting to connect to a standard WEP router. However if I left wlassistant switched on for awhile, it would (mysteriously) work later on. I got fedup, and mostly used a wired connection thereafter.

I’m pleased to note that there are no such issues for my Fujitsu Lifebook S7110, which uses the Intel PRO/Wireless 3945ABG:

lspci -nn | grep 3945
05:00.0 Network controller [0280]: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection [8086:4222] (rev 02)

When I booted up via the LiveCD, I feared the worst, as it was unable to connect to the (same) router. But go ahead and install nonetheless. On the first boot after install, I configured the network, to no avail. I rebooted however, and it worked fine. I’m still not sure what’s going on here, but it’s certainly a pleasant surprise.

For a time I feared that my laptop would reach it’s end of useful life before I found a distro as excellent as MEPIS, but that’s all in the past now.

:)

Oracle and PHP5 in MEPIS

This post helped me install Oracle XE on my developer machine successfully!

It worked for my Debian Lenny system previously, and now it’s tested to work with MEPIS 8.0, Ubuntu 9.04 and Linux Mint 7 as well.

1. Oracle Express Edition
This step is optional if you already have a server to use, but my inexperience it’s far better to have one local.

First you need to add this line to your /etc/apt/sources.lst:

deb http://oss.oracle.com/debian unstable main non-free

Then run the following commands:

su
wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -
apt-get update
apt-get install oracle-xe

It’s a big .deb file, 210.4MB to be exact. The installation, like most in Debian systems is a breeze. When the installer completes there is one extra step:

su
/etc/init.d/oracle-xe configure

You’ll be asked to create a system/sys (administrative user) password, and whether or not to start Oracle on boot.

2. oci8 static object
With oracle-xe successfully installed, we’ll focus on getting Oracle and PHP to place nice.

I downloaded the RPM versions of these files from here:

oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-jdbc-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-odbc-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-tools-11.1.0.7.0-1.i386.rpm

I’m sure that not all of the RPMs are required, so maybe you can try just basic, devel if you like. No guarantees, though.

I also converted it to deb using alien (which you may not have, but can install using ’sudo apt-get install alien’, and then installed:

sudo alien oracle*.rpm
sudo dpkg -i oracle*.deb

You need to log in to your oracle.com account and accept the software license.

You’ll need the ‘pecl’ command, which is available in php-pear, php5-dev:

sudo apt-get install php-pear php5-dev
sudo pecl install oci8

Input “1″ and hit Enter, then type (or paste) the following text.

instantclient,/usr/lib/oracle/11.1/client/lib

When you’re done, hit Enter twice to begin compilation. It takes awhile.

You’ll need to add one line to the end of your php.ini file:

sudo pico /etc/php5/apache2/php.ini

Page Down to the bottom, then add “extension=oci8.so”, and then Ctrl + X, Y to save. Repeat for the cli version too, found in /etc/php5/cli/php.ini.

Lastly, restart Apache:

/etc/init.d/apache2 restart

Embedding Flash in HTML, versus iframe

I recently received a request to develop a CakePHP website. The interface consists of a container 800 by 250 pixels width, with practically no chrome (company name, copyright info) whatsoever. It’s shows calendar entries for a given period, and users can click to view entry details (in a Thickbox). I thought the design was rather simplistic, and gave it no further thought. The project was completed in about 2 days, and I spent an additional 1.5 days making some minor changes.

Today I realized that simple design was because it was intended to replace a Flash-based calendar on the client’s homepage. I did a test with iframe, but it doesn’t work well, because the Thickbox (with entry details) is contained within the iframe.

Note to self: Clarify intended deployment method before giving price information. No hard feelings of course, since they might not understand that embedding Flash is not the same as iframe. Now it’s likely I’ll need to spend more time doing it right; i.e. template-ize their HTML, and then put in the (micro) website that I completed earlier.

SimplyMEPIS 8.0

My slow laptop is now running on SimplyMEPIS 8.0. Surprisingly, it doesn’t feel that slow anymore. Maybe it was an OS issue, but I digress.

The install process was a breeze. I used mepis-network to setup wireless access, gparted to partition the hard disk into two partitions of 8GB (root) and 2GB (swap) each, and then it installed by itself. Later, it setup grub for me so that if I wanted to boot into Windows, it would comply. But I won’t of course. When I boot into MEPIS for the first time, I wanted to setup wireless again, since the install was a Live CD. But I didn’t even need to perform that step! The network settings that I added during the Live CD boot had been saved! Voila!

IMO networking, particularly wireless networking has to improve significantly, even Lenny. I wish it would just work, rather than having to jump through hoops, and even then, not work particularly well.

Up till now, I cannot connect to my home wireless router. Before Lenny was released, there was a tool called “wlassistant” that worked occasionally. But now it’s gone, and all of the other tools (kwifi-radar, wireless-tools) do not work. And it’s not a router issue, because my other Windows laptops connect easily.

I’ll try to set this up as a development machine; if things go well I just might switch my (primary) laptop to MEPIS.

Kyle

I didn’t write this, of course, but it’s a good read, if a little lengthy. Something non- programming-related, for a change.

One day, when I was a freshman in high school, I saw a kid from my class was walking home from school. His name was Kyle. It looked like he was carrying all of his books.

I thought to myself, ‘Why would anyone bring home all his books on a Friday? He must really be a nerd.’ I had quite a weekend planned (parties and a football game with my friends tomorrow afternoon), so I shrugged my shoulders and went on.

As I was walking, I saw a bunch of kids running toward him. They ran at him, knocking all his books out of his arms and tripping him so he landed in the dirt. His glasses went flying, and I saw them land in the grass about ten feet from him.

He looked up and I saw this terrible sadness in his eyes. My heart went out to him. So, I jogged over to him as he crawled around looking for his glasses, and I saw a tear in his eye.

As I handed him his glasses, I said, ‘Those guys are jerks. They really should get lives.’ He looked at me and said, ‘Hey thanks!’ There was a big smile on his face. It was one of those smiles that showed real gratitude.

I helped him pick up his books, and asked him where he lived. As it turned out, he lived near me, so I asked him why I had never seen him before. He said he had gone to private school before now.

We talked all the way home, and I carried some of his books. He turned out to be a pretty cool kid. I asked him if he wanted to play a little football with my friends. He said yes. We hung out all weekend and the more I got to know Kyle, the more I liked him, and my friends thought the same of him.

Monday morning came, and there was Kyle with the huge stack of books again. I stopped him and said, ‘Boy, you are gonna really build some serious muscles with this pile of books everyday! ‘He just laughed and handed me half the books.

Over the next four years, Kyle and I became best friends. When we were seniors we began to think about college. Kyle decided on Georgetown and I was going to Duke. I knew that we would always be friends, that the miles would never be a problem. He was going to be a doctor and I was going for business on a football scholarship.

Kyle was valedictorian of our class. I teased him all the time about being a nerd. He had to prepare a speech for graduation.
I was so glad it wasn’t me having to get up there and speak.

Graduation day, I saw Kyle. He looked great. He was one of those guys that really found himself during high school. He filled out and actually looked good in glasses. He had more dates than I had and all the girls loved him. Boy, sometimes I was jealous!

Today was one of those days. I could see that he was nervous about his speech. So, I smacked him on the back and said, ‘Hey, big guy, you’ll be great!’ He looked at me with one of those looks (the really grateful one) and smiled. ‘Thanks,’ he said.

As he started his speech, he cleared his throat, and began:

‘Graduation is a time to thank those who helped you make it through those tough years. Your parents, your teachers, your siblings, maybe a coach… but mostly your friends… I am here to tell all of you that being a friend to someone is the best gift you can give them. I am going to tell you a story.’

I just looked at my friend with disbelief as he told about the first day we met. He had planned to kill himself over the weekend. He talked of how he had cleaned out his locker so his Mom wouldn’t have to do it later and was carrying his stuff home. He looked hard at me and gave me a little smile.

‘Thankfully, I was saved. My friend saved me from doing the unspeakable…’. I heard the gasp go through the crowd as this handsome, popular boy told us all about his weakest moment. I saw his Mom and dad looking at me and smiling that same grateful smile.

Not until that moment did I realize it’s depth.

Oracle SQL Developer is ****

As the title says, this is a rant.

Here’s the background. I’d been assigned an (old) IBM laptop running Windows XP at work. Except I like to use my own (newer) laptop to write code. So the only reason I even boot up the laptop is to use Visio, or maybe SQL Developer.

Usually I just krdc into the database server, and run SQL Plus off it. Oh, except today, I wanted to get the length of the column names, which is not available (why?!?) in SQL Plus. Or maybe there is something else other than “desc tableName” that I don’t know about, but I digress.

I booted up the aforementioned, crusty old laptop — What specs? see below — and waited. And waited.

cpu-z

My goodness. I heard from a fellow developer that they’re gonna phase out SQL Plus (why?!?) in the next version of Oracle, but, judging by the (not sweet) performance of SQL Developer, this is not a good idea.

Of course, it’s an old laptop (2004), and I’m obviously comparing apples to oragnes, but seriously I’d take SQL Plus anytime.

Return top