Skip to content

Instantly share code, notes, and snippets.

View JC-LL's full-sized avatar

Jean-Christophe Le Lann JC-LL

View GitHub Profile
@JC-LL
JC-LL / gist:dadf7006edc2eba75d95e0a0f057a9d6
Created October 19, 2025 09:30
solving issues on Xilinx Vivado in LMDE 7 Gigi base: Debian 13.0 trixie
# solving issues on Xilinx Vivado in LMDE 7 Gigi base: Debian 13.0 trixie
echo "deb http://deb.debian.org/debian bookworm main" | sudo tee /etc/apt/sources.list.d/bookworm-temp.list
sudo apt update
sudo apt install libtinfo5
# now vivado works like a charm.
@JC-LL
JC-LL / gist:99443acda6385502815cc857c8c23edd
Created December 23, 2021 00:25
AoC Day 18. What 's wrong with the reduction process ??
[[[0,[4,5]],[0,0]],[[[4,5],[2,6]],[9,5]]]
+
[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]
-------------------
after addition : [[[[0,[4,5]],[0,0]],[[[4,5],[2,6]],[9,5]]],[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]]
reduction
after explosion : [[[[4,0],[5,0]],[[[4,5],[2,6]],[9,5]]],[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]]
after explosion : [[[[4,0],[5,4]],[[0,[7,6]],[9,5]]],[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]]
after explosion : [[[[4,0],[5,4]],[[7,0],[15,5]]],[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]]
after explosion : [[[[4,0],[5,4]],[[7,0],[15,5]]],[10,[[0,[11,3]],[[6,3],[8,8]]]]]
@JC-LL
JC-LL / gist:b4e655d6ab93b71865eafe82d3da7b04
Created December 22, 2021 23:12
advent of code day 18 : reduction issue
[[[0,[4,5]],[0,0]],[[[4,5],[2,6]],[9,5]]]
+
[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]
-------------------
after addition : [[[[0,[4,5]],[0,0]],[[[4,5],[2,6]],[9,5]]],[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]]
reduction
after explosion : [[[[4,0],[5,0]],[[[4,5],[2,6]],[9,5]]],[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]]
after explosion : [[[[4,0],[5,4]],[[0,[7,6]],[9,5]]],[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]]
after explosion : [[[[4,0],[5,4]],[[7,0],[15,5]]],[7,[[[3,7],[4,3]],[[6,3],[8,8]]]]]
after explosion : [[[[4,0],[5,4]],[[7,0],[15,5]]],[10,[[0,[11,3]],[[6,3],[8,8]]]]]
@JC-LL
JC-LL / load_mem.cpp
Created February 11, 2019 14:24
loading a memory in c++, from ASCII-based addr/data file
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
class ProgramLoader {
public:
int mem[1024];
require 'gtk3'
require 'pp'
DELTA_X=20
DELTA_Y=20
RED = [0.7,0.0,0.1]
GREEN= [0.1,0.9,0.1]
BLUE = [0.1,0.0,0.7]
BLACK= [0.0,0.0,0.0]
@JC-LL
JC-LL / h_partition_equivalence_tester
Created May 14, 2014 19:52
Small test showing the non-equivalence of two methods supposed to return the same results (ordering problem)
Foo=Struct.new(:t1)
Bar=Struct.new(:t2)
def generate_random n
h={}
kFoo="f0"
kBar="b0"
for i in 0..n-1
t=rand(2)
if t==0