Made with Computer Craft Mod, with allows write lua scripts in minecraft.
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
type 'a graph = | |
| Empty | |
| G of { | |
la: 'a list list; | |
size: int | |
} | |
let init_graph = Empty | |
let add_node = function | |
| Empty -> G {la = [[]]; size=1} |
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 Fmt *) | |
type 'a bst = | |
| Empty | |
| Node of { | |
left : 'a bst; | |
value : 'a; | |
right: 'a bst; | |
} | |
[@@deriving show] |
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 Mysql | |
let () = | |
let db = | |
quick_connect ~host:"localhost" ~user:"root" ~password:"{password}" | |
~database:"{database_name}" () | |
in | |
let result = exec db "SELECT id, name FROM {table_name} LIMIT 5;" in |
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
(* (λx.x)a→a *) | |
(* (λx.λy.x)ab→(λy.a)b→a *) | |
(* (λx.xx)a→aa *) | |
(* (λx.λy.xy)a→λy.ay *) | |
datatype Term | |
= Var of string | |
| Abs of string*Term | |
| App of Term*Term |
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
#include <cstdint> | |
#include <iostream> | |
#include <bitset> | |
using namespace std; | |
void use_bitset(void){ | |
bitset<3> p1b{"001"}; // Player 1 Hand | |
bitset<3> p2b{"010"}; // Player 2 Hand | |
bitset<9> game; |
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
#!/bin/bash | |
while true; do | |
scroll_lock=$(xset q | grep "Scroll Lock:" | awk '{print $NF}') | |
echo $scroll_lock | |
if [ "$scroll_lock" == "on" ]; then | |
xdotool mousedown 1 | |
else | |
xdotool mouseup 1 | |
fi |
Value Numbering é uma tecnica para determinas se duas computações no programa são equivalentes e eliminar uma delas, preservando a semantica do programa.
GVN é uma tecnica de otimização de compiladores basiado na IR SSA. Global porque o mapeamento é feito entre basic blocks boundaries também. Funciona atribuindo valores numericos para variaveis e expressões, e o mesmo valor é atribuido para variaveis e expressoes equivalentes. Por exemplo:
w := 3
x := 3
NewerOlder