Menu
  • HOME
  • TAGS

How to name a static variable that's used for holding the data?

php,naming-conventions,naming

Method names All method names are written in lowerCamelCase. ln order to avoid problems with different filesystems. only the characters a-z, A-Z and 0-9 are allowed for method names - don't use special characters. Make method names descriptive, but keep them concise at the same time. Constructors must always be...

Python: Create instance of an object in a loop

python,list,loops,object,naming

It's your __repr__ -- use self.x & self.y there: def __repr__ (self): return "%s %s" % (self.x, self.y) So your code is actually working but the print of the objects is incorrect. Instead of the instance attributes it is printing x & y from global scope....

What does an underscore “_” mean in Swift?

swift,module,naming-conventions,header-files,naming

It seems that the conventions have changed as far as Swift is concerned, as evidenced by the following: /// This protocol is an implementation detail of `SequenceType`; do /// not use it directly. /// /// Its requirements are inherited by `SequenceType` and thus must /// be satisfied by types conforming...

Why are the aliases for string and object in lowercase?

c#,alias,naming,primitive-types,complextype

In C#, there are no "primitive types" and "complex types". There are classes and structs, (reference types and value types, respectively) among others. Both can include methods (e.g. char.IsDigit('a')). So your objections aren't really valid. But there is still the question: why? I'm not sure if there's a good source...

What does the acronym dst stand for?

node.js,naming

dst is a common shorthand for "destination".

Naming Java File with Inheritance to compile

java,inheritance,compilation,naming

Either use separate file for both classes or remove public access specifier from Superclass. In java ,in same file you can have only one public class. And the class containing main method should be declared public....

What does “f” stand for in C standard library function names?

c,naming,libc

Your question in general is too general but I can explain a few examples. fgets, fopen, fclose, … — The ”f“ stands for “file”. These functions accept or return a FILE * pointer as opposed to a file number as the POSIX functions do. printf, scanf, … — The ”f“...

resolve macro variables for saving/naming a dataset in SAS

macros,sas,naming,resolve

As itzy pointed out you have a space after "2" that splits your dataset name in two. I can replicate the issue only defining the macro variable age with a call symput: data _null_; age='2 '; call symput('age',age); run; If this is the case you can solve it by removing...

re-number observations in a large data frame

r,performance,naming,large-files

This will be faster: d$obs <- id$right[match(d$obs,id$wrong)] ...

Cannot Change Method Name in PHPUnit

php,methods,phpunit,naming

The warning PHPUnit issued indicates it found no test methods in your test class. 1) Warning No tests found in class "CatAgeTest". PHPUnit will accept methods named beginning with test*() and having public visibility as test methods. It is also possible to declare a method outside that naming convention with...

Return different field names Laravel?

javascript,php,laravel,naming

As I see it you basically have two options here: 1. Change the database to camelCase snake_case is just Laravel's convention it not required to have your column names like that. So you could simply change the names to camelCase and set the $snakeAttributes option in your model(s) to false:...

When naming objects in an OOP language, what is the difference between “map” and “transform”?

oop,map,transformation,naming,conventions

In computer science, a "Map" is used to associate a known value/entity to another known value/entity e.g as in your question, ObjectA can be mapped to ObjectB. A "Transform" is used to convert/transform any acceptable value into another using a function e.g. a "transform" to calculate x^2; x could be...

android resources folder naming

android,naming-conventions,android-resources,naming

Directory Naming: You do not need to provide a different suffix to your image file name for different screen sizes in Android like you do in iOS. The file name should be exactly the same for all the images of different sizes. However, you need to follow Google's guidelines/conventions for...

Naming Local Network IPs

networking,ip,naming

For local name conversions, you must set up a local DNS server in your LAN. Also if you want the LAN machines to connect to the Internet, you must set up DNS proxy.

Create R Function with flexibility to reference different datasets

r,function,naming

