Home

Ha!

Posted on Friday, May 19, 2006
I don't think anyone reads this who would find this funny, but I get a kick out of it: Linux posters.

GO MAVS!!!

Posted on Tuesday, May 16, 2006
The Dallas Mavericks are hot right now! There are three series yet undecided in this round. Dallas is soundly thumping San Antonio 3-1. The Detroit vs. Cleveland and Phoenix vs. LA Clippers series are closer at 2-2 and 3-2 respectively. I'm presently at last place in our pool, 19 points down from the lead, but I'm still in it. The key is Dallas. Only I have Dallas winning the whole tournament. But even if things go as close to my bracket as possible, I'll only win by 7 points. It's still anyone's game.

Dallas is essential for me. If they don't win the whole shebang, I am mathematically eliminated. The only series for which I picked a different winner from anyone else (excluding Jayadev) are the Dallas series. Since I'm so far back, these are evidently very important. The tricky part is both Elizabeth and Linda also have Dallas getting all the way to the final. And even if Dallas wins it all, their point totals will be very near mine. (They are currently ahead of me.)

So to analyze my chances, let's assume Dallas will win it all and see how I stack up against Elizabeth and Linda. Presently, Elizabeth is 19 points and Linda is 12 points ahead of me. The Dallas series this round won't make a difference. We all said it'd last 7 games, so we'll all get the same points from it. The Dallas series next round will be interesting. Linda and I said it'd last 4 games, and Elizabeth said it'd last 7 games. So I will gain 4 points relative to Elizabeth if it really only lasts 4 games. (If it takes 6 or 7 games she will gain more over me.) Then there's the final. I'll gain between 17 and 21 points on the both of them.

Then there are the other series. Elizabeth and I both said the current Detroit series would go 5 games, and Linda said 6. If Detroit does win, it'll take either 6 or 7 games. This means Linda will gain another 2 or 4 points relative to me. Then in the next round, I said Detroit would win in 4, Elizabeth said 6, and Linda said 7. So if this is a short series, I have the chance to gain some more points on them. (On the longshot Detroit loses this round to Cleveland, this whole discussion is moot, and none of us get any points. But I have friends rooting for Detroit, so let's hope not! A Dallas vs. Detroit final would be fun.)

Then there's the Phoenix vs. LA Clippers game this round. We all have Phoenix winning it, and if they do it'll take 6 or 7 games and I'll lose on both of them. It'd be preferrable if the Clippers won. Aside from not falling further behind, it might make for a short Dallas series next round. And it's always fun to root for an upset team. (GEORGE MASON!)

I really need Dallas to win the final. Even so, my fate is not guaranteed.

Tomorrow, Liz and Nick are hosting poker. It's the first time since the incident. I hope they have cable so we can watch the games.

Oh and by the way, I probably won't be in Chicago for very long. Cheers.

Comments

mavsfan
Mavs rock. I am glad to see you have picked them. They are going to win the nba championship this year. Not to mention Dirk will be next years mbp and the mavs will win 2-3 of the next 5 championships. They are the next dynasty.
http://dallasmavericks-mavsfan.blogspot.com/

Undocumented options!

Posted on Monday, May 15, 2006
SVN has this wonderful idea where if you want to access a module in a repository you just stick it at the end of the URL, so you get something like http://site.com/repository/module. Should you ever need to know which part is the repository and which part is the module you are screwed, as each of these parts can themselves have slashes.

Of course, usually you don't care. You know what you want and you know where it is. But if you were trying to import into another version control system (say because you find it easier to use), you might. There's a nice tool called tailor which does this. So you might decide to use it. It works by getting the changesets from the old (say SVN) repository and then applying them in the new repository. But the changesets have paths relative to the repository root. That means that tailor has to strip off the "module" part of the paths, and for that tailor must know which part of the URL is the module part.

It has a very simplistic way of doing this. You have to tell it which part is which. To check you, it will test to make sure the repository root you give it is actually valid. Now, a webserver I encountered last night wasn't properly configured, and as a result tailor thought that test failed. At this point it bails, and tells me I screwed up.

That is, it bails unless you put the option "trust-root = True" in the config file. That option tells tailor to trust that I have given it the correct repository root. Unfortunately this option is documented neither in the command line help nor in the man page.

