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
#define STEPS 800 //motor steps for one cut | |
#define DIRECTION 1 //motor direction 1 or 0 | |
#define CUT_TIME 500 //time to cut in ms | |
#define CUT_COUNT 20 //number of cuts | |
#define SPEED_TIME 1 //speed between impulses in ms | |
#define PAUSE_TIME 100 //time after pause button is pressed | |
#define GRAB_TIME 200 //time for grabbing/releasing the paperj | |
#define STEP_PIN 5 //motor driver STEP pin | |
#define DIR_PIN 11 //motor driver DIR pin |
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
/* | |
* Copyright (c) 2012 Calvin Rien | |
* | |
* Based on the JSON parser by Patrick van Bergen | |
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html | |
* | |
* Simplified it so that it doesn't throw exceptions | |
* and can be used in Unity iPhone with maximum code stripping. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining |
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
{ | |
"color_scheme": "Packages/Color Schemes by carlcalderon/Stereokai/Stereokai.tmTheme", | |
"font_face": "Monaco", | |
"font_size": 16, | |
"translate_tabs_to_spaces": true, | |
"use_tab_stops": false | |
} |
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
module nigga; | |
import std.algorithm : reduce; | |
import std.conv : to; | |
import std.process : browse; | |
import std.stdio : write, writeln, readln; | |
import std.string : toLower, capitalize, toUpper; | |
void main() { | |
"http://www.youtube.com/watch?v=0itOCgJtNVU".browse; |
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
///This is only for debug. The same role as Type.init == init!Type | |
@property auto init(Target)() { | |
writeln(Target.init); //used for debug | |
return Target.init; | |
} | |
///Returns Source's .init converted with std.conv.to to Target | |
@property auto init(Source, Target)() { | |
return init!Source.to!Target; | |
} |
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 std.string : format; | |
///Use with mixins. mixin(ArgNull!<arg>); | |
template ArgNull(alias argument) { | |
enum ArgNull = format( | |
"if(%1$s is null) | |
throw new Exception(\"%1$s cannot be null.\");", argument.stringof); | |
} | |
unittest { |
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
/*links*/ | |
a { | |
text-decoration: none; | |
} | |
a:hover { | |
color: #ffff00; | |
} | |
a:active { |
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
open Microsoft.FSharp.Reflection | |
let cases<'a> = seq { | |
for case in FSharpType.GetUnionCases typeof<'a> do | |
yield (FSharpValue.MakeUnion(case, [||]) :?> 'a) | |
} |
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
module PairHeap | |
type Heap<'a> = | |
| Empty | |
| Heap of 'a * (Heap<'a> list) | |
let top = | |
function | |
| Empty -> failwith "empty" | |
| Heap (c,_) -> 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
import { Turtle } from './turtle.js'; | |
import { WaterTurtle } from './water.js'; | |
import { GalapagosTurtle } from './galapagus.js'; | |
import { EvkodianTurtle } from './evkodian.js'; | |
import { NinjaTurtle } from './ninja.js'; | |
result.Turtle = Turtle; | |
result.WaterTurtle = WaterTurtle; | |
result.GalapagosTurtle = GalapagosTurtle; | |
result.EvkodianTurtle = EvkodianTurtle; |
OlderNewer