<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>midnight muse</title>
	<atom:link href="http://midnightmuse.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://midnightmuse.com.au</link>
	<description>Richard Wright's musings about software and other things that take his fancy</description>
	<lastBuildDate>Sun, 26 Feb 2012 21:53:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Windows 8 FUD</title>
		<link>http://midnightmuse.com.au/2012/02/11/windows-8-fud/</link>
		<comments>http://midnightmuse.com.au/2012/02/11/windows-8-fud/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 23:59:09 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=382</guid>
		<description><![CDATA[In my previous post I wrote about my first impressions of Windows 8. And I noted that first, it was a developer preview, so a lot was missing. And second, I was running it in a VM in VirtualBox, so &#8230; <a href="http://midnightmuse.com.au/2012/02/11/windows-8-fud/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my <a title="Windows 8 – First Impressions" href="http://midnightmuse.com.au/2011/09/16/windows-8-first-impressions/">previous post</a> I wrote about my first impressions of Windows 8. And I noted that first, it was a developer preview, so a lot was missing. And second, I was running it in a VM in VirtualBox, so the performance wasn&#8217;t optimal. And third, I wasn&#8217;t running it on a tablet.</p>
<p>Since then the Windows 8 Team have <a href="http://blogs.msdn.com/b/b8/">written a lo</a>t about what the new Windows 8 will have, and what it won&#8217;t. Their <a href="http://blogs.msdn.com/b/b8/archive/2012/02/09/building-windows-for-the-arm-processor-architecture.aspx">most recent post</a> by team boss, Steven Sinofsky, was all about building Windows 8 for ARM processors.</p>
<p>A few things stand out from that post.With a few exceptions, Windows 8 on ARM will be a Metro based OS. Sinofsky said that the Windows desktop will be on ARM machines but there will be few application running on it. Explorer, and some Office 15 applications, Word, Excel, Powerpoint and One Note. You will not be able to install win32 applications onto an ARM machine.</p>
<p>Windows 8 on ARM will look and feel the same as Windows 8 on x86/64 Intel or AMD chip powered pcs. Except for the lack of support for the installation of win32 apps.</p>
<p>This has led to a lot of complaining from the (mostly) development community. Read some of the comments to Sinofsky&#8217;s post to see the response.</p>
<p>But the reality is this. The current tablet market is dominated by Apple. The IPad has taken off and has far surpassed the Mac in sales. Apple sold over 11 million IPads in the 4th quarter of last financial year. Gartner predicts IPad sales of 150 million in 2015.</p>
<p>Clearly, Apple, with its IPad, is the major player in the tablet market. And Microsoft wants to change that. That is good news for us. Whether you are an IPad, Android or Microsoft user, any competition in the market means better products available for all of us.</p>
<p>Apple has gone the route of using different operating systems on its desktop/laptop computers than on its tablets. The Mac runs OS X, the tablet runs iOS. They look very different, and the user experience is very different.</p>
<p>Microsoft wants to use the same operating system on tablets, laptops and desktops &#8211; Windows 8. Which is the best option? I don&#8217;t know. I don&#8217;t think anyone really knows &#8211; the market will tell us.</p>
<p>Unfortunately, with ARM, it is impossible from a technical standpoint, to have an identical experience to the Intel/AMD x86/64. Sinofsky explains why in his post. Perhaps impossible is to strong a word. But to put an identical os on ARM would mean compromises in other ares that Microsoft are not prepared to make. And this has led to complaints. The biggest being that the only applications that can be installed on an ARM device are Metro apps and they have to be installed via the  Microsoft Windows 8 store. This is the same way that Apple operates with the IPad.</p>
<p>But you will be able to install programs onto x86/64 tablets running Windows 8, just as you can now with Windows 7. and every previous version of windows.</p>
<p>I am a developer. I write programs for Windows and have been doing this since Windows 3. Before that I wrote programs for DOS. Do I care that I can&#8217;t copy programs to ARM devices. Not a bit. I will be able to write the programs, but the deployment will be different.</p>
<p>I will tell you a story about life at home. Up until 12 months ago our computer set-up at home was this. I develop on a desktop running Windows 7. It is networked to another desktop running Windows 7 which serves as a continuous integraton build server. So these two pcs are business pcs, mostly. although my main desktop is also my home computer. I have a laptop which is networked to the two desktops. My wife had a laptop, which was running Windows XP and was also networked so that she could access one of the external drives that contains photos, among other things.</p>
<p>At the beginning of last year my wife&#8217;s laptop died. She used my laptop while we were deciding what to replace hers with. After using my son&#8217;s IPad for a while she decided that she also would like an iPad.</p>
<p>If this were to happen later this year I would suggest that she get an ARM tablet with Windows 8 instead. Why? Because of what she does with it. She uses the internet &#8211; browsing and email. She uses Word. She uses Skype. And she uses the iPad to show photos of grandchildren to friends and family. Until earlier this week, one of my sons and his wife and two children lived in Germany. The iPad eventually got Skype, and it is great for photos.</p>
<p>But is is not good at a few things. Connecting a printer was a problem. We now have it set up but it was a kludge. Connecting to networked devices like the external drive is also a problem. Email on the iPad is different to what she was used to.</p>
<p>But the biggest problem is that my wife knows little about getting her iPad, pc, or whatever device she has, working if there is a problem. She has never had to learn. If you are a developer, or do any work with computers, you know that you become the HelpDesk for family. I have had to sort out everything that went wrong. And I know nothing about Apple stuff. But I do know Windows.</p>
<p>But what about installing applications. I don&#8217;t know how many applications I have written. Many for clients, and a number for myself. But I have never written an application that I have installed on my wife&#8217;s laptop. She doesn&#8217;t use them.</p>
<p>Our future computing environment at home is likely to be this. I will maintain my two desktops, upgraded when required. My laptop, which also died and has been replaced, will be replaced by an Intel x64 tablet/hybrid, perhaps something like the announced Lenovo Yoga. My wife will use an ARM tablet running Windows 8.</p>
<p>How much of an inroad will Microsoft make into the tablet market? I have no idea. Apple is firmly entrenched. But Microsoft is the established leader in the enterprise. People who use Windows at work go home at night and I think that, if Windows 8 is any good, and I think that it is looking very good, they might prefer to use something at home that they are used to.</p>
<p>My prediction &#8211; Windows 9 will have a large share of the market, assuming Windows 8 is well received.</p>
<p>In any event, Windows 8 is a good thing. If it is successful then Apple and Android will have to take notice. If it fails then Microsoft will have to work harder.</p>
<p>Finally, Windows 8 on ARM is also a good thing. Intel and AMD will have to respond, and the indications are that they are doing that now. Consumer devices can onlyl get better.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2012/02/11/windows-8-fud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 8 &#8211; First Impressions</title>
		<link>http://midnightmuse.com.au/2011/09/16/windows-8-first-impressions/</link>
		<comments>http://midnightmuse.com.au/2011/09/16/windows-8-first-impressions/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 13:59:57 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=377</guid>
		<description><![CDATA[Windows 8 looks good for tablets. But a step backwards on the desktop. <a href="http://midnightmuse.com.au/2011/09/16/windows-8-first-impressions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Like many others, developers and users alike, I have been waiting patiently for the Microsoft Build Conference, It was first announced in June with the promise of a look at at the next version of Windows, Windows 8. And Microsoft have delivered on that promise.</p>
<p>Before I get to my thoughts on Windows 8 itself, I should express my annoyance at the way that Microsoft have handled the build up to Build. In June, when the conference was announced, there were a number of announcements made concerning the nature of the operating system and the tools that developers would use to write applications for the new operating system. There was an early preview of what Windows 8 would like, and the news that this is an operating system for tablets and PCs alike.</p>
<p>There was a great deal of angst among the development community when Microsoft announced that the new development paradigm was HTML 5 and Javascript. This was not entirely surprising. Microsoft has for some time been giving very strong hints that they thought that HTML and Javascript would play an increasingly important role in the development of applications, both for the cloud and the desktop. No mention was made of Silverlight.Â  Of course, no mention was made of WPF or Winforms. Winforms is the long forgotten child of Microsoft, even though they still use it in house to develop applications, and very successful applications. WPF seems to have lost out to Silverlight. Silverlight out of browser applications seem to be the preferred way to build desktop applications. No mention was made of ASP.NET, even though a lot of work has gone on in that area recently, especially with Razor and MVC. So with no announcements concerning these technologies, and no response from Microsoft to the many questions raised by the development community, the users of their development products, the anger expressed towards Microsoft was understandable, and justified.</p>
<p>Microsoft relies on developers using their products to produce applications that run on the Windows platform for their survival in the enterprise marketplace. On this occasion they have treated the development community with contempt. And it won&#8217;t be easy to win back their trust.</p>
<p>Now, on to Windows 8.</p>
<p>Microsoft, to their credit, have made available a Developer Preview Version of Windows 8. It isn&#8217;t complete. It has bugs. It is not yet at Beta stage. So what we finally end up with will have changed substantially from what we have now.</p>
<p>Bit some things, from what we have been told in the keynote addresses at the Build conference, will not change. What we have been told is thatÂ  Microsoft sees the future of computing as &#8220;Touch&#8221;.Â  Jensen Harris, one of the Microsoft heavyweights, said that we need to build applications that are the same regardless of the device they run on. Be it a phone, a tablet, a laptop or a desktop, the applications should have the same functionality, and the same look and feel, right up the stack.</p>
<p>And herein lies the problem. All the new applications should be built in the Microsoft Metro way. They should run on any device. And I have to say that Windows 8 looks great for a touch device. I don&#8217;t have a touch pc or slate to run it on. But compared to the IPad, which we do have at home, I think Microsoft could have a winner. And if Microsoft wants to become a consumer PC/Tablet/Slate operating system manufacturer, then they may do OK. But this a major change of direction for Microsoft.</p>
<p>I am a developer of applications which run on the Windows platform. Specifically, I write, mostly, business applications which run on the .Net framework. Sometimes I write Winforms, sometimes ASP.Net. But I couldn&#8217;t write these applications using Windows 8, at least as I see it now.</p>
<p>The future of Windows applications, according to Microsoft, is Metro apps. Under this paradigm you can have two applications available at any one time. One of them is the major application taking up most of your screen. The other is docked to one side of the screen and takes about 1/4 to 1/3 or the screen width. But I can&#8217;t work that way. I regularly use two or three screens. One has Visual Studio open on it, maximised to take the wholeÂ  24 inch screen And if the monitor was bigger it would still take the whole screen. Another may have Expression blend, another is likely to have Word, or perhaps One Note, ofr something that has notes dealing with the application I am writing. I am also, at times, likely to have Linqpad open so I can test some Linq queries. I use an O/R Mapper, LLBLGen Pro, in most of my database applications, so at various times during development I will have it open. SqlServer Management Studio will be open at some stages, as might Visio during the database design phase. Perhaps Balsamiq will be open as I try to design the user interface. For continuous integration I use Team City. That runs on a separate PC which is my build server, That PCs monitor will show the results of my Team City build, or, thanks to MaxiVista, will serve as my third monitor when it often hosts one of the Visual Studio windows. I often use it to show my unit test runner. This all works very well on Windows 7. From what I have seen of Windows 8 it will be impossible for me to work like this.</p>
<p>I said earlier that I develop applications for enterprises. The enterprise has been Microsoft&#8217;s strength since the days of DOS. Since the 1980s big business has used mainframes running IBM operating systems or mid range computers with Unix, or AIX, or some similar OS. Small businesses have used PCs. But since the 1980s the PC has made further and further inroads into larger and larger businesses. We now have Microsoft Server powering very larger enterprises. Microsoft&#8217;s SqlServer competes with Oracle in holding the data of the very largest businesses. Windows 8 is not an operating system, as it looks at the moment, for the enterprise. Business users don&#8217;t want to touch their screens, except for a very small number of specialised cases. Enterprise applications, be they accounting, human resources, sales , production or inventory systems, are all about efficiently manipulating and effectively storing data.</p>
<p>Microsoft might think that this is a short-term, myopic, non-visionary, backward-thinking view of computing as we move further into the 21st century. But it isn&#8217;t my view.It is the view of governments who want companies to account for taxes, and employees who want a paycheck each week. It is the view of shareholders who want dividends and banks who lend money.</p>
<p>Don&#8217;t get me wrong. I want a tablet which runs Windows 8, and over the next 6 to 12 months there should be a whole lot of them on the market to choose from. I expect I will be excited by Windows 9 and Windows 10. As a developer I am looking forward to the challenges, and the enjoyment, that will come from programming for these new devices. And I am looking forward to using the tools that are produced by a lot of very smart people at Microsoft and other software companies. There is a lot to look forward to for software developers.</p>
<p>However, I am software developer only to the extent that I can deliver software that my clients want. And I cannot see any of my clients using Windows 8. I can&#8217;t think of one application that I have written in the pastÂ  2 years, 5 years, ever, that would have benefited from being written for a tablet. I know I will have to re-think my future application designs to conform to this new future. I will have to learn new skills.</p>
<p>But Microsoft may also have to re-think. If this is the future of Windows development then perhaps my clients might consider moving to Linux, and that will dictate the types of skills that I have to use.</p>
<p>There is another possibility. I have been primarily a desktop application developer. I think that Microsoft has finally decided to kill off the desktop as we know it. All business application in the future will be either Silverlight or ASP. Microsoft was late in embracing the internet back in the 1990s. But they have made up for that with a gusto in the last few years. I suppose I can live with that. All business applications go up to the cloud. But the problem for me and every other developer remains. If Windows 8 is the development environment that Microsoft is giving us, how will every write these application? It can&#8217;t be done.</p>
<p>I really hope there are some substantial changes to Windows 8 over the coming months.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2011/09/16/windows-8-first-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySql Connection Problem</title>
		<link>http://midnightmuse.com.au/2010/05/06/mysql-connection-problem/</link>
		<comments>http://midnightmuse.com.au/2010/05/06/mysql-connection-problem/#comments</comments>
		<pubDate>Thu, 06 May 2010 05:43:18 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=198</guid>
		<description><![CDATA[I really don't like MySql with .NET <a href="http://midnightmuse.com.au/2010/05/06/mysql-connection-problem/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Everyone loves MySql. It is everywhere. This website runs on it.</p>
<p>But I keep having problems when I use it as the database for .NET applications.</p>
<p>I delivered an application last week. A fairly standard windows desktop application. Except that the database it was connecting to was MySql. As usual, I did my data access using my favourite OR/M tool, LLBLGen. The application crashed at the client&#8217;s site as soon as they tried to access the database.</p>
<p>I checked the connection string, and that was OK. In any event, the exception didn&#8217;t look like that was the problem. It seems that the ado.net provider was missing. But that made no sense to me.</p>
<p>So I loaded it up onÂ  a clean install of XP, that is what the client is running, on a virtual machine that only had the .Net framework and MySql installed. Everything else came straight from source control. And it worked fine.</p>
<p>I hate bugs that I cannot reproduce, and it is driving me crazy!</p>
<p>I am now in the process of cleaning out everything on my laptop, copying those things that I think I need to an external drive, and reloading Windows from scratch. I will try to reproduce the bug on it.</p>
<p>It sounds crazy that I am spending all this time trying to produce a bug. I usually spend my time trying to get rid of them.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2010/05/06/mysql-connection-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Killing a Process</title>
		<link>http://midnightmuse.com.au/2010/05/06/killing-a-process/</link>
		<comments>http://midnightmuse.com.au/2010/05/06/killing-a-process/#comments</comments>
		<pubDate>Thu, 06 May 2010 05:35:14 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=196</guid>
		<description><![CDATA[Sometimes a process just won't roll over and die <a href="http://midnightmuse.com.au/2010/05/06/killing-a-process/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had a problem today that I have not seen before.</p>
<p>I am running Windows 7, 64 bit. I had a document open in Word. The version of Word I use 2010 and, following Microsoft&#8217;s recommendation, I am using the x32, or 32 bit, version. I was scrolling through the document and it froze. I have had all sorts of applications freeze in the past, even some of my own. Or is that especially some of my own?</p>
<p>The usual fix is to open TaskManager, or in my case Process Explorer, which is part of the Sysinternals suite. Right click the process, in this case, Winword, and select Kill Process. It didn&#8217;t work.</p>
<p>So I tried taskkill from the command line. Didn&#8217;t work. So I tried taskkill /F, which is supposedly a forceful task kill. Still didn&#8217;t work. Back to sysinternals and tried its pskill, which is supposed to kill a process. And that didn&#8217;t work.</p>
<p>This has never happened before.</p>
<p>So I did a reboot. Now when right click the system tray and select Task Manager, or do the same from a Ctrl-Alt-Del, I get an error message.</p>
<p>I have no idea what is going wrong, but I can see I have some things to fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2010/05/06/killing-a-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Arms Race</title>
		<link>http://midnightmuse.com.au/2010/04/29/the-arms-race/</link>
		<comments>http://midnightmuse.com.au/2010/04/29/the-arms-race/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 15:03:05 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=194</guid>
		<description><![CDATA[There is a battle going on and we will all be winners. <a href="http://midnightmuse.com.au/2010/04/29/the-arms-race/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Visual Studio 2010 is out, more or less. It will be officially launched in May and be available through retail outlets in June. But it is available now via MSDN for subscribers.</p>
<p>I&#8217;ve played around with the beta and the RC versions for a while, and I downloaded the RTM version last week. My only gripe is that it is slow to start, but once it is open it is a joy to use.</p>
<p>I first started using .Net when version 1.1 was released in 2003. Version 2 of the CLR which was released with Visual Studio 2005 was a big improvement, as you would expect. When I moved to VS 2005 I also discovered Resharper and I have been a fan ever since.</p>
<p>One thing that I have noticed over the years is that each new Visual Studio release has incorporated some of the functionality that was provided by Resharper. For Resharper you could substitute CodeRush + Refractor and the statement would also be true. I think if I had tried CodeRush before I got used to Resharper then I would probably use CodeRush instead. They are both great products and both have substantial numbers of loyal followers.</p>
<p>However, to get back to my point. Resharper and CodeRush &#8211; and I think there may be one or two others, there certainly used to be, but these are the main contenders &#8211; provide some functionality that is missing from Visual Studio. As each subsequent version of Visual Studio incorporate some or most of this functionality, Jet Brains and Developer Express need to add more functionality to Resharper and CodeRush otherwise no one would buy or upgrade their products.</p>
<p>Resharper 5 has just been released. It too has been in beta and then RC versions for some time. I was very disappointed that the RC versions that I tried did not have highlighting of the current line. A very small issue, but one that made coding, for me at least, so much easier. Maybe its usefulness was more perception than reality, I don&#8217;t know. Except that when it wasn&#8217;t available in VS 2010 I was bitterly disappointed. But the final version has it restored and so all is well with the world.</p>
<p>And Resharper has a whole bunch of new stuff as well. It has to if it wants to stay in the market.</p>
<p>So the result is that with each version of Visual Studio we developers get a better environment in which to code, and our add-ons keep improving at the same time.</p>
<p>I recommend that you try out VS 2010 and also give Resharper or CodeRush a try as well. You won&#8217;t be disappointed.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2010/04/29/the-arms-race/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Own Stupidity Amazes Me!</title>
		<link>http://midnightmuse.com.au/2010/04/14/my-own-stupidity-amazes-me/</link>
		<comments>http://midnightmuse.com.au/2010/04/14/my-own-stupidity-amazes-me/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 14:28:01 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=192</guid>
		<description><![CDATA[You'd think at my age I might have learned. But I haven't. <a href="http://midnightmuse.com.au/2010/04/14/my-own-stupidity-amazes-me/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It doesn&#8217;t seem to matter how often we hear or read about what we should do. We still don&#8217;t do it. I even tell my clients what they should do, but I don&#8217;t do it. And today it bit me on the bum.</p>
<p>12th April was a significant day for Microsoft developers. Visual Studio 2010 was launched. It was 13th April here in Australia, because we are so far ahead of most of the rest of the world, except for New Zealand, and that is a real worry. But I digress.</p>
<p>Yesterday morning I downloaded Visual Studio. Actually I started the download and then went to see a client and didn&#8217;t get back until late afternoon. And then I had to install it.</p>
<p>I couldn&#8217;t install it straight away because I had the RC version already installed. And I had enormous trouble getting it uninstalled. Eventually, after many hours, it was gone. Or so I thought. I then tried to install VS 2010 and it told me that it couldn&#8217;t install because I still had a component left on. I uninstalled it and tried again. It started out fine but got to installing the .Net Framework V4 and there it hanged, hung, I&#8217;m not sure which.</p>
<p>I rebooted and tried again. Same thing. I got a cup of coffee and tried again. Still no go.</p>
<p>I downloaded the framework separately and tried that. It wouldn&#8217;t budge. I got another cup of coffee and played a few games of Sudoku, and that didn&#8217;t help.</p>
<p>At this stage I thought that it might be time for a clean install on the pc, and even though that thought fills me with dread, it probably is time, soon. I thought that I had better check my backup files and make sure that I have everything that I need. My client apps aren&#8217;t a problem, they are all under version control on a separate machine. But I have other backups sitting on two 1 tb external disks. Only one was connected to the pc at the time and the other one has some useful stuff on it. It hasn&#8217;t been connected since I re-arranged my office some time ago. So it was now time to dig it out and crawl around the floor under the desk and plug it in.</p>
<p>I tried one more time to install Visual Studio, and what do you know, it is working. It is chugging along quite nicely as I write. But it is now 12:20 am and I have been at this for hours.</p>
<p>The moral is, if I hadn&#8217;t installed the RC version I probably wouldn&#8217;t have had these problems. I wanted to try it out and so I installed it. I didn&#8217;t use it for any production work, I&#8217;m not that stupid. But I do have VMWare installed on this machine. And I have a couple of virtual machines set up for this purpose. Why didn&#8217;t I install the RC version on a vm? Cause I am dumb. Lazy and dumb.</p>
<p>But I have another confession to make. Before I got the RC version, I had a copy of a beta version. I didn&#8217;t install that on a vm either.</p>
<p>I said that I am not only dumb, I am lazy. If I was smart and lazy I would have stuck both these versions on a vm. It is a lot quicker to delete a virtual machine and then make a new clone of a clean vm and install the beta and release candidate versions on the new vm.</p>
<p>I have learnt my lesson, this has been a nightmare.</p>
<p>At least it is going well now and tomorrow I can play with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2010/04/14/my-own-stupidity-amazes-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Source Control needs its own machine</title>
		<link>http://midnightmuse.com.au/2009/11/27/source-control-needs-its-own-machine/</link>
		<comments>http://midnightmuse.com.au/2009/11/27/source-control-needs-its-own-machine/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 12:24:27 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=188</guid>
		<description><![CDATA[It was brought home to me today why source control should really sit on a separate computer. <a href="http://midnightmuse.com.au/2009/11/27/source-control-needs-its-own-machine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use Subversion. Not because I think it is any better than any other source control system. It&#8217;s just that I have come to know it and get used to it. But I was reminded today that regardless of the source control, or version control, program you are using, it should be on a separate PC.</p>
<p>Yesterday morning I was doing some work and everthing was fine. I had to go out for a few hours and when I returned in the afternoon my development computer had died. I rang up my friendly PC repair guy who said it is probably the power supply, but it could be the motherboard. I left it with him and came home.</p>
<p>The only problem was that I had to deliver an application to a client this morning. There were some minor changes that I hadn&#8217;t finished. I was planning on finishing them yesterday afternoon, but that was now impossible. But all was not lost. I was able to grab the latest build from myh buildserver pc which holds the Subversion repository and does continuous integration using TeamCity. The latest changes that I was working on were not in Subversion. I hadn&#8217;t checked them in yet because they weren&#8217;t complete and they would have broken the build if I had.</p>
<p>And if I had kept the source control repository on my development machine it would have been quite safe, and I do nightly backups, things would have been different. I could have got the lastest stuff from the nightly backup, but not as easily. Stuff is the operative word. I would have had to stuff around getting it onto my laptop and then recompiling and checking that everything was OK. Probably a couple of hours work.</p>
<p>But this time it was easy. I had to go out first thing this morning. I got home around 9:30, had a cup of coffee, copied the latest build onto CD and had it delivered to the client by 10:15.</p>
<p>A separate pc hosing source control and continuous integration can save a lot of time, a lot of hassle, and probably a lot of hair.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2009/11/27/source-control-needs-its-own-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Databinding</title>
		<link>http://midnightmuse.com.au/2009/10/29/databinding/</link>
		<comments>http://midnightmuse.com.au/2009/10/29/databinding/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 14:31:23 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=186</guid>
		<description><![CDATA[I have had a long held hatred of databinding. I am starting to change <a href="http://midnightmuse.com.au/2009/10/29/databinding/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Back in the good old days (were they really that good?) when I started programming in Windows I used Visual Basic version 3. The C++ guys down the hall would sneer at us, but we got stuff built pretty quickly compared to them, and, mostly, it worked.</p>
<p>Then along came VB4, and VB5 and VB6, each an improvement, although VB4 had some wrinkles that caused me problems. But that is all so long ago.</p>
<p>The one lingering problem, though, was databinding. Microsoft said that it was the greatest thing since sliced bread, and all the sample apps they provided worked just fine. But when you tried it in a real application it was problematic, at best. At worst, it just didn&#8217;t work.</p>
<p>I gave up using it in VB3. When each subsequent version came out I would try it again and again I would abandon it.</p>
<p>The problem is that some controls require it. The winforms datagrid, for example, could only be filled by using databinding, so I didn&#8217;t use the datagrid.</p>
<p>Then along .Net. Since I was a VB programmer I started out in VB .Net, and I tried databinding. It was supposed to be better, and maybe it was, but it was still pretty crook. So I still didn&#8217;t use the newfangled datagrid.</p>
<p>But things have changed. When Visual Studio 2005 came out I made the change to C#, and I once again tried databinding. And, at last it works. I still rarely use the datagrid, but I am binding to a lot of other controls, listboxes and combo boxes being the two most obvious.</p>
<p>I now use a lot of <a title="Developer Express" href="http://www.devexpress.com/" target="_self">Developer Express</a> controls and they make databinding a breeze.</p>
<p>I have read a lot of stuff from the Agile guys, and they generally don&#8217;t seem to like databinding. But if you don&#8217;t use it then you are fighting the tools that the IDE provides, rather than working with them. And now that WPF is getting better and better it is likely to become more mainstream, especially after Visual Studio 2010 comes out next year, databinding will take off in a big way. There are just so many ways that you can bind data in WPF, it makes no sense at all not to take advantage of it.</p>
<p>I have become a convert. Databinding has made my life so much simpler, and now it really does work.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2009/10/29/databinding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back to a WPF UI</title>
		<link>http://midnightmuse.com.au/2009/10/29/back-to-a-wpf-ui/</link>
		<comments>http://midnightmuse.com.au/2009/10/29/back-to-a-wpf-ui/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 14:11:13 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[Presenter]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=141</guid>
		<description><![CDATA[I have found a better solution to the dual screen problem <a href="http://midnightmuse.com.au/2009/10/29/back-to-a-wpf-ui/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In the previous post I wrote about the problem I had showing a WPF window on a second screen. And this is a major requirement of the application. After much searching I came to the conclusion that it could not be done easily. The only reasonable solution seemed to be building a winforms app and hosting a WPF control for the second screen. I tried that and it worked fine. The way to do it is pretty simple. I created a new project called WPFControls, it would get a better name in the real version â€“ this is just to try it out â€“ and created a WPF control which contained a Rich Textbox. It won&#8217;t stay that way; it will ultimately be a FlowDocumentReader or a FlowDocumentPageReader, but at this stage I don&#8217;t know which one. And in the previous code in WPF I had built a RichTextBox for editing songs and so, to test this line, I will just use the same code to load a song, hence the RTB.</p>
<p>The Rich TextBox loads the song from the database by reading in the flowdocument stored in the lyrics field for the song. All this is described in the previous articles.</p>
<p>On the windows form, which can  be shown on any screen, we place a control of type System.Windows.Forms.Integration.ElementHost. In my case this was given the name EditSongHost.<br />
When the EditSongForm is loaded it loads the WPF control and sets the Song property to the currently selected song.<br />
<code><br />
private void EditSongForm_Load(object sender, EventArgs e)<br />
{<br />
WpfControls.SongEditCtrl ctrl = new SongEditCtrl();<br />
ctrl.Song= song;<br />
EditSongHost.Child = ctrl;<br />
}<br />
</code></p>
<p>This worked just fine, but I now had a winforms application with some WPF controls, and this was a second best solution, as far as I was concerned. I really wanted a WPF application. I could have approximated that by building all the user controls in WPF and hosting all of them in windows forms, but that seemed to me to be madness. WPF is a relatively new technology, and maybe that was the only way possible at the moment. If so then, so be it.</p>
<p>But today I came across another solution on the <a href="http://forums.msdn.microsoft.com/en-US/wpf/thread/5d181304-8952-4663-8c3c-dc4d986aa8dd">Microsoft Forums</a>, in a reply given by Larry Olsen, WPF Program Manager. This is his solution</p>
<blockquote><p>1.<br />
Started a new WPF Application project in Visual Studio<br />
2.<br />
Added the needed references to System.Windows.Forms (needed for Screen) and System.Drawing (needed for Rectangle)<br />
3.<br />
Removed the StartupUri in the App.xaml file and overrode the OnStartup() method in code-behind. I did this because StartupUri points to just one Window, Window1.xaml, in the WPF Application template and OnStartup will let me control what happens when the application starts.<br />
4.<br />
Added Window2.xaml to the project so that I would have a second Window to display on a second monitor.<br />
5.<br />
Added code similar to the article you linked to the override of OnStartup  which was:</p>
<p>Code Block</p>
<p>protected override void OnStartup(StartupEventArgs e)<br />
{<br />
base.OnStartup(e);</p>
<p>Window1 w1 = new Window1();<br />
Window2 w2 = new Window2();</p>
<p>Screen s1 = Screen.AllScreens[0];<br />
Screen s2 = Screen.AllScreens[1];</p>
<p>Rectangle r1 = s1.WorkingArea;<br />
Rectangle r2 = s2.WorkingArea;</p>
<p>w1.Top = r1.Top;<br />
w1.Left = r1.Left;</p>
<p>w2.Top = r2.Top;<br />
w2.Left = r2.Left;</p>
<p>w1.Show();<br />
w2.Show();</p>
<p>w2.Owner = w1;</p>
<p>}</p></blockquote>
<p>I adapted that code so that the second window was displayed after clicking a button. It worked perfectly! I just need to make a few changes. First I needed to set the window style to none so that I had a full screen window with no title bar or maximise, minimise and close buttons. This is why it is important to set the window&#8217;s Owner property. If you don&#8217;t set that and close the main window the second screen is still active and the program is still running. In any event, the second screen needs to be entirely controlled by the primary screen.</p>
<p>When I ran the program the second screen duly opened, but it wasn&#8217;t maximised. So I set its WindowState to Maximized and then tried it. It was maximised but it was showing on the primary monitor, not the second monitor. Why was this happening? I have no idea. But after trying a few things I decided to call the Show method and then set the WindowState property to Maximized in code, after the Show() method. I don&#8217;t know why this makes a difference, but it does. Well, actually I can see why my solution works, but I don&#8217;t understand why setting the property before the Show() method makes a difference. I don&#8217;t know what is going on in the bowels of windows, and just to be sure I moved the WindowState property setting line of code to just before the Show() method, so that it was being set in code, not by the designer. I didn&#8217;t expect it to help, and it didn&#8217;t. No matter, it all seems to work fine.</p>
<p>Here is the code I used, hooked up to a temporary button<br />
<code><br />
private void btnShow_Click(object sender, RoutedEventArgs e)<br />
{<br />
DisplayWindow displayWindow = new DisplayWindow();<br />
Screen s2 = Screen.AllScreens[1];<br />
Rectangle rectangle = s2.WorkingArea;<br />
displayWindow.Top = rectangle.Top;<br />
displayWindow.Left = rectangle.Left;<br />
displayWindow.Show();<br />
displayWindow.WindowState = System.Windows.WindowState.Maximized;<br />
displayWindow.Owner = this;<br />
}<br />
</code></p>
<p>The only niggling doubt I have is that winforms and WPF use different units for screen and control measurement. Winforms uses pixels, and WPF doesn&#8217;t. Rather they have Device Independent Pixels which are equal to 1/96 of an inch. There are benefits to the way that WPF does its screen rendering, but even though it looks fine on my two monitor set up, I will have to test it on a projector which is likely to have a drifferent resolution to my monitor. I don&#8217;t think that WPF will have a problem with that, but the Screen properties, specifically the WorkingArea is a winforms property. I don&#8217;t expect a problem, but it will need to be checked.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2009/10/29/back-to-a-wpf-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entity Framework</title>
		<link>http://midnightmuse.com.au/2009/10/01/entity-framework/</link>
		<comments>http://midnightmuse.com.au/2009/10/01/entity-framework/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 15:39:00 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://midnightmuse.com.au/?p=179</guid>
		<description><![CDATA[I have recently tried out Microsoft's Entity Framework. It wasn't a happy experience. <a href="http://midnightmuse.com.au/2009/10/01/entity-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am working on a project for a client that is a little different to others that I have done. It is a simple project which needed two winforms applications. One was to be used by all and sundry, and the other was uesed by the project administrators.</p>
<p>I could have used one application, and usually I would have done so. Except that the first application was to be run on a system with a touch screen. I didn&#8217;t want a bunch of menus and a login screen for administrators. It was simpler to just write two applications.</p>
<p>The other difference with these apps from others that I am used to is that they use a MySql database. In the past all the applications I have written in the .Net world have used either MsAccess or SqlServer. Fortunately, the Access apps have been getting fewer, although I do have one on the go at the moment, and that is also a painful experience which I will write about in a subsequent post.</p>
<p>The problem with MySql is the data providers. I use an Object Relational Mapper for database access whenever I can. My ORM of choice is <a href="http://www.llblgen.com/">LLBLGen Pro</a>, a mature and powerful product. There are many others, and in the .Net sphere <a href="http://sourceforge.net/projects/nhibernate/">NHibernate</a> is probably the most popular. The problem I had is due to the licencing of the MySql data provider used by LLBLGen. I may have gotten this wrong, but at the time I wrote version 1 of these apps it looked like the problems were, if not insurmountable, at least difficult to overcome. So I wrote my own data access layer using datareaders and, in some cases, datasets. I wasn&#8217;t happy with the result, but it was a very small application and it worked. As with most small applications it has grown and I decided that I wanted a better data access layer. I didn&#8217;t feel that I had was robust enough and I wasn&#8217;t happy with the code. And I certainly wasn&#8217;t happy with the datasets as the program grew.</p>
<p>What to do?</p>
<p>Microsoft hs brought out two relatively new data access technologies. The oldest, and it has been around for a few years is LINQ &#8211; Language Integrated Queries. I really like LINQ, and combined with lambda expressions it gives you a very concise way to query collections. And along with LINQ came LinqToSql, the ability to use LINQ against a Sql database. You are now able to write something very similar to Sql queries in code, as opposed to a string expression. LinqToSql works with a number of different databases provided you only want to read the data. If you want to do updates or inserts then it will only work with Microsoft SqlServer. From what I have read there are no technical reasons for this, so I assume that it was a marketing decision.</p>
<p>More recently Microsoft has released Entity Framework. This has been described by Microsoft as <em>much more than an ORM.</em> My experience is a little different. It seems to me to be very much less than what we would expect in an ORM. Object Relational Mappers have been around for years now. They have been popular in many other platforms &#8211; Java,f or example has had Hibernate since 2001, I think. Other languages have used them since the early 1990&#8242;s. They aren&#8217;t a new phenomenon. If Microsoft had introduced Entity Framework in the early days of .NET, say when .Net 1.1 was all we had, then I think we could put up with what they have given us. But it is no longer 2004. The .Net world has moved on and in 2009 Entity Framework just isn&#8217;t good enough.</p>
<p>And it isn&#8217;t as if Microsoft cannot product good products. The CLR is a pretty good framework. Visual Studio is a good environment to work in, and VS 2010 looks like it will be very nice. WPF and Silverlight are not perfect but pretty good and getting better. C# is an enjoyable language to program in. The Java crowd will deride me for saying all this. But I believe that C# has overtaken Java and it is continuing to evolve. Microsoft has undoubtedly got some talented people. But they missed the boat with Entity Framework.</p>
<p>What&#8217;s wrong with it? First off, it is very slow. Over the past few years performance has become less of an issue in the sort of business applications that I write. Computers are fast. Most have multiple cores and memory to spare. In most of the applications I write the biggest impact on performance is data access. You have to go to the database, get it to its own crunching and return some data. Entity Framework uses reflection to create the objects. The first time you send a database call is the worst. After that it is is still slow, but getting closer to acceptable. LLBLGen, on the other hand, creates the classes as part of a data access project. The runtime experience is very good. It is no differenct from creating any other object once you have the data. The difference is that with a decent ORM your performance is once again determined by your database.</p>
<p>The second problem with Entity Framework is that it is very difficult to use. Julia Lerman has written a book about Entity Framework and is in the process of writing an update. She has an article, <a href="http://www.code-magazine.com/articleprint.aspx?quickid=0907071&amp;printmode=true"> 8 Entity Framework Gotchas</a> that is worth a read. Entity Framework is just not very intuitive.</p>
<p>The final problem I want to mention is the designer itself. Entity Framework runs inside of Visual Studio. You create an Entity Data Model item within a project. You are then taken to a wizard and from there you can create a model from your database. All well and good. But every table you need is placed on a visual canvas. The small application I was building only had eight tables, but that was more than enough to look at on one screen. What is it like when you have 50 tables which is not a large number. I recently did a project which had to query a database containing 24 tables and 27 views. And this was a relatively small application. I wouild have hated to look at my model in the Entity Framework designer, it would have been virtually impossible.</p>
<p>There is a new version of Entity Framework coming out soon. Perhaps it will ship with VS 2010. And I am prepared to give the new version anothe go. But at the moment it is practically unusable.</p>
]]></content:encoded>
			<wfw:commentRss>http://midnightmuse.com.au/2009/10/01/entity-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

