A Funny Java Flavoured Look at the World

Wednesday, October 24, 2007

Free Presentation - The Role of the Enterprise Service Bus

I have been looking at a product called mule which is basically a Enterprise Service Bus. So to understand what Mule did I had to find out what an ESB is and this presentation was pretty useful and very detailed at 60 minutes long

http://www.infoq.com/presentations/Enterprise-Service-Bus


if you like comedy check out this funny podcast
Hosks Half Hour - http://hoskshalfhour.blogspot.com/

Wednesday, April 04, 2007

Java J2EE Job Interview Companion - book review

Java J2EE Job Interview Companion
I found this excellent book this week. I would recommend this book whether you are or are not looking for a new job. It basically sums up a number of well used things in Java programming but in short one paragraph sentences, which is why its a useful interview companion.
It has questions like
1. Give a few reasons for using Java

Built-in support for multi-threading, socket communication, and memory management (automatic garbage

collection).

Object Oriented (OO).

Better portability than other languages across operating systems.

Supports Web based applications (Applet, Servlet, and JSP), distributed applications (sockets, RMI. EJB etc)

and network protocols (HTTP, JRMP etc) with the help of extensive standardised APIs (Application Program

Interfaces).

What is an IS A and a HAS A relationship, Explain the Java Collections Framework

You can find the answers to these questions if you don't already know them but this books summarises it in one paragraph. I have found it very useful for jogging my memory on topics and giving me a little bit of knowledge on the topics I don't know anything about. I think the best quality the book has is it gives you enough information and explanation to understand the topic, so if your fellow developers are talking about it you will have an idea of what it is.

This is the blurb on the amazon.co.uk page - http://www.amazon.co.uk/Java-J2EE-Job-Interview-Companion/dp/1411668243/ref=sr_1_1/202-6432586-7418219?ie=UTF8&s=books&qid=1175700291&sr=8-1

synopsis
A Java/J2EE interview companion and a quick reference guide for: Job seekers Promotion seekers Pro-active learners Interviewers Lulu top 100 best seller. Learn the core concepts and issues relating to Java/J2EE in an easy to understand questions and answers approach.Covers over 220 interview questions and concise answers with diagrams,examples,code samples,cross referencing etc. A quick reference guide, a refresher and a roadmap covering a wide range of Java J2EE related topics. Learn more about this book on Java J2EE interview questions with answers. Available as a PDF version Java J2EE interview questions with answers pdf version

I have only read about 30 pages but so far I have been pretty impressed with it

Tuesday, March 27, 2007

taking a url and passing it back an outputstream in a jsp

Today someone wanted to pass in the name of a file located somewhere inside a web application and then stream that file back to them. In this example they wanted to open a pdf file. We only wanted a quick dirty piece of code put in a jsp, which was okay with me being the cowboy coder I am.

The first tricky point was they were giving me a URL and wanted back a file. I have tangled with this problem before of translating a url to get to a file but of course I couldn't remember how I did it.

After searching on the internet for a bit I found this piece of code

http://www.exampledepot.com/egs/java.net/Post.html

I did have an example first of getting a file and then sending that back through the outputstream of the jsp (which is really a servlet as we all know). It was interesting that I got this task because I had been reading about this in my SCWCD book whilst studying (very slowly) for the exam.

this is what what the code was for the reading a file

//resources//docs//CodeConventions.pdf

response.addHeader("content-disposition","attachment; filename=" + fileName);

fileName = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/resources/docs/CodeConventions.pdf";

URL url = new URL(fileName);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);

File f = new File(fileName);
byte[] bytearray = new byte[(int) f.length()];
FileInputStream is = new FileInputStream(f);
response.setIntHeader("content-length", (int) f.length());
is.read(bytearray);
OutputStream os = response.getOutputStream();
os.write(bytearray);
os.flush();


The deal was that I was going to be passed in the relative url, so the person would pass in the url to the file relative from the root of the web app. This allow me to use the servlets request.getContext and getServer() to generate the first part of the url

here is the final code, it differs because it gets a url and then gets a connection to that url and reads off the data before passing that into the output stream of the servlet/jsp. Its pretty messy but it works.

