Please click this logo to help me get on their beta program:

Xobni outlook add-in for your inbox








2/10/2008

Stuff I use on the Mac

Filed under: General, Software, Mac — Oliver Sturm @ 8:09 pm - 4 days, 3 hours ago

As I wrote previously, I’m using a MacBook now for almost all my daily work. On that post I got some comments about the quality and general availability of software on the platform, so I thought I’d take stock after using it for a while and see what applications I use and where I haven’t found good solutions yet.

Writing, authoring, note taking and similar

Microsoft Office for the Mac is the same enormous package on the Mac that it is on Windows. Well, perhaps not quite as large overall. Some minor issues I’ve found include that Word templates don’t look 100% the same on both platforms - generally quite good software, and essential to me for full compatibility. Includes the slightly weird Entourage, which is not quite Outlook, but comes with a lot of Mac goodness, like Automator integration.

OpenOffice.org (isn’t that one of the stupidest product names ever?) isn’t quite as great on the Mac as it is on other platforms… only the newest pre-release versions have a native Mac UI available, while older builds use the X11 compatibility layer. While I appreciate the availability of X11 on the Mac to be able to run the occasional Unix tool more easily, it’s not a very nice environment in many ways… or at least it would require much more work to configure right. Anyway, I’m just installing OpenOffice to have an alternative to MS Office when I need one, so it doesn’t really have to look great. Otherwise, there’s

NeoOffice - might be worth a look if OpenOffice just looks too ugly. Allegedly also faster with certain things. I haven’t really tried it myself.

iWork is Apple’s own take on a productivity suite - in addition to the considerable capabilities the OS X platform offers out of the box of course. I got it for free with my Mac, and while I won’t pretend I’ve spent ages with it, I must say it’s a very useful package. Keynote alone is worth more than the entire package, compatible with PowerPoint and the presentations can easily look nicer…

OmniGraffle is the answer to one problem I could never solve satisfactorily on Windows. Its functionality is somewhere between Corel Draw, Adobe Illustrator, PowerPoint, and a whole bunch of other applications whose functionality evolves around the creation of drawings, diagrams and so on. I’m not an artist, and OmniGraffle hits just the right spot between providing things out of the box and in-depth functionality that I can use when things need a bit of tweaking. I’ll review OmniGraffle in some more detail in the future.

Curio was the result of a long search for a note taking application that would replace OneNote for me. So does it do everything like OneNote does? No, it doesn’t… there’s pros and cons to Curio. The overall functionality is easily much more sophisticated than OneNote’s, but some usability details could be improved. Another subject for review later on. It’s my preference over several other loosely related apps I tried to various extents, including VoodooPad Pro, OmniOutliner Pro, NoteTaker, Notebook, Evernote and DEVONthink.

MindManager has always been one of my favorite pieces of software (a mind mapping tool, of course), and while the Mac version lacks many features compared with the Windows one, it still blows any competition clean out of the water. Also tried Consideo, though not in very much depth.

Capturing the screen on the Mac is surprisingly complicated. Yes, there’s a tool for screenshots included and it works just fine. But I’m used to what SnagIt and Camtasia were offering on Windows and there aren’t many tools around that even come close. I tried FlySketch for screen shooting, and Snapz Pro X and iShowU for recording - iShowU was actually not bad, but the rest… well. An oddity from my point of view is that apps on the Mac tend to use weird .mov files for videos - yeah, that’s .mov, the file type I’m used to ignoring because it brings up the Apple video player that blocks every Windows machine for minutes, comes with restricted functionality and wants updating every few days. Of course I know things are different on the Mac and .mov files actually play nicely, but still - what’s wrong with a nice compatible .mpg file? Most interestingly, a solution to the screen shooting/recording problem might come from TechSmith - Camtasia and/or SnagIt for the Mac. Hopefully soon.

TextMate is of course the well-known text editor for Mac OS X. Really extremely nice. Bundles for many different file types/development environments, supporting a number of languages for automation, including Ruby and shell scripts. Nice templating as well. I haven’t put it through the paces of my personal editor acceptance tests yet, but I know I do like it so far.

Aquamacs is a port of Emacs for the Mac. A very good port indeed, better than the ones I used to use on Windows. I’m torn between this one and TextMate - they are too different in too many ways to really make a decision. Good thing I can just install both.

MacTeX. Who can be without TeX? Ah… sadly, many people these days manage, or think they do. Anyway. MacTeX is a very nice and complete package.

I’m currently missing an application that is an image editor. I’m not talking about stuff that Lightroom can do (or Photoshop of course) to my photos - I’m talking about editing images, like I sometimes do for icons, web graphics, … it’s weird to feel the need to explain this - ten years or so ago, everybody knew exactly what “picture editing” meant. I used to use PaintShop Pro on Windows, which did the job nicely, although the functionality added in the past few years goes more in the direction of photo management as well. Anyway, funnily enough I haven’t found any nice application for this purpose on the Mac yet.

PIM

iCal and Address Book are of course standard utilities on the Mac, but they are good. I’m not missing anything from Outlook.

OmniFocus is a great todo list application (well, that doesn’t really do it justice…) based on GTD philosophy, but flexible enough to allow any style of todo handling (important, since I don’t really do GTD). Another app to say more about in the future. I tried this against several others, including Anxiety, iGTD and Things.

Internet

ecto is the blogging tool I’m currently using. I have an ugly problem with it related to white space handling - basically ecto drops whitespace in certain circumstances. Hm. Had a quick look at MarsEdit as an alternative, but since I’ve finally received a reply from ecto support, I’ll wait a bit and see. MarsEdit doesn’t have a rich text editor, which sort of turns me off… I could just as well use TextMate then, couldn’t I?

Skype, of course, works just as well on the Mac as it does on Windows. I believe the versions aren’t up to the same standard regarding newest features, but then I stopped using newest features in Skype for Windows years ago, so I’m not bothered.

Adium is a multi-protocol IM client and it’s simply fantastic. I’ve tried enough different clients on Windows in the past and I’ve used Trillian and Miranda for years - Adium is way better than either of these. Luckily it was the first one I tried on the Mac and it’s going to be the last.

