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
package le.pioneer | |
import org.apache.spark.sql.{Dataset, SparkSession} | |
import org.apache.log4j.Logger | |
object HelloDataSet extends Serializable { | |
@transient private lazy val logger: Logger = Logger.getLogger(getClass.getName) | |
private case class Employee(employeeID: Int, employeeName: String, department: String, startDate: String) |
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
package le.pioneer | |
import org.apache.spark.sql.{DataFrame, SparkSession} | |
import org.apache.log4j.Logger | |
import org.apache.spark.SparkConf | |
import java.util.Properties | |
import scala.io.Source | |
// This uses DataFrame API | |
object HelloDataFrame extends Serializable { |
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
package le.pioneer | |
import org.apache.log4j.Logger | |
import org.apache.spark.{SparkConf, SparkContext} | |
// hard-coded Spark application using RDDs API instead of DataFrames | |
object HelloRDD extends Serializable { | |
private case class Employee(employeeID: Int, employeeName: String, department: String, startDate: String) |
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
import java.util.*; | |
//this class is used for statistics //incomplete version | |
public class Sorter { | |
public static ArrayList<Integer> reduce (ArrayList<Integer> init) { | |
ArrayList<Integer> newArray = new ArrayList<Integer>(100); | |
newArray.add(init.get(0)); | |
for (int i: init) { |
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
public class Deep { | |
public static ArrayList<ArrayList<ArrayList<String>>> deep; | |
public static void main (String args[]) { | |
deep = new ArrayList<ArrayList<ArrayList<String>>>(); | |
System.out.println(deep); | |
addOuterArray(); | |
addInnerArray(0); | |
addInnerString("John",0,0); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main( void) | |
{ | |
int a,b,sum,option; | |
printf("Welcome to C calculator\n"); | |
printf("Choose an option:\n"); | |
printf("add: 1 , Subtract: 2 , Multiply: 3\n"); | |
scanf("%d",&option); |
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
import java.util.*; | |
/** This code shows the purpose of collection and iterator | |
* classes in java. This code was made from code from | |
* the book "Java How To Program - edition 9" from figure 20.2 | |
* @author Naji Kadri | |
* | |
* @version 1.0 | |
*/ |