Questions tagged [identifier]

An identifier is a name that identifies either a unique object or a unique class of objects.

1353 questions
16
votes
7 answers

Regular expression to confirm whether a string is a valid Python identifier?

I have the following definition for an Identifier: Identifier --> letter{ letter| digit} Basically I have an identifier function that gets a string from a file and tests it to make sure that it's a valid identifier as defined above. I've tried…
user682194
  • 171
  • 1
  • 1
  • 3
16
votes
3 answers

Prepend table name to each column in a result set in SQL? (Postgres specifically)

How can I get the label of each column in a result set to prepend the name if its table? I want this to happen for queries on single tables as well as joins. Example: SELECT first_name, last_name FROM person; I want the results to be: |…
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
16
votes
8 answers

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.?
15
votes
3 answers

AWS CDK: fixed logical ids

Currently logical ID of a resource is formed by concatenating the names of all of the constructs in the resource’s path and appending an eight-character MD5 hash. This produces garbage like VpcPrivateSubnet1DefaultRouteBE02A9ED and unfortunatelly…
Łukasz
  • 1,980
  • 6
  • 32
  • 52
15
votes
1 answer

Possible to put Logic App Run History Identifier inside logic app action input field?

Hi i was searching on if there is any way to put the logic app identifier into a logic app actions input field? Is it possible to retrieve it some how?
H4p7ic
  • 1,669
  • 2
  • 32
  • 61
15
votes
3 answers

Generating a unique ID in PHP

I'm trying to generate a unique ID in php in order to store user-uploaded content on a FS without conflicts. I'm using php, and at the moment this little snippet is responsible for generating the UID: $id = tempnam (".", ""); unlink($id); $id =…
pbh101
  • 10,203
  • 9
  • 32
  • 31
14
votes
2 answers

Select multiple columns with dplyr::select() with numbers as names

Let's say I have the following data frame: a <- runif(10) dd <- as.data.frame(t(a)) names(dd) <- c("ID", "a", "a2", "b", "b2", "f", "XXX", "1", "4", "8") In dplyr, there is a nice way to select a number of columns. For example, to select the…
Theodor
  • 986
  • 3
  • 7
  • 23
13
votes
2 answers

Unicode identifiers (function names) for non-localization purposes advisable?

PHP allows Unicode identifiers for variables, functions, classes and constants anyhow. It was certainly intended for localized applications. Wether it's a good idea to code an API in anything but English is debatable, but it's undisputed that some…
mario
  • 144,265
  • 20
  • 237
  • 291
13
votes
7 answers

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…
jorm
  • 131
  • 1
  • 3
13
votes
8 answers

generating unique ids in hive

I have been trying to generate unique ids for each row of a table (30 million+ rows). using sequential numbers obviously not does not work due to the parallel nature of Hadoop. the built in UDFs rand() and hash(rand(),unixtime()) seem to generate…
user1745713
  • 781
  • 4
  • 10
  • 16
12
votes
4 answers

How to convert arbitrary string to Java identifier?

I need to convert any arbitrary string: string with spaces 100stringsstartswithnumber string€with%special†characters/\! [empty string] to a valid Java…
parxier
  • 3,811
  • 5
  • 42
  • 54
12
votes
1 answer

ANDROID_ID still available with Android 10

According to Google, the ANDROID_ID (also known as SSAID) should not be accessible on Android 10 systems, without some preconditions (see: https://developer.android.com/about/versions/10/privacy/changes) • If your app targets Android 10 or higher, a…
Sebastian Dine
  • 815
  • 8
  • 23
12
votes
7 answers

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?.
something
something…
CRice
  • 12,279
  • 7
  • 57
  • 84
11
votes
1 answer

How to get Doctrine2 entity identifier without knowing its name

I am attempting to create an abstracted getId method on my base Entity class in Symfony2 using Doctrine2 for a database where primary keys are named inconsistently across tables. When inspecting entity objects I see there is a private '_identifier'…
Lord_Baine
  • 182
  • 1
  • 1
  • 10
11
votes
4 answers

What characters are allowed in Perl identifiers?

I'm working on regular expressions homework where one question is: Using language reference manuals online determine the regular expressions for integer numeric constants and identifiers for Java, Python, Perl, and C. I don't need help on the…
Brendan Long
  • 53,280
  • 21
  • 146
  • 188