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
using System; | |
using System.Collections.Generic; | |
using Antlr4.StringTemplate; | |
namespace stringtemplatetest | |
{ | |
class Bjorn | |
{ | |
public Bjorn(int alder) | |
{ |
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 arDrone = require('ar-drone'); | |
var drone = arDrone.createClient(); | |
drone.takeoff(); | |
drone | |
.after(5000, function() { | |
this.clockwise(0.5); | |
}) | |
.after(1000, function() { |
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 arDrone = require('ar-drone'); | |
var drone = arDrone.createClient(); | |
drone.takeoff(); | |
var takeoffTid = 5000; | |
drone | |
.after(takeoffTid, function() { | |
this.clockwise(0.5); | |
}) |
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 levelup = require('levelup') | |
var db = levelup('./mydb', {valueEncoding: "json"}) | |
var events = require('events'); | |
// Utility function to make streams observable | |
events.EventEmitter.prototype.toObservable = require('./toObservable.js'); | |
var rx = require('rx'); | |
// Utility function to pipe observables to streams | |
rx.Observable.prototype.writeToStream = require('./writeToStream.js'); |
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 play = function(){ | |
console.log('Velkommen til konsollet. Skriv play.spin() og se hva som skjer! Skriv play.help() for hjelp og play.about() for bakgrunnsinfo '); | |
}; | |
play.spin = function () { $("body").css("-webkit-transform", "rotate3d(1,1,0,180deg)")} | |
play.help = function () { console.log("Skriv play.spin() og trykk enter")}; | |
play.about = function () { console.log("Sjekk ut http://blog.bjartwolf.com/?p=552") }; |
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
a := 13 | |
c := 9 | |
x := a | |
for i := 0; i < b.N; i++ { | |
if (x == a) { | |
x = c | |
} else { | |
x = a | |
} | |
} |
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
a := 13 | |
c := 9 | |
x := a | |
for i := 0; i < b.N; i++ { | |
x = a^c^x | |
} |
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
func SaneAbs (num int) int { | |
if num > 0 { | |
return num | |
} else { | |
return -num | |
} | |
} |
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
func InSaneAbs (num int) int { | |
y := num>>63 | |
return (num ^ y) - 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
(def acc (chan (dropping-buffer 10))) | |
(let [accelerometer (.getDefault Windows.Devices.Sensors.Accelerometer) | |
minimumReportInterval (.-minimumReportInterval accelerometer)] | |
(set! accelerometer.-ReportInterval minimumReportInterval) | |
(.addEventListener accelerometer "readingchanged" ( | |
fn [meter] | |
(put! acc (.toFixed (.-reading.accelerationX meter) 2))))) |