Description that tells what script does - terminology

I have a description at the top of the script that tells the reader what the script does. What would I call that description? A spec? What about a description of the operations of a function, located above the function definition? Would I call that a spec for the function? Thank you.

It depends on how formal the description is as well as the programming language. I would call it a "description", "documentation", "comment", or (if using something like javadoc or doxygen) a "documentation comment".
Some programming languages have specific terms for this. For example, in Python, there is a specific mechanism for documenting a module or function which would be described as a "docstring".

Related

Tesseract4Android couldn't initialize tesseract API with language

TessBaseAPI.init() could't initialize tesseract API with language. i have been struggle with this problem for so long. i have try so many solution but it wasn't work. can you guys tell me how to solve this problem?enter image description here
The language field shouldn't receive the programming language name (or what "plate " is? a library?), it should receive a human language like "amh" or "eng" or "chi".
https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html

What does the "_" function in Vala do?

I've seen that some projects used _ function that takes string as an argument, like _("Hello World"). But I couldn't find any manuals or articles about what is it and how to use it.
I guess this has something to do with i18n and l10n (it was mentioned in some article I found on the internet), but can you explain to me how it works and how to use it?
That is the GNU gettext localization function. You can provide language specific alternate strings for the one specified in the function call.
There is the xgettext tool, which generates a .pot file (abbreviation for portable object template) from your application code, then translators can make .po localization files for it. Then, you can bundle these with your application, and deliver a more widely usable piece of software.
I18n. See gettext example here: https://ewgeny.wordpress.com/2012/05/10/supporting-multiple-languages-in-your-application-a-simple-gettext-step-by-step-example/
Also found some info about what exactly this function do, it seems to be the macro for Glib.dgettext() function in Vala, this is from valadoc.org:
dgettext
public unowned string dgettext (string? domain, string msgid)
This function is a wrapper of dgettext which does not translate the message if the default domain as set with textdomain has no translations for the current locale.
...
Applications should normally not use this function directly, but use the _ macro for translations.

extractValue function to extract from HTML?

So I was working with webload and was using a function called extractValue, but when I googled it to try and find proper use of it, I learned that it is actually a SQL function for extracting XML values (? is this correct?). Now seeing as that XML and HTML are both markup languages, I figured that maybe it would apply for both HTML and XML? But then I realized that extractValue for XML follows the form extractValue(xmldocument, startpoint, endpoint), while an example for the extractvalue i am using looks like
roughNKEY = extractValue("\"NKEY.DUMMY.MENSYS.1\"", "/", document.wlSource, 1)
which seems to have the form extractValue(startpoint, endpoint, htmldocument(i think it's reading from the html page?), 1)
I have no idea where this usage is from or even what language it's in, but it works for the purpose. Does anyone know where I can find more information on this? Is this just like a function exclusive to webload or something?
Thanks
Please review the documentation. You can find it in:
C:\Program Files (x86)\RadView\WebLOAD\help_files
There are three documents that contain information about extractValue:
javascript reference manual
scripting guide
IDE user guide
ExtractValue is also generated by the Correlation engine.
In order to extract a value from the page source, you need to insert:
wlHttp.SaveSource = true
Into the IDE node you want to search.

Is there an Actionscript to ABC Bytecode parser?

So, I have an app where users should define ActionScript functions.
What do I need to get the string whritten by the user and convert it to bytecode so that I can use it with as3-commons-bytecode?
Edit
I don't think I was clear enough. I need to turn: if(!myValue) {...}
Into this:
...
findpropstrict private::myValue
getproperty private::myValue
not
iffalse L1
...
Because with this ^^^^ code, I can use as3-commons-bytecode to do what I need.
I took a look at this app's source code. It's very confusing, the project is old and the code is a mess, but it works. I need to find "where the magic happens". Can you show me the way?
You should use part of this project :
eval.hurlant.com/demo/#app=da4a&757d-selectedIndex=0
Check source , there is parser to ABC .
I'm not aware of any libraries that do this for you, but to achieve this functionality you should parse user's input into function names.
For example, you can call a function just by having it's name as a String like so:
var functionName:String = "myMethod";
function myMethod():void
{
trace("myMethod");
}
this[functionName](); //traces "myMethod"
Of course, if you wish to interpret advanced strings with getting/setting objects and their properties and any other user defined statements, that would require to write quite a sophisticated string-to-bytecode converter.
UPDATE:
There's also AS3Eval library that might do the job. Take a look at http://eval.hurlant.com/
There is a library for Haxe which makes it possible to compile Actionscript assembly language into ABC at runtime, but this is still lower-level than the Actionscript you normally write.
http://haxe.org/com/libs/format/abc
The most likely solution is a server or other process which can compile and return SWF content for you. Haxe has a very fast and straightforward compiler, but it may also be possible to use Tamarin or another solution for compiling AS3 on the server.
Actually, there is a runtime library for executing Haxe code, which again, is very similar to Actionscript. Might be worth looking into:
http://code.google.com/p/hscript/
What exactly want to do? To compile "string" the string must be something meanfull for the compiler such as package not a simply string ( like 'asdas ' ). If you don't wont to use flash/flex compiler you may compile AS to ABC with Ant or Haxe. But ther is a problem - how you will start this ABC?

Force function documentation in Doxygen for documenting JavaScript API

I use Doxygen for documenting the JavaScript API of my C++ (Qt) project. The idea is to write one specific documentation for the JavaScript interfaces, and one for the C++ classes us usual.
One example (datasource.dox) looks like this:
\addtogroup JavaScriptAPI
#{
...
\class DataSource
\brief DataSource is the .... some doc goes here ....
\section formats Supported formats
....
\fn isOpen()
\brief returns true if the data source is currently open...
...
#}
The generated help looks nice w.r.t. the class description (or 'object'-description), but the function documentation (isOpen(), ...) is missing. Doxygen creates warning messages like:
Warning: documented function `bool isOpen' was not declared or defined.
The question, now: can I somehow force doxygen to use my \fn-d function descriptions? It would be nice, if doxygen created all those member indices for me...
Two approaches for using doxygen with Javascript are listed here http://www.doxygen.org/helpers.html
(look for JavaScript)