<%@ page import="java.lang.Integer" %>
<%@ page import="java.io.BufferedInputStream" %>
<%@ page import="java.io.ByteArrayOutputStream" %>
<%@ page import="java.io.FileInputStream" %>
<%@ page import="java.io.FileReader" %>
<%@ page import="java.io.File" %>
<%@ page import="java.io.FileInputStream" %>
<%@ page import="java.io.FileReader" %>
<%@ page import="java.io.OutputStream" %>
<%@ page import="java.io.OutputStream" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.net.URL" %>
<%@ page import="java.net.URLConnection" %>
<%


response.setContentType("application/pdf");
String fileName = "not set";
if (request.getParameterValues("docname")[0] != null){
fileName = (String) request.getParameterValues("docname")[0];
}


response.addHeader("content-disposition","attachment; filename=" + fileName);

response.setContentType("application/pdf");
fileName = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + fileName;
URL url = new URL(fileName);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
BufferedInputStream buf=new BufferedInputStream(conn.getInputStream());//for better performance
OutputStream os = response.getOutputStream();

byte[] buffer=new byte[1024];//byte buffer
int bytesRead=0;
while (true){
bytesRead=buf.read(buffer,0,1024);
// bytesRead returns the actual number of bytes read from
// the stream. returns -1 when end of stream is detected
if (bytesRead == -1) break;
os.write(buffer,0,bytesRead);
}

if(buf!=null) {
buf.close();
}
if(os!=null) {
os.close();
}


os.flush();
%>

Wednesday, February 14, 2007

10 presentation tips for developers

In reality I am probably the last person to give tips on giving presentations as I am not that good at giving presentations. Recently though I had to give a presentation so I thought I would note down how I did it and what worked for me, so if any of you other poor developers are bullied into your suit and made to give a presentation you can see how someone else did it.

1. Write it early
don't leave it too late. Get it done early and then once it is written you can chop and change it, other people can look at it. Basically it gives you more time improving your presentation, whether its editing the presentation, adding bits, removing bits, practising or just thinking about it.

2. Edit and edit again
if you are have written the presentation early enough, it is a good idea to read again each day after you have had a break from the presentation. I often find that if you keep working on a presentation you get to a stage where you can't see the wood from the trees. So it's good to do something else and then look at the presentation again. You can then decide what bits aren't needed.

3. Show other people
Feedback on presentations is very important because often you are writing the presentation from the point of view of someone who (often) knows a lot about the subject. In my case recently it was doing performance tips but before I have presented on projects I have done. Getting feedback from other people will give you an opinion of people who don't know about the subject and this can highlight areas which might not be easy to understand by people who don't know the subject. Showing other people will also bring out other problems like spelling, grammar and making sense.

4. Don't make it too long
Short is sweet. People want to know what your presentation is about but they don't want to be bored by it. I find that shorter presentations are often easy to digest. After a certain period if the subject is boring then people will start to switch off.

5. Don't just rely on PowerPoint (if possible)
Although PowerPoint is nice and safe it can also be a bit boring, watching slide after slide. If you can try and put a life demo in and if you can't put a live demo in or you are a bit worried about it then you can record yourself clicking about with the software and then show this and talk about it to the audience. I find this change of presentation style helps keep the audience interesting and it's also visual which the audience love.

6. Add a few jokes
even if you aren't a "funny" person adding in a few jokes is appreciated by the audience. Often presentations are boring and sitting down for a 15-30 minute lecture where you have nothing to do but listen can be tough. So a when there is a small joke added into presentation its a good respite and people are glad for it. I have seen people laugh at terrible unfunny jokes and if they weren't said whilst doing a presentation nobody would laugh but because you add the joke in during a presentation people like it.

7. Practise Practise Practise
I am a terrible speaker and get nervous and flustered. The way I have personally found to help overcome this

8. Make sure it works
if you are using a live internet page or a live piece of software, make sure that you go on the machine the morning of the talk and test that all your web pages work and the software is running. When the software or links don't work it is like watching a wet firework, all the anticipation and then a great big nothing, it also looks a tad unprofessional. If you can make sure you have a backup plan, like a movie of the software or just a load of waffle saying what they would have seen and where to find it later.

9. Look at the audience and Slow Down
Although I said don't make the talk to long, try to avoid going up and rushing through the presentation because you are nervous. People will need time to digest what your presentation is about and they certainly won't be able to do this if you rush through the presentation at 100 miles an hour. Try not to get to flustered and keep the pace not to fast. Another tip is to try and look at the audience whilst delivering the presentation, this has the added bonus of giving you something to focus on and not fidget nervously to much.

