<?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-1979176749314572541</id><updated>2011-11-05T14:21:51.462-07:00</updated><category term='linux'/><category term='crash'/><category term='installation'/><category term='tools'/><category term='personal'/><category term='cache'/><category term='movies'/><category term='bsod'/><category term='graphics'/><category term='games'/><category term='dump'/><category term='phone'/><category term='networking'/><category term='industry'/><category term='misc'/><category term='gpu'/><category term='android'/><category term='shaders'/><category term='hacks'/><category term='tips'/><category term='stereo'/><category term='optimization'/><category term='windows'/><category term='xbox'/><category term='c++'/><category term='stl'/><category term='cpu'/><category term='hardware'/><category term='car'/><category term='mods'/><title type='text'>YAB (Yet another blog)</title><subtitle type='html'>Game programming, cosillas en espaniol and other random stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-7487834823649793643</id><published>2011-07-23T14:56:00.000-07:00</published><updated>2011-07-23T14:56:19.528-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='phone'/><category scheme='http://www.blogger.com/atom/ns#' term='crash'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Droid X Freezing</title><content type='html'>So I started getting weird/random glitches on my Droid X, where the phone would just freeze. I could press the top button &amp;amp; turn off the screen, but when pressing it again or the home key to unlock, sometimes the bottom row of physical buttons would light up a bit and then turn off, or it would just not do that and keep the screen off.&lt;br /&gt;&lt;br /&gt;Unfortunately I was out of the country so I had no internet or data access (I suspected it had to do with setting it in airplane mode for the first time), so I tried removing the SD card and voila! It stopped freezing.&lt;br /&gt;&lt;br /&gt;But I could take no pictures, or read my kindle books offline (or play all the games in my sd card!) :(&lt;br /&gt;&lt;br /&gt;Coming back I looked into this online and did the following:&lt;br /&gt;1) Backup SD card to PC (worked!)&lt;br /&gt;2) Format SD card from PC (worked!)&lt;br /&gt;3) Copied some folders from backup to SD, put the card back into the phone, turn on and wait for hang...&lt;br /&gt;&lt;br /&gt;So did 3) until I only missed the Music folder with all my MP3, and currently the phone works ok! I now have to go through all the files in the Music folder (about 6 gb) and check for weird issues...&lt;br /&gt;&lt;br /&gt;So definitely a case of either a corrupt filesys or corrupt file (or an MP3 file with bad tags?).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-7487834823649793643?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/7487834823649793643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=7487834823649793643' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7487834823649793643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7487834823649793643'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2011/07/droid-x-freezing.html' title='Droid X Freezing'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-3382886862237257206</id><published>2011-07-07T17:31:00.000-07:00</published><updated>2011-07-07T17:31:38.889-07:00</updated><title type='text'>#Fail</title><content type='html'>After spending quite some time trying to find a solution, gave up and asked &lt;a href="http://stackoverflow.com/questions/6618667/performance-using-d3d10-11-and-mdi-windows"&gt;stackoverflow&lt;/a&gt;...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-3382886862237257206?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/3382886862237257206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=3382886862237257206' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/3382886862237257206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/3382886862237257206'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2011/07/fail.html' title='#Fail'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-1771203804928768292</id><published>2011-01-24T09:15:00.000-08:00</published><updated>2011-01-24T09:15:25.526-08:00</updated><title type='text'>Switching phones</title><content type='html'>Ok, I'm going from an old BlackBerry 8703e, to a &lt;a href="http://www.amazonwireless.com/dp/B003UESOGA?_encoding=UTF8&amp;amp;tag=miscadventure-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=B003UESOGA"&gt;Motorola DROID X Android Phone (Verizon Wireless)&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=miscadventure-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=B003UESOGA" style="border: medium none ! important; margin: 0px ! important;" width="1" /&gt;, hopefully I'll see the Android Difference ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-1771203804928768292?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/1771203804928768292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=1771203804928768292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/1771203804928768292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/1771203804928768292'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2011/01/switching-phones.html' title='Switching phones'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-3945004228645401572</id><published>2010-11-30T14:23:00.000-08:00</published><updated>2010-11-30T14:25:35.540-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='car'/><category scheme='http://www.blogger.com/atom/ns#' term='stereo'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Finally here! Installation pics of my car stereo</title><content type='html'>It took a me a while to find the pictures of how the &lt;a href="http://www.amazon.com/Sony-MEX-BT3800U-Receiver-Player-Bluetooth/dp/B0032FOJPM?ie=UTF8&amp;amp;tag=miscadventure-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;Sony MEX-BT3800U&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=miscadventure-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B0032FOJPM" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /&gt; got installed in my Mitsubishi Endeavor, but here they are now!&lt;br /&gt;&lt;br /&gt;Pull from the bottom left side a little bit: &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV2_e0h_OI/AAAAAAAAABE/fVwx4CeSk-4/s1600/P1020655.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV2_e0h_OI/AAAAAAAAABE/fVwx4CeSk-4/s320/P1020655.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;Now from the top right side:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_x8cx9HQyQT4/TPV3L-fpziI/AAAAAAAAABI/nXTXo-eHlrk/s1600/P1020657.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/_x8cx9HQyQT4/TPV3L-fpziI/AAAAAAAAABI/nXTXo-eHlrk/s320/P1020657.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Now from the top left:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_x8cx9HQyQT4/TPV3VXWjMpI/AAAAAAAAABM/Bs9gBGC1Gv4/s1600/P1020656.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/_x8cx9HQyQT4/TPV3VXWjMpI/AAAAAAAAABM/Bs9gBGC1Gv4/s320/P1020656.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;At this point it has detached from the dashboard, and you can now pull from the top a little bit:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV3mql2lyI/AAAAAAAAABQ/0VhPXBITuGI/s1600/P1020659.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV3mql2lyI/AAAAAAAAABQ/0VhPXBITuGI/s320/P1020659.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;So far so good; now we have to remove that pair of screws you can see on the top, and with it we detach the cover of the clock/fm lcd:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV3_M5ayNI/AAAAAAAAABU/biJ463-6FS8/s1600/P1020660.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV3_M5ayNI/AAAAAAAAABU/biJ463-6FS8/s320/P1020660.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;You see those 2 black wires &amp;amp; the one with foam? Now if we look at this from the top, you can see they are attached to the grey metal cover, so manually unplug each one of them from the white plugs:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_x8cx9HQyQT4/TPV4Y6Vs8bI/AAAAAAAAABY/afUwKS7iAcc/s1600/P1020662.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://4.bp.blogspot.com/_x8cx9HQyQT4/TPV4Y6Vs8bI/AAAAAAAAABY/afUwKS7iAcc/s320/P1020662.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Ok, so after that, we can fully remove the grey panel!&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_x8cx9HQyQT4/TPV4q547KGI/AAAAAAAAABc/QKY-lnj_2Gc/s1600/P1020664.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://1.bp.blogspot.com/_x8cx9HQyQT4/TPV4q547KGI/AAAAAAAAABc/QKY-lnj_2Gc/s320/P1020664.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Missing from this picture is the old stereo, which would be in the center slot; you'd proceed to remove the front 2 screws to take it out, and the ground cable.&lt;br /&gt;&lt;br /&gt;To attach it back, follow the steps in reverse, and push it in the end towards the dashboard.&lt;br /&gt;&lt;br /&gt;Disclaimer: You may burn your vehicle electronics! Detach at your own risk!&lt;br /&gt;&lt;br /&gt;And the final product:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV52NVIm2I/AAAAAAAAABg/f-l2zsJABpU/s1600/P1020652.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV52NVIm2I/AAAAAAAAABg/f-l2zsJABpU/s320/P1020652.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-3945004228645401572?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/3945004228645401572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=3945004228645401572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/3945004228645401572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/3945004228645401572'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2010/11/finally-here-installation-pics-of-my.html' title='Finally here! Installation pics of my car stereo'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_x8cx9HQyQT4/TPV2_e0h_OI/AAAAAAAAABE/fVwx4CeSk-4/s72-c/P1020655.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-5399794012787848884</id><published>2010-11-10T14:16:00.000-08:00</published><updated>2010-11-13T14:46:07.960-08:00</updated><title type='text'>Super Mario All-Stars</title><content type='html'>Waiting for it... Free shipping!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/dp/B0049DYNNO?tag=miscadventure-20&amp;camp=213761&amp;creative=393545&amp;linkCode=bpl&amp;creativeASIN=B0049DYNNO&amp;adid=1T81CHHRWZ00AQPAAS5C&amp;"&gt;Link...&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=miscadventure-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=B0049DYNNO&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-5399794012787848884?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/5399794012787848884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=5399794012787848884' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5399794012787848884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5399794012787848884'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2010/11/super-mario-all-stars.html' title='Super Mario All-Stars'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-7770130378902506658</id><published>2010-08-14T16:45:00.000-07:00</published><updated>2010-08-14T16:45:48.108-07:00</updated><title type='text'>Motherboard upgrade</title><content type='html'>Seems I've been getting a lot of random freezes on Win 7 x64; I'll blame it on the motherboard, a &lt;a href="http://www.amazon.com/Gigabyte-GA-P35-DS3L-Core2-Channels-Motherboard/dp/B000U8YO2W?ie=UTF8&amp;amp;tag=miscadventure-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;GA-P35-DS3L&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=miscadventure-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B000U8YO2W" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /&gt;, so I'll be switching to a &lt;a href="http://www.amazon.com/Gigabyte-Core-DDR2-1366-Motherboard-GA-EP45-UD3L/dp/B001KEMJ9U?ie=UTF8&amp;amp;tag=miscadventure-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969" target="_blank"&gt;GA-EP45-UD3L&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=miscadventure-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B001KEMJ9U" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /&gt; instead. At this point who knows why it broke down...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-7770130378902506658?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/7770130378902506658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=7770130378902506658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7770130378902506658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7770130378902506658'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2010/08/motherboard-upgrade.html' title='Motherboard upgrade'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-5509754607230970883</id><published>2010-08-12T14:54:00.000-07:00</published><updated>2010-08-12T14:54:05.456-07:00</updated><title type='text'>Waiting for Metroid...</title><content type='html'>I've got a preorder ready! Let's see what Team Ninja do with it!&lt;br /&gt;&lt;br /&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=miscadventure-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B002BSC4ZS&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-5509754607230970883?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/5509754607230970883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=5509754607230970883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5509754607230970883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5509754607230970883'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2010/08/waiting-for-metroid.html' title='Waiting for Metroid...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-2880920918280554887</id><published>2010-07-07T09:12:00.000-07:00</published><updated>2010-07-07T09:12:52.773-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mods'/><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='car'/><category scheme='http://www.blogger.com/atom/ns#' term='stereo'/><title type='text'>Installed...</title><content type='html'>I will take a nicer picture. This was taken quickly last night with my cell phone.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_x8cx9HQyQT4/TDSnGbmEamI/AAAAAAAAAAM/J0nwnSGQTAc/s1600/0704001326.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_x8cx9HQyQT4/TDSnGbmEamI/AAAAAAAAAAM/J0nwnSGQTAc/s320/0704001326.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The cable you see there is the USB connector for the iPod.&lt;br /&gt;I will be adding the external bluetooth microphone (so I have to tear it apart) so I'll be documenting that with (nicer) pictures :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-2880920918280554887?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/2880920918280554887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=2880920918280554887' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2880920918280554887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2880920918280554887'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2010/07/installed.html' title='Installed...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_x8cx9HQyQT4/TDSnGbmEamI/AAAAAAAAAAM/J0nwnSGQTAc/s72-c/0704001326.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-6048252824275848489</id><published>2010-06-18T17:47:00.000-07:00</published><updated>2010-06-18T17:52:29.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mods'/><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='car'/><category scheme='http://www.blogger.com/atom/ns#' term='stereo'/><title type='text'>Mitsubishi Endeavor 2005  LS Aftermarket Stereo Installation</title><content type='html'>I wanted to have iPod support &amp;amp; bluetooth to my 05 Endeavor, but it seems the stock stereo has no way of hooking up an aux-in. I thought of getting a Garmin Nuvi 765T that has bluetooth &amp;amp; aux-in and use it on the fm radio... But I guess I figured I *could* install an aftermarket stereo all by my self (famous last words).&lt;br /&gt;&lt;br /&gt;This was a pain to do! Seems all the online info is mostly for XLS owners which have the upgraded Infinity stereo system. I have the LS trim, so the option was to either make a new dash panel (yeah right, I can't even cut with scissors in a straight line!) or to use the lower pocket on the dashboard. That couldn't be too bad, could it?&lt;br /&gt;&lt;br /&gt;In the end, success! I'll describe the issues I found and some pics...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-6048252824275848489?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/6048252824275848489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=6048252824275848489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/6048252824275848489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/6048252824275848489'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2010/06/mitsubishi-endeavor-2005-ls-aftermarket.html' title='Mitsubishi Endeavor 2005  LS Aftermarket Stereo Installation'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-7589496439336366053</id><published>2009-09-27T15:26:00.000-07:00</published><updated>2009-09-27T15:31:00.723-07:00</updated><title type='text'>Showing std::vector in the debugger (continued)</title><content type='html'>Seems I found an even better way to show the container elements in the debugger: just add a watch for the address of the std::vector instance!&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;std::vector &lt;&gt; oList;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;oList.push_back( -1 );&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;oList.push_back( 6 );&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;__asm int 3    /// Breakpoint here...&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add a watch for :&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;&amp;amp;oList&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And it expands to (correctly sizing it!)&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;oList[ 0 ] = -1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;oList[ 1 ] = 6;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-7589496439336366053?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/7589496439336366053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=7589496439336366053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7589496439336366053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7589496439336366053'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/09/showing-stdvector-in-debugger-continued.html' title='Showing std::vector in the debugger (continued)'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-823807572226289435</id><published>2009-08-28T17:17:00.000-07:00</published><updated>2009-08-28T17:20:19.099-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='stl'/><title type='text'>Showing std::vector elements in the debugger</title><content type='html'>Some std::vector instantiations do show up the members as arrays on Visual Studio 2005, some don't; if you need to access the member, you can use the following watch:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;oYourVector._Myfirst[ nElement ]&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-823807572226289435?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/823807572226289435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=823807572226289435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/823807572226289435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/823807572226289435'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/08/showing-stdvector-elements-in-debugger.html' title='Showing std::vector elements in the debugger'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-2608243825596036</id><published>2009-06-17T19:03:00.001-07:00</published><updated>2009-06-17T19:07:59.880-07:00</updated><title type='text'>Time...</title><content type='html'>Definitely the most valuable and scarce resource. It's hard (with a 2.5 year old toddler and a 1.5 month old baby) to have enough time to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;On DS: Play Exit, Picross and Etrian Odyssey&lt;/li&gt;&lt;li&gt;On PS3: Play Ninja Gaiden Sigma&lt;/li&gt;&lt;li&gt;On Wii: Play MadWorld and Punch-Out&lt;/li&gt;&lt;li&gt;On Xbox 360: Play Silent Hill 5, Gears of War, Condemned 2, Dead Space on Hard mode&lt;/li&gt;&lt;li&gt;Play Classical Guitar &amp;amp; Electric Guitar&lt;/li&gt;&lt;li&gt;Play Piano&lt;/li&gt;&lt;li&gt;Write an MP3 decoder/player from scratch&lt;/li&gt;&lt;li&gt;Write an HLSL optimizer/extender from scratch&lt;/li&gt;&lt;li&gt;Learn Scheme&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;But there will be time someday...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-2608243825596036?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/2608243825596036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=2608243825596036' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2608243825596036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2608243825596036'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/06/time.html' title='Time...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-8045233824882284231</id><published>2009-04-16T09:40:00.000-07:00</published><updated>2009-04-16T09:43:12.276-07:00</updated><title type='text'>Happy 15th Anniversary...</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Super Metroid&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.gamasutra.com/blogs/MaxwellJensen/20090416/1128/15_Years_of_Super_Metroid.php"&gt;This nice piece&lt;/a&gt; on Gamasutra reminded me of it. I'm getting old! I 'borrowed' it from my friend's brother when I was 14... I think it mysteriously never got back to its original owner ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-8045233824882284231?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/8045233824882284231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=8045233824882284231' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/8045233824882284231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/8045233824882284231'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/04/happy-15th-anniversary.html' title='Happy 15th Anniversary...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-4200928466495891095</id><published>2009-04-07T16:41:00.000-07:00</published><updated>2009-04-07T16:47:19.930-07:00</updated><title type='text'>And Code Too...</title><content type='html'>Of course code also needs to be elegant, concise, clean, self-documenting and efficient.&lt;br /&gt;&lt;br /&gt;My previous post was directed toward performance critical systems, those systems where you know it's the make-or-break 60 fps framerate...&lt;br /&gt;&lt;br /&gt;Good class design (maybe even design patterns) is a characteristic of a good programmer. But maybe the best programmers can adapt and produce the right solution for a problem.&lt;br /&gt;&lt;br /&gt;In other words, &lt;a href="http://www.fightingmaster.com/masters/brucelee/quotes.htm"&gt;Empty your mind, be formless. Shapeless, like water. If you put water into a cup, it becomes the cup. You put water into a bottle and it becomes the bottle. You put it in a teapot it becomes the teapot. Now, water can flow or it can crash. Be water my friend.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So much to learn, so little time to do it...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-4200928466495891095?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/4200928466495891095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=4200928466495891095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4200928466495891095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4200928466495891095'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/04/and-code-too.html' title='And Code Too...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-2585477411796487968</id><published>2009-03-12T17:34:00.000-07:00</published><updated>2009-03-12T17:42:39.432-07:00</updated><title type='text'>Not Code, but Data...</title><content type='html'>I've spent countless hours trying to come up with clean, elegant, concise and readable systems/APIs. Hours spent trying to see if a Design Pattern will help me, refactoring code, reading about best practices, etc.&lt;br /&gt;&lt;br /&gt;But one day I had a Zen-like revelation.&lt;br /&gt;&lt;br /&gt;It's not about the code, it's about the data!&lt;br /&gt;&lt;br /&gt;See, all a computer/program does is transform and move data from one format to another. All we do when we try to come up with fancy interfaces are just ways for us humans to understand how the computer/program will transform the data.&lt;br /&gt;&lt;br /&gt;Of course, you still need to program the APIs in a nice, clean, elegant and readable way, but keep in mind that the end product is just transforming/moving data. Streams of bits and bytes get split up, operated on, and joined into new streams of bits and bytes.&lt;br /&gt;&lt;br /&gt;So in games programming/engineering, you need to figure out what data you need. Come up with a transformation function, and then clean up/refactor/humanize the code without losing performance.&lt;br /&gt;&lt;br /&gt;I think that's the meat of games programming.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-2585477411796487968?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/2585477411796487968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=2585477411796487968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2585477411796487968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2585477411796487968'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/03/not-code-but-data.html' title='Not Code, but Data...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-2753290102668163289</id><published>2009-02-24T18:01:00.000-08:00</published><updated>2009-02-24T18:09:53.344-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='shaders'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Shader tip</title><content type='html'>Tired of recompiling shaders all the time to try different combinations or code branches? Use this little hack in pseudo-code for selecting values: (I guess this was more useful on pre-shader model 3.0 hardware)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;float4    g_vControl = float4( 1, 0, 0, 0 ); // Default to Branch1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;float4 MainPS() : COLOR0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;float fValue0 = ResultFromBranch1();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;float fValue1 = ResultFromBranch2();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;float fValue2 = ResultFromBranch3();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;float fValue3 = ResultFromBranch4();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;float4 vValues = float4( fValue0, fValue1, fValue2, fValue3 );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;&amp;nbsp;float fResult = dot( g_vControl, vValues );&lt;br /&gt;&lt;br /&gt;    // Do more math with the result...&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then on your main C#/C++ code, you can just set g_vControl to ( 1, 0, 0, 0) for Branch1, ( 0, 1, 0, 0 ) for Branch2, etc.&lt;br /&gt;&lt;br /&gt;Of course, on release code you should remove this, or set g_vControl to be static bool so the compiler will optimize out the remaining branches. But for developing it's quite useful.&lt;br /&gt;&lt;br /&gt;Also, you could blend the values: g_vControl = ( 0.5, 0, 0.5, 0 ) for example to blend Branch1() and Branch3().&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-2753290102668163289?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/2753290102668163289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=2753290102668163289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2753290102668163289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2753290102668163289'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/02/shader-tip.html' title='Shader tip'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-5698394678047047240</id><published>2009-01-30T10:20:00.001-08:00</published><updated>2009-01-30T10:29:10.942-08:00</updated><title type='text'>Now a PS3...</title><content type='html'>So now I got a PS3. Setup was pretty easy, but I still have major issues with its GUI.&lt;br /&gt;&lt;br /&gt;Seems very old fashioned, very cluttered. On one hand it's nice to see the past menus you came from, but it just makes it look very busy.&lt;br /&gt;&lt;br /&gt;Streaming with TVersity "just works". I love that it can play VOB files directly, whereas the 360 seems to have issues with them. It would be even more awesome if I enable subtitles from the VOB file (maybe it's not inside it)!&lt;br /&gt;&lt;br /&gt;Blu-Ray and DVD playback is easier than the 360; I love that it can autoplay the movies when you turn the console on, whereas on the 360 you have to browse to the DVD or HD-DVD drive on My Xbox, then click on Play Movie.&lt;br /&gt;&lt;br /&gt;It seems to run way hotter than my 360 for some reason, maybe the 360 has one of the newer chips that makes it run cooler?&lt;br /&gt;&lt;br /&gt;I measured 106 degrees F inside the audio cabinet with the door closed, wow! (It accidentally stayed on when the cabinet door was closed...). I'm afraid to run this same test on the 360 :)&lt;br /&gt;&lt;br /&gt;The only thing that really irritates me is that I can't play any PS2 games on it. Seriously, what's the deal with that?&lt;br /&gt;&lt;br /&gt;I really hope Sony's working on a PS3 software emulator. There were so many games I almost bought for PS2, but thankfully I read the PS3's box... Not all of us had a PS2, Sony!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-5698394678047047240?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/5698394678047047240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=5698394678047047240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5698394678047047240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5698394678047047240'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/01/now-ps3.html' title='Now a PS3...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-5200092461631151028</id><published>2009-01-14T09:48:00.001-08:00</published><updated>2009-01-14T09:56:55.440-08:00</updated><title type='text'>Don't eliminate the programmer...</title><content type='html'>I came across this very interesting post by Scot Westfall (SlickEdit's blog) &lt;a href="http://blog.slickedit.com/?p=255"&gt;"Eliminating the Programmer"&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;Here are some great points:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"&lt;span style="font-style: italic;"&gt;[...]programmers have skills and abilities other than just their knowledge of programming languages.&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;"&lt;span style="font-style: italic;"&gt;[...]Regardless, I’ve noticed that programmers are often more capable in many ways than their non-programming coworkers.&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;"&lt;span style="font-style: italic;"&gt;Programmers think more logically. Working through if-then-else conditions is a core capability for any programmer. While working with business teams on requirements, I have often run across cases the where same ability was lacking.&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;"&lt;span style="font-style: italic;"&gt;Programmers have a superior ability to analyze problems and come up with solutions. They excel at analyzing preconditions, sequences of events, and outcomes. Certainly, this is a key skill in programming, but it is also useful in troubleshooting and business case analysis.&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;"&lt;span style="font-style: italic;"&gt;Another key ability where programmers typically have an edge is the ability to make order out of chaos. I think that’s because the programmer is responsible for creating order within the program.&lt;/span&gt;"&lt;/li&gt;&lt;li&gt;"&lt;span style="font-style: italic;"&gt;[...]their main talent lies in their ability to analyze, troubleshoot, and solve problems. Code is just the physical manifestation that culminates the thought process of the programmer.&lt;/span&gt;"&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Excellent insight into what being a programmer is all about.&lt;br /&gt;&lt;br /&gt;Of course,&lt;br /&gt;&lt;ul&gt;&lt;li&gt; "&lt;span style="font-style: italic;"&gt;it’s clear that this is not a universal trait in all programmers&lt;/span&gt;"&lt;/li&gt;&lt;/ul&gt;Read it in full, and enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-5200092461631151028?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/5200092461631151028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=5200092461631151028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5200092461631151028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5200092461631151028'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2009/01/dont-eliminate-programmer.html' title='Don&apos;t eliminate the programmer...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-8989519449310341170</id><published>2008-12-15T10:46:00.001-08:00</published><updated>2008-12-16T13:58:38.708-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='xbox'/><category scheme='http://www.blogger.com/atom/ns#' term='networking'/><title type='text'>XBox 360 &amp; Verizon FiOS Networking adventures</title><content type='html'>As discussed before, I &lt;a href="http://rcaloca.blogspot.com/2008/12/xbox-360-wmp-11-streaming.html"&gt;got a 360&lt;/a&gt;. So it was quite a bit of a pain getting this to work with my Verizon FiOS network connection, specially because paying $100 for a wireless adapter is kind of expensive, and my wireless signal's bad. Here's how thing are:&lt;br /&gt;&lt;br /&gt;FiOS is the Verizon fiber optic service for internet/cable/TV/phone, etc that supplies my home with information and entertainment. The house is (as most of the houses on the US) wired for coaxial/cable all over, at least on each room.&lt;br /&gt;&lt;br /&gt;The fiber optic from FiOS gets home from the street into my garage, where they have a hub which converts it to coaxial. This hub also has an ethernet output, which would be awesome and solve all my problems had the house be wired with ethernet. Anyways, so from this hub coaxial is conected to the house's wiring and that distributes it to the rooms.&lt;br /&gt;&lt;br /&gt;My desktop is upstairs, and from the coaxial there's a so-called MoCA converter, which convertes coaxial to ethernet through Verizon's router, an Actiontec MI424WR. This is a wireless router too. So I plug my PC from there and use the wireless on the laptop downstairs and the Wii. Signal's pretty bad, too many walls in between (my house has a weird layout).&lt;br /&gt;&lt;br /&gt;So the first thing I though is well, if I can get my DLink DI-524 as a wireless bridge, I can then just plug the 360 (which is downstairs too) directly into it and be done. So I looked at the &lt;a href="http://www.dd-wrt.com/dd-wrtv3/index.php"&gt;DD-WRT&lt;/a&gt; project, but seems my DLink doesn't have enough on-board ram to be reflashed and reused as a bridge.&lt;br /&gt;&lt;br /&gt;Just for kicks sake, I got a WRT54GL router and tried it with dd-wrt, and seems the Verizon router has issues with some routing table being too small. I also tried hooking up both the 54GL and the DLink's WLAN port into to the Verizon's LAN port, but that seems to kill the Verizon router.&lt;br /&gt;&lt;br /&gt;After looking over pages and pages of info, I found &lt;a href="http://www.dslreports.com/faq/15984"&gt;this pretty useful one&lt;/a&gt;. So I would have to get new hardware...&lt;br /&gt;&lt;br /&gt;Got on eBay and bought the same Actiontec router from Verizon for $20 bucks. Verizon wanted $150 for a new one. Crazy talk.&lt;br /&gt;&lt;br /&gt;So days later I got the router.&lt;br /&gt;&lt;br /&gt;So I looked at the previously mentioned report, double checked my equipment matched the diagram from the tutorial, and proceeded. I set the range of IPs for the 'main' router, the one where the 360 was hooked up, to 192.168.1.1 through 49, and set the static ip of the secondary (where the PC is connected) to 192.168.1.50, and the range of addresses to give from 51 to 99.&lt;br /&gt;&lt;br /&gt;I got an IP for my PC of 192.168.1.51, which sounded good. I could ping the main router (1.1), and the secondary router (1.50). So far, so good!&lt;br /&gt;&lt;br /&gt;Then I tried pinging www.yahoo.com, and... no cookie. Tried ipconfig /renew, tried changing settings and port forwarding for http and https ports in the verizon config for both routers, but still nothing.&lt;br /&gt;&lt;br /&gt;So then I looked at my PC's ipconfig, and saw this:&lt;br /&gt;IP: 192.168.1.51&lt;br /&gt;Mask: 255.255.255.0&lt;br /&gt;Gateway: 192.168.1.50&lt;br /&gt;&lt;br /&gt;After some fiddling with it (and getting angry), I figured out that the gateway was the issue. So I went ahead and changed my PC's IP to be static (192.168.1.51) and forced the gateway to be the main router (192.168.1.1).&lt;br /&gt;&lt;br /&gt;Everything works like a charm.&lt;br /&gt;&lt;br /&gt;Not bad for somebody who slept through most of his computer networks classes ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-8989519449310341170?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/8989519449310341170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=8989519449310341170' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/8989519449310341170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/8989519449310341170'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/12/xbox-360-verizon-fios-networking.html' title='XBox 360 &amp; Verizon FiOS Networking adventures'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-9038060199970762548</id><published>2008-12-15T10:35:00.000-08:00</published><updated>2008-12-15T10:46:08.223-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><category scheme='http://www.blogger.com/atom/ns#' term='movies'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='xbox'/><title type='text'>XBox 360, WMP 11 &amp; Streaming</title><content type='html'>So finally bit the bullet and got a 360. Just took me a few years to "jump in". What a wonderful piece of hardware! (Ignoring the three red rings of death issues). Getting used to hi-def console is hard, now I can see I might need a new prescription on my eyeglasses.&lt;br /&gt;&lt;br /&gt;The new dashboard is nice, feels a lot more like the Wii channels but more 'professional'.&lt;br /&gt;&lt;br /&gt;I can also now stream Netflix movies (using Netflix's own 360 downloaded app), PC audio, PC movies and my PC photos.&lt;br /&gt;&lt;br /&gt;Which application I did that with?&lt;br /&gt;&lt;br /&gt;The first thing I tried was Windows Media Player 11 from my laptop, which has Vista. (Why not the desktop? See a future post about networking woes). It just detected the 360 and the 360 detected the laptop, had to enter a code from the 360 and that's that, I could see/stream the files from the laptop to the 360.&lt;br /&gt;&lt;br /&gt;However, I don't want the poor laptop's 160 GB drive being killed from streaming. Nor do I want the wireless connection's speed. I wanted the wired network to my desktop, where the big guns are.&lt;br /&gt;&lt;br /&gt;So I tried WMP 11 on my desktop, but it just began to go nuts on my media files. Started changing attributes on my folder.jpg files, adding those AlbumArt*.jpg, and all sorts of crap.&lt;br /&gt;&lt;br /&gt;I tried turning the options for WMP to now mess with my library but it just blissfully ignored me. So Google to the rescue!&lt;br /&gt;&lt;br /&gt;I went with TVersity instead. Works like a charm! Doesn't mess up my files, streams with no visible CPU hit and monitors folders pretty nicely.&lt;br /&gt;&lt;br /&gt;So now, I can get the kid's MP3 played on the 360, so she won't try to put her music CDs inside my home theater and/or dvd player and get them more scratched :)&lt;br /&gt;&lt;br /&gt;Yet another reason to justify buying a 360. Hopefully the wife will buy it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-9038060199970762548?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/9038060199970762548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=9038060199970762548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/9038060199970762548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/9038060199970762548'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/12/xbox-360-wmp-11-streaming.html' title='XBox 360, WMP 11 &amp; Streaming'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-7895144249899414576</id><published>2008-11-05T17:28:00.000-08:00</published><updated>2008-11-11T18:12:59.665-08:00</updated><title type='text'>Keep it simple...</title><content type='html'>A colleague and I were discussing about which were the things that we learned from other programmers which made us better. I went on and on about how I learned to engineer software in &lt;a href="http://en.wikipedia.org/wiki/What_About_Bob%3F"&gt;baby-steps&lt;/a&gt; and how that helped me, but we ended up figuring out what makes great code robust and easy to use:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Keep it simple.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Not trying to over-engineer systems, not trying to hide things inside obfuscated APIs, basically not trying to look 'smart', and giving very simple pieces/components that have thin layers, will make you a better programmer.&lt;br /&gt;&lt;br /&gt;If it is hard to explain, it probably is hard to mantain and expand.&lt;br /&gt;&lt;br /&gt;At least on my experience, it has been a good rule of thumb. Specially now that I have it on my conscious mind :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-7895144249899414576?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/7895144249899414576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=7895144249899414576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7895144249899414576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7895144249899414576'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/11/keep-it-simple.html' title='Keep it simple...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-3864037880971506421</id><published>2008-10-22T10:42:00.001-07:00</published><updated>2008-10-22T10:46:21.866-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='crash'/><category scheme='http://www.blogger.com/atom/ns#' term='bsod'/><title type='text'>Still more STOP 0x00000024</title><content type='html'>I still can't track this down. My PC was up and running (and idle) for about 9 days, then suddenly it got the same STOP 0x00000024 error. I have Avast! as my antivirus, and Live &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;FolderShare&lt;/span&gt; running all day, to sync files between work and home. And I played &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;BioShock&lt;/span&gt; for several days in a row, no issues, exiting the game and saving correctly.&lt;br /&gt;&lt;br /&gt;So I had to reinstall Windows on the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;IDE&lt;/span&gt; hard drive again, boot from that installation, which forces a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;chkdsk&lt;/span&gt; on the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;SATA&lt;/span&gt; drive, and then change the &lt;span style="font-style: italic;"&gt;boot.&lt;/span&gt;&lt;span style="font-style: italic;" class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;ini&lt;/span&gt; file to boot on the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;SATA&lt;/span&gt; drive again.&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;chkdsk&lt;/span&gt; showed errors on a the files and folders I'm syncing with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;FolderShare&lt;/span&gt;, so that may be the culprit... Had to restore a bunch of them from backup.&lt;br /&gt;&lt;br /&gt;I'm thinking it's a hard drive error, but the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;SeaTools&lt;/span&gt; suite keep telling me &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;everything's&lt;/span&gt; good.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-3864037880971506421?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/3864037880971506421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=3864037880971506421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/3864037880971506421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/3864037880971506421'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/10/still-more-stop-0x00000024.html' title='Still more STOP 0x00000024'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-2779424114041430629</id><published>2008-10-14T09:14:00.000-07:00</published><updated>2008-10-15T08:16:29.487-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Black Textures on BioShock</title><content type='html'>So &lt;a href="http://www.2kgames.com/cultofrapture/home.html"&gt;BioShock&lt;/a&gt; ROCKS. Ok, we know that.&lt;br /&gt;&lt;br /&gt;Now for the issues...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I tried the demo back on my 6600GT AGP card a while ago, and figured it couldn't run (or look nice enough) with that card. So I uninstalled it.&lt;br /&gt;&lt;br /&gt;Then I bought the retail version on my last upgrade, and had &lt;a href="http://rcaloca.blogspot.com/2008/10/stop-0x00000024.html"&gt;some issues&lt;/a&gt; with it.&lt;br /&gt;&lt;br /&gt;I did some WinDbg debugging, some cleanup, chkdsks, etc and now the PC stopped crashing.&lt;br /&gt;&lt;br /&gt;After a while, 30% of the game started showing with black textures, as if the lighting was messed up. Even worse, some characters (and bots/turrets) showed invisible textures, which made it very, VERY frustrating to play (I am walking happily, then suddenly I start getting my health all drained up. Guess what? Invisible enemy).&lt;br /&gt;&lt;br /&gt;So I looked in forums all over, found nobody with my exact problem. Tweaked the hell of all the available .INI files in the games. Until I found a solution buried under a forum:&lt;br /&gt;&lt;br /&gt;* Uninstall BioShock Retail&lt;br /&gt;* Install BioShock Demo&lt;br /&gt;* Uninstall BioShock Demo&lt;br /&gt;* Install BioShock Retail&lt;br /&gt;&lt;br /&gt;All's good now.&lt;br /&gt;&lt;br /&gt;It's really perplexing since I did a full Windows Install after I first installed, so no traces of the BioShock demo would be there...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-2779424114041430629?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/2779424114041430629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=2779424114041430629' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2779424114041430629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/2779424114041430629'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/10/black-textures-on-bioshock.html' title='Black Textures on BioShock'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-6203483181915378684</id><published>2008-10-01T09:28:00.000-07:00</published><updated>2008-10-01T09:42:51.382-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dump'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='crash'/><category scheme='http://www.blogger.com/atom/ns#' term='bsod'/><title type='text'>STOP 0x00000024</title><content type='html'>So I upgraded my machine some 2 or 3 months ago, and have reinstalled XP about 6 times or so. I keep getting a bunch of different blue screen stop codes. I tried getting minidumps and full crash dumps, then opening on WinDBG and tried to figure out what the problem is, but I can't find anything consistent. (I've got all kinds of red herrings, like issues with the antivirus, usb camera drivers, ntfs.sys, etc).&lt;br /&gt;&lt;br /&gt;So here are the main specs:&lt;br /&gt;CPU: Intel E8400&lt;br /&gt;MB: Gigabyte GA-P35-DS3L&lt;br /&gt;RAM: 2x1GB Patriot&lt;br /&gt;HD: SATA 500 GB Seagate (OS, Main), IDE 300 GB Maxtor (Backup)&lt;br /&gt;&lt;br /&gt;Obviously, latest drivers, XP SP3, etc. I've ran MemTest86 for nights in a row, no issues.&lt;br /&gt;&lt;br /&gt;So yesterday Windows Live FileShare crashed on me, and the machine wouldn't boot, showing a BSOD with the STOP 0x00000024 error (yet again). I looked up online, and most references pointed to the &lt;span style="font-weight: bold;"&gt;ntfs.sys&lt;/span&gt; file. So, I booted with my Linux SLAX CD, and tried to rename/remove the file and copy it from the WinXP installation disc. SLAX said it couldn't delete the file (I guess renaming in Linux is a copy-then-delete method).&lt;br /&gt;&lt;br /&gt;Crap. (I have a suspicion this is related to BioShock's DRM with the SecuROM method, since my hard drive shows crap even on Linux and can't open some folders where SecuROM is installed).&lt;br /&gt;&lt;br /&gt;So I rebooted from XP, see if I could get anywhere, and now I got a "NTLDR is missing" before windows even started.&lt;br /&gt;&lt;br /&gt;That's really bad.&lt;br /&gt;&lt;br /&gt;So I thought: "ok, let's bite the bullet and either run the recovery console, or reinstall WinXP &lt;span style="font-style: italic;"&gt;AGAIN&lt;/span&gt;."&lt;br /&gt;&lt;br /&gt;So I booted with the XP CD, and it showed my 500GB drive as "free space".&lt;br /&gt;&lt;br /&gt;Not good. I didn't backup everything!&lt;br /&gt;&lt;br /&gt;So I said, ok, maybe the SATA drive is bad, so let's install it to my trusty 300GB IDE drive. I did and then rebooted.&lt;br /&gt;&lt;br /&gt;As the first part of the XP installation finished, the machine rebooted and ran a CHKDSK on the D:\ drive (which now is the SATA, the bad one). It found and corrected a bunch of errors (like 15 or so). Then the second part of the XP installation began.&lt;br /&gt;&lt;br /&gt;At this point I thought: "Ok, I don't really want to lose my non-backed files, so maybe the SATA drive is &lt;span style="font-style: italic;"&gt;better&lt;/span&gt;?!?". So i turned off the machine while XP install was waiting on me to begin the second phase.&lt;br /&gt;&lt;br /&gt;I rebooted, and chose the SATA drive as the boot drive...&lt;br /&gt;&lt;br /&gt;And it works like nothing ever happened.&lt;br /&gt;&lt;br /&gt;The corrupt files on the c:\found.000 folder were MP3 files, so I did have a backup of those.&lt;br /&gt;&lt;br /&gt;So we'll see what happens next on this saga...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-6203483181915378684?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/6203483181915378684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=6203483181915378684' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/6203483181915378684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/6203483181915378684'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/10/stop-0x00000024.html' title='STOP 0x00000024'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-4468134637011901746</id><published>2008-09-28T14:19:00.000-07:00</published><updated>2008-10-07T09:53:56.565-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Program Defensively</title><content type='html'>There's nothing worse than running an optimized build, where the symbols are gone and the locals wrong, because an edge condition happened. And yes, we can play tough and decide that such cases are so rare, we don't put a check for it.&lt;br /&gt;&lt;br /&gt;And by Murphy's law, nothing happens the first six months; then you get a crash a couple of days before submitting to your publisher, and it will take the best guys in your team to track it. And very probably, a very simple edge condition will have caused this.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int * FunctionThatNeverFails( int nSlots, int * pOriginal )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  int * pNewData = new int[ nSlots ];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  memcpy( pNewData, pOriginal, nSlots * sizeof( int ) );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  return pNewData;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A lot of things can go wrong here. So let's look at the defensive function:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int * FunctionThatNeverFails( int nSlots, int * pOriginal )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  ASSERT( nSlots &gt; 0 );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  ASSERT( pOriginal != NULL );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  int * pNewData = new int[ nSlots ];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  ASSERT( pNewData != NULL );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  memcpy( pNewData, pOriginal, nSlots * sizeof( int ) );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  return pNewData;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Too much typing? Overkill?&lt;br /&gt;Yes, but it will trap a bunch of things we are sometimes lazy (or just too confident) won't happen at all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-4468134637011901746?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/4468134637011901746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=4468134637011901746' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4468134637011901746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4468134637011901746'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/09/program-defensively.html' title='Program Defensively'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-1025773191616726566</id><published>2008-09-22T10:36:00.001-07:00</published><updated>2008-10-07T09:55:16.953-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Preprocessor defines</title><content type='html'>Ok, so say you wrap your assert handler inside this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#define ASSERT( condition )    if( g_bEnableAsserts) { \ ShowDialogBox( #condition ); Break(); }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then you use it in your code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void MyFunction( int n, int m )&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;  ASSERT( n &gt;= 0 )&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;  ASSERT( m &lt;&gt;&lt;span style="font-family:courier new;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Notice the missing semicolon on the first assert? This will compile just fine, since if you expand the macro, it's a valid syntax. However, it makes it not look nice, and may cause confusion.&lt;br /&gt;&lt;br /&gt;To fix this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#define ASSERT( condition )    do{ if( g_bEnableAsserts) { \ ShowDialogBox( #condition ); Break(); } } while( 0 )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It doesn't look as nice, but the compile will now ask you to add the semicolon at the end.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-1025773191616726566?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/1025773191616726566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=1025773191616726566' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/1025773191616726566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/1025773191616726566'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/09/preprocessor-defines.html' title='Preprocessor defines'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-8026676994213602044</id><published>2008-09-18T09:35:00.001-07:00</published><updated>2008-10-07T09:55:07.331-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Post &amp; PreIncrement...</title><content type='html'>Please don't use post-increment. It is just evil.&lt;br /&gt;&lt;br /&gt;So use &lt;span style="font-weight: bold;"&gt;++i&lt;/span&gt; instead of &lt;span style="font-weight: bold;"&gt;i++&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Why?&lt;br /&gt;&lt;br /&gt;Because I've seen a *lot* of code like this:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int nValue = pData[ i++ % 32 ];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When they were clearly trying to do this:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int nValue = pData[ ++i % 32 ];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And actually, it should be even clearer:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;++i;&lt;br /&gt;int nIndex = i % 32;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;int nValue = pData[ nIndex ];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remember to code for readability!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(Bug fixed)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-8026676994213602044?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/8026676994213602044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=8026676994213602044' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/8026676994213602044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/8026676994213602044'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/09/post-preincrement.html' title='Post &amp; PreIncrement...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-5889668544292029167</id><published>2008-09-11T10:25:00.000-07:00</published><updated>2008-09-11T10:32:23.390-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cpu'/><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='cache'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><title type='text'>Beaten on __restrict</title><content type='html'>I had some drafts for writing about &lt;span style="font-weight: bold;"&gt;__restrict&lt;/span&gt;, but &lt;span style="font-style: italic;"&gt;Elan Ruskin&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;a href="http://assemblyrequired.wordpress.com/2008/07/08/load-hit-stores-and-the-__restrict-keyword/"&gt;wrote&lt;/a&gt; &lt;a href="http://assemblyrequired.wordpress.com/2008/09/06/more-on-__restrict/"&gt;two&lt;/a&gt; &lt;/span&gt;&lt;span&gt;excellent posts on his &lt;/span&gt;&lt;a href="http://assemblyrequired.wordpress.com/"&gt;&lt;span style="font-weight: bold;"&gt;Some Assembly Required&lt;/span&gt;&lt;/a&gt; blog.&lt;br /&gt;&lt;br /&gt;I guess you can read about it there :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-5889668544292029167?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/5889668544292029167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=5889668544292029167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5889668544292029167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5889668544292029167'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/09/beaten-on-restrict.html' title='Beaten on __restrict'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-5920529199459120101</id><published>2008-09-04T09:04:00.001-07:00</published><updated>2008-10-07T09:54:26.028-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><title type='text'>Programming is Art...</title><content type='html'>Despite being told otherwise most of the time, I firmly believe programming &lt;strong&gt;is&lt;/strong&gt; Art.&lt;br /&gt;&lt;br /&gt;Why?&lt;br /&gt;&lt;br /&gt;It is the process of translating abstract ideas, into concrete sequences of orders for a machine to follow. As such, it involves different trains of thought for each individual, different and unique ways to solve a problem or arrive to a result, much like painting or drawing/sketching. Each person will interpret the idea (problem), and express is based on his/her experience. That is what adds the human experience to it.&lt;br /&gt;&lt;br /&gt;Programs are never finished; just like sculptors and painters never feel really finished with their works. As you grow and become more experienced, as your sensibilities around the world change, as your ideasd mature, you find your previous work more childish and immature. You wish to go back and rewrite something you did or modify it to become perfect. However, it is an unattainable perfection. And that is what Art is all about.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Jeet_Kune_Do"&gt;"In every passionate pursuit, the pursuit counts more than the object pursued."&lt;/a&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-5920529199459120101?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/5920529199459120101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=5920529199459120101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5920529199459120101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/5920529199459120101'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/09/programming-is-art.html' title='Programming is Art...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-6223170114972315300</id><published>2008-08-29T11:24:00.000-07:00</published><updated>2008-08-29T11:28:57.336-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>DiffMerge</title><content type='html'>&lt;a href="http://www.sourcegear.com/diffmerge/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;DiffMerge&lt;/span&gt;&lt;/a&gt; is a wonderful diff tool for files and folders. And it's free! I actually changed my Perforce default tool (p4diff) to use it, since it shows &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;whitespace&lt;/span&gt; and per-character differences.&lt;br /&gt;&lt;br /&gt;I've heard people recommend &lt;span style="font-weight: bold;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;WinMerge&lt;/span&gt;&lt;/span&gt; too, but I think I can't do folders. On some things I'm working on, I need to check if code or assembly files changed between folders...&lt;br /&gt;&lt;br /&gt;My only complaint is that it doesn't do diffs on binary files. Shame! It'd be the greatest tool ever if it did show the hex values like on a Hex Editor and the strings, and mark the differences...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-6223170114972315300?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/6223170114972315300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=6223170114972315300' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/6223170114972315300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/6223170114972315300'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/08/diffmerge.html' title='DiffMerge'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-7712513109635246656</id><published>2008-08-29T11:14:00.000-07:00</published><updated>2008-08-29T11:18:56.876-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><category scheme='http://www.blogger.com/atom/ns#' term='stl'/><title type='text'>STL Allocators</title><content type='html'>Finally, a clearly explained and concise way to write your own &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;STL&lt;/span&gt; allocator... Courtesy of the &lt;a href="http://blogs.msdn.com/vcblog/archive/2008/08/28/the-mallocator.aspx"&gt;Visual C++ Team&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-7712513109635246656?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/7712513109635246656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=7712513109635246656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7712513109635246656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7712513109635246656'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/08/stl-allocators.html' title='STL Allocators'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-4888264608230344175</id><published>2008-08-15T20:51:00.000-07:00</published><updated>2008-08-17T22:53:20.881-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='industry'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Breaking into the industry...</title><content type='html'>Speaking from my personal experience, the biggest thing you can do to break into the industry is...&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Practice. Practice. Hands-on Practice.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;You probably can compare games programming to being a medical doctor: You can know all the theory, but until you have experienced staying long hours trying to diagnose the root of unrelated symptoms in order to fix a life-threatening problem, you can't say you are a doctor.&lt;br /&gt;&lt;br /&gt;Same thing (though maybe not as dramatic) applies to games programming.&lt;br /&gt;&lt;br /&gt;Yes, we have the guys fresh out of college that finished all their classes with an A+, know all the theory for figuring out if an algorithm is O(n log n) or O(log n), had a semester with functional languages and took some business classes too, who can't figure out what a bitfield is.&lt;br /&gt;&lt;br /&gt;Until you have been trying to diagnose a memory overwrite, tried to track a bad pointer, tried to figure out where the memory leak was caused, you really need to get more practice.&lt;br /&gt;&lt;br /&gt;The only way to get this is skills, is to write your own programs, write both high and low level stuff, fix any roadblocks you find, profile your code and try to optimize it.&lt;br /&gt;&lt;br /&gt;So here are some ideas for practicing on your own code:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Write your own stl-like classes: vector, list, map, stack. Clean them up so the interface is easy to use, and then optimize them. Check for memory leaks.&lt;/li&gt;&lt;li&gt;Write programs to parse different kinds of text files, like INI files, CSV files, etc.&lt;/li&gt;&lt;li&gt;Write an XML parser from scratch, only using the standard C runtime.&lt;/li&gt;&lt;li&gt;Write a program that parses simple math expressions (a calculator). Expand it so you can use and save variables.&lt;/li&gt;&lt;li&gt;Write you own standard C runtime library.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Good luck!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-4888264608230344175?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/4888264608230344175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=4888264608230344175' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4888264608230344175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4888264608230344175'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/08/console-memory.html' title='Breaking into the industry...'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-4364836094054549341</id><published>2008-08-11T12:33:00.000-07:00</published><updated>2008-08-11T12:49:13.191-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><title type='text'>C++ is dead?</title><content type='html'>I have a love/hate relationship with C++.&lt;br /&gt;&lt;br /&gt;There, I said it.&lt;br /&gt;&lt;br /&gt;C++ allows you to almost program to the metal, giving you extensions/intrinsics to code for the machine. It also allows you to use higher level constructs, like OOP and metaprogramming.&lt;br /&gt;&lt;br /&gt;But to write a simple task, it is quite a pain. You have to create a project, compile, link, add the libraries, etc... To use any string operations, you have to use STL which is slow sometimes.&lt;br /&gt;&lt;br /&gt;Sometimes I do like to write a quick &amp;amp; dirty script in Ruby to test something or for tools.&lt;br /&gt;&lt;br /&gt;What does this have to do with the "C++ is dead" title? A post from &lt;a href="http://c0de517e.blogspot.com/2008/08/small-update.html"&gt;C0DE517E&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;While I agree C++ is not the best language in the world, it still is relevant. Just ask any games tech lead, or senior engineer who has spent days optimizing an inner loop for CPU performance. C++ is still the way to go for games, since games programming by definition pushes the hardware to its limit. The problem with other languages is that the compiler/language/interpreter hides the hardware for you (which is good in a lot of other problem domains), but games in the end is making the specific hardware work for you.&lt;br /&gt;&lt;br /&gt;Yes, garbage collection is nice, but remember that consoles are embedded systems with limited resources. If you artists take up 85% of the available video ram in assets, you have to have control over the loading/unloading, not just hoping the garbage collector will get your hints and run when you tell it to.&lt;br /&gt;&lt;br /&gt;I agree some things are &lt;strong&gt;*really*&lt;/strong&gt; tedious to do in c++, and the syntax can be very not clear. But until somebody comes up with a language that is more powerful, allows you to program 'to the metal' and allows you to use better high-level constructs, while at the same time create optimized code that takes into consideration branch predictions, instruction pipelining and load-hit-stores, I think we're (to quote Larry David)&lt;a href="http://en.wikipedia.org/wiki/Curb_your_enthusiasm"&gt;"pretty, pretty, pretty pretty good!"&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-4364836094054549341?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/4364836094054549341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=4364836094054549341' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4364836094054549341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4364836094054549341'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/08/c-is-dead.html' title='C++ is dead?'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-645816131599717698</id><published>2008-08-04T10:34:00.000-07:00</published><updated>2008-08-04T10:46:33.310-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cpu'/><category scheme='http://www.blogger.com/atom/ns#' term='gpu'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><title type='text'>A Delicate balance between the CPU and GPU</title><content type='html'>&lt;p&gt;Modern day high-performance consoles are very interesting beasts.&lt;/p&gt;&lt;p&gt;Some of them have powerful GPUs, with very clever architectures oriented for high-performance games, while others have killer CPUs that, in order to produce the same results as other consoles, you have to offload some of the graphics processing into the CPU, which basically contradicts what the typical PC programmer is taught, which is to just throw stuff at the GPU and let it handle it.&lt;/p&gt;&lt;p&gt;You probably know what we're talking about here... The Cell processor is a very powerful machine, with the SPEs oriented at vector processing (just like the shader units in the GPU), while the PowerPC AltiVec multi-core architecture used on 'other' consoles is more general purpose. So it is quite a pain to develop high performance applications that work on both consoles.&lt;/p&gt;&lt;p&gt;On one console you have to basically help the GPU operations with some vector processors, but you have a lot of power... On the other you have this powerful GPU but the CPUs are more general purpose!&lt;/p&gt;&lt;p&gt;This is a great time to be in the games industry :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-645816131599717698?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/645816131599717698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=645816131599717698' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/645816131599717698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/645816131599717698'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/08/delicate-balance-between-cpu-and-gpu.html' title='A Delicate balance between the CPU and GPU'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-7557726631910228401</id><published>2008-07-30T15:26:00.000-07:00</published><updated>2008-07-30T15:29:10.600-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='movies'/><title type='text'>Finally checked out The Dark Knight</title><content type='html'>And it is awesome! Heath's performance is so great, it makes you uncomfortable, he really IS the sadistic Joker!&lt;br /&gt;&lt;br /&gt;Great plot, strong performances (except maybe for Christian Bale, who seems to be channeling Michael "Prision Break" Scoffield, whispering all the time) and excellent effects. Christopher Nolan outdid himself!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-7557726631910228401?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/7557726631910228401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=7557726631910228401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7557726631910228401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7557726631910228401'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/07/finally-checked-out-dark-knight.html' title='Finally checked out The Dark Knight'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-4104006686097204244</id><published>2008-07-20T20:39:00.000-07:00</published><updated>2008-07-23T09:45:18.629-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cpu'/><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='cache'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><title type='text'>CPU Cache Optimization for reading</title><content type='html'>Now, we can go further and take advantage of the cache instructions. We potentially know in advance how many nodes we'll need to read, and how many we'll need to write, right? So we can avoid the cache miss (or hide it) by prefetching the data that is needed:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void UpdateDataList( bool const* pReadData, int* pWriteData, int nNodes )&lt;br /&gt;{&lt;br /&gt;for( int i = 0; i &amp;lw; nNodes; i++, pReadList++, pWrite++ )&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;CPU_Prefetch( pReadData + 1 );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;em&gt;// Some condition that reads a member of the list&lt;/em&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if( *pReadData )&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;// Mark as dirty&lt;/em&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*pWriteData = 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;// Mark as not-changed&lt;/em&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*pWriteData = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;CPU_Prefetch is a wrapper for an intrinsic function (or plain assembly) that basically tells the CPU to start prefetching the data since it will be used in a later step. The first time it hits it it will not be fast enough to hit prefetch by the time it hits the if() statement; however, for large nNodes, the cache will start to be read in advance, and it will cause an improvement in performance.&lt;br /&gt;&lt;br /&gt;Note that on PowerPC architectures, CPU_Prefetch can be implemented using the &lt;em&gt;dcbt&lt;/em&gt; instruction.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-4104006686097204244?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/4104006686097204244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=4104006686097204244' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4104006686097204244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/4104006686097204244'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/07/cpu-cache-optimization-for-reading.html' title='CPU Cache Optimization for reading'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-9216571971699884902</id><published>2008-07-20T19:30:00.000-07:00</published><updated>2008-07-22T15:34:42.626-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cpu'/><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='cache'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><title type='text'>CPU Cache Optimization</title><content type='html'>In modern processors, access to memory is a big problem since the data has a long way to travel from system RAM all the way to a register inside the CPU so an operation can be performed. And what is a CPU but nothing to read data, perform an operation based on it, and write it out?&lt;br /&gt;&lt;br /&gt;When you ask for the contents of a memory location, some (or most) of the processors will actually read a chunk the address you requested, plus a chunk surrounding it. This is because the data transfers are usually initiated by a DMA request to the memory controller from the CPU.&lt;br /&gt;&lt;br /&gt;When the CPU executes a memory access instruction, a check is performed to see if that region of memory is in the cache. If it isn't then the memory is requested to the mem controller, while causing a cache miss.&lt;br /&gt;&lt;br /&gt;So, for example, let's say a particular processor reads 128 byte chunks. If you have a big object or structure, and only need to access a particular member, the CPU reads the closest 128 bytes (according to our example). So if you only read an int from that structure, you're wasting 124 bytes from that read.&lt;br /&gt;&lt;br /&gt;Let's say you write an int into that structure. The CPU will read a 128 byte chunk into the cache, then execute your write operation, and then send the chunk back to system memory.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example Problem&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;struct SMyData&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;char const* m_pDebugInfo;&lt;br /&gt;&amp;nbsp;&amp;nbsp;bool m_bReadData;&lt;br /&gt;&amp;nbsp;&amp;nbsp;int m_nWriteData;&lt;br /&gt;&amp;nbsp;&amp;nbsp;float m_fSomeDataNotNeededCurrently;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void UpdateDataList( SMyData* pList, int nNodes )&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;for( int i = 0; i &amp;lt; nNodes; i++, pList++ )&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;// Some condition that reads a member of the list&lt;/em&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if( pList-&amp;gt;m_bReadData )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;// Mark as dirty&lt;/em&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pList-&amp;gt;m_nWriteData = 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Seems like a pretty innocent function, right? The problem is when this is done too many times; this basically hammers the processor caches! If there were other threads performing memory accesses, the CPU(s) will have to stall until the memory controller can fill the L2 cache. And this happens quite a lot on games, specially with the current generation on CPUs. We're all moving to multi-core architectures, so there's almost a guarantee the CPU(s) will stall waiting for the L2 cache miss.&lt;br /&gt;&lt;br /&gt;So how do we fix it?&lt;br /&gt;&lt;br /&gt;We know the data format, right? We can see that out of the four member variables, only two are used. And one is used as read-only, while the other is used as write-only. We can help the CPU process this data in a cache friendly fashion. Basically, we want to tell the CPU to read some memory as read-only, and another as write only. So if we could somehow split the data...&lt;br /&gt;&lt;br /&gt;So if we could change to something like:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;void UpdateDataList( bool const* pReadData, int* pWriteData, int nNodes )&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;for( int i = 0; i &amp;lt; nNodes; i++, pReadData++, pWriteData++ )&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;// Some condition that reads a member of the list&lt;/em&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if( *pReadData )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;// Mark as dirty&lt;/em&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*pWriteData = 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By changing this, you are guaranteed a performance boost in your app. Of course, the readability of the source data will be compromised, since now you no longer have Arrays of Structures, but rather Structures of Arrays, but you can't have everything in the world, can you? And typically the need for this arises in tight loops inside the game.&lt;br /&gt;&lt;br /&gt;There's one extra optimization for the cache that we'll delve into on our next installment...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-9216571971699884902?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/9216571971699884902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=9216571971699884902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/9216571971699884902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/9216571971699884902'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/07/cpu-cache-optimization.html' title='CPU Cache Optimization'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1979176749314572541.post-7554563290892614294</id><published>2008-07-19T19:25:00.000-07:00</published><updated>2008-10-07T09:54:40.565-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='misc'/><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><title type='text'>Welcome!</title><content type='html'>Seems the world doesn't need another blog, and yet here we are... The main purpose of this blog is to share my thoughts and experiences on game programming and optimization, along with my views on software development, problem solving and misc stuff. Hopefully you'll find something interesting here!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How it all began (or how rock'n'roll dreams come through...)&lt;/strong&gt;&lt;br /&gt;I started programming at 11/12 years old, on a &lt;strong&gt;TRS-80 CoCo 3&lt;/strong&gt;, of course, starting with Basic. After a couple of years, I found a book about the &lt;strong&gt;6809&lt;/strong&gt; assembly, and wrote some small programs using "inline assembly" with Color Basic (aka POKE with DATA statements!). And of course, this was because I wanted to write my own games! About the same time, at our final year at elementary school, we got some Basic courses on a &lt;strong&gt;Commodore 64&lt;/strong&gt; with a hard disk! (This was a shock to me, as I only used the cassette to save my programs). Of course, I got my hands on a &lt;strong&gt;Commodore 64&lt;/strong&gt; assembly book, and tried to fiddle with the high-res graphics. Sad to report that I didn't get very far...&lt;br /&gt;&lt;br /&gt;Several years later my family got a very expensive PC, a 386SX 2MB of RAM and a 62 MB hard disk (Megabytes, you did read correctly). The possibilities were endless! I started with QBasic, and then jumped to using the debug.com program for writing my assembly programs... That mode 13h with 320x200x256 was awesome! I was also into electronic circuits and logic, so I got one of those Radio Shack 130-in-one electronics kits... Needless to say I burned the LEDs pretty quickly :)&lt;br /&gt;&lt;br /&gt;At this point I was hooked on &lt;strong&gt;Wolfenstein 3D&lt;/strong&gt;, made my jaw drop with it's graphics and framerate. I never got into Doom that much, I liked the Wolfenstein "story" and setting better... My goal was now to make a 3D game...&lt;br /&gt;&lt;br /&gt;Later on high school I had an introductory course on Pascal, and suddenly there was my language of choice! I could write inline assembly with it (Turbo Pascal 6.0) and also high-level code! Of course, the purpose of this was always to write games...&lt;br /&gt;&lt;br /&gt;College started, and I took a major on &lt;strong&gt;Electronics Systems Engineering&lt;/strong&gt;, pretty much Computer Engineering. I flew by all the CS courses, learned C++ &amp;amp; OOP and I was set... I also took a lot of advanced math and more CS classes, of which &lt;strong&gt;Compiler Construcion II&lt;/strong&gt; was my favourite.&lt;br /&gt;&lt;br /&gt;Somewhere through college &lt;strong&gt;id&lt;/strong&gt; released the &lt;strong&gt;Wolfenstein&lt;/strong&gt; source code, and I studied it obsessively. It was very weird to look at the guts of one of my favourite games. But I learned quite a few tricks from it!&lt;br /&gt;&lt;br /&gt;After college, went to an internship on MS, helped on some Powerpoint features, and then tried to break into the games industry... Which took me two years! During that time I worked as a Java engineer and kept working on my own demos, went to a &lt;strong&gt;SIGGRAPH&lt;/strong&gt; and took a shaders course and decided GPU programming was the area of games I would like to work on.&lt;br /&gt;&lt;br /&gt;I got my big break into the games industry, and been there ever since It's been a hard road, but very satisfying. I've learned a lot but there's still so much to learn!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What will I talk about&lt;/strong&gt;&lt;br /&gt;Hopefully not more about me :) I'll discuss real-world examples of performance, code organization, problems and some occasional rants.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What will I won't talk about&lt;/strong&gt;&lt;br /&gt;My employer(s), past &amp;amp; present, internal confidential information, NDA stuff, etc. Basically I'll only talk about publicly available stuff. I have bills to pay!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Obligatory &lt;/strong&gt;&lt;a href="http://blogs.msdn.com/oldnewthing/"&gt;&lt;strong&gt;"Raymond"&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; Clause/Disclaimer&lt;/strong&gt;&lt;br /&gt;These views and opinions are mine and only mine (the author), and do not necessarily reflect those of my current or past employer(s) official (or unofficial) position on anything. I'm here just to share what I can share and learn from others.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What blogs do I read&lt;/strong&gt;&lt;br /&gt;Of course, I'm trying to &lt;a href="http://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants"&gt;stand on the shoulders of giants&lt;/a&gt;, so here's the blogs I read on a regular (*cough* daily *cough*) basis (in no particular order):&lt;br /&gt;&lt;a href="http://www.codinghorror.com/blog/"&gt;Jeff Atwood's Coding Horror&lt;/a&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/oldnewthing/default.aspx"&gt;Raymond Chen's The Old New Thing&lt;/a&gt;&lt;br /&gt;&lt;a href="http://herbsutter.wordpress.com/"&gt;Herb Sutter's Mill&lt;/a&gt;&lt;br /&gt;&lt;a href="http://home.comcast.net/%7Etom_forsyth/blog.wiki.html"&gt;Tom Forsyth's Tech Blog&lt;/a&gt;&lt;br /&gt;&lt;a href="http://blogs.technet.com/markrussinovich/default.aspx"&gt;Mark Russinovich's Blog&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.joelonsoftware.com/"&gt;Joel Spolsky on Software&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.game-ism.com/"&gt;game-ism.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve-yegge.blogspot.com/"&gt;Steve Yegge's Blog Rants&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope to see you around here!&lt;br /&gt;- R&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1979176749314572541-7554563290892614294?l=rcaloca.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rcaloca.blogspot.com/feeds/7554563290892614294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1979176749314572541&amp;postID=7554563290892614294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7554563290892614294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1979176749314572541/posts/default/7554563290892614294'/><link rel='alternate' type='text/html' href='http://rcaloca.blogspot.com/2008/07/welcome.html' title='Welcome!'/><author><name>R Caloca</name><uri>http://www.blogger.com/profile/15408750277652548588</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
