Showing posts with label Software. Show all posts
Showing posts with label Software. Show all posts

Wednesday, December 11, 2013

The Turning Point to becoming a Software Engineer

I started my career as an accountant and one of my first jobs was to do the bank reconciliations (by hand) for the 56 bank accounts this manufacturing company had. Three weeks each month were spent doing this.



I asked management for a PC, a modem to connect to the banks, and access to the mainframe where the cash book was stored. Using one of the original C compilers and dBase III to store the data I pulled the statements from the bank and the mainframe. After several evenings and weekends of work I managed to automate the reconciliation process such that I could finish in a morning what had previously taken me three weeks to do. Although I had dabbled in software previously at school and university this was the turning point that I realized that I could really make a difference being a software engineer.

To give context to this I had written software in Apple BASIC and IBM/Microsoft BASIC to create trivial and contrived toy programs and to do college assignments. This was the first time that I saw the power of automation where so much time could be saved.

Since then I've worked for a number of different companies in various software development roles and for the last few years I've been managing teams of software developers. Excluding my family, the only thing I love more than solving complex problems through software is helping my team members develop and reach their full potential.

What took you into software engineering?

Wednesday, June 20, 2012

Should the team upgrade to the latest version?

I manage a couple of teams of .NET developers. Like everyone else we are under pressure and deadlines to push out the next feature and keep our products moving forward, feature rich and profitable. Nothing new here.




The usual arguments put forward to justify an upgrade to the latest version of a framework or tool are one or more of the following:
  • It has new features.
  • It fixes bugs
  • It runs faster
They are acceptable and reasonable reasons but in my opinion not the most important.
The most important reasons for me to keep us on the latest releases are for developer engagement, retention and recruitment.
As a developer I hate to hear about features that are available but I cannot use because I'm not on the latest release and I know that most other developers feel the same way. The latest feature or paradigm in the current RTM version of your framework might not be the best solution for your project but we don't want it to be excluded because we don't have access to it. We want to be able to actively exclude it because it's not right for us.
When recruiting new members onto your team it makes it easier to be able to say "we use .NET [latest version] with ASP.NET MVC [latest version] and jQuery [latest version]." There are obviously other factors involved but this (1) eliminates the fear that the tools might not be current and (2) keeps you open to almost all developers out there. i.e. those that don't want to regress to earlier versions of a framework. We might not be using any features that have been introduced in the latest versions (we are) but at least that option is open to us.
For engagement and retention it's important for the same reasons. Everyone's happy because we all have access to the latest.
I believe that early upgrade is important to reduce the pain and is ultimately more efficient. If the team is used to upgrading the frameworks and/or tools frequently then it will be familiar, less painful and easier to plan for. For example, we try and upgrade to the latest version of jQuery once a quarter. We do this because our QA team likes to do a full multi-browser regression once a quarter and an upgrade to a new version of jQuery requires this type of regression.
I rarely attempt an immediate upgrade when a new version is released. I like to let it bake for 4 to 12 weeks and read some of the upgrade comments and let the owners address any of the issues the early adopters have encountered. By then there are a few good instructional blogs out there on how to deal with unusual errors and edge case upgrades.
I usually isolate the upgrade to be done by one developer, have him or her extensively document the experience and put a hard time limit on the upgrade attempt. If possible we push the upgrade out as its own release and don't combine it with features and bug fixes.

Monday, February 7, 2011

ASP.NET MVC3 does not appear as an option in VS2010 after installing it

I couldn't work out why the option to create an "ASP.NET MVC 3 Web Application" was not appearing in the list of templates when I clicked on File > New > Project... in Visual Studio 2010. Only "ASP.NET MVC 2 Web Application" was listed there.

Turns out there's a drop down to allow you to select your framework at the top of the file/new/project dialog and this was set to the .NET Framework 3.5. Because MVC3 needs .NET 4 it wasn't being listed. Changing the framework to ".NET Framework 4" solved the problem.

After doing that VS2010 will remember your last choice and default to ".NET Framework 4"...

Tuesday, October 26, 2010

Open Source Software Stupid Tax

I'm sure I read or heard this somewhere before but my searches have turned up nothing.

If you fix a bug or add a feature to an open source project and you don't contribute that bug back to the project this is referred to as the stupid tax.

