Skip to content

Instantly share code, notes, and snippets.

View DarioSucic's full-sized avatar
💤

Dario Sučić DarioSucic

💤
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Node:
def __init__(self, key, data):
self.prev = None
self.next = None
self.key = key
self.data = data
class LinkedList:
@DarioSucic
DarioSucic / Hash table attack.ipynb
Created July 18, 2022 22:33
Python hash table attack
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#![feature(slice_as_chunks)]
use std::{
convert::AsRef,
ops::{
Bound::{Excluded, Included, Unbounded},
RangeBounds,
},
str::from_utf8_unchecked,
};
@DarioSucic
DarioSucic / billiard.jl
Created January 5, 2022 21:33
Example of machine learning and differentiable programming with Flux + Zygote
using Flux
using Flux.Losses
using Flux.Data: DataLoader
using Zygote
using Zygote: Buffer, @ignore
using LinearAlgebra
using StaticArrays
using Base.Threads: @spawn
using TensorCast
@DarioSucic
DarioSucic / 🍯.py
Created May 14, 2021 23:13
Signed Angle Delta Visualization
from math import *
import pyglet as pgl
w, h = 540, 540
cx, cy = w//2, h//2
radius = 3*cx // 5
φ = pi / 4
config = pgl.gl.Config(sample_buffers=1, samples=16)
window = pgl.window.Window(w, h, config=config)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from scipy.optimize import curve_fit
x, y = np.loadtxt("2a.txt", delimiter=";").T
def test_func(x, n):
alpha = (2 * np.pi / 360) * x
n_sq = n ** 2
cosine = np.cos(alpha)
@DarioSucic
DarioSucic / PandasToNetworkx.ipynb
Created August 5, 2020 14:11
Networkx graph from pandas dataframe
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.