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
mele = ['annurca', 'fuji','cox', 'golden','renetta', 'granny smith', 'elstar', 'pink lady'] | |
partitions = function (set, n){ | |
var albero={} | |
if(n>0){ | |
for(var i=0; i< set.length; i++){ | |
var tset=set.slice() | |
var key=tset.splice(i,1)[0]; |
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 <Wire.h> | |
#include <Adafruit_MotorShield.h> | |
#include "utility/Adafruit_PWMServoDriver.h" | |
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); | |
Adafruit_DCMotor *sx = AFMS.getMotor(3), *dx =AFMS.getMotor(1); | |
void setup(){ | |
AFMS.begin(); |
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
#------------------------------------------------------------ | |
# ATtiny85 | |
#------------------------------------------------------------ | |
part | |
id = "t85"; | |
desc = "ATtiny85"; | |
has_debugwire = yes; | |
flash_instr = 0xB4, 0x02, 0x12; | |
eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, |
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
//11 trig | |
//10 echo | |
//13 led | |
void setup(){ | |
pinMode(11, OUTPUT); | |
pinMode(10, INPUT); | |
pinMode(13, OUTPUT); | |
} |
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
(defn daje [x](/(* (+ x 1) x) 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
# Ctrl+Alt+B per compilare! | |
Lei ha clacsonato | |
voglio Io, Mascetti come fosse 72 | |
Io a posterdati | |
voglio Cicinelli, Mascetti come fosse Io più 29 |
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
#!/bin/bash | |
# | |
# usage: run2pass.sh FileToEncode.Extension | |
# produces: FileToEncode.Extension.costant.webm in the same directory | |
# requires: docker | |
# vp9 2 pass encoding with recomended settings for costant quality encoding | |
# uses docker image from jrottenberg/ffmpeg | |
# taken from https://sites.google.com/a/webmproject.org/wiki/ffmpeg/vp9-encoding-guide | |
# |
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
int main(){ | |
vector<int> char_count(int('z'-'a')+1); | |
string word; | |
cin >> word; | |
for_each(begin(word), end(word), [&char_count](char c){ char_count[int(c-'a')]++; }); | |
auto odd=count_if(begin(char_count), end(char_count), [](int count){ return (count%2) == 1;}); | |
if(word.length()%2 == 1) --odd; | |
cout << (odd==0)? "YES" : "NO"; | |
} |
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
#Using an Adafruit NeoPixel led strip http://www.adafruit.com/product/1138 | |
#include <Adafruit_NeoPixel.h> | |
#define MAX_P 60 | |
// Parameter 1 = number of pixels in strip | |
// Parameter 2 = pin number (most are valid) | |
// Parameter 3 = pixel type flags, add together as needed: | |
// NEO_RGB Pixels are wired for RGB bitstream |
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
Tree = function(lbl, lT, rT){ | |
this.label=lbl | |
this.leftTree= lT | |
this.rightTree= rT | |
}; | |
function isAlphaNumeric(char) { | |
var code | |
code = char.charCodeAt(0); | |
if (!(code > 47 && code < 58) && // numeric (0-9) |
OlderNewer