naming-conventions

Angular-Cli camelCase name

百般思念 提交于 2019-12-10 14:54:30
问题 It seems that when I used angular cli to generate components,services etc.by this command and name of component ng g component myApp It generate component folder and other files such as my-app.component.ts instead myapp.component.ts My question is,Is there any command to generate components,services etc. with camelCase name. I research for it,but nothing works. 回答1: Angular Style Guide explicitly says to use my-app.component.ts for file names. dash-case (or "kebab-case"): descriptive part of

Making good column names R

杀马特。学长 韩版系。学妹 提交于 2019-12-10 14:47:39
问题 I read a table from Microsoft Access using RODBC. Some of the variables had a name with a space in it. R has no problem with it but I do. I cannot find out how to specify the space names(alltime) [1] "ID" "LVL7" "Ref Pv No" "Ref Pv Name" "DOS" "Pt Last Name" "Pt First Name" "MRN" "CPT" "CPT Desc" "DxCd1" "DxCd2" "DxCd3" "DxCd4" [15] "DOE" But what do I do if I want to do something such as this > alltime[grep("MIDDLE EAR EXPLORE",alltime$CPT Desc,] Error: unexpected symbol in "alltime[grep(

How to import standard library instead of same-named module in module path

删除回忆录丶 提交于 2019-12-10 14:35:42
问题 I have the following directory structure main_code.py libs/ __init__.py mylib.py time.py with main_code.py just importing mylib : from libs import mylib and mylib.py just importing time : import time print time Now it turns out that mylib.py imports libs/time.py and not the built-in standard library time . Is there any way to get the 'normal' behavior, i.e. that mylib.py imports the built-in standard library time , without changing time.py ? Is this the 'normal' behavior anyway? Do I have to

Database/model field-name convention in Laravel?

喜你入骨 提交于 2019-12-10 13:39:11
问题 I understand that camel case is the usual convention, as per http://forums.laravel.io/viewtopic.php?id=8857 However, Laravel is using created_at and updated_at for timestamp fields. I'm confused as what would be the best naming convention for field-names in the database? If camel cased, can I then switch created_at to createdAt, or should I use camel case for own fields and snake case for the timestamps? It doesn't seem clear to me. Maybe Laravel wants me to use snake case all the way, like

What does internal mean in function names in Emacs Lisp?

懵懂的女人 提交于 2019-12-10 13:27:46
问题 Some people use double dash to indicate that the function is subject to change: What does the double minus (--) convention in function names mean in Emacs Lisp Does including internal in function names mean similar things? Two examples where-is-internal internal-make-var-non-special The function where-is-internal has a detailed docstring and is mentioned in the manual as well. Is where-is-internal an exception? Is there a difference between having -internal as suffix and having internal- as

How do you name constructor argument and member variables?

﹥>﹥吖頭↗ 提交于 2019-12-10 12:50:13
问题 I don't use prefix while naming internal variables of a class (I know some do but I am not starting "why do you..." debate). I just prefer it that way. The problem is that sometimes same parameters are passed in contructor and I end up being confused how to name them. For example: public class SampleClass { private int classId; private string className; public SampleClass (int XclassIdX, string XclassNameX) { classId = XclassIdX; className = XclassNameX; } } How to name XclassIdX and

Naming conventions for Rails migrations

六眼飞鱼酱① 提交于 2019-12-10 12:33:13
问题 Is there a best practice naming convention for Rails migrations, particularly when editing a model? e.g. if I'm adding a column bar to the Foo model, should I name it edit_foo or add_bar_to_foo I'm assuming if I'm editing mutliple models then I should create multiple migrations, but what if I'm making multiple modifications to a single model, do I name it add_bar_remove_x_edit_y_to_foo ? 回答1: I agree with the previous poster. The naming should focus on readability. But also keep in mind that

Kotlin- naming convention for boolean returning methods

早过忘川 提交于 2019-12-10 12:32:01
问题 How would like to know what is the naming convention for boolean returning methods? Using an 'is', 'has', 'should','can' in the front of method sound ok for some cases. but I'm not sure. Is there a better way to name such methods? for example: a function that checks card's validaition . should I call it isValidCard or cardValidation or another name? (I didn't find it here: https://kotlinlang.org/docs/reference/coding-conventions.html) 回答1: Kotlin naming style assumes you use the Java naming

Naming Database Tables and Views

早过忘川 提交于 2019-12-10 12:29:46
问题 I recently asked a colleague why they had included _TABLE at the end of all their database table names. They said it had been a standard at another orgainisation they had worked for. Other colleagues use V_ at the start of views. Is this good practice? 回答1: Consistency is the best approach. Adding a _TABLE or _VIEW at the end of an object name is overkill in my book, but if the database is designed that way, I wouldn't break from convention. For your colleague to bring his naming convention

Convention for namespacing classes vs instances in javascript?

十年热恋 提交于 2019-12-10 11:39:19
问题 I am creating a instance of a class using the following code: test = new function(){ ... } However, base has no prototype because it was created from an anonymous function (I'm guessing this is the reason?). This leaves me unable to create any public functions for the instance. You could argue I could get around this by simply doing: function testClass(){ ... } test = new testClass() and then attaching public functions to testClass. But this forces me to do unnecessary namespacing. In