Posts

  • Kotlin, Dagger2 and Butterknife

    I have started a new app. I know I have written about setting up an app to use Dagger2 in the past but this time I am using Dagger2 and Butterknife with Android Studio 3 and Kotlin. Dagger2 and Butterknife are not new and are well documented but using them in a Kotlin app was less well documented as I setup this app. There are some things that I needed to get used to before...
  • Windows Media Center in NZ using DVB-S - part 2

    I have written before about getting Windows Media Center working in New Zealand using DVB-T and DVB-S. This covers accessing Freeview TV using an ariel and a dish so I thought that I had covered everything. It turns out not. I have just moved house, still renting and part of the deal is that I just inherit a satalite dish, I know the previous tenant had working TV, but nothing else. I have an AverMedia...
  • Reading disk drive SMART information - part 2

    The story so far Last month I was trying to get SMART data from a disk drive. The documentation I could find worked great for one disk drive however when two drives were in use I had a problem linking the data returned from the two WMI select queries SELECT * FROM Win32_DiskDrive and Select * from MSStorageDriver_FailurePredictData, as I cannot assume the data is in the same order. I used the index property in...
  • Reading disk drive SMART information

    Recently I have needed to get SMART data from a disk drive. I maintain a server at home and from experience that disks appear to last around four or five years if they are run all the time and SMART information is an excellent way to spot when a disk is about to die. Again from experience any pending bad sectors is a very bed sign. I was writing a disk monitor program in C#...
  • Another Gadget: Google Home

    I have another new gadget - Google Home. Speakers you talk to are all the rage at the moment, Amazon and Apple are in on the act. First Impressions Well there is a lot of hype. The voice recognition is good, over 90% accuracy. Its just that the devices its competing with, light switches egg timers, volume controls are all running at 100% accuracy. Even having to repeat yourself a bit is irritating. In general...
  • Navigation widgets for liquid

    Now my blog is hosted on Github Pages using Jekyll I found that I need to make some additions to the default template. I used the default template as it has a pretty well structured set of includes meaning that I can add my own widgets pretty easily. The last main piece that I wanted to add from my previous blog was navigation controls. I wanted a timeline of blog posts as well as navigation...
  • An image widget for liquid

    This year I migrated my blog to Github Pages. I am super impressed by the move hosting on github is incredibly fast. There are a few things that I took for granted in my old work flow. One was the way that if I inserted an image into a post then Windows Live Writer would insert a small thumbnail and link to the full image. I didnt realist how useful this was until I wrote...
  • New version of wrist-spin released

    I own a pebble and I really like it. I guess by now everyone knows that Pebble is no more having been bought by Fitbit. I have produced a real time cricket score app for the pebble called wrist-spin. Even though Pebble is no longer an entity I still have one and use wrist-spin all the time so I will continue to support the app until my watch breaks. I’ve released a new version of...
  • Data Migration

    In the previous post I was looking at moving my site from GoDaddy to Github and Azure. The main dynamic part of my web site is my books catalogue. The catalogue has been a pet project for me for many years. Really the only user of the catalogue is me, its still my card index but I use it to experiment and practice with new frameworks and techniques on a real life data set. Year...
  • Moving On

    I started my website in the 1990’s, I still have some of the old pages around. I started my blog around a decade ago. Over the years I have been on a number of platforms. Year Host Technology Blog 1996 GConnect (Local ISP) Static HTML, ASP (Classic), FrontPage None 2007 WebStrikeEasyCGI Static HTML, ASP.NET, PHP WordPress 2012 GoDaddy Static HTML, ASP.NET MVC, BlogEngine.NET 2017 GithubAzure Static HTML, ASP.NET Core Github Pages, Jekyll Moving platform is...
  • New version of Recommender

    I’ve released a small update to Recommender this month. The app is working quite well in its small user base, the change enables you to add a nickname to the app and then when you share a recommendation the recipient will always know where the recommendation came from. You can also edit any recommendation to identify where it came from in the same way as giving a recommendation a category. The source code is in...
  • Success Criteria

    More than once this year I have been involved in discussions about how successful a feature or even a product is. There appear to be a number of criteria that people are happy to use: does it make money; is it widely used; do people like it. Its harder to get agreement on how we should measure these criteria and even harder to agree what success might mean. At the moment I work on a...
  • Slipping standards

    I really try not to rant in this blog, it does no good really. Last year I wrote about a decision I had to make about extending PodcastUtilities to support dates that did not follow the defined standard. It makes me sad when we cannot follow standards. I was surprised at work when a colleague queries my pull request in which I did not escape a single quote char in an android resource file. The...
  • Displaying the appinfo version number in a Pebble app

    This year I have started writing apps for my Pebble. One of the first things that I usually do is put in some kind of “About…” screen so I can easily tell what version of the code I am using.  The about screen for wrist-spin looks like this As often happens on a new platform its the simplest things that trip me up. The version number (versionLabel) used in the Pebble app that is published...
  • New version of Recommender

    There is a new version of Recommender in the play sore. The main change is that I’ve added a Bottom Sheet using the Design Support Library. The Bottom Sheet is used to display the list of categories that you have currently used. Category is a free text field but is used to group recommendations so its best to try and avoid misspelt duplicate. The list of current categories is displayed to to try and discourage...
  • Rebuilding a Media Center PC in 2016

    I have previously written about how to get Windows Media Center working in New Zealand. Recently my Media Center PC died and I needed to rebuild it. In 2016 this was slightly more tricky than I expected. I know that Media Center has been deprecated by Microsoft and that it is not supported on Windows 10 however for live TV there really isn't a real alternative. XBMC / Kodi keeps getting better and eventually I...
  • Android development for .NET developers

    A couple of years ago I switch tracks from being a .NET web developer to being an Android developer. Its not the first time I’ve switched tracks and I am sure it will not be the last. Recently I did a presentation giving people with a .NET background a general map of the terrain in Android development and I wanted to capture the information in the presentation here. Prerequisites You can use what you like,...
  • Pebble activity tracking software

    At Christmas I bought myself a Pebble Time. I often buy myself a Christmas present as its a great way of getting exactly what you want. Actually I didn't know if I wanted a Pebble but six months in I think its a great device, a smart watch that only needs charging once a week but works great in bright sunshine is a real triumph, I rally didn't want a smartwatch the conks out at...
  • Unit Testing Android async callback functions

    Android code will typically make use of async callback functions to do work that could take a long time, such as making network calls, or interacting with the file store or local databases. In fact the Android OS will throw an exception if you attempt to make a network call from the UI thread, which means that a common pattern of writing code is call a synchronous method and pass a callback function that will...
  • Setting up for Pebble development on Ubuntu

    I bought myself a Pebble watch at Christmas and even wrote an app, wrist-spin, to display live cricket scores on the watch. Its a great device and its been fun to develop for, however the setup is not straightforward. The Pebble SDK only runs on Mac OSX and Linux. Now given that 90% of desktop machines run Windows and that the life blood of a device like Pebble depends on the availability of a lot...
  • wrist-spin updated

    I have updated my pebble cricket score app wrist-spin. It ended up being a larger updated than I originally planned, I guess one thing led to another, the update Reworked the navigation so that its much easier to flip between views ranging from a minimal but easy to see at a glance time and score view through to a full detail view. Added the ability to switch between data providers, I’ve found three suppliers of...
  • Unit Testing in native Android apps using MVP and Dagger2

    Towards the end of last year I started working on a new project, Recommender. I found it interesting to compare the tools i selected in 2015 as against an earlier project such as measureme. when i started the new project with new tools i also wanted to try apply some structure to the code to help enable testing. When projects are developed and tested and run all in the same environment then producing automated test...
  • wrist-spin released

    I bought myself a Pebble Time smartwatch for my Christmas present to me. I have been pretty pleased with the watch, it seems to do everything that I wanted in a smart watch, its strong points are a 5 day battery life and how readable it is outside. One of the things missing (from my point of view) was real-time cricket score updates. Well over the Christmas break I decided to fix that. I wrote...
  • New version of PodcastUtilities

    This month I have done a maintenance release of PodcastUtilities. I was seeing this error from a number of sites, including the BBC, The Guardian and NZ Tech Podcast. GetFeedEpisodes: warning, unable to add an episode for Tech Weekly, Thu, 03 Dec 2015 15:35:14 UTC is not a valid RFC 822 string representation of a date and time. I was surprised by the error as it looked OK to me. I ended up adding another...
  • An MVP pattern using scoped Dagger2 IoC containers

    i have previously written about using dagger2 in my new project recommender. one of the things i found most frustrating about writing native android code in contrast to c# or javascript code is how hard it has been in the past to get a reasonable amount of test coverage from unit tests. there have been challenges eclipse didn't have great support for testing this has been addressed as androidstudio is much better at working with...
  • Recommender released

    I have been working on a new native Android application. Recommender is an application to store, organize and share personal recommendations: music, films, books, apps, web sites, restaurants – pretty much anything. Its designed to be used in person where you want to pass on a recommendation to a friend. There is no web service, there is no need to register you details anywhere. This is not an anonymous crowd sourced opinion its intended for...
  • Using Dagger2 and Roboelectric for unit testing in Android development.

    I have started a new project using AndroidStudio and Dagger. Using inversion of control is all well and good but its only there to help with isolation code and one of the main reasons for doing this is to enable objects to be more easily tested. In previous projects I have written pure junit tests. These worked well enough however it does mean that I am only able to test a relatively small number of...
  • Starting a new native Android app in 2015

    Last year I wrote MeasureMe a native Android application. I have just started a new project I find it interesting the difference in tools and techniques I am using only 18 months after MeasureMe. At the time I identified four main areas that I addressed first. Logging Inversion of Control / Dependency Injection Unit Testing Automated Building In 2014 I used eclipse and ant to control the build process, logging was handled by slf4j and...
  • New version of MeasureMe released

    I have done a little bit of tidying up in MeasureMe and published a new version to the play store. I have made manual measurements easier to trigger, by using the icon next to the measure on the main screen. This enables a measurement to be taken immediately. I have also added new scales for anxiety and depression as well as adding a spreadsheet to the example spreadsheet folder.
  • Using Microsoft Fakes to test legacy code

    Recently I needed to do some maintenance work on some old code that was not written with unit testing in mind and had not been structured to enable testing, for example there was no inversion of control. Ideally I would have restructured the code to isolate it from external dependencies however this would have required a large QA resource cost to perform regression testing on the restructured code, and there were no existing unit tests...
  • RamEater updated

    Last month the first version of RamEater was released. I’ve done a bit of polishing of the code. The main change has been to support older Android 2 devices. The problem is that activityManager.getLargeMemoryClass is only available in Android 3 and later. private void eatAllMemory() { //Get amount of memory this app is allowed to use (in MBs) int availMem = activityManager.getLargeMemoryClass(); eatMemory(availMem); } The code has been changed so that the amount of memory...
  • RamEater released

    I have been trying to work on an interesting Android development problem recently. The activity lifecycle includes a number of less obvious states. If the device’s memory is under pressure then an activity can be unloaded, and ultimately the activity and the application process can be unloaded. As a developer it is possible to simulate the activity being unloaded by setting the developer option “Don’t Keep Activities” like this. I needed an easy mechanism to...
  • New version of MeasureMe

    I have release a new version of MeasureMe, v1.1.1. This version has been migrated to material design and compiled for Android 5, lollipop. There is no functional change in this release however I think the layout and navigation is far better. The colour palette was generated by using material palette.
  • New version of PodcastUtilities

    This month I have done a maintenance release of PodcastUtilities. I’ve added the option to delete any old empty folders that occur during download or synchronisation. The new version (2.1.0.6) is now in BitBucket and also available as a binary download if you just want to run PodcastUtilities.
  • Migrating from Eclipse to AndroidStudio

    Last year I produced my first native android application. its called measureme and its done ok on googleplay, over 100 downloads and a review of over 4 stars. it was developed using eclipse and ant, these were the recommended tools at the time and i used them to build release and debug variants and to run unit tests. towards the end of the year android studio 1.0 was officially released and around the same time...
  • Message logging in WCF clients

    Having migrated a service client from WSE to WCF one of the things I noticed is that WCF client message logging is certainly very comprehensive but it can be extremely verbose and difficult to just look at the wire packets. It turns out that WCF client channels can be easily configured to use an existing logging framework. To attach a custom logger we can configure it into the client by adding a behaviourConfiguration into the...
  • Migrating UsernameOverTransport security from WSE to WCF

    WSE was, and I suppose is, a wrapper library to help make talking to WS-* compliant services easier. Specifically it can make communicating with secure services easier. However WSE was targeted at .NET v2, there is not a v4 version and development appears to to stopped. The current mechanism for talking to services like this is to use WCF. With that in mind I have had to migrate a client library away from WSE to...
  • Running JUnit unit tests from Ant

    Having written unit tests for the Java business logic classes, the next piece of the puzzle is to be able to run the tests from a command line build so that they can then be run on a build server or continuous integration server. Remember that these tests are pure logic tests and have no UI, also that they make use of RoboElectric to enable the tests to be run in a desktop JRE and...
  • Unit Testing in native Android apps

    Given that the target machine for an Android app is an Android VM the only real way of running any tests is in the emulator. This seemed like a very complex operation especially for unit tests on individual method calls. There are test that I would only want to run in an emulator or a device such as UI testing but I like to test base components before I get into assembling them as it...
  • Build configurations in native Android apps using Ant

    Last month I was looking at logging in native android apps and in that post I did mention that the logging configuration would need to change based on what I was trying to build. I build MeasureMe for two different reasons. A release build to go in the play store In this build I want almost no logging (only if an unhandled exception is thrown. A build for me to test with This build has...
  • Logging in native Android apps

    MeasureMe was my first native Android application. previously i’ve commented on the basic framework needed to start developing an app and one of the most basic elements is logging. in my previous projects in .net i have used emterprise library and log4net and they have both been fine. obviously for an android application i was going to need a java based framework. i have already blogged about how i migrated from one logging Enterprise Library...
  • New version of MeasureMe

    I have done a small update to MeasureMe. I found a bug where some of the values in the Units Consumed were missing. The fix is in the play store now. I’ve also added another example spreadsheet for Units Consumed. Sorry this post is so short but I have been super busy this month.
  • IoC in native Android apps

    Recently I spent some time producing MeasureMe, a low friction personal measurement tool for Android devices. The development time for the first version was four weeks. Looking at my check-ins for the project I see that I spent the first one and a half weeks getting the architecture sorted out, that is almost a third of my time. It was my first “proper” native Android application, and I did not have long to complete the...
  • MeasureMe Updated

    Last month I release the first version of MeasureMe, a low friction personal measurement tool. One of the ideas behind an agile approach to software development is that the minimum viable product should be shipped as early as possible, and the first version of MeasureMe was in the play store 4 weeks after I started. Then the idea is to revise the product to add functionality. Over the last month I have added Multiple measurements...
  • MeasureMe released

    In the past I have produced HTML5 Phonegap application, TextByNumbers, for android. Last month I spent some time working on a native android application I was interested to see what challenges it would present and how it would differ from an HTML5 application. I needed to get through the development lifecycle quickly, from start to the play store was only four weeks. I think that its resulted in a useful tool as well as giving...
  • Passing Gmail attachments to PhoneGap apps on Android part2

    In part 1 we had got the data from a Gmail attachment and passed it though the Java native application into the Phonegap JavaScript. On the JavaScript side the code we want to call is in a KnockoutJs view model but the mechanism should be similar for other frameworks. In the main index.html we have <script> var enigmaMessaging = new EnigmaViewModel(); ko.applyBindings(enigmaMessaging); </script> And within the EnigmaViewModel we have function EnigmaViewModel() { var self =...
  • Passing Gmail attachments to PhoneGap apps on Android part1

    We have started a new project, Emigma. The plan it to be able to send and receive encrypted messages on Android devices. Obviously we want the flexibility to use and transport for the message and also we really don’t want to have to write a complete email package so we would like to be able to use an external email application such as Gmail. One of the first parts in this was to try and...
  • New version of PodcastUtilities available

    Although we are now working on other projects we are still maintaining PodcastUtilities, we added MTP support this year. I have fixed an issue in PodcastUtilities. The issue was that if an error was thrown when trying to find the available free space on the destination drive then the file copier would stop and not copy any files. The meant that if SyncPodcasts was used with relative, UNC for an MTP path then it would...
  • Inserting line breaks into PDF text using XSLT-FO

    Recently I needed to insert a line break into a block of text in a PDF file. The PDF was generated using an XSLT-FO style sheet with an XML input document. The solution wasn't as straight forward as I had expected but it can be done relatively easily. The XSLT-FO looked like this <fo:block font-size="9pt" line-height="14pt"> <xsl:value-of select="/PresentationData/TextBlock"/> </fo:block> The change needed is to add the linefeed-treatment attribute like this <fo:block font-size="9pt" line-height="14pt" linefeed-treatment="preserve" >...
  • Commute times for a train and folding bicycle in Wellington

    This is the third place I have lived in as many years. Given that the commuter trip is one that I make twice every working day I was interested in how long it would take. We have moved out to the beach, about 20 KM north of Wellington. Its beautiful and tranquil and I hoped that I would be able to keep roughly the same commute time by another new gadget, a folding bike. The...
  • TextByNumbers available on Google Play

    This year I’ve been working on my first real project using html5 and i think its gone pretty well. i’ve even used phonegap to use the assets in an Android application. I thought I would take the final step and publish the app on Google Play. I have to say its a pretty painless process (though its not free) and its well documented on the Google developers site as well as this post. The application...
  • Error messages are important

    I’ve been doing some maintenance work on some old code. And I think that most of my effort has gone into making the error messages better. If a piece if software is successful then it means its going to be used in a live environment. It also means its going to break at some point and at that point its going to be a lot easier for everyone if the error message it produces makes...
  • PodcastUtilities now supports MTP

    We have been working with PodcastUtilities for a couple of years now. Just recently we have both ended up with devices that use MTP (Media Transfer Protocol) rather than USB Mass Storage so we have needed to extend PodcastUtilities to support both MTP and USB. The new version with MTP support is now in BitBucket and also available as a binary download if you just want to run PodcastUtilities. A spin off from this work...
  • Keeping common source between Phonegap and HTML5 apps

    I have written a small utility app to help compose SMS texts and emails out of text snippets – TextByNumbers. Initially I created this as an HTML5 app using jQueryMobile and Knockout.js. It seems to work OK in its HTML5 form however I wanted to explore how easy it was to get into natively hosted apps using Phonegap. The app is completely client side – the server is only used to serve files - so...
  • Getting jQuery Mobile and knockout.js to play together

    My current project is an HTML5 application to assemble text snippets for use in email or SMS messages – TextByNumbers. I have to say that the experience has been pretty good. The two main frameworks I used were jQuery Mobile and knockout.js. I said at the time I would do a separate post about getting them to play nicely together, and here it is. First of all I started to use the jQuery Mobile ListView...
  • Listening to cricket in New Zealand

    I like cricket, and now I have relocated from the UK to New Zealand I’ve had to find methods of listening to cricket. Not watching, I cannot give up days watching cricket, but on the radio I can have it on and still get things done. England International Cricket My usual method of listening England international cricket was Test Match Special on 5live. However its usually region locked so to listening requires some sort of...
  • Windows Media Center in NZ using DVB-S

    I’ve blogged about getting windows media center to work in new zealand using an aerial, dvb-t. of course as soon as i got it to work properly we moved house again and this time there isn't any coverage using an aerial. instead the house does have a satellite dish, so i set about trying to get media center to work with a dvb-s decoder. i bought an AVerMedia AVer3D Satellite TV Tuner, I have to...
  • TextByNumbers

    I’ve been taking a break from PodcastUtilities to start work on a new project TextByNumbers. TextByNumbers is designed to enable people putting together letters / emails / SMS messages from snippets that the user can easily produce. Its should be useable on phones with or without a data connection. I did think of writing a native app, I guess it would be an android app as I have an adroid phone but then I thought...
  • Windows Media Center in New Zealand

    Last year I moved from the UK to New Zealand. I brought with me my Media Center hoping that I could get it to work. It turns out that TV is broadcast over here using DVB-T (and DVB-T2 for HD) just like Freeview in the UK so it does work to the extent that I can watch live TV. However getting the EPG working was another matter all together and the results are mixed, is...
  • Refactoring code using default parameters

    Recently I have come across code that had been refactored using default parameters in C#. The refactoring had taken place in a DLL and it caused an interesting problem in the calling client code. When I looked at the code at first I could not understand how the refactoring had broken the client code so I experimented with this code to reproduce the problem. The original code looked something like this. namespace Library { public...
  • Ajax requests in HTML5 offline applications

    I’ve started having a look at writing offline applications. Its good fun to write using different technology and I am discovering that the whole HTML5 stack is still very immature. The stack I’d settled on for my first attempts is: HTML5, jQuery, jQueryMobile and Knockoutjs. The first stumbling block I came across was that ajax calls work differently when in offline mode. It turns out that jQuery returns a status code of zero when the...
  • appcache MIME type for IIS

    This month I have a rant, I am not a big fan of rants in blog posts as they never really seem to achieve much and really just seem to be be a bit self promoting. However I’ve not had one before and last month I came across a topic that is worthy. I’ve started a pet project to write a browser based HTML5 app. In the past we have produced a version of a...
  • PodcastUtilities: New Version

    We have just completed a new version of PodcastUtilities, it now supports a post download command. Using this command its easy to hook up utilities such as MP3Gain or any other post processing command. This build also contains some bug fixes including support for running the utilities from UNC paths. There is a ready-to-go compiled Windows version available to download, which includes the utilities and documentation. We are planning to take a bit of break...
  • Exception handling in services in a production environment

    I have written about using Enterprise Library to log exceptions in a production environment, specifically how to cope when the loggers will not write to files or event logs. Recently I came across a problem where the whole logging framework was failing to initialise in a production environment. What we got was the usual generic error message and nothing useful in the event logs and obviously the logging framework did not receive anything. In this...
  • Using OpenCover and nUnit

    Previously I have written about using OpenCover with xUnit. It struck me that I should probably also do the same for nUnit as that is what we use in PodcastUtilities The structure of these scripts is slightly different from the xUnit scripts as they have to work both 16 and 32 bit. The master script looks like this call SetProgramFilesEnv.bat if "%ProgramFilesPath%" == "" exit 1 set opencovercmd="%LocalAppData%\Apps\OpenCover\OpenCover.Console.exe" set nunitcmd="%ProgramFilesPath%\NUnit 2.6\bin\nunit-console-x86.exe" %opencovercmd% -register:user -target:%nunitcmd% -targetargs:"/noshadow...
  • Medium Trust, SQLServer CE, log4net and NHibernate

    I have been moving hosting provider to godaddy. Easily the biggest hurdle to overcome has been medium trust. Enforcing medium trust policy is a common approach in shared hosting environments the intention being to stop applications from trampling on each other. The existing site were a mixture of web applications and static pages that used a mix of technologies. Static pages Obviously no real problem moving these, though they were redesigned on the way. Blog...
  • Using OpenCover and xUnit

    When I am writing tests I find it useful to have a coverage tool. Since NCover is no longer free I have started to use OpenCover I like OpenCover, it is a mature product that works well and as a free open source project its great for my personal projects. I also use the excellent ReportGenerator to format the output from OpenCover. I recently needed to use a coverage tool to work with some xUnit...
  • Commute times for bus and bicycle in Wellington

    A while ago I compared commute times in Manchester, I now live in Wellington and thought it would be interesting to repeat the exercise (no pun intended) here. I live a little further out of town in Wellington, the routes I use its about 12.5 KM to work and 11.5 KM home. When I use the bus I have to walk about 5 minutes to the bus stop from my house, the bus stop is...
  • Options for implementing ReadOnly and ReadWrite properties

    This is a real problem, I did come up with a solution however it was not straightforward which probably means that I might have missed something, is there a better way of doing this? The problem In PodcastUtilities we have a configuration file. This is the representation of the podcasts we want to download. The Downloader and the Sync need read access to the configuration however the GUI needs to be able to read and...
  • Digital Migration

    Last month I noted that I had moved from the UK to New Zealand. Just to complete a clean sweep this month I have digitally moved from easycgi to godaddy. Well I’m on a roll now. If you have subscribed to the old blog on easycgi you will need to re-subscribe here. Why did I move? I have to say that I have always found easycgi great hosts however there was a chain of events...
  • Things I have learnt

    I started this blog about three year ago. Its not the first blog I had had a go at like a lot of people over the last ten years I have started with all the best intentions and then it petered out. This blog is different – I have actually kept at it. The idea has been to set realistic goals, in this case of a post every month. I have tried to learn something...
  • A Festive Peer Review

    Its the festive season and I bake a Christmas cake most years. I bake it in August and then let it mature until December. I was given a Christmas cook book years ago and have used the recipe out of that book ever since. Last year I decided to seek a peer review of the cake and who would be better to do that than mum. She said it was very nice but I had...
  • FxCop suppression works in visual studio but not in MSBUILD

    I had a very odd problem to solve recently, I needed to specify a SupressMessage attribute on some code however when I did decorate the code with SupressMessage FxCop on the build server still complained about the error. I had used FxCop locally to check the code before checking in and also used the FxCop command “Copy as SuppressMessage” to make sure I didn’t type it wrong. Luckily this problem only seemed to afflict some...
  • Testing jQuery behaviour using jasmine-jquery

    Recently I was working on a web page and I needed to add the ability to have certain LABEL element be highlighted with an icon and to have an alternative prompt. As often happens in web development the elements to be highlighted were delivered to the page using a JavaScript array planted from the server side and although I could have changed this mechanism it would be less intrusive if I could work within the...
  • TiddlyWiki on small screen devices - available for download

    Last month I described how I got the pipe symbol to work in TiddlyWiki on my HTC Wildfire. I got to TiddlyWiki for small screen devices by downloading AndTidWiki, this in turn was based on iTW. The thing is that its based on TiddlyWiki v2.4.1, the current version is v2.6.4 and now includes jQuery. I took a little time and also had help from Andrew and we have put together a Powershell script that will...
  • TiddlyWiki on android phones, using the pipe symbol

    Solving this problem made me laugh, and cry. It did remind me of something I heard years ago What is the difference between hardware and software? If you play with hardware enough you will break it, if you play with software enough you might just get it to work. I like using tiddlywiki, I’ve used it as a super todo.txt for a long time. I stumbled on an implementation for Android which in turn was...
  • podcastutilities: now supports downloading and synchronising

    A couple of months ago I mentioned PodcastUtilities. This month we have produced a new version of PodcastUtilities that now supports downloading and synchronising podcast media files. You can download a compiled version of PodcastUtilities in a zip file from BitBucket For the last five years I have been using Juice and it has provided sterling service as a podcast downloader, however it appears to have been dormant for the last six years since the...
  • Code Review: Testing Behaviour

    During a code review of unit tests someone said something that I found very interesting. We had been looking at the structure of BDD (GivenThat and When) style tests and he said that he wanted tests to be written in such a way that if he wanted to refractor code but not change the overall intent of code then the tests should not break – but of course they always did. It made me think...
  • PodcastUtilities

    I listen to lots of podcasts, both technical and for entertainment. The problem I have had for a long time is that I need software that will download episodes from a specified list of podcasts and, as I keep a large number of podcasts on my computer then synchronise a subset to a mobile device. Although there are options all seemed unsatisfactory somehow I object to running the large memory foot print of a program...
  • Exception Handling in a try/finally block

    However I recently came across a problem I put into a system. I did not notice the problem until I was going through the exception logs and discovered that they were not as useful as they could have been. I had written some code that was a client to a WCF service and if there was a problem with the service then the intention was to log the error for the main program to carry...
  • Travel tips for India

    Last year I wrote down some of the things that became apparent only after visiting Cuba, this year I have been to India and thought it might be useful to share the things that I discovered there. I have just returned from there and we discussed what we had learnt, there were three of us travelling, one women and two men. Obviously these are our experiences from a three week trip, you might get different...
  • ie does not display a space after an embedded SPAN element

    I came across another odd render problem in IE. I had an a SPAN element enclosed by a DIV element. the span was being used to attract style to a part of the text in the div The HTML I thought I had was something like this. <html> <head> <title>Test</title> <style type="text/css"> body { font-size:20px; } .div { background-color: red; } .span { background-color: blue; } </style> </head> <body> <div> <div class="div"> test before <span...
  • Commute times for car, tram and bicycle in Manchester

    I live in Manchester, I live in the suburbs, 8 kilometres (5 miles) from where I work in the city centre. I usually cycle to work however sometimes I use a car or the tram. Where I live is a 3 minute walk to the nearest tram station, and about 5 to 10 minute walk from the tram station to work. When I use a car I have to walk about 5 minutes from the...
  • calling a stored proc from another stored proc and getting results

    I am not a SQL DBA but like a lot of developers I do get to work in relational databases. Also I guess like a lot of developers I find SQL to be the most alien of the languages I work in. Recently I needed to refactor some code that had an impact on a database, in common with the DRY techniques I wanted to remove duplicated calculations. I’ve simplified this example to make it...
  • Sony Reader vs Amazon Kindle Hands On

    Last year I bought a Sony Reader, I had my reservations about the whole eInk thing but I was so impressed that this year I bought an Amazon Kindle, I thought it might be useful to compare the two approaches to electronic reading. Side by side I guess before I get into the details of each of the readers I should compare them side by side. In some ways its a bit unfair as the...
  • Code Review: Copying the text from a Message Box

    Strictly speaking this snippet isn’t even code however it did come up in a code review and I’ve made use of it often. Lots of times when an error message appears I need to be able to get the text from an error message dialog, either I want to find the text in source code or to use it to search the internet. It turns out that as long as the developer has used the...
  • Code Review: Constructing a StringBuilder with a capacity

    Its the small things that seem to be the most generally applicable when writing code and one of those little things is the construction of a StringBuilder. I guess most developers assume that concatenating strings is not very efficient, because they are immutable it means a lot of copying and memory allocation behind the scenes. One of the advantages that “modern” programming languages such as Java and the .NET family proclaimed over their predecessors was...
  • Enterprise Library exception handling in a production environment

    I have blogged before about liking Enterprise Library, particularly about its exception handling mechanism. Given that the whole purpose of the exception handling mechanism is to provide much needed information about defects in software I have recently been faced with a problem where the exception handling mechanism itself failed. I had a piece of software that was deployed to a production server. It had been tested fully on a staging environment and was then deployed....
  • Another gadget: Dulux PaintPod

    Recently I needed to paint a house, not a huge house, a smallish two bedroom house however I did need to paint all the walls and the ceilings so there was a fair amout of painting needed. I had noticed the Dulux PaintPod in B&Q (I am in the UK, its a bit like Home Depot). I thought that if I was ever going to get use out of a device like this then now...
  • Restoring a image to an Acer Netbook from a Windows Home Server

    After Scott going on about how good Windows Home Server (WHS) is I decided to try it. I have to say on the whole I am very pleased, it works very well. I did have one issue with restoring machine images. WHS will backup machines on the network. You can restore individual files by opening a backup set and copying any files you need. If you loose the whole machine, for example you suffer a...
  • Javascript != C#

    A while ago I blogged about the pitfalls of working in multiple languages, and lo and behold I instantly went and fell down another of them. I had some code that I had written in C# and I needed to port it to JavaScript, I did briefly think to use Script# but it seemed like complete overkill for a class with a few calculations in. Anyway the C# code looked like this double value1 =...
  • HTML UL bullet alignment in different browsers

    In previous posts I have explored strange effects on HTML and CSS in different browsers. I do like it when I have the time to find out exactly how to fix fender problems across browsers by understanding what is going on. I came across a problem in IE where the bullets for a UL element were rendering at the bottom of each list element and the solution to this problem is interesting in that it...
  • travel tips for Cuba

    I have just returned from Cuba. I went armed with the usual travel book and I guess as always with travel I returned having had things work well and things work less than perfectly. I kept a journal and thought it might be useful to publish some of the things I wish I had know before I left. More than anywhere I have travelled the guide book seemed to be out of date very quickly....
  • C# != VB.NET

    Or maybe it should be VB.NET <> C#. I started out using C++ professionally but as time has gone on ended up using a wide variety of languages. Web development does tend to involve concurrent use of multiple languages, javascript, C#, SQL, XSLT etc. I find that using multiple languages at the same time makes it lots easier to make silly mistakes because the language does not perform in the manner I assume it does,...
  • My new Sony Reader

    Before Christmas there was a lot of buzz around eReaders. Many podcasts were saying that the Amazon Kindle and eReaders in general were finally mature enough for mainstream use. I like to buy myself a Christmas present, last year it was a netbook, so I thought I’d have a look at what was available. Let me say straight away I live in the UK, not North America, if I did live in North America I...
  • Watching TiVo recordings on your PC

    I’ve had a TiVo for ages a very welcome Christmas present from Steph. Occasionally I need to watch programs that have been recorded on my TiVo on a PC or on another TV in a different room. The way I’ve solved this problem for years was to use a pair of digisenders, a solution that does work but does have some limitations which mainly centre on the use of the 2.4GHz frequency band. the digisender...
  • Code Review: if statements

    As part of my role as a developer I attend code reviews. On more than one occasion I’ve been struck by small details that have made a big difference. A colleague once pointed out that I was giving myself an opportunity to get code wrong by missing out the braces in an if statement. In most C style languages, (C++, C#, Javascript etc) this is legal if (someCondition) performSomeAction(); However he asserted it was unwise...
  • Debugging ASP.NET and using Integrated Windows Authentication

    Last post I was looking at using integrated windows authentication in IIS. When I am working on a web site like this on my dev machine I often turn integrated windows authentication off and Basic Authentication on. This enables me to access the web site using different credentials that I can just type into the browser. Please note that I only do this on my dev machine and would not recommend doing this in any...
  • Using Integrated Windows Authentication in IIS

    Many public facing web sites need to have special “admin” modes, or even completely different personalities for internal staff. One possible method of achieving this is to use the Integrated Windows Authentication in IIS which can be setup from the Directory Security tab of the IIS MMC snap in as shown here If the anonymous access option is checked then anyone can access the site if not then the user’s windows credentials will be sent...
  • Using Safari with proxy server credentials

    Recently I have installed Apple’s Safari browser and found a problem with my proxy server. My proxy server requires credentials, in the case of IE and Firefox this is my Windows account credentials which the browser will automatically present. Other browsers like Opera and Chrome ask me to enter my username and password before the first page is rendered. they even have a checkbox to remember the credentials so I am not prompted before every...
  • CSS margin, padding and background-image problems

    In my previous post I was looking at problems with older versions of IE. It is always easy to poke fun at older browsers (and IE6 is getting on for 10 years old now) and as I noted at the time the problem migrates from browser to browser as time goes on, in the past it was Netscape 4 and undoubtedly it will be a different browser in the future. Recently I came across an...
  • CSS z-index with containing blocks and IE6 / IE7

    In my previous post I was exploring the effect containing blocks have on absolutely positioned elements. I did say that containing blocks have an effect on z-index as well. The effect is that elements with a higher z-index but within a containing block are rendered behind an element with a smaller z-index. It turns out that the effect is probably a bug and that it only happens in older versions of IE, that is IE6...
  • CSS position:absolute, what does it mean?

    This is probably something the rest of the world found out ages ago but I have only just discovered it. I was trying to find a problem with a page, granted the page was quite complex and consisted of a large amount of generated HTML but the problem boiled down to a simple issue: I did not understand how position:absolute worked in CSS. I had a style like this .interesting_p { position: absolute; top: 10px;...
  • ASP.NET exception logging in a hosted environment

    Fixing problems with web sites can be tricky. On the desktop, if I can replicate the problem then attach a debugger and find the problem, When I am writing a web application this is what I do, I run IIS locally and debug locally and all is fine. However after the site is deployed things become more tricky. In many hosted environments I often find myself restricted. I cannot attach a debugger to the running...
  • A Comparison of Weather Feeds for use in applications and web sites

    I am involved in a project to build an application called Worldolio, this applications provides a variety of geographical information, current time, DST dates, sunrise, sunset and weather forecasts. Currently I am reviewing the weather feed we use for Worldolio with a view to replacing it. In the course of this work I’ve had a look at most of the weather feeds I can find, if you know of any I have missed please point...
  • My new netbook: Acer Aspire One

    I decided to treat myself to a new netbook after Christmas and given that Dixons / Currys were selling Acer Aspires at less than 200 pounds for the Linux version with the 120 GB hard disk I decided have a play. I quite liked the idea of using Linux It is purpose configured for the hardware Its quick to boot its something new to play around with, I have used various flavours of unix in...
  • How to fix Tivo Suggestions in the UK

    If you own a Tivo and are based in the UK then you will have probably noticed that your Tivo has not been recording suggestions for the last few months. I sort of noticed it as part of the background noise in life and finally managed to find some time to see what was going on. It would appear that the problem has been identified by Tivo, however there are no plans to fix it....
  • Rolling Flat File Trace Listener with Purging for Enterprise Library

    I have used Microsoft's Enterprise Library (EL) from Version 1 back in the day. I have to say I love EL, I have read lots of blog entries telling me that there are better components to do some of the parts of EL but EL has some very compelling reasons to use it It has a lot of components of an application that I know I *should* write but that are just overhead. If I...
  • SQLite foreign key constraint generator using T4

    In my previous post I described creating a Codesmith template to generate SQL code to implement foreign key constraints in a SQLite database using triggers as SQL does not natively support the foreign key constraint when specifying the column during table creation. After I had produced the template I started reading about T4 which is Text Template Transformation Toolkit. T4 is built in to Visual Studio, the obvious advantage being that you can use T4...
  • SQLite foreign key constaint generator using Codesmith

    I have started to plan the my new online books catalog as part of the new site structure, as I discussed here. I know the basic shape of the way the catalog will work, in that I will be using server based technology rather than compiling an Access database to HTML. I have been assessing which database technology to use bearing in mind that part of the reason this site exists is to provide an...
  • Getting the tab key to work in a WPF ListView control

    During the summer I have been doing some work on WPF and this lead me to reading about Scott Hanselman's new project Baby Smash.  One small paragraph in this post captured my early progress One little aside to end on. Just when I'm getting really pissed at WPF and I'm ready to give up, something simple and cool happens where I realize I'm starting to "get" it. An example of this is a dialog that...
  • Mixing fire and water: ASP.NET and WordPress

    In my previous post I was describing the earlier incarnations of this web site and the slow but steady draw to trying to rework the web site again. There was a definite sequence of steps that led to this site. During the summer I have been doing some work on WPF and this lead me to reading about Scott Hanselman's new project Baby Smash. His posts about WPF are interesting, especially as I seem to...
  • how did we get here?

    I created my first personal web site in the 1990’s. When I created that first site I decided to use static HTML for the site for a number of reasons I had my hands full learning HTML and CSS without having to learn a server side technology. I was unsure which server side technology was going to be most useful to learn I was cautious about adopting a technology that would make it hard to...
  • Hello world!

    Over the years I have produced a large number of "Hello World"s. In many ways this is the most complex and in other ways it is one of the more straightforward. The world in this instance is likely to be a very small world. I really just need an online CMS system to keep some pages that are easy to update and information that I tend to forget if I do not write it down....