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 zow.core) | |
(def maps [{:a 1 :b 2} | |
{:a 11 :b 22 :c 5} | |
{:c 6 :a 7}]) | |
(defn my-merge-maps | |
[& maps] | |
(reduce (fn [accum [k v]] | |
(if (accum k) |
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 zow.core) | |
(def maps [{:a 1 :b 2} | |
{:a 11 :b 22 :c 5} | |
{:c 6 :a 7}]) | |
(defn my-merge-maps | |
[maps] | |
(apply merge-with | |
(fn [curr-val new-val] |
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 crunch-it.core | |
(:gen-class)) | |
(def sample-chars "abcdefghijkl0123456789") | |
(defn generate-random-strings | |
"Generates a list (`num` items long) of randomish 10-character strings." | |
[num] | |
(for [i (range num)] | |
(apply str (for [j (range 10)] |
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
;; I want `classrooms` (the accumulator) to end up looking like this: | |
;; {"A" #{"a" "d" "g" "j"} | |
;; "B" #{"b" "e" "h"} | |
;; "C" #{"c" "f" "i"}} | |
(defn distribute-students | |
[students teachers] | |
(let [classrooms (into {} (for [t teachers] [t #{}]))] | |
(loop [student-pool students ;; We'll pare this down as we go. | |
classrooms classrooms ;; We'll build this up as we go. | |
[curr-teacher & more] (cycle teachers)] ;; |
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 + [1 2 3 4 5] | |
[6 7 8 9 10]) | |
;; => ((+ 1 6) | |
; (+ 2 7) | |
; (+ 3 8) | |
; (+ 4 9) | |
; (+ 5 10)) | |
;;---------------------------------- |
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 perl | |
use Modern::Perl; | |
#use diagnostics; | |
use List::Util qw/max min sum/; | |
# TODO: more of the following code needs to be put into functions | |
if (@ARGV != 1) { | |
say "Please pass exactly one arg: the number of"; |
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
basics.md | |
pod.md | |
variables.md | |
numbers-and-math.md | |
strings-and-unicode.md | |
lists-and-arrays.md | |
hashes.md | |
types.md | |
context.md | |
nested-data-structures.md |
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
# Announce: Rakudo Perl 6 compiler, Development Release #NN ("NAME") | |
On behalf of the Rakudo development team, I'm proud to announce the | |
MONTH 2013 release of Rakudo Perl #NN "NAME". Rakudo is an | |
implementation of Perl 6 on the Parrot Virtual Machine (see | |
<http://www.parrot.org>). The tarball for this release is available | |
from <http://rakudo.org/downloads/rakudo/>. | |
Please note: This announcement is not for the Rakudo Star | |
distribution[^1] --- it's announcing a new release of the compiler |
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
# Announce: Rakudo Star | |
## A useful, usable, "early adopter" distribution of Perl 6 | |
On behalf of the Rakudo and Perl 6 development teams, I'm happy to | |
announce the MONTH 2013 release of "Rakudo Star", a useful and usable | |
distribution of Perl 6. The tarball for the MONTH 2013 release is | |
available from <http://rakudo.org/downloads/star/>. A Windows .MSI | |
version of Rakudo star will usually appear in the downloads area | |
shortly after the tarball release. |
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
hi | |
* first item in bulleted list | |
second paragraph of first item | |
code block | |
in first item | |
second paragraph in first item |
OlderNewer