Wednesday, April 30, 2008

Duplicate songs on iTunes

Cav just stuck up a post where he was trying to figure out the chances of playing the same song twice in a session when you have a library of 1641 songs. I thought I'd have a shot at solving it, although my probability math isn't perfect either :-P. His question was particularly aimed at iTunes, but for our purposes we're going to assume that song selection is purely random (iTunes biases things somewhat in reality).

Obviously, for a 1 song session, the chances of playing the same song twice are zero. In a two song session, they are 1 in 1641, and in a 1,642 song session, the chances hit 100%. A 1,641 song session has an extremely small chance of playing each song exactly once. Those are some good reality checks on the probability. But how do you work it out for other session lengths?

Well, let's say I want to figure out the probability for a session of length n. We'll assume I know the probability for a session of length n-1, which we'll call p, and which is some value between 0 (no chance at all) and 1 (100% chance). I picture it something like this:


0....................0.5.....................1
ppppppppxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

This is kind of a random-o-meter. 'p' is the probability that we've already had a duplicate, and 'x' is what's left over. So, here's how I think of it: We're throwing a random dart at the meter. If it hits 'p', we had a duplicate even before we hit the current song. If we hit an x, we MIGHT still have a duplicate, because the current song might be the duplicate. What are the chances of that?

Well, we know that we've already played n-1 songs, and none of them were duplicates (or our dart would have landed on p). There are 1,641 songs to choose from, and there's an (n-1)/1641 chance that this time, we will pick a duplicate. So, if we land in the x region, then (n-1) in 1641 times, we still get a duplicate. So the probability is:

p: The chance that we have already played a duplicate
PLUS
The chance of hitting the x region (1-p) TIMES the chance of playing a duplicate (n-1)/1641

We already know the values for n=1 and n=2, but now we have some rules for figuring out additional values:

1: 0
2: 0.06%
3: 0.18%
4: 0.36%
5: 0.61%
10: 2.7%
20: 10.97%
30: 23.41%
50: 52.96%
100: 95.4%
200: 99.99997%

I hope that was enlightening.

Wednesday, April 16, 2008

Something really unusual in Hollywood

The National Association of Broadcasters is a nationwide group that acts as a kind of networking umbrella for everybody who works in broadcasting. They cover television, radio, and similar technologies. They lobby for the interests of broadcasters before congress, and they put on a huge national convention every year.

Last year, the convention was in Las Vegas, and was attended by about 111,000 people. The keynote address was unusually controversial. It was given by Tim Robbins, who works in a variety of media (acting, writing, directing, music, etc.).

Although there was a no-recording clause for the speech, and although everyone had to turn off their video cameras, someone caught a brief audio clip of the most controversial segment. In short, he railed on the media for the low moral character of their shows, and eloquently called for a change for the better. He got quite a round of applause for it, too. It's remarkably inspiring, so if you have a few minutes, give it a listen.

Wednesday, April 02, 2008

A whole new breed of penguin

Yesterday, BBC released some short clips about a newly discovered colony of penguins. My apologies to those of you that have YouTube blocked -- just search for 'penguins' on the BBC's website, and it's in the sidebar.

There were some great pranks from other sources yesterday. Probably the biggest was YouTube modifying the entire front page so that all the featured videos linked to Rick Astley's "Never Gonna Give You Up," instead of the video actually posted. In other words, they rickrolled their entire userbase. The name of the user posting the video was "YTRickRollsU," and the user page was a "Happy April Fools Day 2008" page.

I don't know what poor Mr. Astley did to deserve all the attention, but I hope he didn't sell his soul for it.

Oh, it looks like Robert Mugabe, the tinpot dictator of once-prosperous Zimbabwe, may have actually lost the election. This in spite of a significant campaign of media control and intimidation against his opponents. True, they have an inflation rate of 100,000%, some 80% unemployment, and the lowest life expectancy in the world, but it's still rather remarkable for someone as entrenched as Mugabe to actually lose an election. Here's hoping that Tsvangirai is more competent than his predecessor--fortunately for him, that's a wonderfully low bar.

