URL url = new URL("https://dev.psigate.com:7989/Messenger/XMLMessenger");
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setDoInput(true);
...
Java PSiGate
biggest_square = 0 [1,4,3,5].each do |base| (temp = square(base)) > biggest_square && biggest_square = temp ...
Ruby On Conditional Assignment
by danielharan,
September 21, 2008 19:38
Tien - I voted 5 for your 2...
def square(number) return number**2 end ...
Ruby On Conditional Assignment
by danielharan,
September 21, 2008 16:23
Tien Dung's last function i...
for feedback in @feedbacks
1.upto(20) do |i|
# unless (answer = feedback.question(i)).nil? # lets you avoid a second call
...
# For the initial view, there's a better way to keep track of 'count' # each_with_index is in Enumerable <ul id="lastfm_update_list"> ...
Ruby On Think this needs a loop
by danielharan,
September 06, 2008 20:31
What Elij wrote. It avoids ...
class Report < ActiveRecord::Base belongs_to :reportable, :polymorphic => true ...
Ruby A shorter way to declare cl...
I added these so I could re...
Ruby On Same function repeated but ...
by danielharan,
August 08, 2008 19:32
The two last methods don't ...
Ruby On How to make instance variab...
by danielharan,
July 31, 2008 13:51
Persistent storage by addin...
class User < ActiveRecord::Base has_many :orders has_many :products, :through => :orders ...
Ruby On rails ActiveRecord finder_s...
by danielharan,
July 23, 2008 01:42
Here's where I'd see it goi...
module DashboardHelper
def activity_message_for(object)
render :partial => "#{object.class.name.downcase.pluralize}/activity"
...
module DashboardHelper
def activity_message_for(object)
render :partial => "#{object.class.name.downcase}/_#{object.class.name.downcase}_activity"
...
function showEMail(element)
{
var e = { name: 'myemail',
...
JavaScript On Anti-spam Mailto
by jamesgolick,
January 08, 2008 04:34
document.write really sucks...
Ruby On Challenge: Ugliest Ruby Fiz...
by jamesgolick,
December 20, 2007 23:55
oh my... I'd like to see so...
class Fixnum
def <=>(b)
self % b
...
Ruby Challenge: Ugliest Ruby Fiz...
by jamesgolick,
December 20, 2007 21:54,
8 refactorings
So, after seeing some ugly ...
update.failure.responds_to %(js html)
Ruby On resource_controller: Redesi...
by jamesgolick,
November 05, 2007 22:42
I love those. The *_finder ...
class PostsController < ResourceController::Base ...
Ruby On resource_controller: Redesi...
by jamesgolick,
November 05, 2007 20:28
First refactoring from my b...
class PostsController < ResourceController::Base ...
Ruby resource_controller: Redesi...
Backstory on my blog: http:...
ROLES = %w( administrator staff ) ...
Ruby On restful_authentication role...
by jamesgolick,
September 27, 2007 12:06
As an aside, it's helpful t...
def self.requires_role(role, options={})
before_filter(options) { |controller| controller.instance_eval { logged_in? && current_user.send("#{role}?") ? true : controller.access_denied } }
end
Ruby On restful_authentication role...
by jamesgolick,
September 27, 2007 11:59
Marc's suggestion. Which o...
def self.requires_role(role, options={})
before_filter(options) { |controller| controller.send(:logged_in?) && controller.send(:current_user).send("#{role}?") ? true : controller.send(:access_denied) }
end
Ruby On restful_authentication role...
by jamesgolick,
September 27, 2007 11:56
Problem is, that block seem...

This seems particularly egr...