python | julia | comment | |
---|---|---|---|
print(1, 2) |
🤦♂️ println(1, " ", 2) |
why I need to type ln ? |
|
slicing | 👍 a[::2] |
🤦♂️ a[1:2:end] |
too verbose (start/stop must be given) |
🤦♂️ sin.(a) .- 1 |
silly dot | ||
func def | 👍 f(x) = 2*x |
||
complex numbers | 👍 1j |
1im |
|
👍 2x |
🤦♂️ 0x syntax: invalid numeric constant "0x" |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
The game of life.<br> | |
<a href="https://www.youtube.com/watch?v=ouipbDkwHWA">youtube</a> | |
<br> | |
<input type="button" onclick="timer = false" value="||"/> | |
<input type="button" onclick="timer = false; count(cnt)" value=">"/> | |
<input type="button" onclick="timer = true" value=">>"/> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
#! /usr/bin/env python3 | |
# Javascript only allows to fetch files from the local system by drag&drop. | |
# Here a local server is setup to sent a file from command line to csv_plotter. | |
# Furthermore, we also need to allow CORS... | |
# The server closes finally; thus the browser cannot reload the url/file. | |
# Example | |
# ./csv_sent <filename> |
This file contains hidden or 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
// insert everything in the browser console and a "file" button will appear in the submenu | |
function addfilebutton() { | |
if (document.querySelector("#file2xy") || // exists already | |
!document.querySelector(".dcg-action-newimage")) // unclick case | |
return | |
pic = document.querySelector(".dcg-action-newimage").parentNode | |
var div = document.createElement('div'); | |
div.innerHTML = '<style>.dcg-calculator-api-container .dcg-icon-new-file::before { content: "\\e205";}</style><div class="dcg-new-item dcg-action-newfile" onclick="file2tab.click()"><i class="dcg-icon-new-file dcg-expression-icon" aria-hidden="true"></i>Datei2tab</div><input id="file2tab" type="file" style="display: none" onchange="tabFromFile()"></div>' | |
pic.after(div) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Convert RGBA to RGB</title> | |
<style> | |
#divrgba, #divresult { | |
width: 120%; | |
padding: 8px; | |
} |
This file contains hidden or 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
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> | |
<body> | |
<div id="myDiv" oncontextmenu="return false"></div> | |
<script> | |
var d3 = Plotly.d3, | |
N = 1000, | |
y = d3.range(N).map(d3.random.normal()), | |
data = [{y: y}] |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<style> | |
span {color: gold} | |
span[contenteditable=false] {color: red} | |
</style> | |
<body> | |
Try to delete the "!": | |
<div contenteditable> | |
Here is a <span contenteditable=false>contentEditable False</span>! Ok. |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<style> | |
#cursor { | |
display: inline; | |
} | |
#cursor.collapsed { |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<style> | |
div {background-color: #dfd} | |
span {background-color: #fbb} | |
</style> | |
<body> | |
The checking the caret behaviour in <code>contenteditable</code>. The caret is placed with an offset of 1 and then moved backwards. It is checked whether the caret is still in the current sibling (return value 0) or has entered the previous sibling (return value 5). |
NewerOlder