10. Practise Practise Practise
I find it difficult to give speeches and presentations but one way I have found to make it easier is just by practising the speech/presentation. The more I can practise the speech the less I have to think about what I have to say and the less I need to look at my notes. When you aren't as worried about what you are saying you can then concentrate more on the delivery of the speech. It also gives me more confidence in the presentation the more times I run though it and in the end it becomes more practised and polished.

10 + 1 - bonus tip. Ask if people have any questions at the end
This has the potential to open a can of worms but it may also answer a question which everyone watching is thinking about. It also gives you an opportunity to reply and talk about the presentation topic. Also someone might bring up a useful question

There are all my tips, I would be very interested and grateful for any tips any one else has on the topic of giving presentations because it is certainly one area I could do with improving in and anything to make them less stressful is certainly a good thing for me

using system properties

I was doing some coding that was creating files and changing directories inside a file. I did the work initially on a windows machine, tested on a windows machine and I don't think there was any talk of a Linux machine. So of course onto the Linux machine we go, my code popped up the white flag and promptly fell flat on its backside.
I had of course heard about the nastiness of backward and forward slashes and have been drawn into the Linux world recently but thanks to the beauty of Java and it's platform independency. I recently read somewhere (and blogged about it) that Java isn't platform independent it is a platform, which I suppose is a fair point but to which doesn't really seem to be a bad thing to me (apart from a touch of bloatyness). Anyway back to the subject.
http://scv.bu.edu/Doc/Java/tutorial/java/system/properties.html

There are a number of useful values in the System object and probably the most popular is the System.out.println that a lot people use for debugging their code.

Another useful item is the

"file.separator"

this will return the file separator used, so in my code I used this instead of using a backslash or forward slash, I used the

System.getProperty("file.separator")

this will return the different file separator used for the different operating systems. I'm sure a lot of people already know about the system properties but this was just one way I found to solve problems I had when saving and reading files on different operating system.

Agile and Scrum resources

I don't use Scrum or Agile methods but I read about them now and again. If you are interested in Agile and Scrum I found a site with some good resources
The link above has a number of good resources, interestingly it has a number of links to google video's where they have talks on scrum, all of which are about an hour long and the couple I looked at were a good introduction to SCRUM.
The other really useful link Learn Scrum in 5 minutes
Although it always makes me smile when I read about the Scrum Master, it reminds me of scouts or something like that.

Wednesday, February 07, 2007

SCJP 5 resources

I can't remember where I found this but someone has a made a list of a lot of SCJP resource links on my blog. This was something I was meaning to do, so it saved me the bother. I'm not sure if they are all in here, so my advice would be just to search on the SCJP topic on my blog and then it will return lots of stuff.

here is the link

http://www.google.com/notebook/public/09466151404937120238/BDTncIgoQi_G7jdMh

enjoy and I hope it helps anyone to pass the exam

as I bonus I just saw this on Java lobby, a forum with links to SCJP 5 exams

http://forums.javabeat.net/index.php?topic=5.0

champion

Wednesday, January 31, 2007

should/would you put your blog on your CV?

At the start of the year I often update my CV, well to be honest it's a bit of lie because I look at it and then update a little bit but nothing to dramatic.

Anyway whilst updating my CV and adding in the fact I passed my SCJP 5 exam last year and then wondering if any would be employers would be impressed with it?

I have posted various blogs about being certified which are here if you fancy a read

Is certification becoming less popular as developer retention becomes more important?

Does passing SCJP 5 exam make you a better programmer

Why Should I Get Certified in Java Technology

being certified is getting away from my original point, although if you would like to hear my opinion I don't think it hurts getting certified because if nothing else it sets you CV apart from some other candidates but most developers realise that being certified doesn't really say anything about the quality of your code.

Back to the question

Should you put your blog on your CV?

I suppose it depends on what is on your blog, if its a personal blog it may contain some comments/statements that could offend or give your potential employee some second thoughts. Of course on the other hand it could also show what a well round person you are.

A technical blog on the other hand is a different story. I see it as a way to show a potential employer you technical skills because as we know a lot of people talk a good game on their CV but the skills they put down on their CV don't always materialise when you put them down in front of a computer and get them to do some work :-)

Another point is that whether you put down your blog on your CV or not they will probably find it (especially if its popular) because I blogged about the effect of Google before. A lot of employees will type in your name into Google if they are going to interview you and then see what turns up. A lot of people also type in their own name into Google, this is called "ego surfing". Here is a link to a blog post I wrote about it a while ago

