Sunday, March 21, 2010

National Business and Technology Conference

I had the pleasure of attending the National Business and Technology Conference on Friday. This conference is run by Nspire which is a student organisation in the University of Toronto. It may of been a conference run by students but it was one of the most professional conferences I have ever been to. The conference brings together students who are entrepreneurial in nature with leading Canadian entrepreneurs to help nurture the students entrepreneurial nature and learn from those that have made it. A brilliant idea - its little wonder that a lot of the students there have all ready set up businesses.

The opening keynote was by Anthony Lacavera, CEO and chairman of Globalive - a company who are just rolling out a company called Wind - Canada's newest cell phone provider. Lacavera spoke openly about how his business came into being and then took a lot of questions from the audience.

There was also a Entrepreneurship Competition with a top prize of $25,000. Students pitched their budding businesses to a panel of very distinguished judges. The prize money gives you a sense of the sort of sponsorship the conference brings in.

A great way to spend a Friday afternoon. Perhaps this is something Irish students should be doing?

Friday, March 12, 2010

Getting started with RESTful Service

This week was web services week. I got down and dirty with RESTful web services. To do this I had a look at some of the tutorials on the web. I found a lot of them really over complicated the matter. Then I came across Apache Wink - http://incubator.apache.org/wink/. Wink seemed to have a very simple approach to the development of REST services. Any servlet container can provide for a REST service with Wink all that is required is a few java annotations specifying the URI of the service and the methods to call with each, GET, POST, DELETE and UPDATE event over HTTP. I also found this very simple tutorial from IBM that gets you up and running with Wink and REST services in no time - http://www.ibm.com/developerworks/web/library/wa-apachewink1/?ca=drs-.

Monday, March 1, 2010

Apache for Static, Tomcat for Dynamic

Following on from my previous post what I wanted to do next was allow for the apache web server to handle all the static content on my web app and Tomcat to only handle the dynamic content. Again I found Linux Journal to be a fantastic resource. The article - "Separate the Static from the Dynamic with Tomcat and Apache" gave me basically what I needed to do this plus much more. This article can be found here.

Essentially all that was required was to tell apache where to find the static content in the virtual host definition in the httpd.conf file. To do this all that was required was set up an alias for static content as follows:
Alias /staticContent/ /var/www/staticContent/


In my JSP now when I put the apache server serves up the static content rather than Tomcat. This means that image1.jpg or any static content such as javascript can be changed and redeployed without restarting any server.

Friday, February 26, 2010

Connecting Apache's Web Server to Multiple Instances of Tomcat

I was tasked today with connecting an apache web server to multiple instances of Tomcat. In my search for resources to do this I found this, an excellent article in the Linux Journal by Daniel McCarthy on how to do just what I was looking to do. The only problem was that it was slightly outdated. McCarthy assumes the following setup:
* J2sdk1.4.2_09
* Tomcat 5.0.28
* Apache 2.0.54
* mod_jk 1.2.14

Whereas I had the following setup
- java1.6.0_0
- Tomcat5.5.27
- Apache 2.2.12
- mod_jk1.2.14
- Ubuntu9.10

I did note that there were some differences in the set up and also try to cover some issues I was unsure about when following the tutorial. This is not meant to be a tutorial - it is merely a few pointers if you have the same setup as me (and also to ensure I remember how to do this in future). If you are trying to connect apache to multiple tomcats firstly consult the tutorial in Linux Journal and if you are having trouble then consult this post - maybe you are having one or two of the same problems...

The first part of the article outlines how to install mod_jk1. This involved downloading and compiling it from source and then loading the module. I found that this was not necessary as I was able to use apt-get to install mod_jk1 using the following command:
sudo apt-get install libapache2-mod-jk


I am aware in some cases you may not want to use apt-get to install this module into apache and install it manually. If so I would like to point out that the command is incorrect in the original Linux Journal article - should be:

#Load the mod_jk connector
LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so


