Skip to content

Instantly share code, notes, and snippets.

View adrientetar's full-sized avatar

Adrien Tétar adrientetar

View GitHub Profile
@adrientetar
adrientetar / Af2010.java
Last active December 15, 2015 16:39
Google Code Jam - Store Credit (Africa 2010)
/**
* Google Code Jam
* Qualification Round Africa 2010
*
* Copyright (C) 2013 Adrien Tétar, All Rights Reserved.
*/
import java.util.Scanner;
class Main {
public static void main(String[] args) {
@adrientetar
adrientetar / logo.diff
Created May 6, 2013 20:27
2.6.32 -> 3.0.8
--- /home/adrien/logo.c
+++ /home/adrien/msm7x30-3.0.x-nAa/drivers/video/msm/logo.c
@@ -46,13 +46,12 @@
}
/* 565RLE image format: [count(2 bytes), rle(2 bytes)] */
-int load_565rle_image(char *filename)
+int load_565rle_image(char *filename, bool bf_supported)
{
struct fb_info *info;
@adrientetar
adrientetar / problem012.py
Created September 17, 2013 15:02
Project Euler #12 in Python.
#!/usr/bin/env python
#
# Copyright (C) 2013, Adrien Tétar. All Rights Reserved.
#
def triangleNumber(rank):
res = 0
for i in range(1, rank+1):
res += i
return res
@adrientetar
adrientetar / oie.py
Last active December 23, 2015 16:09
Le Jeu de l'Oie, en Python.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013, Adrien Tétar. All Rights Reserved.
#
import random
import sys
import os
def errNumber():
@adrientetar
adrientetar / 1.py
Last active December 26, 2015 19:39
TP d'informatique n°3, PCSI 2013-2014 — Lycée Carnot, Paris.
#!/usr/local/bin/python3
#
# PCSI, TP d'informatique n°3. #1
# Copyright (C) 2013, Adrien Tétar. All Rights Reserved.
#
def somme(n):
res = 0
for i in range(1,n+1):
res += i
return res
@adrientetar
adrientetar / 1.py
Last active December 28, 2015 16:29
#!/usr/local/bin/python3
#
# PCSI, TP d'informatique n°4. #1
# Copyright (C) 2013, Adrien Tétar. All Rights Reserved.
#
def euclidienne(n, d):
return (n//d, n%d)
print(euclidienne(int(input("Donner n >= 0:")), int(input("Donner d > 0:"))))
use std::io::buffered::BufferedReader;
use std::io::fs::File;
fn main() {
let pairs = read_int_pairs();
for &(a,b) in pairs.iter() {
println!("{:4.4d}, {:4.4d}", a, b);
}
}
@adrientetar
adrientetar / tut.md
Last active January 2, 2016 18:18
Tutorial fixes to come
@adrientetar
adrientetar / exo.sci
Created January 14, 2014 14:28
TP n°5 d'informatique.
A = [ones(3,4);1,0,ones(1,2);ones(1,4)];
B = [ones(1,5);zeros(3,5)];
C = [ones(3,1)*2,[1;2;3],-ones(3,3)];
D = [diag(1,2,3,4,5)];
function y = factorielle(n)
y = 1;
==6055== Memcheck, a memory error detector
==6055== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==6055== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==6055== Command: fontforge
==6055==
Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
Based on sources from 16:30 CEST 29-May-2014.
Based on source from git with hash:6df29dd747e216bf7878e465fbaa45fbcdc94154