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
create name !A!b=1, animate me . 1 1 0; at tm A:=0 100, name !A!b=1; at tm A:=1 101, name !A!b=0; at tm B:=0 102, animate me . 1 1 0; at tm B:=1 103, animate me . 1 1 1000000000; at tm A*B 104, astart !A!b=1; adone timer !A&!B=1 200 reset | |
create name !Ab=1; at tm A:=0 100, name !Ab=1; at tm A:=1 101, name !Ab=0; at tm B:=0 102, animate me . 1 1 1000000000; at tm B:=1 103, animate me . 1 1 0; at tm A*B 104, astart !Ab=1; adone timer !A&B=1 200 reset | |
create name Ab=0; at tm A:=0 100, name Ab=0 ; at tm A:=1 101, name Ab=1; at tm B:=0 102, animate me . 1 1 1000000000; at tm B:=1 103, animate me . 1 1 0; at tm A*B 104, astart Ab=1; adone timer A&B=1 200 reset | |
create animate me . 1 1 0, name A!b=0; at tm A:=0 100, name A!b=0; at tm A:=1 101, name A!b=1; at tm B:=0 102, animate me . 1 1 0; at tm B:=1 103, animate me . 1 1 1000000000; at tm A*B 104, astart A!b=1; adone timer A&!B=1 200 reset | |
at tm A&B=1 100, timer A&!B=0 200 reset, timer !A&B=0 200 reset, timer !A&!B=0 200 reset, timer A=1 200 reset, timer B=1 200 re |
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
float estimated_min_attempt_vel(float fps) | |
{ | |
vector pos = llGetPos(); | |
float alt = pos.z; | |
integer shell = llFloor(llLog(alt)/llLog(2.0)); | |
return fps * llPow(2.0, (float)shell - 24.0); | |
} | |
show(float attempting, float getvel, float actual, float fps, float dilation) | |
{ |
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
DynamicVariable subclass: #DynamicGeneratorVar | |
instanceVariableNames: '' | |
classVariableNames: '' | |
poolDictionaries: '' | |
category: 'Sgeo-DynamicGenerator'! | |
!DynamicGeneratorVar commentStamp: 'SethJGold 1/14/2013 06:41' prior: 0! | |
DynamicGeneratorVar holds the current DynamicGenerator in use. Should not be used directly by client code.! | |
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
waitFor: anAnnouncementClass | |
"Blocks the current process until anAnnouncementClass is announced. | |
Note that synchronous code using this method runs the risk of missing announcements." | |
| val sem | | |
sem := Semaphore new. | |
self on: anAnnouncementClass do: [:ann | val := ann. sem signal]. | |
sem wait. | |
^val. | |
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
listEven :: [a] -> Bool | |
listEven [] = True | |
listEven (_:xs) = listOdd xs | |
listOdd :: [a] -> Bool | |
listOdd [] = False | |
listOdd (_:xs) = listEven xs |
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
/* code taken verbatim from http://www.scala-lang.org/api/current/index.html#scala.util.control.TailCalls$ */ | |
def isEven(xs: List[Int]): TailRec[Boolean] = | |
if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail)) | |
def isOdd(xs: List[Int]): TailRec[Boolean] = | |
if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail)) |
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
REBOL [ | |
Title: "Monads" | |
Author: "Sgeo" | |
] | |
do-monad: func [ | |
monad "An object containing a /bind and a /return." | |
assigns [block!] | |
result [block!] | |
/local ma f next-assigns arg |
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 [num] [ | |
num: 0 | |
count: func [x] [ | |
num: num + x | |
print num | |
] | |
] | |
count 1 count 1 count 1 |
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 std::marker::PhantomData; | |
pub enum Void {} | |
impl Void { | |
fn any(&self) -> ! { | |
match *self {} | |
} | |
} |
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 std::rc::{Rc, Weak}; | |
use std::cell::RefCell; | |
pub struct Scope<'t, T: 't> { | |
filled: bool, | |
hole: &'t mut T | |
} | |
impl<'t, T: 't> Scope<'t, T> { | |
unsafe fn new(mut_ref: &'t mut T) -> (T, Self) { |