I'm not sure of the law regarding blogs and employees etc because I have been talked to by an employer asking me to be careful about the contents of my blog, which was initially quite a shock because I had no idea they knew I had a blog, let alone that they read it.

Personally I think it would be okay to put your blog onto your CV because I have certainly learnt a lot by blogging about Java and I think having a blog shows that you are a person who likes to learn and a person who likes to give back some knowledge to the Java community. These are both good qualities in which I think employers would be interested in. Of course they would probably be shocked by my atrocious spelling and grammar but I would ask them if they are reading this now to look at the content and remember when programming it's not vital to be able to spell well.

I would like to know what people think out there, does anyone else have a link to their blog on their CV, I don't think I have ever really seen a link to a blog, a few websites but not a blog, yet......

Thursday, December 07, 2006

Constructor conundrum

I found an interesting constructor type conundrum this week.

I was created a class which held some values as instance parameters, a few strings and an Array. I then extended this class and hard coded some of the String values for the extended class. Basically I thought this was a decent way of placing the hard coded values into a little area, basically containing the hard coded values which could if later get the values from somewhere else (e.g. reading from a file).

The variables where initially private final Strings but then the constructor complained it couldn't see these values in a constructor. I got around the problem by making the values Static because I didn't actually want to change these values for each instance of the class.

The message was

"cannot refer to an instance field variable name whilst explicitly invoking a constructor"

It took my by surprise a bit and then I thought why is it coming out with this message, I thought that basically these variables should be created before the constructor had run. Then I did a bit more thinking and it occurred to me that the constructor has to have a super or call another constructor as the first line. This is because when Java creates a new instance of a class it has to run all constructors of the inherited classes first before it runs it's own constructor. Why does it do this because you might be using some of the values in the extendded class. As we know this means that Java has to run the constructor of Object class and set up its instance variables before it gets round to run the constructor of your class and initialising it's instance variables.

Anyway it was a slightly interesting (or not) not error but just the way Java works, it took me a little by surprise until I thought about it a bit.




If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Tuesday, December 05, 2006

My first steps using MySql

I have been using MySQL this week which is my first foray into the MySQL world and I'm happy to say it has been a nice easy ride. I haven't done anything fancy with it, in fact I have really only be using it to create two very basic tables but basically I needed a database and MySql is free so it was a good choice.

The download from the site was simple and after I downloaded the latest MySql I downloaded a nice gui tool to go with it - MySQL GUI Tools 5.0. I have been using the Query browser or when I asked another developer which one of the exe's to use he said "the lightening bolt". The lightening bolt was very straightforward to use and creating the table was fairly easy but unfortunately I couldn't add in any rows in the gui dynamically and had to add the rows in using INSERT statements. I don't mind dabbling with an Insert statement but I always forget the syntax (single quotes, who would have thought), so if like me you need a bit of reminding check this link

http://xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/


or you can look at my code

INSERT into sites (ipaddress, sitename) values
('127.0.0.1', 'localhost');

I wrote some jdbc connection code for oracle, SqlServer, access and as we already have code to do such things I was thought I should add in another connection to fit it in with the rest of our code.

I found a couple of useful links to show me how to connect and the name of the driver, the first one was very useful


http://www.stardeveloper.com/articles/display.html?article=2003090401&page=1

You have to download the MySql jar file and put it in the classpath or import it into your eclipse project. So now I am up and running with my MySql database, a table with some rows in and a JDBC connection and it was all fairly painless.

As Borat would say "HI FIIIIVEE"



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Monday, December 04, 2006

Sometimes you need to write defensive code

I read a good description of this today, it said defensive programming is like defensive driving, you take responsibility for protecting yourself even if it's the other drivers fault. It's always a bit of conundrum for me, how defensive should I program my methods, classes because it's likely that I am the only person for quite a while to use it, so am I programming defensively for the benefit of others who might never use it.

That said defensive programming is not just about protecting the people who use your code it's about protecting your code so that a big explosion doesn't happen in your code (and thus you getting the blame). A good piece of defensive programming can help debugging immensely by getting nearer to where the actual problem is and not a function erroring just because it's been passed some invalid parameters.

An Example of this is protecting your code from invalid parameters/inputs. If a user can't be bothered to pass in the right inputs don't let your code try and wrestle with it. Check them variables being passed in and throw the appropriate error if they are not valid. An important point here is to make sure you document what is valid and invalid in your JavaDoc.

