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 math | |
G = 1 | |
class Vector: | |
dX = 0 | |
dY = 0 | |
dZ = 0 | |
def build(self, x1, y1, z1, x2, y2, z2): | |
self.dX = math.fabs(x1 - x2) |
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
public class Element { | |
public mortality; | |
public boolean alive; | |
public int age; | |
public Point position; | |
public void tick() { | |
updateMortality(); | |
if (alive) { | |
age++; | |
if (random(0,1)<mortality) { |
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
2 popolazioni in rapporto: prede, predatori | |
ciascuno con tassi di natalità e mortalità | |
Variabili: caccia controllata (introduce cacciatori), cibo per le prede (nota: portanza = qtà max di animali su un territorio date le sue risorse), nuovi predatori | |
nota di giulio: a ogni tick una preda può consumare 1J, o magari un lavoro variabile per-preda, per spostarsi, quindi a seconda della pendenza... | |
Prede possono scappare, evolversi (perché hanno un fattore secondo il quale scappano dalle prede (genetic programming), quanto sono efficienti, quanto sono fertili, a che età si riproducono, quale algo di pathfinding), stesso per i predatori | |
ambiente con "colline" che rallentano/velocizzano il movimento, ostacoli insuperabili |
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
int i; | |
void segwrite(int n); | |
void loop() { | |
if (digitalRead( 9)) { i--; goto nextstep; } | |
if (digitalRead(10)) { i++; goto nextstep; } | |
return; | |
nextstep: | |
if (i < 0) i = 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
"use strict"; | |
var async = require("async"), | |
net = require("net"), | |
TelegramBot = require('node-telegram-bot-api'); | |
var q = async.queue((item, cb) => { | |
console.log(item); | |
mandaComando(item, cb); | |
}); |
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 serial | |
with serial.Serial("COM3", 9600) as ser: | |
while True: | |
s = ser.read() | |
if (s == b'o'): | |
print "Restart" | |
# Alive | |
ser.write(b'n') |
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
Ziziola | 2015-01-01 00:00:00 | -2 | |
---|---|---|---|
Ziziola | 2015-01-01 00:10:00 | -1,9 | |
Ziziola | 2015-01-01 00:20:00 | -2 | |
Ziziola | 2015-01-01 00:30:00 | -2,2 | |
Ziziola | 2015-01-01 00:40:00 | -2,3 | |
Ziziola | 2015-01-01 00:50:00 | -2,4 | |
Ziziola | 2015-01-01 01:00:00 | -2,4 | |
Ziziola | 2015-01-01 01:10:00 | -2,4 | |
Ziziola | 2015-01-01 01:20:00 | -2,4 | |
Ziziola | 2015-01-01 01:30:00 | -2,4 |
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
Pastori | 2015-01-01 00:00:00 | -1,3 | |
---|---|---|---|
Pastori | 2015-01-01 00:10:00 | -1,3 | |
Pastori | 2015-01-01 00:20:00 | -1,2 | |
Pastori | 2015-01-01 00:30:00 | -0,9 | |
Pastori | 2015-01-01 00:40:00 | -0,7 | |
Pastori | 2015-01-01 00:50:00 | -0,5 | |
Pastori | 2015-01-01 01:00:00 | -0,2 | |
Pastori | 2015-01-01 01:10:00 | 0 | |
Pastori | 2015-01-01 01:20:00 | 0,2 | |
Pastori | 2015-01-01 01:30:00 | 0,1 |
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
Stazione | Anno | Media invernale | |
---|---|---|---|
Pastori | 1995 | 4.7 | |
Pastori | 1996 | 5.6 | |
Pastori | 1998 | 9.7 | |
Ziziola | 1998 | 6.1 | |
Ziziola | 1999 | 4.2 | |
Pastori | 1999 | 5.0 | |
Pastori | 2000 | 5.2 | |
Ziziola | 2000 | 4.9 | |
Ziziola | 2001 | 5.2 |
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
library(caTools) # external package providing write.gif function | |
jet.colors = colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", | |
"yellow", "#FF7F00", "red", "#7F0000")) | |
m = 600 # define size | |
C = complex( real=rep(seq(-1.8,0.6, length.out=m), each=m ), | |
imag=rep(seq(-1.2,1.2, length.out=m), m ) ) | |
C = matrix(C,m,m) # reshape as square matrix of complex numbers | |
Z = 0 # initialize Z to zero | |
X = array(0, c(m,m,20)) # initialize output 3D array | |
for (k in 1:20) { # loop with 20 iterations |
OlderNewer