Skip to content

Instantly share code, notes, and snippets.

View mavericklou's full-sized avatar

Maverick Lou mavericklou

View GitHub Profile
@mavericklou
mavericklou / sql_secondary_school_result
Last active August 29, 2015 14:14
secondary-school-polygons reloaded 2015-01-29
mastermind_production=# select count(*) from task_polygon where worktype_id like 'secondary-school-polygons';
count
-------
38990
(1 row)
mastermind_production=# delete from task_polygon where worktype_id like 'secondary-school-polygons';
DELETE 38990
mastermind_production=# select count(*) from task_polygon;
count
@mavericklou
mavericklou / zixuan.html
Created August 25, 2014 09:45
stock zixuan
<html>
<head>
<!-- <meta http-equiv="content-type" content="text/html; charset=UTF-8"> -->
<meta http-equiv="refresh" content="60" >
<style type="text/css">
.stock { }
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
@mavericklou
mavericklou / test_many2many.clj
Created August 15, 2014 09:28
I suppose #1 and #3 should be working
(ns mastermind.test.korma_test
(:use korma.core
korma.db
clojure.test))
(defn connect-database []
(let [config-map {:db "korma_test"
:user "postgres"
:password "postgres"
:host "localhost"
@mavericklou
mavericklou / compile and run
Last active December 15, 2015 23:58
init pom.xml file for using factual-java-driver
mvn archetype:generate \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DgroupId=com.mycompany.app \
-DartifactId=my-app
mvn clean compile package
java -cp target/my-app-1.0-SNAPSHOT-jar-with-dependencies.jar com.mycompany.app.App
@mavericklou
mavericklou / core.clj
Created July 16, 2012 05:46
my homework
(ns wordcount.core
(:use [clojure.java.io :only [reader]]
[clojure.string :only [split]]))
(defn- word-count [lines]
(reduce #(+ %1 (count (split %2 #" "))) 0 lines))
(defn- tab-delimited? [lines]
(loop [rest-lines lines columns 0]
(if (first rest-lines)
@mavericklou
mavericklou / core.clj
Created March 16, 2012 06:43
aleph 0.2.1-alpha2-SNAPSHOT hang when compile
(ns alephtest.core
(:use aleph.core
aleph.http
lamina.core
))
(defn put-handler
[ch request]
(println "######")
(let [is (:body request)
@mavericklou
mavericklou / 6036 compile process
Created March 8, 2012 03:05
leinginen hang on compile after update to aleph 2.0.1-alpha2-SNAPSHOT March 07
2012-03-07 19:04:16
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode):
"Attach Listener" daemon prio=10 tid=0x0000000040456800 nid=0x1b7b waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Thread-2" prio=10 tid=0x00007f5f04cd2800 nid=0x1b45 runnable [0x00007f5f02f5b000]
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:220)