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
{-# LANGUAGE BangPatterns, OverloadedStrings #-} | |
import qualified Data.ByteString.Lazy as BL | |
import Data.Csv | |
import Data.Char (ord) | |
import Data.Monoid | |
import Data.Vector (Vector) | |
import qualified Data.Vector as V | |
import Data.Foldable (foldMap) | |
import qualified Data.Text.Lazy as T | |
import qualified Data.Text.Lazy.Encoding as T |
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
#!/bin/bash | |
INPDF=$1 | |
OUTDIR=$2 | |
ROT=$3 | |
CONVOPTS=$4 | |
INBASE=$(basename ${INPDF} .pdf) | |
TMP=$(mktemp -d) | |
pdfimages -j ${INPDF} ${TMP}/${INBASE} # emits ppm,pbm or jpg | |
for i in $(ls ${TMP}/${INBASE}-*.*) | |
do |
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
abstract class PosprocessingBakery1 { | |
public void produceBread() { | |
Ingredients ingredients = prepareIngredients(); | |
Bread bread = bakeTheBread(ingredients); | |
if (checkQuality(bread)) { | |
putBreadOnDisplay(postprocess(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) { | |
// ... | |
} |
OlderNewer