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
@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
*
@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 / 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]
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 / 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
"essential
syntax on
set ruler
set number
set mouse=a
set cc=80
set list
set listchars=trail:~,extends:>,tab:▸·,eol:◿
"optional
set nocompatible
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.
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* black_jack_hand.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pbondoer <pbondoer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/06/10 15:02:42 by pbondoer #+# #+# */
/* Updated: 2016/06/10 15:42:56 by pbondoer ### ########.fr */
/* */

Keybase proof

I hereby claim:

  • I am pbondoer on github.
  • I am pbondoer (https://keybase.io/pbondoer) on keybase.
  • I have a public key ASDdfKwUgtP_gbYZfC34CEuucLFtE9DMe-hV_ZarnZ3FhQo

To claim this, I am signing this object:

test0/000755 032677 010202 00000000000 12723641560 013566 5ustar00pbondoer2015_paris000000 000000 test1000714 032677 010202 00000000010 12723635570 013503 0ustar00pbondoer2015_paris000000 000000