View uptime.erl
This file contains 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
-export([uptime/0, uptime/1, uptime_string/0]). | |
%% @doc uptime in native time units | |
uptime() -> | |
erlang:monotonic_time() - erlang:system_info(start_time). | |
%% @doc uptime in specified time units | |
uptime(Unit) -> | |
erlang:convert_time_unit(uptime(), native, Unit). |
View round.decimal.js
This file contains 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
// Closure | |
(function() { | |
/** | |
* Decimal adjustment of a number. | |
* | |
* @param {String} type The type of adjustment. | |
* @param {Number} value The number. | |
* @param {Integer} exp The exponent (the 10 logarithm of the adjustment base). | |
* @returns {Number} The adjusted value. | |
*/ |
View Combinatoria-suissa-factorial.js
This file contains 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
function trampoline(f) { | |
return function trampolined(...args) { | |
let result = f.bind(null, ...args); | |
while (typeof result === 'function') result = result(); | |
return result; | |
}; | |
} |
View trampoline.js
This file contains 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
function trampoline(f) { | |
return function trampolined(...args) { | |
let result = f.bind(null, ...args); | |
while (typeof result === 'function') result = result(); | |
return result; | |
}; | |
} |
View discordjs-cheatsheet.js
This file contains 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
// Discord all events! | |
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!) | |
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client | |
// Learn from this, do not just copy it mofo! | |
// | |
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584 | |
/* | |
koad-was-here |
View brainly.logica.booleana
This file contains 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
3) Determinar o valor lógico, quando possível, de cada uma das proposições a seguir, mostre o desenvolvimento completo para encontrar a resposta: | |
a) (r ^ (~q > p)) ^ ~((p <> ~q) > r v ~p) | |
sabendo que V(p) = F e V(r) = V | |
(v ^ (~q > F)) ^ ~((F <> ~q) > v v ~F) | |
(v ^ (~q > F)) ^ ~((F <> ~q) > v v ~F) | |
q = V | |
(v ^ (~V > F)) ^ ~((F <> ~V) > v v ~F) |
View Divisao.crieUmaListaDeTamanho.6.js
This file contains 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
const tamanhoDa = (lista) => lista.length | |
const atéEncontrarOTotal = (total, x ) => n => (total += n) <= x | |
const dividir = (x, y, total = 0) => | |
tamanhoDa( | |
crieUmaListaDeTamanho(x) | |
.ePreenchaCom(y) | |
.filter( atéEncontrarOTotal(total, x) ) | |
) |
View Divisao.crieUmaListaDeTamanho.5.js
This file contains 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
const tamanhoDa = (lista) => lista.length | |
const dividir = (x, y, total = 0) => | |
tamanhoDa( | |
crieUmaListaDeTamanho(x) | |
.ePreenchaCom(y) | |
.filter( n => (total += n) <= x ) | |
) |
View Divisao.crieUmaListaDeTamanho.4.js
This file contains 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
const tamanhoDa = (lista) => lista.length | |
const dividir = (x, y, total = 0) => | |
tamanhoDa( | |
crieUmaListaDeTamanho(x).ePreenchaCom(y) | |
.filter(n => { | |
total = total + n | |
return total <= x | |
}) | |
) |
View Divisao.crieUmaListaDeTamanho.3.js
This file contains 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
const tamanhoDa = (lista) => lista.length | |
const dividir = (x, y, passos = 0, total = 0) => { | |
const lista = crieUmaListaDeTamanho(x).ePreenchaCom(y) | |
return tamanhoDa(lista.filter(n => { | |
total = total + n | |
return total <= x | |
})) |
NewerOlder