tag:blogger.com,1999:blog-48017715367925725592024-03-19T05:42:05.219-07:00Ben's Developer BlogThe diary of a .NET Developer, working on an unlaunched startup project. Also, I live and work in Southern Oregon.Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-4801771536792572559.post-35339075075061663962009-09-20T04:09:00.000-07:002009-09-20T04:14:23.936-07:00Where have I been?I've been busy.<div><br /></div><div>I've successfully switched to Mac, my <a href="http://www.journeytag.com">iPhone App</a> is done, and I'm now developing in Python and Django for web. I also managed to build a complex web service on the Google App Engine (for my iphone app). </div><div><br /></div><div>I am setting up http://www.benford.name as my personal website and will start hosting my blog over there.</div><div><br /></div><div>Well, that's all I have to report.</div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-4410922708437206302009-04-21T13:59:00.000-07:002009-04-21T14:03:07.389-07:00<div>I've been hard at work groking the iPhone SDK. I became hungup on implementing my photo browser. It's using a UIScrollView with a few "advanced" things happening on top.</div><div><br /></div><div>It's been fun and a challenge to learn "yet another framework". My blogging should stay pretty sparse until my brain has soaked up enough info.</div><div><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRcE0gZ6R_VV85fvF9rJPSvUtnFVAktJeMo1UCXtpDjUQL2gzvJ0c_Cb9yS8KoNM9gLig3sIGMsDAc0UpHh9C344iaRgIg_2ZbaA8lfy0Bze0VteULTMTZiLpQWVDd1vv8fxWKTXP-oC_N/s1600-h/Picture+1.png"><img style="cursor:pointer; cursor:hand;width: 400px; height: 250px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRcE0gZ6R_VV85fvF9rJPSvUtnFVAktJeMo1UCXtpDjUQL2gzvJ0c_Cb9yS8KoNM9gLig3sIGMsDAc0UpHh9C344iaRgIg_2ZbaA8lfy0Bze0VteULTMTZiLpQWVDd1vv8fxWKTXP-oC_N/s400/Picture+1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5327252535317161266" /></a>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-88679560781162916402009-04-04T12:51:00.001-07:002009-04-04T13:01:29.970-07:00Unplugging from the borg<span class="Apple-style-span" style="font-family: Verdana; font-size: 13px; ">I feel like my life as a .NET programmer could be coming to an end. Over the next year I probably won't be starting my own new projects in .NET. </span><div><span class="Apple-style-span" style="font-family:Verdana;font-size:100%;"><span class="Apple-style-span" style="font-size: 13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 13px; ">I can't tell if I just get bored of a "stack" every three years or I am truly wanting to switch again for a "better" way. Back in 2005, I felt isolated using LAMP and yearned for the apparent community of .NET. Four years later, I'm tired of the culture of .NET and the type of apps that get built. The breaking point has been the newly found group of <a href="http://nerddinner.com/40">soggy programmers</a> (which are mostly non-microsoft people). </span></div><div><span class="Apple-style-span" style="font-family:Verdana;font-size:100%;"><span class="Apple-style-span" style="font-size: 13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 13px; ">All of the sudden I find myself seriously playing with the idea of building a iPhone app and using google app engine (python) for the server side. I'm still in research mode, but of all my options, this is what want to do most. </span></div><div><span class="Apple-style-span" style="font-family:Verdana;font-size:100%;"><span class="Apple-style-span" style="font-size: 13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:Verdana;font-size:100%;"><span class="Apple-style-span" style="font-size: 13px;">In all fairness, I wanted to make an iPhone since the day the SDK was released. I even bought a mac mini about 7 months ago. </span></span></div><div><span class="Apple-style-span" style="font-family:Verdana;font-size:100%;"><span class="Apple-style-span" style="font-size: 13px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:Verdana;font-size:100%;"><span class="Apple-style-span" style="font-size: 13px;">I'm plodding along each day wondering what I'll do next. I have spent the last three weeks on my mac mini and I'm loving the change of scenery (from working on windows).</span></span></div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-8203206673969899832009-03-25T02:15:00.000-07:002009-03-25T02:25:19.866-07:00Website Finished and What's Next?<div><b>Website Finished</b></div>Great news! The website I have been working on for the past 6 months is finished enough to go live. So where is it? It's sitting on the server waiting for official content from my business partner.<div><br /></div><div>So, it's done but not live yet. </div><div><br /></div><div><b>What's Next?</b></div><div>I started reading (and coding) through this book: <a href="http://www.iphonedevbook.com/">Beginning iPhone Development</a> with great success. I'm half way through in 2 days.</div><div><br /></div><div>I do have an iPhone app in mind, but I'm not sure I can build it as easily as I think. I promised myself a two weeks to go through that book and I'll see how I feel at that point.</div><div><br /></div><div>If I do decide to go for it, I'll also be building a server component using <a href="http://code.google.com/appengine/">Google App Engine</a>.</div><div><br /></div><div>My alternative is to try for some freelance work to get some income going. I'll keep you posted on both the real launch and my next phase in project dev.</div><div><br /></div><div><br /></div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com5tag:blogger.com,1999:blog-4801771536792572559.post-83645716207863515732009-03-07T12:53:00.001-08:002009-03-07T12:58:44.501-08:00Crunch TimeIt's crunch time on my project. I finally have list of things to finish and also did a pretty good job of estimating each task. Entering this into <a href="http://www.fogcreek.com/FogBugz/">fogbugz</a> gives me a launch date of Marth 14th.<div><br /></div><div>I'm working hard to get this done.</div><div><br /></div><div>I expect just to have the site up and running to see if any interest is out there. It's not perfect and their is plenty of parts that I would like to make better, but 've spent a lot longer than I wanted to on this project so far.</div><div><br /></div><div>Particularly, the UI is going to need some improvement, but I'm hoping it will do for now.</div><div><br /></div><div>See you on the other side!</div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-15620799547952573772009-02-25T16:46:00.001-08:002009-03-07T13:00:32.740-08:00Lost Developer TimeI started adopting NHibernate on my current .NET project. In other words I've outgrown Linq-to-Sql.<div><br /></div><div>I have been crawling through many blogs looking for a little advice on testing nhibernate mappings and implementing the Repository pattern etc, and it dawned upon me:</div><div><br /></div><div><b>All the helpful blog posts and articles about NHibernate were written between 2005 and 2007. </b></div><div><br /></div><div>Am I really that late to the game? The answer is of course, YES!</div><div><br /></div><div>I took a brief look at NHibernate back in early 2006 but and I intentionally avoided it at all costs. Please understand: I used to work at a job where the only priority was is getting done fast (at the expense of quality). Being under constant pressure to finish projects fast, I naturally fell to using tools that supported this type of programming. The two things Microsoft has are Linq-to-Sql and Webforms.</div><div><br /></div><div>These tools appear to make it life bearable,but over time you pay for it in the long run. You end up making crap code but launching it anyway, then having to deal with it while it runs in production.</div><div><br /></div><div>Things are different now. I'm my own boss and I make all the rules. So, I declare the number one priority is quality.</div><div><br /></div><div>I feel like this part of my development career is behind me and I'll try to avoid ever working under conditions where quality is ignored in such extreme ways.</div><div><br /></div><div>I'm very curious to see how long I stay developing in Visual Studio Land. Although, my recent use of Resharper and NHibernate might change this attitude.</div><div><br /></div><div>NOTE: I revised this post on 2/26/2009 at 1:33pm</div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-5304954295047406782009-02-24T18:01:00.000-08:002009-02-24T18:14:08.449-08:00I actually like Safari's font rendering over the "Windows Standard"I downloaded Safari 4 Beta today. It looks like a native windows app to the point where they even changed the font rendering to use the windows style by default. I guess a lot of people complained.<div><br /></div><div>I actually like the OSX style font rendering. Here is a comparison:</div><div><br /></div><div>With OSX font style:</div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggBujS6UIS1BprQ8oLhzkJ-CzIp78ETiHDOoYnTwcIxuvEhfAvUEnxHnCiYKbsy0svWBfbkyquwuG8tTMGi_dtHrscM6PhMUvQ13oxvGnvrsCZsLiXutuzXUHeqOVH6OiZgaqFJDgrT8L4/s1600-h/Capture.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggBujS6UIS1BprQ8oLhzkJ-CzIp78ETiHDOoYnTwcIxuvEhfAvUEnxHnCiYKbsy0svWBfbkyquwuG8tTMGi_dtHrscM6PhMUvQ13oxvGnvrsCZsLiXutuzXUHeqOVH6OiZgaqFJDgrT8L4/s400/Capture.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5306550693611142482" style="cursor: pointer; width: 271px; height: 29px; " /></a></div><div><br /></div><div>With Windows Standard font style:</div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixrAxovAln9TcYggxyf-pS4wRZPsmIzHJvLeaZQAdxPyJ35vF1V56iNvkYhIOM7O_8UAfspOkpqtkuRbR-NzOCk5BBWsLt0-4LsuA0HwjLGtmnmgqBNeRlxPqCEusQDQow9ImYCodDsCBo/s1600-h/Capture1.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixrAxovAln9TcYggxyf-pS4wRZPsmIzHJvLeaZQAdxPyJ35vF1V56iNvkYhIOM7O_8UAfspOkpqtkuRbR-NzOCk5BBWsLt0-4LsuA0HwjLGtmnmgqBNeRlxPqCEusQDQow9ImYCodDsCBo/s400/Capture1.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5306550699057381442" style="cursor: pointer; width: 261px; height: 34px; " /></a></div><div><br /></div><div>I guess Apple is trying to make the windows users happy, but I still don't understand why everyone objected to the "nicer" fonts.</div><div><br /></div><div>At least it is a configurable option:</div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiIipuG8VF20YqxKB9m0_iGyFGUAJKxeH5J_foNm2yIQQO61DrJxNVdt1q2vyCiKBeD_e687S1fjWn-ku8pbQQcVSey288jqetVFPJ1OZxTHF6DCeQXEkzfT09sUOlBcHVgTx0-PbwY4MA/s1600-h/Capture4.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiIipuG8VF20YqxKB9m0_iGyFGUAJKxeH5J_foNm2yIQQO61DrJxNVdt1q2vyCiKBeD_e687S1fjWn-ku8pbQQcVSey288jqetVFPJ1OZxTHF6DCeQXEkzfT09sUOlBcHVgTx0-PbwY4MA/s400/Capture4.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5306552266275081074" style="cursor: pointer; width: 400px; height: 258px; " /></a></div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-66659529907706067902009-02-19T22:34:00.000-08:002009-02-19T23:00:15.119-08:00Thoughts on the SOLID and some goals<div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span class="Apple-style-span" style="font-size:small;">Wow, there has now been four podcasts regarding the SOLID principles and I enjoyed listening to them all. It was especially fun to here all the controversey. I was pleasantly surprised to here </span><a href="http://blog.objectmentor.com/articles/category/uncle-bobs-blatherings"><span class="Apple-style-span" style="font-size:small;">Uncle Bob</span></a><span class="Apple-style-span" style="font-size:small;"> was back on </span><a href="http://www.hanselman.com/blog/HanselminutesPodcast150UncleBobMartinThisTimeWithFeeling.aspx"><span class="Apple-style-span" style="font-size:small;">Hanselminutes</span></a><span class="Apple-style-span" style="font-size:small;">.</span></span></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="font-size:small;">Here is what I personally took away from the SOLID princples:</span></span><span class="Apple-style-span" style="font-size:small;"><br /></span></div><div><ul><li><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="font-size:small;">SOLID principles are all about decoupling your code. </span></span><span class="Apple-style-span" style="font-size:small;"><br /></span></li><li><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="font-size:small;">Decoupling your code helps you write good unit tests. </span></span><span class="Apple-style-span" style="font-size:small;"><br /></span></li><li><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="font-size:small;">Unit tests and (if you're up to it, TDD) are great ways to have quality software. </span></span></li></ul></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="font-size:small;">All this has me thinking a lot about the quality of my code. (ie. testability, how decoupled it is etc) </span><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size:small;"> I'm am now trying to use the SOLID principles as a guideline to help me write better code.</span></span></span></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="font-size:small;">This has been very enlightening and has pretty much changed the way I picture what good code should be. </span></span><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span class="Apple-style-span" style="font-size:small;"> </span></span></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span class="Apple-style-span" style="font-size:small;">Uncle Bob posted a </span><a href="http://blog.objectmentor.com/articles/2009/02/12/getting-a-solid-start"><span class="Apple-style-span" style="font-size:small;">Getting Started post</span></a><span class="Apple-style-span" style="font-size:small;"> on his blog. So here are my goals:</span></span></div><div><ul><li><span class="Apple-style-span" style="font-size:small;">Focus on when I should be using SOLID in my own code.</span></li><li><span class="Apple-style-span" style="font-size:small;">Trying to make it up to Portland, OR for a PADNUG meeting</span></li><li><span class="Apple-style-span" style="font-size:small;">Practice, practice, practice and make a lot of mistakes.</span></li></ul></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><span class="Apple-style-span" style="font-size:small;">I also am starting to read some of Robert Martin's books. I started with Clean Code, I hope to talk more about this topic later on.</span></span></div><div><span class="Apple-style-span" style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;font-family:'segoe ui';font-size:13px;"><br /></span></div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-63026644210902878192009-02-18T17:45:00.001-08:002009-02-18T18:10:09.657-08:00How to follow high traffic twitter conversations<div>I have tried to follow a few high traffic twitterers and quickly had to stop. I'm talking about people like <a href="http://twitter.com/codinghorror">@codinghorror</a>, that update every five minutes. Follow a few of these and your twitter page becomes overrun pretty quick.<br /></div><div><br /></div><div>To follow people like this, I subscribe to their updates via RSS feed, and view them in Google Reader. <br /></div><br /><div><div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgipRpgSP5o7xxHEQuhWBQFDlHYllGfwglZo7KREW3rjudnCGQg5cGeogM7SINyHoRT2mTTb6VzLa-piF2AjMUU4-Nh9EgBOKTSOA9SFHH9w-1t3yuLVeORuFVfzjTNMhdBFpBlJ730TGcy/s1600-h/Capture1.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgipRpgSP5o7xxHEQuhWBQFDlHYllGfwglZo7KREW3rjudnCGQg5cGeogM7SINyHoRT2mTTb6VzLa-piF2AjMUU4-Nh9EgBOKTSOA9SFHH9w-1t3yuLVeORuFVfzjTNMhdBFpBlJ730TGcy/s400/Capture1.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5304324060056152258" style="cursor: pointer; width: 400px; height: 301px; " /></a><br /></div><br /></div><div><br /></div><div>This works OK, but it's a little awkward to follow conversations. I found a tip today from <a href="http://twitter.com/shanselman">@shanselman</a> that fixed this!</div><div><br /></div><div>To follow <a href="http://twitter.com/codinghorror">@codinghorror</a>'s conversation, use <a href="http://search.twitter.com">search.twitter.com</a> and search for their nickname, and subscribe to that page!</div><div><br /></div><div>For example:</div><div><a href="http://search.twitter.com/search?q=codinghorror">http://search.twitter.com/search?q=codinghorror</a></div><div><br /></div><div>and you can subscribe to this RSS</div><div><a href="http://search.twitter.com/search.atom?q=codinghorror">http://search.twitter.com/search.atom?q=codinghorror</a><br /></div><div> </div><div><br /></div><div>Now my Google Reader has a exact conversation stream. It works perfectly!!<br /><div><br /></div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYZ5Rv83ujYyNcpNq4obW9_FSKUfKNCJg44fdQi76obgIh3TO9jnuAUYEvbhCRlW_O3KxxqMLyrURpjYv2kTEncJs5qUB2EvrCGGY7hgJgEVmWVgxxtxsM66sNOFAuTGWx12A5nxFV1sde/s1600-h/Capture2.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYZ5Rv83ujYyNcpNq4obW9_FSKUfKNCJg44fdQi76obgIh3TO9jnuAUYEvbhCRlW_O3KxxqMLyrURpjYv2kTEncJs5qUB2EvrCGGY7hgJgEVmWVgxxtxsM66sNOFAuTGWx12A5nxFV1sde/s400/Capture2.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5304323817685474514" style="cursor: pointer; width: 400px; height: 267px; " /></a><br /></div></div></div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-8284830156323002432009-02-15T15:30:00.000-08:002009-02-15T16:17:34.821-08:00.NET Developer Stereo Types<div>If I told a non-windows developer that I'm a .NET developer, I'm pretty sure they would label me as <a href="http://www.codinghorror.com/blog/archives/001004.html">"Mort programmer"</a> , even though they have no clue who Mort is. </div><div><br /></div><div>This disturbs me greatly. How can I tell people I'm a .NET developer and not be ashamed for saying so? </div><div><br /></div><div>I can't just say, "Hey, I'm a .NET developer, but don't worry, I'm an Einstein, so please don't think I'm a Mort." They wouldn't know what I was talking about? <span class="Apple-style-span" style="font-style: italic;">(Most likely they would think I was some kind of pompous ass) </span></div><div><br /></div><div>It doesn't help that I don't personally know any .NET programmers. The programmers I do know are all non-windows developers.</div><div><br /></div><div>I also agree with a lot of Alt.Netters that many of Microsoft's tools promtote bad software design. (Specifically, code that is not testable and hard to refactor. )</div><div><br /></div><div>I guess I can start adopting better tools (like NHibernate and MVC framework), but this apparent stigma of being a .NET developer has pushed me to start seriously thinking about my choice to continue being a .NET developer.</div><div><br /></div><div>I used to develop a lot of line-of-business apps and this is why I moved to .NET 3 years ago. Over that past year, I have spent more time building public facing websites than anything else, and I'm not sure that ASP.NET is ideal tool for this.</div><div><br /></div><div>Before doing anything rash, I'm trying to reach out to other .NET developers and get some perspective. But in the mean time, I can't stop thinking that going back to my open source roots is looking more attractive.</div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com1tag:blogger.com,1999:blog-4801771536792572559.post-51273416340479412192009-02-13T14:15:00.000-08:002009-02-13T14:33:34.857-08:00Stackoverflow and SOLID PrinciplesI'm still shocked at how the entire Robert Martin (aka Uncle Bob) fiasco has turned out on the <a href="http://blog.stackoverflow.com/category/podcasts/">stackoverflow podcast</a>.<br /><br />And, I'm not sure this <a href="http://blog.stackoverflow.com/2009/02/podcast-41/">episode #41</a> has changed anything.<br /><br />I've been programming for 6 years. With each new project I work on, <span class="Apple-style-span" style="font-weight: bold;">I strive to improve my code just a little bit more than the previous project.</span><br /><br />I'm not saying that I only write code that follows things like the SOLID principles. I'm saying that do try to think about ideas like this (and many other ideas) while I write my code.<br /><br />Maybe I heard it incorrectly, but both Joel Spolsky and Jeff Atwood still seemed to think the SOLID principles were a waste of time.<br /><br />I think this was more confusing than helpful to the programming community.<br /><br /><span class="Apple-style-span" style="font-weight: bold;">The idea that there is a set of engineering principles that I can incorporate into my code is invaluable to me</span>.<br /><div><br />Everyone that listened to the stackoverflow <a href="http://blog.stackoverflow.com/2009/01/podcast-38/">podcast #38</a> and <a href="http://blog.stackoverflow.com/2009/02/podcast-41/">#41</a> should at least listen to the <a href="http://www.hanselminutes.com/default.aspx?showID=163">hanselminutes episode with Bob Martin</a>, and go read about the <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">SOLID principles</a>, and then just think about them next time you write some code.</div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-72179552040088407202009-02-10T02:58:00.001-08:002009-02-12T19:34:37.437-08:00Comparison<T> and IComparable<T> vs LINQ<h4>Sorting Before LINQ:</h4> <ul> <li>Implement IComparable<T> so you can use the default sort.</li> <li>Add a few Comparision<T> delegates so I could sort other ways</li> </ul> <pre><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> DrawDown : IComparable<T> : IComparable<T><br />{<br /><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> Comparison<DrawDown> DateComparison = <span style="color:#0000ff;">delegate</span>(DrawDown field1, DrawDown field2) { }<br /><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> Comparison<DrawDown> ValueComparison = <span style="color:#0000ff;">delegate</span>(DrawDown field1, DrawDown field2) { }<br /><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> CompareTo(DrawDown other) {}<br />} </pre><p>And sort like this:</p><pre>var list = <span style="color:#0000ff;">new</span> List<DrawDown>();<br />list.Sort();<br /><span style="color:#008000;">//or </span><br />list.Sort(DrawDown.DateComparison); </pre><h4>Sorting with LINQ:</h4><pre>var list = <span style="color:#0000ff;">new</span> List<DrawDown>();<br />list.OrderBy(d=>d.Date);<br /><span style="color:#008000;">//or</span><br />list.OrderBy(d=>d.Value);</pre><p><strong>Basically, I use LINQ more then anything else in the .NET framework.</strong> It really does save hours of writing boring “sort” code.</p><p><br /></p><p>NOTE: I am working on getting better syntax highlighting in my blog. Live Writer is not working out at all.</p>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-21598246397287127942009-02-04T00:33:00.001-08:002009-02-12T19:34:58.009-08:00Char to Int vs String to Int<p>I spent way to much time staring at this code trying to figure this out:</p> <pre><span style="color:#0000ff;">int</span> number = 10;<br /><span style="color:#0000ff;">int</span> firstDigit = Convert.ToInt32(number.ToString()[0]);<br />Assert.AreEqual(1,firstDigit) <span style="color:#008000;">//fails: firstDigit == 49</span></pre><p><span style="color:#008000;"><span style="color:#000000;">I knew it was returning the Unicode value of 1, which is 49, but I was after the integer value. <strong>Converting a char to an int always returns the Unicode value, not the integer value.</strong> Converting a string returns the expected result.</span></span></p><pre><span style="color:#0000ff;">int</span> number = 10;<br /><span style="color:#0000ff;">int</span> firstDigit = Convert.ToInt32(number.ToString()[0].ToString()); <span style="color:#008000;">//add an extra ToString()</span><br />Assert.AreEqual(1,firstDigit) <span style="color:#008000;">//passes </span></pre><p><span><span class="Apple-style-span" style="font-size: medium;">Nothing too exciting, but I was stumped for about 15 minutes trying to figure this out. I almost started looking for a </span><a href="http://irc.essex.ac.uk/www.iota-six.co.uk/c/g3_atoi_itoa_sprintf_sscanf.asp" target="_blank"><span class="Apple-style-span" style="font-size: medium;">atoi()</span></a><span class="Apple-style-span" style="font-size: medium;"> function. </span></span></p><br /><br /><p><span style="color:#008000;"><span style="color:#000000;"> </span></span></p>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-74518464130665855802009-01-27T15:43:00.001-08:002009-01-30T12:19:19.331-08:00ASP.NET Ajax vs jQuery.ajax<p>I love jQuery but ASP.NET Ajax has some great features for calling your own webservices. Using jQuery to call services is much simpler, and has less going on behind the scenes, but is harder to debug. ASP.NET Ajax is creating a leaky abstraction for you, and along with that you get intellisense, helpful erorrs, and full visual studio debugging capabilities.</p> <h4>Calling ASP.NET Webservice with jQuery:</h4> <pre>$.ajax({<br />type: "<span style="color:#8b0000;">POST</span>",<br />url: "<span style="color:#8b0000;">PortfolioService.asmx/AddBenchmarkToCart</span>",<br />data: '{portfolioId: "<span style="color:#8b0000;">'+portfolioId+'</span>", benchmarkId:"<span style="color:#8b0000;">' + benchmarkId+ '</span>", position:"<span style="color:#8b0000;">'+position+'</span>"}',<br />contentType: "<span style="color:#8b0000;">application/json; charset=utf-8</span>",<br />dataType: "<span style="color:#8b0000;">json</span>"});</pre><br /><br /><h5>Pros:</h5><ul> <li>Simple code: not a lot of behind the scenes magic</li> <li>Efficient: doesn’t load any extra javascript files </li></ul><h5>Cons:</h5><ul> <li>Hard to debug: it either works or it doesn’t, you get no useful error messages</li> <li>Six lines of code to copy/paste each time</li></ul><h4>Calling ASP.NET Webservice with ASP.NET Ajax:</h4><pre><span style="color:#0000ff;"><</span><span style="color:#c71585;">asp</span>:<span style="color:#800000;">ScriptManager</span> <span style="color:#ff0000;">ID</span>=<span style="color:#0000ff;">"ScriptManager1"</span> <span style="color:#ff0000;">runat</span>=<span style="color:#0000ff;">"server"</span> <span style="color:#0000ff;">></span><br /><span style="color:#0000ff;"><</span><span style="color:#800000;">Services</span><span style="color:#0000ff;">></span><br /><span style="color:#0000ff;"><</span><span style="color:#c71585;">asp</span>:<span style="color:#800000;">ServiceReference</span> <span style="color:#ff0000;">Path</span>=<span style="color:#0000ff;">"~/Portfolio/PortfolioService.asmx"</span> <span style="color:#ff0000;">InlineScript</span>=<span style="color:#0000ff;">"false"</span> <span style="color:#0000ff;">/></span><br /><span style="color:#0000ff;"></</span><span style="color:#800000;">Services</span><span style="color:#0000ff;">></span><br /><span style="color:#0000ff;"></</span><span style="color:#c71585;">asp</span>:<span style="color:#800000;">ScriptManager</span><span style="color:#0000ff;">></span></pre><pre>PortfolioService.AddBenchmarkToCart(portfolioId, benchmarkId, position);</pre><h5>Pros:</h5><ul> <li>Intellisense</li> <li>Useful Error Messages</li> <li>Fully functional visual studio debugging</li></ul><h5>Cons:</h5><ul> <li>Less efficient: includes a small proxy javascript file for your webservice (which the client must download). </li></ul><br /><p>For more information on this, <a href="http://www.asp.net/learn/ajax/tutorial-05-cs.aspx" target="_blank">see this nice tutorial over on the asp.net site.</a></p>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-59322964654531691482009-01-27T13:42:00.001-08:002009-01-27T13:59:34.938-08:00Javascript Class Definitions<p>Two ways to define a class in javascript. </p> <p>At first glance, I didn’t realize what was going on in the second example, but the code is just using JSON syntax to define the prototype. </p> <p><strong>The benefit of reading other people’s code is you always learn something new. </strong></p> <p>(I picked this up browsing through the <a href="http://jquery.com/" target="_blank">jQuery</a> source code.)</p> <p>I placed the <a href="http://blarggstar.com/Examples/Javascript/ClassDefinitionStyles.html" target="_blank">actual source code here so you can can see it in action</a>.</p> <h4>This is the way I always defined classes:</h4><pre> <span style="color: #0000ff">function</span> Person2(<span style="color: #0000ff">name</span>, age) {<br /> <span style="color: #0000ff">this</span>.<span style="color: #0000ff">name</span> = <span style="color: #0000ff">name</span>;<br /> <span style="color: #0000ff">this</span>.age = age;<br /> }<br /><br /> Person2.<span style="color: #0000ff">prototype</span>.HaveBirthday = <span style="color: #0000ff">function</span>() {<br /> <span style="color: #0000ff">this</span>.age++;<br /> }<br /><br /> Person2.<span style="color: #0000ff">prototype</span>.GreetWorld = <span style="color: #0000ff">function</span>() {<br /> <span style="color: #0000ff">return</span> "<span style="color: #8b0000">Hello World, my name is </span>" + <span style="color: #0000ff">this</span>.<span style="color: #0000ff">name</span> + "<span style="color: #8b0000"> and I am </span>" + <span style="color: #0000ff">this</span>.age + "<span style="color: #8b0000">years old</span>";<br /> }</pre><br /><h4>A shorthand way using JSON syntax:</h4><pre> Person.<span style="color: #0000ff">prototype</span> = {<br /> HaveBirthday: <span style="color: #0000ff">function</span>() {<br /> <span style="color: #0000ff">this</span>.age++;<br /> },<br /><br /> GreetWorld: <span style="color: #0000ff">function</span>() {<br /> <span style="color: #0000ff">return</span> "<span style="color: #8b0000">Hello World, my name is </span>" + <span style="color: #0000ff">this</span>.<span style="color: #0000ff">name</span> + "<span style="color: #8b0000"> and I am </span>" + <span style="color: #0000ff">this</span>.age + "<span style="color: #8b0000">years old</span>";<br /> }<br /> };</pre><br /><h4>This makes a lot more sense when you realize you can even do this:</h4><pre><span style="color: #0000ff">var</span> ben3 = { <br /> age: 29, <br /> <span style="color: #0000ff">name</span>: "<span style="color: #8b0000">Ben</span>", <br /> GreetWorld: <span style="color: #0000ff">function</span>() {<br /> <span style="color: #0000ff">return</span> "<span style="color: #8b0000">Hello World, my name is </span>" + <span style="color: #0000ff">this</span>.<span style="color: #0000ff">name</span> + "<span style="color: #8b0000"> and I am </span>" + <span style="color: #0000ff">this</span>.age + "<span style="color: #8b0000"> years old</span>"; }, <br /> HaveBirthday: <span style="color: #0000ff">function</span>() { <span style="color: #0000ff">this</span>.age++; } <br />};</pre><pre> </pre><pre><br /></pre> Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-77721188032465268782009-01-22T01:10:00.001-08:002009-01-22T01:16:36.802-08:00TDD and Private Methods: What an eye opener!<p>I’m continuing to practice TDD while creating a simple word search solver. I’m giving TDD a shot is because normally <strong>I don’t write testable code</strong> and find it difficult to create unit tests after getting so far into a project. <strong>This leads to little or no unit tests</strong>.</p> <p>In my short time trying TDD, I’ve realized a couple things about my coding style. Although my code always works (ie. it performs the task at hand), it is full of interdependencies. This creates an environment that is pretty much impossible to write unit tests for. Any tests that I do write only cover large parts of the system, but they are<strong> not testing small units of my code</strong>—so they do not provide much value.</p> <p><strong>By sticking to TDD I’ve been forced to change this style in a drastic way!</strong> </p> <p>Normally, this how my public facing code would look. The algorithm for SolveForWord would basically be hiding inside some private methods and fields of the PuzzleSolver class.</p> <blockquote> <pre>PuzzleSolver solver = <span style="color: rgb(0, 0, 255);">new</span> PuzzleSolver(wordSearchText);<br />PuzzleSolution solution = solver.SolveForWord(“dog”);</pre></blockquote>I could only test the method “SoveForWord”, which tells me nothing about how it was implemented.<p>With TDD, I did things much different. After a bit of “new thinking”, I created a PuzzleParser class that implements parsing and data manipulation, and left the PuzzleSolver class to perform only the solving algorithm. PuzzleSolver gets an instance to PuzzleParser in the constructor. Then I extracted an interface for PuzzleParser:</p><pre> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">interface</span> IPuzzleParser<br /> {<br /> <span style="color: rgb(0, 0, 255);">string</span> GetLetterFromCoordinate(<span style="color: rgb(0, 0, 255);">int</span> row, <span style="color: rgb(0, 0, 255);">int</span> col);<br /> <span style="color: rgb(0, 0, 255);">string</span> GetLettersFromCoordinate(<span style="color: rgb(0, 0, 255);">int</span> row, <span style="color: rgb(0, 0, 255);">int</span> col, ParseDirection direction);<br /> <span style="color: rgb(0, 0, 255);">int</span> MaxCol { <span style="color: rgb(0, 0, 255);">get</span>; <span style="color: rgb(0, 0, 255);">set</span>; }<br /> <span style="color: rgb(0, 0, 255);">int</span> MaxRow { <span style="color: rgb(0, 0, 255);">get</span>; <span style="color: rgb(0, 0, 255);">set</span>; }<br /> }</pre><br /><p>This is of course the <a href="http://martinfowler.com/articles/injection.html" target="_blank">DependencyInjection</a> pattern, and I finally get why this is so valuable! In this case, I can mock the parser in a test:</p><br /><br /><pre> MockRepository mock = <span style="color: rgb(0, 0, 255);">new</span> MockRepository();<br /><br /> IPuzzleParser parser = mock.StrictMock<IPuzzleParser>();<br /><br /> PuzzleSolver solver = <span style="color: rgb(0, 0, 255);">new</span> PuzzleSolver(parser);</pre><br /><br />So it's certainly baby steps in the right direction, but mabye I'm starting to see the light!Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-24208008553552348772009-01-19T00:20:00.000-08:002009-01-19T00:34:19.245-08:00My own personal version of a "Startup Company"I'm currently working for a startup company. I don't get paid and it's not going to make millions, so it's hard to be excited about the product. But, I'm the sole creator and it's actually pretty cool, so it's a love/hate relationship.<div><br /></div><div>Plus, their is always a chance that it will make a profit.</div><div><br /></div><div>Obviously, their is more to a startup then a good idea. Currently, I'm slaving away down-in-the-trenches, and this type of work is what is going to help this thing survive the first year. </div><div><br /></div><div>Since learning from mistakes is the best way to learn, I eagerly jumped at the opportunity be involved with this project. I'll either succeed or gain another lesson from a failed project.</div><div><br /></div><div>I'll post more about the product as soon as it's ready (more like as soon as I'm ready.)</div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-27149349596707645212009-01-18T02:36:00.001-08:002009-01-18T23:06:54.838-08:00Testing private methods<p>I am writing a <strike>crossword</strike> word search puzzle solver for the purpose of practicing Test Driven Development.  Yep, I am only writing code after first writing a test.  </p> <p>I started off with a very powerful method named SolveForWord:</p> <pre> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> PuzzleSolver<br /> {<br /> <span style="color: #0000ff">public</span> PuzzleSolution SolveForWord(<span style="color: #0000ff">string</span> word) <br /> }</pre><br /><br /><p>Almost instantly, I had the urge to start writing private methods to help parse the puzzle into a private data-structure.   But since I’m doing TDD, I had to think about how to continue.  Since I can’t test private methods, how do I write that code?  </p><br /><br /><p>To be honest what I did next was find out how other people do in this situation.  After a bit of googling, I decided to try <a href="http://www.codeproject.com/KB/cs/testnonpublicmembers.aspx">testing my private methods using reflection</a>.  Then it hit me.  My attempt to test private methods was “test friction” right?  The PuzzleSolver class shouldn’t be doing any parsing!  By experiencing this “test friction” I changed my design.  </p><br /><br /><pre> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> PuzzleParser<br /> {<br /> <span style="color: #0000ff">public</span> PuzzleParser(<span style="color: #0000ff">string</span> text)<br /> {<br /> }<br /> }</pre><br /><br /><p>PuzzleSolver will use PuzzleParser to perform parsing and not actually perform parsing itself. <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">Single Responsibility</a> in action!</p><br /><br /><pre><em>Note: I didn’t know how much code to include in my post, so I purposely left out most of it.</em></pre> Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com2tag:blogger.com,1999:blog-4801771536792572559.post-10217097767193045212009-01-18T02:00:00.001-08:002009-01-18T02:18:57.063-08:00Create Syntax Highlighted code in Blogger using Live Writer<div> <p>I found a <a href="http://download.live.com/writer">Windows Live Writer</a> <a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=Highlight4Writer">plugin</a> to do syntax highlighting of text.</p> <p>You can <a href="http://wlwplugins.com/how-to-manually-install-a-wlw-plugin.php">install plugins</a> by simply copying the dll to your plugin directory.</p> <p>Here is a test:</p> <pre> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> PuzzleSolver<br /> {<br /> <span style="color: #0000ff">private</span> <span style="color: #0000ff">string</span>[] rows;<br /><br /> <span style="color: #0000ff">public</span> PuzzleSolver(<span style="color: #0000ff">string</span>[] rows)<br /> {<br /> <span style="color: #0000ff">this</span>.rows = rows;<br /> }<br /><br /> <span style="color: #0000ff">public</span> PuzzleSolution SolveForWord(<span style="color: #0000ff">string</span> word)<br /> {<br /><br /><br /> } <br /> }</pre><br /><br /> <br /></div> Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-44922559780645229492009-01-17T02:17:00.000-08:002009-01-18T02:39:46.433-08:00Test Driven Development is design<span class="Apple-style-span" style="font-size:small;">In </span><a href="http://www.hanselminutes.com/default.aspx?showID=164"><span class="Apple-style-span" style="font-size:small;">Hanselminutes podcast #146</span></a><span class="Apple-style-span" style="font-size:small;">, Scott Bellware talked about Test Driven Development being design, which I already sort of knew, but what I got out of the show is how TDD can really make a difference in my coding practices.</span> <div><span class="Apple-style-span" style="font-size:small;"> <br /></span></div> <div><span class="Apple-style-span" style="font-size:small;">By practicing TDD, it's going to bring to light all sorts of "test friction". For example, the harder it is to setup tests, the harder TDD becomes. </span><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size:small;">The difficulty I have in setting up <strike>tests</strike> my objects is a big reason I don't even attempt to practice TDD. </span></span><span class="Apple-style-span" style="font-size:small;">Once I realized this, the idea that "test smell begets design smell begets code smell?" sort of made sense. </span><span class="Apple-style-span" style="font-weight: bold;"><span class="Apple-style-span" style="font-size:small;">I've got this horrible test smell staring me in the face and <u>now I really want to do something about it</u></span></span><span class="Apple-style-span" style="font-size:small;">.</span></div> <div><span class="Apple-style-span" style="font-size:small;"></span></div> <div><span class="Apple-style-span" style="font-size:small;">How can I reduce test setup friction? Is single responsibility (</span><a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod"><span class="Apple-style-span" style="font-size:small;">part of SOLID</span></a><span class="Apple-style-span" style="font-size:small;">) the answer? Will </span><a href="http://www.hanselminutes.com/default.aspx?showID=164"><span class="Apple-style-span" style="font-size:small;">Structure Map</span></a><span class="Apple-style-span" style="font-size:small;"> help?</span></div> <div><span class="Apple-style-span" style="font-size:small;"> <br /></span></div> <div>Scott Bellware finished the podcast with a suggestion to read the book <a href="http://www.amazon.com/Test-Driven-Development-Microsoft-NET-Professional/dp/0735619484/ref=sr_1_1?ie=UTF8&s=books&qid=1232186317&sr=1-1">TDD in Microsoft .NET by James Newkirk.</a> I actually already own the book and immediately pulled it off the shelf and am re-reading it. ( I read it 2 years ago before I even knew what unit testing was.)</div> <div> <br /></div> <div>I'm researching this topic heavily and will post more when I find some answers. <br /></div> <div> <br /></div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com2tag:blogger.com,1999:blog-4801771536792572559.post-56591920983436917052009-01-05T16:34:00.000-08:002009-01-08T01:39:48.459-08:00Vista Sidebar Gadgets are HTML pages!<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheUMwCx-teQbxVgzeXyS0ZLe8rWYb-RLo7dxIZv_eOkcgEVtvkKf3q0_gN2WomuAntSsT2gNaQe-YWge_vaPKEmYkD2tAmHYgp9z6priLkl4KGizVHSlVRlPTzvLo9_QcyqcrxjEgfXKLB/s1600-h/Capture5.JPG"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 143px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheUMwCx-teQbxVgzeXyS0ZLe8rWYb-RLo7dxIZv_eOkcgEVtvkKf3q0_gN2WomuAntSsT2gNaQe-YWge_vaPKEmYkD2tAmHYgp9z6priLkl4KGizVHSlVRlPTzvLo9_QcyqcrxjEgfXKLB/s320/Capture5.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5288855201627595954" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEjt2AdiFmOPA5u8yvImQ6eEbAZUhKxLIqP_VqrJ6_UWgIRejvUr3Q4IG2yrcm_OxsvCdLwNJpVMSIuF4o5dmXjPxOiIxrGG06wkxYycb20HriV5ORibP2aY2uFYLcloe4aO7226DGlYTg/s1600-h/Capture.JPG"><br /></a><br />Yep, you heard me right, the vista sidebar gadgets are tiny html pages with images and JScript (aka javascript). <div><br /></div><div>Even the clock app is a simple background image with two clock hands as images.</div><div><br /></div><div>They do have a gadget API which can <a href="http://msdn.microsoft.com/en-us/library/aa359321(VS.85).aspx">rotate images.</a> This is how they achieve the nice animation on the clock, for example.</div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div>You can browse the source code for every gadget that comes with Vista by going here:</div><div><br /></div><div>C:\Program Files\Windows Sidebar\Gadgets\</div><div><br /></div><div> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgshWdXRCUJ5upNpuMgKkA8b6qNUELmIqTIm5AvGniplRJQWioVBA5khj0OM4jKE9aUYEDIqsLrtNbA8edmfdwKxE_PT_oT5LMaomOe-KVt6RvcfT8rcSKuL3Bl6xudfeUq3UZd9Fn1QUzF/s1600-h/Capture.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgshWdXRCUJ5upNpuMgKkA8b6qNUELmIqTIm5AvGniplRJQWioVBA5khj0OM4jKE9aUYEDIqsLrtNbA8edmfdwKxE_PT_oT5LMaomOe-KVt6RvcfT8rcSKuL3Bl6xudfeUq3UZd9Fn1QUzF/s400/Capture.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5287974752795238594" style="cursor: pointer; width: 400px; height: 317px; " /></a><div><br /></div></div><div><br /></div><div>I was amazed when I found this out! For some reason I assumed they were fancy WPF apps.</div><div><br /></div><div>If you're interested you can read more on <a href="http://msdn.microsoft.com/en-us/library/aa965850(VS.85).aspx">msdn</a>.</div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-71855494361615744542009-01-05T16:11:00.000-08:002009-01-05T22:38:32.678-08:00Vista Sleep Issues Solved<div style="text-align: center;"><br /></div><br /><div style="text-align: center;"><br /></div>I finally found outhow to troubleshoot Vista sleep issues. Specifically, how to tell what woke the computer.<div><div><br /></div><div>By using "powercfg lastwake" on the command prompt, I could at least tell that it was a USB device.<br /></div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfM-EXFrI9DEP0AxNMgLrGC9LZgQ_X1LrrwwBEIfoJYTRO9uFmnde3b53LNySqy2I6ywvK_ChBq1oMSAFZ9kmPZ2z9XcHbeAFVizBnZN7fAVdaWsyG_S_EOHEGqezFewvujUT9_qy0thLX/s400/Capture.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5287971564687893698" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 198px; " /><div><div><br /></div><div>A little peeking into Device Manager and I noticed both my mouse and keyboard were allowed to wake the PC. (Normally this is probably a good thing.) I simply disabled that feature and my problem is fixed.</div><div><div style="text-align: center;"><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbXmd8IG7emnZ8ozJEvlVVSXp1bnmSWmukhXmUzv9BWbZrcSrq4HoehyphenhyphenaMCMJHXDnD1ZV_ijYnPr4ldy1kRLnE5F5u1aoAelSnZNYwZ11_TxjMDyGjkUkKtrgYM-asTvo9Ftv24wmTHHac/s1600-h/Capture.JPG"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbXmd8IG7emnZ8ozJEvlVVSXp1bnmSWmukhXmUzv9BWbZrcSrq4HoehyphenhyphenaMCMJHXDnD1ZV_ijYnPr4ldy1kRLnE5F5u1aoAelSnZNYwZ11_TxjMDyGjkUkKtrgYM-asTvo9Ftv24wmTHHac/s400/Capture.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5287967582065201058" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 292px; " /></a></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><span class="Apple-style-span" style="color: rgb(0, 0, 238); text-decoration: underline;"><br /></span></div><div><a href="http://www.vistax64.com/tutorials/63567-power-options-sleep-mode-problems.html">Big thanks to the people over on vistax64 where I found my solution</a></div><div><br /></div><div><br /></div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0);"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga38rARapOItVx_0HO0NLaQI9YnS8Va8cCuadl5Cu8lE3cj74cB0MFusxy_mcjM_ZQAVURYvvujNKM3L3EBQFcI0rJUVRZtZrtBdh3TQarh4N08EAqRpEfL40UMF_PneIsvtaFPM74zReP/s1600-h/Capture.JPG" style="text-decoration: none;"><br /></a><div style="text-align: center;"><span class="Apple-style-span" style="text-decoration: underline;"><br /></span></div></span></div><div><br /></div></div></div>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0tag:blogger.com,1999:blog-4801771536792572559.post-86138300921683765272008-12-10T03:17:00.000-08:002009-02-10T03:21:51.172-08:00Testing Syntax HighlighterI installed syntax highlighter:<br /><br /><pre name="code" class="c-sharp"><br /><br />public class Person<br />{<br /> public string Name { get; set; }<br />}<br /><br /></pre>Benhttp://www.blogger.com/profile/12809201725269923209noreply@blogger.com0