similar to: Prototype.js object.constructor exception

Displaying 20 results from an estimated 300 matches similar to: "Prototype.js object.constructor exception"

2009 Nov 23
1
OOP with Encapsulated Class Definitions
Hi all, I'm seeking feedback (good, bad or indifferent) in regards to developing (further) a new class system for R, that uses encapsulated class definitions (i.e. the method definitions are literally inside the body of the class definition). A working (however very rough and poorly tested) system is available in my R package "oosp" with documentation in the vignette
2006 Aug 04
2
RoR: recognizing a defined class
Hi all, I am very new to Ruby and I have a silly question: how do I get RoR to "recognize" that I just defined a class? To be more explicit, I have a controller and view, and then I want to create a class and get the controller to "see" it. So, I created a file called "myobject.rb" in the models/ directory and inside it defined "class myobject [...] end".
2006 Dec 12
1
S4 'properties' - creating 'slot' functions?
Dear R users! Several languages like C# or VB allow one to create properties; typically these are under 'get', 'set' tags. My question is this really, what are similar or comparable strategies in R, and what might be preferred? I have a couple of situations where I want a certain computation to belong to a class, but I do not really want to seperate it out to a stand-alone
2008 Jan 09
1
Subsetting Method [ Revisited
Hello Everyone: As usual, thanks in advance for any help. I was hoping to get some more advice on this question: I'm trying to write a subsetting routine for an S3 object I've created -- lets call it myObject. myObject has a few attributes basically of type string and numerics. Its atomic value is just a vector of ints. I want to write my own subsetting routine to subset myObject in
2003 Oct 22
2
Automatically updating GLM object
Dear all, i generated several GLM objects, named myobject1 to myobject25. Now i'd like to update both of them. So i tried: for(ii in 1:25) { assign(paste("myobject.updated", ii, sep=""), update( myobject[ii] ,.~ + VAR2)) } Doesn't work I also tried to get all the names in a vector and update(names.myobject[ii],.~ + VAR2) Stiil doesn't work Any ideas
2006 May 24
2
newbie oo question
Hey everyone, I''m trying to create an object that will have some properties predefined, but will allow me to pass in properties to override those standard props if needed. I''m trying something like: var myObject = Class.create(); myObject.prototype = { initialize: function(element, options) { this.element = $(element); this.name = this.element.id; this.options =
2006 Feb 17
2
Sorting Multiple Arrays
Hey Cats, I''m having a problem. I''m working with an object that contains a bunch of arrays: var myObject = { "data": [ {"line": [1,"aoo","far"]}, {"line": [2,"boo","ear"]}, {"line": [3,"coo","dar"]}, {"line":
2005 Jul 19
2
Obtaining argument name within a function
Dear all How can I obtain the name of the argument passed in a function? Here is a simplistic example of what I would like to obtain: myfunction= function(name) { print(paste("The parameter name was",unknownFunction(name)) } myfunction(myobject) [1] "The parameter name was myobject" Thanks Francisco
2006 Dec 30
1
plot methods in sp
Dear listers, I am working since a while with the sp package and still wonder how the plot methods are managed with sp spatial objects. For instance, SpatialPolygonsDataFrame objects have obviously a plot method. However it cannot be found in the list provided by methods(plot) . Furthermore ?plot.SpatialPolygonsDataFrame, nor ?plot.SpatialPolygons, etc.. provide a help, though the lattice
2006 Jun 21
26
Implementing a boolean "switch" in a Class
I need a single boolean which would be "globally" accessible to all instances of a class. Seems like the boolean should be in the class prototype, but I was troubled by the difficulty of setting the prototype boolean to true. Maybe I''m missing something? var MyObject = Class.create(); MyObject.prototype = { bSwitch: false, ... other methods and properties } var oMyOb1
2012 Sep 18
2
Access block scope from AR object
I need to create a sort of transaction around some Active Record objects that perform many insert/updates. Example: class MyObject def transaction &block @my_var = value self.instance_eval block end end MyObject.new.transaction do Model.create Model.collection.create etc...... end I have a gem that add a method into AR::Base and I need to read
2004 Nov 18
5
Lexical Scoping: eval(expr,envir=)
Hi R-listers, I am trying to better undertand what we would call "functional paradigm" use of S/R to better map my programming activities in other languages. This little function is aimed to create an object (at the end end, it would have it's own class): -- myObject =function(){ list( a=1, foo=function(b) { cat("b:",b)
2010 Nov 22
1
cpgram: access data, confidence bands
Dear R experts, beginners and everyone else, I'm calculating "cumulative periodogram" using the command "cpgram" [1] from the MASS library. Here is a short example with the "lh" (hormone level) dataset: library(MASS) plot(lh,type="l",ylab="value",xlab="time", main="Hormone Levels (lh)") spectrum(lh,
2010 Jul 08
3
Testing equality
Hello How can I test equality with two objects when they include some attribute that is BigDecimal? if I make something like this: it "should ...whatever" do obj = Factory.create(:my_object) ... MyObject.first.should == obj end. FAILS This fails because the object expected is different from the object gotten, and the only difference are the BigDecimal attributes, that are
2006 Aug 10
6
save without commit ?
How do I get ''save'' to execute without commit? I have tried: ActiveRecord::Base.connection.begin_db_transaction # do some stuff that doesn''t issue a database COMMIT statement # then: @myObject.save # this issues a COMMIT but it shouldn''t! Shouldn''t it wait until I''ve called: ActiveRecord::Base.connection.commit_db_transaction ? what am
2006 Mar 28
0
Question about Mapping from Forms
During a load or save in my controller I''ve manually been doing: @myobject = MyObject.find(:first, :conditions => "id = #{@params[''id'']}") If I''m updating an existing object I load it, change stuff using something like myobject.name = "@params[''name'']", etc etc, then call save. That''s what I''ve done in
2018 Oct 15
2
sys.call() inside replacement functions incorrectly returns *tmp*
Kia Ora > Although I'm not sure what problem it would solve... Given that you asked, I was interested in writing a multiple assignment function as a replacement function, so something like: massign (x, y, z) = construct.some list () Obviously, that's not possible. Probably the best example I can think of is converting cartesian coordinates to polar coordinates. Then we might have
2006 Jul 27
1
Getting a MySQL deadlock when running RailsCron...
I''m using RailsCron, and it''s working out very well for me. However, I''m having one problem right now. I use the acts_as_background on one of my model objects. In order to get it to add the cron job to the table, I have to make sure the model is loaded in environment.rb. MyObject.load However, I''m running 2-3 fcgi process on my server. Most of the time when
2002 Sep 10
1
adding a method to a class
Hello, I don't see how to add a method to a class. I can add "slots" (and retreive them by : myObject at slot1) but not methods, for example accessor for these slots and others functions. I've read the "methods" library documentation but I can't figure out how to do this. Thanks for any help/tips Vincent
2006 Dec 12
0
S4 property slots as functions?
Dear R users! Several languages like C# or VB allow one to create properties; typically these are under 'get', 'set' tags. My question is this really, what are similar or comparable strategies in R, and what might be preferred? I have a couple of situations where I want a certain computation to belong to a class, but I do not really want to seperate it out to a stand-alone