Thursday, 26 July 2012

Internet Explorer is killing the internet (and me)

As any professional web developer knows, cross-browser testing is one of those day to day mundane tasks that's required for most web UI work. You've spent time creating beautiful UI mock ups with that creative mind of yours, transferred that to HTML and it looks good. Chrome and Firefox is pixel perfect. Then it's that moment you've been putting off - what does it look like in IE? Boom. You're spending the rest of the day, turning that beautiful HTML and CSS into a shambolic hack before it finally resembles what you intended it to.


OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!


...when we laughed our socks off to Monsters inc and Apple introduced us to the iPod; Microsoft gave birth to Internet Explorer 6. It's still to this day stifling the creativity and wasting the time of web developers across the globe. If you find yourself in the unlucky position where a decent percentage of your target audience is still living in the past on IE 6 (or 7 or 8) you're hands are often tied. It requires a bold business decision to say no to IE6 support. Some people, projects and companies are doing this - in some interesting ways too (IE7 tax). Even Microsoft are fed up and have created their own IE6 count down site to encourage people to upgrade. But this act of redemption is too little too late. Saying that, the site is fairly interesting. It displays the stats of IE6 usage around the world. Surprisingly, China being the worst offenders still. Here's an article I found that outlines the reasons why China still favours IE6.



Rant over.

Monday, 23 July 2012

Visual Studio can work with HTML afterall

Fix Visual Studio’s crappy HTML formatting and automatic addition of id when pasting

Some nice chap called Tim just told me how to solve those two annoying things that Visual Studio does when I'm editing HTML. What two things? You know, the weird thing with the line breaks and opening tags and the one where it insists on adding an ID to every element you paste in the HTML.

Thanks Timmy!






Continuous Integration and Jenkins

I found this old draft post hanging around on blogger and it reminded me to a time long ago before CI servers were a part of my dev life, so I decided to post it...


Jenkins (formerly Hudson) is an open source continuous integration server and assists the development team by allowing us to easily integrate changes into our software projects from our source control with confidence. Jenkins can be automated to build, test and deploy any type of software automagically. Jenkins doesn't require bucket loads of learning before you start using it and it's very easy to set up. It's also super extensible and caters for a wide variety of programming languages/testing frameworks etc and there are a lot of plugins available - and I mean a lot.


Feedback is key. If Jenkins has any problems building, testing or deploying any projects it can alert the development team in a number of ways (e.g. through a GUI, email, twitter and many more). So as soon as the build or any tests fail we get alerted and the team react to fix those changes - it's never broken for long.


As you can imagine, once we made the effort to set up our software projects in Jenkins, it has improved our 'quality of dev life' dramatically. Automating the building, unit testing, integration testing and deployment straight to our staging environment for every check-in means we are more confident, less stressed and a lot more productive. Once happy with our staging environment we can one click an application release to live. So our application users are getting newer features faster than ever. Ignoring IDEs and source control, I'd argue a CI server is probably the next most fundamental tool in a developers tool belt.


Jenkins! How did we ever live without you?!




Saturday, 4 February 2012

Import CSV Data into Sql Server Table

Getting a CSV file into a SQL Server table?

Found an even easier way to do it...

CREATE TABLE TelephoneNumbers
(TelephoneNumber NVarChar(15))
GO

BULK INSERT TelephoneNumbersFROM 'c:\TelephoneNumbers.csv'
WITH
(
 FIELDTERMINATOR = ',',
 ROWTERMINATOR = '\n'
)
GO

The code is self explanatory; I was surprised how easy it was!'

Sunday, 11 December 2011

University of Nottingham Agile Software Development Talk

A work colleague and I recently attended the University of Nottingham Jubiliee Campus, to present a talk to second year Computer Science students that were taking part in the group project module. The talk was entitled 'What's it like to work in an agile software development team?'.

The talk focused on how the Esendex development team tackle software development, and we presented some ideas for the planning and development aspects of their own group projects. I did the same module when I was an undergraduate at Nottingham and the module stands out for me as the closest thing you experience at university to working as part of a real software team in industry.

It was tough selecting exactly what to put in the talk, 'agile development' is a broad subject and means different things to different people. We could have easily talked about the Agile Manifesto for the 50 minutes we had, but in the end I think we did well cherry picking the parts that would interest the students and be relevant to their group projects. We also thought it important to run through a demo of some of the concepts we talked about and this part was especially received well.

We carried out a 'mini retro' at the end of the talk, asking the students to leave some feedback on their way out. We split the board in two; 'What went well?' and 'What could have gone better?', providing the students with some post-its and pens. We were very pleased with the feedback, as you can see the feedback was 90% positive :)

You can't see the comments on that pic unfortunately, but here's some I've cherry picked...

Content truly excellent! All highly relevant & interesting, right level of detail.
First live demo from a guest lecturer :)
Great to see a live demo, putting theory into context.
Actually related to the group project.
Students might have struggled following the detail of some examples. Slow down a little. Font size & colour, for demo.

Here's the slides if you're interested, looking forward to getting invited back again next year hopefully.

Thursday, 24 November 2011

One Git Clone to Rule Them All

git clone --recursive REPOSITORY_URL -o REPOSITORY_ALIAS
  • --recursive - Gets the submodules too
  • --o - Sets an alias for remote repo rather than defaulting to origin (useful when working in teams)

Friday, 11 November 2011

Calculating MySQL Database Size

A neat script for retrieving database size in MB. I found it useful for checking on Amazon RDS instances.

SELECT table_schema "Database", SUM( data_length + index_length) / 1024 / 1024 "Size (MB)" 
FROM information_schema.TABLES 
GROUP BY table_schema ;

Monday, 17 October 2011

Should I Dispose of my LINQ DataContext?

Most developers construct a DataContext within a using statement to make sure that resources are cleaned up when leaving the block.

using( var dataContext = new LinqDataContext() )
{
   // Perform some data operations
   dataContext.Insert(obj)

} // Dispose of the DataContext and release resources

However it's not needed, the .Net garbage collector does that for you and the need to dispose of the DataContext is made less of critical requirement knowing that LINQ DataContexts do not keep expensive database connections open (something that surprised me) like some other ADO.Net objects.

To summarise, it isn't the end of the world and you aren't a bad developer if you don't dispose of your DataContext objects. I do however think it's good practice to work with IDisposable classes in this way; plus it releases those resources slightly quicker than just leaving it to the garbage collector.

Monday, 3 October 2011

Powershell Sleep

Zzzzzz....
Start-Sleep -s 5 # 5 seconds
Start-Sleep -m 5000 # 5000 milliseconds