There are some situations where if you are writing a method inside a class that is private then you know what is going to be passed in so you don't have to write some defensive code because it's only your class which will be called the code and sometimes it's not worth the extra effort of creating the defensive code.

The reason I am blogging about defensive programming is because I used an example of it this week or should I say I had to decide to choose to write some code this week where I thought the best policy would be to return an Array which wasn't null.

In my example I was splitting up a log file in a various String arrays and in the piece of work I was doing, I had a log file and then had to split up the log file into various sections based on IP address. The IP addresses were static (in my tests anyway) so I decided to create some code split the log file into lines and then create 5 String arrays, each array filled with the lines with a certain IP address. What would I do if an IP address didn't have any lines. I decided to to return an array with nothing in

String [] myArray = {};

This meant that the next part of my code processed an array but I didn't have to worry about checking for nulls I just processed it because I knew that there was going to be a blank array rather than return null which would have meant I would have had to check for nulls.

This was one of the tips in Effective Java and it's very useful, don't return nulls they are dangerous and a nasty bug waiting to pop up later when a user manages to get some bad data into the system.





If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Labels:

Thursday, November 30, 2006

trouble using | (pipe) with the String.split method

I came across this little problem whilst coding this week and it was driving me crazy and it is only a little problem so I wasn't going to blog about it but I couldn't find any information on it anywhere so I thought I would write a blog entry in case someone else has this problem.

The problem came when I tried to using String.split method, you replace String with an actual String and not the static object. Anyway I had written a log file and used | (pipe) as a delimeter so that when I got the log file in my code I could just do a split("|") and then it would chop each line into a nice array of Strings which I could loop through and search and take out the values I wanted.

The problem I was getting was when I did split

myString.split("|")

it split the string on every single character, which was quite a shock. I tried to goggle the problem by typing in things like

"using pipes with split()"
"pipe metacharacters"

I knew from my study of the SCJP 5 that there is some tricky characters in regex (regular expressions) called metacharacters but I couldn't find | included in any of them and wasn't sure why it was acting funny. I have blogged about metacharacters before in a blog entry called
\n - newline saves the day and formats all my troubles away

In the end I found that to successfully use the pipe in a regular expression I had to add a double backslash like so

myString.split("\\|");

and then it worked fine.

I thought I would blog about this just in case someone else runs across this problem. I'm not sure perhaps its something which everyone knows not to do (except me obviously) , I know pipes are used for adding things together but I still don't really understand why it would split on everyone single space

Is Java getting bloated?

A friend of mine sent me an email today pointing me towards Stroustrup's web page, for those of you who don't know he is the person who invented C++. Here is his homepage http://www.research.att.com/~bs/ and it's quite interesting (even for a Java person)

of course because he invented C++ he is bombarded with questions comparing Java with C++ and which one is better/faster/more Object Orientated etc. So he put questions such as this into a FAQ list and this one in particular caught my eye

Is Java the language you would have designed if you didn't have to be compatible with C?

No. Java isn't even close. If people insist on comparing C++ and Java - as they seem to do - I suggest they read The Design and Evolution of C++ (D&E) to see why C++ is the way it is, and consider both languages in the light of the design criteria I set for C++. Those criteria will obviously differ from the criteria of Sun's Java team. Despite the syntactic similarities, C++ and Java are very different languages. In many ways, Java seems closer to Smalltalk than to C++.

Much of the relative simplicity of Java is - like for most new languages - partly an illusion and partly a function of its incompleteness. As time passes, Java will grow significantly in size and complexity. It will double or triple in size and grow implementation-dependent extensions or libraries. That is the way every commercially successful language has developed. Just look at any language you consider successful on a large scale. I know of no exceptions, and there are good reasons for this phenomenon. [I wrote this before 2000; now see a preview of Java 1.5.]

Java isn't platform independent; it is a platform. Like Windows, it is a proprietary commercial platform. That is, you can write programs for Windows/Intel or Java/JVM, and in each case you are writing code for a platform owned by a single corporation and tweaked for the commercial benefit of that corporation. It has been pointed out that you can write programs in any language for the JVM and associated operating systems facilities. However, the JVM, etc., are heavily biased in favor of Java. It is nowhere near being a general reasonably language-neutral VM/OS.

Personally, I'll stick to reasonably portable C++ for most of the kind of work I think most about and use a variety of languages for the rest.


