February, 2008


26
Feb 08

Eclipse Under Portable Apps

Yes, I am Portable Apps happy recently, that’s because I’ve only just discovered it, and it’s also saving a lot of headaches for me which may occur in the future.  Today I looked up getting Eclipse working under Portable Apps and what d’ya know? It works perfectly.  Personally I followed these instructions to do it with my JDK6 VM (not the latest U build though) and the latest copy of Eclipse and it worked without a hitch.

Setting up the workspace however should – in my opinion – be done slightly differently.  Typically you install the applications in a certain folder (usually F:\Portable Apps\ – dependent on what drive letter your OS has assigned your USB key) and the data goes elsewhere (F:\Documents) so the example given in the above link isn’t good when it comes to backup.  Typically when I backup my documents (and Portable Apps provides a backup application integrated into the software) I only backup the Documents folder, this saves time and makes the backups much smaller.  A full backup is roughly 700MB now, which takes some time, and some hard disk space also.

So now I run document editing software, my IDE, IM, Firefox and Sunbird off my USB key making my desktop almost entirely on my USB key.  The final showdown is Skype which I use regularly for making [free] calls to my family.

Just to mention, I’m now using 1.1GB overall of my 4GB, and that’s almost all the software installed that I require.  Shame this doesn’t run off a Mac though.


25
Feb 08

Mozilla’s Sunbird

As I posted the other day about using Portable Apps you may notice that Mozilla Sunbird comes as standard on one of the installs.  I knew what Mozilla Sunbird was, but I never thought I’d have a need for it, however, upon using it I’ve found that it’s a blessing to have, especially seeing as though I can simply carry it around on my USB key.  As long as there’s a computer available somewhere then I can run it.

My main love of this application is how lightweight it is, there’s nothing complex about it at all.  The views are very configurable and immediately I switched to the month view so I can see what’s going on.  Additionally the repetition options for events is very handy, and already I’ve set in meetings, lectures, times I have to work, rehearsel times et cetera.  Occasionally a repeated event may not occur on certain weeks, and Sunbird can act upon that ensuring it doesn’t occur on certain weeks if you so wish.

Tasks are available at the bottom left of the window shows what tasks need doing, and when they need to be done with the option to hide completed tasks.

In general, this application exposes all of the essential tools you need to manage your time whilst hiding complexity of many time management applications with a simple, intuitive user interface which anyone could figure out.  On top of all this, it’s portable if you so wish!


20
Feb 08

Portable Apps

Seeing as though I got a 4GB Corsair Voyager USB key for Christmas I thought I’d make better use of it rather than using about 10MB of it.  Last night I installed Portable Apps onto it which is just an application allowing you to install applications onto your USB key and use on any computer without having to install anything on the host computer.  I’m running firefox off it right now in fact.

As good as it is, there are some quirks which I’d like fixed in perhaps future versions to make it more usable.  For a start, is it possible to auto-run from a USB key? At the moment you have to manually run the executable located in the root of your USB key in order to start the application, which although isn’t too much trouble, it would save a lot of time.  I’ve just setup Launchy to be able to open up Portable Apps (manually added it) which saves a bit of time.

Secondly, you can run multiple instances of Portable Apps.  Is there no way to stop this from happening when one is running? Also, you have to click on the icon in the lower right-hand corner in order for it to pop up. Surely there should be a keyboard shortcut?

Finally, I’ve noticed there’s documents, music, pictures and video folders in the application, however, documents just leads to the root directory containing music, pictures and video folders.  Personally I have a lot of documents which I’m constantly working on, and this means there’s no specific quicklaunch folder for them, and they have to be nested in sub-folders not native to the application.

Other than that, for what I use it for it’s excellent and am currently using Open Office, Pidgin, Firefox and xampp on it.  It also comes with a couple of games dependent on the version you get.  The default theme isn’t very nice, but from searching around I can see that there’s quite a few skins available for it.

