Wednesday, August 20, 2008

Folder browser dialog in c#

First you need to set a reference to the Shell32.dll in your .NET project. In Solution Explorer right click the References entry, select Add New... and browse to the System32 folder and select Shell32.dll.

Then add the following C# code:

  
string strPath;
string strCaption = "Select a directory.";
DialogResult dlgResult;

Shell32.ShellClass shl = new Shell32.ShellClass();
Shell32.Folder2 fld = (Shell32.Folder2)shl.BrowseForFolder(0, strCaption, 0,
System.Reflection.Missing.Value);

if (fld == null)
{
dlgResult = DialogResult.Cancel;
}
else
{
strPath = fld.Self.Path;
dlgResult = DialogResult.OK;
}

Friday, July 18, 2008

Innovation - the new corporate mantra!!!

Creativity Vs Innovation ?

What are creativity and innovation? There are several definitions. Often they are not distinguished. They are simply seen as part of the process by which knowledge is developed and transformed into business value or even as a business. this is a perfectly acceptable definition but like the failure to differentiate between information and knowledge - it is not very useful for practical purposes.

A more useful approach is to view creativity as the process of generating ideas whilst seeing innovation as the sifting, refining and more critically - the implementation of those ideas. creativity is about divergent thinking. Innovation is about convergent thinking. Creativity is about the generation of ideas and innovation is about putting them into action!!!.

Creativity - coming up with new ideas - is not enough. we need innovation - the taking of new or existing ideas and putting them into action. This requires the application of existing knowledge and the development of appropriate new knowledge. Coming up with new ideas is the food of innovation. innovation is a far tougher proposition than creativity.

Why it is so important in corporate world ?

Daily we read in the news that creativity and innovation are critical for an organization's success in maintaining its competitive advantage and in surviving. many surveys identified creativity and innovation as a "top two priority for business strategy". A recent survey of 500 top CEO’s in USA asked them what their organizations needed to survive in the 21st century. Top answer was "to practice creativity and innovation"!!!!!

We all are entrepreneurs..(Yes..believe me Very Happy)

Who is an entrepreneur??? - A dynamic person who gets the right people together to make something happen.someone who knows the right people, can motivate and wants action / results on a daily basis as in a typical IT project. we all are entrepreneurs means, we are working in such a large corporation takes direct responsibility for turning a project requirements into a profitable finished work product through assertive risk-taking and innovation.many entrepreneurial qualities of us often loose their innovative edge as they grow into such an established environment.It is therefore recommended that business organizations create a culture that provides employees with both freedom and encouragement to develop new ideas


Why the Management system?

There is no magic bullet for successful innovation, but nurturing a corporate culture that values innovation and creativity is important.that depends our corporate culture and what target we set for growth. But first of all we need to put innovation on our agenda, start by designing an idea management system.

The real challenge for our organization may not be finding a way of getting people to come up with ideas, but finding the best, most practical way of tracking and implementing those ideas. More than one hundred years ago the first traditional employee suggestion system -the suggestion box was introduced around the world. the suggestion system has had it ups and downs( we've experienced it already), but today it has developed into a powerful tools as a method to encourage, nurture and acting on employees ideas.

Wednesday, June 18, 2008

Append a path variable in DOS

SET PATH=C:\DOS;C:\MOUSE

PATH=%PATH%;C:\LOTUS



one mistake everytime i makes is like i put it like $PATH! its not $Path, its %PATH% :)

Saturday, April 26, 2008

Why OpenSource ?

I'm a hardcore opensource person. It is the regular question ppl usually ask to me, and here is the best description which i can

OpenSource software gives you the flexibility and reliability that you need. You can be really sure, that noone has placed spyware or other malicious software in it, because you can look into the source. You can also extend the software for your needs, crop unwanted features or make it look nicer in you environment. OpenSource software also has a large community, that contributes experience and improvements. With this amount of testing bugs are found and fixed quickly.The best example for successful open source development might be the new internet browser Firefox. If you do not know Firefox, then we have some more information for you.

Wednesday, April 23, 2008

C++ 09: fulfillment of expectations?

I'm a great fan of programming especially when it is in c++. I admire and love Stroustrup as a philosopher more than an inventor or programmer. and i think no i feel the language is not just a combination of keywords or logics, but it is a philosophy. see a very recent inntreview with Stroustrup, it shed up some lights on the latest trends and happenings in c++.

