similar to: typecasting a function from character to double

Displaying 20 results from an estimated 600 matches similar to: "typecasting a function from character to double"

2006 Jan 12
4
Typecasting and boolean attributes
I have 2 radio buttons like this: <%= radio_button ''group'', ''public'', true %> <%= radio_button ''group'', ''public'', false %> They hold the correct values when viewing the @group object. However, when updating, it does not appear that the params[:group][:public] value is being typecast correctly. As
2005 Dec 03
1
typecasting HashWithIndifferentAccess
I want to typecast an object of HashWithIndifferentAccess (params) to Hash. Whats the way of doing this (except each?) Thanks in advance. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
2004 Jul 12
8
Gogoif with variables acting funny?
Using an example provided by "The Hitchhiker's Guide to Asterisk", I made the following addition to my extensions.conf file: [inbound-analog] exten => s,1,Wait(1) exten => s,2,SetVar(counter=0) exten => s,3,Answer() exten => s,4,Wait(1) exten => s,5,DigitTimeout(15) exten => s,6,ResponseTimeout(10)
2003 May 09
2
Data-mining using R
Is it possible to use R as a data-mining tool? Here's the problem I've got. I have a couple of data sets consisting of results from a cDNA microarray experiment - the details about the biology don't really matter here, the same theory applies for any other data-mining task (that's why I thought it'd be more appropriate to post this on r-user). Each of these datasets consists
2018 Jan 04
3
silent recycling in logical indexing
Hmm. Chuck: I don't see how this example represents incomplete/incommensurate recycling. Doesn't TRUE replicate from length-1 to length-3 in this case (mat[c(TRUE,FALSE),2] would be an example of incomplete recycling)? William: clever, but maybe too clever unless you really need the speed? (The clever way is 8 times faster in the following case ...) x <- rep(1,1e6)
2004 May 14
1
covariates in lm
Dear R list, I have been trying to do a linear model, extracting the effect of a covariate.... and the results do not match, when I do it with other programs (e.g. minitab).... so it is obvious that I was doing something wrong. Whan I do it with minitab, I have this results: (sector is a factor and depth is the covariate): Source DF Seq SS Adj SS Adj MS F P
2018 Jan 04
3
silent recycling in logical indexing
Sorry if this has been covered here somewhere in the past, but ... Does anyone know why logical vectors are *silently* recycled, even when they are incommensurate lengths, when doing logical indexing? This is as documented: For ?[?-indexing only: ?i?, ?j?, ?...? can be logical vectors, indicating elements/slices to select. Such vectors are recycled if necessary to match
2013 Oct 07
1
[LLVMdev] Typecasting int32ty to int64ty
I have something like this on my code :- vector<Value*> args3; args3.push_back(instr->getOperand(0)); //where 'instr' is store instruction Now when I check the Type of instr->getOperand(0). It varies to i32 and i64, depending on the operand(0) of instruction. Due to which my vector<Value*> has different Type of Value*. How can I convert i32 to i64 type before pushing
2007 Jul 30
2
deriv, loop
Hi, 2 questions: Question 1: example of what I currently do: for(i in 1:6){sink("temp.txt",append=TRUE) dput(i+0) sink()} x=scan(file="temp.txt") print(prod(x)) file.remove("C:/R-2.5.0/temp.txt") But how to convert the output of the loop to a vector that I can manipulate (by prod or sum etc), without having to write and append to a file? Question 2: >
2006 Oct 27
2
all.names() and all.vars(): sorting order of functions' return vector
Dear list-subscriber, in the process of writing a general code snippet to extract coefficients in an expression (in the example below: 0.5 and -0.7), I stumbled over the following peculiar (at least peculiar to me:-) ) sorting behaviour of the function all.names(): > expr1 <- expression(x3 = 0.5 * x1 - 0.7 * x2) > all.names(expr1) [1] "-" "*" "x1"
2001 Oct 05
1
nls() fit to a lorentzian - can I specify partials?
First, thanks to all who helped me with my question about rescaling axes on the fly. Using unlist() and range() to set the axis ranges in advance worked well. I've since plotted about 300 datasets with relative ease. Now I'm trying to fit a lossy oscillator resonance to (the square root of) a lorentzian (testframe$y is oscillator amplitude, testframe$x is drive frequency): lorentz
2006 Jul 18
2
I think this is a bug
Hello! I work with: R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.1 (2006-06-01) On Windows XP Professional (Version 2002) SP2 I think there is a bug in the conditional execution if (expr1) {expr2} else {expr3} If I try: "if (expr1) expr2 else expr3" it works well but when I put the expression expr2 and expr3 between {} I receive an error message
2009 Dec 09
4
equivalent of ifelse
Hi, Is there any equivalent for ifelse (except if (cond) expr1 else expr2) which takes an atomic element as argument but returns vector since ifelse returns an object of the same length as its argument? x = c(1,2,3) y = c(4,5,6,7) z = 3 ifelse(z <= 3,x,y) would return x and not 1 thanks
2006 Nov 18
1
deriv when one term is indexed
Hi, I'm fitting a standard nonlinear model to the luminances measured from the red, green and blue guns of a TV display, using nls. The call is: dd.nls <- nls(Lum ~ Blev + beta[Gun] * GL^gamm, data = dd, start = st) where st was initally estimated using optim() st $Blev [1] -0.06551802 $beta [1] 1.509686e-05 4.555250e-05 7.322720e-06 $gamm [1] 2.511870 This works fine but I
2023 Aug 16
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
> > > > Since legacy virtio will no longer be modified, I don't think there is > > much value is exposing this new union as UAPI. I do appreciate the > > benefit to the implementation. > > > > [1] https://patches.linaro.org/project/netdev/patch/20210208185558.995292-3-willemdebruijn.kernel at gmail.com/ > Hi, William and Simon > > Thanks for the
2014 May 01
3
How to test if an object/argument is "parse tree" - without evaluating it?
This may have been asked before, but is there an elegant way to check whether an variable/argument passed to a function is a "parse tree" for an (unevaluated) expression or not, *without* evaluating it if not? Currently, I do various rather ad hoc eval()+substitute() tricks for this that most likely only work under certain circumstances. Ideally, I'm looking for a isParseTree()
2005 Jun 03
2
Everyone-- the scoop on Bison/Flex --
Hey, everybody--- Ignorance CAN be bliss, at least for a while, but, .... Just so you know... A week or two ago, some upgrades to the expression parser (you know, the expressions you put in $[ ... ] in your extensions.conf file) that I submitted, have been merged into the CVS HEAD of the source. Hopefully, for around 99.9% of you, it won't make any difference to you. The Makefile has also
2023 Aug 16
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
On 2023-08-15 p.m.2:13, Willem de Bruijn wrote: > External email: Use caution opening links or attachments > > > On Tue, Aug 15, 2023 at 12:29?PM Simon Horman <horms at kernel.org> wrote: >> >> On Tue, Aug 15, 2023 at 11:09:02AM -0400, Feng Liu wrote: >> To clarify: In general new Networking features go via the net-next tree, >> while bug fixes go via
2003 Jan 31
2
Varying texts in expression(paste())
Hi, I am using R a lot to make plots relating to radioactivity, I am often using expression() to label the plots with nuclide names written with superscripts, e.g. expression(paste("Releases of ", { }^{99},Tc," (TBq/year)"))->ywtext But, is there any simple way to change the number and name of the nuclide through a variable? I tried nuccode=expression({ }^{99},Tc)
2005 Jul 12
2
Puzzled at ifelse()
I have a situation where this is fine: > if (length(x)>15) { clever <- rr.ATM(x, maxtrim=7) } else { clever <- rr.ATM(x) } > clever $ATM [1] 1848.929 $sigma [1] 1.613415 $trim [1] 0 $lo [1] 1845.714 $hi [1] 1852.143 But this variant, using ifelse(), breaks: > clever <- ifelse(length(x)>15, rr.ATM(x, maxtrim=7), rr.ATM(x))