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
#!/bin/bash | |
TOMCAT=apache-tomcat-7.0.23 | |
TOMCAT_WEBAPPS=$TOMCAT/webapps | |
TOMCAT_CONFIG=$TOMCAT/conf/server.xml | |
TOMCAT_START=$TOMCAT/bin/startup.sh | |
TOMCAT_ARCHIVE=$TOMCAT.tar.gz | |
TOMCAT_URL=http://apache.mirrorcatalogs.com/tomcat/tomcat-7/v7.0.23/bin/$TOMCAT_ARCHIVE | |
WAR_FILE=whatever.war |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Flotr2 Issue #89 (Date: Sat, 19 May 2012 22:48:31 GMT)</title> | |
<script src="http://requirejs.org/docs/release/1.0.8/comments/require.js"></script> | |
<script src="https://raw.github.com/HumbleSoftware/Flotr2/master/flotr2.js"></script> | |
</head> | |
<body> | |
<p>Look at your console.</p> | |
<p>In Chrome, I get <code>Uncaught ReferenceError: bean is not defined</code> on line 1359. |
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 Data.List | |
countPairs :: (Integral a, Num b) => [a] -> a -> b | |
countPairs nums target = counter (sort nums) target | |
where | |
counter :: (Integral a, Num b) => [a] -> a -> b | |
counter [] _ = 0 | |
counter [_] _ = 0 | |
counter sn t | |
| s == t = 1 + counter (init (tail sn)) t |
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 Data.List | |
makeLines :: Int -> String -> String | |
makeLines len = (intercalate "\n") . (foldl (buildLine len) [""]) . words | |
where | |
buildLine :: Int -> [String] -> String -> [String] | |
buildLine len currLines word = | |
if length newLine > len | |
then currLines ++ [word] | |
else ls ++ [newLine] |
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
[color] | |
ui = true | |
[alias] | |
lol = log --graph --decorate --pretty=oneline --abbrev-commit --all | |
st = status | |
co = checkout | |
ci = commit | |
count = shortlog -sn | |
lost = log --stat | |
patchlog = log --patch |
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
euler1 :: Int | |
euler1 = sum [x | x <- [1..999], rem x 3 == 0 || rem x 5 == 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
fib :: Int -> Int | |
fib 1 = 1 | |
fib 2 = 2 | |
fib n = fib (n - 1) + fib (n - 2) | |
euler2 = sum $ takeWhile (<4000000) $ filter (even) [fib x | x <- [1..]] |
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
leastDivisor :: Integer -> Integer -> Integer | |
leastDivisor divisor n | |
| rem n divisor == 0 = divisor | |
| divisor^2 > n = n | |
| otherwise = leastDivisor (divisor+1) n | |
factors :: Integer -> [Integer] | |
factors 1 = [] | |
factors n = ld : factors (n `div` ld) | |
where ld = leastDivisor 2 n |
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
findPalindrome :: Int | |
findPalindrome = maximum [x | y <- [100..999], z <- [y..999], let x = y * z, let s = show x, s == reverse 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
import Data.List (foldr1) | |
euler5 :: Int | |
euler5 = foldr1 lcm [1..20] |
OlderNewer