similar to: If you want to disconnect a database properly, there is the code:)!!!

Displaying 20 results from an estimated 300 matches similar to: "If you want to disconnect a database properly, there is the code:)!!!"

2006 Jan 13
1
How to disconnect to a database????
Hi, We have experienced some problems with ActiveRecord::Base class of Ruby-Rails. We are building a web-application based on the Ruby-rails framework and the web-application needs to access to difference databases, so we do not pre-define our database accesses in the database.yml file. In fact, we are using the ActiveRecord::Base.establish_connection() to connect to our database, the function
2006 Jan 11
0
Connection problem with a generic-runtime-built ActiveRecord::Base
Hi, I''m trying to create a "runtime-generic" ActiveRecord class, It means I don''t need to know the table or database, before I create my program ruby-rails. So I don''t need to predefine my database in environment.yml file and pre-build classes inherited from ActiveRecord::Base. I write some code, it seems to work. However, I can''t disconnect my
2006 Jan 19
4
multiple database in the same actions?
Hi, I read the example in http://wiki.rubyonrails.com/rails/pages/HowtoUseMultipleDatabases, it show us how to connect to other database, each time we start a new action, however, this doesn''t work while you try to connect to two different database within the same action. SO I wonder is it possible to bind to two or more database within the same action???? Thanks you very much Saiho
1998 May 14
0
all.equal - cut two, test.equal
Below is a second cut at all.equal and also a generic function test.equal which is intended to return a T/F value. The default method uses all.equal, which is the reason I was looking for all.equal in the first place. Prompted by Thomas Lumley's observation that a T/F result makes more sense I thought it would be worthwhile to indicate what I'm really doing. I have been using test.equal
1998 May 21
1
all.equal - cut three
Below is a third cut at all.equal and the generic function test.equal which is intended to return a T/F value. There was a suggestion that "is.equal" rather than "test.equal" might be considered as a name. I have mixed feelings about this. I associate the "is" functions with inheritance rather than comparisons, but the "equal" part of the name makes it
1998 Jun 25
1
all.equal
I'm not sure what the process is for this, but can I get the following all.equal function put in the R base? Paul Gilbert ____ all.equal <- function(obj1, obj2,...) {UseMethod("all.equal")} all.equal.default <- function(obj1, obj2, tolerance=.Machine$double.eps) {if(mode(obj1) != mode(obj2) ) return("modes differ.") if (length(obj1) !=
2012 Jul 24
1
Function for ddply
Hello, all. I'm new to R and just beginning to learn to write functions. I know I'm out of my depth posting here, and I'm sure my issue is mundane. But here goes. I'm analyzing the American National Election Study (nes), looking at mean values of a numeric dep_var (environ.therm) across values of a factor (partyid3). I use ddply from plyr and wtd.mean from Hmisc. The nes requires a
2001 Dec 19
1
Pearson residuals in quasi family
Hi all, This is a very silly question or something escapes me: Let obj a simple gam poisson model. Let >obj<-gam(....,family=poisson) >obj1<-update(obj, family=quasi(link="log", var="mu")) >From summary.glm(obj1) the dispersion parameter is estimated 1.165; In fact it is: > (predict(obj1, se.fit=T)$se.fit[1:5]/predict(obj, se.fit=T)$se.fit[1:5])^2 4
1998 May 13
1
all.equal
I need the function all.equal which is in Splus but not yet in R. Below is a first cut. Comments would be appreciated. Paul Gilbert _______ all.equal <- function(obj1, obj2, ...) {if(mode(obj1) != mode(obj2) ) return("modes differ.") if(class(obj1) != class(obj2)) return("classes differ.") if(! all(unlist(attributes(obj1)) ==
2017 Sep 22
0
Get function implementation for indirect CallInst.
Hi All, I am using LLVM to analysis some C++ codes. I need to find the related function implementation for a given indirect CallInst. To make my question a little bit clear, I construct a simple example here. For “ call void %3(%class.Base* %1)”, I need to figure out Which implementation is called ( it can be manually figured out that _ZN1A5helloEv (A::hello() is called,how to figure it out in
2010 Mar 05
1
Changing the Prompt for browser()
Is there a way that I can change the prompt for within a browser() call. I often use use code like > with(obj1,browser()) Browse[1]> Is there a way that I can set it so that I can get something like > with(obj1,browser(prompt="obj1")) obj1[1]> I know that prompt is not a valid option for browser, but it would be nice if it were. There is an option('prompt")
2010 Mar 05
1
Changing the Prompt for browser()
Is there a way that I can change the prompt for within a browser() call. I often use use code like > with(obj1,browser()) Browse[1]> Is there a way that I can set it so that I can get something like > with(obj1,browser(prompt="obj1")) obj1[1]> I know that prompt is not a valid option for browser, but it would be nice if it were. There is an option('prompt")
2006 Aug 15
0
Problem with directors and Ruby
I''ve tried to distill this sample down to its smallest portion. The problem is that the function included in the .i file can take optional arguments, most of which are output only, except the last one, which is input only. My target language is Ruby. When SWIG produces the wrapper for this the input parameter''s name and type gets confused with the second
2012 Jan 25
0
Paperclip preserve files ?
Hi, I am using paperclip to upload files. The problem I am facing is, based on my object property I need to preserve my file. Means my object should be deleted from db but the file need to be restored. I am using the option :preserve_files => true. If I keep the above option in model it will be access to all the objects of the model. I need to restore only for limited objects.
2010 May 26
1
problem with not in in subseting dataframe
Hi all, I have a problem while subsetting a dataframe that is while I am using *%in%* condition like *stemp<-subset(temp, obj1 %in% obj2,select=c(temp))* this is working and giving results that what ever is there is both *obj1*and *obj2* ** ** but I want to get values which is there in *obj1* but not in *obj2 * can anyone help me how to get those values. i tried with *%o%* but i am not
2011 Sep 07
1
access objects
hi, say I have consecutively numbered objects obj1, obj2, ... in my R workspace. I want to acces one of them inside a function, with the number given as an argument. Where can I find help on how to do that? Somebody must have been trying to do this before... Some keywords to start a search are appreciated as well. Here's an example, I hope it clarifies what I'm trying to do: obj1 <-
2006 Jan 05
7
HOWTO: Combine fields from 2 two tables in 1 object
Hi all, For a dropdownlist (showing "Company - FirstName Lastname'') I want to fill an object @project_contacts with "Name" from table Companies and "Firstname" and "Lastname" from table contacts. Any idea? Regards, Gerard. -- "Who cares if it doesn''t do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS
2001 Oct 01
1
generic default values
I have a generic function test.equal <- function(obj1, obj2, ...) UseMethod("test.equal") however, the only argument that specific methods use is "fuzz" so I would like to change this to test.equal <- function(obj1, obj2, fuzz=???) UseMethod("test.equal") The problem is that some methods use slightly different default values for fuzz than others. How should
2004 Jan 16
2
reference to objects
Hi, is there a way to reference to a data object without copying it? For example I have a huge matrix called dist and I want two objects obj1 and obj2 to have a memeber dist that points to the matrix, but I don't want, for memory reasons, to copy the matrix twice. As far as I understand the following code will generate three copies of my data: dist <- some_code_that_generates_data
2012 Mar 28
0
[LLVMdev] GSoC 2012 Proposal: Python bindings for LLVM
Hello all, Here is my GSoC 2012 proposal: Python bindings for LLVM. Any feedback are welcome! *Title: Python bindings for LLVM* *Abstract: * llvm-py provides Python bindings for LLVM. The latest llvm-py supports bindings with Python 2.x version for LLVM 2.x. This project is to improve llvm-py to make it compatible with both Python 2.x and Python 3 for LLVM 3. *Motivation* LLVM is used as a