Skip to content

Instantly share code, notes, and snippets.

View SilvaEmerson's full-sized avatar
🏠
Working from home

Émerson Silva SilvaEmerson

🏠
Working from home
View GitHub Profile
defmodule LevelOrderTraversal do
# Nós da árvore representados como {valor, {filho_direita, filho_esquerda}}
@type tree :: {term, {tree | nil, tree | nil}}
# Função que converte a árvore em seus níveis
@spec traverse(tree) :: [[term]]
def traverse(nil), do: [[]]
def traverse({x, {l, r}}) do
[[x] | Enum.zip_with(traverse(l), traverse(r), &Enum.concat/2)]
@VictorTaelin
VictorTaelin / materials.md
Last active February 15, 2025 18:15
materials

Company:

Theory:

Bend vs Reality

TLDR: I understand the proposal of Bend, but when the efficiency reduction is so big that a RTX 4090 is only 7x faster on a near-optimal scenario than 2 cores of a M3 Max in a language like JavaScript, you should probably not take it.

On the otherhand, easy to use, but opt-in, parallel languages such as OCaml exists and they can compete, so you should likely take those. If you need even more performance, Rust could likely beat the RTX 4090 results on a mobile CPU.

Of course future optimizations should improve Bend results, but my goal here is to show that the current results are not as impressive as they may look, likely a JIT would make the RTX 4090 results 10x faster, but an RTX 4090 still uses at least 100 times more power than a single M3 core at any instant, additionally in principle GPUs are better for purely parallel tasks.

Also this example is a very parallelism friendly, this is both against Bend and in favour of it, most real code is not pure and not a purely binary alg

Como Pensar

Ler e entender um pouco desse artigo. https://wiki.c2.com/?FeynmanAlgorithm

  • Reconhecer como você pensa
  • Descrever métodos que você usa para pensar
  • Entender métodos diferentes de pensar
  • Fazer perguntas sobre tudo(incluindo sobre perguntas)

Perguntas

@katef
katef / plot.awk
Last active November 20, 2024 23:27
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@pinealan
pinealan / nix-env-diff.bash
Last active September 12, 2023 12:04
Diff installed packages between nix generations
#!/usr/bin/env bash
# From https://github.com/pinealan/dotfiles
nix-list() {
nix-env --list-generations
}
get_current_gen() {
if [ -z $1 ] ; then
# default to current generation of nix-env
@akitaonrails
akitaonrails / links.md
Created November 6, 2019 01:28
Links de referência pro Episódio 66 do Canal Akitando
@VojtaSim
VojtaSim / cursorPagination.ts
Last active December 21, 2022 17:19
TypeORM + TypeGraphQL cursor pagination
import { ObjectType, Field, ClassType, Int, ArgsType } from 'type-graphql';
import { SelectQueryBuilder } from 'typeorm';
import Cursor, { TCursor } from 'scalar/cursor';
@ArgsType()
export class CursorPaginationArgs {
@Field({ nullable: true })
after?: TCursor;
@onlurking
onlurking / Ruby and Rails Study Roadmap.md
Created February 25, 2019 23:58
Ruby and Rails Study Roadmap
@allenyllee
allenyllee / install_tools.sh
Last active April 3, 2025 12:17
mount vhdx in linux
#!/bin/bash
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client