Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View SethTisue's full-sized avatar

Seth Tisue SethTisue

View GitHub Profile
scala> class C
defined class C
scala> implicit val c = new C
c: C = C@33833882
scala> def foo(x: Int)(implicit c: C) = x + 1
foo: (x: Int)(implicit c: C)Int
scala> foo(3)
@SethTisue
SethTisue / 2014.txt
Created February 4, 2014 20:26
NE Scala 2014 talk winners
the people have spoken
45-minute talks:
- Heather Miller, “Academese to English: Scala's Type System, Dependent Types and What It Means To You”
- Daniel Spiewak, “May Your Data Ever Be Coherent”
- Eugene Burmako & Lars Hupel, “Macros vs. Types”
30-minute talks:
- Eugene Yokota, “Learning Scalaz”
- P. Oscar Boykin, “Summingbird: a streaming map-reduce API for Storm, Hadoop and more”
@SethTisue
SethTisue / gist:9013595
Created February 15, 2014 02:18
SleepAdd in NetLogo
to-report add [a b]
reset-timer
wait a
wait b
report timer
end
observer> show add 2 2
observer: 4
observer> show add 2 2
// pseudo-Scala with nonexistent "yield" in while
val generator =
while(true) {
val in = readLine()
if (in == null)
break
yield in
}
% cd /usr/local/nescala
% echo full details at nescala.org (mobile-friendly)
zsh: number expected
% scala
Welcome to Scala
scala> :power
** Power User mode enabled
scala> ^Z
zsh: suspended scala
@SethTisue
SethTisue / scalawags-14.md
Last active August 29, 2015 13:57
Scalawags #14

Scalawags #14: Shapelessless

in which Shapeless is only threatened to be discussed.

music and dancing (0:00)

Scala 2.10.4 and 2.11.0-RC3, Java 8 (2:30)

  • Josh & co have 900,000 lines of open source Scala code compiling on 2.11.0-RC3
  • does 2.10.4 support Java 8? as far as we know. (Daniel had bytecode validation problems with 2.10.1)
@SethTisue
SethTisue / proposal.md
Last active August 29, 2015 13:58
NetLogo: proposal for splitting primitive classes into front-end and back-end parts

Old

combined front/back end

package org.nlogo.prim

class _breedvariable(name: String) extends nvm.Reporter {
  def syntax = core.Syntax.reporterSyntax(...)
  def toString = s"${super.toString}:$name"

Modeling the Transition to Public School Choice
http://jasss.soc.surrey.ac.uk/17/2/3.html
Spiro Maroulis, Eytan Bakshy, Louis Gomez and Uri Wilensky
"The models in this paper were implemented using the NetLogo multi-agent programmable modeling environment"

Optimization of Agent-Based Models: Scaling Methods and Heuristic Algorithms http://jasss.soc.surrey.ac.uk/17/2/6.html
Matthew Oremland and Reinhard Laubenbacher
"NetLogo was chosen as the modeling platform in this study". two models from NetLogo's Sample Models were studied: Rabbits Grass Weeds and Sugarscape

// method bodies in Foo are just dummies
scala> class Foo[T] { def parse(s: String): T = null.asInstanceOf[T] ; def format(t: T): String = ""}
defined class Foo
scala> class C; class D
defined class C
defined class D
scala> val foos = List[Foo[_]](new Foo[C], new Foo[D])
@SethTisue
SethTisue / scalawags-15.md
Last active August 29, 2015 14:00
Scalawags #15

Scalawags #15

starring an Englishman and three hicks from flyover country who don't know Latin

Intro (0:00)

  • Daniel mistakenly calls Dick "Bill"
  • Josh is so excited about Scala 2.11 his tongue is stuck permanently out

Scala 2.11 announced (4:40)