Suppose I have a logger function, and I called it all over my code. My logs usually show the probability of the existence of a problem or a bug. More actions and investigations needed to confirm the problem or bug. For example, maintainer or tester should grab the input, open it in an editor, and if a specific string is inside the input, The problem or bug is confirmed.
I want to document the procedure of confirming the bug in a comment above of the log function in code. I also want to extract all of these kinds of comments and create, say an HTML table from them. So I can give that table to the tester or maintainer to find correct bugs for me.
I show it in a simple code. I know it's silly, but does the job:
std::ifstream t("file.txt");
std::string input;
// Read the whole file into input string
// DIAGNOSTICS COMMENT
// NOHELLO_BUG
// Diagnostics steps: 1.Open input file file.txt 2. Search hello inside the file, if hello exists inside the file, there should be a bug, send file.txt to the developer!
if (input.find("hello") == std::string::npos)
{
logger::log("hello not found inside input file!");
return false;
}
Is there any command in Doxygen for this purpose, although Any other solution is welcome too. The most obvious way is to write that table by myself, But maintaining that table will be a disaster too.
Doxygen contains a.o. the commands \todo, \bug
From the documentation:
https://www.doxygen.nl/manual/commands.html#cmdtodo
\todo { paragraph describing what is to be done }
Starts a paragraph where a TODO item is described. The description will also add an item to a separate TODO list. The two instances of the description will be cross-referenced. Each item in the TODO list will be preceded by a header that indicates the origin of the item.
\bug https://www.doxygen.nl/manual/commands.html#cmdbug:
\bug { bug description }
Starts a paragraph where one or more bugs may be reported. The paragraph will be indented. The text of the paragraph has no special internal structure. All visual enhancement commands may be used inside the paragraph. Multiple adjacent \bug commands will be joined into a single paragraph. Each bug description will start on a new line. Alternatively, one \bug command may mention several bugs.
Furthermore doxygen contains the command \xreflist with which you can define your own lists.
Small excerpt from the documentation (https://www.doxygen.nl/manual/commands.html#cmdxrefitem):
\xrefitem "(heading)" "(list title)" { text }
This command is a generalization of commands such as \todo and \bug. It can be used to create user-defined text sections which are automatically cross-referenced between the place of occurrence and a related page, which will be generated. On the related page all sections of the same type will be collected.
The first argument is an identifier uniquely representing the type of the section. The second argument is a quoted string representing the heading of the section under which text passed as the fourth argument is put. The third argument (list title) is used as the title for the related page containing all items with the same key. The keys "todo", "test", "bug" and "deprecated" are predefined.
Related
Before you reference in-doxygen-documentation-how-to-create-a-link-to-a-specific-line-of-a-file, I already reviewed that and it doesn't answer the question I have.
In doxygen, there are several links created to specific lines of code (assuming code is built when building doxygen output). The best example is function details as shown below:
I would like to create similar links for other items that are parsed when doxygen is created. Specifically, the SDD tags that you see in the picture above. By creating a link from the SDD tags, or referencing it in the same way doxygen does with "Definition at line 6969 of file AlarmManager.cc", will allow my team to jump straight to the line of code where the SDD is referenced/implemented. See code example below:
case NEBULIZER_INOPERATIVE_EN: /// #sdd [ALARM_ANALYSIS_SDD_1]
ConditionEvaluations::SetCondition(C1500);
AlarmManager::ROperandNameList_.append(tempName = C1500);
break;
case NOT_NEBULIZER_INOPERATIVE_EN: /// #sdd [ALARM_ANALYSIS_SDD_2]
ConditionEvaluations::ClearCondition(C1500);
AlarmManager::ROperandNameList_.append(tempName = C1500);
break;
case NEBULIZER_DISCONNECTED_EN: /// #sdd [ALARM_ANALYSIS_SDD_3]
ConditionEvaluations::SetCondition(C1501);
AlarmManager::ROperandNameList_.append(tempName = C1501);
break;
I tried anchors in the code, but that didn't work. I don't know how to just reference and create a link to File->code line.
I'm writing a scientific manuscript in RMarkdown using the papaja package, which enables me to report my statistics beautifully. However, the journal now requires me to submit a Word document with number-letter referencing. Is it possible to change the referencing style to a number-letter style in Papaja?
I tried opening the LaTeX output from papaja, but it has the citations set out in the text in APA format (e.g. "Apthorp, Bolbecker, Bartolomeo, O'Donnell, \& Hetrick, 2018"), which is not useful to me.
Here's the code from the top of the manuscript:
bibliography : ["PD_sway-1.bib"]
floatsintext : no
figurelist : no
tablelist : no
footnotelist : no
linenumbers : yes
mask : no
draft : no
documentclass : "apa6"
classoption : "man"
output : papaja::apa6_pdf
It would be great if I could get a Word document with number-letter referencing that I could then edit, but a LaTeX file or PDF with the correct citation format would be fine too.
The references are already typed out in APA style in the LaTeX document because they are handled by pandoc-citeproc rather than LaTeX. This has the advantage that the automatic reference formatting also works when you output your document in Word format. To get a Word document all you need to do is change the output line in the YAML front matter:
output: papaja::apa6_docx
Note that the formatting of Word documents that pandoc supports is somewhat limited and you may have to fix some things manually. From the corresponding section in the papaja manual:
More over, rendered documents in DOCX format require some manual work before they fully comply with APA guidelines.
We, therefore, provide the following checklist of necessary changes:
Always,
add a header line with running head and page number
If necessary,
position author note at the bottom of page 1
move figures and tables to the end of the manuscript
add colon to level 3-headings
in figure captions,
add a colon following the figure numbers and italicize(e.g. "Figure 1. This is a caption.")
in tables,
add horizontal rules above the first and below the last row
add midrules
Changing the citation style works just as it does in any R Markdown document. The work-in-progress papaja manual has a section on this:
Other styles can be set in the YAML front matter by specifying a CSL, or Citations Style Language, file. You can use either one of the large number of existing CSL files, customize an existing CSL file, or create a new one entirely.
To change the citation style, download the CSL file and add the following to the YAML front matter:
csl: "path/to/mystyle.csl"
I'm not sure what style the journal requires but most likely a corresponding CSL file already exists.
So I am working on a planets vs zombies type mock up game for class, and am using Qt Creator GUI with C++. One of the things that we are required to do is, on start-up, the game window will attempt to read two files: "pvz_levels.csv" and "pvz_players.csv" from a pre-specified home directory.
The levels file is of the form "level:sequence:rows:start:interval:decrement" and "sequence" itself is a comma separated list of the form (1,1,1,2,3,1,3,1,3,3) which is the sequence in which zombies appear. If this file does not exist in the directory, the program exits with an error.
The players file is of the form "timestamp:player:level"; the time of last play, name of player, and last attempted level, respectively. If this file does not exist, the program silently skips this operation and starts as a new player. If it does exist, the file must be read and parsed, and then used in the program for calculations and such.
So, I am having much trouble with reading and parsing these files. Furthermore, we are required to save the user data in these files, and on the next start-up the user should have the option to continue their game by selecting their respective user from a drop-down list. They should also be able to delete any users.
I am proficient enough with c++ basics but this is my first GUI experience and my prof did not go over it in much detail, so I require quite a bit of help with this project.
Thank you to anyone who is able to help!
Look up the code to an available "csv parser" which stands for "comma separated variable". You need is almost identical, except you use a semi-colon instead of a comma. It seems that by changing one character you parsing is done for you.
You may be able to find a csv parser that accepts the character to be used as the parsing character (I've seen them before).
If you wish I can find a suitable csv parser for your use, but now that you know what you're looking for "csv parser c++ code" it should be a quick Google away.
Also, most csv parsers expect strings to be enclosed to double quotes (") but that is easily modifable.
Some hints:
Just open the File using QFile. Set up a QTextStream and use QTextStream::readLine() to read all Lines into QStringList. Now use QString::split() on the QString saved in the list to get the single values stored in this line. From there you can easily use QString::to* functions to cast the values into your desired type.
For saving just reverse the procedure.
Set up a line using: QString("%1,%2,%3").arg(timestamp).arg(player).arg(level) and put it into your QTextStream. If the stream is connected to a file, this will be written into the file.
I've implemented successfully the CSV reading like this:
std::unique_ptr<QFile> csv_worker(new QFile(resource_path));
QTextStream input_csv(csv_worker.get());
QList<QStringList> data
while(!input_csv.atEnd())
{
//removes the carriage return symbol and splits the elements
QStringList line = input_csv.readLine().remove(QRegExp("\r")).split(","); //replace here with :
data << line;
}
csv_worker->close();
It reads the complete file, each line generates a QStringList.
For the second element in the QStringList, let's say (1,1,1,2,3,1,3,1,3,3}, you have to additionally split that in a sub-QStringList, removing then brackets with something like this:
QStringList sequence = data[i][1].remove(QRegExp("{")).remove(QRegExp("}")).split(",");
One of the fields in my database table is named DATEOFDISCHARGEFROMITU. In any report output, this displays as DATEOFDISCHARGEFRU. I've figured out that the missing characters form the word 'OMIT', which makes me think it's related to this old problem in a previous version of ApEx (I'm using version 4.1.)
Is there a way to display the whole field name in the report header when the field name contains the string 'OMIT'?
Note: Using html character codes will allow the field name to display properly, but then when the report is exported to CSV the character codes are of course shown instead of the full field name. I need a solution that works for exports as well as displaying onscreen.
Platforms (tested): Oracle Application Express (APEX), Version 4.0.2
Note: I am not sure how the linked OTN post is relevant to your problem aside from the coincidence that their file export contains the word "OMIT" and your column title contains the word "OMIT".
It's safe to say that "OMIT" isn't an APEX or ORACLE reserved word that is sabotaging your output. However, if you were talking about a scrap of SQL that attempted to create a table named "SELECT" or "WHERE"
i.e., SELECT * FROM "SELECT" WHERE...
you'll be blocked by the RDBMS from proceeding. :)
I tried an export with a query that contained a column header labeled "OMIT" (see the far right in the example.) The .csv file interpreted by Microsoft Excel looked like this:
I wrote up a separate Q&A post about creating dynamic APEX report headers to answer your follow-on question about a suitable solution for providing a clean, htmlcode-free output when a report is eventually exported to a text, comma separated (or other delimited) output.
In summary, the linked post suggests to set up a dynamic PL/SQL Function within a page item. The page item can be referenced directly in the report column header definition. This is a screenshot demonstrating a possible solution:
The link to the general explanation has more details on the APEX design tasks that gets to this final product.
Onward.
I solved this by using this solution for exporting to csv without an enclosing quote character - as that was another challenge I was faced with for the particular application I was developing. By manually creating the export file I was also able to define the column headings exactly, and the "OMIT" issue did not occur.
Technically that's not a solution for displaying a report with the required headings that can also be exported (Richard's response does that) but it does what I need it to and solves the immediate problem of the DATEOFDISCHARGEFROMITU column heading.
I would like to define an alias that behaves similar to \sa or \see, e.g. groups subsequent paragraphs marked with it into one section and lists each item on a single line.
e.g.
\foo One
\foo Two
\foo Three
Should end up as
Foo:
One
Two
Three
Long story short: An alias that behaves like \see but has a different label.
Have a look at the \xrefitem command. From the doxygen documentation (emphasis mine):
This command is a generalization of commands such as \todo and \bug. It can be used to create user-defined text sections which are automatically cross-referenced between the place of occurrence and a related page, which will be generated. On the related page all sections of the same type will be collected.
The example in the documentation suggests that you place the alias
ALIASES += "reminder=\xrefitem reminders \"Reminder\" \"Reminders\""
in your configuration file. Then writing something like
\reminder test 1
\reminder test 2
\reminder test 3
in your documentation will result in something like:
Reminder:
test 1
test 2
test 3
The only problem with this is that you will under an additional page under the "Related pages" tab called "Reminders". If you don't want this related page you can use an alias as documented in the custom commands documentation:
ALIASES += sideeffect="\par Side Effects:\n"
which will allow you to put the command \sideeffect in the documentation, which will result in a user-defined paragraph with a heading Side Effects:. However, these will not be grouped together in the final documentation (i.e. each \sideeffect will generate a Side Effects: heading).