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
def dispatch_action(klass, action, status = 200) | |
controller = klass.new(self, status) | |
- if Dispatcher.use_mutex then | |
+ if nil then | |
@@mutex.synchronize { controller._dispatch(action) } | |
else | |
controller._dispatch(action) | |
end | |
controller | |
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
/home/gnufied/eventfax/examples~ scalac -cp ../target/eventfax-1.0.0.jar:../lib/xlightweb-2.0-beta-2.jar:../lib/xSocket-2.1.1.jar:. ConsumeFormPost.scala | |
ConsumeFormPost.scala:49: error: type mismatch; | |
found : AccountActivity | |
required: org.xlightweb.IHttpResponseHandler | |
val handler: IHttpResponseHandler = new AccountActivity() | |
^ | |
=== code | |
class AccountActivity extends IHttpResponseHandler { | |
def onResponse(response: IHttpResponse) = { | |
val status = response.getStatus() |
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 'base64' | |
require 'openssl' | |
module PayNowWidgetUtils | |
def generate_signed_form(access_key, aws_secret_key, form_params) | |
form_params['accessKey'] = access_key | |
# lexicographically sort the form parameters | |
# and create the canonicalized string | |
str_to_sign = "" |
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 "net/ssh" | |
module Kernel | |
def with_rsh(host,username,options = {},&block) | |
a = RemoteShell.new(host,username,options) | |
a.start(&block) | |
end | |
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
I am planning to have sites/slice like functionality in my rails app, so as I can roll quick customizations | |
for potential clients (like themes, but more than that). | |
Questions is, for sharing static resources (js,css,images,flash....), I have two options: | |
1. Keep client specific static files in RAILS_ROOT/sites/client_name/public/{javascripts,images,stylesheets} | |
and render them through overridden tag helpers. Down side, is, these static resources won't be then accessible via | |
front end webserver (nginx/apache) and most code I have seen use send_data or something like that to render them. | |
But the up side is each client specific site/slice is self contained. Such as: |
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
~ Connecting to database... | |
/usr/lib/ruby/gems/1.8/gems/merb_activerecord-0.9.4/lib/merb/orms/active_record/connection.rb:79:in `register_session_type': undefined method `register_session_type' for Merb:Module (NoMethodError) | |
from /usr/lib/ruby/gems/1.8/gems/merb_activerecord-0.9.4/lib/merb_activerecord.rb:12:in `run' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/bootloader.rb:99:in `run' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:172:in `bootup' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:42:in `start' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core.rb:169:in `start' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/bin/merb:11 | |
from /usr/bin/merb:19:in `load' | |
from /usr/bin/merb:19 |
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
#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
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
/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... |
OlderNewer