Programming

Programming Tips, Tricks and Job Search

How Much Money Shall John Invest?

How Much Money Shall John Invest?

Many first time investors think that they should invest all of their savings. This isn’t necessarily true. To determine how much money you should invest, you must first determine how much you actually can afford to invest, and …

Compiler Design Books

Compiler Design Books

Modern Compiler Design
by Dick Grune - Technology & Engineering - 2000 . While focusing on the essential techniques common to all language paradigms, this book provides readers with the skills required for modern compiler …

Memory Leaks Detection in Programming

Memory Leaks Detection in Programming

Books on Memory Leaks in Programming

Navigating C++ and Object-oriented Design - Page 381
by Paul Anderson, Gail Anderson - Computers - 1998 - 800 pages

To make the memory leak detector track calls properly, your system should … Here’s how to compile …

What is wstring - Discussion on wstring

What is wstring - Discussion on wstring

What is wstring - Discussion on wstring

Can somebody tell how much std::wstring is supported across different compilers on different platforms? AFAIK std::string is supported by almost all C++ compilers and almost all platforms, …

Unix Debugger GDB Tips Shortcuts

Unix Debugger GDB Tips Shortcuts

GDB - important commands (most can be abbreviated to starting letter)

o r = run the program (can give arguments, e.g., r -f foo.txt or r < test.script)
o file filename = load in the executable filename
o s = step …

Unix System debugging Tips

Unix System debugging Tips

** strace

See systemcalls:

strace <cmd>

** lsof

List open files and network connections of local process:

lsof -p <pid>

When no option is given, lsof prints open files for all processes for which this information …

General Interview Questions

General Interview Questions

Experience-based:

What do you expect out of this job?
Describe the best manager you ever had. What made him or her stand out? How did you …

C++ Software Design Tips Guidelines Checklist

C++ Software Design Tips Guidelines Checklist

C++ Software Design Tips Guidelines Checklist

* Open/close principle
* Prefer free to member functions
* Consider moving private members to the implementation file– pimpl idiom (handle/body, compilation firewall)
* Namespace names after content (not e.g. reverse domain names) and not …

Effective C++ Tips

Effective C++ Tips

Shifting From C to C++.
– Prefer const and inline to #define.
– Prefer iostream to stdio.h.
– Prefer new and delete to malloc and free.
– Prefer C++­style comments.

Memory Management.
– Use the same form in corresponding uses of new and …

More Effective C++ Tips

More Effective C++ Tips

Basics.
– Distinguish Between Pointers and References.
– Prefer C++­Style Casts.
– Never Treat Arrays Polymorphically.
– Avoid Gratuitous Default Constructors.
Operators.
– Be Wary of User ­Defined Conversion Functions.
– Distinguish Between Prefix and Postfix Forms of Increment and decrement operators.
– Never Overload …

C++ Standard Template Library Tips

C++ Standard Template Library Tips

Effective STL - C++ Standard Template Library Tips

Containers.
– Choose your containers with care.
– Beware the illusion of container ­independent code.
– Make copying cheap and correct for objects in containers.
– Call empty instead of checking size against zero.
– …

C++ Design Tips and Tricks

C++ Design Tips and Tricks

C++ Design Tips and Tricks by Dr. Michael Whalen

C++ Design Tips Tip 1:
Learn Patterns

Someone has done what you are doing before:

For Example:

Extracting information from a complex graph of classes (visitor)
Creating a framework to …

Object-Oriented Design Heuristics

Object-Oriented Design Heuristics

All data should be hidden within its class.
Users of a class must be dependent on its public interface, but a class should not be dependent on its users.
Minimize the number of …

Murphy’s Laws For Programmers

Murphy’s Laws For Programmers

Anytime things appear to be going well, you have overlooked something.
If it looks easy, it’s tough. If it looks tough, it’s damn near impossible.
You always find any bug in the last place you …

What is Callback Function in C++ ?

What is Callback Function in C++ ?

“Hollywood Principle” - “Don’t call us; we’ll call you.”
What’s a callback? Suppose you’re taking a long trip, and I lend you my car for the purpose. Given the condition of my car, I’ll probably also hand you a sealed …

Unix Stream Editor Sed Tips Tricks

Unix Stream Editor Sed Tips Tricks

This is a short version of the Sed tips published at http://sed.sourceforge.net/sed1line.txt

Adjust File Spacing
# double space a file
sed G

# triple space a file
sed ‘G;G’

# insert a blank line above every line which matches “REGULAR_EXPRESSION”
sed ‘/REGULAR_EXPRESSION/{x;p;x;}’

# insert …

Tips for Drawing UML Diagrams

Tips for Drawing UML Diagrams

Here are some general guidelines for Unified Modeling Language Diagrams based on - The Elements of UML Style - by Scott W. Ambler

Do not use crossing lines. If you need to use crossing lines, depict them as a jump.

No diagonal …

VIM Shortcuts for Programmers

VIM Shortcuts for Programmers

 

 

Some of the most frequently VIM shortcuts I use. This is just a copy paste from my notes - so …

Checklist for Application Production Support People

Checklist for Application Production Support People

What is the dominant process?

Common kinds of outages we can face

what could slow down a process

What components in the system often change.

Reverting back the changes done.

How do you recover the system if server crashes?

Do you have …

General Purpose Unix Commands

General Purpose Unix Commands

Domains in Demand for Information Technology Jobs

Domains in Demand for Information Technology Jobs

Here are some of the HOT domains or areas if you are looking for a job in IT industry.

Telecom
Networking
SCADA Systems
Wireless Technologies
Finance (Banking)

Stock Market
Graphics
Embedded Systems
Real Time Operating Systems
FEM
Process Control
Process Optimization
Supply Chain Management
Enterprise Resource Planning (ERP)
Image Processing
Language Processing …

Get Rid of Duplicated code in Application

Get Rid of Duplicated code in Application

Duplicate code makes the programs hard to understand and maintain. Most of the applications have about 10% to 25% duplicate code. In X Window System about 20 percent code is duplicated. Java Buffer Library in JDK version 1.4.1 duplicates …

Relationships between two classes – Class Coupling in OOP

Relationships between two classes – Class Coupling in OOP

Class Relationships

Class A inherits from Class B.
Class A has an attribute of class B.

Class A has a template attribute with a parameter of class B.
Class A has a method with an argument of class B.
Class A knows …

Encapsulation – Information Hiding in Object Oriented Design

Encapsulation – Information Hiding in Object Oriented Design

Objects have internal details and an external interface. This is a form of information hiding. No-one but the objects have access to the internal details.

This offers two advantages:

Objects control what can happen to them
Outsider is not exposed to the internal …

Programming Coding Standards

Programming Coding Standards

Coding standards improve communication. Standards mainly include Naming, Formatting and good practices.

Lots of coding standards exist. The selection mainly depends on taste. Pick whatever you like but stick to it and apply it consistently.