Convert String to Double

Sample input: "123.456" . Must contain exact 1 dot ('.'). The rest are decimal numbers.
Output: double value of that string.
Solution:

private int GetIntValue(char x) {
    return (int)(x - '0');
}

public double ConvertToDouble(string numStr) {
    double result = 0;
    char[] array = numStr.ToCharArray();
    int index = array.Length - 1;
    while (index > 0) {
        if (array[index] == '.') {
            break;
        }
        result = ( result + GetIntValue(array[index--]) ) * 0.1;
    }

    index--;

The Guerrilla Guide to Interviewing

Found this link from Joel Spolsky about interviewing guide. It may help me in the future. Enjoy!!


Myth Genius Programmer

I haven't watched the video, but probably it's a nice one: http://code.google.com/events/io/sessions/MythGeniusProgrammer.html

If you already watched it, please tell me what's your comment :)

Top 10 Traits of a Rockstar Software Engineer

Taken from Alex Iskold's article from this website, this is a great post for software engineer folks. Thanks, Alex!!


3 Tips to Beat the Development Deadline

Taken from chrome8's posting on byte forum ( http://bytes.com/topic/software-development/insights/852660-3-tips-beat-development-deadline )

Deadlines looming and just can’t get enough done at work? Try these 3 steps to organize your working day and deliver your projects on time.

Live Office Annoying Bugs

I'm writing my daily log report on Microsoft Office Live. After I saved my document, when I opened it the next morning, all of the fonts are bold! Hm, makes me wonder and I reformatted the fonts and saved it again. This morning I opened the document again, and I found that there are the format changes again (now the problem is the align of the bullets in the document is increasing).

Hello, Office Live SDETs. Could you find the bugs? And for Office Live Developers, please fix it. It's kinda annoying. Hope you guys can work it out soon.

What is the Output of this Program?

    big_loop:
    for (int i = 0; i < 3; i++) {
        try {
            for (int j = 0; j < 3; j++) {
                if (i == j) {
                    continue;
                } else if (i > j) {
                    continue big_loop;
                }
                System.out.print("A ");
            }
        } finally {
            System.out.print("B ");
        }
        System.out.print("C ");
    }

Answer: A A B C B B

Types of Software Testing

Taken from Beginner's Guide to Software Testing by Padmini C, I quoted types of software testing.

Formal Testing: Performed by test engineers
Informal Testing: Performed by the developers
Manual Testing: That part of software testing that requires human input, analysis, or evaluation.
Automated Testing: Software testing that utilizes a variety of tools to automate the testing process. Automated testing still requires a skilled quality assurance professional with knowledge of the automation tools and the software being tested to set up the test cases.

Hello World

My first post on this blog. Hope it helps for me and for other people as well =)

test code

supposed to be bold

Syndicate content