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
fun powerSet(list: List<Int>): Set<List<Int>> { | |
return if (list.isEmpty()) { | |
setOf(emptyList()) | |
} else { | |
list.flatMap { | |
listOf(list) + powerSet(list - it) | |
}.toSet() | |
} | |
} |
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
fun main(args: Array<String>) { | |
val password = args[0] | |
val random = Random() | |
val (a, b) = generateRandoms(random, count = 2) | |
val lineEquation = { x: Int -> a * x + b } | |
val xList = generateRandoms(random, count = password.length) | |
val yList = xList.map { lineEquation(it) } | |
val yMinusAscii = yList.mapIndexed { index, y -> y - password[index].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
package io.github.ghostbuster.geometricalsec | |
import java.util.* | |
fun main(args: Array<String>) { | |
val password = args[0] | |
val random = Random() | |
val a = random.nextFloat() | |
val b = generateRandoms(random, count = 1).first() |
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
0x10866919f37F65173411f9e40923108Ef68a8e84 |
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
0x64041195B91Fdcf14Af7065dD4396EE8eB2D3b8a |
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
task regenerateSolc(type:Exec) { | |
inputs.dir("solidity") | |
outputs.dir("src/main/java/solidity") | |
commandLine './regenerate-solidity.sh' | |
standardOutput = new ByteArrayOutputStream() | |
ext.output = { | |
return standardOutput.toString() | |
} | |
} |
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 cats.data.NonEmptyList | |
import cats.effect.{ContextShift, IO, Resource, Timer} | |
import com.typesafe.scalalogging.LazyLogging | |
import io.circe.{Json, JsonObject} | |
import org.http4s.circe._ | |
import org.http4s._ | |
import org.http4s.client.Client | |
import cats.implicits._ | |
import scala.concurrent.ExecutionContext |
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 estrapade.TestApp | |
import magnolia.{CaseClass, Magnolia} | |
import estrapade.{TestApp, test} | |
import contextual.data.scalac._ | |
import scala.language.experimental.macros | |
trait StructureOf[T] { | |
def structure:Structure | |
def isOptional = false | |
} |
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 estrapade.{TestApp, test} | |
import magnolia.examples.Show | |
case class RPerson(age: Int, name: String, child: Option[RPerson]) | |
case class GPerson(child: Option[RPerson]) | |
object ShowDerivationTest extends TestApp { | |
implicit def showForOption[T](implicit ts: Show[String, T]): Show[String, Option[T]] = | |
new Show[String, Option[T]] { | |
override def show(value: Option[T]): 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
case class Person(age: Int, name: String) |
OlderNewer