+------------------------------------------------------------+
| Process |
| +--------------------------------------------------------+
| | Threads (OS/User) |
| | +----------------------------------------------------+
| | | Coroutines |
| | | + - - - - - - - - - - - - - - - - +
| | | | ┌ Fiber (with stack, yield anywhere) |
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
#include <genesis.h> | |
// Função genérica para desenhar uma linha entre dois pontos | |
void drawLine(u16 x0, u16 y0, u16 x1, u16 y1, u16 paletteIndex, u16 color, u8 tileSize) | |
{ | |
// Cria dinamicamente um tile com base no tamanho configurável | |
u32 lineTile[64]; // Máximo de 64 linhas (8x8 pixels no máximo) | |
for (int i = 0; i < tileSize; i++) | |
{ | |
// Cada linha do tile terá todos os bits preenchidos com '1' (para linhas sólidas) |
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
# First, in your terminal. | |
# | |
# $ python3 -m virtualenv env | |
# $ source env/bin/activate | |
# $ pip install torch torchvision transformers sentencepiece protobuf accelerate | |
# $ pip install git+https://github.com/huggingface/diffusers.git | |
# $ pip install optimum-quanto | |
# $ pip install gradio | |
import torch |
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
<?php | |
declare(strict_types=1); | |
class Loop | |
{ | |
private static ?Loop $loop = null; | |
private array $queue = []; |
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
<?php | |
$key = random_bytes(SODIUM_CRYPTO_SECRETBOX_KEYBYTES); | |
$nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); | |
$ciphertext = sodium_crypto_secretbox("Hi Roy", $nonce, $key); | |
$plaintext = sodium_crypto_secretbox_open($ciphertext, $nonce, $key); | |
if ($plaintext === false) { | |
throw new Exception("Bad ciphertext"); |
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
<?php | |
$view = new View($this, false); | |
$view->set(compact('some', 'vars')); | |
$html = $view->render('view_name'); |