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
### Keybase proof | |
I hereby claim: | |
* I am sheeo on github. | |
* I am sheeo (https://keybase.io/sheeo) on keybase. | |
* I have a public key ASAsgdfQbU465HBWjqtKsmabv5UOF2And0qn1J9VBkQZ-go | |
To claim this, I am signing this object: |
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
export function CalculateIntegrationField(room: Room, goalName: string, goals: [number, number][]): IntegrationField { | |
if(!goals) throw new Error("No goals provided"); | |
if(!room.memory.costField || room.memory.costFieldInvalid) { | |
CalculateCostField(room); | |
} | |
let pre = Game.cpu.getUsed(); | |
let costField = room.memory.costField; | |
let integrationField: number[][] = []; | |
let openList: [number, number][] = []; |
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
#!/usr/bin/env python3 | |
""" | |
Usage: | |
server.py [--nodb | --db TYPE] | |
Options: | |
--nodb Don't use a database (Use a mock.Mock). Caution: Will break things. | |
--db TYPE Use TYPE database driver [default: QMYSQL] | |
""" |
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
#!/bin/bash | |
progname=$(basename $0) | |
print_short_help() { | |
cat <<EOF | |
Usage: $progname [-1] [-f] [-r] [-p phases] [-c compiler] <tests-dir> | |
EOF | |
} |
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
(** Additions to weedingast.ml, bottom **) | |
let type_decl_members td = match td.type_decl with | |
| Class d -> d.class_members | |
| Interface i -> i.interface_members | |
let decl_name decl = match decl.decl with | |
| Field f -> f.field_name.Ast.identifier | |
| Method m -> m.method_name.Ast.identifier | |
| Constructor c -> c.constructor_name.Ast.identifier |
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
public override void CreateNewOutputRows() | |
{ | |
string strCurrency; | |
string flRate; | |
XmlDocument xm = new XmlDocument(); | |
xm.Load(Variables.ECBRL.ToString()); | |
XmlNodeList xnode = xm.GetElementsByTagName("Cube"); | |
DateTime date = DateTime.Parse(xm.GetAttribute("time")); | |
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 System.Security.Permissions; | |
using System.Threading; | |
class ThreadInterrupt | |
{ | |
static void Main() | |
{ | |
StayAwake stayAwake = new StayAwake(); | |
Thread newThread = |
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
let printMatrixRec2((mat : int[][])) = | |
let rec iterate r c = | |
match r, c with | |
| m,n when n = mat.[m].Length-1 && m = mat.Length-1 -> printf " %d" mat.[m].[n]; () // Base case, last entry: Stop recursion when r,c are at bounds of Mat int[][] array | |
| m,n when n = mat.[m].Length-1 -> printf " %d\n" mat.[m].[n]; iterate (m+1) 0 // Special case: last column of row m, print special and iterate next row | |
| m,n when n=0 -> printf "%d " mat.[m].[n]; iterate m (n+1) // Special case: first column of m | |
| m,n -> printf " %d " mat.[m].[n]; iterate m (n+1) // Normal case: entry m,n | |
iterate 0 0 |
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
mat | |
|> Array.iteri (fun m i -> Array.iter (fun n -> printfn "%d" mat.[m].[n]) mat.[m]) | |
// vs | |
mat | |
|> Array.iteri (fun m i -> mat.[m] | |
|> (fun n -> printfn "%d" mat.[m].[n])) | |
// vs |
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
public void Add<TEntity>(TEntity t) where TEntity : class | |
{ | |
var properties = (from p in GetType().GetProperties() | |
select p.GetGetMethod(true)); | |
var genericProperties = (from property in GetType().GetProperties() | |
let returntype = property.GetGetMethod(true).ReturnType | |
where returntype.IsGenericType | |
where returntype.GetGenericArguments().Length == 1 | |
let argumenttype = returntype.GetGenericArguments().First() | |
where argumenttype == typeof (TEntity) |
NewerOlder