I meant to do my taxes two days ago. I haven't forgotten, I just keep leaving necessary forms in all the wrong places.

Tuesday, April 01, 2008

The Red Army Choir goes South

Once upon a time, in a far away, cold northern land, there was a huge army that served the communist overlords. They were known as the "Red Army" or the "Soviet Army". Americans used to think that someday, the Red Army was going to invade the United States. When I was in elementary school, they used to do drills where we'd all have to duck under our desks. This was supposed to be helpful for when the Russians dropped a nuclear bomb on our school, though in retrospect it probably wouldn't have done any good. We also used to read scary stories about Russians cutting up American flags and then teaching all the children that freedom was bad. I think they were trying to train us up as future guerilla fighters, just in case.

Anyway, back in those glorious days, the Russians had a massive men's choir called the Red Army Choir. That's not actually what the choir was called. The full name was "Дважды Краснознамённый ордена Красной Звезды академический ансамбль песни и пляски Советской армии имени А.В.Александрова" which means "the Academic Ensemble of Song and Dance of the Soviet Army, Bearer of Two Orders of the Red Banner and the Order of the Red Star named after Alexandrov." Anyway, they would sing the Soviet anthem and a lot of other patriotic, communist songs for the purpose of inspiring the plebeian masses.

Anyway, it turns out that the Soviet Union kind of sort of collapsed, and singing patriotic songs about it fell out of favor. But that still leaves you with a perfectly good choir who now have a lot of free time on their hands. So what should they do about it?

Enter the Leningrad Cowboys. They're a Finnish rock band who have enormous hair and ridiculous sunglasses, and who thought it would be just hilarious to ... frankly, words fail me. You're just going to have to watch it.

The Leningrad Cowboys and The Red Army Choir singing "Sweet Home Alabama"

Truly, reality is often stranger than fiction.

Friday, March 28, 2008

Odd Signs

I spotted two particularly odd signs today.

The first was a billboard on southbound I-15. It's been up for maybe a few weeks, I'm not sure. The billboard has a picture of a yellow sunflower blossom on a blue background and, in large print, the title "Escape Polygamy." So presumably, if you're a woman (or man?) feeling trapped in your polygamous relationship, and you're fed up with it, and you just happen to be on southbound I-15 with a good memory for phone numbers, you can call the number on the sign.

I suppose there are polygamous relationships around here, although you never hear about them outside of occasional mentions in the news. It's still a rather curious billboard to have on one's morning commute. "Ha!" I yell at it, "It's tricky enough to find just the one!"

The other one was a sign posted in the men's room at work. It was advising, in rather polite terms, that you please refrain from passing kidney stones in this particular receptacle because they clog the drain. If it is strictly necessary to pass kidney stones, perhaps one of the other commodes might be suitable? It further mentioned that this should not be taken as any kind of medical advice, and that maybe, if you have kidney stones, you should consult a doctor.

Just maybe. That one obviously has a story behind it. A curious and strange story, filled with pain and horror and frustrated, mystified plumbers.

P.S. Cavan stinks! Will that cover my shout-out obligations?

Wednesday, March 26, 2008

Going for an English

Come the weekend, an English working man might get together with a few mates, down a few pints at the pub, and then finish off the evening by picking up some curry from an Indian restaurant. Indian food is popular in Britain much the way Mexican food is here, which might explain this rather odd skit: Going for an English.

I missed work today, so I'm going to keep this entry short and go to sleep.

P.S. Shana is awesome.

Tuesday, March 25, 2008

Toasted Cheese Sandwich

Today's blog title is named after what I had for dinner. It had Mrs. Ball's chutney on it, and therefore it was a good toasted cheese sandwich. What I actually wanted for dinner was steamed veggies, but I have to go grocery shopping for that, and since I left work early because I was feeling sick, I really wasn't up for grocery shopping. Hopefully taking vitamins can sort of make up for eating unhealthily.

Anyway, I'm not incredibly sick (I'll just say "sinuses" and leave it at that), but I'm not exactly bouncing around at the moment.