Generally though, it’s most probably worth getting if you can trust all your data being on your USB key.  I’d say regularly backup the key in case you do lose absolutely everything ;)


20
Feb 08

Portable Apps

Seeing as though I got a 4GB Corsair Voyager USB key for Christmas I thought I’d make better use of it rather than using about 10MB of it.  Last night I installed Portable Apps onto it which is just an application allowing you to install applications onto your USB key and use on any computer without having to install anything on the host computer.  I’m running firefox off it right now in fact.

As good as it is, there are some quirks which I’d like fixed in perhaps future versions to make it more usable.  For a start, is it possible to auto-run from a USB key? At the moment you have to manually run the executable located in the root of your USB key in order to start the application, which although isn’t too much trouble, it would save a lot of time.  I’ve just setup Launchy to be able to open up Portable Apps (manually added it) which saves a bit of time.

Secondly, you can run multiple instances of Portable Apps.  Is there no way to stop this from happening when one is running? Also, you have to click on the icon in the lower right-hand corner in order for it to pop up. Surely there should be a keyboard shortcut?

Finally, I’ve noticed there’s documents, music, pictures and video folders in the application, however, documents just leads to the root directory containing music, pictures and video folders.  Personally I have a lot of documents which I’m constantly working on, and this means there’s no specific quicklaunch folder for them, and they have to be nested in sub-folders not native to the application.

Other than that, for what I use it for it’s excellent and am currently using Open Office, Pidgin, Firefox and xampp on it.  It also comes with a couple of games dependent on the version you get.  The default theme isn’t very nice, but from searching around I can see that there’s quite a few skins available for it.

Generally though, it’s most probably worth getting if you can trust all your data being on your USB key.  I’d say regularly backup the key in case you do lose absolutely everything ;)


15
Feb 08

Dynamically Generating Menu Items In Java

There’s a hoard of tutorials on the Internet showing you how to make menus in Java, and they’re just fine, however I always wonder to myself whether they’re the best solution to the common problem of having hundreds of lines of code just to create a menu, so I decided to try out some alternative approaches.

In this tutorial I’ll show you an example from my own project generating menu items dynamically, from any format you wish.

Representing The Data

First of all you need a format to represent the menu items.  For this example I’m using dots by themselves to represent separators, and I’m ending items with a colon to represent them as a menu.  All of these items are contained in one String array, and each element represents an entire menu.  Thus, the format will look like:

{"File: New . Menu-Item Another-Menu-Item . Other-Items", "Tools: Draw . Fill . Editing-Tools"}

This example is extremely basic and there are far better ways of doing it, but for the purpose of this tutorial I’ll keep it simple by not using multi-dimensional arrays, or extracting values from files etc.

Pulling The Data Out

Next we will need to iterate over the list of elements and choose what goes where. You’ll also need to use a small regular expression to split the data by whatever format you choose.  Spaces separate elements in my data representation therefore I use \\s+.

 

for(String menuElement : menuItems)
{
   String[] splitMenuItems = menuElement.split("\\\\s+");

   menu = new JMenu(splitMenuItems[0].substring(0, splitMenuItems[0].length() - 1));
   menu.addActionListener(this);
   menuBar.add(menu);

   for(String menuItemElement : splitMenuItems)
   {
      if(!menuItemElement.endsWith(":") && !menuItemElement.equals("."))
      {
         menuItem = new JMenuItem(menuItemElement.replace('-', ' '));
         menuItem.setActionCommand(menuItemElement);
         menuItem.addActionListener(this);
         menu.add(menuItem);
      }
      else if(menuItemElement.equals("."))
      {
         menu.addSeparator();
      }
   }
}

 Here I use a nested for loop to first iterate over each element in the String array, and each time I do I then split the String into its individual elements and place them into a String array of their own.  A root menu is represented by a proceeding ":" character, so  splitMenuItems[0].substring(0, splitMenuItems[0].length() – 1) takes out the colon at the end of "File:".

