Skip to content

Instantly share code, notes, and snippets.

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
require 'fog_factor'
require 'test/unit'
class FogFactorTest < Test::Unit::TestCase
EPSILON = 0.01
def test_syllable_count
words = {
'tame' => 1,
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
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)
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;
>
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"
#include "hashtable.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
void
hashtable_error(char* msg) {
puts(msg);
}
#ifndef _hashtable_h_
#define _hashtable_h_ 1
typedef struct hashtable_list_item {
char* key;
char* value;
struct hashtable_list_item* next;
} hashtable_list_item;
@clarkgrubb
clarkgrubb / gist:1157508
Created August 19, 2011 18:00
isset is the logical negation of is_null
$ 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
<?
(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.