I use the boring standard Apple Mail application that comes with OS X for my email needs. It works very nicely with my IMAP server and (of course) it doesn’t have any usability oddities, which are the rule rather than the exception in Thunderbird on the Mac. I gave two add-ins for Mail a try, Mail Act-On and MailTags, but I decided I could live without them. One of them, don’t know which, also gave me some stability problems with Mail.

Twhirl is the Twitter client I use - I like it, but I believe there are many out there that have the same functionality.

CocoaWget is a graphical frontend for the GNU tool wget. Like a download manager. I rarely need that functionality - I’m sure there are more full-featured (at least in the graphical UI department) download managers out there.

Cyberduck is a tool for FTP and a few similar file transfer protocols. Nice, with bookmarks, resume support, SCP and SFTP support and AppleScript integration.

I’m using Thunderbird as an NNTP news reader. I tried Unison, but stayed with Thunderbird. Sadly, NNTP is another thing I’m doing less and less these days. Stupid web forums.

NetNewsWire is my RSS client, through NewsGator. Great. Wouldn’t use anything else.

Firefox, still the browser of choice. I tried Safari with a few plugins (Inquisitor, Saft, SafariStand), but it didn’t really come close in terms of comfort. They should add a proper plugin architecture into Safari, perhaps some of the issues would then solve themselves. In Firefox, I’m not a heavy plugin user - these are the ones I use: Adblock Plus, Colorful Tabs, Delicious Bookmarks and Firebug.

Tools

1Password is a password manager, the best one I’ve ever seen. Having used Password Safe on Windows for years, I tried Password Safe SWT on the Mac, which is compatible with the Windows app, but sadly a pain in the neck to use. Password Gorilla was another app I tried before I decided to drop the compatibility thing. 1Password imported my 600+ password file and it can create encrypted HTML files for easy use of (searchable!) password lists on any platform. Lots of other nice features.

The search for a file manager was difficult and it’s not over yet. On Windows I used Altap Salamander, which was great - with the exception of its lack of Unicode support. Currently I use muCommander on the Mac, as the best dual-pane solution I could find. It crashes on me regularly when working with network shares, and it lacks some important features like connecting to shares easily or configuring the editor to use for the F4 command. Weird. Before I got there, I tried lots of others, including ones that weren’t dual pane, but most were either extremely simplistic in their feature set or buggy or incomplete with no support. These are the ones I tried: ForkLift (hard to use with the keyboard, simple features like filtering for the lists missing), XFile (weird package of tools, no context menu support, just one pane, weird keyboard configuration), RAGE Macintosh Explorer (tabbed, not dual-pane, really mouse-only), Path Finder (quite nice though not dual-pane - ran out of trial time before I could get a second look), Xfolders (not bad, but extremely simple), FlyPath (basic NeXT file manager, similar to what Finder can do these days), FileBrowse (useless), 3DOSX (weird 3d crap), Liquifile (very weird) and Disk Order (quite nice, though only slightly more capable than Xfolder, sent support emails about certain important issues, never got replies).

QuickSilver is of course the mother of all launchers, the one that everybody else tries to clone. It’s really very impressive, loads of special packages, very intelligent handling of all kinds of data. Hard to describe ;-) Anyway, I’ve found a few really simple things so hard to do that I still haven’t figured them out - like how to add a shortcut myself that gets me to a particular URL, for instance. Well. I’m sure I’m missing something, and I haven’t spent too much time looking so far. Launchbar, btw, is one other that I had a quick look at.

Toast is my burning application of choice, although I haven’t even looked at it in much detail yet. All others I found were very basic. There’s lots of functionality around even in standard OS X, although it’s spread across lots of different apps. But I wanted everything that Nero could do and Toast gives me that - in a nicer package than Nero, it has to be said. More about Toast when I’ve had time for a closer look. Others I tried (and some of them looked okay for basic stuff like dealing with images) include these: LiquidCD, Disco, Burn

I use iTunes on the Mac to work with my iPod. On Windows I’d totally given up on that (I was using Anapod) because the app was unusable - but the difference is similar to that regarding mov files (see above). iTunes still has quite a hard time with my MP3 collection on a network share, but at least it stays usable.

Araxis Merge deserves a mention because it’s a fantastic file diff/merging tool for both Windows and Mac. But I’m in fact not using it, because their pricing is just ridiculous. Haven’t found a suitable alternative on the Mac yet - of course Unix tools and Emacs diff/merge are much more usable than they are on Windows…

Canoscan Toolbox - weird entry, yes, but this is the driver for my CanoScan 8400F scanner and it’s a really very nice piece of software. I recommend Canon scanners purely for the reason that they come with no-nonsense software that doesn’t look like a candy machine, and it even works on the Mac. Great.

I am not currently using a clipboard monitor tool, which is very unfortunate… I’ve worked with ClipMate on Windows for many years, and while that one was maybe a little antiquated in some ways, it worked well and was continuously maintained. I didn’t actually use that many of its functions - just the clipboard history really, and a few simple things like concatenating clips and pasting without formatting. Well, on the Mac I tried every tool I could find, including iClipboard, CopyPaste Pro, iClip and CuteClips, and they were all crap, pretty much. Some of them at least looked pretty, but none were properly usable with the keyboard or had a history that did the job. I hope somebody is going to create something soon… maybe it’s time I had another look around and chose something to live with, rather than not having one.

For backup purposes I use both Time Machine and SuperDuper!. Time Machine does regular backups and provides a history of file changes - great. I have an external 1TB drive attached for that, which is about half full so far. SuperDuper! is a tool that creates a full clone of a hard drive. I used to use Acronis True Image irregularly on Windows, and it had some features that SuperDuper! doesn’t have. But in turn SuperDuper! is really not intrusive at all. With True Image I always had the problem that when it ran over night and I got back to the machine the next day, all my memory was paged out and it took an hour or two before the machine started behaving normally again. No such thing with SuperDuper!, and so I have my drive cloned onto another, portable external drive every night. Have I mentioned that the clone is directly bootable via USB?

