Questions tagged [identifier]

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

1353 questions
35
votes
4 answers

Ways to create a unique user fingerprint in PHP

What is the best way to generate a 'fingerprint' of user unique-ness in PHP? For example: I could use a user's IP address as the 'fingerprint', however, there could be multiple other users on the same IP I could use the user's IP + user agent…
So Over It
  • 3,668
  • 3
  • 35
  • 46
35
votes
4 answers

What is the difference between static global and non-static global identifier in C++?

What is the difference between static global and non-static global identifier in C++?
Fahad Siddiqui
  • 1,829
  • 1
  • 19
  • 41
34
votes
3 answers

Why is negative id or zero considered a bad practice?

Why is negative id or zero considered a bad practice when inserting a primary key in a database table? I think it could be useful in some cases, but people say that it is not recommended, despite the fact that they never say/know why. So, I was…
34
votes
4 answers

Python underscore as a function parameter

I have a python specific question. What does a single underscore _ as a parameter means? I have a function calling hexdump(_). The _ was never defined, so I guess it has some special value, I could not find a reference telling me what it means on…
Steve
  • 349
  • 1
  • 3
  • 3
33
votes
8 answers

How to check if a JavaScript Object has a property name that starts with a specific string?

Lets say I have javascript objects like this one: var obj = { 'addr:housenumber': '7', 'addr:street': 'Frauenplan', 'owner': 'Knaut, Kaufmann' } How can I check if the object has a property name that starts with addr? I’d imagine…
Alexander Rutz
  • 452
  • 1
  • 4
  • 10
33
votes
8 answers

NSInvalidArgumentException - receiver has no segue with identifier

I have been trying everything for hours, and nothing's worked. I am trying to segue between two view controllers, from one tableViewController to another tableViewController. The segue is hooked up to the top level view, not the tableviewcell. The…
32
votes
13 answers

Why does a programming language need keywords?

For example (in C): int break = 1; int for = 2; Why will the compiler have any problems at all in deducing that break and for are variables here? So, we need keywords because we want the programs to be readable we do not want to over-complicate…
Lazer
  • 90,700
  • 113
  • 281
  • 364
31
votes
5 answers

Android 10: IMEI no longer available on API 29. Looking for alternatives

Our client's app main feature is heavily relaying on tracking their clients' devices, they offer products that are bound to the specific phone(not its owner). This was possible using the device imei, but with the privacy changes in Android 10, they…
kvnnj.m_av
  • 311
  • 1
  • 3
  • 4
30
votes
2 answers

Identifier normalization: Why is the micro sign converted into the Greek letter mu?

I just stumbled upon the following odd situation: >>> class Test: µ = 'foo' >>> Test.µ 'foo' >>> getattr(Test, 'µ') Traceback (most recent call last): File "", line 1, in getattr(Test, 'µ') AttributeError: type…
poke
  • 369,085
  • 72
  • 557
  • 602
30
votes
7 answers

Is it a good idea to use unicode symbols as Java identifiers?

I have a snippet of code that looks like this: double Δt = lastPollTime - pollTime; double α = 1 - Math.exp(-Δt / τ); average += α * (x - average); Just how bad an idea is it to use unicode characters in Java identifiers? Or is this perfectly…
Eric
  • 95,302
  • 53
  • 242
  • 374
29
votes
4 answers

Device identifier of Android emulator

I want to test in the emulator an app that depends of the device identifier (ANDROID_ID). I currently obtain device identifier with the following code: final String deviceID = Settings.Secure.getString(context.getContentResolver(),…
hpique
  • 119,096
  • 131
  • 338
  • 476
28
votes
4 answers

What constitutes a "valid" C Identifier?

At @Zaibis suggestion (and related to my own answer to What are the valid characters for macro names?, as well as (and other Unicode characters) in identifiers not allowed by g++))... clang allows a lot of "crazy" characters.. although I have…
Alex Gray
  • 16,007
  • 9
  • 96
  • 118
27
votes
8 answers

Is there a method in C# to check if a string is a valid identifier

In Java, there are methods called isJavaIdentifierStart and isJavaIdentifierPart on the Character class that may be used to tell if a string is a valid Java identifier, like so: public boolean isJavaIdentifier(String s) { int n = s.length(); if…
Alex
  • 3,429
  • 4
  • 36
  • 66
27
votes
5 answers

How to check if a string is a valid python identifier? including keyword check?

Does anyone know if there is any builtin python method that will check if something is a valid python variable name, INCLUDING a check against reserved keywords? (so, ie, something like 'in' or 'for' would fail...) Failing that, does anyone know of…
Paul Molodowitch
  • 1,366
  • 3
  • 12
  • 29
27
votes
15 answers

What is the difference between an identifier and variable?

I'm a bit confused about identifiers. In my textbook it says, "We use identifiers to name variables (and many other things) in Java." I'm not really sure what this means. Is it like assigning a variable...to a variable? What? So far, I'm getting…
Reena
  • 271
  • 1
  • 3
  • 3
1 2
3
90 91