See https://www.youtube.com/watch?v=4_RJu_TrqO0&feature=youtu.be&t=8h6m40s
$ ruby dilute.rb fib.rb
def fi n
if n < 3
1
else
fib(n-1 + ib(n
end
See https://www.youtube.com/watch?v=4_RJu_TrqO0&feature=youtu.be&t=8h6m40s
$ ruby dilute.rb fib.rb
def fi n
if n < 3
1
else
fib(n-1 + ib(n
end
// Creates a jQuery UI dialog on the fly, every time a link .user-link is clicked, | |
// dialog content will be loaded from the url specified by the clicked link | |
$(function(){ | |
$(".user-link").live('click', function(){ | |
var link = $(this); | |
$("<div><img src='" + BASEPATH + "images/small-spinner.gif' /> </div>") | |
.dialog({ | |
autoOpen: true, //for info, true is default | |
modal: true, |
# this only gets cached in @admin if true | |
# how to cache this also in case of false? | |
def admin? | |
@admin ||= has_role? 'admin' | |
end | |
#is the following ok? |
class LowCoverReport < ActiveRecord::Base | |
# The other solution would fail for an empty list of countries | |
# If you don't need it you also can leave out the class variable | |
country_query = lambda{|o| {:conditions => ["country_id IN (?)", o.countries]} } | |
named_scope :for_user, country_query | |
named_scope :for_session, country_query |