I’ve been trying Versions for SVN, and also ZigVersion, but I’m now using the command line tools mostly. Both of these apps were quite nice - Versions kept running out of time in the current pre-release version - although they had a few nasty habits, like scanning the whole local repository all the time. I might have another look, but I do like command line tools, and on the Mac working on the command line finally feels quite natural and efficient again.

I was looking for a picture viewer with slide show functionality. I’d always used IrfanView on Windows. The first thing that was really odd was that neither of the tools I tried first was able to work with a directory of stuff easily - point it at one picture from the “trip to TechEd” folder and be able to navigate through all the other pictures in that same folder. Weird. Isn’t that a very normal thing to do? Ah well… the one I’m using now is called Xee and can do this easily enough, as well as everything else I need (which isn’t really much). I also tried ViewIt and Shomi.

Adobe Lightroom is at least as nice on the Mac as it is on Windows (it’s an app that works with your camera, archives your images, has post-processing functionality, …). I actually got the impression that it dealt a bit better with my picture archive on a network share than it did on Windows. If you own a license for one of the platforms, the other is also included. Good job, Adobe!

VMWare Fusion is the Mac edition of the virtualization software I’ve been using for around ten years. The current beta 2.0 releases are very stable and offer almost everything the Windows versions have, too. In fact, until the recent 6.5 release on Windows, the Mac version was the only one to have Unity, the feature that allows you to have application windows for apps running in the VM hanging around on the desktop together with those from apps running on the host. I never tried Parallels because VMWare was a natural choice for me, but I hear its performance is nowhere near as good, even more so on Macs with multiple processors.

Microsoft has Remote Desktop Connection for the Mac, which is great because I use it to access and maintain two of my servers. Thumbs up, Microsoft!

Google Earth (as well as some other Google stuff on that same page) is available for the Mac, and it’s just as good as the Windows version.

Handbrake is a nice tool to down-convert DVD movies into MPEG 4. Nice if you want to watch movies on small devices. Works on Windows, too!

