Monday 31 August 2009

Reflections on software desing

Last week I spent lots of time tweaking the user user interface of my other project according to Cooper's principles. Interaction design is fun if you are a designer and NOT fun if you are a programmer, so it is useful in the sense that it helps you get away from the “this will take ages to implement” way of thinking. It is amazing how tempting it is to ignore what the user needs and do it your way, the way it is easy to code. Here is a simple example: to go back to the main menu, you have to click File> Back to main menu. Makes sense, doesn't it? Well, apparently not- I had three different people telling me on three different occasions that they would very much like to see a Back button on the screen at all times!!! Funny thing is, those modern GUI builders let me do this minor change it less than a minute, and I still resisted it until my boss came over and “commanded” me to do it. And this is just the tip of the iceberg- the whole program makes perfect sense to me, since I designed it and implemented it. But to anyone else, it is just an comprehensible collection of buttons. This is what Cooper calls “the dancing bear” paradox. Imagine you want to go to a dance festival. But then you see one of those dancing bear. Do you just walk past and go to a proper dancing event, or do you start giggling and watch the bear's performance? If the bear is a computer program, the average user would just walk past- yes, it is cool that it can move in such an unusual way, but this is not what I wanted in the first place! And then there is that group of enthusiasts, who will stick with the most horrible product simply because it allows them to do something new, no matter how hard it is to use. The third group consist of those who are already more or less skilled computer users, who are too used to the crappy software to simply switch to another product. This is clearly not the way things are supposed to be. Computers are tools, a means to a goal, not a limitation. The problems we all tackle on a daily are hard enough even without software getting in the way. That is why developers should resist the temptation to do it “the convenient way”, to re-use code (despite all the benefits of that) and forger the famous “If it ain't broke, don't fix it” principle.

Next time, an extension to the Cooper model of computer users.

Thursday 27 August 2009

Science is cool- part 2

I am beginning to enjoy this even more and moreeeee! Got around the generation problem, wrote another couple of pretty standard procedures (e.g. finding the size of the largest connected component) and now to the pen-and-paper job. After two whole days of “hm, how do you describe love with an equation” I finally got to an answer, and we all believe it is correct! It is a system of 6 non-linear simultaneous equations, which , unfortunately, proved to be analytically intractable. Again, I went to consult a specialist, and he recommended the Broyden method, which supposedly generalises the secant method for N-dimentional space. Without going into too much detail, it is supposed to find a solution relatively quickly. However, with some manual work the system is easily reduced to 2 equations, and given the limited domain of the variables ( [0;1], since they are probabilities ), made me think GUESSING is the best option. Even if I had to linearly iterate over all possible combinations of value, it would still take only a million steps (for accuracy of three decimal places), which on a modern computer is...well, insignificant! Of course, being an AI-engineer-to-be, this is not a satisfactory approach, so I went for a technique called simulated annealing. In a nutshell, this is a very basic genetic algorithm inspired by metallurgy and chemistry(look it up yourselves, it takes less time to code than to explain how and why it works).

Next time- a programmer's reflections on software design.

Monday 24 August 2009

Graph theory and chaos on an extraordinary Friday

