Posts

Machine Intelligence / Learning Landscape

Image

Raspberry Pi

Static IP for Wifi sudo vi /etc/network/interfaces Add wifi string ID (Different from wifi SSID) auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp iface home_static inet static    address 192.168.0.53    netmask 255.255.255.0    gateway 192.168.0.1  

Perl

Part 1  Recap of Datastructures  Complex Data structures Anon CDS -Hashes Part 2  Regular Expressions  Subroutines & Files Part 3  Modules  CPAN/DBI/CGI/N-w ------------------------------------------------------- Perl identify the DS by the prefix symbol  Scalar - $  - a value  List   - ()  Array  - @  Hashes - % define a lexical scalar -  my $a; default value scalar    -  undef how to check for undef  -  if(defined($a)){ } get input from keyboard -  $a=<STDIN>    # \n stops                            @arr=<STDIN>  # EOF stops output to console       -  print STDOUT "Hello";                            print "Hello"; Errors                  -  print S...

Unix and Hadoop

SCP to a seperate PORT scp -P 5050 asd.tar.gz user@192.168.1.15:/home/user Tomcat Webapps Location /usr/share/tomcat/webapps Get IP address ifconfig eth0 | awk '/inet /{print $2}' Get Tomcat logs tail -f /usr/share/apache-tomcat-7.0.30/logs/catalina.out tail -f -n 10 Running Hadoop Jobs set mapred.job.queue.name=dev hadoop jar acs.jar -D mapreduce.reduce.speculative=false -D mapreduce.map.speculative=false -D mapred.job.queue.name=dev -D mapreduce.task.io.sort.factor=256 -D file.pattern=.*20110110.* -D mapred.reduce.slowstart.completed.maps=0.9 -D mapred.reduce.tasks=10 /Input /Output hadoop jar test.jar -D mapred.job.queue.name=dev -D mapred.textoutputformat.separator=, Glassfish Webapps folder location /usr/share/glassfish4/glassfish/domains/domain1/applications Killing Mysql Processes ps -ef | grep mysql | awk -F" " '{system("kill -9  "$2)}' Starting MySQL /etc/init.d/mysqld start Mo...

Free Dashboards

Image
http://webdesign.tutsplus.com/tutorials/build-a-dynamic-dashboard-with-chartjs--webdesign-14363 http://keen.github.io/dashboards/examples/ http://usebootstrap.com/theme/sb-admin

Handling CSV

import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class ReadCVS {   public static void main(String[] args) { ReadCVS obj = new ReadCVS(); obj.run();   }   public void run() { String csvFile = "DailyData.csv"; BufferedReader br = null; String line = ""; String cvsSplitBy = ","; try { br = new BufferedReader(new FileReader(csvFile)); while ((line = br.readLine()) != null) {        // use comma as separator String[] splits = line.split(cvsSplitBy); System.out.println(splits[4]                                   +splits[5]); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (br != null) { try { br.close(); } catch (IOException e) { ...

Hadoop Part 1: Hello World

Image
Hadoop Hello World: The Word Count Code: The word count code is the simplest program to get you started with Map Reduce Framework. The task that a wordcount program performs is as follows: Given several text files find a count of number of times each word appears in the entire set It primarily consists of 3 parts: Driver    : Driver portion of the code contains the configuration details for the Hadoop Job. For example the input path, the output path, number of reducers , mapper class name, reducer class name etc Mapper  : Role of mapper in word count is to emit <word, 1>  for each word appearing in the document. Reducer : Role of Reducer in word count is to sum the list of 1's prepared by shuffle and sort phase <word, [1,1,1,1,1,1]>  and emit <word, 6> It's easier to create an eclipse java project and add relevant hadoop jar files for the code below.  package com.kush; import java.io.IOException; import java.uti...