Posts

Showing posts from 2012

Day 1 Keynote - Bjarne Stroustrup: C++11 Style

const Vs constexpr

With C++11, WG21  comity introduced generalized constant expression to be able to use in C++ as compile time evaluated constants, and only be used on where its value is evaluated to a const expression. It should have the following requirements: As a Variable: it must be immediately constructed or assigned a value. the constructor parameters or the value to be assigned must contain only literal values,  constexpr  variables and functions. the constructor used to construct the object (either implicit or explicit) must satisfy the requirements of  constexpr  constructor. In the case of explicit constructor, it must have  constexpr  specified. As a Function: it must not be virtual its return type must be  LiteralType each of its parameters must be literal type the function body must be either deleted or defaulted or contain only the following: null statements static_assert  declarations typedef  declarations and...

Memory leak detection in C,C++ codes and Apps

On of the major part of C/C++ native application development is the memory management.Allocation and Deallocation of memory on runtime and cleaning memory before exit is hard to keep in touch while development. If OOP is in the best use this can be minimized but still can be a issue. Specially while loading and using 3rd party dll and libraries can cause unknown issues. Detection of leaks can be done in many ways, code level using detection tools. Code level memory detection is supported by most compilers and there are many libraries to do so. This is almost done in debug mode. _CRT library example of memory detection. This is a set of libraries given my Microsoft to monitor memory status in the application: Before using this you have to include following lines of codes: #ifndef _CRTDBG_MAP_ALLOC #define _CRTDBG_MAP_ALLOC #endif _CRTDBG_MAP_ALLOC #include #include Then after you have to go to a certain function call and check whether there was a m...

Apache Bar Camp- Colombo 2012

Image
Today sri lankan techies had a wonderful time with apache at UCSC on  with the help of WSO2 and commitment of special apache people here at colombo. The session was with 3 keynote speakers, started by Dr.sanjeewa weerawarna, CEO of WSO2. He was giving his valuable time for the newbees and followups with great information of his lifetime story with FOSS. "The Apache Way" could bring the audience to the interesting of being part of the apache comminuty for the community in more long term basis. The simplest form of "Just F***** Do It" [JFDI] was introduced and mentored on the apache community. Meritocracy vs Democracy was a key on the success of apache, and was only used in case of a evading. Otherwise every individual was the key node on the apache community, not either a big part of huge business could break that synopsis. Subversion system is the first time machine developed[only usable by committees], which make you secu...

New programming slang - Programming

Image
There was some interesting post on a site which sumarizes content from stackoverflow.com. As it was pretty nice, i thought of republishing here for my personal reference. So, you guys n grls please don't read this. It can be a copyright issue for me.... ;) here is the post for you http://umumble.com/blogs/Programming/321/ Yoda Conditions The act of using if (constant == variable) instead of natural if (variable == constant), ; for example, if (4 == foo) . Because it is like "if it is the blue – this is the sky" or "if that is tall – this is a man." Pokémon Exception Handling When you catch all the exceptions and then you try somehow to analyze them. try { //code } catch ( Exception ex){ if ( ex instanceof SubException){ //code } else if (ex instanceof SubSubException){ //code } else { //code } } Discuss an example here Egyptian brackets This ...