search for: do_someth

Displaying 20 results from an estimated 156 matches for "do_someth".

Did you mean: do_somethin
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 => "do_something&quo...
2010 May 04
3
Idiomatic looping over list name, value pairs in R
Considering the python code: for k, v in d.items(): do_something(k); do_something_else(v) I have the following for R: for (i in c(1:length(d))) { do_something(names(d[i])); do_something_else(d[[i]]) } This does not seem seems idiomatic. What is the best way of doing the same with R? Thanks. Luis
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 it through "opt -loop-unswitch -S", it unswitched loop on %cond and produced result like this: define i32 @test(i1 %cond) { br...
2012 Nov 26
3
Passing lists between functions
...ike 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 extract the objects within lst like do_something<-function(L){ a<-lst$a b<-lst$b df<-lst$df g<-lst$g a+b+df+g } do_something(lst) My question is, is it possible to avoid the above sequence of statements, and achieve the same thing with a single line of code? Perhaps this would be bad programming practise, as you can't '...
2018 Jun 20
2
[RFC] Removing debug locations from ConstantSDNodes
...(likely incorrect) understanding of it, dropping locations from constants outright might be simpler. > > Our use case was in fastisel, so things are different. I don't think my solution will help you. > > In our case, users were complaining about code like this: > volatile int do_something; > void f() { > ++do_something; > foo(1, 2, 3); > ++do_something; > } > > We'd generate locations like: > .loc line 1 > incl do_something(%rip) > movl $1, %ecx > movl $2, %edx > movl $3, %r8d > .loc line 2 # line 2 starts here, instea...
2007 Feb 01
4
Automatically Indexing Associated Models
...:dependent => :destroy acts_as_ferret :additional_fields => [:blog_comments] def blog_comments self.blog_comments.collect {|comment| comment.body } end end class BlogComment < ActiveRecord::Base belongs_to :blog end CONTROLLER [..] if @blog.blog_comments << comment do_something else do_something end Can someone recommend a good approach to automatically updating the index when a comment is added? -- Posted via http://www.ruby-forum.com/.
2007 Apr 11
4
Feature request... I think...
Folks- I just started using Mocha and I wanted to try something but I couldn''t get it to work. I''m coming from the Java world, so my approach may not be optimal for Ruby. Say I''m testing a.do_something() which calls b.do_other_thing() twice, but I really don''t want to change b.do_other_thing(), just ''expect'' it to be called twice. I know I can b.expect(:do_other_thing).times(2) but it changes the whole method. Unless I''m doing something wrong, I can'...
2018 Jun 20
4
[RFC] Removing debug locations from ConstantSDNodes
Some time ago I saw a report of strange single-stepping behavior given Swift code that looks like this: 1| var input = [16, 14, 10, 9, 8, 7, 4, 3, 2, 1] //< Only number 1 is relevant. 2| print("start") TL;DR: The debugger steps from line 2 -> 1 -> 2 in this code example. One clean way to fix this bug is to remove debug locations from ConstantSDNodes, and I'm asking if
2018 Jun 20
5
[RFC] Removing debug locations from ConstantSDNodes
...likely incorrect) understanding of it, dropping locations from constants outright might be simpler. > > Our use case was in fastisel, so things are different. I don't think my solution will help you. > > In our case, users were complaining about code like this: > volatile int do_something; > void f() { > ++do_something; > foo(1, 2, 3); > ++do_something; > } > > We'd generate locations like: > .loc line 1 > incl do_something(%rip) > movl $1, %ecx > movl $2, %edx > movl $3, %r8d > .loc line 2 # line 2 starts here, inste...
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...
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 can see with our human eyes that this should be 99%. So two questions: - why is BPI used to enable the transformation? - would it not be more useful for BPI to us...
2007 Apr 10
6
getting output of STDOUT in spec
Consider the following method: def name_to_terminal puts "Scott Taylor" end How would I spec this out? Scott
2016 Mar 30
0
Re: [PATCH 0/2] added filesystem_walk0 low level API
...cing > > common mistakes in all of them: I'll list them below, not > > copy/paste-ing them every review. > > > > (a) please check the coding style, in particular > > - the lack of space between a function name and its following opening > > parenthesis; e.g. do_something(param) -> do_something (param) > > > > I was complying with what said here: > http://libguestfs.org/guestfs-hacking.1.html > > It refers to K&R style which suggests functions defined as > do_something(param). > > I guess the documentation at the link could...
2018 Jul 28
2
re-throwing an interrupt condition
...n(e) stop(e)) > > <press CTRL + C / ESC here> > > #> Error in stop(e) : bad error message > > Sorry, I probably misunderstood your intention, but... simply by not > calling stop at all? This is what I see: > > > tryCatch(Sys.sleep(100), interrupt = function(e) do_something <<- 1) > <press CTRL + C / ESC here> > ^C> > > do_something > [1] 1 > > I?aki
2006 Jul 22
0
multiple return values in action web service
Hi all, Does anyone have any advice about returning multiple values from an ActionWebService? That is, I''d like to implement something like the following. api_method :do_something, :expects => [{:id => :string}], :returns => [{:return_code => :int}, {:return_text => :string}] The easy way to do it would be to wrap everything in a struct: class ReturnStatus < ActionWebService::Struct member :re...
2011 Jun 09
1
Rcpp and Object Factories
Hello, I'm not exactly sure how to ask this question, but let me give it a shot... Is it possible (easy) to use Rcpp Modules in conjunction with object factories? For example what I am trying to do is something like this: // c++ classes class Foo { public: void do_something() {}; }; class Foo_Factory { public: Foo * create_foo() { return new Foo(); } }; ## R Code library(Rcpp) ff <- Module("Foo_Factory") foo <- ff$create_foo() foo$do_something() It appears after scouring some message boards that it is doable via boost python, but...
2006 Dec 02
0
Fwd: Re: Mocha and ActiveRecord
...; write a test that checks that when I ask the Order to do something, it >> asks its order items to do that something. I tried to do this like so: >> >> def test_delegates >> order_items = [] >> 3.times { >> item = mock("order item", :do_something => nil) >> order_items.push(item) >> } >> >> order = Order.new(:order_items => order_items) >> order.do_something >> end >> >> This works with normal objects, but it seems ActiveRecord objects don''t >> l...
2005 Sep 23
0
[LLVMdev] name collision - llvm::tie and boost::tie
...use. Except that this does not work on global scope, but only in > namespace: <SNIP> Also, it might be an idea to exploit Koenig lookup if either `tie' function is a free function and uses types from its own namespace. If these definitions hold: namespace foo { struct bar {}; do_something(const bar&); } You can call do_something() without the namespace qualification due to Koenig lookup. (global namespace) using foo::bar; bar b; do_something(b); // resolves to foo::do_something() Maybe this helps. Regards, Andreas -- "Give a man a fire and he's warm for a day; s...
2006 Mar 16
2
question about ajax/rjs and redirection
...error in the form, i handle that on the AJAX side. however, if the form validates, I''d like to redirect the browser to a different page. Will a redirect_to work with an AJAX call or do I have to handle that a special way? ie class AjaxController < ApplicationController::Base def do_something #validate the form data redirect_to :controller => "xyz", :action => "abc" and return if data.validated? # otherwise, render the rjs template end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.o...
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