Skip to content

Instantly share code, notes, and snippets.

import java.util.ArrayList
import java.util.LinkedList
import java.util.List
trait Benchmark {
def run(func: => Unit) = {
val startedAt = System.currentTimeMillis
func
val stoppedAt = System.currentTimeMillis
println("Time taken is :" + (stoppedAt - startedAt))
Welcome to GNU Emacs, one component of the GNU/Linux operating system.
Emacs Tutorial Learn basic keystroke commands
Emacs Guided Tour Overview of Emacs features at gnu.org
View Emacs Manual View the Emacs manual using Info
Absence of Warranty GNU Emacs comes with ABSOLUTELY NO WARRANTY
Copying Conditions Conditions for redistributing and changing Emacs
Ordering Manuals Purchasing printed copies of manuals
fdfd
c = (HttpConnection)Connector.open(url, Connector.READ_WRITE, false);
c.setRequestMethod(HttpConnection.POST);
c.setRequestProperty("Content-Language", "en-US");
c.setRequestProperty( "User-Agent", "Mozilla/4.0");
c.setRequestProperty( "Content-Type", "application/x-www-form-urlencoded");
c.setRequestProperty( "Content-Length", encodedData.length() );
os = c.openOutputStream();
String rStr = this.req.toString();
os.write(("mobile_request=" +rStr).getBytes());
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
public class URLEncoder {
public static String encode(String s, String enc)
throws UnsupportedEncodingException {
require "thread"
KNOWN_ACTORS = {}
THREAD_POOL = []
GLOBAL_MUTEX = Mutex.new
Thread.abort_on_exception = true
class JRubyActor
attr_reader :name,:block
An exception occurred running ./script/server
method 'exit': given 0, expected 1 (ArgumentError)
Backtrace:
Process.daemon at /home/crriadmin/rubinius/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/process/daemon.rb:4
main.__script__ at /home/crriadmin/rubinius/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:62
Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:242
Requirer::Utils.single_load at kernel/delta/requirer.rb:267
Requirer::Utils.unified_load {} at kernel/delta/requirer.rb:140
Array#each at kernel/bootstrap/array.rb:156
Read error: #<ObjectBoundsExceededError: fetch is more than available bytes>
kernel/common/io.rb:152:in `shift'
kernel/common/io.rb:1164:in `read_all'
kernel/common/io.rb:1130:in `read'
/home/crriadmin/rubinius/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:27:in `tail_log'
/home/crriadmin/rubinius/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:18:in `call'
/home/crriadmin/rubinius/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/home/crriadmin/rubinius/gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in `call'
/home/crriadmin/rubinius/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in `process'
/home/crriadmin/rubinius/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client {}'
From 865176c6fe90aa5262317a24fd7df15cc7685018 Mon Sep 17 00:00:00 2001
From: Hemant Kumar <gethemant@gmail.com>
Date: Sat, 3 Apr 2010 03:09:03 +0530
Subject: [PATCH] fix the exit status code of exit!
---
kernel/common/kernel.rb | 2 +-
kernel/common/process.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
#define EXIT_FAILURE 1
static VALUE
rb_f_exit_bang(argc, argv, obj)
int argc;
VALUE *argv;
VALUE obj;
{
VALUE status;
int istatus;