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
/*! ***************************************************************************** | |
Copyright (C) Microsoft. All rights reserved. | |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | |
this file except in compliance with the License. You may obtain a copy of the | |
License at http://www.apache.org/licenses/LICENSE-2.0 | |
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | |
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | |
MERCHANTABLITY OR NON-INFRINGEMENT. | |
See the Apache Version 2.0 License for specific language governing permissions |
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
function Evaluate(method, parameters) { | |
var instructionsOld = method.Instructions; | |
var stack = new Array(method.MaxStack); | |
var locals = new Array(method.LocalCount); | |
// var True = this.True; | |
// var False = this.False; | |
var lastStack; | |
var tempQ; | |
var tempIndex1; | |
var tempParameters; |
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
const width = 7; | |
const height = 7; | |
let grid = new Array(width * height); | |
const WALL = 0; | |
const DOT = 1; | |
const EMPTY = 2; | |
for (let x = 0; x < width; x++) { | |
for (let y = 0; y < height; y++) { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Color Sorter</title> | |
<style> | |
body { | |
background-color: black; | |
flex: 1; | |
display: flex;; |
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
let a = 1; | |
if (a == 1) { | |
let a = 2; | |
console.log(a); | |
} | |
console.log(a); | |
let b = 1; | |
if (a == 1) { | |
let b = b; |
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 restParam<R> = ((...a: any[]) => R); | |
type oneParam<A, R> = ((a: A) => R); | |
type twoParam<A, B, R> = ((a: A, b: B) => R); | |
type threeParam<A, B, C, R> = ((a: A, b: B, c: C) => R); | |
type composeFn = ( | |
(() => () => void) & | |
//1 param, 5 composes |
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
export enum MemberActionOptions { | |
DoThis, | |
DoThat, | |
OtherThing | |
} | |
export type MemberAction = { | |
type: MemberActionOptions.DoThis, | |
thisThing: number, | |
} | { |
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
var locker = new object(); | |
long count1 = 0,count2=0; | |
Task.Run(() =>{while (true)lock (locker)count1++;}); | |
Task.Run(() =>{while (true)lock (locker)count2++;}); | |
Task.Run(() =>{while (true)Console.WriteLine(" Diff :" + (count1 - count2));}); | |
Console.ReadLine(); |
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
public class ServerGame : Game | |
{ | |
public override void MakePlayer() | |
{ | |
MainPlayer = new ServerPlayer(); | |
} | |
public void Tick() | |
{ | |
MainPlayer.ServerThing();//Unavailable without casting |
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
//actual inputs | |
var t0 = process.hrtime(); | |
var m = new Uint8Array(30*60*60*5); | |
for (var c = 0; c < m.length; c++)m[c] = Math.random() * 32 | 0; | |
var mk = []; |