Sunday 1 July 2012

A Comeback: July Morning

It's been a while since I last posted something on my blog, and the time has now come to do it again. I have a story to tell (the actual reason is that my phone won't upload photos to Facebook for some reason, so I can't quite tell the story in pictures only).
This is the story of a July Morning fail. For those of you who do not know, July Morning is totally a thing is Bulgaria. In short, people go down to the beach, listen to Uriah heep and watch the sun rise. I have been an active proponent of this this tradition for the past several years. In practice however, given the abscence of beaches where I live, other things such as hills have been good enough in the past. I now live by the ocean and it seems like a shame not to take full advantage of this fact. I, of course, always come prepared, and here is some evidence of this: 1) our gear, and 2) (parts of) me and my housemate and fellow Sussex Informatics inmate Alex down at Brighton beach:

The flask contains, you guessed it, Scottish-made firewater -- the ritual must be performed in full. That flask has a long history of its own, which is the subject of another post. Suffice it to say I bought it some time ago from a shop in Edinburgh and then took it and emptied it at most tourist attractions in the ciry.
Now, since this is England, one cannot expect the sun to come up every morning because. It is overcast more often than not. So we figure we should wait. And we waited. And waited. And it then started raining. But we are not the kind of people who give up easily, so we waited a bit more. And then came the revelation:
While we were staring at the Brighton Pier, the sun was rising BEHIND us!!! As science has shown before, you cannot trust two scientists to work out where east is.
The moral of the story: the south coast of England is facing the wrong way, we shall attempt to fix that next year. Alternatively, we will change venue. Hopefully, we will also be more successfull in recruiting people for the July Morning cause.Here is another picture to convince people it is awesome.

The picture of me making optimal use of a blanket (being Batman/Superman) is coming later. Please remind me if I forget.

Tuesday 8 September 2009

On training safety

Some time ago I wrote a post about my motivation to participate in a half- marathon. Having spent some time training hard, I started thinking what was it that I learned from sport. So today would like to draw your attention to several well- known and often neglected facts about sports and human anatomy. I will describe some of the most common mistakes and will try to give practical advice to help you through the long training period. I will be focusing on sports that are relatively common, safe and do not require enormous investments- cycling, jogging and going to the gym.

First and foremost, safety. It is important to understand that every type of sport can be dangerous- you can be seriously hurt or even killed. Also bear in mind we do sports to improve our general fitness and thus the quality of our lives. It is good to take things seriously, but you are (most likely) not a professional sportsman. Different rules apply to you, and it is definitely not worth taking any risks. Remember, the key to being safe is being prepared. So what can you do?
Some general safety remarks
  • Pick your training spot carefully. As a general rule, do not exercise outside after dark, especially in the wild or in the dangerous neighbourhoods (this applies to men as well).
  • Find someone who shares your passion for sport- two people are less likely to get attacked. Humans are not the only threat- wild animals are unpredictable and quite common in some parts of the world. Having a partner will help you make some new friends and stay motivated.
  • Respect the environment- your local park of the forest next to your town is not a bin.
  • If you go out of town, always have a mobile phone with you. In case something goes wrong it can (quite literally) be a life-saver.
  • If your activity takes a long time (e.g. a cycling trip) make sure you have enough water and something sweet in case you suddenly feel unwell. Alternatively, some cash would also help if there are shops along the way.
  • Respect others around you. In the gym, keep conversations down and have a towel at all times. On the road, do not endanger others with your behaviour but do not expect them to do the same for you. Always assume everyone is an idiot- the less trust you have in people, the less likely you are to be injured because of someone else's mistake.
  • Do not save money when it comes to equipment. If you want to make the most out your time, buy proper clothing and footwear. I used to experience the typical teenage joint pain until I bought a pair of good shoes and I can run pain-free now. You do not need to go over the top- purchasing high-end hydraulic brakes does not make a lot of sense if you only cycle to work.

    Some cycling- specific remarks:

  • Cycling is different than running in the sense that it requires equipment other than your own body. Unlike your leg, a bike cannot tell if it is damaged, so it your responsibility to regularly check if everything is in working order. Pay special attention to to the brakes and wheels- a badly balance rim will affect the handling and if may result in a close encounter with the road.
  • Do not tinker with your bike if you do not know what you are doing. Should you need a repair seek professional advice.
  • Dirty bikes play dirty tricks- the best way to inspect a bike is to clean it thoroughly. Do not forget to oil the chain after cleaning.
  • Whenever you go out for a long trip (not within walking distances from the nearest train station), take a spare tube with you, especially if you have a road bike. Tools are also a good idea- a small all-in-one kit will only cost you a couple of pounds and can be invaluable in case something breaks down.
  • HELMET!!! I have been mowed down by a car and I guarantee a brain concussion is not the most pleasurable of experiences.
  • Do not overestimate your own abilities. Chicks can't tell the different between braking before the corner and braking right after you feel you are losing control. I learned this the hard way when I crashed my bike at 60 km/h on a mountain road, almost fell into a precipice, forced my dad to jump off his bike to avoid running me over, and forced a truck driver to almost drive into the precipice himself to avoid running me over. My dad broke his arm, and I had a close look at the inside of my knee. We had to keep cycling because our mobiles had no reception and we could not call anyone. In the hospital they put me next to a dying lady, and I was in pain for months. It has been 5 years now, my scar won't go away and my dad's elbow still won't extend. The moral: there is a place and time for extreme sports, and it is certainly not on open roads. If you want to take risks, take them on your own.

    In conclusion- be sensible, plan things in advance, take care of yourself and do not endanger others.
    Next time- having prepared everything, how to go about the actual workout.
  • Wednesday 2 September 2009

    ***

    Today, if Mr Cooper doesn't mind, I'd like to add another category- the proficient user who sticks to a hard-to-use program and takes pride in it. Take Linux users- yes, it is safer, faster, more stable than Windows, but it is complicated even for those who happen to have used a computer before. Even nowadays, with all that effort being put into making Linux* user-friendly, I still feel many people are scared by the very word Terminal. And this is the point- “noobs” should be kept away, and the society of enthusiasts should be closed to outsiders. You make friends with other geeks, get involved in the Vim vs Nano vs Emacs debates, and show off to every girl you see by saying “Step back, let the pro handle this”. The arguments are almost religious, while in reality none of the aforementioned products is clearly superior than the rest. None of the text editors will write a report for you, and in a the large majority of cases Windows (I can't believe I am saying this, but even Vista) will do the job just as good as any other operating system.
    Being a part of this group for about an year now (I know, it is not a lot), I admit I regret getting rid of XP. It was horrible, but I never had to install tons and tons of different drivers to get above 800x600, sound is great, battery time was better than in Ubuntu 8.04 (!!!), and most importantly- games just work. No emulators, no tweaking, no swearing- they just work, and you can shoot as many bad guys as you like. Linux can't do that/

    * Mac users, you are great, OS X is great, please do not flood my mailbox with angry comments.

    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?