Skip to content

Instantly share code, notes, and snippets.

(define adsf 5)
(require (only-in "../lib.ss" enumerate-interval flatmap nil))
; checks not horiz
(define (safe? k queens)
(define (problem-horiz? k-queen-row queens num-at)
(cond ((eq? queens nil) #f) ; we've tried them all
((= k num-at) #f) ; this is comparing against itself
((= k-queen-row (car queens)) #t) ; the row of current queen is the same as kth queen
(else (problem-horiz? k-queen-row (cdr queens) (+ 1 num-at)))))
(define (problem-diag? k-row k-col queens num-at)
(define-syntax begin2
(syntax-rules ()
[(begin2 a) (a)]
[(begin2 a b ...) ((begin3 b ...) a)]))
(define-syntax begin3
(syntax-rules ()
[(begin3 a) (lambda (unique-plz) a)]
[(begin3 a b ...) (lambda (unique-plz) ((begin3 b ...) a))]))
r = robot.RobotPID('gort', 9876)
r.set_dt(.1)
r.set_forward_vars(.8, 0, .1, .05)
r.set_angle_vars(.5, 0, .06, .055)
r.forward(3.25)
r.turn(math.pi/2)
r.forward(3.04)
from playerc import *
import math
import time
class PID:
def __init__(self, Kp, Ki, Kd, dt):
self.Kp = Kp
self.Ki = Ki
self.Kd = Kd
self.dt = dt
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 242 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
warning: updating the current branch
warning: Updating the currently checked out branch may cause confusion,
warning: as the index and work tree do not reflect changes that are in HEAD.
warning: As a result, you may see the changes you just pushed into it
warning: reverted when you run 'git diff' over there, and you may want
describe "Example", ->
beforeEach ->
window._fake = ->
arguments[2](output: "3") if arguments[2]
post_fake_spy = spyOn(window.$, 'post').andCallFake ->
window.fake.apply(this, post_fake_spy.mostRecentCall.args)
afterEach ->
window.fake = window._fake
describe "Example", ->
beforeEach ->
window._fake = ->
arguments[2](output: "3") if arguments[2]
post_fake_spy = spyOn(window.$, 'post').andCallFake ->
window.fake.apply(this, post_fake_spy.mostRecentCall.args)
afterEach ->
window.fake = window._fake
macirb
macirb
irb(main):001:0> framework 'Foundation'
framework 'ScriptingBridge'
framework 'Foundation'
=> true
irb(main):002:0> framework 'ScriptingBridge'
=> true
irb(main):003:0> firefox = SBApplication.applicationWithBundleIdentifier("org.mozilla.firefox")
firefox = SBApplication.applicationWithBundleIdentifier("org.mozilla.firefox")
(defun shell-cdcurr-cmd (shname cmd)
"starts a shell with given name, cd's to current directory, and runs cmd inside it"
(let ((curdir (current-buffer-directory)))
(save-excursion
(shell shname)
(insert (concat "cd " curdir)) (comint-send-input)
(insert cmd) (comint-send-input))))
(shell-cdcurr-cmd "rails-server" "rails s -p 3001 --debug")