Skip to content

Instantly share code, notes, and snippets.

View kmizu's full-sized avatar

Kota Mizushima kmizu

View GitHub Profile
@kmizu
kmizu / enum_99.scala
Last active August 29, 2015 13:57 — forked from keizo042/enum_99.scala
(1 to 10).foreach{x =>
(1 to 10).foreach{y =>
print(x * y+ "\t")
}
println()
}
import scala.collection.mutable.ArrayBuffer
import scala.io.Source
object ShantenAnalysis {
val NUM_PIDS = 9 * 3 + 7
var mentsus:ArrayBuffer[Array[Int]] = null
def main(args: Array[String]) {
mentsus = createMentsus()
@kmizu
kmizu / ShantenAnalysis.scala
Last active December 26, 2015 07:59 — forked from gimite/ShantenAnalysis.scala
Scala版が遅くなってる原因修正
import scala.collection.mutable.ArrayBuffer
import scala.io.Source
object ShantenAnalysis {
val NUM_PIDS = 9 * 3 + 7
var mentsus:ArrayBuffer[Array[Int]] = null
def main(args: Array[String]) {
mentsus = createMentsus()
(defn points [^BufferedImage image ^BufferedImage screen]
(let [width (.getWidth image)
height (.getHeight image)
xrange (range width)
yrange (range height)]
(for [points
(for [sx (range (- (.getWidth screen) width))
sy (range (- (.getHeight screen) height))]
(for [tx xrange
ty yrange]
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {

できること

  • JRebelを利用すると、アプリケーションの再起動なしで実行中のアプリケーションに加えた変更を即座に反映することができます(ホットリローディング)。まるでPHPのようにサクサク書けるッ!
  • Scala開発者にはライセンスが$0で提供されます。Javaで利用する場合は購入してね☆彡

前提

以下がインストールされているものとする。

@kmizu
kmizu / app.coffee
Created April 22, 2013 04:37 — forked from teamon/app.coffee
# This will automatically create or update model
onRender: =>
[method, url] = if @model.isNew()
["POST", mymodels_path()]
else
["PUT", model_path(@model.id)]
@$(".upload").fileupload(
dataType: 'json'
@kmizu
kmizu / log.txt
Created February 5, 2013 05:04 — forked from xuwei-k/log.txt
[error]
[error] last tree to typer: term $outer
[error] symbol: value $outer (flags: <synthetic> <paramaccessor> <triedcooking> private[this])
[error] symbol definition: private[this] val $outer: unit.ScalateHelperSpec
[error] tpe: <notype>
[error] symbol owners: value $outer -> anonymous class $anonfun -> value <local ScalateHelperSpec> -> class ScalateHelperSpec -> package unit
[error] context owners: value u -> value $anonfun -> value $anonfun -> method apply -> anonymous class $anonfun$apply$4 -> method apply -> anonymous class $anonfun$1 -> value <local ViewSpec> -> class ViewSpec -> package functional
[error]
[error] == Enclosing template or block ==
[error]
#!/usr/bin/env sh
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1