Home About

 February 9th, 2009

C# Hello World for LINQ on Mono - 1

If you are up to date with your Ubuntu distribution you will be using Mono 1.9.1 which has support for C# LINQ build in. Enabling it is as easy as adding “using System.Linq” to your project. The following code snippet is the LINQ equivalent of a “Hello World” application:

    using System;
    using System.Linq;

    class MainClass
    {

        public static void Main(string[] args)
        {
            String[] world = { "Hello World", "Hello Mars" , "Hello Venus" };

            var rightOne = from s in world where s.EndsWith("World") select s;

            foreach(string planet in rightOne)
                Console.WriteLine("{0}",planet);
        }
    }

The first time I tried compiling it, MonoDevelop gave me the following error:

An implementation of `Where’ query expression pattern could not be found. Are you missing `System.Linq’ using directive or `System.Core.dll’ assembly reference?(CS1935)]

You can solve this by ensuring that you have added “System.Core” as a reference to your solution/project. You can do this by right clicking “References” in the “Solution Panel” and selecting “Edit References”.

 November 20th, 2008

World of Warcraft in Taiwan: Lich King upgrade - 0

The problem with World of Warcraft is that its too addictive. So to avoid that certain family members skip their homework and team up to burn unsavory characters to crisps in world I am very much reduced to playing in the middle of the night. Chances of that happening, well about once a week at most.

So I had mostly overlooked the Lich King upgrade until I tried to enter the game tonight. My English version of Word of Warcraft, playing on the Taiwan server cheerfully reported that my account had been upgraded for Lich King but that it couldn’t find the content.

The Chinese version on my wife’s computer automatically started downloading a paltry 1.9Gb of data (@ 1000Kb/sec, sweet), but I was referred to the US website.

It turns out that you can actually download the content from:www.worldofwarcraft.com/lichking/download

Of course it asks for a username & password, and my heart sank at this point — no US account, no download.

Miracles do happen, and (a fluke? design?) it accepted my Taiwanese username & password to download the upgrading installer.

Installation went smoothly, although at 50Kb/sec it took a long time. It also did reset realmlist.wtf again so that after the upgrade it tried to verify the account against the US server instead of the Taiwanese one.

The fix was simple enough — on your hard disk find the following file:

c:\Program Files\World of Warcraft\Data\enUS\realmlist.wtf

Then change the contents to:

set realmlist tw.logon.worldofwarcraft.com
set patchlist us.version.worldofwarcraft.com
set portal tw

Now I just need to find another quiet night…


Recent Comments
  • Ales: Hi, Thanks for the code… I must say I did not experience any errors decrypting any of my messages. I even...
  • JC: Thanks very useful and well explained
  • Thomas: This is a public static class written in the C# language that does not save state. You can call into the...
  • Simon: Thank you very much for this post! It helped me essentially to overcome obstacels to work with mono!
  • Graham: This is a good research for keyboard shortcuts! Some shortcuts are also compatible for Windows OS. I have...