Posts Tagged ‘Programming’

My vimrc file for Perl, Python, PHP and C code

Here is my .vimrc file that is highly modified for programming in perl, python, php or C: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 [...]

Weighted Random Number Generation in Java

I made small class for weighted random generation. It is inspired from the Eli Bendersky’s blog post: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import java.util.Arrays; [...]

Git Tags and Branches

You’ve probably known that repository is usually divided into three separate directories. Short explanations, for the folks who haven’t used them : Branch: Every time you release a major version, it gets a branch created. This allows you to do bug fixes and make a new release without having to release the newest – possibly [...]

How to create a Git repo and some Git Basics

Git is a very nice and useful distributed version control system. It certainly became a component for the swiss army knife of software engineers. Git is created by the father of Linux, Linus Torvalds. The main advantage of git over SVN and other traditional VCS’s(version control systems) is its distributed nature and performance(git is really [...]

Memory functions in C and the difference between Memset and Malloc

Memset and malloc are 2 of the most confused functions in C. But actually they have very different usages and functions. “malloc” allocate a memory section whereas memset manipulate the content of the memory section. For instance : char * c; c = (char *) malloc(sizeof(char)); The above code creates and allocates a memory space [...]