Questions tagged [naming]
A general purpose tag to cover anything concerning naming, be it files, programming constructs, data etc.
1,729
questions
-1
votes
0
answers
15
views
How to name a function or variable including SMS? [closed]
Currently i am developing a micro frontend project which is using Graphql and Typescript.
And I will have a function named getSMSId, and i will need to include a Graphql type named SMSIdPair.
So how ...
-1
votes
1
answer
32
views
What is the difference between Resolver and Service in java [closed]
I have a general question , i noticed that some people are naming classes as Resolver in spring boot application , but in functionality it os the same as in services , the only difference is the ...
0
votes
1
answer
24
views
How do I name controllers which are related to multiple entities in REST?
I want to rename and re-route controllers to make them more "RESTful", and I encountered a problem. Let's say I have ItemsController, the route is api/items. Then I have VersionsController, ...
-1
votes
0
answers
14
views
Is it good or bad practice to postfix classes with the folder name? [closed]
I want to discuss if i makes sense to postfix a class with the foldername.
E.g.:
Folder: Control
Files: TreeViewControl, FileUploadControl
OR
Folder: Entity
Files: UserEntity, PositionEntity
For ...
-3
votes
0
answers
24
views
Column name for human-readable/meaningful unique ID [closed]
I am working on a data(base) model. For several entities I would like to add a column to uniquely identify records containing "hand crafted"/human readable/meaningful string.
For example, ...
1
vote
0
answers
26
views
Name of the algorithm for choosing an element from a list based on its "width"
I have the following algorithm, presented here in a simplified version in Rusty pseudocode:
fn foo<T>(elements: list<T>, weights: list<float>, offset: float) -> Option<T> {
...
0
votes
0
answers
19
views
Naming of method that both filters and sorts
I have a REST API endpoint that expects a POST to retrieve Users according to both a filter and a sort parameter. It is a POST because users are required to provide an object that holds both the ...
-3
votes
1
answer
62
views
Naming convention for a method that create a new object from the current instance but modifies some properties [closed]
I was wondering if there are any common conventions for a method that:
returns a new instance of the same type of object;
using the current instance's property values as the defaults;
while changing ...
0
votes
0
answers
11
views
Is it possible to have Visual Studio display a different Solution Explorer name than the csproj file name?
I have a solution with a few projects in them, and each of the projects use a fully qualified name, such as ABC.Appname.Api and ABC.Appname.Web. With a long app name, this can make the names of the ...
1
vote
0
answers
21
views
Automatic Name Fix Package
I am working on a project where I have to reference a list of names from one website to another. After grabbing the name from the first website, I locate the profile of the person within the second ...
0
votes
1
answer
30
views
How to set up my data so the 1st row is blocked off like this in my dataframe?
image of the "locked" row
How do I format my dataframe to match the "wine" database with the first row with names being separated from the rest of the data?
I’m moving this data ...
0
votes
1
answer
62
views
Choose I use a suffix or prefix when naming variables?
Suppose I should have a foreground and a background image, each with their own variable for width, height, and bits per pixel. Should I define my variables as fg_width, fg_height, fg_bits_per_pixel, ...
0
votes
0
answers
18
views
Why `grpc-gateway` named as `gateway`?
Ok, everybody might thinks that's this is really really silly & stupid question, but the more I think about it (this is basically random though but kinda interesting) the more I realize that it's ...
0
votes
1
answer
51
views
What is naming convention for a file with Kotlin extensions?
I have generated class MyDto and I want to add couple of new functions
fun MyDto.convert(foo: String): Bar {...
I have no choice - I have to put it to different file but in contrast to java it won't ...
0
votes
1
answer
28
views
Is there a good practice to name kotlin file contains only functions?
For example i have a kotlin file with validation functions. Another example is a file with only one function which gets mobile device data (manufacturer, android version, etc.)
I have some thoughts to ...
0
votes
0
answers
41
views
Naming convention for a property accessor for a method "proxy"
Note, I'm using the word "proxy" in the general sense, to describe a class functioning as an interface to something else, I'm not using a "Proxy Design Pattern" or the RealProxy ...
0
votes
0
answers
6
views
Is there any R function to combine different csv after removing certain number of rows?
I have 270 csv files with names given as 1_column_1_20230605_101518_r.csv, 2_column_1_20230605_101521_r.csv. There are x number of rows whose information is not useful so I want to remove the X rows ...
0
votes
0
answers
15
views
What are suitable table names for a marketplace website's product catalog and active product listings?
I am working on a project to develop an Amazon-style marketplace where users can sell their products on the website. One requirement is that users cannot sell anything but the products loaded into the ...
0
votes
1
answer
33
views
What are some accepted terms for an object with exactly three properties?
Many of you are likely familiar with the term (and well defined struct in many languages) that is a key-value pair, or kvp for short.
I'm not asking for opinions or a scholarly debate here - the term ...
0
votes
2
answers
100
views
naming lists within for loop using paste0 and get/eval, parse
Straight to the question.
as1_list
I am trying to name data.frames in a list using name() and paste()
but I am having trouble assigning them
num_fu = c('1','2','3','4','5','6','7','8','9')
as <- ...
-1
votes
2
answers
77
views
What are the common ways to distinguish between identifier of local variables and global variables?
I write a function with using same identifier for local variable and globel variable, as shown as following codes:
def func(time_len, num_nodes):
pass
if __name__ == '__main__':
time_len, ...
1
vote
1
answer
44
views
Swift Package's extension property's visibility
When defining a property as an Extension in a Swift Package, if it was created with internal visibility, is it safe to define a property of the same name on the side that uses it? Or could there be ...
3
votes
2
answers
411
views
Python naming guidelines for putting numbers in variable names
I've been doing Leetcode problems in Python and I sometimes use numbers in my variable names for convenience, for example, acc1 or temp2. I use these for algorithms that require keeping track of more ...
0
votes
1
answer
49
views
Explicit naming or explicit path, what is the more pythonic way of naming and using classes? [closed]
I'm working on a project where we currently design a bunch of repositories to abstract the database access.
We found mainly two different ways of naming, structuring and using the newly design ...
0
votes
0
answers
16
views
NamingException in Glassfish7
I have four JNDI string values to lookup for my application. I've added them to Glassfish under Resources -> JNDI -> Custom Resources via asadmin:
create-custom-resource --restype java.lang....
0
votes
1
answer
316
views
What is the proper Naming Convention for Classes and Their Files in ASP.NET Web Application [closed]
Can you kindly tell me guys as to how should I properly name classes and their files in ASP.NET assembly? I know the basic rule that class should be named starting from the capital letter and it ...
0
votes
1
answer
55
views
How to Dynamically define and call a function in python where function names can be variable
I have a problem which I simplified as follows:
def func_1(): # Define first function
a = 1
return a
print(func_1()) # Call first function
def func_2(): # Define second function
a = 2
return ...
1
vote
1
answer
69
views
How to simplify variables naming in included jinja2 templates?
I want to simplify variables naming in jinja2 templates.
When use "include" keyword all variables are in one scope.
How to set one variable name with a different values for each included ...
0
votes
0
answers
38
views
Please help fix ValueError: ... is not in the list python
I have the code below:
def negative_nbr(x):
ls = []
for i in x:
if i < 0:
ls += [ls.index(i)]
return ls
y = [1,-5, 3, -4, 3]
negative_nbr(y)
and it's result:
>&...
0
votes
0
answers
55
views
PowerShell: how to archive a log file based on a specific name and date
I have to achieve some log files which are older than one month, and the naming convention is: filename_year_date (i.e: Logfile.log_2022_12). I've hardcoded the filename for 1 month to see if it works,...
1
vote
1
answer
18
views
How to name files with correct alphanumerical syntax in R?
I am trying to save a list of pngs of my plots, and I want the plots to be correctly alphanumerically ordered when named. Meaning, I do not want a plot named 10Plot.png to be found earlier than one ...
0
votes
2
answers
127
views
Variable with same name as keyword
Is there a good way to create a variable, function, class, etc. with the same name as a keyword?
What I usually see (and follow myself) is using slightly different names. For example, using clazz or ...
0
votes
1
answer
22
views
Folder not naming properly after creation
I have a C++ function createFolder (the symbols before the comments are for the better comments addon in vscode):
void createFolder(const char *dir, const char *foldername)
{
// ! Checking to see ...
0
votes
0
answers
14
views
What should I call this unique-pointer-with-size structure?
I'm annoyed by how C++' standard library only offers some functionality via pointers rather than structures which keep both an address and a size. Specifically, suppose I want something like a ...
0
votes
1
answer
46
views
Does the method name need to be grammatical? [closed]
I have a question that may seem silly, my english is not very good, I often don't know how to name variables or methods.
For example, There is a method, its function is to open a modal for creating ...
0
votes
0
answers
32
views
C# names starting with numbers workaround [duplicate]
I'm creating an enum for different weapon calibres in c# which usually start with digits, resulting in errors.
public enum Caliber
{
9x19,
9x18,
5x56
//etc
}
The code above is ...
0
votes
1
answer
196
views
Naming conventions. Method or variable names containing numbers as a words
I can't find even couple of words about containing numbers in names of variables or on methods. Does anyone have any authoritative information about such cases:
string2map
its4me
etc...
Exactly using ...
0
votes
0
answers
114
views
Is there a naming convention for parent/child class methods in python?
I have the following two classes that operate on pandas Series objects.
class Parent:
def pre_process(self, series):
# Do pre-processing
class Child(Parent):
def ...
0
votes
0
answers
72
views
How can I automatically name the file after using Microsoft Print to PDF function in Power Automate?
I am trying to automate printing a list of PDF files in a folder and renaming the newly printed copies with a different name.
Workflow.
Drop all pdf files into folder
Loop through all files doing the ...
0
votes
1
answer
76
views
Is there a nice naming convention for nonempty lists in Haskell? [closed]
For example, if I have a list of names names :: [Text], and I construct a NonEmpty Text from it, I could call it neNames, names', namesNonEmpty. Is there a standard (preferably short) convention for ...
0
votes
1
answer
65
views
QML naming confussion
I have a basic question about naming components in QML files. I have read that the top element should always get the id root and parent is always the reference to the next element above it.
I have a ...
2
votes
1
answer
88
views
Should I create a block or an element BEM CSS?
** Bem official website says **
Create a block
If a section of code might be reused and it doesn't depend on other page components being implemented.
Create an element
If a section of code can't be ...
0
votes
0
answers
24
views
Creating arrays with unique names while looping through Pandas dataframe by row [duplicate]
I am trying to create a number of new arrays with unique naming. The name of each array is defined by the information in a pandas dataframe.
import pandas as pd
import numpy as np
d = {'ColA':[...
0
votes
0
answers
103
views
Python + Selenium: how to automatically add test name and ids parameter or number to screenshot name?
I am learning how to write tests in Python + Selenium based on Page Object.
In general, the test code itself looks like this:
pytest.mark.parametrize("first_name", [double_first_name, ...
2
votes
2
answers
164
views
Creating custom names for columns based on other column names in pandas dataframe
I have a dataframe like below:
I am looking to create a column using difference or use any other calculations among columns. However, I looking to name the column so that it relfects the operation ...
0
votes
1
answer
68
views
how do i make jpg file's name starts with number automatically increase python
If there is same model name, it will be overwritten even if it's a different picture. So I want to name the image file in front of the name when it's made like 01, 02, 03...... but it doesn't work.
...
0
votes
1
answer
62
views
How to change the columnames for each of a # datasets in your WorkSpace iteratively (preferably using a lapply)
I have a working prototype for what I want to do that works on the single case already. I load a single csv file-formatted dataset into RStudio via:
df<- read.csv("0-11-3-462.csv", header ...
0
votes
0
answers
30
views
What is the best way to describe the square brackets that surround an alias in Azure Synapse or the double quote characters in other databases?
I am writing up some documentation and was curious if the special character used to explicitly force column names without causing a keyword clash, is referred to by anything else other than SQUARE ...
0
votes
1
answer
68
views
How do I, in C#, ensure I never assign to a computed property's backing field directly without encapsulating it in another class?
As properties using custom logic (aka any computed property in c#) need a backing field (source one, two), it can occur that you assign to that backing field directly, changing it's value without ...
0
votes
1
answer
27
views
Wget on Linux saves files differently if called from the command line vs running from a script
I use wget to download a file to my server.
When I paste this in the terminal command line : wget 'https://www.example.com/export/komatsu/komatsu_export.php?pass=Kowa444m11008&date=month' -O /root/...