Category Archives: Technology

Computing similarities between datasets

Similarity measures is used all over the web and is pretty well known by anyone who has performed Internet searches using a search engine. Assuming the entire internet comprising of all the websites as one single database which could be divided into two classes – those which can answer your query and other which cannot. […]

0  

Wrote my first strategy game – KALAH!

Kalah or Mancala is a strategy game. It is a two-player game and heavily favors the person who starts playing first. Each participant starts with certain number of seeds which are randomly allocated. At every turn, the user tries to grab seeds from the opponent’s house. The goal is to finish the game with the […]

0  

Optimization using Hill Climbing

The following example shows how to find the best portfolio configuration given that only the price of a single stock can be incremented by 10 cents at a time. Since we are using Hill Climbing technique, we can find the local optimal value easily but the same cannot be said for finding the global optimal […]

0  

Prefix Tree

Creating a prefix tree is quite easy in Python! root = {} def addToTree(node, word=()): if not word: return addToTree(node.setdefault(word[0], {}), word[1: ]) def main(): for word in (‘batman’, ‘bane’, ‘bale’,): addToTree(root, word) print root Output: {‘b’: { ‘a’: { ‘l’: { ‘e’: {} }, ‘n’: { ‘e’: {} }, ‘t’: { ‘m’: { ‘a’: […]

0  

Do Value Types in C# always go on the stack?

It is quite well-known that value-types are created on the Stack (sometimes in registers as well depending on the allocation strategy) and reference types are based in the Heap area of memory. But when you are creating a custom type and you wish to embed value types in there, where would they reside? So it […]

0