Displaying 20 results from an estimated 60 matches for "myobjects".
Did you mean:
myobject
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".
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 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
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
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 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
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":
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 =
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)
2006 Jun 17
2
problem with select_date
In my form I have these items:
<%= select_year Date.today,
:start_year => Schoolyear.get_startdate.year,
:end_year => Schoolyear.get_enddate.year %>
<%= select_month Date.today.month %>
No matter what I do, in my controller I can''t seem to access the
selected year and
month.
I have tried params[:month].to_s and also
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
2008 Nov 04
18
Can I do foo.should (be_nil || be_empty) in rspec
Is there any way to do
foo.should (be_nil || be_empty)
in rspec.
Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081104/ee43c9c9/attachment.html>
2005 Nov 23
8
getting started, reading listing and saving data
Dear List
I am new to R and to the list and will try best as I can be clear and
concise. My apologies if anything I write contravenes the posting code
on this list. I would also like to say I have run through most of the
material on the R website before writing this email however, I am
stuck.
Here is what I want to do and what I have done
1. Read a comma seperated text file into R
I have used
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
2007 Jan 22
1
Prototype.js object.constructor exception
I''m trying to debug an a uncaught exception: Permission denied to get
property Object.constructor error.
I have some code like this:
myObject.js
------------
function myObject (arg1, arg2, arg3)
{
//does some constructor related stuff
}
myObject.prototype.createSomething = function()
{
// do more boring stuff
// return an Array;
}
manager.js
-----------
var fakeHashMap = new
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
2011 Jun 10
2
merge large number of raster objects
Hello,
I have a large number of raster objects in memory, with names RH100,
RH101, RH102, etc. (myobjects <- ls(pattern='^RH')).
These rasters are sections of a continuous map, and I would like to
combine them using the RasterObject merge tool in package 'raster.'
Merge expects an input list of raster objects (outmap<-merge(x, y, ...),
where x, y, and ... are raster objects)....
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
2006 Apr 06
2
Finding out the format of an object
Suppose I have an arbitrary R object. Is there a way to find out its
format? There are 118 points, each described by two numbers. Let the
name of the object be "obj" without the quotes. I can do a print
(obj), but all I get is a bunch of numbers. I can do a ls.str (obj),
but all I get is a bunch of numbers. Is it a data frame? A vector with
118 elements, each having two