naming

.NET valid property names

*爱你&永不变心* 提交于 2019-12-20 03:23:19
问题 Where is the documentation for valid property names in .NET? Obviously things like space, * or & aren't valid in a property name, but where is this documented? 回答1: http://msdn.microsoft.com/en-us/library/aa664670(VS.71).aspx From the language spec. Property names are identifiers just like members and functions. Granted, there are standard naming conventions elsewhere that are optional, but greatly encouraged. 回答2: You can look the information up for a particular language on the platform,

Why does Java have NullPointerException instead of NullReferenceException? [duplicate]

懵懂的女人 提交于 2019-12-18 19:06:05
问题 This question already has answers here : Closed 8 years ago . Possible Duplicates: What is a Null Pointer Exception? Java: Why aren't NullPointerExceptions called NullReferenceExceptions ? Our of idle curiosity, does anyone know why the null reference exception in Java was called NullPointerException? It seems counterintuitive that in a new language that officially has no pointers a choice would be made to use this name when using a null reference. If anyone can point me to an authoritative

Difference between classes java.rmi.registry.Registry and java.rmi.Naming

自古美人都是妖i 提交于 2019-12-18 13:01:45
问题 What is the difference between the Registry class and Naming class. In my application I am using Registry class. But I want to know about Naming class and its uses ? 回答1: The difference is that Naming is a utility class with static methods, while Registry is a remote interface. Unsurprisingly, Naming calls Registry internally. Note that the name arguments you pass to java.rmi.Naming are in URL format, and include the location of the registry, whereas with java.rmi.registry.Registry , the name

What does .dist used as an extension of some source code file mean?

為{幸葍}努か 提交于 2019-12-18 10:53:59
问题 Examples in the Zend tutorial: phpunit.xml.dist local.php.dist TestConfig.php.dist 回答1: .dist files are often configuration files which do not contain the real-world deploy-specific parameters (e.g. Database Passwords, etc.), and are there to help you get started with the application/framework faster. So, to get started with such frameworks, you should remove the .dist extension, and customize your configuration file with your personal parameters. One purpose I have seen in using .dist

What's the difference between a URL such as “a.b.example” instead of “b.example/a”?

若如初见. 提交于 2019-12-18 09:52:25
问题 Why do some websites I see have a URL in the form a.b.example , and others are in the form of b.example/a ? For example, why is it gist.github.com instead of github.com/gist ? 回答1: These are different components . See section 3 of the URI standard for a list of components and their definitions. https://gist.github.com/ The authority (or more specifically, the host ) is gist.github.com . The path is / . https://github.com/gist The authority (or more specifically, the host ) is github.com . The

What special characters are allowed in T-SQL column name?

半腔热情 提交于 2019-12-17 20:03:25
问题 I would like to know what special characters are allowed to be used in column name in T-SQL, MSSQL. So I know I can use letters and numbers, but are the other characters that are available without using brackets [] to refer to this column? 回答1: from MSDN: The first character must be one of the following: A letter as defined by the Unicode Standard 3.2. The Unicode definition of letters includes Latin characters from a through z, from A through Z, and also letter characters from other

Naming scheme for typedefs

冷暖自知 提交于 2019-12-17 16:30:52
问题 I'm working on a library that extensively used constructs like typedef struct foo_bar_s { ... } foo_bar_t; It's a bad idea to use the _t suffix, because it's a POSIX reserved namespace. The _s suffix for structs is also pretty useless. So I thought I can change it all to typedef struct foo_bar { ... } foo_bar; or if the struct name is not needed typedef struct { ... } foo_bar; However, I cannot distinguish typedefs from regular symbols (variables, etc.) anymore. Is this really such a big deal

Python “private” function coding convention

岁酱吖の 提交于 2019-12-17 15:59:17
问题 When writing a python module and functions in it, I have some "public" functions that are supposed to be exposed to outsiders, but some other "private" functions that are only supposed to be seen and used locally and internally. I understand in python there is no absolute private functions. But what is the best, most neat, or most used style to distinguish "public" functions and "private" functions? I list some of the styles I know: use __all__ in module file to indicate its "public"

Can you start a class name with a numeric digit?

元气小坏坏 提交于 2019-12-17 11:44:07
问题 In C++ , is it possible to start a class name with a digit ? For example, template <class T> class 2DArray { public: // 1D ARRAY CLASS class 1DArray { public: 1DArray() { Create(); } 1DArray(iterator arr) : array1d_(arr) { } explicit 1DArray(size_type cols, const T& t = T()) { Create(cols, t); } 1DArray(const 1DArray& arr) { Create(arr.begin(), arr.end()); } 1DArray& operator=(const 2DArray&); ~1DArray() { Uncreate(); } T& operator[](size_type n) { return array1d_[n]; } const T& operator[]

Is it ok to use dashes in Python files when trying to import them?

浪尽此生 提交于 2019-12-17 03:32:21
问题 Basically when I have a python file like: python-code.py and use: import (python-code) the interpreter gives me syntax error. Any ideas on how to fix it? Are dashes illegal in python file names? 回答1: You should check out PEP 8, the Style Guide for Python Code: Package and Module Names Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores