Windows Server 2008 is my Desktop Workstation

27 07 2008

After hearing lots of good stuffs about this new SERVER product from Microsoft called Windows Server 2008, I took the decision to move from Windows Vista Ultimate to Windows Server 2008 Enterprise Edition πŸ™‚

The good thing is, Windows Server 2008 can be configured as a fully featured desktop workstation. Your one stop guide for completing this ‘awesome’ task is here

Below is my laptop configuration:

1) Apple Macbook 2.4 GHz

2) 4 GB RAM

I have Windows Server 2008 Enterprise x86 Edition installed

Below is the list of software installed:

1) Apple Bootcamp

2) Microsoft Office 2007

3) Microsoft Visio 2007

4) Mozilla Firefox

5) Skype

6) Apple Quicktime

7) Apple iTunes

8 ) Windows Live

  • Live Writer
  • Live Messenger
  • Live Photo Gallery

9) Foxit PDF Reader

10) Flashget Download Manager

11) Virtual PC

12) Kaspersky Internet Security

13) tWhirl

14) Windows Mobile Device Center 6.1

This server is Fast, Sleek, and Customizable (in Features and Roles). That’s a huge benefit over Vista where many services get started no matter you use them.

I have also moved my development stuffs to a virtual environment now and virtual machines run quite fast than in Vista here. Yes, I am quite happy with Virtual PC 2007 and I don’t think I would install x64 version just for Hyper-V. The application support for x64 sucks!

Everything works good in my setup including sleep,shutdown and hibernate πŸ™‚

So far, my experience of having Windows Server 2008 as my main desktop workstation is good and I think I will continue to stay on this for a long, long time until Windows 7 comes out 8)

Advertisements




Random Post : LINQ to XML

14 07 2008

Thought of refreshing my LINQ to XML skills and here is the outcome – another blog post today! 8)

Here is our sample XML file (never mind where it came from or why it is complex)

<?xml version="1.0" encoding="utf-8" ?>
<Output_Message>
    <Dataset>
        <Row>
            <Persons_Current_Name>
                <Name>
                    <Surname>John</Surname>
                    <GivenName>Samuels</GivenName>
                </Name>
            </Persons_Current_Name>
            <Persons_Name_At_Birth>
                <Name>
                    <Surname></Surname>
                    <GivenName>John</GivenName>
                </Name>
            </Persons_Name_At_Birth>
            <DateOfBirth>1865-07-31</DateOfBirth>
        </Row>
    </Dataset>
    <StatusInformation>
        <Status>OK</Status>
        <Alive>YES</Alive>
    </StatusInformation>
</Output_Message>

I am going to query each element (as listed below) and display their values

  • Persons_Current_Name
  • Persons_Name_At_Birth, and
  • DateOfBirth

Our first step would be to load this XML file. We can make use of XDocument to load the whole XML file.

XDocument mainXMLDoc
         = XDocument.Load("Input.xml");

To start with, let us traverse all the nodes and display their values

//Traversing the whole XML
Console.WriteLine("XML Traverse");
Console.WriteLine();
foreach (XElement xelement in
                   mainXMLDoc.Descendants())
{
    Console.WriteLine("{0} : {0}",
              xelement.Name, xelement.Value);
}

Looks simple, isn’t it πŸ™‚

Next, let us get the value of Persons_Current_Name. I already have a class called Name, which is shown below:

public class Name
{
    public String Surname { get; set; }
    public String GivenName { get; set; }
}

How do we directly query Persons_Current_Name element? Below is the very straight forward (ugly) code πŸ˜€

//Persons Current Name
// The Ugly Way
XElement current_name =
    mainXMLDoc.Root
        .Element("Dataset")
        .Element("Row")
        .Element("Persons_Current_Name")
        .Element("Name");
Name persons_current_name = new Name
    {
             Surname =
                  current_name.Element("Surname").Value,
             GivenName =
                   current_name.Element("GivenName").Value
    };

Well, I really don’t like to code this way. Do we have any another option? Yes, we do! 8)

//Persons Current Name
// The Neat Way
Name persons_current_name =
    (from c in mainXMLDoc.Descendants()
     where c.Name == "Persons_Current_Name"
     select new Name
           {
                 Surname =
                      c.Element("Name").Element("Surname").Value,
                 GivenName =
                      c.Element("Name").Element("GivenName").Value
            }).FirstOrDefault();

The above code certainly looks better than our previous code πŸ™‚

Similarly for DateOfBirth,

//Date of Birth
String[] strDob =
    (from c in mainXMLDoc.Descendants()
     where c.Name == "DateOfBirth"
     select c.Value).FirstOrDefault().Split('-');
DateTime dob = new DateTime(Convert.ToInt32(strDob[0]),
    Convert.ToInt32(strDob[1]),
    Convert.ToInt32(strDob[2]));

All looks good, but wait! What to do if I have my XML in string format ? How do I load it? Dont panic, you can use the same XDocument to load the XML in the string format πŸ™‚

XDocument mainXMLDoc =
         XDocument.Parse(strXML);




Interested to work for Intergen?

14 07 2008

To all of my friends who want to work or looking to work @ Intergen, below is a list of additional perks along with the exciting job that Intergen Offers 8)

  • $400 + GST towards the purchasing of a new mobile phone and a discounted phone plan of which Intergen will pay up to $110 per month towards
  • Free monthly massages
  • Drinks and nibbles every Friday afternoon
  • Free Life Insurance cover of 3 times annual salary
  • Free Income protection Insurance for 75% of salary for up to 5 years
  • Free Travel insurance (for you and your family)
  • Additional Maternity Package to Government Assistance (after one year of employment)
  • Banking benefits from ASB Bank
  • Employee Assistance Programme
  • Option to join a discounted Health Insurance Scheme
  • Technology purchases at dealer rates – computers, TVs, stereos, electronics
  • Option to join the Superannuation Scheme with admin fees paid by Intergen
  • Free soft drinks including Coke, V, Just Juice

So, if you are looking for an exciting job, you can look here at our Careers Section





Team System Unit Test and Output Directories

14 07 2008

I always use NUnit to write my unit tests but now at Intergen I also use Microsoft Visual Studio Team System Unit Tests. Today I was stuck by a very basic problem and here it is.

I have a XML file in my project which is added to the output directory when compiled.

When I was running my unit tests against this, Visual Studio threw me this error saying that it couldn’t find the file!

(click to enlarge)

I was really surprised as my XML file is said to copy to output directory and the test fails saying that there is no such file. Checked my Test Solution’s output directory and found that there is indeed the Templates folder and the XML file.

So, whats the problem? Why is my test failing?

Well, the VSTE has a separate directory where it stores all its test results. The directory can be found in your root directory of your solution under the name TestResults. The TestResults also have various folders for each test run you do. If you refer back to the error image that is attached above, you could get the exact directory name. So, the VSTE did not copy the Templates directory to this ‘dynamic’ (for each test run there will be a directory created : correct me if am wrong here) directory. How do we do this then?

The answer is with the Local Test Run Config’s Deployment settings. You can find the local test run config in your solution browser.

Double click the file to open the properties dialog and go to the Deployment section.

Specifying a file or directory here would be included along with the test results πŸ™‚

My test doesnt fail now 8)

Another way to do this (if its a single file : if you know how to add for a directory, please do leave your comment πŸ™‚ ) is to specify along with your test method,

[TestMethod, DeploymentItem(@”Templates\BirthInputTemplate.xml”)]

public void Test_BuildInputXML()
{
}





How I Got Started in Software Development

13 07 2008

babyandcomputer_thumb1

I have been memed! Thanks James πŸ™‚

How old were you when you started programming?

19

How did you get started in programming?

I got introduced to programming and computer languages in my high school. It got into me from then and when I joined my University, I was fully ready to rock myself in programming πŸ™‚

What was your first language?

C/C++

What was the first real program you wrote?

A DirectX game in Visual Basic 6.0

What languages have you used since you started programming?

C/C++, Visual C++ 6.0, Visual Basic 6.0, HTML, Javascript, ASP 2.0, Python, PyGTK, PyQt, Qt (C++), ASP 3.0, C#

What was your first professional programming gig?

A tool for Telecommunication and Telemedicine for one of the projects at ISRO

If you knew then what you know now, would you have started programming?

YES!

If there is one thing you learned along the way that you would tell new developers, what would it be?

1) Blog, Communicate

1) Analyse whatever you are doing

2) Dont hurry – Relax, Think and Code

3) Test whatever you code (Unit Testing)

What’s the most fun you’ve ever had… programming?

Testing what I write. Its always a challenge to break up your mind to test what you write and find mistakes/problems πŸ˜‰

I Choose

1) Daniel Moth

2) Nigel Parker

3) Kirupa

4) Jeremy Boyd





NDepend

13 07 2008

Its really hard to summarize what is NDepend in few words as this tool does a lot and its really useful when you have a big project and had to do code analysis, code usage, code metrics etc., etc., So, to make things simpler, lets take what their website says πŸ™‚

NDepend is a tool that simplifies managing a complex .NET code base. Architects and developers can analyze code structure, specify design rules, plan massive refactoring, do effective code reviews and master evolution by comparing different versions of the code.

With NDepend you can analyse a set of .NET assemblies and that was the first step for me in using NDepend. Another highlight of NDepend is that you can use Code Queries to query to analyse and get results. More on Code Query Language here.

Here is a small screencast on NDepend introduction from me. Its in .swf format and just open it in your browser πŸ™‚