Skip to content

Instantly share code, notes, and snippets.

java.io.FileNotFoundException: /NEOCAST/etc/NettyModule.cfg (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileReader.<init>(FileReader.java:55)
at org.rdm.util.propertylist.PropertyList.createFrom(PropertyList.java:131)
at com.rdm.neocast.server.model.database.MediaPlayer.findFromCommandLineArguments(MediaPlayer.java:506)
at com.rdm.neocast.server.model.database.MediaPlayer.findFromCommandLineArguments(MediaPlayer.java:629)
at com.rdm.neocast.server.model.database.MediaPlayer.findFromCommandLineArguments(MediaPlayer.java:644)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
java.lang.NullPointerException: null (NativeException)
com/rdm/neocast/server/logic/GenerateDownloadMediaLogic.java:137:in `<init>'
com/rdm/neocast/server/logic/GenerateDownloadMediaLogic.java:175:in `<init>'
sun/reflect/NativeConstructorAccessorImpl.java:-2:in `newInstance0'
sun/reflect/NativeConstructorAccessorImpl.java:39:in `newInstance'
sun/reflect/DelegatingConstructorAccessorImpl.java:27:in `newInstance'
java/lang/reflect/Constructor.java:513:in `newInstance'
org/jruby/javasupport/JavaConstructor.java:226:in `new_instance'
org/jruby/java/invokers/ConstructorInvoker.java:114:in `call'
org/jruby/java/invokers/ConstructorInvoker.java:201:in `call'
@zaach
zaach / Gemfile
Created February 19, 2010 05:27 — forked from indirect/Gemfile
# include at least one source and the rails gem
source :gemcutter
gem "rails", "~> 2.3.5", :require => nil
gem "sqlite3-ruby", :require => "sqlite3"
group :development do
# bundler requires these gems in development
gem 'rails-footnotes'
end
alert('oh hai.');
import scala.collection.mutable._
// I want these std functions to be implicit:
implicit def tupled[a1, a2, b] = Function.tupled[a1, a2, b](_)
implicit def untupled[a1, a2, b] = Function.untupled[a1, a2, b](_)
class Connection
class ConnectionPool(size: Int) {
def withConnection[A](f: Connection => A) = f(new Connection)
APACHE:
$ ab -k -c 50 -n 20000 http://127.0.0.1/statread.js 2>&1 | grep "Requests per second"
Requests per second: 12370.69 [#/sec] (mean)
NGINX:
$ ab -k -c 50 -n 20000 http://127.0.0.1/statread.js 2>&1 | grep "Requests per second"
Requests per second: 20262.73 [#/sec] (mean)
NODE:
$ ab -k -c 50 -n 20000 http://127.0.0.1:8000/statread.js 2>&1 | grep "Requests per second"

Tests to do:

Create an environment with 4 (at least >2) servers each running a single process with 40 writing threads. Each writing thread should insert a new document at some prescribed rate (maybe make the threads and the document insertion a configuration parameter?)

Have each of these servers writing to one or more of the nosql "servers" (depending on architecture) -- maybe run one test where all the writes are going to one server, and another where they are spread.

Then lets see how long it takes for each of the servers in a cluster to "catch up" (e.g. what is the lag time average and std dev -- if thats even possible to compute) before a new document is replicated around.

Once we have a feel for this, lets repeat the test but pull one server out of the replication environment. We should do this test twice, once where we remove the server gracefully and once violently. In both cases we'll leave the server "offline" for several tens-of-minutes or hours. Then lets compute the number of documents th

// Map/Reduce with Promises on Narwhal+Node
var SYSTEM = require("system");
var EL = require("event-loop");
var Q = require("narwhal/promise");
var UTIL = require("narwhal/util");
// to simulate a long latency, promise-returning API
var delay = function (timeout) {
var deferred = Q.Deferred();

2010 Modularity Olympics

This is a contest, open to programming languages from all nations, to write modular and extensible code to solve the following problem: Implement a service that can run queries on a database.

The Challenge

Sounds simple right? Wrong! A programmer without control over the source-code of that service must be able to later add enhancements such as statistics collecting, timeouts, memoization, and so forth. There are a few more requirements:

  1. the “enhancements” must be specified in a configuration object which is consumed at run-time (e.g., it could be based on user-input).
  2. The enhancements are ordered (stats collecting wraps timeouts, not the other way around) but it must be possible to reverse the order of the enhancements at run-time.
  3. The enhancements must be “surgical” and not “global”. That is, it must be possible to simultaneously have two query services, one reversed and one not reversed, and even have a query service without any enhancements.
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.10 (Darwin)
mQENBEtsQe8BCACm5G0/ei0IxyjVEp6EEtbEbWK1Q4dKaONtiCODwB8di+L8tlUd
Ra5QYxeyV90C+dqdh34o79enXxT6idHfYYqDdob2/kAPE6vFi4sLmrWIVGCRY++7
RPclZuezPm1sxG1TRAYEsW0VZUE9ofdoQ8xlUZDyn2BSjG8OCT2e4orRg1pHgzw2
n3hnWqJNuJS4jxcRJOxI049THIGUtqBfF8bQoZw8C3Wg/R6pGghUfNjpA6uF9KAH
gnqrC0swZ1/vwIJt9fnvAlzkqLrssYtKH0rMdn5n4g5tJLqY5q/NruHMq2rhoy3r
4MC1w8GTbP7qR83wAyaLJ7xACOKqxB3SrDFJABEBAAG0I1JpY2hhcmQgS3JldXRl