Sample: Calendar for Play2.0- scala - scala

I need to add a calendar to my website for managing events and I found this sample but it's only for Java. I tried to make a scala version of it but I get stuck at some points.
So I was wondering if there is something similar to it but for scala version.
Thanks a lot!

As #pedrofurla already said, just use it from scala. It's one of the scala's pros -- you can seamlessly use java code.

Related

Find out play! version number (e.g. 2.1.3) in application code

Does anyone know how to find out which version of play! an application is running with during runtime? I thought there might perhaps be something like play.api.Play.current.frameworkVersion.
I searched the API doc at http://www.playframework.com/documentation/api/2.1.x/scala/index.html#package for anything useful, but could not find anything.
I think I probably could hack together something like writing the SBT plugin version into a file during the compile/stage which I can then read at runtime. But I was hoping there would be a less cumbersome way of doing this...
Cheers, Alex
How about:
play.core.PlayVersion.current();
found in: http://www.playframework.com/documentation/api/2.2.0-M2/scala/index.html#play.core.PlayVersion$

Scala Support Vector Machine library

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

Is there a Scala like Clojurescript? aka Integrated Scala Single Page Application

So ClojureScript One is rather incredible looking! You can make updates with your REPL in real time to a SPA.
So something like this is rather impossible in Java where you don't have a REPL but it seems very possible in something like Groovy or Scala. I'm sort of a Lisp bigot (I really shouldn't be but oh well) and wondering if there is a Scala or Groovy like Clojurescript?
Update:
In theory it looks like one could wrap Scala/Groovy around Java's ItsNat. However I have some doubts about that project given it hasn't been updated since 2011 (also they have they ugliest website.. its like they tried to make it ugly). The license is also rather restrictive.
Try http://www.scala-js.org/ a A Scala to JavaScript compiler
There's js-scala, but it seems to be quite experimental at the moment.
ItsNat has come to quit a stable stage, this is why it is inactive. Of course new features and more browser support and testing can be leveraged, but so far, we've had a great experience with ItsNat. We've been with ItsNat since version 0.7 and had very (2) issues, that too, quite rare ones.
If you'd like working examples, I'd be glad to show you as our project is open sourced :-)
Works well with both SEO and SPI.
Demo
If you are looking for SPA scala-gwt. Or you are looking for scala-to-javascript compiler?

Xtext auto-suggest value

I am working on Xtext project. I need feature for my variable declaration. Assume I am using my DSL like one below
LifeEra:Teenage
Age:(while cursor is here)
I wonder if I can get pop-up down here and suggesting 16 since LifeEra entered Teenage. Is there anyway I may achieve that.
Hope my question is clear.
Thank you.
As I understood, code complete from dynamic values is not possible only using Xtext. But developing an Eclipse plugin for your own DSL may help. I couldn't find any other way.
You can indeed customize content assist for your DSL. See http://www.eclipse.org/Xtext/documentation.html#contentAssist and http://zarnekow.blogspot.de/2011/06/customizing-content-assist-with-xtext.html.

Are there any Scala template engines other than scalate?

I'm tring to embed scalate in my website with sbt+jrebel, but found there are some problems I can't resolve.
So I want to know if there any other template engines based on scala?
How about popping on the Scalate group and describing the actual problems you're having? Am sure its fairly straight forward to work around? If the issue you're having is to do with sbt + jrebel and class reloading of scala code that you want to use inside your template engine; switching template engine's isn't sounding like an option (unless you want to stop using Scala in your templates). Plus Scalate is really the best and most popular template engine that uses Scala expressions inside it.
Play framework for scala has a brand new scala template engine
not sure if it can be used outside of play
http://scala.playframework.org/documentation/scala-0.9.1/templates
Pure Scala DSLs:
scala-xml (not sure how long this will be supported though)
ScalaTags
"Regular" templating engines:
Twirl
JSP (Java)
Freemarker (Java)
Velocity (Java)
Thymeleaf (Java)
Mustache.java (Java)
Thanks to String Interpolation from Scala 2.10, now we can use native syntax to generated a complex text content.
Just use Fastring. It has both good performance and simple usage.
If you're running on the JVM, Scala's interoperability with Java would let you use Velocity or Freemarker.
I might want to look at Stitchr which was largely inspired by StringTemplate
Scalasti is a Scala wrapper around StringTemplate.
As already mentioned above, I would recommend using Twirl (the template system from Play). It's now very easy to use standalone. You'll have compile time checking of your templates and many more cool and simple stuff:
https://github.com/spray/twirl