Funky Monkey Software | Development, Applications and Chimps

CAT | Industriousness

My friend FlabbyRabbit (over at HackThis) recommended that I start blogging about my software projects so that I can help other people with their projects and have something to look back on when everything is finished. For this reason, I've decided to start writing about ADM (my Android Download Manager) as I develop it, documenting my trials and tribulations as I go along.

So What's going on in the world of Android and downloading at the moment? Well, ADM still doesn't really do much in all honesty. Currently, you can add URLs to the database and ADM will check them for you to see if they are online (provided the relevant downloader plugin is installed).

I've had quite a lot of trouble getting the threaded parts of the application to talk to each other in a meaningful way. The need for threads in an application that does a lot of networking is fairly obvious. The user doesn't want to be sat there waiting for something to happen for hours with no progress dialog. Users want results. Therefore, I've put in a system that goes off, downloads the data and then returns it to the GUI thread while the GUI sits with a progress bar, waiting patiently for some useful input.

Unfortunately, my first attempts at this were met with a rather nasty looking exception "CalledFromWrongThreadException". This basically states that a secondary thread is not allowed to alter a view that was created by a primary thread. That is, if Thread A creates a layout and Thread B goes off and does some work, Thread B is not allowed to update the layout directly.

"So how can we get around this?" You might ask. Well Google have kindly provided a nice answer for you: Handlers. Handlers can be used as a 'proxy' between the two threads, passing information from B back to A. Therefore I can simply implement a handler within my first thread with the following code:

    // Define the Handler that receives
    // messages from the thread and
    // update the progress
final Handler handler = new Handler() {
public void handleMessage(Message msg) {
//progress has been made, update the thread GUI
            updateGUI();

}
};

Then, the second thread (thread B) can just call:

Message msg = mHandler.obtainMessage();
msg.arg1 = total;
threadA.handler.sendMessage(msg);

So there you have it. I'll be posting some screenshots of ADM soonish :)

· · · · ·

Feb/11

4

Coding Week

This week has been one of the most intense weeks of my University career so far! I've had so very much to do in so little time and as I write, I'm basically falling asleep.

As part of our degree this year, we had to write a small Java application for organising car shares in and around the university town using a PostgreSQL database. We've been maintaining the code in Subversion and running lots of JUnit tests on it to make sure everything works nicely. As part of the project, I've learned a lot of stuff, especially on Postgres databases and Java, but also on how to work with and manage a team during a large IT project.

I was dreading this week at first, but it's actually been really cool and I've made some really good new friends and learned a lot of new things. If working for IBM is anything like this week, I'm sure it'll be a hoot!

· · · · · · · · · ·

One of the most interesting modules that I've  been studying this semester has been Artificial Intelligence.

I've been shown how to do lots of very complex, intelligent things with computers including the use of Search Trees to find a solution to a complicated problem, how to use Genetic Algorithms and Genetic Programming to 'evolve' complex solutions and how to cluster data into groups and classify labelled data.

As a revision exercise (but also just to see if I could) I decided to try and cluster my music collection into genres using K-Means and Agglomerative Hierachical clustering. I originally planned to use the actual shape of the music (through wave form analysis) as my metric to find the distance between tracks. However, I simply don't have the mathematical expertise for this job. Therefore, I've been implementing the system using Last.FM metadata and comparing tags assigned to songs.

The biggest problem I've had so far is establishing some rules and some form of distance measure using the tagging system. However, after some lengthy googling, I came across this little gem of information. Essentially, it suggests assigning each possible tag a weight based on the frequency of its use. If a tag is used 5 times and the overall number of taggings (that is assignments of a word to a track, not the number of words themselves) is 100, then the tag's weight is 1/20.

With this system in place, its really easy to start building a picture of a song's 'weight' and matching tracks. The next part was the clustering of the tracks using a Hierarchical Agglomerative approach. This basically means, taking the Euclidean value of each cluster and merging it with its closest neighbor until there is only one big cluster left. Unfortunately, my python code really doesn't want to play ball, so I've written off to the python mailing list to see if any of them can solve it. But if you are interested in seeing the program I came up with, take a look at this python code.

I'm hoping to figure out why this isn't working myself, but any input would be very valuable to me.

"Dude!, She just called you useless!" "OH HELL NO!! Hold my Bachelor of Arts!"

