06.07.09
Posted in Technical at 8:54 pm by Olrik
The past week or so, I have been playing around with the APIs of a site called RolePlayGateway through Python. This blog post will be all about those APIs and how to work with it using Python. In this blog post I am going to assume you have some coding knowledge, Python is not hard to understand so anyone with a decent coding background would be able to read the following example. Keep in mind I am not a genius and some of this code could probably have written in a better way. Feel free to show me how in the comments section!
The Experience
My experience with the API is great. I am working directly with the owner of the site, Eric Martindale, who is actively maintaining RolePlayGateway. Actually accessing and manipulating XML in python was easier then I thought it would be and bringing it into practice was a lot of fun. With a bit of creativity you can do a whole lot with the API of RolePlayGateway. In this blog post though, I will only be covering how to access the API through Python and working in the Python Interpreter.
The APIs
Of course, If you want to work with the APIs, you will have to know where to look. In my case (as stated above) I worked directly with Eric who told me about the APIs. The following APIs are available on the site:
Member Information:
/api/member/<name>
/api/member/<id>
Character Information:
/api/character/<id>
Through these APIs you can retrieve information and use that in your Python application.
Example Code
To retrieve the XML from the site I used a module called “urllib”. This module has to do with urls, but the only function we’ll be using is urllib.urlopen(url). Then we’ll need something to parse the XML, this is done using the module “xml.dom.minidom”. Below is a link to the code of the full example I will be using.
Full Example Code
If I would run this through the Python Interpreter I would get the following output.
As you can see in the example , Unicode / ASCII is a small issue you will have to keep in account. I found / edited a ‘translations’ module that I use to edit names from Unicode to ASCII as the URL will require ASCII but the actual site will show Unicode.
Conclusion
I really like the APIs that Eric showed me, and he keeps adding more / refining it actively. I personally am still working on an application with these APIs that might be considered useful by the community. I hope this article was of use to some of you, others might have just enjoyed the read and some might have even thought “Oookay?”, But I tell you, these APIs are great!
Regards,
Olrik
Permalink
05.21.09
Posted in Sailing, Trip May 2009 at 12:13 pm by Olrik
All the below times are in UTC+1
All miles are seamiles
A knot is about 1853 Meters/Hour
Today I woke up at 8 AM. I had the alarm clock from my dad as we planned to leave him to sleep as my uncle and me started the boat to sail to Aroeskoblyst. I had quite a bad night sleep as last night there was quite a harsh storm. I had gotten up at midnight because I had this suspicion that something as leaking into the boat. When I felt a drop of water on my hair (from my own window that was dripping condense) I went out of my cabin and found that the window above the navigation table was not closed properly and water was getting in. All the maps on the navigation table were wet and this little book with information about all the docks in the surrounding area got wet too. I was happy that I was there in time before the whole table was drowned out. I cleaned up the water and put a towel on the maps and book to let it dry. No permanent damage was done, so I was there on time.
Perhaps you’ve already looked at the pictures and thought what we were doing with our hats on etc.. Well. Lets just say that having a burnt face and ears, then sitting in the sun kind of felt like a bad idea. So to keep further pain from ourselves we decided to pack ourselves in firmly and do what the nomads do in the Sahara, overdress to keep the coolness in. (or so I have been told, anyway). I must say it did some remarkable work though as I have not gotten any more burns and it wasn’t even that bad being tucked away in 6 layers of clothes. That’s right, I had jogging leggings, jeans, a t-shirt, a long sleeved t-shirt, a sweater and a gaastra jacket. It was quite comfortable actually.
The first half way towards Aroeskoblyst I read the rest of my book "The Light Fantastic" by Terry Prachett (if you like fantasy books and want a couple of novels to read, I’d recommend the "Diskworld Novels by Terry Prachett"). A great novel I’ll give you that. Sadly though I finished it and I didn’t have the sequels to the book with me, so I was left without reading material and it was beautiful weather to read, or of course, to take a nap. Which is what I did the other half of the trip to Arousboblyst, heh. My uncle and dad just woke me up when we were approaching the dock as they needed my assistance with lowering the sails and docking the boat. We then went into town to get some nice pictures.
We actually went into town with the thought not to find any restaurants so we already braced ourselves to have to eat some soup that night (while we had been eating like royals before in restaurants). First we saw the spectacle of the day. A ferry ship coming in to dock in Aroeskoblyst. It was actually quite a sight and I took a sort of slideshow-ish stream of pictures that turned out to be quite OK. After that we took a small walk into town and to our amazement saw a sign with "HOTEL" on it with a menu hanging outside. We looked on the menu and saw it was quite good so instead of soup we ended up with a three course menu.
We started off with Coliflower soup with white fish, it’s probably one of the better soups I’ve eaten. Then, as a main course, we had ducks breast with ‘paté de foi gras’, potatoes and a delicious butter gravy. At this point all three of us agreed that this had been a) Way better then the soup as we thought we’d be having that night and b) the best restaurant we have eaten this week, which will most likely not change. Then for dessert we had some concentrated cinnamon-ish drink with whipped cream in a really small glass with a small cake that tasted a little bitter and some really good vanilla ice cream. After we left that restaurant all 3 of us were stuffed and went back to the boat for my uncle and dad to enjoy a good game of "Genius" and for me to write this post.
Sadly, I have yet again found a hotspot that requires me to pay a stupid amount of money for it.
Regards,
Olrik
Permalink
Posted in Sailing, Trip May 2009 at 12:04 pm by Olrik
All the below times are in UTC+1
All miles are seamiles
A knot is about 1853 Meters/Hour
Today we woke up early, around 7:15 AM. We had a long journey ahead of us. We had to sail 45 miles from Berjning to Assens, thus far the farthest we have done. We sailed out at around 9:30 AM, after breakfast. We were determined to reach Assens. The first part of the journey we didn’t have favorable winds so we had to use the motor to get around. Right about the time we reached Middelfart (A town we visited earlier) at which point we could raise the sails and get some action going.
About half way there we saw something VERY cool! We saw some dolphins! Actual dolphins! For the first 5 minutes I was stunned to what I actually saw, then ran for my camera and got some very cool shots! Sadly, I did not manage to get a shot of when they surfaced, but the pictures of them are very bright and you can see them in the water. They swam along with us for about half an hour at which point they disappeared, probably to return ‘home’. Scroll down to the bottom of this post for a link to the pictures.
When we reached Assens we first had to buy a ticket to stay in the dock, so my uncle and dad sent me back to the boat to attach this sticker to the boat to let the dock master know that we paid. While they sent me back, they took off to buy an ice cream and when I returned my dad told me this guy behind the counter spoke English and that I would be able to get the ice cream myself without using German or Danish. Well.. lets just say he could use a crash course English before going to the UK. My dad was constantly laughing of course seeing as he tricked me to believe this guy spoke proper English. It was quite an adventure picking the flavors for my ice cream, heh.
After all this, we had to do some shopping. We had been on the water with considerably good weather (which we never expected) and we hadn’t been using sun cream. My dad had already turned towards the color of a lobster and my uncle wasn’t far behind. Me being lazy with my book was only half that color and only really burnt my nose and forehead somewhat. So off to find us some sun cream and food for the next morning. To our surprise though, according to the first shop we found, we were ‘too early’. They didn’t have any sun cream in stock because the right season hadn’t started yet. We were quite amazed. Luckily the second store that was not even 50 feet away did have sun cream. When my dad and uncle wanted to smear it over their face though, they turned out to be as white as the face of a clown, it was quite hilarious. I think I got one picture where you can still vaguely see that they had a too thick layer of sun cream smeared on.
In the evening we found this Mexican restaurant where we had a nice decent meal. Some stuff was quite spicy, especially the pepper steak that my dad ate but the "Pollo el Diablo" (Spicy Chicken) could’ve been spicier. I guess my appetizer was kind of hot and took some of the spice away. It was a good meal nonetheless.
And again, no hotspots to be found anywhere.. and if I can find them, they are paid or faaaar away from the boat. So I am still writing ahead in my Notepad++ to keep it as much plain text as I can. Too much of a pain to copy all the formatting from word over to my blog.
Regards,
Olrik
Permalink
Posted in Uncategorized at 11:07 am by Olrik
All the below times are in UTC+1
All miles are seamiles
A knot is about 1853 Meters/Hour
Today I woke up at about 9 AM. Quite late considering we planned to leave early every day. My uncle and dad had already done some groceries and woke me up for breakfast. After breakfast we went to plan the route for today. We started off with wanting to sail to Faaborg, but that was around 43 miles away which was even more then the first day and this time we’d have to push up against the tide AND the wind. After some discussing we decided to go to Berjning, more to the north and we left at 10 AM. All the way to Berjning it was along with the tide and a decent wind force 4. We had some beautiful weather all day long, and I think I even burnt myself in the sun (The sun and water are very treacherous together).
We arrived around 5 PM in Berjning where we had a blast docking the boat. The dock was so that there was a round wooden place for all the guest boats to dock. Fortunately, it was Monday and there were almost no people sailing which meant we had all of the space for ourselves. We did get the boat in it’s spot after about 15 minutes of pushing, pulling, putting more lines to poles. I am quite satisfied.
I got to do a lot of fun stuff today, I actually steered the boat for a while which was rather cool! But I must say… It is SO much harder then steering in an automobile! A boat constantly fluctuates on the water and there is no "Straight Ahead". You have to make the "Straight Ahead"! I have learned even more things regarding sailing and I’m liking it more and more.
When we arrived at Berjning my uncle took care of the business with the dock master while my dad and me took care of the last few thing on the boat. We already decided we wanted to go into Berjning and see if there was anything cool to see. There was only one problem. The town was at about a kilometer distance from the docks so we had to bike there. Now, this wouldn’t be such a big deal if Denmark would be flat (like The Netherlands). But in fact, it had some steep hills that we had to climb. This also would have been not much of a big deal if we had some proper bikes, but if you take a look at the pictures (Included at the bottom of the post) then you’ll realize that we only had some very old bikes that nearly collapsed! All of that didn’t make it any less fun going DOWN those hills with blazing speeds!
We ate at a restaurant at the docks again and we think that so far we’ve been finding the best restaurants in the towns we’ve visited. So far I am enjoying every single bit of my holiday.
Regards,
Olrik
Permalink
05.18.09
Posted in Sailing, Trip May 2009 at 10:33 pm by Olrik
All the below times are in UTC+1
All miles are sea miles
A knot is about 1853 Meters/Hour
I woke up today at around 8 AM, which is surprisingly early for me considering I usually got out of bed in the afternoons. I hadn’t slept bad, but it was nowhere near as comfortable as home. We had some breakfast and left for Middelfart, which was a planned journey of 38 miles. We knew it would be rough weather but we were determined to go sailing that day. The first 8 mile or so we motored away from the docks and saw a part of the European tournament for tiny sailing boats (I think they were called "Optimisms", or so I understood). When we got away from the docks and European tournament we raised the main and front sail, going at speeds of 8-10 knots. We had great fun with these speeds, and the weather wasn’t that bad considering they predicted heavy rain. My dad and uncle learned me a few knots I have to remember for when we will be docking the boat, it didn’t take me that long to get the hang of them. I really hope that I will still be able to do them in the morning.
We arrived in Middelfart around 17:00. After docking we went to look for a place to grab a drink. Not too far from the docks we found a little café called "Café Razz" so we went inside and my uncle went to order a few drinks. Now he did one of the two most awesome things there. He ordered rosé and white wine for them and ordered a BIG fanta for me. Now, I think he didn’t realize what they thought was a ‘big’ fanta, but I literally got a glass the size of my hand! It was amazing how big that thing was. After being there for like half an hour we thought it was a good time to find ourselves a nice restaurant to eat. We already saw a restaurant in the dock, but we were sure there were some nice places in Middelfart, but apparently we were wrong or just couldn’t find them. We went back to the restaurant at the dock called "Hansen" and it turned out to be an EXELENT place where the food was delicious! (If anyone goes to Middelfart, Denmark; I really would recommend the place)
When we were done with the main course my uncle wanted to go for a walk, and when he came back he had a bag of lickerish with him. And the next thing that happened was the second of two awesome things my uncle did. He went to sit down, said: "I got some lickerish for tonight on the boat!". And while he sat down while trying to open it, we heard a loud "POOF!" and some rattling of lickerish on the floor. The whole restaurant was looking where this sound was coming from and there we were, all 3 laughing so hard we got pains in our stomach from laughing! I think we ended up laughing uncontrollably for about 10-15 minutes.
Sadly, I haven’t been able to find any hotspots yet where I can sit down and actually post the stuff I am writing, but I am going to write every day to keep up with the things that happened. I really hope that the pictures on the boat turned out good. I tried to take some pictures of the angle the boat was sailing in, but I think that’s only clear in 1 picture. I hope I will be sleeping a tiny bit better tonight, but I think the first night was a lot of getting used to! I must say though, sleeping on one pillow instead of two really does make a difference to comfort but we just didn’t have the space to bring along 2 pillows. I did however completely unpack my bag and made my own cabin a nice place to be able to retreat to should I need it. Everything is nicely hidden in small closets so that I have the most room available for myself, I tell you, those cabins are not the biggest things around but it’s more then enough for little me during sleepy times.
Regards,
Olrik
Permalink
Posted in Sailing, Trip May 2009 at 10:27 pm by Olrik
All the below times are in UTC+1
All miles are sea miles
A knot is about 1853 Meters/Hour
We planned to leave home at around 10:00. Fortunately enough, we left at 9:30. It was quite a drive from the Netherlands to Denmark. Our destination, Aabenraa. When we just drove into Germany we found a road café with some truckers and scored ourselves something to eat. I must say, they make great eggs with ham there, the food was great and there weren’t too cheap on the drinks either. We then decided we’d be driving the rest in one go. I think the planned time was around 8 hours of driving, but we had the unfortunate luck that there was a big soccer game at Hamburg, so there were a lot of traffic jams. We read on one of the signs that the traffic jam was about 10 kilometers long, so we tried to ‘cut off’ the jam by going into Hamburg. At first we lost track of where we were supposed to go and saw more of Hamburg then we initially planned, heh, but found the right track. When we finally hit the highway again, there was almost nobody there which was pleasant for our traveling times.
When finally arrived at Aabenraa we went off to find our contact for the boat. Due to the traffic jam at Hamburg, we were a little late so we came a little unexpected, or should I say, unpredicted. While the contact explained more about the workings of the boat (which my uncle already knew as he owned a boat just like this one) my dad and me went to get our luggage from the car. We didn’t have a lot of luggage so the unpacking didn’t take that long.
We have 3 cabins on the boat, each designed to be for one person but I really doubt if that would be really comfortable. My first night on the boat was a little getting used to. Obviously it isn’t like sleeping in your own bed and instead of an actual bed we have sleeping bags. It really was a little uneasy trying to turn around and give my legs some space while I was in the sleeping bag, it was nothing like I was used to. But nonetheless I slept better then I expected I would sleep. I had my own pillow so that was a big comfort although it didn’t feel exactly the same.
Today we are actually going to sail and I am really looking forward to it. I’ve already been told I get to do all the ‘fun’ jobs, heh. One thing is certain, we are going to sail all day long. After breakfast we will be leaving around 10:00.
Regards,
Olrik
Permalink
05.13.09
Posted in College, Personal at 12:11 am by Olrik
Tomorrow before 12:00 UTC+1 I will be actually receiving my Diploma!! I am so happy I finally got it. It took the school almost one and a half months to ‘make’ the diploma and notify me that it was actually there. I am really glad I am finally though this school as I didn’t really learn a lot there. Non the less, I needed the paper and that’s what I have now. I am so exited I am going to show it to a lot of people tomorrow, they better be prepared for a little bragging session!
Regards
Olrik
Permalink
05.04.09
Posted in Technical at 9:06 pm by Olrik
It’s been a while since I last wrote about something Technical, so it’s about time that I wrote another article more aimed towards the technical side of things. As many of you will know, I am developing a tool. At times I have wanted to show some people bits of my code without them seeing the whole thing. In those cases, I would have to copy the bit of code, save it to a text file and send the text file to them. If they would then edit certain bits I wasn’t sure what was edited, it required lots of effort. Now the other day, I got invited to something I found really handy. It’s called “EtherPad”.
EtherPad is a ‘live’ (online) notebook (or notepad) that offers real-time collaboration. Multiple people can work on the same text simultaneously which it really attractive to me as a developer when I want to show other people bits of code without revealing all of my source code. The best part of it all. It’s FREE! You can find this amazing service at http://etherpad.com/ .
Regards,
Olrik
Permalink
04.06.09
Posted in Personal at 7:53 am by Olrik
For some that may not know, I am doing my driving lessons! Today is my tenth lesson which is the mid-term test, which involves me driving to the next town with a navigations system. I’m quite excited but I really hope I will do good! Another one of my driver instructor’s pupils told me that he was dead serious while normally he’s a lot of fun!! Oh I just can’t wait to get back in that car and do my best to pass that mid-term test! Well.. that’s the blog post for now, I’ve been really busy with working on Geeks to Go!’s Tech Academy. Another blog post will come soon!
Regards,
Olrik
Permalink
03.20.09
Posted in College, Personal at 3:00 pm by Olrik
Yaaaaaaay, Today I went into college to let my work get checked and I am not almost done! I had my test setup checked, gave in the documents and now I have to talk with them about my documents next week on Friday (27-03-2009). It feels so good to know that I am as good as done, it gives a lot of reassurance. I found it awesome that when my teachers checked my work they said: “Your skill level is way higher then we suspected. This work is a lot higher then the requirements. I see we’re working with a real ICT admirer here.”. I feel like I’m on top of the world right now!
After next Friday I will have a vacation period of about 4-5 months, oh how sweet that is going to be! I already know what I am going to do. Work at Geeks to Go! to reach malware staff, and with it ‘dual status’. I am going to help my dad clean his house, as at this time it’s a real men’s home, hehe. And finally I am going to Primary Schools to teach young kids about the Internet. How it can be great, but also really dangerous if you’re not careful. I am so looking forward to next Friday and receiving my Diploma!
Regards,
Olrik
Permalink
« Previous entries