2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 22,000 times in 2014. If it were a concert at Sydney Opera House, it would take about 8 sold-out performances for that many people to see it.

Click here to see the complete report.

Move Constructor

Originally posted on Andrzej's C++ blog:

One of the new features in C++11 – move semantics, or r-value references – are already available in a couple of new compilers and have been well described in a number of articles, e.g., by Danny Kalev, Dave Abrahams, and Howard E. Hinnant, Bjarne Stroustrup & Bronek Kozicki. In this post I try to describe only one aspect or the new feature: the move constructor. If you are not yet familiar with r-value references this will be a soft start. If you already are, you may still find the article useful, as I tried to approach the subject from a different angle.

View original 1,601 more words

PORT or STARBOARD, PIC I/O registers ahoy.

Originally posted on electronics and programming beginners guide:

Keep in mind while reading this that this is a general guide and there are always exceptions. The following is a snap shot of a data sheet from the PIC16F1829. This is the processor that comes with the pickit3 starter kit.


The pictured register is for an 8bit pic hence the register is 8bits wide. PICs that are 16bit and 32bit have registers that are 16bits wide and 32bits wide respectively. Registers are how the software controls the hardware, also called special function registers (SFR). This resister is called TRIS and it controls weather a pin is a input or output.pic16f1829 1

Above is the name of the register  boxed in red. The name of the register can be worked with just like a variable. For example this sets the zero bit of the TRISA register. To “set” a bit means to store a 1 in it. To “clear” a bit…

View original 355 more words

Single color detection using OpenCV

Originally posted on Live and Laugh:

After a few days of learning OpenCV, I started to write my first OpenCV program, the requirement is to detect single color and find three largest color objects, it’s a very basic program, but you can know a lot about computer vision if you understand the code. OpenCV provide so many functions, you have to know what you want and what the function does.

This program still run on the Raspberry Pi, frame per second is about 8.5, if you want to find more or less than 3 biggest objects, you can change N. Here is code(You also can get it in my Github) sg_color.c:

Here is makefile:

LIBS= `pkg-config --libs opencv`
CFLAGS= `pkg-config --cflags opencv`
objects= sg_color.o

sg_color: $(objects) 
	gcc $(LIBS)$(CFLAGS) -o sg_color $(objects)

.PHONY: clean
	rm sg_color $(objects)

Here is processed frame and threshold image:


View original

Visual Intelligence : Human vs Machine

Originally posted on Blog:

Ever wondered how visually intelligent our brain is ? or How much has machine vision achieved in mimicking human vision till now ? Lets start by observing a picture

Human Vision (1) Human Vision (1)

Each of these children is observing the world surrounding him/her. They can identify shape and color of various patches in the room. They can also classify objects, the actions of teacher and most importantly ,identify the visually related social behavior of objects in the environment.

By the age of two, our visual cortex becomes so well trained that we can understand any scene without rationalizing its pixel space. This becomes clear from the following example :-

Famous Ponzo Optical Illusion Famous Ponzo’s Optical Illusion

Observe how quickly your brain understands the scene , albeit it falters in guessing that the size of three vehicles are equal. On the other hand, machine vision is still in its infancy. There are algorithms that accurately…

View original 157 more words

Researchers are using deep learning to predict how we pose. It’s more important than it sounds

Algorithms: heap data structure and intro to Greedy Algorithms

Originally posted on drawing with data:

I’m currently taking the Algorithms 1/Algorithms 2 courses on Coursera.  This is an aside from pure data viz, but is good to get this part of the core cs foundation.  And, it’s fun!

Today’s lectures & main take-away messages

Heaps as Data Structures: (1) if you find yourself doing repeated minimum (or maximum) computations, consider a heap and (2) choosing the right data structure can decrease an algorithm’s running time

Intro to Greedy Algorithms: (1) Greedy algorithms are one of the major algorithm design paradigms along with divide & conquer, randomized, and dynamic programming.  (2) Comparing Greedy to Divide & Conquer, greedy algorithms are generally easier to apply while you need the right insight to find how to decompose for D & C, easier to calculate Big O classification since often one aspect of the algorithm dominates, but typically non-trivial to prove correctness.

Optimal Caching as an…

View original 117 more words

Always write a generalized version of your algorithm

Originally posted on Airspeed Velocity:

Suppose you want to find the minimum value in an array. Well, the Swift standard library has you covered:

Ok that’s cool. But suppose you have an array of strings of integers and you want the minimum numeric value.

Well, I guess you could map them to Int and then use the same function:

Nope, compiler error. String.toInt returns an Int?, because maybe the string isn’t a number.

Fair enough. I happen to know with my intimate knowledge of the problem domain that we can just ignore non-numeric values. So maybe filter those out?

Nope, more compiler errors, because now we have only non-nil values, but they’re still optionals and an Int? doesn’t conform to Comparable. So maybe another map to force-unwrap the results (force unwrap is OK because the filter will guarantee no non-nil elements):1

Ok that compiles now and does return the minimum numeric…

View original 457 more words

Linked List with read-write locks for the entire linked list in C

Originally posted on Chameerawijebandara's Blog:


his implementation support Member( )Insert( ), and Delete( ) functions. Populate the linked list with n random, but unique values. Each value should be between 0 and 2^16– 1. Then perform m random Member, Insert, and Delete operations on the link list. Let mMember, mInsert, and mDelete be the fractions of operations of each type. You may use any values within 0 and 2^16– 1 while performing these three operations.

However, to simplify the implementation, a new value inserted into the list cannot be a value already in the list (it may be a value that was initially added to the list, but later removed).


View original

Complete binary search tree in Java


Get every new post delivered to your Inbox.

Join 276 other followers