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
// https://play.elevatorsaga.com | |
{ | |
init: function(elevators, floors) { | |
function anyoneWaiting(e) { | |
var c = e.currentFloor(); | |
var dest = _.head(e.destinationQueue); | |
var bs = floors[c].buttonStates; | |
if (dest === undefined || dest == c) | |
return !!bs.up || !!bs.down; |
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 nalgebra::allocator::Allocator; | |
use nalgebra::{DefaultAllocator, Dim, MatrixMN, RowVectorN, Scalar, VectorN, U1}; | |
use num_traits::identities::Zero; | |
pub trait IteratorExt: Iterator + Sized { | |
fn collect_columns<N, R, C>(self) -> MatrixMN<N, R, C> | |
where | |
Self: Iterator<Item = VectorN<N, R>>, | |
N: Scalar + Zero, | |
R: Dim, |
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
[package] | |
name = "temp" | |
version = "0.1.0" | |
authors = ["Tim Robinson"] | |
edition = "2018" |
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
enum Product { | |
"BTC-EUR", | |
"ETH-EUR", | |
"ETH-BTC", | |
} | |
let p: Product = Product!("BTC-EUR"); | |
mod product { | |
struct "BTC-EUR"; |
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
{ | |
"name": "portfolio-app", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"build": "node_modules/.bin/webpack --progress --profile --colors", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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 random | |
import time | |
from concurrent import futures | |
from concurrent.futures import ThreadPoolExecutor | |
from tqdm import tqdm | |
def run(task_num): | |
with tqdm(range(100), desc='Task %d' % task_num, position=task_num) as progress: | |
for _ in progress: |
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
ko = require('knockout'); | |
ko.observableDictionary = function(dict, valueFn) { | |
if (!valueFn) { | |
valueFn = function() { | |
return ko.observable(); | |
}; | |
} | |
var viewModels = {}; |
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
*.userprefs | |
bin/ | |
obj/ |
NewerOlder