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 <UIKit/UIKit.h> | |
int main(int argc, char *argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
int retVal = UIApplicationMain(argc, argv, nil, nil); | |
[pool release]; | |
return retVal; | |
} |
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.scalatest.FlatSpec | |
import org.scalatest.matchers.ShouldMatchers | |
class StackSpec extends FlatSpec with ShouldMatchers { | |
"A Stack" should "pop values in last-in-first-out order" in { | |
val stack = new Stack[Int] | |
stack.push(1) | |
stack.push(2) | |
stack.pop() should equal (2) |
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 "ActionViewController.h" | |
@implementation ActionViewController | |
@synthesize startButton; | |
@synthesize stopOrContinueButton; | |
- (IBAction) startButtonPressed { | |
NSLog(@"start button pressed"); |
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
repositories { | |
.... | |
add(new org.apache.ivy.plugins.resolver.URLResolver()) { | |
name = "GitHub" | |
addArtifactPattern 'http://github.com/asikkema/adoptimizer/downloads/[organization]-[module]-[revision].[ext]' | |
} | |
} |
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
package com.agemooij.mongodb | |
import com.mongodb.casbah.Imports._ | |
trait MongoRepository { | |
protected val host = "localhost" | |
protected val port = 27017 | |
protected val databaseName = "agemooij" | |
protected val collectionName: String |
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
package com.agemooij.test | |
import java.util.Date | |
import org.junit.runner.RunWith | |
import org.scalatest.junit.JUnitRunner | |
import org.scalatest.FlatSpec | |
import org.scalatest.matchers.ShouldMatchers | |
import com.mongodb.casbah.Imports._ |
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
object LinearFit2 { | |
case class Point(x: Double = 0.0, y: Double = 0.0) { | |
def +(that: Point): Point = Point(this.x + that.x, this.y + that.y) | |
} | |
implicit def tupleToPoint(tuple: (Double, Double)): Point = Point(tuple._1, tuple._2) | |
def through (points : Point*) : Point = through(points.toList) | |
def through (points : List[Point]) : Point = { | |
val total = points.foldLeft(Point())(_ + _) |
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
scala> :paste | |
// Entering paste mode (ctrl-D to finish) | |
def wrap(partial: PartialFunction[Any, Unit]): PartialFunction[Any, Unit] = new PartialFunction[Any, Unit] { | |
def isDefinedAt(a: Any): Boolean = partial.isDefinedAt(a) | |
def apply(a: Any): Unit = { | |
println("----> received " + a) | |
partial.apply(a) | |
} | |
} |
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
trait SprayAdaptiveGzipSupport extends directives.EncodingDirectives { | |
import spray.httpx.encoding._ | |
def withAdaptiveCompressionSupport: Directive0 = | |
(decodeRequest(NoEncoding) | decodeRequest(Gzip) | decodeRequest(Deflate)) & | |
(encodeResponse(NoEncoding) | encodeResponse(Gzip) | encodeResponse(Deflate)) | |
} | |
object SprayAdaptiveGzipSupport extends SprayAdaptiveGzipSupport |
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
[info] Compiling 1 Scala source to /Users/age/Development/src/agemooij/riak-scala-client/target/scala-2.10/test-classes... | |
01/19 23:59:09 DEBUG [akka://default/user/test-server]: SERVER: Starting akka://default/user/test-server on localhost/127.0.0.1:17249 | |
01/19 23:59:09 INFO [akka://default/user/io-bridge]: akka://default/user/io-bridge started | |
01/19 23:59:09 DEBUG [akka://default/user/io-bridge]: SERVER: Executing Bind(localhost/127.0.0.1:17249,100,LogMark(SERVER)) | |
01/19 23:59:09 INFO [akka://default/user/test-server]: SERVER: akka://default/user/test-server started on localhost/127.0.0.1:17249 | |
01/19 23:59:09 DEBUG [akka://default/user/http-client/$a]: Opening connection 1 to localhost:17249 | |
01/19 23:59:09 DEBUG [akka://default/user/io-bridge]: Executing Connect(localhost/127.0.0.1:17249,None,()) | |
01/19 23:59:09 DEBUG [akka://default/user/io-bridge]: Connection request registered | |
01/19 23:59:09 DEBUG [akka://default/user/io-bridge]: SERVER: New connection accepted on localhost/127.0.0.1:17249 | |
01/19 23:59:0 |
OlderNewer