This file contains hidden or 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 JobDriver { | |
/** | |
* @param args | |
* @throws IOException | |
* @throws ClassNotFoundException | |
* @throws InterruptedException | |
*/ | |
public static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException { |
This file contains hidden or 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 TermPartitioner extends Partitioner<PairOfStringInt, PairOfWritables<Text, ArrayListOfIntsWritable>> { | |
public int getPartition(PairOfStringInt key, PairOfWritables<Text, ArrayListOfIntsWritable> value, int numPartitions) { | |
return (key.getLeftElement().hashCode() & Integer.MAX_VALUE) % numPartitions; | |
} | |
} |
This file contains hidden or 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 GroupingComparator implements RawComparator<PairOfStringInt>{ | |
private static final Text.Comparator TEXT_COMPARATOR = new Text.Comparator(); | |
@Override | |
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { | |
return TEXT_COMPARATOR.compare(b1, s1, l1, b2, s2, l2); | |
/* | |
int firstL1;; | |
int firstL2; |
This file contains hidden or 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 com.github.noiano.hXMLInvIndex; | |
import java.io.DataInput; | |
import java.io.DataOutput; | |
import java.io.IOException; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.io.WritableComparable; | |
import org.apache.hadoop.io.WritableComparator; |
This file contains hidden or 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 os | |
import sys | |
#definisco funzione per human readable size | |
def sizeof_fmt(num): | |
for x in ['bytes','KB','MB','GB','TB']: | |
if num < 1024.0: | |
return "%3.1f%s" % (num, x) | |
num /= 1024.0 |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am noiano on github. | |
* I am noiano (https://keybase.io/noiano) on keybase. | |
* I have a public key whose fingerprint is 2807 F9E4 8F7E 6594 A8EA 70EE ADB8 8BD6 BFC6 9BC9 | |
To claim this, I am signing this object: |
This file contains hidden or 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
use_module(library(lists)). | |
/* | |
N-queens problem solved in Prolog (SWI-Prolog). | |
Usage es: n_queen(4,X). | |
*/ | |
n_queen(N, Solution) :- |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link rel="shortcut icon" href="img/favicon.ico"> |