Contact

admin

About Me · Send mail to the author(s) E-mail · Twitter

At GROSSWEBER we practice what we preach. We offer trainings for modern software technologies like Behavior Driven Development, Clean Code and Git. Our staff is fluent in a variety of languages, including English.

Feed Icon

Tags

Open Source Projects

Archives

Blogs of friends

Now playing [?]

Error retrieving information from external service.
Audioscrobbler/Last.fm

ClustrMap

Starbucks Pricing Strategy

Posted in NonTech at Monday, 28 August 2006 00:34 W. Europe Daylight Time

I've found an interesting article about the pricing strategy of Starbucks and similar brands. Simply put, they set the prices for their small-amount products like a 200 ml coffee so high that it appears to make sense buying a middle-sized one for a few more cents. Other products of the cheaper category are simply not advertised.

The difficulty is that if some of your products are cheap, you may lose money from customers who would willingly have paid more. So, businesses try to discourage their more lavish customers from trading down by making their cheap products look or sound unattractive, or, in the case of Starbucks, making the cheap product invisible.

The article explains that this pricing strategy is actually not a recent invention:

The practice is hundreds of years old. The French economist Emile Dupuit wrote about the early days of the railways, when third-class carriages were built without roofs, even though roofs were cheap: "What the company is trying to do is prevent the passengers who can pay the second-class fare from traveling third class; it hits the poor, not because it wants to hurt them, but to frighten the rich."

Seems like I've been hit by the marketing guys too, but now I know their evil plans.

Rezept: Gewürz-Hackbällchen

Posted in Recipes (German) at Sunday, 27 August 2006 12:18 W. Europe Daylight Time
  • 2 Knoblauchzehen
  • 50 g Pinienkerne
  • 1 altes Brötchen
  • 1 Ei
  • 500 g gemischtes Hackfleisch
  • 2 Zwiebeln
  • 5 getrocknete Aprikosen
  • 850 g geschälte Tomaten aus der Dose
  • Olivenöl
  • gemahlener Kreuzkümmel
  • 1 Lorbeerblatt
  • 1 Zimtstange
  • 3 Nelken
  • 4 Kardamomkapseln
  • Salz, Pfeffer

Ofen auf 150 Grad vorheizen. Knoblauchzehen pellen, hacken und mit den Pinienkernen, eingeweichtem Brötchen, Ei und Hackfleisch vermengen. Mit Salz, Pfeffer und Kreuzkümmel würzen. Aus der Masse mit der Hand kleine Kugeln formen. 4 EL Ölivenöl in einer Pfanne erhitzen und die Hackbällchen braun anbraten. Aus der Pfanne nehmen und in den Ofen schieben.

Zwiebeln würfeln und im Bratfett andünsten. Die Aprikosen würfeln und zusammen mit den Tomaten, Lorbeer, Zimtstange, Gewürznelken und dem Kardamom zu den Zwiebeln geben. 10 Minuten köcheln.

Hackbällchen mit der Soße servieren. Dazu passt Safran-Couscous mit Rosinen.

Mái Mài Mâi Mâi Măi

Posted in General at Saturday, 26 August 2006 11:17 W. Europe Daylight Time

During my trip to Thailand in 2002 (photos buried here) I of course got in touch with the Thai language. Not that I understand Thai besides basic sentences like Sàwàt-dii khráp and Khàwp khun khráp, but the Lonely Planet pages on the Thai language are very interesting.

Thai is a language where the pronounciation of a syllable determines its meaning. In Central Thai there are five tones.

For the example the syllable mai means new, burn, wood, not? or not. The post title mái mài mâi mâi măi essentially forms the sentence New wood doesn't burn, does it? although is consists just of a single word, pronounced differently. Amazing stuff!

Now playing: Zero 7 - The Garden - Throw it all away (feat. Sia)

Caps Lock

Posted in Windows at Tuesday, 22 August 2006 16:53 W. Europe Daylight Time

Caps Lock RemovedThere was an article in a newsletter regarding the Caps Lock key. This key, used to make all letters UPPERCASE, has been bugging me for years. Caps Lock has been used in ancient programming languages like FORTRAN (the name may indicate that uppercase letters were of interest). On internet forums and in chats uppercase statements are considered as "shouting out loud", but some people don't know this little detail. Offending more experienced users is easy.

Do you really need the caps lock key? How often do you type whole sentences in upper case?

To me, the key has been useless the last years, if not disturbing. I've been hitting caps lock accidentally countless times. After realizing that I've written a whole sentence in upper case, I needed to delete the words I've just written and start over again.

