Displaying 20 results from an estimated 6000 matches similar to: "ActionController majic gone bad"
2008 Mar 01
0
Fixtures in ActionController::TestCase
Hi guys,
Need some help.
I am using Rails 2.0 and while writing functional test, I encountered
the following problem
class UserControllerTest < ActionController::TestCase
fixtures :users
...
def do_something
attempt_login(users(:valid_user)) # assuming valid_user is a
proper line in
...
end
def attempt_login(user)
post :login, :user => { :login => user.login, :password
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 =>
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
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
2008 Apr 24
4
Napster.......
Hello all.
I'm new(ish) to the world of linux and am about to finally make the plunge and ditch windows completely. However, there's only one program that I want from windows that I use regularly and that is napster for it's music subscription service. It really is a brilliant service as the choice and variety can't really be matched.
Now, I don't know if this is the right area
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
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
2013 Mar 01
3
EDNS support
I am having problems with EDNS support on a few Centos 6.3 bind
servers. I am trying to determine if the problem is my Juniper SSG5
firewall of Centos.
All the servers have firewall enabled, though I have tested with
stopping iptables and ip6tables. I am using tests from:
https://www.dns-oarc.net/oarc/services/replysizetest
dig @localhost +short rs.dns-oarc.net txt
gets:
;; Truncated,
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
2018 Jun 20
5
[RFC] Removing debug locations from ConstantSDNodes
FWIW: Debug information on constants feels odd to me. They are just values not something that is executed so conceptually I would not expect them to "happen" at a specific time/place in the program. That said most numbers are copied into registers or stored into memory and that is of course an interesting action. So in the original example I would hope to see debug info on whatever
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 Mar 06
2
Refresh a partial onClick using ajax call in rails 3.x
Hi All,
I want to refresh a partial onClick, onClick i am making ajax call
and getting the data but i am unable to refresh the partial. here is the
code
IN views: home.html.erb
$(document).ready(function() {
var currentCellText;
$(".inline").click(function() {
currentCellText = $(this).text();
$.ajax({
type: ''GET'',
dataType: "json",
2015 Jan 08
9
[LLVMdev] Separating loop nests based on profile information?
I've been playing with approaches to getting better optimization of
loops which contain infrequently executed slow paths. I've gotten as
far as throwing together a proof 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
2018 Jul 28
2
re-throwing an interrupt condition
I don't want to return a value, I want to interrupt the computation,
that's why I need to re-throw .
But before getting back to the user I want to run some cleanup code.
G.
On Sat, Jul 28, 2018 at 5:59 PM I?aki ?car <i.ucar86 at gmail.com> wrote:
>
> El s?b., 28 jul. 2018 a las 18:30, G?bor Cs?rdi
> (<csardi.gabor at gmail.com>) escribi?:
> >
> > Anyone
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
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
2015 Jan 08
4
[LLVMdev] Separating loop nests based on profile information?
On 01/07/2015 05:33 PM, Chandler Carruth wrote:
>
> On Wed, Jan 7, 2015 at 5:19 PM, Philip Reames
> <listmail at philipreames.com <mailto:listmail at philipreames.com>> wrote:
>
> I've been playing with approaches to getting better optimization
> of loops which contain infrequently executed slow paths. I've
> gotten as far as throwing together
2010 Jan 31
3
Append/Prepend to a template from controller method
I want a method in app/controllers/application.rb that can
prepend/append text to whatever template gets rendered. Of course I
can''t call render twice w/o getting a double render error, so is this
possible?
I want to redirect after a delay using a meta refresh. Here''s what I''ve
got:
app/controllers/application_controller.rb:
def redirect_after_delay (url, delay)