similar to: Idiomatic looping over list name, value pairs in R

Displaying 20 results from an estimated 10000 matches similar to: "Idiomatic looping over list name, value pairs in R"

2018 Apr 09
3
InductiveRangeCheckElimination and BranchProbabilityInfo
Hi, extractRangeChecksFromBranch uses BranchProbabilityInfo to decide whether its worth trying the InductiveRangeCheckElimination transformation. For the following example: void split() { for (int i = 0; i < 100; ++i) { if (i < 99) do_something() else do_something_else() } } But the reported BPI is reported as 50/50 to whether do_something will be called, but we
2013 Sep 13
0
[LLVMdev] llvm.meta (was Rotated loop identification)
On Thu, Sep 12, 2013 at 4:52 PM, Hal Finkel <hfinkel at anl.gov> wrote: > > If we only try to solve your immediate problem of > > builtin_assume_aligned, isn't that good enough for now? > > The thing that most concerns me about __builtin_assume_aligned and this > scheme is the control dependencies. In gcc, it is the return value of the > intrinsic that carries
2018 Apr 10
0
InductiveRangeCheckElimination and BranchProbabilityInfo
Adding Maxim On Apr 9, 2018, at 10:06 AM, Sam Parker via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: Hi, extractRangeChecksFromBranch uses BranchProbabilityInfo to decide whether its worth trying the InductiveRangeCheckElimination transformation. For the following example: void split() { for (int i = 0; i < 100; ++i) { if (i < 99)
2005 Aug 19
13
Enumerations (again): Comments please
Some of my earlier questions may have hinted ever so slightly in the direction that I''m trying to implement "enumerations". By an enumeration here I mean a class that has a fixed number of immutable instances, which in turn have essentially only a name and a position. Requirements I''ve tried to meet are - Enumeration instances should only be loaded once from the
2013 Sep 12
2
[LLVMdev] llvm.meta (was Rotated loop identification)
----- Original Message ----- > > > > On Sep 7, 2013, at 7:41 AM, Hal Finkel < hfinkel at anl.gov > wrote: > > > > > On Feb 7, 2013, at 10:58 PM, Hal Finkel < hfinkel at anl.gov > wrote: > > > > > As long as this is brainstorming time, I actually like the idea of > an > llvm.invariant intrinsic that the optimizers know to
2010 Jan 28
3
Using tcltk or other graphical widgets to view zoo time series objects
Dear all, I am looking at the R-help entry below: http://finzi.psych.upenn.edu/R/Rhelp02/archive/26640.html I have a more complicatedt problem. I have a zoo time series frame with 100+ sequences. I want to cycle through them back and forth and compare them to the 1st column at any time. I need also a button to click when I need the viewed-selected sequence (that is being compared to the
2006 Jul 17
0
respond_to and redirect_to
Hi, I have two controller actions like: def foo do_something respond_to :html, :js end def bar do_something_else redirect_to :action => "foo" end How can I get foo to return JS, when bar is called via AJAX? What I''d like to get is: bar is called via AJAX do_something_else is executed do_something is executed foo.rjs is rendered The ideal solution should
2006 Apr 05
23
how to create RJS visual effects callbacks
I''m trying desperately to get visuall effects callbacks working in rjs templates to no avail What I''m trying to do is fade an image, change the div with the image to a new image, and then fade the new image back in. How would I go about this in RJS Here''s a simple line from my rjs that I can''t get to work. It is not using callbacks so the
2006 Jun 27
11
Newb question
This isn''t affecting my app, but I''d like to know the reason why I''m seeing this. In my layout, the following code <%= image_tag "front.jpg", :size =>"760x175" %> generates <img alt="Front" height="175" src="/images/front.jpg?1122106054" width="760" /> Where is the parameter in the
2015 Jul 16
3
[LLVMdev] why LoopUnswitch pass does not constant fold conditional branch and merge blocks
Hi, I have a general question on LoopUnswtich pass. Consider the following IR snippet: define i32 @test(i1 %cond) { br label %loop_begin loop_begin: br i1 %cond, label %loop_body, label %loop_exit loop_body: br label %do_something do_something: call void @some_func() noreturn nounwind br label %loop_begin loop_exit: ret i32 0 } declare void @some_func() noreturn After running
2008 Feb 25
4
A more idiomatic way to write this
Hello, I have a vector of 1,000,000 numbers and another vector of 1,000 divisors. What I'd like to do is to divide the first 1,000 numbers of the first vector by the first divisor, then the next 1,000 by the second divisor and so on. I came up with this, but I was wondering if there is a more idiomatic, R-like way to write it: x <- ... divs <- ... for (i in seq(from = 1, to = 1000000,
2006 May 17
9
Render No Layout?
Hi guys, Am having a problem. I have this def in my index controller that works like this: def do_something $a = variable1 $b = variable2 $c = variable3 $d = ""<script language=\"Javascript\"> \n new Insertion.Bottom(''#{$c}'', ''#{$a} - #{$b}''); \n </script>" $trigger = "1" render(:partial =>
2010 May 05
0
R-help Digest, Vol 87, Issue 5
Unsubscribe -----Original Message----- From: r-help-request at r-project.org Date: Wed, 05 May 2010 12:00:09 To: <r-help at r-project.org> Subject: R-help Digest, Vol 87, Issue 5 Send R-help mailing list submissions to r-help at r-project.org To subscribe or unsubscribe via the World Wide Web, visit https://stat.ethz.ch/mailman/listinfo/r-help or, via email, send a message with subject
2011 Aug 20
4
[PATCH 1/2] Make xencommons a bit more idiomatic
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> diff -r 8d6edc3d26d2 -r cfb49fe940fd tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Sat Aug 13 10:14:58 2011 +0100 +++ b/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 16:56:16 2011 -0700 @@ -29,11 +29,9 @@ XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid shopt -s extglob -if test
2007 Aug 23
4
Idiomatic way to do a non-database Enumeration?
I have a class which stores as one of its attributes a day of the week as an integer (0-6, 0=Sunday, standard UNIXy values). I want, obviously, the views to show the weekday name and the forms to provide a drop-down with the weekday names. Essentially it''s a vrtual attribute whose value is the localized weekday name, which maps to the integer value that''s actually stored.
2018 Jun 20
2
[RFC] Removing debug locations from ConstantSDNodes
> On Jun 19, 2018, at 6:36 PM, Reid Kleckner <rnk at google.com> wrote: > > On Tue, Jun 19, 2018 at 5:46 PM Vedant Kumar <vsk at apple.com <mailto:vsk at apple.com>> wrote: > Someone (Reid?) mentioned that we could try sinking constants to their point of first use as an alternative, and (IIUC) create new nodes with distinct DebugLocs for each use of a constant. I
2007 May 05
4
autogenerated it (was ''Custom Matcher and NAME NOT GENERATED annoyance'')
> On 5/5/07, Luis Lavena <luislavena at gmail.com> wrote: > > describe "A User (in general)" do > > before(:each) do > > @user = User.new > > end > > > > it { @user.should have_many(:contest_public_votes) } > > it { @user.should have_many(:design_industry_user_interests) } > > it { @user.should
2007 Feb 01
4
Automatically Indexing Associated Models
PROBLEM I have two models, Blog and BlogComment. When a blog is initially created, it has no comments. Upon creation, the title and body are automatically added to the ferret index and directly searchable. However, when a comment is added to a blog, that comment does not get added to the index and is therefore not ferretable. The desired behavior is that when a comment is added to a blog, that the
2007 Mar 20
1
Passing Arguments to before_filter
I want to put a before_filter in application.rb, as follows: before_filter :do_something, :except_controller => [:admin] def do_something(options) options.stringify_keys! unless options[:except_controller].include?(controller_name) # do something useful end end Where I''m blocking is on how to get the ''options'' data in the do_something method. I think I
2012 Nov 26
3
Passing lists between functions
I'd like to pass a list object created by one function as an argument of another function. once inside the second function, I'd like to break the list up to it's individual elements, each then identifiable by the 'names' of the list. The list looks something like lst<-list(a=1, b=2, df=5, g=7) then inside the function I've been writing a sequence of statements that