Home
Nick [entries|archive|friends|userinfo]
Nick

[ website | gagravarr.org ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Fedora + mplayer being unhelpful [May. 17th, 2008|07:49 pm]
I've been having trouble lately with playing DVDs on my laptop, which runs Fedora Core 8. No matter if I tried mplayer, xine or vlc, I got the same errors in dmesg when trying to play video DVDs:
Buffer I/O error on device sr0, logical block 321
Buffer I/O error on device sr0, logical block 322
Buffer I/O error on device sr0, logical block 323
Buffer I/O error on device sr0, logical block 324
Buffer I/O error on device sr0, logical block 325
Buffer I/O error on device sr0, logical block 326
end_request: I/O error, dev sr0, sector 1464
end_request: I/O error, dev sr0, sector 25376
end_request: I/O error, dev sr0, sector 25416
end_request: I/O error, dev sr0, sector 25460
end_request: I/O error, dev sr0, sector 155408
I checked, and all the software I ought to need was installed, and all the rpm dependencies were present and satisfied. So, I thought it might be a hardware problem, maybe with DMA, as did google searches. Cue lots of prodding of libata options, different kernels etc. Didn't help.

Eventually though, I stumbled upon the answer. On Fedora, installing libdvdread isn't enough. If libdvdcss isn't installed, then it'll silently carry on without it, and access to css protected bits of the disk will fail with drive errors. No warnings, no messages, no dependency checks at install. Just cryptic failures that make you think there's a low level problem.

Doing a "yum install libdvdcss" fixes the problem nicely. Quite why it couldn't give me a nice friendly message to tell me to do that I don't know, or even just have it as a dependency. Bah :(
link1 comment|post comment

NMEA Info and Symbian Open Signed Online [May. 4th, 2008|05:31 pm]
Previously, if you wanted to do anything interesting with your series 60 v3 phone, you had to get a DevCert. This allowed you to sign your own apps to do useful things. However, it was quite a faff to get one, and symbian seemed to get in a miff when all the Open Source developers started telling their users to get them.

So, they came up with a new thing, Symbian Signed Online. Using this, you can upload a .sis file, tell them your IMEI, and get the sis file signed for use on just your phone. Sounds like a good idea, but they have as usual managed to make a meal of it all the same...

Aside from the pointless and irritating restrictions on how often you can upload files for signing, how long you have to wait, captcas and what not, they also decided to come up with an entirely new UID range for this. All sis files to be signed through the program must have a UID in this range, or the signing tool will reject it, and no existing sis files had them.

This means that everyone who writes open source code needs to go and re-package all their applications, to have another version with a UID in the test range. Also, for any apps you use which haven't been updated, you need to manually hack them onto a new UID first.


You can now download open signed friendly .sis files for NMEA_Info.py and s60_as_bt_gps.py from the usual place. Direct links are nmea_info_v3_028_opensign.sis and s60_as_bt_gps_v3_002_opensigned.sis.

I've also re-packaged LocationRequestor, to have a UID in the test range. You can download the .sis file from
http://gagravarr.org/code/locationrequestor_3rd_opensign.sis, and then sling it at open signed online to get it signed.

Finally, if you want to sign the python scripting shell, then they do have a version with the testing UID. You can get it from here.
linkpost comment

Turn your N95 into a Bluetooth GPS [Dec. 3rd, 2007|10:59 pm]
This might seem like quite a crazy idea. Why would you want to turn you expensive Nokia N95 (or other internal gps enabled S60 phone) into a bluetooth gps, when a bluetooth gps only costs 30 odd quid? Well, my main reason is that I always have my phone on me, and often forget my bluetooth gps, so if I needed a BT gps (eg for some external navigation tool), then having my N95 wouldn't be enough.

So, I've written a pretty nifty python script to turn my N95 into a bluetooth GPS. It's powered by LocationRequester (.sis file for Python 1.4.x), so annoyingly you'll have to devcert sign everything (if you spot someone who works for symbian, please hit them with a clue bat).

The script itself is fairly simple. It starts up, connects to the location service, and starts trying to get a fix. From the menu, you can choose to either connect out to another bluetooth device, or accept an inbound connection over bluetooth. Either way, once you have an active bluetooth connection, it builds up NMEA sentences from the location data it receives, and streams them out over bluetooth.

So far, I have only tested it with nmea_info.py on the other end, but that does work just great. If your app doesn't work, then let me know what NMEA sentences it likes, and I'll add them in (since I have to build them by hand, I only went for the more common ones). Admitedly it is a little pointless to have my N95 running this code, then my 6630 running nmea_info connecting to it, but hey :)

You can download the code, and a sis file ready for devcert signing, from http://gagravarr.org/code/#s60_as_bt_gps. You'll need S60 Python 1.4.x, and a devcert signed copy of LocationRequestor. You'll also either need to devcert sign the s60_as_bt_gps sis file, or install s60_at_bt_gps.py and ensure that your python scripting shell is devcert signed.
link27 comments|post comment

nmea_info.py update [Dec. 3rd, 2007|10:24 pm]
I've been doing a little bit of work on nmea_info.py of late, but not much to show of it. I'm trying to make it work with the new positioning module that was introduced with S60 Python 1.4.0, but keep finding bugs in it. So, for now, you'll still need to use LocationRequestor if you want to make use of a built in GPS, but hopefully in a couple of months we can drop that requirement. For now, I've released v027 with the code in there, but disabled, in case anyone wants to see how it'll work in future. Oh, and there are a couple of other little bug fixes in there too.

Speaking of LocationRequestor, some people have been having issues with the download links not always working. If you want the version for Python 1.4.x, then the current direct download link is http://usa.dpeddi.com/locationrequestor_3rd_unsigned.sis

Also, a quick reminder on code signing for 3rd edition phones - S60 Python 1.4.x is signed with full permissions now, but that doesn't help all that much when using 3rd party code. You'll still need to get a devcert for your phone if you want to much of interest (eg access the internal GPS). Once you have your devcert, you need to sign (with the full permissions set) the LocationRequestor sis file, the S60 Python Scripting Shell (you need the _unsigned_freedevcert version), and the nmea_info sis file. Joy....
linkpost comment

Working around a compile time change at runtime, aka how to run programs compiled against FAAD2.0 wi [Sep. 15th, 2007|07:17 pm]
As many of you will know, FAAD2 is part of the FAAC project. It allows you to decode/play mpeg 4 audio (mp4) files, and its library is used by a great many open source media players.

Between FAAD2.0 and FAAD2.5, there were a few API changes made. The most common changes were to rename a bunch of the functions. In order to avoid problems for older programs, they provided compile time compatibility for these changes. So, if you compiled a program written for FAAD2.0 against the new 2.5 library and headers, everything would be fine.

The snag is that if you tried to run a program compiled against FAAD2.0 on a system with FAAD2.5, it wouldn't work. Your program would try to load symbols that had been renamed, and you'll get errors like symbol lookup error: mplayer: undefined symbol: faacDecOpen

The normal suggestion at this point would be to re-compile your programs against the new version. The snag is that most of my media programs come pre-build as rpms, from various repositories. Annoyingly, quite a few of these repositories aren't upgrading to FAAD2.5, because they're being a bit funny about the licence. So, my rpms of things like mplayer and xine are build against FAAD2.0, and this shows no sign of changing. However, I do need FAAD2.5, so that I can play my iTunes Plus files in xmms, which leaves me in a bit of a spot.


So, I decided to write a pre-load library to introduce the compatibility for the API changes at run time, rather than at compile time. Once I'd written this, I'd be able to use all my pre-build media players with the newer FAAD2 libraries, just by pre-loading another library.

What may surprise people is just how easy a prospect this is. You basically just need to clone the header file, make a few tweaks, and add in the stub calls. So, first up, we need to find the faad2 header file with all the definitions in it. This turns out not to be faad.h, but neaacdec.h

Armed with this file, we can start building our shim. In the middle are a whole bunch of #defines. These, at compile time, rename the calls in your program from the old function names to the new ones. We need to replace those #defines with a definition, and some code to call the new ones.

So, for each #define in turn, see what the new function name is (that's on the right). Then, copy and paste in the definition for that function below the #define. Then, in place of the #define, put in a definition of the old function with the same arguments as the new one. Finally, turn that definition into a call to the new one.

Let's look at a fairly simple example:
#define faacDecPostSeekReset           NeAACDecPostSeekReset
....
void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);

