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
val maxNum = 20 | |
val res = for { | |
x <- 1.to(maxNum) | |
y <- x.to(maxNum) | |
z <- y.to(maxNum) | |
squareSum = x*x+y*y+z*z | |
sqrtSquareSum = math.sqrt(squareSum) | |
if (sqrtSquareSum.toInt.toDouble == sqrtSquareSum) | |
} yield s"$x,$y,$z,$squareSum,${sqrtSquareSum.toInt}" |
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
Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException | |
java.lang.StackOverflowError | |
at scala.reflect.internal.Names$Name.decode(Names.scala:460) | |
at scala.reflect.internal.Names$TypeName.decode(Names.scala:598) | |
at scala.reflect.internal.Symbols$Symbol.decodedName(Symbols.scala:1269) | |
at scala.reflect.internal.Types$TypeRef.$anonfun$isShowAsInfixType$3(Types.scala:2091) | |
at scala.reflect.internal.Types$TypeRef.isShowAsInfixType(Types.scala:2091) | |
at scala.reflect.internal.Types$TypeRef.customToString(Types.scala:2372) | |
at scala.reflect.internal.Types$TypeRef.safeToString(Types.scala:2382) | |
at scala.reflect.internal.tpe.TypeToStrings.typeToString(TypeToStrings.scala:55) |
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 doobietest | |
import com.zaxxer.hikari.{HikariConfig, HikariDataSource} | |
import doobie.hikari.HikariTransactor | |
import monix.eval.Task | |
import org.scalatest.{BeforeAndAfterEach, FunSuite, Matchers} | |
import scala.concurrent.Await | |
import scala.concurrent.duration.{FiniteDuration, _} |
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] ------------------------------------------------------------------------ | |
[INFO] Building JavaCPP Presets for FlyCapture 2.7.3.19-0.11 | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] | |
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ flycapture --- | |
[INFO] | |
[INFO] --- maven-resources-plugin:2.4:resources (generate-sources) @ flycapture --- | |
[INFO] Using 'UTF-8' encoding to copy filtered resources. | |
[INFO] skip non existing resourceDirectory /home/flwi/dev/playground/javacpp-presets/flycapture/src/main/resources | |
[INFO] |
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
# | |
# A fatal error has been detected by the Java Runtime Environment: | |
# | |
# SIGSEGV (0xb) at pc=0x000000304085203b, pid=27392, tid=139897653995264 | |
# | |
# JRE version: Java(TM) SE Runtime Environment (8.0_40-b25) (build 1.8.0_40-b25) | |
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b25 mixed mode linux-amd64 compressed oops) | |
# Problematic frame: | |
# C [libtesseract.so.3+0x25203b] ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x16b | |
# |
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 utils | |
import akka.actor.{Actor, ActorSystem} | |
import akka.testkit.{ImplicitSender, TestActorRef, TestKit} | |
import org.scalatest.FunSuiteLike | |
import scala.concurrent.duration._ | |
class StatefulnessBetweenTestsWithImplicitSenderSpec extends TestKit(ActorSystem("MyTestSystem")) | |
with FunSuiteLike |
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
public static class IEnumerableExtensions | |
{ | |
public static IEnumerable<T> OrEmpty<T>(this IEnumerable<T> t) | |
{ | |
return t ?? Enumerable.Empty<T>(); | |
} | |
public static IEnumerable<T> OrEmpty_WontCompile<T>(this T t) | |
{ | |
return t ?? Enumerable.Empty<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
# Generates a series of substitution cipher puzzles. The messages to | |
# "encrypt" are take from a text file passed on the command-line, | |
# where each message is on one line. | |
# | |
# The output is a PDF, "codes.pdf". | |
# | |
# This was written for my 7 year-old, who loves doing substitution | |
# ciphers. | |
require 'rubygems' | |
require 'prawn' |