Follow chinedubond on Twitter

Web Services Security: attaching username tokens to WSE headers

I found this post very useful I recommend it for anyone who wants to use Web services security using username tokens especially when integrating with a Java web service server end that is expecting WSE headers. Apparently, WCF - Windows Communication Foundation does not automatically add the tokens to the headers. Click here to go to the article . It saved me hours of work. Have fun!!!

Posted byChinedu Efoagui at 8:59 PM 0 comments Links to this post  

Configuring Spring ,Hibernate/EclipseLink,JTA on GlassFish V3

It has been a while since I added a post to my blog . I apologise. Work has been really hectic these days. In this blog entry , I want talk about deploying a spring ,JPA i.e hibernate or EclispeLink application  using container managed transactions (JTA).
I had some difficulty at first getting it right but once everything worked right I wanted to share it with the world since it might help someone else.

Glassfish 
 is an open-source application server project started by Sun Microsystems for the Java EE platform and by the virtue of the buy-out ; sponsored by Oracle Corporation. The supported version is called Oracle GlassFish Server. GlassFish is free software, dual-licensed under two free software licences: the Common Development and Distribution License (CDDL) and the GNU General Public License (GPL) .
GlassFish supports all Java EE API specifications (by definition since it is the Java EE Reference implementation), such as JDBC, RMI, e-mail, JMS, web services, XML, etc.(Wikipedia,2012)
 


I wanted to try another opensource application server other than JBoss.
The things I like are:
The admin console makes "tough" or complex things really easy.


I was using MySQL as the database so you can switch to the appropriate database you are using.
It would be nice to use eclipse and include the Glassfish  server plugin for eclispe. It is really powerful.

JPA

for the Java Persistence , I oscillated between EclispeLink and Hibernate. Hibernate is more popular of course but EclispeLink is the reference implementation of JPA 2.0 spec. So it should not be ignored.
Remember to use JTA, the transaction type must be set to JTA . duh ! and not  "RESOURCE_LOCAL".
Glassfish is bundled with Eclispelink by default so if you want to use hibernate, you need to put the hibernate library inside the /lib folder.

Hibernate




  
   org.hibernate.ejb.HibernatePersistence
    jdbc/zeneDS
  com.uy.yourentity
    
      
      
      
      
      
      

EclipseLink Configuration



  
      org.eclipse.persistence.jpa.PersistenceProvider
    jdbc/zeneDS
com.uy.yourentity
    
     
     


There are two ways to add a JNDI JDBC resource to the Glassfish application server. The first one is by using the admin console. and creating the file jbdc resource file. A sample can be found at /lib\install\templates\resources\jdbc folder

There is need to configure the persistence unit to the web.xml. In other to do so , one must be using servlet version 2.5 and above

Add this to your web Web.xml

Persistence Unit for PlyPlus

persistence/zeneJPA


ZeneJPA




Surprisingly, one need minimal configuration on the applicationContext to get this to work.

 
 
 
 
 
 
  
            
  
            
        
 
  
 
 
 
 



One more thing , do NOT , i repeat DO NOT have more than one in any of your spring configs both in the servlet or the applicationContext.
I hope someone found this useful. please direct any questions to me.

Posted byChinedu Efoagui at 9:59 PM 0 comments Links to this post  

Enter the Google Maps



Requirements
Pretty Fast Internet Connection.
JQuery 1.4+
Assumed Knowledge of XML, JavaScript

Introduction

Google Maps is an exciting technology. Since it was first lunched, it has been applied in lots of interesting ways e.g. in measuring actual sizes of buildings to resolving border conflicts! Over the years,I have had very good experience using Google Maps .
I developed http://www.theveryplace.com – a website that uses a lot of Google Map features which give users the ability to get driving instructions and other location based stuff.
Anyway, this blog entry won’t be as far reaching in showing what can be achieved using Google maps.
Before we go to the sample application proper, let me follow tradition and display a “hello world” example.
We will be using JQuery- a popular JavaScript library, to simply the code.
To run the hello world example, copy and paste the code below and view it on your browser.
Also, you can just open the hello.html included in downloadable sample app.


[CDATA[


Ezenna Group of Companies Ltd







]]>

As one can see from the code above, it is quite simple to show a Google map.

I will explain the steps used to create a Google Map.

Step 1.



The strict XHTML declaration instructs the browser to show the html document as is so the browser load the page faster than transitional declaration for instance because there is no extra step of validating html document.
Step 2.




The CSS describes how the html document will be shown. the height, margin and also describes the height and width of the
which acts as a placeholder for our map.
Step 3.







This script tag loads the Google Maps Api necessary to create the map and version is 3.2 and sensor is false which means that the device does NOT use a sensor e.g. GPS to detect the user’s location.
STEP 4.

$(document).ready(function () {
showmap();
});

What this JQuery function pretty much does is execute any function or code after the entire HTML document has been fully rendered. In this case it runs the showMap function which has the instructions to create the Google Map. Note: Don’t forget to load the JQuery like so.





STEP 5

var latlng = new google.maps.LatLng(6.43616,3.41647 );

Inside the showMap function, the first step in creating a Map is to declare the latitude and longitude coordinates of the location, in this case, the city of Lagos Nigeria. The latlng of the location (Lagos) has already been got through a process known as Geocoding. Google Maps comes with that feature but I won’t talk about it since it is beyond the scope of this blog. If one doesn’t know what latitude and longitude are then you might want to get a geography lesson or better still google it.

Step 6.


var myOptions = {
zoom: 12,
center: latlng,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};



Step 7

var map = new google.maps.Map(document.getElementById("zamap"), myOptions);

Takes the initialization settingstored in the myOptions variable, and id of the div which we get the reference of via the document.getElementById method and loads the MAP on the div.