This becomes:
void faacDecPostSeekReset(NeAACDecHandle hDecoder, long frame) {
    return NeAACDecPostSeekReset(hDecoder,frame); }
void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);

After you've done this for each of the #defines, we now have a function with the old name, which calls the new function name with its arguments, and a definition of the new function.

We're now in a position to compile this. We can't just include the new header file, as the #defines in there will rename our functions with the old name to the new one, and we'd be no better off! That's why we had to keep in the definitions of the new function names, as we won't have the header included. To compile, we need to tell gcc to link against the new faad2, and to build it as a shared library:
gcc -Wall -O2 -fpic -shared -ldl -o faad-shim.so faad-shim.c -lfaad

Finally, we can run our old program, loading in our shim to provide the functions that've been renamed:
LD_PRELOAD=/usr/local/lib/faad-shim.so mplayer MyMusic.mp4

To save you time, the shim is available to download from http://gagravarr.org/code/faad-shim.c. Just download, compile, install and pre-load. The above method ought to work for other similar situations too.
linkpost comment

Venice [Sep. 13th, 2007|10:36 pm]

We got into Venice about 20 minutes late, just after 2pm. Our hotel had been selected for its proximity to the station, so we were soon ready to head off for another wander around Venice.

It was too late to do anything touristy - the queues everywhere would've been huge. Instead, we jumped on the #1 water taxi towards St Mark's Square and the Lido, and got off at the last stop before the Lido. This left us at almost the south eastern corner of the city, S. Elena.

