<?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-862393876629049158</id><updated>2011-11-27T16:29:29.328-08:00</updated><category term='xsl'/><category term='inline'/><category term='jaxb'/><category term='movies'/><category term='fallout 3'/><category term='blogspot'/><category term='sha1sum'/><category term='maven'/><category term='benchmark'/><category term='mochi'/><category term='plasma'/><category term='ppm'/><category term='jar'/><category term='vertlets'/><category term='announcment'/><category term='dumb'/><category term='line intesection'/><category term='performance'/><category term='physics'/><category term='transform'/><category term='clouds'/><category term='xml'/><category term='bumpmap'/><category term='bresenham'/><category term='neko vm'/><category term='java'/><category term='refactoring'/><category term='virtual plants'/><category term='optimizing'/><category term='politics'/><category term='2d'/><category term='macros'/><category term='intersection'/><category term='bailout'/><category term='games'/><category term='cube'/><category term='wordpress'/><category term='physaxe'/><category term='svg'/><category term='matrix'/><category term='stickman'/><category term='jar-czar'/><category term='magic realm'/><category term='flowers'/><category term='model'/><category term='testing'/><category term='blogging'/><category term='witch'/><category term='absorb essence'/><category term='bitmap'/><category term='haxe'/><category term='calculator'/><title type='text'>Does one speak of the rope in the house of the hanged?</title><subtitle type='html'>Helping you mind your P's and Q's since 1846!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-3718383143965657851</id><published>2010-08-03T19:31:00.000-07:00</published><updated>2010-08-03T19:32:27.582-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='mochi'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><title type='text'>kit-kat-toe: mochiads with haxe</title><content type='html'>I recently tried out &lt;a href="http://hesselboom.com/mochi/"&gt;Viktor Hesselbom Haxe Instructions for MochiAds&lt;/a&gt; and they work just fine.&lt;br /&gt;&lt;br /&gt;Something like this... &lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;% wget https://www.mochimedia.com/dl/MochiAPI_v3_8.zip&lt;br /&gt;% unzip MochiAPI_v3_8.zip&lt;br /&gt;% cd MochiAPI_v3_8&lt;br /&gt;% mkdir -p foo/mochi&lt;br /&gt;% cp -r mochi/as3 foo/mochi&lt;br /&gt;% cd foo&lt;br /&gt;% compc -source-path . -output mochi.swc -include-sources .&lt;br /&gt;% unzip mochi.swc library.swf&lt;br /&gt;% haxe --gen-hx-classes library.swf&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;Then just get the game id from the &lt;a href="http://mochimedia.com"&gt;nice folks over at mochi&lt;/a&gt; and jam in the little bit of ad code.&lt;br /&gt;&lt;br /&gt;One problem I had was that I found I needed to add a new MovieClip to the  flash.Lib.current, use that for the ad and remove it in the ad_finished callback.&lt;br /&gt;&lt;br /&gt;I had some mixed luck with swfmill... The old version I had (0.2.12) didn't complain about the mp3 I having the wrong bitrate... But when I linked against the -swf-lib from the new version it produced a blank swf! &lt;br /&gt;&lt;br /&gt;So... I have no sound...&lt;br /&gt;&lt;br /&gt;LOL... it is a very silly proof of concept... &lt;a href="http://www.mochigames.com/games/kit-kat-toe/"&gt;check it out&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I call it &lt;a href="&lt;br /&gt;http://www.mochigames.com/games/kit-kat-toe/"&gt;kit-tac-toe&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;gory swfmill detail&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;To compile swfmill under Hardy Heron (I know... it's old)... I had to modify swfmill.c and add:   extern char *xslt_simple;&lt;br /&gt;&lt;br /&gt;And it still didn't work... I may try to use a newer box to  see if my horked environment is why it didn't work right....&lt;br /&gt;&lt;br /&gt;Here is the handy message I got from it... &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sampling rate: 32000&lt;br /&gt;Error: Flash only supports sampling rates of 44100, 22050 and 11025 Hz&lt;br /&gt;WARNING: MP3 file sounds/cats/meow.mp3 has a wrong sampling rate&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/862393876629049158-3718383143965657851?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/3718383143965657851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2010/08/kit-kat-toe-mochiads-with-haxe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3718383143965657851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3718383143965657851'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2010/08/kit-kat-toe-mochiads-with-haxe.html' title='kit-kat-toe: mochiads with haxe'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-553961621797191905</id><published>2010-01-30T18:23:00.000-08:00</published><updated>2010-01-30T18:38:28.448-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='magic realm'/><category scheme='http://www.blogger.com/atom/ns#' term='witch'/><category scheme='http://www.blogger.com/atom/ns#' term='absorb essence'/><title type='text'>28-days as the Witch in Magic Realm</title><content type='html'>The witch is all about spells, here was my setup:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Absorb Esssence: grab a big monster to rack up fame/notoriety killing monsters and natives&lt;/li&gt;&lt;li&gt;Control Octopus/Spider: always nice to have company!&lt;/li&gt;&lt;li&gt;Broomstick: get me out of here!&lt;/li&gt;&lt;/ul&gt;Amazingly, the Pool and the Lost City were in the tile right next to the Dark Valley where I started!&lt;br /&gt;&lt;br /&gt;Grabbed a Giant and the Pool Monster conveniently showed up! Time to kick some @$$!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://twitpic.com/10lpie"&gt;&lt;img src="http://s3.amazonaws.com/twitpic/photos/large/61479014.png?AWSAccessKeyId=0ZRYP5X5F6FSMBCCSE82&amp;Expires=1264905627&amp;Signature=2zdv8nJ%2B7jWOvreMdcc1g1p54Hs%3D"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The very next turn, the Pool Monster found the pool and pulled out: the Cloven hoof, the Black Book and Bejeweled Crown (50g, yo!)... Unfortunately this trapped the Witch as a Giant and on the second go 'round (ahem). the Pool Monster went down. &lt;br /&gt;&lt;br /&gt;Next day I looted the "Sacred Idol" and decided to make a run for it.&lt;br /&gt;&lt;br /&gt;The nearest dwelling was the Chapel which I barely arrived at in time abandoning the Cloven hoof so I could carry the Crown in Giant-mode so as to sell it the next day (day 27!)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://twitpic.com/10lynr"&gt;&lt;img src="http://web9.twitpic.com/img/61490871-def3a2fd22d04a993f5558deba544afe.4b64ec7a-full.png"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My bro had told me short games force you to focus and I'd have to agree, but ... day 28, there was the Witch sitting there with the Black Book, one tile away from the Cloven Hoof... and... the game is over!&lt;br /&gt;&lt;br /&gt;Hurray?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-553961621797191905?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/553961621797191905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2010/01/28-days-as-witch-in-magic-realm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/553961621797191905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/553961621797191905'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2010/01/28-days-as-witch-in-magic-realm.html' title='28-days as the Witch in Magic Realm'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-6288981634322992031</id><published>2009-09-02T12:54:00.000-07:00</published><updated>2009-09-02T13:01:17.918-07:00</updated><title type='text'>fractal pinwheels</title><content type='html'>These are some little pinwheels made by a little fractal line drawing + you typical draw lines around a circle code:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://brianin3d.googlepages.com/pinwheels.gif"&gt;&lt;br /&gt;&lt;br /&gt;You can see it in action &lt;a href="http://brianin3d.googlepages.com/funkyLine_one.html"&gt;here&lt;/a&gt;. Click anywhere to draw a random pinwheel... and hit space key to clear them&lt;br /&gt;&lt;br /&gt;Here is the function to draw the lines:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    public function funky_line( g:Graphics, x1:Float, y1:Float, x2:Float, y2:Float, depth:Int, max:Int ) {&lt;br /&gt;        if ( depth &gt; max ) {&lt;br /&gt;            g.moveTo( x1, y1 );&lt;br /&gt;            g.lineTo( x2, y2 );&lt;br /&gt;        } else {&lt;br /&gt;            depth++;&lt;br /&gt;            var nx = -1 * ( y2 - y1 ) * ( depth / ( depth * depth ) );&lt;br /&gt;            var ny =  1 * ( x2 - x1 ) * ( depth / ( depth * depth ) );&lt;br /&gt;            var xm = x1 + ( x2 - x1 ) / 2 + nx;&lt;br /&gt;            var ym = y1 + ( y2 - y1 ) / 2 + ny;&lt;br /&gt;            funky_line( g, x1, y1, xm, ym, depth, max );&lt;br /&gt;            funky_line( g, xm, ym, x2, y2, depth, max );&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Max is the number of recursions and count is the number of lines to draw around the circle... &lt;br /&gt;&lt;br /&gt;Neato...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-6288981634322992031?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/6288981634322992031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/09/fractal-pinwheels.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/6288981634322992031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/6288981634322992031'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/09/fractal-pinwheels.html' title='fractal pinwheels'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-4168548604716182719</id><published>2009-08-17T06:29:00.001-07:00</published><updated>2009-08-18T08:09:11.877-07:00</updated><title type='text'>xquery script</title><content type='html'>The other day, I really wanted to be able to run an xquery expression over some xml and use it as some scripting input... I was really surprised to see there really doesn't appear to be a nice way to do this!&lt;br /&gt;&lt;br /&gt;After all... xquery is the xml equivalent of grep. Imagine! Landing in an OS with no grep equivalent!&lt;br /&gt;&lt;br /&gt;Oh, wait... I just described &lt;a href="http://www.urbandictionary.com/define.php?term=Windoze"&gt;windoze&lt;/a&gt;... &lt;br /&gt;&lt;br /&gt;I wrote a small piece of XLS wrapped in a script( &lt;a href="http://brianin3d.googlepages.com/xsnap.sh"&gt;xsnap.sh&lt;/a&gt;) the script got a slightly more complicated once I found out that if an input document has a namespace defined, you &lt;b&gt;have to&lt;/b&gt; use it in your expression.&lt;br /&gt;&lt;br /&gt;Now this is handled like magic, but can be turned off by uncommenting the line "XSNAP_SMARTY" then you can specify "xsnap:expression" to match the default ns of the document.&lt;br /&gt;&lt;br /&gt;Here is the dealio: xsnap.sh "groupId/text()" pom.xml&lt;br /&gt;&lt;pre&gt;junit&lt;br /&gt;hsqldb&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;And viola! A "grep-like" tool for xml! &lt;br /&gt;&lt;br /&gt;This mechanism is more robust that just grepping xml since it uses the xquery standard junk.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-4168548604716182719?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/4168548604716182719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/08/xquery-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4168548604716182719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4168548604716182719'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/08/xquery-script.html' title='xquery script'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-2293913978069356525</id><published>2009-06-06T14:37:00.000-07:00</published><updated>2009-06-06T14:39:58.621-07:00</updated><title type='text'>Voronoi diagrams as seamless tiles</title><content type='html'>Check out my groovy new seamless tiles.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://brianin3d-demos.appspot.com/static/images/voronoi/simple_voronoi.png"/&gt;&lt;br /&gt;&lt;img src="http://brianin3d-demos.appspot.com/static/images/voronoi/hex_voronoi.png"/&gt;&lt;br /&gt;&lt;img src="http://brianin3d-demos.appspot.com/static/images/voronoi/voronoi_1.png"/&gt;&lt;br /&gt;&lt;br /&gt;I now have an easy way to use &lt;a href="http://brianin3d-demos.appspot.com/static/demos/random/voronoi.xml"&gt;Voronoi diagrams to generate seamless tiles&lt;/a&gt;! Fun!&lt;br /&gt;&lt;br /&gt;Feel free to get any sort of use out of them you can.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-2293913978069356525?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/2293913978069356525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/06/voronoi-diagrams-as-seamless-tiles.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2293913978069356525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2293913978069356525'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/06/voronoi-diagrams-as-seamless-tiles.html' title='Voronoi diagrams as seamless tiles'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-4799893972850912207</id><published>2009-05-29T07:20:00.000-07:00</published><updated>2009-05-29T08:24:05.903-07:00</updated><title type='text'>file timestamp in RFC-2822 format</title><content type='html'>Creating an &lt;a href="http://feeds2.feedburner.com/Brianin3dDemosAndStuffYo"&gt;RSS&lt;/a&gt; feed from a script was pretty straight forward, but I ran into some nuisance getting the file timestamps in the right format:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;element pubDate: Schemas validity error : Element 'pubDate': [facet 'pattern'] The value 'Thu May 28 22:53:18 EDT 2009' is not accepted by the pattern '(((Mon)|(Tue)|(Wed)|(Thu)|(Fri)|(Sat)|(Sun)), *)?\d\d? +((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec)) +\d\d(\d\d)? +\d\d:\d\d(:\d\d)? +(([+\-]?\d\d\d\d)|(UT)|(GMT)|(EST)|(EDT)|(CST)|(CDT)|(MST)|(MDT)|(PST)|(PDT)|\w)'.&lt;br /&gt;&lt;br /&gt;element lastBuildDate: Schemas validity error : Element 'lastBuildDate': 'Thu May 28 22:53:18 EDT 2009' is not a valid value of the atomic type 'Rfc822FormatDate'.&lt;br /&gt;&lt;/pre&gt; &lt;br /&gt;That's the output of validation from xmllint and the XSD I have... if it's "RFC 822", "RFC 2822", doesn't really matter that much to me... &lt;br /&gt;&lt;br /&gt;I finally got &lt;i&gt;ls&lt;/i&gt; to produce this output format:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% ls -l myfile --time-style=+'%a, %d %b %Y %T %z' | cut -f6-11 -d' '&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The &lt;i&gt;date&lt;/i&gt; command has a nice flag (-R) that will print in this format too:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% date -R ; date +'%a, %d %b %Y %T %z'&lt;br /&gt;Fri, 29 May 2009 10:14:53 -0400&lt;br /&gt;Fri, 29 May 2009 10:14:53 -0400 &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Makes me wish we could just use %s... :-P&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-4799893972850912207?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/4799893972850912207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/05/file-timestamp-in-rfc-2822-format.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4799893972850912207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4799893972850912207'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/05/file-timestamp-in-rfc-2822-format.html' title='file timestamp in RFC-2822 format'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-8940798841855530873</id><published>2009-05-27T11:01:00.000-07:00</published><updated>2009-05-27T11:03:20.928-07:00</updated><title type='text'>css sprites for js games</title><content type='html'>The other day, I started to look at &lt;a href="http://brianin3d-demos.appspot.com/static/demos/random/css_sprites.xml"&gt;css sprites&lt;/a&gt; again.&lt;br /&gt;&lt;br /&gt;Imagemagicks' montage command is a groovy way to concatenation images together:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;montage  ???1.png   -tile 1x -geometry +0+0 -background none last1.png&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Along with some js shenanigans, I was able to write a small  &lt;a href="http://brianin3d-demos.appspot.com/static/demos/games/fall.xml"&gt;bejeweled-like puzzle game&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It's pretty neato!  &lt;a href="http://brianin3d-demos.appspot.com/static/demos/games/fall.xml"&gt;Give it a go!&lt;/a&gt;!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-8940798841855530873?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/8940798841855530873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/05/css-sprites-for-js-games.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8940798841855530873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8940798841855530873'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/05/css-sprites-for-js-games.html' title='css sprites for js games'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-8479468661360676245</id><published>2009-03-23T07:19:00.000-07:00</published><updated>2009-03-23T07:28:00.885-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><title type='text'>feelin' randy!</title><content type='html'>Shuffle! Chaos! Randomness! Surprise me! How many times... have you wanted to: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;shuffle a list of mp3 to pass to mplayer&lt;/li&gt;&lt;li&gt;randomize a list of background images to eog&lt;/li&gt;&lt;li&gt;pick a random file from a directory&lt;/li&gt;&lt;/ul&gt;Once or twice? OK! These can all be boiled down to reading in lines from stdout, mixing 'em up and spewing them back out in a random order.&lt;br /&gt;&lt;br /&gt;Check out this tiny haxe program called &lt;a href="http://code.google.com/p/brianin3d-misc/source/browse/trunk/random/haxe/Randy.hx"&gt;randy&lt;/a&gt;. It's self compiling: &lt;br /&gt;&lt;pre&gt;% wget http://brianin3d-misc.googlecode.com/svn/trunk/random/haxe/Randy.hx&lt;br /&gt;% chmod 755 Randy.hx &lt;br /&gt;%  ./Randy.hx &lt;br /&gt;% echo -e "1\n2\n3" | ./randy &lt;br /&gt;1&lt;br /&gt;3&lt;br /&gt;2&lt;/pre&gt;&lt;br /&gt;I wrote it just 4u!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-8479468661360676245?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/8479468661360676245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/03/feelin-randy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8479468661360676245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8479468661360676245'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/03/feelin-randy.html' title='feelin&apos; randy!'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-1551576768797967679</id><published>2009-03-11T11:29:00.000-07:00</published><updated>2009-03-11T11:34:48.905-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='macros'/><title type='text'>got the macro replacement blues</title><content type='html'>As crazy as it may seem, I have implemented &lt;a href="http://code.google.com/p/brianin3d-misc/source/browse/trunk/MacroReplace/MacroReplace.java"&gt;this&lt;/a&gt; type of silly macro replacement stuff about a million times:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        public String replace( String message, Object ... argz ) {&lt;br /&gt;                int i = 0;&lt;br /&gt;                for ( Object arg : argz ) {&lt;br /&gt;                        message = message.replaceAll( &lt;br /&gt;                                "\\{" + ( i++ ) + "}"&lt;br /&gt;                                , arg.toString() &lt;br /&gt;                        );&lt;br /&gt;                }&lt;br /&gt;                return message;&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Basicly it converts something like:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"this is some {0}, Mr. {1}... some real {0}"&lt;/i&gt; + "&lt;b&gt;mess&lt;/b&gt;" and "&lt;b&gt;Man&lt;/b&gt;"&lt;br /&gt;&lt;br /&gt;to something like:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;this is some mess, Mr. Man... some real mess&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The only "tricky" part is that you have to escape the opening curly with a backslash and then escape the backslash with a backslash... &lt;br /&gt;&lt;br /&gt;Sigh...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-1551576768797967679?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/1551576768797967679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/03/got-macro-replacement-blues.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/1551576768797967679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/1551576768797967679'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/03/got-macro-replacement-blues.html' title='got the macro replacement blues'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-3353595680921766791</id><published>2009-03-08T12:08:00.000-07:00</published><updated>2009-03-08T12:17:49.801-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><title type='text'>UpperCamel: compiling haxe to a native executable</title><content type='html'>UpperCamel is a little program for going back and forth between&lt;br /&gt;camel case and underlined uppercase.&lt;br /&gt;&lt;br /&gt;Typically camel case is used for class names, variables, and method names.&lt;br /&gt;&lt;br /&gt;Whereas underlined uppercase is used for constants, statics, etc.&lt;br /&gt;&lt;pre&gt;     Sample Input     | Sample Output&lt;br /&gt;    ------------------+-------------------&lt;br /&gt;    UpperCamel        | UPPER_CAMEL&lt;br /&gt;    ThisIsNeatoEh     | THIS_IS_NEATO_EH&lt;br /&gt;    UPPER_CAMEL       | upperCamel&lt;br /&gt;    MIX-and-Match     | mixAndMatch&lt;/pre&gt;&lt;br /&gt;Somewhat useful... The main point is to show how to compile haxe to create a native executable:&lt;br /&gt;&lt;pre&gt;% haxe -main UpperCamel -neko upperCamel.n&lt;br /&gt;% nekotools boot upperCamel.n&lt;br /&gt;% echo hello_world | ./upperCamel&lt;br /&gt;helloWorld&lt;/pre&gt;&lt;br /&gt;Neat, huh?&lt;br /&gt;&lt;pre&gt;% file upperCamel&lt;br /&gt;upperCamel: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped&lt;br /&gt;% ldd upperCamel&lt;br /&gt;    linux-gate.so.1 =&gt;  (0x4001a000)&lt;br /&gt;    libneko.so =&gt; /usr/lib/libneko.so (0x4002e000)&lt;br /&gt;    libpthread.so.0 =&gt; /lib/libpthread.so.0 (0x4004d000)&lt;br /&gt;    libc.so.6 =&gt; /lib/libc.so.6 (0x40065000)&lt;br /&gt;    libdl.so.2 =&gt; /lib/libdl.so.2 (0x401a8000)&lt;br /&gt;    libgc.so.1 =&gt; /usr/lib/libgc.so.1 (0x401ad000)&lt;br /&gt;    libm.so.6 =&gt; /lib/libm.so.6 (0x401e1000)&lt;br /&gt;    /lib/ld-linux.so.2 (0x40000000)&lt;br /&gt;    libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x40207000)&lt;/pre&gt;&lt;br /&gt;The code for &lt;a href="http://code.google.com/p/brianin3d-misc/source/browse/trunk/UpperCamel/UpperCamel.hx"&gt;UpperCamel.hx&lt;/a&gt; has a bit of shell script which makes it easy to compile for Unix-env type folks:&lt;br /&gt;&lt;pre&gt;% wget http://brianin3d-misc.googlecode.com/svn/trunk/UpperCamel/UpperCamel.hx&lt;br /&gt;% chmod 755 UpperCamel.hx&lt;br /&gt;% ./UpperCamel.hx&lt;br /&gt;% file ./upperCamel&lt;br /&gt;./upperCamel: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped&lt;/pre&gt;&lt;br /&gt;Haxe to binary executable is a nice path for whipping up custom commands when you need them with a really low price of admission!&lt;br /&gt;&lt;br /&gt;Go, Haxe!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-3353595680921766791?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/3353595680921766791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/03/uppercamel-compiling-haxe-to-native.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3353595680921766791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3353595680921766791'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/03/uppercamel-compiling-haxe-to-native.html' title='UpperCamel: compiling haxe to a native executable'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-3311987799745579113</id><published>2009-02-22T20:12:00.000-08:00</published><updated>2009-02-22T20:21:22.045-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cube'/><title type='text'>crude ascii cube</title><content type='html'>So... working on some stuff... needed the vertices and indices for cube. The point "0" is set at (x,y,z)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;4 .--------. 5&lt;br /&gt;  |\       |\          floor   :  0,1,2 0,2,3&lt;br /&gt;  | \      | \         ceiling :  4,5,6 4,6,7 &lt;br /&gt;  |7 .--------. 6      back    :  0,1,5 0,5,4 &lt;br /&gt;  |  |     |  |        front   :  3,7,6 3,6,2 &lt;br /&gt;0 .--|-----. 1|        left    :  0,4,7 0,7,3 &lt;br /&gt;   \ |      \ |        right   :  1,5,6 1,6,2 &lt;br /&gt;    \|       \|        &lt;br /&gt;   3 .--------. 2&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;pushi( vertices, [&lt;br /&gt;      x + 0 , y + 0, z + 0    // 0    &lt;br /&gt;    , x + m , y + 0, z + 0    // 1    &lt;br /&gt;    , x + m , y + 0, z + m    // 2    &lt;br /&gt;    , x + 0 , y + 0, z + m    // 3    &lt;br /&gt;    , x + 0 , y - m, z + 0    // 4    &lt;br /&gt;    , x + m , y - m, z + 0    // 5    &lt;br /&gt;    , x + m , y - m, z + m    // 6    &lt;br /&gt;    , x + 0 , y - m, z + m    // 7    &lt;br /&gt;] );&lt;/pre&gt;&lt;br /&gt;btw... Adobe... wtf doesn't Graphics.drawTriangles take a zcoord and do zbuffering? Way to phone it in guys... Flash 11?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-3311987799745579113?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/3311987799745579113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/02/crude-ascii-cube.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3311987799745579113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3311987799745579113'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/02/crude-ascii-cube.html' title='crude ascii cube'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-3025548725551272836</id><published>2009-02-17T08:04:00.000-08:00</published><updated>2009-02-17T08:05:37.216-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='announcment'/><title type='text'>announcing http://brianin3d-demos.appspot.com/</title><content type='html'>I've decided to start hosing my demos on &lt;a href="http://brianin3d-demos.appspot.com/"&gt;http://brianin3d-demos.appspot.com/&lt;/a&gt; instead of just all over the place willy-nilly.&lt;br /&gt;&lt;br /&gt;It is pretty bare-bones at the moment, but I plan to grow it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-3025548725551272836?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/3025548725551272836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/02/announcing-httpbrianin3d.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3025548725551272836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3025548725551272836'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/02/announcing-httpbrianin3d.html' title='announcing http://brianin3d-demos.appspot.com/'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-7420661816710207978</id><published>2009-02-17T07:46:00.000-08:00</published><updated>2009-02-17T08:05:56.079-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ppm'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><title type='text'>ppm is a developer's best friend!</title><content type='html'>OK, that is a crazy overstatement, but it is pretty useful bit to know about. &lt;br /&gt;&lt;br /&gt;So what is it? It's a baby-simple image format. Let's say we wanted to write out a 320x240 image. The file would look something like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;P6&lt;br /&gt;320 240&lt;br /&gt;255&lt;br /&gt;{ONE CHARACTER PER R/G/B FOR EACH PIXEL}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So... if the first pixel was black (0x000000), we would write 0, 0, followed by zero. Whereas if it were (0xFFAADD) we'd cleverly write 0xFF, 0xAA, 0xDD.&lt;br /&gt;&lt;br /&gt;Ya dig it? Here is a snippet from &lt;a href="http://code.google.com/p/brianin3d-poppy/source/browse/trunk/us/versus/them/hmap/TextHash2Ppm.hx"&gt;TextHash2Ppm.hx&lt;/a&gt; after I loaded the text file into an array of strings called (creatively enuff) "lines":&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; out.writeString( 'P6\n' );&lt;br /&gt; out.writeString( lines[ 0 ].length + ' ' + lines.length + '\n' );&lt;br /&gt; out.writeString( '255\n' );&lt;br /&gt;&lt;br /&gt; for ( line in lines ) {&lt;br /&gt;     for ( i in 0 ... line.length ) {&lt;br /&gt;         var char = line.charAt( i ) ;&lt;br /&gt;         var value = if ( '#' == char ) 255; else 0;&lt;br /&gt;         out.writeByte( value );&lt;br /&gt;         out.writeByte( value );&lt;br /&gt;         out.writeByte( value );&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is a bit I wrote recently to show files like &lt;a href="http://brianin3d-demos.appspot.com/static/demos/brianin3d-poppy/sample_dungeon.txt"&gt;sample_dungeon.txt&lt;/a&gt; to &lt;br /&gt;&lt;a href="http://brianin3d-demos.appspot.com/static/demos/brianin3d-poppy/sample_dungeon.ppm"&gt;sample_dungeon.ppm&lt;/a&gt; which I then converted to &lt;a href="http://brianin3d-demos.appspot.com/static/demos/brianin3d-poppy/sample_dungeon.png"&gt;&lt;img src="http://brianin3d-demos.appspot.com/static/demos/brianin3d-poppy/sample_dungeon.png"/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Which I can then use as input to this &lt;a href="http://brianin3d-demos.appspot.com/static/demos/brianin3d-poppy/Ter_Dungeon.xml"&gt;heightmap viewer&lt;/a&gt;  even though it looks wonky as heck.&lt;br /&gt;&lt;br /&gt;PPM is a handy format for when you need to create images and you don't have or don't want to use an image library to create jpgs, pngs, etc...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-7420661816710207978?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/7420661816710207978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/02/ppm-is-developers-best-friend.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/7420661816710207978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/7420661816710207978'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/02/ppm-is-developers-best-friend.html' title='ppm is a developer&apos;s best friend!'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-2060897937758849704</id><published>2009-02-09T07:00:00.000-08:00</published><updated>2009-02-09T07:11:56.653-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='bumpmap'/><category scheme='http://www.blogger.com/atom/ns#' term='plasma'/><category scheme='http://www.blogger.com/atom/ns#' term='clouds'/><category scheme='http://www.blogger.com/atom/ns#' term='bitmap'/><title type='text'>bitmap'n it!</title><content type='html'>So... Like a lot of folks, I've always been really fascinated with bitmap type effects. They're a lot of fun to watch and  pretty easy to write.&lt;br /&gt;&lt;br /&gt;I &lt;a href="http://code.google.com/p/brianin3d-bitly/"&gt;collected together&lt;/a&gt; a set of small demos of some classic bitmap effects.&lt;br /&gt;&lt;br /&gt;Franticly clicking on the demo will reset the current effect and eventually enable you to press the keys to access the different effects:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;pixel average: this kooky bit manipulation creates bizarre plasma effects (be patient!)&lt;/li&gt;&lt;li&gt;clouds: different clouds and cloud like effects&lt;/li&gt;&lt;li&gt;hough: use a hough transfer to create trippy sine waves from partial lines&lt;/li&gt;&lt;li&gt;bump: ye olde bumpmap effect using displacement maps from the other demos&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;See it in &lt;a href="http://brianin3d.googlepages.com/little_bitly.html"&gt;action&lt;/a&gt;!&lt;br /&gt;&lt;iframe src="http://brianin3d.googlepages.com/little_bitly.html" width="550" height="640"&gt;&lt;br /&gt;sorry...&lt;br /&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-2060897937758849704?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/2060897937758849704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/02/bitmapn-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2060897937758849704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2060897937758849704'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/02/bitmapn-it.html' title='bitmap&apos;n it!'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-7365391604070522251</id><published>2009-01-26T11:47:00.000-08:00</published><updated>2009-01-27T10:08:39.644-08:00</updated><title type='text'>square root estimation fun with javascript</title><content type='html'>After reading about &lt;a href="http://ncannasse.fr/blog/fast_inverse_square_root"&gt;Fast Inverse Square Root&lt;/a&gt; I thought it would be fun to see this iterative estimation process in action:&lt;br /&gt;&lt;iframe width="800" height="800" src="http://brianin3d.googlepages.com/sqrt.html"&gt;&lt;br /&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-7365391604070522251?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/7365391604070522251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/01/square-root-estimation-fun-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/7365391604070522251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/7365391604070522251'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/01/square-root-estimation-fun-with.html' title='square root estimation fun with javascript'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-6341266453112354413</id><published>2009-01-21T15:01:00.000-08:00</published><updated>2009-01-26T07:08:52.342-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='optimizing'/><category scheme='http://www.blogger.com/atom/ns#' term='intersection'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='refactoring'/><title type='text'>refactoring safety net</title><content type='html'>I recently started porting and collecting &lt;a href="http://code.google.com/p/brianin3d-intersect/"&gt;some code&lt;/a&gt; for doing various sorts of intersection, or collision, tests in haxe.&lt;br /&gt;&lt;br /&gt;At the moment, it is pretty limited with ray/triangle and ray/sphere tests.&lt;br /&gt;&lt;br /&gt;The first test I ported was based on  based on "Fast, Minimum Storage Ray / Triangle Intersection" by Tomas Möller and Ben  Trumbore and ported directly from the copy of the code on &lt;a href="http://jgt.akpeters.com/papers/MollerTrumbore97/code.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The results documented in the paper are pretty impressive and having source code certainly made it an easy win, but some aspects of the code concern me:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;points are represented as arrays, perhaps not very efficient in haxe&lt;li&gt;the code has multiple returns points, can't be inlined in haxe&lt;/ul&gt;&lt;br /&gt;I want to refactor the code to be as efficient as possible because this is likely to be the innermost loop of particle simulation routines, etc, &lt;b&gt;but&lt;/b&gt; I don't want to break the implementation.&lt;br /&gt;&lt;br /&gt;Enter the test case.  &lt;br /&gt;&lt;br /&gt;My initial testcase generated 1000 random triangles and rays and tested the culling and non-culling version of the algorithm. &lt;br /&gt;&lt;br /&gt;All well and good, but not good enuff for refactoring since I need to make sure the same inputs produce the same outputs before and after my changes.&lt;br /&gt;&lt;br /&gt;So... I put in some trace commands to produce xml like so:&lt;br /&gt;&lt;pre&gt;&amp;lt;hit non_hit="1" cul_hit="1" t="0.5373583852"&amp;gt;&lt;br /&gt;    &amp;lt;v0 x="0.6581358404" y="0.1374191698" z="0.9648343668" /&amp;gt;&lt;br /&gt;    &amp;lt;v1 x="0.308879062" y="0.6053369969" z="0.3154988046" /&amp;gt;&lt;br /&gt;    &amp;lt;v2 x="0.8667143827" y="0.1228679823" z="0.3068826511" /&amp;gt;&lt;br /&gt;    &amp;lt;src x="0.1215154344" y="0.2182366329" z="0.4350455069" /&amp;gt;&lt;br /&gt;    &amp;lt;dir x="0.7023522276" y="0.3298090568" z="0.1063413928" /&amp;gt;&lt;br /&gt;&amp;lt;/hit&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now I can verify that the same input produces the same output. &lt;br /&gt;&lt;br /&gt;My test looks like this now:&lt;br /&gt;&lt;pre&gt;public function testCanned() {  &lt;br /&gt;  var count = 0;&lt;br /&gt;  var tests = &lt;br /&gt;  loadTriangles();                                              &lt;br /&gt;    &lt;br /&gt;  for ( i in 0 ... 50 ) {&lt;br /&gt;    for ( test in tests ) { &lt;br /&gt;      verifyTriangle( test );&lt;br /&gt;      count++;                                                  &lt;br /&gt;    }                                           &lt;br /&gt;  } &lt;br /&gt;  var stopTime = Date.now();&lt;br /&gt;  var diff = ( stopTime.getTime() - startTime.getTime() ) / 1000.0;&lt;br /&gt;    &lt;br /&gt;  trace( count + ' tests / ' + diff + 's = ' + ( count / diff ) + ' tests/s' );&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After a few test runs, the initial numbers look like:&lt;br /&gt;&lt;pre&gt;AppTest.hx:99: 459600 tests / 32s = 14362.5 tests/s&lt;br /&gt;AppTest.hx:99: 459600 tests / 36s = 12766.66667 tests/s&lt;br /&gt;AppTest.hx:99: 459600 tests / 35s = 13131.42857 tests/s&lt;br /&gt;AppTest.hx:99: 459600 tests / 35s = 13131.42857 tests/s&lt;br /&gt;AppTest.hx:99: 459600 tests / 36s = 12766.66667 tests/s&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So... it averages out to around 13231.738096 tests/s&lt;br /&gt;&lt;br /&gt;My first refactoring was to use a "result" variable and some branching to only have a single return point so I can use the inline function modified:&lt;br /&gt;&lt;pre&gt;AppTest.hx:99: 459600 tests / 31s = 14825.80645 tests/s&lt;br /&gt;AppTest.hx:99: 459600 tests / 31s = 14825.80645 tests/s&lt;br /&gt;AppTest.hx:99: 459600 tests / 31s = 14825.80645 tests/s&lt;br /&gt;AppTest.hx:99: 459600 tests / 32s = 14362.5 tests/s&lt;br /&gt;AppTest.hx:99: 459600 tests / 31s = 14825.80645 tests/s&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For an average of around: 14733.145160 tests/s &lt;br /&gt;&lt;br /&gt;This comes to 14733.145160/13231.738096 = 1.11347013167180814489 , for an 11% speedup just from this trivial change.&lt;br /&gt;&lt;br /&gt;From &lt;a href="http://brianin3d.blogspot.com/2008/12/point-in-haxe-inline-ftw.html"&gt;some earlier work&lt;/a&gt;, I saw that an optimized point class could be significantly faster than a typedef, some additional tests (unpublished) show that using arrays to represent points was about 4x slower than typedefs!&lt;br /&gt;&lt;br /&gt;The next refactoring will be to use this "InlinePoint" class&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;AppTest.hx:101: 459600 tests / 18s = 25533.33333 tests/s&lt;br /&gt;AppTest.hx:101: 459600 tests / 17s = 27035.29412 tests/s&lt;br /&gt;AppTest.hx:101: 459600 tests / 17s = 27035.29412 tests/s&lt;br /&gt;AppTest.hx:101: 459600 tests / 17s = 27035.29412 tests/s&lt;br /&gt;AppTest.hx:101: 459600 tests / 18s = 25533.33333 tests/s&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Average is 26434.509804. 26434.509804/13231.738096 = 1.99781084028493908605. &lt;br /&gt;&lt;br /&gt;Damn! Of course it comes at the cost of a new type, but still. &lt;br /&gt;&lt;br /&gt;So pretty, happy, but still a little concerned about this:&lt;br /&gt;&lt;pre&gt;var edge1 = threePt();&lt;br /&gt;var edge2 = threePt();&lt;br /&gt;var tvec = threePt();&lt;br /&gt;var pvec = threePt();&lt;br /&gt;var qvec = threePt();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That's a lot of memory allocation madness... One optimization I tried was to move the declarations to where they are actually used... not much difference... &lt;br /&gt;&lt;br /&gt;What about passing in a workspace? This bumped up to 28725 for an improvement of 8%, but doesn't really seem worth the bother. &lt;br /&gt;&lt;br /&gt;So that's the good news... now the bad news...&lt;br /&gt;&lt;pre&gt;ERR: AppTest.hx:48(tests.AppTest.randomTriangle) - expected '-0.206685315' but was '0.4077964499'&lt;/pre&gt;&lt;br /&gt;Happily, it turned out to be a red herring from the refactoring of the test itself:&lt;br /&gt;&lt;pre&gt;assertEquals( cul.x, non.y );&lt;/pre&gt;&lt;br /&gt;should have been (and now is)&lt;br /&gt;&lt;pre&gt;assertEquals( cul.x, non.x );&lt;/pre&gt;&lt;br /&gt;Nutty!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-6341266453112354413?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/6341266453112354413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/01/refactoring-safety-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/6341266453112354413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/6341266453112354413'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/01/refactoring-safety-net.html' title='refactoring safety net'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-8141631656272142449</id><published>2009-01-16T07:52:00.000-08:00</published><updated>2009-01-16T07:57:33.460-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='movies'/><title type='text'>Finding the Twilight Samurai</title><content type='html'>I woke up this morning thinking of an oddly disturbing movie I saw a couple of years ago.&lt;br /&gt;&lt;br /&gt;It's about this this samurai who is living right around the poverty line. A widower, he supports his daughters and elderly mother making extra money building and selling cricket cages to the local villagers.&lt;br /&gt;&lt;br /&gt;In Meiji Japan, this sort of activity is borderline illegal due to a  the caste system so it's a little sketchy.&lt;br /&gt;&lt;br /&gt;Then one day, in the middle of barely being able to keep his family alive the leader of his clan shows up and says: "I need you to go kill this guy."&lt;br /&gt;&lt;br /&gt;I googled on:  samurai movie cricket cage widower&lt;br /&gt;&lt;br /&gt;Which led me to:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://articles.latimes.com/2004/may/02/entertainment/ca-cheng2"&gt;Play it...&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.imdb.com/title/tt0351817/"&gt;Tasogare Seibei ("Twilight" Seibei)&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Looking at the role of the samurai in a very narrow, mercenary sense, the appeal of risking your life in exchange for a position of authority and respect makes a certain sort of epicurean sense.&lt;br /&gt;&lt;br /&gt;Watching this movie, I felt compelled to ask: why is he willing to risk his life and the life of his family for people who have really given him nothing in exchange?&lt;br /&gt;&lt;br /&gt;Or course, the answer is honor. In this film, it is a rare commodity with a very odd exchange rate.&lt;br /&gt;&lt;br /&gt;Just like in real life.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-8141631656272142449?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/8141631656272142449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/01/finding-twilight-samurai.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8141631656272142449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8141631656272142449'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/01/finding-twilight-samurai.html' title='Finding the Twilight Samurai'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-3632463176943864027</id><published>2009-01-06T17:18:00.000-08:00</published><updated>2009-01-06T17:28:39.754-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stickman'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='physaxe'/><title type='text'>stickman physaxe</title><content type='html'>So I was reading about &lt;a href="http://ncannasse.fr/blog/one_physaxe_example"&gt;physaxe 1.2&lt;/a&gt; and thought it would be fun to have some more stickman action leveraging it.&lt;br /&gt;&lt;br /&gt;The demo I throw together is mostly from code ripped off from the original post and little bit of stuff to make the "springs":&lt;br /&gt;&lt;br /&gt;Move the mouse around to move gravity and click anywere to add some junk:&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://brianin3d.googlepages.com/phystickman_standalone.html" width="640" height="480"&gt;&lt;br /&gt;&lt;a href="http://brianin3d.googlepages.com/phystickman.html"&gt;click&lt;/a&gt;&lt;br /&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Usage is something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var a = body( 50, 40 );&lt;br /&gt;var b = body( 50, 140 );&lt;br /&gt;var j = new DistanceJoint( a, b );&lt;br /&gt;&lt;br /&gt;world.addBody( a );&lt;br /&gt;world.addBody( b );&lt;br /&gt;world.addJoint( j );&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It is not integrated  into the physaxe code right, cuz I had to loop over my joints when I stepped the world.&lt;br /&gt;&lt;br /&gt;The interesting piece of the "DistanceJoint" look like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public override function preStep( invDt : Float ) {&lt;br /&gt;    var currentDistance = dist( b1, b2 );&lt;br /&gt;    if ( 0 != currentDistance ) {&lt;br /&gt;&lt;br /&gt;        var diff = ( currentDistance - this.distance ) / currentDistance;&lt;br /&gt;        var xdiff = ( b2.x - b1.x ) * diff;&lt;br /&gt;        var ydiff = ( b2.y - b1.y ) * diff;&lt;br /&gt;&lt;br /&gt;        b1.v.x += xdiff * 0.5;&lt;br /&gt;        b2.v.x -= xdiff * 0.5;&lt;br /&gt;&lt;br /&gt;        b1.v.y += ydiff * 0.5;&lt;br /&gt;        b2.v.y -= ydiff * 0.5;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It doesn't take into account the relative mass of the bodies but that should be pretty straight forward. &lt;br /&gt;&lt;br /&gt;It should be enough for stickmen, cloth, strings, etc.&lt;br /&gt;&lt;br /&gt;If you are interested, you can find the &lt;a href="http://code.google.com/p/brianin3d-phystickman/"&gt;code&lt;/a&gt; here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-3632463176943864027?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/3632463176943864027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/01/stickman-physaxe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3632463176943864027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/3632463176943864027'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/01/stickman-physaxe.html' title='stickman physaxe'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-4053033136478758979</id><published>2009-01-02T14:40:00.001-08:00</published><updated>2009-01-02T15:12:31.287-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virtual plants'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='model'/><category scheme='http://www.blogger.com/atom/ns#' term='vertlets'/><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><category scheme='http://www.blogger.com/atom/ns#' term='flowers'/><title type='text'>segmented flowers</title><content type='html'>So... let me start off a little differently by saying: I'm not really all that thrilled with how this came out.&lt;br /&gt;&lt;br /&gt;The basic idea was to model plants, flowers, as vertlet-based segments using distances constraints for each segment. In order to keep the plants upright, I added a new a "height constraint" to keep each vertlet a certain amount above the ground. &lt;br /&gt;&lt;br /&gt;Additionally I rooted each plant's base point so it wouldn't wander off.&lt;br /&gt;&lt;br /&gt;Next, I added rain by modeling each drop as a vertlet and testing it's previous and current coordinates again each segment (see &lt;a href="http://brianin3d.blogspot.com/2009/01/2d-line-intersetion-test.html"&gt;below&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Here are the results:&lt;br /&gt;&lt;iframe src="http://brianin3d.googlepages.com/weeds.html" width="660" height="500"&gt;&lt;br /&gt;Sorry for the iframe... try &lt;a href="http://brianin3d.googlepages.com/weeds.html"&gt;this&lt;/a&gt; instead...&lt;br /&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;You can click to toggle the rain. I think it might be improved using a better design for the plants (eg: that branching tree algorithm). &lt;br /&gt;&lt;br /&gt;This partially scratched the itch I had to model dynamic plants, but not quite... Hopefully I'll turn up some more information on how to do properly at some point. &lt;br /&gt;&lt;br /&gt;I think angular constraints might work... &lt;br /&gt;&lt;br /&gt;Anyway, if you are interested, the &lt;a href="http://code.google.com/p/brianin3d-weeds/source/checkout"&gt;code&lt;/a&gt; is available for whatever you like.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-4053033136478758979?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/4053033136478758979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/01/segmented-flowers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4053033136478758979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4053033136478758979'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/01/segmented-flowers.html' title='segmented flowers'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-9215160574159974722</id><published>2009-01-02T14:06:00.000-08:00</published><updated>2009-02-11T13:13:10.794-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='line intesection'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='2d'/><title type='text'>2d line intersection test</title><content type='html'>Once upon a time, long, long ago... I wanted to find out where 2 line segments intersected in 2d. &lt;br /&gt;&lt;br /&gt;I played with rise over run and all that dumb crap till I finally found somebuddy who had the math-magic I was looking for.&lt;br /&gt;&lt;br /&gt;Here it is translated to haxe:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public static function intersectionTime(&lt;br /&gt;      line_0_x0:Float, line_0_y0:Float, line_0_x1:Float, line_0_y1:Float&lt;br /&gt;    , line_1_x0:Float, line_1_y0:Float, line_1_x1:Float, line_1_y1:Float&lt;br /&gt;) {&lt;br /&gt;    var line_0_xdiff = line_0_x1 - line_0_x0;&lt;br /&gt;    var line_0_ydiff = line_0_y1 - line_0_y0;&lt;br /&gt;&lt;br /&gt;    var line_1_xdiff = line_1_x1 - line_1_x0;&lt;br /&gt;    var line_1_ydiff = line_1_y1 - line_1_y0;&lt;br /&gt;&lt;br /&gt;    var line_1_normal_x = line_1_ydiff;&lt;br /&gt;    var line_1_normal_y = -line_1_xdiff;&lt;br /&gt;    var l2 = (&lt;br /&gt;        line_1_normal_x * line_1_normal_x&lt;br /&gt;        +&lt;br /&gt;        line_1_normal_y * line_1_normal_y&lt;br /&gt;    );&lt;br /&gt;    if ( 0 != l2 ) {&lt;br /&gt;        l2 = Math.sqrt( l2 );&lt;br /&gt;        line_1_normal_x /= l2;&lt;br /&gt;        line_1_normal_y /= l2;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    var denominator = (&lt;br /&gt;        -line_1_normal_x * line_0_xdiff&lt;br /&gt;        -line_1_normal_y * line_0_ydiff&lt;br /&gt;    );&lt;br /&gt;&lt;br /&gt;    var t = -1.0;&lt;br /&gt;    if ( 0 != denominator ) {&lt;br /&gt;        var numerator = ( 0&lt;br /&gt;            + line_1_normal_x * ( line_0_x0 - line_1_x0 )&lt;br /&gt;            + line_1_normal_y * ( line_0_y0 - line_1_y0 )&lt;br /&gt;        );&lt;br /&gt;        t = numerator / denominator;&lt;br /&gt;    }&lt;br /&gt;    return t;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I'm sure you can find some explanation of what it does and why it works, but sometimes... don't you just wanna rip off code? &lt;br /&gt;&lt;br /&gt;"So what's the deal?" you ask? Fair enuff. You pass it the end points for two line segments and it returns where along the first segment the intersection would occur (-1 means never, sorry).&lt;br /&gt;&lt;br /&gt;If it is between 0 and 1, that means it occurred some where along the first segment. &lt;br /&gt;&lt;br /&gt;If you want to see if the intersection (or collision) occurred on both segments, you can then call with the segment orders reversed to see where on the other segment it hit ala:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var t_0 = App.intersectionTime(&lt;br /&gt;    line_0_x0, line_0_y0, line_0_x1, line_0_y1&lt;br /&gt;    ,&lt;br /&gt;    line_1_x0, line_1_y0, line_1_x1, line_1_y1&lt;br /&gt;);&lt;br /&gt;var t_1 = App.intersectionTime(&lt;br /&gt;    line_1_x0, line_1_y0, line_1_x1, line_1_y1&lt;br /&gt;    ,&lt;br /&gt;    line_0_x0, line_0_y0, line_0_x1, line_0_y1&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;var hit_on_0 = ( t_0 &gt;= 0 &amp;&amp; t_0 &lt;= 1 );&lt;br /&gt;var hit_on_1 = ( t_1 &gt;= 0 &amp;&amp; t_1 &lt;= 1 );&lt;br /&gt;var real_hit = hit_on_0 &amp;&amp; hit_on_1;&lt;br /&gt;&lt;br /&gt;var x = line_0_x0 + ( line_0_x1 - line_0_x0 ) * t_0;&lt;br /&gt;var y = line_0_y0 + ( line_0_y1 - line_0_y0 ) * t_0;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note if "real_hit" is true then x,y will be the coordinates for the actual intersection, otherwise it is where it would have hit on the first line (line_0).&lt;br /&gt;&lt;br /&gt;Here you can see it in action.&lt;br /&gt;&lt;iframe src="http://brianin3d.googlepages.com/lineTest.html" width="660" height="500"&gt;&lt;br /&gt;Sorry for the iframe... try &lt;a href="http://brianin3d.googlepages.com/lineTest.html"&gt;this&lt;/a&gt; instead...&lt;br /&gt;&lt;/iframe&gt;&lt;br /&gt;Grab the &lt;a href="http://code.google.com/p/brianin3d-weeds/source/checkout"&gt;code&lt;/a&gt; here and look at &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;./us/versus/them/weeds/App.hx&lt;br /&gt;./us/versus/them/weeds/LineTest.hx&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's not the most optimized way to do things since there is some duplicated computation, but I know you don't wan me to have all the fun! &lt;br /&gt;&lt;br /&gt;BTW.... does anyone know when/why these google turkeys stopped allowing the embed tag? Sheesh... Numbskulls! Yes... I am looking it in the mouth...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-9215160574159974722?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/9215160574159974722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2009/01/2d-line-intersetion-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/9215160574159974722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/9215160574159974722'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2009/01/2d-line-intersetion-test.html' title='2d line intersection test'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-1053783053664173438</id><published>2008-12-25T16:19:00.001-08:00</published><updated>2008-12-25T16:32:19.786-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svg'/><category scheme='http://www.blogger.com/atom/ns#' term='dumb'/><title type='text'>question: is svg path data definition retarded?</title><content type='html'>Imagine you were going to write an XML description of a polygon type structure... Wouldn't you do something like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;poly&amp;gt;&lt;br /&gt; &amp;lt;pt x=&amp;quot;100&amp;quot; y=&amp;quot;100&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;pt x=&amp;quot;300&amp;quot; y=&amp;quot;100&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;pt x=&amp;quot;200&amp;quot; y=&amp;quot;300&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/poly&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There are probably a lot of variations, but wouldn't it look something like that? &lt;br /&gt;&lt;br /&gt;I mean... it's kinda a no brainer, right? Sort of hard to screw up, though there are probably a lot of ways to get it right.&lt;br /&gt;&lt;br /&gt;If you were handing this out as a homework assignment in an XML 101 class, what grade you would give someone who came up with something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;path d=&amp;quot;M 100 100 L 300 100 L 200 300 z&amp;quot;/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;What if they went on to tell you, you could also write it in any of the following acceptable forms:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;path d=&amp;quot;M 100 100 L 300 100 L 200 300 z&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;path d=&amp;quot;M 100,100 L 300,100 L 200,300 z&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;path d=&amp;quot;M 100 100L300 100L200 300 z&amp;quot;/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Would you think they were being smart by saving space? &lt;br /&gt;&lt;br /&gt;What if they told you:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;the "M" meant "move to the absolute position"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;the "m" meant "the point which relative to the last point"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;the "L" meant "draw a line to the absolute position"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;the "l" meant "draw a line the point which relative to the last point"&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Would you think they were really smart? Or would you think they were pretty dumb?&lt;br /&gt;&lt;br /&gt;Would you recommend it for inclusion in the &lt;a href="http://www.w3.org/TR/SVG/paths.html#PathData"&gt;W3 SVG standard&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;I'm just wondering... cuz to me... it seems pretty stupid. &lt;br /&gt;&lt;br /&gt;Way to drop the ball... I really would not have thought someone could screw that up so badly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-1053783053664173438?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/1053783053664173438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/12/question-is-svg-path-data-definition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/1053783053664173438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/1053783053664173438'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/12/question-is-svg-path-data-definition.html' title='question: is svg path data definition retarded?'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-7411382981276522387</id><published>2008-12-15T09:30:00.000-08:00</published><updated>2008-12-15T11:06:29.668-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><category scheme='http://www.blogger.com/atom/ns#' term='inline'/><title type='text'>a point in haxe: inline ftw!</title><content type='html'>A while back, I talked about how delineating between structures and objects could have some &lt;a href="http://brianin3d.wordpress.com/2008/07/12/making-a-point…riented-designmaking-a-point-about-object-oriented-design/"&gt;performance implications&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Since then I have periodically doubted the conclusions I drew from my observations. My results still indicate that for Java with the JVM I used, structuring the code into a point structure and implementing the operations as a collection of static operators does make for a significant performance increase.&lt;br /&gt;&lt;br /&gt;What I came to doubt was the universality of this observation.&lt;br /&gt;&lt;br /&gt;Specifically, I wanted to see if this design methodology also payed off with &lt;a href="http://haxe.org"&gt;haxe&lt;/a&gt; or if it was more of a JVM implementation artifact.&lt;br /&gt;&lt;br /&gt;To test it, I wrote 3 different implementation of a "point" class:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;typedef TypedPoint = {&lt;br /&gt;    public var x : Float;&lt;br /&gt;    public var y : Float;&lt;br /&gt;    public var z : Float;&lt;br /&gt;}&lt;br /&gt;class TypedPointOps {&lt;br /&gt;    public inline static function add( dest:TypedPoint, a:TypedPoint, b:TypedPoint ) : TypedPoint {&lt;br /&gt;        dest.x = a.x + b.x;&lt;br /&gt;        dest.y = a.y + b.y;&lt;br /&gt;        dest.z = a.z + b.z;&lt;br /&gt;        return dest;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Point {&lt;br /&gt;    public var x : Float;&lt;br /&gt;    public var y : Float;&lt;br /&gt;    public var z : Float;&lt;br /&gt;&lt;br /&gt;    public function new( ?x:Float, ?y:Float, ?z:Float ) {&lt;br /&gt;        this.assign( x, y, z );&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public function assign( ?x:Float, ?y:Float, ?z:Float ) : Point {&lt;br /&gt;        this.x = x;&lt;br /&gt;        this.y = y;&lt;br /&gt;        this.z = z;&lt;br /&gt;        return this;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public function add( a:Point, b:Point ) : Point {&lt;br /&gt;        this.x = a.x + b.x;&lt;br /&gt;        this.y = a.y + b.y;&lt;br /&gt;        this.z = a.z + b.z;&lt;br /&gt;        return this;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I wrote another version called "InlinePoint" which is just like "Point", but used the "inline" keyword.&lt;br /&gt;&lt;br /&gt;Here is the result:&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://brianin3d.googlepages.com/pointsDemo.swf" width="300" height="200" type= "application/x-shockwave-flash"&gt;&lt;br /&gt;&lt;/embed&gt;&lt;br /&gt;&lt;br /&gt;It basicly "adds" two points together 1 million times.&lt;br /&gt;&lt;br /&gt;Here is the breakdown:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;point  : 0.019s&lt;br /&gt;inline : 0.010s&lt;br /&gt;typed  : 1.355s&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see, the object version using the "inline" keyword is extremely fast compared to the alternatives. &lt;br /&gt;&lt;br /&gt;In testing, I used the neato &lt;i&gt;flashplayer&lt;/i&gt; command line tool that came as part of the &lt;a href="http://labs.adobe.com/technologies/flex/flexbuilder_linux/"&gt;Adobe Flex Builder Linux Public Alpha&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% flashplayer pointsDemo.swf&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For some reason it shows the "point" time as "0.149s"... weird... The "typed" time was also pretty different... eh...&lt;br /&gt;&lt;br /&gt;So... why did I bother? Now I know I can port my JS 3D library straight to haxe without any major refactoring! :-D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-7411382981276522387?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/7411382981276522387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/12/point-in-haxe-inline-ftw.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/7411382981276522387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/7411382981276522387'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/12/point-in-haxe-inline-ftw.html' title='a point in haxe: inline ftw!'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-8086767017861311692</id><published>2008-12-08T09:09:00.000-08:00</published><updated>2008-12-08T18:19:23.334-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fallout 3'/><category scheme='http://www.blogger.com/atom/ns#' term='calculator'/><title type='text'>Fallout 3 S.P.E.C.I.A.L Calculator</title><content type='html'>&lt;a href="http://fallout.bethsoft.com/"&gt;Fallout 3&lt;/a&gt; is super-hoopy! And you are nuts not to devote tons of free time to it!&lt;br /&gt;&lt;br /&gt;Here is some stuff on character creation gathered up with a lame calculator... No warrantees... don't sue me!&lt;br /&gt;&lt;br /&gt;SPECIAL is 7 attributes starting with 5 points, with an extra 5 to spread around.. So... 40 points in all:&lt;br /&gt;&lt;br /&gt;&lt;iframe src ="http://brianin3d.googlepages.com/fallout3_special.html" width="299px" height="333px"&gt;&lt;br /&gt;  &lt;p&gt;Sorry... I had to use a cheese iframe.... &lt;/p&gt;&lt;br /&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;If that doesn't work, try hitting it &lt;a href="http://brianin3d.googlepages.com/fallout3_special.html"&gt;directly&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Even works under in (lame olde) IE... Use FF.&lt;br /&gt;&lt;br /&gt;Here is some random advice I culled from &lt;a name="#doodz"&gt;some guys who actually put in the time to really document this stuff&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Since it's a mashup and different builds are different (ya reckon?), a lot of this is contradictory...&lt;br /&gt;&lt;br /&gt;The following notes are culled from those links and are pretty much the words of the original authors.&lt;br /&gt;&lt;h3&gt;Strength&lt;/h3&gt;&lt;br /&gt;I would suggest never going lower than three, and never going higher than five.&lt;br /&gt;&lt;br /&gt;every type of character needs [..] inventory, [..] recommended that Strength be at least a 5&lt;br /&gt;&lt;h3&gt;Perception&lt;/h3&gt;&lt;br /&gt;I wouldn't say a high level of Perception is desperately needed, but it will make your life easier. Put at least one point in there, if not two or three.&lt;br /&gt;&lt;br /&gt;Perception needs to be brought to 6 eventually as a Perk prerequisite&lt;br /&gt;&lt;h3&gt;Endurance&lt;/h3&gt;&lt;br /&gt;If you want to use [big guns or unarmed ...] up to seven or eight. Otherwise, [...] drop it down to four or so&lt;br /&gt;&lt;h3&gt;Charisma&lt;/h3&gt;&lt;br /&gt;it's actually quite important if you want to be able to talk your way out of situations, and definitely worth putting two or three points in.&lt;br /&gt;&lt;br /&gt;you can take Charisma down to 1 if you don't mind getting slightly worse prices on buying and selling and having little chance to use Speech skill.&lt;br /&gt;&lt;h3&gt;Intelligence&lt;/h3&gt;&lt;br /&gt;Note that almost all characters in Fallout 3 should have 9-10 Intelligence&lt;br /&gt;&lt;h3&gt;Agility&lt;/h3&gt;&lt;br /&gt;Unless it's just not in-line with how you want your character to be, push it up to eight.&lt;br /&gt;&lt;h3&gt;Luck&lt;/h3&gt;&lt;br /&gt;If you don't care about any perks related to Luck, you could drain Luck to support other attributes. Unlike previous Fallout games, a low level of Luck won't cause any directly negative effects.&lt;br /&gt;&lt;br /&gt;maxing your Agility and Intelligence early, with Luck following afterwards.&lt;br /&gt;&lt;h3&gt;&lt;a name="#doodz"&gt;Linkz&lt;/a&gt;&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.giantbomb.com/guides/attribute-and-skill-guide/488/"&gt;http://www.giantbomb.com/guides/attribute-and-skill-guide/488/&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.atomicgamer.com/article.php?id=682"&gt;http://www.atomicgamer.com/article.php?id=682&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.mahalo.com/Fallout_3_Walkthrough"&gt;http://www.mahalo.com/Fallout_3_Walkthrough&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Haven't incorporated it yet, but http://www.gamefaqs.com/boards/genmessage.php?board=939932&amp;topic=46820081 is really interesting. Google search for "fallout 3 attributes build" turns up some good stuff&lt;br /&gt;&lt;br /&gt;Sorry I'm too lazy to attribute the quotes to the right source. This is mostly for me to crib from... You should real the full texts, it's worth it.&lt;br /&gt;&lt;br /&gt;I know my calculator looks pretty dumb... the real one looks like &lt;a href="http://brianin3d.googlepages.com/fallout-3-scan-3.jpg"&gt;this&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-8086767017861311692?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/8086767017861311692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/12/fallout-3-special-calculator.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8086767017861311692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8086767017861311692'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/12/fallout-3-special-calculator.html' title='Fallout 3 S.P.E.C.I.A.L Calculator'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-2012490454638272295</id><published>2008-12-02T17:49:00.001-08:00</published><updated>2008-12-02T18:11:54.604-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svg'/><category scheme='http://www.blogger.com/atom/ns#' term='transform'/><category scheme='http://www.blogger.com/atom/ns#' term='xsl'/><category scheme='http://www.blogger.com/atom/ns#' term='matrix'/><title type='text'>svg transform matrix</title><content type='html'>Oh what fun you can have with &lt;a href="http://www.w3.org/TR/SVG/"&gt;svg&lt;/a&gt;! &lt;br /&gt;&lt;br /&gt;I'm working on a little flash game and I wanted to design the boards in inkscape, save as &lt;a href="http://www.w3.org/TR/SVG/"&gt;svg&lt;/a&gt;, transform them to my xml format and load 'em up... but...&lt;br /&gt;&lt;br /&gt;Have you seen a one of these yet?&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;rect&lt;br /&gt;    id=&amp;quot;rect3199&amp;quot;&lt;br /&gt;    width=&amp;quot;31.406677&amp;quot; &lt;br /&gt;    height=&amp;quot;189.16795&amp;quot;&lt;br /&gt;    x=&amp;quot;712.43353&amp;quot; &lt;br /&gt;    y=&amp;quot;-707.71057&amp;quot;&lt;br /&gt;    transform=&amp;quot;matrix(0,1,-1,0,0,0)&amp;quot; &lt;br /&gt;/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;According to the &lt;a href="&lt;br /&gt;http://www.w3.org/TR/SVG/coords.html#TransformMatrixDefined"&gt;spec&lt;/a&gt;, the syntax is &lt;b&gt;matrix(a,b,c,d,e,f)&lt;/b&gt; which get laid out in matrix form like this:&lt;br /&gt;&lt;img src="http://www.w3.org/TR/SVG/images/coords/Matrix.png"/&gt;&lt;br /&gt;if you guessed that, my hat is off to you! To me it is just bizarre...&lt;br /&gt;&lt;br /&gt;OK, so what... matrix math rules out the xsl, right? Wrong...&lt;br /&gt;&lt;br /&gt;Assuming you can pull out the &lt;b&gt;a,b,c,d,e,f&lt;/b&gt; from that kooky string... then you can do this to apply the transformation matrix:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;xsl:attribute name=&amp;quot;x&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:value-of select=&amp;quot;$x * $a + $y * $c + $e&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt; &amp;lt;xsl:attribute name=&amp;quot;y&amp;quot;&amp;gt;&lt;br /&gt;     &amp;lt;xsl:value-of select=&amp;quot;$x * $b + $y * $d + $f&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You &lt;i&gt;have to&lt;/i&gt; do the same thing for width and height, too...&lt;br /&gt;&lt;br /&gt;Happily, I had some old point * matrix implementation to pull from... if you don't have one handy... see above...&lt;br /&gt;&lt;br /&gt;:-D&lt;br /&gt;&lt;br /&gt;If you read the spec, you will see a bunch of other stuff I didn't bother with cuz I don't need it. Sorry...&lt;br /&gt;&lt;br /&gt;Uhhmmm.... and I only ever see the case &lt;i&gt;transform="matrix(0,1,-1,0,0,0)"&lt;/i&gt; so I hardcode the values for a,b,c,d,e,f,g like so&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;xsl:variable name=&amp;quot;a&amp;quot; select=&amp;quot;'0'&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;xsl:variable name=&amp;quot;b&amp;quot; select=&amp;quot;'1'&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;xsl:variable name=&amp;quot;c&amp;quot; select=&amp;quot;'-1'&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;xsl:variable name=&amp;quot;d&amp;quot; select=&amp;quot;'0'&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;xsl:variable name=&amp;quot;e&amp;quot; select=&amp;quot;'0'&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;xsl:variable name=&amp;quot;f&amp;quot; select=&amp;quot;'0'&amp;quot;/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Yeah... I know...&lt;br /&gt;&lt;br /&gt;In case it helps, here is the &lt;a href="http://brianin3d.googlepages.com/board.xsl"&gt;board.xsl&lt;/a&gt; as it stands right now...&lt;br /&gt;&lt;br /&gt;btw: &lt;i&gt;alias xencode="sed 's/&amp;lt;/\&amp;amp;lt;/g;s/&amp;gt;/\&amp;amp;gt;/g;s/\"/\&amp;quot;/g'"&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-2012490454638272295?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/2012490454638272295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/12/svg-transform-matrix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2012490454638272295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2012490454638272295'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/12/svg-transform-matrix.html' title='svg transform matrix'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-8442144264204095248</id><published>2008-12-02T14:21:00.000-08:00</published><updated>2008-12-02T14:32:05.288-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wordpress'/><category scheme='http://www.blogger.com/atom/ns#' term='blogspot'/><category scheme='http://www.blogger.com/atom/ns#' term='blogging'/><title type='text'>why I left wordpress</title><content type='html'>Oh, what a heavy heart! &lt;br /&gt;I freakin' &amp;#x2764;'d &lt;a href="http://brianin3d.wordpress.com/"&gt;wordpress&lt;/a&gt;, but ultimately I had to move to &lt;a href="http://brianin3d.blogspot.com/"&gt;blogspot.com&lt;/a&gt; here's why:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;adsense: &lt;a href="http://brianin3d.wordpress.com/"&gt;wordpress&lt;/a&gt; doesn't allow it, &lt;a href="http://brianin3d.blogspot.com/"&gt;blogspot.com&lt;/a&gt; does.&lt;br /&gt;&lt;li&gt;embed: &lt;a href="http://brianin3d.blogspot.com/"&gt;blogspot.com&lt;/a&gt; let's me put flash content in my blog. Since I blog about &lt;a href="http://haxe.org"&gt;haxe&lt;/a&gt; a lot, this was a real bummer&lt;/li&gt;&lt;br /&gt;&lt;li&gt;javascript: I also do some crazy stuff with js and I needs to demo stuff&lt;/li&gt;&lt;br /&gt;&lt;li&gt;css: I liked being able to make pre tags look like terminals&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;I bummed, really, bummed. Even adding the vaulted &lt;a href="http://www.google.com/analytics/"&gt;google analytics&lt;/a&gt; I don't have a nice charts and graphs...&lt;br /&gt;&lt;br /&gt;And I'm going to have to relink all my projects... woe! woe is me!&lt;br /&gt;&lt;br /&gt;I hate to do it, but ... sometimes things are just like that...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-8442144264204095248?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/8442144264204095248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/12/why-i-left-wordpress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8442144264204095248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/8442144264204095248'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/12/why-i-left-wordpress.html' title='why I left &lt;a href=&quot;http://brianin3d.wordpress.com/&quot;&gt;wordpress&lt;/a&gt;'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-4863059062780095419</id><published>2008-12-02T14:16:00.000-08:00</published><updated>2008-12-02T19:04:07.476-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jar'/><category scheme='http://www.blogger.com/atom/ns#' term='jar-czar'/><category scheme='http://www.blogger.com/atom/ns#' term='sha1sum'/><title type='text'>find jars by sha1sum :  xml.jar-czar.com</title><content type='html'>Ever have a mystery jar? Ever taken over an ant project and need to find what version of log4j the chuckle-heads were using so you can port the project to maven?&lt;br /&gt;&lt;br /&gt;Check it out... &lt;a href="http://www.jar-czar.com"&gt;jar-czar&lt;/a&gt; can help... Converting from an sha1sum to a url is ez and will provide you with the version info you needs. &lt;br /&gt;&lt;br /&gt;Here is some really simple javascript... to pull form an input called 'sha1sum' &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;javascript:( function() {&lt;br /&gt;document.location = (&lt;br /&gt;    document.getElementById( 'sha1sum' ).value&lt;br /&gt;        .replace( /(.*)/, '$1 $1' )&lt;br /&gt;        .replace( /^(...)/, '$1x' )&lt;br /&gt;        .replace( /(x...)/, '$1x' )&lt;br /&gt;        .replace( / /, 'x' )&lt;br /&gt;        .replace( /x/g, '/' )&lt;br /&gt;        .replace( /(.*)/, 'http://xml.jar-czar.com/pub/$1-jar-czar.xml' )&lt;br /&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;as seen on &lt;a href="http://www.jar-czar.com/"&gt;http://www.jar-czar.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is the shell script way:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;% sha1sum jcr-1.0.jar&lt;br /&gt;86b984b459383c8d4ba911785afef426be8fca7e&lt;br /&gt;% sha1sum *.jar | sed 's,\([^ \t]*\) *.*,\1 \1,;s,^...,&amp;amp;/,;s,/...,&amp;amp;/,;s, ,/,;s,.*,http://xml.jar-czar.com/pub/&amp;amp;-jar-czar.xml,'&lt;br /&gt;&lt;a href="http://xml.jar-czar.com/pub/86b/984/b459383c8d4ba911785afef426be8fca7e/86b984b459383c8d4ba911785afef426be8fca7e-jar-czar.xml"&gt;http://xml.jar-czar.com/pub/86b/984/b459383c8d4ba911785afef426be8fca7e/86b984b459383c8d4ba911785afef426be8fca7e-jar-czar.xml&lt;/a&gt;&lt;br /&gt;% alias sha1_to_jar_car="sed 's,\([^ \t]*\) *.*,\1 \1,;s,^...,&amp;amp;/,;s,/...,&amp;amp;/,;s, ,/,;s,.*,http://xml.jar-czar.com/pub/&amp;amp;-jar-czar.xml,'"&lt;br /&gt;% sha1sum *.jar | sha1_to_jar_car&lt;br /&gt;&lt;a href="http://xml.jar-czar.com/pub/86b/984/b459383c8d4ba911785afef426be8fca7e/86b984b459383c8d4ba911785afef426be8fca7e-jar-czar.xml"&gt;http://xml.jar-czar.com/pub/86b/984/b459383c8d4ba911785afef426be8fca7e/86b984b459383c8d4ba911785afef426be8fca7e-jar-czar.xml&lt;/a&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/862393876629049158-4863059062780095419?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/4863059062780095419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/12/find-jars-by-sha1sum-xmljar-czarcom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4863059062780095419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4863059062780095419'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/12/find-jars-by-sha1sum-xmljar-czarcom.html' title='find jars by sha1sum :  &lt;a href=&quot;http://xml.jar-czar.com/browse/alpha/a/a.page00000001.xml&quot;&gt;xml.jar-czar.com&lt;/a&gt;'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-7061870412153157470</id><published>2008-11-25T07:30:00.000-08:00</published><updated>2008-11-25T08:05:23.860-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>better automagic java collections</title><content type='html'>A few years ago, I started writing java code like this to automagically initialize collections of junk and stuff:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;private Collection&lt; String &gt; values_;&lt;br /&gt;&lt;br /&gt;public Collection&lt; String &gt; getValues() {&lt;br /&gt;    return (&lt;br /&gt;        null == this.values_ &lt;br /&gt;        ? this.values_ = new ArrayList&lt;&gt;() &lt;br /&gt;        : this.values_&lt;br /&gt;    );&lt;br /&gt;}&lt;br /&gt;  &lt;br /&gt;public void setValues( Collection&lt; String &gt; values ) {&lt;br /&gt;    this.values_ = values;&lt;br /&gt;}  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Nowadays you can find a lot of code like this in places like JAXB generated code, etc. Where you want the consumer of the class to be able to start doing stuff like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    Wizzle wuzzle = new Wizzle();&lt;br /&gt;    wuzzle.getValues().add( "ok" );&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But there are a few problems with this. For one thing it assumes that there is no value to having the &lt;i&gt;getValues&lt;/i&gt; call return null. Which impacts code like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int sum = 0;&lt;br /&gt;int count = 0;&lt;br /&gt;for ( Wizzle wuzzle : wuzzles ) {&lt;br /&gt;    if( null != wuzzle.getValues() ) {&lt;br /&gt;        sum += wuzzle.getValues().size;&lt;br /&gt;        count++;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;if ( 0 != count ) {&lt;br /&gt;    System.out.println( &lt;br /&gt;        "average is " &lt;br /&gt;        + ( sum / ( double ) count ) &lt;br /&gt;    );&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Of course, I also suddenly have created a bunch of ArrayLists I really don't need.&lt;br /&gt;&lt;br /&gt;Now you might say: so what? And OK, but the fact is, a collection being unset (ie: null) is used in a fair number of places to perform logic or calculations.&lt;br /&gt;&lt;br /&gt;Notice how the coolio automagic collection trick throws off my averages in this code that assumes &lt;i&gt;null == wuzzle.getValues()&lt;/i&gt; mean "undefined."&lt;br /&gt;&lt;br /&gt;Now I am writing (ok, generating) code like this instead:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;private Collection&lt; String &gt; values_;&lt;br /&gt;&lt;br /&gt;public Collection&lt; String &gt; getValues() {&lt;br /&gt;    return ( &lt;br /&gt;        this.valuesUnSet() &lt;br /&gt;        ? this.setNewValues() &lt;br /&gt;        : this.values_ &lt;br /&gt;    );&lt;br /&gt;}&lt;br /&gt;  &lt;br /&gt;public boolean valuesUnSet() {&lt;br /&gt;    return ( null == this.values_ );&lt;br /&gt;}&lt;br /&gt;  &lt;br /&gt;protected Collection&lt; String &gt; setNewValues() {&lt;br /&gt;    return ( this.values_ = this.newValues() );&lt;br /&gt;}&lt;br /&gt;  &lt;br /&gt;public Collection&lt; String &gt; newValues() {&lt;br /&gt;    return new ArrayList&lt; String &gt;();&lt;br /&gt;}  &lt;br /&gt;  &lt;br /&gt;public void setValues( Collection&lt; String &gt; values ) {&lt;br /&gt;    this.values_ = values;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But in order for this to really work, the code to do the average has to be changed to:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int sum = 0;&lt;br /&gt;int count = 0;&lt;br /&gt;for ( Wizzle wuzzle : Wuzzles ) {&lt;br /&gt;    if( !wuzzle.valuesUnSet() ) {&lt;br /&gt;        sum += wuzzle.getValues().size;&lt;br /&gt;        count++;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;if ( 0 != count ) {&lt;br /&gt;    System.out.println( &lt;br /&gt;        "average is " &lt;br /&gt;        + ( sum / ( double ) count ) &lt;br /&gt;    );&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The nice thing about this refactored code is that it doesn't make the assumption that "null" for a collection means uninitialized.&lt;br /&gt;&lt;br /&gt;Instead the decision as to whether or not the Collection has been initialized is left up to the model object's implementation.&lt;br /&gt;&lt;br /&gt;This approach removes a potentially dangerous assumption while allow automagic collections to be used without penalty.&lt;br /&gt;&lt;br /&gt;It is a small incremental improvement on the basic design.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-7061870412153157470?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/7061870412153157470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/11/better-automagic-java-collections.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/7061870412153157470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/7061870412153157470'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/11/better-automagic-java-collections.html' title='better automagic java collections'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-2358472214730389498</id><published>2008-11-21T13:24:00.000-08:00</published><updated>2008-11-26T11:40:50.030-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='jaxb'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><title type='text'>generating serializable classes with jaxb-maven2-plugin</title><content type='html'>So I told my pal &lt;a href="http://home.neo.rr.com/kg8rv/danny2.jpg"&gt;Danny&lt;/a&gt; about the power and the glory that is the &lt;a href="https://jaxb.dev.java.net/jaxb-maven2-plugin/"&gt;JAXB plugin for Maven2&lt;/a&gt; and the sly way you can &lt;a href="http://brianin3d.wordpress.com/2008/09/13/generating-schemas-from-sample-xml/"&gt;generate an xsd from an xml exemplar&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;He had a lot of fun then he said: "how can I make the generated classes implement serializable?"&lt;br /&gt;&lt;br /&gt;To which I responded "..."&lt;br /&gt;&lt;br /&gt;Mystery!&lt;br /&gt;&lt;br /&gt;Turns out, it is super easy! You can use an xjb file like so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;jxb:bindings &lt;br /&gt;    version="1.0" &lt;br /&gt;    xmlns:jxb="http://java.sun.com/xml/ns/jaxb"&lt;br /&gt;    xmlns:xs="http://www.w3.org/2001/XMLSchema"&lt;br /&gt;    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"&lt;br /&gt;    jxb:extensionBindingPrefixes="xjc"&lt;br /&gt;&amp;gt;&lt;br /&gt;    &amp;lt;jxb:bindings  schemaLocation="myCool.xsd"  node="/xs:schema"&amp;gt;&lt;br /&gt;        &amp;lt;jxb:globalBindings&amp;gt;&lt;br /&gt;            &amp;lt;xjc:serializable uid="-6026937020915831338"/&amp;gt;&lt;br /&gt;        &amp;lt;/jxb:globalBindings&amp;gt;&lt;br /&gt;    &amp;lt;/jxb:bindings&amp;gt;&lt;br /&gt;&amp;lt;/jxb:bindings&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I ripped this off from &lt;a href="http://www.mirthproject.org/fisheye/browse/Mirth/trunk/schemas/binding.xjb?r=6"&gt;here&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;Just dump it in yer src/main/resources directory and modify yer pom.xml to look something like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;com.sun.tools.xjc.maven2&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;maven-jaxb-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;executions&amp;gt;&lt;br /&gt;        &amp;lt;execution&amp;gt;&lt;br /&gt;            &amp;lt;goals&amp;gt;&lt;br /&gt;                 &amp;lt;goal&amp;gt;generate&amp;lt;/goal&amp;gt;&lt;br /&gt;            &amp;lt;/goals&amp;gt;&lt;br /&gt;        &amp;lt;/execution&amp;gt;&lt;br /&gt;    &amp;lt;/executions&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;        &amp;lt;generatePackage&amp;gt;com.cashcow.payme.xml&amp;lt;/generatePackage&amp;gt;&lt;br /&gt;        &amp;lt;extension&amp;gt;true&amp;lt;/extension&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The end! Go, &lt;a href="https://jaxb.dev.java.net/jaxb-maven2-plugin/"&gt;JAXB&lt;/a&gt;! Go, &lt;a href="https://jaxb.dev.java.net/jaxb-maven2-plugin/"&gt;Maven&lt;/a&gt;!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-2358472214730389498?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/2358472214730389498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/11/generating-serializable-classes-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2358472214730389498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2358472214730389498'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/11/generating-serializable-classes-with.html' title='generating serializable classes with jaxb-maven2-plugin'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-2687350065487702147</id><published>2008-11-19T18:03:00.000-08:00</published><updated>2008-11-19T18:40:38.434-08:00</updated><title type='text'>jar-czar's cse is up!</title><content type='html'>&lt;A href="http://www.google.com/coop/cse?cx=002902315913794356292%3Ahmrffe83yxc"&gt;Jar-Czar's Custom Search Engine&lt;/a&gt; is up and kicking! &lt;br /&gt;&lt;br /&gt;Give it a shot! &lt;br /&gt;&lt;br /&gt;Unfortunately... something changed on the google side and now &lt;a href="http://www.jar-czar.com/"&gt;www.jar-czar.com&lt;/a&gt; always comes back with a 404... or it shows you the google home page...&lt;br /&gt;&lt;br /&gt;So for now it's back to &lt;a href="http://jar-czar.appspot.com/"&gt;http://jar-czar.appspot.com/&lt;/a&gt;... &lt;br /&gt;&lt;br /&gt;Sigh... &amp;gt;.&amp;lt; &lt;br /&gt;&lt;br /&gt;Before I had the CSE integrated so the results were displayed in the page... have to try to get that working again, but at least it is finally working!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jar-czar.appspot.com/"&gt;&lt;img src="http://jar-czar.appspot.com/images/Coat_of_Arms_of_the_Russian_Federation-small.png"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-2687350065487702147?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/2687350065487702147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/11/jar-czars-cse-is-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2687350065487702147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/2687350065487702147'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/11/jar-czars-cse-is-up.html' title='jar-czar&apos;s cse is up!'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-796932581049257067</id><published>2008-11-17T13:57:00.000-08:00</published><updated>2008-11-17T14:32:35.348-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bresenham'/><category scheme='http://www.blogger.com/atom/ns#' term='haxe'/><title type='text'>haxe: bresenham's line drawing algorithm</title><content type='html'>Here is quick port I did of &lt;a href="http://en.wikipedia.org/wiki/Bresenham's_line_algorithm#Optimization"&gt;Bresenham's famous line drawing algorigthm&lt;/a&gt; I did in &lt;a href="http://haxe.org"&gt;haxe&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    public function bresenhamInt(&lt;br /&gt;        bitmapData : BitmapData&lt;br /&gt;        , x0 : Int&lt;br /&gt;        , y0 : Int&lt;br /&gt;        , x1 : Int&lt;br /&gt;        , y1 : Int&lt;br /&gt;        , c : UInt&lt;br /&gt;    ) {&lt;br /&gt;        var steep : Bool = Math.abs( y1 - y0 ) &gt; Math.abs( x1 - x0 );&lt;br /&gt;        var tmp : Int;&lt;br /&gt;        if ( steep ) {&lt;br /&gt;            // swap x and y&lt;br /&gt;            tmp = x0; x0 = y0; y0 = tmp; // swap x0 and y0&lt;br /&gt;            tmp = x1; x1 = y1; y1 = tmp; // swap x1 and y1&lt;br /&gt;        }&lt;br /&gt;        if ( x0 &gt; x1 ) {&lt;br /&gt;            // make sure x0 &lt; x1&lt;br /&gt;            tmp = x0; x0 = x1; x1 = tmp; // swap x0 and x1&lt;br /&gt;            tmp = y0; y0 = y1; y1 = tmp; // swap y0 and y1&lt;br /&gt;        }&lt;br /&gt;        var deltax : Int = x1 - x0;&lt;br /&gt;        var deltay : Int = Math.floor( Math.abs( y1 - y0 ) );&lt;br /&gt;        var error  : Int = Math.floor( deltax / 2 ); // this is a little hairy&lt;br /&gt;        var y      : Int = y0;&lt;br /&gt;        var ystep  : Int = if ( y0 &lt; y1 ) 1 else -1;&lt;br /&gt;        for ( x in x0 ... x1 ) {&lt;br /&gt;            if ( steep ) {&lt;br /&gt;                bitmapData.setPixel( y, x, c ) ;&lt;br /&gt;            } else {&lt;br /&gt;                bitmapData.setPixel( x, y, c );&lt;br /&gt;            }&lt;br /&gt;            error -= deltay;&lt;br /&gt;            if ( error &lt; 0 ) {&lt;br /&gt;                y = y + ystep;&lt;br /&gt;                error = error + deltax;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The &lt;a href="http://en.wikipedia.org/wiki/Bresenham's_line_algorithm#Optimization"&gt;pseudo code on wiki pedia&lt;/a&gt; made it pretty painless.&lt;br /&gt;&lt;br /&gt;Here is a little demo comparing a really crappy floating point version I did, the above and a version like the one show, but using floating point. &lt;br /&gt;&lt;br /&gt;&lt;object&gt; &lt;embed src="http://brianin3d.googlepages.com/lines.swf" quality="high" bgcolor="#FFFFFF" width="640" height="480" name="home" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" &gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;It draws 20k lines, so it takes it a few seconds depending on yer rig.&lt;br /&gt;&lt;br /&gt;You can find the source code &lt;a href="http://code.google.com/p/brianin3d-lines/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-796932581049257067?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/796932581049257067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/11/haxe-bresenhams-line-drawing-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/796932581049257067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/796932581049257067'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/11/haxe-bresenhams-line-drawing-algorithm.html' title='haxe: bresenham&apos;s line drawing algorithm'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-4399139389067197636</id><published>2008-11-16T11:49:00.000-08:00</published><updated>2008-11-16T13:05:06.143-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='neko vm'/><category scheme='http://www.blogger.com/atom/ns#' term='benchmark'/><title type='text'>is the neko vm too slow to be used?</title><content type='html'>So I've been having a lot of &lt;a href="http://haxe.org/"&gt;haxe&lt;/a&gt; fun lately, but mostly in the flash direction.&lt;br /&gt;&lt;br /&gt;But of course, &lt;a href="http://haxe.org/"&gt;haxe&lt;/a&gt; has another face, the server / fat-client side which is &lt;a href="http://nekovm.org/"&gt;neko vm&lt;/a&gt; (or php).&lt;br /&gt;&lt;br /&gt;Since I think &lt;a href="http://haxe.org/"&gt;haxe&lt;/a&gt; is neat, and I have been playing with the idea of a small abstraction layer to write stuff to use flash apis or openGL I wanted to see what the &lt;a href="http://nekovm.org/"&gt;neko vm&lt;/a&gt; was like.&lt;br /&gt;&lt;br /&gt;Well... I was a little bummed that I couldn't find anything "official", but not really surprised since it's not exacty in the top 10 list.&lt;br /&gt;&lt;br /&gt;I decided to try the olde "Sieve of Eratosthenes" test which is generally regarded as a very naive, worthless and very easy to implement benchmark.&lt;br /&gt;&lt;br /&gt;At this point you probably see where this is going...&lt;br /&gt;&lt;br /&gt;&lt;style&gt;.graph {-moz-border-radius:0.21em; border-radius: 0.2em; border: 2px solid black; background:red; height:8px; }&lt;/style&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="http://brianin3d.googlepages.com/sieve.c"&gt;sieve.c&lt;/a&gt;&lt;/td&gt; &lt;td align="right"&gt;1.542s&lt;/td&gt; &lt;td&gt;&lt;div style="width:15.4px;" class="graph"&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="http://brianin3d.googlepages.com/Sieve.java"&gt;Sieve.java&lt;/a&gt;&lt;/td&gt; &lt;td align="right"&gt;2.899s&lt;/td&gt; &lt;td&gt;&lt;div style="width:28.9px;" class="graph"&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="http://brianin3d.googlepages.com/Sieve.hx"&gt;Sieve.hx&lt;/a&gt; to &lt;a href="http://brianin3d.googlepages.com/Sieve.html"&gt;Flash&lt;/a&gt;&lt;/td&gt; &lt;td align="right"&gt;7.404s&lt;/td&gt; &lt;td&gt;&lt;div style="width:74px;" class="graph"&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="http://brianin3d.googlepages.com/Sieve.hx"&gt;Sieve.hx&lt;/a&gt; to Neko&lt;/td&gt; &lt;td align="right"&gt;20.039s&lt;/td&gt; &lt;td&gt;&lt;div style="width:200px;" class="graph"&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td nowrap style="white-space:nowrap;"&gt;&lt;a href="http://brianin3d.googlepages.com/Sieve.hx"&gt;Sieve.hx&lt;/a&gt; to &lt;a href="http://brianin3d.googlepages.com/Sieve.js"&gt;JS&lt;/a&gt;&lt;a href="http://brianin3d.googlepages.com/SieveJs.html"&gt;*&lt;/a&gt;&lt;/td&gt; &lt;td align="right"&gt;22.799s&lt;/td&gt; &lt;td&gt;&lt;div style="width:228px;" class="graph"&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;br /&gt;Ouch! Of course, we can't expect the &lt;a href="http://nekovm.org/"&gt;neko vm&lt;/a&gt; to really compete with the &lt;a href="http://java.sun.com/javase/6/docs/technotes/guides/performance/speed.html"&gt;Java 6 JVM&lt;/a&gt;, but a 7x spanking really makes it look bad!&lt;br /&gt;&lt;br /&gt;Getting spanked by Flash a 2.5x is not too impressive either... or barely beating out Javascript...&lt;br /&gt;&lt;br /&gt;As &lt;a href="http://blackdog-haxe.blogspot.com/2008/01/case-for-haxe-on-jvm.html"&gt;blackdog&lt;/a&gt; points out, a path from &lt;a href="http://haxe.org/"&gt;haxe&lt;/a&gt; to the JVM may just make a lot more sense.&lt;br /&gt;&lt;br /&gt;Unfortunately, at this point there isn't a way to get from &lt;a href="http://haxe.org/"&gt;haxe&lt;/a&gt; to the JVM and getting to the &lt;a href="http://nekovm.org/"&gt;neko vm&lt;/a&gt; doesn't seem worth the bother... &lt;br /&gt;&lt;br /&gt;:-(&lt;br /&gt;&lt;br /&gt;BTW, I generated the php version, but couldn't get it to crank up... May add in the results later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-4399139389067197636?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/4399139389067197636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/11/is-neko-vm-too-slow-to-be-used.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4399139389067197636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/4399139389067197636'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/11/is-neko-vm-too-slow-to-be-used.html' title='is the neko vm too slow to be used?'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-862393876629049158.post-9135876290435669698</id><published>2008-11-13T13:20:00.000-08:00</published><updated>2008-11-28T15:40:49.195-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bailout'/><category scheme='http://www.blogger.com/atom/ns#' term='politics'/><title type='text'>Chambliss: just add swift kick to the rear</title><content type='html'>December 2nd, 2008 is a good day to give Saxby that early Christmas present he's been wanting: the firm application of the collective food of the good people of Georgia to his back side he's been wanting.&lt;br /&gt;&lt;br /&gt;Frankly, I didn't really know much about Chambliss before the bailout that put a gun to my head and forced me to invest in the floundering mess that is AIG with some vague promises of "getting me back" someday.&lt;br /&gt;&lt;br /&gt;Can't say I wanted to either.&lt;br /&gt;&lt;br /&gt;I realize he's a professional politician which puts his soul about 3 rungs down from grave robber or folks who scam little olde ladies out of their pensions... oh, wait! He is in that last group too.&lt;br /&gt;&lt;br /&gt;Well, if they could I'm sure they'd want to boot him out of their club if they could.&lt;br /&gt;&lt;br /&gt;Hyberpole? Ok, maybe.&lt;br /&gt;&lt;br /&gt;Why not decide for yourself?&lt;br /&gt;&lt;br /&gt;Here is what this our darling "&lt;b&gt;&lt;i&gt;representative&lt;/i&gt;&lt;/b&gt;"responded when I told him not to give my money to those con artists in the financial "&lt;b&gt;&lt;i&gt;services&lt;/i&gt;&lt;/b&gt;" industry (my mods in brackets with italics):&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt; &lt;b&gt;We have been betrayed by many people &lt;/b&gt; &lt;i&gt;[to whom I plan to give billions of dollars more, secure in the knowledge we can trust them now for some reason TBD] &lt;/i&gt; &lt;b&gt;and by abuse of the system &lt;/b&gt; &lt;i&gt;[which I have no intentions of changing since they pay for my yacht ...]&lt;/i&gt; &lt;b&gt;The bill that I voted for is not a bailout&lt;/b&gt; &lt;i&gt;[oh, wait... yeah it totally is, my bad! ...]&lt;/i&gt; &lt;b&gt;this is not a popularity contest &lt;/b&gt; &lt;i&gt;[so please shut up, get back on your tractor and let the smart guys get their graft-on ...]&lt;/i&gt; &lt;b&gt;My first reaction was one of anger and frustration &lt;/b&gt; &lt;i&gt;[realizing I didn't get my kick back on this fraud in advance (you try collecting from these slicksters on the back-end... oh, yeah... you will try! hahahaha I gave your hard earned dough to the worst kind of grafters who are now going to loan it back to your at 24% interest! bwhahahaha! I am pure evil! pay me, biatch!]&lt;/i&gt; &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now I admit, the above is somewhat colored by my own perspective on the ridiculous, wrong-headed pompous nonsense Saxby "YAWB" Chambliss had to offer up in exchange for my hard earned cash which he gave to his friends in big bidness.&lt;br /&gt;&lt;br /&gt;So, you can read the rest &lt;a href="http://brianin3d.googlepages.com/saxby_bailout.html"&gt;here&lt;/a&gt; in it's original form.&lt;br /&gt;&lt;br /&gt;The only modification I made was to remove some slight information specific to my secret identity and replace it with what I am reasonably sure was the original name in the template.&lt;br /&gt;&lt;br /&gt;Now, I'm not advocating for &lt;a href="http://www.swamppolitics.com/news/politics/blog/2008/11/senate_battle_in_georgia_red_h.html"&gt;Martin&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I'm not partisan because I'm not silly enough to believe that big bidness would be dumb enuff to only buy off only half of the politician.&lt;br /&gt;&lt;br /&gt;Nor am I naive enuff to think these guys are really trying to help me. &lt;br /&gt;&lt;br /&gt;In my experience when someone you don't know is trying to get into your bidness and help you with the contents of your wallet, it is not going to be to put more money in there.&lt;br /&gt;&lt;br /&gt;If you follow me... you do, right? I think you do.&lt;br /&gt;&lt;br /&gt;I would just like to encourage you at least rattle the bar of the cage a little.&lt;br /&gt;&lt;br /&gt;Yeah, the warden isn't going to let us go for banging our collective metal cup on the bars. The guards aren't going to release us for throwing down rolls of toilet paper lit on fire.&lt;br /&gt;&lt;br /&gt;But sometimes you have to do what you can to say "Hey! I'll rochambeau you for it!"&lt;br /&gt;&lt;br /&gt;So please, do what you can to boot Chambliss out. And when Martin sends me the same letter in a couple of years, let's do the same for that turkey too.&lt;br /&gt;&lt;br /&gt;Oh, btw:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;However, history warns us against inaction by hard lessons learned.  Delaying to act would be a repeat of the mistakes of the 1920s, when thousands of banks failed before significant confidence was restored to our financial markets.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;For all the experts, politicians and geniuses who repeat this tired refrain. &lt;b&gt;We have no reason to think that propping up this corrupt financial system with some temporary injection of cash is going to do anything other than make it crash down that much harder when it does crash.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You are not the little dutch boy putting his finger in the dike (I know... in the modern world that sounds really derty!)&lt;br /&gt;&lt;br /&gt;Let's just hope 2009 doesn't come to be known as the "Greater Depression."&lt;br /&gt;&lt;br /&gt;I'd like to conclude with...&lt;br /&gt;&lt;br /&gt;When you are having trouble paying the bills, it's not the right time to invest in the stock market.&lt;br /&gt;&lt;br /&gt;When you are concerned about having a job in 6 months, maybe the best use of money is to save up what you can when you can. &lt;br /&gt;&lt;br /&gt;When you are uncertain if the bank is going to foreclose one you, don't go buy shares in a failed corporation.&lt;br /&gt;&lt;br /&gt;Too bad Chambliss is too damned smart to know that. Or maybe just too rich.&lt;br /&gt;&lt;br /&gt;Maybe he should ask &lt;a href="http://clarkhoward.com/liveweb/shownotes/2008/09/25/14101/"&gt;Clark Howard&lt;/a&gt; what he thinks next time.&lt;br /&gt;&lt;br /&gt;Or maybe he could listen to me: &lt;i&gt;keep your hands off my cash your damned, dirty politician!&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Here is the deal, I offer to one and all. It is not a new deal: mind your own bidness and I will mind mine ; the administration of the horns is predicated on the molestation the bull.&lt;br /&gt;&lt;br /&gt;Oops! Almost forgot! Always leave off with a &lt;a href="http://www.sinfest.net/archive_page.php?comicID=2959"&gt;joke&lt;/a&gt;! Unfortunately, the jokes on us, but hey...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/862393876629049158-9135876290435669698?l=brianin3d.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://brianin3d.blogspot.com/feeds/9135876290435669698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://brianin3d.blogspot.com/2008/11/chamliss-just-add-swift-kick-to-rear.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/9135876290435669698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/862393876629049158/posts/default/9135876290435669698'/><link rel='alternate' type='text/html' href='http://brianin3d.blogspot.com/2008/11/chamliss-just-add-swift-kick-to-rear.html' title='Chambliss: just add swift kick to the rear'/><author><name>brianin3d</name><uri>http://www.blogger.com/profile/11056643344486830736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_DIJS3KbqGjY/SRxWYi4LTAI/AAAAAAAAAAM/uIRgJ8OFmbU/S220/p100.gif'/></author><thr:total>0</thr:total></entry></feed>
