Tomer Gabel's annoying spot on the 'net RSS 2.0
# Tuesday, 19 December 2006

I've blogged about Neil Gaiman's MirrorMask before, and have neglected to follow up with comments on the movie. To make it short and to the point: it's brilliant. Original story (Alice-esque, but is otherwise new and fascinating), amazing artwork, impressive photography, great music and terrific acting. This is a top-notch movie which in many ways is better than Labyrinth, and easily parallels Dark City in imagination and visual production. Although this is not a movie for everyone, I would greatly recommend it to anyone who's enjoyed the above movies, or for that matter Lemony Snicket's A Series of Unfortunate Events.

A completely different beast is Borat (I'll spare you the full title). Anyone who's ever watched Ali G should already be familiar with how hysterically sad this character is; it's not that Borat as a character is funny, it's just how stupid the people he interviews are. To put it mildly, it was difficult getting up when the movie ended because my stomach muscles were so sore from laughing. And Borat speaks Hebrew almost the whole movie, to boot!
(Disclaimer: it's worth noting that this movie is completely idiotic, full of profanity and racist jokes. If you're touchy enough to be bothered by this, you shouldn't be reading this blog.)

I won't deny being an Alfonso Cuarón fan; although I've only seen two of his movies, they both impressed me by being completely original and visually striking. His newest movie, Children of Men, definitely struck a chord with me. I'm not sure if this is obvious to anyone but me, but the narrative is like a modernized version of War of the Worlds with a human emphasis (i.e. no aliens): a regular joe getting caught in turbulent times, just one amazing thread of story that appears meaningless when viewed in the grand scheme of things. I'm not a professional writer so it's difficult for me to explain this properly - I hope I've managed to at least pique your curiosity.

Finally, I just feel the need to share a bunch of anecdotes:

  • The Princess Bride is still (after so many years) a masterpiece of duality: sentimentality and criticism, virtue and wickedness, beauty and hardship. It's simply a brilliant tale, and if you haven't seen the movie you literally owe it to yourself.
  • Holy shite, they're making a new Beowulf movie! One directed by Robert Zemeckis and written by Neil Gaiman no less. Who knows, maybe it won't utterly suck?
  • They're actually making new Rocky and Rambo movies. Rocky 5000 all over again?... I mean, I like Sly as much as the next guy, but he's over 60!
  • Pan's Labyrinth looks really gorgeous. The visual style is starting to get old, but the movie itself looks incredibly promising, and I'm definitely looking forward to it.
Tuesday, 19 December 2006 18:11:35 (Jerusalem Standard Time, UTC+02:00)  #    -
Movies

Update (January 16th, 2007): Not only does this apparently only work on the emulator, you would do well to stay away from Managed DirectX in general because common drivers, such as those on the Willcom W-Zero3 - do not support rendering in landscape mode (I wonder which devices DO support those features). After messing with this collectively for weeks we eventually went with the obsolete GAPI. The code here will probably not work for you.

For some reason, elementary DirectX operations are not very well documented in the .NET Compact Framework documentation; I kept running into InvalidCallExceptions for no aparent reason, and couldn't figure out the "simple" way to lock surfaces from the documentation (it's worth noting that I was only interested in basic 2D functionality).

Basically you just need the right set of flags and the right order of operations. Here's the code I used and that worked for me (even under the considerably buggy emulator). To create the device, use the following parameters:

PresentParameters p = new PresentParameters();
p.SwapEffect = SwapEffect.Discard;
p.Windowed = true;
p.EnableAutoDepthStencil = false;
p.PresentFlag |= PresentFlag.LockableBackBuffer;
p.MultiSample = MultiSampleType.None;
m_device = new Device( 0, DeviceType.Default, this, CreateFlags.None, p );

To draw on the backbuffer, you can use the following code:

m_device.BeginScene();

using ( Surface s = m_device.GetBackBuffer( 0, BackBufferType.Mono ) )
{
    int pitch;
    using ( GraphicsStream gs = s.LockRectangle( this.ClientRectangle, LockFlags.None, out pitch ) )
    {
        // Your code goes here...
    }   
    s.UnlockRectangle();
}

m_device.EndScene();
m_device.Present();

I hope this helps someone avoid a couple hours of frustration.

Tuesday, 19 December 2006 16:25:24 (Jerusalem Standard Time, UTC+02:00)  #    -
Development | Compact Framework
# Sunday, 17 December 2006

Word Shoot is reminiscent of Crimsonland's typing mode. Enemies advance at you and, in order to shoot them down, you have the type in the wordsthat show up below them. It's an excellent exercise for fast typing, not to mention a great way to get RSI.

Something's really screwed up with the high score system though; I scored 69,700 on my second game (hard difficulty, 9 missed words - at least 3 of which were because of overlapping enemies). I'm a fairly fast typist, and while I have no problem accepting the concept of people typing faster and/or more accurately than I do, still - 358,620 does not seem to me like an attainable score. I'll give it a couple more tries before I get back to work (we have a regularly scheduled flame throwing every Sunday. And no, I can't remember where that joke comes from).

