Skip to content

Instantly share code, notes, and snippets.

View vincent-hugot's full-sized avatar

Vincent Hugot vincent-hugot

View GitHub Profile
@vincent-hugot
vincent-hugot / extract_interns.py
Last active June 16, 2024 16:18
extract internship data from arexis
# [email protected]
mylogin, mypwd = "XXX", "XXXpassXXX" # Your AREXIS login
force_reload = 0 # 0/1: reload all pages, whether they have been cached or not
########################################################################
from time import sleep
from bs4 import BeautifulSoup
import subprocess as sp
@vincent-hugot
vincent-hugot / peterson_multi.tla
Created May 22, 2024 16:58 — forked from etscrivner/peterson_multi.tla
TLA+ implementation of Peterson's mutual exclusion algorithm. Demonstrates absence of deadlock and liveness given fair processes.
--------------------------- MODULE peterson_multi ---------------------------
EXTENDS TLC, Integers, Sequences
CONSTANT ThreadCount
Threads == 1..ThreadCount
AllOtherFlagsLessThan(item, flags) ==
\A q \in Threads \ {item}: flags[q] < item
(*--algorithm peterson_multi
variables
@vincent-hugot
vincent-hugot / lc-practice.py
Created September 15, 2019 01:04 — forked from doughsay/lc-practice.py
Python List Comprehension Practice Problems
def identity(nums):
"""Identity:
Given a list of numbers, write a list comprehension that produces a copy of the list.
>>> identity([1, 2, 3, 4, 5])
[1, 2, 3, 4, 5]
>>> identity([])
[]
from /u/cscanlin
#Find all of the numbers from 1-1000 that are divisible by 7
results = [num for num in range(1000) if num % 7 == 0]
#print(results)
#Find all of the numbers from 1-1000 that have a 3 in them
results = [num for num in range(1000) if '3' in list(str(num))]
#print(results)
@vincent-hugot
vincent-hugot / tree.md
Created September 15, 2019 00:01 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@vincent-hugot
vincent-hugot / formula.py
Created March 26, 2019 19:25 — forked from gvx/formula.py
Propositional logic library for Python 3, that can valuate an expression and check whether it is a tautology
"""
formula.py - propositional formulas for Python
by Robin Wellner
Hereby, I waive all rights to this library, as described at <http://creativecommons.org/publicdomain/zero/1.0/>
Examples:
foo = Atom('foo')
bar = Atom('bar')
@vincent-hugot
vincent-hugot / ExportChromePasswords.js
Created October 23, 2016 12:53 — forked from Marqin/ExportChromePasswords.js
ExportChromePasswords.js
var decryptedRow="";
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
var pl = pm.savedPasswordsList_;
for(i=0;i<model.length;i++){
PasswordManager.requestShowPassword(i);
};
setTimeout(function(){
decryptedRow += '"hostname","username","password","formSubmitURL","httpRealm","usernameField","passwordField"';
for(i=0; i<model.length; i++){
for f in *.shn; do ffmpeg -i "$f" "${f/%.shn/.flac}"; done
$ sudo apt-get install cuetools shntool flac
$ cuebreakpoints file.cue | shnsplit -o flac file.flac