codesurgeon blog

Monday, July 05, 2010

Slides for Talk on Selected Features of C# 4.0 and the .NET 4 Framework

2² C# 4.0 and .NET 4 Selected Features

These are the slides for the short version of my talk 2² C# 4.0 and .NET 4 Selected Features, presentation time for those is approx. 30 minutes. A slide set which goes into more detail for the DLR and .NET dynamic features is geared for 90 minutes incl. live code demos. It's available upon request.

Most slides in the original Office 2010 PowerPoint file are animated in order to not overwhelm the audience with slides bursting with text and information. The embedded Scribd version is based on Office 2010s PDF export. It is missing the animations and intended for print & screen reading purposes.

As always, your feedback is appreciated in the comments or via email to mustafa ÄT codesurgeon DÖT com

Wednesday, April 07, 2010

The iPad ... it tastes just like chicken!

... yet it seems to make men, predominantly aged between their quarter- and midlife crises, to roll on the floor, snarling and biting.

Being an all-around geek, former co-host of Germany's most popular Mac-centric podcast, founder & co-producer of the biggest indie video gaming show north of the Alps and software engineer, I have been closely following the birth of Apple's latest aluminum, electronics and glass sandwich pancake. After all, the prospect of a "usable" tablet computing platform, bearing interesting challenges and new opportunities for a range of applications, tingles more than a single sense in the geek mind.

I have been excited about the concept ever since Bill Gates couldn't stop talking about it around the turn of the millenium. Unfortunately - as with phones afterwards - Microsoft's implementation of the idea left much to be desired. The Redmond behemoth, employing an army of bright and talented engineers, stuck too close to its Windows OS UI paradigm.

iPad ... it tastes just like chicken!

It wasn't until 2007 and Apple's initial iPhone release that a touch user interface successfully premiered in my and tens of millions of other personal computing universes and secured itself a place to stay. As we've all experienced by now, Apple's execution of the idea was close to flawless and their success well deserved. On the other hand, right now it seems they've been drinking a little too-much of their own kool-aid and seem a little lost in hubrismaking themselves believe they've invented mechanisms (multitouch UI, OO graphics subsystem ... WTF?) which they have not.

Let's all hope that Microsoft ups their game, Android gains more traction, handset makers rise up to the challenge and the closed nature of Apple's platform leads straight into a wall sooner rather than later ... for the sake of us all, especially Apple's; for we all know that once Steve Jobs leaves the mothership, it will force the company to crash-land and need all the karma-cushion it can build up until then.

Yes, I am aware of the thousands of people working for Apple - among them bright devs - usually kept out of the limelight ... well, actually any light at all aside from their release into the safe confines of WWDC once a year. By the way, being a developer, to me this is probably the single most disturbing aspect of Apple's corporate culture, absolutely contrary to e.g. Google and Microsoft and any vibrant tech company in its right mind.

Over more than three decades, Jobs has proven to pick the right people and projects and be absolutely uncompromising (interestingly enough, even self-destructive) when he's set his mind on something.

Imagine an executive meeting at Apple today. Steve is presented with an idea, feature or prototype that he doesn't like. That pretty much settles the project's fate. Forever. Who is going to override his decision? Who is going to argue with the man who can rub you in the face that he's been there from the beginning of personal computing as we know it. Who is going to go rogue with a project inside Apple as he himself did with the Mac in the eighties? The man who financed George Lucas' former wandering hippie circus of CG-genius PhDs long enough for them to churn out the world's first fully computer-animated feature film? The list goes on and no matter what picture the various Jobs' biographies and personal stories we've all read and heard draw of him, he has obviously gotten some things right.

Now imagine the same meeting post-Steve ...

Apple *is* one auteur's will manifest in corporate form. If creative dictatorship is the company's only successful modus operandi (Sculley, anyone?), will Apple still work when it turns into a soviet? It's much less a traditional company than for instance Microsoft is. Is Apple up for a slow death-by-compromise/committee? We'll see but until then let's not steer off further from course and explore the shallow waters of gadget love.

The iPad has been released in the US four days ago, on April 3rd. The internet has been abuzz with videos, columns, spec sheet recitations and reviews. As far as those types of articles go, I have nothing more to add to what a Google search currently reveals.
iPad-ing

I'd much rather share my initial hands-on experience with the device: it's much less magical than it is useful in a utilitarian sense. As with the iPod and iPhone, Apple has taken a rough concept others only pursued half-heartedly and made it accessible and joyful to use. Contrary to countless posts (authored by hyperventilating authors?) on the web, there is *no* black magic involved.

The hardware is as slick as all the photos on the internet convey. The solid aluminum casing, sealed on the front by a single glass-covered screen, is a joy to touch. As for holding the iPad for longer periods of time, that is another story. It's a little on the heavy side. Then again, so are textbooks and laptops. Just don't expect the convenience that comes with the light weight of an Amazon Kindle during handheld reading.

