About Kyriakos Anastasakis

I was born on the beautiful island of Chios, Greece, where I received my primary school and high school education. At the age of 18 (in 1997), I moved to Athens to attend the Department of Informatics at the T.E.I. of Athens. In 2001 as part of a six month industrial placement, I joined Ulysses Systems, Piraeus as a junior Software Developer. In 2002 I received the degree of Informatics Engineer (Mihanikos Pliroforikis) from the T.E.I. of Athens. I continued to work for Ulysses Systems until the end of July of 2003. In 2003 I moved to Birmingham to study for the MSc in Advanced Computer Science at the School of Computer Science, at the University of Birmingham. In 2004, after I finished the MSc studies, I decided to stay in Birmingham and pursue a PhD degree in Computer Science. Since then I have been working towards the PhD in Birmingham under the supervision of Dr. Behzad Bordbar. Since 2005 I have been a part time self-employed software consultant. An interesting project I was involved in, was the development of a small scale CRM software for the Birmingham branch of MLP Private Finance. Since 2004 I have also been responsible for development and maintainance of the website of the Hellenic Society of the University of Birmingham.

Since Spring 3.2 it should be possible to use a qualifier in the “Async” annotation of a method, to indicate which specific executor to use. For example, I have the following class, that is supposed to collect the HTML from a website asynchronously:

HTMLFetcher Interface

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Date;
import java.util.concurrent.Future;

import org.springframework.scheduling.annotation.Async;

public interface HTMLFetcher {

Future<HTMLFetcher.HTMLFetcherResult> getHTML(String baseUrl,Date date);

interface HTMLFetcherResult {

String getHTMLResult();

Date getDate();
}
}

TestHTMLFetcher Class

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Date;
import java.util.concurrent.Future;

import org.apache.log4j.Logger;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;

import agonesgr.html.HTMLFetcher;

@Component
public class TestHTMLFetcher implements HTMLFetcher{

@Async(value="htmlFetcherExecutor")
public Future<HTMLFetcher.HTMLFetcherResult> getHTML(String baseUrl, Date date) {
try {
System.out.println("Before execute!!");
Thread.sleep(100000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
HTMLFetcher.HTMLFetcherResult r = new TestHTMLFetcher.HTMLFetcherResultImpl("",new Date());

return new AsyncResult<HTMLFetcherResult>(r);
}

private static class HTMLFetcherResultImpl implements HTMLFetcherResult{

private String htmlResult;
private Date date;

public HTMLFetcherResultImpl(String htmlResult, Date date) {
super();
this.htmlResult = htmlResult;
this.date = date;
}

public String getHTMLResult() {
return htmlResult;
}

public Date getDate() {
return date;
}
}
}

And the following excerpt from the context.xml file:


This didn’t work! I submitted 10 tasks to the executor and 10 thread, instead of 1 as I had instructed it had been created. I digged into the Spring code a bit and found the AnnotationAsyncExecutionInterceptor class that was doing tbe job of assigning tasks from methods annotated as async to executors. Putting  a breakpoint on its getExecutorQualifier method it became evident why it doesn’t work.

You need to annotate the interface method rather than the class with the:

@Async(value="htmlFetcherExecutor")

annotation. In my example that is the getHTML method of the HTMLFetcher interface. It now works. I am not sure if it was done on purpose (i.e. if it’s part of the specification). I don’t have time to read the related documentation or search the Spring Jira. However, I would assume that the right place to put the annotation is the implementation. I may want to have two implementations of the same method, one decorated with “Async” that will be asynchronously executed and another without any annotation that will be synchronously executed.

By default on Windows Eclipse autocomplete shortcut is: Ctrl+Space. In my Mac laptop I use this combination for the operating system’s spotlight quick search. As a result, I wanted to change the default autocomplete shortcut. What you need to do is:

1. Go to Window->Preferences (Eclipse -> Preferences on Mac).

2. In the new window that pops up, go to “General -> Keys”

3. Find the “Content Assist” command and change it to whatever you like (in my case I chose Cmd+Space).

4. Don’t forget to click on “Save” on this pop up window!

I wanted to add a new device to my wireless network, but I had forgotten the wireless key. My network uses WEP encryption. So, I used aircrack to recover the key. Basically what I had to do was:

    • use airodump to save a large number of  transmissions between the wireless router and a device that is already connected to the network.
    •  use aircrack to analyse the file produced by airodump and find the password

In particular, I managed to recover the key in the following simple steps:

  1. Download BackTrack Linux Distribution and burn it on a DVD.
  2. Boot my laptop using the live DVD
  3. On command prompt type:
    ifconfig to see the available network interfaces in Linux. Doing this I was able to find my laptop’s wireless interface.
  4. Type: airodump-ng -write afile.cap wlan0 , where afile.txt is the file that airodump will save all communication and wlan0 is the wireless network interface of my laptop as discovered in step 3. Let it run and collect packets for quite some time. It may a few hours (in my case it took 6 hours) for this step to collect enough packets. The time it will require depends on the traffic of the network. The more traffic the better. Once enough packets have been collected press Ctr+c to kill the process.
  5. Type: ivstools -convert afile.cap afile.ivs to convert the captured packets to ivs format compatible with aircrack
  6. Use aircrack-ng afile.ivs. Aircrack will pop up a menu to ask you which network you want to crack. Select the SSID of your network and if enough packets have been collected in step 3, you will have the key of your wireless network in no time!

I run into an investment advice book printed in 2002 (i.e. before the recession) and the preface starts like this: “(The US people should be) positive about buying or refinancing a home at historically low interest rates or buying a new car under new no-interest offers”. Obviously the recession came later on and everyone who invested in homes (and cars) lost a good deal of money.Moreover, many articles about the recession and its effect on the housing market mentioned that when interest rates are so low, there’s one way to…UP.

So..I was wondering whether I should spend my valuable time to read the rest 280 pages … I guess not… 🙂

Zenbe Lists has been down for the past few days and I am losing track of my things todo. Had a huge list of things to do on my days off, but…  Anybody got any suggestions for a TODO lists program that works with iOS 3.0.1 and will sync with a PC? Guess I could always try a pen and a piece of paper, but I am afraid it will take me some time to remember how to use this archaic user interface.