This file contains 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
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~## | |
## Sirius Fucking Licence 1.2 "ShitStorm" ## | |
## Do the fuck you want. Get the fuck off. ## | |
## Using this licence don't make you more trasgressive. ## | |
## And doesn't mean you're not an asshole. ## | |
##~~~~~~~~~~~~~~~*The quiet after the shitstorm*~~~~~~~~~~~~~~~~~~~## | |
## Sirius Fucking Manifesto ## | |
## With this software pubblication licence you can modify, rewrite ## | |
## rape, burn, kill, delete, fuck, do nothing. In few words: ## | |
## DO DAFUQ YOU WANT AND DON'T EXCORIATE MY BALLS ## |
This file contains 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
class Pokemon | |
attr_accessor :pid, :checksum | |
def to_s | |
"PID: #{@pid}\nChecksum: #{@checksum}" | |
end | |
end | |
data = File.read ARGV[0] | |
pokemon = Pokemon.new |
This file contains 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
w = File.open('n00b', ?a) | |
f = proc { |*a| | |
w.puts a.join | |
} | |
a = f.curry | |
5.times { |t| a[t] } |
This file contains 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
#-- | |
# urls.txt | |
# D:\Users\Giovanni\Documents\Ebook | |
# D:\Users\Giovanni\Documents\4A Games | Metro 2033 | |
#++ | |
(paths = []).tap { |paths| | |
File.read('urls.txt').each_line { |path| | |
next if path.gsub(/\s+/, '').empty? | |
path.gsub!(/\n/, '') |
This file contains 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
module Enumerable | |
def select_with_index | |
i = 0 | |
self.select { |e| | |
i += 1 | |
yield e, i | |
} | |
end | |
end |
This file contains 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
#include <stdio.h> | |
/* Niente funzioni e niente di niente, un array e un algoritmo di ordinamento bubblesort che te lo ordina in modo crescente semplicemente scambiando gli elementi. | |
*/ | |
int main() { | |
int n; | |
printf("Values to add: "); | |
scanf("%d", &n); | |
if(n <= 2) { |
This file contains 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
require 'open-uri' | |
require 'nokogiri' | |
def puttana(url, what) | |
candidati = [] | |
voti = [] | |
doc = Nokogiri::HTML(open(url)) | |
doc.xpath('//tr[@class="evid"]/th').each { |p| |
This file contains 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/env ruby | |
=begin | |
#Scrivere un programma che legga da tastiera due interi N e K e una sequenza di N stringhe e che stampi le K stringhe più frequenti in essa contenute. Queste K stringhe devono essere stampate in ordine lessicografico. | |
Si può assumere che: | |
- non esistano due stringhe con la stessa frequenza; | |
- il valore di K sia minore o uguale al numero di stringhe distinte; | |
- le stringhe contengono soltanto caratteri alfanumerici (a − z minuscoli e maiuscoli o numeri, nessuno spazio o punteggiatura) e sono lunghe al più 100 caratteri ciascuna. |
This file contains 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
class Array | |
def most_popular(n = 1) | |
get_occurrency_hash[n * -1].first | |
end | |
def occurrences(n = 1) | |
get_occurrency_hash[n * -1].last | |
end | |
def has_duplicates? |
This file contains 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/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
class String | |
def numeric? | |
self.to_i.to_s == self || self.to_f.to_s == self | |
end | |
end |
OlderNewer