In GitHub, how do I search for "RecoverCompact" in "CPubKey::RecoverCompact" - c++

I'm searching GitHub for a given definition of "RecoverCompact", and I keep getting results that were checked in from the first release.
I realized my mistake is that GitHub doesn't search the partial text because it sees "CPubKey::RecoverCompact" as a single string, when in my case I don't know which object this is in.
Why is it that I can search for some instances of "RecoverCompact" and not others? (namely old versions?)
Assuming this has to do with how the method is declared, what is this declaration format called? (Global? .. I'm not a C++ developer)

If you search RecoverCompact in that same repo, you can see its declaration in the CPubKey class
// Recover a public key from a compact signature.
bool RecoverCompact(const uint256 &hash, const std::vector<unsigned char>& vchSig);
To search through older version, you would have to clone the repo and use git log -G, as explained here.

Related

C++ PostgreSQL Library, describe SQL, without execution

I have asked this question on Github, issue #641, since it seems like a deficiency or an enhancement question.
Most databases (e.g. Oracle, SQL*Server, Sybase, ... ) send back a description of the resultset, even if there are zero rows. I cannot seem to find this in pqxx, nor can I find a way to describe SQL of any kind prior to execution. The only way I have been able to get the SQL metadata is by collection upon the first row retrieved, but this is limited to an actual row being retrieved. If there are zero rows, I have no way to determine the metadata.
Looking at the v15.x code base for libpq (standard C library), I see that psql has a "workaround" for this very problem. In the file src/bin/psql/common.c there is a function called static bool DescribeQuery(const char *query, double *elapsed_msec) (on or about line #1248).
This function has a rather ingenious solution for this very problem. They create an "unnamed" prepared statement, which they do not execute, instead they use the results of that call, which provides the field info, and subsequently query against the pg_catalog for the metadata descriptions (source below).
Unfortunately, the pqxx library doesn't provide enough (that I can tell) to duplicate this functionality. Does anyone have a solution for this problem?
Credit for resolution goes to Jeroen Vermeulen, on the Github issue #641. He suggested that the predicate AND false be added to the query to force a prototype result. By doing this an empty resultset is returned, with the fields available for metadata collection.

typo3: extension template namespace

In the root template page.10 is already taken. If I put page.10 into my extension template, I override it. How can I make sure (just putting a large number is not "making sure") that I don't override anything? The root template is very complicated and includes many other templates, so I cannot really tell which numbers are already taken. I just want to use the extension template to append some content.
The safest solution would be not adding anything automatically. Instead you could provide your rendering instruction via lib.* or tt_content.list.* in case it is a registered plugin:
lib.yourContent = USER_INT
lib.yourContent { ... }
Then you only need to document how to add something to the page output, e.g.:
page.11 < lib.yourContent
I know it has been a while since you've asked this question.
You're saying "just putting a large number is not making sure" because you have no idea what content is using which number on the page object.
If you want to be 99,9% sure that a number has not been used, why don't you use the current timestamp as a number on this cObject? That's how the TYPO3 Errorhandler also refers to pages, using the timestamp they wrote it.
The simpliest answer if you can make sure which Page object index is already used for something is you cannot.
It might be set somewhere deeper in extensions, in any condition that meets any expression is defined there.
None of standard built in tools in TYPO3 can predict that and check all combinations of conditions to tell you if such number is set somewhere in some case.
But.
If you are an admin of that page, then the best approach is just to know your template.
Analyse the typoscript and know what numbers in Page object are used for something. Make a tidy consistent template, clean it up, check using Template tools -> Typoscript object browser. You have to know what's going on on your site, the elements in indexes of main Page object are the main and basis things which are shown public.
(Or just guess any random big number and try to search it in whole typoscript using Template tools -> Template Analyzer -> View complete TS listing. Let's be honest, probability that you shoot a big number which is already used is rather low)

Global functions in Lucee/Coldfusion

I am trying to create global functions in Lucee. I have followed the directions here and have it "Kind of" working. Inside of Application.cfc I placed the following code:
public void function onRequest() {
URL.IsInternalUser = function() { return (SESSION.user.ID ?: 0); };
}
This seems to work fine in some cases but if we need to access this function in a subdirectory that contains an Application.cfc that does not have the function re-defined it will error out saying the function doesn't exist.
The ultimate goal I am trying to achive is to have a cfc file that contains several user defined functions and then have them accessible throughout the entire application without redefining things over and over again.
Is there a better way to accomplish what we want? I ask this because on the page I referenced earlier in the comments section there is a quote:
I concur. Wouldn't surprise me to see it somewhere else in the future.
What I like about Railo's method is that it is completely sandboxed.
Host A's tags & functions libraries never cross/conflict with Host B's
libraries unless they're put into the global server folders. It's the
same way for the virtual file system too and pretty much everything
else (datasources, etc).
It specifically mentions Railo having a way to create UDF but I can not find any documentaion on this anywhere. Since we are using Lucee which is a fork of Railo I figure it must have what Railo has for creating UDF. Hoping someone that reads this can help me out and point me in the right direction.
Railo/Lucee support custom functions. You can declare them in /WEB-INF/{railo|lucee}/library/function/ of the site. Save the function in a .cfm file and name the file the same as the function. The server needs a restart after creating new functions. Here is Railo's blog post about it.
Adobe ColdFusion doesn't support this AFAIK. So you have to store your functions in the SERVER scope here.

How to insert the project name in a comment in doxygen?

I often use the project name in comments I write. However, up until now I hardcoded it. Now I realized that if the project name were to change, I would have to go through all the documentation parts and change it. Therefore, I wanted to ask if it is possible to simply reference the project name in the comment and let doxygen fill it out later.
/*! \brief This is the main function of the (project_name) project
*/
int main()
{
return 0;
}
I think what you are looking for is environment variables, which you can read about here.
The one you are looking for should be $(PROJECT_NAME).
To use it, see this answer.

Can't find FinishMonsterBuffer() method

I created a table following the flatbuffers tutorial and compiled it to C++ code. Say, its name is Doc.
In the tutorial, it is said:
Regardless of whether you used CreateMonster or MonsterBuilder, you
now have an offset to the root of your data, and you can finish the
buffer using:
FinishMonsterBuffer(fbb, mloc);
However, I can't find any method named FinishDocBuffer. The generated Doc class only has one method named Verify() in addition to getters. The generated DocBuilder class only has one method named Finish(). And there's only one function named CreateDoc() defined outside of those two classes.
Did I do something wrong, or should the official doc be updated?
FYI, I'm using latest flatbuffers code cloned from the git repo.
Update:
I found the example code didn't call any Finish*Buffer() method either.
Found the reason. I need to add this line to my doc.fbs file:
root_type Doc;