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
namespace :export_import do | |
desc 'link ~/Export_Import to ~/mdm/current/script/export_import' | |
task :link, :roles => :control do | |
exp_imp_link = "#{home}/Export_Import" | |
run <<"END_OF_RUN" | |
if [ ! -L #{exp_imp_link} ]; then | |
if [ -e #{exp_imp_link} ]; then | |
rm -rf #{exp_imp_link}.backup | |
mv #{exp_imp_link} #{exp_imp_link}.backup | |
fi |
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 'fog_factor' | |
require 'test/unit' | |
class FogFactorTest < Test::Unit::TestCase | |
EPSILON = 0.01 | |
def test_syllable_count | |
words = { | |
'tame' => 1, |
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 FogFactor | |
class << self | |
def syllable_count(raw_word) | |
word = raw_word.gsub(/[^a-zA-Z]/,'') | |
syllables = word.scan(/[^aeiouy]+y|[^aeiouy]*(ai|au|ea|ee|ei|ie|io|oa|oi|oo|ou|[aeiou])|([^aeiouy]+|y)(ai|au|ea|ee|ei|ie|io|oa|oi|oo|ou|[aeiou])/i) | |
if syllables.size > 1 and word.match(/(e|es)$/) | |
syllables.size - 1 | |
else | |
syllables.size |
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
Macintosh-3:Clojure clark$ ls | |
clojure clojure.jar jline-0.9.91 jline-0.9.91.jar jline-0.9.91.zip | |
Macintosh-3:Clojure clark$ java -cp clojure.jar clojure.lang.Repl | |
Clojure 1.0.0- | |
user=> (+ 1 1) | |
2 | |
user=> ^D | |
Macintosh-3:Clojure clark$ java -cp jline-0.9.91.jar:clojure.jar jline.ConsoleRunner clojure.lang.Repl | |
Exception in thread "main" java.lang.ClassNotFoundException: clojure.lang.Repl | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:200) |
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
1019c1019 | |
< inhibit_window_system = 0; | |
--- | |
> inhibit_window_system = 1; | |
1057a1058,1063 | |
> /* x-windows now disabled by default, but this will re-enable */ | |
> if (argmatch (argv, argc, "-x", "--x-windows", 7, NULL, &skip_args) | |
> || argmatch (argv, argc, "-x", "--x-windows", 7, NULL, &skip_args)) | |
> inhibit_window_system = 0; | |
> |
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
bash-3.2$ io | |
Io 20090105 | |
Io> respond_to := method( o, m, retv := true; e := try( o m ); e catch(Exception, if( e error containsSeq(" does not respond to "), retv = false)); retv) | |
==> method(o, m, | |
retv := true; e := try(o m); e catch(Exception, if(e error containsSeq(" does not respond to "), retv = false)); retv | |
) | |
Io> O := Object clone | |
==> O_0x100441870: | |
type = "O" |
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
#include "hashtable.h" | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
void | |
hashtable_error(char* msg) { | |
puts(msg); | |
} |
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
#ifndef _hashtable_h_ | |
#define _hashtable_h_ 1 | |
typedef struct hashtable_list_item { | |
char* key; | |
char* value; | |
struct hashtable_list_item* next; | |
} hashtable_list_item; | |
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
$ uname -v | |
Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 | |
$ php --version | |
PHP 5.3.4 (cli) (built: Dec 15 2010 12:15:07) | |
$ php -a | |
Interactive mode enabled | |
<? |
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
(defun undo-only (&optional arg) | |
"Undo some previous changes. | |
Repeat this command to undo more changes. | |
A numeric ARG serves as a repeat count. | |
Contrary to `undo', this will not redo a previous undo." | |
(interactive "*p") | |
(let ((undo-no-redo t)) | |
(undo arg) | |
;; assume undo succeeded and overwrite | |
;; what it wrote. |
OlderNewer