How to pluralize a function's name in technical writing? [closed] - documentation

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
How to pluralize a function's name such as foobar in technical writing?
By technical writing i mean, for example, comment text in source code, documentation of a software or programming element that might be in different place from the corresponding source code.
Should i use
foobars
foobar`s
foobar's
foobar
?

I'd suggest not changing the function/method name in any way as that would invite confusion, but refer to it like:
Use the fooBar functions to blah, blah, blah...
or
Use the fooBar methods to blah, blah, blah...

Add the "s" at the end like any other plural, but distinguish via formatting.
Write something like "All of the substrs are...". I also will distinguish a function name as a function name by using parentheses, as in "All of the substr()s are ...".

Related

How to name boolean variable that indicates whether to do something? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
As far I as my experience tells me, boolean variables usually named in format - is/has+noun/adj/verb, e.g isValid, isButton, hasClickedLink
But say there is the case where we have some flag which straightly tells whether to do something, like for example, clean to indicate that cleanup function should be automatically called in the end.
How to name such a booleans? Same clean - is ambiguous, looks like a method name more, but naming it toClean is, I don't know, too weird. Or should I name it like callCleanup?
Thanks in advance!
In this case i usually append the word wanted, which makes cleanWanted. In general, for boolean variables I also prefer to always let the last word be an adjective. This makes it very clear that it represents a truth value. The is/has prefix is often superfluous, as in hasClickedLink which is more concisely communicated with linkClicked.
methods are usually one word adjectives with a capitol at the start
maybe create a method that sets the flag
for example
void Clean(){
clean = True;
}

Is a dictionary patch the appropriate term used to describe an acronym? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
In Silicon Valley S03E01 Gilfoyle and Dinesh have a conversation about Richard. In the conversation they use the term dictionary patch as such:
Gilfoyle: What if we use like a dictionary patch? To compress all the
nice-guy stuff.
Dinesh: Like an acronym.
Gilfoyle: Exactly. "Richard is great, but you know"... R-I-G-B-Y.
Dinesh: Rigby.
Gilfoyle: Rigby is all the nice-guy stuff.
Wouldn't that be a dictionary key?
Example of a dictionary key:
var dictionary:Dictionary = new Dictionary();
dictionary["RIGBY"] = "Richard is great, but you know";
console.log(dictionary["RIGBY"]);
// output is "Richard is great, but you know";
in this case the dictionary key is "RIGBY"
http://siliconvalleyism.com/silicon-valley-quote.php?id=135
I've never heard of the term "dictionary patch" outside of Silicon Valley. But, yes, 'RIGBY' would be the dictionary key, but dictionary patch wasn't just talking about the key. They were referring to a process of using a dictionary key to replace a long value with that key. So, he's calling this whole higher-level process "dictionary patching", although I've never heard of it.

Convert UID null-termintated string binary to hex [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Here is the question which is Re Phrased.
Here is the raw binary data, hex encoded, which i need as a output:
040000008200E00074C5B7101A82E0080000000000000000000000000000000000000000310000007643616C2D5569640100000033353335324538372D343338462D343444362D413432462D37393942423334313033333800
I can extract some part of the raw data i.e.(040000008200E00074C5B7101A82E0080000000000000000000000000000000000000000310000007643616C2D55696401000000) from the object which i am getting from the micro soft outlook.
The Rest of the part that is
33353335324538372D343338462D343444362D413432462D373939424233343130333338 is the conversion of the UID : 373D06E9-587E-4930-B846-12500FF1AC2F.
So My question here is how to convert the above UID i.e 373D06E9-587E-4930-B846-12500FF1AC2F to this format 33353335324538372D343338462D343444362D413432462D373939424233343130333338 using objective C or cocoa.
Thanks in Advance.
You should look here:
https://developer.apple.com/library/mac/documentation/corefoundation/Reference/CFUUIDRef/Reference/reference.html#//apple_ref/c/func/CFUUIDCreateFromString
CFUUIDCreateFromString() appears to be the API you are looking for. Assuming that CFUUID is the "binary format" you are searching for.
If you then want "raw bytes", look at CFUUIDGetUUIDBytes()

String.Format For SQL Connection String [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I need to convert a SQL connection string into a String.Format line
The line that I need to convert is this:
WHERE full_name = #FullGraveNumber AND cemetery_id = #CemeteryID
Both thefull_name and cemetery_id are variables, but I have not idea how to construct the
String.Format line.
Seems you are looking for
Dim selectCommand = "SELECT * FROM mytable WHERE full_name = #FullGraveNumber AND cemetery_id = #CemeteryID"
Dim cmd = New SqlCommand(selectCommand, yourconnetion)
cmd.Parameters("#FullGraveNumber").Value = value1
cmd.Parameters("#CemeteryID").Value = value2
or
cmd.Parameters.AddWithValue("#FullGraveNumber", value)
First of all, ConnectionString is already a String with no parameters, it does not need to converted using String.Format. Usually stored in app.config, you feed it directly into SqlConnection object upon creation.
Part of the query that you have is also a String, but this time it may be substituted with parameters. However, please don't do so and use SQL parameters instead (see #huMpty's answer).
full_name and cemetery_id are SQL parameters, variables is something else.
My suggestion it to learn the terminology first, before you do any coding. No offense, it would benefit you a lot, because you would be able to ask a proper question. Proper question means a fast and qualified answer. Improper questions are usually closed. These are the rules of StackOverflow.

Wide Method Call VB.NET [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I've just written this:
ldb.Update(emp.Code,emp.number, "text", String.Empty, "EMP", emp.scheme, emp.status, emp.tod, emp.timestamp, emp.Code, emp.oldfrmd)
Its far to wide! How can I shorten this method call? The problem is this isn't my method, so I can't edit it.
It depends on what your concern is:
Too many parameters? Can't really change that without changing the method, although you could introduce a proxying method containing fewer parameters, where each parameter may map to several of the original ones. It looks like you might want to make this a method on whatever the type of emp is, but it's hard to know without more information.
Just too wide on the screen? Use line continuations:
ldb.Update(emp.Code, emp.number, "text", String.Empty, "EMP", _
emp.scheme, emp.status, emp.tod, emp.timestamp, _
emp.Code, emp.oldfrmd)
(IIRC the "_" isn't actually needed in VB10.)
Too many characters? Introduce some local variables, potentially, shortening the eventual call to something like:
ldb.Update(code, number, "text", "", "EMP", scheme, status, _
tod, timestamp, code, oldfrmd)
(Although your overall code will be bigger, of course.)
Since you can't change the method signature, you must really be passing all those fields of emp into it. I would tend to write my own function (pardon my terribly rusty VB; I'm sure there's something wrong with this):
updateLdb(Employee e)
which simply called ldb's function and did nothing more. Using a single letter for a variable name is generally a bad idea, but in this case it saves your line 16 characters, and in a one-line function, "e" isn't particularly less informative than "emp". As Jon says if you move this function into the Employee class, you can get rid of another 16 characters - and it does appear to really belong there.
I would not use "e" as a variable or parameter name in any function that is longer than one or two lines, but in that small a scope, I think you can get away with it without significantly sacrificing readability.