Do you know in Netbeans the method to import a clover.xml such as the method in PHPStorm with the Tools|Show code coverage ?
Thanks
Related
I'm trying to create a simple web app with Dart.
But I cannot import anything that is outside the current or in a sub directory. I'm using VSCODE
My project structure:
/chatapp
/web
/main.dart
/bin
/server.dart
/views
/view.dart
/chatsignin.dart
Now I can import view.dart in chatsignin.dart but cannot import view.dart to main.dart or bin/server.dart. Or any of the other file to any other file in a different directory.
I tried import with package name:
import 'package:chatapp/';
But it shows no subdirectories or files in VS Code
I tried pub get and restarted vscode multiple times but it doesn't work.
After reading the docs I found that all files and folders should be inside the web directory.
I'm embarrassed of myself doing such a silly mistake
I am attempting to python3 proof my work and spyder seems to be having an issue with absolute_import.
For demonstration purposes I created two simple files. caller and callme
caller
from __future__ import absolute_import
from .callme import helloWorld
def runme(msg):
helloWorld(msg)
if __name__ == "__main__":
runme('It worked!')
callme
def helloWorld(msg):
print("helloWorld's message is '{}'".format(msg))
if __name__ == "__main__":
helloWorld('Hi')
When attempting to run caller from spyder I get the following error:
ValueError: Attempted relative import in non-package
Running from ipython via the anaconda prompt (python 2) or from jupyter notebook (running python3 or python2) both work properly.
Ideas on how to fix spyder's behavior so it properly recognizes absolute_import?
Spyder versions tried:
3.2.4 Python 2.7.14 64bits, Qt 5.6.2, PyQt5 5.6 on Windows 10
3.3.2 Python 2.7.14 64-bit | Qt 5.6.2 | PyQt5 5.6 | Windows 10
Update
Updating spyder via conda update spyder (now version 3.3.2) did not fix the issue.
If you run python caller.py in a system terminal, you'll get exactly the same error as the one you posted, i.e.
ValueError: Attempted relative import in non-package
So this is not a problem with Spyder (because Spyder runs something similar to python caller.py when you execute a file with Run > Run), but with the way relative imports works.
Please see this answer for a proper explanation:
https://stackoverflow.com/a/11537218/438386
In essence, you can't use relative imports in scripts.
Note: There's a workaround to avoid this error, as described in this answer:
https://stackoverflow.com/a/11536794/438386
However, we don't have the ability to execute a script as a package in Spyder, sorry.
So I have a folder. Inside this folder is a jar file(twitter4j-core-4.04.jar) that my java file(Runner.java) imports and uses like so:
package twitter4j;
import twitter4j.Twitter;
import twitter4j.StatusUpdate;
import twitter4j.Status;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;
I have all the right code -- a properly formatted:
public class Runner
and a proper main function --
public static void main(String[] args)
I compiled Runner.java using the following command and it compiled without error or warning: javac -cp .:twitter4j-core-4.0.4.jar Runner.java
Yet, when I go to run the class file it produced(using: java Runner) I get the error listed in the title. This error also occurs if I run the java command with the cp flag(Ive looked everywhere and used every possible classpath to no avail)
how can I fix this?
You have to create a runnable .jar file including your code dependencies like twitter4j-core-4.0.4.jar and (possibly) others that this depends on. If you are not using Maven, your IDE probably is capable of generating this kind of .jar file for you.
You must specify the class with its package.
This command must be executed from outside of folder twitter4j:
java -cp blabla.jar twitter4j.Runner
Right Click on class > Run as > Run Configuration
remove main class reference
Apply > Close
Now again right click on class > run as java application.
It worked for me.
Greetings of the day !
I have a requirement to check the environment in grails project Java source package. Please help me.
I am trying to use this code, but not getting success.
String envName = System.getProperty(Environment.DEVELOPMENT);
Try this to get the current environment--
import grails.util.Environment;
...
Environment.getCurrent()
or test the environment --
Environment.getCurrent() == Environment.DEVELOPMENT
I am having an issue with a custom filter plugin, and importing a dependency. Can anyone please help me? I get "Trying to load the X filter plugin resulted in this error: no such file to load -- memcache". The code does "require 'memcache". This is available as if I do that in any other script and run it on the CLI, it works, just not when logstash runs it? Does it use some bundled ruby or smth with a different import path? Its 1.4.2 on Debian, if that matters. Driving me insane (Im not a ruby hacker, so im spinning my wheels a bit).