Home
 

larrytc

About Recent Entries

World Series Win Probability Added Nov. 18th, 2009 @ 04:06 pm
This is just for the World Series itself. Maybe I'll run it for the entire playoffs at some point.

But basically, given two teams of equal strength, you can easily the "leverage" of a game - the difference in the win probability of a win and a loss. Given that and the WPA of players within a game, you can calculate the WSWPA of a player. Shocking nobody, the "leverage" is highest for game 7, 3-3, game 6, 3-2, game 5, 2-2, and so forth.

I ran the numbers for the current World Series, and Matsui was rightfully the MVP:

H Matsui 0.2523125
C Lee 0.1806875
J Damon 0.123375
A Rodriguez 0.121375
M Rivera 0.091625
A Pettitte 0.07425
P Feliz 0.0676875
D Marte 0.0588125
C Sabathia 0.0414375
R Madson 0.0376875
C Utley 0.0344375
J Posada 0.031375
C Park 0.0270625
C Ruiz 0.0256875
S Eyre 0.01925
N Swisher 0.016125
A Burnett 0.0148125
A Aceves 0.0065
J Werth 0.0035625
E Hinske 0.0035
D Jeter 0.002375
J Molina -0.0018125
B Bruney -0.0034375
P Coke -0.006125
M Teixeira -0.008875
B Myers -0.0105
S Victorino -0.011625
J Happ -0.01225
P Hughes -0.01325
E Bruntlett -0.0135
J Hairston -0.016625
M Stairs -0.0214375
D Robertson -0.023625
J Chamberlain -0.033625
M Cabrera -0.0375625
J Rollins -0.0455625
C Durbin -0.05
B Gardner -0.05325
B Francisco -0.05825
J Blanton -0.081375
R Ibanez -0.0878125
R Howard -0.0889375
P Martinez -0.11225
C Hamels -0.13125
R Cano -0.140125
B Lidge -0.17025

Matsui is responsible, by himself, a quarter of the World Series win. On the other end, poor Lidge gave away more than 1/6 of the World Series, and Cano is not far behind, which is not shocking if you were paying attention. And while Utley's power display was impressive, it wasn't even close, though there were whispers of giving it to Utley..
Tags:

6/4 Jun. 4th, 2009 @ 01:41 pm

There's quite a bit of media attention given to the events of 6/4.

I usually ignore most of the media around it.  Personally I feel like it's overplayed, but it is a necessity.

It happened 20 years ago.  Wow, 20 years is quite a long time.

I remember exactly where I was that day.  And a few things leading up to it.  Being in Hong Kong at the time, it was a front-row seat in the pocket of free media in the region.

Well, that's not entirely fair or accurate or true.  The Chinese media was relatively free at the time, and while there were concerns from HK about the coming handover of '97, things appeared to be changing - progress was made politically and economically.

And somewhere along the way, things changed.

It was a Saturday, June 3rd.  I was with family, going to a hiking trip on Landau Island.  It was fairly typical - walked around on trails and seeing the sights and chatting about things.  Transportation was not anywhere close to what is available nowadays, and it was not a day trip.  We stayed at a monastery that night, and we were split up - I was in a room with two bunk beds with my grandfather, my father, and my uncle.  It felt neat to be treated (somewhat) like an adult!

The next day we finished the hike, this time back to Hong Kong.  As you might expect, everybody was pretty shocked at what happened.  I was too young to understand enough to be afraid, but the atmosphere was notably different.

'97 seemed scarier than ever.

Along the way, the Chinese do not ask for political change anymore, nor do they appear to care for it.  Along the way, censorship is everywhere, nothing to see here.  Along the way..

It's not the only factor, but it is definitely one of those events that set off a series of events that..

I'm here now.

Current Mood: contemplative

Jun. 1st, 2009 @ 01:58 am
For some reason, this blog is my home away from home, where my vacation commentary lives.

