Posts

How to use Google Code Prettify

This post is about how can we use Google Code Prettify to highlight the code which is displayed in my blog. Google Code Prettify is a simple lightweight embeddable java script library. Find the steps below for how to use Google Code Prettify. Step 1: Add run_prettify.js script and any one of skin styles(sunburt <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autoload=true&skin=sunburst&lang=css" defer=""></script> Step 2: Use pre tag for representing our code as follows. The following is the example of html code highlighter. <pre class="prettyprint lang-html linenums"> list of statements </pre> List of Skin Styles Default Desert SunBurst Sons-Of-Obsidian Doxy List of built-in languages supported bsh, c, cc, cpp, cs, csh, cyc, cv, htm, html, java, js, m, mxml, perl, pl, pm, py, rb, sh, xhtml, xml and xsl List of additional language supported Apollo , Basic , C...

Base 64 Encode & Decode

This post is about Base64 encoding and decoding. Base64 is a group of similar Binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The atob() and btoa() JavaScript methods, defined in the HTML5 draft specification, provide Base64 encoding and decoding functionality to web pages. Encode Decode GitHub Link: https://github.com/harishshan/Tools/blob/master/Base64EncodeDecode.html

JSON Viewer

This is a simple JSON viewer developed using JQuery. Find the JSON viewer blow and its source code at GitHub Link Options: Collapse nodes Keys with quotes Transform to HTML GitHub Link: https://github.com/harishshan/Tools/blob/master/JSONViewer.html

How to create Dynamic Kafka Topic Through Java

This is post is about how to create a Kafka topic dynamically through Java.In one of my project, we(me and my friend Jaya Ananthram) were required to create dynamic Kafka topic through Java. Since there is no documentation on Kafka official documentation we are struggled to create dynamic Kafka topic through Java. Then After a long search ,we found this solution for creating the Kafka topic through Java.  import java.util.Properties; import kafka.admin.AdminUtils; import kafka.utils.ZKStringSerializer$; import kafka.utils.ZkUtils; import org.I0Itec.zkclient.ZkClient; import org.I0Itec.zkclient.ZkConnection; public class KafkaTopicCreationInJava { public static void main(String[] args) throws Exception { ZkClient zkClient = null; ZkUtils zkUtils = null; try { String zookeeperHosts = "localhost:2181"; // If multiple zookeeper then -> String zookeeperHosts = "192.168.1.1:2181,192.168.1.2:2181"; ...

Installing MS SQL Server on Ubuntu 16.04

This post about installing the MS SQL Server on Ubuntu 16.04. MS SQL Server could be installed only on Windows, Now Microsoft released SQL Server 2017, which adds Linux support for these Linux platforms: Red Hat Enterprise Linux, SUSE Linux Enterprise Server, Ubuntu & Docker Engine. Find the steps below for installing MS SQL Server on Ubuntu 16.04 1. Login to sudo user $sudo su 2.Install CURL (if curl is not already installed) $sudo apt-get install curl 3.Register MS SQL Server repository $curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add $curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list > /etc/apt/sources.list.d/mssql-server.list $curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/msprod.list sudo apt-get update Note : mssql-server.list contains mssql-server and msprod.list contains mssql-tools 4. Install MS SQL server. $sudo apt-get install -y mssql-server $sudo /opt/mssql/bin/...

Brief Introduction to D3.js

This post is the short notes about D3.js (Data Driven Documents) framework, It is a JavaScript framework mainly used to generate charts using HTML, DOM, Canvas and SVG. Reference: https://github.com/mbostock/d3/wiki/API-Reference Select, Append, Text: <script src="http://d3js.org/d3.v3.min.js"></script> <script> d3.select("body") .append("p") .style("color","red") .attr("allign","center") .text("Hello World"); </script> Basic SVG Shape: var canvas=d3.select("body") .append("svg") .attr("width",500) .attr("height",500); var circle = canvas.append("circle") .attr("cx",250) .attr("cy",250) .attr("r", 50) .attr("fill","red"); var rect = canvas.append("rect") .attr("width",100) .attr("heiht",59); var line = canvas.append(...

A Brief Intro of Apache Storm

Image
This post is about Apache Storm and How to install Apache Storm 0.9.4 (latest version) on Windows 7 & Ubuntu 14.04.2 with an Hello World program. Overview of Apache Storm Apache Storm is a free and open source distributed system for real-time computation. Storm is implemented in Clojure & Storm APIs are written in Java by Nathan Marz & team at BackType. Storm is best for distributed processing where unbounded streams of real time data computation requires. In contrast to batch systems like Hadoop, which often introduce delay of hours, Storm allows us to process online data.Storm is extremely fast, with the ability to process over a million records per second per node on a cluster of modest size. About Nathan Marz Nathan Marz was the lead engineer on Twitter's Publisher Analytics team. Previously Nathan was the lead engineer of BackType which was acquired by Twitter in July of 2011. On march 2013 he left Twitter to start-up his own company He is a major bel...