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._ | |
import com.jpexs.decompiler.flash.SWF | |
import com.jpexs.decompiler.flash.tags.{ShowFrameTag, PlaceObject2Tag, DefineSpriteTag, DefineBitsJPEG3Tag} | |
import scala.collection.JavaConverters._ | |
object Main { | |
val LineRegex = """line(\d)""".r | |
def main(args: Array[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
#!/bin/sh | |
# 勇者の塔を自動プレイする簡易スクリプト | |
# ただしNexus6(1440x2560)に限る | |
# 必要なもの: adb | |
# 条件: 兵士タブを開いた状態にし、スクロールを一番上にしておくこと | |
while : | |
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.text.SimpleDateFormat | |
import java.util.{Calendar, Date} | |
import com.github.nscala_time.time.Imports._ | |
object Main extends App { | |
def timer[A](name: String)(f: => A): A = { | |
val start = System.currentTimeMillis() | |
val result = f | |
println(s"${name}: ${System.currentTimeMillis() - start}ms") |
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
#!/usr/bin/env scalas | |
/*** | |
scalaVersion := "2.11.7" | |
resolvers += "sonatype releases" at "https://oss.sonatype.org/content/repositories/releases" | |
libraryDependencies += "org.skinny-framework" %% "skinny-micro-server" % "1.0.+" | |
*/ | |
import skinny.micro._ |
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/sh | |
java -jar $HOME/.sbt/launchers/0.13.9/sbt-launch.jar -Dsbt.main.class=sbt.ScriptMain -Dsbt.boot.directory=$HOME/.sbt/boot "$@" |
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.File | |
import javax.imageio.ImageIO | |
object Main extends App { | |
assert(args.nonEmpty) | |
val image = ImageIO.read(new File(args.head)) | |
println(image.getWidth, image.getHeight) | |
} |
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
#include <stdio.h> | |
#include <math.h> | |
typedef struct { | |
double x; | |
double y; | |
} point_t; | |
typedef struct { | |
point_t* center; |
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
object InsertionSort { | |
def sort[A](ary: Array[A])(implicit ord: math.Ordering[A]): Unit = { | |
if(2 <= ary.length) { | |
ary.indices.tail.foreach { i => | |
val j = (0 until i).indexWhere { j => ord.lt(ary(i), ary(j)) } | |
if(0 <= j) insert(ary, i, j) | |
println(ary.mkString("(", ", ", ")")) | |
} | |
} |
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 scala.io.StdIn | |
object Main extends App { | |
val input = StdIn.readLine() | |
val heights = input.foldLeft(Seq(0)) { case (hs, x) => | |
val add = x match { | |
case '\\' => hs.last - 1 | |
case '/' => hs.last + 1 | |
case '_' => hs.last | |
} |
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
#MAKE_FLAGS="-j2" |