I hereby claim:
- I am benjaminaaron on github.
- I am benjaminaaron (https://keybase.io/benjaminaaron) on keybase.
- I have a public key ASBuRpomqWDBY2eo0WdOjH7P-czBI_U5LACFpehr4tamego
To claim this, I am signing this object:
// To access the list-element within shadowroot I clicked inspect on the list and right-clicked on <div id="tab-item-list"> | |
// --> "Store as global variable", this gives you temp1 that is the basis for this cript | |
// There are probably better ways to access elements in shadowroot, but I didn't want to take the time to learn about it at this point :) | |
items = temp1.getElementsByClassName("item-container") | |
for (i = 0; i < items.length; i++) { | |
item = items[i].firstChild; | |
line = '"' + item.title.replace(/['"]+/g, '') + '","' + item.href + '"'; | |
setTimeout (console.log.bind (console, line)); |
const fs = require('fs'); | |
const parser = require('xml2json'); | |
const format = require('xml-formatter'); | |
// true only for debugging, it messes the labels up because the space after <y:NodeLabel> and before the string gets included | |
const prettyPrint = false; | |
const replaceAll = (str, find, replace) => { | |
return str.replace(new RegExp(find, 'g'), replace); | |
}; |
import numpy as np | |
line = "mandatory1(optional1)mandatory2(optional2)(optional3)" | |
# use regex or a char by char stack approach to extract these? | |
parts = ["mandatory1", "optional1", "mandatory2", "optional2", "optional3"] | |
fixPositions = [0, 2] | |
elements = len(parts) | |
optionalElements = elements - len(fixPositions) | |
n = 2 ** optionalElements |
I hereby claim:
To claim this, I am signing this object:
import java.io.BufferedReader; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.PrintWriter; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public class Main { | |
static List<List<Integer>> partitions = new ArrayList<>(); | |
static void partition(int n, int max, String prefix) { |
import numpy as np | |
import matplotlib.pyplot as plt | |
# | |
# The purpose of this script is to get a feeling what the transformation from spatial to fourier domain does. | |
# | |
# The user can set white or black pixels in the spatial domain and the fourier domain will be updated accordingly. | |
# The left mouse button creates white pixels (value = 1), the right mouse button black pixels (value = 0). | |
# Both one-time clicks work as well as dragging (moving while button is pressed down) the mouse. | |
# The drawing radius can be changed with the + and - keys, also during dragging. |
function saveAsTextFile(element, filename) { // via stackoverflow.com/a/32858416 | |
var textFileAsBlob = new Blob([element.innerHTML], {type:'text/plain'}); | |
var link = document.createElement("a"); | |
link.download = filename; | |
link.href = window.URL.createObjectURL(textFileAsBlob); // works only in Chrome without attaching it to the DOM | |
link.click(); | |
} | |
saveAsTextFile(document.getElementById("content"), "content.xml"); |
import java.awt.event.ActionEvent; | |
import javax.swing.*; | |
public class Main { | |
public static void main(String[] args) { | |
JFrame frame = new JFrame("Simple Swing"); | |
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); | |
JPanel panel = new JPanel(); | |
frame.getContentPane().add(panel); |
grid = 0.01; | |
iter = 50; | |
%% mandelbrot set | |
[Re,Im] = meshgrid(-2:grid:1,-1:grid:1); | |
z0 = Re + Im*1i; % creates a grid of complex numbers from -2 to 1 on the real axis and from -1 to 1 on the imaginary axis | |
values = zeros(size(z0)); | |
z = z0; |