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
#!/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): |
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
#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); |
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
~/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 |
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 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); |
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
/** | |
* Par Antoine CHAUVIN INFOB1 | |
*/ | |
object App { | |
import scala.util.Random | |
/** | |
* Vec represente un vecteur (x, y) | |
*/ | |
case class Vec(x: Int, y: Int) |
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
(defun rac (arbre) | |
(car arbre)) | |
(defun sag (arbre) | |
(car (cdr arbre))) | |
(defun sad (arbre) | |
(car (cdr (cdr arbre)))) | |
(defun plus-grand (a b) |
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
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 |
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
(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)) |
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
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>(); |
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
@Singleton | |
public class MyService extends FsmService { | |
@RequiredArgsConstructor | |
static class Started { | |
final Map<Class<?>, Map<Integer, Object>> objects; | |
} | |
@RequiredArgsConstructor | |
static class Find { |