This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Natalino Busa | |
// twitter.com/natalinobusa | |
// linkedin.com/in/natalinobusa | |
// www.natalinobusa.com | |
import org.apache.commons.codec.binary.Base64.decodeBase64 | |
object Test extends Controller { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.natalinobusa.jpa | |
import javax.persistence._ | |
@Entity | |
@Table(name = "buddy") | |
class Buddy(first: String, last: String) { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
var id: Int = _ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence | |
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" | |
version="2.0"> | |
<persistence-unit name="com.natalinobusa.jpa.HibernateJpaScalaTutorial"> | |
<description> | |
Persistence unit for the JPA tutorial of the Hibernate Getting Started Guide | |
</description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.natalinobusa.jpa | |
import javax.persistence.EntityManager | |
import javax.persistence.EntityManagerFactory | |
import javax.persistence.Persistence | |
import scala.collection.JavaConversions._ | |
object HibernateJpaScalaTutorial { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import Keys._ | |
object BuildSettings { | |
val buildOrganization = "http://natalino.busa.nl" | |
val buildVersion = "1.0.0" | |
val buildScalaVersion = "2.9.2" | |
val buildSettings = Defaults.defaultSettings ++ Seq ( | |
organization := buildOrganization, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api._ | |
import play.api.mvc._ | |
sealed trait ChainedAction[A] extends Action[A] | |
object ChainedAction { | |
def apply[A](bodyParser: BodyParser[A])(block: Request[A] => Action[A]): ChainedAction[A] = | |
new ChainedAction[A] { | |
def parser = bodyParser | |
def apply(request: Request[A]) = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Collection extends Controller { | |
def v1Index(path: String) = ChainedAction { | |
request => | |
println("v1Index" + ' ' + request.queryString.toString()) | |
if (1>0) | |
v1Next(path, "foo") | |
else | |
Action(Ok("never here")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Natalino Busa | |
# twitter.com/natalinobusa | |
# linkedin.com/in/natalinobusa | |
# www.natalinobusa.com | |
import numpy as np | |
from matplotlib import pyplot | |
def special(p, pos_start, pos_end): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Natalino Busa | |
# twitter.com/natalinobusa | |
# linkedin.com/in/natalinobusa | |
# www.natalinobusa.com | |
import numpy as np | |
from matplotlib import pyplot | |
size=100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE followers ( | |
key text, | |
created timestamp, | |
messages_count int, | |
likes_count int, | |
PRIMARY KEY (key) | |
); |
OlderNewer