tag:blogger.com,1999:blog-70806222024-03-10T13:46:16.904+11:00Daily Dribblings of a Demented DeveloperA software developer who noticed one day that all software developers were active bloggers, and was wondering if he was missing out on something......Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.comBlogger155125tag:blogger.com,1999:blog-7080622.post-3564751906237558212012-10-10T20:01:00.001+11:002012-10-15T11:29:51.652+11:00Getting the correct versions of .Net Framework for WinDbgTo debug a minidump of a .Net application created by Windows Error Reporting, it is essential that you have the correct version of the following 3 dll's<br />
<span style="font-family: Courier New;">sos.dll</span><br />
<span style="font-family: Courier New;">mscorwks.dll</span><br />
<span style="font-family: Courier New;">mscordacwks.dll</span><br />
The correct version being the version of the .Net framework that the user was running at the time the minidump was generated. For example, if the minidump was created using the framework 2.0.50727.4971, then you need the 2.0.50727.4971 version of the dll's mentioned above to debug this. Chances are this is NOT the version you currently have on your machine, it may not even be a valid version for your OS (XP, Vista, 7, 8) or architecture (x86, x64). As far as I'm aware, there is no central repository where you can go an grab the correct version of these libraries from, so one has to attempt to find them the hard way.<br />
The .Net framework is initially deployed with our application, however, it is regularly updated, once installed, by Windows Update, to ensure that security vulnerabilities and major defects are patched. If your application is only installed on a single server (or server farm), this is not really a challenge, however, if your application is installed as a desktop application on nearly quater of a million PC's world wide, finding the correct version of the framework requires some sleuthing skills, and a bit of luck. The first step is to try and find the Microsoft support knowledge base article that describes the update. To do this I've found the following query typed into google, usually gets the result you want.<br />
<br />
<em>.Net framework 2.0.50727.4971 site:support.microsoft.com</em><br />
<br />
It is usually the first hit, but it may be further down. Validate this by searching the resulting page (Ctrl+F) for the framework version (e.g. 2.0.50727.4971) and make sure SOS.dll one of the binaries with this version number.<br />
<a href="http://lh5.ggpht.com/-2HAN2wDiHzo/UHU5YpEpnAI/AAAAAAAAAM4/7Z1nHu-Q694/s1600-h/clip_image001%25255B3%25255D.png"><img alt="clip_image001" border="0" height="42" src="http://lh5.ggpht.com/-MwHLxJ2e-Zk/UHU5Z830oQI/AAAAAAAAANA/HRHcmBGD7Bc/clip_image001_thumb.png?imgmax=800" style="background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image001" width="244" /></a><br />
Go to the download information section of this website and click on the provided link. This should take you to the Download Center page where you should see the following options<br />
<a href="http://lh4.ggpht.com/-ef5mOgZYEDc/UHU5bEce8qI/AAAAAAAAANI/lw9rqZBUHN8/s1600-h/clip_image002%25255B3%25255D.png"><img alt="clip_image002" border="0" height="82" src="http://lh6.ggpht.com/-U3T47CcBRD0/UHU5ceunzzI/AAAAAAAAANM/z1aNUsQG2EI/clip_image002_thumb.png?imgmax=800" style="background-image: none; border: 0px currentColor; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="clip_image002" width="244" /></a><br />
Click to download the architecture you require. This will download the .msu file for the update. You can use the command-line Expand utility to extract the files in this update package.<br />
<span style="font-family: Courier New;">expand.exe -D .\Windows6.1-KB2604114-x86.msu</span><br />
Will list all the files in the package, in this case there are 4, <br />
<span style="font-family: Courier New;">.\windows6.1-kb2604114-x86.msu: WSUSSCAN.cab</span><br />
<span style="font-family: Courier New;">.\windows6.1-kb2604114-x86.msu: Windows6.1-KB2604114-x86.cab</span><br />
<span style="font-family: Courier New;">.\windows6.1-kb2604114-x86.msu: Windows6.1-KB2604114-x86-pkgProperties.txt</span><br />
<span style="font-family: Courier New;">.\windows6.1-kb2604114-x86.msu: Windows6.1-KB2604114-x86.xml</span><br />
You want to extract the Windows6.1-KB2604114-x86.cab file to do this use<br />
<span style="font-family: Courier New;">expand.exe -F:Windows6.1-KB2604114-x86.cab .\Windows6.1-KB2604114-x86.msu .\</span><br />
You can then use expand.exe to interrogate and extract the contents of this .cab file. <br />
To extract the files you want use<br />
<span style="font-family: Courier New;">expand.exe -F:sos.dll .\Windows6.1-KB2604114-x86.cab .\</span><br />
<span style="font-family: Courier New;">expand.exe -F:mscorwks.dll .\Windows6.1-KB2604114-x86.cab .\</span><br />
<span style="font-family: Courier New;">expand.exe -F:mscordacwks.dll .\Windows6.1-KB2604114-x86.cab .\</span><br />
Each of these statements will usually result in 2 folders named something like the following <br />
<span style="font-family: Courier New;">x86_netfx-sos_dll_b03f5f7f11d50a3a_6.1.7600.16992_none_e878512ab7239f09</span><br />
You'll need to check both dll's and make sure you get the version you are after.<br />
Simply copy these into a common folder, and you can then use the following windbg commands to set the exepath and load the correct sos.dll<br />
<span style="font-family: Courier New;">.exepath+ C:\MyFrameworkFolder\fwx86_2.0.50727.4927</span><br />
<span style="font-family: Courier New;">.load C:\MyFrameworkFolder\fwx86_2.0.50727.4927\sos.dll</span><br />
Happy debugging.Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com4tag:blogger.com,1999:blog-7080622.post-87392830320339091802012-09-17T13:47:00.001+10:002012-09-17T13:47:48.095+10:00Telstra’s Transparent Proxying<p>I am finding Telstras Transparent proxying a nightmare at the moment. I am trying to configure a Windows Azure SQL DB instance I have set up on a trial account I got from TechEd. Azure SQL database security is tied to your IP address. You can click “Manage” from the portal window to add your current IP address to the firewall rules, but then thanks to Telstra’s transparent proxying, when you connect with SQL Server Management Studio, you get a different IP address, and consequently can’t access SQL Server.</p> <p>Anyone know of a solution to this, short of getting a fixed IP address and opening up the firewall to the world?</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com1tag:blogger.com,1999:blog-7080622.post-33869582594914027392012-09-07T09:45:00.001+10:002012-09-07T09:45:46.723+10:00Thoughts on Gina’s $2 a day comment<p>I think there is a point where the ruling class become so arrogant and full of their own self importance that the “plebs” see their only logical course of action is full scale revolution. I don’t think we’re there yet, and as history has taught us, revolutions rarely succeed in doing more than replacing the head on the coin, but with Gina Rinehart’s latest comments, I feel we have inched one step closer to it. Indeed there are people in West Africa who will work for $2 a day. Many West African nations are struggling economically, and desperate people will do desperate things. Perhaps the global economy does need some re-adjustment, and maybe just, the “invisible hand” of the market can do something to address the great injustices of the world, but for Gina Rinehart to make the inference that Australians need to take severe pay-cuts just because her precious mining business is in danger of slowing down, makes it clear just how detached from reality she has become. You can almost hear “let them eat cake”. It is not the responsibility of the working class to fund the ruling classes lifestyle. If you can’t make your business profitable while being ethical to your workers and paying them a liveable wage that takes into account cultural and social standards, then you don’t deserve to be running a business. Perhaps if Gina was to spend time in West Africa working for $2 a day, she may have a little more sympathy. Even if she was forced for a few months to exist on an Australian un-skilled labourers wage, she may get the picture.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com2tag:blogger.com,1999:blog-7080622.post-14982897154371810902011-11-13T17:35:00.001+11:002011-11-13T17:35:36.591+11:00The Slippery Slide<p>I was raised as a fundamentalist Christian. Until the age of about 25, I believed the following facts to be immutable.</p> <ol> <li>There is a metaphysical all knowing and perfect being who exists outside of time and space, who for want of a better name is called God.</li> <li>This God being, created the entire observable universe including a species of cognisant beings in his image who at some point in their "time based" existence started referring to themselves as homo sapiens. These beings were created with a mortal physical presence and an immortal soul.</li> <li>This God being, spoke to some of these cognisant beings throughout this time based history, that were deemed worthy to accurately record all of his various thoughts and actions over the course of a few thousand years. These writings were then collected by a committee of these cognisant beings around 300 ACE who were doing the will of this God being. This collection of works went by the name "The Holy Bible".</li> <li>This God being made up some elaborate rules for these cognisant beings to gain this Gods favour and be eligible to co-exist with this God being after there mortal physical presence had expired, in a really nice place. The alternative to this really nice place was a pretty horrible place, and those who didn't follow these elaborate rules would be sent there. These elaborate rules were spelled out in this Holy Bible book. Oh and</li> <li>This God being has a penis... (A freakin' huge one).</li> </ol> <p>I chose the word "fundamentalist" in my opening sentence very specifically. There is a quintessential difference between someone who believes</p> <ol> <li>The Bible is the written word of God and infallible, and someone who believes that</li> <li>The Bible is a book of collected works written by humans who were fallible, but had certain insights into the divine at a particular point in history.</li> </ol> <p>There are many aspects in which this distinction plays itself out. One we see commonly, is the biblical literalists insistence on attacking the scientific theory of evolution, and insisting, against all evidence to the contrary, that the earth is less than 10,000 years old. The reason Biblical literalists cannot, and will not accept that the creation story is anything more than a myth for the benefit of an illiterate desert tribe to take solace in, is because they argue that this denial in the literal truth of the opening chapter of the Bible creates a slippery slide that will hold the rest of the Bibles message to critique, and will ultimately invalidate (in their minds) the undeniable truth of the word of God. It has very little to do with the psuedo-science of intelligent design. People who fall into category b however, (those I would refer to as liberal Christians), see no problem with juxtaposing the creation myth as a beautiful and metaphorically elegant story of the supernatural origins of the universe against the scientific theory of evolution. I myself went through a phase of believing that the Bible wasn't meant to be a modern scientific dissertation, but rather in regards to the creation story was meant to provide sufficient information for people in a pre-scientific era to satisfy the ontological question, and move beyond this to more important aspects of how to live a good life. While I was still able to accept the rest of the dogmas of the particular brand of Christianity I was involved with at the time, this event marked my slow progression from fundamentalist Christian to liberal Christian, which eventually culminated in my current position of Atheism. But there was much more to this progression than simply taking the creation story metaphorically.</p> <p>I've spoken with a number of ex-fundamentalists. Some have, like me, gone to almost the polar opposite of atheism. Others have chosen the less extreme agnostic route. Some have found solace in some form of deism, while others prefer to hold to their theistic understanding of the world but chose a more liberal approach to their Christianity. Many of these people, however, will have some key thought, argument or idea that has eventually broken the continuum of the cyclic logic that is necessary to maintain a fundamentalist belief system. What I wish to do in this essay is to explain what that argument was for me, and how I was finally able to break out of the fundamentalist mind-set. Note to any fundamentalists who might be reading this essay, before you start formulating your killer cyclic argument that will in your mind destroy my "sole" objection to your fundamentalist belief, just be warned that this is not my "sole" objection, but merely the one that I deem responsible for enabling me to jettison my dogmatic and limited world view.</p> <p>Language</p> <p>Before I go on, I need to say something about language, and my understanding of it. I have always had an interest in languages. If you haven't figured out by now, English is my native language, and despite attempts at learning a few others, I have to concede that I am not yet bi-lingual, although it remains one of my life goals to become so. In high school I did a few years of Italian, not that I remember much of it now. I have had a number of attempts at learning Spanish, and it is currently the language I am most fluent in aside of English. I can actually hold decent conversations in Spanish, and understand a reasonable amount. I even attempted to learn Greek at one stage. Very early on in my investigation of the concepts of language, and the ways in which languages differ, I started to feel very overwhelmed with the way in which the language we speak, and the way in which we use language can shape our subjective experience and understanding of the world. This can be demonstrated using a very simple example such as the following.</p> <p>In English we would say</p> <p>"The red shirt"</p> <p>The equivalent Spanish translation would be</p> <p>"La camisa roja"</p> <p>Even in this very simple 3 word example we notice two very astounding things. Firstly the word ordering is different. In English we have the definite article "the" followed by the adjective "red" and finally the noun "shirt". In Spanish we have the definite article "la" followed immediately by the noun "camisa" and then finally the adjective "roja". The second and even more significant difference is that in Spanish nouns have a gender whereas in English they are gender neutral. The word for shirt in Spanish "camisa" ends in an "a" making this word feminine, and forcing the usage feminine definite article "la" instead of "el"(masculine) as well as the feminine form of the adjective for red "roja" instead of "rojo".</p> <p>These differences may seem small, and perhaps just an annoying little peculiarity if you are trying to learn a enough of Spanish so that you can order a meal at a restaurant when you go on holidays. However, if you look a little deeper, it raises all sorts of questions around how the world is viewed by the native speakers of these different languages, and how the language you use to think in shapes your subjective reality. The ordering of words is important to the emphasis we place on things, and concepts. Attributing a gender to nouns, or not changes your whole understanding of that concept, and forms different associations in the neural pathways of the brain. Admittedly, in the very simple example I give here, we a reasonably certain that we are talking about the same thing, but this is an extremely simplistic example. It doesn't take too long into trying to explain more detailed concepts that you very quickly see a difference in the ways in which people with different languages understand and perceive the world. This fact is demonstrated quite profoundly by <a href="http://www.youtube.com/watch?v=4b71rT9fU-I">recent scientific research</a> that shows how our concept of languages affects the colours we perceive and how well we perceive them.</p> <p>Spanish and English aren't even all that far apart in their linguistic origins. Extrapolate these differences between say Hindi or Mandarin and English, and the mind can only begin to imagine how differently these people must perceive the world and relate to it. Added to this, our language is constantly changing (I would normally use the word "evolving", but I didn't want to alienate any creationists that might be reading). Just reading a play by William Shakespeare will demonstrate just how much the English language has changed in the past 400 years. It has changed so much that learned Academics debate furiously about the meaning of certain words and phrases that subtly (or sometimes not so subtly) alter the understood meaning of the plays.</p> <p>The Holy Book</p> <p>This brings me to the main intent of this essay. The argument that caused me to break the cyclic logic of fundamentalism, and allowed me the freedom to intellectually assess the evidence for myself and more honestly strive for an understanding of the mysteries of life. Or as a fundamentalist Christian might put, the lie that the devil sold me to win my soul and take me to a hellish eternity.</p> <p>The bible is a collection of works with many different human authors over a period of a few thousand years. Or again if you’re a fundamentalist Christian, the Bible is a collection of works all authored by God but entrusted to a number of different humans over a period of a few thousand years. Regardless of your position on this, the defining argument for fundamentalists is that "The Bible is the written word of a perfect God and therefore infallible". OK, so let's break this down. I don't even want to get into the debate here about the inconsistencies and contradictions in the Bible which are <a href="http://www.infidels.org/library/modern/donald_morgan/inconsistencies.html">well documented</a>. I will instead assume that if you are a biblical literalist, then you will have arguments against these supposed "contradictions", or you are blissfully ignorant of them and don't care, in which case I'm surprised you've read this far. </p> <p>So from the definitions here, Firstly God is "perfect". This by definition, at least in my mind, means that God when communicating with say the angels or even just thinking aloud to himself, or creating the universe by his "word", would not use an imperfect human language to perform this act of divine communication. So God's native concept of "language" would be drastically different to anything any human actually speaks. OK then, but God wanted to communicate with us his created cognisant beings to explain his plan for our lives, and his elaborate rules for gaining salvation and entering into eternity in the nice place as opposed to the horrible place once our mortal bodies had stopped functioning. This would seem an important thing for such a God to want to do. He decides that the best way to do this is to reveal it to various people over a few thousand years in their native language. Right here is where I have my first problem. Translation is imperfect. It is notoriously easy to translate things incorrectly even between very similar human languages let alone between a perfect divine language and an imperfect human language. There is an old saying "The translator lies". So even in the original Ancient Hebrew, Ancient Aramaic and Ancient Greek that the collection of books we know as the bible was written in, there is one level of translation involved. To get to where we are today though, which is to say to a Bible written in our modern languages, involves at the least one more step of translation from one of these ancient languages which are no longer in normal every day use, and are now more for academic interest, into our modern language. The sheer amount of opportunity for inaccuracy in this step renders the task frightfully problematic. This is evidenced by the sheer number of different versions of the bible that are available in English alone, and the constant debates between different adherents of their favourite translations. At this point my belief that what we call the Bible has any claim to being "the written word of God" crumbled and shattered into pieces.</p> <p>One might be tempted to argue that even though their are different translations the underlying doctrinal beliefs that come from the Bible still hold true. In response, I would simply point to the number of different denominations and factions in the Christian church today. If God really thought it was that vital to have a core set of doctrines then he's doing an extremely rotten job of communicating it to modern humans.</p> <p>Life after Biblical Literalism</p> <p>This was the start of the slippery slide that made me question everything I ever believed about Christianity. It made me realise that the Bible should not be given special treatment and be elevated above the critique given to any other historical document. It gave me the freedom to stop taking everything in the Bible as literal truth and to be able to understand it as a collection of books written in a particular period of time for very specific purposes that the people in those times had a far better chance of understanding than I ever will, with my language and my subjective understanding of reality. That's not to say that I don’t still find parts of the bible unbelievably inspiring and enlightening. The elegance of Jesus' words "let he who is without sin cast the first stone" is amazingly poignant and very applicable to our lives today. The problem is, the Bible is statically locked in time and place, and as a consequence there are a great many things for which it does not and cannot speak. Biblical literalists try desperately to extrapolate, but in my opinion just end up causing pain both for there own adherents and for others who they try to inflict their out-dated ideas onto.</p> <p>One of the things that bothers me about my whole journey to this point, is why it took me so long. It wasn't until I was 25 that I really started to ask first-order questions about the faith I was raised with. The only conclusion I can come to is that the combination of the brainwashing working so well, and my own personal insecurities as a young adult caused me to want to keep believing it for so long.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com3tag:blogger.com,1999:blog-7080622.post-16524329169515552262011-11-12T12:09:00.001+11:002011-11-12T12:09:06.283+11:00.Net Performance and Scalability Tuning Tip #2<h3>The Database Bottleneck</h3> <p>Why is my database so flaming slow?</p> <p>Have you heard this before? I have. I’ve also heard it as a good reason not to use relational databases. There are a number of reasons why a particular database could be slow, but lets take a step back and try to understand what a relational database is actually trying to do. Relational databases are designed to be a mathematically structured, transactionally consistent and optimized way to store and retrieve large amounts of “relational” data. If you are not storing relational data, then don’t use a relational database, it is not optimized for your usage scenario. Problem solved… well, perhaps not. </p> <p>Let’s assume you are storing relational data, but the database still seems slow. Well, I could go in to detail about database tuning, but I’m not a DBA, and there are people out there who are far better at that than I. Also database tuning tends to get very vendor specific at its deepest levels. Besides, that’s not what I really want to focus on here. Maybe you could look at the performance of your Network, or the disks and other hardware your database server is running on, but again, I’m not network or hardware engineer, I’m a software engineer. So let’s fix it in software… or at least, to the best of our ability. I’m going to assume then that your database is well tuned and maintained by someone who is experienced in doing so, and knows all the different ways in your organization that this database is going to be used. Once we make these assumptions, then we can no longer say “the database is slow” I would go further and say that any modern database is actually very efficient for what it does. Still I have seen developers in this case trying to blame the database for the poor performance of the application.</p> <p>Most often the database resides on another box entirely to the one you’re application is running on. This is where the problem begins. To actually get data from a database you have to create a database connection, that then opens a network port, which then negotiates a conversation over a protocol, asks the database server for some data. The database engine then does some processing to find your requested data or perform your operation, and finally returns the results as data packets over the network back to your application. Now that mightn’t seem like much, but compared to grabbing that same data from your local memory, or even a file on your local disk, we are talking many orders of magnitude difference. Even if you are using a database engine on your local machine, it will almost certainly be running in a separate process which means that although you don’t have a physical network to navigate, you still have inter-process communications protocols to deal with, and this can still be a few orders of magnitude difference to getting the data directly from memory.</p> <p>The most important thing about developing against a database is to have respect for the overhead required when querying the database. Based on this respect we can establish a few basic rules about how to interact with a database.</p> <p>1. Don’t keep asking the database for the same thing over and over again. If it’s something you need regularly cache it. Caching comes with its own problems, the biggest of them being when to invalidate it, but the one thing you can be certain of is that it won’t be slow.</p> <p>2. Try to ask the database as few times as possible for information during any one operation. Ideally it would be great if you could simply have a single SQL statement that gets everything you need to perform the desired operation, and it is worth investing a few (thousand) CPU cycles trying to figure out exactly what data you are going to need for a particular operation before hitting the database. It is also usually better to return a little more data than you might need, than to find you have to hit the database again because you forgot something. Of course this can be taken too far, so be sensible here, you shouldn’t be returning your entire customer and products tables just to process a single order.</p> <p>3. Learn SQL, or your vendor specific implementation of it at least. Understand how to form the queries that get you the data you want, and take advantage of the well tuned database (assuming it’s well tuned). If you are using a tool that generates SQL for you, like LINQ2SQL or Entity Framework, understand how it generates SQL. These tools tend to produce sub-optimal SQL because they are trying to solve very generic problems, however, they can be coaxed into doing things more efficiently if you understand how they work.</p> <p>If you still think the database is slow, I would suggest doing some profiling of your application. SQL Server comes with a profiler that is more than adequate. Other database engines have their own profiling tools. The Redgate ANTS performance profiler I talked about in my previous post has a SQL profiler (warning it doesn’t work with SQL Express), that is integrated with the code performance analyser. Also just a hint if you’re using ANTS performance profiler, you need to look at the “Wall Clock” setting when you are analysing a piece of code that has a lot of SQL interaction as the CPU clock will give you a false impression.</p> <p>There are many other possible performance issues that can occur with databases, but this is all I really want to talk about at this stage. I have seen many projects in my time that have suffered because the 3 rules above have not been followed.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com1tag:blogger.com,1999:blog-7080622.post-90379664183239425882011-09-12T09:56:00.001+10:002011-09-12T10:14:54.255+10:00Travelling Again<p>I am currently travelling overseas, partly for work partly for pleasure… actually mostly for pleasure. As with other times, I find that travelling to foreign countries creates a lot to reflect on, and consequently write about. My first stop will be California. I am currently in a hotel in Los Angeles, on Monday I will be driving to Anaheim where I will be attending the Microsoft <a href="http://www.buildwindows.com/">Build Windows conference</a>, then I am planning to head to Santa Barbra for a bit of R & R. After that I will be visiting Buenos Aires. I will use this my <a href="http://scottbaldwin.blogspot.com/">personal blog</a> as essentially a travel diary, but my <a href="http://sjbdeveloper.blogspot.com/">geek blog</a> as a means of recording my thoughts on the conference.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-78609953844197725562011-09-11T10:33:00.001+10:002011-09-11T10:33:31.986+10:00Microsoft doesn’t care about feedback from Australians<p>I’m attending the <a href="http://www.buildwindows.com/">Build Windows 2011</a> Conference in Anaheim this coming week, and as part of this Microsoft sent me out an email (presumably to all attendees, or at least all who indicated that they were a developer) inviting them to share feedback in special limited numbers discussion groups. Firstly though, they require you to fill out a quick survey. So I click on the provided link, and I’m presented with the following question.</p> <p><a href="http://lh5.ggpht.com/-XMPrvjhdBXM/TmwB06ipuaI/AAAAAAAAAHE/wa75L6Ed9ZI/s1600-h/image%25255B2%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-vmOZO9mfpCM/TmwB2X5PJTI/AAAAAAAAAHI/Qk0a0c-TuoE/image_thumb.png?imgmax=800" width="244" height="237" /></a></p> <p>OK, fine, I’m not too proud to be lumped in with “the rest of the world” team, so I click “Somewhere Else”, then “Next”. I am then presented with this</p> <p><b>Thank you for your interest in our survey. Those are all the questions we have today. We hope that you will consider participating in future surveys.</b></p> <p>OK, so basically, if you are not from any of these 8 countries, then your opinion is completely irrelevant to Microsoft. Regardless of the fact that you are the technical architect for Windows/PC version of a product that has over 400,000 user licenses world wide. Regardless of the fact that you are fostering a product that is responsible for direct license sales of SQL Server 2008 R2. The message is loud and clear, if you’re not in Microsoft’s G8, then your opinion is worthless. I wonder if our Mac Technical Architect (when he is eventually appointed) will get the same kind of treatment from Apple?</p> <p>Really, the least they could have done is to let me continue with the survey, and then disregard the information anyway, I mean it really doesn’t hurt to store a few extra bytes.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com8tag:blogger.com,1999:blog-7080622.post-88314266667687941992011-09-02T11:51:00.001+10:002011-09-02T11:51:35.236+10:00Today’s Random Grumble<p>I absolutely love OneNote, and use it all the time, but there are some things that really infuriate me at times… I mean how difficult is it really to get url parsing and highlighting working properly?</p> <p><a href="http://lh4.ggpht.com/-CV50UbvO7Lo/TmA2osk15RI/AAAAAAAAAG0/CPibgCSFqxE/s1600-h/image%25255B12%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-O97pt8ljNn0/TmA2pYHiuEI/AAAAAAAAAG4/M5N01Y-gOZY/image_thumb%25255B8%25255D.png?imgmax=800" width="411" height="36" /></a></p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com2tag:blogger.com,1999:blog-7080622.post-14485465084948295922011-08-20T16:45:00.001+10:002011-08-20T16:45:55.310+10:00.Net Performance and Scalability Tuning Tip #1<h2>Measure twice, cut as many times as you like.</h2> <p>As promised, I am starting a series of blog posts on .Net performance and scalability tuning. I have been doing this in my current role at <a href="http://www.qsrinternational.com/">QSR International</a>, and have been amazed at just how many possibilities I have found to improve the performance of the application. Each time I get to a point where I think I can’t get any more performance out of it, I find something else, or have another idea. Not all of these tips are specifically .Net related, many of them will be applicable to any programming language, but my focus for the past 7 years of my career has been specifically on .Net, so naturally, I will be focussing fairly heavily on that. These tips will also be fairly heavily “Rich Client” based as that's where I have spent most of my career, however some of these tips will also apply to any .Net code running anywhere.</p> <p>My first tip is simple. Measure what you are trying to tune. You’ll probably see many bugs in your bug tracking system (you do use a bug tracking system right? If not I suggest you stop reading this article right now, and go find yourself a bug tracking system ASAP), that read “Application is slow when I do XYZ” or “Opening form foo takes forever”. The first step is to get this quantified. Exactly how many seconds does it take to do ‘X’, where ‘X’ is repeatable. Testers will probably have a set of test data, and you need to get your hands on this. Often performance issues surface because the data is structured in a specific way, and if you have differently structured data you may well not spot the problem (have a free “<a href="http://www.codinghorror.com/blog/2007/03/the-works-on-my-machine-certification-program.html">Works on My Machine Certification</a>”). Once your testers have measured it, then you might want to start a discussion around what is acceptable, what you should be aiming for in the tuning etc….</p> <p>Now I said “Measure twice”, well, after the testers have got some basic timings that you can use for comparisons at the completion of your tuning, then it’s your turn to measure. There are a number of tools that will analyse your code and assist in highlighting the areas that require the most attention. Visual Studio comes with a performance wizard under the “Analyze” menu. This is a reasonably good starting point, but personally I prefer tools with a nicer UI. My current favourite at the moment is “<a href="http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/">ANTS Performance Profiler</a>” from redgate, but there are others out there (Feel free to leave a comment if you have another preference).</p> <p><a href="http://lh3.ggpht.com/-OY7GgJEntEg/Tk9YHo0xbcI/AAAAAAAAAGM/TAvyjIgYzT8/s1600-h/ANTSProfiler%25255B5%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="ANTSProfiler" border="0" alt="ANTSProfiler" src="http://lh3.ggpht.com/-TXirIYtsd2A/Tk9YIURON2I/AAAAAAAAAGQ/ifKaWFTuoFs/ANTSProfiler_thumb%25255B1%25255D.png?imgmax=800" width="244" height="179" /></a></p> <p>For me the visualizations provided by ANTS Performance Profiler allow me to very quickly and effectively focus my attention. Without this knowledge, you can spend a lot of time optimizing bits of code that are called so infrequently that even optimized won’t make any noticeable difference to the overall performance. Once you’ve picked a measuring tool, learn it and master it. I usually like to take a series of measurements as I go. As you improve the performance of one problematic area, others will start to rear their ugly heads. Also a series of good visualizations can make for some good discussions with management if they want to know how you’re going. it is also a good education tool for other developers in your team. You can show them exactly why you should, or shouldn’t do particular things.</p> <p>Now that you have measured twice, unlike carpentry where the proverb “Measure twice, cut once” comes from, as coders, we can cut as many times as we need. Assuming you are using a decent source control system (and by the way, if you’re not, stop reading this article and go get yourself one NOW), you can confidently try different options to your hearts content. Keep in mind that sometimes release code behaves slightly differently to debug code, and as such, your final sign off should come from the testers testing on the release version of your build.</p> <p>Stay tuned, much more to come.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com1tag:blogger.com,1999:blog-7080622.post-15736998121389169612011-08-20T15:33:00.001+10:002011-08-20T15:33:06.518+10:00Long Time No Blog<p>For various reasons, I haven’t blogged much over the past few years, but now I feel inspired to get back into it. A lot has changed in my professional life since I last put pen to paper (or rather ascii to screen), but a lot still stays the same. </p> <p>My last post “<a href="http://sjbdeveloper.blogspot.com/2010/09/enjoying-my-iphone.html">Enjoying my iPhone</a>” is an indication of just how long it has been. I now use a Windows Phone 7 device, and I am really liking it. To me the iPhone UX was starting to feel a little stale, and while it was revolutionary for its time, I think MS have made a real challenge with their “metro themed” UX. Having said that, I still keep my old iPhone around just in case. My biggest gripe with my HTC HD7 is that it only has 16GB of memory (my iPhone 3GS had 32GB), and as such I can’t store my entire music collection on it.</p> <p>The biggest news however, is that I no longer work for <a href="http://readify.net/">Readify</a>. As much as I love Readify, and felt honoured working along side some of Australia’s and even the world’s best geeks, I got to a point where I really needed something different. I now work for an ISV called <a href="http://www.qsrinternational.com/">QSR International</a>. They write an awesome piece of software for qualitative data research called NVivo that is used in universities and research institutes all around the world. I have been working with QSR since April this year, and so far really enjoying it. It’s partly the work that I have been doing with them that has inspired me to post a series of new blog articles on .Net performance tuning, so keep a look out for that.</p> <p>In other non-geek related news, the inadequacies of the Melbourne public transport system have finally caused me to give up on my hippy car-free lifestyle, and join the masses who are forced to own a car… well almost.</p> <p><a href="http://lh6.ggpht.com/-GaasVBPIkEc/Tk9HDmFAN5I/AAAAAAAAAGE/1Og5BGglTlQ/s1600-h/bike%25255B2%25255D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="bike" border="0" alt="bike" src="http://lh4.ggpht.com/-dqRi19rSC9s/Tk9HETnntDI/AAAAAAAAAGI/7-CVIV7Oq0M/bike_thumb.jpg?imgmax=800" width="244" height="164" /></a></p> <p>I am now the proud owner of a Honda CBR 600 F4i (named Xena), and absolutely love her. Although I do still catch the bus a fair bit as I believe that it increases significantly my chances of surviving the journey.</p> <p>Keep a eye out for my series on .Net performance tuning… coming soon… I promise.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-31793442397256672532010-09-07T21:21:00.001+10:002010-09-07T21:21:24.752+10:00Enjoying my iPhoneI have known for a long while now that there were significant deficiencies in the Windows Mobile approach to smart devices. This had been made clear from Apples paradigm shifting release of the iPhone. However, the fact that I could develop applications for my windows mobile device using tools I was familiar with, kept me holding firmly to the inferior device, until about a month ago, when frustrations with my HTC touch HD (WM 6.1) reached a critical mass, and it happened to coincide with a colleague of mine upgrading to iPhone 4 and selling his old (almost unused) iPhone 3GS at a very reasonable price.<br />Since then, I have to say I have really been enjoying my iPhone, although, fear not dear reader, I am not about to become yet another Mac fanboi... At least not that easily.<br />There are some really nice things about the iPhone, but at the same time, some things that could be improved.<br />The Good<br />The focus on user experience is really where the iPhone (and indeed apple) really shine. It is quite obvious that this is a device designed to be used while traveling on a train with one hand full of groceries, and you texting arm wrapped around a grab rail for support. The different context sensitive keyboards, the size of the keyboards, the auto-word prompt when you mistype a word, the ability for applications to switch orientation all add up to a great user experience when inputting and reading text, as is evident from the fact that I can type up this whole blog post using my iPhone. The concentration on more natural user interfaces is very welcome.<br />The hardware is fast becoming the minimum spec for smart phone manufacturers that want to compete on the modern market, which I think signifies that apple really nailed it.<br />The proliferation of iPhone apps has seen the platform become an instant hit, and overall, I am extremely happy with it, to the point where I will not be going back to a windows mobile 6.* device. The overall consistency of "most" applications in the app store, and the new device friendly controls that apple have encouraged developers to use are on the whole really good, however, that could become a double edged sword.<br />The bad<br />Battery life sucks. Also coming from a palm is background, I do miss graffiti as a form of input, but I guess there were so few people that bothered to learn it that I'm probably on the minority here. The 20MB download limit when not on a wifi network I see as an affront to my free market rights to purchase the bandwidth I want and how I want it delivered.<br /><br />I will be getting a Windows Phone 7 device when they come out, because I really want to get into the WP7 development space. I'll have to wait and see how well then WP7 performs<br />Before I make a choice as to which device I want to use on a day to day basis... May the best phone win.Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com1tag:blogger.com,1999:blog-7080622.post-74281421776145088412010-03-07T11:52:00.001+11:002010-03-07T11:52:56.261+11:00You know your system is in trouble when…<p>Tried to use my favourite short cut this morning (Windows Key + E), and I got this.</p> <p><a title="Explorer" href="http://www.flickr.com/photos/60213491@N00/4411714851/"><img border="0" alt="Explorer" src="http://farm5.static.flickr.com/4041/4411714851_742c0cd1a5.jpg" /></a></p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-5415273924854526302010-03-06T12:35:00.001+11:002010-03-06T12:35:15.455+11:00Speaking at Victoria.Net SIG<p>Just a quick note to let everyone know that I will be talking at the Victoria .Net SIG on the Microsoft Sync Framework this coming Tuesday <a href="http://www.victoriadotnet.com.au/vic-victorianet-dev-sig-formed/vic-victorianet-dev-sig-events.aspx">http://www.victoriadotnet.com.au/vic-victorianet-dev-sig-formed/vic-victorianet-dev-sig-events.aspx</a></p> <p>Hope to see you there.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-84711206069013806862010-01-30T12:15:00.001+11:002010-01-30T12:15:41.887+11:00More bad luck<p>As my attempts to learn Sync Framework continue, I find even more issues along the way, this time with the SQLCE runtime. The basic scenario boils down to attempting to fill a Detail view from a dataset linked to a SQL Compact Edition datasource. When the application is run, an error message to the effect of </p> <p>Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E).</p> <p>is displayed, and the application crashes. After trying many different things to solve the problem, a simple google search on the exact error yields the solution. Basically it is a problem on Vista and Win7 x64 environments, and simply requires you to install SQl Compact Edition SP1 found here <a title="http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist">http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist</a>.</p> <p>I guess I was just surprised that it was not included as part of Visual Studio 2008 SP1.</p> <p>A colleague of mine <a href="http://notgartner.wordpress.com/">Mitch Denny</a> has told me that “If I was going to pick a person to clear a minefield you would be that person”, I replied that I was hoping it meant he believed I had special unique skills for finding and defusing mines, and not just that I am expendable.</p> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:591d82f2-f183-4549-8f4a-ebb68201f019" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/SQL+Compact+Edition" rel="tag">SQL Compact Edition</a>,<a href="http://technorati.com/tags/Visual+Studio+2008" rel="tag">Visual Studio 2008</a></div> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-83504139575010280092010-01-27T17:11:00.001+11:002010-01-27T17:11:42.033+11:00TFS 2010 Console Application and the .Net 4.0 Client Profile<p>One little frustration that has caught me twice now (and so it’s time to blog it so I remember it), is that when you create a Console Application and then start adding references to any of the TFS API libraries to it (such as Microsoft.TeamFoundation.Client.dll), if yoiu just accept all the defaults for a Console Application in Visual Studio 2010 Beta 2, you get this warning</p> <p>Warning    1    The referenced assembly "Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".    BasicEventListener</p> <p> </p> <p>and the application will not compile.</p> <p>The issue is the .Net 4.0 Client Profile does not contain the reference to System.Web, which is required by the TFS API. This is simple to fix, just go to the Properties of your project, and for the Target Framework, select “.Net Framework 4” instead of the “.Net Framework 4 Client Profile”.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-77714254749648290832010-01-27T10:39:00.001+11:002010-01-27T10:39:05.908+11:00The unluckiest developer alive<p>Sometimes I think I should be a tester for developer tools. For some reason I have the uncanny knack of stumbling onto the most obscure bugs in Visual Studio.</p> <p>I am currently trying to learn Microsoft Sync Framework, and decided (after watching a <a href="http://msdn.microsoft.com/en-au/sync/cc137124.aspx">good video on how to do it</a>) to set up an ADO.Net Sync Services Local Database Cache. I went through the process step by step, the only 2 differences between my environment and the one demonstrated in the video was that I was running SQL Server 2008, and I was using the AdventureWorks2008 database.</p> <p>The procedure I followed was this…</p> <ol> <li>Create a new Winforms Application</li> <li>Add A new Local Database Cache (this starts the wizard)</li> <li>select the AdventureWorks database</li> <li>Select the Production.Products, Production.ProductDescription, Production.ProductPhoto tables to add to the cache.</li> <li>Click OK.</li> </ol> <p>Everything else I left as the default configuration. The result:</p> <p><a title="DataSync" href="http://www.flickr.com/photos/60213491@N00/4307108537/"><img title="Data Synchronization Settings: Incorrect syntax near '.'." border="0" alt="Data Synchronization Settings: Incorrect syntax near '.'." src="http://farm3.static.flickr.com/2733/4307108537_49e216dbf1.jpg" /></a></p> <p>So I figure it’s something to do with my environment. I spent about half an hour Googling and looking at forums before I decided that I must be the first person ever to hit this bug. Next I tried to see if it was because of something in my environment, I checked my setup</p> <p>Windows 7 64 bit; SQL Server 2008 SP1; Visual Studio 2008 SP1; Sync Framework 2.0 x64;</p> <p>The only thing I could think might be an issue was the Sync Framework 2.0 x64, so I uninstalled and installed the x86 version. Still the same problem. </p> <p>I then opened SQL Profiler and tried to see if anything was obvious there, but concluded that it was all OK (I later discovered that I didn’t look closely enough at this).</p> <p>I then cracked open the wizard dlls in reflector to see if there was any help there, but alas, theat was pretty much a dead end too.</p> <p>I even posted an <a href="http://social.microsoft.com/Forums/en-US/syncdevdiscussions/thread/1619f989-fbb9-44f5-b767-c46e5cfaed92">article</a> on the Sync Framework Forum.</p> <p>Frustrated, I decided that it had to be my own environment that was causing the problem, so I set about creating a virtual environment on GoGrid. Once I had managed to get everything installed, I tried just the Production.Products table this time, and got the exact same error.</p> <p>I then tried creating a completely new table in a completely new database, and, surprise surprise, it actually worked… well, almost. It got past the wizard, but the code it generated would not compile. It appears that I stumbled on yet another bug in the Sync Framework wizard, if you use a table called “SyncTable”, the generated code is broken.</p> <p>Encouraged by the “success”, I pressed on undeterred. I finally got everything working by creating a table called “MyTable”.</p> <p>Not satisfied that I had made it work (finally), I decided to try and track down the bug. After about an hour or so of playing around and not having any success, I finally cracked open SQL Profiler again and found that the last statement executed before it died when trying to create a local database cache for the Production.Product table was the following</p> <p>SELECT * FROM [Product]ion.[Product]</p> <p>Obviously the code that works out the schema and table name needs some reworking.</p> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2fb3ed91-8892-4968-aa41-5605faefa7a5" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/ADO.Net" rel="tag">ADO.Net</a>,<a href="http://technorati.com/tags/ADO.Net+Sync+Services" rel="tag">ADO.Net Sync Services</a>,<a href="http://technorati.com/tags/Sync+Framework" rel="tag">Sync Framework</a></div> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-48430414234883937672010-01-09T12:10:00.001+11:002010-01-09T12:10:49.758+11:00Using the TFS 2010 SDK (Beta 2)<p>With significant changes to the way TFS 2010 works, especially in relation to Team Build and the new concept of Projects Collections, the API has necessarily adapted to account for these changes. For developers wanting to use these new API’s, there is currently very little in the way of documentation. The <a href="http://code.msdn.microsoft.com/TfsSdk">TFS SDK code gallery site</a> has a small amount of examples, as well as the beginnings of the API documentation, which although sparse, because of reasonably clear naming conventions actually offers users some guidance when attempting to write integration software for TFS 2010. There are also a few other bloggers around who have some posted code examples.</p> <p>I have been looking at re-writing <a href="http://www.codeplex.com/tfsdepreplicator">TFS Dependency Replicator</a> for TFS 2010, and in so doing have created a very simple application to enumerate some of the objects I am interested in.</p> <p>In the interests of helping other developers, here is my source code. You can also download the full solution from <a href="http://www.scottbaldwin.com/blog/BasicTFS.zip">here</a>.</p> <p>To run it, you must have .Net 4.0 beta 2 and TFS 2010 Explorer Beta 2 installed on your machine.</p> <p></p> <code> <pre>class Program<br />{<br /> static void Main(string[] args)<br /> { <br /><br /> // Get a list of all registered Project Collections<br /> Console.WriteLine("Project Collections");<br /> var collections = RegisteredInstances.GetProjectCollections();<br /><br /> foreach (var collection in collections)<br /> {<br /> Console.WriteLine("Connecting to TFS Server {0} at {1}", collection.Name, collection.Uri.ToString());<br /><br /> // connect to tfs<br /> using (var tfs = new TeamFoundationServer(collection.Uri))<br /> {<br /> tfs.EnsureAuthenticated();<br /> Console.WriteLine("Successfully connected to {0}", tfs.Uri.ToString());<br /><br /> // Get items of interest from TFS <br /> EnumerateServer(tfs);<br /> }<br /> }<br /><br /> Console.ReadLine();<br /> }<br /><br /> private static void EnumerateServer(TeamFoundationServer tfs)<br /> {<br /> // Get all of the Team Projects<br /> var structureService = tfs.GetService<icommonstructureservice>();<br /> var teamProjects = structureService.ListAllProjects();<br /><br /> Console.WriteLine("Team Projects");<br /><br /> foreach (var teamProject in teamProjects)<br /> {<br /> Console.WriteLine("\tName: {0}", teamProject.Name);<br /> }<br /> <br /> // extract all the work items <br /> // NOTE: this uses wiql to query the work item store<br /> Console.WriteLine("Work Items");<br /> var workItemStore = tfs.GetService<workitemstore>(); <br /> var workItems = workItemStore.Query(<br /> "SELECT [ID], [Title] FROM WorkItems");<br /><br /> foreach (WorkItem workItem in workItems)<br /> {<br /> Console.WriteLine("\tID: {0}\tTitle: {1}", workItem.Id, workItem.Title);<br /> }<br /><br /> // Get the build servers <br /> Console.WriteLine("Build Servers");<br /> var buildServer = tfs.GetService<ibuildserver>();<br /> var buildControllers = buildServer.QueryBuildControllers(true);<br /> <br /> // Get all the build controllerrs<br /> foreach (var buildController in buildControllers)<br /> {<br /> Console.WriteLine("\tController: {0}", buildController.Name);<br /><br /> // Get all the build agents<br /> foreach (var agent in buildController.Agents)<br /> {<br /> Console.WriteLine("\t\tAgent: {0}, Team Project: {1}", agent.Name, agent.TeamProject);<br /> }<br /> }<br /> <br /> foreach (var teamProject in teamProjects)<br /> {<br /> // Get each build definition for this Team Project<br /> var buildDefinitions = buildServer.QueryBuildDefinitions(teamProject.Name);<br /><br /> foreach (var buildDefinition in buildDefinitions)<br /> {<br /> Console.WriteLine("\tBuild: {0}", buildDefinition.Name);<br /><br /> // Get all build Details for this build definition<br /> var buildDetails = buildDefinition.QueryBuilds();<br /><br /> foreach (var buildDetail in buildDetails)<br /> {<br /> Console.WriteLine("\t\tBuild Number: {0} Build Status: {1}", buildDetail.BuildNumber, buildDetail.Status);<br /> }<br /> }<br /> }<br /><br /> }<br />}</pre></code> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com2tag:blogger.com,1999:blog-7080622.post-2823592933502635602009-12-27T18:14:00.001+11:002009-12-27T18:14:54.003+11:00Broken Angels book review<div class="hreview"> <div class="item"> <div class="item"> <h2><a class="url" href="http://www.amazon.com/Broken-Angels-ebook/dp/B000FC1BME/ref=sr_1_13?ie=UTF8&s=books&qid=1261871628&sr=8-13" fn?="fn?">Broken Angels by Richard Morgan</a></h2> <img style="display: inline; margin-left: 0px; margin-right: 0px" class="photo" align="left" src="http://ecx.images-amazon.com/images/I/2141XJDCSYL._SL500_AA106_PIkin2,BottomRight,10,34_AA140_SH20_OU01_.jpg" /> </div> </div> <div class="description"> <p>In his first book, "Altered Carbon", Richard Morgan sets up a universe in which human consciousness has been digitized, and can be transported over inter-planetary distances, re-sleeved (placed into another human body), and backed up. Broken Angels follows the main character Takeshi Kovacs, into another "Subjective" life on another colonized planet.</p> <p>The exploration of the digitized consciousness concept is great. I particularly love the graphic description of the "Soul Market". He also does reasonable job of describing the not so subtle links between greedy corporations and wars, but I feel he could have gone further. This time Aliens make an appearance (although long extinct), and there are some interesting explorations of the academic attempts to explore alien culture, and the parallels with our attempts to understand ancient earth cultures is fairly obvious.</p> <p>The development of some of the characters was good enough to understand their motives, but still allowed for some surprises in the end. Other characters I feel weren't really developed as well as they should have been.</p> <p>I feel that the books main problems revolve around the central character Kovacs. At times it can feel very much a "One man takes on the world", "Alpha Male" stereotype. I think this was also the first books main problem as well. It also uses the created universe of digitized consciousness and technological advances to allow for more graphic violence, but I think that is an acceptable exploration of the ideas the universe is based on.</p> <p>As with the first book, the general outlook is bleak, basically accepting that technology will never be a panacea for human ills, but it does leave the reader with the slightest glimmer of hope at least for some of the characters you have met along the way.</p> <p>I will definitely be reading the third in the series.</p> </div> <p></p> </div> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a724191d-4044-4199-80f0-a82155aa6bf6" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Science+Fiction" rel="tag">Science Fiction</a>,<a href="http://technorati.com/tags/Book+review" rel="tag">Book review</a></div> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-80287470761653945222009-12-17T23:53:00.001+11:002009-12-17T23:53:25.391+11:00Linq2SQL Bug with derived classes and Calculated fields<p>Today I discovered a bug in Linq2SQL. When you define a class hierarchy in dbml, where you derive a class from a base Class, and both use the same underlying table, and a discriminator property, as shown below:</p> <p><a title="derived_dbml" href="http://www.flickr.com/photos/60213491@N00/4192727760/"><img border="0" alt="derived_dbml" src="http://farm3.static.flickr.com/2758/4192727760_fd83c6217f.jpg" /></a></p> <p></p> <p>If you then wish to expose a calculated field in the derived class, (and trust me I have come across situations where this is a requirement), you will find that Linq2SQL throws an exception when you attempt to insert or update items of the derived class to the database.</p> <p>The exception is as follows</p> <p><font face="cou">Test method DerivedClassTest.DerivedClassTest.TestInsert threw exception:  System.ArgumentException: Property 'System.String CalculatedField' is not defined for type 'DerivedClassTest.BaseCLass'.</font></p> <p>This bug occurs deep within the Linq2SQL logic, and is to do with the AutoSync functionality where Linq2SQL attempts to create a select statement to return the values of AutoSync fields at the same time as it performs the insert.</p> <p>You may be able to work around this by setting the AutoSync property on the Column Attribute to “Never” as shown below</p> <p>[Column(Storage="_CalculatedField", AutoSync=AutoSync.Never, DbType="NVarChar(61)", IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)] <br />        public string CalculatedField</p> <p>And note that setting this in the designer doesn’t seem to work either, it just removes the AutoSync parameter all together, but still fails. You manually have to set it in the generated code (another bug perhaps?).</p> <p>Of course this means that you won’t get the new value of the field after an insert or update to the table, and you’ll have to re-query the table if you need it.</p> <p>The alternative workaround is to ensure that <strong>all</strong> calculated fields are placed on the base class.</p> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:3cb3bbd3-9489-4ec3-98cc-ead6923d0deb" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Linq2SQL" rel="tag">Linq2SQL</a>,<a href="http://technorati.com/tags/dbml" rel="tag">dbml</a>,<a href="http://technorati.com/tags/Calculated+Fields" rel="tag">Calculated Fields</a>,<a href="http://technorati.com/tags/SQL" rel="tag">SQL</a></div> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-46754473168930591812009-12-12T17:05:00.001+11:002009-12-12T17:05:00.120+11:00I have joined the e-Book Revolution<p>I have finally bitten the bullet and purchased a <a href="http://www.amazon.com/dp/B0015T963C/?tag=gocous-20&hvadid=4139599487&ref=pd_sl_18mromr3b0_e">kindle</a>. I had been tossing up between the kindle and the <a href="http://www.barnesandnoble.com/nook/">nook</a>, and even though in many respects the nook is a superior device, there were really 2 “features” that persuaded me in the end. The first was Text To Speech, the second was availability.</p> <p>The Nook does not have Text To Speech, and I could not find any evidence that they were thinking of adding it in a firmware upgrade. Also I wanted it before Christmas, and the earliest anyone can get there hands on a Nook is 15th of January.</p> <p>I’ve had my kindle for 2 days now, and so far I am really happy with my purchase, but there are certainly some negatives, so here is my review.</p> <p>The positives.</p> <ul> <li>Great looking device, thin and light.</li> <li>reasonable 3G coverage (in most major Australian cities).</li> <li>Text to speech rocks.</li> <li>Latest firmware upgrade (2.3) adds native support pdfs.</li> <li>Good reading experience (eInk is cool).</li> <li>Support for converting files of many different formats such as html, mobi pocket, rtf, etc…, although native support for these document types would be better.</li> <li>Can sync your personal documents via your own PC.</li> </ul> <p>The negatives</p> <ul> <li>No Wifi. I have been amazed at how Amazon have actually sold this as a feature “You don’t have to hunt around for a wifi hotspot”, actually Amazon, I have one of them at home, as do many people, also many of the cafe’s I would go to read have them as well.</li> <li> No Australian news content. This really infuriates me, I would love to get The Age delivered to my kindle, but alas I’ll have to go on killing trees to get my news.</li> <li>Proprietary DRM format. It really annoys me that if I do eventually decide to go for another ebook reading device, I will potentially lose my entire book collection.</li> <li>Not all books come with Text To Speech switched on. I got caught out on this on my first purchase, not checking the information thoroughly enough. I feel a bit cheated, as I feel the publisher has no right to determine how I choose to consume their content. Are they going to dictate that I cannot have another human being read it to me? No, then why draw the line at a computer? </li> </ul> <p>My particular reason for wanting the Text To Speech feature is that I am a very slow reader, and Text To Speech would drastically increase the amount of books I could “read”. In future I will be making purchasing decisions based heavily on whether or not Text To Speech has been allowed by the publisher. Having said that, I wouldn’t be surprised if the problem with Text To Speech rights lies more with audio book retailers than with publishers, but that’s one for the conspiracy theorists to argue about.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-67096734233901856692009-12-03T18:28:00.001+11:002009-12-03T18:28:53.924+11:00Visual Studio Help Integration Wizard and Continuous Integration<p>As .Net developers we are constantly using msdn and the Visual Studio help system. One of the most powerful features of Visual Studio is the ability to hit the F1 key on a class, property or method, and have it whisk you away to the correct msdn entry for the item of interest. When using third party libraries, it is great when they are able to provide you with the same ability to search API documentation from within Visual Studio. This is all possible, but I recently discovered, not necessarily trivial, and there is a really big gotcha if you want to add it to your Continuous Integration process.</p> <p>To start with you need to ensure that all developers of your API are meticulous about putting <a href="http://msdn.microsoft.com/en-us/library/b2s063f7.aspx">XML Summary comments</a> on ALL public facing entities. This is a good practice whether or not you intend to distribute the API.</p> <p>The second step is to use a tool like <a href="http://www.codeplex.com/Wikipage?ProjectName=Sandcastle">sandcastle</a> to build compile the xml comments into a usable format. Sandcastle has a number of different outputs including the classic .chm (Compressed html) output that is easy to read and can be distributed with your project, however, if visual studio integration is what you are really after, then you need the Html2 help output (*.hxs). As there are a lot of different settings for sandcastle, it is good to use the <a href="http://www.codeplex.com/SHFB">SandCastle Help File Builder</a> that provides a nice settings based interface as well as a command line utility to aid you in building your help files.</p> <p>The third step is to create an installation package (.msi or .msm) to distribute your documentation to the millions of developers who will be using your API to write the next killer application. There are a few ways of achieving this, to do this from scratch you could follow <a href="http://msdn.microsoft.com/en-us/library/bb164959.aspx">these intructions</a>, however, in the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=30402623-93ca-479a-867c-04dc45164f5b&displaylang=en">Visual Studio 2008 SDK</a>, there is a project type called the <a href="http://msdn.microsoft.com/en-us/library/bb165415.aspx">Help Integration Wizard</a> that attempts to automate this process for you. This very simple project template works great right up to the point where you try to integrate it into your Continuous Integration Process.</p> <p>The first problem is that the solution created contains 2 vdproj files, which means that you can’t build them with MSBuild, and are forced to pollute your build server with Visual Studio and compile it using the devenv command line. However, even after you have taken this hit, the pain doesn’t stop there.</p> <p>The reason is because of 2 files that are included surreptitiously in the project path but not added to the solution. The executable FixRegTables.exe, and a merge module called MSHelp2_RegTables__RTL_---_---.msm get added to the CollectionFiles folder for the merge module project that is created. If you fail to check these in to your source control solution, your CI build will break with an error about a post build step. However, if you do add them to your source control repository, then chances are when you perform a “Get Latest” operation, these files may well be marked as “Read Only” as this is standard practice for many source control systems to ensure that source files are not modified during a build. In this case, the build will work as expected and produce an msi file, however, the resultant msi file will not install anything when run. The issue is that the Post Build step mentioned above needs to modify the merge module.</p> <p>The solution is to either check the 2 files in to your source control system, and make the merge module writable as part of a pre build step, or to copy the two files from their location in the visual studio sdk into the Collection Files folder as a prebuild step.</p> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e0e97d70-9289-42f2-8a59-d120244ade22" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Visual+Studio+2008" rel="tag">Visual Studio 2008</a>,<a href="http://technorati.com/tags/SDK" rel="tag">SDK</a>,<a href="http://technorati.com/tags/Help+Integration" rel="tag">Help Integration</a>,<a href="http://technorati.com/tags/HTMLHelp2" rel="tag">HTMLHelp2</a>,<a href="http://technorati.com/tags/Continuous+Integration" rel="tag">Continuous Integration</a></div> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com3tag:blogger.com,1999:blog-7080622.post-84809619361234022282009-11-08T18:34:00.001+11:002009-11-08T18:34:49.004+11:00Bragging time<p>On Friday, I successfully passed <a href="http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-561&locale=en-us ">Microsoft Certification exam 70-561</a>. This now makes me a MCTS: .Net 3.5, ADO .Net Applications.</p> <p>I am going to do a few more exams over the coming year, but I’ve yet to decide what the next one will be.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-57297676488804526252009-11-07T16:22:00.001+11:002009-11-07T16:22:55.428+11:00One small gripe about my laptop<p>I absolutely love my new <a href="http://sjbdeveloper.blogspot.com/2009/05/new-laptop.html">laptop</a>, especially since I put an SSD in it. I have one small gripe however, and that is with the keyboard, or rather the lack of one key that I have become very reliant on, that is the “Right Mouse Key”.</p> <p>I am often too lazy to plug in my mouse, or often (like now) not in a position to do so (reclining in a comfortable chair with my Feet up, and the laptop on my <strong>lap</strong>), and I have become quite used to the keyboard shortcuts for all the applications I use, which is why I have always loved the right mouse key, but alas on the Dell Precision M4400 laptop, no such key exists.</p> <p>Having said that, just in doing my research for this rant, I have in fact discovered that Shift+F10 does the same thing, problem solved! Still would  be nice to have a single button for this though.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com0tag:blogger.com,1999:blog-7080622.post-41382062666679077762009-10-05T23:40:00.001+11:002009-10-05T23:40:34.512+11:00Laptops, SSD’s, vhd’s and Hyper-V<p>I recently splurged and purchased one of <a href="http://gskill.com/products.php?index=124&c1=&c2=">these</a> for my <a href="http://sjbdeveloper.blogspot.com/2009/05/new-laptop.html">new laptop</a>. I was finding hard to justify the extra expense for the 128GB over a 64GB SSD, knowing full well, that if I was careful I could run an OS and all the applications I normally use on 64GB, but I thought… what the hell. This weekend I discovered the “boot from vhd” feature of Windows 7, and I can say I am so glad I spent the extra money.</p> <p>I have successfully created a dual boot for Windows Server 2008 R2 running on a 25GB vhd stored on my SSD. It is a bit of work, mucking around with DISKPART and BCDEDIT, but once it’s set up, it just works a treat, and thanks to my SSD, the speed is awesome. My main reason to do this was to play with Hyper-V as I have been charged with setting up a build server and test server at the client I am currently engaged to.</p> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com1tag:blogger.com,1999:blog-7080622.post-46998948914756409362009-05-16T16:45:00.001+10:002009-05-16T16:45:01.389+10:00New Laptop<p>having recently gone back to work after returning from a year in Buenos Aires, I have been tooled up. One of those tools as you may already have seen from <a href="http://sjbdeveloper.blogspot.com/2009/05/windows-7-and-bluetooth-issues-on-dell.html">my previous post</a> is a new laptop, and just by way of showing off, I thought I’d post the specs up.</p> <p><a title="My Laptop" href="http://www.flickr.com/photos/60213491@N00/3535538684/"><img border="0" alt="My Laptop" src="http://static.flickr.com/2077/3535538684_568d8c3f9a_m.jpg" /></a></p> <ul> <li>Mobile Workstation AW-M4400n - Dell Precision M4400n-series Base </li> <li>Intel(R) Core(TM)2 Duo Processor T98002.93GHz, 6M L2 Cache, 1066MHz FSB</li> <li>8GB (2x4GB) 800MHz DDR2 SDRAM</li> <li>15.4 " Ultrasharp(TM) WUXGA (1920x1200) RGBLED Display with TrueLife(TM)</li> <li>NVIDIA Quadro FX 770M, 512MB dedicated memory</li> <li>8X DVD + /-RW Drive</li> <li>2nd Hard Drive 120GB SATA (5400RPM) Hard Drive (External)</li> <li>Integrated 0.3 Megapixel VGA Webcam with Single Digital Mic for WUXGA LCD</li> <li>Wireless Network Cards -Intel WiFi Link 5300 (802.11 a/g/n 3X3) MiniCard</li> </ul> <p>I have also made the decision (as many other <a href="http://www.readify.net">Readify</a> people have) to install Windows 7 RC on it. So far there have been no serious problems, but there are a few things I have found and I will blog about them as I find and (hopefully) fix them. </p> <p>The first one was Google Chrome not working, but there are many <a href="http://www.blogsdna.com/1900/how-to-run-google-chrome-on-windows-7-64-bit-version.htm">posts about this</a>, however even after this, Chrome does seem to be a little unstable from time to time, the end result of which is I end up spending half my time in IE8 which I have no real problem with.</p> <p>The second problem was the <a href="http://sjbdeveloper.blogspot.com/2009/05/windows-7-and-bluetooth-issues-on-dell.html">bluetooth issue I talked about in my previous post</a>.</p> <p>I do get a little bit of instability from Visual Studio 2008 from time to time. I think it has something to do with Team Member Presence information in VSTS Team Explorer, and so I turned off this feature and it now seems to be a lot more stable.</p> <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:770bb606-2a5b-4ff0-a335-f26bd6c67de3" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Windows+7+RC" rel="tag">Windows 7 RC</a>,<a href="http://technorati.com/tags/laptop" rel="tag">laptop</a></div> Scotthttp://www.blogger.com/profile/06971567244746185293noreply@blogger.com2