· · · · · ·

Nov/10

23

Gregynog

Its been more than a week since I attended the fabled "Gregynog Careers Weekend" and I've still not written about it. Essentially, it was a very useful and important experience to me and I really had fun. Gregynog is a large stately home, situated in the welsh countryside, a few miles outside Newtown. It is owned by the University of Wales (a group, Aberystwyth University was formerly part of) and is used for a variety of residential courses and University related gatherings.

We left on Friday evening in the dark and the Welsh Drizzle, arriving at Gregynog and dining at around 6pm. The food was really good and we all wolfed it down like no tomorrow. We then had an introductory talk from the Industrialists and were sent off to the bar.

At 9am the next day the fun began! We were sent around the house, doing various tasks including Panel Interviews, group building activities and even making posters on Belbin personality traits! The most important of these activities (to me at least) was the interview. We were grilled, in turn, on our aspirations, our reasons for applying for the fake job, and our interests. The interviews were set up to be deliberately scary and difficult to attempt to prepare us for any potential interview that we may encounter in our search for industrial placements. I learnt a lot about myself, about how to cope under pressure and about how to set up my CV. The most important lesson I learned was not to undersell yourself. It is a very British trait to underplay huge achievements, and apparently, I have a lot more to offer than my CV would lead you to believe.

The industrialists were fairly impressed with our performance, you can find some of their blog posts (thanks to Peter 'Welp' Weller) here.

· · · · · · · ·

Nov/10

2

OH HAI!

Hey readers. I'm sorry it's been such a long time since my last blog post. I've been keeping myself substantially busy between my last post and this one. Lots of exciting things have been happening and its been a rather hectic 3 months(Yeah, 3 months since I last updated! How crazy is that?)!

The last few weeks/months have been incredible and a lot of awesome things have happened since I last spoke to you. I'm currently sat here writing to you from my rather lovely flat in Aberystwyth looking out into the murk. Its a typical Autumn's day here and it makes it all the nicer to be inside with a warm coffee and a good soundtrack. I'm catching up on all my work, lecture notes and other things that I have fallen significantly behind on.

University is going impeccably well and I am really enjoying the course this year. The Artificial Intelligence content is astounding and the lectures are Genius. We were told at the beginning of the Semester that a lot of the background reading we need to do is in the Russell & Norvig Epic "Artificial Intelligence, a Modern Approach". The lecturer told us not to buy this book since it is highly expensive and available from the library. Lucky for me, I already own this book! We're currently going over Genetic Algorithms in class and we've just finished Heuristic Search. Another large part of the course this year is based upon Advanced Data Structures and Algorithm design. For this reason, I was advised by one of my lecturers to buy The Design Patterns (Gang Four) book which I gladly purchased. My collection of educational texts is growing :D

I am now the Treasurer for the Fantasy Sci Fi group at the university. That means that they let me look after money, which is possibly not a good idea. Having said that, the president, Jen, might actually quite like the 1000 kilos of Jelly Babies I purchased on the FSF account for a Doctor Who themed evening (just kidding if any committee members are reading this).

Emily and a couple of others have now formally formed a band with me! We've decided to call ourselves Persuasion and aim to do lots of little gigs in and around Aber, I'll keep you posted!

I've got a few jobs on at the moment including working as a Demonstrator in the computer labs at University as well as running a few Freelance projects through VWorker and FunkyMonkeySoftware. Its great and keeps the money trickling in on my tight student budget. Demonstrating is also really really good fun and its a great way for me to get some experience teaching/lecturing, helping towards my aim to become an AI Lecturer in a few years time!

Finally, I'm pretty much finished in the IBM Student placement scheme Application Process. I went down to their assessment day thingy on the 20th of October and got a letter telling me that I had been successful and to expect to hear from them soon to arrange a final interview for integration into the company.

I never seem to have any time to rest any more, I'm a very busy man. What with various jobs, assignments and social engagements, I'm always hopping around Aberystwyth and Britain in general. Whether it be to attend a business meeting  in Portsmouth, or a romantic candle-lit night in with good food (if I do say so myself), Supertramp for background music and exquisite company. At least I'm having fun, its just that I've never had so much of it and I think I might explode at this rate!

Life is good, c'est fantastique! I'll try and keep you posted more frequently from now on!

No tags

Theme Design by devolux.nh2.me