( courtesy : InformIT )

Danny Kalev interviews C++ creator Bjarne Stroustrup about the C++09 standard, why C++ was never meant to be just for OOP, and his affinity to Tolkien's hobbits.
  1. Congratulations on your forthcoming book Programming: Principles and Practice using C++! This is the first time you’re writing an introductory book. What has motivated you to write a book for beginners?

    → I had long found the C++ books for beginners unsatisfactory, but I couldn't do anything about that because I didn't have sufficient experience with teaching beginners. Then, more than three years ago (after I had moved to Texas A&M University to become a professor), I was a bit too loud in expressing my opinion of the programming skills of students and what I saw as the lack of focus on programming in their curriculum. Someone asked if I thought I could do better and I had to deliver. I designed a course, delivered it again and again together with an experienced lecturer who saved me again and again from my inexperience and overambition. The current course and the book that goes with it is the result. We have now taught well over 1,000 students, so we know that the approach works.

    My basic idea for the course was to list the knowledge and skills needed to start a project to produce code for the use of others than the programmers themselves. That list became the initial definition of the course. The point about "code for the use of others" is key. This leads to an emphasis on professionalism. When writing code that others rely on you need a responsible attitude to the structure of the code, the correctness ("how do you know it works?"), testing, and maintenance. It also implies that we can't let the student get stuck on obscure language-technical details (such as "exactly how does an unsigned short gets converted to an int?") beloved by teachers who like to set tricky tests. We have to get to the point where the students use object-oriented programming and generic programming because that's required for real-world applications. I also had to add something on graphics and GUI, but that's fun and helps in the appreciation of object-oriented techniques. Similarly, the STL features prominently to allow handling of data and to demonstrate generic programming techniques.

  2. In what ways was this writing experience different from writing a book for experienced programmers?

    →There was far more direct feedback. Often, I was writing and making slides well into the night to have something for the students in the morning. Seeing a blank wall of faces is a great incentive to do better. Conversely, to see those faces light up is a very direct reward. Another difference is that I have had to think harder about what I wanted to communicate. I also had to articulate how to get the ideas across. The latter becomes essential when I don't teach all the classes myself. For a teaching approach to scale beyond what an individual can do, its aims, principles, techniques, etc. must be articulated.

    I had to think hard about what I wanted to teach and how. Most people thought – and insist to keep thinking – that I was/am doing a C++ course. Actually, it is a course in programming. I use C++ to teach the principles and practical skills of programming. The teaching of programming language features is secondary. Obviously, C++ reflects my view of what programming should be so there is no major tension here, but I hope – and have reason to believe – that the skills can be applied with other languages.

    When writing for beginners, you also have to provide more support than for professionals. So there are more exercises, more repetition, more emphasis, more summaries, more diagrams, and more color than people are used to from my other books. The style is ever so slightly lighter than in my other writing. However, it is still a demanding book. I did not set out to write the simplest book on programming because that would not teach people enough to be useful. My aim is eventual professionalism – the ability to write code others can rely on. Obviously, not all of my students will become programmers (I started out with electrical and computer engineers), but I do not want to give the impression that programming is a shallow art for dilettantes.

    For many, my new book will actually be a second book on programming, but the first that aims at professionalism. I suspect that many will use the book for learning on their own, without the support of teachers and fellow students. That's hard, but I try to support that with detailed examples and condensed reference material. There is also material beyond what can be covered in a semester: text processing using regular expressions, numerical computation using an N-dimensional Matrix library, the basics of embedded systems programming, testing, and an overview of C programming from a C++ perspective.

  3. Has your experience as a professor at Texas A&M University brought new insights on how programming languages should be designed (for example, how to make programming languages easier to teach and learn, which features students find too confusing etc.)? If so, have these insights inspired you to design new C++ features?

    → Not really. I had done enough teaching at all levels – from middle school students to executives – even before I came to Texas that I had a pretty good idea what language ideas would help students. Unfortunately, the standards process is quite resistant to dramatic changes for the benefit of novices (of all backgrounds). The best thing that can be done for students is to provide more and better libraries. After that, anything that makes the language (and libraries) more consistent and less surprising helps.

    In particular, I'd give a lot for a very simple graphics and GUI library, a simple library for accessing a few web resources, and (for my engineering students) a good linear algebra library. In my class, I supply the graphics and the matrices myself, but it would be so much better to use someone else's – especially to use standard versions.

    However, we must be careful not to give the impression that calling other people's libraries is all there is to programming. One of the observations that influenced the design of my course and led me to present it as a book was repeated loud complaints from industry about the lack of capable systems programmers. Too many students graduate without exposure to the problems, tools, and constraints on solutions they will face in industry.

  4. The C++09 standard, which is due to be finalized within months, is the biggest standardization endeavor since 1998. In your opinion, what are the most important changes and additions that it includes? How will C++09 affect everyday the design, implementation and testing of new C++ projects?

    → If all goes well, we'll vote out a standard in October. After that comes a public review period and time for dealing with the comments. After that comes a lot of standards bureaucracy procedures. Even if we deliver the text on time, it's touch and go whether the 'x' in C++0x will be '9'. I fear we'll have to go hexadecimal.

    That said, I think that the new standard (C++0x) will be a boon to the C++ community in many ways. We'll have better tools for dealing with the (for most people) brave new world of concurrency. We'll have a few new libraries (regular expressions, hash tables, threads, etc.) and all the libraries will be easier to use and run faster thanks to new language features such as initializer lists, a more concise for loop, auto, etc.). Look at a few C++0x examples and consider what it would take to write them in C++98:

    // C++0x code:
    


    vector v = { "Nygaard", "Kernighan", "Stepanov" };
    unordered_map index;
    // hash table
    for (auto p = v.begin(), p!=v.end; ++p) index[*p] = p-v.begin();

    enum class Traffic_light { red, yellow, green };
    enum class Alert_color { red, blue, green };
    int red = 2;
    Alert_color c2 = red;
    // error: no int to Alert_color conversion
    Alert_color c2 = Traffic_light::red;
    // error
    Alert_color c2 = Alert_color::red;

    template
    // concepts
    requires>
    void sort(T&);
    sort(v);
    sort(red);
    // error: int is not a Container
    vector> vp
    = { {"Nygaard",75}, { "Kernighan",66 }, {"Stepanov",57} };

    sort(vp);
    // error: pair is not Comparable (no operator<)

    Obviously, I'm restricting myself to tiny examples using the more obvious extensions. Note the absence of explanatory comments. Did you need any? It was hard for me that I could not use the C++0x in my new book. There are quite a few new features that help novices by simplifying notation and improving error handling.

  5. Some features are still missing in C++09: a networking library, object persistence, GUI, and database connectivity. In contrast, the new standard includes features such as rvalue references whose usefulness for the average C++ programmer is moot, in my humble opinion at least. Is the C++09 standard complete enough to suit the needs of the average C++ programmer in 2008?

    → No, there will not be nearly enough standard libraries for my taste. However, the C++0x will much more supportive than their C++98 counterparts. Simple C++0x library components, such as regular expressions, unordered maps (hash tables), and smart pointers are already being shipped by some vendors. The main contribution of the C++0x standard library will be to set concurrent programming on a firm basis with a machine model and a threads ABI . I would have liked support for higher level concurrency abstractions – directly using threads and locks is just about the worst way to try to exploit multi-cores. However, such higher-level support will come soon – standard or not – and the C++0x facilities provide a base. For example, the threading in Intel's TBB (Threading Building Blocks) is directly based on the (draft) C++0x threading ABI.

  6. Speaking of the average C++ programmer, what are C++’s major advantages over its newer rivals? In other words, what makes C++ relevant today – and tomorrow?

    → As ever: Performance, flexibility, generality, and access to hardware resources. When you encounter an application with "unusual requirements" you'll appreciate C++'s strengths compared to languages more finely tuned to a specific class of problems.

    Actually, the interest in C++ seems to be increasing again. For example, the C++ track at the SD conference in Santa Clara in early March was by far the largest track and significantly larger than last year (where is again was larger than the year before).

  7. A new standard is also a good opportunity to part gracefully with features that backfired or never soared. I can think of exception specifications and exported templates as examples, but there may well be others. Is it time to take a brave decision and remove such features or at least deprecate them?

    → Unfortunately, we can't do that. The committee cannot ban features that are used in innumerable programs and deprecation is widely ignored. Even the very few features we do manage to ban must be supported by implementers and the users complain bitterly about having to use compatibility switches. It is not easy to "be brave" with millions of lines of code and not responsible to "be brave" with hundreds of millions of lines of other people's code. So, I think that such "bravery" will have to wait for universal availability of near-perfect source-to-source translation tools. One of the advantages of a formally standardized language, such as C++, over proprietary languages is that the standard is a long-term commitment. Today's standard C++ will with absolutely minimal modifications run in 20 years, just as much 20-year old C++ does today.

  8. People (particularly those who do not use C++ as their primary language), still regard C++ as an object-oriented programming language. In practice however, state-of-the-art C++ switched to the generic programming paradigm years ago. Do the classic notions of OOP such as inheritance, virtual member functions, protected members and dynamic binding still matter?

    → It annoys me when I see recently written descriptions of C++ that would have been barely accurate in 1987. C++ was never meant to be just for OOP and certainly I never advertised it as such. See my publication list! Obviously, classical OOP still matters and will continue to do so. Kristen Nygaard (who invented OOP) used to comment that addition did not become useless or unused just because multiplication was invented and became fashionable. OOP serves a fundamental role that is not superseded by generic programming techniques. GP is currently fashionable and therefore over- and misused, but it is as fundamental as OOP and similarly has a permanent and prominent place in our programming and design tool chest. The interesting questions relate to exactly how to combine the two to get the best solutions for real-world problems (by "best" I mean things like correctness, maintainability, ability to reason about code, performance, and easy of reading and writing code). A classic example is the "draw all shapes" example that is usually seen as an example of object-oriented programming only:

    	void draw_all(vector vs)
    
    {
    for(int i = 0; idraw();
    }

    But note that we are already using generic programming here. That vector is a parameterized type. In C++0x, we can write that a bit cleaner:

    	void draw_all(vector vs)
    
    {
    for (auto& x : vs) x->draw();
    }

    However, we can also generalize draw_all() to apply to every data type that can be seen as a sequence:

        template
    
    requires SameType
    void draw_all(Iter b, Iter e)
    {
    for_each(b,e, [] (Shape* p) { p->draw(); });
    }

    Here, I again used C++0x features. In particular, I used concepts to get good type checking and the lambda notation for defining the operation to be applied to each element of a sequence. However, the point is that this is clearly generic programming that after a bit of conventional type manipulation invokes a virtual function on a class hierarchy. This is a prototype for a common and very general style of "mixed OOP and GP code" which (if you must) you can call multi-paradigm.

    We could call draw_all() like this:

    
    
    vector v = { new Circle({0,0},10), new Triangle(p1,p2,p3) };
    draw_all(v.begin(),v.end());

    set s = { new Elipses({0,0},10,20), new Square({10,10},p3) };
    draw_all(s.begin(),s.end());
  9. Something more personal. You were born into a working class family in Ã…rhus, Denmark, as you state in your bio. In the last 30 years or so, you’ve lived in the US. My acquaintance with these two countries, however superficial, suggests that there are significant differences between those two societies. What do you miss most from Denmark and the Danish heritage?

    →Denmark is a wonderful country that it is easy to be homesick for. It's a small country where most natural and cultural phenomena are on a human scale. It helps that it's also a rich, stable country running a full welfare state at a consistent profit. I miss my friends and family – but email and the web editions of Danish newspapers help me keep in touch. I miss the food – but I can get herring, salami, cheese, etc. airlifted in from a Danish shop in California. Danes are rather fond of food – I feel an affinity to Tolkien's hobbits. Danes tend to be significantly more trusting than Americans – I miss that. On the other hand, I could not have done my work in Denmark. Something on the scale of Bell Labs could not be built and sustained in Denmark.

  10. Finally, an inevitable question: Are you planning a C++09 edition of the The C++ Programming Language?

    →I'm thinking about that. I have to write a 4th edition, but it is non-trivial to decide what it should be. Each edition has had a separate aim and scope as the C++ community evolved. Including the standard libraries, the C++0x standard might come close to 2,000 pages. I don't think my 4th editions should compete with that in either style or size.