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
function randInt(minv, maxv) { | |
var rv = minv + Math.floor(Math.random()*(maxv-minv)); | |
return rv; | |
} | |
function initialize(width, height, prob) { | |
var life = new Array(height); | |
for (var i = 0; i<height; ++i) { | |
life[i] = new Array(width); | |
for (var j=0; j<width; ++j) { |
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
-- haskell code that spits out cgm3dt javascript calls to solidblock and point to create a menger sponge. | |
class JSObject a where | |
to_js :: a -> String | |
class PtOffset a where | |
add :: a -> CgmPt -> a | |
data CgmPt = CgmPt { | |
x :: Double, |
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
if (location.hostname.indexOf('sourceforge.net') != -1) { | |
window.opera.addEventListener('BeforeScript', function (e) { | |
e.preventDefault(); | |
}, false); | |
window.opera.addEventListener('BeforeEvent.load', function (e) | |
{ | |
if (e.event.target instanceof Document) | |
{ | |
e.preventDefault(); | |
var nodes = e.event.target.getElementsByClassName('direct-download'); |
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
#!/usr/bin/ruby | |
require 'win32ole' | |
def get_catia() | |
catia = nil | |
catia = WIN32OLE.connect('CATIA.Application') | |
if catia == nil then | |
catia = WIN32OLE.new('CATIA.Application') | |
end |
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 replace-python-exp () | |
"Run the region as a Python script, kill the region, insert the output of the Python script." | |
(interactive) | |
(let* ((tmp-file (make-temp-file "tmppl")) | |
(rb (region-beginning)) | |
(re (region-end)) | |
(str (buffer-substring-no-properties rb re))) | |
(if (string-match "print" str) | |
(progn | |
(write-region rb re tmp-file nil 1) |
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
(global-set-key "\C-\M-g" 'ddg-bang-search) | |
(defun ddg-bang-search (bang) | |
(interactive "s!") | |
(let* ((search-query (replace-regexp-in-string " " "+" (buffer-substring-no-properties (region-beginning) (region-end)))) | |
(search-string (if (> (length bang) 0) | |
(concat "!" bang "+" search-query) | |
search-query))) | |
(browse-url (concat "http://duckduckgo.com/?ka=h&kh=1&kj=b2&km=m&ko=1&ks=n&kt=h&ku=-1&kv=1&kw=s&kx=e&ky=b&k1=-1&q=" search-string)))) |
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
Traceback (most recent call last): | |
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/SQLAlchemy-0.7.3-py3.2.egg/sqlalchemy/pool.py", line 675, in _do_get | |
return self._pool.get(wait, self._timeout) | |
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/SQLAlchemy-0.7.3-py3.2.egg/sqlalchemy/util/queue.py", line 137, in get | |
raise Empty | |
sqlalchemy.util.queue.Empty | |
During handling of the above exception, another exception occurred: | |
Traceback (most recent call last): |
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
79a80,81 | |
> description_encoding = 'use_encoding' | |
> | |
116c118 | |
< return connection.connection.get_characterset_info() | |
--- | |
> return connection.connection.get_charset() |
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
Traceback (most recent call last): | |
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/SQLAlchemy-0.7.3-py3.2.egg/sqlalchemy/pool.py", line 675, in _do_get | |
return self._pool.get(wait, self._timeout) | |
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/SQLAlchemy-0.7.3-py3.2.egg/sqlalchemy/util/queue.py", line 137, in get | |
raise Empty | |
sqlalchemy.util.queue.Empty | |
During handling of the above exception, another exception occurred: | |
Traceback (most recent call last): |
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
(setq load-path (cons "~/emacs" load-path)) | |
(setq load-path (cons "~/.emacs_stuff" load-path)) | |
(setq load-path (cons "c:/emacs/site-lisp" load-path)) | |
;; (setq load-path (cons "c:/emacs/site-lisp/color-theme" load-path)) | |
(defadvice replace-string (around turn-off-case-fold-search) | |
(let ((case-fold-search nil)) | |
ad-do-it)) |