Red Nov. 12th, 2008 @ 07:18 pm
Since this was started as a blog about Topcoder, I'm just going to scream here:

I'm red!

Nearly 7 years, most of it in yellow, now I'm red.

Doesn't mean anything, per se, but I'll take it!
Current Mood: jubilant

Nov. 5th, 2008 @ 08:24 am
Four years ago, a friend told me to keep an open mind, to keep an open heart.

I was disappointed, disheartened.

Nonetheless, there was hope. Where else can you have a peaceful coup every four years?

This year, we succeeded. The road ahead of us will still be tough, but now there's hope that things will be done.

Change.
Current Mood: relieved
Other entries
» (No Subject)
Stumbling upon this entry; on Boing Boing:

"FM used an 8 and the other office I'm in just changed their system to a 7 due to the San Mateo police department getting all upset (and I don't blame them) about how many false calls there are to their system. "


Which brings me back to a story of a time long ago..

In 95-96, the internets was just starting up, and AOL was the newest thing on the block. Personally, I actually got my first modem in 94 and was playing around with BBS and stuff. (remember those Consumer books with a listing in the back?)

In any case, at some point, we started getting random phone calls - once in a blue moon at first, but soon it appeared that a dam bursted somewhere. These weren't crank calls, as there is usually silence on the other line. *69 didn't get very far either - we even got one of those caller id things, at a time when these were not common at all (and they tacked on 10$ a month, those bastards). Many numbers were "unlisted", but even the ones were able to contact were generally unhelpful as they were nearly as confused (but nowhere as frustrated as we were). This was going on at maybe 5-10 calls a day for several months, filling the house with anger, paranoia, and many other stressed emotions..

Coming before the ubiquity of cell phones, I actually got a cell phone out of it, as it was the only "reliable" way to call anywhere. Ah.

In either case, if you didn't figure it out by now, here's the punchline. Apparently, our number was something like 921-xxxx, and another popular number was 21x-xxxx. It took a long time to figure it out, since people didn't realize they were doing it? Why not?

Because that 21x-xxxx number was an AOL number. During the peak of '96. I guess the only reason there weren't more calls was because well, the number never worked, so people probably tried other things eventually. The *69 and call backs generally didn't help as people weren't even calling people, so were mostly surprised we called back, as they didn't technically make calls. We eventually found some luck with a very patient guy that was going through what was happening and then realized it. AOL had one of the "debugging" options to use a 9 prefix to see if it worked. Wonderful.

We got a number change, and everything was peaceful again.. (well, as peaceful as a house with two teens can be..)
» (No Subject)
I think part of the reason why I've been blogging a bit about Singapore is because I'm here by myself - no one to make silly (and sometimes insightful) comments to, so I end up paying more attention.  Maybe.

Re:  Language Barrier

I think the numbers are something like 70% Chinese here in Singapore, which is why this city-state was ejected from Malaysia in the first place.  Unfortunately for me, they mostly speak Mandarin or some variation that I do not understand.  And the English here (or Singlish) is kind of awful, and gets worse away from the city center, which makes sense.


So, I went snowboarding in Snow City, which they claim to be a 3 story building.  It's about half a bunny, though maybe slightly steeper.  It's probably not as steep as things people usually go on, but it just _feels_ a bit steeper, partially because it's narrow enough that you can see the steepness, as opposed to getting lost in the background.

I fell a few times, as there were chunks of ice greeting me with surprise.  Not too bad over all, considering my last run was in March.

A run is about, 10 seconds at fast-ish speed, and maybe a little longer if you're cautious.  It's a nice enough place to have if it was in my backyard, but still good for keeping my legs a little fresh.  The dudes told me that on "expert"-er days, they put up boxes and rails.  I would've loved to play with that.

