search for: condtions

Displaying 20 results from an estimated 42 matches for "condtions".

Did you mean: conditions
2011 Sep 09
2
Passing in Condtions into Object
Hello, I am trying to pass a conditional expression into an expression to be evaluated when ever an R statement is called. For example: get_unique_count <- function(df, select, field){ uniqs <- unique(subset(df, select)[field]) return (nrow(uniqs)) } In this case select is a conditional statement year == 1980, and the function would be called in the following manner:
2018 Mar 04
2
Change Function based on ifelse() condtion
Hi again, I am looking for some way to alternately use 2 related functions, based on some ifelse() condition. For example, I have 2 functions mclapply() and lapply() However, mclapply() function has one extra parameter 'mc.cores' which lapply doesnt not have. I know when mc.cores = 1, these 2 functions are essentially same, however I am looking for more general way to control them
2018 Mar 04
0
Change Function based on ifelse() condtion
On 04/03/2018 10:39 AM, Christofer Bogaso wrote: > Hi again, > > I am looking for some way to alternately use 2 related functions, > based on some ifelse() condition. > > For example, I have 2 functions mclapply() and lapply() > > However, mclapply() function has one extra parameter 'mc.cores' which > lapply doesnt not have. > > I know when mc.cores =
2006 Jan 23
5
dial out and message playback
Hi, In a normal PBX environment a user usually calls in and IVR's are played according to a predefined dialplan. Iam trying to develop an application where asterisk dials out to a user and initiates an IVR instead (please note that the IVR is not static and may vary according to different condtions). Can someone guide me how this is possible using Asterisk. Do I need to write some sort of AGI or application? I have looked into the autodial out feature but I am thinking of a more flexible or optimal solution. Any help will be appreciated. Regards, Danish -------------- next part -------------...
2018 Mar 04
0
Change Function based on ifelse() condtion
Hi Christofer, You cannot assign to list(...). You can do the following myList <- list(...)[!names(list(...)) %in% 'mc.cores'] HTH, Eric On Sun, Mar 4, 2018 at 6:38 PM, Christofer Bogaso < bogaso.christofer at gmail.com> wrote: > Hi, > > As an example, I want to create below kind of custom Function which > either be mclapply pr lapply > > Lapply_me =
2006 Apr 03
1
How to handle failed finds.
What''s the best way to handle a find that doesn''t find anything? For example. Model Foo @result = Foo.find(:first, :condition => "some condtion string").name if the condition is not met Foo.find stops the application with ''unexpected nil''. What is the best way to gracefully trap this error and return something meaningfull to the calling
2012 Aug 25
6
[LLVMdev] How to Check whether BasicBlock resides in a conditional branch
Hello All, I want to dertermine whether a basicblock is in a conditional branch. such as, //============================= if a > 2 // BasicBlock A then BasicBlock B endif BasicBlock C //============================= What I want to identify is BasicBlock B, which is in a condtional block. but C is not. In other words, I want to distinguish BasicBlocks that * must * be executed and that
2018 Mar 04
2
Change Function based on ifelse() condtion
Hi, As an example, I want to create below kind of custom Function which either be mclapply pr lapply Lapply_me = function(X = X, FUN = FUN, ..., Apply_MC = FALSE) { if (Apply_MC) { return(mclapply(X, FUN, ...)) } else { if (any(names(list(...)) == 'mc.cores')) { list(...) = list(...)[!names(list(...)) %in% 'mc.cores'] } return(lapply(X, FUN, ...)) } } However when Apply_MC =
2018 Mar 04
0
Change Function based on ifelse() condtion
Hi Christofer, Before you made the change that I suggested, your program was stopping at the statement: list(...) = list(..) .etc This means that it never tried to execute the statement: return(lapply(X,FUN,...)) Now that you have made the change, it gets past the first statement and tries to execute the statement: return(lapply(X,FUN,...)). That attempt is generating the error message because
2012 Aug 25
2
[LLVMdev] How to Check whether BasicBlock resides in a conditional branch
2012/8/25 Iaroslav Markov <ymarkov at cs.stonybrook.edu>: > Can't you do it by performing some analysis on CFG? You can traverse that structure with BFS. And after that for all the BB you have visited more than once, you try to find a parent that has a branch instruction as a terminator. Additionally you ensure that there are no BB with branches as terminators on your way. If such
2018 Mar 04
0
Change Function based on ifelse() condtion
That's fine. The issue is how you called Lapply_me(). What did you pass as the argument to FUN? And if you did not pass anything that how is FUN declared? You have not shown that in your email. On Sun, Mar 4, 2018 at 7:11 PM, Christofer Bogaso < bogaso.christofer at gmail.com> wrote: > My modified function looks below : > > Lapply_me = function(X = X, FUN = FUN, Apply_MC =
2018 Mar 04
2
Change Function based on ifelse() condtion
@Eric - with this approach I am getting below error : Error in FUN(X[[i]], ...) : unused argument (list()) On Sun, Mar 4, 2018 at 10:18 PM, Eric Berger <ericjberger at gmail.com> wrote: > Hi Christofer, > You cannot assign to list(...). You can do the following > > myList <- list(...)[!names(list(...)) %in% 'mc.cores'] > > HTH, > Eric > > On Sun, Mar
2008 Jul 01
2
if one of 4 conditions is not satisfied
I'm trying to do realize the following: I have 4 condtions. If all conditions are satisfied I will paste("PASS") If any of these is not satisfied I will paste("FAIL"). But I have to paste the corresponding failure. ifelse is a good solution but for a 2 conditions. Maybe switch or something like this. Does anyone have an idea how to do...
2008 Dec 09
1
[LLVMdev] scalar-evolution + indvars fail to get the loop trip count?
Hi, Seems pass scalar-evolution+indvars fail to get the loop trip count of the following case: int foo(int x, int y, int lam[256], int alp[256]) { int i; int z = y; for (i = 255; i >= 0; i--) { z += x; lam[i] = alp[i]; } return z; } The final optimized ll code is : define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind { entry: br label %bb bb:
2018 Mar 04
2
Change Function based on ifelse() condtion
My modified function looks below : Lapply_me = function(X = X, FUN = FUN, Apply_MC = FALSE, ...) { if (Apply_MC) { return(mclapply(X, FUN, ...)) } else { if (any(names(list(...)) == 'mc.cores')) { myList = list(...)[!names(list(...)) %in% 'mc.cores'] } return(lapply(X, FUN, myList)) } } Here, I am not passing ... anymore rather passing myList On Sun, Mar 4, 2018 at 10:37 PM,
2007 Jun 12
4
pretty report
Dear Listers: I have a couple of data frames to report and each corresponds to different condtions, e.g. conditions=c(10, 15, 20, 25). In this examples, four data frames need to be exported in a "pretty" report. I knew Perl has some module for exporting data to Excel and after googling, I found R does not. So I am wondering if there is a package in R for generating good reports. I fo...
2012 Aug 25
0
[LLVMdev] How to Check whether BasicBlock resides in a conditional branch
Can't you do it by performing some analysis on CFG? You can traverse that structure with BFS. And after that for all the BB you have visited more than once, you try to find a parent that has a branch instruction as a terminator. Additionally you ensure that there are no BB with branches as terminators on your way. If such parent exist, you mark that there is exist a direct connection between
2006 May 12
1
Some error about adding.
Ok so I''m trying to make a little exchange 3 for 1 of 1 higher rank here is the code in the controller: def exch_link @id = @session[:user].id @type = @params[:type] exch(@id,@type) end def exch(user_id,this_type) @user = User.find(:condtions => "id = " + user_id) @ranks = ["xw","w","m","l","xl","s","ss"] if @user.send(this_type) >= 3 @this_type = @ranks.index(this_type) @nexts_number = @this_type.to_i + 1 @next_type = @ranks[@nexts_number] @user.s...
2006 Oct 24
1
set.seed() and .Random.number
Hi R-users I have two conditions. For each condition, 100 sets of 10 random numbers from N(0,1) need to be generated. Here is my question. At the begining I specify a seed number. I want to make the 100th set of the first condition and 1st set of the second conditon the same. What do I need to do ? After generating 99th set of 10 random numbers and then saving .Random.seed then using
2008 Dec 09
1
[LLVMdev] scalar-evolution + indvars fail to get the loop trip count?
> > > Having the final .ll file doesn't help debug this. If you run opt > -analyze -scalar-evolution on the .ll you pasted, it will correctly > print out the loop trip count. > > I've modified llvm-gcc to remove all the passes after indvars. > > I updated my llvm and now it works. >> > Surely the loop trip count is 256, but the Loop::getTripCount()