IMHO, none of the apps available right now are groundbreaking. The Marvel app would have been close if Sony Computer Entertainment Europe wouldn't have already come up with their PSP comic reader half a year ago. Nevertheless, it's nice to have a compact device with a screen of this size.

I have no doubts that the best is yet to come. The iPad's form factor is in a region where size *does* make a non-trivial difference. Compared to the iPhone/iPod Touch, the additional screen real estate makes it possible for applications to utilize screen input with both hands without occluding most of the display. That is definitely the distinguishing feature of the device and it matters more than what the "but it's just a bigger iPod Touch" blows might suggest. For the purposes that I see the device serving, the lack of a keyboard is liberating - no more cumbersome lid opening and lap balancing.

The display size makes the iPad perfectly suited to replace our living room computer - a white MacBook. It's what we use when we feel like browsing the news on the couch, checking up on friends and photos on Facebook or digging into Wikipedia when mutual stubbornness deadlocks a discussion. Now if only Apple would have included a front-facing camera, the iPad would have become the ultimate home-bound communications device and helped propel video chat into living rooms. I guess, for that to happen, we won't have to wait any longer than for the next product iteration.

As it is right now, the iPad feels right at home next to a stack of magazines, easily replacing your current terminal of choice for internet lookup.

It's different, it's cool ... and it tastes just like chicken.

--
Special thanks to geek chick extraordinaire Winnie Teichmann for dropping by, joint iPad-ing and taking funny photos.

Friday, November 27, 2009

The Windows Cache Manager - A Quick Overview

Well, if I have to spend my days (and currently nights!) with Windows cache and memory management, it should at least be good for a blog post ;)

The Windows Cache Manager is a central operating system facility managing the system cache, which transparently supports all Windows filesystems. It is capable of handling file data - including multiple data streams for filesystems that support such - as well as filesystem metadata. Since the operating system provides for a centralized external storage caching mechanism (including support for network and disk based access), filesystems are alleviated of implementing proprietary caching functionality.

The Cache Manager operates on a relatively high level for a kernel mode component, interpreting files as byte streams vs. individual disk blocks on physical storage media. Abstracting away from physical file layout allows for simplified analysis of data access patterns and resulting optimizations for instance in terms of better read-ahead performance.

A segment of the kernel virtual address space is assigned to the system cache by the Windows Memory Manager. The Cache Manager further slices this segment into 256KB chunks to hold cached views of filesystem data.

Mapping file contents from disk into the system cache is 256KB-aligned - that is, when reading 100 bytes from a 1MB file at byte offset 400,000 the Cache Manager will fill up the corresponding 256KB chunk in the system cache starting at byte offset 262144 through 524288-1. Assignment of filesystem mappings into the system cache 256KB slots happens in a round robin fashion.

The filesystem tracks the physical bits of a logical file and the type of I/O requested (buffered vs. unbuffered) within corresponding file objects. Multiple file objects can represent the same file on disk. The former share a "shared cache map" which serves as metadata structure for the file on disk being represented by the file objects. It contains a mapping from file offset for a particular view to system cache virtual address space. The Cache Manager utilizes the shared cache map to ensure cache coherency among the different file objects for the same file - for instance by only caching the same view into the file exactly once. Data relevant to individual file objects alone - that is, access patterns to handle read-ahead - is kept in object-specific private cache maps.



The Win32 API exposes flags to influence cache read-ahead behavior via FILE_FLAG_SEQUENTIAL_SCAN and FILE_FLAG_RANDOM_ACCESS When not specifying any of the file flags at all, the Cache Manager tries to analyze and determine an access pattern (strident access, sequential forward or backward scan) in order to optimize its performance.

A number of lazy-writing threads that wake up periodically, sequentially go through the system cache and flush out a predetermined number of modified 256KB chunks to persistent storage in each wake-period. A list of linked shared cache maps indicates system cache chunks that have been written to and thus need to be considered by the lazy-writing threads.

It is interesting to point out, that with Windows' particular kind of memory mapped file caching, the Cache Manager remains oblivious to which parts of the cache actually reside in physical memory (RAM). Instead, the Windows Memory Manager is free to optimize physical memory utilization to balance system cache vs. demands of user processes.

The overall physical size of the system cache depends on the operating system - for 32Bit systems it maxes out at a little over 500MB. As for the size of the kernel virtual address space assigned to the system cache, it depends on the amount of RAM in the system and is calculated via the formula: 128 + (RAM in MB - 16) / 4 * 64.

Resources:



Monday, July 20, 2009

Interview in Germany's #1 College Magazine: The Google Experience and CS Careers

