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
| class Temp { | |
| public static $key = "FOO"; | |
| public static function template(){ | |
| return "foo ". self::$key . " bar"; // works if you don't use string interpolation | |
| return "foo self::$key bar"; // Undefined variable: key | |
| return "foo {self::$key} bar"; // Undefined variable: key | |
| return "foo ${self::$key} bar"; // Undefined variable: FOO | |
| return "foo {Temp::$key} bar"; // Undefined variable: key | |
| return "foo $key bar"; // Undefined variable: key |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <PropertyGroup Condition="'$(Env)' == 'test'"> | |
| <!-- UNC path where we publish code--> | |
| <PublishFolder>\\dev-server\Sites\my-classic-asp-site</PublishFolder> | |
| <!-- the remote path to where our code is deployed --> | |
| <LocalPublishFolder>D:\WebRoot\my-classic-asp-site</LocalPublishFolder> | |
| <!-- the computer name for psexec --> | |
| <Computer>\\dev-server</Computer> |
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
| # Add this line to your software sources | |
| deb http://debian.meebey.net/experimental/mono / | |
| sudo apt-get update | |
| # of course, apt-get remove mono-complete first... | |
| sudo apt-get install mono-complete | |
| # I installed monodevelop from apt just to get all the prereqs | |
| sudo apt-get install monodevelop |
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
| <!doctype html> | |
| <html lang="en" ng-app> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Dev log</title> | |
| <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
| </head> | |
| <body> | |
| <div class="container" ng-controller="DevLogController"> | |
| <h2>Dev Log</h2> |
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
| #!/bin/bash | |
| #read from emacs server file what port it is currently listening on | |
| PORT=`egrep -o '127.0.0.1:([0-9]*)' ~/.emacs.d/server/server | sed 's/127.0.0.1://'` | |
| HOST="${@: -1}" | |
| echo "Found host '$HOST'" | |
| ssh "$HOST" "mkdir -m 700 -p ~/.emacs.d/server" | |
| scp -p ~/.emacs.d/server/server $HOST:.emacs.d/server/server |
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
| (defmethod asdf:perform :around ((o asdf:test-op) (system asdf:system)) | |
| ;; find a good filename, inside the current Jenkins workspace | |
| (let ((outfile | |
| (merge-pathnames (format nil "TAP/~a.tap" (asdf:component-name system)) | |
| (truename (sb-ext:posix-getenv "WORKSPACE")))) | |
| ;; keep a list of how many tests we've got | |
| (num-tests 0) | |
| ;; keep a list of test names and how many assertions passed | |
| (working-tests (make-hash-table))) | |
| (ensure-directories-exist outfile) |
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
| ;; from SimPy.Simulation import * | |
| ;; class Message(Process): | |
| ;; """ a simple Process """ | |
| ;; def __init__(self,i,len): | |
| ;; Process.__init__(self,name="Message"+str(i)) | |
| ;; self.i = i | |
| ;; self.len = len | |
| ;; def go(self): |
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
| (defmacro make-coroutine ((&key (coroutine-done-value :done)) &body body) | |
| (alexandria:with-gensyms ((yield-cv "can we yield?") | |
| (run-cv "can we run?") | |
| (run-lck "lock for the runner thread") | |
| (val "yielding value") | |
| (thrfn "thread body")) | |
| `(let* ((,yield-cv (bordeaux-threads:make-condition-variable | |
| :name "yield")) | |
| (,run-cv (bordeaux-threads:make-condition-variable | |
| :name "run")) |
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
| (defmacro make-coroutine ((&key (coroutine-done-value :done)) &body body) | |
| (alexandria:with-gensyms ((thrfn "thread body") | |
| (c "channel")) | |
| `(let* ((,c (make-instance 'chanl:bounded-channel)) | |
| (,thrfn (lambda () | |
| (flet ((yield (&optional n) | |
| (chanl:send ,c n))) | |
| ,@body | |
| (yield ,coroutine-done-value))))) | |
| (let ((alive-p T) val thr) |
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
| (defun coroutine-test () | |
| (let ((cor (make-coroutine (:coroutine-done-value :done) | |
| (yield 1) | |
| (yield) | |
| (yield 4)))) | |
| (assert (eql 1 (funcall cor)) ) | |
| (assert (null (funcall cor))) | |
| (assert (eql 4 (funcall cor))) | |
| (assert (eql :done (funcall cor))) | |
| (assert (eql :done (funcall cor))))) |