In the next nested for loop I ignore elements ending with the ":" character because due to the String split, it naturally includes the first element which is "File:" – you can choose to remove this element if you wish, whatever suits you really.  I also ignore the "." character and if that character does occur the statement will then go over to the else if statement where it will add a separator for every dot found.

Because the menu items are delimited by spaces I needed to handle menu item text with spaces in it.  To do so I merely used "-" characters to represent spaces.  Underscores may have been better as you may actually use hyphens in your menu items.  When one is found I just simply replace it with a space character.

But What About Key Mnemonics?

Key mnemonics allow you to hit a key on your keyboard and that menu item open up.  You may think that this option isn’t as customisable, but it just means there’s a little more work to do.  Obviously we can represent the data in any form we want, and thus to enable key mnemonics simple change the format of the data.  For example, {"File:_69 New . Close . Exit"} – here we can use an underscore to separate mnemonics and then give the integer value of the VK constant which you can then add to setMnemonic(int).

Simple, huh?

(Please note that this code was developed in accordance with my university and thus is copyrighted. You may freely use this code as long as you give a link back here, or at least put my name in your code somewhere. Thanks! :) )


15
Feb 08

Dynamically Generating Menu Items In Java

There’s a hoard of tutorials on the Internet showing you how to make menus in Java, and they’re just fine, however I always wonder to myself whether they’re the best solution to the common problem of having hundreds of lines of code just to create a menu, so I decided to try out some alternative approaches.

In this tutorial I’ll show you an example from my own project generating menu items dynamically, from any format you wish.

Representing The Data

First of all you need a format to represent the menu items.  For this example I’m using dots by themselves to represent separators, and I’m ending items with a colon to represent them as a menu.  All of these items are contained in one String array, and each element represents an entire menu.  Thus, the format will look like:

{"File: New . Menu-Item Another-Menu-Item . Other-Items", "Tools: Draw . Fill . Editing-Tools"}

This example is extremely basic and there are far better ways of doing it, but for the purpose of this tutorial I’ll keep it simple by not using multi-dimensional arrays, or extracting values from files etc.

Pulling The Data Out

Next we will need to iterate over the list of elements and choose what goes where. You’ll also need to use a small regular expression to split the data by whatever format you choose.  Spaces separate elements in my data representation therefore I use \\s+.


for(String menuElement : menuItems)
{
   String[] splitMenuItems = menuElement.split("\\s+");

   menu = new JMenu(splitMenuItems[0].substring(0, splitMenuItems[0].length() - 1));
   menu.addActionListener(this);
   menuBar.add(menu);

   for(String menuItemElement : splitMenuItems)
   {
      if(!menuItemElement.endsWith(":") && !menuItemElement.equals("."))
      {
         menuItem = new JMenuItem(menuItemElement.replace('-', ' '));
         menuItem.setActionCommand(menuItemElement);
         menuItem.addActionListener(this);
         menu.add(menuItem);
      }
      else if(menuItemElement.equals("."))
      {
         menu.addSeparator();
      }
   }
}

 Here I use a nested for loop to first iterate over each element in the String array, and each time I do I then split the String into its individual elements and place them into a String array of their own.  A root menu is represented by a proceeding ":" character, so  splitMenuItems[0].substring(0, splitMenuItems[0].length() – 1) takes out the colon at the end of "File:".

In the next nested for loop I ignore elements ending with the ":" character because due to the String split, it naturally includes the first element which is "File:" – you can choose to remove this element if you wish, whatever suits you really.  I also ignore the "." character and if that character does occur the statement will then go over to the else if statement where it will add a separator for every dot found.

Because the menu items are delimited by spaces I needed to handle menu item text with spaces in it.  To do so I merely used "-" characters to represent spaces.  Underscores may have been better as you may actually use hyphens in your menu items.  When one is found I just simply replace it with a space character.

