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
{:paths ["."] | |
:deps {clansi/clansi {:mvn/version "1.0.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
// Faster solution for: | |
// http://www.boyter.org/2017/03/golang-solution-faster-equivalent-java-solution/ | |
// With threading. | |
// g++ -std=c++11 -Wall -Wextra -O3 -pthread | |
// On my computer (i5-6600K 3.50 GHz 4 cores), takes about ~160 ms after the CPU | |
// has warmed up, or ~80 ms if the CPU is cold (due to Turbo Boost). | |
// How it works: Start by generating a list of losing states -- states where the | |
// game can end in one turn. Generate a new list of states by running the game |
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
الرَّحْمَنُ | |
الرَّحِيمُ | |
الْمَلِكُ | |
الْقُدُّوسُ | |
السَّلاَمُ | |
الْمُؤْمِنُ | |
الْمُهَيْمِنُ | |
الْعَزِيزُ | |
الْجَبَّارُ | |
الْمُتَكَبِّرُ |
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 ast | |
from functools import partial, wraps | |
DEFAULT_INDENTATION = 2 | |
def enclose(parens,newline=False): | |
def decorate(func): | |
@wraps(func) | |
def wrapper(self,*args,**kwargs): |
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
(defn postfix [& e] | |
(reduce #(if (fn? %2) | |
(let [[l r & m] %] | |
(cons (%2 r l) m)) | |
(cons %2 %)) [] e)) |
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
(def jquery (js* "$")) | |
(defn show [msg] | |
(let [data-as-json ((js* "JSON.stringify") msg nil 4)] | |
((js* "alert") data-as-json))) | |
(defn make-js-map | |
"makes a javascript map from a clojure one" | |
[cljmap] | |
(let [out (js-obj)] |
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 jquerytest.core) | |
(def jquery (js* "$")) | |
(jquery | |
(fn [] | |
(-> (jquery "div.meat") | |
(.html "This is a test.") | |
(.append "<div>Look here!</div>")))) |
Note : This actually does work on a GSE Linux box as well.
First, prepare your system with all the libraries needed for Ruby / RVM. You will need to pay attention to the output from aptitude as it resolves the various dependencies. You may or may not have conflicts depending on your specific system setup. Make sure that you agree with what aptitude is about to do before proceeding.
sudo aptitude install build-essential bison openssl libreadline6 libreadline6-dev curl git
sudo aptitude install zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev
sudo aptitude install sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev subversion
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
;; When executed, this file will run a basic web server | |
;; on http://localhost:8080, which will tell you how many | |
;; times you have visited the page. | |
(ns ring.example.session | |
(:use ring.middleware.session | |
ring.util.response | |
ring.adapter.jetty)) | |
(defn handler [{session :session, uri :uri}] |
NewerOlder