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 or 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 excepts 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 →

Raphael-js-tutorial-part-II

This is second part of the tutorial about getting started with Raphael.js. To see this first part go here.

Writing Text with Raphael

Some code first ;)

var canvas = Raphael(0, 0, 250, 250 );

var t1 = canvas.text(50, 50, *"Some text Goes here"*);

var t2 = canvas.text(60,90,"First line \n Second Line \n Third line");

var t3 = canvas.text(214, 140, "1079").attr({"text-anchor":"middle",'font-size':16,"font-family":"arial","fill":"#fff"});

In the above examples canvas.text will create a simple text element at 50,50. Strangely VML /SVG do not have Line breaks therefore the programmer is responsible for creating new lines,in most cases appending** ‘\n’** does the trick.

Read more →

Turn Off Autocomplete for Input

The autocomplete attribute specifies whether or not an input field should have autocomplete enabled.

Autocomplete allows the browser to predict the value from locally saved history/cache. When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values.

Note: The autocomplete attribute works with the following types: text, search, url, tel, email, password, datepickers, range, and color.

Read more →

Embedding Flash,Quicktime,Windows Media,Silverlight or HTML5 Video

Flash Object

This is quick Snippet which demonstrate how to embed flash object in a web page.

<object type="application/x-shockwave-flash"
 data="path-to-my-flash-file.swf"
 width="0" height="0">
 <param name="movie" value="your-flash-file.swf" />
 <param name="quality" value="high"/>
</object>

Quicktime

This is quick Snippet which demonstrate how to embed quicktime object in a web page

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
      codebase="http://www.apple.com/qtactivex/qtplugin.cab"
      width="200" height="16">
<param name="src" value="pathToMyMovie.mov" />
<param name="autoplay" value="true" />
<param name="pluginspage" value="http://www.apple.com/quicktime/download/" />
<param name="controller" value="true" />
<!--[if !IE]> <-->
  <object data="movie.mov" width="200" height="16" type="video/quicktime">
    <param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
    <param name="controller" value="true" />
  </object>
<!--> <![endif]-->
</object>

Windows Media

This is quick Snippet which demonstrate how to embed Windows Media object in a web page.

Read more →

Mod Proxy equivalent in IIS using ARR and URL Rewrite Module

IIS7 is quite modular, it is shipped with lots of goodies as separate modules and together it is now one of the most powerful and flexible web server.

In this post I intent to cover how we can easily configure ARR and URL Rewrite Module to get a similar functionality as of Mod Proxy in Apache.

Here I will demonstrate configuration of a reverse proxy which according to the definition is

Reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers. A general use case to configure such proxies could be to handle cross domain Ajax requests, so basically if I would like to call a service hosted as http://anotherdomain.com/service from http://localdomain/service I would need to configure a proxy which will request resources from anotherdomain.com/service on behalf of localdomain ### Configuration

Read more →