identifier

Get a unique computer ID in python on windows and linux

Hi, I'd like to get an id unique to a computer with Python on Windows and Linux. It could be the CPU ID, the motherboard serial, ... or anything else. I looked at several modules (pycpuid, psi, ...) without luck. Any idea on how to do that ? Thanks in advance. ...

change flex application identifier string

Just wondering how you can go about changing a flex app's application identifier string? I know its located on line 16 of the xml file but every time I change it, an error occurs when I export the release build. Just wondering how I go about doing this. ...

How can get Python isidentifer() functionality in Python 2.6?

Python 3 has a string method called str.isidentifier How can I get similar functionality in Python 2.6, short of rewriting my own regex, etc.? ...

java: <identifier> expected with ArrayList

I have a class named Storage. Storage contains an arraylist of special objects called Products. Each product contains information such as name, price, etc. My code is as follows: class Storage{ Product sprite = new Product("sprite",1.25,30); Product pepsi = new Product("pepsi",1.85,45); Product orange = new Product("orange",2.25,...

Why do websites generate random alphanumeric strings for urls instead of using row ids?

Why does many sites (youtube is good example) generate string of random number and letter instead of using for example the row id? usually its something likes this bla?v=wli4l73Chc0 instead of like bla?id=83934 Is it just to keep it short if you have many rows? Or is there other good things about this? Because i can imagine: bla?...

Wordpress - Get Post Number in a Category

Is there a way for me to get a pseudo-ID of a post from the category it belongs to? Let's say I have these posts post_id | post_title | post_cat --------+------------+--------- 0 | a post | cat1 1 | a post1 | cat2 2 | a post2 | cat1 3 | a post3 | cat2 ... 57 | a post57 | cat2 I want the pos...

Unicode identifiers in Python?

Hi all, I want to build a Python function that calculates, and would like to name my summation function Σ. In a similar fashion, would like to use Π for product, and so on. I was wondering if there was a way to name a python function in this fashion? def Σ (..): .. .. That is, does Python support unicode identifiers, and if so, ...

How to map string keys to unique integer IDs?

I have some data that comes regularily as a dump from a data souce with a string natural key that is long (up to 60 characters) and not relevant to the end user. I am using this key in a url. This makes urls too long and user unfriendly. I would like to transform the string keys into integers with the following requirements: The source...

problem Keyword token antlr

If the 'for' is used both as a command and as "the English word": for_statement: 'for' ... id: 'for' | ID ; ID: ... right? My problem is how to differentiate the two cases. For example for_statement is only possible beginning of a line (only if preceded by ' ' or '\t'). For example: echo for print example for i in {0..10..2} ...

identifier token keyword antlr parser

How to handle the case where the token 'for' is used in two different situations in the language to parse? Such as statement and as a "parameter" as the following example: echo for print example for i in {0..10..2} do echo "Welcome $i times" done Output: for print example Welcome 0 times Welcome 2 times Welcome 4 times Welcom...

Using a variable as identifier in a json array

Hi folks! I'm wondering if it is possible to use assigned variables as identifier in a json array. When I tried this, I was getting some unexpected results: (Code is simplified, parameters are passed in a different way) var parameter = 'animal'; var value = 'pony'; Util.urlAppendParameters (url, {parameter : value}); Util.urlAppe...

An "elegant" way of identifying a field?

Hi. I'm writing a system that underlies programmer applications and that needs to detect their access to certain data. I can mostly do so with properties, like this: public class NiceClass { public int x { get; set; } } Then I go in and tweak the get and set accessors so that they handle the accesses appropriately. However this r...

Is it poor form to use CLASS attributes with no corresponding CSS rule?

For example if I wanted to select some elements with a certain class using jQuery, and for that reason only, is it always expected that those classes SHOULD be defined in the css?. <div class="xyz"> something </div> <div class="xyz"> something else </div> //with example jQuery $(".xyz").hide(); //is it wrong no element 'xyz' is defin...

C++ conversion from string to object identifier

I'm writing a program in C++ that reads in some data from an external file in order to set the values of static variables. Is it possible to convert a string to an object identifier? (e.g. convert the string "CheckBox::Unchecked" into an identifier for the object CheckBox::unchecked) ...

how to retrieve a specific message from imap with consistent id (message id)

Hi, I need to keep a link tracking for an email message. I am using PHP and IMAP. I need some ID that identify the email over time. Using IMAP UID does not seems to work since the UID changes after expunge(), i know there is a message_id for emails, but how can i retrieve an email using it's message_id with PHP and IMAP? Is there anoth...

hilo generator in classic asp

Is it possible to implement a hilo generator in classic asp? How would this be done? ...

Why # is not allowed in an identifier?

Java allows identifier to start with or contain $ (dollar sign). e.g int a$b; But why # is not allowed in an identifier? What is the specific reason? Is # an operator or something in Java? e.g int a#b; ...

Check name is unique if not append

My application requires the user to enter their business name, which the application will automatically create into a unique identifier to be used in URLs, ie "Bob's Cafe" will become "bobs-cafe" But if there are duplicate names I would like the application to add a number so if there is already a "bobs-cafe" we will use "bobs-cafe-1" ...

generic identifier

Hi, as I probably do not describe the problem in the right terms, I was not able to get an answer with google. Please excuse! In the following code, I would like to replace 'hardcoded' identifier COMMENT with the variable editedField. How to do that? var editedField:String = event.dataField; if (model.multipleProcessingData[i][editedI...

SQL Server query to create database is giving me an error when I include numeric characters in the database name

I am having trouble running a simple sql query in Microsoft SQL Server 2005 to create a database and im not sure why. When I run this query CREATE DATABASE 4444-virtual2 I receive this error Incorrect syntax near '4444'. Is there anything in particular that I must specify if I am creating a database table with numeric values in...