This file contains 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 find_max(const int *a,const int length) { | |
int i,max = a[0]; | |
for(i = 1; i < length; i++) | |
if(a[i] > max) max = a[i]; | |
return max; | |
} | |
This file contains 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
RAILS_GEM_VERSION = '2.2.1' unless defined? RAILS_GEM_VERSION | |
require File.join(File.dirname(__FILE__), 'boot') | |
Rails::Initializer.run do |config| | |
config.load_paths += %W(#{RAILS_ROOT}/vendor/sentry/lib) | |
config.gem "rubyinxs" | |
config.gem "money" | |
This file contains 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> | |
#include <stdlib.h> | |
void merge(int *array,const int p, const int q,const int r) { | |
int n1 = q-p; | |
int n2 = r-q; | |
int *left = malloc((n1)*sizeof(int)); | |
int *right = malloc((n2)*sizeof(int)); | |
int i,j,k; | |
for(i = 0; i < n1; i++) left[i] = array[p+i]; |
This file contains 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/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::Error) | |
from /usr/lib/ruby/1.8/timeout.rb:56:in `timeout' | |
from /usr/lib/ruby/1.8/timeout.rb:76:in `timeout' | |
from /usr/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' | |
from /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' | |
from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline' | |
from /usr/lib/ruby/1.8/net/http.rb:2029:in `read_status_line' | |
from /usr/lib/ruby/1.8/net/http.rb:2018:in `read_new' | |
from /usr/lib/ruby/1.8/net/http.rb:1059:in `request' | |
... 24 levels... |
This file contains 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 eventfax.core._ | |
import eventfax.protocol._ | |
import scala.actors._ | |
import scala.actors.Actor._ | |
import java.io.IOException | |
import java.util.Date | |
case class PingMessage(sessionId: String,message: String) | |
case class PongMessage(sessionId: String,message: String) | |
This file contains 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
# crux of thin patch | |
def pre_process | |
# Add client info to the request env | |
@request.remote_address = remote_address | |
# Process the request calling the Rack adapter | |
@app.call(@request.env) do |result| | |
post_process(result) | |
end | |
rescue Object |
This file contains 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
package new_job | |
import scala.actors.{Actor} | |
import java.io.File | |
import scala.actors.Actor._ | |
case class Job(folder: File, index: Int) | |
class MyScheduler(var jobs: List[Job]) extends Actor { | |
var done = List[Job]() |
This file contains 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
package new_job | |
import scala.actors.{Actor} | |
import java.io.File | |
import scala.actors.Actor._ | |
case class Job(folder: File, index: Int) | |
class MyScheduler(var jobs: List[Job]) extends Actor { | |
var done = List[Job]() |
This file contains 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
find_header: checking for #include <iconv.h> | |
... -------------------- yes | |
"gcc -E -I. -I/opt/ruby186/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -o conftest.i" | |
checked program was: | |
/* begin */ | |
1: #include <iconv.h> | |
/* end */ | |
-------------------- |
This file contains 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 "active_support" | |
require "chronic" | |
module BackgrounDRb | |
class CronTrigger | |
WDAYS = { 0 => "Sunday",1 => "Monday",2 => "Tuesday",3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday" } | |
LeapYearMonthDays = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] | |
CommonYearMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] |