A modern replacement for the Bash system shell. Provides a systems shell in the high-level Scala language, letting you seamlessly mix system operations with real code without the hassle or the frustration of trying to write complex code in Bash. If you use Ammonite, you will probably find the follow book by the Author helpful in using Ammonite to the fullest: https://handsonscala.com/ Ammonite is
Finatra¶ Finatra builds on TwitterServer and uses Finagle, therefore it is highly recommended that you familiarize yourself with those frameworks before getting started. The version of Finatra documented here is version 2.x. Version 2.x is a complete rewrite over v1.x and as such many things are different. For high-level information about the changes from v1.x see the blog post here. Finatra at it
import org.scalameter.api._ object RangeBenchmark extends Bench.ForkedTime { val ranges = for { size <- Gen.range("size")(300000, 1500000, 300000) } yield 0 until size measure method "map" in { using(ranges) curve("Range") in { _.map(_ + 1) } } } ScalaMeter is a microbenchmarking and performance regression testing framework for the JVM platform that allows expressing performance tests in a way whi
Android development is fun, but the code is often fragile and too verbose. With the help of Scala, you can build better apps: cleaner code, safer constructs, less crashes. Moreover, you will be a lot faster! Less code to write, less to tests and maintain. Scala is the best tool to get productive at Android development. In this book, you will learn the ins and outs of Scala development for Android,
Your typical test code Here’s some typical test code found in many codebases @Test public void testCalculateTaxRate() { TaxRateCalculator calculator = new TaxRateCalculator(); Int value = calculator.calculateRate(200, 10); assertEquals(300,value); } This code suffers from several issues. Under what conditions is the tax rate calculated? What exactly is it doing? What is the expected outcome? Being
Update: Added Squeryl, thanks to @JoeZulli for the heads-up Update 2: Added link to latest Squeryl release for Scala 2.10 and 2.9.2 I recently started working with relational databases again from within Scala, after a while in JSON-land (mostly MongoDB and elasticsearch). During that time, I’d been happily working with lightweight libraries / DSLs that take care of case class serialization, such a
Shamelessly ripped off from Programming in Scala, second edition. I did ask for permission, though. Basically, while I'm going through the book, I'm taking notes and pushing them here, so I can later use this page as a Scala quick reference. If you, by some incredible chance, find any of this useful, please do buy the book. No, I don't get the kick back. As you can see, the book link is clean :) B
We’re excited to announce the first release of Scala.js, v0.1! Scala.js was introduced during the 4th Scala Days in June 2013, and has now reached relative stability. While we don’t yet feel that Scala.js is production-ready, we think that it nonetheless deserves its first non-snapshot release. Scala.js is a compiler from Scala to JavaScript. It allows you to write your entire web application in S
32. trait Entity[ID <: Identity[_]] { ! /** エンティティの識別子。 */ val identity: ID ! override final def hashCode: Int = 31 * identity.## ! override final def equals(obj: Any): Boolean = obj match { case that: Entity[_] => identity == that.identity case _ => false } ! } 33. trait Identity[+A] extends Serializable { ! def value: A ! } ! object EmptyIdentity extends Identity[Nothing] { ! def value = throw E
This article shows how Scala adopts and transforms the classical software design patterns. The content of the article is also (independently) translated into Russian and Chinese. Design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished code, but rather a template for how to solve a problem that can be used in many differen
列挙順自体はとくに意味ありません。あと「どの最適化がどのくらい速くなるのか?」を詳細に計ったことはないですし、「原理的にこうなってるから(ry」というのを説明するに過ぎません。中には「JITで無意味になるようなどうでもいい細かすぎること」も書いてありますし、最適化のトレードオフとして失うものもあるので、そのあたり自己責任でお願いします。本当に最適化が必要とされる場合は、以下のものを無闇に実行するよりまず計測したほうがいいのは、言うまでもありません。*1 1. private[this]をつかえ scalaのvalやvarは、private[this]にしたときのみ、直接のフィールドアクセスになります(それ以外ではメソッド呼び出し)。シングルトンのobjectの場合も同様です。private[this]をつけられる場合はできるだけつけましょう 2. なんでもかんでもListをつかうな 最初の
独習 Scalaz これまでいくつのプログラミング言語が羊の衣を着た Lisp に喩えられただろうか? Java は馴染み親しんだ C++ のような文法に GC を持ち込んだ。それまで他にも GC を載せた言語はあったけども、現実的に C++ の代替となりうる言語に GC が載ったことは 1996年には画期的に思われた。やがて時は経ち、人々は自分でメモリ管理をしないことに慣れていった。JavaScript と Ruby の両言語もその第一級関数 (first-class function) やブロック構文を持つことから羊の衣を着た Lisp と呼ばれたことがある。S式の同図像性がマクロに適することから Lisp系の言語はまだ面白いと思う。 近年の言語はもう少し新しい関数型言語から概念を借りるようになってきた。型推論やパターンマッチングは ML にさかのぼることができると思う。時が経てば、人
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く