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
<?php | |
namespace CHH; | |
trait MetaObject | |
{ | |
protected static $__metaClass; | |
static function setMetaClass(MetaClass $metaClass) | |
{ |
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
(require rackunit) | |
(require rackunit/text-ui) | |
(define q1 | |
(test-suite | |
"question 1 : warm up, project, inverse" | |
(check-equal? 1000 (* 10 10 10) "trivial equality") | |
(check-exn exn:fail? (lambda () (error "DUCK!"))) "test for function that should fail")) | |
(run-tests q1) |
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
irb(main):001:0> a = [1,2,3] | |
irb(main):001:0> a = [1,2,3] | |
=> [1, 2, 3] | |
irb(main):002:0> b = a << 4 | |
b = a << 4 | |
=> [1, 2, 3, 4] | |
irb(main):003:0> a | |
a | |
=> [1, 2, 3, 4] |
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 os | |
import subprocess | |
def cmd(command): | |
p = subprocess.Popen(command, | |
stdout=subprocess.PIPE, | |
stderr=subprocess.STDOUT) | |
return iter(p.stdout.readline, b'') | |
def pre(path): |
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
(require 'dash) | |
(defvar *hw/percent* 0.9) | |
(defvar *pr/percent* 0.1) | |
(defvar *week/percent* 0.1) | |
(defvar *exam/percent* 0.15) | |
(defun weekly-grades (hp) | |
(let ((hw (car hp)) | |
(pr (cdr hp))) |
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
;;; browse-kill-ring.el --- interactively insert items from kill-ring -*- coding: utf-8 -*- | |
;; Copyright (C) 2001, 2002 Colin Walters <[email protected]> | |
;; Author: Colin Walters <[email protected]> | |
;; Maintainer: Nick Hurley <[email protected]> | |
;; Created: 7 Apr 2001 | |
;; Version: 1.3a (CVS) | |
;; X-RCS: $Id: browse-kill-ring.el,v 1.2 2008/10/29 00:23:00 hurley Exp $ | |
;; URL: http://freedom.cis.ohio-state.edu/~hurley/ |
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
class Object | |
def mysum | |
0 | |
end | |
end | |
class Fixnum # The class belonging to small integers | |
def mysum | |
self # The sum of an integer is just itself | |
end |
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
(progn | |
(message ":package") | |
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . | |
"http://marmalade-repo.org/packages/")) | |
(package-initialize) | |
(package-refresh-contents)) | |
;;; ... |
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
// table -> [dom] | |
var lines = jQuery("#gridview-1035 table tr"); | |
// [dom] -> [str] | |
var parse = function (i,e) { | |
var s = e.textContent.split(" "); | |
return s[0] ? s[0].trim() : null; // if (s[0]) { return s[0].trim(); } else return null; | |
}; | |
files = lines.map(parse); |
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
;;; caret located "wat" | |
(message "wat") | |
(defun wat () | |
.|. "wat") | |
;;; C-( should? wrap "wat" but eats the previous s-exp | |
((message "wat") | |
defun wat () | |
"wat") |
OlderNewer