all that is technology

Categorizing and summing data in d3js


Categorizing an array into different buckets in d3js with d3.nest.

For example, consider a dataset that contains an array of integers ranging values from 1 to 200. If we had to group this array into the following four buckets, as defined as;

  • value >= 150, categorize as excess-heat
  • value >= 140 …

Connect remote postgresql server with pgAdmin


When trying to connect remote postgresql server with pgAdmin, leads to "Unable to connect" error.

To enable pgAdmin to connect, edit the following configuration in the server:

$ sudo vim /etc/postgresql/9.3/main/postgresql.conf
   listen_address = '*'

$ sudo vim /etc/postgresql/9.3/main/pg_hba.conf
   local    all     postgresql          trust …

SSLProtocolException handshake alert


I was getting the below mentioned exception on my Java client which is trying to establish URL connection to a server. handshake alert: unrecognized_name

The Java client was actually trying to get an XML from the the URL and store it locally in a file as …

PyTypeObject base of Python


PyTypeObject is a structure that defines the basic building blocks of Python, Types.

The definition as found in Include/Object.h file:

typedef struct _typeobject {
    const char *tp_name; /* For printing, in format "<module>.<name>" */
    Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */

    /* Methods to implement standard operations */

    destructor …

Pandas with Postgres datasource


We would be getting data from different sources for doing data analysis. Most common being from files, we might even source from databases.

This post will show how to load data from postgres database to pandas DataFrame. pandas is a python based data analysis tool.

import psycopg2 as pg
import …

Spring Hibernate - Create table if not exists


We have to configure hibernate, if we require the application to create the table when it doesn't already exists. Else, we would end up with the below mentioned exception.

ERROR: ERROR: relation "mytable" does not exist
  Position: 13
org.hibernate.exception.SQLGrammarException: could not execute statement
    at org.hibernate.exception …