Wednesday, October 11, 2006

Salsa!

Don't like dancing? I didn't think I did. Or maybe I was just too shy to ever try it out. I never danced until about a month ago, when I signed up for a salsa course. Now I see things a little differently. Dancing is fun. It's great exercise and last, but not least, it is a great way to meet gorgeous girls. I seriously recommend it.


The whole piano thing has come more or less to a halt. Basically, I can't play when I'm uninspired. And I get uninspired too often at the moment. Salsa and other things help a lot, but only for a short while. I guess there are things I need to change about my life before I can move on to the next step, music-wise. For now I'm looking for a job and another place to live. Preferably in that order, so that I can earn money to pay the rent. I've worked in a kindergarten before and I'm planning to do either that or work as a substitute for a teacher.

Saturday, August 19, 2006

Yet another geeky post :-)

I have just added the last features to the database application and squished the last bugs. I must admit that I feel proud when I look at this little program. The 77 KB of source code is probably miniscule compared to what other people are writing, but it's by far my biggest project so far. And I'm quite pleased with the result:

  • User friendly GUI using wxWidgets.
  • XML based database, making it easy to import/export data.
  • Cryptography based on XTEA (in CBC mode) and MD5.
  • Portability (should compile on Linux, Mac and MS Windows with only minor changes).
  • Stability. I have written several test cases and spent a lot of time on error handling.
The thing I like the most i probably the XML library that I wrote. Using XML is neat because it is so flexible. And it's easy to import/export between different programs as well. A reader of this blog (Gamegod) suggested that XML might be too slow. Fortunately, the worst-case scenario is about 5000 records in the whole database, and only one search per second, so speed is not really a concern.

Writing and testing the program took a lot longer than expected, but I've heard that it's often like that in the software development business. Overall, I'm quite satisfied, but there are a number of things that I would probably do differently if I got another programming task like this one.


Language: C++

I like C/C++, but now I'm beginning to understand why people like Python and similar languages so much. I spent too much time manually allocating memory and making sure it was released again and similar things that higher-level languages take care of automatically. I think Python might have been a better choice, even if I had to learn how to use it first. Its superior string and list handling capabilities would probably have saved me a lot of time.

Another thing about C++ is the long compile times. A typo, a misspelled identifier, a missing semi-colon etc. that cause the compiler to fail, is very time consuming and an interpreted language like Python would make development much faster. If I had an IDE with built-in syntax checking, that would help a lot, though.


IDE: Dev-C++

Using Dev-C++ was nice in the beginning, but it has a lot of shortcomings and a few bugs. Using another IDE with better code completion features and better stability could have saved me quite a bit of time, especially because I'm quite new to most of these things and don't know the function names and their syntax by heart.



GUI library: wxWidgets

wxWidgets is a nice library. It's easy to use and has a lot of features. However, combined with C++, the compile time becomes annoying. Using wxWidgets with Python would probably have been a better solution. Another thing is that I didn't know wxGlade when I started coding, so I spent a lot of time writing GUI code that could have been written for me automatically. wxGlade is a great tool and highly recommended if you use wxWidgets. On the other hand, I probably learned more about wxWidgets from writing the code myself than I would if I had used wxGlade right from the start.

wxWidgets' error handling, though, is an entirely different matter: it's virtually non-existent. This cuased me a lot of headaches when my program mysterioysly started to crash whenever I closed certain dialog windows. After hours of work, it turned out that you shouldn't make pointers to wxSizer members of a wxDialog. I don't know why, and I didn't find anything about it in the documentation. An error message from the library would have been very helpful, since I was left pretty much in the dark by the standard crash messages in Windows.


Anyway, I won't be programming much in the near future, so stay tuned even if you don't care about technical gibberish ;-)

Monday, August 14, 2006

24 reasons not to update your blog

He can take out an army all by himself. He saves presidents and prevents nuclear holocaust. And more importantly: he saves manages to entertain me at a time where I must admit that I'm rather bored and much in need of any kind excitement. Three words: Jack is back (ie. season 5, on Danish tv). I know from experience that the episodes will probably get gradually less and less entertaining, but right now, I don't care. They're showing a new episode every day, which is why I haven't written anything here the last few days, and why I have to end this post here ;-)

