次のようにproject/Build.scala を編集する。
object ApplicationBuild extends Build {
// ...
val appDependencies = Seq(
"commons-daemon" % "commons-daemon" % "1.0.10"
)
// ...
/* A JSON gzip compression filter, which could easily be adapted to any pattern needed. This uses a custom AfterFilter | |
* type which is just a fancy wrapper of Action<NancyContext>. It's useful for convention based loading of filters | |
*/ | |
public class GzipCompressionFilter : AfterFilter | |
{ | |
protected override void Handle(NancyContext ctx) | |
{ | |
if ((ctx.Response.ContentType == "application/json") && ctx.Request.Headers.AcceptEncoding.Any( |
import javafx.scene.layout.StackPane; | |
import javafx.scene.web.WebView; | |
/** | |
* A syntax highlighting code editor for JavaFX created by wrapping a | |
* CodeMirror code editor in a WebView. | |
* | |
* See http://codemirror.net for more information on using the codemirror editor. | |
*/ | |
public class CodeEditor extends StackPane { |
[[syntax trees at end of parser]]// Scala source: Person1.scala | |
package <empty> { | |
object Main extends scala.ScalaObject { | |
def <init>() = { | |
super.<init>(); | |
() | |
}; | |
def main(argv: Array[String]): scala.Unit = { | |
val args = argv; | |
{ |
//domready2.js | |
// without jQuery (doesn't work in older IEs) | |
document.addEventListener('DOMContentLoaded', function(){ | |
// your code goes here | |
}, false); | |
// and here's the trick (works everywhere): | |
r(function(){ | |
alert('DOM Ready!'); |
<configuration> | |
<conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" /> | |
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
<file>${application.home}/logs/application.log</file> | |
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
<fileNamePattern>${application.home}/logs/application.%d{yyyy-MM-dd}.log</fileNamePattern> | |
<maxHistory>14</maxHistory> | |
</rollingPolicy> | |
<encoder> | |
<charset>UTF-8</charset> |
trait IdConfig { | |
val timestampBits: Int | |
val dataCenterIdBits: Int | |
val workerIdBits: Int | |
val sequenceBits: Int |
This is work in progress
I read about the .NET Generic Host for the first time in a Tweet of David Fowler. And I was hooked by the idea, it was just what I was looking for.
I like modules making things small but fit together like pieces of a puzzle, if possible being able to reuse them. I started refactoring Greenshot over a year ago, and was making modules out of the spaghetti code that it was. Trying to extract the modules into their own nuget packages, making them more generic and testable. I glued them together with some code I wrote, which is availble in Dapplo.Addons, but I knew that this was just a journey, until I found something that is a better with more potential.
I found the following description: _The purpose of Generic Host is to enable a wider array of host scenarios. Messaging, backg