For the reasons above the CAPSoff campaign proposes a new keyboard layout where the caps lock key is moved to the top right where the Print Screen, Scroll Lock and Pause keys are located and thereby letting space to other more important keys (more suggestions over here). I'm skeptical that the industry will make that move soon, but you can use your customer voice to finally make it happen by signing the petition.

To relieve you from the Caps Lock pain today, you can physically remove the key (see the image above) but this leaves and ugly crater on the keyboard. A better approach is deactivating the key: Windows uses a keyboard map that translates the keyboard scancodes to internal windows keys (virtual keys). This level of indirection allows applications to respond to the virtual keys instead of dealing with proprietary scancodes issued by keyboards with function keys for e-mail, web search and the like.

To modify the keyboard map I use a tool called KeyTweak. KeyTweak virtually allows you to change the meaning of every key of your keyboard, so be cautious! Also, the mappings apply to all users of the machine.

Besides disabling Caps Lock I've also mapped the Scroll Lock key to the built-in Windows calculator, an applet I did use before.

Getting the Next Week's First Day in .NET

Posted in Geek Mode at Wednesday, 16 August 2006 20:30 W. Europe Daylight Time

Here's a code snippet I've written last year for a test. I don't remember of what use it was to me, I found it today while removing clutter from my local project repository.

This piece of code iterates through all days of the current month and then prints the first day of the next week in the invariant culture (where Sunday is the first day of the week) and the German culture (Monday is the first day of the week).

using System;
using System.Threading;
using System.Globalization;
 
class Program
{
    static void Main(string[] args)
    {
        // The first day of the week is Sunday.
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        RunTest();
 
        // The first day of the week is Monday.
        Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("de-de");
        RunTest();
    }
 
    /// <summary>
    /// Iterates through all days of the current month and prints the 
    /// first day of the next week according to the current culture.
    /// </summary>
    private static void RunTest()
    {
        Console.WriteLine("First day of week is {0}",
            Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek);
 
        // Iterate through all dates of the current month.
        DateTime date = DateTime.Today.AddDays(-DateTime.Today.Day);
        for (int i = 0; i < DateTime.DaysInMonth(date.Year, date.Month); i++)
        {
            date = date.AddDays(1);
 
            DateTime nextWeekFirst = GetNextWeeksFirstDay(date);
            Console.WriteLine("{0} -> {1} ({2})",
                date.ToShortDateString(),
                nextWeekFirst.ToShortDateString(),
                nextWeekFirst.DayOfWeek);
        }
    }
 
    /// <summary>
    /// Returns the date of the next week's first day for a given <see cref="DateTime"/>.
    /// </summary>
    private static DateTime GetNextWeeksFirstDay(DateTime date)
    {
        int daysUntilNextWeeksFirstDay =
            Convert.ToInt32(Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek) -
            Convert.ToInt32(date.DayOfWeek) + 7;
 
        if (daysUntilNextWeeksFirstDay == 8)
        {
            daysUntilNextWeeksFirstDay = 1;
        }
 
        return date.AddDays(daysUntilNextWeeksFirstDay);
    }
}

Output (shortened):

First day of week is Sunday
08/01/2006 -> 08/06/2006 (Sunday)
08/02/2006 -> 08/06/2006 (Sunday)
08/03/2006 -> 08/06/2006 (Sunday)
08/04/2006 -> 08/06/2006 (Sunday)
08/05/2006 -> 08/06/2006 (Sunday)
08/06/2006 -> 08/13/2006 (Sunday)
08/07/2006 -> 08/13/2006 (Sunday)
...
First day of week is Monday
01.08.2006 -> 07.08.2006 (Monday)
02.08.2006 -> 07.08.2006 (Monday)
03.08.2006 -> 07.08.2006 (Monday)
04.08.2006 -> 07.08.2006 (Monday)
05.08.2006 -> 07.08.2006 (Monday)
06.08.2006 -> 07.08.2006 (Monday)
07.08.2006 -> 14.08.2006 (Monday)
08.08.2006 -> 14.08.2006 (Monday)
...

Rezept: Gulasch à la Markus

Posted in Recipes (German) at Monday, 14 August 2006 20:09 W. Europe Daylight Time

Markus hat ein leckeres Gulasch-Rezept veröffentlicht. Mir hat es immer sehr gut geschmeckt, weswegen ich nochmal eine "Sicherheitskopie" anfertige.

  • 1 kg Rindfleisch, am besten Rouladenfleisch, jedenfalls das Beste was zu kriegen ist
  • reichlich Olivenöl
  • 5 große Zwiebeln, geschwürfelt
  • 10 Knoblauchzehen (kann auch mehr sein), in Scheibchen geschnitten
  • 2-3 EL Tomatenmark aus der Tube
  • reichlich frisch gemahlener Pfeffer
  • 1,5 TL Salz
  • 1 Flasche Rotwein
  • 1 Liter Hühnerbrühe
  • 7 Lorbeerblätter
  • 2 Becher Sahne
  • 250 g Backpflaumen, halbiert