This seem quite an amusing question to ask someone who invented C++ I wonder if people still compare Java and the various C languages so much any more, it seems to me and I admit I don't know that much about C++ etc that Java's speed and the processors in computers have improved enough so that speed is not the main issue any more. I have a sneaky feeling that this is probably because the stuff I have been working on is not on such a big scale that time is that important to me and I'm sure C++ is probably still quicker but it doesn't really matter to me.

It's interesting about his point that the JVM will bloat up, this does strike me as a fairly obvious statement because the more stuff that is added to the JVM and the Java language the bigger it is going to get. I remember listing to a debate/discussion on the Java Posse where they were talking about the database being added to the JVM, they were saying it would be nice if people could choose.

I was wondering if with Java going open source that there will be skinny versions of the JVM and people stripping out stuff they don't need a bit like Linux and it's kernel. Then again does it matter that much, computers have plenty of hard disk space.

I like his comment that JVM is a platform and not platform independent, I hadn't really thought of the JVM as a platform before.

As he wrote the FAQ quite a while ago he did quite a good job of predicting the future but I wonder how Java going open source will effect things like speed and bloatness. Does anyone have any comments on this, I would like to hear what you have to say as I am a bit in the dark over such things. Is Java getting/is bloated and does it matter?




If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Wednesday, November 29, 2006

Date is depreciated - Calander is King

This week I had been working with dates which is sure sign of a lot of tricky nitpicking code and lots of little methods each testing certain bits of the code.

The first thing that got me annoyed was the Date class is basically all depreciated except for just creating a date. This is fine and the reason for this is (I think) because people needed a locale specific date or something like that. This is where I started to gnash my teeth a bit because it didn't really point me in the direction I should be going. I think it's the Calendar class and from studying for my SCJP 5 exam. I found the help for the Calendar class not that helpful, how do you set the flipping thing. Here is a link if you want to peruse yourself

Firstly the Calendar class is abstract so to get an instance of it you have to do this

Calendar rightNow = Calendar.getInstance();

or choose a different method to get the right flavour for you. Then to change the date and time from right now you have to set the date, it seem obvious to me now but I was looking through the documentation rather puzzled for a good five minutes before I just went into the code and used my IDE to get the methods available the rightNow variable above.

rightNow.setTime(Date)


I think this is what threw me off a bit because it was setTime and I was thinking about setting a date. Once you have got you Calendar instance set up with the correct time, the Calendar class is very good with the lots of methods to get Time or Months, first day of the week, number of days in month, all very nice.

Earlier on in the day though I was wanting to compare some dates and found this code example to do it, although this uses the Date object. I actually didn't really want to compare the actual date, all I wanted to do was see if the date was in a different month, which I did by getting the month from the calendar instance and then comparing the months.

This was what I was going to blog about all along, how to parse a date from a String value, this example was great, straight to the point

String s = "15-05-2005 5:55:55";

SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Date date = df.parse(s);

Above is the basic code to parse the date, I don't think I have used the SimpleDateFormat tool before but it made it quite simple, although I did have a bit of problem because I put small mm instead of big MM when I tried to change the format of the date a bit.

So there you go there were my adventures with dates, the best thing with working with dates is that you can test your functions easily with unit tests because generating some data for it is easy. This means that although my code was doing a lot of small tests at least I could easily and quickly test the code and be confident that it was doing what it should.



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Tuesday, November 28, 2006

Computer industry 'faces crisis'

I read this article last week but didn't have time to blog about it, I found this on the BBC and this isn't the first time I have read an article in this vain, the title is Computer industry 'faces crisis' The article is about the number of students studying computers at university has dropped dramitically.

It's quite an interesting thought that computers are no longer a fashionable choice for students, what are they doing instead. I can see that the topic can be perhaps more challenging than some of other topics because you have to learn a computer language and then put in the hours to make it do something. Where as in some other subjects like Business Management (which was in my degree) you could often make up parts of the answers to questions and use logic.

The above paragraph is obviously a bit of old man ranting and "it's all easier for these young un's today" type of warbling.

I find it slightly unusual that computer is not being studied as much in university because there does seem quite a lot of jobs in the industry, you get to play with computers. The article says there is a sharp decline in people studying it. I like this description in the article

The industry also had an image problem, he said, with computer scientists often portrayed on TV and in films as "geeky".
I suppose one problem that might occur with computers and studying computer is that it isn't very appealing to women. In my experience I have worked with very few women (1 or 2) so a computer degree is already starting off on the back foot.

