Displaying 20 results from an estimated 9000 matches similar to: "Question: coding protected methods"
2006 Mar 01
5
validations without AR - going crazy trying to find link
Hi,
in the past few months someone posted an entry on their blog about
how to do validations in non-AR classes and I cant find it any more.
Anyone have a link?
Thanks,
Trevor
--
Trevor Squires
http://somethinglearned.com
2006 Feb 17
4
Table with Constants
I would like to have a table with some constants to use them later on
for a drop down menu. How can this be done?
My table looks like
Table with constants
------------------------
id | key | value | type
------------------------
1 | M | Male | sex
....
I know it can be done like this
<% select ''object'', ''method'', Constants.find(:all, :select =>
2006 Mar 22
5
Class Caching Problem [was Newbie Question about Custom Classes]
So any other ideas as to why my custom class under app/models is being
cached even though all the caching is set to false in the
config/environments/* files? Currently I''m having to restart WEBrick
after EVERY change to the file. The controllers and views are
reloading just fine and not being cached. It''s just the custom class
I created that''s being cached.
Any ideas
2006 Jun 08
5
update only the join table in a HABTM - how?
I have a photographers app that requires giving access to galleries for
users. in one part, I want to be able to define gallery access for a
user seperate from updating any of the user info. I have this function:
def edit_access
@user = User.find(params[:id])
@user.galleries = Gallery.find(params[:gallery_ids]) if
params[:gallery_ids]
if @user.update_attributes(params[:user])
2007 Sep 21
3
TextMate Bundle and exception when switching to alternate file.
Hey,
sorry if this is something better suited to another list.
I''ve encountered a strange problem with the RSpec.tmbundle in trunk -
namely that it was raising an exception when pressing
ctrl-shift-downarrow (switch between spec and source - "Alternate
File").
I tracked down the issue to be handling of the file_type in
switch_command.rb#content_for() - the code expected the
2006 Mar 31
5
Model reloading problem
Hi all,
I''ve a model class Toto in the model directory.
I don''t understand why i have to restarts WebBrick to view changes i make
in this class
FYI : in the development. rb i desabled class cache with
config.cache_classes = false
Regards
Luciano
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2010 May 31
2
accessing a data frame with row names
Readers,
I have entered a file into r:
,column1,column2
row1,0.1,0.2
row2,0.3,0.4
using the command:
dataframe<-read.table("/path/to/file.csv",header=T,row.names=1)
When I try the command:
dataframe[,2]
I receive the response:
NULL
I was expecting:
row1 0.2
row2 0.4
What is my error with the syntax please?
Yours,
r251
mandriva2009
2004 Nov 23
5
number of pairwise present data in matrix with missings
is there a smart way of determining the number of pairwise present data
in a data matrix with missings (maybe as a by-product of some
statistical function?)
so far, i used several loops like:
for (column1 in 1:99) {
for (column2 in 2:100) {
for (row in 1:500) {
if (!is.na(matrix[row,column1]) & !is.na(matrix[row,column2])) {
pairs[col1,col2] <- pairs[col1,col2]+1
2006 May 05
3
Plugin refresh time
Hi there,
I''m currently developing a plugin to do authentication and
authorisation. In the init.rb file of the plugin I have this code:-
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), ''lib''))
require ''open_advantage/authorisation''
ActionController::Base.send :include, OpenAdvantage::Authorisation
and this is the skeleton of my
2006 Mar 08
2
Exciting Website Development
I am a single person company designing an exciting new web application
for the general internet community.
I am looking for 1 or 2 RoR developers keen to be involved in the
development of an online application over the next few months.
This project will initially be a free service for all internet user with
the option for revenue through other sources later on - hence I am
looking for
2009 May 14
2
Function to read a string as the variables as opposed to taking the string name as the variable
I am writing a custom function that uses an R-function from the
reshape package: cast. However, my question could be applicable to
any R function.
Normally one writes the arguments directly into a function, e.g.:
result=cast(table1, column1 + column2 + column3 ~ column4,
mean) (1)
I need to be able to write this statement as follows:
result=cast(table1, string_with_columns ~
2008 Feb 26
1
Split data.frames depeding values of a column
Hello to all
is there a function wich splits a data.frame (column1,column2,column3,....)
into
data1 <-(column1,column3....) #column2 = 1
data2 <-(column1,column3....) #column2 = 2
data3 <-(column1,column3....) #column2 = 3
...
Regards Knut
2006 Jul 09
1
Accessing the name of a controller''s module?
If I''m redirecting to a log in page, and saving the controller and
action name in the session hash, how do I also save the controller
module?
After the log in is completed, I can''t redirect back to the originally
directed page because it''s in a different controller module. For the
controller action name I can use the ActionController instance method
controller_name(),
2006 Aug 08
3
params object nil in controller action
Hi All
I am trying to implement a Back to Search Results functionality, by storing
the user''s search criteria (params) in session and then reusing those
params instead of request params when user clicks on "Back to Search Results
link". here is my code
________________________________________________________________________
def search
if session[:incidentSearch].nil? or
2009 Jun 17
6
script help
Hi
?
I have a file. list.txt (two columns)
?
column1??? column2
name??????? address
?
?
I need to put in the letter file letter.txt eg:
?
Dear: Chloe
Address: CA
?
Can I use this
?
for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt
?
Thank you for your help
?
?
?
?
?
__________________________________________________________________
Looking for the perfect gift?
2024 Jun 06
2
R Shiny Help - Trouble passing user input columns to emmeans after ANOVA analysis
Hello everybody,
I have experience coding with R, but am brand new to R Shiny. I am trying
to produce an application that will allow users to upload their own
dataset, select columns they want an ANOVA analysis run on, and generate
graphs that will allow users to view their results. However, I am getting
the following error: *"Argument is of length zero."*
Being new to Shiny, I am
2009 Jun 15
2
Help with syntax error
Hi,
I have written boxplot commands of this form before, but I don''t quite understand why the function call is reporting a syntax error in this instance. All parameters passed to the function are strings.
Thanks in advance.
Payam
> simplevar <- function(wframe,column1,column2) {
+ tframe <- get(wframe)
+ x1 <- which(names(wframe)==column1)
+ x2 <-
2024 Dec 12
1
Cores hang when calling mcapply
Hi Gregg.
Just wanted to follow up on the solution you proposed.
I had to make some adjustments to get exactly what I wanted, but it works, and takes about 15 minutes on our server configuration:
temp <-
??????open_dataset(
????????????sources = input_files,
????????????format = 'csv',
????????????unify_schema = TRUE,
????????????col_types = schema(
????????????"ID_Key"
2024 Dec 11
1
Cores hang when calling mcapply
Hello Thomas,
Consider that the primary bottleneck may be tied to memory usage and the complexity of pivoting extremely large datasets into wide formats with tens of thousands of unique values per column. Extremely large expansions of columns inherently stress both memory and CPU, and splitting into 110k separate data frames before pivoting and combining them again is likely causing resource
2013 Mar 21
2
Displaying median value over the horizontal(median)line in the boxplot
Hi,
set.seed(45)
test1<-data.frame(columnA=rnorm(7,45),columnB=rnorm(7,10)) #used an example probably similar to your actual data
apply(test1,2,function(x) sprintf("%.1f",median(x)))
#columnA columnB
# "44.5"? "10.2"
par(mfrow=c(1,2))
lapply(test1,function(x) {b<-