similar to: how to convert a set of strings to a list of unique numeric id?

Displaying 20 results from an estimated 2000 matches similar to: "how to convert a set of strings to a list of unique numeric id?"

2006 Apr 03
1
Automatically changing strings to pass unique constraints
I have validates_uniqueness_of on one of my model''s attributes. I''d like to make it so that I can set the attribute to something, and if it clashes with an existing record, automatically append a number to it. I''m not really sure of the best way to go about this - any recommendations? Pat
2010 Jun 22
1
how to efficiently compute set unique?
Hi, I want to get the unique set from a large numeric k by 1 vector, k is in tens of millions when I used the matlab function unique, it takes less than 10 secs but when I tried to use the unique in R with similar CPU and memory, it is not done in minutes I am wondering, am I using the function in the right way? dim(cntxtn) [1] 13584763 1 uniqueCntxt = unique(cntxtn); # this is
2007 Feb 02
0
Mutiple unique key(Compisitive unique)
Hi All.. I am new to ruby on rails.I want set the unquie on two fields. Means in one model three fileds are there. 1.Id, 2.C-id 3.Q-id I want set the unquie on C-Id,Q-Id combindely on the model validations Can u give me advice? I tryed with statemwnt validates_uniqueness_of [:c_id, :qid] But it now giving the proper results Regards, Ramya -- Posted via http://www.ruby-forum.com/.
2008 Jun 25
3
selecting values that are unique, instead of selecting unique values
unique(c(1:10,1)) gives 1:10 (i.e. unique values), is there any method to get only 2:10 (i.e. values that are unique) ? _________________________________________________________________ Easily edit your photos like a pro with Photo Gallery. [[alternative HTML version deleted]]
2018 Jul 02
1
MARGIN in base::unique.matrix() and base::unique.array()
Hi, The man page for base::unique.matrix() and base::unique.array() says that MARGIN is expected to be a single integer. OTOH the code in charge of checking the user supplied MARGIN is: if (length(MARGIN) > ndim || any(MARGIN > ndim)) stop(gettextf("MARGIN = %d is invalid for dim = %d", MARGIN, dx), domain = NA) which doesn't really make sense. As
2006 Nov 15
2
Newbie: how to get unique x unique x aggregate chart?
I'm very new to R, so please forgive me if I just missed the answer in existing documentation... I have a data set with at least three columns, X, Y, and Z. I want to produce a chart where one axis shows all the unique values of X, and the other axis shows all the unique values of Y. Each cell within the chart should contain the result of applying an aggregate function (such as mean(), for
2007 Jun 07
0
Unique :key not maintained after add_indexes?
Hi, When adding an index to another one using add_indexes I get duplicates even though I use the :key attribute. For example: def test_add_indexes_uniqueness index1 = Ferret::Index::Index.new(:key => :id) index2 = Ferret::Index::Index.new(:key => :id) # Add two items with same id index1 << {:id => 23, :data => "This is the data..."}
2006 Aug 04
1
how to count totals for each unique name in a table?
hello, i am having trouble on how to implement this. i have a table of doctor information where each doctor has a town and county field. i would like to create a view that shows the amount of doctor_types in each town. For example if the user selects the ''General Doctors'' search button, a view like this will show up. The next step would be for the user to select which
2006 Nov 04
0
unique boolean flag
Hi! I have a field "default", and i wish to validate that only one of the records is true, the remaining must be false. If there are no records, the first one created must be default=true. Apart from that, when any new/updated record is set to default=true, the remaining ones must be default=false. How do you accomplish this? Thanks in advance, Rodrigo. -------------- next part
2006 Jul 28
0
Dreamhost, fastcgi, validates_uniqueness_of.... is not always unique?
Hey everyone, I have an application running on dreamhost with fast cgi (FCGI). I have a model, "Member", that has the following validation: validates_uniqueness_of :email, :if => Proc.new{|member| !member.email.blank?} The :if clause is really not needed because an email address is required and in fact the model also has: validates_presence_of :email
2006 Jun 20
3
return unique rows with finders
I''m looking through the api for something like find(:all, :distinct => true) so that multiple instances of a row won''t be returned - is this possible? Thanks!
2006 May 01
1
finding unique values in a column
Is there a way in Rails to find all the unique values in a column? I was hoping to find something like Item.find(:unique => "colname") but didn''t. Is there a way, short of writing _ugly_ raw SQL to do this in Rails? Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Apr 18
0
activerecord(mysql) and hash to unique count
I am working with ruby(activerecord) and want to save a ''hash'' of URLs such that a key is the URL and the value points to a count of how many times it occurs after processing a csv file my question; all I know of is right now is to attempt to save, get a unique error and then when handling the exception increment the hash value (really a column in a table) Is this bad? Or
2006 May 02
0
Non-unique IP removal issue
I have come across an interesting issue when adding non-unique IPs to an interface. I am not sure this is the right place for this issue but I couldn''t find anything online about it. The issue is that "ip addr del" ignores the mask and deletes the first matching IP. I know adding non-unique IP to same ethernet doesn''t really make sense, but it is possible
2006 Jan 09
0
Adding multiple input boxes having unique ids
Hi, I can''t figure out how to set a unique id or name for multiple new input boxes. If I have a todo list and want to add another task input box via a "add task" link, I can assign a unique name and id for the first new one I had with the following: <!-- picked up and placed within wrong_answers_container when Add Another Answer is clicked --> <div
2006 Feb 12
3
Error when Eager Loading "Not unique table/alias"
Hi list, I get the error "Not unique table/alias" (myql 4.1) when trying eager load 2 classes that use the same base class (not STI) Example: <code> class Wedding < ActiveRecord::Base belongs_to :bride, :class_name => ''Person'', :foreign_key => ''bride_id'' belongs_to :groom, :class_name => ''Person'',
2006 Jan 18
1
using unique varchar instead of id
Hi, I just signed up so ''hello everybody''. As the title suggests, I was wondering if there was an easy way to specify that I want all actions/controls to be based upon a particular parameter rather than :id (in this case :unique_name). I don''t :id to appear in URLs or elsewhere, I want it all to work from :unique_name. It seems like something that I should be able to
2010 Jun 29
0
Rails session_id is not unique
We have been experiencing an issue in our environment (Jruby 1.4, Rails 2.3.5, Tomcat 5.5, Java 1.6) where duplicate session_ids are being created in the sessions table. We are assuming the only way this can happen is when 2 sessions are created at the exact same time on 2 different machines (we have 10 app servers running with config.threadsafe! on). Has anyone encountered this issue? It seems
2013 Jul 24
0
subtracting rows for unique
Hi, Try: dat1<- read.table(text=" ID Date x2 x1????????? x3 56 25-Jun-01 10 2? 126 56 29-Oct-01 10 2? 140 56 18-Mar-02 10 2? 445 56 6-Jun-03 10 2??? 224 56 16-Jan-04? 10 2??? NA 58 10-Jan-02 10.8 1 715 58 26-Dec-03 10.8 1??? NA ",sep="",header=TRUE,stringsAsFactors=FALSE) ?unlist(with(dat1,by(as.Date(Date,format="%d-%b-%y"),ID,FUN=function(x)
2011 Jan 05
1
unique limited to 536870912
Hi I am using R with igraph to analyze an edgelist that is greater than the said amount. Does anyone know a way around this? Thanks Inder