Browsing projects by Tag(s)

Select a tag to browse associated projects and drill deeper into the tag cloud.

Showing page 1 of 1

This library is useful anytime you need an unique ID, e.g. in web forms. Each uniqID is generated only once, assigned with the IP address of the client, and cannot be used more than once. The library contains two functions: The first one, getuniq(), generates an unique string (26 characters long) ... [More] , ready for using in the HIDDEN field in HTML FORM, i.e. in comment form. The second one, called checkuniq(), takes the submitted uniqID as its parameter and returns 1, if the passed uniqID string is valid, or 0 if invalid. 'Valid uniqID' means it has been generated but not yet checked. The library provides that the once used uniqID won't be generated again anytime in the future as so as anytime in the past. [Less]

0
 
  0 reviews  |  0 users  |  175 lines of code  |  0 current contributors  |  Analyzed 11 days ago
 
 

A unique 2D game with physics, construction, and an arcade paddle as gameplay elements. So far, it's in VERY EARLY STAGES, and the framework is still being built. That is to say, there is nothing of the game yet. You will however, find some useful framework code, such as 3D math, (including ... [More] quaternion + arcball utilities,) video code, and simple rendering stuff (2D and 3D primitives, projections, freetype font rendering, etc.). [Less]

0
 
  0 reviews  |  0 users  |  7,508 lines of code  |  0 current contributors  |  Analyzed 5 days ago
 
 

