This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Mon, 05 Jul 2010 18:07:05 +0100] ERROR: Re-raising exception: NoMethodError - undefined method `[]' for nil:NilClass | |
/tmp/chef-solo/cookbooks/runit/definitions/runit_service.rb:23:in `from_file' | |
/usr/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/mixin/recipe_definition_dsl_core.rb:49:in `instance_eval' | |
/usr/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/mixin/recipe_definition_dsl_core.rb:49:in `method_missing' | |
/tmp/chef-solo/cookbooks/chef/recipes/bootstrap_client.rb:56:in `from_file' | |
/usr/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/cookbook_version.rb:316:in `load_recipe' | |
/usr/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/mixin/language_include_recipe.rb:40:in `include_recipe' | |
/usr/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each' | |
/usr/lib/ruby/gems/1.8/gems/chef-0.9.6/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe' | |
/tmp/chef-solo/cookbooks/chef/recipes/bootstrap_server.rb:30:in `from_file' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'eventmachine' | |
require 'socket' | |
class Smtp < EM::P::SmtpServer | |
require 'ostruct' | |
@@received = 0 | |
def initialize(*args) | |
super | |
@cache = "/tmp/cache" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/smtp' | |
FILE = File.readlines("foo1") | |
class Email | |
def initialize | |
@smtp = Net::SMTP.new('127.0.0.1', 2025) | |
end | |
def post(from, to) | |
msgstr = <<EOF | |
From: <#{from}> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.actors.Actor | |
import scala.actors.Actor._ | |
import javax.mail._ | |
import javax.mail.internet._ | |
import java.util.Properties._ | |
case class Request(sender : Actor, payload : String) | |
case class Ready(sender : Actor) | |
case object Stop | |
object Client extends Application { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import javax.mail.*; | |
import javax.mail.internet.*; | |
import java.io.*; | |
public class ThreadExample { | |
private static class WorkerThread extends Thread { | |
javax.mail.internet.MimeMessage message; | |
public WorkerThread(String body) { | |
Properties properties = System.getProperties(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require("sys"), | |
http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"); | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname; | |
var filename = path.join(process.cwd(), uri); | |
path.exists(filename, function(exists) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'eventmachine' | |
require 'evma_httpserver' | |
require 'uri' | |
class Static < EM::Connection | |
include EM::HttpServer | |
def post_init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int bsearch(int left, int right, int find, int *a) { | |
if (left > right) | |
return -1; | |
int mid = (left + right) / 2; | |
if (find == a[mid]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..100}; do echo foo; done | |
for ((i=1; i<=100; i++)); do echo foo; done | |
for `seq 1 100`; do echo foo; done | |
# while version | |
i=1; while [ $i -le 100 ]; do echo foo; i=$(($i+1)); done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local store = {} | |
local function add(key, value) | |
store[key] = value | |
end | |
local function get(key) | |
return store[key] | |
end |
OlderNewer