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
if exists('b:did_after_ftplugin_clojure') | |
finish | |
endif | |
let b:did_after_ftplugin_clojure = 1 | |
let s:save_cpo = &cpo | |
set cpo&vim | |
setl tabstop=2 expandtab shiftwidth=2 softtabstop=2 smarttab | |
if executable('lein') && filereadable('project.clj') |
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
if exists("g:loaded_syntastic_clojure_nrepl_checker") | |
finish | |
endif | |
let g:loaded_syntastic_clojure_nrepl_checker=1 | |
function! SyntaxCheckers_clojure_nrepl_IsAvailable() | |
return executable('lein') && filereadable('project.clj') | |
endfunction | |
function! SyntaxCheckers_clojure_nrepl_GetLocList() |
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
function! s:run_tests(filename) | |
let template = '(require ''clojure.tools.namespace) (require ''clojure.test) (let [namespaces (clojure.tools.namespace/find-namespaces-in-dir (java.io.File. "%s"))] (doseq [ns namespaces] (prn ns) (require ns :reload) (if (re-find #"-test\z" (name ns)) (clojure.test/run-tests ns) (try (let [test-ns (symbol (str (name ns) "-test"))] (prn test-ns) (require test-ns :reload) (clojure.test/run-tests test-ns)) (catch Exception e (.getMessage e))))))' | |
let exp = printf(template, escape(a:filename, '"\')) | |
call fireplace#session_eval(exp) | |
endfunction | |
autocmd! BufWritePost *.clj call s:run_tests(expand("<afile>")) |
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 System.Environment | |
import System.IO | |
import System.Exit | |
import Control.Monad (filterM) | |
import qualified Data.Text as T | |
import qualified Data.Text.Lazy as TL | |
import qualified Data.Text.ICU.Regex as TIR | |
import qualified Data.Text.Lazy.IO as TILO | |
main :: IO () |
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 qualified System.Environment as SE | |
import qualified System.IO as SIO | |
import qualified Data.Text as T | |
import qualified Data.Text.ICU.Regex as TIR | |
import qualified Data.Text.IO as TIO | |
import Control.Monad (unless, when) | |
main :: IO () | |
main = do | |
args <- SE.getArgs |
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
#!/usr/bin/env ruby | |
# -*- encoding: utf-8 -*- | |
require 'rexml/document' | |
require 'cgi' | |
require 'time' | |
DT_TEMPLATE=<<EOS | |
<DT><A HREF="%s" ADD_DATE="%d" PRIVATE="0" TAGS="%s">%s</A> | |
EOS |
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
(ns lucene_gosen_test.core (:gen-class)) | |
(import java.util.Collections) | |
(defn -main [& args] | |
(println (first args)) | |
(with-open [reader (new java.io.StringReader (first args))] | |
(let [ | |
analyzer (new org.apache.lucene.analysis.ja.JapaneseAnalyzer org.apache.lucene.util.Version/LUCENE_35 Collections/EMPTY_SET Collections/EMPTY_SET Collections/EMPTY_SET "/home/haruyama/work/solr/dic/solr/conf/dic") | |
ts (.tokenStream analyzer "dummy" reader) | |
termAtt (.getAttribute ts org.apache.lucene.analysis.tokenattributes.CharTermAttribute) | |
posAtt (.getAttribute ts org.apache.lucene.analysis.ja.tokenAttributes.PartOfSpeechAttribute) |
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 java.io.Reader; | |
import java.io.StringReader; | |
import org.apache.lucene.analysis.ja.JapaneseTokenizer; | |
public class LuceneGosenKuyoBug { | |
public static void main(String[] args) { | |
String s = ""; | |
int count = Integer.parseInt(args[1]); | |
for (int i = 0; i < count; ++i) { |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#include <gmp.h> | |
bool check_symmetry(mpz_t i) | |
{ | |
char* s = mpz_get_str(NULL, 10, i); | |
size_t len = strlen(s); |
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
(unify-match 1 '(? x) | |
(singleton-stream '())) | |
(unify-match '(? x) 1 | |
(singleton-stream '())) | |
(unify-match '(? x) '(? x) | |
(singleton-stream '())) | |
;(query-syntax-process '(?x ?x)) |