naming

C naming suggestion for Error Code enums

耗尽温柔 提交于 2019-11-28 20:37:48
问题 I'm writing a simple parser to read the config file.The config.h interface have only three main functions they are in brief as follows, config_init(); config_dinit(); config_parse(); config_read_value(); My question is those functions will emit different type of errors , for a example, config_init() emit , FILE_NOT_FOUND,FILE_EOF_ERROR,FILE_OPEN_ERROR, ... config_dinit() emit , NOT_INIT_ERROR , config_parse() emit , PARSE_ERROR, OVERFLOW_ERROR, INVALID_CHARACTER_FOUND_ERROR,... config_read

Naming Generic DataContracts in WCF

我只是一个虾纸丫 提交于 2019-11-28 20:29:50
I am using a Generic Class as a Response Data Contract. All is good and this is streamlining the design of my WCF service significantly. Each request is given a standard response object with the following signature: Status (Enum) Message (String) Result (T) Below is the Response Class: [DataContract] public class Response<T> { public Response() {} public Response(T result) { this.result = result; if (result != null) { this.status = Status.StatusEnum.Success; } else { this.status = Status.StatusEnum.Warning; } } public Response(T result, Status.StatusEnum status) { this.status = status; this

What is the difference between a shim and a polyfill?

一笑奈何 提交于 2019-11-28 14:54:40
Both seem to be used in web development circles, see e.g. HTML5 Cross Browser Polyfills , which says: So here we're collecting all the shims, fallbacks, and polyfills... Or, there's the es5-shim project. In my current project we're using a number of these, and I want to stick them all in the same directory. So, what should I call this directory--- shims , or polyfills ? Arsalan Ahmed A shim is any piece of code that performs interception of an API call and provides a layer of abstraction. It isn't necessarily restricted to a web application or HTML5/CSS3. A polyfill is a type of shim that

What is the Swift syntax “ .bar” called?

ⅰ亾dé卋堺 提交于 2019-11-28 14:02:05
Swift has this handy syntax: enum Foo { case bar case baz } func hoge(foo: Foo) { } hoge(foo: .bar) // This Which is mirrored in places other than enum s: struct Qux { static let `default` = Qux() } func hoge(qux: Qux) { } hoge(qux: .default) // This I am not sure what to call this in conversation / tickets. Maybe "type-inferred dot syntax"? I'm unsure. Does this syntax have an official name? If so, what is it? It is called an implicit member expression . From the grammar section of the language guide : An implicit member expression is an abbreviated way to access a member of a type, such as

Is the XML declaration node mandatory?

孤人 提交于 2019-11-28 13:18:22
I had a discussion with a colleague of mine about the XML declaration node (I'm talking about this => <?xml version="1.0" encoding="UTF-8"?> ). I believe that for something to be called "valid XML", it requires a XML declaration node. My colleague states that the XML declaration node is optionnal, since the default encoding is UTF-8 and the version is always 1.0 . This make sense, but what does the standard says ? In short, given the following file: <books> <book id="1"><title>Title</title></book> </book> Can we say that: It is valid XML ? It is a valid XML node ? It is a valid XML document ?

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

牧云@^-^@ 提交于 2019-11-28 11:56:10
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? 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 languages. The underscore (_), at sign (@), or number sign (#). Subsequent characters can include the following:

Why are x86 registers named the way they are?

霸气de小男生 提交于 2019-11-28 09:41:19
For example, the accumulator is named EAX and, while the instruction pointer is called IP . I also know that there are bytes called CL and DH . I know there must be a convention to all of the names, but what is it? The C and the D are numbers/types and H for high and L for low parts of the higher register. http://en.wikipedia.org/wiki/X86 Wikipedia explains it very well. More from the Wikipedia: AX/EAX/RAX: accumulator BX/EBX/RBX: base CX/ECX/RCX: counter DX/EDX/RDX: data/general Something i found * EAX - Accumulator Register * EBX - Base Register * ECX - Counter Register * EDX - Data Register

Use object names as list names in R

老子叫甜甜 提交于 2019-11-28 03:33:17
问题 Of course I could name the objects in my list all manually like this: #create dfs df1<-data.frame(a=sample(1:50,10),b=sample(1:50,10),c=sample(1:50,10)) df2<-data.frame(a=sample(1:50,9),b=sample(1:50,9),c=sample(1:50,9)) df3<-data.frame(a=sample(1:50,8),b=sample(1:50,8),c=sample(1:50,8)) #make them a list list.1<-list(df1=df1,df2=df2,df3=df3) But it makes a lot of work if I have let's say 50 objects with long names. So is there any way to automate this and make the names inside the list the

Do you prefer verbose naming when it comes to database columns? [closed]

独自空忆成欢 提交于 2019-11-27 22:30:27
问题 Which is your preference? Let's say we have a generic Product table that has an ID, a name, and a foreign key reference to a category. Would you prefer to name your table like: CREATE TABLE Products ( ProductID int NOT NULL IDENTITY(1,1) PRIMARY KEY, CategoryID int NOT NULL FOREIGN KEY REFERENCES Categories(CategoryID), ProductName varchar(200) NOT NULL ) using explicit naming for the columns (e.g. Product Name, Product ID), or something like: CREATE TABLE Products ( ID int NOT NULL IDENTITY

Max name length of variable or method in Java

孤者浪人 提交于 2019-11-27 21:48:48
Is there a max length for class/method/variable names in Java? the JLS doesn't seem to mention that. I know very long names are problematic anyway from code readability and maintainability perspective, but just out of curiosity is there a limitation (I guess class names might be limited by the file system maximal file name limitation). If I'm not mistaken, the limit is not in the language itself but in the classfile format, which limits names to 64k, so for all practical intents and purposes identifier length is not a problem. Specifically, this is the definition of a constant string in the