This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
) | |
type Mutator interface { | |
Change() | |
AnotherChange() | |
} |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"math" | |
"time" | |
) | |
type Receiver interface { | |
Receive(data interface{}) |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"runtime" | |
) | |
func catchPanic(err *error, functionName string) { | |
// recover gets the last panic |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
) | |
type Action struct { | |
Next interface{} | |
f func() | |
} |
This file contains hidden or 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
object Main { | |
trait A { | |
val age = 18 | |
} | |
trait B { | |
val name = "Lucas" | |
} |
This file contains hidden or 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
.data ## Data declaration section | |
## String to be printed: | |
prompt: .asciiz "Enter a non-negative number:\n" | |
result: .asciiz "\nThe factorial is: " | |
.text | |
main: | |
li $v0, 4 | |
la $a0, prompt | |
syscall |
This file contains hidden or 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 com.twitter.finagle.Http; | |
import com.twitter.finagle.ListeningServer; | |
import com.twitter.finagle.Service; | |
import com.twitter.finagle.http.HttpMuxer; | |
import com.twitter.util.Await; | |
import com.twitter.util.Future; | |
import java.net.InetSocketAddress; | |
import static java.nio.charset.StandardCharsets.UTF_8; | |
import static org.jboss.netty.buffer.ChannelBuffers.copiedBuffer; | |
import org.jboss.netty.handler.codec.http.*; |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
type VectorClock struct { | |
values map[string]int64 | |
} |
This file contains hidden or 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 Test { | |
private var y = 0 | |
def x = y | |
def x_=(v: Int) = y = v | |
} | |
val test = new Test() | |
test.x = 12 |
This file contains hidden or 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.scalatest.FlatSpec | |
import scala.concurrent.{Await, Future, Promise} | |
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
class MainSpec extends FlatSpec { | |
"accounts balances" should "be equal before and after transfers" in { |