OverviewUniqueModel is provides a mechanism for application developers to define a list of property tuples to be kept unique on the Google App Engine Datastore. See it in action (code) Noteworthy FeaturesSQL-like robust uniqueness enforcement Able to enforce uniqueness of multiple property ... [More] tuples for a single kind Uniqueness is enforced even on concurrent put() operations Virtually no programming overhead for normal usage (see example below) Support and FeedbackIf you decide to give UniqueModel a try, I'd love to hear from you. Please send me an e-mail (my address is located to the right) and submit any issues you find to the issue tracker. If you need support, I can be reached by e-mail, or I can also be found lingering in #appengine on irc.freenode.net under the nick IAB. Simple ExampleAs an example, lets say I'm writing a simple game in which players interact on a rectangular 2D map. To represent a player's location on the map, I create a structure called locations in which I store the x and y value of the player's position, and the ID of an active player. I'm scared of ghosts and things that can be in multiple places at the same time. I know, it's an irrational fear, but it's my game dammit! In order to keep more than one player from occupying the same position on the map, and therefore keep the ghosts at bay, I need to make sure that a point is represented exactly 0 or 1 times in my locations structure. Also in order to be sure nobody occupies more than one position, I need to be sure that an active player_id is represented exactly 0 (an active player can be dead) or 1 times. In scientific terms, the property tuple (x,y) and the single property player_id must each be unique within the set of all locations In a typical SQL schema definition script this would be accomplished like so: CREATE TABLE locations( x integer, y integer, player_id integer references active_players(player_id), unique(x,y), unique(id), );There is no similar way of enforcing uniqueness in the App Engine Datastore. Fortunately to alleviate this problem, we can use UniqueModel: from google.appengine.ext import db import burns class Locations(burns.UniqueModel): x = db.IntegerProperty() y = db.IntegerProperty() player = db.ReferenceProperty(reference_class=ActivePlayer) _uniques = set([ (x,y), (player,) #note that single properties must be stored as tuple ])Just like with the SQL schema definition, if an insert or update violates the uniqueness constraint placed on (x,y) or player, an exception (UniqueConstraintViolatedError) is raised. No ghost-like or omni-present players to deal with! Under the HoodIn a nutshell, UniqueModel works by creating an MD5 hash of a property tuple to be kept unique and storing it on the datastore. When put() is called on an instance of UniqueModel the following happens: UniqueModel calculates a hash of each property tuple to be kept unique In a transaction, UniqueModel checks for the existence of these hashes in the datastore and does the following: If any of the hashes exist in the datastore, the transaction raises an exception Otherwise, each of the hashes are stored with a reference back to the UniqueModel that they represent. If the transaction raised an exception, UniqueModel calls delete on itself to undo the previous put() and then raises the exception again If no exception was raised, db.Model.put() is called and UniqueModel.put() returns normally LimitationsThere are a few limitations imposed by UniqueModel that the application developer should be aware of. Stores many additional EntitiesThe uniqueness of each kind is modeled as entities of kind UniquePropertyInstance. Given n entities of a specific kind that extends UniqueModel, n*m entities of kind UniquePropertyInstance must exist to model the uniqueness of that kind, where m is equal to the number of property tuples to be kept unique for the kind in question. Uniqueness is Modeled as an Entity GroupIn order to verify uniqueness in a method that is safe from concurrent put() operations, the uniquness must be tested and set in an atomic operation. The only way to do this with the App Engine datastore is to use a transaction. However, transactions have the unfortunate restriction that they can only operate on a single entity group. That means that in order to check the uniqueness for an entire kind, the entities that model the uniqueness for that kind must have a common parent. Because of all this, UniqueModel stores an entity of kind UniquePropertyInstanceParent for each kind that extends UniqueModel. This entity serves as the root of the entity group for a particular kind that extends UniqueModel. Therefore, for each kind extending UniqueModel, an entity group of size n*m+1 must exist to ensure uniqueness on concurrent put() operations, where n is equal to the number of entities of the kind and m is equal to the number of property tuples to be kept unique for the kind. Uniqueness is Verified in a TransactionAs stated above, it is necessary to check and submit the uniqueness of an entity within a transaction. Unfortunately, since transactions on the datastore do not nest UniqueModel.put() cannot be called from within a transaction. Uniqueness is Checked with MD5 HashesTo create the hash of a property tuple, each member of the tuple's __str__ method is called and concatenated. The resulting str is then passed to hashlib to be turned into an MD5 sum. This imposes the following problems: Extra CPU usage on put() (see http://uniqueificate.appspot.com,code for an example) Only works for properties with __str__ methods that accurately represent the property value Possibility (although very low likelihood) of forced collisions [Less]

0
 
  0 reviews  |  0 users  |  97 lines of code  |  0 current contributors  |  Analyzed 5 days ago
 
 

First we need a XML based schema: Maybe this And we need APIs documents for WebMasters also A server to keep the unique resume copy tools for WebMasters to use these apis others - TBD

0
 
  0 reviews  |  0 users  |  0 current contributors
 
 

Unique

0
 
  0 reviews  |  0 users  |  280,343 lines of code  |  0 current contributors  |  Analyzed 6 days ago
 
 

a simple circus theme for igoogle, cycles between a day and a night skin.

0
 
  0 reviews  |  0 users  |  0 current contributors
 
 

utsessions allow the features of timed and unique sessions for an user account in Django. What does it do ?utsessions is a middleware that makes all opened user sessions unique. When an user session is opened, the user account can't be reused before a certain amount of time. After this time ... [More] , if the user account is reused, the first session is closed and a second one is opened. A session can also be automaticaly closed after a choosen time. This kind of behavior is useful for websites providing access to data by unique user account. Philosophyutsessions was written to be easily : Installed in your projects, by simply registering the middleware. Extended thanks to his design in object: each component can be removed or reused. Configured, with the settings.py file which allows different behaviors. InstallationThe easiest way is to use easy_install : $> easy_install utsessionsOr download the latest packaged version at http://code.google.com/p/django-ut-sessions/ and unpack it. You can also perform a Subversion checkout to get the latest code. svn checkout http://django-ut-sessions.googlecode.com/svn/trunk/ django-ut-sessionsInside the package use this command line to install the package into your PYTHONPATH. $> python setup.py installProject installationNow simply add this following line into your MIDDLEWARE_CLASSES section. 'utsessions.middleware.UTSessionMiddleware',It must be after the SessionMiddleware and AuthentifcationMiddleware like this : MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'utsessions.middleware.UTSessionMiddleware', )SettingsIf you want to define the period of a session before being logged out, set a value in seconds to SESSION_LIMIT_SECONDS in your settings.py A session can be released for another user before a certain amount of time, set to default at 300 seconds. To change this value define SESSION_TOKEN_LIMIT_SECONDS. If set to 0, no lock will be created. TestsPut utsessions into your INSTALLED_APPS section and run : $> python manage.py test utsessions [Less]

0
 
  0 reviews  |  0 users  |  176 lines of code  |  0 current contributors  |  Analyzed about 19 hours ago
 
 

Ever wonder what "limited access" meant in your SharePoint permissions? Ever try to uncover the instances of unique permissions within your SharePoint sites, trying to find out what is causing "limited access" for your account(s)? Did you become angry when you realized it could ... [More] take hours of clicking around trying to find all these instances of broken inheritance? Well, Never Fear! SPLimitedAccessDiscovery is here! SPLimitedAccessDiscovery provides you with a report on the "why" behind your limited access instances within your SharePoint sites. [Less]

0
 
  0 reviews  |  0 users  |  0 current contributors
 
 

I have written these code files to compute number of unique/non unique permutation and combinations of input strings

0
 
  0 reviews  |  0 users  |  621 lines of code  |  0 current contributors  |  Analyzed 7 days ago
 
 

snowflake

claimed by Twitter

Compare

Snowflake is a network service for generating unique ID numbers at high scale with some simple guarantees.

0
 
  0 reviews  |  0 users  |  1,120 lines of code  |  4 current contributors  |  Analyzed about 3 hours ago
 
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.