Range Constrained Types in C++

Posted on Fri 05 September 2014 in misc View Comments • Tagged with C++, Ada

One of the first things a new Ada programmer will learn is the ability to define constrained type. Which means that one can restrict the values that can be assigned to a variable of this specific type.

For example:

subtype Positive is Integer range 1 .. Integer'Last;

Being a subtype …


Continue reading

Template Argument Deduction

Posted on Sun 04 May 2014 in misc View Comments • Tagged with C++, generics

With automatic template deduction, it is possible to omit the template argument when instantiating a template function. The compiler will deduce the type from the actual parameter sent to the function. This is of course assuming there are no ambiguities.

For example:

template<class T>
T max(T x, T …

Continue reading

How to Enable Logging of Chat Sessions in ERC

Posted on Wed 04 December 2013 in misc View Comments • Tagged with Emacs

ERC is an irc client that runs inside emacs. I sometimes use it to ask question or read interesting discussions.

It is very nice to have the code I am working on and some interesting discussion side by side on the screen.

Sometimes I read something interesting and later want …


Continue reading

Making Legacy Software Work On Windows

Posted on Sat 09 November 2013 in misc View Comments • Tagged with Linux, Windows, Wine

It sometimes happens that programs written for old versions of Windows will not work on new versions even with compatibility mode enabled. It is not uncommon for such program to crash and show some cryptic message that even a person of technical background can not understand. Sometimes only a simple …


Continue reading

Combining ls and cat Commands

Posted on Sat 17 August 2013 in misc View Comments • Tagged with shell, sh, linux

Very often, when exploring contents of directory trees, I find myself confused between the the "ls" and "cat" commands and mistakenly type one instead of the other. Both these commands are used pretty often and conceptually they have similar meanings. One says "print out a content of directory". The other …


Continue reading

OpenNI2 Samples and Dynamic Library Problems

Posted on Fri 02 August 2013 in misc View Comments • Tagged with openni, linux

While experimenting with the OpenNI2 samples, I sometimes would get the following error when trying to run one of the executables:

~/OpenNI-Linux-x86-2.2$ Samples/Bin/SimpleViewer
Samples/Bin/SimpleViewer: error while loading shared libraries: libOpenNI2.so: cannot open shared object file: No such file or directory

The dynamic library file …


Continue reading

How to Save Money in Israel

Posted on Mon 01 April 2013 in misc View Comments • Tagged with Economics, Tips

It is always good to cut on household expenses, especially at times when product prices are rising. In this post I have gathered several tips that will help you save money monthly with only small impact on your quality of life.

Notice that this post is intended to help Israeli …


Continue reading

Spartanization Plug-In For Eclipse

Posted on Sat 09 March 2013 in misc View Comments • Tagged with Eclipse, Software Engineering, Spartanization Plugin

I would like to share an Eclipse plug-in that I have recently developed. It possible to install it from the following update site: http://update.nihamkin.com/spartan/.


If you are not familiar with "spartan programming", you can read about it on this …


Continue reading

Start New Blogofile Post With a Single Command

Posted on Fri 22 February 2013 in misc View Comments • Tagged with Blogofile

I wrote a bash script which should allow starting blogofile blog posts more conveniently. This will set up everything needed with a single command.

This script will perform:

  1. Create a file in the _posts directory. The file name will be prefixed with the next number in the sequence (personal choice …


Continue reading

How to Add Items Into Eclipse's Refactor Menu

Posted on Sat 16 February 2013 in misc View Comments • Tagged with Eclipse, Plug-In, JDT

Recently, I was writing a plug-in that performs some refactoring (of which I will write in a separate post).

Writing the refactoring was not too complicated, but figuring out how add the menu items correctly into the Refactor menu took a lot of time.

I tried to figure this from …


Continue reading