Displaying 20 results from an estimated 300 matches similar to: "Object Finalizers help"
2006 Feb 20
1
Object finalization help
Heya guys,
This one is bothering me as its evading my eye. I''m trying to set a
callback on finalization of an object, ie: a finalizer set through a
plugin to the model.
Example In Plugin:
def acts_as_goat
class_eval do
ObjectSpace.define_finalizer(self, lambda {self.conn.close} )
end
end
class UberGoat < ActiveRecord::Base
acts_as_goat
end
Is this the correct way to set
2006 Jan 09
3
Include with two references of one model of the same table
Hey guys,
I just came across this oddity, not sure what to make of it yet, but
I think it might be incorrect behavior. When doing a @inst.find(:all,
:include => ["hometeam", "awayteam"] ...) hometeam and awayteam are two
references from a belongs_to that is of the same model and of the same
table. I will get a pgerror stating that "matches", which is
2007 Jun 18
0
Phoenix Rails Users Group
What: June Phoenix Rails Users Group
When: Tuesday, June 19th, 6:30 pm - 9pm
Where: Office of Integrum Technologies
290 East El Prado Court,
Chandler, AZ
(north-east of Arizona and Warner)
Topic: Overview of alternative Ruby web frameworks
----
Please join us Tuesday evening at 6:30 pm for the Phoenix Rails Users
Group. This month Josh Knowles and Jade
2006 Oct 24
1
Broken thread Safe connection Management on Mysql (Mysql too many connections errors)
Hi,
There is an issue on socket connection with backgroundrb (rev 47) and
mysql backend: after a certain number of job you reach the mysql
connection limit as socket are never closed and nobody can connect to
mysql anymore till you stop the backgroundrb daemon.
Already reported on:
http://rubyforge.org/pipermail/backgroundrb-devel/2006-July/000066.html,
2006 Jul 13
0
AZ Ruby on Rails Community
If you are interested in learning about Ruby on Rails or are currently
doing Ruby on Rails development this is a meeting you will want to
attend. We will be having the first meeting this Wednesday July 19th at
Molly Brannigan''s located at Val Vista and the US 60. Free wireless
connectivity will be provided.
The first part of the meeting will consist of introductions and feedback
2006 Jan 30
0
const_missing: uninitialized constant Test when running unit tests
I have a set of tests that run without issue on one machine. On another
machine when running the same tests we get:
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in
`const_missing'': uninitialized constant Test (NameError)
from ./test/unit/../test_helper.rb:5
from test/unit/entity_test.rb:1:in `require''
from
2005 May 08
1
ruby destructor hooks
Hi
Is there a way of finding out when or whether the wx object referenced
in ruby is still alive?
Here''s my problem
# register that +wx_control+ should update on application events of type
+event_type+
def add_subscriber(wx_control, app_event_type)
@subscriptions[app_event_type].push(wx_control)
end
# later
def broadcast(app_event)
@subscriptions[app_event.type].each { |
2006 Feb 09
9
Looking for hosting advice
Hello everyone,
I''ve got a Rails app that''s going to replace an in-house application,
where the customers are used to having to deal with maintaining their
own servers and data. As these are non-IT customers, maintaining
servers and data is a long way from their core business and thus quite
costly for them. I''m hoping to slice their costs by removing the
requirement
2006 Jan 11
4
Code Shopping in Rails
Back in the horse-and-buggy days when I was cutting my OO eye teeth
on Smalltalk, we had a LOT of conversations about the biggest problem
dealing with a large and growing set of classes and methods in the
Smalltalk image. It became clear that most, if not all, successful
Smalltalk coders spent a lot of their time code-shopping, i.e.,
looking for a class or method that did something they
2006 Aug 10
4
exporting vcards from rails
i''m doing a site for someone that has a form set up to collect contact
information from the user. i installed the vpim gem and was hoping to
give my client a way to download all of the contact''s information as a
vcard. using the examples, i was able to get it working in ruby, but i''m
not quite sure how to generate and download a vcard on the fly.
has anyone done
2011 Apr 02
0
reg.finalizer(): Multiple finalizers?
Hi,
I've got some questions regarding finalizers registered using
reg.finalizer(). I have a setup where in certain cases I wish to set
a new finalizer to an object that already got one. Since there is no
API for removing/replacing already registered finalizers (have been
"requested" previously on this list), I have basically just added a
new finalizer by calling reg.finalizer() a
2013 Feb 13
2
stopping finalizers
Is there some way to prevent finalizers running during a section of code?
I have a package that includes R objects linked to database tables. To
maintain the call-by-value semantics, tables are copied rather than
modified, and the extra tables are removed by finalizers during garbage
collection.
However, if the garbage collection occurs in the middle of processing
another SQL query (which is
2015 Nov 24
0
Custom C finalizers for .Call
On Tue, Nov 24, 2015 at 12:10:12AM +0100, Jeroen Ooms wrote:
> Currently it is all to easy for package authors to introduce a memory
> leak or stack imbalance by calling Rf_error() or
> R_CheckUserInterrupt() in a way that skips over the usual cleanup
> steps.
I have a more modest request: Please improve the documentation of
exactly what Rf_error() does and how it should be used!
2015 Nov 25
0
Custom C finalizers for .Call
Jeroen,
I agree that it may be useful to have some kind of "finally"-like infrastructure. However, in the use cases you list there are already ways to do that - the same way that R_alloc uses. First, you don't need to call UNPROTECT - the whole point is that the protection stack is automatically popped in case of an abnormal termination. That is precisely how memory leaks are
2016 Aug 06
1
vector finalizers
Dear R Devel,
In a thread this morning Luke Tierney mentioned that R's way of
garbage collecting is going to change soon in 3.4.0. I couldn't find
this info on Google but I wanted to share what I had been discussing
in another forum, in case now is not too late to raise considerations
which could affect the design of planned changes to R's garbage
collection facilities.
I ran into a
2006 Mar 05
2
ActiveLDAP maintain user connection
Hi, I''ve just started to do some work using ActiveLDAP and Rails. I''ve
managed to get some basic login code that works to authenticate users,
but I would like to be able to maintain that connection for the User
Model so that the ACL''s in LDAP for each user will be used correctly as
the various controller queries are made. I haven''t quite sorted out how
to
2007 Nov 16
1
Temporaly silencing the rails log.
Hi! I want to do what subject say. Is there any elegant way to do this:
???
# Silence the log inside the block attached to the method call.
def silence_logger
orig= nil
ObjectSpace.each_object(::Logger) do |logger|
logger.info "-" * 80
logger.info "Quieting the log..."
orig= logger.level
logger.level= ::Logger::FATAL
end
yield
2015 Nov 23
4
Custom C finalizers for .Call
WRE explains that R_alloc() can be used to allocate memory which
automatically gets released by R at the end of a .C, .Call or
.External, even in the case of an error or interruption. This is a
really great feature to prevent memory leaks. I was wondering if there
is a way to extend this mechanism to allow for automatically running
UNPROTECT and custom finalizers at the end of a .Call as well.
2010 Dec 14
1
Modifying values outside a function using "apply".
I am sure this si a simple problem but the solution is evading me.
I have a list of matrices all with the same number of columns but different
number of rows. The first two columns label the row. The labels are
allways the same for the same row numbers, just some matricies have more
rows.
For example using 3 column matrices...
> q.1 <- function(r){return(cbind(seq(0, 10, by=1)[1:r],
2007 Jan 24
2
A spec where interaction-based testing breaks down... (at least for now)
Here are the specs:
context "Finding all the stylesheets available to a company" do
setup do
@mock_company = mock("company")
@mock_company.stub!(:to_param).and_return "1"
Stylesheet.stub!(:find)
end
def do_find
Stylesheet.find_available_to @mock_company
end
specify "should convert the company into a parameter" do