Skip to content

Instantly share code, notes, and snippets.

View pbondoer's full-sized avatar
😎
Back to work

Pierre Bondoerffer pbondoer

😎
Back to work
View GitHub Profile
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: The filesystem on /Volumes/Data/nfs/zfs-student-7/users appears to be case-sensitive.
The default OS X filesystem is case-insensitive. Please report any apparent problems.
Warning: Your Cellar and TEMP directories are on different volumes.
OS X won't move relative symlinks across volumes unless the target file already
exists. Brews known to be affected by this are Git and Narwhal.
"essential
syntax on
set ruler
set number
set mouse=a
set cc=80
set list
set listchars=trail:~,extends:>,tab:▸·,eol:◿
"optional
set nocompatible
@pbondoer
pbondoer / quicksort.py
Created December 15, 2014 22:08
Tri quicksort
# quicksort implementation
# based on:
# http://me.dt.in.th/page/Quicksort/
import random
def quicksort(a, start=0, end=None):
# first pass of the algorithm?
if end is None:
end = len(a) - 1
import time
from math import sqrt
#START
n = int(input("Nombre d'itérations?"))
m = input("Méthode (l/e)?")
start_time = time.time()
if(m.lower() == "l"):
@pbondoer
pbondoer / selection.py
Created November 28, 2014 09:18
Tri par selection
from random import randint
def selection(liste, debut = 0):
minimum = debut
for i in range(debut, len(liste)):
if(liste[i] < liste[minimum]):
minimum = i
if(minimum != debut):
liste[minimum], liste[debut] = liste[debut], liste[minimum]
@pbondoer
pbondoer / DM_ISN.py
Created November 1, 2014 19:55
DM ISN
from random import randint
print("Nous avons pris 100 nombres au hazard.")
#generer une liste de 100 nombres entiers compris entre 0 et 100
n = []
for i in range(0, 100):
n.append(randint(0, 100))
#ordonner la liste de maniere croissante
n = sorted(n)
@pbondoer
pbondoer / SquareRoot.hx
Last active October 5, 2022 09:38
A small square root calculator.
import cpp.Lib;
/**
* A square root approximator.
*
* Adapted from:
* http://en.wikipedia.org/wiki/Newton's_method
* Initial guess calculation adapted from:
* http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Rough_estimation
*