Witch is an enhancement to the task switching functionality in OS X. Normally you can switch applications (Cmd-Tab) or windows in the current app (Cmd-`), but with Witch you can switch to a particular application window directly. Nice.


Right, that’s it for now. Hope it’s interesting - otherwise it’ll just serve as a note-to-self :-)

15/8/2008

CopySourceAsHTML and VS 2008 SP1

Filed under: General, .NET — Oliver Sturm @ 11:53 am - 1 month, 3 weeks ago

I tried to install the very nice CopySourceAsHTML (the link hasn’t actually been working for me since yesterday, but I had a download hanging around) plugin on my machine, which has both VS 2005 and VS 2008 (the latter including the new SP1) installed. I chose to install “for everybody”, as I always do - perhaps this makes a difference, I haven’t tried. This is an XP machine.

The plugin didn’t install itself correctly for some reason, not even in VS 2005. I found the file CopySourceAsHTML2005.Addin in the path C:\Documents and Settings\<username>\Application Data, where I didn’t think it belonged - and VS was obviously not finding it there either. When I moved it into C:\Documents and Settings\<username>\My Documents\Visual Studio 2005\Addins, VS 2005 found it but couldn’t load it - there was an error message on VS startup. I found that I had to copy the file CopySourceAsHTML2005.dll into the same directory and then it worked (that dll got installed in C:\Program Files\J.T. Leigh & Associates\CopySourceAsHtml2005). Weird.

I also made it work in VS 2008 by copying the Addin and the dll files to C:\Documents and Settings\<username>\My Documents\Visual Studio 2008\Addins and changing the version number in the Addin file to 9.0. Now everything works fine in both VS versions. The installer is apparently not quite up to scratch… nice plugin though!

7/7/2008

Feedback on my NxtGenUG Fest 08 session - Handling data in F#

Filed under: General — Oliver Sturm @ 3:40 pm - 3 months ago

It occurred to me today to look at the feedback that a lot of you have left for the session I did at the NxtGenUG Fest 08 event a few weeks ago. Thanks to everybody who did so, it’s always appreciated!

Now, there are a few points I’d like to comment on - feedback as usual was varied, the overall average not too high… but that’s to be expected, especially with a topic like that in the context of the day.

To the 21 people who left an 8 or 9 rating - thanks! There’s not much to say about this since comments were very positive.

The comments on the 7s are a bit more interesting - some of them are still positive, some others are more critical. In order of appearance in the list.

> Second time in a row Oliver has overrun and not covered everything on his agenda, the same happened last year with his WPF session. He needs to work on his timings.

Hm… well, I don’t agree. Perhaps I should post about this in general, because apparently my point of view in this regard isn’t well understood - I get comments about this all the time. In a nutshell, my sessions typically include content that most likely I’m not going to have time to present. The reason it’s in there (in the form of slides and/or samples) is because I found it interesting during the research phase of session preparation and I’m thinking it might be interesting to the people who download my slides and samples after the presentation. It might also come in handy when I deliver the presentation again, with a slightly different target time (this varies a lot from event to event - everything between 55 and 90 minutes for a session slot is quite common). If I remember, I try to explain this in most sessions - I don’t remember whether I did this time or not.

Of course there are also considerations specific to the event in question. For starters, Dave insisted when he talked to me that I submit something entirely new, not something that was previously done elsewhere. Looking at the presentations I saw on the day, I have my doubts whether everybody adhered to that rule, but I did - as a result, this was a first run for the presentation, and these will always be a bit less perfect on timing than subsequent runs, no matter how well prepared somebody is.

Finally, of course, I didn’t run over - I simply adjusted the session content to fit the time frame and left out a few minor bits at the end because time didn’t allow for them. If you don’t like it, my apologies - these bits and bobs are out there in the wide world whether you like it or not. As it is, they are included in the slide deck, and it seems you’re saying I should have left them out. Go figure.

> I think the session would have benefited from getting onto the code samples sooner.
> Whetted our apetites, but didn’t make time to cover the more exciting parts.
> Super fast, but I enjoyed having an introduction to this.
> I thought drilled too quickly into the code examples.

Yeah well… what are you going to do in 60 minutes, when 90% of the audience are on the "F-what?" level to begin with? And as you can see, this is a subject that splits any audience…

> There was no sense of where this language’s niche was.

Fair enough - I can’t tell you though. Still waiting on the MS niche definition committee to finish its work. In the meantime, just listen, get up to speed if it sounds interesting, and make up your own mind.

> In places I felt that the presentation and samples could have been tightened up a bit. Removing a bit of waffle.

Interesting to hear that - I don’t think the majority would agree that there could have been much more in it though.

> Oliver picked an interesting subject, but could really have benefitted from giving a concrete reason for using this language - the benefits of functional languages over imperative perhaps? As it was: interesting but ultimately not useful for everyday coding

I was leaving that part open to your own imagination at this point. I think I did mention areas in which people are currently using F#, and of course general internet content about functional programming will bring up a lot of ideas. Anyway, I think you got the right impression - for the majority of developers, F# is probably not an everyday programming language today, and who knows if it will ever be.

> … I was left wondering why I would choose to use it for data access over c#

I wasn’t saying you would. Some of the techniques I showed were from the functional part of the programming world, but that doesn’t mean you can only use them in F# either. In general the session was supposed to be an introduction to the language and some of the more obscure (from the typical .NET programmer’s point of view) practices, as well as to point out that F# is a .NET language after all and a lot of the standard technology can be used just as easily as it can from C#.

> Interesting stuff… though more of an introduction to F# than handling data!

Yes, that’s what it turned out to be. Or at least it was half and half, I guess… the NxtGenUG guys always ask for bleeding edge technology and their event focus was where the data handling part came from. On second thought, it turned out that the necessary basics took up a bit too much room in this presentation. Will have to ask for a double slot next time, to do a separate introduction and the data handling thing in its whole glory :-)

> I liked the happy go lucky presentation style

Eh? :-)

> … it was too left field for a mainstream session ….

I agree. It wasn’t supposed to be a mainstream session. The way I’ve always understood it, the NxtGenUG Fest isn’t supposed to be a mainstream event.

> personally I dont and neither did anyone around me have any real interest in F#

Out of the other 52 who left feedback, around 48 did though.

> Really not sure

I think the answer is 42. :-)

1/7/2008

Remapping Command keys to Ctrl in VMWare

Filed under: General, Mac — Oliver Sturm @ 5:19 pm - 3 months, 1 week ago

On the Mac itself, I have remapped the caps lock key (does anybody actually use that thing these days?) to Command (that’s the key with the weird symbol… ah well, one of the keys with weird symbols <g>) . I had always done the same thing on Windows, where it required registry changes, so I was positively surprised to find that on the Mac it’s just a system preferences option… Microsoft, here’s how you do that kind of thing:

200807011814.jpg

Now, while I’ve found it useful on the Mac to have the Command key easily accessible (although Ctrl is still used in too many places, like terminals and things… gotta find a solution to that), that key is recognized as a Windows key in VMWare. So I changed one of the registry trickery files so that the Windows keys get remapped to Ctrl for use in Windows. Works like a charm. Here’s what the content of that .reg file looks like:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,5B,E0,1d,00,5C,E0,00,00,00,00

Hope it helps somebody!

14/6/2008

Blogging from my new MacBook

Filed under: General, Mac — Oliver Sturm @ 10:59 pm - 3 months, 3 weeks ago

Would you believe it, I got a MacBook recently. It’s fantastic, there’s no other way to describe it. OS X is amazing, Windows apps seem to run faster in VMWare Fusion than they do on native Windows, and the applications are just… well, can’t find any more superlatives. Holy cow!

I’ll certainly post more about this in the future. I’m not planning on abandoning Windows, or .NET, or anything like that - on the contrary, I want to see what other platforms have to offer these days, be it for competition or compatibility. Mono is supposed to be able to run most Windows Forms apps these days, I hear… now I only need some time :-)

If you haven’t had a look at the Mac since they started building Intel based machines, go do so as soon as you can. You are really missing out.

8/6/2008

TechEd done, NxtGenUG FEST 08 is next

Filed under: General — Oliver Sturm @ 4:16 pm - 4 months ago

I’m still in Orlando now, but later today I’ll be on a refreshing (?) flight back to the UK. TechEd was very good — lots of people very interested in DX products, we won loads of awards and had a good laugh about the Telerik guys ;-)

Later this week I’ll be in Reading for the NxtGenUG FEST 08 event on June 12th. Hate to state the obvious, but it’s the 2008 incarnation of their yearly FEST event. A day of great speakers and sessions, the usual (well, usual for NxtGenUG standards — if your’e not familiar with it, be prepared to be amazed) assortment of swag, pizza and so on… It costs a bit of money for non-members of NxtGenUG, but it’s still quite a bargain at 49.99, and of course it’s free for members. Sign up is here, and there’s a G(r)eek dinner the night before. Originally it was planned to send Daniel Moth off to the states, but now I hear he can’t make it to the dinner… anyway, if you happen to be in Reading on the night of the 11th, sign up here and join us for the geek dinner!

Right, that’s it — I have some sessions to prepare…

21/5/2008

BA Executive Club? Ridiculous.

Filed under: General — Oliver Sturm @ 6:23 pm - 4 months, 2 weeks ago

I’ve had a BA Executive Club account for about 18 months. During that time I must have been on perhaps 15 BA flights - some UK domestic, some within Europe, some to the US. For quite a while I’ve also had a BA-sponsored American Express card, which pays miles into my Executive Club account. I’m not flying on BA all the time, because I find that pretty hard to do - basically I wouldn’t pay extra to fly with a particular airline, and usually it’s hard enough to find flights that go to the right place at the right time anyway. Overall I certainly fly more than most people I know. I’ve collected roughly 30000 miles up to now - is that much? I don’t know.

Today I thought I’d look into something that I’ve never looked into before: see whether it makes sense to upgrade a flight with those miles. I’d tried before to use the online function to do that, but every time I’d been told there was some sort of problem and I should contact my "booking agent". Flight booked online, sometimes even through BA directly, so wtf is that about the booking agent? Why no proper information about what the problem is? Hm…

So I took the time to call them and spend 20 minutes in a phone queue. Of course it was the wrong phone queue - even though I’d taken the number from that online error page, there’s a different, Executive Club specific number I should be using. Okay, got transferred. Other girl, same problem, transferring me elsewhere again. Finally somebody who knows what to do, he looks at my booking and goes "well, that’s not the right kind of ticket". What? Kind of ticket? "Yes, you should have a ‘flexible’ ticket so you can change it later. When booking online, there’s a choice between a cheap and a flexible ticket." Ah, how stupid of me.

I ask the guy if I could theoretically get anything useful for my 30000 miles on my flight to Orlando and it turns out that 25000 miles will buy me an upgrade to World Traveller Plus. Wow! Hallelujah! Just 18 months of careful airline selection and already can I afford 10 additional centimetres of leg room! So he goes, "I’m going to call our sales guys and ask them what the upgrade to a flexible ticket would cost for the trip." Comes back, and it turns out that upgrade costs about 420 quid. I say hey, that’s a bit expensive, isn’t it and he replies "no, and that’s just for one leg of the trip because <weird stuff here> - you can’t get the upgrade on the way back, but for the one leg it’s just 12500 miles".

Phew. That’s it, is it? Pay around 3 times the price for the London-Orlando leg of the trip to get a flexible ticket, and then 12500 miles to upgrade to the next, almost identical, class of travel. Frickin’ unbelievable.

Now, people tell me there’s more to frequent flyer programs - for instance, when you fly enough within one year, you get into a higher class and then you get all sorts of benefits like 150% miles on the mile (What’s the idea with "miles" anyway? The miles I get credited don’t have any similarity to the distance between the start and end of my flight.) and free upgrades to higher classes. Well, BA do 125% and 150% miles, yes. Other benefits available here (or probably not, because you have to be a privileged person with your own login in order to see this). But as far as I can tell they never give me any free upgrades, whatever I do. And most importantly, to be a better Executive Club member than I am today, I need to collect Tier Points. Now wtf are Tier Points suddenly? Check my account - I have ZERO of them. I need another 600 and 4 qualifying flights to get to Silver membership. Hm…

Looking around, I see where to get Tier Points from. Obviously I don’t get them from the kinds of flights I always use, otherwise I’d have some. But there’s a wild list stating that depending on the class and area I fly in there are 20 different fare classes (yes, really!) and all of them collect Tier Points (no further details). For some reason apparently I manage to travel outside these classes all the time - no info on that either.

Now how to figure out what fare class a ticket is in? Oh, easy: look at your boarding card. Yes, that card you get at the airport to carry around for an hour. And yes, the info is on that part of the card that gets ripped off and taken away from you when you board your plane. If you have some form of printed ticket that nobody uses anymore these days, it might also be on there. E-Tickets? Nah, not on there. Well, go figure.

Eat shit, Executive Club.

20/5/2008

F# compiler considered too linear

Filed under: General — Oliver Sturm @ 6:33 pm - 4 months, 2 weeks ago

In my continuing efforts to make XPO work fully with F#, I found the next problem to deal with: the extremely linear way of thinking of the F# compiler.

Basically, the compiler seems to read each source code file from top to bottom. Generally, things that are defined below the current line can’t be referred to in the current line. Apart from the order of lines in source code files, the order of source code files in the project is equally important, since the compiler handles them in precisely that order. 

Hint for Visual Studio users: While the order of source code files in the project is represented correctly in the Visual Studio Solution Explorer, it can’t be changed from there. Instead, it is necessary to edit the project file and swap source code files around manually. Right-click the project in Visual Studio and select "Unload Project" from the context menu. Right-click the project again and select "Edit <projectname>.fsharpp". When you’re done making your changes, use the context menu a third time to select "Reload Project". You will see that the order of files in Solution Explorer has changed according to the changes you made in the project file.

In some schools of though on programming, this linear view of things might seem quite normal, but in .NET it is not. In main-stream .NET programming, it was widely regarded a great innovation when C# took care of the old problems that C and C++ had in that regard (no more header files!!!). Pascal wasn’t any better, and many other languages - most of them had some sort of "pre-declaration" feature that had to be used when, for instance, a reference to a certain type needed to be created before the type itself was declared. Nothing like that in C# — the compiler looks at all the types and namespaces declared somewhere in my current project and figures things out for me. Great, that’s how it should be.

In all fairness, in F# there’s at least one very obvious reason why the compiler takes that linear approach: type augmentations. They basically mean that depending on the position in code, a class might have a certain member or not. If you’re not familiar with the feature, look at this example:

type MyClass() =
    let answer = 42
	
let mc1 = new MyClass()
	
// At this point Output can't be found on mc1
//mc1.Output()
	
let output x = printfn "%d" x
	
type MyClass with
    member x.Output() = output 52
	
let mc2 = new MyClass()
mc2.Output()
	
// Now Output is part of MyClass, so I can even call
// it on my "old" instance
mc1.Output()

Before I get to my particular use case — just generally speaking, the ordering requirements introduced by linear compiling seem like a great and quite unnecessary hassle in the vast majority of cases. F# has a very strong type inference system, because it is deemed to be unnecessary for the developer to mark all types explicitly in order to implement strong typing. In the same way, the compiler could automatically find types and namespaces in my current project regardless of their location, and it could detect those cases where types change through augmentation.

The particular case I’m dealing with is that of persistent business class hierarchies. These hierarchies are typically interrelated to the point where one or more networks of classes are formed. As an example, consider modelling a hospital. You’d have a whole bunch of different types of people to store, so you’d have classes for People and Addresses, Employees, which might be Nurses, Doctors and cleaning and housekeeping personnel, Patients with relationships to the Nurses and Doctors, Rooms, Floors and OperatingTheatres which are assigned to Doctors or Teams of Doctors. Visitors, CarParks, the whole Accounting and Booking business… the list is endless. It is quite clear that many of these types have references to many other types, and typically a one-to-many relationship is modelled with a collection property on one end and a simple reference on the other end, so as soon as there’s a relationship there, it will result in two classes interrelating.

Sure, not all classes interrelate, so it might be possible, taking a lot of time and great care, to separate the classes into groups that are hopelessly tangled, but have only unidirectional references outside the group. Of course it might make sense in the example above for almost all classes to have a reference to the Hospital type, since that is important if there’s ever more than one hospital being handled at once. There might be other such "special", high-level objects that make the grouping approach really complicated. In any case the task of sorting the classes into such groups is extremely tedious and the grouping breaks easily, as soon as any class is changed to include or exclude a property that refers to another class. You might wonder why I’m going on about the grouping thing at all — well, read on, that’s what F# wants me to do.

Have I mentioned that persistent business class hierarchies can be large? Apart from having private fields and public members for each and every piece of data that is associated with the various entities, the classes will typically also contain certain parts of business logic functionality. Depending on the architectural approach that is used, validation logic might live in these classes, as well as a lot of the state handling that many entities need. To mention some numbers, a C# project I’ve worked on myself — really just a medium size application — has 75 persistent classes and a total of 11263 lines of code in these classes.

Now, why am I going on about these interrelated networks of classes? Quite simple: because F# requires me to declare all interrelated classes in one block of code! Yes, that’s right. I can’t put some of the classes into other files. I can’t put them in different namespaces. The only valid syntax to declare interrelated classes in F# is this:

type ClassA() =
    let foo = new ClassB()
	
and
 ClassB() =
    let foo = new ClassA()

As you can see, this uses the "and" keyword to concatenate the two type declarations. This doesn’t hold true for classes only, but for all types. One of my first thoughts about this was that it shouldn’t be that much of a problem if my application made use of lots of interfaces and dependency injection throughout to remove the need for direct references from one class to another. But in the end this approach only shifts the problem to the interfaces - at a rough count, that class hierarchy from my old project would require me to declare 75 interfaces with 520 properties and around 300 other members. For those declarations, the problem is still the same, and while the volume may be smaller, it’s still significant. Plus, of course, it requires my application architecture to work in a very specific way, I need to create all those interfaces for no real reason whatsoever, … doesn’t sound like a very good idea.

In the end I don’t think that this problem is entirely particular to my use case. In other class hierarchies, dependencies might typically be somewhat more linear than they are in those hierarchies I’ve described, but interrelations are still rather common. So here are the important points I want to make:

  1. For this particular use case, we need a change that allows us to declare interrelated classes separately. There’s a very similar problem for namespaces - perhaps not quite as severe, but that’s just because there aren’t going to be as many namespaces as there are classes. To solve these issues, I guess a "pre-declaration" feature like I described above could do the job (perhaps as an attribute), but what we really need is … see (2).
  2. The F# compiler should handle all type resolution matters automatically, independent of declaration order, apart from those cases where order is important due to type augmentation. It is my belief that the compiler could detect such "significant-order" cases automatically, so there shouldn’t be a need for any new keywords or decorations to make this work. This intelligent implementation is what I expect from a language compiler in the year 2008, and with the ambitions F# has as a multi-paradigm language, we should expect no less.

19/5/2008

Null values for F# classes

Filed under: General — Oliver Sturm @ 10:34 pm - 4 months, 2 weeks ago

The next problem I found in my efforts to make XPO work with F# is documented here: Null values for F# classes - basically, I can’t just set a variable that has a reference to another object to null in F#.

The general assumption in F# is that null values are a threat and so the languages discourages their use. I totally see the point and if all I wanted to do was create classes (or perhaps not even those) for use in F# itself, I wouldn’t have a problem with it - but interop is an important thing for F#, as I see it, and all the rest of the .NET world makes elaborate use of null values. Null values are the (rather more dangerous) alternative to F# Options to most .NET developers - exactly the same purpose, just a less elegant implementation.

I haven’t given up on the Hub yet, although I have to say I haven’t received any useful replies from there yet… and the people who do reply are rather those that like to write forum posts than those who really know what they’re talking about ;-) Anyway, perhaps I’ll get lucky with a blog post again - Brian, are you still reading? ;-)

UPDATE: I found the solution to this problem in the release notes for F# 1.9.4: use the Unchecked.defaultof<T> function. I guess that’s the new functionality that was referred to earlier. Great!

18/5/2008

gentoo/Shorewall/DISABLE_IPV6

Filed under: General — Oliver Sturm @ 1:07 pm - 4 months, 3 weeks ago

Something I just stumbled upon. I was configuring Shorewall 4, and there’s a flag called DISABLE_IPV6 in shorewall.conf. Oh yeah, I thought, that makes sense - I don’t yes IPV6, so I’ll set that to Yes. Did so, and when I ran Shorewall it showed my lots of error messages like this:

FATAL: Module ip6_tables not found.
ip6tables v1.3.8: can't initialize ip6tables table `filter': iptables who? (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.

Well, I don’t have ip6_tables compiled, which is just the reason I liked that flag when I saw it. Read the source, and I found that the flag doesn’t mean "don’t use IPV6", but rather it means "use ip6tables to take some special action to disable IPV6". Well.

I searched for the piece of documentation I was missing (because I wasn’t assuming there’d be anything to misinterpret about the meaning of that flag), but I still can’t find anything… apart from this forum post where somebody states "… this is because in a perversely twisted form of logic the configuration file requires you to have IPV6 support to be able to disable it …" Well put.

16/5/2008

Oddities in F#/C# interaction

Filed under: General — Oliver Sturm @ 11:29 pm - 4 months, 3 weeks ago

I have been working on getting a sample for using XPO from F#. My first sample was easily created back in January this year:

#light
open DevExpress.Xpo
type Person = class
  inherit XPObject as base
  public new(session : Session) = { inherit XPObject(session);
    name = string.Empty
  }
	
  val mutable private name : string
	
  member public x.Name
    with get() = x.name
    and set(v) = x.name <- v
end
	
let person = new Person(XpoDefault.Session)
person.Name <- "Wally"
person.Save()

This works just fine - great. Now I wanted to create a slightly more evolved sample using more of the standard XPO features, and use that to develop some best practices. I also had the idea to create some CodeRush templates similar to those we have for C# and VB.

All this turned out much more complicated than I thought, for a variety of different reasons. The first issue I stumbled upon was that I can’t call our standard helper method SetPropertyValue correctly from F#. It looks like a bug to me, since I did a lot of very similar tests, and only with the precise combination of parameters and return type that this method has does the F# call to it fail. If it’s confirmed to be a bug, it’ll get fixed - but so far I haven’t heard anything, and I want a workable solution now.

I started working on one - see below -, but first I had to decide which type of mutable fields I was going to use for my persistent classes. F# allows class fields to be declared "mutable", which means they can be changed (if this sounds like an ordinary thing to you, I recommend you read up on your functional programming theory <g>). It also allows to declare values as "ref cells", which wraps the actual values in an additional class internally.

Our standard SetPropertyValue method uses a "ref" parameter in its C# implementation. Of course that method isn’t working anyway, so I was considering writing my own helper method for the time being. C# ref parameters are not something F# deals with extremely gracefully in my opinion, the main reasons for which are probably that changeable values are not foremost in peoples’ minds in that language, and there’s support for multiple return values using tuples, so the use cases from ref parameters are much reduced anyway. The only way (afaik - a topic I’m still a little unsure about) that F# ever passes a parameter by reference is if the value I’m using is a ref cell in F#.

The problem with using multiple return values instead of the by-reference type method, whether we’re talking about the standard helper method or a new one, is that it changes the requirements of the syntax at the call site. Optimally, I would like the helper API to be very easy to use. I also want to perform change notification from within the helper method. Using multiple return values, the pattern could look like this:

let setValue oldVal newVal =
    ((oldVal <> newVal), newVal)
let testSetValue1 newVal =
    let mutable testval = 10
    // This is the line I'd need in my property setters
    match (setValue testval newVal) with | true, __n -> testval <- __n | _ -> ()
	
    printfn "testval: %d" testval
	
testSetValue1 10
testSetValue1 42

There are several things wrong with this. First, the line I need to use in each property setter is rather complicated. I’d integrate it in a template, but there are people who don’t use templates, and anyway it just looks wrong to reproduce that sort of thing in every single property. Second, the naming of the helper function is really no longer correct - it doesn’t actually set the value of the property anymore, it just finds out whether setting the value is required at all. Of course if that’s all I want to do, I should change the function’s name and I don’t need multiple return values after all… the real problem is that the actual setting of the value happens in the property setter code. And that brings me to third: if I was to integrate change notification in the helper function, this would now happen before the property change actually takes place (and that’s still assuming that it takes place at all, which is not under the control of the helper function anymore).

So all this looked bad to me and I decided to go with the by-reference type helper function after all. This works only if the value I’m actually setting from inside the helper function is a ref cell. In C#, it’s possible to take any given variable and pass a reference to it into a method that requires such a reference. Not so in F#, apparently. Unless a value is declared to be a ref cell, it can’t be used in this way. Declaring as a ref cell in turn means that there’s an extra wrapper class created for the value - quite a bit of unnecessary overhead it seems, particularly when dealing with large numbers of fields such as there are typically in persistent classes. But since ref cells are the only way to make the F# compiler pass something by reference, there’s no way around that. I did some additional tests with temporary ref cells and other things, but this only made the overhead worse, not better. So I decided to accept things as they are and move on.

One other thing I should mention about ref cells: they require special syntax when used in code, basically they need to be dereferenced in order to access the actual value. So instead of writing "foo" to access the value foo, I now have to write "!foo" (yeah, looks like "not foo", but it’s not, if you know what I mean <g>). Quite inconvenient as well, if you write a lot of business logic in your class and prefer to use the private field directly. Probably better to use the public properties where possible, then you don’t have that problem.

My next step was to try and pull the helper functions which can’t be called in their original C# implementation into F# as a workaround. That looked pretty simple to begin with - our C# implementation is actually quite a bit more complex because we have to jump through some hoops to get the equality comparison right (that’s the reason for having the conflicting overloads I mentioned earlier). I created a base class that I was going to use for further objects:

type FSharpBaseClass =
    inherit XPObject as base
    public new(session: Session) = { inherit XPObject(session) }
    member public x.SetPropertyValueFS propertyName oldVal newVal =
        let needsSetting = !oldVal <> newVal
        if needsSetting then
             oldVal := newVal
        x.OnChanged(propertyName, !oldVal, newVal)
        needsSetting

And lo and behold, here’s the next inexplicable F# issue: I can’t call the OnChanged method! Again, no idea why that is - I did a bunch of tests with very similar setups and all of these work. OnChanged can’t be called though, I get a compiler error: Error 5 A protected member is called or a base variable is being used. This is currently only allowed in the direct implementation of members since they could escape their object scope.

Of course there’s not a single page that Google can find about this problem, that would have been boring. Ah well. That’s it for today in any case. To be continued.

28/4/2008

WPF styles and default behavior

Filed under: General — Oliver Sturm @ 5:59 pm - 5 months, 1 week ago

After my recent presentation at the VBUG conference, somebody sent me this question: "I have code to style a button and several triggers to change the button’s background color. For some reason, the trigger for the IsPressed property doesn’t seem to work. Why?" Here’s the style code that was being used (this actually includes some changes I made to the original, but never mind that):

<Style TargetType="{x:Type Button}">
  <Setter Property="Background" Value="Red"/>
  <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
      <Setter Property="Background" Value="Green"/>
    </Trigger>
    <Trigger Property="IsPressed" Value="True">
      <Setter Property="FontWeight" Value="Bold"/>
      <Setter Property="Width" Value="200" />
      <Setter Property="Background" Value="Lime" />
    </Trigger>
  </Style.Triggers>
</Style>

With a few buttons on a form and this style code installed in App.xaml, you can easily see that he’s right - the IsMouseOver property change triggers a change of the background color to green, but IsPressed seems to do its job only partly, since it misses setting the Background property to Lime. In the original example, the change to the background color in that trigger was actually the only thing that was supposed to happen, so it looked like nothing was happening at all. With my changes, it seems obvious that the trigger is observed correctly, but the Background property change doesn’t seem to be executed.

The reason for this behavior is simple: there are standard templates in place that format the buttons in the way we’re normally used to seeing a button formatted. On Vista that means setting the background color to a certain gradient, displaying a rounded rectangle, and having certain animations in place that are executed when the button is focused, the mouse moves over it or it is clicked. This standard behavior is also implemented as control templates using triggers, and so interests collide - the triggers in the sample code actually do set the background color to Green or Lime, only the standard trigger quickly starts doing something else. As a result, the IsMouseOver trigger sets the color to Green only for a short while before the standard animation sets in, and in the IsPressed case the color is actually never seen.

To solve this problem I used Blend to get hold of the standard control template for a button. I opened my test solution in Blend, selected one of my buttons and used the context menu entry Edit Control Parts (Template) | Edit a Copy… to have a block of code for the base template inserted into my XAML file. Note that this block is inserted into the Window class XAML file by default. In many cases this is actually the sensible solution, but in the sample application I had my styles defined in App.xaml, so I had to move the block across to that file. If you do this, be aware that there’s also an XML namespace Microsoft_Windows_Themes inserted by Blend, which you have to move together with the code in order to make things work.

Now, if you have a close look at this code that has been created by Blend, you will see that there are three "events" called RenderDefaulted, RenderMouseOver and RenderPressed configured to call various elements of the ButtonBase class, which are pulled in using the TemplateBinding syntax extension. In addition, there are some triggers that are also involved with changing the button’s appearance in response to various events.

For this example, I chose to remove all those elements to break things down to an extremely basic button that doesn’t react visually anymore (apart from my own triggers) to mouse moves or clicks. In reality this might not always be the right thing to do - this article is just meant as a starting point for readers to figure out what they need to do in their own use cases. Anyway, after my modifications, this is what I was left with:

<ControlTemplate x:Key="buttonTemplate" TargetType="{x:Type ButtonBase}">
  <Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome"
     SnapsToDevicePixels="True"
     Background="{TemplateBinding Background}"
     BorderBrush="{TemplateBinding BorderBrush}">
    <ContentPresenter
       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
       Margin="{TemplateBinding Padding}"
       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
       SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
       Content="{TemplateBinding Content}"
       ContentTemplate="{TemplateBinding ContentTemplate}"
       RecognizesAccessKey="True"/>
  </Microsoft_Windows_Themes:ButtonChrome>
</ControlTemplate>

Blend had automatically inserted a Template attribute for this control template into XAML, to make the particular button, which I had called the context menu on, work with this template. So I just had to run the application and there it was - two buttons still working in the same way as ever, and a third one without any of the animations and perfect green and lime colors depending on mouse state. Great!

You can download the source code for my test application here: WPFControlTemplating.zip (9016 bytes)

27/4/2008

Impressions from the VBUG conference

Filed under: General — Oliver Sturm @ 1:59 pm - 5 months, 1 week ago

VBUG did their Spring 2008 Conference last week. In the beginning, Andy was tired , Chris was enthusiastic and Tim was … … also there. Dave was hungry and then he couldn’t get in . When he finally made it, he was the only one in Rich’s session and had to be revived . Not quite Dave’s event - he was scared of his computer and ended up starting his own presentation early .

Mark , Gary and Rich sang , and everybody danced

In the end it was all as it should be.

Great event, guys!

DX takes all the awards plus Product of the Year

Filed under: General — Oliver Sturm @ 11:55 am - 5 months, 1 week ago

Developer Express have won each of the 8 (eight!!) categories we entered for this year’s asp.netPRO Magazine Reader’s Choice Awards. Wow!

The categories we entered were Best Add-in, Best Charting and Graphics Tool, Best Component Set, Best Grid, Best Navigation Suite, Best Online Editor, Best Printing/Reporting Tool and Best Scheduling/Calendar Tool. Our overall package DXperience was also named Product of the Year.

Look here for more info, the official thank-you to everybody and a few words from Julian.

25/4/2008

Locked myself out of Vista? Help! - Solved

Filed under: General — Oliver Sturm @ 12:28 pm - 5 months, 2 weeks ago

It appears I’ve managed to do a pretty stupid thing - personally I rather feel like Windows let me do a stupid thing, but that’s probably a matter of perspective ;-)

