Edit: This list is now maintained in the rust-anthology repo.
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
| [tool.poetry] | |
| name = "mnist" | |
| version = "0.1.0" | |
| description = "" | |
| authors = ["Nick Linker"] | |
| [tool.poetry.dependencies] | |
| python = "^3.6" | |
| [tool.poetry.dev-dependencies] |
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
| #[derive(Debug)] | |
| struct OrderBook { | |
| pair_name: String, | |
| pair_id: u64, | |
| bids: HashMap<String, String>, | |
| asks: HashMap<String, String>, | |
| } | |
| fn parse_poloniex_full_order_book(msg: &str) -> OrderBook{ |
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 | |
| # | |
| # pyTorch install script for NVIDIA Jetson TX1/TX2, | |
| # from a fresh flashing of JetPack 2.3.1 / JetPack 3.0 / JetPack 3.1 | |
| # | |
| # for the full source, see jetson-reinforcement repo: | |
| # https://github.com/dusty-nv/jetson-reinforcement/blob/master/CMakePreBuild.sh | |
| # | |
| # note: pyTorch documentation calls for use of Anaconda, | |
| # however Anaconda isn't available for aarch64. |
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
| // https://users.rust-lang.org/t/predictable-random-numbers/17593 | |
| extern crate rand; | |
| use std::collections::HashMap; | |
| use rand::Rng; | |
| use rand::IsaacRng; | |
| #[derive(Debug, Clone)] | |
| struct Value(Vec<u8>); |
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 subprocess | |
| from lib.common.dominoUtil import running_on_local | |
| from lib.config import PROJECT_PATH | |
| import time | |
| import psutil | |
| import os | |
| import numpy as np | |
| def _recommended_threads(): | |
| return psutil.cpu_count()-2 |
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::marker::PhantomData; | |
| use std::cell::Cell; | |
| pub struct Game<'g> { | |
| // Putting the lifetime 'g into a PhantomData<Cell<&'g ()>> instead of a | |
| // PhantomData<&'g ()> makes 'g invariant instead of covariant. | |
| // I don't know if that's necessary here, but better be safe than sorry. | |
| // See https://doc.rust-lang.org/nomicon/subtyping.html for more info. | |
| phantom: PhantomData<Cell<&'g ()>>, | |
| } |
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
| #![feature(optin_builtin_traits)] | |
| mod userspace { | |
| use unit::Unit; | |
| use session::{Ai, DataTrait, Session}; | |
| #[derive(Debug)] | |
| struct MyAi<'a> { | |
| units: Vec<&'a mut Unit> | |
| } |
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
| #![feature(optin_builtin_traits)] | |
| mod userspace { | |
| use unit::Unit; | |
| use session::{Ai, DataTrait, Session}; | |
| #[derive(Debug)] | |
| struct MyAi(); | |
| #[derive(Debug)] |
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
| {-# OPTIONS -Wall -Werror #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| import Control.Applicative ((<|>)) | |
| import Control.Monad (void) | |
| import Test.QuickCheck | |
| import Text.Show.Functions () |