The bottom line is that it will be good news for people already working in computers as smaller numbers of skilled people should mean are prices go up. We can but hope.



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Tuesday, November 21, 2006

What IT skills are used with Java?

Yesterday I blogged about The Average wage for Java Developers and the page where I got this information also had some interesting statistics regarding what other skills job adverts had when the word Java was mentioned. The original source of that data can be found on this link.

Below is are the IT skills that are mentioned in the same advert as Java

Java Related IT Skills
Top 20

Over the last 6 months permanent IT job ads across the UK citing Java also mentioned the following IT skills in order of popularity. The figures indicate the number of IT job ads and their proportion against the total number of ads sampled citing Java.
131498 (38.50 %)J2EE
222217 (27.16 %)SQL
321498 (26.28 %)UNIX
421368 (26.12 %)XML
521023 (25.70 %)Oracle
620439 (24.98 %)Finance
718660 (22.81 %)C++
818480 (22.59 %)Banking
916815 (20.55 %)Degree
1014833 (18.13 %)OO
1113380 (16.35 %).NET
1213159 (16.08 %)C#
1311514 (14.07 %)JSP
149895 (12.09 %)HTML
159510 (11.62 %)Sybase
169481 (11.59 %)UML
179222 (11.27 %)Linux
189125 (11.15 %)SQL Server
198823 (10.78 %)Windows
208694 (10.63 %)Front Office


I was slightly surprised J2EE was the top IT skill, I don't really know why but I was sure so many adverts would use that word as it seems slightly on it's way out. The database stuff like SQL and Oracle is very high as you would expect. JSP is quite low down the list and I thought this would be something to do with Ajax but that isn't on the list at all. Disappointingly OO is down to number 10, below Degree. It's interesting that other programming languages feature quite highly.

This set of data also interested me

Java Related IT Skills
By Category

Over the last 6 months permanent IT job ads across the UK citing Java also mentioned the following IT skills grouped by category. The figures indicate the number of IT job ads and their proportion against the total number of ads sampled citing Java. Up to 20 skills are shown per category.
Application Development
131498 (38.50 %)J2EE
221368 (26.12 %)XML
313380 (16.35 %).NET
411514 (14.07 %)JSP
59895 (12.09 %)HTML
68217 (10.04 %)WebSphere
76583 (8.05 %)Struts
86295 (7.69 %)EJB
96068 (7.42 %)Servlets
105182 (6.33 %)WebServices
114998 (6.11 %)Hibernate
124447 (5.44 %)JDBC
134150 (5.07 %)JMS
143981 (4.87 %)Swing
153931 (4.80 %)XSLT
163445 (4.21 %)SOAP
173329 (4.07 %)CSS
183254 (3.98 %)ASP.NET
192878 (3.52 %)Middleware
202788 (3.41 %)Spring Framework
Application Platforms
16423 (7.85 %)WebLogic
25021 (6.14 %)Tomcat
34257 (5.20 %)JBoss
43865 (4.72 %)Apache
51539 (1.88 %)WebSphere Appl...
61316 (1.61 %)IIS
71284 (1.57 %)MQSeries
8878 (1.07 %)CMS
9635 (0.78 %)WebLogic Portal
10617 (0.75 %)WebSphere MQ
11572 (0.70 %)Documentum
12431 (0.53 %)ColdFusion
13391 (0.48 %)SharePoint
14380 (0.46 %)BizTalk Server
15357 (0.44 %)NetWeaver
16340 (0.42 %)Lotus Notes
17316 (0.39 %)Oracle Workflow
18309 (0.38 %)Oracle Applica...
19216 (0.26 %)ATG Dynamo
20201 (0.25 %)Lotus Domino


it shows that Weblogic is the most popular Application platform (well the most popular mentioned) although Websphere is number 6 application development which would indicate it was perhaps more popular. I was interested that .NET featured so highly with Struts and Servlets still high up there.

Finally it has a section on what development applications. I was very surprised that Junit was above Ant. This data must be a bit old I am thinking because Eclipse is mentioned but there is no sign of NetBeans. Subversion seems to be the most popular version control although CVS isn't mentioned whilst Visual SourceSafe is.

Where are all the Java developers working, mainly in Finance and Banking (if the figures are to be believed)