Das Olivenöl erhitzen und klein geschnittene Fleischstücke (ungefähr so groß wie bei Geschnetzeltem) kräftig anbraten. Zwiebel, Knoblauch, Salz und Pfeffer dazugeben. Alles so lange weiterbraten, bis die Flüssigkeit weitgehend verkocht ist und am Topfboden langsam anbäckt. Kurz bevor es anbrennt, mit 1/2 Flasche Rotwein ablöschen, den Rest trinken. Alle anderen Zutaten dazugeben, aufkochen lassen und 50-60 Minuten bei mittlerer Hitze köcheln lassen. Dabei häufig umrühren, damit nichts anbrennt - das wäre sehr ärgerlich. Das ganze schmeckt gut mit Basmatireis, aber Nudeln sollen wohl auch ganz lecker dazu sein.

RDP/Terminal Services Port Configurator for Windows Mobile

Posted in Mobility | Tools and Software at Thursday, 10 August 2006 21:11 W. Europe Daylight Time

Remote DesktopWindows Mobile devices come with an integrated Terminal Services client (also known as Remote Desktop Protocol, RDP). This client allows you to connect to any Remote Desktop-enabled machine like Windows XP Professional, Windows Server and Linux (another here). Actually a tempting idea to connect to your home machine if you're abroad. You just need a some kind of internet connection.

The Network

If there are multiple machines in a firewalled network the only public IP address known on the internet is the one of the router. The default server port for RDP connections is port 3389 (TCP protocol). RDP clients use this port when connecting to a RDP server. What happens if an internet user (RDP client) connects to port 3389 on the public IP of the router? If the firewall is set up correctly, nothing, i.e. the connection is refused. To enable Remote Desktop connections the network administrator has to configure a port mapping. The port mapping basically tells the firewall to open a specific port and route all data from this port to a specific machine on the internal network (for example your Windows XP box). If two users want to expose their machines to the internet the administrator has to open two ports, because a single port is always attached to a single internal machine. See the illustration below for a general overview.

Port Mappings

The Failure of the Windows Mobile RDP Client