Our plan was to see much of the east and north of the city, and stay off the tourist routes. We enjoyed a quiet stroll through S. Elena (which felt very unlike the rest of Venice), the crossed over just north of the Giardini Pubblici. Sticking to back streets, it was up to S. Pietro. Here we located a very nice church with garden in front of it, and chilled for a little bit. It's quite Venitian, but quiet, shame it's such a long way to get too... Then it was a wander through the backstreets to Via Garibaldi, a large street in the east of the city from where a canal was filled in. Dodging tourists, we nipped up to the entrance to the Arsenale. This was still a little busy, but worth putting up with for the impressive buildings.

After a quick beer in a bar overlooking the Arsenale entrance, we pushed on. Sticking mostly to the quieter routes, we wandered up towards the north of the island, enjoying the interesting buildings (if you have the time, Venice is a wonderful city to just wander about in). Eventually we re-joined the tourists, and took the Rialto Bridge over the Grand Canal, onto San Polo. We found a nice cheap pizza place, had a good meal, then wandered back to the hotel and fell asleep....

On Monday, we were up early, and had made it to St Mark's Square before 9am. This allowed us to get up Campanile and take in the views, all before half 9. It was a great time to be up there, while everything was bright, but before it got too hot or cloudy. After decending, we joined the St Mark's Basilica queue just before it opened. In the end, we didn't have to wait too long, and were fairly soon inside. Despite the crowds inside, it is an amazing building to see inside, and worth the queues. Just make sure you take the time to keep looking up, as the ceiling's half of what you're there to see!

Ca RezzonicoWe'd intended to see some art, but hadn't factored on how many galleries were closed / half day on a Monday. By the time we'd had a coffee, it was looking very unlikely that we'd get into any of the big name ones. So, we flipped through our Rough Guide, and discovered Ca Rezzonico. This museum is set in an old Grand Canal palace, and has been around for nearly 70 years. The first floor features fittings, furnishings and frescos from the 18th century, and give a fair idea of what the place would've looked like then. The top two floors are filled with Venitian art, especially 17-19th century. They cover a huge range of art, and we found those paintings of how Venice used to be of particular interest. Given the range of things it has, and how relatively quiet it was, it's certainly one to visit. Oh, and there's a cheap Gondolier that takes you across the Grand Canal just by it, so it's easy to get to from San Marco.

