View after-aab22
1 2 3 4 5 6 7 8 9
Running Ball Drop
Ball Drop (10 steps, 10 solve loops) : 27 ms (370.3703703703704 steps/second)
Checksum: -1.8194444444444444
 
Ball Drop (10 steps, 30 solve loops) : 10 ms (1000.0 steps/second)
Checksum: -1.8194444444444444
 
Ball Drop (100 steps, 10 solve loops) : 39 ms (2564.102564102564 steps/second)
Checksum: -30.69444444444442
View with vector_math
1 2 3 4 5 6 7 8 9
Running Ball Drop
Ball Drop (10 steps, 10 solve loops) : 23 ms (434.7826086956522 steps/second)
Checksum: -1.8194442838430405
 
Ball Drop (10 steps, 30 solve loops) : 9 ms (1111.111111111111 steps/second)
Checksum: -1.8194442838430405
 
Ball Drop (100 steps, 10 solve loops) : 42 ms (2380.9523809523807 steps/second)
Checksum: -30.694456100463867
View gist:4011883
1 2 3 4 5 6
#lang racket
 
(define (anfangskurs A B D)
(define alpha (my-acos (/ (- (sin B) (* (cos D) (sin A))) (* (cos A) (sin D)))))
(cond
[(< 180 alpha) (- 360 alpha) alpha]))
View degree.rkt
1 2 3 4 5 6 7 8 9 10
#lang racket
 
(define (degree->cardinal degree)
(case (modulo (inexact->exact (round (* 32 (/ degree 360)))) 32)
((0) "N")
((1) "NbE")
((2) "NNE")
((3) "NEbN")
((4) "NE")
((5) "NEbE")
View degree->name
1 2 3 4 5 6 7 8 9 10
#lang racket
 
(define (helper dir1 dir2 sub)
(cond
[(= sub 1) dir1]
[(= (modulo sub 4) 0) (string-append "b" dir1)]
[(= (modulo sub 2) 0) (string-append "b" dir2)]
))
 
(define directions "NESESWNW")
View gist:3941116
1 2 3 4 5 6 7 8 9 10
#lang racket
 
(define (degree->radian degree)
(* (/ (* 2 pi) 360) degree))
 
(define (radian->degree radian)
(* (/ 360 (* pi)) radian))
 
(define (my-acos alpha)
(if (= alpha 0)
View trait.php
1 2 3 4 5 6 7 8 9 10
<?php
/**
* Is this possible in php5.4 using traits?
*/
trait Hashmap {
public function set($key, $val) {
$this->data[$key] = $val;
View .htaccess
1 2 3 4 5
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
View gist:760242
1 2 3 4 5 6 7 8 9 10
setup : function(ed) {
ed.onKeyPress.addToTop(function(ed, e) {
if(e.keyIdentifier =='Enter' && ed.selection)
{
var element = ed.selection.getNode(),
tagname = element.tagName.toLowerCase(),
contentLength = element.textContent.length;
if( contentLength==0 && (tagname=='dt' || tagname=='dd'))
{
ed.execCommand("formatBlock",false, 'p');
View README.rdoc

Rails 2.3.5 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment

Something went wrong with that request. Please try again.