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
def imageToBinaryImage = Flow[BufferedImage].map(img => { | |
val bin = ImageHelper.convertImageToBinary(img) | |
bin | |
}) |
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 extends App with OCR { | |
implicit val system: ActorSystem = ActorSystem("ocr") | |
implicit val executor: ExecutionContextExecutor = system.dispatcher | |
implicit val materializer: ActorMaterializer = ActorMaterializer() | |
implicit val jsonStreamingSupport = EntityStreamingSupport.json() | |
import MyJsonProtocol._ | |
def imageDeSkew:Flow[BufferedImage] = ??? | |
def imageToBinaryImage:Flow[BufferedImage] = ??? | |
def bufferedImageToMat:Flow[BufferedImage] = ??? |
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
// Dependencies | |
libraryDependencies += "net.sourceforge.tess4j" % "tess4j" % "4.0.0" | |
libraryDependencies += "com.typesafe.akka" %% "akka-stream" % "2.5.12" | |
libraryDependencies += "com.typesafe.akka" %% "akka-http" % "10.1.1" | |
libraryDependencies += "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.1" | |
// Plugins | |
addSbtPlugin("org.bytedeco" % "sbt-javacv" % "1.16") |
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
trait OCR { | |
val tesseract: Tesseract = new Tesseract | |
tesseract.setDatapath("/usr/local/Cellar/tesseract/3.05.01/share/") | |
} |
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
#!/bin/sh | |
rsvg-convert -v > /dev/null 2>&1 || { echo "rsvg-convert is not installed, use: brew install librsvg." >&2; exit 1; } | |
ASSETS_FOLDER=$1 | |
if [ "$ASSETS_FOLDER" == "" ]; then | |
echo "Usage: $0 /path/to/svg/assets/" >&2 | |
exit 1 | |
fi |
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 spray.json.DefaultJsonProtocol | |
/** | |
* Created by duane on 12/11/2015. | |
*/ | |
trait ObjectIdSerialization extends DefaultJsonProtocol { | |
import reactivemongo.bson.BSONObjectID | |
import spray.json._ |
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 | |
/* | |
#cgo LDFLAGS: -lSetupapi | |
#ifdef __MINGW32__ | |
#include <ntdef.h> | |
#endif | |
#include <windows.h> | |
#include <setupapi.h> |
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
// | |
// Code for: https://www.hackerrank.com/challenges/a-very-big-sum | |
// | |
object Solution { | |
def main(args: Array[String]) { | |
val num = readInt() | |
// See if number is positive or negative |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
using System.Runtime.InteropServices; | |
namespace MyAPI | |
{ |
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 java.util.Enumeration | |
class Merge(a:Enumeration[Integer], b:Enumeration[Integer]) extends Enumeration[Integer] | |
{ | |
/** | |
* Checks to see if either Enumeration has any elements | |
* @return true if either input Enumeration has an element | |
* false if both Enumerations have no elements | |
*/ | |
override def hasMoreElements: Boolean = { |