identifier

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 = substr($id, 2); This code is hideous: it creates a temporary file on the FS and deletes it...

Getting a unique id from a unix-like system

Hello. I want to get from any Unix-like system (if this is possible) a unique id that will be persistent every time my application runs in the same machine. If it is possible, I want to get the same id from Linux or FreeBSD or Solaris, etc... I don't want to generate a new id for each machine, but get an already existent id, and I prefe...

Python globals, locals, and UnboundLocalError

I ran across this case of UnboundLocalError recently, which seems strange: import pprint def main(): if 'pprint' in globals(): print 'pprint is in globals()' pprint.pprint('Spam') from pprint import pprint pprint('Eggs') if __name__ == '__main__': main() Which produces: pprint is in globals() Traceback (most recent ...

Identifiers or Variables which is which?

Hi, I'm quite confused about several books in .NET that I have read. Would someone out there like to explain to me what an identifier is and how it differs from a variable? Or variables and identifiers are the same? Thanks in advance. ...

What can you NOT use an identifier for?

I'm trying to understand what identifiers represent and what they don't represent. As I understand it, an identifier is a name for a method, a constant, a variable, a class, a package/module. It covers a lot. But what can you not use it for? ...

"seekg identifier not found"

I have a program called main: #include<iostream> #include<fstream> using namespace std; #include"other.h" int main() { //do stuff } and then other.h: char* load_data(int begin_point,int num_characters) { seekg(begin_point); char* return_val=new char[num_characters+1]; mapdata.getline(return_val,num_characters); return...

Bundle Identifier

Hi, I'm running a small team of iPhone developers and am a bit concerned about the application transfers into iPhone from Xcode. The problem is that whenever an app is transfered into the iphone the earlier transfered app is mysteriously replaced. My question is, "How do I ensure that every app takes its own respective place and does ...

Unique Identifiers that are User-Friendly and Hard to Guess

Hi, My team is working on an application with a legacy database that uses two different values as unique identifiers for a Group object: Id is an auto-incrementing Identity column whose value is determined by the database upon insertion. GroupCode is determined by the application after insertion, and is "Group" + theGroup.Id. What we ...

Invalid compiler-generated .NET Class Name

I was going through Getting Started (with PostSharp) And when I saw PostSharp injected (is this expression is right?) an aspect code into assembly, I saw this oddly named class marked with CompilerGeneratedAttribute. It is named <>AspectsImplementationDetails_1. As far as I know, class name cannot be started with <>. But how is it po...

Rolling back identifiers NHibernate

I would like to get NHibernate to roll back the identifier of any entities saved during a transaction if the transaction is aborted. I am using NHibernate 2.1.0, and it doesn't do this by default. I came up with the following solution, which works up to a point: public class RevertIdentifiersEventListener : DefaultSaveEventListener { ...

Is it possible to make four (and more) part Uniform Type Identifiers?

I'm trying to register my custom UTI for document-based app. It seems ok, because a get correct type in -initWithType:error: method and in -dataOfType:error:. BUT my app fails to open the newly created files. The UTI is similar to this, notice the four components used: ru.mycompany.myapp.myformat I thought it is possible to create fo...

iPhone: Is there a way to loadFromNib AND have a reuseIdentifier?

I am thinking about this problem now for very long. I try to use different types of cells in my table, that each have their own cell controller and have a reuseIdentifier AND load from NIB. The problem boils down to this: You can either init a Cell via [UITableViewCell initWithStyle:reuseIdentifier:] or via [NSBundle loadNibNamed:owne...

SQL-Query with a multi-part identifier problem within a subquery

Hi All, i've a query that is supposed to return the sum for "status"-duration entries. The duration is calculated by using datediff(n, datestamp, (subquery that returns the datestamp ending the current status, i.e. finds the next fitting "status change"-entry after the one locked at) My Problem is that the following query returns an mu...

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 (n==0) return false; if (!Character.isJavaIdentifierStart(s.charAt(0))) return fa...

What is the real reason for Ruby class names being capitalised?

Ok, so everyone knows that capitalised identifiers are seen to be ‘constant’ in Ruby. However, it is possible to assign a new value to constants, so the following works class A def self.hi; "hi"; end end class B def self.hi; "ho"; end end A.hi # => "hi" B.hi # => "ho" A = B # warning: already initialized constant A # => B A.hi # =...

Can't install application on iPhone

When I try to install on iPhone I get the following: Can't install application The Info.plist for application at (null) specifies a CFBundleExecutable of (null), which do not exist The Bundle identifier matches the one on file at Apple and the phone has the provisional certificate... Any ideas?? Thanks ...

jquery.min.js error in ie6

IE g gives me the following error: Line: 79 Char: 4 Error: Unexpected identifier, string or number Code: 0 The website is test.hatc.org. I am using a template that features fading images, opacity and sliding menus. I saw an error pertaining to jquery.min.js in a browser running IE8 with compatibility mode on, so I think it has somethi...

MySQL: is there something like an internal record identifier for every record in a MySQL table?

I'm building a spreadsheet app using MySQL as storage, I need to identify records that are being updated client-side in order to save the changes. Is there a way, such as some kind of "internal record identifier" (internal as in used by the database engine itself), to uniquely identify records, so that I'll be able to update the correct...

Is it possible to "escape" a method name in PHP, to be able to have a method name that clashes with a reserved keyword?

I'm doing MVC in PHP, and i'd like to have a list() method inside my Controller, to have the URL /entity/list/parent_id, to show all the "x" that belong to that parent. However, I can't have a method called list(), since it's a PHP reserved keyword. In VB.Net, for example, if I need to have something with a name that clashes with a res...

VB.NET, what is the difference between Boolean and [Boolean] ?

I ran some code through an automatic translator for C# to VB, and it translated some code like this: Public Property Title As [String] How is this different to Public Property Title As String and why do both exist? ...