Remember the DIV acts a placeholder for the Google Map.
The Options variable holds the Map initialization variables like the “zoom”. “Center” indicates the actual location from the latlng coordinates. “mapTypeId” here is initialized as “RoadMap”., there are other options like terrain , satellite, hybrid. “MapTypeControlOptions “shows the MapType options as a dropdown menu if one wishes to conserve space.

Behold The Map!

Figure 1 showing the Google Map

If you can see the image above then congratulations, for creating your first Google map.
Right now the Map does not look like much. It just shows Lagos. We will now proceed to adding a marker to indicate exactly where we are in Lagos.
//adding a marker
var marker = new google.maps.Marker({
position:latlng,
map: map,
title: "I am here!"
});

The piece code displays the marker on the map by setting the position to the latlng coordinates and the map to the map variable and we will create a title for the marker.
One can change the marker icon. That I will illustrate in the sample app so stay tuned.
Hover your mouse above the marker to see the title.
So see the marker below:
Figure 2 showing a marker

Now I promised a hello world example and not a “I am here” so we will take the tutorial a notch up by display an Infowindow with the Famous words.
//add an infowindow
var infocontentDiv = '
'+
'Hello World!'+
'
';

var infowindow = new google.maps.InfoWindow({
content: infocontentDiv
});
//event listener to open the infowindow on click
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});

The variable infocontentwindow holds the content we would like to display.
google.maps.InfoWindow creates an Infowindow and uses the infocontentwindow as its content.
Since we want the infowindow to open when the marker is clicked on, we add the event listener to the marker.
Click on the marker and VOILA! The infowindow pops up with the”Hello world” message.

Figure 3 Showing the "Hello World" Infowindow



Now I will illustrate the following Google Maps capability such as detecting user location, populating several locations on a single map using a sample project as a case study. This application will be called “Ezenna Group of Companies”. Legend has it that Ezenna as a typical Igbo man, had so many businesses scattered all over the world. Since they were so many, he forgot the whereabouts of some of them. Fortunately for him, he met an I.T consultant who advised him (at a huge cost) to get a directory of all his businesses so they will easy to find. I won’t tell you who the consultant was; I am sure by now you have a pretty good idea.
To make everything simple, the data of Ezenna’s business will be stored in xml instead of a RDBMS.
See below at a snippet of the xml





YouLike Clothes
Best collection of designer clothes and accessories. Cool Perfumes, watches in stock.
Boutique
clothes.png

No 12 Aba Road, Port-Harcourt

Rivers

4.83573
7.03035



It contains attributes describing store such as name, description, location and so on. We shall employ JQuery to load and manipulate our XML data to show all the locations on the map. So enough talking, let’s see some code.

$(document).ready(function () {
// showmap();
$.ajax({
type:"GET",
url:"stores.xml",
datatype:"xml",
success:showEzennaStoresOnTheMap
});
});

We use the ajax to asynchronously fetch the xml data.
To loop through the data, we use find method to get all the tags and iterates through and initializes the Store properties leike name,description and so on.

$(xml).find("STORE").each(function(){
var id=$(this).attr('id');
var name=$(this).find('NAME').text();
var description=$(this).find('DESCRIPTION').text();
var type=$(this).find('TYPE').text();
var lat=$(this).find('LAT').text();
var long=$(this).find('LONG').text();
We create the Map the usual way then add the

var bounds = new google.maps.LatLngBounds();
// Extending the bounds object with each LatLng
bounds.extend(new google.maps.LatLng(lat,long));

// Adjusting the map to new bounding box
map.fitBounds(bounds);
The bounds object adjusts the map so that the different markers fit inside the bounds being passed to it.

var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat,long),
map: map,
title: name
});
The title of the marker is set to the name property of the tag.
Figure 4 showing all of Ezenna’s stores

The Ezenna’s stores are shown on the map but there seems to be different the type of stores on the map. So we change the marker code to reflect the marker image we’ve got.

var zapic=$(this).find('LOGO').text();
imageloch="images/"+zapic;
recycleh = new google.maps.MarkerImage(imageloch);
// Adding the markers
var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat,long),
map: map,
icon: recycleh,
title: name
});

Figure 5 Showing different set of Marker Images

The icons can be downloaded here from this URL. http://code.google.com/p/google-maps-icons/
Meanwhile, the rest of the Store properties are set on the InfoWindow. As shown below with Zoom In and Zoom out link configured on it.




var infocontent=document.createElement('div');
var title=document.createElement('strong');
title.innerHTML =name;
var descriptionlink = document.createElement('p');
descriptionlink.innerHTML=description;
var breakr = document.createElement('br');
var plink = document.createElement('p');
var websitelink = document.createElement('a');
websitelink.innerHTML = 'Website';
websitelink.href = "http://www.theveryplace.com";
websitelink.target="_blank";
var a = document.createElement('a');
a.innerHTML = ' Zoom In';
a.href = '#';
// Adding a click event to the link that performs
// the zoom in, and cancels its default action
a.onclick = function() {
// Setting the center of the map to the same as the clicked marker
map.setCenter(marker.getPosition());
// Setting the zoom level to 15
map.setZoom(15);
// Canceling the default action
return false;
};
var zoomout = document.createElement('a');
zoomout.innerHTML = ' Zoom Out';
zoomout.href = '#';
// Adding a click event to the link that performs
// the zoom in, and cancels its default action
zoomout.onclick = function() {
// Setting the center of the map to the same as the clicked marker
map.setCenter(marker.getPosition());
// Setting the zoom level to 15
map.setZoom(5);
// Canceling the default action
return false;
};
// Appending the link to the second paragraph element
plink.appendChild(websitelink);
plink.appendChild(a);
plink.appendChild(zoomout);
// Appending the two paragraphs to the content container
infocontent.appendChild(title);
infocontent.appendChild(descriptionlink);
infocontent.appendChild(breakr);
infocontent.appendChild(descriptionlink);
infocontent.appendChild(plink);
// Setting the content of the InfoWindow

