Questions tagged [identifier]

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

1253 questions
1442
votes
17 answers

What is the meaning of single and double underscore before an object name?

Can someone please explain the exact meaning of having single and double leading underscores before an object's name in Python, and the difference between both? Also, does that meaning stay the same regardless of whether the object in question is a…
Ram Rachum
  • 71,442
  • 73
  • 210
  • 338
482
votes
5 answers

What's the Hi/Lo algorithm?

What's the Hi/Lo algorithm? I've found this in the NHibernate documentation (it's one method to generate unique keys, section 5.1.4.2), but I haven't found a good explanation of how it works. I know that Nhibernate handles it, and I don't need to…
DiegoCofre
  • 4,823
  • 3
  • 15
  • 6
396
votes
5 answers

Do DOM tree elements with ids become global variables?

Working on an idea for a simple HTMLElement wrapper I stumbled upon the following for Internet Explorer and Chrome: For a given HTMLElement with ID in the DOM tree, it is possible to retrieve the div using its ID as the variable name. So for a div…
KooiInc
  • 104,388
  • 28
  • 131
  • 164
289
votes
12 answers

Is main a valid Java identifier?

One of my kids is taking Java in high school and had this on one of his tests: Which of the following is a valid identifier in Java? a. 123java b. main c. java1234 d. {abce e. )whoot He answered b and got it wrong. I looked at the question…
Gary Bak
  • 4,564
  • 4
  • 19
  • 32
229
votes
10 answers

Hibernate throws org.hibernate.AnnotationException: No identifier specified for entity: com..domain.idea.MAE_MFEView

Why am I getting this exception? package com.domain.idea; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import…
Ramy
  • 17,760
  • 36
  • 94
  • 141
209
votes
7 answers

What are "connecting characters" in Java identifiers?

I am reading for SCJP and I have a question regarding this line: Identifiers must start with a letter, a currency character ($), or a connecting character such as the underscore ( _ ). Identifiers cannot start with a number! It states that a…
LuckyLuke
  • 42,935
  • 77
  • 254
  • 416
186
votes
4 answers

Are PostgreSQL column names case-sensitive?

I have a db table say, persons in Postgres handed down by another team that has a column name say, "first_Name". Now am trying to use PG commander to query this table on this column-name. select * from persons where first_Name="xyz"; And it just…
5122014009
  • 3,072
  • 5
  • 20
  • 33
106
votes
4 answers

Cannot create a database table named 'user' in PostgreSQL

It seems PostgreSQL does not allow to create a database table named 'user'. But MySQL will allow to create such a table. Is that because it is a key word? But Hibernate cannot identify any issue (even if we set the PostgreSQLDialect).
Channa
  • 4,121
  • 13
  • 52
  • 90
94
votes
7 answers

Using number as "index" (JSON)

Recently started digging in to JSON, and I'm currently trying to use a number as "identifier", which doesn't work out too well. foo:"bar" works fine, while 0:"bar" doesn't. var Game = { status: [ { 0:"val", …
Zar
  • 6,272
  • 6
  • 49
  • 74
90
votes
8 answers

Table name as a PostgreSQL function parameter

I want to pass a table name as a parameter in a Postgres function. I tried this code: CREATE OR REPLACE FUNCTION some_f(param character varying) RETURNS integer AS $$ BEGIN IF EXISTS (select * from quote_ident($1) where…
John Doe
  • 8,304
  • 10
  • 45
  • 68
86
votes
9 answers

Are python variables pointers? or else what are they?

Variables in Python are just pointers, as far as I know. Based on this rule, I can assume that the result for this code snippet: i = 5 j = i j = 3 print(i) would be 3. But I got an unexpected result for me, it was 5. Moreover, my Python book…
Lior
  • 5,203
  • 7
  • 29
  • 44
78
votes
2 answers

How to call on a function found on another file?

I'm recently starting to pick up C++ and the SFML library, and I was wondering if I defined a Sprite on a file appropriately called "player.cpp" how would I call it on my main loop located at "main.cpp"? Here is my code (Be aware that this is SFML…
user1932645
77
votes
4 answers

Hibernate error: ids for this class must be manually assigned before calling save():

Caused by: org.springframework.orm.hibernate3.HibernateSystemException: ids for this class must be manually assigned before calling save(): com.rfid.model.Role; nested exception is org.hibernate.id.IdentifierGenerationException: ids for this class…
程序猿
  • 771
  • 1
  • 5
  • 4
75
votes
8 answers

How does jQuery work when there are multiple elements with the same ID value?

I fetch data from Google's AdWords website which has multiple elements with the same id. Could you please explain why the following 3 queries doesn't result with the same answer (2)? Live Demo HTML:
1
Misha Moroshko
  • 148,413
  • 200
  • 467
  • 700
72
votes
8 answers

How to preserve identifierForVendor in ios after uninstalling ios app on device?

I am developing an iOS app which calls web-service for login and at that time i send login credentials to web server along with vendor identifier (identifierForVendor),to identify device uniquely for those credentials.So user can have only one…
Harshavardhan
  • 1,206
  • 1
  • 14
  • 20
1
2 3
83 84