(ns x.y | |
(:use [plumbing.core]) ;; Just for the map-vals | |
(:require [clojure.walk :refer [postwalk prewalk prewalk-demo postwalk-demo]] | |
[clojure.core.match :refer [match]] | |
[schema.utils :refer [named-error-explain validation-error-explain]] | |
[schema.core :as s]) | |
(:import (schema.utils NamedError ValidationError))) | |
;; Partially FROM: | |
;; https://github.com/puppetlabs/clj-schema-tools |
(defn permutations [s] | |
(lazy-seq | |
(if (seq (rest s)) | |
(apply concat (for [x s] | |
(map #(cons x %) (permutations (remove #{x} s))))) | |
[s]))) | |
(defn cost [proposoals s] | |
{:permutation s | |
:cost (apply + (map-indexed (fn [project candidate-str] |
#!/usr/bin/env bash | |
# | |
# Copy env variables to app module gradle properties file | |
# | |
set +x // dont print the next lines on run script | |
echo $(printenv) | tr ' ' '\n' > app/gradle.properties | |
set -x |
Hi! Today I'll walk you through Lucene search engine syntax to make the best use of clojars website.
We can see a search query as a bunch of terms and operators, let's explore several ways to use our search engine:
There are 2 types of terms:
- A
term
is a single word such asoauth
orsql
- A
phrase
is just a bunch of words grouped by quotes, like"sql builder"
#include <WiFi.h> | |
#include <WiFiClient.h> | |
#include <WiFiServer.h> | |
#include <WiFiUdp.h> | |
#include <SPI.h> | |
char ssid[] = "NULL_INDUS"; // your network SSID (name) | |
char pass[] = "90046686"; // your network password |
# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/Security_Guide/s1-server-ports.html | |
# sample target port 834 | |
nmap -sT -O localhost | |
cat /etc/services | grep 834 | |
netstat -anp | grep 834 | |
lsof -i | grep 834 |
# sd formatter and overwrite sd card | |
# https://www.sdcard.org/downloads/formatter_4/eula_mac/ | |
# or gparted on linux | |
diskutil list | |
diskutil unmountDisk /dev/disk[2] | |
sudo dd bs=1m if=~/Downloads/software/iot/2016-05-27-raspbian-jessie.img of=/dev/rdisk[2] |
Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
(my response to https://twitter.com/apotonick/status/717105889845624832)
I haven't yet came across readily available resources for large-scale application architecture for Elixir apps. I found Programming Phoenix to be a good start for that though. And there's ~30 years of knowledge in the Erlang land :)
For web apps, I found the abstractions that Elixir/Phoenix provides to be really helpful. Indeed, the list below is somewhat ORM focused.
In the small, Ecto.Schema, Ecto.Query, Ecto.Changeset, and Phoenix.View allow me to build highly composable and side-effect free modules. I can have many schemas, changesets and queries all interacting with the same underlying DB table(s) if I want to. Most of the side-effects (through Ecto.Repo for DBs) are usually in the Phoenix.Controller (or other Plugs).