The Clinton campaign, smarting under a couple months of criticism for not releasing Hillary's tax returns, recently sent out an email demanding that Obama release his. Literally two minutes later, they did. Details on that little exchange here. For those who are too bored to read the actual 103-pages of returns, the summary is: He made about $1.5 million in 2006. He made a lot of money from his book, and made most of his money before that from managing a hospital and legal work. Frankly, the whole thing's pretty boring.

Given their hesitance, it might be that the Clintons' is a little more fun. But no one will know until they release it!

Oh, and regarding my music choice: I don't think I could ever like hip-hop, so I'm probably safe. It's not that country's evil so much as I used to think it was evil when I was a teenager. So the only person who's really disappointed is my former self. And he's a brat, so he'll just have to deal with it.

Monday, March 24, 2008

Blogging on Empty

I could've sworn I had something clever to say, but now I can't remember what it was. So you shall just have to put up with something stupid instead.

In a complete betrayal of everything good and holy, I purchased some country music. I feel as if I have somehow betrayed everything I once stood for. I have little to say for myself, except that I liked one of the songs. So there.

Easter was a lot of fun. I got to hang out with the sibs and much of the rest of the family. There was also an embarrassingly large amount of food served, and I don't think I have quite recovered yet. I continue to work out every day at the gym, but I'm not sure that a mere workout is going to cut it.

Sorry if the news is all boring, I'm just posting to try and stay in the habit. Apologies all round.

Saturday, March 22, 2008

I recently realized that some of my readers had never heard of lolcatz. They're not exactly high culture--more like the internet version of kitsch--but they're often pretty funny.

So here's a quick example.

There's also good stuff over at Cute Overload, although technically they're a slight variant from the lolcatz genre.

Friday, March 21, 2008

Weasels and coffee.

Another mini-post: This has to be one of the world's strangest products. Oh, and I'd say that the phrase "no one knows why they do this" has several layers of metaphoric meaning here.

This all started from a conversation about scorpions in vodka, by the way. Apparently, you see, they stick an actual scorpion in an actual bottle of vodka, and then said vodka is drunk. I don't know why anyone does that either, but at least that's got a layer of weirdly awesome on top of the insanity. The weasel thing is just plain insanity.

Thursday, March 20, 2008

I liked Obama's speech

Obama gave a really good speech. Better than Romney's really good one. It's a little uncomfortable, deeply thoughtful, and definitely worth the time to read. So go! Read it! Then comment!

Wednesday, March 19, 2008

Brain oozing out of ears

I've spent the last couple weeks working on a really hard problem.

It all started about six months ago. One of my coworkers wandered into my office in an absent-minded fashion, stuck some burritos in the microwave (I am the Keeper of the Microwave), and doodled some stuff on my whiteboard. He'd been thinking about a painful theoretical problem I'd brought up earlier, and he thought he had a solution. Which he did. It was awesome.

The problem was that it changes everything. It's a completely new way of representing curved surfaces. It can do everything the old method can do, but entire classes of problems simply disappear in a poof of simplicity. We wanted it yesterday, and it pretty nearly requires rewriting all of the code from scratch. Just in case you're not aware, Rewriting From Scratch is kind of the opposite of Staying In Business.

Over a couple of months, we worked out how it might be possible. We were considering some new features that were impossible in the old code anyway, and it was a great excuse. We would start on the new code, but it would have an interface between the old and the new. All the old code would remain in service, but the new tools would be added to the new side. A thick layer of conversion code would let the two sides communicate, and it would be responsible for making sure we could transition all the existing customers' models into the new style.

I spent a furious couple of weeks writing the skeleton of the new code. Everything had to be done over--data handling, saving and loading files, moving objects, undo and redo -- everything. I've already sunk several dozen days into writing the conversion layer, and there's still a good distance to go. I go home mentally exhausted pretty much every night, and it's hard to ask much more from a job than that.

Thursday, February 14, 2008

C'est le jour du saint Valentine

