This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <math.h> | |
#include <random> | |
#include <chrono> | |
using namespace std; | |
//Find the best quiniela bet | |
//Compile with g++ -O3 quiniela.cpp -o quiniela | |
//On my machine with g++ version 9.4.0 the code find the best bet in 155 s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
//quick prototype inspired by the haskell version (not battle tested) | |
//https://byorgey.github.io/blog/posts/2024/11/27/stacks-queues.html | |
//compile with g++ -std=c++17 slidingmonoid.cpp -o slidingmonoid | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add this to the browser console of https://www.funnyhowtheknightmoves.com/ | |
/** | |
* Creates line element on given position, with given length and angle. | |
*/ | |
function createLineElement(x, y, length, angle) { | |
var line = document.createElement("div"); | |
var styles = 'border: 1px solid black; ' | |
+ 'width: ' + length + 'px; ' | |
+ 'height: 0px; ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tried to make a payment on aliexpress this weekend. | |
Turns out the payment processor (wlp-acs.com), after a first valid SMS code check, is requesting my bank secret password. | |
Didn't give it, no way I'm giving it so the payment was rejected. | |
For information the identifier for accounts on this bank is written on every cheque you make. | |
See screenshot below : | |
I called the bank this morning, and they assured me this is normal that it is "required by law", they call it "second factor". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Compilation with : | |
//g++ -std=c++17 -O3 wordle.cpp -o wordle | |
/* | |
This is a single threaded, zero memory allocation, recursive exhaustive search of the wordle search space | |
Just to see how far a brute-force approach would go | |
Every guess split the list of remaining possible words into one of (3^5=243) buckets | |
At the next tree level the list inside each bucket is examined recursively, until there are 2 candidates left. | |
No specialized solver to finish the small lists have been used. | |
License MIT | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import onnx | |
from onnx_tf.backend import prepare | |
import tensorflow as tf | |
import onnxruntime | |
from PIL import Image | |
import numpy as np | |
import sys | |
#You need to have model.onnx and neuralhash_128x96_seed1.dat in your working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf #We need tensorflow 2.x | |
import numpy as np | |
#The hashlength in bits | |
hashLength = 256 | |
def buildModel(): | |
#we can set the seed to simulate the fact that this network is known and doesn't change between runs | |
#tf.random.set_seed(42) | |
model = tf.keras.Sequential() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def cosd( ang ): | |
return np.cos(2*np.pi*ang/360.0) | |
def sind( ang): | |
return np.sin(2*np.pi*ang/360.0) | |
def measure3( alpha, phi, r1,r2): | |
d = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#LICENSE MIT# | |
from keras.models import Model | |
from keras.layers import Input, Dense, Merge, Recurrent | |
from keras.layers.recurrent import SimpleRNN, GRU,LSTM | |
from keras.layers.embeddings import Embedding | |
from keras.layers.wrappers import TimeDistributed | |
import random |