# I am a scientist who has been using R for about 2 years. Today I achieved a measure of enlightenment into | |
# the zen of R, and I want to share it with you. | |
# I was simulating a set of independent random walks, which are formed by a multiplicative process. Here is | |
# the code I had built up over a few months of working on it and modifying it on and off as research | |
# questions changed: | |
TimeSteps <- 1000 | |
Walks <- 100 | |
ErrorMagnitude <- 0.03 |
; Copyright (c) Daniel Kwiecinski. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
; which can be found in the file epl-v10.html at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
; | |
; Example of extending native Java array types to Clojure protocols |
This is the example that comes with the reagent template converted to use HTML5 based history. This means there are no #
in the urls.
I just got this working, so there might be better approaches
The changes are
- use
goog.history.Html5history
instead ofgoog.History
- listen to clicks on the page, extract the path from them, and push them onto the history
- listen to history changes, and have secretary do its thing in response
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
import shapeless._ | |
import scalaz._ | |
import Scalaz._ | |
object console extends App { | |
trait Foo[A] { | |
type B | |
def value: B |
If you're coming to the Property-Based TDD As If You Meant It Workshop, you will need to bring a laptop with your favourite programming environment, a property-based testing library and, depending on the language, a test framework to run the property-based-tests.
Any other languages or suggestions? Comment below.
.NET (C#, F#, VB)
Python:
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
module Counter exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick) | |
-- MODEL | |
type alias Model = Int |