<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0UMQHk9fSp7ImA9WxNUF0U.&quot;"><id>tag:blogger.com,1999:blog-27963633</id><updated>2009-11-09T11:48:01.765-05:00</updated><title>Tao Te Ka-Ching</title><subtitle type="html">Working the cash register of the great Tao...</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://taotekaching.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>61</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/TaoTeKaChing" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;A04GRno5eyp7ImA9WxJRFks.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-7403300541254364202</id><published>2009-05-18T14:05:00.001-04:00</published><updated>2009-05-18T14:05:27.423-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-18T14:05:27.423-04:00</app:edited><title>A New Home…And Me</title><content type="html">&lt;p&gt;&lt;font size="5"&gt;To all subscribers (I think there’s 2 of you), I am now at:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.taotekaching.com"&gt;&lt;font size="5"&gt;http://www.taotekaching.com&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="5"&gt;Thank you,&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="5"&gt;~ZagNut&lt;/font&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-7403300541254364202?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/kiYHT7_e_JI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/7403300541254364202/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=7403300541254364202&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/7403300541254364202?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/7403300541254364202?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/kiYHT7_e_JI/new-homeand-me.html" title="A New Home…And Me" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/05/new-homeand-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEHRns4cSp7ImA9WxJSGE4.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-6498317817493258379</id><published>2009-05-08T21:45:00.001-04:00</published><updated>2009-05-08T21:47:17.539-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-08T21:47:17.539-04:00</app:edited><title>My Foot Surgery, Pooping, and Me…End of Week 3</title><content type="html">&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;WARNING!&amp;#160; HOT ACTION GRUESOME SURGERY PICS BELOW!!!&lt;/font&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So &lt;a href="http://taotekaching.blogspot.com/2009/04/foot-surgery-and-meweek-1-finale-and.html"&gt;my last, long post&lt;/a&gt; was a detailed recap of that first week: the surgery process, some minor tidbits about home, having cast put on, etc.&amp;#160; A whole lot of nothing has happened during the following two weeks.&amp;#160; And yet, so much &lt;em&gt;has&lt;/em&gt; happened.&lt;/p&gt;  &lt;p&gt;For anyone who may stumble upon these pages doing some personal research before their own surgery, I can assure you that pooping can be an extraordinarily painful and exhausting event.&amp;#160; I need an analogy or some other tool to proceed…&lt;/p&gt;  &lt;p&gt;I never knew what heartburn was.&amp;#160; I didn’t even &lt;em&gt;know&lt;/em&gt; I didn’t know what heartburn was until I had a bunch of stress-related indigestion going on – lots of belching and farting and basically uncomfortable gas in my stomach that eventually became intolerable.&amp;#160; When it started getting to that point, I assumed that I had heartburn or acid reflux or something, and began popping the Tums.&lt;/p&gt;  &lt;p&gt;Then came the moment when, in the peak of the glory of my stress at that time (another story for another day), my sternum and anything underneath would occasionally suddenly become awash in a hot, fiery pain.&amp;#160; Ergo, heartburn.&amp;#160; I now &lt;em&gt;know&lt;/em&gt; what heartburn is.&lt;/p&gt;  &lt;p&gt;I still am not sure what constipation is.&amp;#160; But if it is anything like what began at the tail end of week 1 through to today (so far), I’d rather have heartburn, daily, several times a day, for 10 minutes each time.&lt;/p&gt;  &lt;p&gt;For lack of a better phrase, after surgery I did not shit for the first week.&amp;#160; Apparently that’s normal, as the anesthesia leaves your system (I guess).&amp;#160; My wife got some Colace stool softener tablets, that you can take up to 3 a day.&amp;#160; By the end of week 1, I was well into my 3-a-day.&amp;#160; Then it came.&amp;#160; After 5 minutes of using my walker and toilet seat riser and various other equipment to get me situated in my bathroom, I finally initiated the event.&lt;/p&gt;  &lt;p&gt;And man oh man, it was an event.&amp;#160; A grip-the-walls, sweat-pouring-down-forehead, vein-popping, horrible event.&amp;#160; I guess it was painful.&amp;#160; I don’t exactly remember.&amp;#160; My mind has blocked out that memory.&amp;#160; And the several memories since.&amp;#160; Out of maybe 10 shits since then (including that one), I think 2 were “ok”, even typical-relief fulfilling.&amp;#160; The rest of them, and absolutely that first one…ugh.&amp;#160; Not fun, folks.&amp;#160; In any way, shape, or form.&lt;/p&gt;  &lt;p&gt;Speaking of pain, when I had my cast put on, the resident basically wrapped my calf and foot – all of that – first with a soft, thick cotton wrapping, then this colored gauze (you can pick your color) that hardened pretty quickly after.&amp;#160; Quick, convenient, done.&amp;#160; Problem was, my money-shot wound on the outside of my foot (see pics below, or from &lt;a href="http://taotekaching.blogspot.com/2009/04/foot-surgery-and-meweek-1-finale-and.html"&gt;here&lt;/a&gt;) hadn’t finished bleeding / seeping, and that seepage was partly absorbed by the cotton padding, where it dried and connected to whatever was “drying” at the seepage point on my wound.&lt;/p&gt;  &lt;p&gt;Now, I’ve been applying cold-packs behind my knee pretty much the entire time to help with the swelling.&amp;#160; And help with the swelling it did.&amp;#160; In fact, my calf / foot de-swelled in my cast enough to allow fairly good movement to happen in there.&amp;#160; Ergo, the cast-to-wound-seepage-bridge would move and tug on the wound.&lt;/p&gt;  &lt;p&gt;This was an interesting pain, interesting in that I “knew” exactly how to describe it when it first introduced itself to me in all its glory.&amp;#160; For some reason, immediately I just knew what it would be like to have a clump of maybe 10 to 20 yellowjackets gnawing and stinging a particular area of one’s foot, and just sitting there letting them do that.&amp;#160; The vicodin was quickly replaced by the oxycodone, and the oxycodone, I am almost positive, helped pooping become difficult again.&amp;#160; Even though I had only some 10 days until the cast would be removed to have the sutures out, we made an appointment to have the cast “changed”, as this cycle was becoming unbearable.&lt;/p&gt;  &lt;p&gt;And so, some &lt;font color="#ff0000"&gt;&lt;strong&gt;FRESH PICS!&lt;/strong&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;#160; You’ll have to forgive me – my wife and I forgot our good camera, and she ran off with Liam while I dealt with the wait, etc.&amp;#160; These are me trying to get decent shots with my Palm Centro camera.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SgTgSA4gwZI/AAAAAAAAAT4/DiF_RMZ1NNU/s1600-h/foot%20stuck%201%5B5%5D.jpg"&gt;&lt;img title="The Clump" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="547" alt="The Clump" src="http://lh3.ggpht.com/_TWT435FEB_Y/SgTgSmyMC1I/AAAAAAAAAT8/q82XmOE4lws/foot%20stuck%201_thumb%5B3%5D.jpg?imgmax=800" width="449" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Ok, this one’s pretty good.&amp;#160; They just removed the cast with this strange saw device.&amp;#160; Here’s the gauze-seepage-clump.&amp;#160; They poured cold water over it to get it to loosen.&amp;#160; That felt so good, it just, it was just indescribable.&amp;#160; Here’s a close up of that clump:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/SgTgS4fqB3I/AAAAAAAAAUA/qLMJtzo_pps/s1600-h/foot%20stuck%202%5B6%5D.jpg"&gt;&lt;img title="The Clump Up Close" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="442" alt="The Clump Up Close" src="http://lh4.ggpht.com/_TWT435FEB_Y/SgTgSwqEsJI/AAAAAAAAAUE/aZ1ucqXvzVc/foot%20stuck%202_thumb%5B4%5D.jpg?imgmax=800" width="455" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SgTgTKZUgwI/AAAAAAAAAUI/ghhHxSu0HMc/s1600-h/inside%20scar%5B8%5D.jpg"&gt;&lt;img title="inside scar" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="203" alt="inside scar" src="http://lh5.ggpht.com/_TWT435FEB_Y/SgTgTQNjNYI/AAAAAAAAAUM/haqvvoqej_A/inside%20scar_thumb%5B6%5D.jpg?imgmax=800" width="244" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So here’s the scar on the inside of my foot.&amp;#160; These pictures, I can assure you, don’t do this any justice.&amp;#160; Very delicious.&amp;#160; Fairly bruised / purplish, but still very little pain from this area.&lt;/p&gt;  &lt;p&gt;Here’s a zoom up for you (click to get it large!)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SgTgTgJCPAI/AAAAAAAAAUQ/EhDqOe3k6lk/s1600-h/inside%20scar%202%5B28%5D.jpg"&gt;&lt;img title="inside scar 2" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="181" alt="inside scar 2" src="http://lh5.ggpht.com/_TWT435FEB_Y/SgTgTteSeRI/AAAAAAAAAUU/NIJjmWVTAaY/inside%20scar%202_thumb%5B26%5D.jpg?imgmax=800" width="184" align="right" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Oh yeah…And now, the Clump uncovered!&amp;#160; You are all very lucky, because this was really the only good picture I got of this horrid place, otherwise you’d be plagued by many gross close-ups.&amp;#160; You can see “The Lips” there at the heel.&amp;#160; I have no idea what that puncture-looking hole thing is farther up.&amp;#160; Some of the seepage had dried on my foot, which is the brown “staining” at the bottom.&amp;#160; They were kind enough to wipe it off a little.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/SgTgT2AiyDI/AAAAAAAAAUY/H4F9J7DQHQY/s1600-h/YUK%5B3%5D.jpg"&gt;&lt;img title="YUK" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="244" alt="YUK" src="http://lh3.ggpht.com/_TWT435FEB_Y/SgTgUB7GXmI/AAAAAAAAAUc/GMVvpLHVvgI/YUK_thumb%5B1%5D.jpg?imgmax=800" width="166" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This area blows.&amp;#160; It hurts, it’s gross, it’s still swollen, it can’t get comfortable, ever. However, it will all be &lt;em&gt;awesome&lt;/em&gt; with sandals on!&lt;/p&gt;  &lt;p&gt;You can also see, barely, the small entry point on the heel for what I presumed is the screw they put in.&amp;#160; This area is a consistent, annoying throb of pain.&amp;#160; If one true factoid can be said: bones don’t like having screws put in or through them.&lt;/p&gt;  &lt;p&gt;I’m excited, though.&amp;#160; The picture of the scar on the inside of my foot clearly shows my new arch.&amp;#160; And my whining of the pain is most of the time just being a bit over dramatic.&amp;#160; That stupid outside, money-shot area (in particular the dark spot / hole place) stings relentlessly, but you do get used to it.&amp;#160; The heel / screw as well, just not as easy to ignore I think, but it is less frequent than the other stuff.&amp;#160; Newly, though, is a general ankle-bones pain.&amp;#160; As things are hurting less, I am a little more liberal when doing what I can.&amp;#160; Just climbing into bed to do this post, I put weight on the ankle area of the cast or something, and my ankle &lt;em&gt;screamed&lt;/em&gt; out in pain.&lt;/p&gt;  &lt;p&gt;So, May 14 (only 6 days!) I get my sutures out.&amp;#160; I have been working from home these last two weeks (ideal for a software developer!), which was a fresh change from massive hours of Fallout 3.&amp;#160; This has kept me good and busy, but I’m very ready to be physically back this Monday.&amp;#160; I will say that it is probably different for everyone, but being up in this bedroom for a good 3 weeks…I am going slightly mad.&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:73b2b888-ad6e-4d72-8d23-44094b6c6434" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/foot+reconstruction" rel="tag"&gt;foot reconstruction&lt;/a&gt;,&lt;a href="http://technorati.com/tags/surgery" rel="tag"&gt;surgery&lt;/a&gt;,&lt;a href="http://technorati.com/tags/vicodin" rel="tag"&gt;vicodin&lt;/a&gt;,&lt;a href="http://technorati.com/tags/oxycodone" rel="tag"&gt;oxycodone&lt;/a&gt;,&lt;a href="http://technorati.com/tags/pooping" rel="tag"&gt;pooping&lt;/a&gt;,&lt;a href="http://technorati.com/tags/stool+softener" rel="tag"&gt;stool softener&lt;/a&gt;,&lt;a href="http://technorati.com/tags/colace" rel="tag"&gt;colace&lt;/a&gt;,&lt;a href="http://technorati.com/tags/constipation" rel="tag"&gt;constipation&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Fallout+3" rel="tag"&gt;Fallout 3&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/27963633-6498317817493258379?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/0VqJYWd6Yrc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/6498317817493258379/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=6498317817493258379&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/6498317817493258379?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/6498317817493258379?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/0VqJYWd6Yrc/my-foot-surgery-pooping-and-meend-of.html" title="My Foot Surgery, Pooping, and Me…End of Week 3" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/05/my-foot-surgery-pooping-and-meend-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4NQHo_cSp7ImA9WxJTF0s.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-3817910035128303392</id><published>2009-04-26T14:03:00.001-04:00</published><updated>2009-04-26T14:03:11.449-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-26T14:03:11.449-04:00</app:edited><title>Foot Surgery and Me…Week 1 finale, and week 2 begins!</title><content type="html">&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;WARNING!&amp;#160; HOT ACTION GRUESOME SURGERY PICS BELOW!!!&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Greetings!&amp;#160; Now that I’m &lt;em&gt;much&lt;/em&gt; more coherent, I’m going to start off week 2 with a recap of week 1.&amp;#160; This will be a rather long post, and is meant for people like me who searched out blogs for information on having surgery done, in general, and having foot surgery done, in particular.&amp;#160; I know I’ve made a few posts, but they most certainly were done while on super loopy drugs.&amp;#160; Here’s a &lt;em&gt;full&lt;/em&gt; recounting of last week for your reading pleasure.&lt;/p&gt;  &lt;p&gt;We went in to Same Day Surgery on Monday April 20 at 5:00am.&amp;#160; A few people were already in the waiting room, but more would arrive in the following 30 to 45 minutes.&amp;#160; Nothing special about the room; just a typical hospital / clinic waiting room.&lt;/p&gt;  &lt;p&gt;I, like everyone else there, eventually had my name called out to get me registered with my wrist strap and sign consent to treatment forms.&amp;#160; This took a few minutes, and I returned to the waiting room.&amp;#160; After only maybe 10 more minutes, I was called out again, this time to go to a curtained off “room” much like the ones they’ll put you in for an Emergency check-in.&amp;#160; Here I changed into my gown and had some initial tests done: blood taken, vitals, etc.&amp;#160; Then, it gets trippy…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_TWT435FEB_Y/SfSh0FPGTTI/AAAAAAAAATE/RVS_HhFQNv0/s1600-h/view0me%5B3%5D.jpg"&gt;&lt;img title="ZagNut on his walker" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="244" alt="ZagNut on his walker" src="http://lh3.ggpht.com/_TWT435FEB_Y/SfSh0UKVzjI/AAAAAAAAATI/5L6ChyejeWA/view0me_thumb%5B1%5D.jpg?imgmax=800" width="188" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So, finally I am wheeled to a pre-surgery staging area.&amp;#160; To this point, my wife had been with me, and I cannot tell you how good that is on the psyche until it’s taken away.&amp;#160; I end up being the first into this pre-surgery triage area place.&amp;#160; Slowly, over the next hour, everyone I’d seen in the Same Day Surgery room eventually gets wheeled into here.&amp;#160; We’re lined up, two rows facing each other, on the rolling gurney bed things in our gowns and stretch caps.&amp;#160; A woman about to have back surgery gets a fair amount of attention from a very attractive blonde doctor or resident.&amp;#160; An anesthesiologist comes in and asks me a few questions.&amp;#160; He’s quite arrogant so he brushes off my questions quickly.&amp;#160; More and more doctors, residents, and nurses show up.&amp;#160; Everyone’s bullshitting, having coffee, all around these two lines of people in gowns scared shitless.&lt;/p&gt;  &lt;p&gt;My surgeon shows up, talking to the arrogant anesthesiologist about how some clinic or whatever performed 25 heart surgeries in one day.&amp;#160; He breaks from the story long enough to say hi, shake my hand, and, after &lt;strong&gt;&lt;em&gt;asking me&lt;/em&gt;&lt;/strong&gt; which foot we were doing, draws his initials on my ankle above my left foot.&amp;#160; Up to this point, I had been asked &lt;em&gt;repeatedly&lt;/em&gt; which foot we were operating on; so much so that I was beginning to wonder myself.&amp;#160; I was told later why, but cannot remember.&lt;/p&gt;  &lt;p&gt;Another anesthesiologist shows up: an attractive, cheery but soft-spoken woman, and begins getting my IV’s hooked up.&amp;#160; Apparently her father had passed away a week or so earlier.&amp;#160; I expressed my condolences, and she was thankful, eager to have another ear to talk about it with.&amp;#160; I didn’t give a shit either way, I was just scared shitless and in a surreal awe of the “casualness” of these doctors starting their day down here.&amp;#160; I’m not sure how long the woman and I talked, as she apparently administered the actual goods.&lt;/p&gt;  &lt;p&gt;The next thing I knew, my wife and someone (a nurse?) were looking down at me asking how I felt.&amp;#160; As I recall, pretty fucking good.&amp;#160; I slept on and off over the evening there, and towards the following day, my foot began to make it’s slight rage known.&amp;#160; I’d hit a button, and my foot calmed down quickly (as did the rest of me).&lt;/p&gt;  &lt;p&gt;So the next morning, I was pretty cocky and “ready to go home,” since I was managing the pain so well.&amp;#160; Here is one place I fucked up pretty badly: if you have the opportunity to stay an extra night, do it.&amp;#160; Everyone, including my doctor, seemed psyched that I seemed to be doing so well (notice how much the word “seemed” is showing up).&amp;#160; A physical therapist showed up with a walker (I think I was asked which I wanted to use: the walker is &lt;em&gt;definitely&lt;/em&gt; the right choice) had me go down the hall, go up and down a few steps on my butt, then back to my bed.&amp;#160; I was soaked in sweat by the time we got back, and my foot was beginning to foreshadow to me that I haven’t felt anything yet.&amp;#160; Perhaps a set of pictures will show better than I can explain &lt;em&gt;why&lt;/em&gt; my foot was fairly pissed off (plus, a quick break from the book being written here):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_TWT435FEB_Y/SfSh02UMOoI/AAAAAAAAATM/bRjPPx6zwIw/s1600-h/view2%5B4%5D.jpg"&gt;&lt;img title="The Lips" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="398" alt="The Lips" src="http://lh5.ggpht.com/_TWT435FEB_Y/SfSh1MgMneI/AAAAAAAAATQ/3jPAlu_orPs/view2_thumb%5B2%5D.jpg?imgmax=800" width="445" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;These pictures were taken on a follow-up appointment some four days after the surgery.&amp;#160; This delicious first entry to our set of pictures my wife has given the lovely name “The Lips.”&amp;#160; I almost vomited hearing that name, because &lt;em&gt;damn&lt;/em&gt; that’s gross.&amp;#160; Anyway, not sure what they were doing from this side, possibly the fusion of my metatarsal, who knows.&amp;#160; I &lt;em&gt;do&lt;/em&gt; know that I my “heel” was broken in two places, so maybe this was one of the points to get at that heel.&amp;#160; I am also 90% sure I never once “felt” this one.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_TWT435FEB_Y/SfSh1qZBVLI/AAAAAAAAATU/o0gvSxRCCzg/s1600-h/view3%5B3%5D.jpg"&gt;&lt;img title="Cadaverous looking heel shot" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="218" alt="Cadaverous looking heel shot" src="http://lh6.ggpht.com/_TWT435FEB_Y/SfSh14aSFuI/AAAAAAAAATY/ES854tDnpPs/view3_thumb%5B1%5D.jpg?imgmax=800" width="244" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Speaking of my heel, I’m guessing this is where the screw(s) were put in.&amp;#160; This picture is weird to me also, since it’s the only one that show’s the yellow dye of their surgery-prep stuff.&amp;#160; For some reason you can’t see that coloring on any of the other pictures.&amp;#160; I &lt;em&gt;did&lt;/em&gt; feel this one – a frequent, droning ache that I did not enjoy.&amp;#160; I’d give this maybe 30% to 40% of my discomfort, if not more.&amp;#160; Note The Lips &amp;lt;gag&amp;gt;…&lt;/p&gt;  &lt;p&gt;But now, without further ado, the real money shot:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SfSh2FYM0dI/AAAAAAAAATc/3ezcthxmOAs/s1600-h/view1%5B8%5D.jpg"&gt;&lt;img title="Oh yeah..." style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="347" alt="Oh yeah..." src="http://lh5.ggpht.com/_TWT435FEB_Y/SfSh2d2v3EI/AAAAAAAAATg/_gczajJ5Qkw/view1_thumb%5B4%5D.jpg?imgmax=800" width="450" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;“Oh whatever, that’s not &lt;em&gt;that&lt;/em&gt; gross!”&amp;#160; Yeah okay.&amp;#160; I went ahead and made sure my wife got a good close up of this one.&amp;#160; If I had to guess, I’d say this is the entry point for a vast majority of the work he did.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SfSh2ieWvuI/AAAAAAAAATk/Afh7qjUxfFw/s1600-h/view1b%5B6%5D.jpg"&gt;&lt;img title="The Real Lips" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="409" alt="The Real Lips" src="http://lh4.ggpht.com/_TWT435FEB_Y/SfSh3PivQzI/AAAAAAAAATo/6H1y8t5arDE/view1b_thumb%5B4%5D.jpg?imgmax=800" width="454" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Oh yeah.&amp;#160; That’s just delicious.&amp;#160; And actually, I screwed up.&amp;#160; &lt;em&gt;This&lt;/em&gt; is what Joey referred to as The Lips.&amp;#160; Apparently, this lovely spot had quite a bit of discharge, that seeped through my initial padding / cast onto my pillows at the hospital.&amp;#160; This guy definitely contained all the rest of my discomfort.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_TWT435FEB_Y/SfSh3XidmII/AAAAAAAAATs/LDAZEU2Toy4/s1600-h/view0liam%5B6%5D.jpg"&gt;&lt;img title="Liam on my walker" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="463" alt="Liam on my walker" src="http://lh5.ggpht.com/_TWT435FEB_Y/SfSh3ucCsRI/AAAAAAAAAT0/dMOQNpdDcPg/view0liam_thumb%5B4%5D.jpg?imgmax=800" width="453" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Shameless inclusion of my fat little man, Liam!&amp;#160; He definitely likes to play with poppa’s walker, which blows when poppa is at the other end of the room and needs to get it.&lt;/p&gt;  &lt;p&gt;So anyway, we get me home.&amp;#160; I’m skipping dealing with the extraordinarily douche bag escort who didn’t know how to use a wheelchair, and the absolutely extraordinary amount of pain that flashed through my body when I accidentally put some weight down on that foot.&amp;#160; All happened just getting me into the car to get me home.&amp;#160; My recommendation here: whoever’s helping you needs to be patient.&amp;#160; In hindsight, we should have just found the front entrance, gotten wheeled down to there, and waited there for Joey to get her car.&amp;#160; We instead tried to be practical and wheel me to the garage, where Joey would get her car and pick me up.&amp;#160; It’s not that the garage was inconvenient, just obviously foreign territory to our “escort”.&amp;#160; Also, some woman parked her minivan in front of the ramps, and so forth.&amp;#160; Whatever.&amp;#160; We get me home.&lt;/p&gt;  &lt;p&gt;The pain decides now to make itself fully known.&amp;#160; And boy, does it hurt.&amp;#160; We get me up into the bed upstairs and throw two oxycodones down my throat.&amp;#160; Didn’t really help.&amp;#160; Three hours later, threw two more oxys down my throat.&amp;#160; This, combined with shear exhaustion from the newfound pain and effort to just move around, much less go upstairs, finally did something.&amp;#160; I passed out.&lt;/p&gt;  &lt;p&gt;Weird, WEIRD dreams on that oxycodone.&amp;#160; I also took the opportunities this surgery afforded me to quit smoking.&amp;#160; I definitely didn’t consciously give a shit about smoking throughout the week, but occasionally a super-mega-realistic oxycodone day dream would come along and make me wonder why I’d be smoking in the house when Joey wouldn’t allow it.&amp;#160; I’d get in a big fight with myself about how I really screwed up and was gonna use this time to quit finally, and now here I am smoking in our bedroom without a care in the world.&amp;#160; What a douche I am.&amp;#160; Then I’d wake up to take a few sips of water and formally think through my counter-arguments to my smoking self-berating.&amp;#160; I’d be all fully prepped, pop a few oxys and, just before passing out again, suddenly become very, very confused with what the hell was going on.&amp;#160; Kind of fun, I guess.&amp;#160; I’ve since switched to Vicodin, being a little leery of oxycodone’s wonderous powers.&amp;#160; For the first week, the oxy was needed for sure, though, don’t get me wrong there.&lt;/p&gt;  &lt;p&gt;So my super media center lasted one day.&amp;#160; I decided, in an oxy-haze that I wanted to work on my laptop on my big, comfy recliner.&amp;#160; So Joey did the best she could disassembling my super setup so I could work for maybe 10 minutes on my laptop before falling asleep.&amp;#160; I streamed two episodes of Harvey Birdman through it.&amp;#160; That’s all.&lt;/p&gt;  &lt;p&gt;The Playstation 3 is a godsend, and Fallout 3 was made for inert surgery times.&amp;#160; And that’s really where I’m at now.&amp;#160; PS3, Fallout 3, and in a solid cast until May 14 or so.&amp;#160; The posts should be &lt;em&gt;way&lt;/em&gt; shorter now.&amp;#160; Just trying to get as detailed as possible, should anyone else be researching having the same or similar surgery done to their feet.&lt;/p&gt;  &lt;p&gt;Now, back to Fallout 3.&amp;#160; Cheers…&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:63385c1d-8c2d-4b08-a91f-5f79501cf3e2" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/surgery" rel="tag"&gt;surgery&lt;/a&gt;,&lt;a href="http://technorati.com/tags/oxycodone" rel="tag"&gt;oxycodone&lt;/a&gt;,&lt;a href="http://technorati.com/tags/vicodin" rel="tag"&gt;vicodin&lt;/a&gt;,&lt;a href="http://technorati.com/tags/foot+reconstruction" rel="tag"&gt;foot reconstruction&lt;/a&gt;,&lt;a href="http://technorati.com/tags/fallout+3" rel="tag"&gt;fallout 3&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ps3" rel="tag"&gt;ps3&lt;/a&gt;,&lt;a href="http://technorati.com/tags/harvey+birdman" rel="tag"&gt;harvey birdman&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/27963633-3817910035128303392?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/GRXOwivVvyY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/3817910035128303392/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=3817910035128303392&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/3817910035128303392?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/3817910035128303392?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/GRXOwivVvyY/foot-surgery-and-meweek-1-finale-and.html" title="Foot Surgery and Me…Week 1 finale, and week 2 begins!" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/04/foot-surgery-and-meweek-1-finale-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4MRHk-eip7ImA9WxJTFEQ.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-6342304609160828525</id><published>2009-04-23T10:29:00.001-04:00</published><updated>2009-04-23T10:29:45.752-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-23T10:29:45.752-04:00</app:edited><title>Finally, a clue, and Me…</title><content type="html">&lt;p&gt;So these past three days have been something else, I’ll tell you!&amp;#160; First of all, I quit smoking, so I was going through some sort of withdrawals there.&amp;#160; The pain at times was extraordinary, leaving me incredibly exhausted pretty much all day.&amp;#160; We’d counter this with two oxycodone about every four hours.&amp;#160; Basically with all this simultaneously going on, doing anything other than sleeping was a waste of time.&amp;#160; I’d try to play PS3 and simply forget what I was playing.&amp;#160; My super media setup went kaput once or twice and my oxy-mind only made it worse.&lt;/p&gt;  &lt;p&gt;Today, though, I feel more on top of it, even with the oxycodone.&amp;#160; I think the quitting smoking was really making life weird there, not that I was jonesing or anything, but I could tell a great cloudy-headed confusion was permeating all other aspects of my suffering.&amp;#160; Still doing fine on that, btw.&lt;/p&gt;  &lt;p&gt;I know my typing etc is quite poor right now.&amp;#160; I’m having a hard time still concentrating even on this dumb post.&amp;#160; I see Dr. Wukich at around 2:00 today.&amp;#160; I’m gonna see if I can score some xray images.&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-6342304609160828525?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/6VRajzlpUxU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/6342304609160828525/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=6342304609160828525&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/6342304609160828525?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/6342304609160828525?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/6VRajzlpUxU/finally-clue-and-me.html" title="Finally, a clue, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/04/finally-clue-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4FRHw7eSp7ImA9WxJTFE4.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-872223816133363979</id><published>2009-04-22T17:15:00.001-04:00</published><updated>2009-04-22T17:15:15.201-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-22T17:15:15.201-04:00</app:edited><title>My Left Foot, Extreme Pain, and Me…</title><content type="html">&lt;p&gt;So I believe in my last entry I said I couldn’t wait for my surgery, cause I had such a bad ass media center setup and games and and and…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/Se-I1Nq6CfI/AAAAAAAAASs/yeLbK1VHVV4/s1600-h/FOOT%5B3%5D.png"&gt;&lt;img title="FOOT" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="418" alt="FOOT" src="http://lh5.ggpht.com/_TWT435FEB_Y/Se-I1xr2LCI/AAAAAAAAASw/HDQUknyZ2RY/FOOT_thumb%5B1%5D.png?imgmax=800" width="446" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;First of all, if they suggest you stay an extra night, stay the extra night.&amp;#160; Most likely it’s because your anesthesia is about to wear off and they can help control the pain better.&amp;#160; This is my hunch, anyways.&amp;#160; It’s a hunch based on being up all night moaning in retardedly bad pain.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/Se-I2aHIRmI/AAAAAAAAAS0/QPRL-3sOq6U/s1600-h/FOOT2%5B4%5D.png"&gt;&lt;img title="FOOT2" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="375" alt="FOOT2" src="http://lh4.ggpht.com/_TWT435FEB_Y/Se-I3H-QHMI/AAAAAAAAAS4/9UaxnvUiECI/FOOT2_thumb%5B2%5D.png?imgmax=800" width="456" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The oxycodin wasn’t doing shit.&amp;#160; I couldn’t get comfortable to sleep (I decided to quit smoking too with all this).&amp;#160; They say to elevate your foot to lessen pain.&amp;#160; I am finding that &lt;em&gt;every&lt;/em&gt; time I do that, I get a good massive 10+ minutes of ouch.&amp;#160; A nice hard steady surface seems to be what the doctor ordered.&amp;#160; I’ll have my foot up on like 6 pillows, and it starts screaming at me as if I’m squeezing it or something.&amp;#160; Soon as I take it off and just lie it on the bed, everybody seems calm for awhile.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/Se-I384eN3I/AAAAAAAAAS8/T-HU72PNiZU/s1600-h/FOOT3%5B3%5D.png"&gt;&lt;img title="FOOT3" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="344" alt="FOOT3" src="http://lh4.ggpht.com/_TWT435FEB_Y/Se-I4RBb0nI/AAAAAAAAATA/ILO3UmaMvcw/FOOT3_thumb%5B1%5D.png?imgmax=800" width="450" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I’ve tried playing some games and other stuff today.&amp;#160; I think I’m so exhausted from the pain and oxycodin that I just can’t keep it all in order.&lt;/p&gt;  &lt;p&gt;Hey, a walker is a good thing to have.&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;p&gt;PS:&amp;#160; I’m making no sense….we’ll see about tomorrow…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-872223816133363979?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/wfCiPmEwlTQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/872223816133363979/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=872223816133363979&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/872223816133363979?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/872223816133363979?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/wfCiPmEwlTQ/my-left-foot-extreme-pain-and-me.html" title="My Left Foot, Extreme Pain, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/04/my-left-foot-extreme-pain-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEMQng6eip7ImA9WxJTEUQ.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-8909757744903327928</id><published>2009-04-18T23:30:00.002-04:00</published><updated>2009-04-19T21:24:43.612-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-19T21:24:43.612-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="foot surgery and me" /><title>Proper Preparation for Surgery, and Me…</title><content type="html">&lt;p&gt;Well folks, I am perhaps a little over a day away from major surgery.&amp;#160; And I can’t wait...&lt;/p&gt;  &lt;p&gt;Why?&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/Seqas3rsaKI/AAAAAAAAASA/udFBGtjLjxk/s1600-h/setup_1%5B3%5D.png"&gt;&lt;img title="setup_1" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="205" alt="setup_1" src="http://lh6.ggpht.com/_TWT435FEB_Y/SeqatYfK1KI/AAAAAAAAASE/GyHDGsQucq8/setup_1_thumb%5B1%5D.png?imgmax=800" width="195" border="0" /&gt;&lt;/a&gt; &lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/Seqat3jD-_I/AAAAAAAAASI/ieuSk27G0nc/s1600-h/setup_2%5B5%5D.png"&gt;&lt;img title="setup_2" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="199" alt="setup_2" src="http://lh3.ggpht.com/_TWT435FEB_Y/SeqauVl3STI/AAAAAAAAASQ/Y3hQankoVYU/setup_2_thumb%5B3%5D.png?imgmax=800" width="214" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;That’s why…&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;With my wife’s full blessings, I have, at the foot of my bed:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;a 32” HDTV &lt;/li&gt;    &lt;li&gt;PlayStation 3      &lt;ul&gt;       &lt;ul&gt;         &lt;li&gt;Fresh, unopened copy of Fallout 3 &lt;/li&gt;          &lt;li&gt;Unfinished Dead Space &lt;/li&gt;          &lt;li&gt;Unfinished GTA IV &lt;/li&gt;          &lt;li&gt;Unfinished Bioshock &lt;/li&gt;       &lt;/ul&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Dell Studio 1535 laptop      &lt;ul&gt;       &lt;ul&gt;         &lt;li&gt;Myst I, II, and III (never played them) &lt;/li&gt;       &lt;/ul&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;500 GB MyBook drive      &lt;ul&gt;       &lt;ul&gt;         &lt;li&gt;all of the Jonny Quests &lt;/li&gt;          &lt;li&gt;all of the Star Blazers &lt;/li&gt;          &lt;li&gt;all of the Battle of the Planets &lt;/li&gt;          &lt;li&gt;all of the Space Ghost Coast-to-Coasts &lt;/li&gt;          &lt;li&gt;all of the Harvey Birdmans &lt;/li&gt;          &lt;li&gt;all of the SeaLab 2021s &lt;/li&gt;          &lt;li&gt;all of the Action Teen Hunger Forces &lt;/li&gt;       &lt;/ul&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Additionally, my laptop already has VS 2005 and 2008 on it, as well as SQL 2005 and 2008 (this is noted primarily for my employers who sometimes peruse my blog to assure them of the volumes of work I will accomplish).&lt;/p&gt;  &lt;p&gt;So now combine above setup with some oxycodone and/or vicodin and you have probably the most fantastic vacation lined up ever.&lt;/p&gt;  &lt;p&gt;I have very, very flat feet, and have had to go through all the money-gobbling circles of orthotics and lousy podiatrists to get here, here being a “&lt;em&gt;reconstruction of flat foot with &lt;span class="Apple-style-span" style="font-style: normal"&gt;&lt;em&gt;&lt;span class="Apple-style-span" style="font-style: normal"&gt;&lt;span class="Apple-style-span" style="font-style: italic"&gt;double osteotomy calcaneus, &lt;/span&gt;&lt;em&gt;gastrocnemius lengthening, and fusion of 1st tarsometatarsal joint&lt;/em&gt;” by an orthopedic surgeon.&amp;#160; Left foot Monday, right foot sometime maybe in November / December.&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I hope to have some delicious pictures of my mangled left foot for everyone here in the near future, plus some x-ray images.&amp;#160; I’m scheduled to go in at 5:00am Monday morning.&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;ADDENDUM (Sunday, April 19 @ 4:02pm)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Ok, I’m 13 hours away from the chopping block.&amp;#160; I figure I would give the guest of honor his due.&amp;#160; Here’s my feet right now, and in particular the left flipper:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_TWT435FEB_Y/SeuD-o3S0zI/AAAAAAAAASU/X0Ap1kUbW9I/s1600-h/my_feet_now%5B3%5D.png"&gt;&lt;img title="my_feet_now" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="386" alt="my_feet_now" src="http://lh5.ggpht.com/_TWT435FEB_Y/SeuD_ygWDzI/AAAAAAAAASY/AStXE-Fqen4/my_feet_now_thumb%5B1%5D.png?imgmax=800" width="448" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SeuEAnQDRcI/AAAAAAAAASc/BSJ1gQxxcqA/s1600-h/left-foot-now%5B3%5D.png"&gt;&lt;img title="left-foot-now" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="420" alt="left-foot-now" src="http://lh3.ggpht.com/_TWT435FEB_Y/SeuEBTOWeiI/AAAAAAAAASg/G3-itviFVlU/left-foot-now_thumb%5B1%5D.png?imgmax=800" width="456" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Ugh.&amp;#160; It just…I’m glad I’m having this done.&amp;#160; Huge massive scars around it all will look better than this mutation.&lt;/p&gt;  &lt;p&gt;Also, had to update my super-media-computing center.&amp;#160; Here’s a hint if you want headphones for your PS3: make sure bluetooth or USB set works before purchasing.&amp;#160; I have a set of Motorola s805 DJ ones that are fantastic, but no workie.&amp;#160; So, I brought up the DENON receiver, hooked the optical audio up, and threw some old-school stereo headphones on.&amp;#160; Very, very sweet.&amp;#160; I put &lt;a href="http://code.google.com/p/ps3mediaserver/"&gt;PS3 Mediaserver&lt;/a&gt; on my laptop and am streaming video to my PS3, as well.&amp;#160; Here ‘tis:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/SeuECDOK9QI/AAAAAAAAASk/-O52V8dkS_o/s1600-h/setup-3%5B3%5D.png"&gt;&lt;img title="setup-3" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="362" alt="setup-3" src="http://lh6.ggpht.com/_TWT435FEB_Y/SeuECzlf2VI/AAAAAAAAASo/ieD7AWr2dsM/setup-3_thumb%5B1%5D.png?imgmax=800" width="432" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Gives me wood just looking at it…&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;p&gt;&lt;strong&gt; ADDENDUM TO THE ADDENDUM:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Ok so I was getting some stuttering on the playback through the PS3 from ps3mediaserver, due to going over wifi.&amp;#160; I found a crossover cable and downloaded &lt;a href="http://www.pfsense.com/"&gt;pfSense&lt;/a&gt; (&lt;a href="http://m0n0.ch/wall/"&gt;m0n0wall&lt;/a&gt; with UPnP support).&amp;#160; Using &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&amp;amp;displaylang=en"&gt;Virtual PC&lt;/a&gt;, I created a router with my laptop’s wifi and ethernet cards, making the wifi the WAN and ethernet the LAN.&amp;#160; No more stutter, and the PS3 has access to whatever it needs.&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:aab03aea-3ecf-43fc-b625-bcec1c68e11b" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/double+osteotomy+calcaneus" rel="tag"&gt;double osteotomy calcaneus&lt;/a&gt;,&lt;a href="http://technorati.com/tags/surgery" rel="tag"&gt;surgery&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ps3" rel="tag"&gt;ps3&lt;/a&gt;,&lt;a href="http://technorati.com/tags/fallout+3" rel="tag"&gt;fallout 3&lt;/a&gt;,&lt;a href="http://technorati.com/tags/gta+4" rel="tag"&gt;gta 4&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dead+space" rel="tag"&gt;dead space&lt;/a&gt;,&lt;a href="http://technorati.com/tags/vacation" rel="tag"&gt;vacation&lt;/a&gt;,&lt;a href="http://technorati.com/tags/adult+swim" rel="tag"&gt;adult swim&lt;/a&gt;,&lt;a href="http://technorati.com/tags/jonny+quest" rel="tag"&gt;jonny quest&lt;/a&gt;,&lt;a href="http://technorati.com/tags/btop" rel="tag"&gt;btop&lt;/a&gt;,&lt;a href="http://technorati.com/tags/media+server" rel="tag"&gt;media server&lt;/a&gt;,&lt;a href="http://technorati.com/tags/pfsense" rel="tag"&gt;pfsense&lt;/a&gt;,&lt;a href="http://technorati.com/tags/m0n0wall" rel="tag"&gt;m0n0wall&lt;/a&gt;,&lt;a href="http://technorati.com/tags/virtual+pc" rel="tag"&gt;virtual pc&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/27963633-8909757744903327928?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/t0uowAOqUus" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/8909757744903327928/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=8909757744903327928&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/8909757744903327928?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/8909757744903327928?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/t0uowAOqUus/proper-preparation-for-surgery-and-me.html" title="Proper Preparation for Surgery, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/04/proper-preparation-for-surgery-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8AQXYyeip7ImA9WxVbEE8.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-1114518056385765363</id><published>2009-03-25T20:54:00.001-04:00</published><updated>2009-03-25T20:54:00.892-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-25T20:54:00.892-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="anonymous delegates" /><category scheme="http://www.blogger.com/atom/ns#" term="threads" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="file lock" /><title>A Stupid Anonymous Thread Trick, and Me…</title><content type="html">&lt;p&gt;Ok, the storyline:&amp;#160; A web site creates a temporary file to work with, then is supposed to delete it, because maybe space is low on the drive or whatever.&amp;#160; There are times where the file will still be locked from our work when we try to delete it.&amp;#160; Perhaps we did something like:&lt;/p&gt; &lt;!--&lt;br /&gt;{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Envy Code R VS;}}{\colortbl;??\red48\green95\blue182;\red227\green213\blue193;\red46\green83\blue209;\red1\green0\blue1;\red0\green0\blue0;\red37\green146\blue65;}??\fs20 \cf1\cb2\highlight2 File\cf3 .\cf4 WriteAllBytes\cf0 (\cf6 {\b "newFile"}\cf0 , \cf1 File\cf3 .\cf4 ReadAllBytes\cf0 (\cf6 {\b "oldFile"}\cf0 ));}&lt;br /&gt;--&gt;  &lt;div style="font-size: 10pt; background: #e3d5c1; color: black; font-family: envy code r vs"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #305fb6"&gt;File&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;.&lt;/span&gt;&lt;span style="color: #010001"&gt;WriteAllBytes&lt;/span&gt;(&lt;span style="font-weight: bold; color: #259241"&gt;&amp;quot;newFile&amp;quot;&lt;/span&gt;, &lt;span style="color: #305fb6"&gt;File&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;.&lt;/span&gt;&lt;span style="color: #010001"&gt;ReadAllBytes&lt;/span&gt;(&lt;span style="font-weight: bold; color: #259241"&gt;&amp;quot;oldFile&amp;quot;&lt;/span&gt;));&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;And it hasn’t released the lock on “oldFile” when we get to the next statement.&amp;#160; Oh man, that’s a problem.&amp;#160; A BIG problem.&amp;#160; A HUGE problem.&lt;/p&gt;  &lt;p&gt;Not anymore!&amp;#160; Introducing a stupid anonymous thread method pause trick we can do:&lt;/p&gt; &lt;!--&lt;br /&gt;{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Envy Code R VS;}}{\colortbl;??\red0\green0\blue0;\red227\green213\blue193;\red64\green0\blue128;\red1\green0\blue1;\red46\green83\blue209;\red37\green146\blue65;\red48\green95\blue182;\red43\green145\blue175;}??\fs20 \cb2\highlight2             \cf3 bool\cf0  \cf4 deleted\cf0  \cf5 =\cf0  \cf3 false\cf0 ;\par ??            \cf3 int\cf0  \cf4 tries\cf0  \cf5 =\cf0  \cf6 3\cf0 ;\par ??            \cf3 while\cf0  ((\cf5 !\cf4 deleted\cf0 ) \cf5 &amp;amp;&amp;amp;\cf0  (\cf4 tries\cf0  \cf5 &amp;gt;\cf0  \cf6 0\cf0 ))\par ??            \{\par ??                \cf3 try\par ??\cf0                 \{\par ??                    \cf7 File\cf5 .\cf4 Delete\cf0 (\cf6 {\b "theFile"}\cf0 );\par ??                    \cf4 deleted\cf0  \cf5 =\cf0  \cf3 true\cf0 ;\par ??                \}\par ??                \cf3 catch\par ??\cf0                 \{\par ??                    \cf7 Thread\cf0  \cf4 pauser\cf0  \cf5 =\cf0  \cf3 new\cf0  \cf7 Thread\cf0 (\par ??                        \cf3 new\cf0  \cf8 ParameterizedThreadStart\cf0 (\par ??                            \cf3 delegate\cf0 (\cf3 object\cf0  \cf4 o\cf0 )\par ??                            \{\par ??                                \cf4 System\cf5 .\cf4 Threading\cf5 .\cf7 Thread\cf5 .\cf4 Sleep\cf0 (\cf6 500\cf0 );\par ??                            \}));\par ??                    \cf4 pauser\cf5 .\cf4 Start\cf0 ();\par ??                    \cf3 while\cf0  (\cf4 pauser\cf5 .\cf4 IsAlive\cf0 ) ;\par ??                    \cf4 tries\cf5 --\cf0 ;\par ??                \}\par ??            \}\par ??}&lt;br /&gt;--&gt;  &lt;div style="font-size: 10pt; background: #e3d5c1; color: black; font-family: envy code r vs"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #400080"&gt;bool&lt;/span&gt; &lt;span style="color: #010001"&gt;deleted&lt;/span&gt; &lt;span style="color: #2e53d1"&gt;=&lt;/span&gt; &lt;span style="color: #400080"&gt;false&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #400080"&gt;int&lt;/span&gt; &lt;span style="color: #010001"&gt;tries&lt;/span&gt; &lt;span style="color: #2e53d1"&gt;=&lt;/span&gt; &lt;span style="color: #259241"&gt;3&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #400080"&gt;while&lt;/span&gt; ((&lt;span style="color: #2e53d1"&gt;!&lt;/span&gt;&lt;span style="color: #010001"&gt;deleted&lt;/span&gt;) &lt;span style="color: #2e53d1"&gt;&amp;amp;&amp;amp;&lt;/span&gt; (&lt;span style="color: #010001"&gt;tries&lt;/span&gt; &lt;span style="color: #2e53d1"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #259241"&gt;0&lt;/span&gt;))&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #400080"&gt;try&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #305fb6"&gt;File&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;.&lt;/span&gt;&lt;span style="color: #010001"&gt;Delete&lt;/span&gt;(&lt;span style="font-weight: bold; color: #259241"&gt;&amp;quot;theFile&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #010001"&gt;deleted&lt;/span&gt; &lt;span style="color: #2e53d1"&gt;=&lt;/span&gt; &lt;span style="color: #400080"&gt;true&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #400080"&gt;catch&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #305fb6"&gt;Thread&lt;/span&gt; &lt;span style="color: #010001"&gt;pauser&lt;/span&gt; &lt;span style="color: #2e53d1"&gt;=&lt;/span&gt; &lt;span style="color: #400080"&gt;new&lt;/span&gt; &lt;span style="color: #305fb6"&gt;Thread&lt;/span&gt;(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #400080"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ParameterizedThreadStart&lt;/span&gt;(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #400080"&gt;delegate&lt;/span&gt;(&lt;span style="color: #400080"&gt;object&lt;/span&gt; &lt;span style="color: #010001"&gt;o&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #010001"&gt;System&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;.&lt;/span&gt;&lt;span style="color: #010001"&gt;Threading&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;.&lt;/span&gt;&lt;span style="color: #305fb6"&gt;Thread&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;.&lt;/span&gt;&lt;span style="color: #010001"&gt;Sleep&lt;/span&gt;(&lt;span style="color: #259241"&gt;500&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }));&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #010001"&gt;pauser&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;.&lt;/span&gt;&lt;span style="color: #010001"&gt;Start&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #400080"&gt;while&lt;/span&gt; (&lt;span style="color: #010001"&gt;pauser&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;.&lt;/span&gt;&lt;span style="color: #010001"&gt;IsAlive&lt;/span&gt;) ;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #010001"&gt;tries&lt;/span&gt;&lt;span style="color: #2e53d1"&gt;--&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Oh god yeah…&lt;/p&gt;  &lt;p&gt;Ok, a quick run-through.&amp;#160; We try to delete our file.&amp;#160; An exception is caught, so to allow the current thread to finish any IO operations, we create a temporary thread (pauser), which we wait for to finish.&amp;#160; Once it’s done, we try again until either we succeed or just give up.&lt;/p&gt;  &lt;p&gt;My sandbox for playing around with &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/ThreadTest.zip"&gt;this idea is here&lt;/a&gt;.&amp;#160; I have a question, though, that needs answering desperately:&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Is this useful anywhere?&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;If so, please provide an example of where this would be great to use.&amp;#160; I just need to know I didn’t &lt;em&gt;fully&lt;/em&gt; waste my time.&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-1114518056385765363?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/Aavxu9U0_JY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/1114518056385765363/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=1114518056385765363&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1114518056385765363?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1114518056385765363?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/Aavxu9U0_JY/stupid-anonymous-thread-trick-and-me.html" title="A Stupid Anonymous Thread Trick, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/03/stupid-anonymous-thread-trick-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAGRnw_fCp7ImA9WxVUE0k.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-5060175196113143595</id><published>2009-03-17T22:35:00.001-04:00</published><updated>2009-03-17T22:35:27.244-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-17T22:35:27.244-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008" /><category scheme="http://www.blogger.com/atom/ns#" term="copy database" /><category scheme="http://www.blogger.com/atom/ns#" term="copy tables" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2005" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Copying tables from one database to another, and me…</title><content type="html">&lt;p&gt;So, lately I had the dilemma of having done a bunch of preliminary SQL work in 2008 Express, then needing to port my results over to a staging SQL 2005 server at work.&amp;#160; I casually backed up the 2008 database and lo and behold, &lt;a href="http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_23580139.html"&gt;couldn’t restore it&lt;/a&gt;!&amp;#160; SSIS wasn’t set up, and I had to gets stuff done ASAP!&amp;#160; I searched on Google, and all I got were either “use SSIS” or “it can’t be done.”&amp;#160; In other words, those who’ve done this before haven’t shared with the rest of us.&lt;/p&gt;  &lt;p&gt;So a proc I wrote came in handy…&lt;/p&gt;  &lt;p&gt;I threw together this stored procedure, linked to the remote 2005 server, and used &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/FunWithSQL.zip"&gt;this proc&lt;/a&gt; to move all my data.&amp;#160; It’s very simple and WYSIWYG-ish right now, as it:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;doesn’t copy over indexes &lt;/li&gt;    &lt;li&gt;doesn’t copy over table schemas &lt;/li&gt;    &lt;li&gt;just copies the tables into a new database with the same table names and data &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;A Quick Sample Run-Through&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So, first let’s create a database named SimpleSample.&amp;#160; We’ll create two tables, one with prime numbers and one with the beginning of the Fibonacci sequence.&lt;/p&gt;  &lt;p&gt;For our primes:&lt;/p&gt; &lt;style&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- /* Font Definitions */ @font-face	{font-family:"Cambria Math";	panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face	{font-family:Calibri;	panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{margin-top:0in;	margin-right:0in;	margin-bottom:10.0pt;	margin-left:0in;	line-height:115%;	font-size:11.0pt;	font-family:"Calibri","sans-serif";}.MsoPapDefault	{margin-bottom:10.0pt;	line-height:115%;}--&gt;&lt;/style&gt;  &lt;div style="overflow: auto; height: 450px"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;use&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;SimpleSample&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;go&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;@table &lt;span style="color: blue"&gt;table&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;"&gt;(&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; primes&lt;span style="color: blue"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;"&gt;)&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;@counter &lt;span style="color: blue"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;set&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;@counter &lt;span style="color: gray"&gt;=&lt;/span&gt; 1&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;while &lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;"&gt;(&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;@counter&lt;span style="color: gray"&gt;&amp;lt;&lt;/span&gt; 1000&lt;span style="color: gray"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;begin&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;insert&lt;/span&gt; &lt;span style="color: blue"&gt;into&lt;/span&gt; @table&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;primes&lt;span style="color: gray"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:BLUE"&gt;values&lt;/span&gt;&lt;span style="color: gray"&gt;(&lt;/span&gt;@counter&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;set&lt;/span&gt; @counter &lt;span style="color: gray"&gt;=&lt;/span&gt;@counter &lt;span style="color: gray"&gt;+&lt;/span&gt; 1&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;end&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;set&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;@counter &lt;span style="color: gray"&gt;=&lt;/span&gt; 2&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;while &lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;"&gt;((&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&lt;span style="color: fuchsia"&gt;count&lt;/span&gt;&lt;span style="color: gray"&gt;(&lt;/span&gt;1&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt; &lt;span style="color: blue"&gt;from&lt;/span&gt; @table &lt;spanstyle  ="COLOR:BLUE"&gt;where&lt;/span&gt; primes &lt;span style="color: gray"&gt;&amp;gt;&lt;/span&gt;@counter&lt;span style="color: gray"&gt;)&lt;/span&gt; &lt;span style="color: gray"&gt;&amp;gt;&lt;/span&gt;0&lt;span style="color: gray"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;begin&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;delete&lt;/span&gt; &lt;span style="color: blue"&gt;from&lt;/span&gt; @table&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;where &lt;/span&gt;&lt;span style="color: gray"&gt;(((&lt;/span&gt;primes &lt;spanstyle  ="COLOR:GRAY"&gt;%&lt;/span&gt; @counter&lt;span style="color: gray"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:GRAY"&gt;=&lt;/span&gt; 0&lt;span style="color: gray"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:GRAY"&gt;and&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;primes &lt;span style="color: gray"&gt;&amp;gt;&lt;/span&gt; @counter&lt;spanstyle  ="COLOR:GRAY"&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;select&lt;/span&gt; &lt;span style="color: blue"&gt;top&lt;/span&gt; 1 @counter&lt;span style="color: gray"&gt;=&lt;/span&gt; primes &lt;span style="color: blue"&gt;from&lt;/span&gt;@table &lt;span style="color: blue"&gt;where&lt;/span&gt; primes &lt;span style="color: gray"&gt;&amp;gt;&lt;/span&gt;@counter &lt;span style="color: blue"&gt;order&lt;/span&gt; &lt;span style="color: blue"&gt;by&lt;/span&gt;primes&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;end&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&lt;span style="color: gray"&gt;*&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;into&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;Primes&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;from&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;@table&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Now for Fibonacci:&lt;/p&gt;  &lt;div style="overflow: auto; height: 450px"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;use&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;SimpleSample&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;go&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;set&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&lt;span style="color: blue; white-space: nowrap"&gt;nocount&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;on&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@fibo &lt;span style="color: blue; white-space: nowrap"&gt;table&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;(&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; nacci&lt;span style="color: blue; white-space: nowrap"&gt;bigint&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;while &lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;(((&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&lt;span style="color: fuchsia; white-space: nowrap"&gt;max&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;(&lt;/span&gt;nacci&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;from&lt;/span&gt; @fibo&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt; &lt;span style="color: gray; white-space: nowrap"&gt;&amp;lt;&lt;/span&gt; 1000&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt; &lt;span style="color: gray; white-space: nowrap"&gt;or&lt;/span&gt;&lt;spanstyle  ="COLOR:BLUE"&gt; &lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;((&lt;/span&gt;&lt;spanstyle  ="COLOR:BLUE"&gt;select&lt;/span&gt; &lt;span style="color: fuchsia; white-space: nowrap"&gt;COUNT&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;1&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:BLUE"&gt;from&lt;/span&gt; @fibo&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:GRAY"&gt;=&lt;/span&gt; 0&lt;span style="color: gray; white-space: nowrap"&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;begin&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;if &lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;((&lt;/span&gt;&lt;spanstyle  ="COLOR:BLUE"&gt;select&lt;/span&gt; &lt;span style="color: fuchsia; white-space: nowrap"&gt;count&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;1&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:BLUE"&gt;from&lt;/span&gt; @fibo&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:GRAY"&gt;&amp;gt;&lt;/span&gt; 1&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;insert&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;into&lt;/span&gt; @fibo&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;nacci&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;select&lt;/span&gt; &lt;span style="color: fuchsia; white-space: nowrap"&gt;sum&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;i&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:BLUE"&gt;as&lt;/span&gt; nacci &lt;span style="color: blue; white-space: nowrap"&gt;from &lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;select&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;top&lt;/span&gt; 2 nacci &lt;spanstyle  ="COLOR:BLUE"&gt;as&lt;/span&gt; i &lt;span style="color: blue; white-space: nowrap"&gt;from&lt;/span&gt; @fibo &lt;spanstyle  ="COLOR:BLUE"&gt;order&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;by&lt;/span&gt; nacci &lt;spanstyle  ="COLOR:BLUE"&gt;desc&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt; tops&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;insert&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;into&lt;/span&gt; @fibo&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;nacci&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt; &lt;spanstyle  ="COLOR:BLUE"&gt;values&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;(&lt;/span&gt;1&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;end&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&lt;span style="color: gray; white-space: nowrap"&gt;*&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;into&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;Fibonacci&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: blue; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;from&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt; @fibo&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Now that we have two sample tables we’re going to copy, create a second database named SimpleSample2.&amp;#160; Our routine will be simple: get a list of the names of our source tables, and for each name in the list, SELECT from the table with that name in our source database INTO a new table with that same name in our destination database.&lt;/p&gt;  &lt;p&gt;There are many ways to get the list of tables.&amp;#160; I ended up using the sys.sp_tables proc:&lt;/p&gt;  &lt;div style="overflow: auto; height: 400px"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@temp &lt;span style="color: blue; white-space: nowrap"&gt;table&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;(&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TABLE_QUALIFIER&lt;span style="color: blue; white-space: nowrap"&gt;nvarchar&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;(&lt;/span&gt;200&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:GRAY"&gt;,&lt;/span&gt; TABLE_OWNER &lt;span style="color: blue; white-space: nowrap"&gt;nvarchar&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;200&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:GRAY"&gt;,&lt;/span&gt; TABLE_NAME &lt;span style="color: blue; white-space: nowrap"&gt;nvarchar&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;200&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:GRAY"&gt;,&lt;/span&gt; TABLE_TYPE &lt;span style="color: blue; white-space: nowrap"&gt;nvarchar&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;200&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:GRAY"&gt;,&lt;/span&gt; REMARKS &lt;span style="color: blue; white-space: nowrap"&gt;nvarchar&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;&lt;span style="color: fuchsia; white-space: nowrap"&gt;max&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;begin&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@sourceDatabase &lt;span style="color: blue; white-space: nowrap"&gt;varchar&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;(&lt;/span&gt;100&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;set&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@sourceDatabase &lt;span style="color: gray; white-space: nowrap"&gt;=&lt;/span&gt; &lt;span style="color: red; white-space: nowrap"&gt;'SimpleSample'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: red; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@spTables &lt;span style="color: blue; white-space: nowrap"&gt;varchar&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;(&lt;/span&gt;1000&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;set&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@spTables &lt;span style="color: gray; white-space: nowrap"&gt;=&lt;/span&gt; &lt;span style="color: red; white-space: nowrap"&gt;'exec '&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;+&lt;/span&gt; @sourceDatabase &lt;span style="color: gray; white-space: nowrap"&gt;+&lt;/span&gt;&lt;span style="color: red; white-space: nowrap"&gt;'.sys.sp_tables'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: red; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;insert&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&lt;span style="color: blue; white-space: nowrap"&gt;into&lt;/span&gt; @temp&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;exec&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&lt;span style="color: maroon; white-space: nowrap"&gt;sp_sqlexec&lt;/span&gt;&lt;span style="color: blue; white-space: nowrap"&gt; &lt;/span&gt;@spTables&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&lt;span style="color: gray; white-space: nowrap"&gt;*&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;from&lt;/span&gt; @temp&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: blue; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;end&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;After that, I cleaned out the data to just dbo created tables:&lt;/p&gt;  &lt;div style="height: 250px; overdflow: auto"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;delete&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;from&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@temp&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;where&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;TABLE_TYPE &lt;span style="color: gray; white-space: nowrap"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span style="color: red; white-space: nowrap"&gt;'TABLE'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: red; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@ourTables &lt;span style="color: blue; white-space: nowrap"&gt;table&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;(&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; idx&lt;span style="color: blue; white-space: nowrap"&gt;int&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;identity&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;1&lt;span style="color: gray; white-space: nowrap"&gt;,&lt;/span&gt;1&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:GRAY"&gt;,&lt;/span&gt; name &lt;span style="color: blue; white-space: nowrap"&gt;nvarchar&lt;/span&gt;&lt;spanstyle  ="COLOR:GRAY"&gt;(&lt;/span&gt;200&lt;span style="color: gray; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;)&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;insert&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&lt;span style="color: blue; white-space: nowrap"&gt;into&lt;/span&gt; @ourTables&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: blue; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt; TABLE_NAME &lt;span style="color: blue; white-space: nowrap"&gt;from&lt;/span&gt; @temp&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Finally, throw those tables into the destination database:&lt;/p&gt;  &lt;div style="overflow: auto"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@name &lt;span style="color: blue; white-space: nowrap"&gt;nvarchar&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;(&lt;/span&gt;200&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@query &lt;span style="color: blue; white-space: nowrap"&gt;varchar&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;(&lt;/span&gt;2000&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;declare&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;@idx &lt;span style="color: blue; white-space: nowrap"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;while &lt;/span&gt;&lt;span style="font-size: 10pt; color: gray; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;((&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;select&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&lt;span style="color: fuchsia; white-space: nowrap"&gt;COUNT&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;(&lt;/span&gt;1&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;from&lt;/span&gt; @ourTables&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt; &lt;span style="color: gray; white-space: nowrap"&gt;&amp;gt;&lt;/span&gt; 0&lt;spanstyle  ="COLOR:GRAY"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;begin&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;select&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;top&lt;/span&gt; 1 @idx &lt;spanstyle  ="COLOR:GRAY"&gt;=&lt;/span&gt; idx&lt;span style="color: gray; white-space: nowrap"&gt;,&lt;/span&gt; @name &lt;spanstyle  ="COLOR:GRAY"&gt;=&lt;/span&gt; name &lt;span style="color: blue; white-space: nowrap"&gt;from&lt;/span&gt;@ourTables&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;set&lt;/span&gt; @query &lt;span style="color: gray; white-space: nowrap"&gt;=&lt;/span&gt; &lt;spanstyle  ="COLOR:RED"&gt;'SELECT * INTO '&lt;/span&gt; &lt;span style="color: gray; white-space: nowrap"&gt;+&lt;/span&gt;@toDb &lt;span style="color: gray; white-space: nowrap"&gt;+&lt;/span&gt; &lt;span style="color: red; white-space: nowrap"&gt;'.dbo.['&lt;/span&gt;&lt;span style="color: gray; white-space: nowrap"&gt;+&lt;/span&gt; @name &lt;span style="color: gray; white-space: nowrap"&gt;+&lt;/span&gt; &lt;spanstyle  ="COLOR:RED"&gt;'] FROM '&lt;/span&gt; &lt;span style="color: gray; white-space: nowrap"&gt;+&lt;/span&gt; @name&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;exec&lt;/span&gt; &lt;span style="color: maroon; white-space: nowrap"&gt;sp_sqlexec&lt;/span&gt;&lt;spanstyle  ="COLOR:BLUE"&gt; &lt;/span&gt;@query&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;spanstyle  ="COLOR:BLUE"&gt;delete&lt;/span&gt; &lt;span style="color: blue; white-space: nowrap"&gt;from&lt;/span&gt;@ourTables &lt;span style="color: blue; white-space: nowrap"&gt;where&lt;/span&gt; idx &lt;span style="color: gray; white-space: nowrap"&gt;=&lt;/span&gt;@idx&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: blue; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; white-space: nowrap"&gt;end&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;The &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/FunWithSQL.zip"&gt;SQL sources are here&lt;/a&gt;.&amp;#160; I’m sure it can be spruced up to do many more great things, such as those I initially listed.&amp;#160; If you decide to add anything, please post in the comments or try to get your additions / changes to me and I’ll update the SQL.&amp;#160; You’ll even have the extra bonus of being credited on this immensely popular blog!&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-5060175196113143595?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/0U0xD1uaOx4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/5060175196113143595/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=5060175196113143595&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/5060175196113143595?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/5060175196113143595?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/0U0xD1uaOx4/copying-tables-from-one-database-to.html" title="Copying tables from one database to another, and me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/03/copying-tables-from-one-database-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMGQX0zfip7ImA9WxVVFEU.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-1124058285753045185</id><published>2009-03-07T21:47:00.001-05:00</published><updated>2009-03-07T21:47:00.386-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-07T21:47:00.386-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sha1" /><category scheme="http://www.blogger.com/atom/ns#" term="picasa" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="sqlite" /><category scheme="http://www.blogger.com/atom/ns#" term="md5" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="duplicate files" /><category scheme="http://www.blogger.com/atom/ns#" term="binary comparison" /><category scheme="http://www.blogger.com/atom/ns#" term="system.data.sqlite" /><title>Duplicate Files, Hash Codes, SQLite, and Me…</title><content type="html">&lt;p&gt;My wife’s been getting on my case about having a gazillion different hard drives with everything and our mothers on them all around the house.&amp;#160; I mean, come &lt;em&gt;on&lt;/em&gt; everybody, she just wants her pictures in one @%$!# spot!&amp;#160; She also “misused” &lt;a href="http://picasa.google.com/"&gt;Picasa&lt;/a&gt;, and now has a bunch of duplicates on her laptop (she doesn’t read my blog, so I ain’t worried she’ll read that).&lt;/p&gt;  &lt;p&gt;So, out shopping for Little Liam last weekend, and we decide to pop into Circuit City’s closing-its-doors blowout sale.&amp;#160; I grabbed her a 500 GB Western Digital external drive and, when we got home, proceeded immediately on a simple solution to shut her pie hole.&lt;/p&gt;  &lt;p&gt;The result: &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/MyPicturesConsolidator_Release.zip"&gt;MyPicturesConsolidator&lt;/a&gt;!&amp;#160; It is a WYSIWYG image grabber, duplicate detector, and file-copier-consolidator all in one, gorgeous package!&lt;/p&gt;  &lt;p&gt;Ok, this program is &lt;em&gt;NOT&lt;/em&gt; a work of art, but may contain some good stuff you can use, and it works pretty solidly, so…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/SbMxmP6On-I/AAAAAAAAAQg/aBJy0d_GEGI/s1600-h/mpc%5B3%5D.png"&gt;&lt;img title="mpc" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="259" alt="mpc" src="http://lh4.ggpht.com/_TWT435FEB_Y/SbMxmnniXII/AAAAAAAAAQk/yYoxRqAz4sk/mpc_thumb%5B1%5D.png?imgmax=800" width="447" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;How it works:&lt;/p&gt;  &lt;p&gt;First, you select where you want any pictures it finds to get copied to:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SbMxnF0NunI/AAAAAAAAAQo/AJl6xnqIh7M/s1600-h/mpc_dest%5B4%5D.png"&gt;&lt;img title="mpc_dest" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="150" alt="mpc_dest" src="http://lh6.ggpht.com/_TWT435FEB_Y/SbMxnqJQnnI/AAAAAAAAAQs/rgemG7Ul_7U/mpc_dest_thumb%5B2%5D.png?imgmax=800" width="445" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Second, select the logical drive you want to scan for pictures.&amp;#160; I included a Refresh Drive List button for changing between USB drives:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_TWT435FEB_Y/SbMxoBVn6nI/AAAAAAAAAQw/7uhItZt2qTY/s1600-h/mpc_src%5B2%5D.png"&gt;&lt;img title="mpc_src" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="223" alt="mpc_src" src="http://lh4.ggpht.com/_TWT435FEB_Y/SbMxop6iGKI/AAAAAAAAAQ0/AdEnC0oRFOQ/mpc_src_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Third, click Find My Pictures!&amp;#160; And &lt;em&gt;you’re good!&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Behind the scenes:&lt;/p&gt;  &lt;p&gt;I wanted a “list” to be maintained that kept track of files we’ve gone through.&amp;#160; I decided to use a &lt;a href="http://www.sqlite.org/"&gt;SQLite&lt;/a&gt; database that would hold MD5 and SHA1 hashes of the pictures.&amp;#160; A good side effect of this is, just take it with the exe and &lt;a href="http://sqlite.phxsoftware.com/"&gt;SQLite dll&lt;/a&gt; to another computer along with your destination drive (or network share path, etc.), and the duplicates list maintained in the SQLite db should work golden for you.&lt;/p&gt;  &lt;p&gt;MD5 and SHA1 generation is, for lack of a better phrase, retardedly easy via .NET.&amp;#160; An MD5 hash of a file, for instance, can be had in one line of code:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="overflow: auto; width: 430px; height: 56px; background-color: white"&gt;&lt;font face="Courier New" size="3"&gt;&lt;nobr&gt;byte[] md5Hash = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(System.IO.File.ReadAllBytes(filename));&lt;/nobr&gt; &lt;/font&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The code is &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/MyPicturesConsolidator.zip"&gt;here&lt;/a&gt;.&amp;#160; Go ahead and take a look.&amp;#160; There’s some dumb things I’m doing in there that deal with my wife’s needs (i.e. Picasa uses file creation dates, ergo I try to find the earliest for her when I can, etc.).&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-1124058285753045185?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/KtWgEum8DdU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/1124058285753045185/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=1124058285753045185&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1124058285753045185?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1124058285753045185?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/KtWgEum8DdU/duplicate-files-hash-codes-sqlite-and.html" title="Duplicate Files, Hash Codes, SQLite, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/03/duplicate-files-hash-codes-sqlite-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQHQ344cSp7ImA9WxVWFU4.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-2728784279266236954</id><published>2009-02-24T23:32:00.001-05:00</published><updated>2009-02-24T23:32:12.039-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-24T23:32:12.039-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="martin" /><category scheme="http://www.blogger.com/atom/ns#" term="basestream" /><category scheme="http://www.blogger.com/atom/ns#" term="hex editor" /><category scheme="http://www.blogger.com/atom/ns#" term="spolsky" /><category scheme="http://www.blogger.com/atom/ns#" term="design patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="HxD" /><category scheme="http://www.blogger.com/atom/ns#" term="position" /><category scheme="http://www.blogger.com/atom/ns#" term="binary comparison" /><category scheme="http://www.blogger.com/atom/ns#" term="SOLID" /><title>Binary Data Transforms, Hex Editing, Design Patterns, and Me…</title><content type="html">&lt;p&gt;Lately for work I have been responsible for developing a .NET layer to read from and write to an existing application's binary data files.&amp;#160; The task has proven tedious, but not necessarily boring, as I've discovered some invaluable tools and development principles from this. &lt;/p&gt;  &lt;p&gt;First off, the &lt;a href="http://mh-nexus.de/en/hxd/"&gt;HxD hex editor&lt;/a&gt;, and, more importantly, comparison tool is simply perfect for the job.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_TWT435FEB_Y/SaTJw80nBMI/AAAAAAAAAP4/2Kma1I-c5lo/s1600-h/hxd4.png"&gt;&lt;img title="hxd" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="315" alt="hxd" src="http://lh3.ggpht.com/_TWT435FEB_Y/SaTJxAVuLhI/AAAAAAAAAP8/wzECf4vQEjs/hxd_thumb2.png?imgmax=800" width="453" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Many minute differences in my binary output were discovered with this tool.&amp;#160; By using the comparison feature:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SaTJxRgD3uI/AAAAAAAAAQA/Z1fjpIXpiug/s1600-h/hxdcompare3.png"&gt;&lt;img title="hxd-compare" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="160" alt="hxd-compare" src="http://lh5.ggpht.com/_TWT435FEB_Y/SaTJxrx6-mI/AAAAAAAAAQE/VcGWZrPtfB0/hxdcompare_thumb1.png?imgmax=800" width="401" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I could determine the first instance of a difference in output and, if unexpected, use the location from HxD to quickly narrow down the area of code responsible.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_TWT435FEB_Y/SaTJx6YX8eI/AAAAAAAAAQI/trmcHC-JScs/s1600-h/hxdcompare24.png"&gt;&lt;img title="hxd-compare2" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="265" alt="hxd-compare2" src="http://lh5.ggpht.com/_TWT435FEB_Y/SaTJyFkQbAI/AAAAAAAAAQM/5gKyb0h7kC4/hxdcompare2_thumb2.png?imgmax=800" width="458" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In my code, a &lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.io.stream.aspx"&gt;Stream&lt;/a&gt;&lt;/font&gt; is passed to a method that will populate a &lt;a href="http://msdn.microsoft.com/en-us/library/ah19swz4.aspx"&gt;&lt;font face="Courier New" size="3"&gt;struct&lt;/font&gt;&lt;/a&gt; representing the file.&amp;#160; This &lt;font face="Courier New" size="3"&gt;Stream&lt;/font&gt; is put into a &lt;a href="http://msdn.microsoft.com/en-us/library/system.io.binaryreader.aspx"&gt;&lt;font face="Courier New" size="3"&gt;BinaryReader&lt;/font&gt;&lt;/a&gt; for sequential type-based reading of the file.&amp;#160;&amp;#160; By simply adding conditional breakpoints at various places in the code, locating the problem was easy.&amp;#160; The condition of the breakpoint would be something like:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.io.binaryreader.basestream.aspx"&gt;myBinReader.BaseStream&lt;/a&gt;.&lt;a href="http://msdn.microsoft.com/en-us/library/system.io.stream.position.aspx"&gt;Position&lt;/a&gt; &amp;gt; 10000&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;where 10000 would be just below the difference location given by HxD.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SaTJyjcmKHI/AAAAAAAAAQQ/yt3sFkK8zHI/s1600-h/hxdcompare36.png"&gt;&lt;img title="hxd-compare3" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="272" alt="hxd-compare3" src="http://lh5.ggpht.com/_TWT435FEB_Y/SaTJywTRR-I/AAAAAAAAAQU/lgZXILYPdCY/hxdcompare3_thumb4.png?imgmax=800" width="456" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So this greatly, greatly, very much helped speed up the process of making sure I was reading and writing the native binary file format out correctly.&amp;#160; Next, I was to transform &lt;em&gt;some&lt;/em&gt; of this data to XML for use by another application.&amp;#160; I already had the &lt;font face="Courier New" size="3"&gt;struct&lt;/font&gt; of native data, and wanted to make the transformation to and from XML as stupidly simple as possible.&amp;#160; To do this, I threw down a bunch of different classes, each representing the XML element I was to turn out, and had the elements inherit a base interface with a &lt;font face="Courier New" size="3"&gt;ToXML()&lt;/font&gt; contract method.&amp;#160; Some of the “element” classes contained &lt;font face="Courier New" color="#333333" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx"&gt;List&amp;lt;&amp;gt;&lt;/a&gt;&lt;/font&gt;s of the other “element” classes, so when churning out the XML, it was as simple as doing a &lt;font face="Courier New" color="#333333" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ttw7t8t6.aspx"&gt;foreach&lt;/a&gt;&lt;/font&gt; and callling &lt;font face="Courier New" size="3"&gt;ToXML()&lt;/font&gt; from each of those to produce my child nodes correctly.&lt;/p&gt;  &lt;p&gt;I very much realize this solution is neither new nor ingenious.&amp;#160; I am using it, in fact, as a tangent off into a discussion on this &lt;a href="http://www.johndcook.com/blog/2009/02/19/recap-of-the-robert-martinjoel-spolsky-brouhaha/"&gt;patterns-war stemming from the Spolsky comment on the SOLID method&lt;/a&gt;.&amp;#160; Quite frankly, I’m not sure what pattern or patterns I implemented above.&amp;#160; The Proxy or Facade?&amp;#160; I would &lt;em&gt;like&lt;/em&gt; to know, as I’ve used this technique of a sort of “translation class” a bazillion times, except my bosses really don’t provide me much time to learn about it, much less, say, spend time with my family (I know you gobblers are reading this).&amp;#160; However, I have an opinion on this patterns-war that I would love some feedback on.&amp;#160; It centers around hiring:&amp;#160; if your team is hiring a new developer / engineer, and you or your team are big into design patterns, don't make knowledge of design patterns a requisite for hiring.&lt;/p&gt;  &lt;p&gt;I have been programming most of my life, but only somewhat recently have been able to make it my career.&amp;#160; Already I've met a good range of coders: the hardcore enthusiast, the day-job-only coder, the serious professional.&amp;#160; They seem to come in all types, but all have the same common denominator:&amp;#160; they enjoy writing code.&amp;#160; Some more than others, but ultimately, there is a certain gene-pool that simply enjoys writing code.&amp;#160; It actually has little to do with being a computer enthusiast.&amp;#160; A good majority of systems administrators I've worked with or under don't like programming, period.&amp;#160; But there are those of us who are addicted to &amp;quot;realizing&amp;quot; our thoughts right there on the screen. &lt;/p&gt;  &lt;p&gt;Until maybe two or three years ago, I knew little to nothing about design patterns.&amp;#160; As I became familiar with and researched them, I've discovered that I've been using many of them for a long, long time.&amp;#160; And that's exactly what they are:&amp;#160; patterns that have been &amp;quot;recognized&amp;quot; in the programming trade.&amp;#160; As such, they are most valuable as a means of communicating an approach to a task or problem at hand.&amp;#160; They are not, however, a &lt;em&gt;requirement&lt;/em&gt; to attack a programming task, nor are they &lt;strong&gt;any&lt;/strong&gt; indication of the competency of the prospective engineer / developer. &lt;/p&gt;  &lt;p&gt;If your programming shop or R&amp;amp;D department or whatever group you work in is a pattern-heavy group, then make the applicant aware of this, but don't dismiss them if they simply don't know design patterns.&amp;#160; Most likely the applicant would be more than eager to learn them, and will discover they’ve already used many of them anyways.&amp;#160; Ergo, it's a subset of a lexicon we, as coders, may or may not need to know, depending only on how to be most efficient in our team. &lt;/p&gt;  &lt;p&gt;I've noticed that a majority of the programmers I've worked with thus far who are heavy into patterns arrogantly criticize and judge their colleagues when they find out they don't know what a singleton is or the proxy pattern or whatever.&amp;#160; So far, from what I've seen, neither camp has shown to be better programmers than the other.&amp;#160; The &lt;em&gt;real&lt;/em&gt; thing that quickly separates an experienced programmer from a truly great programmer, though, is ego.&amp;#160; I personally love everything from learning new tricks and techniques from my colleagues to having them point out where I was really dumb in my code.&amp;#160; It only makes me ultimately a better programmer (hopefully).&amp;#160; What I don’t want to do, and I think this is a pretty unanimous feeling, is converse with an asshole.&lt;/p&gt;  &lt;p&gt;When you really think about it, the literal sense of “conversing with an asshole” is identical to it’s figurative sense: an asshole really never listens, and only barks out useless foulness you’ll want to stay away from.&amp;#160; Plus, your friends, family, and colleagues all may very well think less of you if they see you regularly conversing with assholes, even if it’s the same asshole.&lt;/p&gt;  &lt;p&gt;So really, whether you’re big into design patterns or not, don’t be an asshole, because it just means you don’t listen and no one wants to be near you anyways.&amp;#160; And if you’re hiring, replace “do they know what a flyweight pattern is?” with “are they an asshole?” on your checklist.&amp;#160; You’ll &lt;em&gt;always&lt;/em&gt; build a better team that way.&lt;/p&gt;  &lt;p&gt;~zagnut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-2728784279266236954?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/BiHCx4KKXHQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/2728784279266236954/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=2728784279266236954&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/2728784279266236954?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/2728784279266236954?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/BiHCx4KKXHQ/binary-data-transforms-hex-editing.html" title="Binary Data Transforms, Hex Editing, Design Patterns, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/02/binary-data-transforms-hex-editing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcER3c5eyp7ImA9WxVXE0w.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-4185878022854761835</id><published>2009-02-10T19:24:00.002-05:00</published><updated>2009-02-10T19:26:46.923-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-10T19:26:46.923-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dirty words" /><category scheme="http://www.blogger.com/atom/ns#" term="baby toys" /><category scheme="http://www.blogger.com/atom/ns#" term="DIFFERENCE" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2005" /><category scheme="http://www.blogger.com/atom/ns#" term="SOUNDEX" /><category scheme="http://www.blogger.com/atom/ns#" term="bad language" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Baby Toys, Potty Words, SQL, and Me...</title><content type="html">&lt;p&gt;So little Liam just had his first birthday last Thursday.&amp;#160; Among the plethora of toys dumped on him is an incredibly annoying, er, wonderful alphabet speaking caterpillar:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/SZIa03VMbcI/AAAAAAAAAPg/lqnUuDns_u0/s1600-h/Liam15.jpg"&gt;&lt;img title="My fat son!" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="433" alt="My fat son!" src="http://lh4.ggpht.com/_TWT435FEB_Y/SZIa1Dnlr5I/AAAAAAAAAPk/P_ThRfklWvY/Liam1_thumb3.jpg?imgmax=800" width="456" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There’s a small yellow bow switch just below the head with three settings, plus off (dear God): letter pronouncing, alternate letter pronouncing, and color word.&amp;#160; These obviously coincide with the feet, so if you press the A foot, the caterpillar will speak “A” on the letter pronunciation, “ah” on the alternate pronunciation, and “red” on the color one.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SZIa1tjEgoI/AAAAAAAAAPo/7-ZYsgH1iSg/s1600-h/caterpillar6.jpg"&gt;&lt;img title="caterpillar" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="301" alt="caterpillar" src="http://lh3.ggpht.com/_TWT435FEB_Y/SZIa12OdKvI/AAAAAAAAAPs/5PirNBlKIP4/caterpillar_thumb4.jpg?imgmax=800" width="458" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I had the setting on alternate pronunciation, and was lying back letting Liam play and climb on me.&amp;#160; While smashing the caterpillar, he hit a bunch of keys, seemingly at once.&amp;#160; The F key said “fuh” first, then the caterpillar giggled and said “that tickles!”, and then “kh” for the K key.&lt;/p&gt;  &lt;p&gt;This immediately caught my attention, and I had to make the evil caterpillar curse violently so mom would toss it in the closet.&amp;#160; With Liam’s full attention, I hit the F, then K keys.&amp;#160; Again, “he he he, that tickles!” between the two keys.&amp;#160; I took the caterpillar from Liam.&amp;#160; This was now science!&amp;#160; I tried K, O, “he he he, that tickles!”, K.&amp;#160; FASCINATING!&amp;#160; They built in anti-potty-wording!&amp;#160; It blocked T-I-“he he he, that tickles!”-T, F then C, K-O-“he he he, that tickles!”-C, C-O-“he he he, that tickles!”-C, C-U-“he he he, that tickles!”-M, and P-I-S (latin for &lt;em&gt;to pee&lt;/em&gt;).&amp;#160; J-I-Z worked, as well as B-U-T.&amp;#160; The word for buttocks or donkey (A-“he he he, that tickles!”-S) did not.&lt;/p&gt;  &lt;p&gt;This makes me wonder about other alphabet toys and whether they were as thoroughly scrutinized or not.&amp;#160; Needless to say, I had been working on some SQL for work and decided to see how well it tells the &lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms187384.aspx"&gt;SOUNDEX&lt;/a&gt;&lt;/font&gt; difference between various spellings of rather naughty words using &lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms188753.aspx"&gt;DIFFERENCE&lt;/a&gt;&lt;/font&gt;.&amp;#160; Using SQL 2005, the results were startlingly poor.&amp;#160; In a few instances, SQL was smart in its comparisons, however in many cases a comparison between, say, a naughty reference to a woman’s genitals and a man’s returns a &lt;font face="Courier New" size="3"&gt;DIFFERENCE&lt;/font&gt; value of 3.&amp;#160; For those who don’t know, the value returned ranges from 0 to 4, 0 being completely dissimilar to 4 being extremely similar if not identical.&amp;#160; The values in the above case &lt;em&gt;should&lt;/em&gt; have been a 0.&amp;#160; The SQL and source for the simple tests are &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/PottyWords.zip"&gt;here&lt;/a&gt;.&amp;#160; Basically, I’d at least look at additional resources for filtering potty language from user input.&lt;/p&gt;  &lt;p&gt;I guess really the only useful thing that came out of this arguably utterly useless exercise is some quick C# I threw together to de-Cartesian-ize my SQL result set:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="overflow: auto; width: 450px; height: 300px"&gt;&lt;style&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--&lt;br /&gt; /* Style Definitions */&lt;br /&gt; p.msonormal, li.msonormal, div.msonormal&lt;br /&gt;	{margin-top:0in;&lt;br /&gt;	margin-right:0in;&lt;br /&gt;	margin-bottom:10.0pt;&lt;br /&gt;	margin-left:0in;&lt;br /&gt;	line-height:115%;&lt;br /&gt;	font-size:11.0pt;&lt;br /&gt;	font-family:"Calibri","sans-serif";}&lt;br /&gt;--&gt;&lt;/style&gt;&lt;nobr&gt;     &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;using&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt; System;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;using&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;using&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt; System.Text;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;using&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt; System.IO;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt; ConsoleApplication1&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;{&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;class&lt;/span&gt; Program&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; csv = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;(&lt;span style="color: #2b91af"&gt;File&lt;/span&gt;.ReadAllLines(&lt;span style="color: #a31515"&gt;&amp;quot;potty.csv&amp;quot;&lt;/span&gt;));&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; csvmod = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; csv.FindAll(&lt;span style="color: blue"&gt;delegate&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt; s)&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt;[] l = s.Split(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: blue"&gt;char&lt;/span&gt;[] { &lt;span style="color: #a31515"&gt;','&lt;/span&gt; });&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if&lt;/span&gt; (csvmod.FindIndex(&lt;span style="color: blue"&gt;delegate&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt; s2)&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; (s2.Contains(l[0] + &lt;span style="color: #a31515"&gt;&amp;quot;,&amp;quot;&lt;/span&gt;) &amp;amp;&amp;amp; s2.Contains(l[1] + &lt;span style="color: #a31515"&gt;&amp;quot;,&amp;quot;&lt;/span&gt;) &amp;amp;&amp;amp; (s2.IndexOf(l[0] + &lt;span style="color: #a31515"&gt;&amp;quot;,&amp;quot;&lt;/span&gt;) != s2.IndexOf(l[1] + &lt;span style="color: #a31515"&gt;&amp;quot;,&amp;quot;&lt;/span&gt;)));&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }) &amp;lt; 0)&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; csvmod.Add(s);&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;false&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;File&lt;/span&gt;.WriteAllLines(&lt;span style="color: #a31515"&gt;&amp;quot;potty-less.csv&amp;quot;&lt;/span&gt;, csvmod.ToArray());&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;Courier New&amp;quot;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 12pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;"&gt;}&lt;/span&gt;&lt;/p&gt;   &lt;/nobr&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Just an example of hot anonymous delegate action for ya.&lt;/p&gt;  &lt;p&gt;Tasty…&lt;/p&gt;  &lt;p&gt;~zagnut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-4185878022854761835?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/kGBgCWMJnWw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/4185878022854761835/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=4185878022854761835&amp;isPopup=true" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/4185878022854761835?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/4185878022854761835?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/kGBgCWMJnWw/baby-toys-potty-words-sql-and-me.html" title="Baby Toys, Potty Words, SQL, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/02/baby-toys-potty-words-sql-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YHR3s4fyp7ImA9WxVQF0w.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-4676126127063494692</id><published>2009-02-03T21:37:00.001-05:00</published><updated>2009-02-03T21:38:56.537-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-03T21:38:56.537-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="editpoint" /><category scheme="http://www.blogger.com/atom/ns#" term="textpoint" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="codeelement" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="bodytext" /><category scheme="http://www.blogger.com/atom/ns#" term="programmatically change code" /><category scheme="http://www.blogger.com/atom/ns#" term="vccodefunction" /><category scheme="http://www.blogger.com/atom/ns#" term="visual studio" /><category scheme="http://www.blogger.com/atom/ns#" term="extensions" /><category scheme="http://www.blogger.com/atom/ns#" term="outputdebugstring" /><category scheme="http://www.blogger.com/atom/ns#" term="programatically modify code" /><category scheme="http://www.blogger.com/atom/ns#" term="codemodel" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><title>Visual Studio Extensions, C++ Debugging, and Me…</title><content type="html">&lt;p&gt;So, I am lazy, as I believe most programmers are.&amp;#160; I follow &lt;a href="http://www.amazon.com/Bill-Cosby-Himself/dp/6302428122"&gt;Bill Cosby’s sage advice&lt;/a&gt; to &lt;a href="http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;ct=clnk&amp;amp;cd=3&amp;amp;url=http%3A%2F%2F74.125.47.132%2Fsearch%3Fq%3Dcache%3A570kVG7nrWEJ%3Aforum.dvdtalk.com%2Fdvd-reviews-recommendations%2F380294-dvd-talk-review-bill-cosby-himself.html%2Bbill%2Bcosby%2Bhimself%2B%2522It%2Btakes%2Bgreat%2Bthinking%2Band%2Bwork%2C%2Bto%2Bkeep%2Bfrom%2Bworking.%2522%26hl%3Den%26ct%3Dclnk%26cd%3D3%26gl%3Dus&amp;amp;ei=2f2ISYbIBtWDtwfbp6ikBw&amp;amp;usg=AFQjCNHixr9nQfsSzwulpRT09UtEDF7fSw&amp;amp;sig2=qbP0BS-KvfCDDg1_5VDpbw"&gt;work hard to keep from working&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;At work I’d “inherited” a code-complete medium-sized application in C++ that requires somewhat extensive feature enhancements / changes (due to the customer, of course).&lt;/p&gt;  &lt;p&gt;I’ve been noticing that it seems much easier to write very foreign looking code in C / C++ than it is in C#, and although this application was obviously brilliantly coded, it is quite foreign indeed, seeming to be more of a C+ application than full-on C or C++.&lt;/p&gt;  &lt;p&gt;Nevertheless, I have my work cut out for me, and it needs to be done FAST.&amp;#160; I need to make changes and see what breaks, then fix it, and so on.&amp;#160; The problem was, no debugging code was written into the application &lt;em&gt;at all&lt;/em&gt;.&amp;#160; What was I to do?&amp;#160; I could spend a good 2 to 3 weeks adding debug output to all the functions, but I don’t have 2 to 3 weeks.&amp;#160; WHAT DO I DO?&lt;/p&gt;  &lt;p&gt;Introducing &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/AutoDebugIndexer.zip"&gt;AutoDebugIndexer&lt;/a&gt;!&amp;#160; It’s a simple &lt;a href="http://msdn.microsoft.com/en-us/vsx/default.aspx"&gt;Visual Studio Extension&lt;/a&gt; in C# that tried to add an &lt;a href="http://msdn.microsoft.com/en-us/library/aa363362(VS.85).aspx"&gt;OutputDebugStringA&lt;/a&gt; to the beginning of every function it finds.&amp;#160; What’s great is &lt;em&gt;it seems to work!&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;It simply recurses through all the &lt;a href="http://msdn.microsoft.com/en-us/library/envdte.codeelement.aspx"&gt;CodeElements&lt;/a&gt; of each &lt;a href="http://msdn.microsoft.com/en-us/library/envdte.project.aspx"&gt;Project&lt;/a&gt;’s &lt;a href="http://msdn.microsoft.com/en-us/library/envdte.codemodel.aspx"&gt;CodeModel&lt;/a&gt;, checks to see if each (as a &lt;a href="http://msdn.microsoft.com/en-us/library/aa712214(VS.71).aspx"&gt;C++ CodeElement&lt;/a&gt;) is a &lt;a href="http://msdn.microsoft.com/en-us/library/envdte.vscmelement.aspx"&gt;vsCMElementFunction&lt;/a&gt;, and if so, tries to slap an &lt;a href="http://msdn.microsoft.com/en-us/library/aa363362(VS.85).aspx"&gt;OutputDebugStringA&lt;/a&gt; containing the function’s &lt;a href="http://msdn.microsoft.com/en-us/library/envdte.codefunction.fullname.aspx"&gt;FullName&lt;/a&gt; at the beginning of that function’s &lt;a href="http://msdn.microsoft.com/en-us/library/aa652063(VS.71).aspx"&gt;BodyText&lt;/a&gt;.&amp;#160; &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/AutoDebugIndexer.zip"&gt;Download the source&lt;/a&gt; and see for yourself.&amp;#160; Really you only need to look at AutoDebug.cs, everything else is pretty much Extensibility Wizard code.&lt;/p&gt;  &lt;p&gt;On a side note, this is an extremely simple solution here.&amp;#160; I did not try at all to make this pretty, nor make it work beyond C++.&amp;#160; The latter is easy, however.&amp;#160; You’d just test for the code type, at the very least at the project level, and if it is say C#, insert a System.Diagnostics.Debug.WriteLine(“blah”); instead of the OutputDebugStringA.&lt;/p&gt;  &lt;p&gt;Hope this is as valuable to you as it certainly will be for me!&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-4676126127063494692?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/qXHEyXJkRe4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/4676126127063494692/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=4676126127063494692&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/4676126127063494692?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/4676126127063494692?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/qXHEyXJkRe4/visual-studio-extensions-c-debugging.html" title="Visual Studio Extensions, C++ Debugging, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/02/visual-studio-extensions-c-debugging.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4GRHY5eip7ImA9WxVRFUw.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-1924553657224710273</id><published>2009-01-21T00:44:00.002-05:00</published><updated>2009-01-21T00:48:45.822-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-21T00:48:45.822-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="ice" /><category scheme="http://www.blogger.com/atom/ns#" term="PCLinuxOS" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="science" /><category scheme="http://www.blogger.com/atom/ns#" term="bitmap" /><category scheme="http://www.blogger.com/atom/ns#" term="compression" /><title>In the name of Science, and Me…</title><content type="html">&lt;p&gt;All programmers, at one point or another, have dreamt of this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_TWT435FEB_Y/SXa2I4uisVI/AAAAAAAAAOI/umpGR0RdYsw/s1600-h/3M%20TA3.png"&gt;&lt;img title="3M TA3" style="border: 0px none ; display: inline;" alt="3M TA3" src="http://lh6.ggpht.com/_TWT435FEB_Y/SXa2KrJtRnI/AAAAAAAAAOM/ZK1McBTWvnE/3M%20TA3_thumb.png?imgmax=800" border="0" height="54" width="54" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Of course, you know what this is, right?  It’s a file.  Duh, you say?  No, you don’t understand.  Each pixel represents 4 bytes of a file.  I used the first two pixels to “store” the number of bytes of the actual file, then the rest up to that white line at the end, is the file.&lt;/p&gt;  &lt;p&gt;Brilliant?  Yes, yes I know.  I have not been able to purge my mind of this ridiculously stupid project / experiment for years.  Every now and then, it’s very “what if” resurfaces like a slightly annoyed blackhead.  It needed popping…&lt;/p&gt;  &lt;p&gt;Needless to say, it is not very good for compressing.  Zipping the image actually increases it’s size slightly.  I was skeptical of this, though (this is SCIENCE), so I decided to try it on a &lt;a href="http://www.pclinuxos.com/"&gt;PCLinuxOS&lt;/a&gt; &lt;a href="http://spout.ussg.indiana.edu/linux/pclinuxos/pclinuxos/live-cd/english/preview/pclinuxos-minime-2008.iso"&gt;Mini-Me 2008 ISO&lt;/a&gt; image I had laying around on my desktop, which is around 296MB.  The bmp generated is quite large – 8821 x 8821.  The compression results:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;PCLOS ISO: 311,207,936 bytes&lt;/li&gt;    &lt;li&gt;PCLOS ISO bitmapped: 309,407,681 bytes&lt;/li&gt;    &lt;li&gt;PCLOS ISO zipped: 307,880,700 bytes&lt;/li&gt;    &lt;li&gt;PCLOS ISO bitmapped &amp;amp; zipped: 309,407,811 bytes&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There.  Finally.  Purged from my mind…but…&lt;/p&gt;  &lt;p&gt;WHAT IF I GENERATED A &lt;em&gt;SERIES&lt;/em&gt; OF 50 x 50 BITMAPS OF THE ISO AND STRUNG THEM INTO AN AVI?&lt;/p&gt;  &lt;p&gt;Not going there.  If you do, please dear God and baby Jesus let me know how it goes.  &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/BMPCodeTest.zip"&gt;Here’s my dumb code&lt;/a&gt; if it’ll help, or get it from here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/SXa2KvEVlvI/AAAAAAAAAOQ/GcO8WTV7_Qs/s1600-h/file.png"&gt;&lt;img title="file" style="border: 0px none ; display: inline;" alt="file" src="http://lh4.ggpht.com/_TWT435FEB_Y/SXa2K7KKOOI/AAAAAAAAAOU/9EPW4Hr9A38/file_thumb.png?imgmax=800" border="0" height="57" width="57" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;But that’s not all I did in the name of science tonight!  I went out to have a cigarette (in our 15 degree weather) in celebration of lobotomizing the bitmap wart from my mind to discover this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_TWT435FEB_Y/SXa2Lc-mVwI/AAAAAAAAAOY/btFDAaJ6LZU/s1600-h/lite-off%5B4%5D.png"&gt;&lt;img title="lite-off" style="border: 0px none ; display: inline;" alt="lite-off" src="http://lh4.ggpht.com/_TWT435FEB_Y/SXa2L6nCGPI/AAAAAAAAAOc/Rjf3wG4hx-A/lite-off_thumb%5B2%5D.png?imgmax=800" border="0" height="498" width="451" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the name of science, I &lt;em&gt;had&lt;/em&gt; to know what it would look like lit up.  I knew the dangers.  I knew I might, potentially, kill the power to our house, destroy my beloved TV, and black out the neighborhood.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_TWT435FEB_Y/SXa2Medw38I/AAAAAAAAAOg/lR8Dx9VdH8I/s1600-h/lite-on%5B5%5D.png"&gt;&lt;img title="lite-on" style="border: 0px none ; display: inline;" alt="lite-on" src="http://lh6.ggpht.com/_TWT435FEB_Y/SXa2M6PIHtI/AAAAAAAAAOk/t1vj84fwbAE/lite-on_thumb%5B3%5D.png?imgmax=800" border="0" height="464" width="450" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Eh, boring.  Thought all the ice would light up or something…&lt;/p&gt;  &lt;p&gt;~zagnut&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-1924553657224710273?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/PKqC4mgtFKE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/1924553657224710273/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=1924553657224710273&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1924553657224710273?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1924553657224710273?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/PKqC4mgtFKE/in-name-of-science-and-me.html" title="In the name of Science, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/01/in-name-of-science-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUDQ3Y5eip7ImA9WxVSFEs.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-8336714138370233117</id><published>2009-01-08T20:24:00.001-05:00</published><updated>2009-01-08T20:24:32.822-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-08T20:24:32.822-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="565" /><category scheme="http://www.blogger.com/atom/ns#" term="DIB" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="5-5-5" /><category scheme="http://www.blogger.com/atom/ns#" term="graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="5-6-5" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="555" /><category scheme="http://www.blogger.com/atom/ns#" term="bitmap" /><category scheme="http://www.blogger.com/atom/ns#" term="device independent bitmap" /><title>Device Independent Bitmaps, C#, and Me…REDUX!</title><content type="html">&lt;p&gt;Well, after using the &lt;a href="http://taotekaching.blogspot.com/2008/11/dib-c-and-me.html"&gt;previously posted code&lt;/a&gt; in some projects at work, some limitations arose quickly.&amp;#160; The two biggest were support for 8-bit bitmaps, and support for both 5-5-5 and 5-6-5 16-bit bitmaps.&lt;/p&gt;  &lt;p&gt;The &lt;em&gt;new&lt;/em&gt; code looks like the following:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt; &lt;style&gt;&lt;br /&gt;&lt;br /&gt; @font-face&lt;br /&gt;	{font-family:"Cambria Math";&lt;br /&gt;	panose-1:2 4 5 3 5 4 6 3 2 4;&lt;br /&gt;	mso-font-charset:0;&lt;br /&gt;	mso-generic-font-family:roman;&lt;br /&gt;	mso-font-pitch:variable;&lt;br /&gt;	mso-font-signature:-1610611985 1107304683 0 0 159 0;}&lt;br /&gt;@font-face&lt;br /&gt;	{font-family:calibri;&lt;br /&gt;	panose-1:2 15 5 2 2 2 4 3 2 4;&lt;br /&gt;	mso-font-charset:0;&lt;br /&gt;	mso-generic-font-family:swiss;&lt;br /&gt;	mso-font-pitch:variable;&lt;br /&gt;	mso-font-signature:-1610611985 1073750139 0 0 159 0;}&lt;br /&gt; p.msonormal, li.msonormal, div.msonormal&lt;br /&gt;	{mso-style-unhide:no;&lt;br /&gt;	mso-style-qformat:yes;&lt;br /&gt;	mso-style-parent:"";&lt;br /&gt;	margin-top:0in;&lt;br /&gt;	margin-right:0in;&lt;br /&gt;	margin-bottom:10.0pt;&lt;br /&gt;	margin-left:0in;&lt;br /&gt;	line-height:115%;&lt;br /&gt;	mso-pagination:widow-orphan;&lt;br /&gt;	font-size:11.0pt;&lt;br /&gt;	font-family:"Calibri","sans-serif";&lt;br /&gt;	mso-ascii-font-family:calibri;&lt;br /&gt;	mso-ascii-theme-font:minor-latin;&lt;br /&gt;	mso-fareast-font-family:calibri;&lt;br /&gt;	mso-fareast-theme-font:minor-latin;&lt;br /&gt;	mso-hansi-font-family:calibri;&lt;br /&gt;	mso-hansi-theme-font:minor-latin;&lt;br /&gt;	mso-bidi-font-family:"Times New Roman";&lt;br /&gt;	mso-bidi-theme-font:minor-bidi;}&lt;br /&gt;.msochpdefault&lt;br /&gt;	{mso-style-type:export-only;&lt;br /&gt;	mso-default-props:yes;&lt;br /&gt;	mso-ascii-font-family:calibri;&lt;br /&gt;	mso-ascii-theme-font:minor-latin;&lt;br /&gt;	mso-fareast-font-family:calibri;&lt;br /&gt;	mso-fareast-theme-font:minor-latin;&lt;br /&gt;	mso-hansi-font-family:calibri;&lt;br /&gt;	mso-hansi-theme-font:minor-latin;&lt;br /&gt;	mso-bidi-font-family:"Times New Roman";&lt;br /&gt;	mso-bidi-theme-font:minor-bidi;}&lt;br /&gt;.msopapdefault&lt;br /&gt;	{mso-style-type:export-only;&lt;br /&gt;	margin-bottom:10.0pt;&lt;br /&gt;	line-height:115%;}&lt;br /&gt;@page section1&lt;br /&gt;	{size:8.5in 11.0in;&lt;br /&gt;	margin:1.0in 1.0in 1.0in 1.0in;&lt;br /&gt;	mso-header-margin:.5in;&lt;br /&gt;	mso-footer-margin:.5in;&lt;br /&gt;	mso-paper-source:0;}&lt;br /&gt;div.section1&lt;br /&gt;	{page:section1;}&lt;br /&gt;table.msonormaltable&lt;br /&gt;	{mso-style-name:"Table Normal";&lt;br /&gt;	mso-tstyle-rowband-size:0;&lt;br /&gt;	mso-tstyle-colband-size:0;&lt;br /&gt;	mso-style-noshow:yes;&lt;br /&gt;	mso-style-priority:99;&lt;br /&gt;	mso-style-qformat:yes;&lt;br /&gt;	mso-style-parent:"";&lt;br /&gt;	mso-padding-alt:0in 5.4pt 0in 5.4pt;&lt;br /&gt;	mso-para-margin-top:0in;&lt;br /&gt;	mso-para-margin-right:0in;&lt;br /&gt;	mso-para-margin-bottom:10.0pt;&lt;br /&gt;	mso-para-margin-left:0in;&lt;br /&gt;	line-height:115%;&lt;br /&gt;	mso-pagination:widow-orphan;&lt;br /&gt;	font-size:11.0pt;&lt;br /&gt;	font-family:"Calibri","sans-serif";&lt;br /&gt;	mso-ascii-font-family:calibri;&lt;br /&gt;	mso-ascii-theme-font:minor-latin;&lt;br /&gt;	mso-hansi-font-family:calibri;&lt;br /&gt;	mso-hansi-theme-font:minor-latin;}&lt;/style&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div class="Section1" style="overflow: scroll; width: 425px; height: 450px"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt; System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt; System.Collections.Generic;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt; System.Drawing;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt; System.Drawing.Imaging;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt; System.Runtime.InteropServices;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt; System.IO;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt; DIBitmaps&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; DIB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// our BITMAPINFOHEADER struct, as per gdi&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// use LayoutKind to make sure data is marshalled as we've laid it out&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;[&lt;span style="color: #2b91af"&gt;StructLayout&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;LayoutKind&lt;/span&gt;.Sequential)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;struct&lt;/span&gt; BITMAPINFOHEADER&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;uint&lt;/span&gt; biSize;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; biWidth;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; biHeight;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;ushort&lt;/span&gt; biPlanes;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;ushort&lt;/span&gt; biBitCount;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;uint&lt;/span&gt; biCompression;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;uint&lt;/span&gt; biSizeImage;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; biXPelsPerMeter;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; biYPelsPerMeter;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;uint&lt;/span&gt; biClrUsed;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;uint&lt;/span&gt; biClrImportant;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;//public void Init()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;//{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;//&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;biSize = (uint)Marshal.SizeOf(this);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;//}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; Bitmap BitmapFromDIB(&lt;span style="color: #2b91af"&gt;MemoryStream&lt;/span&gt; dib)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// get byte array of device independent bitmap&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;byte&lt;/span&gt;[] dibBytes = dib.ToArray();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// get the handle for the byte array and &amp;quot;pin&amp;quot; that memory (i.e. prevent &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// garbage collector from gobbling it up right away)...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;GCHandle&lt;/span&gt; hdl = &lt;span style="color: #2b91af"&gt;GCHandle&lt;/span&gt;.Alloc(dibBytes, &lt;span style="color: #2b91af"&gt;GCHandleType&lt;/span&gt;.Pinned);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// marshal our data into a BITMAPINFOHEADER struct per Win32&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// definition of BITMAPINFOHEADER&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;BITMAPINFOHEADER dibHdr = (BITMAPINFOHEADER)&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.PtrToStructure&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;(hdl.AddrOfPinnedObject(), &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(BITMAPINFOHEADER));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;bool&lt;/span&gt; is555 = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Bitmap bmp = &lt;span style="color: blue"&gt;null&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (dibHdr.biBitCount == 8)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// set our pointer to end of BITMAPINFOHEADER&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Int64&lt;/span&gt; jumpTo = hdl.AddrOfPinnedObject().ToInt64() + dibHdr.biSize;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;bmp = &lt;span style="color: blue"&gt;new&lt;/span&gt; Bitmap(dibHdr.biWidth, dibHdr.biHeight, PixelFormat.Format8bppIndexed);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;bmp.SetResolution((100f * (&lt;span style="color: blue"&gt;float&lt;/span&gt;)dibHdr.biXPelsPerMeter) / 2.54f,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;(100f * (&lt;span style="color: blue"&gt;float&lt;/span&gt;)dibHdr.biYPelsPerMeter) / 2.54f);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// set the colors in our palette&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ColorPalette palette = bmp.Palette;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt; ptr = &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;int&lt;/span&gt; colors = (&lt;span style="color: blue"&gt;int&lt;/span&gt;)(dibBytes.Length - (bmp.Width * bmp.Height) - dibHdr.biSize);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 256; i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ptr = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;(jumpTo);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;uint&lt;/span&gt; bmiColor = (&lt;span style="color: blue"&gt;uint&lt;/span&gt;)&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.ReadInt32(ptr);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;int&lt;/span&gt; r = (&lt;span style="color: blue"&gt;int&lt;/span&gt;)((bmiColor &amp;amp; 0xFF0000) &amp;gt;&amp;gt; 16),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;g = (&lt;span style="color: blue"&gt;int&lt;/span&gt;)((bmiColor &amp;amp; 0xFF00) &amp;gt;&amp;gt; 8),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;b = (&lt;span style="color: blue"&gt;int&lt;/span&gt;)((bmiColor &amp;amp; 0xFF));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;palette.Entries[i] = Color.FromArgb(r, g, b);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;jumpTo += 4;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;bmp.Palette = palette;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// now write the remaining bmp data to our bitmap&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;BitmapData _8bd = bmp.LockBits(&lt;span style="color: blue"&gt;new&lt;/span&gt; Rectangle(0, 0, bmp.Width, bmp.Height),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160; &lt;/span&gt;jumpTo -= hdl.AddrOfPinnedObject().ToInt64();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.Copy(dibBytes, (&lt;span style="color: blue"&gt;int&lt;/span&gt;)jumpTo, _8bd.Scan0, _8bd.Stride * _8bd.Height);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;bmp.UnlockBits(_8bd);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; ((dibHdr.biBitCount == 16) &amp;amp;&amp;amp; (dibHdr.biCompression == 3))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Int64&lt;/span&gt; jumpTo = (&lt;span style="color: #2b91af"&gt;Int64&lt;/span&gt;)(dibHdr.biClrUsed * (&lt;span style="color: blue"&gt;uint&lt;/span&gt;)4 + dibHdr.biSize);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt; ptr = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;(hdl.AddrOfPinnedObject().ToInt64() + jumpTo);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;ushort&lt;/span&gt; redMask = (&lt;span style="color: blue"&gt;ushort&lt;/span&gt;)&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.ReadInt16(ptr);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ptr = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;(ptr.ToInt64() + (2 * &lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.SizeOf(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;UInt16&lt;/span&gt;))));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;ushort&lt;/span&gt; greenMask = (&lt;span style="color: blue"&gt;ushort&lt;/span&gt;)&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.ReadInt16(ptr);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ptr = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;(ptr.ToInt64() + (2 * &lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.SizeOf(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;UInt16&lt;/span&gt;))));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;ushort&lt;/span&gt; blueMask = (&lt;span style="color: blue"&gt;ushort&lt;/span&gt;)&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.ReadInt16(ptr);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;is555 = ((redMask == 0x7C00) &amp;amp;&amp;amp; (greenMask == 0x03E0) &amp;amp;&amp;amp; (blueMask == 0x001F));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// go ahead and release the &amp;quot;pin&amp;quot; from our handle on that memory&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;hdl.Free();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// If the target device does not have one plane, or we're working with a bitmap other &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// than a non-compressed (BI_RGB) bitmap, we're not gonna work woith it&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (dibHdr.biPlanes != 1 || (dibHdr.biCompression != 0 &amp;amp;&amp;amp; dibHdr.biCompression != 3))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;null&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (bmp == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// we need to know beforehand the pixel-depth of our bitmap&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;PixelFormat fmt = PixelFormat.Format24bppRgb;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;switch&lt;/span&gt; (dibHdr.biBitCount)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;case&lt;/span&gt; 32:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;fmt = PixelFormat.Format32bppRgb;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;case&lt;/span&gt; 24:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;fmt = PixelFormat.Format24bppRgb;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;case&lt;/span&gt; 16:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;fmt = (is555) ? PixelFormat.Format16bppRgb555 :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;PixelFormat.Format16bppRgb565;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;break&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;default&lt;/span&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;null&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// prepare for our output bitmap&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;bmp = &lt;span style="color: blue"&gt;new&lt;/span&gt; Bitmap(dibHdr.biWidth, dibHdr.biHeight, fmt);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// load our &amp;quot;empty&amp;quot; bitmap into memory and lock it for&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// writing in the format we specified&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;BitmapData bd = bmp.LockBits(&lt;span style="color: blue"&gt;new&lt;/span&gt; Rectangle(0, 0, bmp.Width, bmp.Height),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ImageLockMode.WriteOnly, fmt);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// marshal our device independent bitmap data over to our output bitmap&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.Copy(dibBytes, &lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.SizeOf(dibHdr), bd.Scan0, bd.Stride * bd.Height);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// we're done marshalling, so release our bitmapdata lock&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;bmp.UnlockBits(bd);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (dibHdr.biHeight &amp;gt; 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// DIB data is upside-down for some reason, so flip it&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// return our bitmap&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt; bmp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8pt; line-height: 115%"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8pt; line-height: 115%"&gt;&lt;o:p&gt;&amp;#160;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The adjusted code can be downloaded &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/DIB.cs"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you find any other issues, please let me know and I’ll get it updated ASAP.&lt;/p&gt;  &lt;p&gt;~ZagNUT&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-8336714138370233117?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/2dQBC-nOIfI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/8336714138370233117/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=8336714138370233117&amp;isPopup=true" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/8336714138370233117?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/8336714138370233117?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/2dQBC-nOIfI/device-independent-bitmaps-c-and.html" title="Device Independent Bitmaps, C#, and Me…REDUX!" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/01/device-independent-bitmaps-c-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4MQXg5cSp7ImA9WxVSE0Q.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-7493820196497940140</id><published>2009-01-08T00:53:00.001-05:00</published><updated>2009-01-08T00:53:00.629-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-08T00:53:00.629-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="YAGOL" /><category scheme="http://www.blogger.com/atom/ns#" term="Win32" /><category scheme="http://www.blogger.com/atom/ns#" term="pong" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Game of Life" /><category scheme="http://www.blogger.com/atom/ns#" term="Conway" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><category scheme="http://www.blogger.com/atom/ns#" term="screensaver" /><title>Conway’s Game of Life, Pong, Screensavers, and Me…</title><content type="html">&lt;p&gt;Greetings, all:&lt;/p&gt;  &lt;p&gt;Due to the &lt;em&gt;massive&lt;/em&gt; increase in my blog traffic (I think I het around 20 / week or so) after I &lt;a href="http://taotekaching.blogspot.com/2008/05/conway-game-of-life-redux-screensavers.html"&gt;initially offered up my Game of Life screensaver&lt;/a&gt;, I now offer, in celebration of the new year, GoLPong!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_TWT435FEB_Y/SWWUuhIlS6I/AAAAAAAAAN4/7nLxnG8cLTY/s1600-h/GoLPong%5B3%5D.png"&gt;&lt;img title="GoLPong" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="459" alt="GoLPong" src="http://lh6.ggpht.com/_TWT435FEB_Y/SWWUvPMQwJI/AAAAAAAAAN8/oDhCz6gGkGU/GoLPong_thumb%5B1%5D.png?imgmax=800" width="408" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;That’s right, for 2009 you now can have a fancy &lt;em&gt;new&lt;/em&gt; Game of Life screensaver.&amp;#160; &lt;strong&gt;BUT THIS ONE’S PACKED WITH NEW FEATURES!&lt;/strong&gt;&amp;#160; Well, what are they?&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Game of Life does &lt;strong&gt;both&lt;/strong&gt; trails and no trails &lt;/li&gt;    &lt;li&gt;Flickers between trails and non-trails &lt;/li&gt;    &lt;li&gt;Pong played live by your computer against itself &lt;/li&gt;    &lt;li&gt;Alternates randomly between these two! &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Oh my god, you say, but how much does it cost?&lt;/p&gt;  &lt;p&gt;Free.&amp;#160; Because I love you.&lt;/p&gt;  &lt;p&gt;It is a beautifully dumb screensaver.&amp;#160; You can get it &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/GolPong.scr"&gt;here&lt;/a&gt;.&amp;#160; The source code (uncommented, of course) is &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/GoLPong.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Tell me how you like it.&amp;#160; Also, send me comments for the 2010 version you’d like to see.&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-7493820196497940140?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/_Hd77RoGu58" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/7493820196497940140/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=7493820196497940140&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/7493820196497940140?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/7493820196497940140?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/_Hd77RoGu58/conways-game-of-life-pong-screensavers.html" title="Conway’s Game of Life, Pong, Screensavers, and Me…" /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2009/01/conways-game-of-life-pong-screensavers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMEQHc4eip7ImA9WxRbFEw.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-9072687845329313436</id><published>2008-12-04T14:20:00.001-05:00</published><updated>2008-12-04T14:20:01.932-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-04T14:20:01.932-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SetParent" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="DllImport" /><category scheme="http://www.blogger.com/atom/ns#" term="managed" /><category scheme="http://www.blogger.com/atom/ns#" term="Win32" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="FindWindow" /><category scheme="http://www.blogger.com/atom/ns#" term="ShellExecute" /><category scheme="http://www.blogger.com/atom/ns#" term="MDI" /><category scheme="http://www.blogger.com/atom/ns#" term="native" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><category scheme="http://www.blogger.com/atom/ns#" term="GetClassName" /><title>Native MDI Containers, Managed Child Forms, and Me...</title><content type="html">&lt;p&gt;So, at work we have this (ugly) native C++ MFC application that the Powers-That-Be &lt;em&gt;insist&lt;/em&gt; needs a complex web-services riddled interface to our social-networking-meets-file-sharing new website.&amp;#160; Initially, said interface was to be in MFC native code action.&amp;#160; I said, &amp;quot;sheeeeeeeeeiiiiiiiiiiiiiiiittt&amp;quot;.&amp;#160; But then the light came: why not do the interface in a .NET form and pass the form handle somehow to the native application to pull it into its window as a child window.&amp;#160; Any interaction between the two can be handled easily through messaging calls.&amp;#160; I immediately began to Google on it.&amp;#160; I found nothing that directly addressed this problem.&amp;#160; I concluded it was one of two things: either it was so easy, no one bothered documenting it, or so rarely done, no one bothered documenting it.&amp;#160; Either way, no one bothered documenting it...&lt;strong&gt;UNTIL NOW!!!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Basically my solution was to grab the parent window's class using a call to &lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms633582(VS.85).aspx"&gt;GetClassName&lt;/a&gt;&lt;/font&gt;, then send this as a command line parameter to the .NET exe via a &lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx"&gt;ShellExecute&lt;/a&gt;&lt;/font&gt; call.&amp;#160; Once in the .NET client, I use two &lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx"&gt;DllImport&lt;/a&gt;&lt;/font&gt;-ed calls: &lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms633499.aspx"&gt;FindWindow&lt;/a&gt;&lt;/font&gt; and &lt;font face="Courier New" size="3"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms633541(VS.85).aspx"&gt;SetParent&lt;/a&gt;&lt;/font&gt; -- &lt;font face="Courier New" size="3"&gt;FindWindow&lt;/font&gt; to get the window handle from the class name I passed in as a parameter, and &lt;font face="Courier New" size="3"&gt;SetParent&lt;/font&gt; to, well, set the parent of my form.&lt;/p&gt;  &lt;p&gt;The sample code is &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/NativeParentManagedChild.zip"&gt;here&lt;/a&gt;.&amp;#160; Note, you'll need to change the hardcoded path in the NativeMaster C++ solution to the output of the ManagedChild project.&amp;#160; Hope it's helpful...&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-9072687845329313436?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/fnblfCD1QbM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/9072687845329313436/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=9072687845329313436&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/9072687845329313436?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/9072687845329313436?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/fnblfCD1QbM/native-mdi-containers-managed-child.html" title="Native MDI Containers, Managed Child Forms, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/12/native-mdi-containers-managed-child.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQESH48fip7ImA9WxVSGEQ.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-1239646047587785079</id><published>2008-11-24T17:18:00.003-05:00</published><updated>2009-01-13T20:58:29.076-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-13T20:58:29.076-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="DIB" /><category scheme="http://www.blogger.com/atom/ns#" term="comments" /><category scheme="http://www.blogger.com/atom/ns#" term="Win32" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><category scheme="http://www.blogger.com/atom/ns#" term="RGB" /><category scheme="http://www.blogger.com/atom/ns#" term="bitmap" /><category scheme="http://www.blogger.com/atom/ns#" term="device independent bitmap" /><title>DIB, C#, and Me...</title><content type="html">&lt;p&gt;Ok, after pulling out my hair trying to generate thumbnails from device-independent bitmaps stored by a CArchive in an "old" MFC program, I finally got help here at the workplace on this.&lt;/p&gt;  &lt;p&gt;I must say I could not find this easily with much Googling, ergo I'm gonna post this up here with comments for anyone else out there looking for the same thing.&lt;/p&gt;  &lt;p&gt;Please suggest any updations to comments and / or code, if you see the need...&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;NOTE: This code has been updated.  Look &lt;/span&gt;&lt;a style="color: rgb(255, 0, 0); font-weight: bold;" href="http://taotekaching.blogspot.com/2009/01/device-independent-bitmaps-c-and.html"&gt;here&lt;/a&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; for it.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div style="overflow: scroll; width: 400px; height: 400px;"&gt;&lt;span style=";font-family:courier;font-size:85%;"  &gt;     &lt;pre&gt;// our BITMAPINFOHEADER struct, as per gdi&lt;br /&gt;// use LayoutKind to make sure data is marshalled as we've laid it out&lt;br /&gt;[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;public struct BITMAPINFOHEADER&lt;br /&gt;{&lt;br /&gt;public uint biSize;&lt;br /&gt;public int biWidth;&lt;br /&gt;public int biHeight;&lt;br /&gt;public ushort biPlanes;&lt;br /&gt;public ushort biBitCount;&lt;br /&gt;public uint biCompression;&lt;br /&gt;public uint biSizeImage;&lt;br /&gt;public int biXPelsPerMeter;&lt;br /&gt;public int biYPelsPerMeter;&lt;br /&gt;public uint biClrUsed;&lt;br /&gt;public uint biClrImportant;&lt;br /&gt;public void Init()&lt;br /&gt;{&lt;br /&gt; biSize = (uint)Marshal.SizeOf(this);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static Bitmap BitmapFromDIB(MemoryStream dib)&lt;br /&gt;{&lt;br /&gt;// get byte array of device independent bitmap&lt;br /&gt;byte[] dibBytes = dib.ToArray();&lt;br /&gt;&lt;br /&gt;// get the handle for the byte array and "pin" that memory (i.e. prevent garbage collector from&lt;br /&gt;// gobbling it up right away)...&lt;br /&gt;GCHandle hdl = GCHandle.Alloc(dibBytes, GCHandleType.Pinned);&lt;br /&gt;&lt;br /&gt;// marshal our data into a BITMAPINFOHEADER struct per Win32 definition of BITMAPINFOHEADER&lt;br /&gt;BITMAPINFOHEADER dibHdr = (BITMAPINFOHEADER)Marshal.PtrToStructure(hdl.AddrOfPinnedObject(), typeof(BITMAPINFOHEADER));&lt;br /&gt;&lt;br /&gt;// go ahead and release the "pin" from our handle on that memory&lt;br /&gt;hdl.Free();&lt;br /&gt;&lt;br /&gt;// If the target device does not have one plane, or we're working with a bitmap other than a&lt;br /&gt;// non-compressed (BI_RGB) bitmap, we're not gonna work woith it&lt;br /&gt;if (dibHdr.biPlanes != 1 || dibHdr.biCompression != 0)&lt;br /&gt; return null;&lt;br /&gt;&lt;br /&gt;// we need to know beforehand the pixel-depth of our bitmap&lt;br /&gt;PixelFormat fmt = PixelFormat.Format24bppRgb;&lt;br /&gt;switch (dibHdr.biBitCount)&lt;br /&gt;{&lt;br /&gt; case 32:&lt;br /&gt;  fmt = PixelFormat.Format32bppRgb;&lt;br /&gt;  break;&lt;br /&gt; case 24:&lt;br /&gt;  fmt = PixelFormat.Format24bppRgb;&lt;br /&gt;  break;&lt;br /&gt; case 16:&lt;br /&gt;  fmt = PixelFormat.Format16bppRgb555;&lt;br /&gt;  break;&lt;br /&gt; default:&lt;br /&gt;  return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// prepare for our output bitmap&lt;br /&gt;Bitmap bmp = new Bitmap(dibHdr.biWidth, dibHdr.biHeight, fmt);&lt;br /&gt;&lt;br /&gt;// load our "empty" bitmap into memory and lock it for writing in the format we specified&lt;br /&gt;BitmapData bd = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.WriteOnly, fmt);&lt;br /&gt;&lt;br /&gt;// marshal our device independent bitmap data over to our output bitmap&lt;br /&gt;Marshal.Copy(dibBytes, Marshal.SizeOf(dibHdr), bd.Scan0, bd.Stride * bd.Height);&lt;br /&gt;&lt;br /&gt;// we're done marshalling, so release our bitmapdata lock&lt;br /&gt;bmp.UnlockBits(bd);&lt;br /&gt;&lt;br /&gt;// DIB data is upside-down for some reason, so flip it&lt;br /&gt;bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);&lt;br /&gt;&lt;br /&gt;// return our bitmap&lt;br /&gt;return bmp;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;~simon&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-1239646047587785079?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/j1n-XMrPwOg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/1239646047587785079/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=1239646047587785079&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1239646047587785079?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1239646047587785079?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/j1n-XMrPwOg/dib-c-and-me.html" title="DIB, C#, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/11/dib-c-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcCSXc4fSp7ImA9WxRVFE4.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-507601012445423340</id><published>2008-11-11T15:57:00.001-05:00</published><updated>2008-11-11T15:57:48.935-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-11T15:57:48.935-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Soap" /><category scheme="http://www.blogger.com/atom/ns#" term="TinyXML" /><category scheme="http://www.blogger.com/atom/ns#" term="web services" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="xmethods" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><title>C++, Web Services, TinyXML, and Me...</title><content type="html">&lt;p&gt;Greetings...&lt;/p&gt;  &lt;p&gt;So my current employer wants our existing MFC application to interface with some web services exposed by our new website (sorry, need to stay hush-hush about it at the moment).&amp;#160; Now, while the MFC side of things is turning out to be a bitch, I threw together some classes to make life easier for me.&amp;#160; The source is &lt;a href="http://dl.getdropbox.com/u/1534/My%20Software%20Share/CppWebServices.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;CppHttp.h is a simple class to do GET and POST requests through.&amp;#160; Currently, it does NOT do multi-part requests, but I promise to update this when I get to that.&amp;#160; To consume the responses, I'm using &lt;a href="http://sourceforge.net/projects/tinyxml"&gt;TinyXML&lt;/a&gt;.&amp;#160; I looked at some other libraries, including using the MsXml stuff, but they were WAY overboard what I needed.&amp;#160; I included a sample class that calls a stock market thing I found on &lt;a href="http://www.xmethods.net"&gt;xmethods.net&lt;/a&gt;.&amp;#160; The Find method in there is particularly useful when getting, say, a DataTable back and wanting to go straight to the nodes.&lt;/p&gt;  &lt;p&gt;Anyway, hope this is useful.&amp;#160; Let me know your thoughts.&lt;/p&gt;  &lt;p&gt;~ZagNut&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-507601012445423340?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/g1A8kf0EDYg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/507601012445423340/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=507601012445423340&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/507601012445423340?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/507601012445423340?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/g1A8kf0EDYg/c-web-services-tinyxml-and-me.html" title="C++, Web Services, TinyXML, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/11/c-web-services-tinyxml-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UFRX84eCp7ImA9WxRXGUg.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-8215458960654204753</id><published>2008-10-25T12:12:00.002-04:00</published><updated>2008-10-25T12:13:34.130-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-25T12:13:34.130-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Dead Space" /><category scheme="http://www.blogger.com/atom/ns#" term="MGS4" /><category scheme="http://www.blogger.com/atom/ns#" term="Metal Gear Solid 4" /><category scheme="http://www.blogger.com/atom/ns#" term="Ashley Todd" /><category scheme="http://www.blogger.com/atom/ns#" term="Playstation 3" /><title>Dead Space, Metal Gear Solid 4, Ashley Todd, and Me...</title><content type="html">Ok, first off, a Metal Gear Solid 4 update:  I am increasing my rating from a 6 to a 6.5.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For those of you in the know, I am now off to deal with Rex.  At any rate, even my wife was interested in the plot, although it wasn't like she could flip the channel, heh...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am not sure how soon I will return to MGS4, however, as Deep Space just came, and my god is it great.  The graphics, like MGS4 are stunning, it IS creepy, and I very much like how the storyline (albeit far, far "simpler" than MGS4) is unfolding through the gameplay and not through a million cut scenes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Other than that, no coding or political updates, per se.  One quick note on the &lt;a href="http://edition.cnn.com/2008/POLITICS/10/24/mccain.sticker/?iref=hpmostpop"&gt;Ashley Todd&lt;/a&gt; debacle: although we are extremely close to electing the first black President in our history -- an enormous leap since as late as the 50's, this is still obviously only window-dressing over our nation's subconscious.  Miss Todd could have said &lt;em&gt;anything&lt;/em&gt;, including that she simply can't remember &lt;em&gt;what&lt;/em&gt; happened.  Instead it was a large, viscous black man who attacked her.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Why is it never a Chinese man?  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-8215458960654204753?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/DWn_ab7oGv0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/8215458960654204753/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=8215458960654204753&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/8215458960654204753?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/8215458960654204753?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/DWn_ab7oGv0/dead-space-metal-gear-solid-4-ashley.html" title="Dead Space, Metal Gear Solid 4, Ashley Todd, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/10/dead-space-metal-gear-solid-4-ashley.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EHQng5fyp7ImA9WxRXFkw.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-4250553219770994961</id><published>2008-10-21T15:50:00.004-04:00</published><updated>2008-10-21T16:07:13.627-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-21T16:07:13.627-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Dead Space" /><category scheme="http://www.blogger.com/atom/ns#" term="FarCry 2" /><category scheme="http://www.blogger.com/atom/ns#" term="FarCry" /><category scheme="http://www.blogger.com/atom/ns#" term="PS3" /><category scheme="http://www.blogger.com/atom/ns#" term="MGS4" /><category scheme="http://www.blogger.com/atom/ns#" term="Metal Gear Solid 4" /><category scheme="http://www.blogger.com/atom/ns#" term="Playstation 3" /><title>Metal Gear Solid 4 and Me...</title><content type="html">Ok, I am not a hardcore gamer by any means.  My wife got me a PS3 for Father's Day, as I got to see Grand Theft Auto on his and immediately spooged myself.  GTA4 = 10 / 10.  Period.  Very fun.  Etc.&lt;br /&gt;&lt;br /&gt;To me, there is a common denominator between GTA4 and FarCry -- two (very?) different games: both follow a mantra of allow the gamer to go anywhere, do anything.  Discovering those worlds and just playing around in them makes the product soooo much more enjoyable.  A big reason why I'm giving MGS4 a 6 / 10...tops.&lt;br /&gt;&lt;br /&gt;First and foremost, the TONS of cut scenes in MGS4 is driving me crazy.  The game is so beautiful and very engrossing &lt;span style="font-style: italic;"&gt;when you get to play&lt;/span&gt; (although not being able to jump, say over a very narrow hole in the floor, is annoying).&lt;br /&gt;&lt;br /&gt;Second, I don't know what Tokyo Mushrooms the development team was eating when they made this, but the storyline was so very cool UNTIL Raiden comes in (if you've played it, you know what cut scene I'm talking about).  Then it gets super-anime and quite frankly, super-gay.  The game actually felt very mature, like it was a commentary on war (and it may still be), but is now cartoonish and rediculous.&lt;br /&gt;&lt;br /&gt;I'll definitely re-post should my views on this game change, but for right now, I'm somewhat disappointed.  A 6 out of 10.&lt;br /&gt;&lt;br /&gt;I am looking forward to Dead Space, which should arrive any day now, as well as FarCry 2 (ooooh yeah!).&lt;br /&gt;&lt;br /&gt;Your thoughts on MGS4?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-4250553219770994961?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/PwAQH2EgTXY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/4250553219770994961/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=4250553219770994961&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/4250553219770994961?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/4250553219770994961?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/PwAQH2EgTXY/metal-gear-solid-4-and-me.html" title="Metal Gear Solid 4 and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/10/metal-gear-solid-4-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUHSXk_cCp7ImA9WxRQEUg.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-33642143360847327</id><published>2008-10-04T16:30:00.001-04:00</published><updated>2008-10-04T16:30:38.748-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-04T16:30:38.748-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Dice.com" /><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="applet" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="programming language" /><title>Java, Dice, Programming Languages and Me...</title><content type="html">&lt;p&gt;So, I decided to write another Applet, this time one that gives the &amp;quot;popularity&amp;quot; of a programming language based on the number of instances found from a generic Dice.com search.&lt;/p&gt; &lt;p&gt;&lt;applet codebase="http://dl.getdropbox.com/u/1534/My%20Software%20Share/DiceProgLangsApplet" height="380" width="250" code="Main.class"&gt;&lt;/applet&gt;&lt;/p&gt; &lt;p&gt;The source code is &lt;a href="http://dl-client.getdropbox.com/u/1534/My%20Software%20Share/DiceProgLangsApplet.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-33642143360847327?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/anNE6ZZgqcw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/33642143360847327/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=33642143360847327&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/33642143360847327?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/33642143360847327?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/anNE6ZZgqcw/java-dice-programming-languages-and-me.html" title="Java, Dice, Programming Languages and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/10/java-dice-programming-languages-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QFQXY8fip7ImA9WxRQEE0.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-6429834571615744039</id><published>2008-10-02T22:30:00.001-04:00</published><updated>2008-10-02T22:35:10.876-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-02T22:35:10.876-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="obama" /><category scheme="http://www.blogger.com/atom/ns#" term="vice president" /><category scheme="http://www.blogger.com/atom/ns#" term="debate" /><category scheme="http://www.blogger.com/atom/ns#" term="mccain" /><category scheme="http://www.blogger.com/atom/ns#" term="palin" /><category scheme="http://www.blogger.com/atom/ns#" term="biden" /><title>Politics, The Vice Presidential Debate, and Me...</title><content type="html">&lt;p&gt;Ok, first and foremost: Biden is winning, and won.&amp;#160; Not hugely, but hands down.&amp;#160; However, this post will focus more on Palin, and a new respect I found for her tonight.&amp;#160; My hat's off to that woman.&amp;#160; &lt;/p&gt;  &lt;p&gt;First, she made me feel like I was watching my neighbor suddenly thrown onstage to debate a seasoned politician.&amp;#160; Her nervousness, although well-checked, was still evident.&amp;#160; There was this &amp;quot;hockey-mom&amp;quot;, as has become so popular a euphemism for her, up there playing with the big boys.&amp;#160; Ugh.&amp;#160; The courage that must have took...&lt;/p&gt;  &lt;p&gt;Furthermore, I don't think my toughest cram session for any test in college or otherwise was close to the splatter she must have been going through the last few weeks.&amp;#160; It seemed very obvious to me that most of what came out of her mouth was studied and remembered, and that it was only &amp;quot;known&amp;quot; well enough to most times be put in the right context.&amp;#160; But that knowledge wasn't hers, yet; it hadn't sunk in as understanding.&amp;#160; If it had, it would have come out much more fluidly.&amp;#160; Regardless, my god the amount of information she must have had to assimilate.&lt;/p&gt;  &lt;p&gt;An interesting topic came up on one of the networks Joey and I were watching prior to the debate -- that the biggest thing Palin is defending tonight is her career.&amp;#160; It seemed (I'd only been half listening at the time, as my eardrum was punctured today [another story]), it seemed the commentators / pundits then were implying that, should she grossly fail, her career will be kaput.&lt;/p&gt;  &lt;p&gt;I am convinced McCain and Palin are &lt;em&gt;not&lt;/em&gt; what we want the next four years, but I would be incredibly disgusted were her career to truly suffer after tonight, as she pulled a monumental feat for a small town woman, recently turned Governor.&amp;#160; Same as I would were Obama not given the credit for going from relative obscurity as a community organizer in Chicago to the possible Presidency.&amp;#160; My post from &lt;a href="http://taotekaching.blogspot.com/2008/08/politics-lexicology-and-me.html"&gt;August 20&lt;/a&gt; implies my same sentiment: that whatever memes out there have infected us simple citizens with such animosity based on doublespeak and bullshit that we overlook our own gut instincts.&lt;/p&gt;  &lt;p&gt;One more plus I have to hand to Palin: she's absolutely a tasty bitch who deserves a good spanking for being such a bad kitty...&lt;/p&gt;  &lt;p&gt;I really can't say, though, if that's a qualification or not for Vice President.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-6429834571615744039?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/TZgKL4AdZFU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/6429834571615744039/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=6429834571615744039&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/6429834571615744039?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/6429834571615744039?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/TZgKL4AdZFU/politics-vice-presidential-debate-and.html" title="Politics, The Vice Presidential Debate, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/10/politics-vice-presidential-debate-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUBQnk7cSp7ImA9WxRTFUg.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-4801903613956104590</id><published>2008-09-04T15:29:00.002-04:00</published><updated>2008-09-04T15:40:53.709-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-04T15:40:53.709-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Flash" /><category scheme="http://www.blogger.com/atom/ns#" term="RGB" /><category scheme="http://www.blogger.com/atom/ns#" term="bitmap" /><title>Flash RGB, C#, and Me...</title><content type="html">&lt;p&gt;Greetings,&lt;/p&gt;  &lt;p&gt;So a co-worker of mine had to translate Flash RGB data into a Bitmap.  He noted that finding that out was difficult, ergo, for your coding pleasure, here's a tasty little static function you can use just for that:&lt;/p&gt;  &lt;style&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: Consolas, "Courier New", Courier, Monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;p&gt;&lt;div style="width:400px;height:400px;overflow:auto;"&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; Bitmap BmpOut(&lt;span class="kwrd"&gt;string&lt;/span&gt; rgb, &lt;span class="kwrd"&gt;int&lt;/span&gt; width, &lt;span class="kwrd"&gt;int&lt;/span&gt; height)&lt;br /&gt;{&lt;br /&gt;    Bitmap bmp = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;br /&gt;    &lt;span class="kwrd"&gt;try&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;int&lt;/span&gt; bytes = (rgb.Length / (width * height));&lt;br /&gt;        &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsArgb = (bytes == 8);&lt;br /&gt;        &lt;span class="kwrd"&gt;double&lt;/span&gt; dWidth = (&lt;span class="kwrd"&gt;double&lt;/span&gt;)width;&lt;br /&gt;        bmp = &lt;span class="kwrd"&gt;new&lt;/span&gt; Bitmap(width, height);&lt;br /&gt;        &lt;span class="kwrd"&gt;int&lt;/span&gt; counter = -1;&lt;br /&gt;        &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; rgb.Length; i += bytes)&lt;br /&gt;            bmp.SetPixel(++counter % width, (&lt;span class="kwrd"&gt;int&lt;/span&gt;)Math.Floor((&lt;span class="kwrd"&gt;double&lt;/span&gt;)counter / dWidth),&lt;br /&gt;            Color.FromArgb(&lt;span class="kwrd"&gt;int&lt;/span&gt;.Parse(((!IsArgb) ? &lt;span class="str"&gt;"FF"&lt;/span&gt; + rgb.Substring(i, 6) : rgb.Substring(i, 8)), System.Globalization.NumberStyles.HexNumber)));&lt;br /&gt;    }&lt;br /&gt;    &lt;span class="kwrd"&gt;catch&lt;/span&gt; { bmp = &lt;span class="kwrd"&gt;null&lt;/span&gt;; }&lt;br /&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; bmp;&lt;br /&gt;} &lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;enjoy...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-4801903613956104590?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/MUtA7xn8V7A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/4801903613956104590/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=4801903613956104590&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/4801903613956104590?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/4801903613956104590?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/MUtA7xn8V7A/flash-rgb-c-and-me.html" title="Flash RGB, C#, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/09/flash-rgb-c-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQFRHs9eip7ImA9WxdaEkU.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-1156350544614258556</id><published>2008-08-20T21:20:00.006-04:00</published><updated>2008-08-20T22:55:15.562-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-20T22:55:15.562-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="bush" /><category scheme="http://www.blogger.com/atom/ns#" term="clinton" /><category scheme="http://www.blogger.com/atom/ns#" term="obama" /><category scheme="http://www.blogger.com/atom/ns#" term="al qaeda" /><category scheme="http://www.blogger.com/atom/ns#" term="cheney" /><category scheme="http://www.blogger.com/atom/ns#" term="liberal" /><category scheme="http://www.blogger.com/atom/ns#" term="Endangered Species Act" /><category scheme="http://www.blogger.com/atom/ns#" term="bin laden" /><category scheme="http://www.blogger.com/atom/ns#" term="conservative" /><category scheme="http://www.blogger.com/atom/ns#" term="coulter" /><category scheme="http://www.blogger.com/atom/ns#" term="Saudi Arabia" /><category scheme="http://www.blogger.com/atom/ns#" term="9/11" /><title>Politics, Lexicology, and Me...</title><content type="html">I've decided to add a politically-nuanced(?) entry based on a tiny epiphany I just had.  I will, in my lifetime, have seen the political re-meme-ing of one or two words.&lt;br /&gt;&lt;br /&gt;I was thinking about why I am disgusted with people who now &lt;span style="font-style: italic;"&gt;accuse&lt;/span&gt;&lt;span&gt; others as "another liberal".  I'm not sure exactly why I'm disgusted, as the image this pops into my mind is of some hairy, unshowered, pseudo-intellectual, hippy lesbian 20-something dancing around at a large college party with Grateful Dead playing in the background.  But this is not what's implied when a (neo-)republican lay-pundit snarls at someone being "another &lt;possible&gt; liberal".&lt;br /&gt;&lt;br /&gt;I then thought of Ann Coulter.  She, in &lt;a href="http://en.wikipedia.org/wiki/The_Cornell_Review"&gt;her undergraduate years at Cornell, was in the College of Arts and Sciences&lt;/a&gt;, basically getting a liberal arts education.  I thought then that schools nowadays may need to have both a college of liberal arts and a college of conservative arts.  I didn't care so much about what this would mean, if anything, because it was then I noticed the &lt;span style="font-style: italic;"&gt;meaning&lt;/span&gt; of these words in my mind at that moment is not actually what their meaning really is.&lt;br /&gt;&lt;br /&gt;The word &lt;span style="font-weight: bold;"&gt;conservative&lt;/span&gt; should connote something to the effect of "if it works, that's what we should do," whereas &lt;span style="font-weight: bold;"&gt;liberal&lt;/span&gt; would therefore imply "we haven't tried this; it may be better, so we should try it."  Again, we might also say that &lt;span style="font-weight: bold;"&gt;conservative &lt;/span&gt;means to purposefully use a minimal amount of, say, salt, whereas we're &lt;span style="font-weight: bold;"&gt;liberal &lt;/span&gt;with salt if we shake on as much as we might want.&lt;br /&gt;&lt;br /&gt;Looking at the Bush / Cheney's administration through these terms really makes them neither liberal nor conservative.  Some argue that Clinton made the economy what it was when Bush Jr. took over, others say he inherited it from Bush Sr.  Either way, our economy was working, and working well.  A conservative, under the assumptions of the above connotations, would have continued the policies that was proven successful.  Liberals would have wanted to expand on it, try new things with it, even alter it.  Technically, then, our current administration is very liberal when it comes to our economy.&lt;br /&gt;&lt;br /&gt;What's more baffling, though, is our military strategies post-9/11.  &lt;a href="http://archives.cnn.com/2001/US/09/16/inv.binladen.denial/"&gt;Bin Laden initially denied responsibility for the attacks&lt;/a&gt;.  A conservative (again under the above connotations) would have held back military action again Bin Laden and Al Qaeda until substantial proof (not just evidence) warranted retaliation against them.  A liberal would be less burdened by proof.  At this point, we again seem to be seeing a far more liberal administration than a conservative one.  However, the real proof is in the pudding, and the pudding consisted of 15 of the 19 hijackers being Saudi Arabian.  Ergo, both the liberal and the conservative would have directed attention more to that region than, say, Iraq.  What term then fits this administration?  Retarded?  Pussy?&lt;br /&gt;&lt;br /&gt;The final coup-de-gras comes with Bush's desire to &lt;a href="http://www.nydailynews.com/money/2008/08/12/2008-08-12_president_bush_wants_some_endangered_spe.html"&gt;lessen restrictions created by the Endangered Species Act&lt;/a&gt;.  Aside from the mind-boggling reasoning behind trying to push this one out when your poll ratings are so low, this is an extraordinarily non-conservative stance.  As a noun, this implies one who is discreet, cautious.  I would bet money that a vast majority of Americans support the Endagered Species Act.  This is unlike global warning and other environmentalist issues.  This is about keeping rhinos and polar bears and eagles in existence, because they're cool.  Ergo, not the policy change you want to try to make if you're cautious, and especially if you want to be discreet.Furthermore , &lt;a href="http://www.thefreedictionary.com/conservative"&gt;as an adjective&lt;/a&gt;, conservative means "tending to conserve; preserve".  Thus, Bush is a hardcore liberal.&lt;br /&gt;&lt;br /&gt;This may seem to be a Bush / Cheney lambasting entry, but it isn't.  I'll enjoy returning to this with a Obama or McCain administration to see which way they &lt;span style="font-style: italic;"&gt;truly&lt;/span&gt; lean.  I just want to remain true to the roots of my native language.  I'm just a staunch conservative that way.&lt;br /&gt;&lt;/possible&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-1156350544614258556?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/pS0Hj1wm8qU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/1156350544614258556/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=1156350544614258556&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1156350544614258556?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/1156350544614258556?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/pS0Hj1wm8qU/politics-lexicology-and-me.html" title="Politics, Lexicology, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/08/politics-lexicology-and-me.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYBRng6eSp7ImA9WxdVF0s.&quot;"><id>tag:blogger.com,1999:blog-27963633.post-3555804495267265356</id><published>2008-07-22T16:46:00.004-04:00</published><updated>2008-07-22T16:55:57.611-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-22T16:55:57.611-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><category scheme="http://www.blogger.com/atom/ns#" term="regex" /><category scheme="http://www.blogger.com/atom/ns#" term="code" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="regular expressions" /><title>A Programming Job Interview Challenge #13 - Brackets, and Me...</title><content type="html">&lt;p&gt;Ok, I've been doing &lt;a href="http://www.dev102.com/2008/07/21/a-programming-job-interview-challenge-13-brackets/"&gt;the programming quizzes here&lt;/a&gt; and have &lt;em&gt;a&lt;/em&gt; solution...&lt;/p&gt;  &lt;p&gt;In Perl:&lt;/p&gt;&lt;br /&gt;&lt;div style="width:400px;height:300px;overflow: auto"&gt;&lt;pre&gt;&lt;span style="color:#2040a0;"&gt;$FILE&lt;/span&gt; = &lt;span style="color:#008000;"&gt;"expressions.txt"&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#a52a2a;"&gt;&lt;strong&gt;open&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;FILE&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;or&lt;/strong&gt; &lt;strong&gt;die&lt;/strong&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#008000;"&gt;"Could not open expressions file."&lt;/span&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;;&lt;br /&gt;&lt;strong&gt;foreach&lt;/strong&gt; &lt;span style="color:#2040a0;"&gt;$OLINE&lt;/span&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&amp;lt;FILE&amp;gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#2040a0;"&gt;$LINE&lt;/span&gt; = &lt;span style="color:#2040a0;"&gt;$OLINE&lt;/span&gt;;&lt;br /&gt; &lt;strong&gt;if&lt;/strong&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#2040a0;"&gt;$LINE&lt;/span&gt; =~&lt;span style="color:#b000d0;"&gt; m/(^[\]}\)&amp;gt;])|([\[{\(&amp;lt;]$)/&lt;/span&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt; &lt;span style="color:#a52a2a;"&gt;&lt;strong&gt;print&lt;/strong&gt;&lt;/span&gt; &lt;span style="color:#008000;"&gt;"bad : &lt;span style="color:#2040a0;"&gt;$OLINE&lt;/span&gt;"&lt;/span&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; &lt;strong&gt;else&lt;/strong&gt;&lt;br /&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;  &lt;strong&gt;while&lt;/strong&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#2040a0;"&gt;$LINE&lt;/span&gt; =~&lt;span style="color:#b000d0;"&gt; m/(\[\])|({})|(\(\))|(&amp;lt;&amp;gt;)/&lt;/span&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;   &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt; &lt;span style="color:#2040a0;"&gt;$LINE&lt;/span&gt; =~&lt;span style="color:#b000d0;"&gt; s/(\[\])|({})|(\(\))|(&amp;lt;&amp;gt;)//g&lt;/span&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:#2040a0;"&gt;$strLen&lt;/span&gt; = &lt;span style="color:#a52a2a;"&gt;&lt;strong&gt;length&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#2040a0;"&gt;$LINE&lt;/span&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;;&lt;br /&gt;  &lt;strong&gt;if&lt;/strong&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#2040a0;"&gt;$strLen&lt;/span&gt; &amp;gt; 1&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;   &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt; &lt;span style="color:#a52a2a;"&gt;&lt;strong&gt;print&lt;/strong&gt;&lt;/span&gt; &lt;span style="color:#008000;"&gt;"bad : &lt;span style="color:#2040a0;"&gt;$OLINE&lt;/span&gt;"&lt;/span&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;  &lt;strong&gt;else&lt;/strong&gt;&lt;br /&gt;   &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt; &lt;span style="color:#a52a2a;"&gt;&lt;strong&gt;print&lt;/strong&gt;&lt;/span&gt; &lt;span style="color:#008000;"&gt;"good : &lt;span style="color:#2040a0;"&gt;$OLINE&lt;/span&gt;"&lt;/span&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#4444ff;"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#4444ff;"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;strong&gt;&lt;span style="color:#4444ff;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;And a C# console app to generate the "sample" strings (i.e. the "expressions.txt" file used above):&lt;/p&gt;&lt;br /&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre {  font-size: small; color: black;  font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt  { background-color: #f4f4f4;  width: 100%;  margin: 0em; }  .csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;div style="width:400px;height:300px;overflow: auto"&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; ConsoleApplication1&lt;br /&gt;{&lt;br /&gt;   &lt;span class="kwrd"&gt;class&lt;/span&gt; Program&lt;br /&gt;   {&lt;br /&gt;       &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;       {&lt;br /&gt;           Creator();&lt;br /&gt;           &lt;span class="rem"&gt;//Console.ReadKey();&lt;/span&gt;&lt;br /&gt;       }&lt;br /&gt;       &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Creator()&lt;br /&gt;       {&lt;br /&gt;           Random r = &lt;span class="kwrd"&gt;new&lt;/span&gt; Random((DateTime.Now.DayOfYear + DateTime.Now.Millisecond) * (DateTime.Now.Second + DateTime.Now.Minute + 1));&lt;br /&gt;           &lt;span class="kwrd"&gt;string&lt;/span&gt; encs = &lt;span class="str"&gt;"[{(&amp;lt;&amp;gt;)}]"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;           &lt;span class="kwrd"&gt;string&lt;/span&gt; sb = &lt;span class="str"&gt;""&lt;/span&gt;;&lt;br /&gt;           &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 100; i++)&lt;br /&gt;           {&lt;br /&gt;               sb = &lt;span class="str"&gt;""&lt;/span&gt;;&lt;br /&gt;               &lt;span class="kwrd"&gt;bool&lt;/span&gt; good = (r.Next(0, 100) &amp;gt; 50) ? &lt;span class="kwrd"&gt;true&lt;/span&gt; : &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;br /&gt;               &lt;span class="kwrd"&gt;int&lt;/span&gt; strlen = r.Next(1, 21) * 2;&lt;br /&gt;               &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; j = 0; j &amp;lt; strlen; j++)&lt;br /&gt;               {&lt;br /&gt;                   &lt;span class="kwrd"&gt;if&lt;/span&gt; (!good)&lt;br /&gt;                       sb = String.Format(&lt;span class="str"&gt;"{0}{1}"&lt;/span&gt;, sb, encs[r.Next(0, encs.Length)]);&lt;br /&gt;                   &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;                   {&lt;br /&gt;                       &lt;span class="kwrd"&gt;int&lt;/span&gt; p = r.Next(0, encs.Length / 2);&lt;br /&gt;                       &lt;span class="kwrd"&gt;int&lt;/span&gt; q = r.Next(0, 3);&lt;br /&gt;                       &lt;span class="kwrd"&gt;if&lt;/span&gt; (q == 0)&lt;br /&gt;                           sb = String.Format(&lt;span class="str"&gt;"{0}{1}{2}"&lt;/span&gt;, encs[p], sb, encs[encs.Length - p - 1]);&lt;br /&gt;                       &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (q == 1)&lt;br /&gt;                           sb = String.Format(&lt;span class="str"&gt;"{0}{1}{2}"&lt;/span&gt;, sb, encs[p], encs[encs.Length - p - 1]);&lt;br /&gt;                       &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;                           sb = String.Format(&lt;span class="str"&gt;"{0}{1}{2}"&lt;/span&gt;, encs[p], encs[encs.Length - p - 1], sb);&lt;br /&gt;                   }&lt;br /&gt;               }&lt;br /&gt;               &lt;span class="rem"&gt;//Console.WriteLine(String.Format("{0}: {1}", good, sb.ToString()));&lt;/span&gt;&lt;br /&gt;               Console.WriteLine(sb);&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;I couldn't spend &lt;em&gt;that&lt;/em&gt; much time on this, as I am at work.  Ergo, I'm a little disappointed with the Perl, although it was &lt;strong&gt;&lt;em&gt;my first Perl program ever!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I'm particularly curious about how I could have done some sort of recursive check.  Please give any suggestions to the Perl script that would make it as close to a one-liner regex check.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;~simon&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27963633-3555804495267265356?l=taotekaching.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TaoTeKaChing/~4/x8iJ5s2tJUs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://taotekaching.blogspot.com/feeds/3555804495267265356/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=27963633&amp;postID=3555804495267265356&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/3555804495267265356?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/27963633/posts/default/3555804495267265356?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TaoTeKaChing/~3/x8iJ5s2tJUs/programming-job-interview-challenge-13.html" title="A Programming Job Interview Challenge #13 - Brackets, and Me..." /><author><name>ZagNut</name><uri>http://www.blogger.com/profile/14233434581996044037</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="05088892112248462053" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://taotekaching.blogspot.com/2008/07/programming-job-interview-challenge-13.html</feedburner:origLink></entry></feed>