Development Applications
13746 (4.58 %)JUnit
23487 (4.26 %)Ant
33078 (3.76 %)Eclipse
41206 (1.47 %)ClearCase
5944 (1.15 %)Flash
6676 (0.83 %)Oracle Forms
7639 (0.78 %)Rational Rose
8581 (0.71 %)TestDirector
9577 (0.71 %)WebSphere Stud...
10560 (0.68 %)Visual Studio
11525 (0.64 %)Subversion
12506 (0.62 %)WinRunner
13439 (0.54 %)LoadRunner
14397 (0.49 %)VSS/SourceSafe
15360 (0.44 %)Dreamweaver
16313 (0.38 %)PowerBuilder
17312 (0.38 %)PVCS
18251 (0.31 %)JDeveloper
19241 (0.29 %)QuickTest Pro
20216 (0.26 %)NUnit
General
120439 (24.98 %)Finance
218480 (22.59 %)Banking
38694 (10.63 %)Front Office
48300 (10.15 %)Investment Ban...
53660 (4.47 %)Telecoms
62241 (2.74 %)Electronics
72176 (2.66 %)Education
82012 (2.46 %)Retail
91692 (2.07 %)Insurance
101581 (1.93 %)Back Office
111482 (1.81 %)Pensions
121464 (1.79 %)Government
131372 (1.68 %)Games
141360 (1.66 %)Health
151147 (1.40 %)Financial Inst...
161034 (1.26 %)Marketing
17723 (0.88 %)Publishing
18562 (0.69 %)Billing
19529 (0.65 %)Retail Banking
20500 (0.61 %)Multimedia


So in the end what can you make of it all, Don't trust statistics.


If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Monday, November 20, 2006

The Average Salary for Java Developers

Every now and then I like to have a look at what the average wage is for a Java developer, I found quite an interesting site with a lot of statistics on. I am like everyone else and love statistics to look at, although every time I look at these statistics they seem quite high, especially considering they have another section for contract work. here is the link

and below are the more interesting statistics taken from the website link above.


Java

This section looks at the demand for Java skills across the UK with a comparison to our Programming Languages category. Included is a guide to the average salaries offered in IT job ads that have cited Java over the last 3 month to 20 November 2006 with a comparison to the same period last year.

Java


3 Months to
20 November 2006
Same Period
Last Year
Rank58
Rank Change on Same Period Last Year+3
Matching Permanent IT Job Ads3329629274
As % of All UK Permanent IT Job Ads Sampled15.51 %14.02 %
As % of Category35.23 %32.64 %
Salaries Quoted2358922104
Average Minimum Salary£43,726£43,695
Average Salary
% Change on Same Period Last Year
£48,313£48,014
+0.62 %
Average Maximum Salary£52,900£52,334

Programming Languages
UK

Matching Permanent IT Job Ads9451089675
As % of All UK Permanent IT Job Ads Sampled44.02 %42.95 %
Salaries Quoted6759669274
Average Minimum Salary£38,633£38,861
Average Salary
% Change on Same Period Last Year
£42,360£42,423
-0.14 %
Average Maximum Salary£46,087£45,986


Java Average Salaries

This section looks at the demand and provides a guide to the average salaries quoted in IT job ads citing Java within the UK region over the last 3 months to 20 November 2006.

RCJAASSC
England +331928£48,628+0.44 %
Scotland -1696£34,642+5.48 %
Wales +2281£31,472-17.28 %
Northern Ireland -443£35,797+10.30 %
Isle of Man +76£39,200+35.17 %
Channel Islands -151--
RCRank change on same period last yearSCAverage salary % change on same period last year
JAMatching permanent IT job adsASAverage salary


Java Related IT Skills
Top 20

Over the last 6 months permanent IT job ads across the UK citing Java also mentioned the following IT skills in order of popularity. The figures indicate the number of IT job ads and their proportion against the total number of ads sampled citing Java.
131498 (38.50 %)J2EE
222217 (27.16 %)SQL
321498 (26.28 %)UNIX
421368 (26.12 %)XML
521023 (25.70 %)Oracle
620439 (24.98 %)Finance
718660 (22.81 %)C++
818480 (22.59 %)Banking
916815 (20.55 %)Degree
1014833 (18.13 %)OO
1113380 (16.35 %).NET
1213159 (16.08 %)C#
1311514 (14.07 %)JSP
149895 (12.09 %)HTML
159510 (11.62 %)Sybase
169481 (11.59 %)UML
179222 (11.27 %)Linux
189125 (11.15 %)SQL Server
198823 (10.78 %)Windows
208694 (10.63 %)Front Office



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny