Displaying 7 results from an estimated 7 matches for "objb".
Did you mean:
obj
2009 Aug 05
1
S4 method dispatch: coercion of arguments with setAs defined
...'getNumber', function(object) standardGeneric('getNumber'))
setMethod('getNumber', 'A', function(object) object at number)
setClass('B', representation(obj='A', extra='list'))
setAs('B', 'A', def= function(from) from at obj )
objB <- new('B', obj=new('A', number=10))
getNumber(objB)
But get the error:
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function "getNumber", for
signature "B"
I thought the dispatch procedure in S4 would try to find a...
2012 Oct 17
1
Do *not* pass '...' to NextMethod() - it'll do it for you; missing documentation, a bug or just me?
...ated* them.
foo1.B <- function(object, ..., b=-2) {
NextMethod("foo1", object=object, ..., b=b);
}
## INCORRECT: As an illustration, *triplication* of arguments '...'.
foo2.B <- function(object, ..., b=-2) {
NextMethod("foo2", object=object, ..., ..., b=b);
}
objB <- structure(NA, class=c("B", "A"));
foo0(objB, "???", "!!!");
## Gives:
## List of 5
## $ object:Classes 'B', 'A' logi NA
## $ a : chr "???"
## $ b : num -2
## $ c : chr "!!!"
## $ d : num 4
foo1...
2008 Nov 05
1
Methods dispatch and inheritance R.oo
...-ClassA();
objA
[1] "Class A: 15"
setConstructorS3("ClassB", function(B=15) {
extend("ClassA", "ClassB",
.size2 = B
);
})
setMethodS3("print", "ClassB", function(this,...) {
print(paste('Class B:',this$.size2));
})
objB<-ClassB();
objB
Error in this$.size2 : $ operator is invalid for atomic vectors
--
View this message in context: http://www.nabble.com/Methods-dispatch-and-inheritance-R.oo-tp20339090p20339090.html
Sent from the R help mailing list archive at Nabble.com.
2006 Oct 03
2
Rails transactions issue with rollback.
...ction in which a duplicate key exception is being thrown
by MySQL. I assume this happens when I try to do a save. The problem
is that before the save, I do a destroy on another object as part of the
transaction. Catching the exception by doing this,
User.transaction do
begin
objA.destroy
objB.save <-- causing exception
rescue Exception => exc
flash[:notice] = ....
end
end
does not rollback the destroy. Any help would be appreciated.
Thanks,
Sam
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message bec...
2010 Nov 19
1
JRI and error message from R_isMethodsDispatchOn
...raps R:
Error in .Call("R_isMethodsDispatchOn", onOff, PACKAGE = "base") :
Incorrect number of arguments (2), expecting 1 for R_isMethodsDispatchOn
The Java pseudo code would be like:
public class Test{
public static void main(String[] args){
...
objA.do;
objB.do;
...
}
}
Each do method actually calls R to do the job. I already know R is
single-treaded so I implemented end method in Rengine class to shutdown
R in each method. I thought this won't cause multi-thread problems in
this case because I terminate/destroy each R thread before I c...
2017 May 04
12
[PATCH v1] ACPI: Switch to use generic UUID API
...99c-B8C9-5DA81D606E0A",
@@ -141,10 +141,10 @@ static int int3400_thermal_get_uuids(struct int3400_thermal_priv *priv)
}
for (j = 0; j < INT3400_THERMAL_MAXIMUM_UUID; j++) {
- u8 uuid[16];
+ uuid_le u;
- acpi_str_to_uuid(int3400_thermal_uuids[j], uuid);
- if (!strncmp(uuid, objb->buffer.pointer, 16)) {
+ uuid_le_to_bin(int3400_thermal_uuids[j], &u);
+ if (!uuid_le_cmp(*(uuid_le *)objb->buffer.pointer), u) {
priv->uuid_bitmap |= (1 << j);
break;
}
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index a15ec71d0423.....
2017 May 04
0
[PATCH v1] ACPI: Switch to use generic UUID API
...}
>
> for (j = 0; j < INT3400_THERMAL_MAXIMUM_UUID; j++) {
> - u8 uuid[16];
> + uuid_le u;
>
> - acpi_str_to_uuid(int3400_thermal_uuids[j], uuid);
> - if (!strncmp(uuid, objb->buffer.pointer, 16)) {
> + uuid_le_to_bin(int3400_thermal_uuids[j], &u);
> + if (!uuid_le_cmp(*(uuid_le *)objb->buffer.pointer), u) {
> priv->uuid_bitmap |= (1 << j);
>...