Questions tagged [unique]

Refers to an element that is distinctly different from any other element in a collection.

Refers to an element that is distinctly different from any other element in a collection.

6072 questions
2
votes
5 answers

Generating Unique Values for MySQL Unique Fields

When a user signs up to my website, for example, I create a unique string of length 40 and insert it into the database. We then send an email to the newly signed up user containing this unique string in the form of an URL, and this all works…
Donal.Lynch.Msc
  • 3,365
  • 12
  • 48
  • 78
2
votes
2 answers

Selecting unique non-repeating values

I have some panel data from 2004-2007 which I would like to select according to unique values. To be more precise im trying to find out entry and exits of individual stores throughout the period. Data sample: store year rev space market 1…
2
votes
2 answers

Rand(); with exclusion to and already randomly generated number..?

I have a function which calls a users associated users from a table. The function then uses the rand(); function to chose from the array 5 randomly selected userID's however!... In the case where a user doesnt have many associated users but above…
Stefan P
  • 1,013
  • 2
  • 18
  • 34
2
votes
1 answer

XSLT sorting by 2 parametres and choosing by the 1st unique and the 2nd highest

I had an xls book saved as xml. There I have 1st rows with header and other rows with data. In xml it looks: Header 1 - id
2
votes
5 answers

Remove duplicate from php array (not array_unique)

I have an array like this: Array( [0] => Array( [id] => 1 [name] => name1 [table] => warehouse) [1] => Array( [id] => 2 [name] => name2 [table] => warehouse) [2] =>…
Levan Lotuashvili
  • 841
  • 10
  • 13
2
votes
2 answers

Why Microsoft has put 2 different options for creating Unique Indexes on a table in SQL Server 2005?

Why Microsoft has put 2 different options for creating Unique Indexes on a table in SQL Server 2008? Manage Indexes/Keys : 1 ) type = Unique Key ==> IsUnique = Yes (IsUnique is disabled) 2 ) type = Index ==> IsUnique = Yes Thank you
odiseh
  • 25,407
  • 33
  • 108
  • 151
2
votes
2 answers

How can I get unique values in dataframe column into a dataframe even though the number of values is not the same

I have a dataframe Data: Data <- data.frame(A=sample(1:7),B=c(5,5,5,6,6,6,6),C=c(1,2,2,3,3,4,5)) A B C 1 6 5 1 2 7 5 2 3 4 5 2 4 2 6 3 5 1 6 3 6 5 6 4 7 3 6 5 I am trying to extract the unique values from each of the columns into a…
Elks
  • 85
  • 1
  • 10
2
votes
2 answers

Do swift hashable protocol hash functions need to return unique values?

I am working through an iOS swift Tetris tutorial* and have it completed and working. But I am puzzled about one particular aspect - the Hashable protocol. The function: class Block: Hashable, Printable { [...] var hashValue: Int {…
2
votes
3 answers

Python Calculating Unique List Permutation Possibilities

So I have a problem dealing with permutations of lists/strings, which I am having a hard time solving. So, say I have several Lists: list1 = ["a"] list2 = ["a","b","c","d"] list3 = ["b","e"] list4 = ["f","g","a"] I need to calculate the number of…
Michael Scott
  • 539
  • 3
  • 8
  • 18
2
votes
1 answer

Sublime Text 2 remove unique lines

I'm looking for the opposite of Sublime Text 2's Permute Lines -> Unique. I need to be able to display only the duplicate lines in the file (or, if possible, in two different files). I found the HighlightDuplicates plugin, but I don't know how to…
PBwebD
  • 778
  • 11
  • 33
2
votes
2 answers

Extracting unique and non-unique strings to separate output files

I am have trouble trying to extract only lines that are not duplicated and only lines that are only duplicates from a test file. The input file contains both duplicates and non-duplicate lines. I have created a logging function and I can extract…
Chimpin
  • 21
  • 1
2
votes
3 answers

SQL - How to combine rows based on unique values

The table below was created from another table with columns ID,Name,Organ,and Age. The values found in the Organ column were codes which designated both organ and condition. Using CASE I made a table like…
O.D.P
  • 135
  • 1
  • 2
  • 10
2
votes
1 answer

Uniqueness of an attribute in an object

I have created a new class in which there is an attribute called Name. I am trying to make this attribute ‘unique’. I mean that if I create an object with the name "AA", it will not be possible to create another object named "AA". How can I manage…
Ganjira
  • 966
  • 5
  • 16
  • 32
2
votes
3 answers

Unique vectors in cell based on tolerance

I'm trying to make a search algorithm which finds the unique columns of a cell based on a tolerance level. The unique function of MATLAB (R2012a), does not provide a tolerance input. Below is the code which I have so far; I have limited myself to…
user5489
  • 123
  • 2
  • 8
2
votes
1 answer

How to pass request.user to a model's clean method for a foreignkey unique_together validation?

I'm trying to run a validation where a user can't enter the same name_field twice but other users entering the same name will not interfere. I tried using "unique_together = (("username","name_field"))" but when a user enters the same value twice…
Logic1
  • 1,806
  • 3
  • 26
  • 43