The reason that you fixed this bug in the first place is because it was preventing you from using the open source software the way that you wanted to use it. It might not even be a bug, it might be a feature that was missing that you needed.

Not contributing it back to the project is a stupid tax because it means that each time you want to upgrade to the latest version of the open source code you have to reapply your fix or feature. This is going to cost you in time and if you don't get it right first time it may introduce further bugs into your system. If you have someone else working on the team and they decide to upgrade the open source project to the latest version they might not know that you had "modded" the OS project. You might not even know that the developer that you replaced on the team applied a patch to it and then you're left scratching your head and trying to work out why the upgraded OS code is not working with your project.

Don't pay the stupid tax. Get your fixes and features back into the open source project as soon as possible and give yourself a pain free upgrade path to further releases of the OS project.

Friday, August 27, 2010

Erase an area in Paint.Net using the Paint Bucket

There might be an easier way to do this but I couldn't find it and it took me forever to work this out so I hope that it helps someone else as well.

Using the excellent and free Paint.Net image editing software I wanted to erase an area but I wanted to do it with the paint bucket so that it would would erase all the complicated edges that I couldn't get to.

Start off by selecting a small area that you're going to erase with the Rectangle Select tool and hitting the delete key. You now have a small checkered section.

Select the Color Picker tool and click in the just deleted area and this will set your color to transparent (deleted/erased).

Now click on the Paint Bucket tool and click in the area(s) that you want to erase with this tool and it will use the Paint Bucket to erase the area(s).

Please let me know if there's an easier way to do this.

 

Wednesday, June 2, 2010

Upgrading Silverlight project from v2 to v3 (with .NET 4 and MVC2)

I have a setup a site for Online Calculators that I created about 2 years ago to get up-to-speed on Silverlight 2. I've been going through and converting all of my web sites to VS2010, MVC 2, .NET 4, and jQuery 1.4.1.

I anticipated that the calculators were going to be a bit difficult because I'd also included some Codeplex Silverlight Futures (or whatever it was called) charting libraries in the original project and because I was also upgrading the hosting site from .NET 2.0 to .NET 4.0 and well as MVC1 to 2.

I was very impressed with the ease of the upgrade. The VS2010 wizard did it all and it probably took me less that half an hour to complete everything from end to end including setting up the web site on a new server.

The part that I was most concerned with were the charts in the Mortgage Calculator because of the origin (Codeplex) of the libraries and that they may have changed for Silverlight 3. However those went swimmingly. The host site is very basic and so the conversion to .NET 4 and MVC 2 was not a great challenge for the wizard.

Friday, May 21, 2010

Dropbox File Synchronization

I've been using DropBox for a couple of months now and I'm very impressed. I keep my crucial source code files on there and sleep well at night knowing that they are backed up "off-site." That was my primary goal in using DropBox. However, now, I'm using more of the features and I'm using it to keep my DEV server synchronized with my PROD server with respect to files that have been uploaded by users. This has always been a pain for me to do but now it happens automatically. I've also started investigating the possibility of using it for Continuous Integration in a Cruise Control build environment. I haven't set that up yet but I don't see any reason why that wouldn't work.

Friday, April 30, 2010

VS2010 "cannot create the window"

I installed the release-to-market (RTM) version of Visual Studio 2010 and it worked well for a few days and then suddenly it started giving me a "cannot create the window" error and refused to start.

I did a whole bunch of searching and discovered that there were some incompatibilities with Office 2010 beta (an incompatible DLL) that was causing most of the problems. Not in my case though because I'd never installed Office 2010. If, however, you are reading this and you have installed a version of Office 2010 then you might want to search further as that might be your problem.

I contacted the developers at Microsoft and they were outstanding in the help that they provided me. I downloaded a debugger and created some memory dumps of what was happening in VS2010 when it started and sent them off to Microsoft. They isolated that the problem was happening when the machine.config file was being loaded. I know that I had edited my machine.config and so I became suspicious of my edit.

A quick aside about machine.config's. On a 32-bit operating system with .NET 2 installed there's only one machine.config and that usually lives here:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG

