<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6756950882378809744</id><updated>2011-11-27T16:09:41.478-08:00</updated><category term='business model'/><category term='irony'/><category term='codeing'/><category term='Bachelor Pad cooking'/><category term='programming'/><category term='serialization for D'/><category term='language theory'/><category term='algorithm'/><category term='faith'/><category term='back of the envelope'/><category term='links'/><category term='min max'/><category term='D'/><category term='SPL*.NET'/><category term='misc'/><category term='.net library'/><category term='response'/><category term='current events'/><category term='graph theory'/><category term='DSL*.NET'/><category term='optimization'/><category term='fear and reason'/><category term='fun'/><category term='followup'/><category term='travailing'/><category term='social science'/><category term='to someone'/><category term='fiction'/><title type='text'>return Array[$];</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>56</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-6176333634848342341</id><published>2010-10-19T22:12:00.000-07:00</published><updated>2010-10-19T22:20:54.821-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='faith'/><title type='text'>XKCD makes in interesting point, my mistake.</title><content type='html'>&lt;a href="http://xkcd.com/808/"&gt;Today's XKCD&lt;/a&gt; makes the point that of a number of crazy phenomenon, only the proven ones are used by capitalistic businesses. The claim being that the rest aren't real. Well I can agree with him on all but one; prayer. But then again, it's the only one he mentions that can't be monetized even if it's scientifically proven to work. (Then again even I think your crazy if you choose to &lt;i&gt;forgo&lt;/i&gt; normal medicine in favor of only prayer, so he's not totally without a point.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-6176333634848342341?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/6176333634848342341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/10/xkcd-makes-in-interesting-point-my.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6176333634848342341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6176333634848342341'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/10/xkcd-makes-in-interesting-point-my.html' title='XKCD makes in interesting point, my mistake.'/><author><name>BCS</name><uri>http://www.blogger.com/profile/16290373784404152656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-2304802698823667643</id><published>2010-10-01T22:19:00.000-07:00</published><updated>2010-10-01T22:41:30.652-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fiction'/><title type='text'>This season on TV...</title><content type='html'>Well there's a few new shows I'm following this season: &lt;a href="http://www.nbc.com/undercovers/"&gt;The Undercovers&lt;/a&gt;,&lt;a href="http://abc.go.com/shows/no-ordinary-family"&gt; No Ordinary Family&lt;/a&gt;, &lt;a href="http://www.nbc.com/the-event/"&gt;The Event&lt;/a&gt; and &lt;a href="http://www.nbc.com/chase/"&gt;Chase&lt;/a&gt;. The Undercovers is a bit formulaic, the plot is okay but it doesn't have anything to set it apart. No Ordinary Family has an interesting plot, sort of a light hearted Heros, but from the pilot I'm not sure if it's going to drift more towards the serialized drama/mystery or the comic side (I hope the latter). The Event is a blatant me-too serialized drama/mystery in the same direction as half the successful shows from the last few years. So far, it seems to move a little bit faster than most and doesn't seem to be afraid of telling the viewers what the heck is going on, both good things in my book, so it might stay interesting.&lt;br /&gt;&lt;br /&gt;The one real stand out so far is Chase. In some ways, a standard procedural, but it shows a lot of action from the fugitives standpoint and seems to be trying hard to not paint the bad guy as a 2D monster. The first two episodes have managed to present characters that are simultaneously convincing bad guys and real humans. If they can keep it up, I think I'm going to like this one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-2304802698823667643?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/2304802698823667643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/10/this-season-on-tv.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2304802698823667643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2304802698823667643'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/10/this-season-on-tv.html' title='This season on TV...'/><author><name>BCS</name><uri>http://www.blogger.com/profile/16290373784404152656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-7224291106788968682</id><published>2010-08-19T09:55:00.000-07:00</published><updated>2010-08-19T10:07:40.617-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fear and reason'/><category scheme='http://www.blogger.com/atom/ns#' term='travailing'/><title type='text'>Airport security... Bah!</title><content type='html'>I was flying home a few days ago and ran into an interesting "issue". While going through security, one of my bags got flagged for having "organic materials" on top of "wires". Well, put that way, it sounds kinda scary. On the other hand, a few bags of ground coffee and some ear buds sounds a lot less threatening.&lt;br /&gt;&lt;br /&gt;The up shot is don't pack food and wires together.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-7224291106788968682?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/7224291106788968682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/08/airport-security-bah.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/7224291106788968682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/7224291106788968682'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/08/airport-security-bah.html' title='Airport security... Bah!'/><author><name>BCS</name><uri>http://www.blogger.com/profile/16290373784404152656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4379581863654649206</id><published>2010-07-16T15:27:00.000-07:00</published><updated>2010-07-16T15:40:03.704-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='codeing'/><title type='text'>Ice skate dentistry.</title><content type='html'>My current project at work ended up handing me a mess to deal with. In short, I ended up with a few thousand lines of code to get code reviewed and no clean and easy way to break it up. After thrashing around for a while trying to create several change sets in the same directory, I reluctantly concluded that the source control system we use doesn't support what I wanted to do. I was reluctant because the alternative was push individual commits through in series or to have multiple copies of the full set and all the fun with propagation of edits that causes.&lt;br /&gt;&lt;br /&gt;Well, I chose the seconds and it's working. OTOH it reminds me of the scene where Tom Hanks does dentistry with an ice skate. Just because something work, or even is the best solution, doesn't make it even &lt;i&gt;remotely&lt;/i&gt; pleasant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4379581863654649206?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4379581863654649206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/07/ice-skate-dentistry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4379581863654649206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4379581863654649206'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/07/ice-skate-dentistry.html' title='Ice skate dentistry.'/><author><name>BCS</name><uri>http://www.blogger.com/profile/16290373784404152656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-2036893427841904463</id><published>2010-07-08T10:08:00.000-07:00</published><updated>2010-07-08T10:27:36.402-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>A gratuitously cute name.</title><content type='html'>I'm reading &lt;i&gt;Effective C++ 3e&lt;/i&gt; and in the OO section Mr. Meyers has one point he wasnt people to remember: The battle of Hastings was in 1066... OK, the real bullet point is that public inheritance models "is-a". To illustrate his point he uses the example that a Penguin is-a bird, but then goes on to point out that this can get you in trouble if you assume that all birds can fly. Well, not all can and several ways to deal with this are brought up including one that brings me to my point: &lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;tt&gt;class Penguin: public Bird {&lt;/div&gt;&lt;div&gt;public:&lt;/div&gt;&lt;div&gt;  virtual void fly() { error("Attempt to make a penguin fly!"); }&lt;/div&gt;&lt;div&gt;};&lt;/tt&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This struck me a remarkably funny, particularly if you include exception handling:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;tt&gt;virtual void fly() { throw new PenguinError("Attempt to make a penguin fly!"); }&lt;/tt&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Q&lt;/b&gt;: How do you attempt to make a penguin fly?&lt;/div&gt;&lt;div&gt;&lt;b&gt;A&lt;/b&gt;: You throw it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Q&lt;/b&gt;: Well how does that work out for ya?&lt;/div&gt;&lt;div&gt;&lt;b&gt;A&lt;/b&gt;: The penguin seems to be 'in flight' for a bit and then crashes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Right now I'm really regretting that I can't use exceptions at work because I can't wait to derive a Penguin class from Exception just for that case!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-2036893427841904463?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/2036893427841904463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/07/gratuitously-cute-name.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2036893427841904463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2036893427841904463'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/07/gratuitously-cute-name.html' title='A gratuitously cute name.'/><author><name>BCS</name><uri>http://www.blogger.com/profile/16290373784404152656</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-5244962360246090614</id><published>2010-07-05T11:41:00.000-07:00</published><updated>2010-07-05T11:50:05.896-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='fiction'/><category scheme='http://www.blogger.com/atom/ns#' term='followup'/><title type='text'>Another looks at David Weber's world.</title><content type='html'>First of all: WARING: MASSIVE SPOILER ALLERT! If you haven’t already read ‘Torch of Freedom’ and ‘Mission of Honor’, Stop Now! I’m not even going to attempt to tell the stories so you will spoil all the surprises and get none of the fun.&lt;br /&gt;&lt;br /&gt;A while back, &lt;a href="http://arrayboundserror.blogspot.com/2009/04/some-musings-on-david-webers-world.html"&gt;I made some predictions &lt;/a&gt;about what was going to happen in a &lt;a href="http://www.amazon.com/Torch-Freedom-Honorverse-David-Weber/dp/1439133050"&gt;pair of&lt;/a&gt; &lt;a href="http://search.barnesandnoble.com/booksearch/isbninquiry.asp?ean=9781439133613"&gt;forthcoming books&lt;/a&gt;. Well the no longer forthcoming; my copies are sitting on the desk in front of me. So time to see how will I did:&lt;br /&gt;&lt;br /&gt;-&lt;i&gt;When the Sollies attack the Lynx terminus, Manticore pounds them flat.&lt;/i&gt; - Sort of 1/3 outright kills, 2/3 abject surrender.&lt;br /&gt;-&lt;i&gt;Honor and 8th fleet is sent through to Talbott putting a substation portion of the Apollo equipped ships and their auxiliaries in Lynx.&lt;/i&gt; - partly right, 8th fleet is out of place, but at Haven. On the other hand, a lot of Apollo munitions are in Talbott&lt;br /&gt;-&lt;i&gt;While they are out of position the Oyster Bay ballistic pods attack.&lt;/i&gt; - Yup, but only the yards are the target.&lt;br /&gt;-&lt;i&gt;Most of the Manticore yards and many of home fleet ships that didn't go to Lynx get severely damaged.&lt;/i&gt; - All the yards get trashed but the fleet is untouched.&lt;br /&gt;-&lt;i&gt;The yard tech crews get out somehow.&lt;/i&gt; - The techs get toasted but ALL the R&amp;D types get lucky.&lt;br /&gt;-&lt;i&gt;Oyster Bay is blunted to some extent but still hurts Manticore a lot.&lt;/i&gt; - Spot on.&lt;br /&gt;-&lt;i&gt;Somewhere in all this, the Mesa spider drive ships attack.&lt;/i&gt; - Spot Off&lt;br /&gt;-&lt;i&gt;The Mesa manned units, take a royal beating including most of the units getting captured or destroyed.&lt;/i&gt; - Ditto&lt;br /&gt;-&lt;i&gt;Non of this shows up in Torch of Freedom.&lt;/i&gt; - A little foreshadowing but otherwise nothing.&lt;br /&gt;&lt;br /&gt;-&lt;i&gt;Zilwicki and Cachat infiltrate Meas.&lt;/i&gt; - Check&lt;br /&gt;-&lt;i&gt;They learn of Oyster Bay, Mesa's other plans and both the spider and streak drives.&lt;/i&gt; - Nope, sort of and yes.&lt;br /&gt;-&lt;i&gt;They don't get the full story.&lt;/i&gt; - No, but they came sooo close.&lt;br /&gt;-&lt;i&gt;They capture documentation, hardware or complete examples of a spider drive.&lt;/i&gt; - They got one of the people who designed the thing.&lt;br /&gt;-&lt;i&gt;They get enough to figure out how to detect the spider drive.&lt;/i&gt; - Nope.&lt;br /&gt;-&lt;i&gt;Zilwicki and Cachat capture a functional Mesa streak drive courier ship.&lt;/i&gt; - Nope&lt;br /&gt;-&lt;i&gt;They get back about the time Oyster Bay kicks off.&lt;/i&gt; - Nope&lt;br /&gt;-&lt;i&gt;Torch of Freedom ends with Zilwicki and Cachat on the way from Mesa to Manticore.&lt;/i&gt; - Almost, they are heading back but not directly to Manticore.&lt;br /&gt;&lt;br /&gt;-&lt;i&gt;Elizabeth, post Zilwicki &amp; Cachat, will send Honor directly (and uninvited) to Haven to offer not only peace but an alliance.&lt;/i&gt; - Directly and uninvited? Check. But pre Zilwicki/Cachat/Oyster Bay.&lt;br /&gt;-&lt;i&gt;Honor arrives with a very small task force as a pointed reminder that Manticore can still hurt them but isn't.&lt;/i&gt; - Same effect, Big taskforce&lt;br /&gt;-&lt;i&gt;Honor steamrollers her way into what she wants by, with impeccable manors, assuming that she will get it.&lt;/i&gt; - Not as much of a bulldog as I expected.&lt;br /&gt;-&lt;i&gt;She gets immediate talks (as in least time to Haven orbit and "meet me at the shuttle pad" immediate) face to face with Pritchart.&lt;/i&gt; - Almost exactly. &lt;br /&gt;-&lt;i&gt;After hearing what Honor (and maybe Cachat) has to say Pritchart jumps in on the spot.&lt;/i&gt; - Nope. &lt;br /&gt;&lt;br /&gt;On the other hand, much of what I missed in this set of points, happens later and in reverse when Pritchart take a trip to Manticore.&lt;br /&gt;&lt;br /&gt;-&lt;i&gt;Haven sends units to help protect Manticore.&lt;/i&gt; - Sounds like it will happen in the next book and not that they will actually need it in the short run. &lt;br /&gt;-&lt;i&gt;Manticore sends tech crews displaced from the Manticore yards to Bolthole along with the Zilwicki and Cachat's finds.&lt;/i&gt; - Not yet at any rate.&lt;br /&gt;-&lt;i&gt;Hemphill and Foraker start working together.&lt;/i&gt; - Ditto&lt;br /&gt;&lt;br /&gt;-&lt;i&gt;The Sollies eventually turn into a back drop for the Mantcore/Haven vs. Mesa  conflict.&lt;/i&gt; - Looks that way&lt;br /&gt;-&lt;i&gt; Mantcore/Haven begin to use Mesa’s operations to turn groups of Sollies away from war.&lt;/i&gt; - Maybe&lt;br /&gt;-&lt;i&gt;Some sectors fall to Mesa, others to Manticore/Haven.&lt;/i&gt; - It still looks like it will go that way.&lt;br /&gt;-&lt;i&gt;The Sollies fracture along the lines of what Honor outlined in Storm From the Shadows.&lt;/i&gt; - Still Looking that way.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Score:&lt;br /&gt;-Yes: 8&lt;br /&gt;-No : 6&lt;br /&gt;-Sort of: 8&lt;br /&gt;-Not yet: 7&lt;br /&gt;&lt;br /&gt;Not bad. None of the books went as far as I expected them to, but aside from that I was about half right.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-5244962360246090614?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/5244962360246090614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/07/another-looks-at-david-webers-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5244962360246090614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5244962360246090614'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/07/another-looks-at-david-webers-world.html' title='Another looks at David Weber&apos;s world.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-5649795166752617016</id><published>2010-03-04T23:35:00.000-08:00</published><updated>2010-03-16T12:22:59.050-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='irony'/><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><title type='text'>What are the chances?</title><content type='html'>Well I just got back from an interview trip to California. It was kind of fun. Oddly I found the worrying about driving more stressful than worrying about the interview (or actually doing either). The flight went off without a hitch and (once I figured out how to get way from the airport, man I hate construction) the driving wasn’t even that bad. The interview was fun, I enjoyed chatting with the people and the flight back was mostly on time.&lt;br /&gt;&lt;br /&gt;The fun part started in the San Jose airport while I was waiting for my flight back: I got there early and was standing around waiting when someone I knew from collage spotted me! I’m just shy of 690 miles from home in a city I can’t name a sole in and I run into someone I know and they're on the same flight as I am. What are the odds? (It was a Friday and this was the late flight home so if I was going to run into anyone I knew, it would be there and then.) Well it gets better. At Sea-Tac, while waiting for our connection (it sure was handy having someone who knew there way around there to follow), I ran into someone else I knew coming from Alaska and, just before the flight boarded, yet another coming from Boston. What are the odds? (Better than you might think given that it was the last flight to the local airport,.. but three different people in one trip?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-5649795166752617016?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/5649795166752617016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/03/what-are-chances.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5649795166752617016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5649795166752617016'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/03/what-are-chances.html' title='What are the chances?'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-6651421132918732351</id><published>2010-01-14T15:06:00.000-08:00</published><updated>2010-01-14T15:12:22.648-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bachelor Pad cooking'/><title type='text'>Bachelor Pad cooking – Meal in a pan.</title><content type='html'>&lt;p&gt;This is a cheep and tasty recipe that is quick to prepare and serve. &lt;br /&gt;The basic recipe:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Place &lt;u&gt;¼ cup dried grain&lt;/u&gt; (I’ve used barley and several kids of rice) in an &lt;u&gt;8 inch cast iron pan.&lt;/u&gt;&lt;/li&gt;&lt;li&gt;Add water until the grain is awash and just starting to float.&lt;/li&gt;&lt;li&gt;Put a &lt;u&gt;¼ to ½ lb portion of frozen meat&lt;/u&gt; on the grain.&lt;/li&gt;&lt;li&gt;Top with toppings of your choice:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;u&gt;Bacon&lt;/u&gt; (particularly if the meat is lean)&lt;/li&gt;&lt;li&gt;&lt;u&gt;Frozen sliced pepper, onions&lt;/u&gt;, etc.&lt;/li&gt;&lt;li&gt;&lt;u&gt;Salt, pepper, or other spices.&lt;/u&gt;&lt;/li&gt;&lt;li&gt;&lt;u&gt;Frozen vegetables; corn, bean, peas&lt;/u&gt;. (Or as a side dish.)&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Cover and seal with tinfoil.&lt;/li&gt;&lt;li&gt;Bake at 350°F for 50-90 minutes&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;Cooking time depends on the type and size of meat; For me, pork seems to take about 50 minutes, chicken more like 90. Until you know how long to cook it, check doneness with a meat thermometer or cut the meat open to check for any remaining pink sections.&lt;br /&gt;&lt;p&gt;With a little planning ahead this can be prepared in under 5 minutes. If you keep and eye out you can often get chap meat (I’ve seen it at little more than as $1/lb), cut this into serving sizes and freeze them in individual Ziploc type sandwich bags. Vegetables can similarly be prepared and frozen in advance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-6651421132918732351?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/6651421132918732351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/01/bachelor-pad-cooking-meal-in-pan.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6651421132918732351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6651421132918732351'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/01/bachelor-pad-cooking-meal-in-pan.html' title='Bachelor Pad cooking – Meal in a pan.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-7039509841924947698</id><published>2010-01-12T13:11:00.000-08:00</published><updated>2010-01-12T13:20:09.428-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Bachelor Pad cooking'/><title type='text'>Bachelor Pad cooking – Shake and Bake Pancakes:</title><content type='html'>This easy to make recipe has only cheep and common ingredients and results in very few items to clean up. (Prep time, 10-15 minutes, cook time 13-15 minutes.)&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Start oven warming to 450° F&lt;/li&gt;&lt;li&gt;In a &lt;u&gt;12oz canning jar&lt;/u&gt;, put &lt;u&gt;1 ½ Tbs. of real butter&lt;/u&gt; and a few oz of &lt;u&gt;milk&lt;/u&gt;, don’t worry about measuring the milk.&lt;/li&gt;&lt;li&gt;Nuke this for about 30-60 seconds. The butter should be starting to melt but you don’t want the milk to hot. Stir vigorously (use a chopstick or other small stick) until the butter finishes melting.&lt;/li&gt;&lt;li&gt;Add:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;u&gt;¼ cup sugar&lt;/u&gt;&lt;/li&gt;&lt;li&gt;&lt;u&gt;½ tsp. baking powder&lt;/u&gt;&lt;/li&gt;&lt;li&gt;&lt;u&gt;Salt to taste&lt;/u&gt;&lt;/li&gt;&lt;li&gt;A few drops of &lt;u&gt;vanilla extract&lt;/u&gt; (optional)&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Mix thoroughly.&lt;/li&gt;&lt;li&gt;Add &lt;u&gt;1 egg&lt;/u&gt;.&lt;/li&gt;&lt;li&gt;Close lid and shake until mixed.&lt;/li&gt;&lt;li&gt;Open and add:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;u&gt;½ cup flower&lt;/u&gt;&lt;/li&gt;&lt;li&gt;Milk to fill the jar, leaving some shaking room.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Close the jar and shake vigorously, making sure all the flower gets mixed in. If needed scrape the sides with a chopstick.&lt;/li&gt;&lt;li&gt;Pour into a well greased &lt;u&gt;pie plate&lt;/u&gt; and bake for 13-15 minutes.&lt;br /&gt;&lt;li&gt;Cut the side of the pancake free with a knife, razor blade or pointy stick and flip the pan over on a large dinner plate. Using a chopstick and being careful not to burn your self, separate the pancake from the pan (using a clear glass pan makes this easier).&lt;/li&gt;&lt;li&gt;Enjoy!&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-7039509841924947698?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/7039509841924947698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/01/bachelor-pad-cooking-shake-and-bake.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/7039509841924947698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/7039509841924947698'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/01/bachelor-pad-cooking-shake-and-bake.html' title='Bachelor Pad cooking – Shake and Bake Pancakes:'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4509539657027645483</id><published>2010-01-10T15:47:00.000-08:00</published><updated>2010-01-10T15:50:28.174-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='response'/><category scheme='http://www.blogger.com/atom/ns#' term='current events'/><category scheme='http://www.blogger.com/atom/ns#' term='business model'/><title type='text'>Why I think Netbooks don't suck.</title><content type='html'>&lt;a href="http://www.codinghorror.com/blog/archives/001318.html"&gt;Jeff Atwood did a blog article on Netbooks&lt;/a&gt; in response to a article by some other guy who says they are lame. For some reason, the comments are disabled so I'm commenting here:&lt;br /&gt;&lt;br /&gt;The other guy basically says that Netbooks are a worst of both worlds cross between laptops and cell phones. Well, I have to agree with Jeff on this one that this is dead wrong.&lt;br /&gt;&lt;br /&gt;I'll grant that Netbooks aren't that spectacular a computer but that's not what there supposed to be. As I see it, Netbooks are as close to a cell phone as you can get without giving up the reasons people even bother with real computers:&lt;br /&gt;&lt;br /&gt;- A keyboard that you can actual type on with more than two thumbs.&lt;br /&gt;- A real OS&lt;br /&gt;&lt;br /&gt;I don't care that it's not that powerful or that the keyboard is somewhat undersized or that it doesn't actually fit in my pocket. What I care about is that it's easy enough to pack that I carry it even if I'm not sure I will need it. I care that I can run any windows program I'm likely to use. I care that I can plug it into my wired network at home. I care that it runs for hours on a single charge. I care that I have full control over the file system.&lt;br /&gt;&lt;br /&gt;Down near the bottom, Jeff even goes so far as to question if Netbooks might take over the whole computer market. Well, I'm sure they won't. I'll grant that for most people's portable computing, Netbooks are it (small, cheap and powerful, pick two) but making things portable forces to many compromises that get in the way of other stuff. (A while back, about '03, I was shopping for a laptop and priced what I really wanted and compared it to the same things as a desk top. The difference in price could buy a low end laptop.) I see three end user markets; Netbooks for pack-it-with-you computers, desktops for no-compromises power processing and lots of screen space, and a small slot for desktop replacement type laptops for IT techs and what-not.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4509539657027645483?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4509539657027645483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2010/01/why-i-think-netbooks-dont-suck.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4509539657027645483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4509539657027645483'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2010/01/why-i-think-netbooks-dont-suck.html' title='Why I think Netbooks don&apos;t suck.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-27293374831274849</id><published>2009-08-13T10:02:00.000-07:00</published><updated>2009-08-13T10:05:11.643-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='links'/><title type='text'>Formal proof of correctness for a full kernel</title><content type='html'>&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://ertos.nicta.com.au/research/sel4/"&gt;The front page for the project&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://ertos.nicta.com.au/publications/papers/Klein_EHACDEEKNSTW_09.pdf"&gt;The write up&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://dobbscodetalk.com/index.php?option=com_content&amp;task=view&amp;id=1712&amp;Itemid="&gt;a write up of the write up&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-27293374831274849?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/27293374831274849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/08/formal-proof-of-correctness-for-full.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/27293374831274849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/27293374831274849'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/08/formal-proof-of-correctness-for-full.html' title='Formal proof of correctness for a full kernel'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-8748226839662314516</id><published>2009-08-13T08:58:00.000-07:00</published><updated>2009-08-13T09:57:54.694-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='back of the envelope'/><category scheme='http://www.blogger.com/atom/ns#' term='current events'/><title type='text'>MPG for an electric car?</title><content type='html'>It looks like the &lt;a href="http://news.cnet.com/8301-11128_3-10308235-54.html?part=rss&amp;subj=news&amp;tag=2547-1_3-0-5"&gt;EPA, GM and a few others&lt;/a&gt; are trying to figure out how to compare gas burning apples to plug in the wall oranges. Everyone knows what you are talking about when you quote MPG numbers but what about for a car that has gas tank or one that can be charged off the power grid?&lt;br /&gt;&lt;br /&gt;It seems that the EPA is trying to come up with a standard for how to equate the two. Well just to throw my two cents in: equate them based on what really matters. No one really cares how much gas a car burns (except for concerns of range) what people really care about is either how much money it takes to go some distance or how much CO&lt;sub&gt;2&lt;/sub&gt; you dump out doing it. The first number would be a bit tricky as both fuel and electric prices very a bit by region so some kind of national average would need to be used. The second one is no better because CO&lt;sub&gt;2&lt;/sub&gt;/kWh is a function of what is generating the reserve power on your grid? I happen to know that most hydro-power plants are run at either full power (or as close to it as something else lets them). The same almost surly goes for most of the renewable power sources as they tend to be use it or loose it systems. From that, all or most of the power production, will be from the dirtiest source around so it ends up being not at all trivial to compute.&lt;br /&gt;&lt;br /&gt;&lt;hr/&gt;&lt;br /&gt;Just out of curiosity, if a large chunk of the US fleet goes to plug in cars, how much power are we talking about? According to the linked article, 80% of cars go less than &lt;tt&gt;40 mi/day&lt;/tt&gt; and the only number cited for power consumption is &lt;tt&gt;0.25 kWh/mi&lt;/tt&gt; so if you assume the long tail puts the average at THE 80% mark, that gives you &lt;tt&gt;10 kWh/day/car&lt;/tt&gt;. If there is one electric car per 6 people in the US, that gives &lt;tt&gt;50 GWhr/day&lt;/tt&gt; or &lt;tt&gt;1.5 TWhr/month&lt;/tt&gt; of extra demand. For comparisons that is (based on mt reading of &lt;a href="http://www.eia.doe.gov/cneaf/electricity/epm/tablees1b.html"&gt;this report&lt;/a&gt;) about 0.1% of the total US electricity demand.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-8748226839662314516?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/8748226839662314516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/08/mpg-for-electric-car.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/8748226839662314516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/8748226839662314516'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/08/mpg-for-electric-car.html' title='MPG for an electric car?'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-1009696997899766579</id><published>2009-08-10T09:29:00.000-07:00</published><updated>2009-08-10T09:40:14.642-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='irony'/><category scheme='http://www.blogger.com/atom/ns#' term='links'/><category scheme='http://www.blogger.com/atom/ns#' term='current events'/><title type='text'>The best kind of vigilante justice</title><content type='html'>Every once in a while a story pops up about someone who takes the law into there own hands, almost always indicating a failing on some level: like the story of the town thug who got shot dead in the middle of a crowd of several hundred people and not one person saw the shooter.&lt;br /&gt;&lt;br /&gt;Well &lt;a href="http://www.spokesman.com/stories/2009/aug/09/deputies-find-robbery-suspect-all-tied-up/"&gt;here is a story&lt;/a&gt; that is just about the best possible case of vigilante justice I can think of: thief robs man, man tackles thief, man cuffs thief with wire ties, thief left for police &lt;a href="http://maps.google.com/maps?t=h&amp;amp;q=46.814167,-117.88&amp;amp;ie=UTF8&amp;amp;ll=46.814922,-117.880404&amp;amp;spn=0.015683,0.013797&amp;amp;z=16"&gt;in middle of main street.&lt;/a&gt; Now aside from the going after someone wielding a knife, and (maybe) the public humiliation factor, I can't see anything anyone can object to.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-1009696997899766579?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/1009696997899766579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/08/best-kind-of-vigilante-justice.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/1009696997899766579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/1009696997899766579'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/08/best-kind-of-vigilante-justice.html' title='The best kind of vigilante justice'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-412875895185516243</id><published>2009-07-27T10:53:00.000-07:00</published><updated>2009-08-03T10:02:27.660-07:00</updated><title type='text'>Google is funny.</title><content type='html'>I A few hours ago, Claimed &lt;a href="http://smplsite.com"&gt;a site&lt;/a&gt; in &lt;a href="http://www.google.com/webmasters/tools"&gt;google's web masters tools&lt;/a&gt;. One of the ways to do this is to add a file by a given name to the site. Well I added the file and finished the process. A bit later I took a look at the IIS logs and found this (slightly edited):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;12:36:46 72.14.194.33 - ... 69.49.230.86 80 GET /GOOGLE[...].html   - 200 0 Google-Sitemaps/1.0&lt;br /&gt;12:36:46 72.14.194.33 - ... 69.49.230.86 80 GET /noexist_[...].html - 404 2 Google-Sitemaps/1.0&lt;br /&gt;12:36:48 72.14.194.33 - ... 69.49.230.86 80 GET /google[...].html   - 200 0 Google-Site-Verification/1.0&lt;br /&gt;12:36:48 72.14.194.33 - ... 69.49.230.86 80 GET /noexist_[...].html - 404 2 Google-Site-Verification/1.0&lt;br /&gt;12:36:48 72.14.194.33 - ... 69.49.230.86 80 GET /google[...].html   - 200 0 Google-Sitemaps/1.0&lt;br /&gt;12:36:48 72.14.194.33 - ... 69.49.230.86 80 GET /google[...].html   - 200 0 Google-Site-Verification/1.0&lt;br /&gt;12:36:48 72.14.194.33 - ... 69.49.230.86 80 GET /noexist_[...].html - 404 2 Google-Sitemaps/1.0&lt;br /&gt;12:36:48 72.14.194.33 - ... 69.49.230.86 80 GET /noexist_[...].html - 404 2 Google-Site-Verification/1.0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Why the heck does Google need to load the same file 4 times? And why do they ask for another (nonexistent) file 4 times in a row. OK, yeah they have bandwidth to burn but it still seems a bit sloppy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-412875895185516243?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/412875895185516243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/googel-is-funny.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/412875895185516243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/412875895185516243'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/googel-is-funny.html' title='Google is funny.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-2020107650675816216</id><published>2009-07-27T09:44:00.000-07:00</published><updated>2009-07-27T09:51:10.701-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fear and reason'/><title type='text'>Bayesian statistics in the general media.</title><content type='html'>&lt;a href="http://news.bbc.co.uk/2/hi/uk_news/magazine/8153539.stm"&gt;This page&lt;/a&gt; needs more visibility. The take away is that, way to often, peoples first guess is wrong when it comes to statistical problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-2020107650675816216?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/2020107650675816216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/bayesian-statistics-in-general-media.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2020107650675816216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2020107650675816216'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/bayesian-statistics-in-general-media.html' title='Bayesian statistics in the general media.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-1023772873566037687</id><published>2009-07-10T12:25:00.000-07:00</published><updated>2009-07-10T12:30:51.865-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><title type='text'>Creative Phrasing</title><content type='html'>Found in a Police Daily Activity Log &lt;a href="http://www.moscow.id.us/police/daily_activity_log_09/dal_07_05_09.htm"&gt;July 8, 2009, 20:48&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;A moose is in the field, between Rolling Hills area and Moser, was in a yard. &lt;u&gt;Escorted&lt;/u&gt; from the city.&lt;tt&gt;[Emphasis added]&lt;/tt&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I like the way that's phrased...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-1023772873566037687?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/1023772873566037687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/creative-phrasing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/1023772873566037687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/1023772873566037687'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/creative-phrasing.html' title='Creative Phrasing'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-7012263532726812197</id><published>2009-07-05T18:06:00.000-07:00</published><updated>2009-07-05T18:17:11.982-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><title type='text'>The Consequences of Deciding and Timeing</title><content type='html'>This article on &lt;a href="http://feedproxy.google.com/~r/StuartSierra/~3/VU74w8Gqb9E/not-deciding"&gt;the consequences of not deciding&lt;/a&gt; brought to mind a story about one of the US presidents (sorry I don't remember where I heard it or the president's name): When asked to make a decision, he would ask how long he could wait to make it. Then he would ask the person to come back in that amount of time and then he would make the decision. Almost always he would have better information to decide with and sometimes all but one of the options where clearly wrong that that point. The trick here is that he needed to get a correct answer to his question; how long could he wait without causing other problems or &lt;i&gt;adversely effecting his options&lt;/i&gt;. The upshot is, make decisions as soon as you must, but no sooner.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-7012263532726812197?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/7012263532726812197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/consequences-of-deciding-and-timeing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/7012263532726812197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/7012263532726812197'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/consequences-of-deciding-and-timeing.html' title='The Consequences of Deciding and Timeing'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-3858873172158673064</id><published>2009-07-01T10:40:00.000-07:00</published><updated>2009-07-01T11:00:52.302-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='social science'/><title type='text'>Group size and unity.</title><content type='html'>This &lt;a href="http://www.schneier.com/blog/archives/2009/07/security_group.html"&gt;essay&lt;/a&gt; brings up some interesting points about group size and group dynamics. This kinda sorta ties into an idea I'd love to see tried: build a loose group of small highly specialized businesses set up to cheaply collaborate on projects. Each small business would be about 3-8 people and 3 or 4 of them (say a programming shop, a graphical design shop and an electrical engineering shop) would work closely together on a project with a few more acting as support (say a fab shop, a legal office and a secretarial service).&lt;br /&gt;&lt;br /&gt;The essay at the top lends a bit of empirical support to this idea based on group sizes effecting how well a group will work together. As for this actually working, &lt;a href="http://www.vengaworks.com/"&gt;these people&lt;/a&gt; seem to think something in the same ballpark is a good idea.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-3858873172158673064?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/3858873172158673064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/group-size-and-unity.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/3858873172158673064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/3858873172158673064'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/07/group-size-and-unity.html' title='Group size and unity.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-9196248569333541860</id><published>2009-06-26T10:17:00.000-07:00</published><updated>2009-06-26T10:58:29.258-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='business model'/><title type='text'>Beating CAPTCHA can be a good thing.</title><content type='html'>Anyone who has been around for a while has run across &lt;a href="http://en.wikipedia.org/wiki/Captcha"&gt;CAPTCHA&lt;/a&gt;s. These are one of the current state of the art weapons in the detecting-bots-arms-race. CAPTCHAs general boil down to finding problems that people solve easily and computers are really bad at and asking your user to solve it. One of the interesting things about this arms race is that CAPTCHAs can be designed so that successfully breaking one requires creating a better program for solving a problem that is valuable in the real word.&lt;br /&gt;&lt;br /&gt;One example of this is &lt;a href="http://recaptcha.net/"&gt;reCAPTCHA&lt;/a&gt;. They take the best &lt;a href="http://en.wikipedia.org/wiki/Optical_character_recognition"&gt;OCR&lt;/a&gt; they can get there hands on, find text it can’t read, make the text even harder to read and then fork it out for bots to do there best with. For someone to beat this, they would have to make a better OCR program. This has two interesting effects. First if the bot gets into general circulation (and it will sooner or later) reCAPTCHA can just start using it in there OCR system and be back on top. Second it furthers the state of the art in ORC and that is valuable in it’s own right.&lt;br /&gt;&lt;br /&gt;This thought has some interesting implications. More generally what a CAPTCHA does is use &lt;a href="http://en.wikipedia.org/wiki/NP_(complexity)"&gt;problems that are hard to solve but easy to check the solution on&lt;/a&gt; to make automatic access to a resource to expensive. How about doing this more directly? How about find commercially valuable computational problems that can easily be broken up into chunks that have this attribute and can be solved in a few seconds and checked in microseconds. Then the bots would need to expend a few CPU seconds per page load to access a site.&lt;br /&gt;&lt;br /&gt;One implementation of this could be a browser plug-in that allows you to bypass the CAPTCHA on a site. The publisher of the plug-in would push out code packets that the plug-in would be required to run. Sites that run the CAPTCHA could even get paid to use it (some fraction of what the central server gets after expenses) and to make things fun, the whole things is open so that anyone who wants can try to write better solutions to the problem. One neat trick would be to try to set the price paid by the central guy so that if you can improve the solver enough, you can make money by getting your own account and just solving problems after problem. Or if you that doesn’t make enough money fast enough for you, just sell your solution to the central guy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-9196248569333541860?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/9196248569333541860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/beating-captcha-can-be-good-thing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/9196248569333541860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/9196248569333541860'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/beating-captcha-can-be-good-thing.html' title='Beating CAPTCHA can be a good thing.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-663746173465642339</id><published>2009-06-19T11:29:00.000-07:00</published><updated>2009-07-01T23:37:39.130-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><title type='text'>Stackoverflow Flair widget</title><content type='html'>I have made up a &lt;a href="http://smplsite.com/soflare.html"&gt;quick hack of a page&lt;/a&gt; to add a &lt;a href="http://blog.stackoverflow.com/2009/05/nowearn-valuable-flair/"&gt;Stackoverflow&lt;/a&gt; &lt;a href="http://stackoverflow.com/users/flair"&gt;Flair&lt;/a&gt; &lt;a href="http://help.blogger.com/bin/answer.py?hl=en&amp;answer=53219"&gt;Widget&lt;/a&gt; to a blogspot blog.&lt;br /&gt;&lt;br /&gt;Note to the stackoverflow team: you have my permission to use that page wholesale if you want.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-663746173465642339?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/663746173465642339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/stakoverflow-flair-widget.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/663746173465642339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/663746173465642339'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/stakoverflow-flair-widget.html' title='Stackoverflow Flair widget'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-6274502178331600633</id><published>2009-06-16T10:17:00.001-07:00</published><updated>2009-06-16T10:24:04.095-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='links'/><category scheme='http://www.blogger.com/atom/ns#' term='current events'/><title type='text'>Open source; not just for software anymore.</title><content type='html'>This comapany in the UK (I think) is making an &lt;a href="http://news.bbc.co.uk/2/hi/science/nature/8103106.stm"&gt;"Open source" hydrogen car&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I think this is a really cool idea and I'm interested in how it will pan out. I have thought it would be interesting to do something like this but I had always thought along the lines of a &lt;a href="http://en.wikipedia.org/wiki/DARPA_Grand_Challenge"&gt;DARPA grand challenge&lt;/a&gt; like project or something fictional like a &lt;a href="http://en.wikipedia.org/wiki/Footfall"&gt;the spaceship Michael&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-6274502178331600633?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/6274502178331600633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/open-source-not-just-for-software.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6274502178331600633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6274502178331600633'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/open-source-not-just-for-software.html' title='Open source; not just for software anymore.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-6172898057140135720</id><published>2009-06-11T00:27:00.000-07:00</published><updated>2009-06-11T00:33:06.483-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='D'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization for D'/><title type='text'>Serialization for D part 6 of n</title><content type='html'>The latest and greates for &lt;A HREF="http://www.dsource.org/projects/scrapple/browser/trunk/Serial"&gt;my library is out&lt;/A&gt;. The new stuff for this edition is support for arrays and (limited, somewhat clumsy) support for 3&lt;sup&gt;rd&lt;/sup&gt; party types.&lt;br /&gt;&lt;br /&gt;The array support is transparent but the 3&lt;sup&gt;rd&lt;/sup&gt; party type support adds some new stuff to the API. I went with the function pointer approach and have a simple interface for attaching a pair of function to a given type.&lt;br /&gt;&lt;br /&gt;I'm thinking that a number of use cases will be common enough that I should create some boiler plate implementation for them. The first that comes to mind is serialization the same way that the rest of the types are; that is serialize all the members. Other cases would be to pull only selected members or to use a constructor to build the object rather than member assignment.&lt;br /&gt;&lt;br /&gt;I'm looking for ides for other cases so comments are welcome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-6172898057140135720?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/6172898057140135720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/serialization-for-d-part-6-of-n.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6172898057140135720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6172898057140135720'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/serialization-for-d-part-6-of-n.html' title='Serialization for D part 6 of n'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4980093445208453646</id><published>2009-06-08T22:47:00.000-07:00</published><updated>2009-07-05T18:23:50.724-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fear and reason'/><title type='text'>Looks like the bad guys are winning....</title><content type='html'>I wish we would see more people thinking like &lt;a href="http://www.schneier.com/blog/archives/2009/06/fear_of_aerial.html"&gt;this fellow&lt;/a&gt; with regards to fear over terrorist using services like Google Earth to plot attacks rather than the people he is quoting.&lt;br /&gt;&lt;br /&gt;If it weren't for the fear that I'd see it done, I'd write a satire about a terrorist cell that attacks systems they want shut down by using those same system to attack other targets they don't even care about.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4980093445208453646?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4980093445208453646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/looks-like-bad-guys-are-winning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4980093445208453646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4980093445208453646'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/looks-like-bad-guys-are-winning.html' title='Looks like the bad guys are winning....'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4832232564573415857</id><published>2009-06-02T13:39:00.000-07:00</published><updated>2009-06-02T13:45:01.042-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='current events'/><title type='text'>Thank goodness Linux != Probable cause</title><content type='html'>It's nice to see people making rational decisions in the legal system. For instance: &lt;a href="http://www.schneier.com/blog/archives/2009/06/update_on_compu.html"&gt;running Linux is not&lt;/a&gt; &lt;a href="http://www.boston.com/yourtown/newton/articles/2009/05/27/bc_student_gets_computers_back/"&gt;Probable cause for a search warrant &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4832232564573415857?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4832232564573415857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/its-nice-to-see-people-making-rational.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4832232564573415857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4832232564573415857'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/its-nice-to-see-people-making-rational.html' title='Thank goodness Linux != Probable cause'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-2444547605104184561</id><published>2009-06-01T15:14:00.000-07:00</published><updated>2009-06-01T15:27:45.032-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='language theory'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Static Initialization Check Feature</title><content type='html'>&lt;p&gt;While thinking about &lt;a href="http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-5-of-n.html"&gt;how to do 3&lt;sup&gt;rd&lt;/sup&gt; party types for my sterilization library&lt;/a&gt;, I ran into an interesting problem; how to verify that boot time initialization is done correctly.&lt;br /&gt;&lt;p&gt;Some cases are easy, for instance, where the initialization is done by the same code author that defines the validity check. In that case the checks can just be appended to the initialization code.&lt;br /&gt;&lt;p&gt;The problem cases is where the two bits are separated. This is a sort of punting model where the first author "punts" by throwing out some state variable and expecting someone (a second author) to set them up correctly. In this case you have the problem of where to put the checks. If you put it in a static constructor in the module with the state variables, then it ends up running before any static constructors in the modules that could have set the values. Another option is having a test function that the second author needs to call, but they could forget. A third option would be to have a function that gets called at the top of &lt;tt&gt;main&lt;/tt&gt;, err, yuck. The option I think I'll go with is to check that things are correct on the tare down and then force an immediate teardown at some point as part of the test rig.&lt;br /&gt;&lt;p&gt;What I'd really like is some sort of delayed assert that runs after all the &lt;tt&gt;static this&lt;/tt&gt;s but before main. Of course then I'll want something between that and main... &lt;a href="http://blogs.msdn.com/oldnewthing/archive/2009/03/18/9485229.aspx"&gt;(Yet another example of why to never have more than two levels of operation if you can avoid it)&lt;/a&gt; To avoid that issue it could be restricted to provably side effect free expressions. Given that in my case all I want to do is check that a global is non null this would be just fine for.&lt;br /&gt;&lt;p&gt;Of course, in my case what I'd really like is static whole program optimization and analysis to, where possible, rip out static constructors in favor of literal data segments and replace the checks I'm taking about with compile time checks. But now I'm just dreaming.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-2444547605104184561?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/2444547605104184561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/static-initialization-check-feature.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2444547605104184561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2444547605104184561'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/06/static-initialization-check-feature.html' title='Static Initialization Check Feature'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4142495330062422087</id><published>2009-05-31T17:21:00.002-07:00</published><updated>2009-05-31T20:47:05.830-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='D'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization for D'/><title type='text'>Serialization for D part 5 of N</title><content type='html'>&lt;p/&gt;I figured out why the hard-link stuff wasn't working as I was expecting; I had the annotation on the referring type rather than the referenced type. Fixing that wasn't much of a problem and cleaned up some other code in the process.&lt;br /&gt;&lt;p/&gt;Well, with that, I think I'm done with all the easy parts.&lt;br /&gt;&lt;p/&gt;The next bit I'm planning on tackling is 3&lt;sup&gt;rd&lt;/sup&gt; party types. That is how to serialize types that you don't control and can't add stuff to.&lt;br /&gt;&lt;p/&gt;I don't really like any of the options I've come up with but I think I've got something that will work. If anyone has any better ideas, I'm interesting in hearing them.&lt;br /&gt;&lt;h3&gt;The Compile Time Option&lt;/h3&gt;&lt;br /&gt;&lt;p/&gt;It would be nice to make it just a call to function like &lt;tt&gt;Serialize(value,sink);&lt;/tt&gt; but that only works as long as all the overloads are all in the same module. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;module t1;&lt;br /&gt;int Baz(int){return 1;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;module t2;&lt;br /&gt;int Baz(float){return 2;}&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;import t1;&lt;br /&gt;import t2;&lt;br /&gt;import std.stdio;&lt;br /&gt;&lt;br /&gt;void main() { writef("%d, %d\n", Baz(cast(int)0), Baz(cast(float)0)); }&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;m.d(5): Error: t1.Baz(int) at t1.d(2) conflicts with t2.Baz(float) at t2.d(2)&lt;br /&gt;m.d(5): Error: undefined identifier Baz&lt;br /&gt;&lt;/pre&gt;&lt;p/&gt;Several other ideas also fall afoul of this issue forcing me to conclude that their is no way to, at compile time, cooperatively resolve overloads. That is, at some single point in the code, the user needs to fully state every source of overloading. I really don't want this.&lt;br /&gt;&lt;h3&gt;The Run Time Option&lt;/h3&gt;&lt;br /&gt;&lt;p/&gt;The next thought is to use run time lookup (an AA based on &lt;tt&gt;T.stringof&lt;/tt&gt; or &lt;tt&gt;T.mangleof&lt;/tt&gt;) to locate the processing functions. I already use this to extract derived types. In that case I at least know that everything in question is an &lt;tt&gt;Object&lt;/tt&gt; but for this case I don't. Another issue I don't like here is that I ether need to do unsafe casts on function pointers, data pointers or return types. I &lt;i&gt; think&lt;/i&gt; I can make sure this is valid if all access is thought template accessors but I'd rather not have to. And finally, this option is to hard to test because you can't be sure it's right until you exercise every type, including those in third party libs that might change on you.&lt;br /&gt;&lt;h3&gt;The Boot Time Option&lt;/h3&gt;&lt;br /&gt;&lt;p/&gt;The option I think I'll go with sort of fakes the run time option but with better compile time support. The way I'm planning on working this is to have a &lt;tt&gt;ThirdPartyAccess(T)&lt;/tt&gt; template that defines global function pointer variables for Serializing and Deserilizing. These function pointers are accessed freely at run time to do the work. As for the derived type setup, these will be populated at program startup by static constructor generated when the used defines what function to use for a given type:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;module TheirTypes;&lt;br /&gt;&lt;br /&gt;import SomeTypeLib;&lt;br /&gt;&lt;br /&gt;void SerSomeType(SomeType, Sink!(char)) { ... }&lt;br /&gt;SomeType DeserSomeType(Source!(char)) { ... }&lt;br /&gt;&lt;br /&gt;mixin WorkWith!(SomeType, SerSomeType, DeserSomeType);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p/&gt;I still don't like this because I can't figure out a clean way to be sure each and every function pointer is populated exactly once. The best I have come up with is to have a &lt;tt&gt;-debug&lt;/tt&gt; switch that turns on check code in a static destructor to verify all the pointers are non-null. This has the odd side effect or making it a good idea to put in a quick start-n-stop feature to exercise this code. At least, a with static constructor ordering, this will fail reliably when things are wrong.&lt;br /&gt;&lt;h3&gt;The Link Time Option&lt;/h3&gt;&lt;br /&gt;&lt;p/&gt;Now, I think I can make the boot time option work but I don't like it that much better than the run time option so I'll sketch out a feature I'd like to have for this use case. For lack of a better name I'll call it extern templates. The idea is stolen from C's extern global variable. In effect, let the user use whatever variable they want, define them wherever they want and let the linker sort it all out:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;module a;&lt;br /&gt;template Foo(T) { extern int V; }&lt;br /&gt;&lt;br /&gt;int SomeFn()&lt;br /&gt;{&lt;br /&gt;   writef("%d, %d\n", Foo!(int).V, Foo!(float).V); // prints "5, 6"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;module m1;&lt;br /&gt;import a;&lt;br /&gt;&lt;br /&gt;Foo!(int).V = 5;&lt;br /&gt;&lt;/pre&gt;&lt;hr/&gt;&lt;pre&gt;&lt;br /&gt;module m2;&lt;br /&gt;import a;&lt;br /&gt;&lt;br /&gt;Foo!(float).V = 6;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p/&gt;In the example code, the template allows references to a variable and the code in &lt;tt&gt;m1&lt;/tt&gt; and  &lt;tt&gt;m2&lt;/tt&gt; actually provides the definition. When compiled, &lt;tt&gt;m1.obj&lt;/tt&gt; and &lt;tt&gt;m2.obj&lt;/tt&gt; would contain the symbols and &lt;tt&gt;a.obj&lt;/tt&gt; would only contain external references to them. I'm sure there are some interesting corner cases that make this not so nice (and the definition syntax is down right ugly) but it sure would help in some cases.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4142495330062422087?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4142495330062422087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-5-of-n.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4142495330062422087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4142495330062422087'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-5-of-n.html' title='Serialization for D part 5 of N'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-37534596187050780</id><published>2009-05-28T16:12:00.000-07:00</published><updated>2009-05-28T16:15:41.380-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='links'/><title type='text'>Oh, Man I want one of these!!</title><content type='html'>This &lt;a href="http://www.npr.org/templates/story/story.php?storyId=104644575&amp;ft=1&amp;f=1019"&gt;"in house" print on demand system&lt;/a&gt; prints books faster than some places can make you coffee (and they call it the "Espresso machine")&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-37534596187050780?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/37534596187050780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/oh-man-i-want-one-of-these.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/37534596187050780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/37534596187050780'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/oh-man-i-want-one-of-these.html' title='Oh, Man I want one of these!!'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4366647841380555852</id><published>2009-05-27T22:07:00.000-07:00</published><updated>2009-05-27T22:12:39.062-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='D'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization for D'/><title type='text'>Serialization for D part 4 of N</title><content type='html'>There added isn't much this time. The biggest thing is support for repeated objects (think &lt;a href="http://en.wikipedia.org/wiki/Hard_link"&gt;hardlinks&lt;/a&gt;). Aside from that it's mostly cleanup and renaming (breaking changes, sorry) and a few tweaks to the Source/Sink interfaces.&lt;br /&gt;&lt;br /&gt;One of these days, I really need to get around to improving the comments...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dsource.org/projects/scrapple/browser/trunk/Serial"&gt;source link&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4366647841380555852?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4366647841380555852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-4-of-n.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4366647841380555852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4366647841380555852'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-4-of-n.html' title='Serialization for D part 4 of N'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-5290150341701009293</id><published>2009-05-25T20:55:00.000-07:00</published><updated>2009-05-25T21:16:59.309-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='D'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization for D'/><title type='text'>Serialization for D part 3 of N: with Code!</title><content type='html'>I have published reasonably working version posted &lt;a href="http://www.dsource.org/projects/scrapple/browser/trunk/Serial"&gt;here&lt;/a&gt;. It's very much alpha and I haven't documented it much at all.&lt;br /&gt;&lt;br /&gt;What works is user defined types (structs and classes) where every member is to be serialized. The one fun case that works is driveled classes (that wasn't as hard as I though it would be) as long as the base class is also serializable.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;A quick tutorial&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;First, invocation:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt; // something to work with&lt;br /&gt; SS ss = SS(42, 2.717, new DS(1));&lt;br /&gt;&lt;br /&gt; // A data sink&lt;br /&gt; Si c = new Si();&lt;br /&gt;&lt;br /&gt; //------- Run the serializer&lt;br /&gt; marshal(c,ss);&lt;br /&gt;&lt;br /&gt; // show the data&lt;br /&gt; writef("%s\n", c.get));&lt;br /&gt;&lt;br /&gt; // make a Source from that data&lt;br /&gt; So s = new So(c.get)&lt;br /&gt;&lt;br /&gt; //------- deserialize stuff.&lt;br /&gt; SS sd = SS.DemarshalMe();&lt;br /&gt;&lt;br /&gt; // show the results&lt;br /&gt; writef("%s\n"%s\n", sd);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To serialize something, you need a data sink to dump it into and to deserialize something you need a source to pull from. In this example, I use an basic sink that just stores into a buffer and a source that pulls from one.&lt;br /&gt;&lt;br /&gt;Next, The data types.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/// A struct to serialize&lt;br /&gt;struct SS&lt;br /&gt;{&lt;br /&gt; mixin Serializable!();&lt;br /&gt;&lt;br /&gt; int foo;&lt;br /&gt; float bar;&lt;br /&gt; CS cs;&lt;br /&gt;&lt;br /&gt; char[] toString() { return format("&lt;%s,%s,%s&gt;", this.tupleof); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/// a base class to serialize&lt;br /&gt;class CS&lt;br /&gt;{&lt;br /&gt; mixin Serializable!();&lt;br /&gt;&lt;br /&gt; int i = 5; float j = 3.1415926;&lt;br /&gt;&lt;br /&gt; this(){}&lt;br /&gt; this(int) { i++; j++; }&lt;br /&gt;&lt;br /&gt; char[] toString() { return format("&lt;%s,%s&gt;", this.tupleof); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/// a derived class to serialize&lt;br /&gt;class DS : CS&lt;br /&gt;{&lt;br /&gt; mixin Serializable!();&lt;br /&gt;&lt;br /&gt; real f = 2.717;&lt;br /&gt;&lt;br /&gt; this(){}&lt;br /&gt; this(int) { f++; super(0); }&lt;br /&gt;&lt;br /&gt; char[] toString()&lt;br /&gt;  { return format("&lt;%s,%s&gt;", super.toString()[1..$-1], this.tupleof); }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-5290150341701009293?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/5290150341701009293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-3-of-n-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5290150341701009293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5290150341701009293'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-3-of-n-with.html' title='Serialization for D part 3 of N: with Code!'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-3479945101318291827</id><published>2009-05-22T14:42:00.000-07:00</published><updated>2009-05-25T21:17:22.808-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='D'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization for D'/><title type='text'>Serialization for D part 2 of N</title><content type='html'>Well I did a quick hack and got a really basic version going. It only handles XML (with some &lt;i&gt;ugly&lt;/i&gt; formatting restrictions) as the format and is restricted to &lt;tt&gt;struct&lt;/tt&gt;s, classes that are used like &lt;tt&gt;struct&lt;/tt&gt;s, and basic numeric types.&lt;br /&gt;&lt;br /&gt;The up side is that the API/usage is just like I was expecting to do it and I didn't run into any problems. The down side is that I was kinda expecting it to take longer that this (all hyped up and nothing to do).&lt;br /&gt;&lt;br /&gt;The next bit I'm going to work on, is to loosen up the XML formatting, but that should be easy. After that I'm going to dive into making polymorphism work. &lt;br /&gt;On that note, I've thought of a few more issues I will need to deal with: &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Public and Private Base Class Members&lt;/h3&gt; The off the cuff solution is to call &lt;tt&gt;base.Serialize&lt;/tt&gt; either before or after dealing with all the direct members. But that doesn't address how to figure out what the base class members are.&lt;br /&gt;&lt;h3&gt;Template Types.&lt;/h3&gt; The primary problem here will be making sure the correct type is deserialized, a.k.a. error checking. For internal nodes of &lt;tt&gt;struc&lt;/tt&gt;t types this shouldn't be a problems because there it is all static so if it's correct at the top level, it's correct throughout.&lt;br /&gt;&lt;h3&gt;Template Types + Polymorphism&lt;/h3&gt; This adds another wrinkle to that problem. The wrinkle pops up where a template class derived from a non template class. This can result in trying to deserialize a type that wasn't instantiated in the code doing the deserialization.&lt;br /&gt;&lt;h3&gt;Unions&lt;/h3&gt; This one is going to be nasty. I think I'll just ignore it for now. Later some sort of callback might make it work. As I said, not now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-3479945101318291827?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/3479945101318291827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-2-of-n.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/3479945101318291827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/3479945101318291827'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-2-of-n.html' title='Serialization for D part 2 of N'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-2808137837131036741</id><published>2009-05-22T10:58:00.000-07:00</published><updated>2009-05-22T11:11:09.221-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='current events'/><title type='text'>Reading between the lines.</title><content type='html'>I just ran across &lt;a href="http://abcnews.go.com/US/story?id=7654385&amp;page=1"&gt;this news article&lt;/a&gt;. The up shot of it is that a 13 year old kid in Minnesota who is suffering from Hodgkin's lymphoma, attempted to refuse traditional treatment for it (possibly for religious reasons) apparently with the approval of his mother. Somehow it ended up with a court ruling that he could not refuse treatment because his doctors said he will die without it. After that,he and his mother fled for Mexico.&lt;br /&gt;&lt;br /&gt;Now the fleeing the country bit might be illegal depending on the custody situations but who cares. The biggest piece of the story in my opinion is that &lt;i&gt;a court decided that it has the authority to overrule someone on what happens to there own body!&lt;/i&gt; (and this is barely even mentioned until halfway down the page)&lt;br /&gt;&lt;br /&gt;Now I'll grant that there might be more to it, for instance; dad says, do the treatment, mom says do what the kid wants and the court goes with dad. Even if that is true, from the way it's written it seem that the court ruled based on what it thought was best for the kid, not based on who it thought should decide. And from the way it's written, it seems the author this that is just fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-2808137837131036741?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/2808137837131036741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/reading-between-lines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2808137837131036741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2808137837131036741'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/reading-between-lines.html' title='Reading between the lines.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-5123044841423485079</id><published>2009-05-20T16:01:00.000-07:00</published><updated>2009-05-20T16:10:13.301-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fear and reason'/><title type='text'>Finally, some rational thought in mainstream media!</title><content type='html'>&lt;a href="http://www.schneier.com/blog/archives/2009/05/me_on_full-body.html"&gt;This guy&lt;/a&gt;, who seem to known what he's talking about most of the time, &lt;a href="http://edition.cnn.com/2009/TRAVEL/05/18/airport.security.body.scans/?iref=mpstoryview"&gt;got quoted by CNN&lt;/a&gt; about post 9/11 airport security.&lt;br /&gt;&lt;br /&gt;As he puts it, the mentality seems to be "cover your ass". Nobody in a position to do anything is willing to say "no" for fear that something  will happen and they won't be able to say they did everything they could.&lt;br /&gt;&lt;br /&gt;This sort of reminds me (by contrast) of the time I was talking to a Philosophy masters student and after a bit of back and forth I asked him the question "&lt;i&gt;Would you rather have security measures that make you feel safe, that you know are utterly useless or ones that don't make you feel safe and actually make you safer?&lt;/i&gt;" To my utter shock, he asked for the first.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-5123044841423485079?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/5123044841423485079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/finally-some-rational-thought-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5123044841423485079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5123044841423485079'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/finally-some-rational-thought-in.html' title='Finally, some rational thought in mainstream media!'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4862059156813624457</id><published>2009-05-20T10:23:00.000-07:00</published><updated>2009-05-25T21:17:45.421-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='D'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization for D'/><category scheme='http://www.blogger.com/atom/ns#' term='followup'/><title type='text'>Serialization for D part 1.1 of N: comments</title><content type='html'>This is as much notes to my self as anything:&lt;br /&gt;&lt;br /&gt;&lt;UL&gt;&lt;br /&gt;&lt;li&gt;Thanks to &lt;a href="http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-1-of-n.html?showComment=1242799082605#c5810570415641194944"&gt;Chad&lt;/a&gt; for pointing out that I need to consider what license I will be using. (I'm planning of being very permissive there.)&lt;br /&gt;&lt;li&gt;Several other people have pointed me at their own work. I guess I'll have to check what license they use. OTOH, while I really want to make a good usable library, this is just as much a "lets have fun with template" project.&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.announce&amp;article_id=15997"&gt;Tim Matthews&lt;/a&gt; pointed out another source/sink I will want to consider: databases. Being able to use a byte array would cover that one I think.&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4862059156813624457?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4862059156813624457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-11-of-n.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4862059156813624457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4862059156813624457'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-11-of-n.html' title='Serialization for D part 1.1 of N: comments'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-1279711011475205376</id><published>2009-05-19T20:25:00.000-07:00</published><updated>2009-05-25T21:18:11.867-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='D'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization for D'/><title type='text'>Serialization for D part 1 of N</title><content type='html'>I'm planning on starting work on a template based serialization liberty for D. The objective is to be able to, from a single line or two of code per type, generate the needed function to stuff complex types into a file, network socket, byte buffer or whatever. At this point I'm still puzzling out what the interface will be.&lt;br /&gt; &lt;ol&gt;&lt;li&gt;What will using this library with a type look like?&lt;/li&gt; &lt;li&gt;What will invoking the code look like?&lt;/li&gt; &lt;li&gt;What format will be generated?&lt;/li&gt; &lt;li&gt;What will the source or destination for the data look like?&lt;/li&gt; &lt;li&gt;How to work with polymorphic types?&lt;/li&gt; &lt;li&gt;What types of limitations will it impose?&lt;/li&gt;&lt;/ol&gt;Taking each of these in the order I thought of them in&lt;br /&gt;&lt;h1&gt;Usage&lt;/h1&gt;Ideally I want using the library to be a simple as possible, a single line of code would be best. For built in types, this is easy as the system should "just work". User defined types will be the more interesting case. I expect I will want to build several different solutions for different cases. For example, in the case where everything should be just slurped up or spit out, it should be as a simple as no arguments mixin:&lt;br /&gt;&lt;pre&gt; class C&lt;br /&gt; {&lt;br /&gt;  int i;&lt;br /&gt;  someClass c;&lt;br /&gt;  mixin Serializable!();&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;Other cases, for instance where some values need to be omitted or where proper use of constructors needs to be observed, could use other approaches.&lt;br /&gt; &lt;ul&gt;&lt;li&gt;Process only the members on a given list&lt;/li&gt; &lt;li&gt;Process only the members not on a given list.&lt;/li&gt; &lt;li&gt;Deserialize by calling a constructor on the given values&lt;/li&gt; &lt;li&gt;Tag nodes on the way out and resolve references so that multiply referenced objects come through correctly resolved.&lt;/li&gt; &lt;li&gt;Various combinations of the above&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;One other bit that might work is a module level "make everything serializable" template that does default serialization of every type in the module. The problem with this is that to make it work the system as a whole will need to deal with both external and internal definitions of serialization functions. On the other hand, this will be needed anyway for built in types and maybe, 3&lt;sup&gt;rd&lt;/sup&gt; party library.&lt;/p&gt;&lt;p&gt;One minor point is how to structure everything. Because it has a lot of redundancy in the different combinations, some way to reuse code is needed.Something like the recursive self mixin trick might do well. &lt;/p&gt;&lt;h1&gt;Invocation&lt;/h1&gt;&lt;p&gt;The hard part here is the naming (one of the two most difficult tasks in programming). For now I'm just going to go with the simple solution:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt; MyType myType;&lt;br /&gt; myType = MyType.Deserialize(source);&lt;br /&gt; myType.Serialize(sink);&lt;br /&gt;&lt;/pre&gt;If anyone has a better idea what to name them I'm open to suggestions.&lt;br /&gt;&lt;p&gt;The other side is how to structure adding serilization for external in types. Built in types are easy, a simple template function that get called if T.Serialize doesn't exits (or the other way around). The harder cases is 3&lt;sup&gt;rd&lt;/sup&gt; part types as (last I checked) getting template to overload from several sources is hard.&lt;/p&gt;&lt;h1&gt;Format&lt;/h1&gt;&lt;p&gt;For this there is a few interesting option classes:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Machine specific binary&lt;/li&gt; &lt;li&gt;Machine neutral binary&lt;/li&gt; &lt;li&gt;Text: XML/Jason/YAML/CSV&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;For starters, I'm going to do just XML as I can read it so debugging will be easier. After that, I might go for a machine specific binary format and try to abstract out the rendering parts to reduce redundancy.&lt;/p&gt;&lt;h1&gt;Data Source/Sink&lt;/h1&gt;&lt;p&gt;This is one point I'm not sure on. What should be the primitive source and skink? A Phobos or Tango stream would be one option, but it would be nice to be Phobos/Tango agnostic. Also, might other systems be desirable? I think I'll try and keep the implementation dependent code for this loosely coupled and well contained so switching later is easier.&lt;/p&gt;&lt;h1&gt;Derived Types&lt;/h1&gt;&lt;p&gt;One major problem will be how to handle polymorphic instances. The best I can think of is to have them embed a type tag into the output stream and then use some sort of tag to delegate map to deserialize the stream. This has some interesting implications on the operation; for instance with XML, it indicates that the outermost tag of a type should, at least in part, be serialized by the child type but deserialize by the parent type. One options is, given these types&lt;br /&gt;&lt;/p&gt;&lt;pre&gt; class C { }&lt;br /&gt; class D : C { int i; }&lt;br /&gt; class E : C { float x;}&lt;br /&gt;&lt;br /&gt; struct S { C ofTypeC; }&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;an instance of type S is serialized as:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt; &amp;lt;S&amp;gt;&amp;lt;ofTypeC typeis="D"&amp;gt;&amp;lt;i&amp;gt;42&amp;lt;/i&amp;gt;&amp;lt;/ofTypeC&amp;gt;&amp;lt;/S&amp;gt;&lt;/pre&gt;&lt;p&gt;This would have &lt;tt&gt;S.Serialize&lt;/tt&gt; output up to the attribute and then hand off via a virtual Serialize call to the member. On the other hand, &lt;tt&gt;S.Deserialize&lt;/tt&gt;, would consume the full &lt;tt&gt;ofTypeC&lt;/tt&gt; tag and then use the attribute to call the correct Deserialize function. This clearly ends up adding a some annoying overhead so some way to detect (or indicate) that no derived types will be used (and check to make sure that is so) would be nice.&lt;/p&gt;&lt;h1&gt;Limitations&lt;/h1&gt;&lt;p&gt;One thing I'm not going to handle is marching references for aliasing and slicing of arrays. Just because something is a slice of something else on one side, doesn't make it so on the other.&lt;/p&gt;&lt;p&gt;Aside from that, I don't known what limitations I'm going to impose, but I'm sure I'll find out as I go along.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-1279711011475205376?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/1279711011475205376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-1-of-n.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/1279711011475205376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/1279711011475205376'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/serialization-for-d-part-1-of-n.html' title='Serialization for D part 1 of N'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-8702465029197669003</id><published>2009-05-14T10:55:00.000-07:00</published><updated>2009-05-14T17:59:09.193-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='graph theory'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><title type='text'>Automatic Discretization of a 2D Geometric Obstacle Map</title><content type='html'>The following is a report I put together for a Technical writing class about some work I did for an "AI for mechanical engineer" class. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Abstract:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The problem of routing pipes and wires around real world obstructions falls under the category of path finding and as such tends to be a computationally complex problem. It can become even more complex than the classical single path problem if many paths need to be found and the choices for them interact, for instance thought space constraints, electronic interference or crosstalk. One approach to reducing the computational load is to reduce the geometric map to an abstract discreet graph and select and evaluate options categorically. This report considers and evaluates techniques for doing this conversion.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A number of system layout problems can be broken down into two steps; positioning the major components, and routing the connections between the components. In order for the results from the first step to be automatically evaluated, the second has to be automated. This problem is known as the path finding problem and is known to in general, be of exponential complexity. One way to make this problem more tractable is to convert the obstacle map into a much simpler mathematical graph resulting in a much smaller exponential complexity problem. This will allows more options to be considered and more complex problems to handled.&lt;br /&gt;&lt;br /&gt;I have considered two solutions to this problem and, after producing partial solutions to both, determined that one was significantly better and continued that solution to a fully working proof of concept.&lt;br /&gt;&lt;br /&gt;The final results only demonstrate a concrete implementation of the concept showing that it is reasonable to compute and that it generates reasonable results. The implementation doesn’t attempt to be more than reasonably efficient.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Discussion&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Options Considered&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I considered two basic operation principles. The first principle works by finding local maxima for the closest obstacle function. That is to locate positions that can’t be moved away from any nearby obstacles without moving closer to another one. Intuitively this is like inflating a balloon until it fills some region and calling its center a node. These positions were located My implementation used simple hill climbing but partial swarm optimization  or simulated annealing  might provide better performance.&lt;br /&gt;&lt;br /&gt;The second solution worked by locating “pinch points” and treating them as region boundaries. This can be though of as defining rooms by picking what will be counted as a door. The pinch points (doors) were identified by selecting from the lines of closest approach between pairs of obstacles.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;General Results&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The balloon solution was simpler to implement and, based on preliminary results, tended to generate reasonable results. To generate reliable results over the full map it required many starting locations. This caused it to run very slowly, hampering its usefulness. This might be overcome if some type of dynamic density function could be uses to select more starting locations in smaller passages and fewer in open areas.&lt;br /&gt;The pinch point solution was more complicated to implement but also generate reasonable results and ran many times faster. Based on these results, I chose to only finish implementing this solution.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Restrictions&lt;/i&gt;&lt;br /&gt;The final algorithm assumes an input map consisting of non overlapping, convex polygons. The implementation imposes a few more restrictions:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The line of closest approach between any two polygons must not share an endpoint with any other for another pair or polygons.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The map must be bounded by a known set of polygons, in a known order.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;In practice these might be unnecessary restrictive, for instance some concave polygons might work and some cases of shared line endpoints will work, but the exact conditions where this is allowed are harder to define. Also, improvements in the implementation could allow further relaxation of these requirements.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Methods&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_X3yTcSBZlFI/SgxiFaYVaiI/AAAAAAAAAAs/Cjcwc6E1ecU/s1600-h/Output_1.png"&gt;&lt;img style="width: 400px; height: 400px;" src="http://1.bp.blogspot.com/_X3yTcSBZlFI/SgxiFaYVaiI/AAAAAAAAAAs/Cjcwc6E1ecU/s400/Output_1.png" border="0"/&gt;&lt;/a&gt;&lt;br /&gt;Figure 1: The example input map&lt;br /&gt;&lt;br /&gt;I tested the program on an example map was selected to provided a variety of features and scales. These test helped in the development of the program by giving concrete results and by reveling a number of flaws (that were fixed) and limitations (that need to be avoided) during the development process.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_X3yTcSBZlFI/SgxioPzDPtI/AAAAAAAAAA0/3rZY3cOZ9Do/s1600-h/Output_2.png"&gt;&lt;img style="400px; height: 400px;" src="http://lh4.ggpht.com/_X3yTcSBZlFI/SgxioPzDPtI/AAAAAAAAAA0/3rZY3cOZ9Do/s400/Output_2.png" border="0"/&gt;&lt;/a&gt;&lt;br /&gt;Figure 2: Minimal separation lines&lt;br /&gt;&lt;br /&gt;The algorithm operates in several stages. The first stage is feed the initial map and finds the shortest line between each pair of obstacles. Only lines that don’t cross inside of another obstacle are kept.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_X3yTcSBZlFI/SgxioZeD9VI/AAAAAAAAAA8/Aj3eVrkGU8Y/s1600-h/Output_3.png"&gt;&lt;img style="width: 400px; height: 400px;" src="http://3.bp.blogspot.com/_X3yTcSBZlFI/SgxioZeD9VI/AAAAAAAAAA8/Aj3eVrkGU8Y/s400/Output_3.png" border="0"/&gt;&lt;/a&gt;&lt;br /&gt;Figure 3: Region boundary selections resulting in a plainer graph.&lt;br /&gt;&lt;br /&gt;This set is then filtered to remove crossing lines with a preference for keeping the shortest lines. This results in a plainer graph with the obstacles as nodes and the lines as edges.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_X3yTcSBZlFI/SgxioSlSK3I/AAAAAAAAABE/DZm8krJrxS4/s1600-h/Output_4.png"&gt;&lt;img style="width: 400px; height: 400px;" src="http://2.bp.blogspot.com/_X3yTcSBZlFI/SgxioSlSK3I/AAAAAAAAABE/DZm8krJrxS4/s400/Output_4.png" border="0"/&gt;&lt;/a&gt;&lt;br /&gt;Figure 4: Map with node selection&lt;br /&gt;&lt;br /&gt;The interior regions are then identified from this. My implementation does this using a wall following technique. Because all the connecting edges don’t connect to a single point this is somewhat complicated and somewhat of a kluge. To ensure that all interior regions are found, the edges are scanned and each one is traversed exactly once in each directions (this can also be thought of as on both sides) skipping over cases where the edge has been traversed from a previous starting point. This requires either that the exterior edges all be marked from the start as traversed or that the wall following method correctly follow the outside as well.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_X3yTcSBZlFI/Sgxioh3qwpI/AAAAAAAAABM/eJxZnFJ8_YU/s1600-h/Output_5.png"&gt;&lt;img style="width:  400px; height: 400px;" src="http://3.bp.blogspot.com/_X3yTcSBZlFI/Sgxioh3qwpI/AAAAAAAAABM/eJxZnFJ8_YU/s400/Output_5.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Figure 5: Final graph with nodes and connections&lt;br /&gt;&lt;br /&gt;Once the interior sections are identified, the connectivity graph can be found by connecting any two nodes that are bounded from the same link.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Complexity Analysis&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;OL&gt;&lt;br /&gt; &lt;li&gt;Finding all links and filtering on overlap with polygons: &lt;i&gt;O(n&lt;sup&gt;3&lt;/sup&gt;)&lt;/i&gt; maybe closer to &lt;i&gt;O(n&lt;sup&gt;2&lt;/sup&gt;)&lt;/i&gt; &lt;br /&gt; The number of links is &lt;i&gt;O(n&lt;sup&gt;2&lt;/sup&gt;)&lt;/i&gt; and each needs to be checked with each polygon giving the upper case. Better data structures could reduce the cost of the intersection test but not to a constant cost.&lt;br /&gt;&lt;br /&gt; &lt;li&gt;Filtering links for overlap: &lt;i&gt;O(n&lt;sup&gt;3&lt;/sup&gt;)&lt;/i&gt; maybe closer to &lt;i&gt;O(n&lt;sup&gt;2&lt;/sup&gt;)&lt;/i&gt;&lt;br /&gt; Each of the &lt;i&gt;O(n&lt;sup&gt;2&lt;/sup&gt;)&lt;/i&gt; links needs to be checked with each previously accepted link. &lt;a href="http://en.wikipedia.org/wiki/Planar_graph#Other_planarity_criteria"&gt;Given that the result is a plain graph, only &lt;i&gt;O(n)&lt;/i&gt; links&lt;/a&gt; can be accepted giving the upper bound. Again, with better data structure this might go even lower, but not to a constant.&lt;br /&gt;&lt;br /&gt; &lt;li&gt;Region selection: &lt;i&gt;O(n)&lt;/i&gt;&lt;br /&gt; Each of the &lt;i&gt;O(n)&lt;/i&gt; links will be traversed twice and each traversal has a cost (for finding the next link) proportional to the &lt;i&gt;O(1)&lt;/i&gt; average number of edges per node.&lt;br /&gt; &lt;li&gt;Connect the regions: &lt;i&gt;O(n)&lt;/i&gt;&lt;br /&gt; This can be done in constant time per link.&lt;br /&gt;&lt;/OL&gt;&lt;br /&gt;&lt;br /&gt;The worst case, the solution is &lt;i&gt;O(n&lt;sup&gt;3&lt;/sup&gt;)&lt;/i&gt;, however this might be able to drop to nearer &lt;i&gt;O(n&lt;sup&gt;2&lt;/sup&gt;)&lt;/i&gt;. Given that this is a precursor to a &lt;i&gt;O(b&lt;sup&gt;d&lt;/sup&gt;)&lt;/i&gt; operation and is cutting back on both &lt;i&gt;b&lt;/i&gt; and &lt;i&gt;d&lt;/i&gt;, even the worst case result is a clear win for any reasonably sized problem.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;My work has show that the basic algorithm of segmenting the map along lines of closets approach is sound. However it also reveals some weaknesses in my implementation. The largest weakness is that the wall following solution is not robust enough to deal with the edges of the map. As this part was not my primary interest I didn’t put much work into it. For a production implementation, it would be worth while to spend some time exploring better options.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-8702465029197669003?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/8702465029197669003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/automatic-discretization-of-2d.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/8702465029197669003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/8702465029197669003'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/automatic-discretization-of-2d.html' title='Automatic Discretization of a 2D Geometric Obstacle Map'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_X3yTcSBZlFI/SgxiFaYVaiI/AAAAAAAAAAs/Cjcwc6E1ecU/s72-c/Output_1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-6726156115727559798</id><published>2009-05-13T01:13:00.000-07:00</published><updated>2009-05-28T10:56:07.003-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DSL*.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SPL*.NET'/><title type='text'>Hm... this sounds familiar</title><content type='html'>&lt;a href="http://msmvps.com/blogs/jon_skeet/archive/2009/05/12/language-proliferation.aspx"&gt;Jon Skeet: Coding Blog -- Language proliferation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Sounds like MS is creating support of a large number of languages on .NET. They are still GPLs but it's looking where I think they should go. &lt;br /&gt;&lt;br /&gt;I think I started with the wrong lable on this one, what I'd like to see is not a pile of domain specific languages (DSLs) but special purpose languages (SPLs).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-6726156115727559798?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/6726156115727559798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/hm-this-sounds-familiar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6726156115727559798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6726156115727559798'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/hm-this-sounds-familiar.html' title='Hm... this sounds familiar'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-749949530001371919</id><published>2009-05-08T11:52:00.000-07:00</published><updated>2009-05-08T12:03:53.927-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='irony'/><category scheme='http://www.blogger.com/atom/ns#' term='faith'/><title type='text'>Turnabout's fair play</title><content type='html'>Quoting from &lt;a href="http://www.scientificamerican.com/article.cfm?id=letters-may-2009"&gt;a letter to Scientific American by Oscar Estévez&lt;/a&gt; about Creationism,  Intelligent Design (ID) and the theory of evolution:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;The questions they [students] should ask are, Does ID make predictions? And can those predictions be tested? If the answers to both are negative, they themselves can conclude that ID is "only a nonscientific theory."&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I'll ask the same in return:&lt;br /&gt;&lt;br /&gt;Does the theory of evolution make predictions? And can those predictions be tested? If the answers to both are negative, you can conclude that the theory of evolution is "only a nonscientific theory."&lt;br /&gt;&lt;br /&gt;I challenge Mr. Estévez to point to point to a predictions made by the theory of evolution that can be tested and where the test will show it to be either true or false. &lt;br /&gt;&lt;br /&gt;Note that there are a number of predictions made by the theory of evolution than can be show to be true but can't be show to be false. For example, failing to demonstrate the creation of new species can always be discounted on the grounds of "We just didn't run the experiment long enough" or "we haven't found the right fossil yet".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-749949530001371919?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/749949530001371919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/turnabouts-fair-play.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/749949530001371919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/749949530001371919'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/turnabouts-fair-play.html' title='Turnabout&apos;s fair play'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-6128685101994406725</id><published>2009-05-06T14:55:00.000-07:00</published><updated>2009-08-03T09:57:49.011-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fear and reason'/><title type='text'>Pilotless airplanes and securety implications.</title><content type='html'>&lt;a href="http://news.cnet.com/8301-17938_105-9693764-1.html"&gt;This article&lt;/a&gt; brings up some thoughts from Israel about making airlines without a cockpit. The tone is a bit condescending (I don't think the author likes the idea, and I'd be hesitant to fly on one my self) but down at the bottom is a comment that is down right caustic, starting with:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;I hope those science engineers had figured out the motives of Al Queda for taking control of one of these unmanned planes.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;and continuing with concerns about someone getting remote access to the airplane and using it for mischief. Now that is one thing I'm &lt;i&gt;not&lt;/i&gt; to concerned about. For one, the flight program on an unmanned airliner would be one of the most carefully designed programs ever written. If you can count on anything, ti would be that it can't be overridden remotely. As for other attacks, in this day and age, if you can access the avionics software of a plain, I'll bet you can lockout all the cockpit controls and fly it into whatever you want so I don't think there is any &lt;i&gt;more&lt;/i&gt; risk cropping up here than we have right now. Frankly, I suspect physical takeover of a maned plane is more likely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-6128685101994406725?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/6128685101994406725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/pilotless-airplains-and-securety.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6128685101994406725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6128685101994406725'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/05/pilotless-airplains-and-securety.html' title='Pilotless airplanes and securety implications.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-6534622528811440109</id><published>2009-04-29T08:00:00.000-07:00</published><updated>2009-05-28T10:58:55.086-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>"Unit in the last place" floating point test</title><content type='html'>For about the third time, I have needed to look up how to code the Unit in the last place floating point test so I'm going to post &lt;a href="http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm"&gt;this link&lt;/a&gt; so I can find it.&lt;br /&gt;&lt;br /&gt;And to protect from that going dead the final code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// Usable AlmostEqual function&lt;br /&gt;bool AlmostEqual2sComplement(float A, float B, int maxUlps)&lt;br /&gt;{&lt;br /&gt;    // Make sure maxUlps is non-negative and small enough that the&lt;br /&gt;    // default NAN won't compare as equal to anything.&lt;br /&gt;    assert(maxUlps &gt; 0 &amp;&amp; maxUlps &lt; 4 * 1024 * 1024);&lt;br /&gt;    int aInt = *(int*)&amp;A;&lt;br /&gt;    // Make aInt lexicographically ordered as a twos-complement int&lt;br /&gt;    if (aInt &lt; 0)&lt;br /&gt;        aInt = 0x80000000 - aInt;&lt;br /&gt;    // Make bInt lexicographically ordered as a twos-complement int&lt;br /&gt;    int bInt = *(int*)&amp;B;&lt;br /&gt;    if (bInt &lt; 0)&lt;br /&gt;        bInt = 0x80000000 - bInt;&lt;br /&gt;    int intDiff = abs(aInt - bInt);&lt;br /&gt;    if (intDiff &lt;= maxUlps)&lt;br /&gt;        return true;&lt;br /&gt;    return false;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-6534622528811440109?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/6534622528811440109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/unit-in-last-place-floating-point-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6534622528811440109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6534622528811440109'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/unit-in-last-place-floating-point-test.html' title='&quot;Unit in the last place&quot; floating point test'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-5491840964128780019</id><published>2009-04-28T10:00:00.000-07:00</published><updated>2009-06-02T23:53:13.825-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fiction'/><title type='text'>Some musings on David Weber's world.</title><content type='html'>A while back I finished off all the available Honor Harrington books. The last one has a foreword that mentions that there are already two more books fully written and in the pipe. So having a mind that just will not shut down, I started pondering what will happen. It doesn’t help that their author, David Weber, finally dropped a cliff hanger on his fans. Any way I realized that I’m in an interesting position; I have a theory as to where the next books are going and they are already fixed so I can’t influence them. So what I’m going to do is throw my speculation out here on my blog and in a few months when the books come out see how it matches. If it does, well cool. If not, it’s kind of fun anyway.&lt;br /&gt;&lt;br /&gt;For starters, I have no special knowledge of Mr. Weber’s plans. All I know is what I have read in his books and a little on-line research. (So Mr. Weber, if I get this all spot on, don’t sue me or you will validate it). All of this is based on speculation and the two rules of good story telling:&lt;ol&gt;&lt;br /&gt; &lt;li&gt;The story must be reasonable and believable.&lt;br /&gt; &lt;/li&gt;&lt;li&gt;The story must be entertaining (or addictive)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;It wouldn’t be believable for Manticore to come out to easily (and with no peril it wouldn't be fun either) and watching you team get utterly crushed would drive the fans away (and coming back from that wouldn’t be believable either) so it will be somewhere in between. Also that leads to some very fun sub plots that can come in.&lt;br /&gt;&lt;br /&gt;Last we saw, the Sollies were about to hit Lynx like a ton of bricks on a hard floor and Mesa was about to drop a pile of pods in on Manticore. On a side note, I’m a bit surprised Weber didn’t bring out that option earlier. He could have had 8&lt;sup&gt;th&lt;/sup&gt; fleet drift in a few pods or mistletoes while the destroyer/scout/decoys were playing their shell games in various Haven system. It sure would have resulted in some funky head games not to mention cost the Peeps dearly in Moriarties and trained crews. Anyway the question is what happens next. Here’s my theories:&lt;br /&gt;&lt;br /&gt;The first interesting thing (and more or less a given) is when the Sollies attack the Lynx terminus. As with the ton-o-brick vs. floor, the floor wins. To counter it Honor and 8th fleet is sent through to Talbott putting a substation portion of the Apollo equipped ships and their auxiliaries in Lynx. While they are out of position (leaving, gone or on the way back; I'm not sure where Weber will put them), the Oyster Bay ballistic pods attack, and severely damage most of the Manticore yards and many of home fleet ships that didn't go to Lynx. I can't spot how it could be worked in but I it would be handy if the yard tech crews get out somehow (massed builders trials might do it but that seems a bit clumsy).&lt;br /&gt;&lt;br /&gt;As a result of the fleets being out of position at home, Oyster Bay is blunted to some extent but still hurts Manticore a lot. Somewhere in all this, the Mesa spider drive ships attack. The partial failure of the ballistics component cause a less than complete success by the manned elements. As to what happens to the Mesa units, I’m inclined to go with them taking a royal beating including most of the units getting capture or more likely, destroyed. I’m, not sure which book that will happen in because it doesn't fit in the mold that seems to be set up for &lt;i&gt;Torch of Freedom&lt;/i&gt; but &lt;i&gt;Missions of Honor&lt;/i&gt; comes out second and it would play better if the reader doesn’t get a preview.&lt;br /&gt;&lt;br /&gt;One Bit that would have to be in &lt;i&gt;Torch of Freedom&lt;/i&gt; is whatever Zilwicki and Cachat have been up to. (I’m really glad Mr. Weber let Mr. Flint play with his toys, those two characters are some of the most enjoyable I have come across (in any storyline) and, based on the &lt;i&gt;Storm from the Shadows&lt;/i&gt; foreword, they may have, in real life, saved Honor’s life) It doesn't take much guess work to figure out that they are going to be infiltrating Meas. What I suspect the upshot of that will be, is they learn of Oyster Bay, Mesa's other plans and both the spider and streak drives. They won't get the full story as it seems Mesa's plans are going to be parceled out over a few books at the least. On the other hand, the tech stuff is going to come out soon enough anyway so they will capture documentation, hardware or complete examples of a spider drive. At a minimum, they will get enough to, probably with a little magic on Hemphill's part (or Foraker's, keep reading ;-), figure out how to detect the spider drive. The first real question mark is the streak drive. Henke and the rest of the Talbott crowd is starting to twig to the fact that the "Mesan's mail is running a bit faster than every one else's" so I suspect that will come out also. It would fit their swashbuckling ways for Zilwicki and Cachat to capture a functional Mesa streak drive courier ship and make a run in it for Manticore via Lynx. The next question mark is the timing. They can't arrive to soon or the ship yards could be saved, but to late and it looses some dramatic/tragic weight. I'm going to guess they will show up in time to do some good regarding the manned units or just after the dust settles. (The other option is in time to save the yard dogs but not the yards them selves. For that to work the pods need to be really hard to spot or a pattern of nukes could soft kill them even with lousy target locks).&lt;br /&gt;&lt;br /&gt;Now this is getting really speculative, but if &lt;i&gt;Torch of Freedom&lt;/i&gt; ends with Zilwicki and Cachat on the way from Mesa to Manticore that would solve the problem of springing Oyster Bay without a preview.&lt;br /&gt;&lt;br /&gt;Anyway As for the aftermath in Manticore; Elizabeth, with information from Zilwicki &amp;amp; Cachat, a Manty/Solly war looming and devastated ship yards, will do the "I still hate the Peeps but I need to ignore that" bit and make an abrupt command decision to send Honor directly (and uninvited) to Haven to offer not only peace but an alliance. Honor arrives with a very small task force (on the order of a single Apollo wall’er and a few screen ships to make sure they get Havens attention) as a pointed reminder that Manticore can still hurt them but isn't. Honor does here usual thing of steamrolling her way into what she wants by, with impeccable manors, assuming that she will get it. In this case, what she gets is immediate talks (as in least time to Haven orbit and "meet me at the shuttle pad" immediate) face to face with Pritchart. After hearing what Honor (and maybe Cachat) has to say Pritchart jumps in on the spot.&lt;br /&gt;&lt;br /&gt;In a nice political whiplash, Haven sends units to help protect Manticore (some joyfully hated people all but die of indignation at this). In the other direction (and to the great displeasure of a few Havenites) Manticore sends tech crews displaced from the Manticore yards to Bolthole along with the Zilwicki and Cachat's finds. This would lay the ground work for a few threads like getting Hemphill and Foraker working together and the fun, technological and sociological, they could create. (I just realized, I don't think we have ever actually met Hemphill.)&lt;br /&gt;&lt;br /&gt;That's about as far as I’m willing to lay out details but I'm actually more comfortable with the big picture further down the line than the details in close. The Mantcore/Haven alliance has two problems. First the Sollies want to pound Manticore and will be running scared when they notice that the only advantage they have left is quantity. The other is whatever Mesa is up to. As the old truisms goes; one problem, is one problem, but two problems, can be two solutions. In line with that, they begin attempting to use Mesa’s operations to turn groups of Sollies away from war. Some sectors immediately jump on board or get out of the way and others get caught in a meat grinder when Mesa plays hard ball. Other sectors governments are clearly to invested and will have to be removed by force. Some of them will fall to Mesa, others to Manticore and Haven. Either way the Sollies fracture along the lines of what Honor outlined in &lt;i&gt;Storm From the Shadows&lt;/i&gt;. As for Mesa, the less than total success of Oyster Bay and the Zilwicki/Cachat debacle puts them in a bit of a bind but they invoke the "no plain survives contact with the enemy" line and continue on with a nice show of operational agility, pragmatism and determination.&lt;br /&gt;&lt;br /&gt;Now that I look at all of that, I'm think I've covered both the books in the pipe and started in on the next one on the main line. So who knows, some of this might effect the story after all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-5491840964128780019?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/5491840964128780019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/some-musings-on-david-webers-world.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5491840964128780019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5491840964128780019'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/some-musings-on-david-webers-world.html' title='Some musings on David Weber&apos;s world.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-6475833102481646176</id><published>2009-04-27T15:45:00.000-07:00</published><updated>2009-04-27T15:57:38.558-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='current events'/><title type='text'>This seems a bit "off" to me.</title><content type='html'>I'm haven't dug into this at all but something is not right here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.wired.com/threatlevel/2009/04/data-centers-ra"&gt;FBI Defends Disruptive Raids on Texas Data Centers&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The up shot of it is that the FBI raided a few data co-location centers based on a fraud claim by AT&amp;T and Verizon (basically unpaid bills for accounts that my have been set up with falsified information) and walked out with &lt;i&gt;hundreds&lt;/i&gt; of servers who's only crime might well be that they were in the same co-location building a servers used for a crime... maybe.&lt;br /&gt;&lt;br /&gt;If this was a Hollywood drama/comedy I can just imagine the ending:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;i&gt;FBI spokesman, a year or so down the line:&lt;/i&gt; We'er sorry about putting those businesses into bankruptcy by taking there servers because we couldn't tell tell they weren't owned by the bad guys we were after and didn't bother listening to the site manger when he told us exactly that.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I don't think it will be that bad but I'm sure someone should feel ashamed of how they ran this little operation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-6475833102481646176?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/6475833102481646176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/this-seems-bit-off-to-me.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6475833102481646176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/6475833102481646176'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/this-seems-bit-off-to-me.html' title='This seems a bit &quot;off&quot; to me.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-5215924431096017297</id><published>2009-04-23T11:17:00.001-07:00</published><updated>2009-05-28T10:57:03.930-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DSL*.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SPL*.NET'/><title type='text'>Another DSL*.NET language idea</title><content type='html'>I just came across &lt;a href="http://haacked.com/archive/2009/04/22/scripted-db-views.aspx"&gt;this post&lt;/a&gt; and it made me think of yet another language I would want in a &lt;a href="http://arrayboundserror.blogspot.com/2009/03/why-is-net-built-using-gpls.html"&gt;DSL*.NET system&lt;/a&gt;: A secure language. That would be a language (probably a scripting type language and a set of them to boot) that are intentionally crippled so that my program can safely run them without having to set up sandboxes.&lt;br /&gt;&lt;br /&gt;To follow Mr. Haack's example, a language that is flexible enough to construct a DOM but can't do much else would be rather doable by something like dropping parts of the &lt;tt&gt;using&lt;/tt&gt; semantics so that the code can only interact with objects passed into it and with statics that it defines.&lt;br /&gt;&lt;br /&gt;It's not a finished and polished idea but you can see where I'm going with it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-5215924431096017297?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/5215924431096017297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/another-dslnet-language-idea.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5215924431096017297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5215924431096017297'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/another-dslnet-language-idea.html' title='Another DSL*.NET language idea'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-8247570206757077578</id><published>2009-04-18T17:39:00.000-07:00</published><updated>2009-04-18T17:40:45.915-07:00</updated><title type='text'>The problem with being overly literal minded.</title><content type='html'>A number of time I can recall saying (or typing) something and then noting that while what I actually said is exactly what I meant, most people will read between the lines and get something else out of it that is not what I meant. The first example of this I can think of is years ago, asking my dad "Do you know where the whatever is?" Now when he (or most anyone, including my self once in a while) asked that sort of question he would expect people to if they could, help him look for whatever it was he was looking for. The problem was I was asking "Do you know where it is" and exactly nothing more, in fact in that cases asking more would have been rude.&lt;br /&gt;&lt;br /&gt;I have run into the same sort of thing a few other places where I ask one question that usually is an implicit request for something else but in a situation where that something else would be rude to ask for. A more recent example would be asking a question on &lt;A HREF="http://stackoverflow.com"&gt;a forum&lt;/A&gt; where I could Goggle for the answer in about five minuets. Asking someone to go do my research for me would clearly be rude but what about a question that someone who knows the topic could answer in 15 seconds? I sort of end up stuck in this corner; do I burn five minutes on Goggle trying to find what terms to ask for? Or do I risk sounding rude and selfish on the (fairly good) chance that someone who knows the answer will help me out?&lt;br /&gt;&lt;br /&gt;What I often end up doing is spending about half my words explaining what I'm not asking for and it always comes out awkward. I think the whole problem for me comes because (I think) I tend to form loose concept associations. There's the idea of what I want to ask, and the words I use to ask it and because I get the first fully formed before I start in on the second, the implications of the phrase I end up wanting to use don't enter in the decision of whether to ask the question at all.&lt;br /&gt;&lt;br /&gt;I'm not trying to change the world (I can't) and I'm not expecting the world to treat me different (it won't) and I'm not even asserting I'm smarter than other people (that's a sort of useless topic to begin with in my book). It's just an interesting thought I had at a way I keep getting tripped up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-8247570206757077578?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/8247570206757077578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/problem-with-being-overly-literal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/8247570206757077578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/8247570206757077578'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/problem-with-being-overly-literal.html' title='The problem with being overly literal minded.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-5821437586013320036</id><published>2009-04-02T12:41:00.000-07:00</published><updated>2009-05-28T10:58:36.764-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><title type='text'>The advantages of O(b^d)</title><content type='html'>The punch line is that the advantages of exponential time complexity is that even small improvements in performance are not so small.&lt;br /&gt;&lt;br /&gt;For instance; When I finely got the &lt;a href="http://www.cs.cornell.edu/Courses/cs312/2002sp/lectures/rec21.htm"&gt;alpha-beta pruning correct&lt;/a&gt; (I think) on my Connect 4 AI and it's effective complexity went from &lt;tt&gt;O(7&lt;sup&gt;0.7 d&lt;/sup&gt;)&lt;/tt&gt; to &lt;tt&gt;O(7&lt;sup&gt;0.6 d&lt;/sup&gt;)&lt;/tt&gt;. For &lt;tt&gt;d = 13&lt;/tt&gt; that's 49 million leafs to 3 million leafs.&lt;br /&gt;&lt;br /&gt;This is the same principle that make &lt;a href="http://arrayboundserror.blogspot.com/2009/05/automatic-discretization-of-2d.html"&gt;this idea&lt;/a&gt; reasonable&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-5821437586013320036?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/5821437586013320036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/advantages-of-obd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5821437586013320036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5821437586013320036'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/04/advantages-of-obd.html' title='The advantages of O(b^d)'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-3691214137108606990</id><published>2009-03-29T13:08:00.000-07:00</published><updated>2009-03-29T13:15:48.144-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='faith'/><title type='text'>How true it is.</title><content type='html'>&lt;blockquote&gt;If you belonged to the world, the world would love you as one of its own. But because you do not belong to the world and I have chosen you out of it, the world hates you.&lt;/blockquote&gt; &lt;a href="http://bible.cc/john/15-19.htm"&gt;John 15:19&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://astoneofebenezer.blogspot.com/2009/03/most-high-ruleth.html"&gt;A friend of mine ran smack into this down in the Dominican Republic.&lt;/a&gt; What I find "interesting" about this is that I rarely hear about this sort of thing with other faiths, just with Christianity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-3691214137108606990?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/3691214137108606990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/how-true-it-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/3691214137108606990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/3691214137108606990'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/how-true-it-is.html' title='How true it is.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-5046805574806800509</id><published>2009-03-27T20:57:00.001-07:00</published><updated>2009-03-27T21:06:10.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='irony'/><title type='text'>Irony:  the Alanis Morissette kind</title><content type='html'>Actually, I find it more funny than &lt;a href="http://blog.stackoverflow.com/2008/11/podcast-31/"&gt;ironic&lt;/a&gt;, but whatever it is, it is a little annoying.&lt;br /&gt;&lt;br /&gt;I was searching for literature on Mandatory Work First ordering and guess what, I'm the top hit for &lt;tt&gt;"Mandatory Work First" min max&lt;/tt&gt;. Lot of help that does me.&lt;br /&gt;&lt;br /&gt;It's sort of like being your own sys admin when things go wrong:&lt;br /&gt;&lt;br /&gt;Computer: "The system has crashed. Please contact the system administrator"&lt;br /&gt;Me: "Ok self, fix it"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-5046805574806800509?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/5046805574806800509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/irony-alanis-morissette-kind.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5046805574806800509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/5046805574806800509'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/irony-alanis-morissette-kind.html' title='Irony:  the Alanis Morissette kind'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4159177377715011446</id><published>2009-03-27T14:16:00.000-07:00</published><updated>2009-05-28T16:45:26.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='min max'/><category scheme='http://www.blogger.com/atom/ns#' term='codeing'/><title type='text'>fun with AI's</title><content type='html'>My &lt;a href="http://arrayboundserror.blogspot.com/2009/03/fun-from-code-lines.html"&gt;connect 4&lt;/a&gt; AI has improved &lt;a href="http://arrayboundserror.blogspot.com/2009/03/my-ai-is-working-mostly.html"&gt;yet again&lt;/a&gt;. This time around I just tweaked it so that I compute the full score for each state in the BFS potion of the tree and sort each group. With this improvement, I'm running to a depth of 12 in less than 30 seconds. I've still got a bit of tuning to do (some ad-hoc testing shows that running the BFS to a depth of 3 is several times faster than a depth of 4 on the single core machine I was using)&lt;br /&gt;&lt;br /&gt;After that's done, the next bit is to figure out how to do a sliding depth scale to leverage all the remaining time. I expect that the progress vs time plot is going to be rather interesting.&lt;br /&gt;&lt;br /&gt;On another front, I am back in the lead; I figured out how to beat the AI while playing second!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4159177377715011446?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4159177377715011446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/fun-with-ais.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4159177377715011446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4159177377715011446'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/fun-with-ais.html' title='fun with AI&apos;s'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-4574602108281402097</id><published>2009-03-23T10:43:00.000-07:00</published><updated>2009-05-28T16:45:51.759-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='min max'/><category scheme='http://www.blogger.com/atom/ns#' term='codeing'/><title type='text'>My AI is working (mostly)</title><content type='html'>As I posted a &lt;a href="http://arrayboundserror.blogspot.com/2009/03/fun-from-code-lines.html"&gt;few days ago&lt;/a&gt;, I'm working on a connect-4 AI as a class project. It turns out that counting the children works and the whole thing performs well (at least as fast as the single threaded version)&lt;br /&gt;&lt;br /&gt;The solution ends up working by keeping a count of how many unpropagated children each node has. When this goes to zero, the nodes value is propagated up the tree another level. The only tricky part is building the tree in the first place. The issue here is that you can't propagate stuff while the tree is being built so it has to happen as an intermediate step before the leaf processing.&lt;br /&gt;&lt;br /&gt;Once all that gobly-goop is done the main evaluation runs just fine. However I still haven't figured out how to do any better than evaluating the leafs in the order they fall in (fact is I haven't even coded anything yet, only puzzled over it). That works very well because, most of the time, both threads are working on nodes that share a parent so alpha-beta pruning works correctly. At 2 threads, I suspect that I'm running at almost 100% efficiency but if I stared using more threads (say more than the branching factor) I would expect that to drop a lot.&lt;br /&gt;&lt;br /&gt;The next thing I'm planning on trying will be to run my heuristic function on all the nodes and sort each group of children as they are generated. I hope that this will better optimize the alpha beta pruning and might even give an order where I can get something closer to ideal while adjusting the depth based on time renaming.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://stackoverflow.com/questions/661254/in-place-min-max-tree-invalidation-problems"&gt;asking around for others solutions&lt;/a&gt; I was pointed at &lt;a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.177"&gt;this paper&lt;/a&gt; that mentions something called "mandatory work first" that might mesh well with my stuff if I can figure out how to sort based on it.&lt;br /&gt;&lt;br /&gt;Anyway, the code functions and beats me easily. On the other hand I have a few more tweaks I want to try. Fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-4574602108281402097?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/4574602108281402097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/my-ai-is-working-mostly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4574602108281402097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/4574602108281402097'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/my-ai-is-working-mostly.html' title='My AI is working (mostly)'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-7941973354344947079</id><published>2009-03-20T13:44:00.000-07:00</published><updated>2009-05-28T16:45:51.759-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='min max'/><category scheme='http://www.blogger.com/atom/ns#' term='codeing'/><title type='text'>Fun from the code lines.</title><content type='html'>&lt;p&gt;My current school project is an AI for playing Connect-4 using &lt;a href="http://en.wikipedia.org/wiki/Minimax"&gt;minimax&lt;/a&gt;. The first bit was fun, lost of low level bit twiddling, building bit adders, monster functions that do recursion without recursion, &lt;a href="http://arrayboundserror.blogspot.com/2009/03/i-just-got-free-25-speedup-in-my-code.html"&gt;finding bazaar optimizations&lt;/a&gt;... all the kinds of stuff crazy people like me enjoy.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After I got it to the point it could beat me, the real fun started!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So far I have, at least twice, found places where I had the AI’s playing the wrong side ("Here, let me help you win!") and then spent the better part of two days trying to figure out where the typo in a fundamentally broken algorithm was.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The thing was that I was looking to speed it up by going multi threaded. The way I was  planning on doing this was&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt; &lt;li&gt; Run the first few levels of the min-max tree in a breadth first evaluation&lt;/li&gt;&lt;br /&gt; &lt;li&gt; Sort the leafs based on how good they look&lt;/li&gt;&lt;br /&gt; &lt;li&gt; Have several threads do the normal depth first bit on each leaf&lt;/li&gt;&lt;br /&gt; &lt;li&gt; Stuff the data back up the tree.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The theory here was that I could start running deep and watch the clock to known when and how much I need to back off the depth to use up all my time. However I managed to step on several severe problems with it.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;First that form can’t do &lt;a href="http://en.wikipedia.org/wiki/Alpha-beta_pruning"&gt;alpha beta&lt;/a&gt; pruning at all, so I drop a lot of performance right there. After being annoyed at that for a minute or two, I dug in to update the min-max tree on the fly after each leaf is evaluated. That shouldn’t be to hard, each time I get a value check to see if it is less/grater-than its parent and if so update and repeat.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The better part of two days later I was frustrated as all get-up and &lt;b&gt;then&lt;/b&gt; noticed that &lt;a href="http://stackoverflow.com/questions/661254/in-place-min-max-tree-invalidation-problems"&gt;this doesn’t work&lt;/a&gt; (I told you it was a fundamentally broken algorithm) Cases like this provide a counterexample:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;img style="margin: 0pt 10px 10px 0pt;" src="http://1.bp.blogspot.com/_X3yTcSBZlFI/ScQAszl7zuI/AAAAAAAAAAM/XbMp5Tzz6XU/s320/minmax.PNG" alt="" id="BLOGGER_PHOTO_ID_5315374229967589090" border="0" /&gt;&lt;br /&gt;&lt;p&gt;First the 10 goes in, and the left min node and the max node go to 10. Then the 5 goes in and the left min node goes to 5 but the max node stays at 10. Oops...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Anyway, I think by counting children and a bit of fancy footwork I can solve that problem, but the result of that is the alpha beta pruning is going to be really funky. I’ll have to play around how things get sorted and whatnot to see what works.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Right now I’ve got the leaf evaluation and mix-max push working correctly but things go wacky when a win or loss shows up above the leafs. Fun, fun, fun. What I really need is another set of eyes to go over my code. Unfortunately given that it’s homework...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-7941973354344947079?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/7941973354344947079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/fun-from-code-lines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/7941973354344947079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/7941973354344947079'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/fun-from-code-lines.html' title='Fun from the code lines.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_X3yTcSBZlFI/ScQAszl7zuI/AAAAAAAAAAM/XbMp5Tzz6XU/s72-c/minmax.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-1557811434837823684</id><published>2009-03-16T21:07:00.000-07:00</published><updated>2009-05-28T10:57:03.931-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='language theory'/><category scheme='http://www.blogger.com/atom/ns#' term='DSL*.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SPL*.NET'/><title type='text'>Why is .NET built as GPLs?</title><content type='html'>The &lt;a href="http://en.wikipedia.org/wiki/Common_Language_Infrastructure"&gt;CLI&lt;/a&gt; (basically .NET) has shown that Microsoft has what it takes to integrate several different language so tightly that it just works. You could almost roll dice to pick your language for each function and never notice problems. Given that they can make inter opt that easy, why is Microsoft primarily building &lt;a href="http://simple.wikipedia.org/wiki/General-purpose_programming_language"&gt;GPL's *&lt;/a&gt; on top of it? Why don't they leverage that interoperability and start building a pile of very small, very special purpose languages? These language could be tuned for very specific cases and, by avoiding corner-cases and compromises, could be made very clean. The theory would be that points in code that transition from one domain to another are good candidates for functions anyway.&lt;br /&gt;&lt;br /&gt;I'm thinking of languages like:&lt;br /&gt;&lt;br /&gt;&lt;DL&gt;&lt;br /&gt; &lt;DT&gt; A control structures language&lt;br /&gt;  &lt;DD&gt; This would provide all the &lt;tt&gt;if&lt;/tt&gt;s, &lt;tt&gt;foreach&lt;/tt&gt;s, &lt;tt&gt;switch&lt;/tt&gt;s and whatnot.&lt;br /&gt; &lt;DT&gt; A math processing language&lt;br /&gt;  &lt;DD&gt; this would define precise math semantics and advanced math expressions&lt;br /&gt; &lt;DT&gt; An systems-of-equations language&lt;br /&gt;  &lt;DD&gt; Think &lt;A HREF="http://www.maplesoft.com/"&gt;Maple&lt;/A&gt; or &lt;A HREF="http://www.mhhe.com/engcs/mech/ees/"&gt;EES&lt;/A&gt;. This would provide no control structures, or define order of evaluation (not to be confused with &lt;a href="http://www.eskimo.com/~scs/readings/precvsooe.20010512.html"&gt;order of operations&lt;/a&gt;) but would rather compute solutions for a system of equations (math for sure, maybe logical and bit-wise) given a number of inputs&lt;br /&gt; &lt;DT&gt; An SQL like language&lt;br /&gt;  &lt;DD&gt; aside from small cases, why should LINQ even be part of C#?&lt;br /&gt; &lt;DT&gt; Etc.&lt;br /&gt;  &lt;DD&gt; ...&lt;br /&gt;&lt;br /&gt; &lt;/DL&gt;&lt;br /&gt;&lt;br /&gt;&lt;small&gt;* Sorry there dosn't seem to &lt;i&gt;be&lt;/i&gt; an &lt;tt&gt;&lt;a href="http://en.wikipedia.org/wiki/General-purpose_programming_language"&gt;http://en.wikipedia.org/wiki/General-purpose_programming_language&lt;/a&gt;&lt;/tt&gt; right now, it redirect to the DSL page :b&lt;/small&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-1557811434837823684?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/1557811434837823684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/why-is-net-built-using-gpls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/1557811434837823684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/1557811434837823684'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/why-is-net-built-using-gpls.html' title='Why is .NET built as GPLs?'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-3735636936793655634</id><published>2009-03-16T12:06:00.000-07:00</published><updated>2009-05-28T10:58:22.210-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='current events'/><title type='text'></title><content type='html'>Regarding the gunman (or maybe gun-boy) in Waiblingen, Germany:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Searching his bedroom, the police found violent computer games — in which, experts say, players digitally clothe and arm themselves for combat — plus brutal videos and play weapons that fire small yellow pellets, said Siegfried Mahler of the Stuttgart prosecutors' office.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Surce: &lt;a href="http://www.iht.com/articles/2009/03/12/europe/germany.php"&gt;International Herald Tribune&lt;/a&gt; (I found it first in the March 13, New York Times) &lt;br /&gt;&lt;br /&gt;My question is: why are they so cagey about saying what they found? Sounds to me like they found the kid plays &lt;a href="http://en.wikipedia.org/wiki/WoW"&gt;WoW&lt;/a&gt; (or something like it) and &lt;a href="http://en.wikipedia.org/wiki/Air_soft"&gt;Air Soft&lt;/a&gt;. If that was the case, why don't they come out and just say so? The only reason I can think of is it wouldn't sound as dangerous.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;br /&gt;I guess I should throw in a token &lt;a href="http://www.reddit.com/r/worldnews/comments/847nq/guess_what_did_investigators_find_in_the_room_of/"&gt;"Don't blame the game" Reddit link&lt;/a&gt; (By the way, I'm not saying I lean &lt;i&gt;either&lt;/i&gt; way on that one.)&lt;br /&gt;&lt;/small&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-3735636936793655634?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/3735636936793655634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/regarding-gunman-or-maybe-gun-boy-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/3735636936793655634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/3735636936793655634'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/regarding-gunman-or-maybe-gun-boy-in.html' title=''/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-2518990128545965867</id><published>2009-03-15T15:32:00.000-07:00</published><updated>2009-05-28T10:59:21.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Lock free concurrency is neat.</title><content type='html'>This topic comes by way of a few interest of mine.&lt;br /&gt;&lt;p/&gt;&lt;br /&gt; The first is non-locking concurrent solutions, or more actually some of the ways they are modeled and dealt with. A while ago I came across a description of a &lt;A HREF="http://video.google.com/videoplay?docid=2139967204534450862"&gt;lock free hash table using a CAS instruction&lt;/A&gt;. I fond this to be really cool because it managed to proof correctness of a solution by using only a single concurrent primitive and a state transition diagram. That was my first introduction into lock free solutions and I have been somewhat interested in them from then on.&lt;br /&gt;&lt;p/&gt;&lt;br /&gt; Another interest stems from my work. At one of the steps of our R&amp;D we had a system that worked by doing computation purely as a pattern-match-and-extend operation. While I was working with this I was also taking a algorithms class so naturally, I tried to combine the two. The most interesting thing to come out of that was from attacking the &lt;A HREF="http://en.wikipedia.org/wiki/Minimum_spanning_tree"&gt;minimum spanning tree problem&lt;/A&gt;. Given that the system in question is only additive, things tend to be cast in terms of classification. For this problem I chose to cast it in terms of edges to be removed so the question becomes how to identify edges in a graph that are not part of the minimum spanning tree? I have never managed to prove that this is correct, but what I can up with was to mark any edge that was the heaviest edge in any simple cycle. As it happens this is easy to define  but insanely expensive to compute. I never did implement it but I keep kicking it around.&lt;br /&gt;&lt;p/&gt;&lt;br /&gt; While that solution is intractable in real hard ware, it's interesting to note that it would work just fine on a system with unlimited concurrency.&lt;br /&gt;&lt;OL&gt;&lt;br /&gt; &lt;LI&gt; Start a thread on every node&lt;br /&gt; &lt;LI&gt; Every thread spawns a new thread for every edge from the current node.&lt;br /&gt; &lt;LI&gt; each thread now checks to see if the current node is in it's ancestry. If it is, then the heaviest edge between that occurrence and the end is marked and the thread quits.&lt;br /&gt; &lt;LI&gt; otherwise continue at step 2.&lt;br /&gt;&lt;/OL&gt;&lt;br /&gt;&lt;br /&gt; The next step is to notice that even under limited concurrency, this is a valid (but still impractical) transformation on a graph. Running something like &lt;A HREF="http://en.wikipedia.org/wiki/Kruskal%27s_algorithm"&gt;Kruskal's Algorithm&lt;/A&gt; on the graph at any point will result in the same result as running it on the original graph. With a little hand waving, I can convince my self that you can even run them at the same time. Even more interestingly, you only need to make very few assumption (I'll get back to that) to show that you don't even need to use locks. Not even &lt;i&gt;hardware locking&lt;/i&gt; like you would need for a CAS based algorithm.&lt;br /&gt;&lt;p/&gt;&lt;br /&gt; This no-locking aspect is a result of the only state that is modified, only ever going in one direction (from "might be in the tree" to "not in the tree") and because Kruskal's algorithm won't care if it gets stale data, it will just take longer to reject it.&lt;br /&gt;&lt;p/&gt;&lt;br /&gt; The solution is still impractical as finding cycles is not efficient. However, if half of Kruskal's algorithm is stolen and the extra threads just run around and test random edges to see if their endpoint share a sub-tree, I expect that this could be made very practical&lt;br /&gt;&lt;p/&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt; Now back to the assumptions: The only assumption I can see that has to be maid to avoids even hardware locking is that writing to that status flag of one edge must not interact with any other status flags. This precludes using a bit array or anything else that places the flags closer than the granularity of the CPU's cache. On the other hand. Even if this can't be met, CPU's need some way to effectively solve this problem so I would expect that it isn't that much of an issue.&lt;br /&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-2518990128545965867?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/2518990128545965867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/lock-free-concurrency-is-neat.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2518990128545965867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2518990128545965867'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/lock-free-concurrency-is-neat.html' title='Lock free concurrency is neat.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-8083919759822935252</id><published>2009-03-11T09:27:00.000-07:00</published><updated>2009-05-20T13:54:03.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='to someone'/><title type='text'>Happy Birthday to you know who you are.</title><content type='html'>:-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-8083919759822935252?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/8083919759822935252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/happy-birthday-to-you-know-who-you-are.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/8083919759822935252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/8083919759822935252'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/happy-birthday-to-you-know-who-you-are.html' title='Happy Birthday to you know who you are.'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-9044204393077664971</id><published>2009-03-09T15:37:00.000-07:00</published><updated>2009-03-29T13:18:00.377-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net library'/><title type='text'>My company is releasing some software I wrote</title><content type='html'>&lt;a href="http://precisionsoftware.blogspot.com/2009/03/natural-language-net-date-parser.html"&gt;The release notice&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-9044204393077664971?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/9044204393077664971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/my-company-is-relasing-some-software-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/9044204393077664971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/9044204393077664971'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/my-company-is-relasing-some-software-i.html' title='My company is releasing some software I wrote'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-568508338055135616</id><published>2009-03-08T21:07:00.000-07:00</published><updated>2009-05-28T16:45:51.760-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='min max'/><category scheme='http://www.blogger.com/atom/ns#' term='D'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><title type='text'>I just got a 25% speedup in my code!</title><content type='html'>I am working on a Connect-4 AI for an AI class. Being me I decided to go all out on the bit twiddling and whatnot to make the thing as compact and as fast as I could make it (there is a 30 seconds per move limit).&lt;br /&gt;&lt;br /&gt;The big part turns out being how to test for a win/loss and how to score the leaves of the tree. I chose to go with bits masks for the board as it lets me do both of these with ANDs, shifts and XORs. I shift the bits so that each sequence of 4 spaces stack and then build &lt;a href="http://stackoverflow.com/questions/598458/how-to-get-checksums-for-strided-patterns"&gt;a set of adders&lt;/a&gt; from ANDs and XORs. Checking the 4s bits finds wins and looses and masking with the inverse of the opponents and counting the 3s, 2s and 1s gives a heuristic for the state. The problem with this is that the direct way would end up with about 100 lines of bit ops and piles of goo for variables names. I actually started in on that tack but decided it wasn't a good idea.&lt;br /&gt;&lt;br /&gt;What I settled on was a templated struct that handles the shift and adds and another struct to handle the next higher level of the mucking around. The main problem with that is that I end up with about 160 variables (most of which are not needed at the same time) that are locked into struct so I don't expect that the compiler will do a good job of reusing them (I also suspect that many of the methods won't get inlined as aggressively)&lt;br /&gt;&lt;br /&gt;I was tossing around the idea of getting the code working and then editing the structs back into the main loop (inlining by hand) to address these issue and it occurred to me that if I turned the struct into templates I can do a named mixin and I don't need to alter the usage code one bit.&lt;br /&gt;&lt;br /&gt;As an example, this code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;struct S&lt;br /&gt;{&lt;br /&gt;   int i;&lt;br /&gt;   int I()&lt;br /&gt;   {&lt;br /&gt;      return i++;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;   S s1, s2;&lt;br /&gt;   s1.i = 0;&lt;br /&gt;   s2.i = 0;&lt;br /&gt;   assert(s1.I == 0);&lt;br /&gt;   assert(s2.I == 0);&lt;br /&gt;   assert(s1.I == 1);&lt;br /&gt;   assert(s2.I == 1);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;becomes this code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;template S()&lt;br /&gt;{&lt;br /&gt;   int i;&lt;br /&gt;   int I()&lt;br /&gt;   {&lt;br /&gt;      return i++;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;   mixin S!() s1;&lt;br /&gt;   mixin S!() s2;&lt;br /&gt;   s1.i = 0;&lt;br /&gt;   s2.i = 0;&lt;br /&gt;   assert(s1.I == 0);&lt;br /&gt;   assert(s2.I == 0);&lt;br /&gt;   assert(s1.I == 1);&lt;br /&gt;   assert(s2.I == 1);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;In my actual case this resulted in about a 25% speed boost.&lt;br /&gt;&lt;br /&gt;of course this does have a few down side like I can no longer use &lt;tt&gt;this&lt;/tt&gt; or any of it's aliases. I can't use the data as a struct and I can't copy it.&lt;br /&gt;&lt;br /&gt;But all in all a 25% speedup for almost no coding is just cool!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-568508338055135616?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/568508338055135616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/i-just-got-free-25-speedup-in-my-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/568508338055135616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/568508338055135616'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/i-just-got-free-25-speedup-in-my-code.html' title='I just got a 25% speedup in my code!'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6756950882378809744.post-2232071130703063026</id><published>2009-03-04T16:00:00.000-08:00</published><updated>2009-03-04T16:01:41.860-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><title type='text'>So I started a blog this afternoon...</title><content type='html'>I hope I can think of stuff to say...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6756950882378809744-2232071130703063026?l=arrayboundserror.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arrayboundserror.blogspot.com/feeds/2232071130703063026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/so-i-started-blog-this-afternoon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2232071130703063026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6756950882378809744/posts/default/2232071130703063026'/><link rel='alternate' type='text/html' href='http://arrayboundserror.blogspot.com/2009/03/so-i-started-blog-this-afternoon.html' title='So I started a blog this afternoon...'/><author><name>BCSd</name><uri>http://www.blogger.com/profile/13116517988033017470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
