<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4950038149959872780</id><updated>2011-11-27T18:15:46.842-06:00</updated><category term='C#'/><category term='ASP'/><category term='javascript'/><category term='html'/><category term='.Net'/><title type='text'>Programming Affinity</title><subtitle type='html'>This is where I post some of the interesting bits and pieces of code that I sometimes write or come across. Reuse them, share them, whatever you want. Enjoy!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-6189289412139572467</id><published>2010-05-27T13:42:00.001-05:00</published><updated>2010-05-27T13:43:56.454-05:00</updated><title type='text'>Roughly Drafted Magazine</title><content type='html'>Apparently Daniel Eran Dilger has whined about flash on his site enough times that Google has decided that it must be a site ABOUT flash...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh5.ggpht.com/_bInlSfkrXAs/S_67SbYFpvI/AAAAAAAAAFU/rqf209mjet8/s800/RDM%20Flash.jpg" alt="Create free flash websites at Roughly Drafted Magazine" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I'm torn for a favorite part of this article between that and the point in that article where he says "[...] Eric Savitz, a man who gets a lot of things wrong in order to come up with sensationalist headlines [...]" That description sounds far too familiar if you've ready any of the articles on RDM ("How Apple could slay Google at WWDC 2010", "What will HP do with Palm’s webOS? Mostly likely: fail", "Android 2.2 to do things we assumed it already did", etc...)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.roughlydrafted.com/2010/05/27/reality-check-microsoft-rumored-at-show-at-apples-wwdc-2010/comment-page-1/#comment-28954"&gt;Reality Check: Microsoft rumored at show at Apple’s WWDC 2010 — RoughlyDrafted Magazine&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-6189289412139572467?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/6189289412139572467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=6189289412139572467&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/6189289412139572467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/6189289412139572467'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2010/05/roughly-drafted-magazine.html' title='Roughly Drafted Magazine'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_bInlSfkrXAs/S_67SbYFpvI/AAAAAAAAAFU/rqf209mjet8/s72-c/RDM%20Flash.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-2296650242209344669</id><published>2010-05-25T16:32:00.005-05:00</published><updated>2010-05-25T16:41:31.006-05:00</updated><title type='text'>FoxConn Suicides</title><content type='html'>So, pretty soon we'll be seeing a new sticker requirement on all electronic devices manufactured or assembled in China. I made a mock prototype, and included the new sticker.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh5.ggpht.com/_bInlSfkrXAs/S_w6t9BF1YI/AAAAAAAAAE4/mx-p5UlqlX4/nochineseworkers.PNG" width="100%" alt="No Chinese workers jumped during the manufacture of this device." /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-2296650242209344669?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/2296650242209344669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=2296650242209344669&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/2296650242209344669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/2296650242209344669'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2010/05/foxconn-suicides.html' title='FoxConn Suicides'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_bInlSfkrXAs/S_w6t9BF1YI/AAAAAAAAAE4/mx-p5UlqlX4/s72-c/nochineseworkers.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-2146497671423124925</id><published>2010-04-30T12:07:00.003-05:00</published><updated>2010-04-30T13:02:52.658-05:00</updated><title type='text'>Interesting Theory, Mostly Correct</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;in reference to: &lt;a href="http://www.roughlydrafted.com/2010/04/30/why-steve-jobs-loves-adobe-flash/"&gt;Why Steve Jobs Loves Adobe Flash — RoughlyDrafted Magazine&lt;/a&gt; (&lt;a href="http://www.google.com/sidewiki/entry/109000263288087790149/id/1qIvfGxiQA7btMfE2J4Bz8V3Frw"&gt;view on Google Sidewiki&lt;/a&gt;)&lt;/p&gt;&lt;p&gt;This article depicts the author's typical "Apple reigns supreme" view. Oddly enough, I agree with the majority of his article. There's a couple false "facts" in here, including that Flash is a closed system, Flash drains battery life, and Flash doesn't support multitouch. There's a decent handful of apps already submitted and approved by Apple that prove the last two of these to be fallacies.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The main point of this article is that Jobs likes Flash on all Mobile OSs other than the iPhone because it will weaken his competition. I'd say that's probably correct, and that really is Jobs' sentiment. However, I think it's a very dangerous and risky move on his part, because the vast majority of people like freedom of choice more than anything else.&lt;br /&gt;&lt;br /&gt;People risk their lives on a daily basis to try and get into America. Why? Freedom! Freedom of CHOICE. Freedom to become whatever you want. I don't think that the mobile platform war is going to turn out any differently, and people will flock to the competition for the freedom of choice. Will the competition be weakened? Their product may suffer, but the freedom of choice could very well outweigh that by magnitudes.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-2146497671423124925?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/2146497671423124925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=2146497671423124925&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/2146497671423124925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/2146497671423124925'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2010/04/interesting-theory-mostly-correct.html' title='Interesting Theory, Mostly Correct'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-725351085056844841</id><published>2010-04-23T15:14:00.002-05:00</published><updated>2010-04-23T15:15:58.041-05:00</updated><title type='text'>e-Cigs: The Myths and the Facts</title><content type='html'>&lt;div&gt;Ok, so if you live in a city of decent proportions, watch TV, or use the internet, chances are pretty good you've seen an electronic cigarette somewhere. And if you're a smoker, you've probably thought about buying one of these gizmos. Especially if you have problems breathing, or you're a gadget collector like myself. My opinion -- GET ONE. Consider what you're buying, and shop around for a good one at a good price, but regardless of what you pay for it, it will very certainly pay off if you USE it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Liquid&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The liquid in the cartridges is rated at milligrams (1/1000 gram) of nicotine per gram. So an 11mg liquid will have 11mg/g (11 milligrams of nicotine per gram of liquid), an analog has about 1.3mg of nicotine. So to match an analog's nicotine level drag for drag, you need to buy a liquid rated at close to 30mg (I use 36mg). Lights have about 0.8mg of nicotine, and their equivalent will be somewhere between the 11mg and 16mg liquids available. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A pack a day smoker will likely go through about 10ml of liquid a week at first, although that will go down over time. It's different being able to just take a puff wherever you are, so you will. All the time. Flagrantly. You'll eventually get over this, and your consumption will decrease. I now go through about half that. I always order liquid when I get down under 10ml though, because sometimes stuff gets put on back order or shipping is delayed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Cartridges&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Most companies advertise that a cartridge will last about 300 drags, and I've never COUNTED my drags on a cartridge, but I don't think I've ever gotten anywhere near 300. I've probably gotten about 200 out of a cartridge with fresh packing and an already wet atomizer. The advertising puts a single cartridge on par with an entire pack of cigarettes, the reality of it is closer to 4 or 5 analogs per full cartridge, especially if you refill. And you should refill. Period.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you're going to refill (and you should; it's easy, and the cheapest way to e-smoke), then you're going to need liquid, a handful of spare cartridges, and some polyester fiber packing. The cheapest I've found in the polyester is fiberfill for pillows, available at Wal-Mart for under 5 dollars for what should be a lifetime supply. Make sure you don't buy the stuff with chemicals added to it. All of it is fire-safe. If you aren't going to refill, you might want to stock up on pre-filled cartridges. Replace the packing once or twice a week to prevent bad flavors. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Atomizers&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is the heating element piece. Don't expect it to last forever. Expect it to last a month. Be happy if it lasts longer. They're not expensive, mine cost me 8 dollars. I've read and tried a LOT of ways to clean them, and thus far all attempts have failed, sometimes damaging the atomizer beyond repair. Just use a toothpick or something similar to remove visible polyester fibers from the element and mesh area. If it gets a bad taste to it, you can run water through it, but make sure it dries well before you use it, and make sure and wet it well with liquid (a drop or two of liquid in the middle of it) before you use it again, or it will pop.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you heat the atomizer while it is dry, or drop it off a roof, or anything like that, it will very likely never work again. Always keep a spare atomizer in case you accidentally destroy one. Always test your spare when you get one in, sometimes they don't work, and no company I know of will replace them, so if you get a bad atomizer, expect to eat the cost. I buy them in five-packs, and order a new pack when I get to only two working atomizers left.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Batteries&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There's really only two styles of batteries when you exclude the fact that there are different sizes, shapes, and atomizer fittings. There are automatic batteries -- turn on when you start to draw, turn off when you stop. And there are manual batteries -- come on when you push a button, go off when you let go. The batteries will only work with the atomizers they were designed for, so if you get a DSE-901, don't expect to mix parts with a 510. It won't work.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I prefer the manual battery. I like to heat it up about a half-second before I take a drag, as that gives you a little more of a hit off of it. Also, the manual batteries seem to be just fine after a ride through the laundry, whereas the automatic sensor doesn't seem to make it through. Don't ask me how I know this...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Batteries can explode when heated. DO NOT TRY THIS AT HOME. Batteries can also contain chemicals that can damage your equipment and your clothes, so try to avoid washing them on accident, too.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Changing Over&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I quit smoking analogs for my e-cig (TECC Titan 510) almost a year ago. I've since tried a few other styles (DSE-901, RN4081, etc.), and there's not just a huge difference in them as far as SMOKING goes, but there's quite a bit of difference in battery life, atomizer life, cartridge size, and look/feel of the devices. So shop around, find out what's in your price range, and read some review on that device to determine life and cartridge sizes. There's plenty of forums for this, just google the make and model and you'll find several at the top of the list most likely.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No matter what you choose to buy, there are a few things that you should follow. Number one, you're going to probably have 75 to 100 dollars in this, after you buy a spare atomizer (yes, you should always keep a spare), liquid, and some empty cartridges. Number two, if you're going to buy it, USE IT. I've seen lots of people pick these up, but "supplement" them with analogs for one reason or the other. These people seem to ALWAYS eventually put their e-cig in a drawer and go back to full time analogs. If you aren't going to use it, there's no point in wasting your money. So, when you buy one, make a one month commitment to yourself that you won't smoke an analog, and buy enough liquid to cover that month.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Analogs taste nasty after about a week of regular use of the e-cig, so if you do decide to drop it, be prepared. You'll wonder how you ever started smoking in the first place. I know, because I was stupid enough to let myself run out of liquid/atomizers a couple times over the last year, and still craved that sweet nicotine. Speaking of which, the liquid has a slightly sweet taste, and less ash taste, so it doesn't taste quite like an analog, even if you get an analog brand flavored liquid. That's not to say it tastes BAD at all, because it doesn't, it just doesn't taste the SAME.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;A Few Facts&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These will not help you get off of nicotine. You're still going to have to cut yourself back if that's what you're shooting for. You will still crave nicotine. It is illegal to sell these as a smoking cessation ("stop smoking") device and if anyone tries that approach, call them on it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These do not contain the tar and cancer causing agents that cigarettes contain, except in trace amounts. And those trace amounts have been shown to be less than or equal to what you would see in medicinal uses like the patch or gum.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you're a gadget person, you won't save much money for a while on these, since you'll be buying all those neat accessories. You'll slow down or stop that eventually.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I can't vouch for Smoking Everywhere's products, but I do use their liquid sometimes. Their liquid seems fine to me. Their prices are the highest I've found on any e-cig product or accessory anywhere. If you want cheap, they probably aren't for you. I do admire them for being the first company (that I know of) to bring the e-cigs to the general public (mall kiosks, door-to-door sales, etc.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's still illegal for you to supply nicotine to people under 18. It doesn't matter that it's not "tobacco". &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-725351085056844841?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/725351085056844841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=725351085056844841&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/725351085056844841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/725351085056844841'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2010/04/e-cigs-myths-and-facts.html' title='e-Cigs: The Myths and the Facts'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-770821978816339232</id><published>2010-04-22T16:00:00.006-05:00</published><updated>2010-04-22T16:29:41.785-05:00</updated><title type='text'>What Draws Fanatics to Apple? A Little Fact, A Little Theory.</title><content type='html'>&lt;b&gt;My Roots: Pretty Shallow&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I grew up most of my childhood and early adulthood less than fifteen minutes on one side or the other of the Mason-Dixon Line. For those who don't know, this is the imaginary line that divides the North (the Yankees) from the South (the Rebels). During the Civil War, men were forced to fight their own relatives who lived just miles away on the opposite side of the line. In my few years, however, I've done a fair amount of traveling, and there's one thing that's made abundantly clear. The further you go into either side of this imaginary line, the more fanatical the people are about which side they're on, and why.&lt;br /&gt;&lt;br /&gt;While this fact holds true on both sides of the line, the fanaticism is radically different depending upon which side of the line you currently fall. No matter whether you were born there or just simply raised there, the southern side of this line win the trophy for being the most extreme about their stance. In many of their opinions, the Civil War still isn't over, and eventually, they'll amass some troops from out of their hats and take over the country. The northerners aren't just incredibly shy about their opinions of the southern radicals -- the south lost the war a long time ago, and they need to get over it and move on.&lt;br /&gt;&lt;br /&gt;Growing up on the line though was a bit different. Not too far to the south there were many small towns where only white people were brave enough to stop at a gas station or a cafeteria. Not too far to the north, even illegal immigrants were welcomed with open arms.&lt;br /&gt;&lt;br /&gt;Not to get into a "race" discussion, I'm going to end this description here.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The Technological "Mason-Dixon Line"&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In comparison to the debates between Apple fanatics and the rest of the computing world, it's pretty much the same thing. Apple has used some pretty interesting marketing campaigns to ensure that this imaginary line is drawn between their products and the rest of the world's electronics. Those on the far spectrum of this line believe that Apple products are going to launch an assault that will take over the electronics market. People on the Apple side, but closer to the line believe that Apple makes some fine products, but their zealot brethren are a bit over the top about it. People on the other side of the line believe they won the war years ago and they just don't care.&lt;br /&gt;&lt;br /&gt;People switch sides of this imaginary line, some moving in, others moving out. Hell, I've moved over the line once. And I'm probably going to soon cross back over again. I bought an iPhone3G... then I bought a MacBook Pro. I've been perfectly happy with both. Now, there are some advances on the other side I'd like to move to. For whatever reason though, the people on the far end of the Apple side, even when forced on the other side of the line, take the "prisoner of war" attitude -- "My company makes me use a PC, but at home I'm ALL APPLE!"&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The "Far South"&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;The other day I made the statement that "it appears to me" that Apple's products are almost always ranked best in class, but that the class they are in is always a version or two version behind the rest of the world. Apple can squeeze more juice out of a 1GHz processor than a lot of other companies can get out a 1.3GHz. However, Apple's newest mobile product uses a 1GHz processor, while the rest of the world has moved to 1.83GHz, likely too big a chasm for Apple's best fine-tuning to hurdle. Likewise in their laptops, Apple released this year's lineup with Intel i5's, while other companies are boasting the Intel i7's.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Apple's take on this is to restrict the platform's capability to not enable users to have anything on their device which would inhibit their experience. The rest of the world's take -- if it won't handle it, people won't use it. The end users can decide if the software they're using is not performing well, and if they aren't satisfied, then they'll find a different piece of software to replace it.&lt;br /&gt;&lt;br /&gt;One of my friends, upon hearing this statement, was immediately up in arms. His statement was that if I got the device I was contemplating, it would do more things than his Apple product, but it would do those extra things slowly. My rebuttal -- it will do everything yours will do with at least the same performance, likely with even BETTER performance... then it will do some other stuff on top of that. And I won't have to cough up the "Apple Tax". Not to be bested, he argued for as long as we had time to talk that people would be less happy with the cheaper device with more functionality, because the added functions would have sub-standard performance. His feeling was that people would be happier with the more expensive and more restricted device because it wouldn't lack performance on anything that it did.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Middle Ground&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;From a friend who's been on the Apple side of the line for a lot longer time, but never so deep, comes more reserved opinions about Apple's rash of app rejections, app approvals, inconsistent regulations, and EULA changes. His statement on it -- "It's like the computing line is run by an entirely different company than the mobile line. The mobile line [from Apple] is something I have no desire whatsoever to get involved in with."&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've heard similar statements from the Windows users closer to the line, things such as "I wish my computer did &lt;some&gt;, but it's not worth paying an extra &lt;some&gt; dollars for it."&lt;br /&gt;&lt;br /&gt;&lt;/some&gt;&lt;/some&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Straw Man Defense&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;And the people on the Deep-Apple side of the line use some pretty vague and unverifiable arguments to stay there. My favorite line so far in all my discussions with people on both sides of the line comes from the zealot mentioned two paragraphs prior -- "Apple's core UI and kernel haven't changed in the last 10 years [...] there's a massive learning curve between Windows 98 and Windows 7." In case you're missing the irony... here's a few links (and DATES) that may clear it up:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Am_windows95_desktop.png"&gt;Windows 95    (1995)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Windows98.png"&gt;Windows 98    (1998)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Win2000.png"&gt;Windows 2000  (2000)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:WindowsME.png"&gt;Windows Me    (2000)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Windows_XP_SP3.png"&gt;Windows XP    (2001)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Windows_Aero.png"&gt;Windows Vista (2006-2007)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Windows_7.png"&gt;Windows 7     (2009)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Macintosh_System_7.5.3_screenshot.png"&gt;Mac OS  7.5.3 (1996)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:MacOS81_screenshot.png"&gt;Mac OS  8.1   (1998)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Mac_OS_9_screenshot_2.png"&gt;Mac OS  9     (1999)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:MacOSX10-0screenshot.png"&gt;Mac OSX 10.0  (2001)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:AM_MacOSX_Panther.png"&gt;Mac OSX 10.3  (2003)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Leopard_Desktop.png"&gt;Mac OSX 10.5  (2007)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Snow_Leopard_Desktop.png"&gt;Mac OSX 10.6  (2009)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(I don't think either of these guys have had any major redesigns in the last 15 years, but they've both been re-skinned enough times. In the middle of all this though, Apple switched architectures, which is something that pretty much BEGS some kernel changes. Windows... well, it's still pretty much up in the air.)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What makes Apple Fanatics... Fanatical? Well, it's that same "war-time" mentality that some people keep about them all the time. It's infectious and magnetic. People with the same over-the-top ideals will group up in droves, and like protesters, radical southerners, or any other minority group, they're going to yell at the top of their voice hoping someone hears them. Meanwhile the rest of the world will most likely just continue to ignore them as nothing more than a small nuisance. Those of you on the line who can still make rational decisions and have reasonable discussion, I applaud you. Those ignoring Apple as nothing more than a small nuisance, beware. And you over-zealous lot on the far Apple side of the line, Apple computers are just Personal Computers (PCs) no matter what you choose to call them. A rose by any other name smells just as fragrant, and a turd by any other name still stinks.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-770821978816339232?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/770821978816339232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=770821978816339232&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/770821978816339232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/770821978816339232'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2010/04/what-draws-fanatics-to-apple-little.html' title='What Draws Fanatics to Apple? A Little Fact, A Little Theory.'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-8352209763659867776</id><published>2009-12-07T14:48:00.003-06:00</published><updated>2009-12-08T14:38:02.260-06:00</updated><title type='text'>StackOverflow Scoring Flaw</title><content type='html'>&amp;lt;rant&amp;gt;&lt;br /&gt;&lt;br /&gt;Recently, I had posted that I had joined &lt;a href="stackoverflow.com"&gt;StackOverflow&lt;/a&gt;, and that I was starting to gain reputation in the community. Yesterday, I encountered two things, which make me wonder about the validity of the scoring system at StackOverflow. &lt;br /&gt;&lt;br /&gt;Apparently, as the current scoring system stands, people can do what has been referred to as "Tactical Downvoting", and also a user can wreak havoc on a newer user's reputation without consequences.&lt;br /&gt;&lt;br /&gt;    &lt;b&gt;Tactical Downvoting:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;When a user finds an unanswered question to which they know or think they know the answer, they can post their own answer, and then downvote all other answers. While this may cost them a limited amount of their own reputation (-1 for each downvote), this costs the other users twice as much for each downvote. This also increases the visibility of the user's post, as posts with higher votes are displayed first by default (0 being higher than -1). &lt;br /&gt;&lt;br /&gt;So, if I and 3 other users post answers to the same question, and I immediately downvote the other answers, mine will then show at the top, increasing the chances that it will be voted up and/or accepted. My reputation will get -3 for the downvotes. The other users will each suffer a -2 loss. For each time my answer is voted up, I get +10 reputation. If my answer is accepted, I get an additional +15 reputation.&lt;br /&gt;&lt;br /&gt;Therfore, for a small loss, I can potentially rule out other valid (possibly MORE valid) answers, and have my reputation raised higher.&lt;br /&gt;&lt;br /&gt;    &lt;b&gt;Wreaking Havoc:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;My reputation suffered a nearly 10% loss after apparently irritating someone with a reputation quite a bit higher than mine by questioning the syntax he had used in his posting. I found that about half of my posted answers had been downvoted shortly after this encounter, and the user all but admitted it in answer to my asking why. Now, StackOverflow runs scripts to detect this sort of malicious behavior, and removes the downvotes, however, their script does NOT restore reputation.&lt;br /&gt;&lt;br /&gt;So, for a sacrifice of all of my current reputation on the site (559 at the time of this writing), I could effectively bring someone with a reputation of 1000 down to 0. Yes, it's true that my reputation would suffer too... but after having gotten more reputation, it would be pretty easy to wipe out a newer user.&lt;br /&gt;&lt;br /&gt;    &lt;b&gt;Summary:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;While I definitely think that the StackOverflow team's hearts are in the right place (for the most part), I think that there's still quite a bit of fine tuning to be done to the scoring system, to ensure that users with high reputation actually SHOULD have a high reputation. &lt;br /&gt;&lt;br /&gt;For instance, making it where you can't downvote answers for a question you've answered, and vice versa. This would ENTIRELY prevent tactical downvoting. If you think your answer is right, and the others are wrong, let the community decide. You wouldn't let an interviewee interview your other applicants...&lt;br /&gt;&lt;br /&gt;Also, your downvote to upvote ratio should be set to ensure that you're not only casting downvotes. Case in point, the user who downvoted all my answers has a +15/-24 ratio, meaning he's cast nearly twice as many downvotes as upvotes. And that's AFTER the other downvotes were removed. My current ratio at the time of this writing is +40/-2. While this wouldn't entirely stop a user from mass downvoting, it would certainly stop it in certain circumstances.&lt;br /&gt;&lt;br /&gt;Additionally, the penalty of casting a downvote should be equal to the reward from receiving an upvote (-10). The penalty for receiving a downvote should be an equal penalty to casting a downvote. Thus, a user casting downvotes could never gain an edge over a user they cast against. Why shouldn't someone agreeing with you be equal to someone DISagreeing with you?&lt;br /&gt;&lt;br /&gt;&amp;lt;/rant&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-8352209763659867776?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/8352209763659867776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=8352209763659867776&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/8352209763659867776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/8352209763659867776'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2009/12/blog-post.html' title='StackOverflow Scoring Flaw'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-1648534265956463398</id><published>2009-11-19T08:59:00.003-06:00</published><updated>2009-11-19T09:02:34.822-06:00</updated><title type='text'>Submissions Wanted!</title><content type='html'>I'm looking for contributors to help me make this into a daily blog with unique content. I'm wanting unique code snippets/tips... something preferably 50 lines or less... If you submit something that gets used, you will receive... "A warm fuzzy feeling when you look at the 'Submitted by:' line of the articles". Thanks!&lt;br /&gt;&lt;br /&gt;~md5sum~&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-1648534265956463398?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/1648534265956463398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=1648534265956463398&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/1648534265956463398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/1648534265956463398'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2009/11/submissions-wanted.html' title='Submissions Wanted!'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-1421821097556132756</id><published>2009-11-17T10:00:00.002-06:00</published><updated>2009-11-17T10:40:39.105-06:00</updated><title type='text'>New Job, New Stuff</title><content type='html'>So lately I have found myself once again too busy to post on here. This seems like a recurring theme in my life, no matter how I try to post regularly. Since my last full post, I've changed to a new job. I'm now working as a Senior Application Developer for a company which manufactures digital x-ray equipment for veterinarians. It's been quite a lot of fun, and I've gotten to learn a lot.&lt;br /&gt;&lt;br /&gt;I've also joined StackOverflow as a true user, and started asking and answering questions there. My WootOff script hit 1800 installs this morning in the wave of a new WootOff over at &lt;a href="http://www.woot.com"&gt;Woot.com&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;This post is actually intended to tell you about some of my experiences using some of the new Google products, so I'm going to stop rambling now, and get to the good stuff.&lt;br /&gt; &lt;br /&gt;I've been testing out Google Voice now for several months, and I must say, I absolutely love it. Call presentation has saved me from talking to people I want nothing to do with more than once, and unlimited free texts without cost is awesome. However much I may love this service though, I don't think it will really take off with the general public. It will be great for businesses that need to roll phones around for helpdesk or secretaries. I can also see people like myself who end up carrying up to 3 phones with him quite often using it to consolidate calls to a single phone. The ability to record calls with the press of a button is nice too, but there's a notification that totally sucks. I have an invite to the first 2 people to comment on this post and ask for them.&lt;br /&gt;&lt;br /&gt;The other product that I've been testing is Google Wave. Google wave is pretty impressive. It still has a few things they're going to have to work out as of this posting, but the overall interface is quite impressive, and the functionality is astounding. Google Wave allows other users on a wave to see changes as they're made by anyone. Users can also make a "sub-wave" inside a wave, and only include some (or none) of the users on the main wave. Files can be directly inserted into a wave, making collaboration a simple thing. Played right, I can see this platform replacing all social networking sites, email, and chat all in one swift motion.&lt;br /&gt;&lt;br /&gt;Until next time!&lt;br /&gt;&lt;br /&gt;~md5sum~&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-1421821097556132756?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/1421821097556132756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=1421821097556132756&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/1421821097556132756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/1421821097556132756'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2009/11/new-job-new-stuff.html' title='New Job, New Stuff'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-6925645035530649824</id><published>2009-10-26T13:58:00.013-05:00</published><updated>2009-12-10T14:39:38.952-06:00</updated><title type='text'>Serialize Objects Manually</title><content type='html'>Edit (27 Oct, 2009 14:31 GMT-600): I realized earlier that this solution doesn't handle arrays and generics. However, I don't really need that functionality, and therefore won't be updating this post with the information. If I need it later, I'll implement it.&lt;br /&gt;&lt;br /&gt;I recently found an instance in which I needed to pass a System.Windows.Shapes (part of the PresentationFramework) object through WCF and store it in a database. Shortly after starting with this problem, I realized that not only were all the shapes not marked Serializable, but the classes were also sealed, preventing inheritance. So now I had to dig deeper into my options to get these guys from my client to my server.&lt;br /&gt;&lt;br /&gt;My first few attempts at this were hardly heartfelt, and didn't succeed at all, as I was just trying to get it done as fast as possible (the worst thing a programmer can do... good for me). Finally, I realized I wasn't making any headway on this problem, and I started reading other people's experiences, as well as asking if anyone had any tips on several forums. The best advice I could find in all of this was just to use Reflection and serialize the object myself. So, that's just what I did. And, since I'm so fond of sharing the coolest things I find to do, I'm sharing how to do this, both for my own future reference and for yours. Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;/// Serializes and Deserializes objects not marked with the Serializable attribute.&lt;br /&gt;/// NOTE: Named Serialize to prevent interference with the &lt;br /&gt;/// System.Runtime.Serialization namespace.&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;public static class Serialize&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// Used for thread safety on the SerializeObject(object obj) method.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private static object serializeSync = new object();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// Used for thread safety on the DeserializeObject(string s) method.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private static object deserializeSync = new object();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// Serializes an object into an xml formatted string.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;param name="obj"&amp;gt;The object to serialize.&amp;lt;/param&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;returns&amp;gt;Xml formatted string representing the "obj" parameter&amp;lt;/returns&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public static string SerializeObject(object obj)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make this thread safe.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lock (serializeSync)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make a new StringBuilder seeded with a default xml root&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StringBuilder sb = new StringBuilder("&amp;lt;object type=\"" + &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;obj.GetType().Namespace + "." + obj.GetType().Name + ", " + &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;obj.GetType().Assembly.FullName + "\"&amp;gt;");&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get the PropertyInfos from the object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PropertyInfo[] pInfos = obj.GetType().GetProperties();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure there are properties.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (pInfos.Length &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Loop through each property.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach (PropertyInfo pi in pInfos)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure you can write to the property, and &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// that it isn't null or empty.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (pi.CanWrite &amp;&amp; pi.GetValue(obj, null) != null &amp;&amp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pi.GetValue(obj, null).ToString() != "")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get the property value, make sure it's&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// serialized as well.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string tmp = SerializeObject(pi.GetValue(obj, null));&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure that the property was properly serialized.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (tmp != "")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Add it to the xml string.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sb.Append("&amp;lt;property name=\"" + pi.Name + "\"&amp;gt;" + &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tmp + "&amp;lt;/property&amp;gt;");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// TODO: Implement error logging.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// If there are no properties, treat it as a low level type.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// See if it was an enumeration member.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (obj.GetType().IsEnum)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Return the int value of the enumeration member.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return ((int)obj).ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Return the string value of the object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return obj.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure we're not returning an empty object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (sb.Length == ("&amp;lt;object type=\"" + obj.GetType().Namespace + "." + &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;obj.GetType().Name + ", " + obj.GetType().Assembly.FullName + &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"\"&amp;gt;").Length)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Return an empty string, rather than the empty object tag.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return "";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// End the root element.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sb.Append("&amp;lt;/object&amp;gt;");&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Return the xml.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return sb.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// Deserializes a string created using the SerializeObject(object obj) method.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;param name="s"&amp;gt;The string returned by the SerializeObject(object obj)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// method.&amp;lt;/param&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/// &amp;lt;returns&amp;gt;The object which was formerly serialized.&amp;lt;/returns&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public static object DeserializeObject(string s)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make this thread safe.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lock (deserializeSync)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make a new XmlDocument.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlDocument xDoc = new XmlDocument();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Try to load the xml formatted string.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xDoc.LoadXml(s);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// TODO: Implement error logging.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure something got loaded.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (xDoc.OuterXml != null &amp;&amp; xDoc.OuterXml != "")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get the type of object being deserialized.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Type t = Type.GetType(xDoc.ChildNodes[0].Attributes["type"].Value);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make a new instance of the object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;object o = Activator.CreateInstance(t);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get a list of the property nodes.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlNodeList xNodeList = xDoc.ChildNodes[0].ChildNodes;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure there are child nodes.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (xNodeList.Count &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Loop through all the properties.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach (XmlNode xNode in xDoc.ChildNodes[0].ChildNodes)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure the node meets the base criteria.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (xNode.Name == "property" &amp;&amp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xNode.Attributes.Count == 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Loop through all the properties of the current&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// instance of the serializesd object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach (PropertyInfo pi in o.GetType().GetProperties())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure the property name and the node's property name match, and&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// you can write to the property.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (xNode.Attributes["name"].Value == pi.Name &amp;&amp; pi.CanWrite)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// See if the property is an enumeration.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (pi.PropertyType.IsEnum)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Set the value of the property in our new&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// object to the int value of the serialized object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pi.SetValue(o, Convert.ToInt32(DeserializeObject(xNode.InnerXml)), null);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Set the value of the property in our new object to the properly&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// typed value of the serialized object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pi.SetValue(o, Convert.ChangeType(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DeserializeObject(xNode.InnerXml), pi.PropertyType), null);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;catch&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Set the value to whatever the deserialization&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// method returns (last ditch effort).&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pi.SetValue(o, DeserializeObject(xNode.InnerXml), null);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// If there were no serialized properties, treat it as a low level type.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Make sure there was a value stored.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (xDoc.InnerText != "")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Properly type the object and set it's value.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;o = Convert.ChangeType(xDoc.InnerText, o.GetType());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Return our new object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return o;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Our document loaded successfully, but was empty.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Return an empty object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-6925645035530649824?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/6925645035530649824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=6925645035530649824&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/6925645035530649824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/6925645035530649824'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2009/10/serialize-objects-manually.html' title='Serialize Objects Manually'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-7132295968296155160</id><published>2009-07-17T15:03:00.003-05:00</published><updated>2009-07-17T15:34:40.776-05:00</updated><title type='text'>My Morning Comedy &amp; Cool Deals Lineup</title><content type='html'>Every morning, I like to spice up my day by checking in on some sites with some nice daily content. Sometimes these are pretty cool, and so I thought that my readers might be interested in some of these.&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://www.thedailywtf.com"&gt;The Daily WTF&lt;/a&gt;. This is a fun site where people send in the insane things that they come across in their day-to-day dealings with other people's code and strange other stuff. This is an especially great read when you think that one of coworkers has just done the dumbest thing you've ever seen.&lt;br /&gt;&lt;br /&gt;2. &lt;a href="http://www.userfriendly.org"&gt;UserFriendly.org&lt;/a&gt;. This is a geeky comic strip. Usually has content based on current things going on in the tech world, and it's usually very funny.&lt;br /&gt;&lt;br /&gt;3. &lt;a href="http://www.woot.com"&gt;Woot&lt;/a&gt;. This is a deals site. They sell one item per day until it sells out, with the exception of once a month, when they have a "Woot-Off" and sell all the remaining items one-by-one until they sell out from the items that didn't sell out on previous days. Prices are typically very decent, and the items range from completely geeky to random household items.&lt;br /&gt;&lt;br /&gt;4. &lt;a href="http://www.ihavetohavethat.com/index.php"&gt;I Have To Have THAT&lt;/a&gt;. A very Woot-like site, but I've never seen them do anything like a Woot-Off on there.&lt;br /&gt;&lt;br /&gt;I'd love to hear of more fun sites from my readers, so feel free to send them in!&lt;br /&gt;&lt;br /&gt;Until next time, my best regards to all of you.&lt;br /&gt;&lt;br /&gt;~ Nathan ~&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-7132295968296155160?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/7132295968296155160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=7132295968296155160&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/7132295968296155160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/7132295968296155160'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2009/07/my-morning-comedy-cool-deals-lineup.html' title='My Morning Comedy &amp; Cool Deals Lineup'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-4750367475608662883</id><published>2009-01-11T22:14:00.002-06:00</published><updated>2009-01-11T23:01:31.558-06:00</updated><title type='text'>Free Exercise Bike w/ Laptop Stand</title><content type='html'>I was working on a lady's laptop, and we got to talking about exercise, and I mentioned my plans to purchase an exercise bike that fit under my desk so that I could exercise on the couch or at work. She said that she had an old exercise bike in her basement that I could have if I wanted. Me, never turning down anything free, took her up on the deal, and I returned to my house with an old DP brand &lt;span style="font-style:italic;"&gt;AIR EX2000&lt;/span&gt;. Sorry I didn't take any "before" pictures of the bike, but I didn't realize how cool and easy this mod would be.&lt;br /&gt;&lt;br /&gt;I did this entire mod in about 1 hour, including finding my tools, disassembling, reassembling, and then taking pictures. I will be uploading the pictures in the morning, but here's the basic walk-through.&lt;br /&gt;&lt;br /&gt;Tools Required: 1/2" socket/wrench, adjustable wrench, 14 zip ties, 1 metal coat hanger, exercise bike.&lt;br /&gt;&lt;br /&gt;Step 1 - Remove Arms and Pedal Attachments:&lt;br /&gt;On the &lt;span style="font-style:italic;"&gt;AIR EX2000&lt;/span&gt; the handles are attached to the pedals via a shaped metal bar. Use the adjustable wrench to remove the nut from the back side of the pedals, and then remove the pedals. Take the attachment bars from the pedals, you won't need the washer and grommet, so you can put them back in the space on the pedals, and then put the pedals back on. Take the arms off the bike with the 1/2" socket/wrench and adjustable wrench. The bar attaching them runs the width of the bike, so it is only necessary to remove one side, then just pull the bar through. &lt;br /&gt;&lt;br /&gt;Step 2 - Put Arms On:&lt;br /&gt;Put the arms back on the opposite side they came off of, using the same hardware. make sure the part where you would normally place your hands faces out. Use 2 zip ties on each side to hold the arm bars to the leg bars to prevent the stand from swiveling on the bike.&lt;br /&gt;&lt;br /&gt;Step 3 - Attach Pedal Attachments as Stand:&lt;br /&gt;On the &lt;span style="font-style:italic;"&gt;AIR EX2000&lt;/span&gt;, the braces which attach the pedals to the arm bars have about a 1" zig-zag in them, with one end being about 10", and the other about 4". Using 4 zip ties on each side, attach the holes on the long side of the bracer bars to the holes in the (now) top of the handle bars. Make sure the zig-zag is curved up first, so that your laptop can rest on it. Using 2 more zip ties, tie the holes in the short ends of the braces together in a point (I did mine side-by-side, to make it level).&lt;br /&gt;&lt;br /&gt;Step 4 - Laptop Clasp:&lt;br /&gt;To prevent the laptop from sliding from side to side, and also to keep it from accidentally sliding off in case of shock (cats jumping on it), cut the hook part of the hanger off, and straighten it out. Run it through both holes on both sides of the handle bars (the same holes you zip tied the braces to). Bend it up at the width of your laptop, and hook the corners in enough to allow it to snap over the edges of your laptop.&lt;br /&gt;&lt;br /&gt;Now my legs are all rubbery, since I've been on the bike the entire time I've been writing this. The seat isn't that comfy, so I'm gonna have to make some modifications to it too, but for now, I have an exercise bike with a laptop stand, completely free of charge.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-4750367475608662883?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/4750367475608662883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=4750367475608662883&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/4750367475608662883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/4750367475608662883'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2009/01/free-exercise-bike-w-laptop-stand.html' title='Free Exercise Bike w/ Laptop Stand'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-6546979580570793373</id><published>2008-12-27T00:43:00.007-06:00</published><updated>2009-12-10T14:46:58.428-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Google Maps API</title><content type='html'>Ok, so I started a project for work in ASP/C#: verifying peoples' addresses and finding our closest facility to them. I ran into a few little problems here and there, so I thought this would make for an interesting post.&lt;br /&gt;&lt;br /&gt;The &lt;a href='http://www.google.com/apis/maps/index.html'&gt;Google Maps API&lt;/a&gt; seems to be pretty handy for &lt;u&gt;&lt;b&gt;anything&lt;/b&gt;&lt;/u&gt; you might want to display or look up on a map for your web pages. It allows you to center the map to any point you would like, set markers anywhere, add shapes and images to the map, and even allows for transparent overlays.&lt;br /&gt;&lt;br /&gt;Now, everything on the web page we are designing is strictly in code, there is no ASP scripting involved, which added some interesting twists to this project which would normally be avoided, but I ran into a couple of snags while working on this project:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href='#MapNoDisplay'&gt;Google Map doesn't automatically display when made from the C# code.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href='#MapDisappears'&gt;Google Map disappears when placed in a panel after each postback.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href='#MapHasGray'&gt;Google Map has a gray border.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href='#MapKeyInvalid'&gt;The Google Maps API key was registered for a different web site.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='MapNoDisplay'&gt;The&lt;/a&gt; first thing you have to do in order for &lt;b&gt;&lt;u&gt;any part&lt;/u&gt;&lt;/b&gt; of the Map API to work is to make the following link, using your own key, not the Google key:&lt;br /&gt;&lt;pre class="brush: html"&gt;&lt;br /&gt;&amp;lt;script src="http://maps.google.com/maps?file=api&amp;amp;amp;v=2.x&amp;amp;amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The Google Map is made by creating a div tag and setting an id for it, and then passing that div id to the GMap2 object in JavaScript, which places a map in the div.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;var map = null;&lt;br /&gt;&lt;br /&gt;function initialize()&lt;br /&gt;{&lt;br /&gt;    if (GBrowserIsCompatible())&lt;br /&gt;    {&lt;br /&gt;        map = new GMap2(document.getElementById('map_div'));&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, you make sure that you run the "initialize" function in your body's onload event, and the map will display in the div. If you make this div as a "LiteralControl" or any other server side code, and the div is inside an UpdatePanel, the onload event fires and runs "initialize" without ever showing the map, and you need to add the following line of code after the div is created to make it display from the start (replace &amp;lt;unique id&amp;gt; with a proper element id):&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;ScriptManager.RegisterClientScriptBlock(Page, typeof(System.Type), "&amp;lt;unique id&amp;gt;", "initialize();", true);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, if all you ever do is show the map, and never center it or anything else, all you need to do is to make sure that the line above gets run with every postback. However, if you want markers set, or want the map centered in a specific spot, you'll need to add a new function to your JavaScript, and a couple new global variables. To center the map on a specific location:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;map.setCenter(new GLatLng(37.4419, -122.1419), 13);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Easy, all you need to do is pass a new latitude and longitude to the setCenter method. The last number (13) is the zoom level; the higher the number, the closer the zoom.&lt;br /&gt;&lt;br /&gt;So at this point, we can add a marker to the map, to show pinpoint the above location. This can happen on a button being pressed, or any event, but you need this code somewhere to be executed in your JavaScript:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;map.addOverlay(new GMarker(new GLatLng(37.4419, -122.1419)));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='MapDisappears'&gt;Here&lt;/a&gt; you have your map on the page, centered over the Google office (yeah, I used their example lat/long), and a big red marker placed on their building. You click an element on your page that causes a postback, and the map disappears!&lt;br /&gt;&lt;br /&gt;Now when this first happened to me, I freaked out, chewed off all my nails, and called my shrink. Not quite, but it was frustrating to see it all nice and pretty, and then just go away. So I started searching, and pretty soon found a way to fix it. I'm not going to go into the details of why this happens, as this could take several more posts, but I'll tell you how to fix it.&lt;br /&gt;&lt;br /&gt;If you've read the post from top to bottom, then you remember seeing this line:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;ScriptManager.RegisterClientScriptBlock(Page, typeof(System.Type), "&amp;lt;unique id&amp;gt;", "initialize();", true);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And now, we're going to utilize a similar line to make the map display again. Firstly, if you have markers, you &lt;b&gt;&lt;u&gt;have&lt;/u&gt;&lt;/b&gt; to save them somewhere: in varibles, a CSV file, hidden text fields, I don't care, but you will lose them on every postback if you don't save them on the client. So we need to add the following code to our JavaScript:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;// It's up to you to fill "markers", I'm setting it null&lt;br /&gt;// Use it as an array, and store GLatLng's in it&lt;br /&gt;var markers = null;&lt;br /&gt;&lt;br /&gt;function reInitialize()&lt;br /&gt;{&lt;br /&gt;    initialize();&lt;br /&gt;&lt;br /&gt;    for (var i = 0; i &lt; markers.length; i++)&lt;br /&gt;    {&lt;br /&gt;        map.addOverlay(new GMarker(markers[i]));&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And add the following line to your C# (best place is up to you, replace &amp;lt;unique id&amp;gt; with a proper element id):&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;ScriptManager.RegisterClientScriptBlock(Page, typeof(System.Type), "&amp;lt;unique id&amp;gt;", "reInitialize();", true);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Suddenly, your map is back, with all it's markers, centered where you had it, and looking all pretty again.&lt;br /&gt;&lt;br /&gt;&lt;a name='MapHasGray'&gt;The&lt;/a&gt; last little thing I noticed with the map, is that when you add it to a page from code, IE8 doesn't always display it properly. If while the UpdatePanel is still loading, your map div gets moved, the map's "center" is the original center of the div, not based on the new location. If you see this occurring, the simplest way to fix it is just to wait until the page is loaded to initialize the map. This can be done using our ScriptManager line again, but modified as shown in the first example below:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;ScriptManager.RegisterClientScriptBlock(Page, typeof(System.Type), "&amp;lt;unique id&amp;gt;", "setTimeout('initialize();', 1500);", true);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Rather than as it was shown in the first of this post:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;ScriptManager.RegisterClientScriptBlock(Page, typeof(System.Type), "&amp;lt;unique id&amp;gt;", "initialize();", true);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note that the new version of this line has a timeout set on the "initialize" function. You simply need to set the timeout to a sufficient amount of time for all the elements on your page to finish loading.&lt;br /&gt;&lt;br /&gt;&lt;a name='MapKeyInvalid'&gt;This&lt;/a&gt; one is a short one, but one that reared it's ugly head just after releasing all this code that we worked so hard on to an actual server. We had been running the site on the development machines (localhost), and when development was done, we went to release to a QA environment for further testing. Suddenly, our beautiful map stopped working! We got an error stating &amp;quot;The Google Maps API key used on this web site was registered for a different web site. You can generate a new key for this web site at http://code.google.com/apis/maps.&amp;quot; So, i went and re-registered the key, copied it and pasted it into place, and still got the same error.&lt;br /&gt;&lt;br /&gt;Finally, I came across a post about using &lt;a href='http://office.microsoft.com/en-us/frontpage/FX100743231033.aspx'&gt;Microsoft FrontPage&lt;/a&gt; with the Google Maps API, and problems with the &amp;quot;&amp;amp;amp;&amp;quot;s in the link source. FrontPage will apparently (trying to help you out and all) translate the &amp;quot;&amp;amp;amp;&amp;quot; to &amp;quot;&amp;amp;amp;amp;&amp;quot;. Now I knew this wasn't my problem because I was using C# to output the link, but C# uses literal translation when outputting strings. &lt;br /&gt;&lt;br /&gt;Therefore, I had to replace the string as shown above:&lt;br /&gt;&lt;pre class="brush: html"&gt;&lt;br /&gt;&amp;lt;script src="http://maps.google.com/maps?file=api&amp;amp;amp;v=2.x&amp;amp;amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;with the following string:&lt;br /&gt;&lt;pre class="brush: html"&gt;&lt;br /&gt;&amp;lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2.x&amp;amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And once this was changed, my map suddenly started to work on the server the way it should. Hope this helps.&lt;br /&gt;&lt;br /&gt;Feel free to comment on this if you have any additional information or questions. I have tried my best to explain in detail without making this post too long, or simply boring you into leaving, and I hope that has been sufficient. Happy Mapping!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-6546979580570793373?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/6546979580570793373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=6546979580570793373&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/6546979580570793373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/6546979580570793373'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2008/12/google-maps-api.html' title='Google Maps API'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-5519290929672886414</id><published>2008-12-25T14:32:00.022-06:00</published><updated>2011-02-01T10:47:47.649-06:00</updated><title type='text'>I'm Back! + Woot Auto Buy 3 on Random Crap</title><content type='html'>It's been a while since I've posted, and while I've been gone, I've done a few interesting things, and will be posting more bits and pieces of code here now. Sorry to anyone who was hoping I was a stable blogger, and would be posting more regularly, and I will try to do better as time goes on. So now, I'm going to post one piece I spent some time on: The Woot Auto Buy 3 on Random Crap.&lt;br /&gt;&lt;br /&gt;This script can be &lt;a href='http://userscripts.org/scripts/show/37342'&gt;found and installed&lt;/a&gt; on &lt;a href='http://userscripts.org'&gt;Userscripts.org&lt;/a&gt;, using the &lt;a href='http://www.mozilla.com/en-US/firefox/'&gt;Firefox&lt;/a&gt; web browser, and the &lt;a href='https://addons.mozilla.org/en-US/firefox/addon/748'&gt;Greasemonkey&lt;/a&gt; add-on. It will automatically click the "I want 1" button, upgrade to 3, and fill out the information on the purchase page. It doesn't yet work with &lt;a href='https://www.paypal.com/us/'&gt;PayPal&lt;/a&gt;, but when I make that upgrade, I will also update this post. You need to be &lt;u&gt;&lt;b&gt;signed in&lt;/b&gt;&lt;/u&gt; to &lt;a href='http://www.woot.com'&gt;Woot.com&lt;/a&gt; for this script to function properly. Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Edit (28 Oct, 2009 14:18 GMT-0600): I'm keeping the newest version number of this script on this page now, since the script has now had 1500+ installs!&lt;br /&gt;&lt;br /&gt;Current version: &lt;div id="currentVersion"&gt;0.20&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;//&lt;br /&gt;// by njkrut (njkrut{at}gmail.com)&lt;br /&gt;// heavily modified by (md5sum{at}yahoo.com)&lt;br /&gt;// ==UserScript==&lt;br /&gt;// @name Woot.com Auto Refresh and Buy 3 on Random Crap&lt;br /&gt;// @namespace http://nikru.com&lt;br /&gt;// @description Auto Refreshes during WootOff, then Buys 3 items on BoCs&lt;br /&gt;// @include https://www.woot.com/Member/Order.aspx&lt;br /&gt;// @include http://www.woot.com/&lt;br /&gt;// ==/UserScript==&lt;br /&gt;var doMyPostBack = function()&lt;br /&gt;{&lt;br /&gt;   if(theForm &amp;amp;&amp;amp; wantthreebutton)&lt;br /&gt;   {&lt;br /&gt;       eventTarget.value = 'ctl00$ContentPlaceHolder$ShoppingCartControl$WantedThreeButton';&lt;br /&gt;       eventArgument.value = '';&lt;br /&gt;       theForm.submit();&lt;br /&gt;   } else {&lt;br /&gt;       alert('Could Not Select Three for Unknown Reasons');&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var pageItem = document.getElementById('TitleHeader');&lt;br /&gt;var wantOne = document.getElementById('ctl00_ContentPlaceHolder_OrderButton');&lt;br /&gt;var wantOne2 = document.getElementById('ctl00_ContentPlaceHolder_OrderButton2');&lt;br /&gt;var eventTarget = document.getElementById('__EVENTTARGET');&lt;br /&gt;var eventArgument = document.getElementById('__EVENTARGUMENT');&lt;br /&gt;var item = document.getElementById('ctl00_ContentPlaceHolder_ShoppingCartControl_SaleTitleLabel');&lt;br /&gt;var wantthreebutton = document.getElementById('ctl00_ContentPlaceHolder_ShoppingCartControl_WantedThreeButton');&lt;br /&gt;var theForm = document.getElementById('aspnetForm');&lt;br /&gt;var cardSecurity = document.getElementById('ctl00_ContentPlaceHolder_SecurityCodeTextBox');&lt;br /&gt;&lt;br /&gt;if (document.location == "http://www.woot.com/" &amp;amp;&amp;amp; document.getElementById("PriceSpan").innerHTML == "$0.99" &amp;amp;&amp;amp; pageItem.innerHTML.substring(0,11) == "Random Crap")&lt;br /&gt;{&lt;br /&gt;   try{&lt;br /&gt;       document.location = "http://www.woot.com/" + wantOne.getAttribute("href");&lt;br /&gt;   }catch(a){&lt;br /&gt;       try{&lt;br /&gt;           document.location = "http://www.woot.com/" + wantOne2.getAttribute("href");&lt;br /&gt;       }catch(e){&lt;br /&gt;           alert(e);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}else{&lt;br /&gt;   if (document.location == "http://www.woot.com/" &amp;amp;&amp;amp; document.getElementById("ctl00_ContentPlaceHolder_WootOffPanel"))&lt;br /&gt;   {&lt;br /&gt;       setTimeout("document.location = document.location", 30000);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (item.innerHTML.substring(0, 11) == "Random Crap" &amp;amp;&amp;amp; wantthreebutton)&lt;br /&gt;{&lt;br /&gt;   doMyPostBack();&lt;br /&gt;}else{&lt;br /&gt;   if (item.innerHTML.substring(0, 11) == "Random Crap")&lt;br /&gt;   {&lt;br /&gt;       cardSecurity.value = '';&lt;br /&gt;       if (cardSecurity.value != '')&lt;br /&gt;       {&lt;br /&gt;           WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder$BuyButton", "", true, "", "", false, false));&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-5519290929672886414?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/5519290929672886414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=5519290929672886414&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/5519290929672886414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/5519290929672886414'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2008/12/im-back-woot-auto-buy-3-on-random-crap.html' title='I&apos;m Back! + Woot Auto Buy 3 on Random Crap'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-7722696930723559247</id><published>2008-03-20T09:20:00.005-05:00</published><updated>2009-12-10T14:57:11.474-06:00</updated><title type='text'>SQL Stored Procedure Decryptor</title><content type='html'>This script will decrypt an encrypted stored procedure in your database. Please note that in order to use this stored procedure, you must be connected as a remote admin. In order to do this, you must first enable remote admin connections by running this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;&lt;br /&gt;sp_configure 'remote admin connections', 1 ;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;RECONFIGURE ;&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After that, you need to disconnect ONLY YOUR QUERY window, not object explorer. Object explorer will not connect as remote admin. Also, you will kick out any existing connections to your database when you connect as remote admin, so do not do this on a production box. To connect as remote admin, connect your query window again, but type "ADMIN:" before the server name (minus the quotes, of course), and connect using sa or an administrator account.&lt;br /&gt;&lt;br /&gt;Then, you can edit the &amp;lt;catalog&amp;gt;, &amp;lt;schema&amp;gt;, and &amp;lt;object&amp;gt; areas (one of each) in the following query to decrypt a stored procedure.&lt;br /&gt;&lt;br /&gt;I take absolutely NO credit for writing this, I found it on a website, and I don't remember where, but there were no credits in it where I found it.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;&lt;br /&gt;USE [&amp;lt;catalog&amp;gt;]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;DECLARE @procedure sysname&lt;br /&gt;SELECT@procedure = '&amp;lt;schema&amp;gt;.&amp;lt;object&amp;gt;'&lt;br /&gt;DECLARE @intProcSpace bigint&lt;br /&gt;DECLARE @t bigint&lt;br /&gt;DECLARE @maxColID smallint&lt;br /&gt;DECLARE @intEncrypted tinyint&lt;br /&gt;DECLARE @procNameLength int&lt;br /&gt;&lt;br /&gt;DECLARE @real_01 nvarchar(max)&lt;br /&gt;DECLARE @fake_01 nvarchar(max)&lt;br /&gt;DECLARE @fake_encrypt_01 nvarchar(max)&lt;br /&gt;DECLARE @real_decrypt_01 nvarchar(max)&lt;br /&gt;DECLARE @real_decrypt_01a nvarchar(max)&lt;br /&gt;&lt;br /&gt;create table #output&lt;br /&gt;(&lt;br /&gt;[ident] [int] IDENTITY(1, 1)&lt;br /&gt;NOT NULL&lt;br /&gt;,[real_decrypt] NVARCHAR(MAX)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;@maxColID = max(subobjid)&lt;br /&gt;FROM&lt;br /&gt;sys.sysobjvalues&lt;br /&gt;WHERE&lt;br /&gt;objid = object_id(@procedure)&lt;br /&gt;&lt;br /&gt;select&lt;br /&gt;@procNameLength = datalength(@procedure) + 29&lt;br /&gt;&lt;br /&gt;select&lt;br /&gt;@real_decrypt_01a = ''&lt;br /&gt;&lt;br /&gt;SET @real_01 = (&lt;br /&gt;SELECT&lt;br /&gt;imageval&lt;br /&gt;FROM&lt;br /&gt;sys.sysobjvalues&lt;br /&gt;WHERE&lt;br /&gt;objid = object_id(@procedure)&lt;br /&gt;and valclass = 1&lt;br /&gt;and subobjid = 1&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;BEGIN TRAN&lt;br /&gt;&lt;br /&gt;SET @fake_01 = 'ALTER PROCEDURE ' + @procedure + ' WITH ENCRYPTION AS ' + REPLICATE(cast('-' as nvarchar(max)), 40003 - @procNameLength)&lt;br /&gt;&lt;br /&gt;EXECUTE (@fake_01)&lt;br /&gt;&lt;br /&gt;SET @fake_encrypt_01 = (&lt;br /&gt;SELECT&lt;br /&gt;imageval&lt;br /&gt;FROM&lt;br /&gt;sys.sysobjvalues&lt;br /&gt;WHERE&lt;br /&gt;objid = object_id(@procedure)&lt;br /&gt;and valclass = 1&lt;br /&gt;and subobjid = 1&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;SET @fake_01 = 'CREATE PROCEDURE ' + @procedure + ' WITH ENCRYPTION AS ' + REPLICATE(cast('-' as nvarchar(max)), 40003 - @procNameLength)&lt;br /&gt;&lt;br /&gt;SET @intProcSpace = 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SET @real_decrypt_01 = replicate(cast(N'A' as nvarchar(max)), (datalength(@real_01) / 2))&lt;br /&gt;&lt;br /&gt;SET @intProcSpace = 1&lt;br /&gt;&lt;br /&gt;WHILE @intProcSpace &amp;lt;= (datalength(@real_01) / 2)&lt;br /&gt;BEGIN&lt;br /&gt;SET @real_decrypt_01 = stuff(@real_decrypt_01, @intProcSpace, 1, NCHAR(UNICODE(substring(@real_01, @intProcSpace, 1)) ^ (UNICODE(substring(@fake_01, @intProcSpace, 1)) ^ UNICODE(substring(@fake_encrypt_01, @intProcSpace, 1)))))&lt;br /&gt;SET @intProcSpace = @intProcSpace + 1&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;insert #output (real_decrypt) select @real_decrypt_01&lt;br /&gt;declare @dbname sysname&lt;br /&gt;declare @BlankSpaceAdded int&lt;br /&gt;declare @BasePos int&lt;br /&gt;declare @CurrentPos int&lt;br /&gt;declare @TextLength int&lt;br /&gt;declare @LineId int&lt;br /&gt;declare @AddOnLen int&lt;br /&gt;declare @LFCR int&lt;br /&gt;declare @DefinedLength int&lt;br /&gt;declare @SyscomText nvarchar(max)&lt;br /&gt;declare @Line nvarchar(255)&lt;br /&gt;&lt;br /&gt;Select @DefinedLength = 255&lt;br /&gt;SELECT @BlankSpaceAdded = 0&lt;br /&gt;&lt;br /&gt;CREATE TABLE #CommentText ( LineId int ,Text nvarchar(255) collate database_default )&lt;br /&gt;&lt;br /&gt;DECLARE ms_crs_syscom CURSOR LOCAL FOR&lt;br /&gt;SELECT real_decrypt from #output&lt;br /&gt;ORDER BY ident&lt;br /&gt;FOR READ ONLY&lt;br /&gt;&lt;br /&gt;SELECT @LFCR = 2&lt;br /&gt;SELECT @LineId = 1&lt;br /&gt;&lt;br /&gt;OPEN ms_crs_syscom&lt;br /&gt;&lt;br /&gt;FETCH NEXT FROM ms_crs_syscom into @SyscomText&lt;br /&gt;&lt;br /&gt;WHILE @@fetch_status &gt;= 0&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;@BasePos = 1&lt;br /&gt;SELECT&lt;br /&gt;@CurrentPos = 1&lt;br /&gt;SELECT&lt;br /&gt;@TextLength = LEN(@SyscomText)&lt;br /&gt;&lt;br /&gt;WHILE @CurrentPos != 0&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;@CurrentPos = CHARINDEX(char(13) + char(10), @SyscomText, @BasePos)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IF @CurrentPos != 0&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;While (isnull(LEN(@Line), 0) + @BlankSpaceAdded + @CurrentPos - @BasePos + @LFCR) &amp;gt; @DefinedLength&lt;br /&gt;BEGIN&lt;br /&gt;SELECT&lt;br /&gt;@AddOnLen = @DefinedLength - (isnull(LEN(@Line), 0) + @BlankSpaceAdded)&lt;br /&gt;&lt;br /&gt;INSERT&lt;br /&gt;#CommentText&lt;br /&gt;VALUES&lt;br /&gt;(&lt;br /&gt;@LineId&lt;br /&gt;,isnull(@Line, N'') + isnull(SUBSTRING(@SyscomText, @BasePos, @AddOnLen), N'')&lt;br /&gt;)&lt;br /&gt;SELECT&lt;br /&gt;@Line = NULL&lt;br /&gt;,@LineId = @LineId + 1&lt;br /&gt;,@BasePos = @BasePos + @AddOnLen&lt;br /&gt;,@BlankSpaceAdded = 0&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;@Line = isnull(@Line, N'') + isnull(SUBSTRING(@SyscomText, @BasePos, @CurrentPos - @BasePos + @LFCR), N'')&lt;br /&gt;SELECT&lt;br /&gt;@BasePos = @CurrentPos + 2&lt;br /&gt;&lt;br /&gt;INSERT&lt;br /&gt;#CommentText&lt;br /&gt;VALUES&lt;br /&gt;(@LineId, @Line)&lt;br /&gt;SELECT&lt;br /&gt;@LineId = @LineId + 1&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;@Line = NULL&lt;br /&gt;END&lt;br /&gt;ELSE&lt;br /&gt;BEGIN&lt;br /&gt;IF @BasePos &amp;lt;= @TextLength BEGIN&lt;br /&gt;&lt;br /&gt;While (isnull(LEN(@Line), 0) + @BlankSpaceAdded + @TextLength - @BasePos + 1) &gt; @DefinedLength&lt;br /&gt;BEGIN&lt;br /&gt;SELECT&lt;br /&gt;@AddOnLen = @DefinedLength - (isnull(LEN(@Line), 0) + @BlankSpaceAdded)&lt;br /&gt;&lt;br /&gt;INSERT&lt;br /&gt;#CommentText&lt;br /&gt;VALUES&lt;br /&gt;(&lt;br /&gt;@LineId&lt;br /&gt;,isnull(@Line, N'') + isnull(SUBSTRING(@SyscomText, @BasePos, @AddOnLen), N'')&lt;br /&gt;)&lt;br /&gt;SELECT&lt;br /&gt;@Line = NULL&lt;br /&gt;,@LineId = @LineId + 1&lt;br /&gt;,@BasePos = @BasePos + @AddOnLen&lt;br /&gt;,@BlankSpaceAdded = 0&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;@Line = isnull(@Line, N'') + isnull(SUBSTRING(@SyscomText, @BasePos, @TextLength - @BasePos + 1), N'')&lt;br /&gt;&lt;br /&gt;if LEN(@Line) &amp;lt; @DefinedLength and charindex(' ', @SyscomText, @TextLength + 1) &gt; 0&lt;br /&gt;BEGIN&lt;br /&gt;SELECT&lt;br /&gt;@Line = @Line + ' '&lt;br /&gt;,@BlankSpaceAdded = 1&lt;br /&gt;END&lt;br /&gt;END&lt;br /&gt;END&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;FETCH NEXT FROM ms_crs_syscom into @SyscomText&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IF @Line is NOT NULL&lt;br /&gt;INSERT&lt;br /&gt;#CommentText&lt;br /&gt;VALUES&lt;br /&gt;(@LineId, @Line)&lt;br /&gt;&lt;br /&gt;select&lt;br /&gt;Text&lt;br /&gt;from&lt;br /&gt;#CommentText&lt;br /&gt;order by&lt;br /&gt;LineId&lt;br /&gt;&lt;br /&gt;CLOSE ms_crs_syscom&lt;br /&gt;DEALLOCATE ms_crs_syscom&lt;br /&gt;DROP TABLE #CommentText&lt;br /&gt;&lt;br /&gt;ROLLBACK TRAN&lt;br /&gt;DROP TABLE #output&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-7722696930723559247?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/7722696930723559247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=7722696930723559247&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/7722696930723559247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/7722696930723559247'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2008/03/sql-stored-procedure-decryptor.html' title='SQL Stored Procedure Decryptor'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-5807435182631496449</id><published>2008-03-14T10:31:00.003-05:00</published><updated>2009-12-10T14:59:34.697-06:00</updated><title type='text'>Auditing Your Tables</title><content type='html'>I wrote this script to use at work to create triggers on all of the tables here at work so that we can audit changes. I have modified it slightly to include the Create/Alter of the audit table. Soon I will be posting queries that will allow you to easily view the information in the audits. Please note that if you want things translated in your audit table, you can do lookups in the triggers, but this will require a manual change. So, without further anticipation:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql"&gt;&lt;br /&gt;--******************************************************--&lt;br /&gt;--* Author: Nathan Wheeler *--&lt;br /&gt;--* Date: 3/12/08 *--&lt;br /&gt;--* Description: This query will look through each *--&lt;br /&gt;--* table in the used catalog and create an auditing *--&lt;br /&gt;--* trigger for each table with a primary key. *--&lt;br /&gt;--* It will also create the table in which to place *--&lt;br /&gt;--* the audit entries. *--&lt;br /&gt;--* Licensing: Feel free to use this script to create *--&lt;br /&gt;--* audits on all your catalogs, just don't give it *--&lt;br /&gt;--* away without this notice. *--&lt;br /&gt;--* *--&lt;br /&gt;--* For more stuff like this, visit: *--&lt;br /&gt;--* http://maxaffinity.blogspot.com *--&lt;br /&gt;--******************************************************--&lt;br /&gt;--Insert catalog name here.&lt;br /&gt;USE [&amp;lt;catalog&amp;gt;]&lt;br /&gt;GO&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;--If the AuditTable is there alter it, otherwise create it.&lt;br /&gt;IF OBJECT_ID(('AuditTable'), 'U') IS NOT NULL&lt;br /&gt;PRINT 'CREATE TABLE [dbo].[AuditTable]'&lt;br /&gt;ELSE&lt;br /&gt;PRINT 'ALTER TABLE [dbo].[AuditTable]'&lt;br /&gt;PRINT ' ('&lt;br /&gt;PRINT ' [AuditID] [int] IDENTITY(1, 1)'&lt;br /&gt;PRINT ' NOT NULL'&lt;br /&gt;PRINT ' ,[TableName] [varchar](50) NOT NULL'&lt;br /&gt;PRINT ' ,[KeyName] [varchar](50) NOT NULL'&lt;br /&gt;PRINT ' ,[KeyValue] [varchar](50) NOT NULL'&lt;br /&gt;PRINT ' ,[FieldName] [varchar](50) NOT NULL'&lt;br /&gt;PRINT ' ,[FieldOldValue] [varchar](8000) NULL'&lt;br /&gt;PRINT ' ,[FieldNewValue] [varchar](8000) NULL'&lt;br /&gt;PRINT ' ,[ModifiedBy] [varchar](75) NOT NULL'&lt;br /&gt;PRINT ' ,[ModifiedDate] [datetime] NOT NULL'&lt;br /&gt;PRINT ' ,CONSTRAINT [PK_AuditTable] PRIMARY KEY CLUSTERED ([AuditID] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]'&lt;br /&gt;PRINT ' )'&lt;br /&gt;PRINT 'ON [PRIMARY]'&lt;br /&gt;PRINT 'GO'&lt;br /&gt;DECLARE&lt;br /&gt;@TableName VARCHAR(255)&lt;br /&gt;,@KeyName VARCHAR(255)&lt;br /&gt;,@Schema VARCHAR(255)&lt;br /&gt;,@TriggerName VARCHAR(255)&lt;br /&gt;,@FieldName VARCHAR(255)&lt;br /&gt;DECLARE table_cursor CURSOR&lt;br /&gt;FOR SELECT&lt;br /&gt;KU.TABLE_NAME&lt;br /&gt;,KU.COLUMN_NAME&lt;br /&gt;,KU.CONSTRAINT_SCHEMA + '.'&lt;br /&gt;FROM&lt;br /&gt;INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS TC&lt;br /&gt;INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KU&lt;br /&gt;ON TC.CONSTRAINT_TYPE = 'PRIMARY KEY'&lt;br /&gt;AND TC.CONSTRAINT_NAME = KU.CONSTRAINT_NAME&lt;br /&gt;WHERE&lt;br /&gt;--In the "NOT IN" is where you can list any tables you DON'T want to audit.&lt;br /&gt;--Be sure to put at least the AuditTable in here.&lt;br /&gt;KU.TABLE_NAME NOT IN ('AuditTable')&lt;br /&gt;ORDER BY KU.TABLE_NAME&lt;br /&gt;OPEN table_cursor&lt;br /&gt;FETCH NEXT FROM table_cursor INTO @TableName, @KeyName, @Schema&lt;br /&gt;WHILE @@FETCH_STATUS = 0&lt;br /&gt;BEGIN&lt;br /&gt;--The trigger will be the name of the table prefixed be "audittr_".&lt;br /&gt;--This can be changed by setting @TriggerName to something different.&lt;br /&gt;SET @TriggerName = @Schema + 'audittr_' + @TableName&lt;br /&gt;DECLARE field_cursor CURSOR&lt;br /&gt;FOR SELECT&lt;br /&gt;c.name&lt;br /&gt;FROM&lt;br /&gt;sysobjects o&lt;br /&gt;INNER JOIN syscolumns c&lt;br /&gt;ON o.id = c.id&lt;br /&gt;WHERE&lt;br /&gt;o.name = @TableName&lt;br /&gt;ORDER BY&lt;br /&gt;o.name&lt;br /&gt;,c.colorder&lt;br /&gt;--If the trigger already exists, alter it instead of create.&lt;br /&gt;IF OBJECT_ID((@TriggerName), 'TR') IS NOT NULL&lt;br /&gt;PRINT 'ALTER TRIGGER ' + @TriggerName&lt;br /&gt;ELSE&lt;br /&gt;PRINT 'CREATE TRIGGER ' + @TriggerName&lt;br /&gt;PRINT ' ON ' + @Schema + @TableName&lt;br /&gt;PRINT ' AFTER UPDATE'&lt;br /&gt;PRINT 'AS '&lt;br /&gt;PRINT ''&lt;br /&gt;PRINT ' INSERT INTO AuditTable'&lt;br /&gt;OPEN field_cursor&lt;br /&gt;--Get the first field name.&lt;br /&gt;FETCH NEXT FROM field_cursor INTO @FieldName&lt;br /&gt;PRINT ' SELECT ' + QUOTENAME(@TableName, '''') + ' AS TableName,'&lt;br /&gt;PRINT ' ' + QUOTENAME(@KeyName, '''') + ' AS KeyName,'&lt;br /&gt;PRINT ' INSERTED.' + @KeyName + ' AS KeyValue,'&lt;br /&gt;PRINT ' ' + QUOTENAME(@FieldName, '''') + ' AS FieldName,'&lt;br /&gt;PRINT ' CAST(DELETED.' + @FieldName + ' AS VARCHAR(MAX)) AS FieldOldValue,'&lt;br /&gt;PRINT ' CAST(INSERTED.' + @FieldName + ' AS VARCHAR(MAX)) AS FieldNewValue,'&lt;br /&gt;PRINT ' SYSTEM_USER AS ModifiedBy,'&lt;br /&gt;PRINT ' getdate() AS ModifiedDate'&lt;br /&gt;PRINT ' FROM INSERTED'&lt;br /&gt;PRINT ' INNER JOIN DELETED'&lt;br /&gt;PRINT ' ON INSERTED.' + @KeyName + ' = DELETED.' + @KeyName&lt;br /&gt;PRINT ' WHERE CAST(DELETED.' + @FieldName + ' AS VARCHAR(MAX)) &amp;lt;&amp;gt; CAST(INSERTED.' + @FieldName + ' AS VARCHAR(MAX))'&lt;br /&gt;--If there is another field (can't see why you'd want just one)&lt;br /&gt;--get the next field name.&lt;br /&gt;FETCH NEXT FROM field_cursor INTO @FieldName&lt;br /&gt;WHILE @@FETCH_STATUS = 0&lt;br /&gt;BEGIN&lt;br /&gt;PRINT ' UNION ALL'&lt;br /&gt;PRINT ' SELECT ' + QUOTENAME(@TableName, '''') + ','&lt;br /&gt;PRINT ' ' + QUOTENAME(@KeyName, '''') + ','&lt;br /&gt;PRINT ' INSERTED.' + @KeyName + ','&lt;br /&gt;PRINT ' ' + QUOTENAME(@FieldName, '''') + ','&lt;br /&gt;PRINT ' CAST(DELETED.' + @FieldName + ' AS VARCHAR(MAX)),'&lt;br /&gt;PRINT ' CAST(INSERTED.' + @FieldName + ' AS VARCHAR(MAX)),'&lt;br /&gt;PRINT ' SYSTEM_USER,'&lt;br /&gt;PRINT ' getdate()'&lt;br /&gt;PRINT ' FROM INSERTED'&lt;br /&gt;PRINT ' INNER JOIN DELETED'&lt;br /&gt;PRINT ' ON INSERTED.' + @KeyName + ' = DELETED.' + @KeyName&lt;br /&gt;PRINT ' WHERE CAST(DELETED.' + @FieldName + ' AS VARCHAR(MAX)) &amp;lt;&amp;gt; CAST(INSERTED.' + @FieldName + ' AS VARCHAR(MAX))'&lt;br /&gt;-- Get the next field.&lt;br /&gt;FETCH NEXT FROM field_cursor INTO @FieldName&lt;br /&gt;END&lt;br /&gt;PRINT 'GO'&lt;br /&gt;--Close and deallocate the field cursor for the next table.&lt;br /&gt;CLOSE field_cursor&lt;br /&gt;DEALLOCATE field_cursor&lt;br /&gt;--Get the next table.&lt;br /&gt;FETCH NEXT FROM table_cursor INTO @TableName, @KeyName, @Schema&lt;br /&gt;END&lt;br /&gt;--Close and deallocate the table cursor.&lt;br /&gt;CLOSE table_cursor&lt;br /&gt;DEALLOCATE table_cursor&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-5807435182631496449?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/5807435182631496449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=5807435182631496449&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/5807435182631496449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/5807435182631496449'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2008/03/auditing-your-tables.html' title='Auditing Your Tables'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4950038149959872780.post-3414851508288723272</id><published>2008-03-12T14:20:00.001-05:00</published><updated>2008-03-12T14:30:06.521-05:00</updated><title type='text'>Welcome</title><content type='html'>Welcome to MaxAffinity where youre programming affinity can be maximized through the use of code snippets and tips from some of the top developers in the country.&lt;br /&gt;&lt;br /&gt;Actually most of that is complete bullshit, but there is going to be a lot of neat code snippets, hardware tips and tricks, and a lot more. The real big difference is that it's not from some of the top developers in the world, it's just me. Sorry to disappoint. Enjoy the blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4950038149959872780-3414851508288723272?l=maxaffinity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maxaffinity.blogspot.com/feeds/3414851508288723272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4950038149959872780&amp;postID=3414851508288723272&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/3414851508288723272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4950038149959872780/posts/default/3414851508288723272'/><link rel='alternate' type='text/html' href='http://maxaffinity.blogspot.com/2008/03/welcome.html' title='Welcome'/><author><name>Nathan Wheeler</name><uri>http://www.blogger.com/profile/12605608991479003509</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
