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
#SingleInstance Force | |
#MaxHotkeysPerInterval 99999 | |
#IfWinActive ahk_class DarkSouls2 | |
; AHL script to remove input lag from DarkSouls2 PC, and add hotkeys for | |
; Guard break / Jump Attack | |
; | |
; Current settings (some can be easily changed) | |
; LMB / RMB = normal attacks | |
; Shift + LMB / RMB = strong attacks |
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
extern crate serialize; | |
extern crate time; | |
// use std::str; | |
// use std::rand; | |
use std::io::{File, BufferedReader}; | |
use std::collections::TreeMap; | |
use serialize::{json, Encodable, Decodable}; | |
#[deriving(Decodable, Encodable, Show)] |
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 lazybot.plugins.number-trivia | |
(:use [lazybot registry] | |
[lazybot.utilities]) | |
(:require [clj-http.client :as client])) | |
; http://numbersapi.com/ | |
; from API docs: | |
;;; Just hit http://numbersapi.com/number/type to get a plain text response, where | |
;;; type is one of trivia, math, date, or year. Defaults to trivia if omitted. | |
;;; number is |
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 lazybot.plugins.dice | |
(:use lazybot.registry) | |
(:use lazybot.utilities) | |
(:require [clojure.string :as string]) | |
(:require [instaparse.core :as insta]) | |
(:require [clojure.core.match :refer [match]])) | |
; parser expects input like | |
; "3d20 + 2d4 + 10" | |
; and produces a list of structures like |
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
describe("Player", function() { | |
var player; | |
// hook before each test | |
beforeEach(function(){ | |
player = new Player(); | |
spyOn(loading,'show'); // intercept and record calls to loading.show | |
player.play(); | |
}); | |
// actual specifications/tests |
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
;; http://www.johndcook.com/blog/2012/05/08/a-knights-random-walk/ | |
;; | |
;; Start a knight at a corner square of an otherwise-empty chessboard. Move the | |
;; knight at random by choosing uniformly from the legal knight-moves at each | |
;; step. What is the mean number of moves until the knight returns to the | |
;; starting square? | |
(def MAXPOS 7) | |
; (pos, move) -> pos |
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 python | |
""" This is a simulation of ants moving woodchips around | |
using the pyscape classes. Hopefully it demonstrates the | |
construction of central clusters using only decentralized | |
algorithms followed by autonomous agents. | |
We begin with a scattering of woodchips across the grid. | |
Ants randomly walk around, following a simple rule: | |
if you see a woodchip: |
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
-- a more verbose and explanatory version of this one-liner | |
-- main = interact $ unlines . map reverse . lines | |
-- we're going to use some library functions: | |
-- lines :: String -> [String] | |
-- unlines :: [String] -> String | |
-- reverse :: [a] -> [a] | |
-- reverse works on arbitrary lists, and Strings are [Char]. | |
-- let ... in allows you to bind names to values, |
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
nathan@hugin:~/p/haskell/tidbits$ cat quine.hs | |
q a b c=putStrLn $ b ++ [toEnum 10,'q','('] ++ show b ++ [','] ++ show c ++ [','] ++ show a ++ [')'] | |
main=q "q a b c=putStrLn $ b ++ [toEnum 10,'q','('] ++ show b ++ [','] ++ show c ++ [','] ++ show a ++ [')']" "def q(a,b,c):print b+chr(10)+'q('+repr(b)+','+repr(c)+','+repr(a)+')'" "def e(x) return 34.chr+x+34.chr end;def q(a,b,c) print b+10.chr+'main=q '+e(b)+' '+e(c)+' '+e(a)+' '+10.chr end" | |
nathan@hugin:~/p/haskell/tidbits$ runghc quine.hs | |
def q(a,b,c):print b+chr(10)+'q('+repr(b)+','+repr(c)+','+repr(a)+')' | |
q("def q(a,b,c):print b+chr(10)+'q('+repr(b)+','+repr(c)+','+repr(a)+')'","def e(x) return 34.chr+x+34.chr end;def q(a,b,c) print b+10.chr+'main=q '+e(b)+' '+e(c)+' '+e(a)+' '+10.chr end","q a b c=putStrLn $ b ++ [toEnum 10,'q','('] ++ show b ++ [','] ++ show c ++ [','] ++ show a ++ [')']") | |
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 python | |
import random | |
from math import * | |
# This is an attempt at solving the travelling salesperson problem | |
# with simulated annealing. I tried this once in matlab and it sucked. | |
# a map is a list of tuples, one tuple for each city. | |
# each tuple represents the (x,y) location of a city on the map. |
OlderNewer