Friday, August 11, 2006

Being a software developer

My father has hired me to develop a database application for his company. I don't have much practical experience, so development has been slow, but these last days I feel like I'm really getting somewhere. For the geeks reading this blog: I decided to use XML for the data, because it's more flexible than eg. an SQLite database. I decided to write my own XML parser from scratch. That way I'd probably learn more than by using an existing XML library. It took me a while to write, but it's almost done now and it saves and loads simple XML files. For the GUI I decided to use wxWidgets, because it's cross-platform and because it supports printing, unlike eg. FLTK. The only major downside of wxWidgets at the moment is the long compile times.

It's getting late, so I'll continue this later. Hopefully there won't be so long between updates in the future :-)

Friday, August 04, 2006

Back from the dead

It happens to all bloggers at some point: life catches up with you. And I am no exception. It caught up with me, and hopefully will continue to do so once in a while :-)

Sorry to keep you waiting. I didn't realize it's been over a month. But then again, I have been busy with a lot of things.


The festival, Roskilde 2006, was great. First of all there was the music. We had Arctic Monkeys, Tool, Bob Dylan and many others, both Danish and International bands palying there. The best experience was my discovery of some great jazz bands (I don't remember the names right now). I've never really listened much to Jazz, but I guess that's about to change.

Then there the movies. There was a free cinema with movies playing all the time. I'll save the in-depth reviews for a later time, but for now I'll just recommend Kiss Kiss Bang Bang and Dark Water to all of you reading this blog.

And finally there were a lot of old friends, whom I wish I'd see more often.


Afterwards, I went to Spain for a week for the IUSY Festival, but that's a whole other chapter.


Touching on the subject of music again, I have been practicing, perhaps not as much as I should, but more than I'm used to, so I guess things are moving in the right direction. For those who're interested in that sort of thing, the pieces I'm currently practicing are Impromptu Fantasie by Chopin and the maddeningly difficult Etude in C# minor Op. 42, nr. 5 by Scriabin.

So the conclusion, I guess, must be that I'm actually back from the living, but that would sound silly as a headline :-)

Monday, June 26, 2006

Walking the line

I'm scared. And excited.

I have made a choice. I will be a pianist.


But first, I'm going to one of Europe's biggest music festivals, Roskilde Festival, so until next week I will probably be busy relaxing with my friends and listening to great music, far away from any computer. See you again on monday.

BTW. I've discovered that some people are actually reading some of what I write. Woohoo!!!! Hopefully there will be more visitors in the future. For now, a warm welcome to gamegod.

Sunday, June 25, 2006

The difficulty of choosing

I have to choose my future within the next few days or I will have to wait another year before I begin. I don't know what to choose. Music science? Probably too academic. Engineering? Probably too geeky. History or political studies? Probably too boring on the long term and not even very useful when applying for a job. Nurse? Probably too tough and too low salary. And I need to choose which city to live in, perhaps leaving the family and friends that I have here.

I often think about studying to be a pianist. The problem is that although half the time I love playing, the other half of the time I'm sick of practicing. Mostly because I'm not very disciplined and always choose too dificult pieces and practice them too fast. But I'm addicted. Like right now, I feel a very strong urge to play. It's a very intense feeling, and together with the fact that I am quite talented, it gives me hope that perhaps one day I could make it and study at the academy of music. Getting in probably wouldn't be so hard, but getting used to practising as much as I would have to, probably would.

Turning a hobby into a fulltime job isn't always easy. Or a very good idea. Especially when it's one that's so hard to make money on. Even as a piano teacher it might not be easy to make a living. The problem is also that if I choose to study something else (eg. engineering), then I will probably have to give up playing. Perhaps I should just wait another year. In the mean time I could get a job and play the piano a lot. That is if I could keep on living with my parents (and their grand piano) or find somewhere else to practise.

I shall have to think, and think fast.