Pandoc - How to generate Github Markdown table of content TOC? - github

I'm trying to generate Table Of Content for a Markdown file that works well in a Github repository with a command:
pandoc -f gfm -s --template template.md --toc questions.md -o README.md
The template.md is:
# Wielka Lista Pytań rekrutacyjnych dla Java Developera
$if(toc)$
$toc$
$endif$
$body$
The questions.md is:
# Spring / Hibernate / JPA
1. Rodzaje fetchowania (fetch lazy, fetch eager)
2. W jaki sposób mozna tworzyć zapytania w JPA? (Chodziło o JPQL)
3. Co to jest problem N+1
- [Jak rozwiązać problem N+1 w Springu?](https://www.youtube.com/watch?v=hC4NmoO66Zc)
4. Na czym polega lazy loading?
5. W jaki sposób można wstrzykiwać zależności w Springu?
6. Adnotacja #Profile
7. Scope’y beanów
8. Jakie znasz serwery aplikacji?
## Spring Security / Security
1. Jakie znasz rozdzaje autoryzacji w Springu?
2. Co to jest OAuth 2.0?
3. Było pytanie o Base64
4. Pytanie o autoryzacje tokenem
And the output README.md is:
# Wielka Lista Pytań rekrutacyjnych dla Java Developera
- [Spring / Hibernate /
JPA](#spring--hibernate--jpa){#toc-spring--hibernate--jpa}
- [Spring Security /
Security](#spring-security--security){#toc-spring-security--security}
# Spring / Hibernate / JPA {#spring--hibernate--jpa}
1. Rodzaje fetchowania (fetch lazy, fetch eager)
2. W jaki sposób mozna tworzyć zapytania w JPA? (Chodziło o JPQL)
3. Co to jest problem N+1
- [Jak rozwiązać problem N+1 w
Springu?](https://www.youtube.com/watch?v=hC4NmoO66Zc)
4. Na czym polega lazy loading?
5. W jaki sposób można wstrzykiwać zależności w Springu?
6. Adnotacja \#Profile
7. Scope'y beanów
8. Jakie znasz serwery aplikacji?
## Spring Security / Security {#spring-security--security}
1. Jakie znasz rozdzaje autoryzacji w Springu?
2. Co to jest OAuth 2.0?
3. Było pytanie o Base64
4. Pytanie o autoryzacje tokenem
As you can see in TOC I'm getting some extra parts which I don't want to have, like this: {#toc-spring--hibernate--jpa} and what's more the links are actually not working.
Oh, and the headers are having those extra parts as well: {#spring--hibernate--jpa}.
You can watch it live on my repository here: https://github.com/sztukakodu/wielka-lista-pytan
I use Makefile to build the output.
What should be changed to have output with TOC without those extra parts & headers without extra parts & with all links working properly?

Related

How to parallelize Gauge at specification level?

I'm building a Gauge automation project with Selenium, Maven and Java. When executing a specification with an included table data like
# Specification
| name |
| A |
| B |
| C |
## Scenario 1
* User logs in application
## Scenario 2
* User does something for product <name>
In single thread, it runs:
mvn clean install
Output:
Scenario 1
Scenario 2 for name A
Scenario 2 for name B
Scenario 2 for name C
And then it moves to the next specification.
However, Gauge behaves different when running the same spec in parallel on 2 nodes:
mvn clean install -DinParallel=true -Dnodes=2
Output:
Browser 1: Scenario 1
Browser 2: Scenario 2 for name A
Browser 1: Scenario 2 for name B
Browser 2: Scenario 2 for name C
You can immediately see that the scenarios from Browser 2 will not succeed as the "precondition" from Scenario 1 was not run.
Is there a way to parallelize Gauge at specification level?
Note: I know that rewriting the scenarios to be self-contained is one way to go, but these tests get really long, really fast and increase the running time.
After some experimenting, it turns out that Gauge has 2 different parallelizations, depending on how you write the spec.
With a spec with test data like
# Specification
| name |
| A |
| B |
| C |
## Scenario 1
* User logs in application
## Scenario 2
* User does something for product <name>
the parallelization is done at scenario level, as described in the original question:
mvn clean install -DinParallel=true -Dnodes=2
Output:
Browser 1: Scenario 1
Browser 2: Scenario 2 for name A
Browser 1: Scenario 2 for name B
Browser 2: Scenario 2 for name C
However, when rewriting the specification to incorporate the test data into the steps
# Specification
## Scenario 1
* User logs in application
## Scenario 2 for A
* User does something for product "A"
## Scenario 2 for B
* User does something for product "B"
## Scenario 2 for C
* User does something for product "C"
the output looks something like
mvn clean install -DinParallel=true -Dnodes=2
Output:
Browser 1: Scenario 1
Browser 1: Scenario 2 for name A
Browser 1: Scenario 2 for name B
Browser 1: Scenario 2 for name C
which effectively applies parallelization at spec level rather than scenario level.

"failed to load any lstm-specific dictionaries for lang " tesseract 4.1

I tried to train the tesseract 4.1 using OCRD project but after training completed I copied the lang.traineddata but getting above error.
The tesseractWiki page is very confusing to understand asking to use combine_lang_model after making lstmf file. So Actually I have the lstmf file. I created these file by using tif/box pair.
Please help me for further step.
Related discussions:Failed to load any lstm-specific dictionaries for lang xxx
Suppose your training folder like this:
OCRD/makefile
OCRD/data/foo-ground-truth.
You could try as following steps:
Find the WORDLIST_FILE/NUMBERS_FILE/PUNC_FILE in the makefile, and change them to:
WORDLIST_FILE := data/$(MODEL_NAME).wordlist
NUMBERS_FILE := data/$(MODEL_NAME).numbers
PUNC_FILE := data/$(MODEL_NAME).punc
Suppose your base traineddata is eng.traineddata.
2.1 Download the .wordlist/.numbers/.punc files from the langdata_lstm.
2.2 Place them in OCRD/data
2.3 if the MODEL_NAME = foo, rename them as: foo.wordlist, foo.numbers, foo.punc
if you don't have the base traineddata, you could try this too. But if your base traineddata is afr, you should download the files from langdata_lstm/afr.
make training again
The cause of this error:
In OCRD, the default path of the above three files is $ (OUTPUT_DIR) = data / $ (MODEL_NAME), and all files in this path are automatically generated during the training process.
If the variable START_MODEL is not assigned, the makefile will not generate any related files under this path;
If the variable START_MODEL has been assigned, the foo.lstm-number-dawg、foo.lstm-punc-dawg、foo.lstm-word-dawg and so on will be produced in data / $ (MODEL_NAME). But they are not the right one. So there may be a bug in OCRD.

GitHub Repository File Changes

I am subscribed to multiple GitHub repository channels and I am constantly seeing stuff like this:
File Changes
M .circleci/config.yml (2)
M .gitignore (2)
M doc/_static/style.css (9)
M doc/conf.py (4)
M doc/documentation.rst (2)
R examples/visualization/plot_make_report.py (8)
M mne/report.py (48)
M mne/tests/test_report.py (32)
What do the Ms and Rs mean when describing these file changes?
This list is a summary of the changes that were done in a specific commit. These letters indicate what happened to the file next to them:
M - modified
A - added
D - deleted
R - renamed
and there are a few more.
These shortcuts are taken from the output for the git status --short command which you can read about more in its documentation.

Tokenizer in moses-SMT system stuck even with 10 sentences

I was trying to make a baseline MT system. Just for checking How it works I made Source (S) and Target (T) language corpus of just 2000 sentences. The very first step is to prepare the data for Machine Translation (MT) system. In this step first we have to perform tokenization as mentioned here Baseline SMT. I've used this code:
~/mosesdecoder/scripts/tokenizer/tokenizer.perl -l en \
< ~/corpus/training/news-commentary-v8.fr-en.en \
> ~/corpus/news-commentary-v8.fr-en.tok.en
~/mosesdecoder/scripts/tokenizer/tokenizer.perl -l fr \
< ~/corpus/training/news-commentary-v8.fr-en.fr \
> ~/corpus/news-commentary-v8.fr-en.tok.fr
( say S = French & T = English)
I checked after 2 hours it was still running. I got curious since it was not expected. Then I tried with just ten sentences. To my surprise, it's been 30 minutes and it is still running.
Did I do anything wrong?
PS: OS = Ubuntu 14.04.5 LTS
Sony ultrabook
No dual boot.
Please Follow bellow steps ;
git clone https://github.com/moses-smt/mosesdecoder.git
cd mosesdecoder
git clone https://github.com/moses-smt/giza-pp.git
cd giza-pp
make
mkdir tools
cp giza-pp/GIZA++-v2/GIZA++ giza-pp/GIZA++-v2/snt2cooc.out giza-pp/mkcls-v2/mkcls tools
scripts/tokenizer/tokenizer.perl -l fr < ~/corpus/training/news-commentary-v8.fr-en.fr > ~/corpus/news-commentary-v8.fr-en.tok.fr

OWASP Orizon implementation

I am working on developing a efficient tool for source code security testing.I have looked into OWASP's Orizon project. It looked interesting. But I am not able to get proper example implementations and documentation for the same. Can any one help me in doing it??
The source code of last version of OWASP Orizon (currently 1.39) is available on github but you will need to tweak the ant build.xml to build it. You can also download the binary version (1.19) on sourceforge. You then just have to extract the tar.gz and run the orizon.sh that will give you a command prompt.
The available commands are the following:
* open directory_name: opens directory_name for scanning.
* model: creates an application model from the opened directory.
* stat: prints out some statistics coming from orizon engines
* crawl: performs a code crawling
* set option [value]: sets the option telling orizon how to behave
valid option are:
+ mirage [trace|notrace]: trace and notrace to put the engine in
trace or in no trace mode.
+ quiet: says orizon to run quietly
+ store_output: says orizon not to use standard output to
print informations (valuable only for development team)
+ orl_root directory: specifies an alternative root for security
library overriding lib/orizon-library-1.19.jar
+ report_format [txt|html|xml|console]: specifies the output
format. Using console, output onto disk
will be disabled.
+ report_name filename: write report in filename, stored in the
directory you launch osh from.
* report: prints out the findings report
* version: prints the version number
* info: prints the version number and the available engines signature