Skip to content

Instantly share code, notes, and snippets.

View Xophe92's full-sized avatar

Christophe Bonnefoy Xophe92

View GitHub Profile
//run me at https://ethereum.github.io/browser-solidity/#GIST_ID=abb4967f9a5fa3229b5bb2b65fa24562
contract signatureManagement {
address[] signatureAllocatorPartner;
mapping (address => uint) signatureAllocatorPartnerId;
Mandate[] mandates;
authorizedSigningPartnerForMandate[] authorisationsGranted;
#!/usr/bin/env python2
import json
import random
import copy
import googlemaps
import math
import os.path
import datetime
def distanceFromLarAndLon(lon1, lat1, lon2, lat2):
<!DOCTYPE html>
<html>
<head>
<style>
#map {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
position: absolute;
@Xophe92
Xophe92 / applyHelperFunctionForDask.py
Created February 10, 2018 00:52
Expérimentation avec Dask
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 10 22:10:31 2018
@author: Xophe92
Découverte de DASK/DataFrames (pandas en multicoeur ou en clusters...)
Préféré à PySpark car
* code natif python (pandas et numpy sous le manteau)
G28 ;Home
M92 X79.6 Y79 Z401 ;calibration lors de lachat
;2do calibration M92 E[93]
M117 Cleaning ; Indicate nozzle clean in progress on LCD
M109 S210 ; Temperature 210C
M107 ; Turn layer fan off
G21 ; Set to metric
@Xophe92
Xophe92 / main.py
Created August 31, 2019 23:23
playing with encodings
# coding: utf8
a = "Père Noël"
print(f"a = \"{a}\"")
print(f"type(a) => {type(a)} \n")
b = a.encode('utf-8')
print(f"b = {b}")
print(f"type(b) => {type(b)} \n")
print("{encoding} \t {b.decode(encoding)}")
@Xophe92
Xophe92 / rsa.py
Last active October 8, 2019 19:29
b00tl3gRSA2 - Points: 400 - (Solves: 1076)
import binascii
n = 62452183886922897079565462589532968595884552052214229613445442774743423725102737845742975666636854617775795947653844346559950723662263034642750426162273832839101527738528294467648817519626232830075222929548053450371355548382455233416933866954353433351778542716327032301670100608617444861845487978703599835379
c = 56347572031538334377661578217905779910490772992642826875089038058436862705266996954941611050094273478907514997960956816289297147965363014381184730266460034420695156137130424878759263215224108315562552968913202468760795267651517029708252934757877155640216359411075081754078898540094203891997354635495949480953
e = 61897578533882795669670180546914170241934801387789726178209999472564491631659190026553473372696292044152567645449981835158789679959142094011319619930275962936609685337352059111535711982420122060517738442734450137974442442074077044188542576386785694404751980458638816026283776944151705012059689090902604045873
for d in range(65537,65537): # 0, 100000000
if pow(pow(c, d, n)
Star reduction in Siril with pixelmath
Forumula given by https://www.youtube.com/watch?v=rM3-yAcAbZc
In Siril Pixelmath
S is the image with stars, SL is the starless
K is a parameter between 0 and 1
formula "transfert approach": max(SL, ~(~((K-1)*S/((2*K-1)*S-K)) / ~((K-1)*SL/((2*K-1)*SL-K)) * ~SL))
formula "Halo-1" max(SL, S-max(0,((S-(K-1)*S/((2*K-1)*S-K))*~(SL/S))*~SL))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.