arundhaj

regression towards the datascience

SSLProtocolException handshake alert

 

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

javax.net.ssl.SSLProtocolException: 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 {
    PyObject_VAR_HEAD
    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 …

Starting CDH quickstart VM in Windows

 

While trying Cloudera CDH quickstart VM in my Windows 7 machine, I was facing issues to start it with VMware player.

I was getting the following error message.

The import failed because D:\VirtualMachines\cloudera-quickstart-vm-4.3.0-vmware\cloudera-quickstart-vm-4.3.0-vmware.ovf did not pass OVF specification conformance …

Getting Started with ZeroMQ in Python

 

A simple getting started sample for ZeroMQ in Python. We will implement a Echo Server and Echo Client.

echo_server.py

import zmq

context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://127.0.0.1:5000")

while True:
    msg = socket.recv()
    print "Got", msg
    socket.send(msg)

echo_client …