python-logo

Properties
Python is strongly typed (i.e. types are enforced), dynamically, implicitly typed (i.e. you don't have to declare variables), case sensitive (i.e. var and VAR are two different variables) and object-oriented (i.e. everything is an object).
Getting help
Help in Python is always available right in the interpreter. If you want to know how an object works, all Read More →

php

Make a fully operational REST API in PHP

Routing a JSON REST request
Converting it into SQL
Executing it
Giving a meaningful response

Running
Save this file as “api.php” in your (Apache) document root and call it using:
Or you can use the PHP built-in webserver from the command line using:
The URL when ran in from the command line is:
NB: Don’t forget Read More →

images

Ruby is...
A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.
Learn to Program with Ruby - https://pine.fm/LearnToProgram/chap_00.html
« the original tutorial »

Getting Started
Numbers
Letters
Variables and Assignment
Mixing It Up
More About Methods
Flow Control
Arrays and Iterators
Writing Your Own Methods
Classes
Blocks and Procs
Beyond This Tutorial

 

f34559fb85ab31961e60e1928bf4e0ca

It's not all that hard to implement a finite-state machine, unless it's very large, and you have to worry about multithreading, and ...

A common design technique in the repertoire of most programmers is the venerable state machine. Designers use this programming construct to break complex problems into manageable states and state transitions. There are innumerable Read More →

index

Simple Sorting Challenge
Challenge Description:
Write a program which sorts numbers.
Input sample:
Your program should accept as its first argument a path to a filename. Input example is the following

70.920 -38.797 14.354 99.323 90.374 7.581
-37.507 -3.263 40.079 27.999 65.213 -55.552

Output sample:
Print sorted numbers in the following way. Please note, that you need to print the numbers till Read More →

images

FakeIt is a simple mocking framework for C++. It supports GCC, Clang and MS Visual C++ - https://github.com/eranpeer/FakeIt
FakeIt is written in C++11 and can be used for testing both C++11 and C++ projects.
Checkout the Quickstart for many more examples!
Download the Latest Release and start using FakeIt now!

Mock objects - http://clean-cpp.org/mock-objects/

Unit tests follow a simple pattern. Read More →

trac_banner

What is Twisted?
Twisted is an event-driven networking engine written in Python and licensed under the open source ​MIT license. Twisted runs on Python 2 and an ever growing subset also works with Python 3.
Here's a simple publish/subscribe server, where clients see all messages posted by other clients:
You can test this out by opening two terminals Read More →

python-logo

A failure detector is a key building block for fault-tolerant distributed system, which provide a mechanism to collect information of process failure.
The Heartbeat Model
The heartbeat model is used in most distributed systems. Every process p periodically sends an “I am alive” heartbeat message to the process q. The period is the heartbeat interval Δi.
If q Read More →

boost

This class manages socket timeouts by applying the concept of a deadline.Some asynchronous operations are given deadlines by which they must complete. Deadlines are enforced by an "actor" that persists for the lifetime of the client object.
If the deadline actor determines that the deadline has expired, the socket is closed and any outstanding operations are Read More →

mongodb-logo-web-tagline-99280fe76cc002a93d023901c1a05df8b621f1c893084a580dee83de9be96630

Overview
Welcome to the Getting Started with MongoDB guide. This guide provides instructions to get you started using MongoDB. The guide covers the following topics:

Introduction to MongoDB as well as instructions to Import Example Dataset;
A brief overview of the C++ MongoDB Driver;
Basic Insert, Find, Update, Remove operations plus Aggregation;
Instructions on creating Indexes to improve query performance.

The Read More →

computer code

Welcome to the home page for the 97 Things Every Programmer Should Know project, pearls of wisdom for programmers collected from leading practitioners. You can read through the Contributions Appearing in the Book plus the Other Edited Contributions, browse Contributions in Progress, view the list of Contributors, and also learn How to Become a Contributor. Read More →

Fotolia_45264356

1. Human Readable Random String
This code will create a human readable string that will look more close to dictionary words, useful for captchas.

/**************
*@length - length of random string (must be a multiple of 2)
**************/
function readable_random_string($length = 6){
$conso=array("b","c","d","f","g","h","j","k","l",
"m","n","p","r","s","t","v","w","x","y","z");
$vocal=array("a","e","i","o","u");
$password="";
srand ((double)microtime()*1000000);
$max = $length/2;
for($i=1; $i<=$max; $i++)
{
$password.=$conso[rand(0,19)];
$password.=$vocal[rand(0,4)];
}
return $password;
}

2. Generate a Random String
If you don’t need human readable string, then use Read More →

Bash-script-2

Using bash scripts to become a more efficient web developer
Here are a few scripts, that I find really useful for speeding up my web development time.
I’ve been building up this list as I needed to use them – so they maybe a little raw.
For example often clients send me images with filenames that don’t match Read More →

linux-bash

 
 
1. Introduction

1.1 Getting the latest version
1.2 Requisites
1.3 Uses of this document

2. Very simple Scripts

2.1 Traditional hello world script
2.2 A very simple backup script

3. All about redirection

3.1 Theory and quick reference
3.2 Sample: stdout 2 file
3.3 Sample: stderr 2 file
3.4 Sample: stdout 2 stderr
3.5 Sample: stderr 2 stdout
3.6 Sample: stderr and stdout 2 file Read More →

dynamic_allocation

The problems with fixed size arrays
Declaring an array with a fixed size like
int a[100000];
has two typical problems:

Exceeding maximum. Choosing a real maximum is often impossible because the programmer has no control over the size of the data sets the user is interested in. Erroneous assumptions that a maximum will never be exceeded are the source Read More →