Jewish Calendrical calculations

A well-known mnemonic for calculating days of the week is the Calendar Atbash. An Atbash is a simple cypher where the first letter of the alphabet is replaced by the last, the second by the next to last, and so on. Thus Aleph is replaced by Tof, Beth by Shin and so on; this gives the acronym Atbash.

Applying the Atbash to the first seven days of Pesach, we get

Aleph – Tof – Tisha B’Av
Beth – Shin – Shavuot
Gimel – Resh – Rosh Hashana
Daled – Kuf – Keriat Hatorah, i.e. Simchat Torah, a day devoted to Keriat (“reading of”) the Torah
He – Tzadi – Yom Tzom Kippur, the Day of the Fast of Atonement
Vav – Pe – Purim
Zayin – Ayin – Yom ha-Atzmaut, Israel Independence Day
This is to be read “The first day of Pesach is on the same day of the week as the date beginning Tof, i.e. Tisha b’Av”, etc. (The first line is spoilt if that day is Shabbat so that the fast has to be postponed to Sunday.) Israel Independence Day may also be moved. Note that the Atbash remained incomplete until the creation of the State of Israel meant that this new festival was created.

About C++ 11

C++ is a very popular language and after 30 years, it’s still widely considered a best choice for many types of projects, including large scale systems and applications coding.
If you consider the layers of technology in a computer system as a stack, C++ is used to write code at all levels except firmware with its most common usage at the application level. Today, vast numbers of medium to large scale applications are written in C++. The list is huge and includes Microsoft Office, Adobe Photoshop, Illustrator, InDesign, Firefox, Google Chrome, provisioning service and billing systems for major phone and networks, even major web sites like Amazon, Facebook, and Google are either written in or have significant backend resources written in C++.

Ratified in August, 2011, C++11 is the first real extension of the C++ Standard. It provides a number of new features, including a range based for loop, type inference, lambda functions, and unambiguous null pointer constant,
and most of TR1.

Technical Report 1 or TR1 is mostly a set of library extensions, including regular expressions, smart pointers, hash tables, and random number generators.

Best practices in designing RESTful APIs

An affordance is a quality of an object, or an environment, which allows a user to perform an action.

You can follow these steps:

  • Identify stakeholders
  • Identify activities
  • Break activities into steps
  • Create API definitions
  • Validate API

The following questions should be asked:

  • Can resources exist one without the other?
  • Does one resource exist when another one exists?
  • Does the relationship between resources require more information than just the links between them?



How to set AWS Command Line Interface

pip install awscli


The AWS Command Line Interface User Guide walks you through installing and configuring the tool. After that, you can begin making calls to your AWS services from the command line.
$ aws ec2 describe-instances

$ aws ec2 start-instances –instance-ids i-1348636c

$ aws sns publish –topic-arn arn:aws:sns:us-east-1:546419318123:OperationsError –message “Script Failure”

$ aws sqs receive-message –queue-url

You can get help on the command line to see the supported services,
$ aws help
the operations for a service,
$ aws autoscaling help
and the parameters for a service operation.
$ aws autoscaling create-auto-scaling-group help


Knockout.js released by Steve Sanderson in summer of 2010. Although Steve works for Microsoft the decision to release knockout.js as an open source project was right.

It is a standalone javascript library relying on MVVM and Observable patterns. The key principles of knockout.js are:

* a clear separation between domain data, view components and data to be displayed
* the presence of a clearly defined layer of specialized code to manage the relationships between the view components

These features streamline and simplify the specification of complex relationships between view components, which in turn make the display more responsive and the user experience richer.

Knockout.js includes the following features:

* Declarative bindings
* Automatic UI refresh (when the data model’s state changes, the UI updates automatically)
* Dependency tracking
* Templating (using a native template engine although other templating engines can be used

In this example, two text boxes are bound to observable variables on a data model. The “full name” display is bound to a dependent observable, whose value is computed in terms of the observables. When either text box is edited, the “full name” display is automatically updated, with no explicit event handling.

HTML code snippet:

   <p>First name: <input data-bind="value: firstName" /></p>
   <p>Last name: <input data-bind="value: lastName" /></p>
   <h2>Hello, <span data-bind="text: fullName"> </span>!</h2>

Javascript code snippet:

function ViewModel() {
    this.firstName = ko.observable("John");
    this.lastName = ko.observable("Smith");
    this.fullName = ko.computed(function() {
        return this.firstName() + " " + this.lastName();
    }, this);
ko.applyBindings(new ViewModel());

Installing CUDA Toolkit 5.0

Installing CUDA Toolkit 5.0 on Ubuntu 11.10 Linux

The following explains how to install CUDA Toolkit 5.0 on 64-bit Ubuntu 11.10 Linux. I have tested it on a desktop with AMD Phenom II X4 CPU, 4GB RAM, 1TB hard drive, 800W power supply, and NVIDIA GeForce GTX 650 graphics card. The instruction assumes you have the necessary CUDA compatible hardware support. Depending on your system configuration, your mileage may vary.

 Basic Video Driver

First of all, you have to reconfigure Ubuntu with the basic video driver. Enter the following in a terminal.

$ sudo apt-get –purge remove nvidia*

Then create a new file in /etc/modprobe.d with the following content in order to blacklist the built-in nouveau driver, which conflicts with the CUDA developer video driver that you will install later.

# /etc/modprobe.d/blacklist-nouveau.conf
blacklist nvidiafb
blacklist nouveau
blacklist rivafb
blacklist rivatv
blacklist vga16fb
options nouveau modeset=0

You may manually update the kernel image in a terminal afterward:

$ sudo update-initramfs -u

Now you can reboot the system at this point for the change to take effect.


Linux Development Tools

After you have successfully configured Ubuntu Linux with the basic video driver, you can install the Linux development tools.

$ sudo apt-get update
$ sudo apt-get install build-essential


OpenGL Developer Driver

To prepare for compiling the OpenGL code samples in the CUDA SDK, you will have to install the OpenGL developer environment as well.

$ sudo apt-get install freeglut3-dev libxi-dev libxmu-dev


OpenMPI Developer Driver

Since there is a new MPI sample in the CUDA SDK, you will have to install the OpenMPI environment as well.

$ sudo apt-get install mpi-default-dev


CUDA Toolkit

Download the CUDA Toolkit from the CUDA download site. The graphical display manager must not be running during the CUDA video driver install. Hence you should logout your Linux desktop and switch to console mode with the Alt+Ctrl+F2 keystroke. You then login the text console, and stop the graphical display manager.

$ sudo service lightdm stop

You may have to enter the same Alt+Ctrl+F2 keystroke again to resume the text console. Now install the CUDA Toolkit:

$ sudo sh

And reboot afterward:

$ sudo reboot


Environment Variables

Assuming you have accepted the default install locations, you should add the following in the.bashrc file of your home folder.

export CUDA_HOME=/usr/local/cuda-5.0
export PATH


CUDA SDK Samples

There should be a copy of the SDK samples in your home directory already, and you can proceed with the build process.

$ cd ~/NVIDIA_CUDA-5.0_Samples
$ make

If everything goes well, you should be able to verify your CUDA installation by running thedeviceQuery sample in bin/linux/release.

About Software Quality

Software companies that install the right kind of procedures have made enormous progress in avoiding failures. First of all successful companies do not ignore uncertainty – the address it. They also establish quality control mechanisms that simultaneously speed up the whole process. And they reach for new paradigms such as building software from reusable components.
These companies, however, are by far not the rule; in fact, they are exception.