In November last year, Dominik Hahn, editor at presstige and fan of a couple of the podcasts that I'm collaborating on, contacted me for an interview in their publication. Little did I know at that time, that their magazine boasts a print run of 10.000 issues. IMHO, that is pretty impressive for an entirely student run magazine.

He was particularly interested in career advice I could give for fellow CS students and my personal experiences with working for Google.

I have embedded the magazine, neatly turned to the right page for your viewing/reading pleasure, right after the jump.

If you don't speak German, let me distill the article for you: Yes, go work for Google.

It's a special place, where you are given any and every chance to evolve as an individual and engineer. This is not to say that there aren't any other workplaces that qualify, but Google definitely gets a lot of the things I was looking for right. And then some.


Friday, February 13, 2009

WoW: Wrath of the Lich King Review for games™

Oh Noes! A fan of our podcasts just dropped me an email, inquiring about WoW matters and made me realize that I totally forgot to plug my very own review of World of Warcraft: Wrath of the Lich King in games™ issue 01/09.


When Soenke Siemens, associate editor in chief of German games™, asked me for a WotLK review for their print publication in October 2008, how was I supposed to say "No!". Especially given that such an inquiry translated to an excuse for burning time hunting down Arthas in Blizzard's latest extension to Warcraft lore?

My personal history with WoW started as early as fall 2004 with the US Beta and has been unfolding ever since. Admittedly, the journey hasn't been without frequent pauses of several months. After all, real life obligations require their share of attention and levelling up too :)

So, I guess it shouldn't be surprising that after my initial three weeks of intensive adventuring in Northrend, thanks to a beta key provided by good friend and former Google colleague Sumer O. (Blizzard employee, now) and the big ol' collector's edition box by the magazine, I had to attend to my other - i.e. RL - character, Mustafa.



I might get around to pick up a little WoW-ing over the course of the next four weeks though. If you feel like teaming up with our friends & family guild on German server Khaz'goroth, I suggest you drop me a note. I have a dormant US account too, but chances for me to pick up that one too, while living in Germany and barely finding time to dwell in the European server pool, are currently very low.

Distilling the essence of the massive expansion to a two page review wasn't easy, especially when aiming for an original article that does not mimic a fact sheet or worse resembles little more than a mutated press release.

Judging from the feedback we received for the article, coming up with a compelling review seems to have worked though. Thanks to everybody for the kind words and feedback.

If you're interested and lucky, you might still be able to pick up a copy of the issue at a newsstand of your choice, before the February wave of magazines washes it all away.

On the other hand, thanks to games™'s PDF offer, you can always opt for the cellulose-free way of digital distribution and get access to any back issue you'd like ;)

Saturday, December 20, 2008

Review: I Love Katamari (iPhone/iPod Touch)



Roughly a week ago, in a surprise move, Namco released an iPhone game based on one of their more recent and creative IPs, that is Katamari Damacy. The official title of the version for Apple's handheld combo is dubbed I Love Katamari.



The basic game mechanic remains unchanged to what fans of the series have come to expect from the various incarnations of the title for the PSP, PlayStation 2 and Xbox 360.

The goal is to roll around a sticky ball, that is a Katamari in the game's lingo, and snowball it to a certain size by rolling over items strewn around in 3D stages.

As you roll around the first level of five for the iPhone title, you quickly realize the nature of the challenge ahead: you can't just roll up objects in any arbitrary order.

Items of a certain size will only be picked up by a Katamari that has reached a respective minimum volume. Thus you are required to iteratively identify objects you can pick up as the monstrosity you are pushing through the level reaches bigger and bigger sizes.



I Love Katamari features four modes which provide for slight variations while keeping the core game mechanic intact. In Story Mode you get a taste of the crazy background of the series, where you are prince to the King of All Cosmos, who requests you to roll up a particular object, varying from stage to stage and involving items such as a dog or a truck.

You start out with a blank Katamari that is just big enough to pick up the smallest items, depending on the stage setting these range from sushi to footballs.

A tight time limit forces you to hurry up and grow your Katamari as fast as possible in order to be able to pick up the requested object. Stages for all playmodes are made available subsequently through successfully completing challenges in story mode.

Once you have cleared a stage it is available in any of the other three modes. Time Attack gives you the opportunity to roll up a Katamari as big as possible within a set time limit, Exact Size Challenge requires you to do exactly that and Eternal Mode is your chance to enjoy stages without having to watch any limitations while building a behemoth to your liking.

The standout feature of the iPhone/iPod Touch version of the game are the controls. Navigation through the leves is accomplished by tilting and turning the device in a very intuitive fashion. To me this feature made me grok the Katamari Damacy fascination for the first time, despite having played the PS2 version for a short while.



From my personal experience I consider the game absolutely suitable for short bursts of playtime. Over the last five days, I have fired up the title every single day in order to try and please the King of all Cosmos while riding the subway or waiting in line.

