Intellij idea 2021.2 cannot render markdown table currently? - intellij-idea

I use idea 2021.2 and corresponding markdown plugin. But the simple table cannot display in previous mode:
Why? I found somebody has related the problem to the JavaFx, however, I think it is occured in old version idea. I cannot find javafx render option in my version.
How to solve it?

You are using the wrong Markdown syntax.
The following code works fine (minimum three - for table header)
| Column 1 | Column 2 |
| :--- | :--- |
| AAA | BBB |

Related

How to use regex and awk to detect and extract variable length and width text table?

In running some scripts that update WordPress, the output of the scripts is logged to a file. Here is a relevant portion of the log file:
Downloading update from https://downloads.wordpress.org/plugin/adrotate.5.8.15.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Downloading update from https://downloads.wordpress.org/plugin/cookie-notice.2.0.0.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Downloading update from https://downloads.wordpress.org/plugin/google-site-kit.1.25.0.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Disabling Maintenance mode...
+-----------------+-------------+-------------+---------+
| name | old_version | new_version | status |
+-----------------+-------------+-------------+---------+
| adrotate | 5.8.14 | 5.8.15 | Updated |
| cookie-notice | 1.3.2 | 2.0.0 | Updated |
| google-site-kit | 1.24.0 | 1.25.0 | Updated |
+-----------------+-------------+-------------+---------+
[32;1mSuccess:[0m Updated 3 of 3 plugins.
[32;1mSuccess:[0m Theme already updated.
What I want to do next is open, read, and extract a portion of that log file to write it to a separate file as-is. The critical piece I need is this table from the output above:
+-----------------+-------------+-------------+---------+
| name | old_version | new_version | status |
+-----------------+-------------+-------------+---------+
| adrotate | 5.8.14 | 5.8.15 | Updated |
| cookie-notice | 1.3.2 | 2.0.0 | Updated |
| google-site-kit | 1.24.0 | 1.25.0 | Updated |
+-----------------+-------------+-------------+---------+
So, what I'm doing is using
awk '/Disabling Maintenance mode...$/,/[32;1mSuccess:$/' logfile.txt
to attempt to grab that table. Unfortunately, with this awk command, I seem to also get the Disabling Maintenance mode... and [32;1mSuccess: parts along with it. And those strings aren't reliably consistent enough to use them as proper start/end markers for awk. The most accurate thing I can think of is the correct regex to grab just that table and nothing more.
The problem with the text-formatted table is that the length and width of it can vary depending on what the script is updating. The "name" column could have an item in it that's 50 characters long, for example, which makes the table wider. It could also have, like, 20 "rows". So I never know how many hyphens or pipe characters to count in regex or in some kind of loop.
I've tried various tutorials and also regex101.com to devise a pattern that will help me find this variable length/width pattern. But I'm making no progress. I'm not sure I know how to frame the problem correctly within regex syntax. All tutorials I'm reading are using "abc" and "xxx" as examples and this is so much more complex.
Can anyone help me figure out how to do this?
Maybe this is too simple?
awk 'bar == 3 {exit}; /--/ {bar++} bar ' logfile.txt
If you don't want the bars in the output:
awk 'bar == 3 {exit}; /--/ {bar++; next} bar' logfile.txt
With your shown samples please try following. Written and tested in GNU awk.
awk '
/^\[32;1mSuccess:/ { found="" }
/^Disabling Maintenance/{ found=1; next }
found
' Input_file
Explanation: Adding detailed explanation for above.
awk ' ##Starting awk program from here.
/^\[32;1mSuccess:/ { found="" } ##Checking if line starts from [32;1mSuccess: then unset found here.
/^Disabling Maintenance/{ found=1; next } ##Checking if line starts from Disabling Maintenance then set found to 1 here.
found ##checking condition if found is set(NOT NULL) then print that line.
' Input_file ##Mentioning Input_file name here.
I would use GNU AWK following way, let file.txt content be
Downloading update from https://downloads.wordpress.org/plugin/adrotate.5.8.15.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Downloading update from https://downloads.wordpress.org/plugin/cookie-notice.2.0.0.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Downloading update from https://downloads.wordpress.org/plugin/google-site-kit.1.25.0.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Disabling Maintenance mode...
+-----------------+-------------+-------------+---------+
| name | old_version | new_version | status |
+-----------------+-------------+-------------+---------+
| adrotate | 5.8.14 | 5.8.15 | Updated |
| cookie-notice | 1.3.2 | 2.0.0 | Updated |
| google-site-kit | 1.24.0 | 1.25.0 | Updated |
+-----------------+-------------+-------------+---------+
[32;1mSuccess:[0m Updated 3 of 3 plugins.
[32;1mSuccess:[0m Theme already updated.
then
awk '/^[+|].*[+|]$/' file.txt
output
+-----------------+-------------+-------------+---------+
| name | old_version | new_version | status |
+-----------------+-------------+-------------+---------+
| adrotate | 5.8.14 | 5.8.15 | Updated |
| cookie-notice | 1.3.2 | 2.0.0 | Updated |
| google-site-kit | 1.24.0 | 1.25.0 | Updated |
+-----------------+-------------+-------------+---------+
Explanation: print only lines which begin with one of: +| and end with one of: +|. Note that this might give false positives if you have any non-table lines starting with + or | and ending with + or |, so I suggest you run further test with your input data if you wish to use my solution.

Chrome Selenium IDE 3.4.5 extension "execute script" command not storing as variable

I am trying to create a random number generator:
Command | Tgt | Val |
store | tom | tester
store | dominic | envr
execute script | Math.floor(Math.random()*11111); | number
type | id=XXX | ${tester}.${dominic}.${number}
Expected result:
tom.dominic.0 <-- random number
Instead I get this:
tom.dominic.${number}
I looked thru all the resources and it seems the recent selenium update/version has changed the approach and I cannot find a solution.
I realize this question is 2 years old, but it's a fairly common one, so I'll answer it and see if there are other answers that address it.
If you want to assign the result of a script run by the "execute script" in Selenium IDE to a Selenium variable, you have to return the value from JavaScript. So instead of
execute script | Math.floor(Math.random()*11111); | number
you need
execute script | return Math.floor(Math.random()*11111); | number
Also, in your final assignment that puts the 3 pieces together, you needed ${envr} instead of ${dominic}.

postgres 9.5 create function plpthon3u resets connections to server

I have installed postgresql 9.5 on windows 10, x64.
I have created the extension plpython3u with python 3.3.5 on the server's path and it appeared to create the extension successfully:
SELECT * FROM pg_available_extensions
WHERE name like '%python%' order by name;
name | default_version | installed_version | comment
-------------------+-----------------+-------------------+------------------------------------------
-
hstore_plpython2u | 1.0 | | transform between hstore and plpython2u
hstore_plpython3u | 1.0 | | transform between hstore and plpython3u
hstore_plpythonu | 1.0 | | transform between hstore and plpythonu
ltree_plpython2u | 1.0 | | transform between ltree and plpython2u
ltree_plpython3u | 1.0 | | transform between ltree and plpython3u
ltree_plpythonu | 1.0 | | transform between ltree and plpythonu
plpython2u | 1.0 | | PL/Python2U untrusted procedural language
plpython3u | 1.0 | 1.0 | PL/Python3U untrusted procedural language
plpythonu | 1.0 | | PL/PythonU untrusted procedural language
(9 rows)
However when I attempt to create the following function (from the pg docs)
CREATE FUNCTION pymax (a integer, b integer)
RETURNS integer
AS $$
if a > b:
return a
return b
$$ LANGUAGE plpython3u;
the psql (or pgadmin3) terminal's connection is reset.
The python 3.3 on the path is anaconda's distb and runs fine on its own. I couldn't find the required version of python in the postgresql docs and used dependency walker as described here Postgres database crash when installing plpython to find the required dll that plpython3.dll in the server's lib/ points to.
Can anyone help me with what I have missed?
Many thanks
Looking more carefully at the installation download, I read the readme.txt. This clearly lays out how to include the language packs including plpython. No need to muck around with dependency walker or anything like that.
Following the clear and simple instructions in the readme.txt is all it took to get the plpython extension working fine. No excuse for not reading the readme. My bad.
I was not matching the required version of python. The bottom line is that postgresql does seem to be relatively sensitive to the particular distribution of python, not just version - (I had matched the versions postgres python distb 3.3.4 and anaconda 3.3.4.)
Specifically, setting the server's path to use the python installed along with the server, C:\EnterpriseDB\LanguagePack\9.5\x64\Python-3.3 in my case, was all that it took to get it working correctly.
Thanks go to Adrian Klaver on the pgsql-general mailing list for getting me sorted. This answer is just for future reference as I claim it is easy to miss the readme :-).

Get version of rich edit library

ALL,
Is it possible to get the version of the RichEdit control the program uses?
| Version | Class name | Library | Shipped with | New features
|------------|---------------|--------------|-----------------|
| 1.0 | "RICHEDIT" | Riched32.dll | Windows 95 |
| 2.0 | "RichEdit20W" | Riched20.dll | Windows 98 | ITextDocument
| 3.0 | "RichEdit20W" | Riched20.dll | Windows 2000 | ITextDocument2
| 3.1 | "RichEdit20W" | Riched20.dll | Server 2003 |
| 4.1 | "RICHEDIT50" | Msftedit.dll | Windows XP SP1 | tomApplyTmp
| 7.5 | "RICHEDIT50" | Msftedit.dll | Windows 8 | ITextDocument2 (new), ITextDocument2Old, Spell checking, Ink support, Office Math
| 8.5 | "RICHEDIT50" | Msftedit.dll | Windows 10 | LocaleName, more image formats
I know I can just have some variable and assign it appropriately if Msftedit.dll library is loaded or not. However if I do load RichEd20.dll, I can get either RichEdit 2 or RichEdit 3 implementation. And they are quite different. A lot of stuff were added in the latter.
If i did load Msftedit.dll, there are features that 7.5 that would not be available in earlier versions (e.g. automatic spell checking).
It's even possible that the same process can have all three DLLs loaded, and even using all three versions of RichEdit in the same process:
"RICHEDIT" → 1.0
"RichEdit20W" → 2.0, 3.0
"RICHEDIT50" → 4.1, 7.5, 8.5
Given a RichEdit control (e.g. WinForms RichTextBox, WPF RichTextBox, WinRT RichEditBox, VCL TRichEdit) is there a way to determine the version of a RichEdit control?
Or maybe I can somehow differentiate them by Windows version where it is available?
If using c++ you may find the following snippet useful to read out the class name :
TCHAR className[MAX_PATH];
GetClassName(GetRichEditCtrl().GetSafeHwnd(), className, _countof(className));
GetRichEditCtrl() is function on another control, you may need to substitute with whatever gives you a hwnd to the control.
Another method is using a tool like spy++ to inspect the class name.

"-" character is converted to ? in console for gherkin language used in cucumber feature file

I am using cucumber feature file to execute or write my test cases. Issue is that I am using data table as :
| abc | 1234567890 |
| defg | New Activation – Monthly (Credit in store) |
Now issue is this that console is throwing an error that :
Cannot locate element with text: New Activation ? Monthly (Credit in store).
I am not able to understand why ? is being displayed instead of "–" .