naming

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

我的未来我决定 提交于 2019-11-29 17:42:35
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 ? unor 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 path is /gist . As https://gist.github.com/ would typically also have paths like the second URI (e.g.,

Use object names as list names in R

左心房为你撑大大i 提交于 2019-11-29 10:11:09
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 same as the outside objects? Find the names, then call mget . If there is a pattern to the names of each

What is SUT and where did it come from?

旧城冷巷雨未停 提交于 2019-11-29 09:03:50
I see many people talking about the term SUT, but do not understand why they use that term. SUT is what you want to test? Where does this term come from and what does it mean? For example in this test, what is my SUT? [TestMethod] public void UsersAction_should_return_IndexAction() { const long id = 1; UsersViewModel viewModel = new UsersViewModel() { SelectedUsers = new long[] { 1, 2, 3, 4 } }; ActionResult result = _controller.Users(id, viewModel); result.AssertActionRedirect().ToAction("Index"); } The System Under Test (SUT) from a Unit Testing perspective represents all of the actors (i.e

LINQ: Why is it called “Comprehension Syntax”

感情迁移 提交于 2019-11-29 06:01:40
问题 Why is the following LINQ syntax (sometimes called "query" syntax) called "comprehension" syntax? What's being comprehended (surely that's wrong)? Or, what is comprehensively represented (maybe I'm on the right track, now)? 回答1: I suspect this is related to the second meaning of Comprehend: to take in or embrace; include; comprise This syntax has to do with defining what should be included in a set. 回答2: It comes from the more language-agnostic term List Comprehension which many languages

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

只愿长相守 提交于 2019-11-29 04:35:21
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(1,1) PRIMARY KEY, CategoryID int NOT NULL FOREIGN KEY REFERENCES Categories(ID), Name varchar(200) NOT

Name for HTTP Request+Response

旧城冷巷雨未停 提交于 2019-11-29 02:54:36
There's one thing I haven't found in rfc 2616 and that's a "canonical" name for a request/response pair. Is there such thing? 4.1 Message Types HTTP messages consist of requests from client to server and responses from server to client. HTTP-message = Request | Response ; HTTP/1.1 messages Taking this as a template, which word would you put in the following sentence? A single complete HTTP ... consists of one HTTP Request and one HTTP Response HTTP-... = Request Response roundtrip? cycle? The spec calls them "exchanges" (or "request/response exchanges"), In HTTP/1.0, most implementations used

What are some class names that would signal a need for refactoring? [closed]

孤街浪徒 提交于 2019-11-29 02:52:34
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I came across a few articles like this one, which suggest that some words should never be used as part of a class name. When a class

Can a DAO call DAO?

拈花ヽ惹草 提交于 2019-11-29 01:31:39
I have component which needs to update the database for the customer and customer address (via JDBC). Is it appropriate to call the CustomerAddressDAO from the CustomerDAO? Or create a separate "CustomerDataManager" component which calls them separately? You can do it, but that doesn't mean you should. In these cases, I like to use a Service ( CustomerService in this case) that has a method call that uses both DAOs. You can define the transaction around the service method, so if one call fails, they both roll back. The problem with DAOs that call other DAOs is you will quite quickly end up

Class naming chaos [closed]

孤街醉人 提交于 2019-11-29 01:12:33
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I often struggle with deciding how to name a class. Not so much because the class's purpose is unclear, but because of names like xxx*

Why are underscores better than hyphens for file names?

两盒软妹~` 提交于 2019-11-28 23:34:47
问题 From Building Skills in Python: "A file name like exercise_1.py is better than the name execise-1.py. We can run both programs equally well from the command line, but the name with the hyphen limits our ability to write larger and more sophisticated programs." Why? 回答1: The issue here is that importing files with the hyphen-minus (the default keyboard key - ; U+002D ) in their name doesn't work since it represents minus signs in Python. So, if you had your own module you wanted to import, it