Displaying 20 results from an estimated 1000 matches similar to: "protected method access"
2012 Sep 08
4
dash symbol
In the example below, what is the dash doing between the class
attribute and array:
(field_helpers -
[:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each
do |selector|
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2012 Sep 22
4
Class, Module, Object
>> reload!
Reloading...
=> true
>> puts Class < Module
true
=> nil
>> puts Module < Class
false
=> nil
>> puts Module < Object
true
=> nil
>> puts Object < Module
false
=> nil
>> Object.parent
=> Object
The above indicates that the Class object instance inherits from the
Module object instance and the Module object instance
2012 Jan 21
4
why doesn't an instance of Object get Class's new instance method?
"Object is the root of Ruby''s class hierarchy. Its methods are
available to all classes unless explicitly overridden."
Wouldn''t Class class be at the root of the class hierarchy?
After all, look at this:
1.9.2p290 :006 > Object.instance_of? Class
=> true
Object is an instance of class, after all we can use one of Class''
instance methods on Object:
2012 Jan 01
4
Chronic parsing date range in console but not in application in rails 3
Hey all,
Chronic will parse a date range in console:
Chronic.parse(1/1/2011 - 1/1/2012, :guess => false)
=> 2012-01-01 12:00:00 -0500..2012-01-01 12:00:01 -0500
However, when I use logger to check if it''s parsing in application, it
is not:
logger.info "The value of history date is #{history_date}" =>
The value of history date is 1/1/2011 - 1/1/2012
2013 Apr 03
2
strange behavior with active relation any? method
In console, I run the following and any? returns true:
drivers = Driver.select("drivers.*,
drivers.id").joins([:reports, :driving_habits]).where("extract(MONTH
FROM reports.time) = ? AND extract(YEAR FROM reports.time) = ?", 3,
2013).uniq.order("drivers.id asc").page(2).per(1)
drivers.any?
=> true
This correctly evaluates to true because the relation contains one
2012 Sep 20
2
append_features(mod)
append_features(mod)
The documentation says:
When this module is included in another, Ruby calls append_features in
this module, passing it the receiving module in mod. Ruby’s default
implementation is to add the constants, methods, and module variables
of this module to mod if this module has not already been added to mod
or one of its ancestors. See also Module#include.
What if this module is
2013 May 07
2
Net::HTTP
I''m looking at the documentation:
http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html
And I notice two uses of Net::HTTP. Both are using GET requests. But
what''s the difference? When to use which?
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri
response = http.request request # Net::HTTPResponse object
end
uri =
2012 Feb 04
3
the ^ and % operators in context
The % is modulus (remainder) operator and ^ is bitwise. In this
context, we take a file, and go through each character and encrypt it.
But why are the ^ and % operators used here:
def encrypt(reader, writer)
key_index = 0
while not reader.eof?
clear_char = reader.getc
encrypted_char = clear_char ^ @key[key_index]
writer.putc(encrypted_char)
key_index = (key_index +
2007 Mar 29
1
Wikibooks
As a big fan of Wikipedia, it's frustrating to see how little there is about
R in the correlated project, the Wikibooks:
http://en.wikibooks.org/wiki/R_Programming
Alberto Monteiro
2013 Apr 27
3
where exactly are gems?
when you add a gem to the Gemfile and then run bundle install, where
does the command look for the gem? If you had "gem ''rails'', :git =>
''github.com/rails/rails.git", I assume it would update your
system .rvm gems directory with the latest github commits. But what is
the default repository that bundler looks for gems?
--
You received this message because
2005 May 01
2
Newbie Question
Hello,
(This is a newbie question. I skimmed though the mailing list archive to try
to find the answer, but didn't find anything. Maybe I'm just not looking for
the right thing.)
Are there any tools that could be used to convert a series of frames (stored
as JPEG's or something), for a movies, into a Theora file?
TIA
See ya
--
Charles Iliya Krempeaux, B.Sc.
charles @
2013 May 18
3
You have already activated rake 10.0.4, but your Gemfile requires rake 10.0.3.
I''m careful to create separate gemsets for each project, so when I run
bundle install, it only installs gems for that gemset. This way gems
dont creep into the wrong projects. Now I just pulled a project from
github. I made sure I was in the correct gemset, and then I run bundle
install and it works fine. but then when I use rake to create the
database "rake db:create". I get
2005 May 15
1
Simple Video and Audio Recording ???
Hello,
(This is yet another newbie question.)
My goal is to record Video and Audio, from a webcam and microphone, and
record them in ogg format. (Using Theora and Vorbis.)
I'm aware that I can use video4linux or video4linux2 to get the video. And
use various API's for audio. And can use APIs like GStreamer to do the
encoding, etc. But, if possible, I like something a little more
2015 Nov 15
2
~/.ssh/config permissions
Hi,
Working with apache-sshd I found that it forces ~/.ssh/config to be
owned by user without group/others permissions. It failed for me
within my valid openssh environment.
Within sources (readconf.c::read_config_file), I found that openssh
only enforces ownership by user and not group/others write.
When I opened an issue, I was referred to this[1] wiki page (not sure
who maintain it) claiming
2011 Jun 27
2
insert value of primary key into another field before record is saved
Hey all,
I created a seed task:
def books!
books = Book.where(:type_id =>
Type.find_by_name(''Fiction'')).order(''id'')
books.each do |book|
@books = 4.times.map do |i|
subbook! "#{book.book_num}-#{i}".to_s, :book_state =>
BookState[:available].id, :book => book
end
end
puts "log it:
2010 May 11
0
What are your thoughts about the "R programming" wiki-book ?
An R community member named Ajay wrote today about the "R programming"
wiki-book project (link to Ajay's
post<http://decisionstats.wordpress.com/2010/05/10/the-r-online-wikibook/>),
and I would like to know what you think about the project:
http://en.wikibooks.org/wiki/R_Programming
Ajay believes that
> "What we need is a consolidated document that can add 1) show
2010 Feb 10
7
undefined method join
Hey all,
I get an undefined method `join'' for #<String NoMethodError.
student.rb
has_one :student_fail
attr_accessor :student_fail_attribute
#controller
def student_fail
@student = @student.find params[:id]
def update_student_fail
@student.build_student_fail params[:student][:student_fail_attribute]
if @student.save
#view
form_for @student do |f|
2011 Dec 13
1
k-means cluster and plot labels
Hi,
For my data, I followed the example of http://en.wikibooks.org/wiki/Data_Mining_Algorithms_In_R/Clustering/K-Means#Execution and got some very nice results. Despite the fact, that I want to achieve a bit more by clustering my data (stratification beyond case-control), the actual data-frame contains a column labeled "C" which holds a case-control indicator (here either "Z"
2023 Nov 10
1
@cert-authority for hostbased auth - sans shosts?
On 09/11/23, Marian Beermann (public at enkore.de) wrote:
> ... while OpenSSH does support using a CA in conjunction with hostbased
> authentication, it still requires a list of all authorized host names in the
> rhosts / shosts file.
I'm not familiar with the use of .rhosts/.shosts, but I don't think those are needed at all with a machine or per-user known_hosts file/files
2010 Dec 21
5
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
Hey all,
I know that this:
Called id for nil, which would mistakenly be 4 -- if you really wanted
the id of nil, use object_id
means that I have an instance variable that has not been initialized.
However, I''m a little confused as to what to do in a signup form for
form_for:
<% content_for :login do %>
<% form_for @user, :url => { :action => "login" } do