OnLive trolls

Man, trolls suck be they on forums, in blog comments, or, when playing video games. I just had an experience with the OnLive video game service which has me of two minds.

I was playing Borderlands ( I *LOVE* This game ) single player… And a spectator started watching me. As soon as he entered (before I could even do anything) he gave me 30 “jeers” (essentially its like sitting on the sidelines at a sports game and yelling “BOOOOOOOO YOU SUCK.”)

Now I know that I can go into my preferences and turn notifications of “cheers” and “jeers” off (it’s be nice if I could just turn jeers off, but thats another matter.) The online person being an ass isn’t what bothers me (I’ve run everything from IRC networks to Forums to Blogs, I’ve come to grips with people and their need to troll.) It’s that now someone can troll me when I’m not playing a game multiplayer.

I tend to play games for an escape, the same reason I read books. On my Xbox360 I can play a game locally, and nobody bothers me. On OnLive that’s not the case. Someone can randomly find me – whether im playing a network game or not – whether they own the same game or not – whether we’re friends or not – and give me an, apparently, unlimited number of thumbs down. Even were I to change my settings to not show jeers while I’m playing it still goes on my OnLive profile telling the world “this guy must really suck.”

I think that the technology of OnLive is AMAZING, though I wish their selection of games was bigger and/or more timely, but I’m not sure I like other people intruding on my experience in this way with complete impunity. It really only takes a handful of spoiled apples to ruin the bunch sometimes.

I wonder how prevalent this is and whether other people find it as subtly annoying as I have?

[ Edit: As it turns out I was completely wrong about the permanence of cheers and jeers, they are thankfully not attached to your profile (at least not anywhere that I or anyone else can see them.) In this I was wrong 🙂 ]

Possible fix for TextMate always attempting to save files at the root of the filesystem

TextMate -> Preferences -> Advanced -> Shell Variables -> + -> HOME = /Users/[insert your username here]

Once I did this the default save folder it’s using now is my Desktop. Which is much nicer than “/”

I don’t know that this is an actual fix, but it seemed to work for me. YMMV. And in case it’s not obvious don’t put “[insert your username here]” in the value, but I bet you’re smarter than that anyways 😉

Peanut Butter Cup Salad

My wife asked me to recreate the recepie of something we get from the store so we could make it chunkier (yea, thats what I was told) and she could bring it for a potluck/meeting at work today… I got it pretty much spot on, so I thought I’d share it with you.

Peanut Butter Cup Salad

Ingredients

  • 1 cup whipping cream
  • 1 tbsp sugar
  • 1 tbsp lemon juice
  • 2 green apples
  • 2 red apples
  • 20 peanut butter cups
  • 1/2 cup roasted peanuts

Instructions

  1. Boil peanuts until no longer chalky when chewed, remote from water, set aside to cool and dry. If the texture is off-putting to you then don’t boil them, but the “chew” is nice in the finished dish, so perhaps use a more chewy nut instead?
  2. Core and cut apples into 4 wedges, slice wedges into 1/8 to 1/4 inch pieces each with a bit of skin. toss apple slices in lemon juice, set aside. The lemon will help prevent the apples from browning and give them a little bit more “zing” to cut the sweetness of the finished product.
  3. Cut peanut butter cups into desired sizes, chop the last 4 very fine (this is to flavor the whipped cream)
  4. Whip cream and sugar till stiff (if you cut a valley into your whipped cream the sides should not ooze in to fill the gap.) You want the cream just barely sweet, but not overly so, adjust sugar level while still soupy. If you’re feeling really adventurous bloom a packet of gelatin in a small bit of the cream before making your whipped cream, it will make the product last longer and give it a more unctuous mouthfeel (I have not actually tested this…)
  5. In a large bowl mix peanuts, apples, and peanut butter cups thoroughly. Mix them together first because over mixing with the whipped cream will make un-whipped-cream.
  6. Fold in whipped cream in 3 batches with as little “stirring” as possible (otherwise you break the whipped cream back down to just cream.) Everything should be just coated, but not so much that you can no longer see the ingredients (except the peanuts, those will be hard to see).
  7. Place plastic wrap tightly down on the entire surface of the mass in the bowl (cream picks up funky flavors in the refrigerator, and nobody wants their desert tasting like wet yak hair!)
  8. Let rest 24 hours for best taste (it takes time for the whipped cream to really soak in the peanut butter cup flavor.)
  9. Devour

Let me know if you try it and/or have anything to say about it!

Todays lesson: Check your assumptions

It’s easy to make assumptions about what we think is the problem with the speed of our code. Lets say you have a loop like so:

foreach( $big_list_of_things as $thing ) {
	$res1 = somefunc1( $thing );
	$res2 = somefunc2( $thing );
	$res3 = somefunc3( $thing );
	$res4 = somefunc4( $thing );
}

Since its your code you’re pretty sure most all of the time me being spent inside somefunc2 and everything seems pretty fast except somefunc2 which is noticeably slow. Maybe you did something like this to get a kind of anecdotal feel for how long things are taking (I do this kind of thing a lot…)

foreach( $big_list_of_things as $thing ) {
	$res1 = somefunc1( $thing ); echo "1";
	$res2 = somefunc2( $thing ); echo "2";
	$res3 = somefunc3( $thing ); echo "3";
	$res4 = somefunc4( $thing ); echo "4 ";
}

So you even see some slowness on func2 — Solved! well… maybe… Just because func2 is obviously a problem doesn’t mean that there aren’t other problems going on in your code that you weren’t expecting. And it’s not a huge amount of work just to make sure, so we might as well, here I’ll show you how.

$big_list_of_things = range( 1, 100 );

function somefunc1() { usleep( mt_rand(0, 100) ); }
function somefunc2() { usleep( mt_rand(0, 30000) ); }
function somefunc3() { usleep( mt_rand(0, 14000) ); }
function somefunc4() { usleep( mt_rand(0, 150) ); }

$t1 = $t2 = $t3 = $t4 = 0;
foreach( $big_list_of_things as $thing ) {
        $s = microtime(1);  
        $res1 = somefunc1( $thing );
        $t1 += ( microtime(1) - $s ); 
        $s = microtime(1);
        $res2 = somefunc2( $thing );
        $t2 += ( microtime(1) - $s ); 
        $s = microtime(1);
        $res3 = somefunc3( $thing );
        $t3 += ( microtime(1) - $s ); 
        $s = microtime(1);
        $res4 = somefunc4( $thing );
        $t4 += ( microtime(1) - $s );
}
echo "1: $t1, 2: $t2, 3: $t3, 4: $t4
";

Gives me the following output… and oh look… 2 is a problem but maybe 3 needs to be looked into as well. Would I have known about how much time 3 was taking? probably not since it “seemed” so fast…

php ./test.php
1: 0.0077567100524902, 2: 1.4149680137634, 3: 0.70513272285461, 4: 0.013875484466553
php ./test.php
1: 0.0079605579376221, 2: 1.5631670951843, 3: 0.62554883956909, 4: 0.013876676559448
php ./test.php
1: 0.0080087184906006, 2: 1.4883117675781, 3: 0.66886830329895, 4: 0.013206481933594
php ./test.php
1: 0.0074846744537354, 2: 1.5641448497772, 3: 0.64763903617859, 4: 0.012674331665039

Just last night I found and fixed a bug that must have been there for ages that I had no idea about by exactly this method. And in case you were wondering whether or not it’s worth it… Trust me… Sometimes it is…