naming

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

别来无恙 提交于 2019-12-03 01:49:21
What does f stand for in the name of C standard library functions? I have noticed that a lot of functions have an f in their name, and this does not really make sense to me. For example: fgets , fopen , printf , scanf , sqrtf and so on. Your question in general is too general but I can explain a few examples. f gets , f open , f close , … — The ”f“ stands for “file”. These functions accept or return a FILE * pointer as opposed to a file number as the POSIX functions do. print f , scan f , … — The ”f“ stands for “formatted”. These functions accept a format string. f print f , f scan f — This is

How can I dynamically create a name of a variable in Python? [duplicate]

China☆狼群 提交于 2019-12-02 23:43:29
问题 This question already has answers here : How do I create a variable number of variables? (13 answers) Closed last year . I am having a function in python def func(dataFrame,country,sex): varible_name=dataFrame[(dataFrame['land']==country) & (dataFrame['sex']==sex)] Now, for example, I call this function func(dataFrame,'England','M') I want that variable name be England_M instead of variable_name. 回答1: You can't do that in Python. What you can do instead is store the results under a dictionary

What is the preferred way (better style) to name a namespace in Ruby? Singular or Plural?

蓝咒 提交于 2019-12-02 23:39:02
What are for you the pros and cons of using: FooLib::Plugins FooLib::Plugins::Bar vs. FooLib::Plugin FooLib::Plugin::Bar naming conventions? And what would you use or what are you using? What is more commonly used in the comunity? Use: module FooLib end module FooLib::Plugins end class FooLib::Plugins::Plugin; end #the base for plugins class FooLib::Plugins::Bar < FooLib::Plugins::Plugin; end class FooLib::Plugins::Bar2 < FooLib::Plugins::Plugin; end or in a different words: module FooLib module Plugins class Plugin; end #the base for plugins class Bar < Plugin; end class Bar2 < Plugin; end

Android activity naming

对着背影说爱祢 提交于 2019-12-02 21:36:13
I'm running into more and more naming clashes between Android activities and other classes. I was wondering if you could tell me how you avoid these. Sadly, my particular naming problems are not covered in the related questions on SO. First example I have an activity that displays a level of the game. However, the data required for that level (background artwork, entities etc.) is stored in a separate class. Naturally, I would call the latter class Level . However, I would call the activity Level as well, because it displays levels. Second example I have an activity that plays back a cut scene

How many bits is a WORD and is that constant over different architectures?

有些话、适合烂在心里 提交于 2019-12-02 20:54:37
Is a machine WORD always the same or does it depend on the machine architecture? And is the meaning of the word WORD context sensitive or generally applicable? The machine word size depends on the architecture, but also how the operating system is running the application. In Windows x64 for example an application can be run either as a 64 bit application (having a 64 bit mahine word), or as a 32 bit application (having a 32 bit machine word). So the size of a machine word can differ even on the same machine. The term WORD has different meaning depending on how it's used. It can either mean a

Is naming variables after their type a bad practice?

余生长醉 提交于 2019-12-02 20:51:58
I'm programming C++ using the underscore naming style (as opposed to camel case) which is also used by the STL and boost. However, since both types and variables/functions are named all lower case, a member variable declaration as follows will lead to compiler errors (or at least trouble): position position; A member variable named position which is of type position . I don't know how else to name it: It's generally a position , but it is also the position of the object. In camel case, this would be fine with the compiler: Position position; But in C++ it causes problems. I don't want to

iPhone Application Name Availability

一个人想着一个人 提交于 2019-12-02 19:57:45
Is there a way to check whether an iphone application name is available to use? Would a search on iTunes and checking to see if there is an existing application already out there be indicative that an iphone application name is available to use or not? As pointed out here , even if you search the traditional channels, there may still be someone who has claimed that same name but not submitted an application yet. If you wish to truly test this out, it sounds like you can start the process of submitting an application on iTunes Connect, fill in the name of your new application, but don't

What is a request-response pair called? [duplicate]

ぃ、小莉子 提交于 2019-12-02 18:42:14
This question already has an answer here: Name for HTTP Request+Response 4 answers For example in HTTP you send a request and receive a response; is there a noun that describes that request-response pair? I'd thought of "dialog" or "conversation" however those imply multiple request-response pairs, whereas I'm looking for a word that indicates exactly one. The reason for asking is that I need to name an object which encapsulates the details of both, and RequestResponse seems fairly lame. How about "exchange"? RFC2616 calls it an Exchange . Wireshark and HTTPNetworkSniffer call it a Request

Is the word “Helper” in a class name a code smell?

你。 提交于 2019-12-02 17:26:42
We seems to be abstracting a lot of logic way from web pages and creating "helper" classes. Sadly, these classes are all sounding the same, e.g ADHelper, (Active Directory) AuthenicationHelper, SharePointHelper Do other people have a large number of classes with this naming convention? I would say that it qualifies as a code smell, but remember that a code smell doesn't necessarily spell trouble. It is something you should look into and then decide if it is okay. Having said that I personally find that a name like that adds very little value and because it is so generic the type may easily

What are the different kinds of cases?

纵然是瞬间 提交于 2019-12-02 17:01:24
I'm interested in the different kinds of identifier cases, and what people call them. Do you know of any additions to this list, or other alternative names? myIdentifier : Camel case (e.g. in java variable names) MyIdentifier : Capital camel case (e.g. in java class names) my_identifier : Snake case (e.g. in python variable names) my-identifier : Kebab case (e.g. in racket names) myidentifier : Flat case (e.g. in java package names) MY_IDENTIFIER : Upper case (e.g. in C constant names) Nils von Barth Names are either generic, after a language, or colorful; most don’t have a standard name