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). |
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. | |
*/ |
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; | |
}; | |
} |
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; | |
}; | |
} |
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 |
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) |
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) ) | |
) |
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 ) | |
) |
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 | |
}) | |
) |
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