It has been such an ordinary Monday it is not worth talking about. On the other hand, Friday, oh we all love Fridays! Nobody really bothers- it is doughnut day, for heaven's sake! So I go with the flow- got to work a little bit late than usual, that is 11 am, and spend half an hour making tea and contemplating on how to improve on a already perfect algorithm. When I finally got to the point where I look at my experimental results, I realized I couldn't be more wrong about it. Thing is, the meaningless combination of numbers I got was supposed to represent a simple graph. Well, almost... it was a graph of some sort, but not a single metric was within 50% of the desired, let alone be a precise match. Here is a bit for the technically oriented among you (please feel free to skip the next paragraph if you are not into graph theory of Java):
~~~~~~ TECHNICAL ~~~~~~
The task is to generate a simple undirected graph with a given degree distribution- initially uniform, Gaussian and exponential, with a potential for easy extension. Also, we should be able to control different graph metrics (mean geodesic path length, clustering coefficient and degree correlation) at least to some extent. My original idea was to generate the degree sequence and construct a graph that corresponds to it. The Erdos-Gallai theorem comes handy here- it provides a necessary and sufficient condition that a sequence of number is a graphic, i.e. the degree distribution of a graph. Problem with that is, I was trying to generate a sequence which precisely describes the degree distribution, and you get stuck somewhere between order and chaos. On one hand, the graph still has to be random, but on the other if you give it “hard” numbers and do not allow fluctuation it is really hard to get anything. Cool, huh? No need to reinvent the wheel though, a quick search and you get your hands on a number of clever AI-inspired algorithms to do the job for you.
Unfortunately, I could not make any further progress on this project, since I accidentally discovered requirements mismatch in my previous project (the programming one). I (very conveniently) ignored the bit that said “let the user play around and interact with the program to see what happens if...” and replaced it with a textual description of the process. Still does the job, but not very educational :D. A bit later on, I realized my listener uses the rather simple SwingUtilities.isRightClick() to decide whether to show the context-sensitive menu or not, BUT there is no such thing as a right click on the Mac. The pop-up trigger is left click with a CTRL_DOWN_MASK bitmask. Well done, Apple, elegant, but don't you think that is convenient to have a normal right click like everyone else does? So right now I have no idea how to get around this little complication, especially given that ctrl+click is already mapped to an action.
~~~~~~END OF TECHNICAL BIT~~~~~~
Apart from that, life is not going bad at all, given that I've been away from my precious girl for six weeks now. Missing her gives me that extra motivation when training, and I particularly need it when I do it on my own. By the way , running is going quite good, I did a total of about 6 kilometres over the weekend and I can feel my getting stronger with every meter. If only English weather didn't have that annoying habit to get in my way all the time!

Thursday 20 August 2009

Hey, have I ever mentioned how cool it is to be a researcher? Well, it is extremely cool!
So far the project I work on has been all about programming. We were developing an educational tool to help teach maths (more specifically, network theory) to biologists, i.e. people who are supposed to hate it. As you might expect, it's not the easiest job in the world, especially when you work with a team of zero and the schedule is tight. Fortunately, I managed to get my hands on an incredible piece of software, very well thought through, and relatively easy to use and it that save me a lot of time. However, what I did was still a programming job, and as you might imagine, it is not the most fascinating of activities. At this point I ought to make an important clarification-it is quite a pleasurable experience to work (i.e. program) in a team of talented people. Just imagine it: the relentless pace at which ideas are thrown around, the pressure of all those bright minds sitting around you working at full capacity, the devastating feeling you get if your idea is not so great. You have not other choice but to keep up, and it seems like everyone else is doing their best to prevent you from that! If you are the least bit competitive, you will come to love great teams, simply because they are...well... great!

And since I did not get a lot of this, I'm glad the job is done and I can move on to some even more amazing interdisciplinary stuff. The paper is still in preparation, so I'm not allowed to say an awful lot yet, but it is simply great! We are designing a computer model of a complex biological system, which is meant to improve on a previous model. I feels rather good to know that you “correcting” the work of someone who has been around for 40 years longer than you and has published more papers than you can read in a month! Besides, as one of my colleagues said today, change is better than a break. Over the last couple of days I had to go over an awful lot of biological literature, gather ideas, identify other people's assumptions and figure out how to get rid of the biases they've introduced. In the process I got to talk to some very, very interesting and knowledgeable people. For example, did you know that fish shoals have designated “scouts”, who are supposed to swim toward predators and challenge them to give the shoal time to escape? And did you know, that those scouts tend to “hang around” (to the extent a fish can hang around with another fish) with the cowardly fish, but their “real friends” are other bold scouts? So, is science not cool?

Tuesday 18 August 2009

Marathon training

Hi everyone, it's great news! Me and my mate Sam, decided to take part in next year's half marathon in Brighton*. To the sceptics among you, yes, I realize it's only a half-marathon and it doesn't sound quite as impressive as a marathon, but it's a start.
Here's some history: I used to dislike (well, to be completely frank, I absolutely despised) running. I used to have that typical teenage joint thing- to keep up with the rest of the body my bones grew too fast, so they were not an example of strength. Put simply, running was a pain. While at uni I had no other option but to take up running since I could not get my hands on a decent bike for a while. On the other hand, Sam had some previous experience. During our first year, we would go jogging in the woods right next to our house every now and then- the hills around Brighton are amazing. Seriously, I highly recommend visiting the South Downs if you haven't done it by now- it's a one-of experience.

