This file contains hidden or 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
import copy | |
import json | |
def flat_json(data, last_name = "", rows = [{}], keys = []): | |
last_row = rows[len(rows)-1] | |
if type(data) is dict: | |
lists = {} | |
for key in data: | |
name = last_name + ("__" if last_name else "") + key | |
if type(data[key]) is list: |
This file contains hidden or 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
section .data | |
struc sockaddr_in | |
.sin_family: resw 1 ; 2 bytes word pra family | |
.sin_port: resw 1 ; 2 bytes 1 word pra porta | |
.sin_addr: resd 1 ; 4 bytes double word pra endereço | |
.sin_zero: resb 8 ; 8 bytes em 0 | |
endstruc | |
socket_err_msg db "Deu erro no socket bobao", 10 | |
socket_err_len equ $-socket_err_msg ; Tamanho da mensagem |
This file contains hidden or 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
module LexerTest | |
import Text.Lexer | |
import Data.List | |
data TokenKind =Sharp | |
Show TokenKind where | |
show Sharp = "#" |
This file contains hidden or 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
// Nosomy's SEQQBE Algorithm implemented in rust by Chiyoku | |
use std::env; | |
use std::io::{self, Write}; | |
use std::io::BufWriter; | |
fn out_vector(vector: &mut Vec<u8>,size: usize,stream: &mut std::io::BufWriter<std::io::StdoutLock>) -> u8{ | |
let mut counter: u8 = 0xFF; | |
for pos in 0..size{ | |
let y = unsafe { vector.get_unchecked_mut(pos) }; |
This file contains hidden or 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
module Main where | |
data Cuit | |
= Cuit :+: Cuit | |
| Cuit :*: Cuit | |
| Neg Cuit | |
| Var String | |
(-|) = Neg |
This file contains hidden or 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
open Unix; | |
let start = baud => | |
try({ | |
let fd = openfile("/dev/ttyUSB0", [O_RDWR], 0o640); | |
let tty = { | |
...tcgetattr(fd), | |
c_parenb: false, | |
c_cstopb: 1, | |
c_csize: 8, | |
c_icanon: false, |
This file contains hidden or 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
module Pipes | |
import Control.Monad.Trans | |
import Data.IORef | |
-- It's just https://github.com/QuentinDuval/IdrisPipes with one small change. | |
||| PipeT is a composable data type to describe streams of data that | |
||| can be generated and can flow upstream and downstream just like | |
||| javascript generators |
Algumas mudanças bem importantes na linguagem vão ocorrer pelos próximos dias e que vão influenciar bastante o modo que programamos Kind2. Primeiro eu gostaria de introduzir as ideias que a linguagem tenta usar e, após isso, os problemas que pensei que não vão deixar a linguagem ir tanto para frente quanto eu queria.
A unidade de modularização da linguagem seriam as funções já que tudo em Kind é primordialmente uma função ou um construtor (você pode considerar os 2 a mesma coisa já que um construtor é uma função que não reduz) e isso molda varios aspectos da linguagem como:
This file contains hidden or 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
use std::{collections::HashSet, fmt::Display, rc::Rc}; | |
/// The AST. This thing describes | |
/// the syntatic tree of the program. | |
#[derive(Debug)] | |
pub enum Syntax { | |
Lambda { | |
param: String, | |
body: Rc<Syntax>, | |
}, |
OlderNewer