I need a Support Vector Machine library for Scala.
I guess that I should have a look at both Scala and Java implementations, do you recommend me to use any of them in particular?
SVMlight has JNI bindings for Java, available for download here. You shouldn't have any problems calling it from Scala code.
Here are two alternatives:
https://github.com/zsxwing/scala-svm
https://github.com/cjlin1/libsvm (has both Java and C versions). Alternative link: https://www.csie.ntu.edu.tw/~cjlin/libsvm/
I ended up using the second one from Scala without problems. It is published to Maven Central, although not the latest source version.
This one looks promising. Looks like it's constantly updated
Related
Looking for a stable Scala implementation (or something similar) of JGit.
Has anyone worked with anything like it?
I've found scala-git but it's not what I'm looking for.
I did the same search some time ago, but I concluded that it was preferable to use JGit (even if it's a Java library) in Scala. It's used by products with lots of users (eclipse, netbeans, gerrit,...) and even some Scala products like Gitbucket use it.
Its API can be easily called from Scala, and does not result in ugly code, nor needs heavy wrappers.
Personally I prefer using a Java lib widely used than a pure Scala lib for which I don't know the roadmap nor if it's still maintained. I thought to ScalaGit but it seemed really young (only 67 commits) and not actively maintained (last commit on Apr 21, 2014).
Any java library (like jgit) is perfectly usable in scala as scala run in the java runtime environment. Is there any reason why you can't use it?
Groovy seems to fix a lot of the things I dislike about Java, and I was wondering if it would be possible to actually write an Eclipse plugin in Groovy instead of Java.
Does anyone know if this is possible, and if so how to go about it?
I've just found a blog entry which says it's not officially supported but is actually possible.
Not yet tested to see if it works, but it seems promising:
Writing Eclipse plugins with Groovy, by Jörn Dinkla
#Peter, I do not think that the blog post you linked to is complete or if it will really work. It is pointing to the old version of Groovy-Eclipse, which is no longer supported and is out of date.
Yes. It is possible to create your own plugins in Groovy.
First, install the Groovy-Eclipse plugin from here:
http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7/
Then you can create a new plugin project and add the Groovy Nature.
Remove the Groovy Libraries classpath container
Instead, add the org.codehause.groovy as a required bundle
Create your Groovy code as normal
Now, the tricky part is exporting the plugin using PDE. See this blog post for how to do that: http://contraptionsforprogramming.blogspot.com/2010/08/groovy-pde-redux.html
One important thing to note is that you will need at least one Java file in your project for PDE to compile anything, It can be a dummy, empty file (this is a bug that has not yet been fixed).
Rejoice!
As an example, here is the codenarc Eclipse plugin that was written completely in Groovy:
http://sourceforge.net/projects/codenarceclipse/
You can also use JRuby, or Javascript ...
JAM Circle is a great example showing how to make great use of a scripting language in an Eclipse plugin, by allowing the end user to write his own actions and load them at runtime.
There's a proxy-like plugin that allows you to implement the plugin virtually in any language that supports JSR223 (javax.scripting)
I am new to Scala. However, I a created a medium size program with Scala 2.9.0. Now I want to use an open source library which is only available for Scala 2.7.7.
Is it possible to use this 2.7.7 library in my Scala 2.9.0 program? How can I do it? I had already a look at sbt but did not really succeed. Has someone a hello world example for this?
It should be possible in principle using a custom classloader for the 2.7.7 jar and custom wrappers. But practically, since the library is open source, it's very likely that it would be less work to recompile it with 2.9 and make those changes which are required. (There usually aren't many.)
Typesafe has an early preview of a migration manager (http://typesafe.com/technology/migration-manager) which promises to report on and resolve binary incompatibilities. Apparently the early preview only report on incompatibilities, but it might be worth a shot.
The best approach would be to either use a maintained library or to update the code.
If you take the second option, compile the code with the flags -deprecation and -Xmigration.
This tells you what you need to change between versions.
I've spent a good few hours googling for something to allow me to open Zip files in Scala (I know you can just use the Java API, but I was hoping to find a Scala friendly wrapper for it instead of faffing about writing Buffered/FileInputstream and so on)
So I was just messing about in the REPL and found this package
scala.tools.nsc.io.ZipArchive
Which after some digging and using this scala.tools.nsc.io.File, I managed to open a zip archive with all of the Scala niceness (being able to foreach etc)
The thing is I can't see any mention of this package in the official Scala 2.8.1 API document, so I was just wondering why there's no documentation on it? What is it?
this package contains Compiler-related classes. It's mainly used (as far as I know) for Plugin creation.
Due to it being related to Scala compiler, I'm not sure to which point it is a "stable" package and how much may it change between Scala versions, so be careful there.
I've been reading up on Scala a lot recently and I really want to get into it. I do my Java web development from within Eclipse with Tomcat as my preferred server and I'd like to keep it that way. I've tried the Scala Eclipse plugin but it's safe to say, it isn't there yet. I had to uninstall it because it simply ins't working. On top of that, it doesn't seem to provide anything for doing web projects (I could be wrong there).
Since Scala is a compiled language just like Java is, I was wondering if it's possible to simply swap out Java with Scala, as in, where I'd normally would create Java classes I would now be able to create Scala classes instead? Maybe even mix Java and Scala?
Is there anyone out there who's been able to set up a decent Scala workflow in Eclipse for web development without the dreaded "official" Scala Eclipse Plugin?
PS: I've tried the Play framework (I think it recently added Scala support) but it simply isn't for me. I like my classes compiled and to use JSP's for my views.
You don't say anything about what version of the Scala IDE for Eclipse you were using, or what you tried to do to resolve your issues. I suggest that before changing your workflow you head over to http://groups.google.com/group/scala-ide-user and see if we can help you out.
Since Scala is a compiled language
just like Java is, I was wondering if
it's possible to simply swap out Java
with Scala, as in, where I'd normally
would create Java classes I would now
be able to create Scala classes
instead?
Yes, absolutely. That's one of Scala's big advantages over some other JVM languages.
Maybe even mix Java and Scala?
Yes, absolutely. That's one of Scala's big advantages over some other JVM languages.
Make sure you have familiarity with the Java and Scala collections libraries (and that you keep them straight -- if you're planning using advanced Scala features on Java collections, definitely use a Scala 2.8 release candidate). Also make sure you're faimilar with the #BeanProperty annotation -- it can simplify your Scala coding somewhat.
As Miles said, you should give us the version of Eclipse you are working with.
I'm also new to Scala and found difficult to work through Eclipse. I was using Eclipse Galileo 3.5.2 and found specially long to compile all the scala libraries. I switched to IntelliJ (IDEA 9.0.2) and I'm much more confortable now. I recomend trying it although it's more a personal matter.
Even so, I agree, the plugins are not there yet specially for web development. The great news is that you can use everything you have in Java and mix it with Scala. Since Scala is compiled to Java BitCode, they are totally compatible. See Combining Scala and Java.
When writing in Scala you always have (almost) all the Java libraries at your service plus anything you have created before. You will have to be carefull with the types (i.e. primitive types) but it normally works out very well.