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 | |
# 1. ls this directory | |
# 2. Remove from the list the 5 most recent files | |
# 3. Remove from the directory the remaining files. | |
ls | grep -v "$(ls -t | head -n 5)" | xargs -n 1 rm |
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
/** | |
* This method fetches an integer value of five from the top of the call stack, which is as high as you can get | |
* @return a high five | |
*/ | |
public static int five() { | |
try { | |
return five(); | |
} | |
catch (StackOverflowError e) { | |
return 5; |
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
<?php | |
/** | |
* A simple image uploader | |
* Federico Ponzi | |
*/ | |
/* Config: **/ | |
// Base url, for the json response: | |
define ("BASE_URL", "http://127.0.0.1/"); | |
// Where to put the images: |
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
# -*- coding: utf-8 -*- | |
"""Convert the Yelp Dataset Challenge dataset from json format to csv. | |
For more information on the Yelp Dataset Challenge please visit http://yelp.com/dataset_challenge | |
""" | |
import argparse | |
import collections | |
import csv | |
import simplejson as json | |
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 socket | |
import MergeSort | |
HOST = '192.168.1.1' | |
PORT = 50007 | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((HOST, PORT)) | |
#Receives arraystring in chunks |
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
(* numeri di Church *) | |
val zero = fn f => fn x => x; | |
val uno = fn f => fn x => f x; | |
val due = fn f => fn x => f (f x); | |
val tre = fn f => fn x => f (f (f x)); | |
(* dato un naturale, si ottiene il corrispondente numero | |
di Church applicando la seguente funzione di codifica *) |
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 | |
#Federico Ponzi | |
#doylefermi | |
#chocolatkey | |
# GPLv2 | |
usage() | |
{ | |
echo "Usage: $0 [-all][-list][-i] xxx.xxx.xxx.xxx" | |
} |
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 main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"strings" | |
"sync" | |
"log" | |
"time" | |
"crypto/md5" |
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 main | |
import "fmt" | |
func dividiEtImpera( arr []int, low int, hi int, ch chan int){ | |
if hi - low == 1{ | |
// fmt.Println("low: ", low, " hi:", hi, " Caso hi-low==1, ritorno:",arr[hi-1], "+", arr[low] | |
ch <- arr[hi-1] + arr[low] | |
} else if hi-low == 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
package main | |
import "fmt" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
nMeno1 := 0 | |
nMeno2 := 1 | |
return func() int { |