There were two pairs of other people, for a total of five people.  The short runs essentially mean that you can wait for the person in front of you finish without really waiting all that much.  There were a couple of elderly skiers who just kept on going, and there were two snowboarding newbies that were taking lessons.  In all, everyone appeared to enjoyed themselves, and all is well.

Oh ya, it was -7 degree C inside, which is about 19 degrees F.  I actually rented a jacket, but it turned out to be mostly unnecessary.  I guess I'm cool like that.  (No?)
» (No Subject)
I guess it's the first time I've been in an unfamiliar non-American city for years, and definitely one with very stable internet access.. (working for most of the day..)

Most Singaporeans speak English, to some varying degree.  I guess most major cities will employ people who speak English, to some varying degree.  Nonetheless, all the signs are in English, which is, at the very least, a great help.

I don't think I've been an entirely unfamiliar area in quite some time.  Korea was 4 years ago, the last time that the language barrier would be a problem.  The signs of names of places are in traditional Chinese there though, so the barrier is not as high.

You can also argue that Scotland had a higher language barrier - while English, the accent was so thick that it was mostly difficult trying to communicate.  It was much easier with the British.

In either case, I went to the Night Safari here last night.  Supposed to be unique and one of its kind.  It was pretty strange in a cool, discovering kind of way - all the animals we know and love in a different light.  Or lack off.  (Not clever enough for you?  ;))

It was neat, even though mostly, it was just of things sleeping.  The lighting was created to the same ambience of the moonlight, to not disturb the animals.  Needless to say, flash photography was frown upon, as the park staff is eager to let me know multiple times.  Mostly, the animals do what I do - sleep at night.  Well, maybe I don't get enough sleep at night, but that's another story.  It was slightly disappointing, and while I kept trying to get some pictures of the animals to do something, it was not to be.

I did get a few movies, of me describing a mostly dark scene.  The verdict when I finally view it, but if I had to guess, you might as well as look at pitch black stuff and listen to Larry talk about random stuff.

There was a part where you get to play with fruit bats, and they were flying randomly, eating random things that I hope are fruit.

I'll check the logs to see how long I took, though it was meant to be more than an hour long.  It was a bit rushed for me since I took longer than expected to get there, and didn't want to leave after all the trains stopped running.  Still, I got enough of an idea of what it was about.

It's a different perspective, and probably one that I can only bring home with vivid words.  Maybe with a promise to revisit in the future..
» (No Subject)
F1 is here, and sadly I'm going to miss it.  Apparently it's a huge thing, but being American, it means nothing to me anyhow.  Except for cars going really fast, which is always good, right?

On the flip side, it means tons of roads and stuff are closed.  And I'll probably have to leave for the airport just a little bit earlier just in case..
» (No Subject)
Threw up all night the "dinner" I had last night.  There goes the attempt to be cultural and look for local goodies and all that stuff.  Maybe next time.

As if Larry needs any more stretched analogies..

So I was walking back to the hotel from work yesterday.  I took the cab in the morning to work, because I didn't know the way (nor a map) and was kind of running late because my alarm clock was set to AM but the clock was set to PM.  Wasn't too long of a route, traffic considering, so I easily memorized the route the cab took and plotted it in my head.

Naturally, my memory is not what I think or hope it would be, and missing a right turn somewhere, I walked for a bit until I recognized that I no longer recognized anything.  I found my way eventually, with the aid of the address written on the back of a napkin.  Probably could've gotten there much earlier if I remembered I had it.

What it did cost was that it basically detoured my perfect plan for the evening by about an hour.  Since this was already in the evening, combined with my experience with cities worldwide, made the prospect a bit gloom.  You see, in most cities, every single thing closes at some point in the night, whether it's 8 or 9 or 10 or whatever is really cultural.  It's true in Hong Kong, it's true in New York, it's true almost everywhere.  Of course, there are exceptions, but that usually only comes with knowing where or what to look for.

During my lost hour, I did mentally noted various 24-hour food places, mostly your regular fine dining such as McDonalds and Burger King.  Still, you never know..

