In TinyLog what is the platform independent format character for new line in tinylog.properties - tinylog

In tinylog.properties what do you you specify as the platform independant character for new line ?

In tinylog.properties, you can use Unix like new lines \n or Windows like new lines \r\n. Both should work platform independently on all common JVMs and Android devices.
However, you cannot change the line separator for log files via tinylog.properties. The default line separator can only be changed for the entire JVM via system properties. You can do it via your command line, e.g. java -jar MyApp.jar -Dline.separator=$'\n' on Linux.

Related

Run sha256sum (from Cygwin) on file with special character and blank (quoting does not work)

I have Cygwin installed in order to use Linux command line tools on Windows. I also added it to my PATH. In general, it works fine, but I observe this weird behavior:
I want to run sha256sum on the file C:\Users\s1504gl\Desktop\Täst .txt. Note the german Umlaut ä and the whitespace before the file extension. In order to avoid problems with paths, I always quote paths in command line calls, such as:
sha256sum "C:\Users\s1504gl\Desktop\Täst .txt"
However, PowerShell returns
/usr/bin/sha256sum: '"C:\Users\s1504gl\Desktop\T'$'\303\244''st .txt"': No such file or directory
When I rename the file to either Täst.txt or Test .txt, it works. So the combination of the special character ä and the whitespace seems to cause the problem. Exchanging double quotes by single quotes does not change anything in this case.
I am pretty sure it has to to with PowerShell since the example works without any problems on my Linux machine.
Is there some other way of escaping special characters and/or blanks that I do not know?
Run from Cygwin terminal
sha256sum "/cygdrive/C/Users/s1504gl/Desktop/Täst\ .txt"
In general Cygwin program do not accept Windows paths and works surely with POSIX path
I found the following workaround:
I create a temporary file from R, containing all the necessary commands and then run this tempfile using bash which is also included in Cygwin. This way, I escape from the problem occurring due to different encodings in Windows and the Linux tools from Cygwin.

Can I set the VS Code default EOL based on file type?

Working with .sh files on Windows causes issues when running them in Linux Docker containers if they have EOL of CRLF. Can I make VS Code always work with LF for specific file type such as .sh while still using CRLF for all others?
I only find "files.eol": "\r\n" in settings, but this is global.
I understand you can change this in the bottom toolbar on a per-file basis, but I would like this to be the default for all .sh files.
In your settings window, go to
Settings > Text Editor > Files > Eol option. You'll fine following available options there
- \n
- \r\n
- auto (default)
Here \n represents LF, \r\n represents CRLF, and auto use the operating system specific EL operator.
Select your option and save.
VS Code: version 1.13.3
You can use EditorConfig.
Install the editorconfig extension, and then add a .editorconfig file at the root of your project with this:
[*]
end_of_line = crlf
[*.{sh}]
end_of_line = lf
But as #axiac said, I would recommend to always use lf...
EDIT : I was a bit "premature" with this answer. But it now works as of v1.40. See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_40.md#fileseol-per-language
You can do this in vscode without an extension. You can make a language-specific setting:
In the command palette, search for "Configure language specific", select it and choose "shellscript" from the language options:
This will create the following in your settings:
"[shellscript]": {
},
Now add in whatever you want to apply to shellscript files only like (not all settings will work in there but most do):
"[shellscript]": {
"files.eol": "\n"
},
VERY, VERY IMPORTANT:
The end-of-line sequence is used for new files. For existing files,
the existing end-of-line sequence is always preserved. To change the
end-of-line sequence for an existing file, use the Change End Of Line
Sequence command.
from https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_40.md#fileseol-per-language

vmoptions classpath with non-ascii characters

I'm adding the following line -classpath/p ${installer:sys.userHome}/.comput/updates/latest.jar to the vmoption file. (Tried both options: via installer 'Add VM option' action and via launcher config).
Works pretty fine with ASCII user name (with spaces as well), but fails with non-ascii user names (I'm testing with Russian). The vmoption file looks fine to me: the path is correct and has the right encoding: CP 1251 for my case:
However the path passed to JVM seems to have incorrectly decoded characters: On the attached screen you may see the actual path passed to JVM (checked via YourKit) from Install4J launcher:
and you may also compare it with the screen when the non-ascii path is passed via command prompt:
The only workaround I have found is to substitute the path with 8.3 Windows path, but converting to it on pure Java seems very error prone to me.
Appeciate your help very much!

What is the name of this style of configuration file?

What is the name of this type of configuration file, where sections are noted in square brackets and parameters are specfied with name/value pairs?
[section1]
n = 1
[section2]
s = foo
That's the format for an old-style .INI file. From the article:
In MS-DOS and 16-bit Windows platforms up through Windows ME, the INI file served as the primary mechanism to configure operating system and installed applications features, such as device drivers, fonts, startup launchers, and things that needed to be initialized in booting Windows. INI files were also generally used by applications to store their individual settings.

Cannot open iReports 6

i tried installing the latest version of iReport. installation was successful but now while opening it is giving me error. the Slash screen opens and closes.
error :
my config file :
# ${HOME} will be replaced by user home directory according to platform
default_userdir="${HOME}/.${APPNAME}/5.6.0"
default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/5.6.0"
# options used by the launcher by default, can be overridden by explicit
# command line switches
default_options="-J-Xms256m -J-Xmx512m -J-Dorg.netbeans.ProxyClassLoader.level=1000 -J-XX:MaxPermSize=512m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dnetbeans.exception.report.min.level=99999 "
# for development purposes you may wish to append: -J-Dnetbeans.logger.console=true -J-ea
# default location of JDK/JRE, can be overridden by using --jdkhome <dir> switch
#jdkhome="C:\Program Files (x86)\Java"
jdkhome="\jdk1.6.0_45"
# clusters' paths separated by path.separator (semicolon on Windows, colon on Unices)
#extra_clusters=
please help me
Look at this line
# default location of JDK/JRE, can be overridden by using --jdkhome <dir> switch
#jdkhome="C:\Program Files (x86)\Java"
jdkhome="\jdk1.6.0_45"
# clusters' paths separated by path.separator (semicolon on Windows, colon on Unices)
#extra_clusters=
What you need is to set an environement varialble JDK_HOME that points to the path of your JDK installation , or update your config file to point to the path where JDK installed
a) Once installed, go to its \etc folder, e.g., C:\Program Files (x86)\Jaspersoft\iReport-5.6.0\etc and add write permissions (for yourself) to the readonly file ireport.conf, of which you show an example output.
b) Open ireport.conf w/ an editor like Notepad++ , and add the line for your jdk home, e.g., jdkhome="C:\\Program Files\\Java\\jdk1.7.0_71" (instead of just jdkhome="\jdk1.6.0_45"). Note: on Win OS you might need to use the escaped backslash.