Author's details

Date registered: January 27, 2015

Latest posts

  1. Ubuntu Command: “tasksel” — October 25, 2016
  2. BLAS and LAPACK — September 12, 2016
  3. Euclidean Algorithm — July 22, 2016
  4. Calculating Fibonacci Numbers — July 20, 2016
  5. References and Pointers (C++) — July 11, 2016

Most commented posts

  1. Linear Regression in C++ — 1 comment
  2. Logistic Regression in C++ — 1 comment

Author's posts listings

Oct 25

Ubuntu Command: “tasksel”

Just a note to myself to check out this command when I get the chance.  For whatever reason, despite having used Ubuntu on and off for years, I first learned of it today.

Sep 12


Back when I was new to the world of HPC, I was often confused as to what the distinction was between BLAS and LAPACK.  With the wealth of available memory model variants (shared, distributed), vendor implementations, and subroutine naming conventions, the amount of acronyms can get out of hand quickly.  The following is a little …

Continue reading »

Jul 22

Euclidean Algorithm

The Euclidean Algorithm recursively calculates the greatest common divisor (GCD) of two integers.  It works because GCD(a,b) = GCD(a mod b, b) = GCD(b, a mod b).  Each step of the algorithm reduces the size of the numbers by about a factor of 2.  The total number of steps required is roughly log(a*b).  It is …

Continue reading »

Jul 20

Calculating Fibonacci Numbers

The following C++ code calculates the Nth number in the Fibonacci sequence.  The first routine recursively calculates F_n, however it is very inefficient and takes an unrealistic amount of time to calculate even moderately high values for F_n (say 100).  The second routine generates the sequence sequentially on the fly up to F_n, and is …

Continue reading »

Jul 11

References and Pointers (C++)

Inspired by C++ Primer, Fifth Edition A reference refers to (is another name for) another object. Any operation on the reference actually operates on the object to which the reference is bounded. A pointer is an object itself (unlike a reference) and “points to” another object. Pointers can have four states: 1) It can point …

Continue reading »

Jun 28

Linear Regression in C++

The following is the gradient descent algorithm implemented for linear regression using C++ and the Eigen library:

Jun 28

Logistic Regression in C++

After taking Andrew Ng’s Machine Learning course, I decided to implement some of the algorithms in C++.  The following codes utilize the Eigen template library for linear algebra.  Also, I’m no master in C++, therefore take these codes with a grain of salt! In the course itself, a matlab optimization solver (fminunc) is used in …

Continue reading »

Mar 30

Setting up Visual Studio 2012 and SFML

The detailed directions can be found here: SFML with Visual Studio For all configurations, add the path to the SFML headers (<sfml-install-path>/include) to C/C++ » General » Additional Include Directories. For all configurations, add the path to the SFML libraries (<sfml-install-path>/lib) to Linker » General » Additional Library Directories. Next link your application to the …

Continue reading »

Dec 10


The semi that slammed into me, I never saw it coming. Screeching tires, a loud metallic thud, and a wave of broken glass all compressed into a single second, before darkness and silence. Consciousness returns in a hospital bed, my vision cloudy and fading. The nebulous forms of my wife and child are beside me, …

Continue reading »

Nov 30


The device from deep space parked itself in orbit before orienting it’s lens towards Los Angeles. Earth collectively sighed in relief when it was determined that the alien technology was not a weapon, but a probe. Further analysis revealed that the satellite took a total of 18 weeks worth of images in zeptosecond increments. The …

Continue reading »

Older posts «