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
class Semigroup a where | |
mappend :: a -> a -> a | |
class Semigroup a => Monoid a where | |
mempty :: a | |
mconcat :: [a] -> a | |
mconcat = foldr mappend mempty | |
instance Semigroup Int where |
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
map = [ | |
#general | |
{name: "Patient Control ID", value: nil}, | |
{name: "SSN", value: nil}, | |
{name: "Other ID", source: :ldap, source_name: "datatelid"}, | |
{name: "Last Name", source: :ldap, source_name: "sn"}, | |
{name: "First Name", source: :ldap, source_name: "givenName"}, | |
{name: "Middle Initial", source: :ldap, source_name: "initials", mapper: Proc.new {|v| v[0]}}, | |
{name: "Sex", source_name: "gender", source: :ods}, | |
{name: "Address", source: :ods, source_name: ["home_address_line_1","home_address_line_2"], mapper: Proc.new{|v| v.join " "}}, |
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 lisp-ch1) | |
(def self-evaluating? | |
(some-fn number? string? char? | |
true? false? vector?)) | |
(defn -atom? [s] | |
(or (self-evaluating? s) | |
(symbol? 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
(ns sudoku | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn get-square [rows x y] | |
(for [x (range x (+ x 3)) | |
y (range y (+ y 3))] | |
(get-in rows [x y]))) | |
(defn init [vars hints] |
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
#include <iostream> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <fstream> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
ofstream outfile; |