Today is Valentine's day, so naturally I decided it would be a great day to celebrate Curt's birthday. I treated Shana and Curt to dinner. The restaurant refused to take reservations, so we had to walk in and get in line for a table. The wait was only a little over an hour, which was a lot better than some of the people who were after us.

"Why are you celebrating Curt's birthday on Valentine's day," you may be asking, "when his actual birthday doesn't even happen till Saturday?" This, of course, is because we are stupid. Still, they gave him a brownie sundae for dessert, even though it wasn't his actual birthday. This might be because we lied and said it was his actual birthday. Maybe we will all go to hell.

Oh yeah: Andrew, the Novell cafeteria does do take out, although they charge a tiny bit extra for the containers. The main problem is that Novell's campus is kind of in the middle of nowhere, so it's a pretty long trip to get down there. If you're going to go that far, you may as well eat in.

Wednesday, February 13, 2008

This is what I had for lunch today. It was pretty good! One of the perks of renting office space from Novell is that we get to eat food at their cafeteria. One of the downsides of not actually working for Novell is that they charge us higher prices at their cafeteria.

Coming home was an adventure today--it was snowing heavily and the roads were icy slick. There was an awful lot of running red lights going on, and nobody really minded much because they couldn't really accelerate into the intersection anyway. I was planning on going out to buy some stuff, but ended up just going home in the end.

I have to go to BYU tomorrow. The colloquium is about regression testing of software, and that's something we do a lot. Maybe it will be helpful.

Well, that's all from me. I'm off to do another page of exercises for my Japanese course and then go to sleep. Nathan's out of town, so my apartment's really quiet right now.

Wednesday, February 06, 2008

What a day!

I actually locked myself out of my car! I technically knew that this was possible, but it requires quite a few things to go wrong, all in a row. Well, they did. Fortunately, knowing that I'm the kind of person that locks myself out of my car, I left a copy of my car keys at my parents' place, and they ran them down to me. Thanks, parents!

Of course, I was also sufficiently brilliant to leave my company ID inside of my car just before locking myself out, so I had the inestimable privilege of wandering around the freezing parking lot for the 20 minutes it took for the parents to drive my keys down.

Anyway, after all that, I needed some cheering up, so I went and bought fish. Specifically, it was some kind of herb-crusted salmon salad. It was really good, and so I'm back in a pretty good mood. It's a pity that food's ability to put you in a good mood also makes you gain weight. Ah well, I'll try and work a little harder at the gym tomorrow.

Monday, February 04, 2008

Back in school! Sort of!

I've signed up for an independent study course at BYU. I've been wanting to learn how to read Japanese properly, and while I've been making some progress in self-study, having a structured way of learning and access to a teacher should be an immense help. My goal is to get some reasonable level of JLPT certification. I still have no idea what on earth I would do with such a thing as a JLPT certificate, but it's a way of keeping myself busy.

The course is Japanese 300. Clarissa is also taking it, although unlike me, she has schedules and grades and things. I will get a grade in the course, but I remain blissfully detached from caring what it is. There was a big section on using the course to meet graduation requirements, and I chuckled my way right over it. It's a lot more fun to take classes without the pressure--now I just have to see if I will do any of the work.

I had Italian food for dinner tonight. It was really good. But I find myself craving a cookie, and I don't have any. Such are the privations of life!

Friday, January 25, 2008

Hospital Trip

I went to visit Grant at the hospital today. His blog has a lot more about the exact reasons for his hospital visit--suffice it to say that he's had major surgery, and the recovery has not gone very smoothly. I ended up staying for three hours, and mostly just shot the breeze about a bunch of things. Auntie Elaine was there too, and enjoyed chiming in when we were commiserating on how impossible dating seems to be around here (seriously, what is so messed up about Utah dating culture? I can't put my finger on it exactly, but there really is something strange about it, and it seems it's not just me. Maybe I'll rant about that another time).