It's decided now, Sam's made a bet with his brother, I've promised myself I will do it as a part of the long term self-development plan**. No turning back at this point. So, anyone up for the challenge? We're looking for a running (and drinking, or course) mate, ideally based in Brighton, starting October 2009. Also we'd love to get in touch with people with more experience in the are, so if you are one post a comment or contact me using the form on the right.

*http://www.sussexbeacon.org.uk/halfmarathon/
**My friend Verena has a thing or two to to say about self-development, check her out at www.selfdev.org

Sunday 16 August 2009

An unimportant announcement

Right, for the sake of simplicity forget about multi-language blogs. This one is and will remain entirely in English, and the Bulgarian version is available either via the link at the right-hand side of the page or at:
http://www.reseter05bg.blogspot.com

The contents is these blogs may or may not be identical, so do not hesitate to contact me should you require a translation.

The "Doctor"

So as I mentioned, working full-time was taking its toll on my wrists of steel. So one day I call in sick at work and go straight to the doctor's ( for the sake of arguments, let's call her Dr Jane Doe). So I obediently wait for my turn to come, and this can take a while in England, and I walk into her office. I sit down I saw I've got joint pain. She looks a me, takes a step back, and asks if I've also had fever or a rash. On the inside I am already rolling of the floor, but on the outside I remain calm and explain I don't have swing flu, but rather something like RSI. She sighs and asks me explain in more detail. I say I've got a programming job and that I also went jogging the previous evening and that caused my limping. And here goes her treatment:
- Did you warm up before jogging?
- Yes!
- And did you do some stretching after that?
- Yes, kind of, I don't like doing this.
- Aha, there you go, that's the problem. Now look at me (and shows me how to bend down)
-But doc, I've had that knee condition for 10 years now, it always hurts, no matter what I do.
-No, no, no! Look, and do this next time. (keeps showing me how to bend down, and I start to wonder if she's hitting on me or what?!?) Have you got some proper running shoes?
- Yes, I do!
- It must be the wrong stretching then, next time do it properly. And buy an ergonomic mouse pad. If this doesn't help, consider a career change, career, understand? (yes doc, I happen to speak some English, I know what career is)
- But doc, I'm a student, I intend to do that for the rest of my life!
- No, you must not. Thank you.

Baffled, I decide it's better to walk out and see a doctor who actually listens to what I say.

Summer so far

Hi,
I'll try and summarize the last month is less than a page. As you may or may not know, I got a summer studentship from the University of York and I've been working in the York Center for Complex Systems Analysis (or YCCSA for short) for five weeks now. I believe this is a very typical academic job, although it's my first so it's hard to day :D I work mostly unsupervised, flexible hours, and my boss does NOT care if I'm late or not- how cool is that. Not to mention, he is a respected biologist and is often away on conferences and stuff, so nobody is around to pressure me. Despite my job clearly being relaxed, it is also quite demanding. No constant supervision means every mistake I make will haunt me for ages, so needless to say I have to be very careful. Also, sitting in from of a computer screen full-time turns out to be not as easy as I expected. One week into it I had to to see a doctor because both wrist were giving me a hard time ( more on the this to follow, it's a remarkable story).

York is a cool place- incredible architecture. I can almost feel like a medieval English soldier fighting off...well, almost everyone. Especially when walking along the city wall- it's been rebuilt every time somebody invaded the town, which is approximately a million times, so it's in mint condition. The minster is also quite impressive, although I heard it's not as big as the one in Cologne. Still, I like it better than St Paul's in London ( I ought to say, we walked all day in London and when we finally got there I felt more like killing myself rather than looking at a large collection of stones piled on top of each other).

Right enough for now, if anyone wants to hear more about a specific thing, do let me know- I've got some free time.

Welcome

Hi everyone,
just got round to actually setting up a my own blog. I've been meaning to for years, but I guess I'm bored enough now to actually do it. So read and enjoy!