naming

Which characters are illegal within a branch name?

时光怂恿深爱的人放手 提交于 2019-11-26 12:52:05
问题 Which characters are illegal within a branch name? 回答1: Naming rules for refname: Git imposes the following rules on how references are named: They can include slash / for hierarchical (directory) grouping, but no slash-separated component can begin with a dot . or end with the sequence .lock . They must contain at least one / . This enforces the presence of a category like heads/ , tags/ etc. but the actual names are not restricted. If the --allow-onelevel option is used, this rule is waived

When setting environment variables in Apache RewriteRule directives, what causes the variable name to be prefixed with “REDIRECT_”?

家住魔仙堡 提交于 2019-11-26 11:55:10
问题 I am trying to set Apache environment variables (for use in PHP) with the [E=VAR:VAL] flag on RewriteRule rules in an .htaccess file. I have already discovered the variables are accessed in PHP as server variables $_SERVER rather than $_ENV (which makes a certain amount of sense). However, my problem is for some rules the [E=VAR:VAL] flag works as expected and I end up with a variable $_SERVER[\'VAR\'] but for other rules I end with a variable $_SERVER[\'REDIRECT_VAR\'] or $_SERVER[\'REDIRECT

What's the best approach to naming classes? [closed]

故事扮演 提交于 2019-11-26 10:06:51
问题 Coming up with good, precise names for classes is notoriously difficult. Done right, it makes code more self-documenting and provides a vocabulary for reasoning about code at a higher level of abstraction. Classes which implement a particular design pattern might be given a name based on the well known pattern name (e.g. FooFactory, FooFacade), and classes which directly model domain concepts can take their names from the problem domain, but what about other classes? Is there anything like a

Is there a reason Image.FromFile throws an OutOfMemoryException for an invalid image format?

我们两清 提交于 2019-11-26 08:58:10
I am writing code that catches this OutOfMemoryException and throws a new, more intuitive exception: /// ... /// <exception cref="FormatException">The file does not have a valid image format.</exception> public static Image OpenImage( string filename ) { try { return Image.FromFile( filename ); } catch( OutOfMemoryException ex ) { throw new FormatException( "The file does not have a valid image format.", ex ); } } Is this code acceptable to its user, or is OutOfMemoryException intentionally being thrown for a particular reason? No, it is history. GDI+ was written quite a while before .NET ever

Reserved words as names or identifiers

爱⌒轻易说出口 提交于 2019-11-26 08:57:30
问题 Is there any tricky way to use Java reserved words as variable, method, class, interface, package, or enum constant names? 回答1: No, there is no way. That's why they're labeled "reserved". 回答2: This is a valid question. Such a thing is possible in other languages. In C#, prefix the identifier with @ (as asked before); in Delphi, prefix with & . But Java offers no such feature (partly because it doesn't really need to interact with identifiers defined by other languages the way the .Net world

What is the purpose of constraint naming

流过昼夜 提交于 2019-11-26 08:09:22
问题 What is the purpose of naming your constraints (unique, primary key, foreign key)? Say I have a table which is using natural keys as a primary key: CREATE TABLE Order ( LoginName VARCHAR(50) NOT NULL, ProductName VARCHAR(50) NOT NULL, NumberOrdered INT NOT NULL, OrderDateTime DATETIME NOT NULL, PRIMARY KEY(LoginName, OrderDateTime) ); What benefits (if any) does naming my PK bring? Eg. Replace: PRIMARY KEY(LoginName, OrderDateTime) With: CONSTRAINT Order_PK PRIMARY KEY(LoginName,

Is there a reason Image.FromFile throws an OutOfMemoryException for an invalid image format?

陌路散爱 提交于 2019-11-26 02:01:55
问题 I am writing code that catches this OutOfMemoryException and throws a new, more intuitive exception: /// ... /// <exception cref=\"FormatException\">The file does not have a valid image format.</exception> public static Image OpenImage( string filename ) { try { return Image.FromFile( filename ); } catch( OutOfMemoryException ex ) { throw new FormatException( \"The file does not have a valid image format.\", ex ); } } Is this code acceptable to its user, or is OutOfMemoryException

Android - Package Name convention

∥☆過路亽.° 提交于 2019-11-26 00:57:40
问题 For the \"Hello World\" example in android.com, the package name is \"package com.example.helloandroid;\" Is there any guideline/standard to name this package? (references would be nice) 回答1: Android follows normal java package conventions plus here is an important snippet of text to read (this is important regarding the wide use of xml files while developing on android). The reason for having it in reverse order is to do with the layout on the storage media. If you consider each period ('.')

What&#39;s the use/meaning of the @ character in variable names in C#?

99封情书 提交于 2019-11-25 21:58:50
问题 I discovered that you can start your variable name with a \'@\' character in C#. In my C# project I was using a web service (I added a web reference to my project) that was written in Java. One of the interface objects defined in the WSDL had a member variable with the name \"params\". Obviously this is a reserved word in C# so you can\'t have a class with a member variable with the name \"params\". The proxy object that was generated contained a property that looked like this: public

Android - Package Name convention

假如想象 提交于 2019-11-25 20:33:37
For the "Hello World" example in android.com , the package name is "package com.example.helloandroid;" Is there any guideline/standard to name this package? (references would be nice) Android follows normal java package conventions plus here is an important snippet of text to read (this is important regarding the wide use of xml files while developing on android). The reason for having it in reverse order is to do with the layout on the storage media. If you consider each period ('.') in the application name as a path separator, all applications from a publisher would sit together in the path