Anyway, Grant's been playing a lot of Civilization IV, which looks incredibly addictive >_<. Now, there are several games that will keep me up late, but the building simulation games are the only kind that will keep me from making it to bed at all. Apparently Grant's had a similar experience. I no longer have Civilization installed on any of my machines, it's just too destructive, but boy has he got me tempted. Resist! Resist!

At any rate, his today was better than his yesterday, and yesterday was the worst day of his life. They're hoping he'll make it out of the hospital tomorrow, but he's going to need some pretty intense nursing at home for a while. He's got a lot of TV shows and movies downloaded, and he's probably going to be doing a lot of reading. If anyone has some brilliant ways for him to pass the time, feel free to contribute.

Wednesday, January 02, 2008

Random Event of the Day

Whenever you travel in another country, it's usually best to pay for everything by credit card. It's safer, it's got fraud protection, and it works at literally dozens of stores (I'm teasing ... most places I've been, you still need cash, but the cards still come in handy). Unfortunately, using a credit card with a foreign currency usually results in a small charge from the credit card company.

So, there's this fellow named Mike (his real name) who wanted to go to Costa Rica for about a month. His credit card had a charge for using foreign currency, and he wanted to avoid that charge, so he signed up for a Capital One Visa card. Unfortunately, because they're a suspicious bunch, they only gave him a $1000.00 credit limit. Mike needed a little more than that, so he asked if he could get the limit raised. "No," said CapitalOne. "You need to use it for about a year first." Okaaay, so what can he do? "Well, you could transfer a bunch of money into the account, which would effectively raise your limit." So that's what Mike did.

Oops, transaction rejected. Mike calls and ask what's wrong. "Oh, for amounts that big, you'll have to mail us a check," said Capital One. Greeeat, should have said that in the first place. By this time, Mike was getting a bit suspicious, and had them put notes on his account. Then he mailed them a check for $6000.00. And away they went to Costa Rica.

So, what happens? When he tries to use the card, he discovers the account has been frozen! Apparently, mailing them a check is a major breach of policy! "Read the notes on my account!" Well, the notes pretty clearly say that he was instructed to mail them a check. "So remove the hold!" No can do, that would be breaking the rules. "AAAAGGGGH!"

And so it ends, with him stranded in Costa Rica, selling pencils to tourists to try and get a boat ride home. Nah, just kidding, he went to his web site and posted the whole sordid tale. Within a few hours, the story had been posted to Reddit and made the front page. Maybe a few hundred thousand people read it. It also hit the online version of the Consumerist.

The guy in Costa Rica got a few calls offering support and money. And how they heard about it, I don't know, but Capital One pretty quickly removed the hold on the account and sent an explanatory email to the poor stranded traveler. He's being rather understanding, considering the circumstances. You can read a bit more detail here.

So there you go: the power of the Internet. Getting back at the big guys through flash mobs and all that. Actually, that's kind of the kicker of the whole thing: This happened today. Newspapers are getting rather thoroughly outpaced anymore. Fun, isn't it?

Tuesday, January 01, 2008

Happy New Year

2007 is over and 2008 has begun. The world's a year older and so on. I guess it hasn't been a bad year -- some interesting things happened, I went some interesting places, and I possibly even learned something. Eh, maybe that's being too hopeful. Here's hoping that 2008 works out even better, hmm?

Saturday, November 24, 2007

Belgian Waffles and Cougars

I actually got dragged off a to a football game today (or at least a broadcast of one). A friend of mine in the ward wanted to go at a local movie theater, and I turned him down last time he invited me to something, so I felt I probably ought to go. Anyway, it ended up fun (we won, and I ate popcorn), so hurray for football. In a fit of sanity, I changed out of my red T-Shirt into a blue one to go watch the game.

My parents are having their anniversaries this week, so we took them out to breakfast at a local restaurant. The food was really good, so score one for Mimi's breakfasts. Unfortunately, the service was sloooooww, so score minus-one, for a grand total of meh.

I filled in for a friend's shift at the temple for most of the afternoon and evening, which was a lot of fun. I haven't done baptisms in quite a while, so it was a nice change of pace from always doing sessions.