Skip to content

Instantly share code, notes, and snippets.

\begin{align}
F(x)=\int{f(x) dx} \to F(1)=0.5*(F(0)+F(\infty)) \\
\text{ por ejemplo }\\
f(x)={-1 \over (x+1)^2} \\
\end{align}
f(x)=
li(x) - \sum{li(x^p)}
-\log(2)
+\int_{x}^{\infty}
{dt \over {t*(t^2-1)*\log(t)} }
initial=5
depth=15
class Node {
String id
int depth
Boolean isLeft
int value
Node left
Node right
@jagedn
jagedn / CollatzGoogleFormula.js
Last active June 18, 2019 09:42
Open a Google sheet, select tools/script and replace the code with this file. Refresh your sheet and you'll have 2 new formulas
var bigInt=function(undefined){"use strict";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),DEFAULT_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyz";var supportsNativeBigInt=typeof BigInt==="function";function Integer(v,radix,alphabet,caseSensitive){if(typeof v==="undefined")return Integer[0];if(typeof radix!=="undefined")return+radix===10&&!alphabet?parseValue(v):parseBase(v,radix,alphabet,caseSensitive);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function NativeBigInt(value){this.value=value}NativeBigInt.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT<n&&n<MAX_INT}function smallToArray(n){if(n<1e7)return[n];if(n<1e14)return[n%1e7,Math.floor(n/1e7)];return[n%1e7,Math.floor(n/1e7)%1e7,Math.floor(n
@jagedn
jagedn / mathml2png.gs
Last active June 21, 2019 19:40
Mathml2Png en Google Sheet
String.prototype.addQuery = function(obj) {
return this + Object.keys(obj).reduce(function(p, e, i) {
return p + (i == 0 ? "?" : "&") +
(Array.isArray(obj[e]) ? obj[e].reduce(function(str, f, j) {
return str + e + "=" + encodeURIComponent(f) + (j != obj[e].length - 1 ? "&" : "")
},"") : e + "=" + encodeURIComponent(obj[e]));
},"");
}
function mathml2png( math, format, scale, transparent){
@jagedn
jagedn / m30historico.gs
Last active August 7, 2019 14:42
Vuelca a una Hoja Google los datos históricos de la M30 (vehiculos, velocidad, recorrido)
function onOpen(e) {
var ui = SpreadsheetApp.getUi();
var menu = ui.createAddonMenu()
menu.addItem('Historico M30', 'dumpM30');
menu.addItem('Accidentes M30', 'accidentesM30');
menu.addToUi();
}
function populateHeader(sheet){
sheet.appendRow([ "Fecha", "Vehiculos","VelocidadMedia","DistanciaMedia","TiempoMedio" ]);

August 2019

L M X J V S D
@jagedn
jagedn / borneo2019.adoc
Last active July 18, 2019 13:18
borneo 2019
L M X J V S D
@jagedn
jagedn / math.adoc
Last active July 18, 2019 13:24
test gist.asciidoctor.org

La raiz cuadrada de 4 es 2

\$sqrt(4) = 2\$
@jagedn
jagedn / bikeym30.groovy
Last active August 8, 2019 10:48
Groovy Bikey example
@Grab(group='com.jerolba', module='bikey', version='0.9.0')
import com.jerolba.bikey.*
bikey = new TableBikeyMap()
[
'https://datos.madrid.es/egob/catalogo/300201-2-calle30-accidentes-historico.csv', //2016
'https://datos.madrid.es/egob/catalogo/300201-0-calle30-accidentes-historico.csv', //2017
'https://datos.madrid.es/egob/catalogo/300201-4-calle30-accidentes-historico.csv' //2018
].each{ url ->