To connect to the first machine ("Your Computer") from the internet the user has to tell its RDP client to simply connect to the firewall (because it's the machine with the public IP address). Because 3389 is the default port this actually translates to ServerName:3389, where ":" delimits the server name from the port number. To connect to "Another Computer" the address is ServerName:3390.

This is where the RDP client of Windows Mobile fails. It just won't accept servers with appended port numbers.

RDP Invalid Server Name

The First Approach

It's actually possible to change the behavior of the Remote Desktop client to connect to non-standard ports like 3390 or any other by applying a registry hack.

  1. Open the device registry using a registry editor
  2. Open the key HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default\
  3. Create an entry of type DWORD, called Server Port
  4. Set the value to the required port number (3390 in the case above)

My Solution

It's actually a very cumbersome task to edit the registry, especially if you're changing port numbers fairly often because you need to connect to different machines. After proof-reading Torsten's book on Windows Mobile development I thought this would be an easy to automate task.

I've written a little helper application that sets the registry values for you. I've tested it on my Axim x51v and inside the emulators of Visual Studio 2005. It's a .NET Compact Framework 1.0 application so you most likely don't have to install the .NET runtime on Windows Mobile 5.0 devices.

RDP Port Switcher

DownloadDownload the RDP Port Switcher Setup CAB. Feel free to add your own functionality, source code is available.

Now playing: Big Bud - Late Night Blues - State of mind

DirectUpdate and Windows Security Policy

Posted in Tools and Software | Networking at Saturday, 05 August 2006 14:32 W. Europe Daylight Time

We are working with a DSL connection here and offer some services to the outside world, for example Remote Desktop login to each roommate's workstation. This web site is also served through this DSL connection. That's what Bill Gates must have meant when he talked about the vision of "information on your fingertips"¹.

Simple consumer DSL line like ours have an annoying "feature": The provider disconnects the line every 24 hours to force redialing the connection and thus allowing him to assign a new public IP address. This prevents offering large scale services and forces businesses to buy a more expensive connection package with static public IPs. Because nobody on the internet knowns our current IP address (as it changes every day) we use a Dynamic DNS service to update the IP addresses of our domains (www.it99.orgwww.pixelplastic.de and some others).

There are Dynamic DNS clients that monitor the connection and issue an IP update to Dynamic DNS service like DynDNS. Current routers even come with such a client. I was trying the demo version of DirectUpdate to see how it works.

DirectUpdate

This is the DirectUpdate management screen. Notice that the window is not resizable by means of the standard minimize, maximize and restore buttons (Minimize, Maximize and Restore Buttons). What happens if you log in with a resolution of 640x480 and the window floats around off-screen? You're lost. One might say that this a very uncommon case today as CRTs with this resolution are pretty much dead, but we had such a display connected to the old server.

After installing DirectUpdate everything worked fine, DynDNS updates were issued and the service ran reliably. However, the security event log filled up with strange "Audit Policy Change" events. These events occurred at random times. Each time the Logon/Logoff and Account Logon audit, which forces Windows to log successful and failed logon attempts to the security event log, was completely disabled. All other audit settings remained untouched.

Event ID: 612
User:  NT AUTHORITY\SYSTEM
Audit Policy Change:
New Policy:
Success Failure
  -  - Logon/Logoff
  -  - Object Access
  -  - Privilege Use
  -  - Account Management
  -  - Policy Change
  -  + System
  -  - Detailed Tracking
  -  - Directory Service Access
  -  - Account Logon
Changed By:
User Name: ARWEN$
Domain Name: WG
Logon ID: (0x0,0x3E7)

I've reset the Windows Audit Policy to log Logon/Logoff and Account Logon events each time a 612 event was logged but after some hours the policy change would occur again. Tracing the system events using Filemon, Regmon and Process Explorer gave no clue about the source of the error. Time to open a support case using a voucher that Torsten kindly let me use.

The Microsoft support clerk recommended disabling all non-Microsoft services (there were about four) on the system. Lo and behold, the Audit Policy Change events didn't appear again. After gradually re-enabling these services I found that DirectUpdate was the source of the policy changes. The next step was to prevent DirectUpdate from issuing policy change requests. As there's no setting on the UI regarding policy, I had to dig deeper.

DirectUpdate installs as a Windows service. Because it appears easier for the developers if DirectUpdate the service runs under the SYSTEM account, the most powerful account in Windows that's allowed to perform every operation. Why should a service that's sole purpose is to monitor IPs and sending HTTP requests run in such an unrestricted environment? I changed the service to run under the Network Service account, a restricted user for the very purpose of running services under it:

The new Network Service account [...] has a greatly reduced privilege level on the server itself and, therefore, does not have local administrator privileges.
  1. Open the Services MMC Snap-In by running services.msc
  2. Search for the "DirectUpdate engine" service
  3. Right-click, select Properties and open the Logon tab
  4. Enable the This account radio button, then Browse and enter NetworkService or browse for the localized Network Service name
    DirectUpdate Logon Settings
  5. Click OK
  6. Grant the following rights to the Network Service account
    • Change in the DirectUpdate log file folder
    • Change in C:\Program Files\DirectUpdate\Dump\
    • Full Access in HKEY_LOCAL_MACHINE\SOFTWARE\Fraggers.net
  7. Restart the service

This did the trick. DirectUpdate runs peacefully and the Security Policy doesn't get changed anymore. So, thanks again Torsten for allowing me to contact Microsoft Support on the issue!

¹ Phew, this is the ugliest Microsoft site I've ever seen.

Now playing: Yonderboi - Splendid Isolation - Motor

Windows CE Plug-In for Total Commander

Posted in Mobility | Tools and Software at Thursday, 03 August 2006 01:15 W. Europe Daylight Time

Today I was checking the list of plug-ins for my favorite Windows Explorer replacement Total Commander. There I found the WinCE file system plug-in (direct download) which plays perfectly with my Dell Axim x51v. No need to launch Explorer just to copy my podcasts to the device. It's been a pain in the neck, especially the inconsistent handling of double-clicks on the device folders: Sometimes a new Explorer window would open for no obvious reason.

The SymbFS plug-in for my Nokia phone didn't work so well, but this is maybe due the its beta state and that development ended in late 2004. If you're a Total Commander user you should definitely take a look on the other plug-ins like Events NT, Registry, ProcFS, Services and WebDAV.

BTW, Dell released firmware update A04 (German version) for the Axim x51v. This release should provide "enhanced CF I/O card performance". Several forum entries state that the update has resolved the disappearing CF card problem. I've updated my device last weekend and didn't have any problems so far.

Update: The NokiaFS plug-in works fine with my Nokia 6680.

Now playing: Aural Float - Freefloat - Soulsearching