Skip to content

Instantly share code, notes, and snippets.

View jeovazero's full-sized avatar
:octocat:
lamentavel

jeovazero

:octocat:
lamentavel
  • JOI/SC
View GitHub Profile
// jeotario's academy
void exceptional() {
throw Exception('hi');
}
void hello() {
throw 'Hello Friend';
}
// jeotario's academy
Future foo() {
print('start');
return Future.delayed(Duration(seconds: 2), () async {
print('end');
});
}
Future<String> fallen() {
bool isEven(int num) {
return num % 2 == 0;
}
bool isEven(int num) => num % 2 == 0;
/// replicateText(text: 'go', times: 2) == 'gogo'
/// replicateText(times: 0, text: 'go') == ''
String replicateText({ String text, int times }) {
var result = '';
# linear_regression
# 2021-06-06
# author: jeovazero
Σ = sum
h(t, x) = Σ(t .* x)
j(θ, x, y) = 1 / 2 * Σ([(h(θ, x[i]) - y[i])^2 for i in 1:length(y)])

Install

$ nix-env -f '<nixpkgs>' -iA nix-direnv direnv

Configure

Add to $HOME/.direnvrc:

source $HOME/.nix-profile/share/nix-direnv/direnvrc
/* author: jeovazero */
/**
* Linking by size + Path halving
*/
class UnionFind(size: Int) {
val roots = IntArray(size)
val sizes = IntArray(size)
var rootsSize = size - 1
init {
for(i in 0..(size - 1)) {
// https://www.inf.ufpr.br/nicolui/grad/Programas/Curiosidades/Gerador-CPF/Algoritmo-CNPJ.txt
function validateDigit(cnpjValues: number[], extraDigit?: number) {
const values = extraDigit != null ? [...cnpjValues, extraDigit] : cnpjValues
let size = values.length
let position = size - 7
let sum = 0
for (let i = 0; i < size; i++) {
sum += values[i] * position--
let
config = {
packageOverrides = p: {
sbt = p.sbt.override {
jre = p.jdk11;
};
scala = p.scala.override {
jre = p.jdk11;
};
};
{-# LANGUAGE Rank2Types #-}
mapPair :: (forall x. x -> x) -> (a,b) -> (a,b)
mapPair f (a, b) = (f a, f b)
id' :: forall x. x -> x
id' x = x
main = print $ mapPair id' (1, 'a')
version: '3'
services:
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka:2.13-2.8.1