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
using System; | |
using JSIL; | |
using JSIL.Meta; | |
public static class Program { | |
public static int x = 10; | |
public static int y = 20; | |
public static void Main () { | |
dynamic document = Builtins.Global["document"]; |
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
/* | |
Given two strings, find the number of common characters between them. | |
Example | |
For s1 = "aabcc" and s2 = "adcaa", the output should be | |
commonCharacterCount(s1, s2) = 3. | |
Strings have 3 common characters - 2 "a"s and 1 "c". | |
*/ |
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
struct ParseVisitor<T> { | |
_marker: PhantomData<T> | |
} | |
impl<'de, T> Visitor<'de> for ParseVisitor<T> | |
where T: std::str::FromStr | |
{ | |
type Value = T; | |
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
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
extern crate rand; | |
use rand::Rng; | |
const TRAINING_SET_SIZE: u64 = 1024; | |
fn transfer_derivative(output: f64) -> f64 { | |
return output * (1.0 - output); | |
} | |
#[derive(Clone, Debug)] |
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
pub fn launch_tiled<C: 'static + Clone + Sync + Send + Fn(super::Tile)>( | |
self, | |
scene: Scene, | |
tile_size: (usize, usize), | |
cb: C, | |
) -> () { | |
let queue = Arc::new(MsQueue::new()); | |
// Generate tiles | |
{ |
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
pub fn render_tiled(scene: Scene, settings: Settings) -> mpsc::Receiver<super::Tile> { | |
let queue = Arc::new(MsQueue::new()); | |
let (sender, receiver) = mpsc::channel(); | |
// Split the backbuffer into tiles and push them into the queue | |
{ | |
let mut x = 0; | |
let mut y = 0; | |
'gen_tiles: loop { |
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
pub fn render_tiled(scene: Scene, settings: Settings) -> TaskHandle { | |
let queue = Arc::new(MsQueue::new()); | |
let (sender, receiver) = mpsc::channel(); | |
// Split the backbuffer into tiles and push them into the queue | |
{ | |
let mut x = 0; | |
let mut y = 0; | |
'gen_tiles: loop { |
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
/* tslint:disable */ | |
var wasm; | |
const TextDecoder = require('util').TextDecoder; | |
let cachedDecoder = new TextDecoder('utf-8'); | |
let cachegetUint8Memory = null; | |
function getUint8Memory() { | |
if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) { | |
cachegetUint8Memory = new Uint8Array(wasm.memory.buffer); |
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
const path = require('path'); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
const main = { | |
entry: ['./source/main.js', './assets/styles/main.scss'], | |
output: { | |
filename: "main.js", | |
path: path.resolve(__dirname, "dist") | |
}, | |
resolve: { |
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
Constant buffer: | |
[6, 20, 20, 12, 0, 2, 0] | |
Variable Slots: | |
{} | |
Instruction block: | |
main |
OlderNewer