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
(defproject eisentower-todo "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.9.0-alpha12"]] | |
:main ^:skip-aot eisentower.core | |
:target-path "target/%s" | |
:profiles {:uberjar {:aot :all} | |
:dev {:dependencies [[org.clojure/test.check "0.9.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
module PNM where | |
{- | |
http://people.sc.fsu.edu/~jburkardt/data/pgmb/pgmb.html | |
run parser: do { s <- readFile "feep.pgm"; putStrLn (show (parseP5_t2 (L8.pack s))); } | |
-} | |
import qualified Data.ByteString.Lazy.Char8 as L8 | |
import qualified Data.ByteString.Lazy as L |
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
*Beautiful Strings* | |
When John was a little kid he didn't have much to do. There was no internet, no Facebook, and no programs to hack on. So he did the only thing he could... he evaluated the beauty of strings in a quest to discover the most beautiful string in the world. | |
Given a string s, little Johnny defined the beauty of the string as the sum of the beauty of the letters in it. | |
The beauty of each letter is an integer between 1 and 26, inclusive, and no two letters have the same beauty. Johnny doesn't care about whether letters are uppercase or lowercase, so that doesn't affect the beauty of a letter. (Uppercase 'F' is exactly as beautiful as lowercase 'f', for example.) | |
You're a student writing a report on the youth of this famous hacker. You found the string that Johnny considered most beautiful. What is the maximum possible beauty of this string? |
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
$ php -a | |
Interactive shell | |
php > $obj = new stdClass; | |
php > $numKey = 123; | |
php > $obj->{$numKey} = 'foo'; | |
php > $ary = (array) $obj; | |
php > var_dump($obj, $ary); | |
class stdClass#1 (1) { | |
public $123 => |
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
module MyJson where | |
import Data.List | |
data JValue = JString String | |
| JBool Bool | |
| JNumber Double | |
| JNull | |
| JList [JValue] | |
| JObject [(String, JValue)] |
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
io | |
redis | |
*.hi | |
*.o | |
bin | |
config | |
vendor |
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
-- array($year, $model, $price) | |
-- (Int, String, Int) | |
type Price = Int | |
data CarType = Ford | Chevrolet deriving (Show) | |
data Vehicle = Car Int CarType Price | |
| Bicycle Price | |
| Motor Price deriving (Show) | |
data Accessory = SteeringWheel Price | Brake Price deriving (Show) | |
type Store = [Vehicle] |
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
-- array($year, $model, $price) | |
-- (Int, String, Int) | |
type Price = Int | |
data CarType = Ford | Chevrolet deriving (Show) | |
data Vehicle = Car Int CarType Price | |
| Bicycle Price | |
| Motor Price deriving (Show) | |
data Accessory = SteeringWheel Price | Brake Price deriving (Show) | |
type Store = [Vehicle] |
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
-- array($year, $model, $price) | |
-- (Int, String, Int) | |
type Price = Int | |
data CarType = Ford | Chevrolet deriving (Show) | |
data Vehicle = Car Int CarType Price | |
| Bicycle Price deriving (Show) | |
type Store = [Vehicle] | |
storePrice :: Store -> Price |
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
-- az elso nyers megvalositas szambol -> szoveg | |
fizzbuzzText n = | |
if n `mod` 3 == 0 then | |
if n `mod` 5 == 0 then | |
"FizzBuzz" | |
else | |
"Fizz" | |
else | |
if n `mod` 5 == 0 then | |
"Buzz" |
NewerOlder