Saturday, June 27. 2009Home Network
I just finished off some updates to my home network so I thought I'd share a few pics of the main switch rack.
Here it is: ![]() The big thing you will probably notice is that most of the switches are not used and some only very sightly, I do have more switches than I really need at present! Here's what the box contains, working down from the top. 1) APC PDU – Power switcher. 2) Netgear POE switch 3) 3 COM POE switch 4) Netgear 10/100 Switch 5) Patch panel for the 22 outlets in my flat. 6) Netgear Gigabit Switch 7) HP 10/100 Switch. How my flats split: Kitchen: 2 Ports over cupboard on outside wall. 2 Ports over extractor hood/cupboards on inside wall. 4 Ports under worktop. Living room: 2 Ports by TV. 2 Ports by Rear wall. Bedroom: 2 Ports by door. Office (Bedroom 2): 2 Ports by door. 4 Ports by Server/workstation PCs. Airing cupboard: 2 Ports, yes I really do have 2 network ports in the airing cupboard! Most of the ports come from the main Netgear Gigabit switch. Currently I have 3 ports connected to the 3COM POE switch. I only intended to buy 1 POE switch but apparently their like buses. Having waited many months to get a good price on eBay the Netgear POE switch came up as a BIN so I immediately purchased it, then a few days latter I realised that I had one the 3COM POE switch I put a low-ball bid on, net result is 2 POE switches. This has the advantage that I can have one POE switch powering devices that I want on 24x7 and the other powering devices that I might not want on all the time, so giving me better control over power usage. If you want to know why I wanted POE switches you'll have to wait for another blog post! The 10/100 Netgear switch was the original switch I purchased to service the flat before it ran out of ports and I wanted something faster than 100M. I'm leaving it in the rack as it might well stay with the flat when I eventually move out and it's filling a hole I'd have to buy a blanking plate for otherwise. I was lucky enough to be given the gigabit switch and HP switch, currently the HP switch is also not used. At the top of the rack is my latest purchase, a UPC PDU (Power Distribution Unit), this means that I can switch off all the unneeded network switches and should I need to I can hard reboot any as well – I needed to do that a few months ago before the UPS was connected when a very brief brownout put the Netgear gigabit switch in a funny state and took down my network. If you look closely enough you will see the obvious problem – the PDU network comes from the gigabit switch, so if I have a dippy moment and power off that switch I can't switch it on again over the network (it would have been nice to see the APC PDU have 2x network ports!), so I will be sticking my head in the loft if that happens. Should the power fail and the UPS battery run out then the device will switch off, but it's set-up to automatically power on the Netgear switch when power is returned so hopefully I should regain control in that situation. I've got a few little side projects under way and wanted the APC PDU to play with as it was, but it's turned out to be useful as the POE switches can be noisy when switched on (although I've hacked them and replaced the little 40mm fans for quiet ones which makes a big difference), having 3+ switches all running little 40mm fans can be really noisy when it's in the loft and your trying to sleep! The whole lot is powered through a little APC UPS, I don't care much for the device, mainly because it screams when the power goes off and that's not amusing when it's in the loft – I've got a network monitor card for a SmartUPS so now all I need is to get a SmartUPS to replace the little one and I'll be happy. The cabinet it's self is a plastic 19” 7U cabinet I got off eBay, sadly most of the Netgear and 3COM switches were to deep for the original configuration of the cabinet – hence the reason the door is not fitted as it won't close – fortunately their were 2 sets of mounts for the mounting brackets and I was able to bring them forward and the switches just about fit now (about 300mm) otherwise I had them resting on top of the case which was a bit naff. Here's the switch depths of the 2 POE switches, the maximum I can get in my cabinet is 300mm and that has to include the power lead coming out the back of the switches. ![]() At the back of the case theirs a bit snake of CAT5 that heads off all over the loft: ![]() This was before I got the PDU, hence the mass of mains leads. Wiring up the patch panel has been interesting: ![]() You can see that was before I rearranged the switches. Tuesday, May 19. 2009An unhandled exception has occurred. The image is not found.
A while ago I updated my exchange rate sites (Dollars2Pounds et al) to use the "new" ASP.NET Chart control, after some initial testing every thing appeared to be going well and the live websites were updated with the chart control.
Shortly after deploying the servers event log filled up with messages along these lines: Event code: 3005 Event message: An unhandled exception has occurred. Event time: 5/19/2009 1:17:59 AM Event time (UTC): 5/19/2009 12:17:59 AM Exception information: Exception type: ArgumentException Exception message: The image is not found. Request information: Request URL: http://www.yuan2dollars.com/ChartImg.axd?i=chart_6_6.png&g=e036ff271be14badb39473c8d04f8609 Request path: /ChartImg.axd T Stack trace: at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.ProcessSavedChartImage(HttpContext context) at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) I've been trying to get to the root cause for some time concerned that visitors to the websites were seeing blank images and I followed various suggestions based on image cache lifetime, temp folder permissions, phase of the moon and so on. It wasn't until just recently when I followed Scott Hanselman's top tip of implementing elmah that the real cause of the problem became obvious. It's Google causing all the exceptions! Well googlebot and other search engines. Their right in front of me under the “ALL_RAW” heading of the server variables was the answer "Connection: Keep-alive Accept: / Accept-Encoding: gzip,deflate From: googlebot(at)googlebot.com" I should have guessed that! What happens is googlebot request the page, so the charting control creates the image and renders a image tag for it, caching the image for a predefined period of time. Naturally googlebot does what it does best, it saves that link to the image and tries to re-index it time and time again at a much latter date (weeks), by the time googlebot comes back for the image a second time the cache has long since been updated and naturally the image no longer exists and the naming convention of the image means that it's not going to get the replacement. Recently I also ran some performance test with the charts in place using LoadImpact, they provide some limited and basic performance testing for free, but its more than enough for simple sites like mine to see that I had serious performance issues on my sites when more than a couple of visitors were hitting the site at the same time. The charts on each pages were taking about one second to render (it's not surprising as I'm trying to render something like 26,000 data points for the 3 month USD/GBP chart and 7,000 for the other 3 month charts on a 2.4GHz P4). With the CPU fully pegged for a second trying to produce those charts it doesn't take long before the delay hits in if more than a couple of users access the page at the same time. ![]() My fix for this has been fairly simple, the charts are now updated in the background by a cache expired event and are written to a static .png file with a fixed name. The charts are stored in a “Charts” folder and existing files are replaced with fresh images, the page is rendered with a normal img tag so when googlebot visits it can get the latest chart using the correct name and page rendering now happens in about 6ms. Interestingly this performance fix has also seen a 10% increase in traffic. Tips:
Monday, April 06. 2009Dinner Timer Lite 1.2.0 Released
I've just uploaded the new version of Dinner Timer Lite (1.2.0) and updated the DinnerTimer.com website to add the new version and update the screen shots.
Some new additions this time are:
As well as many more improvements which are listed on the Download page. Wednesday, January 14. 2009Open Plan Offices – What a HUGE Mistake.
I read earlier today on news.com.au that Open-plan offices are making knowledge workers sick, say Australian scientists - No kidding!
![]() Problems with open plan offices are hardly a secret. Joel has promoted office spaces for developers for a long time, it's also covered in PeopleWare - although sadly I don't think many managers actually read that book, Jeff Atwood of Coding Horror covered it and I'm sure there are many more instances. I think the whole office thing is back to front, if you insist on having an open plan office then the managers should be in the open plan parts and the knowledge workers should have the separate quiet offices – managers have to communicate more and know what's happening much more than the workers. Knowledge workers need to be productive and granted communications is really important but not as important as being able to focus on the work. Now I'm sure most companies would want better value for money out of their knowledge workers and to have a better product on the market. I see a quiet working environment as a major step towards that. So employers next time you are wondering why your software project cost so much money, why it was so late, why it's so buggy and not as good as the competitors and why there appears to be a skills shortage start by think a bit closer to home and how the business uses it's resources (sorry employees). Sadly having an office has been seen as a status symbol. More fool the companies that make their knowledge workers work in a noisy office and tuck their managers away in nice quiet offices – You are wasting a fortune in employee productive. With the exception of a few, generally managers are only their to support the workers – without the workers the manager is pointless – the workers are the important bit! (Hint: Think about small companies, they do really well given the lack of managers). I've had the miss-fortune to work in an open plan office situation for my last 5 proper jobs (I don't count my own business) over the previous 8 years and I'm one of those people who is really sensitive to the noise around me so I can totally agree with the findings. Noisy environments are stressful, frustrating and prevent you from doing your job to the best of your abilities. Most of my previous employers have been biotech, pharma or life science instrumentation but my current employer is a large IT focused software company and of all the places I expected to understand about the damage noise does I would expect my current employer to understand(*), sadly this is not the case. Now the sound of developers working hard is quietness with a few keyboard strokes and the occasional conversation. If like my current position your do code reviews prior to checking in code then this adds to the background noise. If like my current position you have more than 1 person who loves the sound of their own voice and is loud then you are doomed. ![]() Take the bug fixing part of the project when your trying to get the application out of the door (and probably didn't budget much time for bug fixing so it's critical to get it done asap). All the developers are fixing bugs, if you have an office of 20 developers, each fixing 1 bug/day which results in a 10 minute code review. That's 20 * 10 minutes of conversation about code reviews per day. Or put it another way 3 1/3 hours worth of background conversations happing every day. If those code reviews are about 10 minutes apart then you get a full day of distractions for all of the 20 developer in that one office. Guess what, it's so easy to introduce side effects and bugs whilst fixing a bug, especially if you are not concentrating, so whilst everybody is trying hard to concentrate to fix the bug and not introduce more they are subject to 50% of the time being a distraction caused by a code review happening in the office (and most likely once the quietness is broken other people will start chatting as well which makes it even noisier). Any then we wonder why so many extra problems get introduced during the bug fix cycle! Personally I'm a late starter, I like working latter in the day when everybody has gone home and the office is quiet – I generally get more done during the last 1-2 hours than I'm able to do for the bulk of the day because of the background distractions. Many friends criticise me for being late, having the pleasure of missing the rush hour traffic to and from work, but you know what, it lowers my stress levels, I get more done and I'm happier and I guess whilst I'm not stuck in traffic that helps lower my carbon footprint. Here's some hints to employers looking to get better value for money from developers (I'm sure this or variations of this apply to a lot of developers):
Here's what doesn't work:
Not long ago I changed jobs because my previous employer went into administration and at the end of the day I had 3 offers to choose from. The first of these was offering £5k more than the one I accepted. Here's why I turned it down:
So how many employers would like to get someone at a discount of £5,000/year? I'm guessing quit a lot. Share holders – how happy would you be that the company you own part of is paying a £5,000 premium? That little office space is going to pay for it's self really quickly and it's highly likely that the cost of flexible working hours is nothing – sounds like a bargain to me. So improved productive, cheaper staff, less stress and most likely lower employee turn over can all be achieved for free, all that needs to be changed is the mindset, so it's never going to happen is it. ![]() If like me you are a developer and struggling in a noisy office for a company that doesn't get it and your kicking your self for taking a duff job and your now stuck finding something you prefer better because the economy fell apart then check out ChatterBlocker it works much better than music at drowning out background voices, it's not distracting, you can put it up loud if you need to without effecting others and it also works great in the background when listening to podcasts to drown out the noisy people in the office! (*) although having said that they also think that paying for an employees eye test means paying the legal minimum and saving about £10 on the cost of a normal test, which given us developers spend the day staring at the monitor you'd think they would care about out eyes – they pay for Bupa, provide tea, coffee, fruit but save a few quid on the eye test – go figure! (Guess which bit HR are responsible for!) (**) I wonder if in a few years time we will see a new set of health and safety litigation where knowledge works sue employers for damaged hearing caused by the constant use of headphones + music used on recommendation by their manager to drown out the background noise of the open plan office. Windows 7 .iso file handling – Close but No Cigar!
Typically when I have an iso file what I want to do is mount it as a DVD Drive, not spend 10 minutes burning the thing just so I can then read it on the same machine and in the process wasting a DVD and causing more environmental damage with the plastic. OK so that's useful if I take it to a different machine or need to boot from the disk, but that's rare for me now days.
Guess what, in Windows 7 you can burn a iso image to disk. Great, that's a nice touch, but you can't mount the thing! ![]() One cool addition to Windows 7 is being able to create and map a .vhd (virtual disk) as a disk on the machine in Disk Management (I've not tried it yet – apparently you can even boot from it – freaky & cool!). Now tell me why can I do that and yet I can not attach a iso image file, that's massively frustrating. What makes it really crazy is that when you download from MSDN you get .iso files, now even with Vista you have to go and get extra software to handle them. At least you can burn them easily in W7 but really, I should be able to download a SQL server 2008 iso from MSDN, right click and mount it in W7 and install it. I store all the iso's I download from MSDN on a network share and access them as I need them. If I burn them to disk I just loose them, so the bulk iso storage works really well for me. It's similar in Server 2008 R2, no option to mount the CD/DVD and by default the burn option isn't their either – but then that's for the best really as I'd want the default install to be locked down as much as possible. I did wonder if their was some kind of legal, patent, copyright issue around the iso image thing, but Hyper-V can mount an iso image to be use as a CD/DVD drive in a Hyper-V instance so why can't Windows 7 do that? Please Microsoft give us the ability to mount an iso image as a DVD drive! Until they do I'm sticking with MagicISO which works a treat – and it's freeware! (Thank you MagicIso inc!). I'm also hoping one day we see DVD drives that can do LightScribe or similar without having to flip the disk but I doubt we will ever see that (at least for a reasonable price!). Windows 7 Taskbar – FAIL!
Like many others I've been trying out Windows 7 just recently.
My trial of it didn't start well with the MSDN version being available around the same time as the public release – I mistakenly thoughts as a paying MSDN subscriber I might get it a little earlier but hey, I get to find out and fix any problems in my applications at the same time my users get to see the issues. Still at least my stuff doesn't eat your MP3's! I installed a test version of W7 in a Hyper-V instance which didn't go all that smoothly either, first time around and I had to have a second go, but that might have been because I put the iso of Windows 7 on a NAS and a network problem may have crept in causing the installation not to find the files it wanted. Next (I think) because I access my Hyper-V set-up using the Hyper-V MMC snap-in from my Vista box copy and paste doesn't work between the two machines so entering the product code and trying to paste the Url in to browse for the patch to stop W7 trashing my MP3's was painful. But hey, I should save my Hyper-V bashing for another day as I could go on for some time about that! What really annoys me with W7 is what has happened to the taskbar. Apparently I'm not alone. Don't get me wrong, I'm not against change and I like a lot of what's changed over the years in Windows, generally it's been for the better. With Vista, XP and those before it I actually like the quick launch toolbar. I like it having small icons and I use it heavily (I have 18 apps in there). I also like the notification area, not massively but for a lot of applications it's perfect. Theirs a number of application I don't want in their and think they should live else where (like the ATI stuff, SmartStamp, OpenOffice QuickStart) but I can live with that. In XP Microsoft gave us the collapsing notification area and initially I adopted that but ended up finding it annoying, the worst of which was with Outlook email notification as I had times when XP would decide it should hide it and then you didn't get to see it hence ignoring new email (OK so not a bad thing) or other times when receiving a lot of emails it would cause the notification area to shrink and grow which was really annoying and had a side effect on the running programs and made it difficult to hit the correct icon. There is one big problem with the quick launch, toolbar and notification area in XP and Vista and it's this that I believe Microsoft are trying to solve with the redesign in Windows 7. The problem is you can't fit much into the default Quick Launch and Notification areas. So the way I see it is you have two options:
Let me explain why I don't like the new Windows 7 Toolbar:
Here's how I fix the Vista/XP ToolBar problems:I make the taskbar 2 units high. Nice and Simple! You get a lot more running applications in the taskbar before it gets overly cluttered (to the point that my head gets cluttered before the taskbar).
On a default Windows Vista/XP set-up anything more than 6 icons in the notification area is a pain and similar for the quick launch area. With 2 units high I have 18 quick launch apps, 13 notification icons, the date, time and day and currently 11 running applications without a problem. Now I have a 22” wide-screen monitor so things are a little easier but I run exactly the same set-up at work where I have only a 19” square monitor and it works just as well, if not better as the quick launch and notification area don't take up hardly any room. So you have two choices: Either:
Personally, I think that the XP/Vista taskbar works well and that making it 2 units high solves the problems with the quick launch and the notification area and making the change in Windows 7 just introduces code that isn't needed and with no doubt lots of new and fun bugs. Fingers crossed that theirs an option to use the previous taskbar implementation in W7 or failing that some amusing adverts mocking the new taskbar so the pain has some good. Tuesday, December 23. 2008DNS Problems
Apologies for the recent outage of Dollars2Pounds and the other exchange rate sites. You may not have noticed if you or your ISP had the DNS values in cache as the site was actually up and running.
Just a couple of days ago I updated Dollars2Pounds to use the DNS servers of the host I have the server with, thinking that it would reduce the load on my servers and that they would be less likely to go down than my servers. How very wrong I was, earlier this evening I got an email from the site monitoring service I use (site up time) telling me that Dollars2Pounds was unreachable. A quick check and the site was up and running but the DNS servers were not returning anything and the host providers main web site was down as well. Hopefully this is a rare occurrence, however since EV1Servers got taken over things have gone badly, not least the 3 day outage recently when a transformer blew up. Lets hope things improve as it's really painful to change hosts and you don't really know what will happen at a new hosts. I've also managed to accidentally knock the odd site off line over the past week whilst I've been setting up the accounts on the new server. The good news is that all my exchange rates sites (Dollars2Pounds, Pounds2Euro etc.) are now on a more powerful server and using a more up to date exchange rate source which is updated every 15 or 60 mins. dependent on the currency pair. Wednesday, December 17. 2008MSBuild Item List Iteration
Repeating a task for each item in a MSBuild item list is really easy if the task supports ; seperated lists, if not, well it's still easy but trying to remember the syntax is another matter!
This keeps catching me out and I've seen few examples of its use around so if for no other reason than as a reminder to myself here's how to iterate a list of items with MSBuild. Define your item list as something like: <ItemGroup> <InstallerFiles Include="$(MSBuildProjectDirectory)\Setup\**\Release\*.msi" /> </ItemGroup> In this example I have a folder .\Setup\ which contains multiple subfolders of different setup projects which generate msi files. Method 1: <Target Name="CopyOutput"> <Message Text="Copying installers to Build Output folder. Source = @(InstallerFiles)"/> <Copy SourceFiles="@(InstallerFiles)" DestinationFolder="$(BuildOutputFolder)" /> </Target> This example copies all of the msi files into the BuildOutputFolder. This method relies on the Copy target to accept a “;” separated list of values. Sadly if you have a task that only takes a single value then your a little stuffed with the @ operator. Method 2: <Target Name="CopyOutput"> <Message Text="Copying installers to Build Output folder. Source = %(InstallerFiles.FullPath)"/> <Copy SourceFiles="%(InstallerFiles.FullPath)" DestinationFolder="$(BuildOutputFolder)" /> </Target> This method will call the Copy task once for each item in the InstallerFiles list. But that's not really a fair example as you can just use the @ operator for Copy. Here's another example that's more appropriate. <PropertyGroup> <DeploymentLocalPath>$(CCNetWorkingDirectory)\Setup\</DeploymentLocalPath> <VersionUpdater>VersionVDProj.exe</VersionUpdater> <VerisonFile>$(CCNetWorkingDirectory)\Version.txt</VerisonFile> </PropertyGroup> <ItemGroup> <SetupProjects Include="$(DeploymentLocalPath)**\*.vdproj" /> </ItemGroup> <Target Name="Version"> <!-- Some bits to set MSIVersion normally go here and have been removed for clarity → <Exec Command='$(VersionUpdater) -msi "%(SetupProjects.FullPath)" version=$(MSIVersion)'/> </Target> Here I use the VS.NET Deployment Project Version Updater (http://www.codeproject.com/KB/install/VersionVDProj.aspx) to update each of the setup projects with the MSIVersion number, but this could be any colsole application that took a filename. The .FullPath is a “Wellknown Item Metadata” property. Theirs more listed on the MSDN page Sara Ford also has an example of a good use of metadata for recursive copying (http://blogs.msdn.com/saraford/archive/2005/11/08/490445.aspx). Theirs also an interesting MSBuild wiki over on Channel 9. Sunday, September 14. 2008Build Indicator - Part 3 (The software)
This is part 3 of the Build Indicator series. In this part I describe the communications library and using this as part of a MSBuild task as well as the test harness.
Previous Parts :
License : Please use, copy and modify this code as you wish, all I ask is that you don’t take credit for the bits I wrote. You should ensure it’s fit for purpose before using it. The Arduino build indicator works via fairly simple RS232 communications so you can adapt your own build monitor (or other system) to use the indicator easily, or download the Arduino build indicator library and use/modify to suite your needs. You can also download the firmare for the Arduino from here. The library consists of 3 projects at this time :
All the software described here is written in C# and targets .NET 2.0 so it should be usable from any .Net 2.0+ project, you can add the AnalysisUK.BuildIndicators.Arduino.dll as a reference or include the project and reference that as part of the solution. In the download is a Arduino.sln Visual Studio 2005 solution file which includes the main communications project, the MSBuild task project and the Test Harness WinForms program. The Communications project :This project consists of four classes and one enumeration.
Using the controller : The below code is from the MSBuild task and shows how to use the command and controller. When the SendCommand method is called with the command this is sent to the Arduino which updates the output corresponding to the ProjectNumber to show the Status. Using MSBuild :Included in the download is a MSBuild task. This can be included in a MSBuild project and called to update the status. You can either copy the targets and task reference from the TestBuildStatusIndicator.proj MSBuild file or use the file directly. You will need to correct the AssemblyFile location. The ProjectNumber and CommPort should be updated to the Comm port the Arduino is on and the appropriate project number. To call the sample MSBuild tasks from a Visual Studio command line use : MSBuild TestBuildStatusIndicator.proj /t:IndicateBuildGood MSBuild TestBuildStatusIndicator.proj /t:IndicateBuilding MSBuild TestBuildStatusIndicator.proj /t:IndicateBuildFailed The MSBuild targets are defined as : Using the Test Harness :Also included in the project is a test harness, this is a simple WinForms application which again uses the main communications project and provides a simple UI to exercise the build indicator. ![]() Future parts :I'm currently working on including the Arduino build indicator into CCTray for use with CCNET so that will be available in a future posting. Thursday, August 28. 2008Dinner Timer Lite V1.1 Released – and it's Huge!
Literally, huge. Below is a photo of my 22” wide-screen monitor with Dinner Timer Lite running. As you can see it fills the screen nicely with a big font – now you can easily see Dinner Timer Lite from the other end of the kitchen or further.
![]() before you ask, yes you can make it smaller! Just in-case you are wondering, yes that is the snowman build indicator on the left and it's not lit up because the build machine wasn't running (saving a little electricity and reducing the heat in the office!). There are a few other cool additions to V1.1, these include : Added Twitter notifier – now notify your friends and family automatically when you start dinner, when it will be ready, tweet notifications when it's about to be ready, when it's ready and through Dinner Timer Lite's unique overrun timer tweet when the dinners burnt. Here's screen shot of setting up the Twitter notifier to send out a message when the timer has overrun : ![]() Here's a screen shot of my Twitter tweets. You can also follow me as BookSwapSteve on Twitter ![]() I've also improved bubble notifications – Bubble and twitter notifiers now support text template replacements. Include any of the following for them to be replaced with the appropriate values when run : {{RunMins}}, {{StartTime}}, {{EndTime}}, {{MinsRemaining}}, {{MinsOverrun}}. Additional sounds for the sound notifier including : Cow moo, Air horn, Alarm beep, Alarm clock beep, Alarm ring, All clear, Ambulance, Aooga horn, Boat air horn, Boing, Boing2, Boxing bell multi, Bullet ricochet, Buzzer, Buzzer 2, Buzzer 3, Buzzer 4, Buzzer 5, Buzzer heavy, Buzz through loud, Buzz thru and Chainsaw. The time options available in the drop down list is now user configurable and includes the ability to name the times. e.g. you can enter a timer called "Pizza" and have it set as a 12 minute timer, the list will then show Pizza which can be easily selected and when the timer is started it will run for 12 minutes. Here's a sample of modifying the time option to show pizza : ![]() ![]() The options boxes have been resized for the default Windows Vista font size. I've also added warnings for opacity settings where the timer may not be visible and a extra context menu item has been added to the notification area icon to reveal the timer if it is difficult to see. Both myself and a few others had managed to get Dinner Timer Lite to be so transparent that we couldn't find it to restore it. I've also changed the installer to be a single exe so no unzipping required and the binaries and installer are digitally signed so you know their genuinely from me (Analysis UK). Their are also various under-the-cover improvements to facilitate some new features in the next release, including the first stage of splitting out of the notifiers from the main application with the intention of allowing developers to create their own notifier plugins, but thats going to have to wait for a future version before it's fully implemented. Monday, August 25. 2008Moving from .NET 2.0 to .NET 3.5 on Plesk - welcome to Server Application Unavailable errors
I just uploaded a new version of DinnerTimer.com which moved from being a .net 2.0 site to a .net 3.5 site, the server has .net 3.5 installed and every thing went well until I navigated to DinnerTimer.com
I was greeted by : Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. The error message in the event log was : Exception: System.IO.FileLoadException Message: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied. This struck me as a little crazy as all my other sites on the server are .NET 2.0 and the previous site was .NET 2.0. After much searching on the net and trying a variety of things (including giving permission to the various IIS accounts to .net 3/3.5 folders in windows folder and setting up a dedicated 3.5 App pool for the site) I finally added IIS_WPG permissions on the "Web Sites" folder in IIS manager and the site magically appeared. Now I just have to wonder what the security implications are and if that broke any other sites. You have to love simple upgrades! I'm not sure if this is a general issue with IIS or because I'm running plesk which uses different security & user settings to a normal IIS setup. Friday, August 22. 2008Analysis UK email problems
Apologies to anybody that's tried to email me in the last week but my emails been broken.
It turns out that the email service I use as a front end had an old personal email address in their billing information for me, so when my annual subscription was due I didn't get a reminder because I no longer have the personal email address I used (I finally ditched Demon and sadly lost the email address I had with them since about 1998 – my advice is don't get an email address tied to your internet provider – better yet, get your own domain name and use that for email so you are not tied to any company – but be sure to remember to renew your domain name!). Having had lots of spam recently I through that the reduced level of emails was just because the spam was slowing down – the automated status emails from my web sites were still coming through because they went directly to the mail server and not via the front end thing, so it looked like I was still getting emails on that account, hence it wasn't until I sent my self an email from a separate account (I know – I need to get out more) and it bounced that I realised something was wrong. Hopefully all fixed now. The irony of the situation is that I signed up with the service so that I wouldn't loose emails if my email server went down. They provide 2 front end mail delivery servers that forward it onto the real mail server when it's running. I think I've lost more email because of it than I ever lost because my server was down. Vista 64 Blue Screen Hell
I recently updated my development box to a nice new quad core processor and with it stuck in 8Gigs of ram. I would have been more than happy to stick with Windows XP as I had on my old dev box but the 32 bit version is limited to 4G (more like 3.5G) of ram so all that extra goodness would have been wasted, hence I crazily decided to opt for Vista 64.
What a mistake! It's like using Windows ME all over again and we all know what a terrible product that was. So to start with the motherboard an Asus P5Q PRO for some reason doesn't support sleep which is a big thing with Vista, I would go off to have dinner and come back to find the PC rebooting because it had gone to sleep. Sadly I wasn't always that lucky – it would often corrupt the CMOS and loose the date/time. If I had one of my Arduino based projects such as the connected it would also be frozen at the Bios Legacy USB detect stage. I can't really blame Vista for what is a motherboard problem so I've disabled the sleep function and replaced it on the Start menu with Shutdown. When I wrote LazyLoad I didn't think it would be useful on Vista because of the improvements Microsoft made – It hasn't taken long for me to realise LazyLoad is still well worth running on Vista! So onto the real big problem I'm having, almost daily blue screen of death's. This appears to be caused by the ATI graphics card – a Radeon HD 3650, just great. I regularly get a blank screen followed by Vista telling me it's recovered from a stopped graphics driver. However almost daily the screens start blinking darkness and then when I've had enough time to glimpse at the work I'm about to loose it all goes blue claiming an ati driver failed. Just to really annoy me when the machine reboots Vista prompts with it's “Windows has recovered from an unexpected shutdown” and gives me a “Check for solution” option, it then appears to do something, followed by quietly hiding it's self never to be seen again, not a sorry we couldn't find anything, or a try the vendors web site for the latest drivers, or a yep we know another ati driver problem, nope, it just disappears as if it's embarrassed and wants to quietly leave the room having wet it's self. ![]() I've had ATI cards before and not liked them, I really should have known better. Whilst looking for the link for the 3650 on the ATI site the search summed ati up for me. I entered hd 3650 and hit enter to search, not realising I had to change the “Select Site:” drop down. I got a JavaScript box saying “Please select a site.” and they kindly cleared my search text so I had to enter it again (whilst not making the same mistake of hitting enter) and then select the ATI site. How could something so simple be so unfriendly? And what's with the improved TCP/IP stack in Vista. I though networking with Vista was supposed to be much improved. If I watch a movie that's on another machine one of two things happens, either the file explorer will freeze and show the green progress bar whilst trying to browse the folders or when I finally open the file my whole PC will freeze whilst Windows Media player opens the file. And if the other machine is busy doing something like a backup I really know about it on my Vista box (BTW – often the other machine is a Vista box!). I thought with 4 cores a gigabit network and an improved TCP stack Vista would still be usable whilst it tried to sort out connections with networked machines. My old XP box with it's single processor was is so much better for networking. As for the new “improved” windows explorer, I so hate it, I mean really hate it. If I'm trying to copy files or folders with Explorer in details view (which I prefer) from one location to another I regularly end up with them going into a sub folder of the destination because of the change in the way the hover selection works as it's really difficult to get exactly between the folders when dropping. As for default view (list view) that's just to annoying, You've got loads of extra column headings and if you have a long file name it's often obscured, it looks like you can resize the columns but that doesn't work – you have to change to details view to do that – it gets me EVERY time and annoys me intensely every time. Is it just me or has the audio stuff got worse, my last box (XP) pushed out the audio via the SP/DIF and headphones socket at the same time, I can't see how to do that in Vista, so if I want to switch from headphones to speakers I have to stop what I'm listening to, change the default or use something like WinAmp's settings to change the output (not easy to get to) then change to the RCA Digital output. What a pain in the ****, I want both outputs together – is that such a stupid requirement? I wonder if that's another Asus special. I'm so very glad FireFox remembers the pages I had open, all to often I've been part way through reading an article for the PC to blue screen on me and by the time I'm back up and running I've forgotten where I found the article. Fire up FireFox and restore - magic! I so wish IE did the same, especially as it's a lot less stable than FireFox and crashes it's self frequently. So in conclusion, it's really great so much effort has gone into the Aero to make Vista look nice whilst introducing whole new instability issues, revaming Windows Explorer to take annoying to a whole new level whilst totally defeating usability and that the TCP has been speeded up to the point that Vista to Vista networking freezes the machine and browsing a file share regularly messes up, that's on top of the slew of security measures which resulted in me being unable to browse my NAS without having to get into the depths of Vista settings. I appreciate most of the problems are actually hardware (MB/Graphics card) but it's still annoying to have seen so much effort go into making the thing look nice only to have it fall over, I've seen it all to often with various products where the manufacture has put lots of effort into making the thing look really nice but failed to make a usable product (more on that and my home automation problems latter). Take for example software products that have their window an unusual shape - I know instantly that I'm not going to be able to use it, all to often I've tried software where the products a funny shape and the functionality and usability of the product are just so poor – please please please lets get back to making usable products and get over our obsessive desire for things to look pretty whilst not worrying about being able to use them. Well the good news is in the hour it's taken me to write this the machines not blue screened! Monday, July 07. 2008Build Indicator – Part 2 (The firmware)
This is part 2 of the Build Indicator series. Part 1 – the construction of the hardware is here. The firmware is written using the Arduino’s own programming language which is much like C/C++, using the IDE provided it’s easy to develop the code and push it down to the Arduino. I decided that as the Arduino has 13 IO pins it would be a shame not to make these available for 6 build indicators so 6 individual projects could be monitored. I’ve not used OO to implement the code so it’s a little messy with individual arrays for project status, red and green led pins which are indexed based on the project number. I think you can create classes but this has to be done in external C++ files so for a simple application like this I didn’t worry to add that extra complexity. Serial (RS232) communications is used to send a status message down to the Arduino build indicator to update the project status. The full Arduino build indicator code can be download here. License : Please use, copy and modify this code as you wish, all I ask is that you don’t take credit for the bits I wrote. You should ensure it’s fit for purpose before using it. Variable declaration : 1 /* 2 Build Indicator (c) Analysis UK Ltd 2008 3 * 4 Digital Pin Assignments: 5 0 - RX 6 1 - TX 7 2 - Project 6 - Green LED 8 3 - Project 6 - Red LED 9 4 - Project 5 - Green LED 10 5 - Project 5 - Red LED 11 6 - Project 4 - Green LED 12 7 - Project 4 - Red LED 13 8 - Project 3 - Green LED 14 9 - Project 3 - Red LED 15 10 - Project 2 - Green LED 16 11 - Project 2 - Red LED 17 12 - Project 1 - Green LED 18 13 - Project 1 - Red LED 19 */ 20 21 #define VERSION "1.0" 22 23 // Project not enabled of not connected. 24 int PROJECT_OFF = 0; 25 26 // Project build failed 27 int PROJECT_FAIL = 1; // 001 28 29 // Project build good 30 int PROJECT_GOOD = 2; // 010 31 32 // project building from a failed project. 33 int PROJECT_BUILDING_FAIL = 5; // 101 34 35 // project building from a good build. 36 int PROJECT_BUILDING_GOOD = 6; // 110 37 38 // Maximum number of projects. 39 int maxProjects = 6; 40 41 // Project status codes. Indexed by project. 42 int projectStatus[] = { 43 0, 0, 0, 0, 0, 0}; 44 45 // Pins for the Red LEDs. Indexed by project. 46 int redLEDPin[] = { 47 13, 11, 9, 7, 5, 3}; 48 49 // Pins for the Green LEDs. Indexed by project. 50 int greenLEDPin[] = { 51 12, 10, 8, 6, 4, 2}; // pins 0 and 1 reserverd for RS232. The arrays redLEDPin and greenLEDPin represent the pins to use for the red/green leds and are indexed on the project number (i.e. project 0's red led is on pin 13). The array projectStatus holds the status of the project and again is indexed by the project number. Setup: 54 // run once, when the sketch starts 55 void setup() 56 { 57 // Initialise the ports for output to drive the LEDs 58 for (int i=0; i<maxProjects; i++) { 59 pinMode(greenLEDPin[i], OUTPUT); // sets the digital pin as output for the green/blue part of the tri color LED 60 pinMode(redLEDPin[i], OUTPUT); // sets the digital pin as output for the red part of the tri color LED 61 } 62 63 // Setup Serial communications 64 Serial.begin(57600); 65 } The setup method iterates through all the projects setting up the pins designated as led’s for output and then sets up serial communications at a baud rate or 57,600. Fortunately the Arduino takes care of the difficult serial comms bits for us. Main Loop: 67 // Main loop, runs over and over again 68 void loop() 69 { 70 // Check and Read settings from PC 71 ReadCommands(); 72 73 // Update the LED's to indicate project status' 74 UpdateLEDs(); 75 76 // Idle. 77 Idle(); 78 } 79 The loop method is the main application loop that the Arduino will enter once setup is complete and will keep repeating. Within loop we call 3 basic methods, ReadCommands() which will check the serial port for commands from the host, UpdateLEDs() which will update the leds based on the project status and Idle() which just inserts a small delay but can be used for other background tasks. The comms protocol is a fairly simple one. All messages should start with a byte value of 2 and terminate with a byte value of 3 so the Arduino can easily know when a instruction has been received. To update a project status send the ascii string “@P[x]=y” with x being the project number 1-6 and y being the status (0, 1, 2, 5, 6). To query the version number of the firmware send ?V. I’ve stolen the comms protocol from another project I’m working on with the Arduino that has more commands and queries so I’ve based all commands where the Arduino has to do work on the @ character and all queries on the ? character to help separate out the commands and queries. RS232 Message handling: 86 // Read commands sent from the PC 87 void ReadCommands() 88 { 89 // Check if serial data available, if so then read this in 90 91 // Read all from the serial port until no more bytes available looking for the 92 // start byte (1) of a message. 93 while (Serial.available()) { 94 //read the incoming byte: 95 int incomingByte = Serial.read(); 96 97 // Start identifier. STX 98 if (incomingByte == 2) { 99 // Found start byte now read in until we get the end of message byte. 100 ReadSeialCommand(); 101 return; 102 } 103 } 104 } 105 106 // Read a command from the serial port. Read until the read byte 107 // is an end of message (new line) indicator. 108 void ReadSeialCommand() { 109 // Expect maximum of 25 bytes (normally 6) 110 byte buffer[25]; 111 int index=0; 112 113 while (true) { 114 if (Serial.available()) { 115 // read the incoming byte: 116 int incomingByte = Serial.read(); 117 118 // Terminating byte 119 // Wait for ETX (End of text - transmision) 120 if (incomingByte==3) { 121 ProcessRequest(buffer); 122 return; 123 } 124 else { 125 buffer[index] = incomingByte; 126 index++; 127 } 128 129 // Check for buffer overflow and give up if it has. 130 if (index>25) { 131 Serial.print("Error:Buffer Overflow.\n\r"); 132 return; 133 } 134 } 135 } 136 } 137 138 void ProcessRequest( |