次のようにproject/Build.scala を編集する。
object ApplicationBuild extends Build {
// ...
val appDependencies = Seq(
"commons-daemon" % "commons-daemon" % "1.0.10"
)
// ...
# NOTE: This code was extracted from a larger class and has not been | |
# tested in this form. Caveat emptor. | |
import django.conf | |
import django.contrib.auth | |
import django.core.handlers.wsgi | |
import django.db | |
import django.utils.importlib | |
import httplib | |
import json | |
import logging |
Pipeline pipeline = jedis.pipelined(); | |
long start = System.currentTimeMillis(); | |
for (int i = 0; i < 100000; i++) { | |
pipeline.set("" + i, "" + i); | |
} | |
List<Object> results = pipeline.execute(); | |
long end = System.currentTimeMillis(); | |
System.out.println("Pipelined SET: " + ((end - start)/1000.0) + " seconds"); |
/* | |
WorkCrew - a WebWorker work queue library | |
Usage: | |
// Create an 8 worker pool using worker.js. | |
var crew = new WorkCrew('worker.js', 8); | |
// Do something whenever a job is completed. | |
// The result object structure is |
//////////////////////push_notifications.js/////////////////////// | |
var apns = function(){ | |
var pref = require('preferences').preferences; | |
Titanium.Network.registerForPushNotifications({ | |
types: [ | |
Titanium.Network.NOTIFICATION_TYPE_BADGE, | |
Titanium.Network.NOTIFICATION_TYPE_ALERT | |
], | |
success:function(e) |
package com.example; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.LinkedBlockingQueue; | |
import org.fluentd.logger.FluentLogger; |
# Upstart script for a play application that binds to an unprivileged user. | |
# put this into a file like /etc/init/play.conf | |
# | |
# This could be the foundation for pushing play apps to the server using something like git-deploy | |
# By calling service play stop in the restart command and play-start in the restart command. | |
# | |
# Usage: | |
# start play | |
# stop play | |
# restart play |
# encoding: utf-8 | |
# FastCGI-to-WSGI bridge for files/pipes transport (not socket) | |
# | |
# Copyright (c) 2002, 2003, 2005, 2006 Allan Saddi <allan@saddi.com> | |
# Copyright (c) 2011 Ruslan Keba <ruslan@helicontech.com> | |
# Copyright (c) 2012 Antoine Martin <antoine@openance.com> | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without |
Copyright [2012] [Gianluca Tessarolo] | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, |