{love to code?}

July 21, 2009

Single click builds for different environments using Visual Studio

Filed under: C# — navaneethkn @ 8:39 AM
Tags: , , ,

A neat build system is vital for all projects. Good build system should be capable to work without *any* user intervention. Here is what Joel Spolsky says on his post

Can you make a build in one step?

By this I mean: how many steps does it take to make a shipping build from the latest source snapshot? On good teams, there’s a single script you can run that does a full checkout from scratch, rebuilds every line of code, makes the EXEs, in all their various versions, languages, and #ifdef combinations, creates the installation package, and creates the final media — CDROM layout, download website, whatever.

Ask yourself the same question – Can you build your application in one step? (more…)

July 16, 2009

Wolfram – Amazing computational knowledge engine

Filed under: Miscellaneous — navaneethkn @ 5:50 PM
Tags:

Wolfram is an amazing computational knowledge engine. Wolfram in their own words

Wolfram|Alpha’s long-term goal is to make all systematic knowledge immediately computable and accessible to everyone. We aim to collect and curate all objective data; implement every known model, method, and algorithm; and make it possible to compute whatever can be computed about anything. Our goal is to build on the achievements of science and other systematizations of knowledge to provide a single source that can be relied on by everyone for definitive answers to factual queries.

As of now, Wolfram|Alpha contains 10+ trillion pieces of data, 50,000+ types of algorithms and models, and linguistic capabilities for 1000+ domains. Built with Mathematica—which is itself the result of more than 20 years of development at Wolfram Research—Wolfram|Alpha’s core code base now exceeds 5 million lines of symbolic Mathematica code. Running on supercomputer-class compute clusters, Wolfram|Alpha makes extensive use of the latest generation of web and parallel computing technologies, including webMathematica and gridMathematica.

I love it’s capabilities to parse and execute mathematical expressions. Here is Wolframalpha in action.

Wolfram showing results of a mathematical expression

Wolfram showing results of a mathematical expression

July 11, 2009

ADO.NET best practices – Reading data from data reader

Filed under: C# — navaneethkn @ 5:45 PM
Tags: , , ,

I have seen many people using DataReader incorrectly. In this post, I will try to explain some good practices that can be followed when reading from a data reader. Consider the following problematic code,

SqlDataReader reader = /* ... */;
while (reader.Read())
{
    string userName = reader["user_name"].ToString();
    int age = int.Parse( reader["age"].ToString() );
    /* ... */
}
reader.Close();

How many problems can you figure out from the above code? There are many problems with this code, (more…)

July 8, 2009

Visual Studio 2010 intellisense for C++

Filed under: cplus-plus — navaneethkn @ 1:50 PM
Tags: ,

I have downloaded a beta version of VS2010 today.  First thing I did was to test the most heard intellisense support. VC++ team has done a great job and finally intellisense for C++ is almost usable and working.

Let the screenshots speak for themselves.

VS2010 intellisense

VS2010 intellisense

Intellisense showing method description including the type used for template

Intellisense showing method description including the type used for template

Neat description about types

Neat description about types

It’s cool. Go and give it a try today!

July 5, 2009

Converting console application to windows application – C++/CLI

Filed under: C++/CLI — navaneethkn @ 4:46 PM
Tags: , ,

Have you ever needed to convert a console application to windows application?

Recently, I worked on an application which was created to run on console, but later decided to move to windows application. To make it a windows forms application, you only have to add new windows form to the project. VS will add all necessary references automatically.

Modify your main method like, (more…)

July 3, 2009

Using application configuration file (app.config) with C++/CLI applications

Filed under: C++/CLI — navaneethkn @ 4:15 AM
Tags: , ,

.NET applications uses app.config file to keep the application configuration entries like database connection strings, logging information etc.  Using Visual Studio, you can add a new app.config file to your application. In C# and VB.NET projects, app.config will be copied automatically to the output directory and it will be named like <Application>.exe.config where <Application> is your executable name. ConfigurationManager is a helper class which provides a neat interface to the contents of app.config.

With the above information, let us write a simple application which reads AppSettings node from the application configuration file. (more…)

Blog at WordPress.com.