scala

Scala and Aspects

Scala and Aspects can be used together? Are there benefits in this case? Thanks ...

Passing Java array to Scala

Hello, Although I've been using Scala for a while, and mixing it with Java also, I bumped on problem. How can I pass a Java array to Scala? I know that the other way around if fairly straightforward. Java to Scala is not so however. I should I declare my method in Scala? Here is a small example of what I'm trying to achieve: Scala:...

Scala generic array

Hi, I'm trying to declare a method in an abstract class which receives an Array of generic type T. As such: abstract class Circle[-T] extends Shape[T] { def draw(points: Array[T]): Unit } The problem I'm getting is that Scala compiler complaints with: contravariant type T occurs in invariant position in type Array[T] of va...

want to create a popup in scala

hello everybody i want to create a popup on a click on link on my first page in scala and my popup window contains one drop dpwn menu.so please help me out as fast as possible. ...

Which is better framework Java/GWT or Scala/Lift ?

Hi folks, I wanted to start a new web application project and I am confused between two frameworks that is GWT(Java) or Lift(Scala). So I want your opinion which one I choose? Both are good according to my project requirement. So on the basis of frameworks comparison please tell me which is good? ...

want to create popup window in scala/lift framework.

Possible Duplicate: want to create a popup in scala hi all i want to create an popup window in scala/lift framework through an link .so needed an code for both scala ...

Programs running aapt in android sdk from shell and from sbt.

I have a weird problem where I cannot run aapt from an sbt command as well as from the shell. I run this command: sbt update package-debug And everything hums along until I get this error: java.io.IOException: Cannot run program "/home/egervari/Programs/android-sdk-linux_x86/platforms/android-7/tools/aapt": java.io.IOException: error...

Are FP and OO orthogonal?

I have heard this time and again, and I am trying to understand and validate the idea that FP and OO are orthogonal. First of all, what does it mean for 2 concepts to be orthogonal? FP encourages immutability and purity as much as possible, while OO seems built for state and mutation – a slightly organized version of imperative program...

Is there a dbunit-like framework that doesn't suck for java/scala?

I was thinking of making a new, light-weight database population framework. I absolutely hate dbunit. Before I do, I want to know if someone already did it. Things i dislike about dbunit: 1) The simplest format to write and get started is deprecated. They want you to use formats that are bloated. Some even require xml schemas. Yeah, wh...

Lift MapperField Objects

Hi, Why the mapper fields in Lift framework is defined as Objects inside the class? Why not them as vals? When I look at their Wiki page, it says that for some internal reasons of Scala, we are making them as Objects instead of val or var. What is the internal reason or hinderence in Scala? ...

Scala: good way to keep pairs of strings

Hey fellas, What is a neat way to hold pairs of strings which are not necessarily key-values (might have duplicate keys), for a small collection? List[List[String]] works obviously but looks dirty. Cheers Parsa ...

Scala project won't compile in Eclipse; "Could not find the main class."

Hi all, I have installed Eclipse 3.5.2 and today's Scala plugin from /update-current (that's Scala 2.8 final.) I can compile and run Scala projects consisting of a single singleton object that implements main(). But, if a project contains more classes, I receive the "Could not find the main class" error. I have tried searching for th...

Custom Protocol Handler not passing argument on OSX

Hello, I'm trying to hook up a custom protocol handler to my application on OSX so that I can do test://argument In my plist I have the following: <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>CFBundleURLIconFile</key> <string></string> <...

Frameworks comparation: Lift, Play and Wicket

What are the advantages and dis­advantages of frameworks Lift, Play and Wicket? What characteristics are best or only supported by each? Thanks ...

Mutable method parameters in Scala

Simple problem: I am subclassing a FilterInputStream in Scala, which has a read method: public void read(byte [] b,int offset,int len) The data being read will be put in b, but as parameters are "vals" in Scala methods, I see no way to properly subclass this. How do I set b to the data being read? The Java *InputStream really leaves m...

How should I avoid unintentionally capturing the local scope in function literals?

I'll ask this with a Scala example, but it may well be that this affects other languages which allow hybrid imperative and functional styles. Here's a short example (UPDATED, see below): def method: Iterator[Int] { // construct some large intermediate value val huge = (1 to 1000000).toList val small = List.fill(5)(s...

When are Scala objects garbage collected?

This question is about Scala objects, which are defined something like this: object Pipeline { val dispatcher = new Dispatcher } I know that, in some circumstances, they are referred to as 'companion' objects, although I don't yet understand the distinction. Anyway, I want to know when they get garbage collected. So, in the above e...

Why illegal start of declaration in Scala?

For the following code: package FileOperations import java.net.URL object FileOperations { def processWindowsPath(p: String): String { "file:///" + p.replaceAll("\\", "/") } } Compiler gives an error: > scalac FileOperations.scala FileOperations.scala:6: error: illegal start of declaration "file:///" + p.repl...

Parent fields initialization

In the following example a reference to reason is stored in both parent and child. I'd like to avoid this and store the reference only in parent (usual use of Java exceptions). import java.lang.{Exception, Throwable} class FileError(message: String, reason:Throwable) extends Exception(message, reason) { ... } How do I initialize a p...

Connector between node.js and Scala (Java)

What is the best way of integrating node.js with Scala (Java)? The simplest way I see so far is using Redis PubSub as a mediator, with node.js server handling HTTP requests and publishing messages to the request channel (via redis-node-client), and Scala actors (e.g. Akka Redis PubSub integration) subscribed the request channel and publi...