Funky Monkey Software | Development, Applications and Chimps

The last few weeks have been pretty nice for me since I've had lots of lectures and not much else to do. Unfortunately, I've just been hit in the face with a bucketload of assignments and I've really got my work cut out! I've already had 7 assignments announced, 2 of which I've completed, and one of which I'm half way through.

I'm currently working on my AI assignment in which I have to use Bayesian Logic/Fuzzy Logic/Both to calculate whether or not to insure someone given their driving profile. I've found some really interesting stuff while I've been doing this, I've also found that almost all of the literature to do with these topics is aimed really high and not very accessible to the likes of me. I'm hoping, once I've got my head around all this stuff, I'll be able to release a working version of my car insurance system online for you to see.

This next week is the last week of uni before easter. After that, I'm off to buy a car, look at houses and do all sorts of fun things that I can't do at the moment.

I'll write again soon,

James

· · · · · · ·

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 :)

· · · · ·

Its been a while since I worked with C++ (a few months at least) and even when I did use the language, I was looking at it from a Java developer's perspective rather than trying to understand what the language is all about. My Computer Science lectures on C++ and different programming paradigms has really opened my eyes as to how C++ should be used (separately and in different ways to Java).

The first lesson I've been learning is about 'Constness', that is, declaring things that don't change constant in your programs to ensure that the compiler tells you when you try to change them and thus, iron out silly bugs. An example of this is as follows:

You may define a cat class in your program. Logically, you would never wish to change the gender of a cat, So the cat's gender could be declared a constant:

cat.h:
class Cat{
...
private:
      const bool isMale;
...
}
cat.cpp:
Cat::Cat(bool male) : isMale(male){
...
}

Now, you want to see if two cats have the same  gender, but you put in a typo:

Cat::canBreed(Cat otherCat){

    if(this->isMale = otherCat->getIsMale()){
          return false;
    }

}

Sad kitteh is sad: "Why you trying to reassign mah gender?"

You wanted to compare the gender of the two cats, but instead, you are trying to assign the gender of Cat A to the gender of Cat B. Luckily, the C++ compiler will help you out here.

Since you declared isMale as a const, this typo will be singled out as a mistake and the compiler will tell you that you are trying to do something wrong: this is a good thing!

So what about mutables? These are a slightly more difficult concept to grasp, but essentially they are only to be used when the object does not logically change, but must change in practice. For example: For loading an image just in time, rather than keeping it in memory (the image 'object' remains the same, but the image data buffer itself changes at the last minute). I stumbled across this article on mutables, and I couldn't have put it better myself.

So that's all for the first in my series of exciting C++ adventures, No cats were psychologically or physically damaged in the making of this article.

· · · · · ·

Feb/11

14

Android and ADM

The last few weeks have been incredibly busy with a huge number of activities going on, including revision for exams and Work Week. Now that I finally have some free time, I decided to have a quick look into the development of Android applications using my Scroll. I noticed that there is currently a lack of JDownloader-esque apps for Android and when I'm up on the uni campus with only my Android, I'd like to be able to download stuff on masse using the University's stupidly fast connection. For these reasons, ADM was  born

ADM (pronounced 'Adam') or Android Download Manager, is going to be a fully fledged download core system complete with link parser/checker functionality and a file hosting crawler that searches places like Rapidshare and Hotfile for relevant downloads that may interest the user. I may also build in un-rar functionality too. I've started working on it and have some early designs and stuff, but nothing too exciting.

I'll post more info when I have something exciting to show you. Unfortunately, my WordPress Script seems to hate me and is not letting me upload images or anything at the moment!

· · · · · · · ·

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!"

· · · · · ·

Jan/11

18

Happy New Year

Well I know its a little late, but its time for that obligatory 'reflective' and 'philosophical'  post that comes but once a year.

Firstly, the last year has seen a wonderfully diverse series of events that have been enlightening, entertaining, educational and occasionally embarassing. I've seen the coming and going of some really good friends, the success of several relationships and the failures of others.

In 2010, I managed to secure myself a sandwich year with IBM after several months of searching for a job. I applied to some really well known companies and organisations such as CERN and Intel but to no avail. Eventually in September, I was invited by IBM to attend an interview and was offered a junior programmer's position. At IBM Hursley, near Winchester in the UK. I'm scheduled to start in July this year and I'm really psyched!

I also passed the first year of my degree with a 1st! I was very excited and it gave me a great opportunity to work as a demonstrator within the Computer Science department and get some experience teaching computer science to the first years.

So what's happening this year? Well, aside from finishing my 2nd year at uni, I'll be starting my year out at IBM, having purchased a car and an appartment on my own for the first time.

New years resolutions? Keep this blog updated with a new post at least weekly and to keep my personal diary up to date too.

See you in the next week readers!

No tags

Dec/10

26

Season’s greetings

So, as quickly as ever, it seems that Christmas has snook up on us yet again! The Christmas holiday period marks a highly anticipated break from student life for me and many of my student colleagues. It's also a great opportunity for me to start getting creative and using a lot of the knowledge I picked up during the uni semester to develop some new software packages.

Christmas also brought me a lovely new android tablet to play with, providing me with the perfect opportunity to have a go at writing some android apps. I'be harassment wonderful day today and a wonderful year in general (although I'll save all the reminiscing stuff for my new year's post).

All the best and lots of Yuletide cheer

James

· · · · ·

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

11

A quick apology

I'm feeling really bad for neglecting a lot of friendships at the moment. I've been really busy as of late, and its difficult to fit in all the work without putting the play on the subs bench for a while. I promise to be more sociable after all the assignments are handed in and everything is sorted out with uni work.Until then, I'm really sorry, please don't hate me >_<

No tags

Older posts >>

Theme Design by devolux.nh2.me