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 <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
ifstream lettura ("input.txt"); | |
ofstream scrittura ("output.txt"); | |
vector<int> stati; |
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 <iostream> | |
#include <string> | |
#include <algorithm> | |
#include <limits> | |
using namespace std; | |
// The height of the tree (ok, the name is counter-intuitive...) | |
#define DEPTH 20 | |
// The 'undefined' value for the 'set' field |
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 python3 | |
# Copyright 2013 Luca Wehrstedt | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of source code must retain the above copyright notice, this | |
# list of conditions and the following disclaimer. | |
# |
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 python3 | |
import sys | |
import time | |
import urllib.request | |
import hashlib | |
import subprocess | |
url = sys.argv[1] |
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 python3 | |
import argparse | |
import random | |
def genera_codice(): | |
result = "" | |
c1 = random.randint(1, 3); | |
for i in range(c1): |
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
import re | |
def camelcase_to_underscore(name): | |
return "_".join(w.lower() for w in re.findall("(?:[A-Z][a-z]+|[A-Z]+(?:$|(?=[A-Z][a-z])))", name)) |
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
import sys | |
import random | |
import pygame | |
pygame.init() | |
grid = (39, 29) | |
cell = (20, 20) | |
width = grid[0] * cell[0] | |
height = grid[1] * cell[1] |
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 type S = sig | |
type 'a process | |
type 'a in_port | |
type 'a out_port | |
val new_channel: unit -> 'a in_port * 'a out_port | |
val put: 'a -> 'a out_port -> unit process | |
val get: 'a in_port -> 'a process | |
val doco: unit process list -> unit process | |
val return: 'a -> 'a process |
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
./scripts/cmsDropDB -y > /dev/null; | |
./scripts/cmsInitDB > /dev/null; | |
./cmscontrib/AddAdmin.py admin -p admin > /dev/null | |
# -w is the number of workers (there need to be enough already listed in cms.conf). | |
# -s is the number of submissions, each of 50 (?) testcases. | |
# also, in Worker.__init__ set fake_time to 0.1. | |
python cmstestsuite/RunTimeTest.py -w 16 -s 10 |
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
import math | |
fixed = 0.552284749831 / math.sqrt(2) | |
fixed = 0.3915 | |
print(fixed) | |
def get_point_along_bezier(p1, p2, r, out_d, in_d, rel, out_l, in_l, t): | |
dx = p2[0] - p1[0] | |
dy = p2[1] - p1[1] |
OlderNewer