Entries Tagged 'Programming' ↓

GPX Viewer in Debian \o/

So as I’m trying to make an effort to start being more productive again, I’ve kicked this off by packaging my python application, GPX Viewer, for Debian. Last year, I created GPX Viewer to read GPS trace files in the GPX format, calculate some stats, and display the trace on a map.

I started packaging it for Debian/Ubuntu last summer, but sort of forgot about it. But at the weekend I finished it off and submitted it to the Python Applications Packaging Team, where a Debian developer (Piotr Ożarowski) kindly reviewed my packaging, advised of a few tweaks, and then sponsored my package for the repositories.

And it’s as simple as that. It’s now nicely in the repositories: http://packages.debian.org/sid/gpxviewer

Now, what shall I package next? 🙂

GPX Viewer 0.1

Noticed anything different about the blog? I hope not, as I’ve made a smooth transition to using my own VPS provided by Bitfolk. Yay! But that’s the topic of another blog post!

I’ve made a little app, with Python. This app opens up GPX trace files and allows you to view them on a map, and view basic stats. For those who don’t know, GPX files, are tracks recorded by a GPS device. Making tracks with a GPS device lets you review your journey later.

GPX Viewer 0.1

As you can see, and  can possibly recognise, the trace is drawn on an openstreetmap map. This was made possible thanks to John Stower’s brilliant openstreetmap GTK widget with Python bindings. (I’ve packaged this GTK widget up for Ubuntu and it was accepted in. That was my first packaging, which I will talk about in a future blog entry!)

Go ahead and download it from http://andrewgee.org/downloads/gpxviewer

I’m going to work on Ubuntu and Debian Packages very shortly, so it’s easy to install. Are you a packager for another distribution? Would appreciate it if you’d package this up for me. It would be great if you let me know if you are going to do this.

Translations. This program is fully translatable on Launchpad at http://translations.launchpad.net/gpxviewer – Go ahead and check it out, if you know another lanuage and want to help out! Shouldn’t take too much effort, as there’re few strings to be translated at the moment!

Leave a comment to let me know what you think of the application.

Django

In my last post, I was talking about how I had made a nice little radio automation app in python. Since then I’ve completely restructured it and it is now split into a frontend and backend, which communicate with XML-RPC (yay for the xmlrpclib module). But the website to go with this project is not that great. The other day I went back to look at the website so far, which I had originally written in PHP. I got annoyed with how disorganised it was and decided to rewrite it in django. Oh. And I just prefer python coding over PHP now 🙂

I’ve been trying to learn django on and off for ages now. I usually lose concentration after the first two parts of the tutorial. But this time I had a purpose – the website. I’ve found the best way, for me to learn a new language, is to take a tutorial telling me how to make another project, but apply it to my own project. So I installed the SVN version of django and I’ve zoomed through a lot of django learning now. It’s great. It’s all nicely arranged and modular, which is something I’m liking more and more as my programming skills have developed and perhaps lazyness, when re-using code 🙂

I’ve also been using subversion to keep the code organised. I would have used bazaar if there had been a webdav plugin that worked with the current version I have. I suppose I’ll have to wait for intrepid for that then. subversion is serving me well though. I just got to get the person that’s supposed to be helping me to actually help me. Yes, that’s right – I’m looking at you Stephen.

Radio

Within the past year, my school has started to become very involved in trying to start it’s own radio station. We’ve had a large amount of money put into it and it’s slowly growing. We have the software that all the professionals use, and all of the equipment too.

But now I’m moving on to developing an automation application for the time that there isn’t a show on air. This will be similar to Southampton University’s radio station automation system (http://surgeradio.co.uk).

I’m using a combination of python and gstreamer. The feedback so far from the teacher involved, with our radio station, is good. The only problem is the network technician that is a Windows Server user. I think I’m going to have a problem, when I ask for a linux server to host the automation server, streaming, file server, and website. I expect he’ll wonder what’s wrong with his little sharepoint setup, he has going. Hopefully I might be able to do some persuading to get past that, but it’s not going to be easy. I understand the problem that this would cause though. I’m the only one with the skills to maintain the linux server. When I leave next year, I doubt they will have a clue how to operate the server, as I don’t think they have no knowledge of Linux. Anyway, that’ll be fun to try and sort out. Any suggestions?

At the application side, it’s coming along well. I’ve made a website that will allow listeners to request songs to be played. These requests are popped into a MySQL database. From here, my python app checks for new requests after every song. If there is a request, it’ll play that. If not, it’ll choose the next song from a pre chosen list. Nifty, aye?

I was amazed at how quick it was to develop in python, as this is my first real programming project in python. It was so simple to get a basic set up done. I had it done within a night! Jono Bacon’s excellent guide on gstreamer in python helped me well. The app now also has a nice little GUI, made in glade, that’ll help the DJs turn the automation on and off.

For the hardware setup, I’m looking to get the server, that I mentioned, and a few high quality sound cards, that’ll provide balanced audio in and out. I don’t think we’d need much processing power for the encoding of the streaming, as I’ve done a few test runs with my old Pentium 4 clocked at 1.8GHz.

All I have to do is finish it all up now… And perhaps do some of my many pieces of homework!

Ruby on Rails Fun

Still my early summer holidays. Apart from the many household jobs my parents have instructed me to do, I’ve also be learning a new programming language.

I’ve be learning the great web development language known as ruby on rails. I’m not quite a 1337 h4xx0r at it yet, but hopefully one day! Or perhaps not. I’m not a 1337 h4xx0r at php and javascript and I’ve been using them for quite a while now.

Advantages?

I think this ruby on rails magic makes all this web development lark much easier because of the following things I’ve found so far:

Firstly, the “Model, View, Controller” way of running things. Ok. So this wasn’t easy to understand straight away. But as soon as it goes *click* in your head, it sure is amazing. I remember half heartedly trying to learn ruby on rails a while back and gave up pretty quickly because of the confusion from this MVC. If you want to learn ruby on rails, I do recommend getting a good book (I’ll talk about that in a minute), and also making lots of examples to remember what all the different components of MVC do.

Number 2 in ruby on rails features has to be Migrations for databases. Migrations allow you to easily synchronise database changes between developers of the web application. You make a change to the database that needs to be synchronised? Well then you setup a database migration step and the changes will be updated when the developer next runs db:migrate. Another good use for database migrations would be to easily manage the database states between the development and the actual deployment on a server. I can’t see PHP doing that with any great ease.

Number 3? Well… I don’t have a number 3! I’ve only got to page 100 so far. Actually 99. But still!

The elite book

Before starting to learn I spent much time trying to find the best book to guide me through learning the language. After browsing through the surprisingly small amount of RoR books on amazon, I found that the best beginners book is one that goes by the name of “Agile Web Development with Rails”. It’s a bit of a mouthful for a book title, but it surely is a great book. It is very well written and easy to understand.

The book takes you through building a project that is an e-commerce site. I find this is the best way to learn a new language and is what I’ve done for almost every other programming language I’ve learnt. I would have preferred for it to be a more useful project, such as a blogging system or something else. But looking at it now, I can see that an e-commerce system probably contains lots of different concepts that you will learn.

I’ve included a direct link to the amazon page for the book on the right, so if you are thinking about buying this book, please follow the link below to help support the running of my blog!