The [[ ]] operator on data frame is similar to $ but allows you to introduce an object and look for it's value. Then outside of the function you assign "x" value to sig. if you don't put quotes there R will look for x object fun <- function(dat, sig,...

awt Frame constructor not accepting naming of GraphicsConfiguration class

java,awt,naming

When you call a method or constructor, you pass arguments - values - you're not declaring the parameters like you do when you declare the method or constructor. So it should be something like: GraphicsConfiguration gc = ...; // Whatever you need to get a value Frame f = new...

What are groups on the same z-coordinate called? (eg, such groups on the same x-coord are called “columns”.)

naming

do you mean "layer"? It is also used in photoshop...

Same name for function and method, cannot call the former within the latter

javascript,scope,naming

It's your call of the u function that is problematic. You forgot the new keyword, which made the this context be the global scope object - on which you then are overwriting the global post variable. Two fixes: Use (new u("form")).post(…); or make your constructor new-agnostic Don't put the post...

Naming: time you have to wait before something is valid

naming-conventions,naming

I don't believe there is a standard computing term for "the time you have to wait before something is valid", but a common computing term used for waiting is (obviously!) "wait" or "delay". In my opinion "CLICK_GESTATION_HOURS" is not a good choice of variable name as it is very ambiguous...

Custom Dictionary not working with Code Analysis

visual-studio-2013,code-analysis,naming

I found the Problem, while i know that xml is case sensitive it is quite difficult to spot that some entries in a few hundred lines of xml are lower cased... <Word></Word> works as expected. ...

Naming my DB tables - Suggestions? [closed]

sql-server,naming-conventions,naming

As the question is suggestion based. I just put some suggestions here. Table1: RefererInfo RefererDetails Table2: backlogReasons backlogInfo backlogDetails Table3: CustomerCategory CustomerBackground Table5: PersonInChargeForParty ContactsForParty ...

Naming personal email address with own domain

naming

The biggest downside of using conventions for emails ([email protected] [email protected] [email protected] and others) is that it's more likely you'll receive spam. I suggest thinking out of the box here and coming up with something you like [email protected]_name.com As a side note, you probably have a very unique first name if...

Scala type alias naming rules?

scala,naming,type-alias

Scala identifier names cannot contain a mix of symbols and characters. This applies uniformly on method as well as type and type constructor names. scala> type =m=>[A, B] = Map[A, B] <console>:1: error: identifier expected but '=' found. type =m=>[A, B] = Map[A, B] ^ scala> type ===>[A, B] =...

Why do variable names start with the letter 'k'?

variables,v8,naming

The "k" actually indicates that this variable is a constant (konstant?) It's a use of Hungarian Notation (http://en.wikipedia.org/wiki/Hungarian_notation) see: Objective C - Why do constants start with k...

Setting the name of cells inside a vba function

excel,vba,excel-vba,naming,names

You can't Define a Name in a UDF you must use a sub the following will fail: Public Function qwerty(r As Range) As Variant qwerty = 1 Range("B9").Name = "whatever" End Function ...

Choosing effective function names

php,coding-style,naming,code-cleanup

There's no black or white in this case. But I believe that the best practice should be: Logical - Describe what the function does Comfortable - short and to the point So you won't have to think on "Wait, what was the name of the function that does X and...

Name of a document which provides information about the database logical design?

database,document,naming

The document is formally called Data Dictionary. A platform-specific example is Data Description Specifications (DDS) that allow the developer to describe data attributes in file descriptions that are external to the application program that processes the data, in the context of an IBM System

How do I apply my python code to all of the files in a folder at once, and how do I create a new name for each subsequent output file?

python,parsing,for-loop,naming,pypdf

Create a function that encapsulates what you want to do to each file. import os.path def parse_pdf(filename): "Parse a pdf into text" content = getPDFContent(filename) encoded = content.encode("utf-8") ## split of the pdf extension to add .txt instead. (root, _) = os.path.splitext(filename) text_file = open(root + ".txt", "w") text_file.write(encoded) text_file.close()...

how could I handle an iterative naming system for this?

format,sas,naming

Try a proc transpose instead, you can delete the missing in a second step or add a where clause to the out data set. If you want to create subsets after that based on ID separate them out in a data step. *generate sample data; data have; array V(20) v1-v20;...

Is it possible to include loop counter in name of array when declaring it? (in C)

c,arrays,for-loop,counter,naming

I want to include the counter of the array at the end of the array name such that it is: array1[], array2[], array3[] and so on, one for each iteration That is not possible. C is a compiled language, meaning that a program (the compiler) creates the program at...

Is it ok to use an argument named “arguments” in JavaScript?

javascript,naming

It is okay to use the name arguments in "sloppy mode", but not recommended. It is forbidden in strict mode, which all new code should use if the author cares about code quality. function a(arguments) { console.log(arguments); } a(1); // Prints "1" (function () { 'use strict'; function a(arguments) {...

What's the distinction between an “entity” and a “game object”?

naming-conventions,game-engine,naming

I have seen few webgl javascript engines. Terminology was different for each. Distinction between an “entity” and a “game object”? Usually object is something you can perceive with vision and/or touch. While entity might be perceived only with sixth sense or not at all (two cameras in scene cant perceive...

Looping through a list in Python and creating new objects based on items

python,list,for-loop,naming

You do not want to do that. Creating a variables dynamically is almost always a very bad idea. The correct thing to do would be to simply use an appropriate data structure to hold your data, e.g. either a list (as your elements are all just numbered, you can just...

What would be the correct variable name?

c,naming

You are not technically shadowing; you would have to define a variable of the same name to shadow it. Moreover, shadowing is generally frowned upon because careless use could lead to easy confusion. What you are doing is taking the current item for your cycle, so a suited name could...

What's a good name for the part of a URL after the hostname? [closed]

url,naming

URI.js calls the function path() for getting/setting the path and resource() for setting the part of the URI "comprising of path, query, and fragment." Given the URI https://[email protected]:8080/foo/bar.html?q=3#baz: path() === '/foo/bar.html' query() === 'q=3' resource() === '/foo/bar.html?q=3#baz' This might be useful: https://medialize.github.io/URI.js/docs.html...

DB2 SQL Show Long and Short Table Names?

sql,naming,db2400

There may be more than one way, but if you run this query: select * from qsys2.systables where table_schema IN ('LAWMOD9T', 'LIBDDS') You'll see that SYSTEM_TABLE_NAME is one of the columns. So, you can join to qys2.systables using the schema and "long" table name....

Can an AppStore app have a different Facebook app name? [closed]

ios,facebook-apps,naming,trademark

You can change the name of you Facebook app after it's been created, and it doesn't need to be the same as your app's.

Is there an official name for Java 7's combined / multi-catch block?

java,naming,multi-catch

The Java Language Specification section 14.20 refers to uni-catch and multi-catch clauses, which is about as official as it gets. A catch clause whose exception parameter is denoted as a single class type is called a uni-catch clause. A catch clause whose exception parameter is denoted as a union of...

good variable name: the number of process to go [closed]

variables,naming-conventions,naming

The question of how to name variables has existed for time immemorial. One approach (both loved and loathed) at least attempts to deal with systematically. "Hungarian Notation", http://en.wikipedia.org/wiki/Hungarian_notation. In Hungarian, a variable that contains a count of something begins with "c", so in that approach you would name it cProcess....

How to name method [closed]

javascript,refactoring,naming

Is it usual behaviour to return null for function? If it's not an exceptional condition, yes, it's entirely normal. Consider DOM's getElementById, for instance, which returns null if there is no matching element, which isn't exceptional and therefore doesn't warrant an exception. Or JavaScript's own String#match, which returns null...

How do I name a function that takes an object `A` and a set `{A, B}` as arguments, then returns `B`? [closed]

python,function,naming-conventions,naming

I would use a different function name, different argument names and a docstring to make it clear what's going on, something like: def get_other(current, both): """Return the element from 'both' that is not 'current'.""" ... Note that both implies a pair without anything long-winded, and doesn't specify the type required....

How to insert “and” word in the functions and variables names? [closed]

naming-conventions,naming

If the dictionary has keys as businessCategories and values as cityId, preferred name would be businessCategoriesToCities. And if both are part of the key itself, businessCategoriesAndCities seems good. As the function is updating both old as well as new categories, you should go with just updateCategories....