With our fill of art for the day, we grabbed a spot of lunch near the University. Fed and watered, we decided to find a park. Unfortunately, the guide book lied, and almost all of the parks it showed on its map either didn't exist, or were private :( So, we got to walk all the way to the bottom of Dorsoduro, along to the port, through the back streets, and out to the south west corner. Failing to find a nice park, we opted to sit in a cafe for a bit, and chill. After we'd drunk all the lemonade we could handle, we decided to pop round the corner to the oldest church in Venice, S. Nicolo Del Mondicoli. This would've been a massive walk, had we not already been out that end of the island, so it was very quiet. The inside was good, and worth seeing if you're near, but probably not worth a huge walk to. Finally, we headed back to the station, did some shopping, and got our train. Probably our only complaint was that the maps in the Rough Guide get progressively less accurate the further off the beaten track you go (and hence the more you need them...), so we did end up with a few doublings back, and discovering things not where the map claimed them to be :(

On Tuesday morning, we arrived into Paris about on time, at about half 8. As we had over 2 hours until checkin closed on our Eurostar, and Ollie had never seen the Eifel Tower, we decided to head out to see it. A quick metro ride, and a slightly longer RER ride, and we were there. Unfortunately, we only had time to see it for 10 minutes, before heading back, so we couldn't walk Champ De Mars, just see it from near the base.

After a couple of RER rides more, we were at Gare Du Nord. In no time, we were speeding across France and then Kent, and back into Waterloo. Holiday over, but a great time had been had by all. Next stop, Brussels, Berlin and Prague, probably close to Easter :)
linkpost comment

[LJ2ME] Ljubljana [Sep. 9th, 2007|09:36 am]
We're now on the train back to Venice, having spent a great few days in Ljubljana. The sun is shining, and it ought to be a nice day to wander around, once we get in.

On our first night in Ljubljana, we made it to the hostel fairly easily. It was just as cool and colourful as we'd expected from the guide books. We were quickly joined by a couple of OSMers, so cheap cocktails and nice Slovenian food followed. Bryan managed to buy a round of dinner, it was so cheap!

It was a great evening, with much talking of geekery. We were also given lots of tips on where to go the next day. With nice cheap beer to, we enjoyed ourselves.

Friday dawned bright, which was a slight faff as our top floor room lacked any curtains. It was a little bit overcast when we set off, but a perfect temperature for walking around the city. Our first port of call were the central bridges - The Dragon Bridge, with its impressive green-copper dragon statues on each edge, and the Three Bridges, now car free. The latter wasn't quite as impressive as I'd expected, but it did look good all lit up later that night.

Our walk up to the castle was interrupted by a free modern sculpture exhibition in the town hall. The building itself is worth a visit, and we enjoyed a good many of the sculptures. Shame all the information was only in Slovene, so we were left guessing for a few of them...

The castle sits on a hill overlooking the town, in the middle of a steep curve in the river. It's a surprisingly long walk up, most of it through forrest, so Bryan and I were put in mind of Montreal. Our path up brought us out near the entrance, and we were soon inside (no charge for anything except the Tower +Museum). There were some nice views from the battlements, as we were at least two church spires up. We then opted for the tower.

The tower rises out of one corner of the castle, and climbs up quite a distance. You can see it from much of the town. We got there just before a showing of a 3d film on Ljubljana (included in the ticket). This was interesting and visually impressive, though never quite covered things in the detail we were interested in. After the film, we climbed up to the top, and drank in the views. We could see all of the city, the surrounding green hills, and on to the mountains of the alps. It's certainly a must-see.

After a spot of lunch in a riverside cafe, we visited the Cathedral. Initially, we thought it had to be closed (despite being within opening hours), but we eventually discovered an unlocke door and headed in. There were several others inside, so we came to the conclusion that they didn't go in for open doors, or other similar welcoming signs. It was visually impressive, so we planned to visit a few more.

