Skip to content

Instantly share code, notes, and snippets.

View volgar1x's full-sized avatar

Antoine Chauvin volgar1x

View GitHub Profile
#!/usr/bin/env python
import re
import wget
from itertools import groupby
from KickassAPI import Search
NORMALIZE_NAME = re.compile("\[.+\] (.+) - (\d+).*")
def normalize_name(name):
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int* head;
int len;
} int_array;
void arr_alloc(int_array* arr) {
arr->head = (int*) malloc(sizeof(int) * arr->len);
~/Workspace/montecarlo-pi on ⭠ master ⌚ 19:31:18
$ rvm use rbx && time ruby ruby/montecarlo_pi.rb
Using /home/antoine/.rvm/gems/rbx-2.5.2
3.14156328
ruby ruby/montecarlo_pi.rb 104.46s user 0.61s system 332% cpu 31.633 total
~/Workspace/montecarlo-pi on ⭠ master ⌚ 19:32:17
$ rvm use jruby && time ruby ruby/montecarlo_pi.rb
Using /home/antoine/.rvm/gems/jruby-1.7.19
3.14179444
import java.util.stream.IntStream;
import java.util.Random;
public class MontecarloPI {
static IntStream repeat(int value, int times) {
int[] tab = new int[times];
for (int i = 0; i < times; i++) {
tab[i] = value;
}
return IntStream.of(tab);
/**
* Par Antoine CHAUVIN INFOB1
*/
object App {
import scala.util.Random
/**
* Vec represente un vecteur (x, y)
*/
case class Vec(x: Int, y: Int)
(defun rac (arbre)
(car arbre))
(defun sag (arbre)
(car (cdr arbre)))
(defun sad (arbre)
(car (cdr (cdr arbre))))
(defun plus-grand (a b)
defmodule Conn do
defstruct halted: false
end
def send(conn, _) when conn.halted do # does not compile
conn
end
def send(conn, _) when conn[:halted] do # does compile
conn
(defun add (elem arbre)
(cond
((null arbre)
(list elem nil nil))
((plus-grand elem (rac arbre))
(list (rac arbre)
(sag arbre)
(add elem (sad arbre))))
((plus-petit elem (rac arbre))
package shitty.iut;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static List<String> getWords(String line) {
List<String> result = new ArrayList<String>();
@Singleton
public class MyService extends FsmService {
@RequiredArgsConstructor
static class Started {
final Map<Class<?>, Map<Integer, Object>> objects;
}
@RequiredArgsConstructor
static class Find {