unique

how to make the username and email is Unique .. using WTFroms

wtforms is a forms validation and rendering library for python web development but i can't find how to handle the username and email Unique , thanks ...

How to generate unique serial number of machine in Delphi?

Hi, I have question how to generate unique serial number of machine in Delphi? I tried to do this using the ID the motherboard or processor, but unfortunately it's unfortunately supported. Partition serial numbers, etc. fall off, because it is changing after the formatted. I'm looking for something that doesn't change after the formatt...

Prolog Beginner: How to make unique values for each Variable in a predicate.

I have a prolog predicate: Add( [A|B] , Answer ) :- ... ~ Add everything in the list to come up with answer ... I would now like to implement AddUnique that would return unique values for everything in the list except when I give it the variable twice. Here are somethings that are logically equivalent: ?- AddUnique...

jQuery: how to pick unique IDs ?

Hello. New to whole this jQuery (and javascript altogether, heh) and so far it's been excellent, but now I'm in a small pickle. Let's say I have list of forms generated from SQL database and every single one of them has to have unique id, so how I can select the specific item that is to be manipulated (changing values via php). the $("#...

Need a SQL statement focus on combination of tables but entries always with unique ID

Hi All, I need SQL code to solve the tables combination problem, described on below: Table old data: table old name version status lastupdate ID A 0.1 on 6/8/2010 1 B 0.1 on 6/8/2010 2 C 0.1 on 6/8/2010 3 D 0.1...

Unique value in table using EF4 and locking

In this code, I have an Entity Framework 4 model with a single "Thing" entity that has an Id and a Name(string) column. I would like to ensure that when I call FindOrCreateThing(name) from multiple threads, only one row in the Things table will ever be created with the given name. Currently, I'm using locks to accomplish this, and it se...

T-SQL Unique constraint locked the SQL server

HI ! This is my table: CREATE TABLE [ORG].[MyTable]( .. [my_column2] UNIQUEIDENTIFIER NOT NULL CONSTRAINT FK_C1 REFERENCES ORG.MyTable2 (my_column2), [my_column3] INT NOT NULL CONSTRAINT FK_C2 REFERENCES ORG.MyTable3 (my_column3) .. ) I've written this constraint to assure that combination my_column2 and my_c...

UNIQUE CONSTRAINT on a column from foreign table in SQL Server 2008

I have two tables: create table [dbo].[Main] ( [ID] [int] identity(1,1) primary key not null, [No] [int] not null, [Sign] [char](1) not null ) create table [dbo].[Names] ( [ID_Main][int] primary key not null, [Name][nvarchar](128) not null, constraint [FK_Main_Users] foreign key ([ID_Main]) references [dbo].[Ma...

Hibernate, select by id or unique column

I am using hibernate for Java, and I want to be able to select users by id or by name from the database. Nice thing about Hibernate is that it caches the result by id, but I seem to be unable to make it cache by name. static Session openSession = Factory.openSession(); public static User GetUser(int Id) { return (User) openSessio...

How to set two column unique in SQL.

I am creating a table ,in the table two column is unique, I mean columnA and columnB do not have same value: such as : Table X A B 1 2(RIGHT,unique) 2 2(RIGHT, unique) 1 3(RIGHT, not unique) 2 3(RIGHT, not unique) 1 2 (WRONG, not unique) How to create such a table? many thanks! create table X ( [ID] INTEGER PRIMARY KEY AUTOINCREASE ...

Problem in finding next / previous row in mysql

SELECT id ,MAX(status) AS status FROM Mail WHERE status < (SELECT status FROM Mail WHERE id = 1000) GROUP BY status ORDER BY status DESC LIMIT 1; I am using this query to find the previous row of the current row 1000.Here i am getting NULL values if i use the status column which is not unique.where as it gives proper values...

Generating a unique id for a given string using php

I'm using Zend_Cache_Core with Zend_Cache_Backend_File to cache results of queries executed for a model class that accesses the database. Basically the queries themselves should form the id by which to cache the obtained results, only problem is, they are too long. Zend_Cache_Backend_File doesn't throw an exception, PHP doesn't complai...

MySql compound keys and null values

Hi, I have noticed that if I have a unique compound keys for two columns, column_a and column_b, then my sql ignores this constraint if one column is null. E.g. if column_a=1 and column_b = null I can insert column_a=1 and column_b=null as much as I like if column_a=1 and column_b = 2 I can only insert this value once. Is there a...

SQL unique query -- need help

Hello, Need some help with what is probably a pretty basic SQL query. I'm trying to select the number of unique records that match a specific where clause. Essentially, I'm looking to find the number of unique users that logged in between date x and y. If a user logged in more than once between those dates, it would need to only count ...

Sql: Unique field contraint (slug) across multiple tables (doctrine/symfony)

I have a number of tables that will be looked up using the url 'slug'. For example 'news' and 'blog' both have the 'slug' field, which is defined as a unique field in the doctrine database schema. Is there any way I can extend this uniqueness across both tables: for example if there is a news article with slug= "good-story" then it will...

Get unique filename in a multithreaded application

I need to build a unique filename in a multithreaded application which is serializing some data on the disk. What approach could I use to ensure a unique name. The app was not multithreaded before and was using Ticks. When using multiple threads, it failed much faster than I expected. I now added the CurrentThreadId to the filename, and ...

django unique field

is there another REGEX way (or another way) to ensure that a model class field would be unique? (it is not a key, or at least not declared as a key, is shoulb be a simple CharField) Thanks ...

Rails, why joins returns array with non-uniq values?

I use example with Rails 3, but I believe that this is true for Rails 2.3 as well. Suppose, I have model City that has many Locations. I try to find Cities that have locations. I use following code: City.joins(:locations) But output array is: => [#<City id: 5, name: "moscow", created_at: "2010-07-02 15:09:16", updated_at: "2010-07-...

Unique list of items using LINQ

I've been using LINQ for a while now, but seem to be stuck on something with regards to Unique items, I have the folling list: List<Stock> stock = new List<Stock>(); This has the following Properties: string ID , string Type, string Description, example: public class Stock { public string ID { get; set; } public string Type {...

is there any kind of unique object that can differentiate smart cards from each other

I need to know if there any kind of unique object that i can use to differentiate between smart cards for example if i have 1000 smart cards and i need to differentiate between them without pre-write any values on them is there any default unique value which is a factory default built-in value like the mac address for the network cards ...