Displaying 20 results from an estimated 800 matches similar to: "conditional validation"
2006 Aug 08
1
Named routes and url generation?
Hi all
In my application I''ve some named routes defined this way...
map.label_context1 '':context1/label'', :controller => ''mycontroller''
map.label_context2 '':context1/:context2/label'', :controller => ''mycontroller''
map.label_context3 '':context1/:context2/:context3/label'', :controller
=>
2017 Jul 13
2
Help with R script
Dear R-help Group
Scenario 1:
I have a text file running to 1000 of lines...that
is like as follows:
[922] "FieldName: Wk3PackSubMonth"
[923] "FieldValue: Apr"
[924] "FieldName: Wk3PackSubYear"
[925] "FieldValue: 2017"
[926] "FieldName: Wk3Code1"
[927] "FieldValue: "
[928] "FieldValue: K4"
[929] "FieldName:
2017 Jun 23
1
setReplaceMethod creates 'object' in the userworkspace
Hi,
I recognized that the function 'setReplaceMethod' is creating a
character vector in the user workspace having the name (e.g. "newClass")
of the class used as value. If you can sort out a mistake by myself, I
would like you to file a bug report.
BBFN,
Jonathan
setClass("newClass", representation(value="numeric"))
setMethod(f = "initialize",
2017 Jun 23
1
setReplaceMethod creates 'object' in the userworkspace
Hi,
I recognized that the function 'setReplaceMethod' is creating a
character vector in the user workspace having the name (e.g. "newClass")
of the class used as value. If you can sort out a mistake by myself, I
would like you to file a bug report.
BBFN,
Jonathan
setClass("newClass", representation(value="numeric"))
setMethod(f = "initialize",
2017 Jul 13
2
Help with R script
Using Ulrik?s example data (and assuming I understand what is wanted), here is what I would do:
ex.dat <- c("FName: fname1", "Fval: Fval1.name1", "Fval: ", "FName: fname2", "Fval: Fval2.name2", "FName: fname3")
tst <- data.frame(x = ex.dat, stringsAsFactors=FALSE)
sp <- strsplit(tst$x, ':', fixed=TRUE)
chk <-
2017 Jul 13
0
Help with R script
Hi Vijayan,
one way going about it *could* be this:
library(dplyr)
library(tidyr)
library(purrr)
ex_dat <- c("FName: fname1", "Fval: Fval1.name1", "Fval: ", "FName:
fname2", "Fval: Fval2.name2", "FName: fname3")
data.frame(x = ex_dat) %>%
separate(x, c("F1", "F2"), sep = ": ") %>%
filter(F2
2017 Jul 14
0
Help with R script
@Don your solution does not solve Vijayan's scenario 2. I used spread and
gather for that.
An alternative solution to insert mising Fval - picking up with Don's
newtst - is
newtst <- c("FName: fname1", "Fval: Fval1.name1", "FName: fname2", "Fval:
Fval2.name2", "FName: fname3", "FName: fname4", "Fval: fval4.fname4")
2007 Oct 13
4
Chapter 9
Hello,
I''m currently stunk on this issue for few days and I do not know how
to get it fixed.
The system always raises this error message :
order is closed
and here is my order.rb:
class Order < ActiveRecord::Base
include ActiveMerchant::Billing
before_validation :set_status
attr_protected :id, :customer_ip, :status, :error_message, :updated_at, :created_at
attr_accessor
2012 Nov 30
5
subset data frame by variable with missing value
Hello,
I have a variable in a data frame that contains NA values. I just want to
subset so that I get the obs where that variable is missing.
In SAS I would do:
data missing;
set test;
if myvalue=' ';
run;
How can I perform this simple task in R?
Thanks in advance for your help.
--
View this message in context:
2006 Aug 09
7
function before_save
Hi everybody
I would like a function as the "before_save" method in the model. But it
must be the opposite. When I take out data from the database through the
model, I want to call a function before the data are available in the
controller.
Can anyone help me?
---- >>>> thx <<<< ----
--
Posted via http://www.ruby-forum.com/.
2012 Jan 19
1
dataframe: how to select an element from a row
Hi,
I 'd like to select the Date where myvalue =1800 appears the* first time*.
For instance:
df =data.frame(date, myvalue, ...)
...
Date myvalue
2012-01-05 2500
2012-01-06 2450
*2012-01-07 1800*
2012-01-08 2200
2012-01-09 1800
I'd like to retrieve the third line.
I do
2007 Mar 29
4
validates_length_of not working with :if ?
Hello,
I''m trying to cut down the errors if the guy already getting the empty
nickname, so he doesn''t get anything about the nickname is short.
validates_presence_of :nickname
This below is not working ?
validates_length_of :nickname, :within => 4..40, :if => Proc.new {
|user| user.nickname.length > 1 }
nor this one below?
validates_length_of :nickname, :within
2005 Aug 04
4
An small suggestion for the R team
Hi all,
I would like to suggest that all R functions/etc like:
codes-deprecated
grid-internal
ns-alt
ns-dblcolon
ns-hooks
ns-internals
ns-lowlev
ns-reflect.Rd
tools-internal
ts-defunct
utils-deprecated
utils-internal
... and another
i.e, function/word separate for '-'
were all substituted by
codes_deprecated
grid_internal
ns_alt
2005 Sep 24
2
Asterisk returns 484 ADDRESS INCOMPLETE for incoming SIP calls
I'm new to asterisk and need some help with getting a SIP connection
working.
I am trying to establish a termination point/DID number in another
country. I am currently running Asterisk CVS-HEAD. My foreign provider
uses SIP and authenticates via IP address. I am not required to
register my SIP connection in order to send or receive calls.
Can someone help me with how to understand the
2010 Feb 17
2
multi-argument returns
Dear R users,
I have multi-argument returns in a function and I am warned by the program
they are deprecated.
I have found this in the R-help archives :
http://tolstoy.newcastle.edu.au/R/help/01c/0319.html
http://tolstoy.newcastle.edu.au/R/help/01c/0356.html
Since I am not too good at programming, the list solution seems the better
one for me. It is also the one advocated by Kevin Murphy.
So
2006 Jul 02
7
How can I intercept attribute calls?
Hi.
I have two types of fields in my database, e.g. "name" and "name_ru".
First one is a user''s name in english and the second one is in russian.
I want to intercept calls like "c.name" and add "_ru" to it if current
language is russian (I have my own Locale class like n Globalize).
So I want such thing:
--
Locale.set("en-US")
c.name
2012 Aug 14
3
validates_format_of :message not working, validates_length_of :message is working
I''m using validates_format_of and the validation I want to do works, but I
can''t get an error message to be displayed if the data is invalid:
validates_format_of :mobile, :with => /\A[\+0-9]+\Z/, :message => " - Wrong"
I have another validation some where else that does display the error
message: " - Name is too long"
validates_length_of :name,
2007 Jul 24
13
Problem with validates_length_of an integer
Hello guys, I''m trying to validate the input of an integer from a form,
here is a bit of code:
This is the definition of the offending column in the migration:
t.column :position, :integer, :default => 0, :limit => 3, :null => false
And here is how I try to validate it inside de model:
validates_length_of :position, :within => 1..3
And this is the exception I get when I
2006 Feb 23
3
Codec order sent wrong from Asterisk
I'm communicating a softphone (SJPhone) to a Grandstream phone GXP-2000.
The codec order on each one is the next:
SJPhone: GSM - iLBC - PCMA - PCMU
GXP2000: G729 - GSM - PCMA - PCMU
(I have a G729 license, so there's no problem with transcoding G729)
In my sip.conf, I've defined the following codec order:
disallow=all
allow=g729
allow=gsm
allow=g726
allow=alaw
allow=ulaw
And my
2006 May 09
5
How to use gettext in plugins?
I use rails-engine as a plugin of the application and I want to localize
the validate message from the plugin:
validates_length_of :login, :within => 3..40, :on => :create, :message
=> N_("%{fn} is too short (min is %d characters)")
It can not display the according language,where should i set it?
I have tried to add
require ''gettext/rails''