Sunday, 17 December 2006 15:30:24 (Jerusalem Standard Time, UTC+02:00)  #    -
Gaming
# Thursday, 14 December 2006

I just reinstalled my laptop (a long and annoying story which I shall tell some other time), and this time opted for the Intel PROSet/Wireless drivers along with the PROSet/Wireless software suite (the one that replaces the crappy Windows wireless network management applet). It installed fine, the wireless card seemed to work fine but when I tried to start up the Intel application I was horrified.

It was in Hebrew.

Now, I realize that language preferences are a very personal issue, which is exactly why this pisses me off so much: why have ATi, nVidia and Intel all decided that my language of preference is Hebrew? The fact that my Windows is configured for Hebrew support in non-Unicode applications is no bloody excuse - it's that way because a lot legacy (and even new!) Hebrew applications require this setting to work properly. But my Windows is completely in English. Had I wanted localized UIs, I would've installed a localized version of Windows.

In Intel's defense, the translation was very comprehensive and even the RTL issues were sorted out; usually, however, software that supports localized menus have a language option where you can change the default language. The PROSet/Wireless software suite does not, and this time I was pissy enough to do something about it. Solution? Either download and import this registry hack, or do it manually:

  1. Start up your favourite registry editor;
  2. Go to HKLM\Software\Intel\Wireless;
  3. Change the value of InstalledLangId from whatever it is to 0x409 (or 1033 if you're decimal) -- that's the LangId for English;
  4. Change the value of InstalledLangShortString to "ENG";
  5. Kill the iFramewrk.exe process and restart it (or restart your machine if you're lazy)

All done. I really wish applications would stop deciding for me the language I want to work with.

Thursday, 14 December 2006 12:00:20 (Jerusalem Standard Time, UTC+02:00)  #    -
Software
# Wednesday, 13 December 2006

... from Alex Feinman. Don't ask me why.

In other news, the .NET Compact Framework doesn't decode alpha channels even in bitmaps that has them (well, it might decode the alpha channel, but it doesn't survive a Bitmap.LockBits call - maybe because there's no ImageFormat with alpha...) Still working around that.

Wednesday, 13 December 2006 19:01:40 (Jerusalem Standard Time, UTC+02:00)  #    -
Development | Personal
# Tuesday, 12 December 2006

Amazon used to be all about simplicity and usability - at least that's what I remember from my last order there, maybe 4 years ago. Now it seems my account is long-since deleted, and I figured I'll just go ahead and create a new one.

To make a long story short, there is absolutely no obvious way of knowing whether or not you're logged on, whether or not your account is active, or anything of the sort. I clicked on "Your Account," got a million different account management options and not even one "You're not logged in, click here to register" or somesuch option.

That, in my book, is very stupid.

Tuesday, 12 December 2006 14:11:36 (Jerusalem Standard Time, UTC+02:00)  #    -
Personal
# Monday, 11 December 2006

You might want to take a look at this post from Omar Shahine. His explanation (excuse? call it whatever you want) for why Windows Mobile will probably never be as good as Blackberry in some respects is honest to the point of being uncanny.

I've often remarked how much I appreciate Raymond Chen's ramblings about the decisions behind some of the more peculiar aspects of Windows. However, where Raymond is uncompromising and unapollogetic (to the point where readers sometimes comment that he is a "douchebag"), Omar is brutally honest but not grounded to the point of being cynical.

I reckon that top management cannot usually afford this sort of uncompromising honesty, but given what is often seen in this industry such an attitude is refreshing even coming from lower rings in the leadership ladder.

Monday, 11 December 2006 14:11:36 (Jerusalem Standard Time, UTC+02:00)  #    -
Development
# Sunday, 10 December 2006

To make a long story short, I'm building a trivial query engine over a dataset using XPath; for expressiveness purposes, I've allowed the users of said engine to query for attributes, and assumed that I can simply go up the hierarchy from there and access the elements directly.

I was somewhat dumbfounded to find that each node in the resulting node set had its parentNode property set to null; at first I was sure this has to do with an implementation detail of MSXML3 (perhaps it returns copies of the attributes for... I have no idea what possible gain could be derived from this.) A little more digging proved that, and I quote from MSDN:

In C/C++, IXMLDOMAttribute inherits IXMLDOMNode but are not actually child nodes of the element and are not considered part of the document tree. Attributes are considered members of their associated elements rather than independent and separate. Thus IXMLDOMAttributeparentNode, previousSibling, and nextSibling members have the value Null.

Working under the assumption that this is an MSXML3-only problem, I digged a bit into the W3C DOM specification only to find that it is, in fact, a specification issue:

Attr objects inherit the Node interface, but since they are not actually child nodes of the element they describe, the DOM does not consider them part of the document tree. Thus, the Node attributes parentNode, previousSibling, and nextSibling have a null value for Attr objects. The DOM takes the view that attributes are properties of elements rather than having a separate identity from the elements they are associated with; this should make it more efficient to implement such features as default attributes associated with all elements of a given type.

This seems to me a completely arbitrary design decision. It makes absolutely no sense to inherit from what at first glance is an interface for first-class citizens in the document (Node) and then castrate the interface with useless implementations. If, contractually speaking, attributes never have siblings or parents, then they shouldn't have those properties at all, otherwise this just frustrates the developers wishing to make use of those properties, and wastes their time by forcing them to dig through documentation to figure out what's wrong.

And on top of it all, the decision doesn't even make sense in light of the "efficiency" claim - how is it more efficient to partially implement an interface, instead of defining a new one that's more contractually sound?

Sunday, 10 December 2006 21:10:52 (Jerusalem Standard Time, UTC+02:00)  #    -
Development

Quick link: To download the wrapper classes click here

While working on a large application targetting the .NET Compact Framework 2.0 I realized that I'll need to feed some native code (specifically, the XSLT processor in MSXML 3.0 SP1) with an IStream implementation.

Articles about interoperating with unmanaged code in the CF are not exactly abundant; to save you the time I spent on incorrect and/or conflicting research, here's the bottom line:

  • There is no Managed C/C++ for .NET Compact Framework 2.0. To some this may be old news, but you should really pay attention to this point if you're going to do any serious development against CF. 2.0 adds support for managed COM/ActiveX interop, but otherwise you're completely stuck with P/Invoke.
  • Although it's not immediately obvious, CF 2.0 does support exposing managed classes via COM.
  • The CF is missing some usually-minor classes from the BCL; in this case I was missing System.Runtime.InteropServices.ComTypes.IStream. Annoying but easy to work around.
  • Finally, as an aside, MSXML 3.0 SP1 for Windows Mobile does not support the IXslTemplate and IXslProcessor interfaces, meaning that MSXML 3.0's already lackluster performance in XSLT transformations is further hindered by not being able to cache the interpreted stylesheets. This means that, if you use XSLT, your application will not scale. I was not initially aware of this issue, so I hope our data sets are small enough to handle this, or I may yet come to regret the decision to use XSLT in this project.

I managed to save quite a bit of time by leveraging Oliver Sturm's work, which was originally intended for the desktop. Since the CF is missing a whole bunch of minor classes, the managed definition of IStream included, I originally mucked about with midl trying to generate these definitions from the .IDL files. After this proved to be a genuine chore, I just ripped the definitions straight out of the .NET Framework 2.0 assemblies with the ever-useful Reflector.

You can download the class file here. If you use this it would really be cool if you could drop me an e-mail, and I bet Oliver would be equally appreciative. Enjoy!

Sunday, 10 December 2006 15:31:16 (Jerusalem Standard Time, UTC+02:00)  #    -
Development | Compact Framework

God knows I give the guys at JetBrains a lot of credit, but I didn't see this coming: according tot he Omea News feed, Omea Pro is being open sourced!

For those of you not in the know, Omea Reader is JetBrains' RSS, newsgroup, e-mail etc. aggregator. It's a pretty amibitious application that I've been using for quite a while now instead of RSSOwl (Omea's interface is smoother, although RSSOwl definitely has its moments), although in reality I only use about 10% of its capabilities - newsgroups and RSS feeds.

I was about to buy Omea Pro this week and am now feeling really awkward that I can download it for free instead; the least I can do is spread the word. I suggest you take a serious look at it, because the non-Pro Omea Reader is already a very formidable product.

Sunday, 10 December 2006 13:00:56 (Jerusalem Standard Time, UTC+02:00)  #    -
Software
Me!
Send mail to the author(s) Be afraid.
Archive
<2006 December>
SunMonTueWedThuFriSat
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456
All Content © 2024, Tomer Gabel
Based on the Business theme for dasBlog created by Christoph De Baene (delarou)