Posts

Showing posts from October, 2016

Regular expression keep matched value

Simply use () to quote the value you would like to keep in the result. String selectedText = "abcdefghi"; selectedText = selectedText.replace(/(a)(b)(c)(d)(e)(f)(g)(h)(i)/g, "$1- $2- $3- $4- $5- $6- $7"); // selectedText "a-b-c-d-e-f-g-h-i"

Managing database evolutions

Image
https://www.playframework.com/documentation/2.5.x/Evolutions When you use a relational database, you need a way to track and organize your database schema evolutions. Typically there are several situations where you need a more sophisticated way to track your database schema changes: When you work within a team of developers, each person needs to know about any schema change. When you deploy on a production server, you need to have a robust way to upgrade your database schema. If you work on several machines, you need to keep all database schemas synchronized. Enable evolutions Add  evolutions  into your dependencies list. For example, in  build.sbt : libraryDependencies += evolutions Running evolutions using compile-time DI If you are using  compile-time dependency injection , you will need to mix in the EvolutionsComponents  trait to your cake to get access to the ApplicationEvolutions , which will run the evolutions when instantiated. Since ...