Skip to content

Instantly share code, notes, and snippets.

View ebrugulec's full-sized avatar
💃

Ebru Gulec ebrugulec

💃
  • Berlin, Germany
View GitHub Profile
import React from 'react';
class Contacts extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div></div>
);
import React from 'react';
const Contacts = React.createClass({
render() {
return (
<div></div>
);
}
});
object HelloWorld {
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}
trait Planar {
def height: Int
def width: Int
def surface = height * width
}
Import week3._
object scratch{
new week3.Rational(1,2)
}
Import week3.Rational
object scratch{
new week3.Rational(1,2)
}
object scratch{
new week3.Rational(1,2)
}
package classes
object rationals {
val x = new Rational(1,3)
val y = new Rational(5,7)
val z = new Rational(3,2)
x - y - z
x + y
y + y
package classes
object rationals {
val x = new Rational(1,3)
val y = new Rational(5,7)
val z = new Rational(3,2)
x.less(y)
x.max(y)
}
class Rational(x:Int, y:Int)
{
private def gcd(a: Int, b:Int): Int = if (b == 0) a else gcd(b, a%b)
private val g = gcd(x,y)
def numer = x / g
def denom = y / g
def less(that: Rational) = numer * that.denom < that.numer * denom
def add(that: Rational) =