November, 2009


15
Nov 09

Daily Digest for November 15th

twitter (feed #2)
New blog post: Daily Digest for November 14th http://bit.ly/rgUv9 [SeanJA]
googlereader (feed #5)
twitter (feed #2)
RT pengwynn Twitter avatars remixed http://ow.ly/161E3u [SeanJA]
twitter (feed #2)
@gavinblair Ya… it doesn’t do too much now… I am thinking of teaching it some basic D&D stuff though [SeanJA]
twitter (feed #2)
Hans Rosling: Let my dataset change your mindset | Video on TED.com: http://bit.ly/14Pou4 via @addthis [SeanJA]
twitter (feed #2)
http://twitpic.com/pix68 – They still this? [SeanJA]
twitter (feed #2)
America banned sliced bread: http://bit.ly/2KFUMy [SeanJA]

14
Nov 09

Daily Digest for November 14th

twitter (feed #2)
RT @alyankovic: An all-star comedy Christmas carol: http://vimeo.com/7590670 [SeanJA]
twitter (feed #2)
@dzone @majson Ya, I am getting that too, from their site as well [SeanJA]
googlereader (feed #5)
twitter (feed #2)
Fluorine Uranium Carbon Potassium [SeanJA]
twitter (feed #2)
@d20_roller test 123 [SeanJA]
twitter (feed #2)
@d20_roller roll d20 [SeanJA]
twitter (feed #2)
@d2_roller roll d90 [SeanJA]
twitter (feed #2)
@d20_roller roll d90 [SeanJA]
twitter (feed #2)
twitter (feed #2)
~$ whois steve.jobs [SeanJA]
twitter (feed #2)
3 days until L4D2 is released… nice [SeanJA]
googlereader (feed #5)
twitter (feed #2)
@revnoah Hahaha Your Top 40 can now fit on an iPod Classic [SeanJA]
twitter (feed #2)
@d20_roller roll d60 [SeanJA]
twitter (feed #2)
@d20_roller roll d12 [SeanJA]

13
Nov 09

Daily Digest for November 13th

twitter (feed #2)
New blog post: Daily Digest for November 12th http://bit.ly/26f1Q2 [SeanJA]
googlereader (feed #5)
googlereader (feed #5)
Shared Lawn Order.
googlereader (feed #5)
twitter (feed #2)
googlereader (feed #5)
twitter (feed #2)
rt @carnage4life Google announces embrace & extend of HTTP with new SPDY protocol http://bit.ly/1UfvVK [SeanJA]
twitter (feed #2)
That’s right, I still hold the record for the 100 meters boys 12.13 at AISR (I don’t think any of my records have been beaten actually…) [SeanJA]
googlereader (feed #5)
googlereader (feed #5)
twitter (feed #2)
Best cufflinks ever http://bit.ly/3WUYOK [SeanJA]
twitter (feed #2)
Does anyone out there want to branch php with me so that it has a sane naming scheme? #php [SeanJA]
twitter (feed #2)
Aww… none of my extensions work in FF 3.6b2 [SeanJA]
twitter (feed #2)
There are people who talk a lot to themselves and learn a lot from the conversation http://i.imgur.com/NWYiq.jpg [SeanJA]
googlereader (feed #5)
twitter (feed #2)
SecuROM… 5 machine activation limit… so… can you deactivate a game on a machine? [SeanJA]
twitter (feed #2)
Is dzone borked? [SeanJA]
twitter (feed #2)
Robinson Crusoe on Mars: This film is scientifically authentic! [SeanJA]

12
Nov 09

Daily Digest for November 12th

twitter (feed #2)
New blog post: Daily Digest for November 10th http://bit.ly/4qSWUF [SeanJA]
googlereader (feed #5)
twitter (feed #2)
I can put an arrow in your tires from 100 paces, so be nice [SeanJA]
googlereader (feed #5)
twitter (feed #2)
Oops… Oracle got blocked by the EU… ah well [SeanJA]
twitter (feed #2)
Esculent… hmmm… can you use it in a sentence? Perhaps one involving pie? [SeanJA]
generic (feed #13)
twitter (feed #2)
Awww…. I am totally guilty of #7 but I think it is funny http://bit.ly/1Uv9Dm [SeanJA]
twitter (feed #2)
Are your loved ones plotting to eat you? Take this quiz to find out http://theoatmeal.com/quiz/plotting_eat [SeanJA]
twitter (feed #2)
There is a 49% chance my loved ones are plotting to eat me [SeanJA]
twitter (feed #2)
Gordon the Gopher (Go’s mascot) looks sketchy (via @lyndzrokz) http://bit.ly/1E83zN [SeanJA]
twitter (feed #2)
As it turns out, turning into a giant porcupine is against the laws of nature… [SeanJA]
twitter (feed #2)
George Washington invented instant coffee! [SeanJA]
twitter (feed #2)
New blog post: Stop Micro-optimizing http://bit.ly/4np0xb [SeanJA]
googlereader (feed #5)
Shared Plotbuster.
twitter (feed #2)
googlereader (feed #5)
Shared FUBAR booth.
twitter (feed #2)
Support Remembrance Day Poppy, add a #twibbon to your avatar now! – http://bit.ly/11ctu4 [SeanJA]
twitter (feed #2)
googlereader (feed #5)
googlereader (feed #5)
twitter (feed #2)
RT @twibbon: Amazing! 22,000 wear online poppies on Armistice Day #2minutesilence http://bit.ly/i22FC [SeanJA]
twitter (feed #2)
RT @rtraction: 2 Words – Garden Jawa – http://bit.ly/1QBI4N #awesome [SeanJA]
twitter (feed #2)
http://bit.ly/Qm5BV "Homo sapiens were sub divided into five varieties: [...], the African and the monstrous." [SeanJA]
twitter (feed #2)
Does he have a question? http://bit.ly/39ZARr [SeanJA]
googlereader (feed #5)
twitter (feed #2)
googlereader (feed #5)
googlereader (feed #5)
twitter (feed #2)
@NathanFillion Shouldn’t you be bumping elbows or something rather than shaking hands? Don’t you read the news? [SeanJA]
twitter (feed #2)
@gavinblair Nice, but disappointed that the city doesn’t move :P [SeanJA]
twitter (feed #2)
Yes! If there was any reason to drop someone off at a police station, this is it. http://bit.ly/3aPHLY [SeanJA]
twitter (feed #2)
I am a crucial part of this operation [SeanJA]
twitter (feed #2)
@cssquirrel Look for video cameras… you might have stumbled onto the set of Glee by mistake [SeanJA]
twitter (feed #2)
Oh no!RT @breagrant: dollhouse canceled! that’s too bad. [SeanJA]
twitter (feed #2)
@pengwynn Ooh… I still have 92 left, I offer up my my gmail invites as well [SeanJA]
twitter (feed #2)
twitter (feed #2)
I’m going to sextuple u #thingsthatsounddirty [SeanJA]
twitter (feed #2)
Want to see the ugliest bowl of cereal in the world? http://bit.ly/1kgQya [SeanJA]
twitter (feed #2)
@gavinblair I am glad that was a reply to a message from a while ago and not the one I just wrote… [SeanJA]
twitter (feed #2)
@gavinblair That doesn’t mean that they couldn’t move as well though [SeanJA]
twitter (feed #2)
Super Dave is back on Saturday!!!! [SeanJA]
googlereader (feed #5)
googlereader (feed #5)

10
Nov 09

Stop Micro-optimizing

Let’s look at a common php ‘optimization’ tip (note that I am only running this test on my computer, and I am not shutting things down to help it go faster).

Use single quotes ( ‘ ) instead of double quotes ( ” ) .

The reasoning behind this is that php parses double quoted strings for variables, so it takes way longer to process your evil double quoted strings than it does to parse your single quoted strings.

$test = 'something';
$repeats = 1000000;
$start1 = microtime(true);
$first = '';
for($i = 0; $i < $repeats; $i ++){
	$first .= 'string '. $test;
}
$end1 = microtime(true);
$time1 = ($end1 - $start1);
 
$start2 = microtime(true);
$second = "";
for($i = 0; $i < $repeats; $i ++){
	$second .= "string $test";
}
$end2 = microtime(true);
$time2 = ($end2 - $start2);
 
echo 'A difference of: '.($time2 - $time1) . ' seconds'; 
#=> A difference of approx: 0.244801044464 seconds;

A whopping 0.24 seconds over 1000000 string concatenations (a difference of about 0.00000024 per concatenation). I wouldn’t bother with this one, if the code is full of double quotes leave it.

Now, I am not suggesting that you rethink the micro optimizations that you make go ahead, make them if you must. But before you put too much thought into it, make those macro-optimizations that you are avoiding and clean up your code. Future you will thank you, especially if current you avoids dumb “micro-optimizations” like bit shifting rather than multiplying and dividing (dumb because for the most part, modern compilers make this optimization already, or your processor does a table lookup rather than doing the actual calculation).

#this:
9 * 256;
#is way more readable than:
9 << 8;