Skip to content

Instantly share code, notes, and snippets.

View sn1p3r46's full-sized avatar
💭
Lost in Coding

Alexander Ows sn1p3r46

💭
Lost in Coding
View GitHub Profile
@sn1p3r46
sn1p3r46 / Animal.java
Last active September 26, 2016 18:18
Basic Java class for java teaching proposes :)
// The class is visible from outside the package
// the class itself is not the object but is the
// description of its behaviour and its data structure.
// (The PROJECT)
public class Animal {
private String race = "Uknown";
private int age;
@sn1p3r46
sn1p3r46 / preprocessing.pl
Last active June 26, 2016 18:11
TEXT PREPROCESSING WITH PERL
#!/usr/bin/perl
my @myLangs = qw( de it fr );
# STOP WORDS FOLDER
my $stp = "/home/andrea/Downloads/DataMining/code/data/";
# STOP WORDS FILE
my $stf = "/stopwords.txt";
# DATA MAIN PATH
[ -z "$PS1" ] && return
export EDITOR=/usr/bin/nano
export SHELL=/bin/bash
# Pretty-print of some PATH variables:
alias path='echo -e ${PATH//:/\\n}'
alias libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}'
alias mkdir='mkdir -p'
@sn1p3r46
sn1p3r46 / TP-Link_TD-W8960N_Reboot.sh
Last active November 29, 2020 15:23
This bash script reboots TP-Link routers
@sn1p3r46
sn1p3r46 / AprioriCompact.py
Created January 28, 2016 13:37
a compact apriori pythonian version
from collections import defaultdict
from itertools import imap, combinations
def get_frequent_items_sets(transactions,min_support,steps=0):
frequent_itemsets = []
items = defaultdict(lambda: 0)
[inc(items,item,1) for transaction in transactions for item in transaction]
items = set(item for item, support in items.iteritems()
if support >= min_support)
[frequent_itemsets.append(item) for item in items]