Questions tagged [identifier]

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

1353 questions
1793
votes
18 answers

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

What do single and double leading underscores before an object's name represent in Python?
Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
505
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
  • 5,053
  • 3
  • 17
  • 6
290
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,746
  • 4
  • 22
  • 39
271
votes
15 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
  • 20,541
  • 41
  • 103
  • 153
248
votes
5 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,766
  • 6
  • 24
  • 34
211
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
  • 47,771
  • 85
  • 270
  • 434
149
votes
5 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,963
  • 14
  • 65
  • 97
114
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,786
  • 8
  • 54
  • 76
112
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
  • 9,414
  • 13
  • 50
  • 69
106
votes
10 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…
程序猿
  • 1,061
  • 2
  • 7
  • 4
104
votes
3 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
98
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, and it was 5. Moreover, my Python book…
Lior
  • 5,841
  • 9
  • 32
  • 46
84
votes
13 answers

PostgreSQL Error: Relation already exists

I am trying to create a table that was dropped previously. But when I do the CREATE TABLE A ... I am getting below error: Relation 'A' already exists. I verified doing SELECT * FROM A, but then I got another error: Relation 'A' does not…
nsbm
  • 5,842
  • 6
  • 30
  • 45
82
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
  • 166,356
  • 226
  • 505
  • 746
73
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,266
  • 2
  • 14
  • 25
1
2 3
90 91