View lib.rs
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
mod ml_thread; | |
use gdnative::prelude::{godot_print, methods, Method, NativeClass, Node as GDNode, InitHandle, godot_init}; | |
use ml_thread::start_language_model_thread; | |
use std::sync::mpsc::{channel, Receiver, RecvError, Sender, SendError}; | |
const MAX_INPUT_LENGTH: usize = 512; | |
const BATCH_SIZE: usize = 1; |
View union_find.py
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
class UnionFind: | |
def __init__(self): | |
self.parents = dict() | |
def add(self, node_id:int): | |
self.parents[node_id] = node_id | |
def union(self, node_a:int, node_b:int): | |
min_parent = min(self.parents[node_a], self.parents[node_b]) | |
self.parents[node_a] = min_parent |
View tinypico_wireless_morse_keyboard.ino
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 <BleKeyboard.h> | |
#include <TinyPICO.h> | |
TinyPICO tinypico = TinyPICO(); | |
BleKeyboard keyboard; // keyboard("Name", "manufacturer", battery_level_100) | |
// a .- | |
// b -... | |
// c -.-. | |
// d -.. |
View DecisionTree.gd
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
# Sample Usage: | |
# var day_features = [ | |
# # freezing, raining, foggy, sunny | |
# [0, 1, 0, 0], | |
# [0, 0, 0, 1], | |
# [0, 0, 0, 0], | |
# [0, 0, 1, 0], | |
# [1, 0, 0, 1], | |
# [1, 1, 0, 0], | |
# [1, 0, 1, 0], |
View decision_tree.rs
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
//use serde::{Serialize, Deserialize}; | |
use std::collections::HashMap; | |
// If you have serde, serialization is available with this derive chain: | |
//#[derive(Clone, Debug, Default, Serialize, Deserialize)] | |
#[derive(Clone, Debug, Default)] | |
pub struct DecisionTree { | |
feature: usize, | |
threshold: f32, |
View basic_backprop.py
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
import numpy | |
import random | |
class Graph: | |
def __init__(self): | |
self.nodes = list() | |
self.last_tape = None | |
def forward(self, variables, output_node): | |
for n in self.nodes: | |
n.forward(variables) |
View owa.tracker-combined-latest.minified.js
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
(function(exports) { | |
if (!this.JSON) { | |
this.JSON = {}; | |
} | |
(function() { | |
"use strict"; | |
function f(n) { | |
return n < 10 ? "0" + n : n; | |
} | |
if (typeof Date.prototype.toJSON !== "function") { |
View gan.py
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
import numpy | |
from pathlib import Path | |
import sys | |
import torch | |
from torch import nn | |
import torchvision | |
from torchvision import datasets | |
from torchvision import transforms |
View CameraController.gd
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
extends Camera | |
export var follow_target_path:NodePath = "" | |
var follow_target:Node | |
export var follow_distance:float = 5.0 | |
export var follow_height:float = 1.0 | |
export var mouse_sensitivity_x:float = 0.005 | |
export var mouse_sensitivity_y:float = 0.005 | |
var last_mouse_delta:Vector2 = Vector2() |
View sketch_artist.py
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
import numpy | |
import picamera | |
import picamera.array | |
import random | |
import RPi.GPIO as GPIO | |
from time import sleep | |
camera_width = 320 | |
camera_height = 240 | |
arma_pin = 32 |
NewerOlder