Add the relevant webjars to your build file:
libraryDependencies += "org.webjars.bower" % "angular" % "1.3.15"
Add the resources to your server definition:
unfiltered.netty.Server
import scalaz.effect.IO | |
trait ItemSelector[ItemType] extends StatefulWidget[ | |
ItemSelectorProps[ItemType], | |
ItemSelectorState[ItemType] | |
] | |
{ | |
override def initialState = P => ItemSelectorState(P.selected) | |
} | |
case class ItemSelectorProps[ItemType]( |
Add the relevant webjars to your build file:
libraryDependencies += "org.webjars.bower" % "angular" % "1.3.15"
Add the resources to your server definition:
unfiltered.netty.Server
// Input Scala sources | |
def lightIsVisible(l: Vec, p: Vec) = { | |
val ray = Ray(p, l - p) | |
val length = (l - p).magnitude | |
var visible = true | |
for (i <- 0 until objects.length){ | |
val (o, s) = objects(i) | |
val t = o.intersectionTime(ray) | |
if (t > Epsilon && t < length - Epsilon){ | |
visible = false |
import React from "react/addons"; | |
import m from "./m"; | |
// https://www.youtube.com/watch?v=GOiVYbWJDOA | |
export default class CyaSS extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
hover: false, | |
active: false |
import japgolly.scalajs.react._, vdom.prefix_<^._, ScalazReact._ | |
import org.scalajs.dom.raw.HTMLSelectElement | |
import scala.scalajs.js | |
import scalaz.Equal | |
import scalaz.effect.IO | |
object SelectOne { | |
case class Choice[A](value : A, | |
label : String, |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
#!/bin/bash | |
find . -name '*.scala' -exec perl -pi -e ' | |
s/(?!<[a-zA-Z0-9_"])onblur(?![a-zA-Z0-9_"])/onBlur/g; | |
s/(?!<[a-zA-Z0-9_"])onchange(?![a-zA-Z0-9_"])/onChange/g; | |
s/(?!<[a-zA-Z0-9_"])onclick(?![a-zA-Z0-9_"])/onClick/g; | |
s/(?!<[a-zA-Z0-9_"])ondblclick(?![a-zA-Z0-9_"])/onDblClick/g; | |
s/(?!<[a-zA-Z0-9_"])onfocus(?![a-zA-Z0-9_"])/onFocus/g; | |
s/(?!<[a-zA-Z0-9_"])onkeydown(?![a-zA-Z0-9_"])/onKeyDown/g; | |
s/(?!<[a-zA-Z0-9_"])onkeyup(?![a-zA-Z0-9_"])/onKeyUp/g; |
(dominic: this list of papers was originally recommended to me by Brain Noguchi @bnoguchi, and was a great start to understanding distributed systems)
Here's a selection of papers that I think you would find helpful and interesting:
The seminal paper about event ordering and concurrency. The important result is that events in a distributed system define a partially ordered set. The connection to what we're working on is fundamental, as this defines how to detect concurrent updates. Moreover, the chosen algorithm to turn the partially ordered set into a totally ordered set defines the conflict resolution algorithm.
http://research.microsoft.com/en-us/um/people/lamport/pubs/time-clocks.pdf
import org.scalajs.dom | |
import org.scalajs.dom.console | |
import scala.scalajs.js | |
import scalaz.{Equal, State, StateT} | |
import scalaz.std.option.optionEqual | |
import scalaz.std.tuple.tuple2Equal | |
import scalaz.syntax.bind._ | |
import scalaz.effect.IO | |
import japgolly.scalajs.react._ | |
import japgolly.scalajs.react.vdom.ReactVDom._ |