Skip to content

Instantly share code, notes, and snippets.

@ninux
ninux / fdtd_gui.py
Created November 29, 2023 21:00
frist rudimentary FDTD GUI
import threading
import time
import tkinter as tk
from tkinter import messagebox
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.figure import Figure
@ninux
ninux / sine_plotter.py
Last active November 25, 2023 22:28
python tkinter sine plotter GUI
import threading
import time
import tkinter as tk
from tkinter import messagebox
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.figure import Figure
@ninux
ninux / gist:75737af00635d9512164
Last active August 29, 2015 14:08
debug messages in c
#ifdef DEBUG
#define _dbgmsg(MESSAGE, ...) printf("DEBUG: " #MESSAGE "\n", \
##__VA_ARGS__)
#else
#define _dbgmsg(MESSAGE) {}
#endif
main:
LDA #$07 ; load byte mask for joystick input
ORA $1858 ; map mask
STA $1858 ; write byte
loop: LDA #$07 ; load byte mask for LED output
ORA $000b ; map mask
STA $000b ; write byte
LDA $000c ; load port G
@ninux
ninux / gist:bffcfb366b668e4dd41f
Created June 16, 2014 08:50
some fun with gnu octaves' control package
# Octave 3.8.1, Mon Jun 16 09:08:01 2014 CEST <ninux@x200>
pkg load control signal
G = zpk([];[-1,-1; -1,1],1);
G = zpk([],[-1,-1; -1,1],1);
H = zpk([],[-2,-1; -2,1],1);
zplane(G,H)
graphics_toolkit("gnuplot")
zplane(G)
s = tf('s')
G = zpk([],[-1,-1; -1,1],1);
git archive HEAD --format=zip > archive.zip
@ninux
ninux / gist:10648411
Last active August 29, 2015 13:59
using regex in java
private boolean containsNumbers(String s) {
Pattern p = Pattern.compile(".*\\d.*");
return p.matcher(s).find();
}
private boolean containsCharacters(String s){
Pattern p = Pattern.compile("[a-zA-Z]");
return p.matcher(s).find();
}
@ninux
ninux / bugreport.tex
Created April 13, 2014 19:50
minimal example for "venndiagram" bugreport
\documentclass[a4paper, 10pt, fleqn]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{venndiagram}
\begin{document}
\begin{figure}[h!]
\centering
@ninux
ninux / gist:67abc556eba11af98e54
Created February 25, 2014 13:39
cleanup repo with new .gitignore
# http://stackoverflow.com/questions/7075923/resync-git-repo-with-new-gitignore-file
git rm -r --cached .
git add .
git commit -m "cleaned up repo with new gitignore"
@ninux
ninux / gist:5713741
Created June 5, 2013 13:12
Merge PDFs with Ghostscript
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf
found at https://bbs.archlinux.org/viewtopic.php?id=65036