In the original article a tomcat startup script is defined. I could not get this to work. Firstly at the start of the script it tries to import /etc/init.d/functions - but in my version of ubuntu functions did not exist in this directory. The script also tried to start the tomcat server with the following call:
/bin/su tomcat $CATALINA_HOME/bin/startup.sh

When I used this I got an error that the id tomcat was not recognised. - unknown id: tomcat. To fix this I edited the script and removed the import of the functions directory and also simplified the startup script as follows:

#!/bin/bash
# tomcat
# chkconfig:
# description: Start up the Tomcat servlet engine.
# Source function library.
#. /etc/init.d/functions

RETVAL=$?
export CATALINA_BASE="/opt/tomcat_instance1"
export CATALINA_HOME="/opt/tomcat_instance1"
export JAVA_HOME="/usr/lib/jvm/java-6-openjdk"

case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
$CATALINA_HOME/bin/startup.sh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
$CATALINA_HOME/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL




Now on to the single item that took me a VERY long time to figure out. The original article outlines how you should set up workers so that apache can redirect some requests to other servers. This is all defined in a workers.properties file. The article also tells you that you need to tell apache about the workers.properties file and this is done by adding the following to apache's httpd.conf file:

JkWorkersFile "/etc/httpd/conf/workers.properties"
JkLogFile "/var/logs/www/mod_jk.log"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

I did this and then restarted the apache server. It failed. It wouldnt start and whats more I got absolutely no error. At this point the obvious thing to think is that Jk_mod isn't installed properly on Apache - so I checked and rechecked and reinstalled - no joy. Eventually, as those of you that are more observant than me have figured out, I saw that the log file was pointing to /var/logs - which doesnt exist on the version of ubuntu I am running. I changed this to /var/log/www/mod_jk.log and all was good in the world again.

Thursday, January 28, 2010

Leaning Stats on iTunesU

Over the past week I have been following an intro statistics course from UC Berkley, taught by Prof. Hank Ibsner. I find his teaching style very refreshing. He is committed to ensuring that his students understand why you do what you do in stats before showing how you do it. This teaching style really resonates with me.

When Prof. Ibsner is covering a new concept, for example standard deviation (SD) he does not give the formula first and then explain the concept. Rather he explains the concept to such a point that the formula becomes obvious. This is a good approach for me anyway and I have found that many people feel that they a stats concept once they know the formula, but do they know why something is calculated a particular way or what each variable means?

Thursday, January 21, 2010

Relearning through iTunesU - Class starts today

At the start of most years I always like to try to learn new things. This year I decided to do something a bit different, I am going to relearn things that I learned a long time ago - I am going to do refresher courses. I have decided to do all this using iTunesU. This is really a great resource, my only problem about it is that it is in Apple propriety software - you need iTunes to access.

So what am I going to relearn. After much debate with myself I decided to refresh my technical skills a bit and get to grips data structures and algorithms, computing paradigms (python programming) and statistics again. I also decided to throw in iPhone development from Stanford, just for kicks. I will let you know how I get on..

Friday, January 15, 2010

Seneca Aviation Project

Busy day today! I spent the first half of the day up at Buttonville Airport just North of Toronto. This is where Seneca College has its School of Aviation. I was there to kick off the start of our work on a NSERC funded research project that will look to improve pilot training in Canada. Our part of the project looks at how on-line learning can be a part of that. More information can on the project can be found here.

At the moment we are focusing on Inter-Rater Reliability (IRR) of instructors and how this can be improved. This involved a lot of filming today of various different flying scenarios in very cool flight simulators - really interesting stuff!

The second half of the day continued on the IRR theme but this time I went up to Air Canada to have a chat with there training co-ordinator on how they calibrate their examiners. This was a really useful insight into how this industry maintains a high level of excellence in pilots through constant learning and development.

The whole day left me buzzing with ideas on how to improve IRR. I now need to solidify those ideas, as I get to test them out at the first IRR session on Wednesday. Time is tight!