How to install and configure grunt on mac Osx

This post is intended to assist folks who are trying to install and work with grunt on mac osx

Install Node.js and npm with Homebrew

First, install Homebrew by typing in the following command ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Then, type in brew update to ensure your Homebrew is up to date.

brew update

Run

brew doctor 

to make sure your system is all good.

Follow any other recommendations from brew doctor.

Read more →

Install tile-stache on OsX Mavericks

This is quick tutorial about installing Tilestache library in OSX Mavericks.

Step 1

Make sure Developer tools are installed xcode-select –install

Then add these flags to tell xcode to use python like rest of the world does

export CFLAGS=-Qunused-arguments

export CPPFLAGS=-Qunused-arguments

Finally type in sudo easy_install tilestache

That’s it, all done. You might see some warnings, but that’s fine — ignore them.

Read the introduction here to get started

Read more →

Ternary search tree

In computer science, a ternary search tree is a type of prefix tree where nodes are arranged as a binary search tree. Like other prefix trees, a ternary search tree can be used as an associative map structure with the ability for incremental string search. However, ternary search trees are more space efficient compared to standard prefix trees, at the cost of speed. Common applications for ternary search trees include spell-checking and auto-completion.

As with other trie data structures, each node in a ternary search tree represents a prefix of the stored strings. All strings in the middle subtree of a node start with that prefix.

Read more →

Gheat Java – Heat maps

heat_map

A heat map is a graphical representation of data where the individual values contained in a matrix are represented as colors.

This article will attempt to explain the process of creating and using GHEAT-JAVA, which is a port of famous aspen based gheat and took great inspiration from Gheat.net

Writing a service which would serve heat map tiles is a bit tricky, there are three major components involved

  1. The client part i.e. some kind of mapping library which has a concept of layer, I chose Google maps.
  2. The data source part, i.e. a spatially aware database or an in memory data structure, I have used postgres ,an in memory quad tree and a flat file as data sources.
  3. The renderer part or basically the code which accepts requests, parses tile bounds, fetches data and then renders gradients on the tile and later colorizes them.

The Tiling layer (Client part)

Google maps allows developers to add a custom layer, the code looks like this

Read more →