Tris volumineux
Les algorithmes de tri doivent aussi être adaptés en fonction des configurations informatiques sur lesquels ils sont utilisés.On suppose que toutes les données sont présentes en mémoire centrale (ou accessibles en mémoire virtuelle). La situation se complexifie si l'on veut trier des volumes de données supérieurs à la mémoire centrale disponible (ou Read More →

Dynamic Programming – Cutting Rods
This problems is presented in Introduction to Algorithms as an intro to Dynamic Programming.
Given a rod of length n inches and a table of prices pi for rod lengths: i = 1, 2, ... n, determine the maximum revenue rn obtainable by cutting up the rod to pieces and selling them.
The Read More →

To create the shared (*.so) library, use these steps
Example instructions for compiling
1) g++ -fpic -c CLib.cpp
2) g++ -shared -o CLib.o
3) g++ CLibTest.cpp -o CLibTest -L. -lCLib
C Programming Tutorial in Linux #040 - Dynamic Shared Library

La loi de la gravitation ou loi de l'attraction universelle, découverte par Isaac Newton, est la loi décrivant la gravitation comme une force responsable de la chute des corps et du mouvement des corps célestes, et de façon générale, de l'attraction entre des corps ayant une masse, par exemple les planètes, les satellites naturels ou Read More →
Tell your C++ compiler which instantiations to make while it is compiling your template class's .cpp file.
(If you've already read the previous FAQ, this answer is completely symmetric with that one, so you can probably skip this answer.)
As an example, consider the header file Foo.h which contains the following template class. Note that method Foo<T>::f() Read More →

Google C++ Style Guide

Table of Contents

Header Files

Self-contained Headers
The #define Guard
Forward Declarations
Inline Functions
Function Parameter Ordering
Names and Order of Includes


Nested Classes
Nonmember, Static Member, and Global Functions
Local Variables
Static and Global Variables


Doing Work in Constructors
Explicit Constructors
Copyable and Movable Types
Delegating and Inheriting Constructors
Structs vs. Classes
Multiple Inheritance
Operator Overloading
Access Control
Declaration Order
Write Short Functions

Google-Specific Magic

Ownership and Smart Pointers

Other C++ Features

Reference Arguments
Rvalue References
Function Overloading
Default Read More →

Provide a surrogate or placeholder for another object to control access to it.
Use an extra level of indirection to support distributed, controlled, or intelligent access.
Add a wrapper and delegation to protect the real component from undue complexity.
You need to support resource-hungry objects, and you do not want to instantiate such objects unless and until they Read More →

Memory management is the heart of operating systems; it is crucial for both programming and system administration. In the next few posts I’ll cover memory with an eye towards practical aspects, but without shying away from internals. While the concepts are generic, examples are mostly from Linux and Windows on 32-bit x86. This first post Read More →

Since a time_t is only required to represent time intervals of ±68 years, and many implementations use a base year of 1970 for representing the current time, there is an inability for many popular C++ implementations to represent dates and times after 2038. This means that a lot of software could break in 2038, if Read More →

1. Mapping Objects to Databases
2. Active Record
3. Data Mapper
4. Using a Repository
5. Identity Map
6. Lazy And Eager Loading
7. Virtual Proxy Pattern
8. Taking the Next Step
Data access is a popular subject among developers. No doubt you've heard plenty of opinions on specific data access technologies and persistence frameworks, but what's the best way to consume these Read More →

This piece of code illustrates how your compiler library handles different settings of the TZ environment variable. It also shows
the problematics arising from time zone conversion localtime/gmtime when daylight saving is currently in effect and the time to be converted would have no daylight time set and vice versa.
In your shell set the environment variable Read More →