Skip to content

Instantly share code, notes, and snippets.

/*
The following function
public static long rand(int min, int max) {
return (System.nanoTime()%(max-min)) + min;
}
does not generate random numbers with a known distribution;
the properties (randomness) of the output depend on factors that modify it.
/*
PHP <8.1 does not support
https://unicode-org.github.io/icu/userguide/format_parse/datetime/index#datetimepatterngenerator
*/
package com.computermind.sandbox.icu;
import com.ibm.icu.text.DateTimePatternGenerator;
<!DOCTYPE html>
<html>
<style>
div {
display: block;
float: left;
}
</style>
<script>
var N = 12; // nº of divisions
package org.testing;
import java.util.List;
import java.util.stream.IntStream;
import static java.util.stream.Collectors.counting;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.toList;
public class Test {
<!DOCTYPE html><html><head><meta charset="utf-8">
<!-- obtener alguna fuente @font-face ... en este caso "Noto Sans SC" -->
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap" rel="stylesheet">
<style>
/* donde sea usar esta fuente (puede añadirse a la lista de font-families del root) */
.chino {
font-family: "Noto Sans SC";
Info de descarga en:
https://www.boe.es/datosabiertos/
Para bajar todo desde enero de 2009 por ejemplo:
for y in `seq 2009 2020`
do
for m in 01 02 03 04 05 06 07 08 09 10 11 12
do
# Si las relaciones son contínuas (ej. pueden ser expresadas por una función real),
# una ANN puede aproximarla de forma precisa:
#
# https://en.wikipedia.org/wiki/Universal_approximation_theorem
# Install
# $ python --version
# Python 3.8.5
# $ pip --version
# pip 20.1.1 from /usr/lib/python3.8/site-packages/pip (python 3.8)
@josejuan
josejuan / hide.user
Last active September 6, 2020 18:08
// la consola javascript suele abrirse con F12, copiar, pegar, ENTER:
[].slice.call(document.querySelectorAll("li.comment"))
.filter(x => x.querySelector("b.fn").innerText == "David B")
.forEach(x => x.style.display = 'none')
// Antonio (AKA "Un físico")
[].slice.call(document.querySelectorAll("li.comment"))
.filter(x => x.querySelector("b.fn").innerText == 'Antonio (AKA "Un físico")')
.forEach(x => x.style.display = 'none')
class ToFrom f where
to :: List2 a -> f a
from :: f a -> List2 a
instance ToFrom Maybe where
to End = Nothing
to (Elem x _) = Just x
from Nothing = End
from (Just x) = Elem x End
import Test.QuickCheck
import Algorithm.Search
...
-- conversion util
to :: List2 a -> [a]
to End = []
to (Elem x xs) = x: to xs