After popping into Sokol (a bar/restaurant noted for it's meaty Slovenian cuisine) for coffee and free wifi, we headed across Kongresni Trg to the Ursuline Church of the Holy Trinity. This had a stunning, not very church like front, and an interior that used the light stone very well. The alter looked particually good, against it's plain backdrop.

After a few more squares and gardens, we got to the Serbian church. This is small but tall, and every space inside is covered in frescos. Quite different to the other two, but worth a look.

Finally, we tried to see the modern art gallery, bu it closed earlier than our guidebook said (6pm not 8pm). So, we wandered a scenic route back to the hostel.

Yesterday was the OSM mapping party. This went well, with 8 participants, and we got a fair bit more of the city done, but that's a post for OpenGeoData! We spent the evening having nice beer, and chatting :)

Now, we're enjoying the sights as we travel across the country by train, and very rarely getting a gps fix :/
linkpost comment

[LJ2ME] Hurtling Across Italy [Sep. 6th, 2007|03:35 pm]
Our Eurostar journey got us into Paris for just gone five, after a fast dash across Kent and northern France. They even had nice tea.

With about 3 hours to kill, we headed to Cite. After a brief wander, a cafe beaconed, and we enjoyed a beer looking at Notre Dame. It took us a little while to find Gare de Bercy on the map, but once we did, the metro seemed a sensible call.

We got there in plenty of time, but the departure board informed us (in French) that there'd probably be no restaurant on that nights train. So, we headed back to the road, and spied a general store tucked away up the pedestrian street that runs from by the station steps. We popped in, and bought sandwiches, crisps and beer :)

We had a 4 berth room, which was a 6 seater until the top bunks folded out. This proved a very nice setting for food, beer, cards and planning.

After a night where many but not all slept well, we got into Venice at half 9. It took a little while to collect the next tickets and drop off bags, but by half 10 we were having breakfast in a secluded cafe.

In the end, we spent the whole time just wandering around the city. Off the main few tourist routes, it's just wonderful to meander through. We also identified things to do on the return (when we'll have more time). All was good, even the weather was stunning until just before we left.

Right now, we're on a very shiny and new train, zooming across Italy. The views are often great, and the seats really comfy. Our only complaint is that the windows don't play nicely with our gps's :(
linkpost comment

[LJ2ME] Slovenia Bound [Sep. 5th, 2007|11:48 am]
I'm currently on a train to Paddington, and tfl permitting, we'll be at Waterloo in an hour. Paris for dinner, Venice for breakfast, and Ljubljana for tomorrow evening.

Should be a good trip :)
linkpost comment

Final day at the Fringe [Aug. 14th, 2007|03:31 pm]
We weren't sure exactly what time we'd get in this morning, so we hadn't booked anything too early. In the end, we did get in before half 9, so we opted for Beethoven For Breakfast. Unfortunately, so had everyone else it seemed, and it'd sold out. Must've been a good concert :/

Instead, we wandered over to C, and saw Shakespeare For Breakfast (free coffee and croissant). We'd seem their show last year, so had a fair idea of what to expect. Lots of sillyness involving Shakespearian characters, with as many lines from the plays included as possible. On the whole, it worked pretty well, and was good fun (if slightly forgettable). It's also probably the best play on before about half 11! 3.5 stars

There wasn't quite time to fit another show in, and we couldn't see anything worth sprinting about for, so we opted for a museum instead. The Museum of Scotland is handily placed on George IV Bridge, just round from C, so we headed there. The building itself is worth a see if nothing else, and it has loads of exhibits. We spent most of our time in the history of science section, which was on the whole pretty good, though it probably could've used a few more over-arching descriptions of the exhibit cases, to better put them in context. Plenty of interest to see, and it's free :)

For our final show of the fringe, it was Someone To Watch Over Me. Another dark and minimalist play, this time covering 3 western hostages in Lebanon in the 80s. It was a very powerful and touching performance, and featured more humour than you might expect, as the captives attempted to keep their spirits up. 4.5 stars
linkpost comment

