function reducerFn(output, value) {
// reducer functions know how to build a structure when repeatedly given
// that structure and values (think of it as 'builder')
return output
}
function reduceFn(collection, reducerFn, output) {
(ns om-data.core | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true] | |
[datascript :as d])) | |
(enable-console-print!) | |
(def schema {}) | |
(def conn (d/create-conn schema)) | |
% Run missionaries(((3,3),(0,0),1),[],Path). | |
validMove(Position, Visited):- | |
notMember(Position,Visited), | |
positiveCount(Position), | |
noEatingAnyone(Position). | |
positiveCount(((LeftCannibals,LeftMissionaries), (RightCannibals,RightMissionaries),_)):- | |
LeftCannibals >=0, | |
LeftMissionaries >=0, |
(ns react-cljs.core | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [om.core :as om] | |
[om.dom :as dom :include-macros true] | |
[cljs.core.async :refer [>! <! chan put! sliding-buffer]])) | |
(enable-console-print!) | |
(def app-state | |
(atom {:counters (into [] (map (fn [n] {:id n :count 0}) (range 10)))})) |
In Restful Web APIs it is argued that one of the major problems with APIs (arguably regardless of whether they are RESTful) is that they don't convey enough semantics so a client unfamiliar with implementation details (media type, URL structures, HTTP methods etc.) could still make use of it. On the "human web" this isn't really a problem, as the book rightly points out, because humans are much better at making decisions despite considerable semantic gaps. For example, if a site contains a link with the text:
Click here to buy our most popular product!
It's easy for us to understand that we can click on it to purchase an item; a computer however would just see some additional markup and realize it's a link, but not where it points to, why or what it is:
(ns react-cljs.core | |
(:require React)) | |
(declare render) | |
(defn handle-change [e] | |
(render {:text (.. e -target -value)})) | |
(defn render [{:keys [text]}] | |
(React/renderComponent |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript" src="d3.js"></script> | |
<script type="text/javascript" src="list.js"></script> | |
<title>d3 demo</title> | |
</head> | |
<body onload="init()"> | |
<ul> |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: