search for: attr1

Displaying 20 results from an estimated 20 matches for "attr1".

Did you mean: attr
2005 Aug 10
1
Why only a "" string for heading for row.names with write.csv with a matrix?
Consider: > x <- matrix(1:6, 2,3) > rownames(x) <- c("ID1", "ID2") > colnames(x) <- c("Attr1", "Attr2", "Attr3") > x Attr1 Attr2 Attr3 ID1 1 3 5 ID2 2 4 6 > write.csv(x,file="x.csv") "","Attr1","Attr2","Attr3" "ID1",1,3,5 "ID2",2,4,6 Have I missed an easy way...
2010 Jun 01
2
Help on aggregate method
...f certain values on a data frame,? grouped by various attributes, and then create a new column in the data frame that will have the corresponding mean for every row. I attach part of my code: matchMean <- function(ind,dataTable,aggrTable) { index <- which((aggrTable[,1]==dataTable[["Attr1"]][ind]) & (aggrTable[,2]==dataTable[["Attr2"]][ind])) as.numeric(aggrTable[index,3]) } avgDur <- aggregate(ap.dat[["Dur"]], by = list(ap.dat[["Attr1"]], ap.dat[["Attr2"]]), FUN="mean") meanDur <- sapply((1:length(ap.dat[,1])), F...
2009 Sep 18
1
inconsistency in attaching attributes to NULL
In R-devel (svn 49628) and back to at least R 2.7.0 we get inconsistent results when attempting to attach attributes to a variable with the value NULL. If we use attributes<- it finishes but changes the value to list(). > a<-NULL > attributes(a)<-list(attr1="First attribute", attr2=2+2i) > a list() attr(,"attr1") [1] "First attribute" attr(,"attr2") [1] 2+2i If we use attr<- it refuses to attach the attribute > b<-NULL > attr(b, "attr1") <- "First attrib...
2010 Jul 02
3
Knowledge discovery
Hi, I have 100000 units with 10 attributes (attr1, attr2, attr3, etc...) For instance: unit attr1 attr2 attr3 ... 1 a ww 12 2 a re 11 3 b ww 09 4 c yt 02 5 a qw 02 ... I'd like to answer to the question: a) what are the most frequent combinations of att...
2007 Jul 18
2
Hash.from_xml
Hi, I''ve started looking at ticket 90<http://merb.devjavu.com/projects/merb/ticket/90>and there are a couple of situations that the current implementation doesn''t cater for. 1. Tag Attributes are wiped out. - <tag1 attr1=''1''>Content</tag1> #=> { "tag1" => "Content" } - I think it should return - {"tag1" => { "attr1" => ''1'', "__content__" => "Content" } 2. Mixed content can throw an...
2006 Jan 05
2
Confused...
Ok, So, I''ve got two data tables associated through a foreign key. class Child < ActiveRecord::Base belongs_to :parent, :class => Parent, :foreign_key => "parent_id" # also has attr1, attr2 end class Parent < ActiveRecord::Base has_many :children, :class => Child, :foreign_key => "parent_id" end So, I''m trying to build the new/edit form for the child table... Basically, I was aiming for something like: <%= text_field "child", &quot...
2012 Jan 04
1
AR update / create pattern: is there an easier way?
I find myself writing the following frequently: r = MyActiveRecord.where(:attr1 => cond1, :attr2 => cond2, ...) r.exists? ? r.first : r.create ... which has the effect of returning an instance of MyActiveRecord if all the conditions are met, or creating one if it doesn''t. A variant of this: c = MyActiveRecord.new(:attr1 => val1, :attr2 => val2,...
2007 Mar 05
1
Deletion of xattr don't sync
...sync, however it is synced when data of file change, see example below. Maybe this is a bug or maybe this is ok? System gentoo attr-2.4.32, rsync form today cvs. -- Regards Stanislaw Gruszka stasiu@sg /mnt/hda5/export $ echo "data" > file stasiu@sg /mnt/hda5/export $ attr -s attr1 -V val1 file Attribute "attr1" set to a 4 byte value for file: val1 stasiu@sg /mnt/hda5/export $ attr -s attr2 -V val2 file Attribute "attr2" set to a 4 byte value for file: val2 stasiu@sg /mnt/hda5/export $ rsync -av -X --delete 127.0.0.1::rsync-export /mnt/hda5/copy receivin...
2013 Apr 25
1
[LLVMdev] Dynamic Type Lookup ...
Thanks for your feedback David.... Yes, the intention is to support duck-typing. In my code example, a.attrB1 = 5 .... is probably more accurately stated as ..... a. attr1.attrB1 = 5 Certainly this would be an unsafe call because we would not know that attrB1 is an attribute of attr1 until runtime. I believe this type of call is valid in a language like Python. Are there any references out there that would help me implement something like this? thanks, frank...
2011 Nov 12
1
With an example - Re: rbind.data.frame drops attributes for factor variables
...male 3 good 4 Male 4 bad > attributes(dataset$answer) $levels [1] "bad" "good" "great" $class [1] "factor" Now adding some custom attributes to column dataset$answer attributes(dataset$answer)<-c(attributes(dataset$answer),list(newattr1="custom-attr1")) attributes(dataset$answer)<-c(attributes(dataset$answer),list(newattr2="custom-attr2")) > attributes(dataset$answer) $levels [1] "bad" "good" "great" $class [1] "factor" $newattr1 [1] "custom-attr1"...
2013 Apr 24
3
[LLVMdev] Dynamic Type Lookup ...
Hello everyone, I would like to implement functionality something like the following in my sample language..... class A { Object attrA1 } class B { int attrB1 bool method methTestB ( .... ) } main () { bool test Object a a = new Class A() a.attr1 = new Class B() a.attrB1 = 5 test = a.methTestB(...) } I assume that I will need: - some type of runtime lookup table to store the class structure of Class A and B. - some way of encoding and storing an object's attribute type information - a means of retrieving this information at runti...
2006 May 17
6
ActiveRecord#to_param
...e documentation. The closed I came up with was: <%= link_to "action", {:action => "take_action"}.merge(object.attributes_before_type_cast) %> This way I can see the data of the object in the @params Hash but instead of the needed values "data" => {"attr1" => "value1", "attr2" => "value2"} I get a more flattened Hash: {"attr1" => "value1", "attr2" => "value2"}. I think I might solve the problem by appending a "[data]" to every key of the object.attrib...
2003 Oct 23
1
Can you create a MySQL database with RMySQL?
Is it possible to create a database in MySQL via RMySQL? Also, is the format for the authorization field 'userName/password at databasename'? I saw an example like this somewhere in the documenation, but I haven't found the actual specification. Thanks, Barnet Wagman
2012 Feb 27
0
Suggestion on Model Def - reg in nlme
...it is self explanatory. library(reshape) library(nlme) library(multcomp) df<-expand.grid(Subject=c("S1","S2","S3"),Arm=c("L","R"),Treatment=c("A","B","C"),Time=c("T0","T1","T2")) df$Attr1<-rnorm(27,40,2.2) df$Attr2<-rnorm(27,76,4.2) df<-melt(df) colnames(df) head(df) df<-subset(df,variable=="Attr1") df<-droplevels(df) model <- lme(value ~ Treatment*Arm*Time, random = ~1 | Subject,data =df) print("R Formula Used - lme(value ~ Treatment*Arm*Time, ran...
2013 Apr 25
0
[LLVMdev] Dynamic Type Lookup ...
On 24 Apr 2013, at 23:13, Frank White <frankwhite1003 at gmail.com> wrote: > Hello everyone, I would like to implement functionality something like the following in my sample language..... > {snipped not very informative C++ pseudocode.} > I assume that I will need: > > - some type of runtime lookup table to store the class structure of Class A and B. That depends on
2006 Aug 15
6
Theoretical: Should models be subclasses of AR or mix it in?
All, My apologies if this is a little long-winded and stream of consciousness-y :). SUMMARY: Why do we extend ActiveRecord instead of mixing it in to our model classes? Been thinking about my app''s models and starting to want to build something of a hierarchy. I have some commonality across 3 of my model classes and I''d liek to aggregate the behavior in a superclass.
2011 Oct 25
7
additional model attributes
Hi, i have a "place" model with 2 columns (id, name). I''m calling an external api which gives me data to create a new place object. I would like to add the address from the external place to the place object and render it as a json result, without storing it in the database. i don''t get any errors, but the address never shows up within the json output. i''ve
2011 May 11
2
Issue with Arel::SelectManager and insert Method
Hello, Arel::SelectManager (arel 2.0.9) uses following statement to insert a new record: @engine.connection.insert im.to_sql, ''AREL'', primary_key_name, primary_key_value But in DatabaseStatements insert ist defined as: insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) Actually, Arel::SelectManager does not use the sequence name. This leads to issues
2016 Feb 15
1
[PATCH] Start adding return values tests for bindings
...ot; + ["pv_fmt"]=> + string(7) "unknown" + ["pv_size"]=> + int(1) + ["dev_size"]=> + int(1) + ["pv_free"]=> + int(1) + ["pv_used"]=> + int(1) + ["pv_attr"]=> + string(5) "attr1" + ["pv_pe_count"]=> + int(1) + ["pv_pe_alloc_count"]=> + int(1) + ["pv_tags"]=> + string(4) "tag1" + ["pe_start"]=> + int(1) + ["pv_mda_count"]=> + int(1) + ["pv_mda_free"]=&g...
2010 Dec 01
10
[LLVMdev] RFC: Exception Handling Proposal Revised
...en determines which catch handler to call (if any). If no catch handlers are applicable, the exception resumes propagation either to the next enclosing region or out of the function. Basic Block Attributes ====================== A basic block can be given an attribute. General Syntax: label: attr1 attr2 ... attrn For exception handling, we introduce the `landingpad' attribute. lp: landingpad A basic block that has the `landingpad' attribute is considered a (surprise!) "landing pad". • It may be branched to only by the unwind edge of an invoke instruction or by the r...