[LJ2ME] Fringe Day 3 part 2 [Aug. 14th, 2007|08:38 am]
After a nice lunch, we just missed a show at Underbelly (it was too late by the time we'd decided). So, we headed to the Spiegel Garden, sat around and chilled.

Next up, it was the excellent Punt and Dennis. We'd already seen a bit of them on the Early Edition, and they were even better on their own show. It was a hilarious mix of political jokes, little skits, mimes and raptors. We laughed throughout, and had a great time. 4.5 stars

With another gap not ideal for a show, we opted for nice tapas in a place just off the royal mile. Then, it was time to head up to C Too, for the musical Sweeny Todd. This Sondheim piece has a great score, and the cast did it well. I hadn't been to sure how the story would work, but it did progress and flow nicely, with enough material to fill. 4 star

Unfortunately, it finished a few minutes late, so we had to sprint down to the next show. This was The London Underground Song, by one half of Amateur Transplants. There were quite a few new short songs, and many of the old favourites. Lots of black humour in the songs, lots of laughs at things you perhaps shouldn't be laughing about, but do all the same! Our only complaint was that the gig was too short. 4 stars
linkpost comment

[LJ2ME] Free Wireless [Aug. 13th, 2007|03:04 pm]
Now I have a wifi enabled mobile, I've been looking out for free wireless around the festival. Mostly this has been to allow us to look up reviews on Three Weeks and Edfringe, neither of whom have mobile data package friendly sites.

Pleasingly, there is a fair bit of free wifi about. We found a couple of coffee shops on south bridge, one of which even had a sign in the window. The Spiegel Garden (just south of the pleasance) has it throughout, which is where we are now. None of the C venues seem to :(

The underbelly has two different networks. One covers the box office (and press office), which is very handy for checking revues before you book. The bar, which has no mobile signal strength, has another, which works very well. I was even able to use Truphone from it, very nicely, to save me having to walk all the way up and out to place a call :)

All in all, it does prove to be a good festival for free wireless. No Fon though.
linkpost comment

[LJ2ME] Fringe Day 3 [Aug. 13th, 2007|02:57 pm]
Today, we started with The Truman Capote Talk Show. This was a bio monolouge, about an interesting and varied life. It was a gripping production, always keeping you interested. It reminded us of the Robert Maxwell play last year, and was certainly in a similar style. 4 stars

Then, we had much fun with train tickets, which remains unresolved. It looks like Alex is going to be leaving the day after us after all :(

Three more shows today, then a few more tomorrow, all being well.
linkpost comment

[LJ2ME] Yet more at the fringe [Aug. 13th, 2007|10:37 am]
Yesterday, we managed a new record for us of 7 shows, so a couple more reviews to go!

Starting our evening's comedy, we saw News Revue. As expected, it was a mix of songs, sketches and witty one liners. I'd say that pretty much every one worked, and most were excellent. The mix between the styles was good, and there were a fair number of skits that made you both think a laugh. Shame the venue was so hot... 4 stars

Finally, we decided on a spot of late night stand up, in the form of Political Animal. Pity we didn't remember how bad the last thing like this was. This one was bad bad bad. Andy Zoltsman was the compare, and was pretty good, but occasionally got a bit lost. The first act was rambling, a bit ranty, and not funny for enough of the time. The second guy was so shockingly bad it defies description. He wasn't funny. He ranted and depressed, incoherently. Just shockingly bad. Then we had some young guy who was ok, but no political content to the routine. Finally, an american came on who was ok, but over a third of his material was years old, and not as good as the likes of the now show on the same topics. All in all, a huge disappointment. 1.5 stars
linkpost comment

[LJ2ME] More of Fringe Day Two [Aug. 13th, 2007|10:32 am]
[mood |Thoughtful]

Our 2nd day continues with with another powerful show. On Wonderland is a show by Al Smith's group (he wrote Enola and Radio, but didn't write this one). It's probably even more minimal than radio, just one woman and a bath tub. It's mesmorising work, a near stream of conciousness monologue on her troubled life, that kept you gripped and entranced, never quite knowing where next. As Alex says, 'that was just brilliant!' 4.5 stars

After a quick spot of dinner, it was off to the pleasance for Into The Hoods. Our first musical forray of the year, but not our last. Well, I say musical, but more dance telling a story to music. It was loosely inspired by Sonhime's Into The Woods, and shared a fair few of the same themes. Otherwise, it was some amazing dancing to mostly hiphop, set on a London estate. It was wonderfully coreographed, mesmorising to watch, and technically stunning. We hadn't intended to see any dance, but I'm really glad we did. 5 stars
link2 comments|post comment

[LJ2ME] Fringe the 2nd [Aug. 12th, 2007|04:23 pm]
Today, we made a fairly early start to our fringe day, and were in town by 11. This gave us time to collect tickets for most of the rest of our time here, before wandering off for our first show.

We were seeing The Early Edition, with Marcus Brigstock, Andre Vincent, and two guests. To our delight, today was Punt and Denis :) It was a wonderful hour of news related jokes and ramblings, and very radio 4. Worth at least one visit, if not more! 5 stars

