Archive for the 'Uncategorized' Category

Berlin – The hunt for Giants

Thursday, October 1st, 2009
The Little Giant on Day 2

The Little Giant on Day 2

Cut to this morning, and I’m in the search of giants.  Walking along Unter Den Linden (which roughly translates as “Tourists will buy anything”) is a lot like walking along tourist districts anywhere else in the world.  Huge imposing buildings filled with art and stolen treasures from all over the planet, and statues to fallen heroes scattered around wherever possible.  Alongside tourist (“I Love Berlin”) shops, and Starbucks are the expensive showrooms of Ferrari, and other “small c*ck” car manufacturers I can’t remember.  Some even have exclusive bars inside with bouncers on the door.  Walking boldly in, I was quite obviously turned away.

At either end of Unter Den Linden are the first sites for Die Riesen Kommen.  They’re really just teasers for the events that will follow tomorrow, and through the rest of the weekend much like the wooden spaceship that landed in London.  I finally found Schlossplatz to be the giant building site, opposite the giant cathedral I’d been using to shelter from the rain.  Schlossplatz, it appeared – was mostly a giant building site which would soon be home to the brand new Schlossplatz U-Bahn station.  Walking around it a couple of times I thought that maybe those crazy Royal De Luxe guys had caused this themselves.  Digging a giant cavern in the middle of Berlin seemed like just their sort of thing, but I was questioning whether they would have found city approval.

Then I heard screams of excitement off in the distance where I’d seen a small tent being built earlier – so rushed that way to find … another fenced off hole in the ground.  Taking their cue from the shows in Iceland, Royal De Luxe had engineered a geyser in the middle of Berlin spraying water 50-60 ft into the air every 5-10 minutes.  “Come stand over here for pictures” a helpful German student advised me.  “Hah”, I laughed, knowing it was right where the water had fallen minutes before.  “How about you stand here, I’ll just wait right here”.  As the water erupted high into the sky, I let loose on the camera, continuing to stay my ground as said water came crashing right down on top of me”.  Apparently the German student, found it particularly amusing.  “Never seen it go that way before”, he chuckled.  “Fuck off and die”, I thought.

The D90 rose to the challenge however, and after having a (cold) geyser thrown over it, I’m now sure it can perform well in almost all wet weather conditions.  The same can’t be said for my coat.

Berlin, city of culture for the bizarre

Thursday, October 1st, 2009
Gorilla outside the gallery shop

Gorilla outside the gallery shop

I’m in love with Berlin already. There’s graffiti all over the place, art galleries of the bizarre and obscure, fantastic displays of architecture, restaurants to cater for anyones taste the world over, and enough to keep you busy for a very long time.

Just as the tube map looks remarkably similar, Berlin looks and feels like it could be London’s long lost brother. Hopefully I feel this way after 5 days here. I found one free art gallery hidden away down a side street off of Friedrich Strasse which left me wanting to buy everything. I’ll most likely compromise and buy a postcard instead. Iron exhibits both huge and small fill the central courtyard and various huts off to the side as bunch of those artists responsible sat around making more.

It felt like I’d walked into some sort of rennaisance fraternity in gotham city – they had their own bar, which nobody seemed to be interested in using, a group huddled around an open fire, and a small burger van tucked away in the corner.  If the rest of Berlin stays like this (and first impressions indicate it will), I might not even mind staying in a city for longer than days.

Talk like a Pirate Day, Arrrr.

Saturday, September 19th, 2009

Shiver me timbers, fire th’ canons! Etc. ‘Tis September 19th, talk like a pirate day, arrr.

So don’t be surprised that ye’ll find everythin’ here Piratised fer th’ day. Sorry :)

Arrrrrr.

Arrrrrr.

Rescuscitating AMM with Amazon Web Service signed requests

Wednesday, August 26th, 2009

A few days ago Amazon added a requirement to their AWS that all requests to the service be signed, lest they be rejected. I’ve been using Sozu’s excellent Amazon Media Manager plugin for a while now to manage the currently reading list on this blog. It’s been a great way to keep track of exactly what I have read (avoiding the need to, like, remember), as well as masking my illiteracy by pasting a giant list of what is commonly known as airport trash.

Unfortunately, this is one plugin that hasn’t been updated in quite a while (after all, if ain’t broke…), so it broke. Being the sort of developer that’s quite happy to pick up a block of php and hack it until it works, I stumbled across this blog entitled ‘Amazon® AWS HMAC signed request using PHP‘, which has a function to download.

So to fix AMM:

1. Download that file, and copy the contents into the bottom of amm_parser.php.

2. In the same file (amm_parser.php), replace your _setUrl function with this one:

function &_setUrl() {
	//Build URL from base URL and other required parameters
	switch ($this->_locale) {				
		case 'uk':
			$region = 'co.uk';
			break;
		case 'de':
			$region .= 'de';
			break;
		case 'jp':
			$region .= 'co.jp';
			break;
		case 'fr':
			$region .= 'fr';
			break;
		case 'ca':
			$region .= 'ca';
			break;
		case 'us':
		default:
			$region = 'com';
			break;
	}
	$public_key = "< < Your Access Key ID >>";
	$private_key = "< < Your Secret Access Key >>";
	$url = aws_signed_request($region, array(
			"Operation"=> "ItemSearch",
			"Keywords" => $this->_parameters[Keywords],
			"ResponseGroup"=>$this->_parameters[ResponseGroup],
			"SearchIndex" => $this->_parameters[SearchIndex],
			"AssociateTag" => urlencode($this->_associate_tag)),
			$public_key, $private_key);
	return $url;
}

3. Oddly enough, this new method requires a private secret key which Amazon recommends to not give to anyone. So I’m not going to post mine here, even though it’s required for the plugin to work. So before I ponder that particular nugget of madness, you’ll need to sign up for an AWS developer account, and find your own keys via the Access Identifiers page. These need to be added into the function above.

That should be enough to get you back up and running again, although selfishly I’ve only really tested it for my needs alone. So please let me know if it works, or fails miserably.

For all the legal bits, I’m not at all affiliated with Amazon or Sozu – so please use at your own risk :)

C# Joins with Linq and Lambdas

Saturday, August 8th, 2009

I’m always forgetting the syntax for lambda joins in C#, because I never use them enough and get bored looking for reminders enough that I just revert back my old ways and use the query expression instead. So rather than find a good tutorial and bookmark it, I’ll post it here instead. By the time it falls off the front page, I’ll just about have remembered how to do it without needing this anyway :)

Query Syntax

var products = from audio in DbContext.DataContext.ProductAudios
join product in DbContext.DataContext.ProductAudios on audio.ProductId equals product.ProductId
select new { Product = product, Audio = audio };

Lambda Syntax

var products = DbContext.DataContext.ProductAudios.Join(
                DbContext.DataContext.Products,
                audio => audio.ProductId,
                product => product.ProductId,
                (audio, product) => new { Product = product, Audio = audio });

It might look like more code because of my formatting, but I find the lambda syntax much convenient when chaining queries together with other where’s and groupby’s, especially when that might be split across different methods. It also isolates your join nicely, whereas I find the query syntax will start to get particularly unreadable with more complex queries.

Last but not least, another piece of linq-join-related syntax I’m finding myself always having to look up a lot is for left outer joins. Fortunately I always end up at MSDN for that one, so I’ll just link to it here:
How to: Perform Left Outer Joins