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
#/etc/squid/squid.conf | |
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/passwords | |
auth_param basic realm proxy | |
acl authenticated proxy_auth REQUIRED | |
http_access allow authenticated | |
# Choose the port you want. Below we set it to default 3128. | |
http_port 80 |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# <bitbar.title>Weather</bitbar.title> | |
# <bitbar.version>v3.5.0</bitbar.version> | |
# <bitbar.author>Daniel Seripap</bitbar.author> | |
# <bitbar.author.github>seripap</bitbar.author.github> | |
# <bitbar.desc>Detailed weather plugin powered by DarkSky with auto location lookup. Supports metric and imperial units. Needs API key from https://darksky.net/dev/.</bitbar.desc> | |
# <bitbar.image>https://cloud.githubusercontent.com/assets/683200/16276583/ff267f36-387c-11e6-9fd0-fc57b459e967.png</bitbar.image> | |
# <bitbar.dependencies>python</bitbar.dependencies> |
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
\begin{algorithm} | |
\caption{ConcurrentGain - Le chiamate al calcolo dell'information gain vengono eseguite in parallelo utilizzando tutti i core disponibili.} | |
\label{alg:ID3_concurrentGain} | |
\begin{algorithmic}[1] | |
\Procedure{maxInformationGain}{$Dataset, Attributes, TargetAttributes$} | |
\Statex Calcola parallelamente l'attributo che meglio suddivide il dataset in input per classificare il target. | |
\State $Threads \gets $ [ ] \Comment{Creo un array di riferimenti ai Thread} | |
\ForAll{$Attribute$ in $Attributes$} | |
\If{$Attribute \not= TargetAttributes$} \Comment{Salto l'attributo Target} | |
\State $Threads[i] \gets concurrentGain(Attribute)$ |
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
INIT <- function(numeroDiNodi){ # INIT() riceve in input il numero di nodi iniziali del framework | |
Grafo <- inizializzaGrafo() # Crea il grafo globale iniziale | |
Matrice <- convertiGrafoInMatrice(Grafo) # Converte il grafo prima generato in una matrice | |
ListaFinale <- vector(mode="list") # Variabile temporanea: lista di tuple | |
for (i in 1:numeroDiNodi){ # Per ogni suddivisione della matrice creata | |
SottoMatrice <- dividiMatrice(Matrice, i , numeroDiNodi) # dividiMatrice spezza la matrice per righe | |
ListaFinale[i] <- list(input = SottoMatrice, # Creo la tupla [input = SottoMatrice | |
popolazione = randomPopulation()) # popolazione = popolazione randomica | |
} | |
return ListaFinale # |
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
https://www.youtube.com/watch?v=OGr1_qIstlE | |
https://www.youtube.com/watch?v=U-iAMaqibXU | |
https://www.youtube.com/watch?v=_qA4p_XWUCA | |
https://www.youtube.com/watch?v=XI1VpElKWF8 | |
https://www.youtube.com/watch?v=G4UspBs3DGQ | |
https://www.youtube.com/watch?v=6miaTf1gF4g | |
https://www.youtube.com/watch?v=AoZhXA10EEI | |
https://www.youtube.com/watch?v=1m4tYUfYCj4 | |
https://www.youtube.com/watch?v=dv5_QW17xJQ | |
https://www.youtube.com/watch?v=9aHQnDTd1y4 |
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
private ArrayList<Long> getAllFriendsIDs(String user) throws TwitterException{ | |
ArrayList<Long> tmp = new ArrayList<>(); | |
ArrayList<Long> friends = new ArrayList<>(); | |
Long cursor = -1L; | |
IDs ids = null; | |
checkAPICall("/users/show/:id"); | |
User curUser = _tw.showUser(user); | |
// Take the min number of user | |
if(curUser.getFollowersCount() < curUser.getFriendsCount()){ |
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
#!/bin/bash | |
# Only once setup: | |
# iptables -N cloudflare | |
# iptables -t filter -I INPUT -j cloudflare -p tcp -m multiport --dports http,https | |
iptables -F cloudflare | |
for i in `curl https://www.cloudflare.com/ips-v4`; do | |
iptables -A cloudflare -p tcp -s $i -m multiport --dports domain,http,https -j ACCEPT; | |
done | |
iptables -A cloudflare -j RETURN |
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
#!/bin/bash | |
randomResult=0 | |
random () | |
{ # Genera un numero random tra due intervalli | |
lower=$1 | |
upper=$2 | |
randomResult=-99 #initialize | |
while [ "$randomResult" -le $lower ] | |
do | |
randomResult=$RANDOM |