Okapi Java properties file and XLIFF file - xliff

Is it possible to use Okapi to convert java properties files to XLIFF and to reconstruct java properties file from XLIFF file.

Yes, this is possible using the Properties Filter.
An example of doing this using Okapi Tikal would look like this:
tikal.sh -fc okf_properties -x sample.properties -nocopy
# translate the resulting sample.properties.xlf file
tikal.sh -fc okf_properties -m sample.properties.xlf
You can also use this with Rainbow as part of an extraction pipeline.

Related

Asciidoctor: store git commit hash in pdf

I'd like to generate a PDF from an .adoc file with asciidoctor using
asciidoctor-pdf Doku.adoc
How can I print the current git sha1-hash into the PDF?
Use DocumentAttributes
asciidoctor-pdf -acommitHash=$(git rev-parse HEAD) Doku.adoc
You can now use the document attribute commitHash within your document by writing:
{commitHash}
Use ifdef to test if the variable is set.
ifdef::commitHash[]
{commitHash}
endif::[]
You can also define a default as fallback if no attribute is defined from the CLI
:commit: Unknown
Version: {commit}
The command line -a will override the document internal declaration.

httxt2dbm creates Perl files instead of .dbm file. Apache server does not "want" to work with those files

I tried to convert a simple mymap.txt file to mymap.dbm file to use in RewriteMap for RewriteRule. mymap.txt file is tested with and works perfectly. I was converting it with httxt2dbm apache functionality:
httxt2dbm -i mymap.txt -o mymap.dbm
And instead of creating one mymap.dbm file it creates two files looking like this:
mymap.dbm.dir (0 kb)
mymap.dbm.pag (1 kb / 1024b)
RewriteMap does not "want" to work with any of those files. I tried to rename mymap.dbm.pag to mymap.dbm and work with it. Did not work either.
Line from httpd.conf:
RewriteMap somemap "txt:C:\xampp\htdocs\htaccessTest1/mymap.dbm"
mymap.txt looks like this:
k1 http://localhost/htaccessTest1/keyw1.html
k2 http://localhost/htaccessTest1/keyw2.html
k3 http://localhost/htaccessTest1/keyw3.html
k4 http://localhost/htaccessTest1/keyw4.html
With .txt map I had zero problems.
How to force it to work?
Update1:
I tried force it to output DBM:
httxt2dbm -f DBM -i mymap.txt -o mymap.dbm
Error appeared:
Error: The requested DBM Format 'DBM' is not available.
How is this possible if that is what it meant to be?
Update2:
.pag file with following .dir files are Perl files.
But why does httxt2dbm create those files instead of .map file?
RewriteMap somemap "txt:C:\xampp\htdocs\htaccessTest1/mymap.dbm"
Notice the txt.
From the documentation:
txt
A plain text file containing space-separated key-value pairs, one per line. (Details ...)
...
dbm
Looks up an entry in a dbm file containing name, value pairs. Hash is constructed from a plain text file format using the httxt2dbm utility. (Details ...)
So if you're using a dbm map, you need to tell Apache that:
RewriteMap somemap "dbm:C:\xampp\htdocs\htaccessTest1/mymap.dbm"
Many dbm implementations use two files for storing data: a .dir file storing the hash table used for looking up keys, and a .pag file with the values. That part is normal. More documentation:
Note that with some dbm types, more than one file is generated, with a common base name. For example, you may have two files named mapfile.map.dir and mapfile.map.pag. This is normal, and you need only use the base name mapfile.map in your RewriteMap directive.

How to write match results from .cypher into textfile via cypher shell (Windows)?

I want to write match results based on cypher code inside a cypher file via cypher-shell into a text file (I am trying to do this on Windows). The cypher file contains: :beginmatch(n) return n;:commit
I tried to execute:
type x.cypher | cypher-shell.bat -u user -p secret > output.txt I get no error. But at the end there is just an empty text file "output.txt" inside the bin folder. Testing the cypher code directly in the cypher-shell (without piping) works. Can anyone help, please?
consider using the apoc library
that you can export to different formats, maybe it can help you.
Export to CSV
Export to JSON
Export to Cypher Script
Export to GraphML
Export to Gephi
https://neo4j.com/labs/apoc/xx/export/ --> xx your version Neo4j,example 4.0

Can we pass a command line argument to property file reader in jmeter

I have a config.property file that contains all the property values to be used in jmeter, so i am using property file reader plugin to read the property file, here the problem is i don't want to hard code the path to config.properties file in property file reader so i want it to pass as command line argument but it is not working
command i am executing is
.\jmeter -JPROPERTY_FILE=<file_location> -n -t <path_to_jmx> -l <path_to_jtl> -j <path_to_log>
In the File Path of Property File Reader, replace:
${PROPERTY_FILE}
By using __P function:
${__P(PROPERTY_FILE)}
Your mistake is that you’re using Variable syntax for a property.
See:
http://jmeter.apache.org/usermanual/functions.html#__P
http://jmeter.apache.org/usermanual/functions.html#functions
You should be using __P() function like ${__P(PROPERTY_FILE)} or even __property() function like ${__property(PROPERTY_FILE,PROPERTY_FILE)}. The latter one automatically stores the retrieved value into a JMeter Variable so you won't have to additionally declare it under User Defined Variables of the Test Plan
Instead of using custom plugins I would suggest going for built-in JMeter functionality, there is -q command-line argument which allows loading and arbitrary .properties file so you will not have to install the plugin, care about order of Configuration Elements, etc.

Behave framework .ini file usage

In my .ini file I have
[behave]
format=rerun
outfiles=rerun_failing.features
So I want to use "rerun_failing.features" file for storing scenarios that fail.
However when I run '--steps-catalog' command, it also stores that catalog to the same file. Why is that?
How to make set up two separate files for commands '--rerun' and '--steps-catalog'?
Thanks!
Use behave --dry-run -f steps.catalog ... instead. The output of the steps.catalog formatter is written to stdout, not the "rerun-outputfile".