Questions for scala


How to activate ENSIME editor for Emacs in MacBook

Iam new for emacs ... installed emacs for macbook and installed the ensime plugin, i cant follow the steps as provided in the ensime site, can anyone help me by citing any wiki or blogs which has s...

How to exclude library dependencies with explicit URL from generated pom?

I'm moving the Scala Migrations project from ant/ivy to sbt. It optionally uses log4jdbc as a library dependency that doesn't exist in any public Maven repository (from what I can find).

Scala - iterators and takeWhile

I am running the following piece of code:

Working with Lift XHTML/HTML in Netbeans

I am developing a Lift application using Netbeans and I have everything working apart from the lift xhtml, which is stored with an html extension, creates a number of warning and errors in netbeans...

Implementing a Measured value in Scala

A Measured value consists of (typically nonnegative) floating-point number and unit-of-measure. The point is to represent real-world quantities, and the rules that govern them. Here's an example:

Lazy Cartesian product of several Seqs in Scala

I implemented a simple method to generate Cartesian product on several Seqs like this:

Purely functional data structures for text editors

What would be good purely functional data structures for text editors? I want to be able to insert single characters into the text and delete single characters from the text with acceptable efficie...

Scala - XML inspection/modification

I am new to both XML processing and Scala in general. I have few questions/things to achieve based on the example xml below

How do you write shortened version of function literal?

Could you please explain to me how to write shortened version of function literal ?

correctly terminate akka actors in scala

I've write sample code that starts an actor, kills it and finishes execution.

Scala - futures does not run

I am trying to run the following future basic code

ClassNotFoundException / NoClassDefFoundError when running a Scala jar

Having a Scala project exported to a .jar with eclipse, the application started with java -jar app.jar dies with the error java.lang.ClassNotFoundException: scala.Predef$.

Scala - Problem using MapWrapper when upgrading from 2.7.7 to 2.8.1

I have this piece of code I inherited that works well under Scala 2.7.7 (well, replacing the import to use jcl ). But when I try to use 2.8.1 I get this error:

Generically typed classes in collections in Scala

I'm having a problem with a generic class I'm creating in Scala. I have the following class:

scala, transform a callback function to an iterator/list

For the sake of this question, I have the following example code which I cannot change:

traits with immutable paramiters in scala

I want to make the following example so that Collar is immutable

Building a regex with packrat parsers in Scala

I have two packrat parsers in scala:

Type inference on anonymous functions with enrich-my-library

Say I have a method that turns a (function on two elements) into a (function on two sequences):

Scala/Lift: Does it require special http routing?

Since Lift is stateful, each subsequent request to a page/site must go back to the same server. Presumably that means that the front-end load balancer needs to keep track of which client is talking...

types as mold to delegated classes in Scala

I am working in ScalaFX Project. In this moment I am adapting classes from javafx.scene.control.cell. In this package, methods with same signature are duplicated in many classes. e.g.

Why doesn't Scala's Option translate directly to a T in bytecode?

One thing I don't understand about Scala, is why Null subclasses everything, despite not passing the substitution test. Presumably this is for Java compatibility, which is fine, I guess -- but then...

Counter in for comprehension

How to do Scala equivalent to this Java code:

In Scala, what exactly does 'val a: A = _' (underscore) mean?

What exactly does val a: A = _ initialize a value to? Is this a typed null? Thanks.

Get superclasses function in Scala

What would be a short functional way to get the superclasses of a given Class instance in Scala?

Setting instance vars with apply

With Array it's possible to get and set elements with val i = xs(0) and xs(0) = i syntax. How to implement this functionality in my own class? So far I was only able to implement getting the values.

A way to prepend letters to each imported class

Is there a way to import all classes from a package and rename them all by prepending some text? A construct

How many implicits are there in Scala?

If I haven't imported anything but Scala's usual defaults, how many implicits (implicit conversions) are in scope?

Why do people use _? as an identifier suffix?

I start reading Lift framework source code, I find that there're so many methods are defined using a name like methodName_? , is there a convention that _? has some special meaning?

How to use Spring Autowired (or manually wired) in Scala object?

I am trying to use Spring with Scala. I know Autowired works with Scala class, but I am using a web-framework that requires an object and I want to inject a dao into it. I wonder how to do this? So...

Functional code for finding index in array

I would like to refactor this piece of Scala code in functional style:

Scala - ordering a list

I am trying to sort a List of XMLMessage which in turn, derive from Message. The Message trait extends Ordered and provides comparison function based on timestamps. However, when I try to say:

Scala - Recursion of an anonymous function

I'm working through the scala labs stuff and I'm building out a function that will, in the end, return something like this:

Managing unused `List`s in Scala

Scala have wealth of immutable structure.

Integration Test in Play Framework

I am trying to get Integration Tests to work in Play Framework 2.1.1

ScalaTest - writing custom matchers

I am running into a problem while writing a custom matcher for NodeSeq:

How can I make ensime show all compilation errors?

I'm doing Scala web development using the Play framework's scala module, and using Emacs+Ensime to edit the code. Sometimes even when Ensime shows no errors, Play will still show a compilation erro...

Overriding method by return type in scala, oop solution?

I have some problem to find oop information about my problem in scala, peraphs you can help me to find a good solution, or good web/book ressources ?

Self-referential duck-typing

I wish to write a function that operates on any value that can be added to other members of its own type (whatever "added" means in context). The obvious (heh-heh) definition of such a type:

Scala: pre-initialize val while extending a class

How do I pre-initialize a val and extend a class in Scala?

Need help figuring out performance bottleneck

I'm working on my scala chops and implemented a small graph Api to track vertices and edges added to graph. I have basic GraphLike Trait, and have an Undirected Graph class ( UnDiGraph) and a Direc...

What do Futures and Agents in Akka offer over Clojure's counterparts?

Having watched the presentation Composable Futures with Akka 2.0, I am curious to know what additional features the Akka implementation of Futures and Agents bring over Clojure's ones.

Is the method name “is” of “RequestVar” a short name of some other words?

In lift web framework, the RequestVar has a method is:

What is the recommended mongo db plugin for Play! Framework?

There are at least two mongo db plug-ins for Play! Framework, PlayMorphia and Mongo 1.3.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.