An Agreeable Procrastination – and the blog of Niels Kühnel

Code, the universe and everything

Archive for August 2010

Best Chrome Theme Ever

with one comment

I’ve just changed my Chrome theme to “Candies”. It really adds a feeling of Cillit Bang® effectiveness to my browser experience.

Chrome theme

The “Candies” theme in Chrome

The only problem is the pin-up girl that it adds to your Chrome home page. So it’s not a good idea to use the theme when you show people stuff on your computer unless you want them to think that you’re a porn enthusiast.

Chrome theme 2

You will show the audience this girl if you don’t watch out.

In short: 1) Use the theme. 2) Avoid situations like this:

Conference Attendee 1: “Did you see the presentation about that new CRM system?”
Conference Attendee 2: “You mean the one by Onan the Babarian?”
Conference Attendee 1: “Yes.”

Written by niels.kuhnel

August 31, 2010 at 2:08 pm

Posted in Uncategorized

Unicode’s sad lack of intellectual smileys

with one comment

Recently amused by the “WTF”-punctuation mark in Unicode (“Interrobang”, U+203D), a quest for exotic punctuation marks on Google led me to some even cooler ones: Henry Denham’s rhetorical question mark, Marcel Bernhardt’s later use of the same symbol as the Irony Point (a reversed question mark) and Hervé Bazin’s doubt point (clip_image002), certitude point (clip_image004), acclamation point (clip_image006),authority point (clip_image008), indignation point (clip_image010) and love point (clip_image012). Even though the latter are from 1966, they demonstrate that smileys were needed long before teenagers got access to emails :); The rhetorical question mark  is from the 1580s and the Irony Point from the late 19th century. Sadly, none of these great symbols have codepoints in Unicode (maybe to leave room for “Snowman” U+3020 and “Postal mark face” U+2368). As a matter of fact, there is a codepoint for a reversed question mark, but thats not the Irony Point. That’s an “Arabic Question Mark” (U+061F).

As I see it, the punctuation marks could have made the world a better place in at least two important ways:

  1. Intellectuals would have had smileys they could use without demeaning themselves (the originators of the marks mentioned were an outstanding English printer and two French poets)
  2. Lojban would probably never have been invented (a ghastly artificial language with constructs to signify, among other things, sarcasm and irony)

So, Unicode Consortium, what were you guys thinkingWTF?.

There is one good thing about the lacking Unicode codepoints, though… This in-joke for a t-shirt:


I’ll get mine as soon as possibleclip_image004[1]

Written by niels.kuhnel

August 26, 2010 at 11:56 pm

Posted in Typography

Tagged with

How to use the cool, new OpenType features in Word 2010

with one comment

It’s really nice to see that Microsoft finally provides support for the standard they defined themselves only 14 years ago. The advanced typography features of OpenType, now enabled in Word 2010, makes your documents look so much more professional and aesthetically pleasing. Especially when they’re combined with features already present in earlier versions of Word.

However, all this is disabled by default. Here’s how to enable it:

1. Change the “normal” style to enable the features everywhere:

OpenType features in Word2010 - Change font settings, small

2. Enable hyphenation


And now, look what you’ve got: Kerning (must have), ligatures (must have – special characters for certain character “collisions” like fi, ffi) and old-style figures (optional, but looks really nice and fancy ad agency’ish).

OpenType features in Word 2010

It looks like the everyday typophile can finally retire LyX + XeLaTeX. XeLaTeX’ll probably have some sophisticated features, still not present in Word, but in comparison Word documents are extremely convenient as they can be emailed to and fro for comments and collaboration, without telling people how to install MikTeX, LyX and follow various intricate guides to set it up right.

One more thing… You probably want to create a PDF when you’re nicely looking document is done. And you have probably used Type 1 flavoured OpenType fonts (the ones form Adobe that have so-called CFF outlines), and then you find that your PDF looks miserable and text can’t be selected when you use Word’s build-in export function. That’s because Word doesn’t support OpenType fonts with CFF outlines.  Luckily a free remedy (soon again) exists if you want to have both automatically generated table of contents AND OpenType fonts with CFF outlines. The PDF-T-Maker. For some reason it doesn’t currently work with Word 2010. I have created a patch and sent it to them. To avoid licensing issues I will not publish it here, though.

Written by niels.kuhnel

August 26, 2010 at 4:47 pm

Recursive functions in markup (fun with delegates)

leave a comment »

Sometimes it would be nice to do recursive functions in user controls (for instance, when doing menus).
You can’t define functions like void RenderMenu(IEnumerable<MenuItem> items, int level) { ... } in markup files unless you’re up for some serious Response.Write’ing in a <script runat=”server”> block (which kind of kills the purpose of markup files in the first place). What you can do, however, is to assign values to variables and these values can be delegates.

So you can go like this:

Action<IEnumerable<MenuItem>, int> renderMenu = null;
renderMenu = (items, level) => {
    %><ul class="level-<%=level>"><%
    foreach( var item in items ) {
      <li><a href="<%=item.Url>"><%=item.Title%></a>
      <%if( item.Children.Any() ) {
           renderMenu(item.Children, level + 1);

renderMenu(MyMenuItems, 1);

It’s surprising that you can embed HTML in a delegate, but if you know how the ascx parser works it’s probably obvious (I don’t).

Now, it’s important to assign “null” to the delegate variable first, and then assign the actual function in a later statement. Otherwise you can’t do recursion because the compiler complaints about the variable not beeing initialized.

The fact that you have to do “Action<bla, bla, bla...> foo = null; foo = (bla, bla, bla..) { ... }” to define the function is arguably not very aesthetically pleasing. It’s also a shame that you must define the function before you use it. But if you use this construction a lot you’ll probably just get used to it as the way it is, and it’s really convenient to be able to do recursion in markup – with embedded markup.

(How about casing? It’s a local variable so it should be camelCased. But it’s used as a way – don’t say hack 😛 – to have a method. So should it be PascalCased?)

Written by niels.kuhnel

August 11, 2010 at 10:37 pm

Posted in ASP.NET

Tagged with ,

So it came to this…

leave a comment »

I’ve finally overcome my animosity towards blogging. This is it! (ta-da) My blog…

Written by niels.kuhnel

August 11, 2010 at 9:59 pm

Posted in Uncategorized