This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.github.milind; | |
import java.io.IOException; | |
import java.util.StringTokenizer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.github.milind; | |
import java.io.IOException; | |
import java.util.StringTokenizer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.github.milind; | |
import java.io.IOException; | |
import java.util.StringTokenizer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.mycompany</groupId> | |
<artifactId>twitter-sentiments</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<maven.compiler.source>1.7</maven.compiler.source> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.mycompany.twitter.sentiments; | |
import java.io.BufferedWriter; | |
import java.io.FileInputStream; | |
import java.io.FileWriter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 Watching a nice movie | |
0 The painting is ugly, will return it tomorrow... | |
1 One of the best soccer games, worth seeing it | |
1 Very tasty, not only for vegetarians | |
1 Super party! | |
0 Too early to travel..need a coffee | |
0 Damn..the train is late again... | |
0 Bad news, my flight just got cancelled. | |
1 Happy birthday mr. president | |
1 Just watch it. Respect. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Following are the steps which you need to follow in order to install Scala 2.11.6 on Ubuntu 14.04 | |
Assumptions : username is hduser | |
Step 1 : JAVA Installation | |
If you have already installed JAVA, then you can skip this step. | |
If JAVA is not installed, then please follow below steps in order to install JAVA 1.7 | |
command 1 : sudo apt-get update | |
command 2 : sudo apt-get install openjdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd | |
wget http://download.netbeans.org/netbeans/8.0.2/final/bundles/netbeans-8.0.2-javase-linux.sh | |
chmod +x netbeans* | |
sh netbeans-8.0.2-javase-linux.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Following are the steps which you need to follow in order to install Spark 1.6.1 on Ubuntu 14.04 | |
Assumptions : username is hduser | |
Step 1 : JAVA Installation | |
If you have already installed JAVA, then you can skip this step. | |
If JAVA is not installed, then please follow below steps in order to install JAVA 1.7 | |
command 1 : sudo apt-get update | |
command 2 : sudo apt-get install openjdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val input_file=sc.textFile("input.txt") | |
val step1=input_file.flatMap(line => line.split(" ")) | |
val step2=step1.map(word => (word,1)) | |
val step3=step2.reduceByKey(_+_) | |
step3.saveAsTextFile("wordcount") |