Next up was Duck Variations. Two guys, one bench, lots of conversations, most of them about ducks. I found most of the bits a bit wierd, and not enough of them humourous. 2.5 stars

Then we took a walk to underbelly, and picked a show to see. We opted for the well reviewed Painkillers, and two woman show. It was dark, and featured some arty projections at points. A journalist interviews a husband killer, and each try and get inside the others head. It's very raw, and very compelling. 4.5 stars

All going well, there are 4 more shows to see today :)
link1 comment|post comment

[LJ2ME] The Fringe [Aug. 12th, 2007|04:19 pm]
Once again, I'm up at the fringe. After a fairly good train journey up on Friday night, Alex and I saw three shows yesterday, then went to find Ollie. Today we're aiming for 7 shows, 5 or 6 tomorrow, then a couple on Tuesday before our afternoon train home.

First up, we saw 'Change'. This was a five person play about a 50 something mid level nsa analyst going nowhere. Suddenly, his work on Iran is of importance, and he's being promoted, and asked to compromise. Almost all of it was good, very thoughtful, but some of arguments were badly directed. 3.5 stars

Then, we headed to the cavern at the Pleasance, for another powerful show on the middle east (we saw Girl Blog From Iraq from there last year). This was a one woman show, where she play each person in a cafe in Tel Aviv in turn, being interviewed. It presented most sides, with great passion and feeling. Each person's story was interrupted by a suicide bomb blast, and it you felt for it. You left moved, informed and depressed. 5 stars

Finally yesterday, we saw Teenage Kicks. This was all about John Peel's middle days at radio one, the period with another John as his manager. It's all from before I got into Peel, but it was still of interest. Lots of whitty dialogue, a fair spattering of good music, and great fun. 4 stars
linkpost comment

Few little Django bits [Aug. 10th, 2007|05:40 pm]
Recently, I've been doing a fair bit of coding with Django. For those who don't know about it, Django is a web application programming framework for Python. Django is to Python much like Rails is to Ruby. It handles the pesky http related bits, provides a nice way to map requests onto python methods, presents those methods with the request arguments in a helpful way, handles sessions and middleware, and offers a an ORM and a template framework.

One of the differences with rails is that it aims to come much more "batteries included" than ruby on rails. So, if you use Django's ORM (which you don't have to for your main app - it's quite easy to drop in SQLAlchemy instead), you get a really nice admin interface and authentication system. Just define your model, enable the admin interface in your config, and browse to /admin/. Very nice, and very simple :)


The first python snippet deals with postcodes. I wanted some JavaScript in my webapp to be able to talk to the NPEMaps Geocoder API. The snag is that the JS security model doesn't allow cross-site requests to be made, as I would need. The solution was to have a Django view proxy requests on. First, I wired up a url entry, to map requests to /geocoder/ to my proxy method:
    (r'^geocoder/$','geocoder'),
