Skip to content

Commit

Permalink
init push for the code base
Browse files Browse the repository at this point in the history
  • Loading branch information
MoustafaAMahmoud committed Feb 3, 2019
1 parent bb6fd50 commit 5cc1d2f
Show file tree
Hide file tree
Showing 25 changed files with 3,442 additions and 0 deletions.
Binary file added .fuse_hidden00002e2500000004
Binary file not shown.
92 changes: 92 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# -*- mode: gitignore; -*-
*~
\#*\#
### Emacs ###
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# network security
/network-security.data


# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

18 changes: 18 additions & 0 deletions Ch00-CourseOverview/AVGExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
private IntWritable one = new IntWritable(1);
private IntWritable output = new IntWritable()
proctected void map(
LongWritable key,Text value, Context context) {
String[] fields = value.split("\t");
output.set(Integer.parseInt(fields[1]));
context.write(one, output);
}
IntWritable one = new IntWritable(1);
DoubleWritable average = new DoubleWritable();
protected void reduce(IntWritable key,Iterable<IntWritable> values,Context context) {
int sum = 0 ; int count = 0;
for(IntWritable value : values) {
sum += value.get(); count++;
}
average.set(sum / (double) count);
context.Write(key, average);
}
Loading

0 comments on commit 5cc1d2f

Please sign in to comment.