Displaying 20 results from an estimated 22 matches for "some_condit".
Did you mean:
some_commit
2015 Jan 08
9
[LLVMdev] Separating loop nests based on profile information?
...of concept implementation of a profile
guided optimization to separate a single loop with multiple latches into
a loop nest, but I want to get feedback from interested parties before
investing much more effort.
The primary case I'm concerned about looks something like this C example:
while( some_condition )
//do lots of work here
if (!some_rare_condition) { <-- This is loop variant
helper();
}
}
The key point here is that the 'do lots of work' section contains things
we could lift out of the loop, but our knowledge of memory gets
completely destoryed by the 'helper...
2011 Oct 28
3
Is active record 3.1.1 supposed to be threadsafe?
Hi There
Is active record 3.1.1 supposed to be threadsafe?
In other words, should the following (concurrent access to a model)
work?
Thread.new do MyModel.where(some_condition).first end
Thread.new do MyModel.where(some_condition).first end
I ask because upon the answer, it depends which component should handle
synchronization, and in consequence, which component to patch/fix.
A bit of background: We stumbled over a concurrency issue when using
capybara-webkit with...
2013 Mar 06
2
Refresh a partial onClick using ajax call in rails 3.x
...ata);
$("ul#mymenu ul#mixed").html(data);
},
error:function(data){
alert("Error");
}
});
});
});
<body>
<%= render(:partial => "partial", :object => @object) %>
</body>
contoller action
def some_action
@object = Class.where(some_condition)
render :home do |page|
page["#myMenu #mixed"].replace_html :partial => "event"
:object=> @object
end
end
partial _partial.html.erb
<ul id="myMenu" class="contextMenu">
<ul id="mixed"&g...
2008 Jan 21
1
ActionController majic gone bad
Overriding method missing in ActionController destroys magic even when
passed back
ie.
def method_missing(method, *args)
if some_condition
do_something
else
#let rails handle it normally
super(method,args)
end
end
if I don''t over ride method missing then i can call a view without an
action
with the override i get a method missing error.
MAJIC
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~---...
2015 Jan 08
4
[LLVMdev] Separating loop nests based on profile information?
...ion to separate a
> single loop with multiple latches into a loop nest, but I want to
> get feedback from interested parties before investing much more
> effort.
>
> The primary case I'm concerned about looks something like this C
> example:
> while( some_condition )
> //do lots of work here
> if (!some_rare_condition) { <-- This is loop variant
> helper();
> }
> }
>
> The key point here is that the 'do lots of work' section contains
> things we could lift out of the loop, but our kno...
2009 Mar 04
2
FW: flow control
...all,
I need a little help with flow control in R. What I'd like to do is to
advance a for loop by changing its counter. However, what seems obvious
to me does not yield the proper results. An example of my problem is
for (i in seq(1, some_number, some_increment)){
<some stuff>
if (some_condition == T) i <- i + 2; #want to advance the loop
by 2
}
Whenever the counter goes to the next step, the next item in the
original sequence seq(1, some_number, some_increment) replaces the
counter value. Is there a way for me to do this?
Best,
Ken
2006 Jan 10
7
Can only render or redirect once per action - why?
I ran into this error message a quite a few times since my app requires
branching to different pages from the same action... say using a switch
statement. Ofcourse I found that you can use multiple redirects or renders
if you do
render :action => ''new'' and return false
I hate to code something I don''t understand fully. Any explanation of this
will be greatly
2010 Jan 31
3
Append/Prepend to a template from controller method
...;
<%= yield %>
</body>
</html>
So then if I want to add a redirect-after-delay, I add the following to
1) my controller and 2) the action''s view:
app/controllers/my_controller.rb
def my_action
redirect_after_delay ''http://www.google.com'', 3 if some_condition
end
app/views/my_controller/my_action.html.erb
<% content_for :refresh_tag do %>
<meta http-equiv=''refresh''
content=''<%=@redirect_delay%>;url=<%=@redirect_url%>''>
<% end %>
<h1>Please wait while you are redirected...<...
2006 Mar 14
8
The RoR equivalent of out.write() in JSP?
All,
In JSP, I can output strings in the Web page by either
<%= foo %> //foo is a string or returns a string
or
<% out.write("test") %> //write directly to the output stream.
What is the method of "writing to the output stream" in RoR? Basically,
what is the equivalent of out.write()?
I have an if then statement that I want to put around a call to
h
2015 Jan 13
2
[LLVMdev] Separating loop nests based on profile information?
...> optimization to separate a single loop with multiple latches into a loop
>> nest, but I want to get feedback from interested parties before investing
>> much more effort.
>>
>> The primary case I'm concerned about looks something like this C example:
>> while( some_condition )
>> //do lots of work here
>> if (!some_rare_condition) { <-- This is loop variant
>> helper();
>> }
>> }
>>
>> The key point here is that the 'do lots of work' section contains things
>> we could lift out of the loop, but our...
2007 Oct 24
6
how to subclass active record to call a method on all save and destroy actions
I''m looking for a way to subclass active record (I''ll refer to the
subclass I want to create as NewActiveRecord) so that I can call
different methods on a save or destroy action on all models which sub
class NewActiveRecord
I dont want to use before_save or any of the other regular call back
methods as I want to be able to use these call backs in the models
which subclass
2007 Dec 04
0
a new model object associated with two parents
...arent classes?
Will the "transaction" work the way I have it or should I chose the name
of the whole database to apply the transaction to? (I wasn''t clear on
what the book meant me to use)
def create_course_performances
@pupils_to_add = Pupil.find(:all, :conditions => [some_condition =
"something" ] )
@course_offering =
Course_offering.find_by_id(params[:course_offering_id]
@pupils_to_add.each do |current_pupil|
holder = Course_performance.new(:name => current_pupil.full_name
)
Pupil.transaction do
current_pupil.course_p...
2007 Jul 30
1
streaming response
hello list!
I like merb a lot, it frees me from dropping to mongrel every time i
want to stream something.
i have an action which will stream a list of JSON objects (separated
by semicolons). unfortunately because of Mongrel''s write-only header
hash, once a Content-Length header has been written, I can never again
tell it to not send such a thing - and streaming doesn''t work if
2006 Apr 08
1
How To ??? change class of DIV
I''m trying to replicate the "green-bar" effect used in the Depot app using Ajax. And I''m almost there ;-) I''m about to set off on the last stage and would appreciate any advice that would set me off in the right direction.
On the page, each record is represented by a <div>. Each <div> has id = "item#{record.id}" with class = either
2006 Apr 01
3
Ignoring Validations In An Admin Tool?
I have the following validation on and ''Order'' model:
validates_presence_of :order_lines, :message => ''missing one or more
products.'', :on => :save
Ok, great. An order has to have products. Ok.
Problem is, there are some old orders that don''t have lines (don''t ask) and
in the admin tool we need to be able to work on these orders.
2015 Jan 08
2
[LLVMdev] Separating loop nests based on profile information?
...lementation of a profile guided optimization to separate a single loop with multiple latches into a loop nest, but I want to get feedback from interested parties before investing much more effort.
>
> The primary case I'm concerned about looks something like this C example:
> while( some_condition )
> //do lots of work here
> if (!some_rare_condition) { <-- This is loop variant
> helper();
> }
> }
>
> The key point here is that the 'do lots of work' section contains things we could lift out of the loop, but our knowledge of memory gets completely...
2009 Jun 29
3
Table Inheritance based on a function
...the database following the application -
instead of the application asking the DB to derive the type _property_
from immanent record properties.
Practically, we would like to have a database function or condition to
control the type.
As a first step this can be done like this:
Select *, CASE WHEN some_condition THEN ''a'' ELSE ''b'' END AS type
FROM table1;
We could define this as a view and put ut in a RoR model.
Problem is RoR can not tell a real table from a view (another
deficiency IMO) - and will try to UPDATE or INSERT the view which
fails.
So what we''...
2006 May 22
4
On-write Automatic Snapshot
Apologies if this has been addressed, but looking at some of the sun
blogs and google searches I have not been able to find an answer.
Does ZFS support on write automatic snapshots?
For example, according to defined policy, every time a file is written
a snapshot is created with the diff stored. I can see this being
useful in high security environments and companies that have extreme
regulatory
2016 Oct 21
4
RFC: Killing undef and spreading poison
...on'.
I'm curious, btw: did you have any concrete API in mind?
>> and 0, poison -> poison
>
> This is similar to the existing poison, and it raises similar questions. Consider the following code:
>
> %x = call i32 @foo()
> %y = or i32 %x, 1
> %c = call i1 @some_condition()
> br i1 %c, label %true, label %false
> true:
> %d = udiv i32 -1, %y
> false:
> %z = phi i32 [ %true, %d ], [ %false, 0 ]
>
> Is it safe to turn the phi into a select? (ignoring profitability)
>
> KnownBits can tell us that %y always has at least one bit set,...
2016 Oct 18
8
RFC: Killing undef and spreading poison
Hi,
Over the past few years we've been trying to kill poison somehow. There have
been a few proposals, but they've all failed to pass the bar and/or to
gather significant support (my own proposals included).
We (David, Gil, John, Juneyoung, Sanjoy, Youngju, Yoonseung, and myself)
have a new proposal to kill undef instead and replace it with poison + a new
'freeze' instruction. We