The blog on systems development/architecture, to be a beautiful, artistic one.
Showing posts with label Scala. Show all posts
Showing posts with label Scala. Show all posts
Friday, 25 December 2015
Monday, 14 December 2015
Sunday, 2 August 2015
Fibonacci Number and their Factors
Friday, 31 July 2015
Functional Patterns - zip
Friday, 17 July 2015
difference between method and function in Scala
The official ScalaReference says Method types do not exist as types of values.
[cont.]
#scala #scalajp
— Rhizome (@rhizome1976) August 19, 2013
If a method name is used as a value, its type is implicitly converted to a corresponding function type (§6.26).
#scala #scalajp
— Rhizome (@rhizome1976) August 19, 2013
Wednesday, 3 June 2015
How to create XML models in Scala? - scalaxb
How to create XML models in Scala?
Currently the way to create XML models in Scala (like JAXB) is scalaxb, cf. https://github.com/eed3si9n/scalaxb, http://scalaxb.org/.
Among several ways, to run scalaxb sbt-scalaxb is the simplest one to do so but I believe there is no full covered procedure for that so I write it here :)
Let's say we use scalaxb 1.3.0.
Note: As of Scala 2.11, you need to write the parsing library dependency separately, like
That's it.
Currently the way to create XML models in Scala (like JAXB) is scalaxb, cf. https://github.com/eed3si9n/scalaxb, http://scalaxb.org/.
Among several ways, to run scalaxb sbt-scalaxb is the simplest one to do so but I believe there is no full covered procedure for that so I write it here :)
Let's say we use scalaxb 1.3.0.
1. Set up sbt files.
To call scalaxb from sbt 0.13.x, put this in your
project/scalaxb.sbt
:resolvers += Resolver.sonatypeRepo("public")
addSbtPlugin("org.scalaxb" % "sbt-scalaxb" % "1.3.0")
and this in
scalaxb.sbt
:scalaxbSettings
// Write your own package
packageName in scalaxb in Compile := "com.blogger.xml"
sourceGenerators in Compile <+= scalaxb in Compile
// The version of Dispatch, which is an HTTP access library and in some cases scalaxb depends on.
dispatchVersion in scalaxb in Compile := "0.11.2"
Note: As of Scala 2.11, you need to write the parsing library dependency separately, like
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"
2. Put XSD files into src/main/xsd.
3. Run $ sbt scalaxb on your project.
4. You'll see generated sources in target/scala-2.11/src_managed/main/sbt-scalaxb.
Wednesday, 9 July 2014
When a Scalaist has to use Java
Use Guava, the library by Google!
https://code.google.com/p/guava-libraries/wiki/GuavaExplained
That enables you to write in functional style.
Subscribe to:
Posts (Atom)