This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# function *foo(x) { | |
# var y = 2 * (yield (x + 1)); | |
# var z = yield (y / 3); | |
# return (x + y + z); | |
# } | |
# | |
# var it = foo( 5 ); | |
# | |
# // note: not sending anything into `next()` here |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule XmlParsing do | |
import Record, only: [defrecord: 2, extract: 2] | |
defrecord :xmlElement, extract(:xmlElement, from_lib: "xmerl/include/xmerl.hrl") | |
defrecord :xmlText, extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl") | |
def xml do | |
""" | |
<html> | |
<head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (text, div, br) | |
import Dict exposing (Dict) | |
times3 : Maybe Int -> Maybe Int | |
times3 x = | |
case x of | |
Just num -> Just <| num * 3 | |
_ -> Nothing | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.SparkContext | |
import org.apache.spark.SparkContext._ | |
import org.apache.spark.SparkConf | |
object SimpleApp { | |
def main(args: Array[String]) { | |
val conf = new SparkConf().setAppName("Simple Application") | |
val sc = new SparkContext(conf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Table do | |
@moduledoc """ | |
Plays Ping Pong between a local and remote machine. | |
Start both machines using short names: | |
iex --sname node1 --cookie fudge | |
iex --sname node2 --cookie fudge | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaVersion": 2015, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, | |
"plugins": ["react", "prettier"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car { | |
constructor(doors = 4, state = "brand new", color = "silver") { | |
this.doors = doors | |
this.state = state | |
this.color = color | |
} | |
} | |
class Truck { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A basic Enum constructor function | |
const Enum = (...values) => { | |
let newEnum = {} | |
for (const value of values) { | |
Object.assign(newEnum, { | |
[value]: value | |
}) | |
} | |
return newEnum | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// Each car element accepts a visitor. | |
/// | |
trait CarElement { | |
fn accept(&self, visitor: &CarElementVisitor); | |
} | |
/// | |
/// Each visitor must deal with each element of a car. | |
/// | |
trait CarElementVisitor { |
OlderNewer