Anyway, I was trying out some things with UAC, looking at the way different elevation prompts are displayed depending on whether or not the current user is an Administrators member or not, and so on. Previously I was working in what appears to be the default configuration, which my user account being a member of the local Administrators group and the Administrator account disabled and without password.

I activated the Administrator account and gave it a password. Then I removed my own account from the Administrators group and added Power Users instead. I played around with this setup and then decided to go back where I came from - only I made a mistake, I disabled the Administrator account first, before assigning the Administrators group back to my own account.

As a result, I can’t currently find a way to get Administrator privileges on my system! I can’t log in as Administrator because the account is disabled. For the same reason I can’t use the "runas" command to run any admin tools. And elevation offers only my own account (pretty weird that - why does it offer to elevate into my own account if I’m not an Administrators member at all?), which allows me, after entering my password, to bring up Computer Management - but I still can’t make changes to any account settings, obviously.

What do I do? I can see that I wasn’t thinking enough before making those changes, but I’m still having a hard time believing that I managed to lock myself out completely, i.e. the only solution is a restore from backup. Any ideas, please?

 

Update: I found a solution on this very helpful page: http://www.jimmah.com/vista/Administration/locked_out_of_admin.aspx I feel quite lucky that the no. 1 option actually worked for me and I didn’t have to use any of the other two - but at least there seems to be hope even if the situation is worse than mine turned out to be. In case you need that article and the above link should have stopped working, I have a local copy of it that I might be prepared to pass on in that event. Thanks to everybody who helped!

Next Page »

Powered by WordPress
© Copyright 2005-2008 Oliver Sturm