Aren't undocumented options grand!

Beauty & The Geek 3

Posted on Monday, May 15, 2006
It would appear a friend from that place might be in this show. Haha! (Hope they don't make him do a crossword puzzle!)

NBA Playoffs

Posted on Sunday, May 14, 2006
Rob's running a pool for the NBA playoffs. They started about 3 weeks ago, and last until sometime in June. Part of the fun of March Madness was watching our relative standings in the pool updated almost live. ESPN did it all for us. So when Rob started the pool, he called me up and asked how much work it'd be to make such a website. You see, ESPN doesn't have one for the NBA. I said it'd be a few hours of work, but I didn't commit to doing it.

This past week I've had a little extra time on my hands. The result is here. There are a few things I still want to do:

  • PPR! As you can see from the table, there's a spot for the possible points remaining. The scheme for awarding points makes calculating PPR somewhat more complicated than it might seem at first glance. A correct pick gets 2, 4, 8 or 14 points depending on the round plus 4, 2, 1 or 0 points depending on how closely the series length is predicted plus an upset bonus if applicable. The upset bonus is awarded when there is an upset, i.e. a lower seeded team wins. The upset bonus is the difference of the seeds. This is what makes it tricky! It's entirely possible that someone can maximize his points by losing a series one round, in order to get the upset bonus in the next. One has to take this into account to faithfully calculate PPR.

  • Automatic updates! The whole point of this thing was to make both Rob's life and my life easier (in the long run). I haven't yet written the script that will update the database. This is actually a pretty simple step thanks to AJAX. I remember back in the day when I might have to screenscrape to do this. But now every website has a nice XML feed so AJAX can automatically and asynchronously refresh its webpages.

  • Game progress! When I write that background script, I can get more information than the series tallies the database currently holds. I can follow individual games (scores and the like) and display these on the page. Of course, this means I should also use an AJAX-style refresh, to keep those updates coming. (Knowing the upcoming schedule will also allow for better caching!)

  • Clean code! I did this rather quickly, so it's a little messier than it has to be. It'd be nice if it were a bit more intelligible. The files so far total over 800 lines. Isn't that a kick?



I can now run a pool every year! Hah.

Good idea

Posted on Sunday, May 14, 2006
Take long walks in stormy weather or through deep snows in the fields and woods, if you would keep your spirits up. Deal with brute nature. Be cold and hungry and weary.

Que sera sera

Posted on Saturday, May 06, 2006
The Barefoot Contessa was on TV tonight. I came into it late, and couldn't figure out what was happening. Great fun to watch though. Bogie is unique. I leave you with a quote from the movie about the lonely times in life:

... there are no days and nights in it, just days that turn black when the sun goes down.

My Music!

Posted on Friday, May 05, 2006
I lost my music when my laptop went belly up. Well not quite, but my music's not as portable as it once was. I have a few CDs. I had ripped them all to my laptop. I didn't feel particularly compelled to back this up. After all, I own the CDs. I still have the music; it's just a pain to get it back onto my laptop again. So as I was sitting here ripping another CD, I became curious about the distribution. I'll share. The number of albums I have (box sets and multi-disc albums only count for one) with only one composer are:

  • 1 Albinoni

  • 3 Bach

  • 1 Beethoven

  • 1 Berlioz

  • 1 Bizet

  • 1 Brahms

  • 2 Corelli

  • 1 Debussy

  • 2 Dvořák

  • 26 Liszt

  • 1 Mozart

  • 1 Orff

  • 1 Rachmaninov

  • 1 Respighi

  • 4 C. Schumann

  • 1 R. Schumann

  • 1 Serebrier

  • 2 Shostakovich

  • 1 Sibelius

  • 8 Tchaikovsky

  • 1 Telemann



I have 5 other albums of classical music, and a few of popular music as well. So it'll be a while before it all comes back "online." This list certainly highlights the strengths and weaknesses of my collection (don't judge me for the Liszt!). If any of you are looking to buy me Christmas presents...

Esmerelda!