Unfortunately not all that shines is gold and thanks to frequent slowdowns, occasional sluggishness and control issues every now and then, I Love Katamari makes sure we don't forget.

More than the obvious technical bugs, I am disappointed by sloppy design decisions. For instance, at certain points your Katamari goes through a distinct growth phase - which by the way always causes a slowdown and makes the framerate drop to something around 2-3 fps - where I'd expect to see some kind of consequence to the sudden growth. 

Something along the lines of all of a sudden being able to pick up significantly larger objects than was possible before. That usually doesn't happen though until you've rolled over a couple of more items, that would have already stuck to the Katamari before the growth sequence, which doesn't help to make sense of the whole growth animation/framerate meltdown.

Despite the issues that the game suffers from and which Namco will hopefully address in a future update, my verdict is very positive. This is quite in contrast to the conclusion Luke Plunkett draws in his micro-review on Kotaku and Chris Kohler on his Game|Life blog on Wired.

If you are in for a game that does not mimic the bad half of 80s game concepts - as they seem to be flooding the AppStore - I suggest you grab a copy of I Love Katamari and start nagging Namco to release a patch ASAP - not telling them of course that you already enjoy the game - as I do ;)

Update - Dec. 22nd, 2008: Namco has released an updated version of the game which resolves most of the technical issues I Love Katamari was suffering from. The title in version 1.0.1 plays much smoother now.
The bug fixes also result in a significantly decreased difficulty level. For instance I was trying to get past the Park stage for the last two days, but failed miserably each and every time I attempted to. After the patch, it took me exactly one try to roll up the requested light truck and pass the level.



The UI stayed pretty much unchanged, aside from an element showing the extent of tilt the iPhone/iPod Touch sensor reports to the game. I suggest you either update your version of the game, if you have purchased it already that is, or use the new release to get it in the first place ;)

Thursday, July 17, 2008

Space Siege Preview for games™


As listeners on Germany's most popular gaming podcast games und so already know, Alex and I met up with Chris Taylor and talked about his studio's latest game Space Siege.

gamesTM asked me for a preview of the title which has been published in their latest, i.e. August 2008, issue. The magazine is available at newsstands and bookstores as well as a slick DRM-free PDF online.

It is jam-packed with previews (e.g. Civ IV: Colonization, CoD: World at War, Treyarch's Bond, Dawn of War 2), reviews (Battlefield Bad Company, Alone in the Dark) and a LucasArts Indy retro flashback - well worth shelling out the bucks ;)

Wednesday, July 09, 2008

Google Tech Talks: Wiring Hacker Synapses & More

Some of the talks given at EclipseDay at the Googleplex are available as videos via the Google engEDU Tech Talks Channel on YouTube now.

For your (and my) convenience, I have embedded our very own Eclipse Communication Framework Wiring Hacker Synapses talk right after the jump. But if you are really in for a ride to remember, I suggest you indulge yourself in the full list of EclipseDay Grand Teton room recordings.


Wait - there is even more ;) Photos.

Saturday, June 28, 2008

Visiting the Friendfeed Global International Headquarters ...

... and helping out with the move.

Since I was in Mountain View, CA for the first half of this passing week, I used the chance to make up for all the missed friendfeed open house and TGIFF invitations. On Monday afternoon I took a break from preparing my slides for EclipseDay at the Googleplex and dropped by the Friendfeed Global International Headquarters - new and old.
It was great to finally meet up with the team behind the service of which not only I think that it is excellent in scope, execution and promise.
After a warm welcome by Ana and a chat with Paul, I joined the team in moving from the old office to the new location, contributing my share to friendfeed's continued success ;)

Among the non-trivial tasks of relocating a global international headquarter was mounting a high-tech mailbox to the precise specifications laid out by Ana - that is "So that our short and chubby mailman can reach it". Paul and I had to make more than one attempt to get it right.

Over the course of my stay I was successively introduced to the rest of the team and I have to say you guys rock. I had a blast talking to you all and I am sure that my Monday afternoon friendfeed diversion helped with the success of the talk at Google the following day :D

P.S.: Ana thank you for the shirts. I took mine out for a walk in Munich today. My girlfriend says thank you for thinking of one for her too - since you and I could not find the girl cuts in the box, it looks like as if I'll get around to wear that one too though :)

Corresponding items on my friendfeed:

Wednesday, June 25, 2008

Hot Off the Press: Slides for Cola Tech Talk "Wiring Hacker Synapses"

These are the slides for my Cola: Real-Time Shared Editing talk at Google for EclipseDay.

You can download the PDF version of the slides by clicking through to the scribd page for this presentation.

The embedded slides/PDF version have been stripped off any animation, that is are fully built and thus should be well suited for non-presentation style consumption.

Wiring Hacker Synapses