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
type Key = Long | |
implicit def strToKey(str: String): Long = str.toLong |
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 { | |
i <- 1 to 9 | |
j <- 1 to 9 | |
if i != j | |
result = s"($i, $j)" | |
} { | |
println(result) | |
} |
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
class CommandWatcher | |
constructor: (commands) -> | |
@keys = [] | |
@length = commands.length | |
@command = commands.join ',' | |
watch: (handler) => | |
watcher = @ | |
$(document).on 'keydown', (event) -> | |
watcher.keys.push event.which | |
# マッチしたら実行後、即return |
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 Main extends App { | |
assert(Ver(1, 4) > Ver(1, 2)) | |
assert(Ver(2, 1) < Ver(3, 0)) | |
assert(Ver(4, 0) == Ver(4, 0)) | |
assert(List(Ver(1, 2), Ver(1, 4), Ver(1, 6)).min == Ver(1, 2)) | |
} | |
case class Ver(major: Int, minor: Int) extends Ordered[Ver] { | |
def compare(other: Ver) = { |
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 com.ponkotuy.proxy | |
import java.nio.charset.StandardCharsets | |
import com.netaporter.uri.Uri | |
import io.netty.bootstrap.{Bootstrap, ServerBootstrap} | |
import io.netty.buffer.{ByteBuf, Unpooled, UnpooledByteBufAllocator} | |
import io.netty.channel._ | |
import io.netty.channel.nio.NioEventLoopGroup | |
import io.netty.channel.socket.SocketChannel |
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
# MariaDB-specific config file. | |
# Read by /etc/mysql/my.cnf | |
[client] | |
# Default is Latin1, if you need UTF-8 set this (also in server section) | |
default-character-set = utf8 | |
[mysqld] | |
# | |
# * Character sets |
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 com.ponkotuy | |
import java.nio.charset.Charset | |
import io.netty.channel.ChannelHandlerContext | |
import io.netty.handler.codec.http._ | |
import org.littleshoot.proxy.impl.DefaultHttpProxyServer | |
import org.littleshoot.proxy.{HttpFilters, HttpFiltersAdapter, HttpFiltersSourceAdapter} | |
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
# Time: 150513 9:34:49 | |
# User@Host: myfleet[myfleet] @ localhost [127.0.0.1] | |
# Thread_id: 63 Schema: myfleet QC_hit: No | |
# Query_time: 8.689849 Lock_time: 0.000136 Rows_sent: 2096 Rows_examined: 3635960 | |
# Full_scan: Yes Full_join: No Tmp_table: Yes Tmp_table_on_disk: No | |
# Filesort: Yes Filesort_on_disk: No Merge_passes: 0 Priority_queue: No | |
SET timestamp=1431477289; | |
select br.area_id, br.info_no, br.cell, br.win_rank, ci.alphabet, count(1) as cnt from battle_result br left join cell_info ci on br.area_id = ci.area_id and br.info_no = ci.info_no and br.cell = ci.cell where br.created > 1396278000000 and br.created < 1431442800000 group by br.area_id, br.info_no, br.cell, br.win_rank order by br.area_id, br.info_no, br.cell, br.win_rank; | |
# 以下のように書き換えたら3倍ぐらい早くなった |
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 | |
object Main { | |
def main(args: Array[String]) { | |
val path = "/home/yosuke/01_01.swf" | |
val is = new FileInputStream(new File(path)) | |
val swf = new SWF(is, path, "KanColle1_1", false) |