Posted on Wednesday, May 03, 2006
I had a pretty nice copy of The Hunchback of Notre Dame. I got it from this little bookstore in Terrell, Texas. For some reason which evades me now, my family and I went to Tyler, Texas (of Toadies song fame). On the way back, we stopped at a strip mall in Terrell. I found this little bookstore. I didn't recognize the name, but the store had 3 or 4 other locations. I have a habit of buying books on trips. I don't like souvenirs, and I don't vacation well, so I suppose it's a compromise. It gives me something to read on the way back, and a way to remember the trip. I bought THND in Terrell. I bought Sister Carrie at the Baylor bookstore. I bought Lucky at an airport.

The point of this is: I can't find THND now! I thought I brought it to Chicago. But I don't see it anywhere.

I take that back

Posted on Tuesday, May 02, 2006
Sorry, I meant to ask if you could believe there are two blogs devoted to random events that happen on Chicago mass transit. Here's the other one.

Weekend at Bernies

Posted on Monday, May 01, 2006
So yesterday I spent some time with part of my old bridge crowd. Four hours of staccato conversation. It was nice to see them again. We suggested future soirees. I wish I were more certain of my future...

Then Rob and I went to go play pool at the usual place. Call it practice for playoffs. You know what happened? We were charged for pool. (The bartender working didn't know us.) It brings up an interesting moral question: if they so regularly give us free pool, can we expect it? (Also, a former manager essentially offered everyone in the league free pool--but he no longer works there. He didn't promise anything though.) I really don't care, but Rob was incensed. I'm certain he's going to embarrass me. I have friends there. Why can't everyone be so laid back as I? :)

Sunday Funnies

Posted on Sunday, April 30, 2006
This probably is "too much information," but there's something I really like to do on Sunday mornings. I get up early, hit the grocery store for some snack food, and come back home to watch the Sunday morning political talk shows. I just can't get my day started without Bob Schieffer, Tim Russert and George Stephanopoulos. It's my way of keeping up with politics.

Bob Schieffer had Condie on today. What's her job again? It seems she believes herself to be the administration's (incompetent) press secretary. How's she ever going to have any diplomatic credibility abroad if she has absolutely no credibility locally. Bob tried to pin her down on some old issues, like troop levels in Iraq. Her answer was evasive and contentless (as usual): everyone makes mistakes and it's not the right time to analyze the potential mistakes surrounding the war. What she doesn't seem to understand is that even though every large operation will inevitably make mistakes, it's still alright to revisit the decisions leading to them. Decisions can be made intelligently and in good faith and still be wrong, and then decisions can be made hurriedly and tendentiously by Defense Secretaries on crack. That is, was it the administration's gross negligence and willful ignorance of the facts at hand which directly led to the horrible mess? (And further, if now's not the right time to discuss this, tell us when? We won't wait until a seemingly eternal war is finally abandoned.) Unfortunately, I don't think Condie even understood the question. Bob had to give up and move on.