If you have installed VS2010 then that means that you have also installed .NET 4 so there's another machine.config for .NET 4 and you can find that here:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config
(On my machine this is the one that VS2010 is using even though I'm running Windows 7 x64.)

If you have a 64-bit OS then you have 64-bit versions of these machine.config's as well taking the total to four. These can be found here:

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config

(I don't know why one is in capitals and the other in proper case.)

An analysis of my machine.config's (all 4 of them) showed that I have incorrectly edited 2 of them. I had added a new section to the machine.config but had failed to add that section name to the sectionGroup. So I was missing this part of the machine.config:

<sectionGroup name="myNewSectionGroupName" ... > <section ...> </sectionGroup>

Which goes inside the <configSections> ... </configSections> part of the file.

In the end it was a PIBKAC* and not a VS2010 bug.

*PIBKAC = Problem Is Between Keyboard And Chair

 

Tuesday, April 20, 2010

.Net 4 VS2010 Conversion Notes

I'm in the process of converting a bunch of projects from .NET 3.5 to .NET 4.0 and know that I will be converting plenty more in the future so I thought I'd jot down some notes as I went along. This list of notes should increase over time.

 

Machine.Config

.NET 3.0 and 3.5 were really an extension of .NET 2.0 so the machine.config remained constant here C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config or in the 64-bit equivalent here C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG

With .NET 4 we have new 32-bit and 64-bit locations here C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and here C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config

If you've made modifications to your machine.config file for .NET 2.0, 3.0, or 3.5 then you'll have to propagate those changes to the .NET 4.0 version.

 

Links to conversion resources

Official What's new in ASP.NET MVC 2

ASP.NET 4 Breaking Changes

 

Breaking Changes that I've bumped into

<httpRuntime requestValidationMode="2.0" /> needs to be added to web.config to prevent the "A potentially dangerous Request.Form value was detected from the client" error.

 

Tuesday, April 13, 2010

Merging in Mercurial

I'm using TortoiseHg and trying to get the hang of merging changes from multiple contributors so I setup a small test and did some changes and commits and pulled each one into a main repository without doing any merges (except one at the beginning). This is what the tree looked like.




 Then I tried to do a number of different merges and found that nothing really worked (or in the end made sense) except for merging from the bottom of the graph to the tip. When I started doing this things started flowing smoothly. I had lots of conflicts because I made sure that each time I changed a file I changed the same line in different locations to force conflicts. The conflicts were easily resolved in the default KDiff3 text merge tool. This is what the graph ended up looking like in the end.



Wednesday, March 24, 2010

Mercurial Commit Push Pull Update

I'm just starting to wrap my head around Mercurial and feel that this is the best diagram that I've seen that explains the push/pull commit/update model.
 To get or retrieve changes from your working directory to the "server" directory is always a two step process.
To "check-in" you will commit your changes to your local repository and then push them to the server.
To "get latest" you will pull from the server and then update to your working directory.

 

Source: http://www.ivy.fr/mercurial/ref/v1.0/Mercurial-QuickStart-v1.0-300dpi.png

Wednesday, March 17, 2010

Make Better Software: The Training Series

The company that I work for recently bought my team the Make Better Software: The Training Series done by Joel Spolsky at Fog Creek Software. This is my report on this course.

I've listened to all the Stack Overflow podcasts with Jeff Atwood and Joel Spolsky and so I now "get" that Joel is only pretending to be arrogant and his manner is intended to provoke debate. He does it well.

The six one-hour videos in the course are very well done. They were easy to watch and packed with good content and extremely well edited. Every now and then you felt like it was teetering on the edge of a sales pitch for either the product that they sell or for candidates to apply for a job at their company but considering that it was all about working at Fog Creek and creating Fog Bugz it would have been very difficult to not do this now and then.

The manual (Student Guide) that comes with the videos was not as well prepared as the videos. It is essentially a collection of Joel's blog post over the last 10 years divided into six sections. I found at least two blog posts that were repeated verbatim in two different sections and there were paragraphs that were repeated and some of the blogs seemed to have text missing off the end. This was slightly unprofessional and a bit irksome. I'm not sure if anybody proofread or edited the compilation of these.

In the table of contents he has a "chapter" titled "Incentive Pay Considered Harful", italics and bold are mine. I've heard Joel criticize candidates for submitting resumes with spelling mistakes in them with comments like "there's no excuse for that, don't they know how to use a spell checker."

Despite my criticism of the spelling and lack-of-proof-reading I consider the content to be good. It duplicates what is said in the video and in some parts goes a bit deeper and has the names and references that you might miss when watching the video of that section.

The course starts off with The Joel Test. We score fairly high on the Joel test with a 10. We don't do point 3 (daily builds) but instead we build on every check-in which is more rigorous than he is proposing.

After the Joel Test the course is divided into 6 modules:

  1. Recruiting
  2. Team Members
  3. Environment
  4. Schedules
  5. Lifecycle
  6. Design of Software

From a management point of view all modules are relevant but more so modules 1 to 4. I felt that Program Managers were the main focus in the Team Members section but all members were covered and some myths dispelled.

Fog Creek appear to have the best environment for almost anybody to work in let alone developers. It's interesting that the offices given to developers are not only to increase productivity but are a huge sales tool in recruiting talent.

My point of view is that of a developer. As such I found the second half of the course more interesting. Joel did an excellent job of convincing me about the value in specifications and I no longer feel that they are a waste of time but rather something that needs to be continuously worked on while a project is alive.

Would I recommend this course? Absolutely.

 

Thursday, December 31, 2009

Five best things I didn't get for Christmas


I'm posting this here so that I can find it again. This is Life Hacker's most popular Hive Five Topics of 2009.

I hadn't seen this before I bought my Netbook but it turns out that the one I bought was an update to the most voted Netbook on their Five Best Netbooks posting.

Friday, November 20, 2009

Rotate or flip image through Y-axis

I've been trying to work out how to rotate an image through the Y-axis and display its mirror image on a web page. One of the problems that I faced was trying to find the right word(s) to search on as rotate (so I discovered) is used to refer to rotation through the Z-axis most of the time.
I finally found a solution in Silverlight 3. Here's the code...
<Image Source="Jellyfish.jpg">
    <Image.Projection>
        <PlaneProjection RotationY="180" />
    </Image.Projection>
</Image>

...which does exactly what I'm looking for.
My favorite image editing program (Paint.Net) refers to this as Flip Horizontal which I think is completely misnamed.

<PlaneProjection RotationY="0" />




  <PlaneProjection RotationY="180" />


Thursday, October 29, 2009

Quicken Deluxe 2010 spams your desktop

Quicken

I just bought and installed Intuit Quicken Deluxe 2010 from their site for $59. The first thing to disappoint me was the fact that there was nowhere during the purchasing procedure to enter my coupon code and get a discount. I was in too much of a hurry to bother with hunting around for how to do this so they got to keep my $10 discount.

The second thing that really annoyed me was that the installation procedure dumped three spam links on my desktop for other products that they sell.

I haven't even run their software yet and they've had two strikes that annoyed me sufficiently to blog negatively about them. It might be great software but so far it looks like a shady company using back-alley tactics.

Edit on 11/30/2009: That link above (Intuit Quicken Deluxe 2010) has the software priced at $54.99 so you save a through dollars through NewEgg. I didn't know about it at the time so paid the full $59 to Intuit.

Tuesday, October 27, 2009

DVDBurn.exe in Server 2003

I've just been battling for the last 30 minutes to try and burn an ISO as an image to a DVD. I have a version of Nero Burn and tried to line up the planets with this bit of not-so-great software and ended up creating a data DVD with the ISO as the single file on this DVD. I took a second attempt with Nero but just couldn't find the option to create it as an image.

Did I mention that I was burning this DVD image from Windows Server 2003?

I stumbled across this little gem of a utility that I must have installed on this server with the Resource Kit Tools. It's called dvdburn.exe and has a younger brother called cdburn.exe.

DVDBurn.exe takes 3 parameters:

dvdburn <drive> <image> [/Erase]

Worked like a charm:

C:\Software>dvdburn d: en_windows_7_ultimate_x64_dvd.iso
Media type: DVD-R
Preparing media...
Error setting timestamp; this error will be ignored, some drives can work without this
- 100.0% done
Finished Writing
Waiting for drive to finalize disc (this may take up to 30 minutes).............

Success: Finalizing media took 10 seconds
Burn successful!

Friday, October 23, 2009

C# Math.Round Banker's or Mathematical Method

I wasn't even aware that there was a banker's method to rounding numbers until I came across what I though was a bug in the Math.Round() function in the .NET library today.

If you call this function:

double x = Math.Round(.005, 2);

then you will discover that x is set to zero. If you call this:

double x = Math.Round(.0051, 2);

then x will be set to 0.01.

I was always taught that you round up from 5. This is still correct and is known as the mathematical method of rounding. However I have recently learned that there's another method and if the least-significant-digit is 5 and you're using the banker's method then you round down instead of up. This is the method that Math.Round() uses by default.

If you want to use the expected mathematical method for the round function then you need to add another parameter to the overloaded Round() function which specifies how you want it to handle midpoint rounding. AwayFromZero will do the trick:

double x = Math.Round(.005, 2, MidpointRounding.AwayFromZero);

This will cause x to be set to .001 as you would expect. The other value defined in the MidpointRounding enum is ToEven and this will do the default of round the midpoint down to zero.

Mystery solved!

1 Sep 2010, just discovered this:

Banker's Rounding

When you add rounded values together, always rounding .5 in the same direction results in a bias that grows with the more numbers you add together. One way to minimize the bias is with banker's rounding.

Banker's rounding rounds .5 up sometimes and down sometimes. The convention is to round to the nearest even number, so that both 1.5 and 2.5 round to 2, and 3.5 and 4.5 both round to 4. Banker's rounding is symmetric.

Wednesday, October 21, 2009

SpamBayes performance on Outlook 2007

I installed SpamBayes for Outlook 2007 eight days ago and have been using it since then. I can understand the reluctance of users to installing this software because it's not trivial to understand how it works or exactly why it would be better than the spam software built into Outlook.
Before I installed SpamBayes, Outlook was catching about half of the spam emails that I received and putting about 5 or 6 legitimate emails into the Junk Mail folder. After SpamBayes took over it got a few wrong and put a number of emails into the Junk Suspects but once it had finished training in about 3 or 4 days it was getting almost everything right. Since then it's had about an average of 1 a day wrong or unknown and the gap between those is getting longer.
If you're an Outlook user and you haven't installed SpamBayes yet then I highly recommend that you do so. It's free and available here from SourceForge and it will repay your time-investment within the first week.
The key difference between SpamBayes and Outlook's default spam filter is that SpamBayes learns what spam means to you without you having to classify subject types and/or from emails as blacklisted. You don't have to setup rules. For example, I get a lot of spam email that purports to be from myself. I also send myself legit emails about things I want in my email. Spammers know this and that's why they spoof my email address because they know that I won't block my own email address. SpamBayes learns that it should place zero significance on who the email's from and instead focuses on other markers in the email to learn from you what spam and ham (good email) mean to you.
If, for example, you work in the porn (or anti-porn) industry then emails with the word "porn" may be legitimate emails that you want to and need to read. They may be from co-workers of yours. However, there may also be plenty of spam about porn that you don't want to read. SpamBayes takes care of that for you because it learns that distinguishing spam from ham based (in part) on the word porn for your email is useless and will therefore automatically ignore this word and focus on other words (and markers) in your email to make this distinction. In my personal email however it would probably classify the word "porn" as a red flag that the email is spam.

Ditto Clipboard Manager

For about the last year I've been using ClipX which is a clipboard manager. This worked well-ish with a few minor annoyances but seems to have been languishing in a vacuum of non-development and stagnation. Recently a friend put me on to the Ditto Clipboard Manager which I've installed on to a number of machines that I use and I absolutely love it and recommend that you install it immediately.
I've tested Ditto on Windows XP (32 bit), Server 2003 (32 bit) and Server 2008 (64 bit) and it works perfectly on all those machines. Today I was chastised by Ninja Camp for not blogging about this utility and spreading the wealth of knowledge so here is that post. Ninja Man tried to install it on Vista earlier today and he reported initial problems and I haven't heard back from him on this so not sure if he got it working or not. Hopefully he'll comment here on his progress.

One of the other utilities that I had running on one of my computers was Pure Text. This little applet allowed you to strip formatting from text when you paste it. You know when you copy something from a word document or a web page and you want to paste it without that bold and color? Well Pure Text does this for you. However, and this is a big however, you no longer need this utility if you're using Ditto. One of the features of Ditto is to paste any of your clippings as "Paste Plain Text Only" which is a real Godsend.
The default keyboard combination to launch Ditto is Ctrl + ` which I suggest you don't change even if you find it uncomfortable at first. I promise that this will grow on you very quickly.