If you are on RHEL make sure optional repos are enabled:
subscription-manager repos --enable rhel-7-server-optional-rpms
Then install yum-cron:
A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)
I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.
A functor is something that supports map
.
To generate a pom.xml file just run gradle writeNewPom
If you want to generate it as pom.xml in the root of the project, replace writeTo("$buildDir/newpom.xml")
with writeTo("pom.xml")
complete -W "\`grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'\`" make |
**************************************************************************** | |
**** FaunaDB Relations: GraphQL schemas, mutations and resulting documents * | |
**************************************************************************** | |
**** One to One Relation *************************************************** | |
SCHEMA: | |
type User { name: String! car: Car } | |
type Car { plate: String! owner: User } | |
MUTATION: | |
mutation Create { | |
createUser(data: { |
apply plugin: 'application' | |
apply plugin: 'scala' | |
repositories { | |
mavenLocal() | |
mavenCentral() | |
} | |
mainClassName = 'PushkaTest.MainApp' |
I was curious about the results reported here, which reports that Scala's mutable maps are slower than Java's: http://www.infoq.com/news/2011/11/yammer-scala
In my tests, Scala's OpenHashMap equals or beats java's HashMap:
Insertion 100k elements (String keys) time in ms:
//Adapted from: https://github.com/jcrobak/avro-examples | |
import org.apache.spark.SparkContext | |
import org.apache.spark.SparkContext._ | |
import org.apache.avro.generic.GenericRecord | |
import org.apache.avro.mapred.AvroKey | |
import org.apache.avro.mapreduce.AvroKeyInputFormat | |
import org.apache.hadoop.io.NullWritable | |
import org.apache.commons.lang.StringEscapeUtils.escapeCsv |
object Mappable { | |
implicit class ToMapOps[A](val a: A) extends AnyVal { | |
import shapeless._ | |
import ops.record._ | |
def toMap[L <: HList](implicit | |
gen: LabelledGeneric.Aux[A, L], | |
tmr: ToMap[L] | |
): Map[String, Any] = { | |
val m: Map[tmr.Key, tmr.Value] = tmr(gen.to(a)) |