But What About Key Mnemonics?

Key mnemonics allow you to hit a key on your keyboard and that menu item open up.  You may think that this option isn’t as customisable, but it just means there’s a little more work to do.  Obviously we can represent the data in any form we want, and thus to enable key mnemonics simple change the format of the data.  For example, {"File:_69 New . Close . Exit"} – here we can use an underscore to separate mnemonics and then give the integer value of the VK constant which you can then add to setMnemonic(int).

Simple, huh?

(Please note that this code was developed in accordance with my university and thus is copyrighted. You may freely use this code as long as you give a link back here, or at least put my name in your code somewhere. Thanks! :) )


9
Feb 08

The Lecture Standards Initiative: Introduction

Whilst being a student at university my incentive to complain increased tenfold after returning from my placement year working at Symantec. The industry teaches you a great deal about a lot of things not even related to your job, and in particular the ways in which information is conveyed to you. During that year at Symantec I attended many internal meetings, review sessions, progress updates and general chit-chats, all of which contributed towards my education of the industry.

In the industry, and especially in a company so large, vast, and ahead of the game in the IT sector, the information presented to employees was of the utmost importance, and in companies like this each and every employee is valued to the highest regard. The presentations I attended always struck out at me as being the most informative educational sessions I had ever been to, where opinions of the people listening really mattered, and where feedback was critical to the success of the meeting. As I had just come from two years of university education I found myself comparing both presentations in the industry to lectures at university and always found I learnt more in the industry. But why was this so?

Let’s face it, university lecturers tend to come from backgrounds of education and not participation (there are certain lecturers who are heavily bounded by their industrial experience however) – everyone in the industry seems to know this trade ’secret’. Whilst education is a brilliant incentive for the present and future, it also strikes out as being the place where you get the least experience, so learning is a crucial part. A contributing factor to any students’ learning curve is the standard of lectures being given.

So what defines the standards of a lecture? We can assume that the level of quality given during lecture periods is relative to how much information a student may absorb. The lecturer-student relationship is very much a give-receive relationship with no input given from the student. As a student you simply expect to gain knowledge by sitting in your seat totally unresponsive for the duration of the lecture, however, this is quite the high expectation of the university life (perhaps a contributory factor to failure rates within universities). The quality of a lecture actually spans over a huge area and has a lot to do with the passive interaction of a student.

During my years at university I was very much into web development as many students are nowadays, and the concentration areas of web development actually lay in any visual areas in both digital, and paperback form. Concepts such as typography, visual consistency, contrast ratio, iconic representations, images and more were all thrown into the same bucket sat in a neat and distinct pile. Every single lecture I attended I would be thinking in my head of the visual criticism I could give not to the lecturer, but to the lecture slides. I never would have once criticised a lecturer – why are lecturers supposed to know about visual consistency in lecture slides? They’re mathematicians, sociologists, computer scientists and more, it has nothing to do with their area, in my opinion.

Quality of lectures could also be defined as the understandability of the information given, the teaching style, and the structure. This breakdown of content is what is sometimes referred to at NVQ Level 3 as “bite-size”. We, as humans, like to break things down, whether it be remembering a phone number or remembering the route to your university buildings. We may say to ourselves “Well, we know the way to the shop, so from there we take this route” – that’s breaking it down so you can learn more easily.

What I’m sure any lecturer would want is their students to learn the content of the particular unit they’re teaching without having to overcome hurdles such as “what does this slide mean?”. I’m also sure that students want to be able to understand anything they’re taught and be able to grasp the contents of it with much ease, despite its difficulty.

These are all some topics that will be covered during this Lecture Standard Initiative and I hope you will take the time to read it, both as students and as lecturers.

  1. The Looks
  2. The Structure
  3. The Content
  4. The Teaching Style
  5. The Revision

(numbered points will appear as hyperlinks when they’re available)