library

The karma of bad software documentation alvin May 18, 2017 - 3:43pm

Tried to use someone’s software library.
Documentation was bad, couldn’t get it to work.
Used someone else’s.

#haiku-ish

How to use the Spring Framework in Scala

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 17.4, “How to use the Spring Framework in Scala.”

Problem

You want to use the Java Spring Framework library in your Scala application.

Solution

In my experience, the only real changes in using the Spring Framework in Scala applications involve how you cast the objects you instantiate from your Spring application context file, and that’s only because the casting process is different between Scala and Java.

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

How to access HTTP response headers after making an HTTP request with Apache HttpClient

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a very short recipe, Recipe 15.12, “How to access HTTP response headers after making an HTTP request with Apache HttpClient.”

Problem

You need to access the HTTP response headers after making an HTTP request in your Scala code.

Solution

Use the Apache HttpClient library, and get the headers from the HttpResponse object after making a request:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

How to find good Scala libraries alvin June 20, 2015 - 4:22pm

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a short recipe, Recipe 14.7, “How to find good Scala libraries.”

Problem

Ruby has the RubyGems package manager, which lets developers easily distribute and manage the installation of Ruby libraries; does Scala have anything like this?

Android Studio - How to import a jar file (in a libs folder)

I just started using Android Studio 1.x and quickly ran into a problem where I needed to use a Jar file in my Android project. In short, this image shows the steps I followed to import the Jar file into my project. As an important note, I put the Jar file I needed in an app/libs folder, which I created in my project. As the image shows, this affects your Gradle build configuration. (I found this info at this SO link.)

Scala can’t find the JavaFX jar/library (SBT solution) alvin November 1, 2014 - 9:37am

Something I learned the hard way yesterday ... JavaFX ships with JDK 7, but it’s not in the classpath. This image shows the solution for when you want to use JavaFX in a Scala/SBT application. I found this answer on the ScalaFX website.

How to load multiple library dependencies in SBT

SBT FAQ: How do I load multiple library dependencies in SBT? (i.e., what is the correct syntax?)

Solution: Use a Seq with the libraryDependencies syntax in your build.sbt file:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.