When I compile my java program in notepad++, it first displays few lines before displaying the results. Is there any setting to suppress (first 7 lines and last 2 lines) lines? I only want to display my results.
NPP_EXEC: "java-run"
SET: JAVADIR = "C:\Program Files\Java\jdk1.8.0_121\bin\java"
$(JAVADIR) = "C:\Program Files\Java\jdk1.8.0_121\bin\java"
CD: C:\Users\****\Documents\JAVA\Hello
Current directory: C:\Users\******\Documents\JAVA\Hello
"C:\Program Files\Java\jdk1.8.0_121\bin\java" TestArray
Process started >>>
1.9
2.9
3.4
3.5
Total is 11.7
Max is 3.5
<<< Process finished. (Exit code 0)
================ READY ================
Related
This is a tricky problem because it deals with the Pythonwin.exe user interface itself, and not my code.
When I run a file with the following code in it, I would expect that if it errors, it would show the line that it failed on in the traceback output
I literally just create an untainted 32-bit python 3.5 environment, installed pywin32, and opened my testfile.py to run it and here were the results.
Screenshot
If you see the line saying
File "C:\testfile.py", line 2, in <module>
foo = 2 #this line works fine, but is identified as the traceback line
I would have expected this to point to line 5 and not line 2.
Inside a larger script, this is much more problematic as I need to guess which line caused the error based on the context.
To replicate my situation in an anaconda-based environment:
1. open the Anaconda Command Prompt
2. run the following lines to generate our environment
set CONDA_FORCE_32BIT=1
conda create -n test python=3.5
activate test
conda install -y pywin32
Save "testfile.py" file with text:
#comment
foo = 2 #this line works fine, but is identified as the traceback line
a=2
a=3
a=b #this line causes the error, but isn't identified
Open PythonWin.exe, open the "testfile.py" file and hit F5 or click Run
And it is not just an issue in anaconda installed environments.
If anyone has any insight into how to make it report the bad line of code, or why it is acting in this way, please let me know. Thanks!
When I call Rscript.exe for Version 3.5 of R, it is unable to open the file if the file name or path has a space in it. I saved 2 files with the code:
cat("What do you get when you multiply 6 * 9?")
as C:\foo bar.R and as C:\foo_bar.R
When I in a DOS command window try to run these using version 3.4.3 and 3.5:
C:\>"C:\Program Files\R\R-3.4.3\bin\x64\Rscript.exe" "C:\foo bar.R"
What do you get when you multiply 6 * 9?
C:\>"C:\Program Files\R\R-3.4.3\bin\x64\Rscript.exe" "C:\foo_bar.R"
What do you get when you multiply 6 * 9?
C:\>"C:\Program Files\R\R-3.5.0\bin\x64\Rscript.exe" "C:\foo bar.R"
Fatal error: cannot open file 'C:\foo': No such file or directory
C:\>"C:\Program Files\R\R-3.5.0\bin\x64\Rscript.exe" "C:\foo_bar.R"
What do you get when you multiply 6 * 9?
C:\>
When I try to run the file with a space in the name in version 3.5.0 of R, there is a fatal error saying there is no such file.
Thanks Edward Carney, I emailed the address you listed, and got a response from Tomas confirming it is a bug, and providing a workaround until it is fixed:
A quick workaround before this gets fixed is to add an extra first argument that has no space in it, e.g.
Rscript --vanilla "foo bar.R"
The problem exists on all systems, not just Windows.
This has now been corrected in the Development version, and there is a binary build for Windows at:
https://cran.r-project.org/bin/windows/base/rdevel.html
It has also been corrected in the patched version, and there is a binary build for Windows at:
https://cran.r-project.org/bin/windows/base/rpatched.html
If I run my tests using PHP7.2 or PHP7.1 they are about 3x slower than if I run them using PHP7.0. Is there anyway to get to the bottom of why this is happening?
Even when I run the test suites (Feature & Unit) separately I still see the slow down. It's only when I run the tests individually does the speed difference become insignificant.
I'm using Laravel 5.5.20 and Laravel Homestead 7.0.1. I have 47 rather simple tests, some hitting the database, others just simple assertions; so there isn't anything that should take ages.
I installed johnkary/phpunit-speedtrap to see which tests take the longest so I could remove those but there isn't a specific test that takes a long time because if I remove the offending test, the next one will take ages (see below).
First Run Second Run
Test A 0.2 sec Test A 0.2 sec
Test B. 0.3 sec Test B. 0.3 sec
Test C 0.1 sec Test C 0.1 sec
Test D 0.1 sec Test D 0.1 sec
Test E 9.3 sec REMOVED Test E
Test F 0.3 sec Test F 9.3 sec <-- Test F now takes ages
Test G 0.2 sec Test G 0.2 sec
I am also using an in-memory SQLite3 database, with the Laravel CreatesApplication and RefreshDatabase trait as I want each test to run independently.
I do not have Xdebug installed or running. Is there something known that PHP7.1 and PHP7.2 take a long time to run PHPUnit tests? Is there something else I can install (or even run it with Xdebug) to track down what exactly it is that is causing the issue?
Setup
Laravel 5.5.20
Laravel Homestead 7.0.1 (Per-project installation)
PHPUnit 6.4.4
Vagrant 2.0.1
Virtualbox 5.2.4
Results
PHP 7.2 PHPUnit 6.4.4
Time: 12.4 seconds, Memory: 162.00MB
PHP 7.1 PHPUnit 6.4.4
Time: 12.19 seconds, Memory: 162.00MB
PHP 7.0 PHPUnit 6.4.4
Time: 4.88 seconds, Memory: 162.00MB
I had the same issue as you but with XDebug installed. I found a pretty good hint by a user named Roni on Laracasts (I can't find the link anymore, sorry) which says to run tests with the -n flag of the php command, like this: php -n vendor/bin/phpunit.
According to the documentation at php.net (command line options) this is for running the command without what php.ini is defining. Which means no includes of extensions.
-n No php.ini file will be used
So, for me it runs tests in a minute now, not in 15 minutes. The problem is kind of strange, because it began with php 7.2 on my machine but others in my team don't have the issue, despite the fact that xdebug is installed. I wonder what really is behind this issue.
I install quantum espresso 6.2 and use cygwin.
I run example01 to test quantum espresso, which calculate energy and band structure for Si, Al, Cu and Ni. I get an error message as follows:
running the scf calculation for Si...from test_input_xml: input file not opened or empty
At line 1999 of file read_namelists.f90 (unit = 9, file = 'input_tmp.in')
Fortran runtime error: End of file
Error termination. Backtrace:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
from test_input_xml: input file not opened or empty
At line 1999 of file read_namelists.f90 (unit = 9, file = 'input_tmp.in')
Fortran runtime error: End of file
Could you help me to overcome this problem ?
What is PARA_PREFIX in your environment_variables file set to?
Try running with
PARA_PREFIX=" "
or if you have MPI you can try
PARA_PREFIX=" mpirun -np 1 "
Most tests and examples are meant to be run serially.
I am trying to make a GIF-animation in R. I have an array of matrices which i wish to convert into a GIF animation. My strategy is inspired from this example:
http://ryouready.wordpress.com/2010/11/21/animate-gif-images-in-r-imagemagick/
where the following code produces 11 PNG-Pictures with the "png"-function in R. Next it calls for the external ImageMagick-program "convert" to compile the GIF animation.
dir.create("examples")
setwd("examples")
# Animated countdown from 10 to "GO!".
png(file="example%02d.png", width=200, height=200)
for (i in c(10:1, "G0!")){
plot.new()
text(.5, .5, i, cex = 6)
}
dev.off()
# convert the .png files to one .gif file using ImageMagick.
system("convert -delay 80 *.png example_1.gif")
#shell("convert -delay 80 *.png example_1.gif")
The problem is that R doesn't seem to finde the exe-file "convert" which is a part of ImageMagick and installed on the C-drive (C:\Program Files\ImageMagick-6.8.5-Q16). In the comments to the website i am linking to earlier, it is suggested for Windows users to use "shell" instead of "system" to run external programs but none of the two work. The error message is
Invalid parameter - 80
Warning message:
running command 'convert -delay 80 *.png example_1.gif' had status 4
I've tried to change the Windows PATH enviroment variable in the systems properties, as suggested in this answer, but the PATH-variable was allready corectlly defined on my system. I also tried specifying the whole string of the convert.exe file, but also without luck...
How can i get ImageMagick to run through R?
Specs:
Windows 7 Servicepack 1,
R 3.0.0
Thanks in advance...
On Windows, there are several convert.exe commands, all of which are in the PATH. So you must specify the path to the right convert.exe executable. In my case, I had it in the LyX folder (however, you will find it in the ImageMagick installation too).
Be careful with the quotes, the backslashes and the spacing if you are pasting. E.g. from within R:
system('"C:\\Program Files (x86)\\LyX 2.0\\imagemagick\\convert.exe" -delay 20 -loop 0 files_*.png animation.gif')
I'm a windows 10 user, after defining the working directory I got it working in R using
shell("convert -set delay 80 -loop 0 *.jpg example_shell_test.gif")
within cmd each command means the following
convert = open convert function from ImageMagick
-set delay x = set the delay time between each frame to x (1000 = 1 second)
-loop 0 = loop forever, if set to 1 it will go through the images once
*.[image type]= and file of .[image type]
[name of output gif].gif = save new .gif as
I got it working first within command prompt by navigating to the directory and running the line
convert -set delay 80 -loop 0 *.jpg example_cmd_test.gif
Before this I was using
-delay = 80
rather than
-set delay 80
in cmd and got error:
convert: invalid argument for option '-delay': = # error/convert.c/ConvertImageCommand/1277.
In R using the system() command with the correct "-set delay x" I was getting error:
> system("convert -set delay = 80 -loop 0 *.jpg example_3.gif")
Invalid Parameter - delay
Warning message:
running command 'convert -set delay = 80 -loop 0 *.jpg example_3.gif' had status 4
other errors in shell()
> shell("convert -set delay = 80 -loop 0 *.jpg example_shell_test11.gif")
convert: unable to open image '80': No such file or directory # error/blob.c/OpenBlob/3094.
convert: no decode delegate for this image format `' # error/constitute.c/ReadImage/509.
Warning messages:
1: running command 'C:\WINDOWS\system32\cmd.exe /c convert -set delay = 80 -loop 0 *.jpg example_shell_test11.gif' had status 1
2: In shell("convert -set delay = 80 -loop 0 *.jpg example_shell_test11.gif") :
'convert -set delay = 80 -loop 0 *.jpg example_shell_test11.gif' execution failed with error code 1
I ran it in R with shell() after and it seems to work fine
shell("convert -set delay = 80 -loop 0 *.jpg example_shell_test.gif")
Do have a look at this thread also
ImageMagick - Issue with Windows and convert function
I know someone else already found the solution to your problem but there is an easier way to solve it without having to include the entire pathway in system(). Simply setani.options(convert = 'pathway/convert.exe')
after loading the animation package.
After attempting all of these fixes as well as these and these to no success, I used alternative software to make the conversion, several of which are described here. I am a Windows user and found the simple instructions contained in that site for VirtualDub quickly accomplished this task.