In either case, I got back to my hotel, changed, and popped right back out for that local cuisine, which might or might not exist.  But first, I went to the Merlion Park - the symbol of Singapore.  It was actually a bit out of the way, but it seems necessary, even if I'm usually anti-tourist traps.  Surprisingly, in a city where everyone's hawking stuff, the park and its intermediate area was mostly hawking free.  A bit of surprising pleasantness.

Eventually I settled down to what appears to be a cheap Malaysian fast food place and ate some noodles with eggs and tofu.  Mistake number k.

With the aftereffects not appearing for another hour or two, I walked around slightly disappointed that I would have to cut one of the places out of the loop.  Instead, I walked right into where I was looking for - a flea market so I can pick up random goodies for people.  Apparently it was late, but barely earlier enough that it was still open.

The joy of finding what you don't expect to find!

And then I went back to the hotel, watched some TV (including the classic Steve Chow's The Chinese Odyssey) and threw up half my weight.
» (No Subject)
Hong Kong was fun and relaxing.  Somehow I managed to avoided doing all the touristy stuff that friends and families drag me to in previous years.  This is probably partially because I came during a different season - people are either at work or in school.  So instead, I just hung out a bit with my cousins, helping them with homework, making fun of stuff and watching TV.  The familiar with the unfamiliar, only I'm not sure which is which.

Singapore I am here.  As a first impression, it seems like it's just like every other big-ish city I've been in, only the buildings here are not as densed or as high as the Hong Kong downtown.  Downtown Manhattan I don't know yet.

On another note, I accidentally brought gum into Singapore.  Worse, I was chewing it as I got off the plane, smiling confidently the entire way - as if it was an act of defiance!  I spit it out and surrendered my pack of gum (which also happens to be very accessible in my front pocket..) going through customs and not much was made of this ignorant foreigner.  Whoops.
» (No Subject)
I speak Cantonese with a good enough level (and with a local Hong Kong accent) that people don't think I'm from anywhere else, even if sometimes it sounds like I'm an idiot.

When I'm with family here, they know that I've been away for a long time.  There are probably some misconceptions somewhere.

Those of you who talk to me know that I don't always hear 100% - I make it up half the time by guessing what people are saying (just enough time for me to reply instantly, though I have enough time to stop myself if I guessed incorrectly).  You'll get a lot of "excuse me"s and "huh"s from me when that happens.

There's a reason behind it, physically, that I won't get into for now.

The amusing part is there here, people that don't know me that well just assume I'm slow and/or stupid.  While people who knows me (family, mostly) thinks it's because I don't know enough Chinese (though I do).  So they repeat things in English (or some attempts at a translation) in a condescending way, though mostly unintentionally.

So it goes.
» (No Subject)
So, I'm in HK.  I got struck between two fat dudes, one who kept waking me up every 25 mins to go to the bathroom or just rolling around.  Literally.  Didn't get to sleep all that much, so I'm drained.

Met up with cousins, and apparently it's Mid-Autumn festival tomorrow, so we're just chilling.  We were walking around playing with candles and lit lanterns and stuff.  That's retro right there.

The atmosphere here is unlike of any other place - the beach was crowded with people just having fun.  This is near midnight.

Apparently they have Blokus here too, and I dominated, of course.  And then got beaten by my 12 year old cousin..

Weather is very humid and warm here.
» (No Subject)

So, I was at the Worlds Science Festival the other day.  Ah, New York is a wonderful place to live.

There was an atheist group near one of the corners of the Washington Square park.  As I was walking by, some dude tried to give me a leaflet about doubting God, probably trying to lead me into buying the related book. (I forgot the title, though it was worded provocatively.. but not enough for me to remember it.  I guess it's tough to beat "The God Delusion".)

Of course, being the master New Yorker that I am, I was going into my "ignore people on the street" routine, when I thought better of it, and said, "You're preaching to the choir!"

The guy was flabbergasted, but quickly recovered enough to not be amused.

"You think this is funny?"

I just smiled and walked away.. (into the sunset)


» On living in Harlem
Harlem has this reputation of being this really dangerous place in the city. (here, the city refers to Manhattan.  The outer boroughs are "New York", and the rest of the New York is just "upstate") It's probably true at some point, and probably relatively true for now, but it's not so bad.

Being spoiled by living in Union Square, the transition was not painless, but for 800$ a month, I got an 1 BR with a little backyard in a "quiet" part of Harlem was nice - since I need to sleep to close to silent.

Equivalently, an apartment closer to downtown would cost in the neighbourhood of 1800$ a month at the time.  It sounds as awful as it is.

There were many arguments against Harlem - mostly the usual about safety concerns.  Being a minority in a minority neighbourhood must have some concerns.

But, the simple math won out.  Not even discounting the cost of food and other expenses, the 1000$ savings comes at a cost of a 30 minute longer commute with some safety concerns.

The math is simple - 1000$ = 50 20$ cab rides.  I never came close, and in the city it's not always the smart choice, but it actually costs me ~25$ to get work in a cab.  So basically I can literally cab to and from work almost everyday.  That eliminates a majority of the safety concerns. 

I don't, because I'm cheap, and usually only cabs during those late night drinking days.  Still though, I don't usually carry that much cash to begin with, but the difference is that if I got mugged less than say, 5 times (probably high) a month, for 200$ each (almost never carry that much cash.. and probably would stop after the first or the second time..) I would still come out ahead.  So getting mugged wasn't a concern for me - probabilistically it wasn't going to be that awful.  Being a New Yorker all my life probably helped - I don't think I'm a particular pushover.

The people I fear most are really the crazy and the irrational.  I'm cheap because I can be, but I don't actually value money all that much - though mostly I would like to spend it as efficiently as possible.  So if people want money, and poses a real immediate threat (as opposed to people trying to scare you and have you marked) I would not care too much about handing it over.

Crazy people are just crazy, not much to say about them.  Irrational people are probably teens for my definition - either they're bored and just wants to find something to do, or they are out trying to prove something, both classic "wrong place at the wrong time" scenarios.  They can happen anywhere in either case, but in theory more likely there.

---

So I spent a few months in Harlem, and while outside circumstances forced me away from it, I got friendly with some locals, and mostly enjoyed my time there.  There was only one instance where I was given a racist comment, but that was by some drunk, and mostly people didn't really care.  I didn't come close to being mugged, and I enjoyed it there.
» Topcoder went down

So despite almost certainly advancing, I'll have to wake up early again tomorrow.  Joy.

I hope tomorrow's set will be just as simple, but I wouldn't hold my breath for it - they'll probably end up using another, much tougher set, and it's going to wreck chaos.

Hopefully for me, it's just annoying.  Shame for some other people though.

Also, I had 249 points on the 250, which doesn't happen that often..
» (No Subject)
Today's got all the makings of an epic day.

Sick as hell.
2 hours of sleep.
Snowboarding.
Chipotle.
Drinking.  Drinking.  Drinking.

But I'm here instead of staying out until 5am today, probably disappointing a few people who I haven't seen but still wanted to drag me out for even more drinking.  Maybe I'm just old.

It'll start again tomorrow..
» TopCoder Blogger Thing
I didn't want to appeal to friends to make it a true popularity contest (though I did nudge a few members who already have accounts to it) but it was kind of cool to be a finalist.

Still, I can't help but feel a bit bitter over the results.

Obviously the .txt solution eliminates a sort of upfront cost of viewing the entry, which probably was clever and something I should've thought of. I did it in Word, and didn't even take advantage of it (and use images or otherwise).

It felt like I was in a fight with two hands behind my back. Couldn't help it.

Topcoders (who I haven't poked to vote for me) all mostly wondered why I chose this topic. TC didn't thought to include the criteria for which we're writing, so that's the other hand behind my back.

I aimed for visual imagery purely through words, and thought that it was the simple approach. I could've and in retrospect, probably should've been more flashy.

I was very naive in choosing a canvas, a background would be judged unbiasedly. Unforunately, most of the people were metagaming the contest - and in this case, the metagame was the game. And you can't blame the other players for playing, but you can surely blame yourself for not.

Ya, I probably should've wrote about the TCO '04 that I visited. Or the Google Code Jam. It's more technical, and I have pictures from both, so it would be more of a blog entry instead of a literary piece. After all, it is what they wanted.

The other handicap is the sheer amount of people who are willing to vote for Petr just because he's Petr. Not that there's anything wrong with that, other than that it's obviously bad for me.

You can debate that Petr's piece is better than mine, or that it's more suited than mine, and that it fits better than mine. It might even be all those things. But it's probably a bit unfair to think that it was deserved, per se. Being outvoted nearly 4-1 means something else completely..

In that case, we were voted on who we were more than our submissions.

And that leaves such a bitter taste in my mouth. Well, I don't blame Petr, in itself, since if you have the power to do that, you should totally take advantage of it. Just wished the rules were more fair for the rest of us non-targets.

It also doesn't help that I misjudged the intent, to some degree. Instead of writing a piece about something, both the winners essentially won on writing about what they would write about if they won. Politics is never going to be my strong point.

So what have I learned from all this?

Naivette and ideals are great and all, but it can only get you so far. The rest of you probably think I know better, and should've known better this time. And you're right.

I overthink on a lot of things, and mostly uselessly and needlessly. Heh, too bad not when I need to..
» Can you spot the error?
Horrible TCO on my part. It was one of those nights where I knew exactly what to do, but the programming was absolutely wrong.

I had many errors, and it ultimately led me to my downfall, but see if you can spot the error with the following code (assume all the logic is correct, the error might or might not be subtle, but it's totally context-less.) Yes, this is the "standard" textbook N^3 left-right DP.
	ArrayList[,] cache = new ArrayList[51,51];
	bool[,] done = new bool[51,51];	
	public ArrayList go( int left, int right ) {
		if ( done[left,right] ) return cache[left,right];
		int[] c = new int[26];
		for ( int i = left; i <= right; i++ )
			c[ s[i] - 'a' ]++;
			
		bool d = true;
		for ( int i = 0; i < 26; i++ ) if ( c[i] > 1 ) d = false;
		
		if ( d ) {
			ArrayList ret = new ArrayList();
			ret.Add( s.Substring( left, right - left + 1 ) );
			return ret;
		}
		
		ArrayList best = null;
		for ( int i = left; i < right; i++ ) {
			// split on between i, i, i + 1, right
			ArrayList now = go( left, i );
			ArrayList now2 = go( i + 1, right );

			for ( int k = 0; k < now2.Count; k++ ) now.Add( now2[k] );
			now.Sort();

			if ( best == null ) best = now;
			if ( better( now, best ) ) {
				best = new ArrayList();
				for ( int k = 0; k < now.Count; k++ ) best.Add( now[k] );
			}			
		}
		done[left,right] = true;
		cache[left,right] = best;
		return best;
	}

Better lucky than good - and apparently I wasn't either!
» Weeee Tetris DS
I've been playing Tetris DS lately.. not really taking away from my time, per se, just reallocating my TV time away..

The Tetris Wifi website updated today, apparently, and somehow, with a rating of 7313, I'm ranked 10th in the world (out of a few of tens of thousands). Of course, the Japanese and the Europeans haven't gotten the game yet, so I expect fully to fall ungracefully. But nonetheless, it's a bit amusing.

Oh ya, if you have the system, my code is:

083690
041563

Advertisement

Top of Page Powered by LiveJournal.com