Chua Wen Ching's Blog

Technologies, Communities, Career, Life

  • Aptana 1.1 IntelliSense Weirdness for JQuery

    I had installed Aptana 1.1 to learn JQuery and hopefully I could get full IntelliSense support for JQuery. Aptana has lots of interesting features though which impressed me. In terms of Intellisense experience, Visual Studio 2008 is indeed better. Maybe I am too used to Visual Studio 2008.

  • Running ASP.NET 2.0 on FileSystem instead of IIS without Visual Studio 2005/2008 installed

    How are you able to run your ASP.NET 2.0 web application on File System (Standalone web server without IIS) without Visual Studio 2005/2008 installed in your local machine. I will say this is particular useful for POC ASP.NET 2.0 web application to customers or having web graphics designer testing out the ASP.NET 2.0 web application without knowing anything about IIS or trying to run F5 on Visual Studio 2005/2008.

    How can you do that? I heard from lots of people that it wasn't possible to do this. There was no way you can extract out this FileSystem from Visual Studio 2005/2008. You can download the existing Cassini 1.0 and enhance it. You can also find some implementation online like this or download UltiDev Cassini (which I wasn't able to install it properly).

    This might not be common but I believe it can be useful to lots of people out there.

    Tip #1

    You can run this filesystem without having Visual Studio 2005/2008 installed as long you have .NET Framework 2.0 and above installed.

    You can locate this file "WebDev.WebServer.EXE" at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

    Try it yourself

    Tip #2

    Run this application in the Visual Studio 2005/2008 command prompt as below or you can try open a command prompt and change directory to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

    webdev.webserver.exe /path:"C:\MyPOC\TestWeb" /port:1337 /vpath:"/TestWeb"

    First you define a path of your ASP.NET 2.0 Web Application. I include quotes around the path.

    Set any ports you like, but do be careful of complication to existing ports used by other applications. I noticed when you debugged ASP.NET 2.0 FileSystem project in Visual Studio 2005/2008, it would use this port 1337 so I reused it.

    I will recommend to set a virtual path like above. It can be anything you like.

    Tip #3

    webdev.webserver is not dependent to IIS. If you don't believe it, try to stop all your IIS web process.

    Tip #4

    The ASP.NET Development Server will run at your taskbar like below. But don't even try to click on the Root URL.

    You will never able to get it to run. I almost gave up because of this as I thought there was some JIT error.

    Instead, run the URL http://localhost:1337/SPAN directly on your web browser (IE or FireFox). It works :)

    Hope you find this useful. If you know there is a better way, let me know. Thanks.


    I realized some machines did not have the webdev file in the right place, instead it was stored in this location C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0

    Nevertheless, it works :) Good luck

  • My coming initiatives for Green Computing/Orphans July 20, Senior Citizens July 26

    I will be having 2 events that is worth to highlight in my blog:

    Date: Sunday, July 20, 2008

    Organizers: MIND and Mesiniaga (co-organizer) 

    Venue: FRIM (within the forest)

    Target audience: 60 orphans (age between 8 - 17), 60 working adults (registration will open soon), 10 (organizers, press)

    Press: Newspaper, Magazines and TV Channel (tentative). PC.COM is confirmed coming and covering.

    Entrance: It's free. MIND (my community) will be covering everything including lunch.

    The session is a platform to educate the kids/adults about Green Computing as well as building synergies between the orphans and IT working professionals. There will be indoor and outdoor activities. Thanks to Microsoft for sponsoring my community and making things happen.

    Current sponsors: Dell Malaysia, Microsoft Malaysia, Microsoft Singapore, Microsoft MVP SEA Team, Microsoft Corp - VSTS Team, ISA Technologies, eQuva, Jetbrains, O'Reilly, PeachPit, PC.COM, SSW Australia, Red-Gate.


    9.00 a.m. Registration and Breakfast
    9.30 a.m. Welcome address and Keynote 1 – Mr. Fathil Sulaiman Ismail (Mesiniaga Managing Director)
    9.45 a.m. Green Computing Keynote 2 - Dell Country Manager Pang Yee Beng (TBC)
    9.55 a.m. Prize Giving Ceremony to Home by Dell + Photo Shooting with all sponsors involved
    10.05 a.m. Green Computing Overview (Ms. Hazreen, Mesiniaga)
    10.20 a.m. Approaches to Green Computing (Lim Fun Jin, ISA Technologies)
    10.40 a.m. Green Technology Speaker 2 (Microsoft)
    11.00 a.m. Canopy Walk (4 groups)
    11.00 a.m. – 11:30 a.m. Press Briefing by Main Sponsor (Dell) and Organizer (MIND) and Mesiniaga
    1.30 p.m. Buffet Lunch (mingle with the kids)
    2.30 p.m. The End

    If any of you like to be our sponsors, drop me an email. I am not looking at cash funding, instead anything that you can sponsors to rock these kids or donate to the Orphanage Home. Thanks.

    The event promotion will be advertised soon. Stay tuned.

    Date: Saturday, July 26, 2008

    Organizers: MIND

    Speaker Highlight: Yew Ban and Poh Sze

    Venue: Microsoft Malaysia (Auditorium)

    Target audience: minimum 30, maximum 100 senior citizens (age 40 - 70)

    Press: Unknown yet. Probably Mandarin Newspaper.

    Entrance: It's free. MIND's session is always free and making impact for the community in Malaysia

    This is the 1st session that MIND will be conducting in Mandarin (traditional chinese) as well as to senior citizen. The prerequisite is that these senior citizens know the fundamentals of computer. Yew Ban, Poh Sze and myself will be speaking in Mandarin. MIND members can drop by for this session but this session is really simple and easy for the senior citizens to understand, so not sure suitable for the elite folks.

    The agenda will be as below:


    9.30 a.m. Registration
    10.00 a.m. Introducing Windows Vista in Chinese – Yew Ban and Wen Ching
    10.40 a.m. Break
    10.45 a.m. Introduction Microsoft Word 2007 in Chinese – Yew Ban and Wen Ching
    11.30 a.m. Break
    11.35 a.m. Using Windows Mobile 6 in Chinese (phones can be used other than just SMS and Phone Calls) – Poh Sze
    12.15 p.m. The END

    Well I hope both events will run smoothly and it can be teaser to my blog readers of MIND coming initiatives. Thank you.

  • C# 3.0 - Using Anonymous Types

    I had a friend who recently asked me on the ways using Anonymous Type in C# 3.0. Take note, this is just an example and to me it is like syntactic sugar. You can do the conventional way and it still works.

    If you have a ComboBox within .NET Windows Forms and you like to programmatically configure the ComboBox with a list of values (Value & Member), normally people will do this:

       27             IList listOfAnimals = new ArrayList {

       28                 new Animal { Id = 10, Name = "Itik" },

       29                 new Animal { Id = 1, Name = "Ayam" }

       30             };



       33             comboBox1.DataSource = listOfAnimals;           

       34             comboBox1.ValueMember = "Id";

       35             comboBox1.DisplayMember = "Name";

       39     public class Animal

       40     {

       41         public int Id { get; set; }

       42         public string Name { get; set; }

       43     }

    To me, it is a bit redundant to create an Animal class just for the purpose of programmatically setting the values to IList. Take note, tt will not read from the database and I am using ArrayList for this example. You can use other types of course. What if you have ComboBoxes that cater for Country, State, Cities, Phone Numbers, etc?

    The other way that is most appealing will be:

       33     public class UltimateGenericComboBoxClass

       34     {

       35         public int Value { get; set; }

       36         public string Member { get; set; }

       37     } 

    And you use it across all your programmatically ComboBoxes. 

    As for me, I will recommend to consider using Anonymous types as below:

       22             IList listOfAnimals = new ArrayList {

       23                 new { Id = 10, Name = "Itik" },

       24                 new { Id = 1, Name = "Ayam" }

       25             };


       27             comboBox1.DataSource = listOfAnimals;           

       28             comboBox1.ValueMember = "Id";

       29             comboBox1.DisplayMember = "Name";

    As the code above, within the ArrayList I will call new { Id = 10, Name = "Itik" }. I did not create any really redundant class for this. Let me know if you have a shorter way for this. Have fun.