Hadoop Streaming

Hadoop Streaming is a generic API which allows writing Mappers and Reduces in any language. But the basic concept remains the same. Mappers and Reducers receive their input and output on stdin and stdout as (key, value) pairs. Continue reading

Javascript: Find duplicates in the array and delete from array.

Finding duplicates in array. Please go to groggyjava.

Deleting duplicates:

var duplicateCodes= [];
duplicateCodes.push(“ss”, “”, “ee”, “”,”ee”);  //inserting duplicates and some empty values.

duplicateCodes= duplicateCodes.filter(function(e){return e});  // removing empty values.
if(duplicateCodes.indexOf(“ee”) >= 0)  // checking if “ee” is already in the array
alert(“Please remove \n” + duplicateCodes.join(‘\n’));

Hadoop installation.

You can setup Hadoop in two ways on your windows machine.

  1. Download Virtualbox or VMware player, install Linux and install Hadoop. A very good tutorial is available here: http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/
  2. Virtualized apps: Download Virtualbox or VMware player, install Cloudera QuickStart VM or Hortonworks Sandbox or MapR Sandbox. This way minimizes the time spent on installing, and configuring Hadoop, then Pig, Hive, and so on. These contain a single-node Apache Hadoop cluster, Eclipse for Java, complete with example data, queries, scripts… You can download them from their websites.
    https://www.youtube.com/watch?v=oNQ8f2My5Hs (for installing Cloudera QuickStart VM)

Continue reading

DIV, P and SPAN tags.

By default, <p> </p> will add line breaks before and after the enclosed text (so it creates a paragraph). <span> does not do this, that is why it is called inline. When we are using normal text at that time we want <p> tag.

When we are using normal text with some effects at that time we want <span> tag. An important difference is that <div >, <p> are block elements and  <span> is inline, meaning that <p>Hi</p><p>There</p> would appear on different lines when <span>Hi</span><span>There</span>winds up side by side. Continue reading

By Sriramjithendra Posted in HTML5 Tagged

How to use AngularJS in ASP.NET MVC and Entity Framework

This post is taken from Dhananjay Kumar.

In short, this post will touch upon:

  • adding an AngularJS library in ASP.NET MVC;
  • reference of AngularJS, bundling and minification;
  • fetching data using the Entity Framework database;
  • returning JSON data from an ASP.NET controller;
  • consuming JSON data in an AngularJS service;
  • using AngularJS service in AngularJS controller to pass data to the view; and
  • rendering data on an AngularJS View

Continue reading

Client Browser’s Submit Mechanism And The Postback Mechanism in ASP.NET and How the server knows which button clicked

While reading about “UseSubmitBehavior in an asp.net button”, I came to know that UseSubmitBehavior property to specify whether a Button control uses the client browser’s submit mechanism or the ASP.NET postback mechanism. By default the value of this property is true, causing the Button control to use the browser’s submit mechanism. If you specify false, the ASP.NET page framework adds client-side script to the page to post the form to the server. (causes the button to use the ASP.NET postback mechanism, also to identify at server side which button was clicked in the browser.). Continue reading

Numbers as keys in JSON object

JSON object: 
var jsonParams = {
                Name: ‘ram’,
                    1: ‘asdf’,
                     2: ‘2312’
If you want to read value from above JSON object
$(“#Street”). val(jsonParams[“1”]);