background preloader

Scala

Facebook Twitter

Pligor / Signing Android Apks. CURRENTLY IS RECOMMENDED TO SKIP USING THIS TOOL THE SAME FUNCTIONALITY CAN BE FOUND BY EXECUTING android:package-release IN sbt WHILE HAVING SET THE FOLLOWING FOUR VALUES IN project.properties (local.properties):

pligor / Signing Android Apks

Pfn/android-sdk-plugin. George Pligor sur Twitter : "#Scala has a very long way to go and many issues but it is still the more sane and human #friendly language out there. Scala Collections: Why Not? Herding XML in Scala - Programming Scala. Basic XML processing with Scala. Topics: XML, Scala XML API, XML literals, marshalling Introduction Pretty much everybody knows what XML is: it is a structured, machine-readable text format for representing information that can be easily checked for the “grammaticality” of the tags, attributes, and their relationship to each other (e.g. using DTD’s).

Basic XML processing with Scala

This contrasts with HTML, which can have elements that don’t close (e.g. <p>foo<p>bar rather than <p>foo</p><p>bar</p>) and still be processed. XML was only ever meant to be a format for machines, but it morphed into a data representation that many people ended up (unfortunately, for them) editing by hand. Lightning-Fast Cluster Computing.

Http clients

A Tour of Scala: Annotations. Annotations associate meta-information with definitions.

A Tour of Scala: Annotations

A simple annotation clause has the form @C or @C(a1, .., an). Here, C is a constructor of a class C, which must conform to the class scala.Annotation. All given constructor arguments a1, .., an must be constant expressions (i.e., expressions on numeral literals, strings, class literals, Java enumerations and one-dimensional arrays of them). An annotation clause applies to the first definition or declaration following it.

More than one annotation clause may precede a definition and declaration. The meaning of annotation clauses is implementation-dependent. In the following example we add the throws annotation to the definition of the method read in order to catch the thrown exception in the Java main program. Artifactory Online. Scala - How to download URL contents to a String or file. By Alvin Alexander.

Scala - How to download URL contents to a String or file

Last updated: Feb 4, 2013. Simple Scala scripts : Scan a directory recursively. I'm using Scala increasingly as a scripting language at the moment. As my confidence with it is increasing, I'm finding it's becoming more and more useful for those throw-away scripting situations. XStream - About XStream. How to Convert a Java List to a Scala List (actually... let's not do that) If you're using Scala and still making use of pretty much any Java library, you'll pretty soon come up against this problem: you're Java library has returned you a java.util.List, but you want to use the awesome methods contained in Scala's scala.List (soon to be scala.collection.immutable.List).

How to Convert a Java List to a Scala List (actually... let's not do that)

I'll show you how to do what you want in a second, but first, and importantly, I need to explain that what you actually want to do is NOT convert a Java List to a Scala List. Why? It's because, despite the name similarity, they're actually very different things... Don’t get fooled by Akka Logging Thread Name – Logging is Asynchronous. In my scala/akka web server, I’m doing all the processing in akka Actors.

Don’t get fooled by Akka Logging Thread Name – Logging is Asynchronous

I’m doing a lot of blocking IO so, as per documentation, I’ve setup my Actor to run as a router with a pinned dispatcher so that each worker gets its own thread. In my application.conf file, I have the following setting: What are the disadvantages to declaring Scala case classes. Assert, Require, Assume. Very simple but useful are the methods assert, require and assume which are built into the Predef object.

Assert, Require, Assume

As you might expect they are methods for performing certain checks during runtime to verify certain conditions. They do not use the Java assert framework and therefore are always evaluated regardless of whether or not assertions are enabled. Update: Scala 2.8 has an annotation called elidable that will (when 2.8 is complete) allow one to remove method calls at compile time by setting a compiler flag. The assert, etc... methods are all marked with this flag and as a result can be removed at compile time for production environments. Scala2.8. Kbloom/scala-collections-quickref. Squeryl - A Scala ORM for SQL Databases. Simple Build Tool. Its main features are: native support for compiling Scala code and integrating with many Scala test frameworksbuild descriptions written in Scala using a DSLdependency management using Ivy (which supports Maven-format repositories)continuous compilation, testing, and deploymentintegration with the Scala interpreter for rapid iteration and debuggingsupport for mixed Java/Scala projects Typesafe Inc., Scala's commercial outlet, has called sbt "arguably the best tool for building Scala projects", with the two most prominent key features being incremental compilation and an interactive shell.[4] When continuous compilation mode is entered, the Scala compiler is only once instantiated which eliminates subsequent startup costs, and source file changes are tracked so that only affected dependencies are recompiled.

Simple Build Tool

Sbt had already fed back into the Scala standard library before, when its process API was adopted in Scala 2.9.[6] Multiple commands may be used on the same line.