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
/* | |
Copyright (c) 2007-2010 iMatix Corporation | |
This file is part of 0MQ. | |
0MQ is free software; you can redistribute it and/or modify it under | |
the terms of the Lesser GNU General Public License as published by | |
the Free Software Foundation; either version 3 of the License, or | |
(at your option) any later version. |
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 zmqbugtest; | |
import org.zeromq.ZMQ; | |
public class Main { | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.mygroup/groupId> | |
<artifactId>my-artifact</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<name>${project.artifactId}</name> | |
<description>My wonderfull scala app</description> | |
<inceptionYear>2010</inceptionYear> | |
<licenses> | |
<license> |
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 subprocess as sp | |
import sys | |
# here you define general mutation rules | |
def upperCaseAllTs(x): return x.replace("t", "T") | |
def mySecretStrategy(x): return x.replace("34", "#$") | |
def cap(x): return x.capitalize() | |
# and put the mutator strategies here | |
strats = [upperCaseAllTs, mySecretStrategy, cap] |
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 java.io.{IOException, InputStream, OutputStream} | |
import org.mockito.Mockito | |
import scalaz._ | |
import Scalaz._ | |
import scalaz.effects._ | |
trait Closable[A] { | |
def close(a: A): IO[Unit] | |
def closeOrKeep(a: A): IO[Option[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
package akkaz | |
import akka.actor._ | |
import akka.util.duration._ | |
import akka.util.Timeout | |
import akka.dispatch.{ExecutionContext, Future} | |
object Futureapplicative extends App { | |
val system = ActorSystem("Futureapplicative") |
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
# for SSD | |
echo deadline > /sys/block/sda/queue/scheduler | |
echo 0 > /proc/sys/vm/swappiness | |
# turn off Radeon by default so it doesn't consume battery | |
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch | |
# turn off bluetooth by default | |
rfkill block bluetooth |
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
abstract class Bakery1 { | |
public void produceBread() { | |
Ingredients ingredients = prepareIngredients(); | |
Bread bread = bakeTheBread(ingredients); | |
if (checkQuality(bread)) { | |
putBreadOnDisplay(bread); | |
} | |
} |
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
interface BakeBreadStrategy { | |
Bread bake(Ingredients ingredients); | |
} | |
class Bakery2 { | |
public Bakery2(BakeBreadStrategy bakeStrategy) { | |
// ... | |
} |
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
abstract class PosprocessingBakery1 { | |
public void produceBread() { | |
Ingredients ingredients = prepareIngredients(); | |
Bread bread = bakeTheBread(ingredients); | |
if (checkQuality(bread)) { | |
putBreadOnDisplay(postprocess(bread)); | |
} | |
} |
OlderNewer