Then, I used urllib to proxy on the request, and got Django to return the request as-is:
def geocoder(request):
    "XSS workaround for calling the npemaps geocoder"
    qs = request.META["QUERY_STRING"]
    url = "http://npemap.org.uk/cgi/geocoder.fcgi?%s" % qs

    # Make the request, and return the output
    req = urllib.urlopen(url)
    data = req.read()
    content_type = req.info().get('Content-Type',"text/plain")
    return HttpResponse(data, content_type)
All very nice and simple :)


Another nice thing about Django is that all your code is in Python. This means that you can take advantage of Python's really nice list comprehension syntax. It's very quick to get your head around, and allows you to write some very nice, concise code. Take for example the challenge to extract the version out of a Jad file (much like a java properties file, which is aimed at J2ME installations). With Python, that can be done in just one line:
version = [v.split(": ")[1] for v in open(jad_file).readlines() if v.startswith("MIDlet-Version")][0].strip()
That corresponds to:
  • Open the filename from the variable jad_file, read it in, and return an array of all the lines
  • Loop over all the lines in the file, and pop each line into the temp variable v
  • If v doesn't start with "MIDlet-Version", skip it
  • For those lines where it does (should only be 1 in my case), split the string on ": ", and return the 2nd part
  • Build up a new array of all of those 2nd parts from matching lines (ought to only be 1 for me)
  • Grab the 1st entry of this array, and strip off whitespace at the start and end
As you can see, Python list comprehension is very nice :)
linkpost comment

Quick nmea_info update [Aug. 6th, 2007|09:27 pm]
First up, Python 1.4.0 compatability. Eddi has kindly produced a sis file for LocationRequestor that's compatible with the new Python 1.4.0, you can download that here.

Secondly, with Python 1.4.0, the main Python sis file (but not the scripting shell) is signed by Nokia. Annoyingly, they haven't signed it with the Location permissions, so you'll still need to re-sign with your dev cert if you want to use the internal gps (no need to re-sign for just bluetooth). However, the update also changed the UID of Python, which means the old nmea sis files gave a warning about Python being missing. So I've built new versions of the nmea sis files (same version # though), which won't give that warning on 1.4 (but will do on the old 1.3.x Python)

I've also updated my previous post, in case anyone's checking back on that.

Oh, and one other thing I've discovered. The assisted-gps feature in the new (v12) N95 firmware really does make a difference. I've been getting dramatically quicker fixes with it enabled :)
linkpost comment

Using the internal GPS with nmea_info.py [Jul. 16th, 2007|03:03 pm]
I had a few questions on the weekend about using nmea_info.py with the internal GPS on a N95 (or similar S60 v3 phone). It's fairly simple:

  • Get the DevCert for your phone, if you don't have it already
  • Download S60 Python 1.4.1 (or 1.3.22, but you'll need a different LocationRequestor sis file)
  • Download the 3rd edition .sis file of LocationRequestor for your version of Python:
    LocationRequestor for 1.4.x or LocationRequestor for 1.3.22
  • Install the main Python for S60 sis file (it's already handily signed)
  • Sign the python shell sis files, and the LocationRequestor sis file, with your devcert, and be sure to give them all the full set of devcert permissions.
  • Install the signed python shell and LocationRequestor on your phone
  • Either:
    • Install the .py version of nmea_info on your phone, and run it from the python shell
    • or sign the v3 .sis of nmea_info with your devcert, giving it full devcert permissions, and install that on the phone
  • Slide the cover open, and hold the phone upside-down, looking like a bit of a prat
  • Enjoy the internal GPS goodness with your N95 and nmea_info

OK, maybe it does take 5-10 minutes (longer if the symbian signed site has crashed again...), but that's what we get by buying a phone with all the symbian signed restrictions crap on it :/

Update: Now works with Python 1.4.0, if you get a different LocationRequestor .sis file (thanks to Eddie for compiling it)
Update 2: Python 1.4.1 is correctly signed by Nokia, so you don't need to re-sign. You still need to sign LocationRequestor, the Python Shell, and nmea_info. Isn't platsec such a wonderful advancement for S60?
link10 comments|post comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]