On George Stephanopoulos's show, the highlight by far was George Will. His endless pessimism summed up this week in politics well. The topic at the roundtable was gas prices. Sure they've gone up, but they've been higher (e.g. in 1981, adjusted for inflation). Higher gas prices do have positive side-effects: they encourage conservation and thus have a positive effect on global warming (which the administration doesn't "believe" in...). The U.S. by far uses the most crude oil at 21 million barrels a day. China's at about 6, and India's at about 1 and a half. Cut domestic consumption. Increase production. (A windfall profits tax will hurt production. Carter did it; it didn't help then.) Encourage hybrid vehicles and E85. Give those idiots who bought SUVs what they deserve... Is this really so much of a problem?

Then Tim Russert had some interesting people, including our own Dick Durbin. He was on the opposite end of every issue from all three of the other guests. He seems to think the profits the oil companies see, and the salaries of the top men is completely out of line. But it's commensurate with what top men in other industries get. Look at what top hedge fund traders get paid. Half a billion dollars is a decent salary. Maybe that's too much, or maybe not. They get paid if they perform well, and they are accountable not just for their decisions but also the vicissitudes that affect their markets. Seems to me that if that CEO types are uniformly paid that highly, people must value what they do, and think that they are worth that. I suppose I'm a capitalist; I believe in a free market.

In other news, we have dropped a notch in the convention market. We were previously second to Las Vegas, but now we also follow Orlando. I mention this because some people think I happen to have a special fondness for Rosemont and the hummel museum...

Do you ever see a glimpse of your own future?

Posted on Sunday, April 30, 2006
I just did. You know the guy who sits on the porch in his little chair for hours at end, and watches all the people walking and driving by, trying to parallel park, walking their dogs... If I make it to age 60, I'm pretty sure that'll be me.

To the pub...

Posted on Friday, April 28, 2006
So I should let you know that my laptop now works. I had talked to Dell technical support at about 5 p.m. on Tuesday, and Thursday morning my laptop hard drive arrived. That's a pleasant surprise. I quickly installed it, then worked on installing my preferred operating system. This took a little bit longer than it should have, but I eventually got everything set.

Tonight, we went to the pub. We went to watch basketball. Rob, Bert, Elizabeth, George, Matt and Christina came. I was being overly "social" though. I was hanging out with some people nearer the pool table and more willing to play pool. The people were trying to hook me up with one of their female friends.

Amused...

Baby we can make it if we're heart to heart

Posted on Wednesday, April 26, 2006
Tuesday I crossed off most of my to-do list. In the process, I learned a lesson:

Don't call Dell technical support. Ever. I learned this the hard way. I called them, spent a little over half an hour giving personal information and describing the problem to a lady with one of the thickest Indian accents I've ever heard. This included giving my phone number, so she could call back if we got disconnected. Great idea! Poorly implemented: as we were discussing the problem at hand, the connection was dropped. No one called back. So I tried calling again. This time I got a guy, also clearly Indian, but with a much milder accent. He also seemed to know what he was doing. We got to the same part in the conversation before the connection was dropped, again. Naturally, he never called me back either. And I had no ticket number, and nothing had been started to actually resolve my problem. This is precisely why I had put off this call...

So at this point, frustrated, I tried Dell's online technical support. The lady was very helpful. Even though it took an hour, and her responses lagged considerably, it was infinitely better. I should have a part coming in a few days.

With a great feeling of accomplishment, I arrived at the CP for our pool league. It was the last week of regular play. Next week starts the playoffs. We're in the playoffs, but so is everyone else. (Our division only has 6 teams. The first team automatically advances, and the next 4 have these playoffs.) Anyways, we're having trouble with attendance. One of our guys is captain of a softball team. One is being flaky for unknown reasons.

The highlight of the day was the ride home. On the southbound red line, three girls entered at some downtown stop. One said, "Hey, look what James wrote," and pulled out a small note and began to read it aloud:

Dear Lola,

Your absence is like being hit in the ankle with a blunt object.


I grant you that being hit in the ankle with a blunt object must hurt, but when thinking of potentially painful things, is this the first one that pops into your mind? I had trouble not laughing too noticably. (There's a blog which specializes in things overheard on Chicago mass transit. Wouldn't you figure?)

Texas Blues

Posted on Monday, April 24, 2006
There's a song I like. I heard it attributed to a Texan blues singer. I think it was Mance Lipscomb, but I'm not sure. I haven't found it among his songs, as far as I can tell online. I heard it covered by some band on Prairie Home Companion, probably in 2003. The leitmotif of the song is "chains." Any help?

Rumours of my Demise

Posted on Saturday, April 22, 2006
To make a long story short, my laptop died. Actually, it seems the hard drive died. (It was my fault, but I won't get into that.) As a result, my access to jgarrett was hampered until now.

Anyways, I've been having a great few weeks, lately. I'll avoid getting saccharine about it, but I'm beginning to build a better appreciation... (Good luck if you can figure out what I'm talking about! In 2 weeks, I probably won't even know.)

I've been keeping in touch with that prospie who e-mailed me a while back. He decided to come. I'm somewhat curious how he found me. Anyways, because of a lack of access to my primary e-mail, I had to get inventive in figuring out how to respond to his last e-mail (which is on my now dead laptop). I googled, and he has a myspace page. So now do I (so I could message him). That's in the category of things I doubt I'll ever think about again. My brother has a myspace page even...

I should get back to real life now that I've checked this off my to-do list.

Are we a youth hostel now?

Posted on Wednesday, March 22, 2006
About two weeks ago, Q's Ukrainian friends stayed here for a few days. Then this past weekend, N had 3 college buddies and his brother over for the weekend--for his "bachelor party." (I do not think I saw his brother sober ever.) Then last night when I come home, there's some guy sleeping on the couch--one of Q's friends.

Anyone else need a place to stay?

Comments

Jeff Garrett
So M discovered my blog? :)
Manki
Dude, we totally need more entries, where you at?
The Sith Lord
Time and time again I've told you, please try not
to get senti about this. Do what must be done.
Every single friend of Q and N is now an enemy
of the apartment. (No pun intended.)
Anonymous
Time and time again I've told you: try not to get
senti about this. Do what must be done. Every single
friend or relative of N and Q is now an enemy of the
apartment.
Your other flatmate
Please try not to get senti about this.

Why PHP is not a real language...

Posted on Monday, March 20, 2006
PHP doesn't have named parameters. You know what that means? That's right, you have to specify every parameter to a function, in order and unnamed, even if there are default values. You can leave off parameters at the end, but only at the end.

Earlier today I thought, "Hey, it'd be neat to list the number of posts in each category." It's not exactly rocket science. The categories are listed by some function called list_cats, and it takes a parameter for just such an occassion. It's called optioncount because it controls the option of whether or not to list the post counts for each category. It defaults to FALSE, or in other words "don't show the counts." Hey, I told you it's not rocket science.

So I have just to send the function TRUE in that parameter instead of the default FALSE. Now here comes the whacky part. I now have to specify all the parameters of list_cats up to and including this one--even though I don't want to change any of the others. So the code must read:

list_cats(FALSE,'All','name','asc','index.php',TRUE,FALSE,TRUE)

There's only one other parameter in there that's not taking the default value. That's the one 'name' which says to sort by category name (it defaults to category ID--why!). So with named parameters, it could look as simple as:

list_cats($sort_column => 'name', $optioncount => TRUE)

Now I must ask you the reader a few questions. Which one is more readable? It's certainly not clear what all the parameters in the first one do. Furthermore, which ones are important? For example, which ones differ from the defaults? Which ones are there because the author intended them to be set, and which are just there because the language is braindead?

While we are at it, which line is more maintainable? If you write this and come back to it five years later, or even two days later, you'll have to scour the documentation to figure out what all the parameters of the first line do. You can make an educated guess (and probably be right!) for the second version. (Maybe PHP developers are envious of Perl developers for being able to create morasses of unmaintainable, illegible code! Just a theory.)

This shortcoming is nothing new. I used to use PHP all over the place. So when I encountered this flaw again, I thought, "Hey, maybe they fixed that in the latest version!" So I googled. Unsurprisingly, I found this guy Adam who thought named parameters would make his life easier. I'm sure there are many such people out there though. He had a nice link though... Apparently the PHP people did think about adding named parameters pretty recently. Laughably, they did not. The link gives three reasons:

  1. There is no real need.

  2. It's not simple enough.

  3. It makes code messier.



Now, certainly in my example, and in Adam's, it makes code simpler and easier to follow. What's more, it leads to maintainable code. You could actually read some lines without having to continually return to the manual or documentation. You can imagine how difficult it must be to actually figure out what's going on in a reasonably-sized PHP script. So really, that only leaves their first one: there is no real need.

I suppose. Other languages respect developer time. They try to help one make simple, legible, maintainable code. Ruby and Python stand out. Even Perl has named parameters. So in the sense that one can just use a decent language, I agree.

(If this seems like a bit of a rant, I suppose it is. I just see no reason to purposely thwart developers--even if they do use PHP. Given the option, the PHP language gods could add named parameters. It'd lead to better code, and save time for everyone. But they choose not to... WHY?)

Comments

WS
Yeah, PHP is crappy. I've been wanting to do Ruby on Rails, as I like the concept, but who has time these days to go learn yet another language? Not me.

I need more time. I traded time 5 years ago for a family. It was worth it, but my blog life has been tarnished ever since. Anyways, go check out the latest pics of me and the fam Jeff!

The mice are back...

Posted on Monday, March 20, 2006
And I can't get to sleep. I'm going to do laundry and hope I don't wake up Q.