infowindoww.setContent(infocontent);

This piece of code set the zoom level as the bounds are increased .

var listener = google.maps.event.addListener(map, "idle", function() {
if (map.getZoom() > 16) map.setZoom(16);
google.maps.event.removeListener(listener);

});








Figure 6: showing the infowindows.

If we click on ZOOM IN .We get to see what is shown in the picture below. 


User Location detection

Detecting a visitor’s location to one’s website is useful feature and has many applications in fraud management for example if the user’s credit card address is far from the location at which transaction is being carried out would be an indication of high risk transcation. Also one can get useful analytics to the demographics of one’s website visitors.
To detect user’s location, one can use gears, browser based geolocation or Ip based geolocation. Ip based geolocation is the least accurate.

To use gears, one needs to add the script tag to the header of the web page

For IP-based One could use The Google API for

// Getting the position
if (google.loader.ClientLocation.latitude && google.loader.ClientLocation.longitude) {
// Defining the position
var latLng = new google.maps.LatLng(google.loader.ClientLocation.latitude,
google.loader.ClientLocation.longitude);

From my experience, I found out that Google’s client location though is bit more accurate than other offerings but in the case of Nigeria, it returns null on most IP addresses so I decided to switch to a different ip-based geolocation provider.
I assume they depend on your Google Key for something because it is one of the parameters needed.
You can get it here http://www.maxmind.com/app/geolitecity

Either way, IP-based geolocation is not very accurate. Actually, they are the least accurate as seen it the picture below which shows my location as Ikeja while I am on the Lagos Island.

Some smart mobile phones have GPS which provide very accurate location. Also GSM cell sites use triangulation to determine one’s position.
The Geolocation API specification is found at www.w3.org/TR/geolocation-API/.
To use the standard browser based geolocation API download the geo.js file which is the W3C standard. Please note that Internet explorer does NOT support this.
if (geo_position_js.init()){
geo_position_js.getCurrentPosition(setPosition, handleError,{enableHighAccuracy:false,options:6000});
}

To get around any of the hiccups associated with the lack of I.E support, Google Gears becomes a good alternative. Although, one of the problems of gears is that it is not ubiquitous. User geolocation with Gears is quite accurate as in shown in the picture. As at the time of writing this blog , I was at Lagos Island and voila , Gears shows me on the Island exactly.

To include Gears add this to the header of your webpage

Then the following option to your control flow.

if (google.gears) {

UseGears();

}

function UseGears() {

browserSupportFlag = true;

var geo = google.gears.factory.create('beta.geolocation');

geo.getCurrentPosition(function(position) {

longir=position.longitude;

latituder=position.latitude;

}

If you are concerned about privacy issue concerning auto detection of your location, don’ be since you will have to accent to any of it.


Therefore as a rule of the thumb one should use Ip.based Geo-coding as a fall-back and either Gears or the W3C standard as the first options as shown in the sample code.

Next Steps
So we have learnt how to detect user location, transverse through xml data with JQuery, show multiple locations on a map. Some nice features I left out are getting driving directions to any of the Ezenna stores and proximity detection i.e. showing the user, the nearest Ezeani Store to the user’s location. You may want to look at see below for a working example of calculating distance between two coordinates [1]
For example, Murtala Mohammed Airport Coordinates are
Latitude= 6.57722, Longitude 3.32111

Great Circle Distance Formula using radians:
3963.0 * arccos[sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 - lon1)]
If you do NOT first convert the latitude and longitude values in the database to radians, you must include the degrees-to-radians conversion in the calculation. Substituting degrees for radians, the formula becomes:

Great Circle Distance Formula using decimal degrees:
3963.0 * arccos[sin(lat1/57.2958) * sin(lat2/57.2958) + cos(lat1/57.2958) * cos(lat2/57.2958) * cos(lon2/57.2958 -lon1/57.2958)]
OR
r * acos[sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 - lon1)]
Where r is the radius of the earth in whatever units you desire.
r=3437.74677 (nautical miles)
r=6378.7 (kilometers)
r=3963.0 (statute miles)
One can see all these concepts on display on this website – http://www.theveryplace.com

Download the sample app here


References
1. Wikipedia http://en.wikipedia.org/wiki/Great-circle_distance
2. Google Maps Api http://code.google.com/apis/maps/documentation/javascript/
3. Developer Guide http://code.google.com/apis/maps/documentation/javascript/basics.html
4. http://code.google.com/apis/maps/documentation/javascript/overlays.html
5. Beginning Google Map API 3, Gabriel (Svennerberg, 2010)
6. W3C, www.w3.org/TR/geolocation-API/.
7. http://www.meridianworlddata.com/Distance-Calculation.asp

Posted byChinedu Efoagui at 5:07 PM 0 comments Links to this post  

The Reason The Chicken Crossed the Street.



Warning: Read this if you have absolutely nothing to do.

Why did the chicken cross the street? Many people have attempted to answer this very simple yet highly mind boggling question. All have settled on the answer of “To get to the other side “to the question which I call the quintessential question of our time. The reason being that, the answer to this every question would lead to a greater understanding of how we view our universe.
Since, I was not fully convinced of the widely accepted answer, I decided to take a crack at it. I posed this question to numerous people via an online survey, the results I got were astoundings Over 90% of respondents gave the answer of “To get to the other side “ while the rest of the answers ranged from
1. to find the hen.
2. it was looking for Osama bin laden .
3. crossing for world peace.

To fully understand this question we must first analyze the various parts of this question i.e. the Objects, Nouns or key players. Whatever you call it. They are Chicken and Street. Now what is a chicken? A chicken (Gallus gallus domesticus) is a domesticated fowl.Chickens are simple folk with a simple life style (see picture below).

We see them around going about their business, looking for food in total oblivion to what is going on around them except when danger beacons. During mating season, they are seen doing “IT” in the open in full public glare without a care in the world.
For a lot of people, chickens just means food. In fact African Americans have chicken as part of their staple diet. In some cultures, when a human being is referred to as a chicken, it means the person in question is a coward. This is mainly due to the extremely heighten sense of apprehension that chickens have.
Historically, they didn’t usually have that reputation.
Ancient Greeks believed that even lions were afraid of cocks.
In the New Testament, Jesus prophesied the betrayal by Peter: "Jesus answered, 'I tell you, Peter, before the rooster crows today, you will deny three times that you know me.'" (Luke 22:34) Thus it happened (Luke 22:61), and Peter cried bitterly. This made the cock a symbol for both vigilance and betrayal.

By now you must be saying to yourself, is this leading anywhere? And if it is, why can’t I just tell you the answer straight away. Well, the answer to that is simple, like all theories, they must be proven and proven beyond reasonable doubt.

Back to the subject of why did the chicken cross the street? Imagine you were an alien maybe a Martian and you saw a chicken for the first time crossing the street. As an alien, you have no idea that chicken are a source of nutrition for many a homes and you could be forgiven to actually think that they are an intelligent life form. Thus, be tempted to approach them to show you their leader inorder to begin the process of world domination. That is exactly what begs the questions. How intelligent is the chicken? Is it aware that that is a street it is crossing? For all it knows, it is just part of the earth.

To find out how intelligent an average chicken is, we needed to use some sort of intelligence measurement to determine it’s IQ. The scoring of modern IQ tests such as the Wechsler Adult Intelligence Scale now based on a projection of the subject's measured rank on the Gaussian bell curve with a center value (average IQ) of 100, and a standard deviation of 15 (Wikipedia,2009) won’t cut it for chickens.
Besides, The highest recorded human IQ was Marilyn vos Savant obtained a ratio IQ of 228. Compare that with Albert Einstein’s IQ of 172 then you would know how smart she must have been even though she spent her life trying to be a writer.
If she was that smart maybe she would have succeeded?
I mean dumber people have. Like the person writing this stuff you are reading right now for instance.

Scientifically speaking, using the same parameters of calculating human IQ to determine that of Chickens’ won't be fair at all since they are biological and genetically dissimilar in every way and react differently to environmental condition differently since there is a role of genotype and environment (nature and nurture) in determining IQ as reviewed in Plomin et al. (2001, 2003). while a human may desire to go to college to get a degree thus getting a good job with invariably mean more food on the table, a chicken has no such desire except of course if there is enough bird feed in schools.
Therefore we had to look for a rational and practical means of accurately calculating chicken IQ in order to know if they aware of their actions explicitly or they are just reacting to instinct. Since chickens can’t relate with us in a humanly comprehensible way, which effectively rules out us asking it or giving it some paper-based tests to write to ascertain its I.Q, I needed to find out another way. I then discovered that all life forms have one common goal irrespective of whatever they are i.e. Self-Preservation. Self-Preservation should entail stuff like finding food, defending ones from danger and so on. Using the rate of success of these skills of self-preservation, one could determine an Intelligence Quotient for any organism.

Postulate I:

Self-Preservation : Self-Preservation is the common goal of all living things

Postulate II:

The Principle of the Constancy of the Genetic Impart:

The hard coded instructions in an organism’s DNA invariably decides behavioral outcomes that impacts positively or negatively to the organism’s I.Q. while this varies between different species, it is constant in the same specie. (My idea)

Chicken IQ: P/ ivK2
Where:
• P = Self-Preservation Index ranges between 100-200.

• i = decision matrix.

• v = the quack syndrome is the amount of quackness measured in qs (quacks per second) which is responsible for the heightened level of apprehension one finds in fowls.
you might be tempted to argue that chickens don’t quack. Yes you are definitely right but since birds that quack are in the majority, then I guess that settles it then.

• K= genetic Constant- In every living thing is born with DNA Deriving this formula was not easy; chickens were made to go through numerous experiments Besides the usual sending the chickens through complex mazes to find out the effectiveness of the of their self preservation techniques, we went the extra mile.
The chicken was given an encephalo-velotic helmet (see picture below) to study the rate of its quackness.



The chicken was even given cigarettes (See picture below) to see if it would show any human cognitive capabilities but it remained the same. I don’t know if it had anything to do with the fact that the cigarettes contained menthol.



DISCLAIMER: No Chicken was harmed during the experiments.

In conclusion, my theory was further reinforced by an incident I personally experienced while driving to work one day. As I was coming up the road, a rooster was in my way.
I tried to horn loudly in order for it to move away but it just stood there pecking away at the ground. It was only when my car had gotten critically close to it that was when the rooster flew high and away. That was my Eureka moment.
It then occurred to me that the chicken was not aware of the street at all what it was aware of was the moving cars(of course it does know they are cars just moving objects which could be coming to kill it) which could cause it harm therefore it flew to the other side explicitly to avoid been killed. That action is directly attributable to its “intelligence”.
The reason the chicken crossed the street IS TO AVOID BEING ROADKILL.

ATTENTION: If you read this all the way down here then you need to have your brain checked. MERRY CHRISTMAS.

Posted byChinedu Efoagui at 9:30 AM 0 comments Links to this post  

District 9: Apartheid Allegory, Racist, or Just Plain Stupid?


There has been a lot of hullabaloo raised over the science fiction movie titled “District 9”. A lot of Nigerians felt offended by it which prompted the Nigerian Government to ban it from showing at the cinemas because in their view, it portrayed Nigerians negatively. Before continuing, I wish to state that I do not intend this article to be a movie review nor attempt to continue to pour more scorn on the movie but rather try to examine all sides of the argument and eventually find a balanced (if I am lucky) view point on the ongoing saga.
Prior to the release of the movie, I considered myself a sci-fi bluff who would enjoy any science fiction movie no matter how lame it was. Sitting through torturous hours of watching the likes of Star Troopers, Battlefield Earth, Chronicles of Riddick over the years, had made me immune to any kind of contraption done in the name of Science fiction but then came District 9.

See pic below:


hmm..


Two weeks after the movie was released in the U.S, it finally came to our shores. I decided to watch the movie in a cinema hall at Abuja, Nigeria. As I entered the cinema hall, I could not help but notice how empty the hall was (Just I, my date and a few foreigners). The sight of the empty hall also, made me regret coming to see the movie on the Big Screen, thinking that the film must have been so poor to pull such a scanty crowd. However, considering I was already in the Hall with the tough hide I had developed for watching any whacked Sci-fiction movie, and of course did not want to be rude to my date, I decided to sit through it. Having previously,read synopsis of the movie, I pretty much knew of what to expect. The concept of the movie seemed to be a breath of fresh air, the aliens came to Africa instead of the usual America we are so used to. Instead of the usual, “Show me your leader!” kind of storyline which comprised of highly aggressive and invulnerable Aliens with only one motive which was the destruction of the entire planet starting with the United States. Here, the viewers are confronted with an original story of Aliens who are vulnerable to our weapons, harried in slums, despised and ill treated by us humans. After the first 15 minute document style coverage in the movie, then came the bombshell –the presence a Nigerian gang referred to as “The Nigerians” that reside in District 9. These Nigerians were criminals and there were prostitutes amongst them who serviced aliens. To make matter worse, the crippled leader of the gang was called Obasanjo – the name of a former leader of Nigeria. At first I didn’t know what to think and tried very hard to keep an enjoyable facade for the benefit of my date but inside me started the conflict between my love for Science fiction and patriotism.
As a Nigerian, I felt very bad by the portrayal of “The Nigerians” in the movie. ”Surely, the director could have used a fictional country?” I pondered. Despite of this, there were some good points in film; for example, the transformer like scene was particularly pleasing to watch and was done much better than the Michael Bay’s summer blockbuster attempt in Transformers 2 as well as realistic visual effects shown especially in the levitation of the command module by the mother ship and real world decision making by the main actor (Wikus van der Merwe) which was largely influenced by self-preservation other than a prick of conscience. Another thing that was impressive about this was that all the stunning visual effects were done by an Australia Visual effects company on a modest budget of $30 million.Juxtaposed that with the average 150-250 million budget spent on films in the United States then one can really appreciate the huge cost differential.

Apartheid Allegory
The director, Neill Blomkamp who is a South African intended the movie to be an Apartheid Allegory- A commentary on the goings-on during the dark apartheid period in South Africa. In that era, there was a District 6 where blacks were kept after been driven out of their original homes. The director also said that lots of Nigerians lived in the District 6 hence the name “little Lagos” was given to the section of District 6 inhabited by the Nigerians. He also went further to state that Nigerians were responsible for most of the crime in South Africa which in my opinion is a ridiculous assertion based on the premise that in the aftermath of the apartheid period, there was a huge pool of weapons which were originally used to fight the white-minority led South African Government that made up 10% of the population. These weapons were later deployed by the black South Africans (Not all of them but a few), most of whom lacked jobs or education, to commit crime.

Read below an excerpt of interview of the Director Neil Blomkamp

“The Nigerian thing is there because I wanted to take as many cues from South Africa as I could. I wanted South Africa to be the inspiration. If I try to keep South Africa as true to South Africa as I could, then, unfortunately, a massive part of the crime that happens in Johannesburg is by the Nigerians there. It's just the way it is. I wanted to have a crime group, and thought the most honest refraction of a crime group would be Nigerians, for one. Then secondly, the Muti, the African witch doctor, is also a huge part of Africa and many African countries. So I wanted to incorporate that as well. At the time I was writing the movie, there were all these tribal witch doctor attacks on Albinos, because Albino flesh was worth more than normal humans. That was the analogy to a different group or a different race, [with their] traditional medicine, or traditional Muti – even cannibalism, in some instances. I incorporated aliens into that. “- Neil Blomkamp (Director District 9)
Source: http://www.popentertainment.com/blomkamp.htm

Personally, I did not see any similarities between Apartheid and Human –Prawn segregation. This could have been easily remedied if the aliens were portrayed as gentle, loving and intelligent creatures instead of dangerous, garbage-eating and primitive people. This would have made the audience question the human intentions for ill-treating the “prawns” but due their shabby portrayal in the movie, their treatment by the humans looked justified! Therefore as an apartheid Allegory, I think the movie failed miserably.

Racist
Racism is a very sensitive issue. Everyone has a right to freedom of expression and association. Therefore with time, deep down everyone has a positive and negative impression about people based on their social interaction with them or hear-say. Some have accused South Africans of being racist towards Nigerian based the brewing xenophobia of South Africans at Nigerians. Last year in South Africa, there was a pogrom targeted at Nigerians. A lot of people mostly Nigerians were killed. One ponders why? If one accuses South Africans of being racists then what does one have to say about the Libyans and the Chinese who have put Nigerians on death row. Are they racists too? There seems to be a reoccurring pattern of despise at Nigerians everywhere in the world. Not long ago, in a particular Scandinavian country, Nigerians were offered $3300 each to leave the country. Sadly nowadays, in the eyes of the world, being a Nigerian is now synonymous to being either a drug peddler or a fraudster.



This is a shocking contrast to the 70s and early 80s when we were very much respected. Foreigners loved to have Nigerians shop at their stores with their “Petrol Naira”. Being a Nigerian then meant being a responsible, proud brother to all Africans. It is for this reason that I would like to look beyond racism but rather take a cue from what my mother (God bless her soul) once told me; that when it seems the whole world is against you then it is time to do some introspection- a form of internal audit on one life.
I won’t want to bore you with the numerous problems with Nigeria. We know them. They are well documented. These problems have pushed many of our people to the far corners of the earth in search of greener pastures and where they do not exist; take matters into their own hands. However, we must not be in complete denial. The issues of Voodoo and cannibalism shown in the movie do exist in Nigeria and other African countries. We are witnesses to a certain House of Rep. member that was caught on film performing ritual rites as well as the video evidence shown in court during the Orji (Not to be confused with Clifford Orji) Kalu’s case showing the then incumbent in disgusting ritual pose. There are also stories told for example: at least 1 albino is murdered per month in Tanzania for their body parts which some believe will grant them certain powers; while small children are raped in South Africa because sex with a virgin is believed to cure AIDS.
I would conclude this section in saying the director is definitely NOT racist but hurriedly accepted the rude caricature of Nigerians without further research which I would attribute to lazy writing.

Plain Stupid

A typical Hollywood action movie consists mainly of three things: a protagonist, an antagonist and a stupid reason for massive explosions and special effects. That is what makes money .It is nothing personal. Hollywood is all about making profit. In the 80s and 90s, the villains in most Hollywood movies were either eastern Europeans or Russians. After the tragic 9/11 attacks, it became Arabs. This is because Hollywood is stupid. If one takes Hollywood seriously then one is bound to believe their exaggerated caricatures and stereotypes of everyone. See the following examples: Americans are gun-trotting, trigger happy people, Russians are war mongers, British men are gay, South Africans are militaristic, Africans are primitive, Asians are vengeful martial artists, Arabs are terrorists, African-Americans are drug dealers and of course Nigerians are fraudsters. One has to be stupid to believe anything that comes out of it. One is usually best advised to ignore Hollywood but ignore Hollywood at one's own peril. It is the U.S biggest propaganda tool and weapon in shaping global opinion about anybody or any topic. Even opinions on other issues such as Global warming can be shaped to suit their policy. Does the movie “A Day before Tomorrow” come to mind. Take a look at a certain Richard Gear movie titled "Red Corner" which in my opinion was a critic on the Chinese Justice System. The funny thing about the movie was that its release coincidence with the inclusion of the China into World Trade Organization. There were concerns raised over the Human rights records of the Chinese government then.

Conclusion

It is easy to criticize how others portray us but we need to more careful how we portray ourselves. A great man once said that no one can show you contempt except you permit him. Nollywood, our own version of Hollywood produces so many movies with basically the same theme- Voodoo, Rituals and corruption. It is a fast easy way of making money. Why spend so much time and money to write an elaborate, moving story when one can just regurgitate the same tried and tested Voodoo based template. Nollywood has been successfully at this because they have a ready accomplice in the Nigerian audience that patronizes the Voodoo tales. If our image need to change considering in a short time, something drastic needs to be done about Nollywood. I am not talking about punitive measures but rather measures that help the industry take risks in untapped storylines because it is a private enterprise with the sole emphasis on making profit. Such measures could include, a large pool of low interest loans could be made available to movie producers which show interest in adopting voodoo-free plots. Also, the scourge of piracy needs to be tackled and WON because by protecting the creative rights of our film makers, do we challenge them to making better movies.

Back to District 9, it really makes no sense as a punitive measure banning the movie from showing at the cinemas since the big distribution and movie companies don’t really make much money from Nigeria anyway. I think that decision was prompted for a need to make a statement. Either way, Nigerians had already spoken by simply not turning out to watch the movie at the cinemas evidenced by the empty halls at the movie’s showings. Sooner or later the cinema houses would have had to replace the movie with more profitable ones without being coerced by the Federal Government. Furthermore, Hollywood has realized that controversy sells so the more people talk negatively about District 9, the more other people will troop to the cinemas or buy a DVD to see what the fuss is all about.

I also learnt the Nigerian authorities are demanding an apology. Well, after Sony apologized for the play station advert, it made sense to continue with this line of attack but I think the results would be different. Firstly, Sony said the movie which arrived in Nigeria two weeks after release in the U.S was given permission to screen by the Nigeria Censor Board whom I assume must have watched the movie.
In concluding, I think real efforts should be made in improving the lives of Nigerian at home. If our economy and good governance improves, I believe our stature around the world will see proportional increase. Lets continue to conduct ourselves with dignity and refuse to be downcast. God has a reason he made us Nigerians. Happy Independence Day!

Posted byChinedu Efoagui at 3:18 PM 0 comments Links to this post  

Resolving The ASUU Strike.

Abstract and Introduction

This essay is a commentary on the current imbroglio between ASUU and The Federal Government; its effect on our educational system and recommendations on how the situation can be resolved. I will try to remain as neutral and objective in my analysis since I am neither a student nor an academic nor a government employee but only a concerned citizen.
In the last three months, ASUU has down tools and as a result, all universities other than the UniIlorin, Nnamdi Azikiwe University, Awka, Osun State University and the Ahmadu Bello University, Zaria have been shutdown with their students idling away at home. The basic crux of the matter is that ASUU claimed to have had an agreement with the federal government in 2006 which the latter is refusing to honor while those on the other side say that there is no such agreement but only a proposal that ASUU drafted and sent to the government in which, some government officials accepted to study. Even in the light of this, ASUU have had a series of agreements with the Government where such issues as “the principle of collective bargaining”, autonomy, academic freedom, academic allowances, conditions of service and increase in funding of Education have been settled.
Other issues that have been resolved during this stalemate are: Salaries of university lecturers which have been raised by 40%. The retirement age for professors is now the same as Supreme Court justices at 70 years. The allocation to education in the 2009 has increased from N210.3b last year to N224.8b this year (Source: budgetoffice.gov.ng), while the Education Trust Fund is injecting N31b in educational programmes.

“ Education consists of a series of enchantments, each raising the individual to a higher level of awareness, understanding, and kinship with all living things and It is the role of the teacher to awaken joy in creative expression and knowledge.”


ASUU Demands

1. Address the Deplorable state of the universities.
Everyone knows the situation of our schools. There are over–crowded classrooms, under-equipped laboratories and absentee lecturers who pass on their responsibility to unqualified graduate assistants to lecture the students. There are even allegations that lecturers sleep with female students and receive bribes to give such students favorable marks.
These factors have contributed to make the average Nigerian graduate half-baked and less respected than their peers who studied abroad. Both the Federal Authorities and ASUU have to share the blame for this ordeal that the Nigerian students have to go through once granted admission to any of our universities. T
he decay of our institutions of higher learning has been attributed to the inadequate funding by Government over the years while the incessant strikes by ASUU have watered down the quality of teaching. The resulting disjointed academic calendar has given rise to a situation where students are rushed to write exams after strikes are called off instead of continuing with some productive academic work.
At the beginning of this crisis in June, ASUU claimed they were fighting to improve the deplorable state of the universities but from what has transpired so far, it seems there is more emphasis is being laid on their remuneration.

2. Raise in Salaries

ASUU have asked for an increase in salaries and the Federal Government have offered 40% rise in wages. Yet, ASUU is still adamant on continuing with the strike insisting that the government honor a previous agreement. I can’t say how much money is enough for ASUU, God knows I need more money myself but I sincerely hope the spirit of compromise can prevail in order for the students to continue their education.
I read ASUU’s open letter to the President from ASUU’s website and there was an interesting comparison table in which the salaries of senior public officers and senators were juxtaposed with that of a Professor.

ANNUAL SALARIES OF CERTAIN PUBLIC OFFICERS
Permanent Secretary, Executive Secretary, Chief Executive of
Parastatal,Vice Chancellor N22,051,154.30
Professor N3,859,078.60
Federal high Court Judge N26,875,840.00
Local Government Chairman N13,865,895.30
Local Government Supervisory Councilor N12,746,875.00
Federal House Member N35,932,346.30
Senator N36,677,840.00

(Source: ASUU website.)

Anyone one looking at the table above would notice the very wide disparity between the salary of a senator (N36m per annum) and Professor (N3M per annum) but I question the motive behind bringing such comparisons up. If anything, it look like a very low blow. Are ASUU saying they want to earn like senators? If they do then the logical step for them is to join politics; pick up nomination forms, go through the rigorous campaigning and elections. One might also argue that these public officers do not deserve these high wages especially in the face of widespread poverty in our country but we must restrain ourselves from making a mockery of these democratic offices. Elective offices and the Judiciary are very sensitive positions that cannot be allowed to be easily compromised by the money bags.
Besides, the inflated salaries of senators and other public officers is a direct result of the monetization policy of the Obasanjo Administration. Previously, before that policy started, senators and other public officers were averaging between 2-4m annually.The Obasanjo administration decided to pay public officers who are entitled to official cars and houses, the monetary value of those items instead of maintaining them. The administration considered this to be cheaper in the long run. Anyway, I don’t see that as a valid reason to justify one’s pay raise. I would prefer if one negotiates a pay raise based on the basis of one’s productivity and value-added rather than childishly compare oneself to senators.
For example imagine a bank manager using the MD’s salary as a justification to ask for more money.

“If ASSU want to earn like senators then they have to become senators.”

I suspect the reason ASUU is not using productivity as a basis for demanding more pay is due to the lack of it. Consider this, what new knowledge have our lecturers added to the scientific body compared to their counterparts abroad?

3. Autonomy

In respect to autonomy, university councils have now taken over the full responsibility of administering the higher institutions. They hire both academic and non-academic staff and appoint vice chancellors without government input. Ideally, ASUU should be dialoguing with different university councils, and not the Federal Government, as far as conditions of service are concerned. The thing about autonomy is that it can be double-edged. The withdrawal of government subvention would lead to a corresponding rise in school fees thereby putting tertiary education out of the reach of low-income families.

Attitude
In life, one might be fighting for the right thing but the manner in which the battle is fought might rob it of its morality. I learnt that Professor Akachukwu Awuzie the president of ASUU declared at the end of an ASUU meeting that, “It is better to die fighting on our feet, instead of crawling on our knees”. I find this statement to be very disturbing not just that is highly provocative but it is indicative of an “Overlord” mentality of the ASUU leadership. Such show of bravado and grand standing really does not have a place in civil society. Furthermore, ASUU have refused to obey a direct order by The Industrial Arbitration Panel to resume work by August 24. Surely, ASUU are not conducting themselves as the best of employees. They need to present their case articulately devoid of “gangsterism” and tone down their rhetoric in order to get the support of the populace.

Deadlock

The deadlock in the negotiations is mainly due to the Federal Government’s refusal to sign an agreement that would compel state governments to pay the academic staff of their universities the same wages as their counterparts in federal universities. The state governors have even threatened to sue the federal government if they sign any agreement that is binding on them. Some say that the reason that ASUU is insisting on this issue is that the Head of ASUU is an employee of a state university.


The Way Forward

The Federal Government needs to make education a top priority because no nation can advance without it. They must stop paying lip-service to Education and give it the proper funding it deserves. The budget for Education should be substantially increased from what it is now. Monitoring teams and agencies must be empowered to enforce the highest possible standards within all institutions of higher learning. Lecturers must be made accountable to constituted authority and of course their customers– the students.
By now I am sure, Nigerian students must be tired of strikes and most importantly they would be tired of being used as pawns in ASUU’s battle with the Federal government.
ASUU are composed of some of the brightest minds in Nigeria today. To continue to use strike as the only option to resolve issues shows a gaping lack of creativity and imagination on the part of the ASUU. Surely, there must be another way? Some have gone as far as saying that that there might not much difference between ASUU and Niger-Delta Militants. While the militants use foreigners as hostages, ASUU uses students as a bargaining chip to press home their demands. It seems we as a people have not shed our siege mentality developed during the military era when strikes were used to coerce the ruling military junta to the round table since there were limited forms of representation.
I seriously doubt their efficacy in a democratic setting where the wheels of change grinds more slowly thus requiring a more subtle, astute and diplomatic approach. In the United States for instance when an industry … say for example the pharmaceutical or insurance industry have an agenda, they employ the use of lobbyists to advance their cause to the lawmakers who then script laws that would be favorable to that particular industry. Even the Nigeria media adopted that approach to achieve the Freedom of Information Bill although the president has not signed it and HITV also employed similar tactics to get the rights for the English Premiership. What stops ASUU from doing the same?
I am a strong believer in using the current apparatus of government to effect the right change. That is how slavery was abolished; the Afro-Americans got their civil rights and so on. One should not throw the baby with the bath water. The democratic process we have might not be perfect but it is the only freedom we’ve got.
It would be too simplistic say which side is wrong or right. Everyone in Nigeria enjoys bashing the government. In a country where bad governance is so prevalent, any talk of the government incompetence is usually greeted with resounding applause. But a proper assessment of the situation will reveal that despite the inadequacies of government, the ASUU leadership has become unmanageable.
Therefore, both parties in sharing the blame need to have the interests Nigerian students at heart in so doing will align their decisions along the acceptable lines of reason.

Posted byChinedu Efoagui at 1:52 PM 0 comments Links to this post  

A World Without Vista


Imagine you had the power to remove one terrible thing from the world. Well, some would like a world without... say, nuclear weapons perhaps others would prefer to eliminate suffering or disease. You just name it, there are so many bad things in the world worth eliminating that would ease the burden of your fellow homo sapiens. My own contribution to world would be to rid it of Windows VISTA. Well, why vista?It is just a bloody software, isn't it ? What impact does it have on the world, you might ask? Well, that is where you are wrong. In this digital age, everyone somehow has a form of connection to a computer and Microsoft's Windows happens to be on 95% of personal computers out there. What so the bad about that, you might be asking? Well for one, a windows is not the best operating systems out there for it to enjoy such huge market share and monopoly.
There are other operating systems that are doing a better job than Windows such as Linux, MacOS. Before i go on, i want to be clear that it is not the intention of this blog to indulge in Windows or Microsoft Bashing or Religious wars like my MAC is better than your PC.
In fact, I am ardent Windows user and I am indeed writing this blog on Windows Vista Ultimate Edition! Then what is the reason behind writing such a negative blog about Windows? Furthermore, this blog is not intended to educate or offend anyone. I am just expressing my frustration with the Vista since I have been using it.
The problems with windows are well documented and to be fair over time they have addressed some of the numerous issues with their operating system. These problems range from the security issues that mainly arise due to efforts by Microsoft to reach out to the lowest common denominator in order to make the platform easier to use. Those initial efforts to make window more user friendly instead of more secure, have resulted in an explosion of Trojan horses and viruses -malicious programs which are capable of doing the most sinister things to your PC and network once their payload is released.This has become such a nuisance that end users need to have "trusty" Anti-virus programs installed. The tradeoff with the anti-virus programs is that they run background processes which slow down you computer a great deal. The security or rather the lack of it have also made one vulnerable to identity theft propagated mainly by spy-ware and dialers which come in your system exploiting notorious security holes found in internet explorer.
At this junction, I would advise using Firefox when surfing the internet because it is one of the most secure browsers out there.
Another issue is instability of the operating system. Let me put it another way, have you heard of the blue screen of death?



That comes up when something goes wrong with windows. No need to worry. Most of the time, the problems are usually solved by restarting one's system. If that doesn't solve it then take it to a technician which is similar to the “If symptoms persist more than two days, go see a doctor!" adage.
There are loads of other issues which i don't want to bore you with but like I mentioned earlier over time, Microsoft strengthen some of them especially with the Windows XP.
Windows XP for me is probably the best thing to come out of Microsoft after Halo though it has its attendant problems, it managed to have a five year product life which is very rare in the Windows family.
Previously before Xp, Microsoft had made it a habit to upgrade each new version in a space of 2 years but with XP, the product lasted 5 years before a major upgrade.
That upgrade was Vista. Prior to Vistas released, it was touted as the best thing since sliced bread with Avalon technology;NFS, enhanced security features amongst many other features. Unfortunately most of these features could not meet the marketing deadline so had to be shelved for another time.
The critical as well as user reception since its release in 2007, has been very poor/ so poor that Microsoft has stopped using the word "Vista" in its advertisment champaigns and is already lining up another version to replaced it. If one juxtaposed that to the 5 year lifespan of XP, it seems Microsoft knowing the failing of Vista, wants to change it in a hurry.
Now Windows 7 is being touted as the new deal. Well, fingers crossed on that one.
Vista has its own peculiar challenges other than the previously mentioned issues it inherited from its predecessors. They are follows:

1. It is slow albeit very slow. It is slow to startup, slow to boot up and you got it again, slow in useage. In some cases, so slow to use that sometimes one feels one is browsing on 56k dialup connection rather on a desktop. Okay, I exaggerated a bit there but you get my point.

2 Application compatibility issues- there is no guarantees that your old applications running on windows XP is going to work seamlessly in Vista. One might need to upgrade the application itself to a version that is Vista compatible. If no upgrade exists then I guess you are screwed.
Well it is not all bad news for Vista. It is the most stable windows OS and probably the most secure windows out there but it is not the best. I rate Windows XP with its security patches installed higher than it.

If one already has a pc running Vista no need to rush to ask for your money back. May be one could wait a while for the much anticipated Windows 7 going to be released in October 22, 2009. Windows 7 could start the gradual withdrawal of Vista from shelves and PCs and lead us ultimately to the world that I have envisioned-A world without Vista.

Posted byChinedu Efoagui at 11:05 AM 0 comments Links to this post