Instantly share code, notes, and snippets.

• Sort options

# SimoneSimoneManduchi

View prob.py
 #Python code that in a pseudo-random way estimates the average number of trials needed to see the sequence 1 or 2, of iid R.V. The probability of Head must be input in decimal form like 0.0001 or 0.2548. Remove hashes for debug prints #Done by Simone Manduchi, 28th November 2015 - Probability course - LUISS University. Beta version import random trials=int(raw_input('Number of trials: ')) p=float(raw_input('Probability of having an HEAD (in the form 0.xxxxx): ')) runs=int(raw_input('Different runs (each of them consists in the number of trials inserted before): ')) counter=0 finalavg=[] while counter!=runs: q=1-p
View gist:74bf96410f4ff69364b7
 #Stata lista=(VAR SEPARATED WITH COMMA) a=0 b='gen var=.' while a!=len(lista): c=a+1 b+='\nreplace var='+str(lista[a])+' if Y11_Country=='+str(c) a+=1 print(b)
View grimace.htm

View gist:11267370
 //Creato da Simone Manduchi per il NewsBoard Forum (2009) (non valido dal 2012 causa i blocchi di sicurezza sui circuiti) var mexnospam = 'Non puoi fare spam in Tag!' urlAllowed = new Array(); urlAllowed [0]="http://myspecialworks.blogfree.net"; urlAllowed [1]="http://supporto.forumfree.net"; urlAllowed [2]="http://newsboard.forumfree.net"; urlAllowed [3]="http://www.google.it"; var tagboardv = document.tagboard ? document.tagboard : 0; if(tagboardv) { function noSpam() {
View gist:11083106
 #Sfondidesktopgratis.net per aggiungere rewriterules all'htaccess dopo aver cambiato la directory by Simone Manduchi (2014) import lxml.html var_dir=input('Directory:') var_new_dir=input('Nuova directory:') errors='' print('Inizializzazione... \n') list_file = open("/home/user/Desktop/lista-da-php.txt") var_list_file = list_file.read() var_list_file=var_list_file.split('&&&')
View gist:10970637
 # -*- coding: utf-8 -*- ''' ###TriviaBot### Ultima modifica: 3/9/2010 ''' from irclib import SimpleIRCClient import random import timed85vg4fd8v4AAFR&CGVD
View gist:10970554
 # -*- coding: utf-8 -*- '''Questo BOT tiene i record degli utenti su vari canali. In caso di disconnessione i dati rimarranno disponibili. Prima di installarlo creare nella stessa directory un file vuoto records.pkl''' #Creato da Simone Manduchi per forumfree.it (2010) from irclib import SimpleIRCClient import pickle class IRCCLient(SimpleIRCClient): def __init__(self, channel): SimpleIRCClient.__init__(self)
View gist:10970451
 #universalsite.org #created by Simone Manduchi (2010) import sys import webbrowser import random from PyQt4 import QtGui from PyQt4 import QtCore