Botium- Scripting Memory - robotium

Parameters define by SCRIPTING_MEMORY were not recognize during test execution
I have set the "Hide advanced Scripting setting" :
text matching mode :none
normalize texte:disable
expend conversation : enable
convo Expansion mode : use all utterances
Expand Utterances to Conversations:disable
Enable Scripting Memory : enable
Scripting Memory mode : Capture word characters only
Expand Scripting Memory : enable
code:
"#begin
SET_SCRIPTING_MEMORY name|Test1
"#me
$name
screenshot :
$name Variable is not replace by its value.
Parameters $name is recognize as text instead of recognize as variable.
Which parameters I have to change so that botium recognize its?

Related

Kotlin prints non-English characters as question marks

I am trying to print Hebrew characters from a Kotlin program (running on the console).
All the Hebrew characters are being output as question marks.
I created the following simple test.kts script file for testing:
println("שלום מקוטלין")
// Try to print a simple non-Hebrew character too
println("\u0394") // Greek Delta
The file is properly saved in UTF-8 format.
It prints:
???? ???????
?
I tried running it in Command Prompt, PowerShell (both in its native window and in Windows Terminal), and Git Bash, all of which give the same result. I also tried redirecting the output to a file to rule out display issues in the shells.
To make sure the problem isn't the console itself, I also made simple test.bat, test.ps1, and test.sh files with the following content:
echo "שלום מקוטלין"
All three shells correctly displayed the Hebrew text here, indicating that the problem is in Kotlin's output, not in the shell display. (Though PowerShell requires the file to be saved "UTF-8 with BOM" to display properly, this can't be the issue with Kotlin since Kotlin won't even run a script that is saved with a BOM.)
As far as I can tell, Kotlin should support UTF-8 output by default with no configuration needed.
How can I get the proper output?
Updates:
If I write the output to a file using java.io.File("out.txt").writeText("שלום מקוטלין"), it works properly.
Also, if I open a new PrintStream using val out = java.io.PrintStream(System.out, true, "UTF-8") and then write to it using out.println("שלום מקוטלין"), that works properly too.
Only writing to the console with println is broken.
System info:
Windows 10 2004 (Build 19041.450)
Kotlin 1.4.0 (downloaded from GitHub Releases)
Tested with JAVA_HOME pointing to both JRE 1.8.0_261 (Oracle) and 11.0.2 (Oracle OpenJDK).
(Update at bottom)
Partial answer, but was able to get some Hebrew characters in the console in both Kotlin and Java. Was verry painful. Included some commented out stuff to show you some other things I may have tried if you run into any other hurdles.
Saved Tester.kt as UTF-8 with Notepad.
fun main(args : Array<String>) {
System.setProperty("file.encoding", "UTF8")
//val charset = Charsets.UTF_8
//val byteArray = "שלום מקוטלין".toByteArray(charset)
//System.out.printf("%c",byteArray.toString(charset))
//System.out.println(Charset.defaultCharset())
System.out.println("ל")
}
kotlinc.bat .\Tester.kt -include-runtime -d Tester.jar
Now, this leads to another mess, which I discovered by trying to copy and paste Hebrew characters to Powershell/Cmd. When copying, the ? marks showed right off the bat. Dug around a little bit, seems Powershell ISE is better suited for this (reference below). Without any plugins, copy and pasted successfully. Then had to run this:
PS> [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
Because on my system, running the following showed:
PS> [Console]::OutputEncoding
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : True
CodePage : 1252
Then,
java -jar -D"file.encoding=UTF-8" tester.jar
and voila, a single Lamedh
ל
Also, the Java route, which may or may not bring more insights:
Tester.java saved as UTF-8 with Notepad, imports redundant, yes, but shows some standout imports
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import static java.nio.charset.StandardCharsets.*;
import java.nio.*;
public class Tester{
public static void main(String[] args){
String str1 = "שלום מקוטלין";
byte[] ptext = str1.getBytes(UTF_8);
String value = new String(ptext, UTF_8);
ByteBuffer byteBuffer = StandardCharsets.UTF_8.encode("ש");
System.out.println(Charset.defaultCharset());
System.out.println("שלום מקוטלין");
System.out.println(value);
System.out.print(byteBuffer.getChar());
System.out.printf("Value: %s",value);
}
}
javac would give:
javac .\Tester.java
.\Tester.java:8: error: unmappable character (0x9D) for encoding windows-1252
System.out.println("╫⌐╫£╫ò╫? ╫₧╫º╫ò╫ÿ╫£╫Ö╫ƒ");
So
javac -encoding UTF-8 .\Tester.java
and voila again, PS ISE only:
PS> java -D"file.encoding=UFT-8" Tester
UTF-8
שלום מקוטלין
שלום מקוטלין
힩Value: שלום מקוטלין
I think this shows there are several hurdles, but it can work with Kotlin, and with println after making sure the file is correct, running the file the right way, and the output is correct. Hebrew may be particularly difficult due to the right-to-left nature, other characters like Greek were easier I think.
No matter what, I feel your pain, good luck. From what I read, there may be other bottlenecks like sending Hebrew over a network. This opened my eyes to several things, will continue to learn about this myself.
(Update)
Using the second link in the reference actually provided before, you can make two small changes and get Hebrew in Powershell (not just ISE)!!
PS> $OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
Then,
Font: Courier New
References:
https://markw.dev/unicode_powershell/
Displaying Unicode in Powershell
https://community.idera.com/database-tools/powershell/ask_the_experts/f/learn_powershell_from_don_jones-24/11793/add-hebrew-to-powershell
https://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html
I want to display Greek unicode characters but i get "?" instead on ouput
Encode String to UTF-8

How to set default params for xz archiver?

By default xz compressor uses single thread (eg. to compress newly created packages from AUR). There's a --threads option for using more threads.
Where can I set global settings for xz so that threads option is set to my value? Could'nt find any info in man.
The man page does talk about the use of environment variables for this purpose:
ENVIRONMENT
xz parses space-separated lists of options from the environment variables XZ_DEFAULTS
and XZ_OPT, in this order, before parsing the options from the command line. Note
that only options are parsed from the environment variables; all non-options are
silently ignored. Parsing is done with getopt_long(3) which is used also for the
command line arguments.
XZ_DEFAULTS
User-specific or system-wide default options. Typically this is set in a
shell initialization script to enable xz's memory usage limiter by default.
Excluding shell initialization scripts and similar special cases, scripts must
never set or unset XZ_DEFAULTS.
XZ_OPT This is for passing options to xz when it is not possible to set the options
directly on the xz command line. This is the case e.g. when xz is run by a
script or tool, e.g. GNU tar(1):
XZ_OPT=-2v tar caf foo.tar.xz foo
Scripts may use XZ_OPT e.g. to set script-specific default compression op‐
tions. It is still recommended to allow users to override XZ_OPT if that is
reasonable, e.g. in sh(1) scripts one may use something like this:
XZ_OPT=${XZ_OPT-"-7e"}
export XZ_OPT
It looks like XZ_DEFAULTS will do what you want.

Change Integrated Terminal title in vscode

We can open command prompt in vscode by using the Integrated Terminal feature in View menu.
We can even open multiple terminals as shown below:
Is there any way I can change the title of the terminal ?
1: cmd.exe will be build terminal
2: cmd.exe will be watch terminal
I have gone through the integrated terminal documentation but I didn't find a way to do that.
Press in windows Ctrl + Shift + P and after type: Terminal: Rename, there you can change the terminal name/title
In v1.61 there is the ability to set the terminal names using variables. See terminal custom titles in release notes.
Terminal names are traditonally the name of the process they're
associated with. Thus, it can be difficult to distinguish between
them.
We now support configuring both title and description to help with
this using variables described in terminal.integrated.tabs.title and
terminal.integrated.tabs.description settings.
The current default values are:
{
"terminal.integrated.tabs.title": "${process}",
"terminal.integrated.tabs.description": "${task}${separator}${local}${separator}${cwdFolder}"
}
Variables available are:
${cwd} - The terminal's current working directory
${cwdFolder} - The terminal's current working directory.
${workspaceFolder} - The workspace in which the terminal was launched.
${local} - Indicates a local terminal in a remote workspace.
${process} - The name of the terminal process.
${separator} - A conditional separator (" - ") that only shows when surrounded by variables with values or static text.
${sequence} - The name provided to xterm.js by the process.
${task} - Indicates this terminal is associated with a task.
It looks like the ${task} variable is what you are looking for.
Sometimes, plugins will remove default keyboard shortcut bindings.
Look for "terminal.rename" in keyboard shortcuts then edit the keyboard shortcut to your preferred shortcut.
To apply your shortcut, make sure your cursor is focus in edit part of the window before you key in. Not at the terminal part.
In v1.41 there is a new command which can be used like so:
{
"key": "ctrl+t",
"command": "workbench.action.terminal.renameWithArg",
"args": {
"name": "remote"
}
}
if you have some frequently used name, like "remote" or "build" that you use often.
With VSCode 1.63 (Nov. 2021), entering "<blank>" (ie., empty string) as name will restore the default name for that terminal.
See issue 134020
For instance:
If my setting is ${cwd}${separator}${process} and I name a terminal "foo".
How do I reset "foo" back to the value of ${cwd}${separator}${process}?
My suggestion was that if you attempted to submit a blank name that would automatically reset to the value of your setting.

Can FlyCheck be used with Komodo(for Django) for checking syntax on the fly?

I want to use Komodo IDE for building one Django project.I want to use flycheck syntax checker so that it indicates the syntax errors on the fly.If fly-check cannot be integrated with Komodo,is there any other possibility to syntax checking on the fly?
Use the following process:
Goto Toolbox=>Add=>New Command
Enter the emacs command line arguments in the Run field:
emacs eval('(progn
(flycheck-declare-checker go-gofmt
"A Go syntax and style checker using the gofmt utility."
:command '("gofmt" source-inplace)
:error-patterns '(("^\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): \\(?4:.*\\)$" error))
:modes 'go-mode)
(add-to-list 'flycheck-checkers 'go-gofmt)))
Check all the boxes
Enter the path to emacs in the Start In field
Click the Key Binding tab
Use Ctrl+0 as the New Key Sequence
Press Ctrl+A,Ctrl+0
References
Komodo Documentation: Run Commands
Emacs Wiki: Flycheck

FORTRAN input from mouse

What is the FORTRAN input statement (e.g., READ statement, or OPEN statement) to accept input from a mouse? For example, in Windows explorer, it is possible to right-click on a file and then select a FORTRAN executable from the menu that appears. How do I make such a FORTRAN program capture whatever the mouse sends (e.g., capture the name of the file, or whatever the mouse transmits)? Information out there about FORTRAN input seems restricted to input from a file or the keyboard. I cannot find anything about input from a mouse.
I've made progress on my own and, for those interested, here it is:
Firstly, the "fortran standard" does not directly support input from a mouse. But Windows Explorer can be made to pipe a file name into a fortran executable nevetheless.
Under Windows, the right-click generates the full \path\filename as a command line argument. That information can be captured by a fortran using "get_command_argument", as follows:
PROGRAM get_filename
CHARACTER(len=100) :: arg
CHARACTER(len=2000) :: filename
filename = ''
! NB: spaces in a file name define separate arguments, so re-assemble the file name as it comes in
i = 1
DO
CALL get_command_argument(i, arg)
IF (LEN_TRIM(arg) == 0) EXIT
filename = TRIM(filename)//' '//TRIM(arg) ! putting the spaces back in
i = i+1
END DO
WRITE (*,*) 'file= ',TRIM(filename)
read(*,*)
END PROGRAM
A link to the executable can be placed in the Windows right-click menu, as explained here:
http://www.howtogeek.com/107965/how-to-add-any-application-shortcut-to-windows-explorers-context-menu/
You need to add "%1" to the name of the executable to make it accept command line arguments,
e.g., I called my executable "PW_copy.exe", and so the final registry entry was: \path\PW_copy.exe %1
It works!
Dragging the mouse across several files generates separate threads each with a different file name.