path

Wpf - relative image source path

此生再无相见时 提交于 2019-12-17 09:49:15
问题 I'm having problems setting the source for images in my Wpf application. I have an Image where the source is bound to the SourceUri property of the DataContext object, like this: <Image Source="{Binding SourceUri}"></Image> Now, I don't know what to set on the SourceUri property of my object. Setting the complete absolute path ("c:/etc/image.jpg") it displays nicely, but obviously I want to set the relative path instead. My images are stored in a folder Resources which is in the same folder

How to find an EXE's install location - the proper way?

点点圈 提交于 2019-12-17 09:48:50
问题 I am making a software in C# and MATLAB that calls another software (CMG) to do some processing. My problem is that the address of the software I have put in my program is only correct on my personal computer and not on the customers' computers (I don't know what would be the path to CMG software on their computer). How can I provide a general form of the address in order to make it work on every computer? The following is the path I call from my MATLAB software: C:\Program Files (x86)\CMG

How to change the path of Python in Spyder?

喜夏-厌秋 提交于 2019-12-17 09:33:20
问题 I'm using Debian. I installed Python 3.2.3. The path of Python 3 is /usr/bin/python3. How do I change it in Spyder? 回答1: Press CTRL+SHIFT+ALT+P to open the Preferences window. Within this window, select the Console item on the left, then the Advanced Settings tab. The path to the Python executable will be right there. 回答2: simple if your not able to change the working directory .Press CTRL+SHIFT+ALT+P to open the Preferences window then go to RUN then see the working directory options and

Python: import module from another directory at the same level in project hierarchy

◇◆丶佛笑我妖孽 提交于 2019-12-17 08:12:55
问题 I've seen all sorts of examples and other similar questions, but I can't seem to find an example that exactly matches my scenario. I feel like a total goon asking this because there are so many similar questions, but I just can't seem to get this working "correctly." Here is my project: user_management (package) | |------- __init__.py | |------- Modules/ | | | |----- __init__.py | |----- LDAPManager.py | |----- PasswordManager.py | |------- Scripts/ | | | |----- __init__.py | |-----

What is the difference between user variables and system variables?

风流意气都作罢 提交于 2019-12-17 08:02:14
问题 What is the difference between user variables such as PATH , TMP , etc. and system variables? I accidentally deleted the user variable PATH . What am I supposed to do? 回答1: Right-click My Computer and go to Properties->Advanced->Environmental Variables... What's above are user variables, and below are system variables. The elements are combined when creating the environment for an application. System variables are shared for all users, but user variables are only for your account/profile. If

Read file from /src/main/resources/

一世执手 提交于 2019-12-17 07:50:55
问题 I am trying to do a web application and have a problem: I don't know how to open a text file with Java that is saved in the resource folder: String relativeWebPath ="/src/main/resources/words.txt"; //Import der des Textdoumentes String absoluteDiskPath = getServletContext().getRealPath(relativeWebPath); File f = new File(absoluteDiskPath); (The file words.txt) As you can see on the image I am trying to access words.txt but it isn't working. Any ideas? 回答1: Try this. InputStream is = getClass(

Read file from /src/main/resources/

Deadly 提交于 2019-12-17 07:50:21
问题 I am trying to do a web application and have a problem: I don't know how to open a text file with Java that is saved in the resource folder: String relativeWebPath ="/src/main/resources/words.txt"; //Import der des Textdoumentes String absoluteDiskPath = getServletContext().getRealPath(relativeWebPath); File f = new File(absoluteDiskPath); (The file words.txt) As you can see on the image I am trying to access words.txt but it isn't working. Any ideas? 回答1: Try this. InputStream is = getClass(

How do I add paths to the Apache PATH variable?

三世轮回 提交于 2019-12-17 07:38:25
问题 I've set in my custom.conf file in apache2 this: SetEnv PATH $PATH:/opt/local/lib/mysql5/bin:/this-is-a-test However it's not working. When I call: $hey = shell_exec('env'." 2>&1"); var_dump($hey); I get: ... PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/opt/local/bin Can anyone help? I'm on Mac using Macports for my development environment. Thanks! 回答1: That seems awfully strange to me that you are trying to set the PATH

Get location of JAR file

坚强是说给别人听的谎言 提交于 2019-12-17 07:31:18
问题 I'm trying to get the location a Runnable JAR file is run from. I tried doing try { String path = new java.io.File(".").getCanonicalPath(); } catch (IOException e) { e.printStackTrace(); } But that returns: C:\Users\Kevin\Desktop/server/Server while the JAR file is located at C:\Users\Kevin\Desktop I also tried doing return new file(Server.class.getProtectionDomain().getCodeSource().getLocation().getPath()); But that returns: C:\Users\Kevin\Desktop\server.jar/server/Server So basicly I want

Can I apply a gradient along an SVG path?

我与影子孤独终老i 提交于 2019-12-17 07:28:02
问题 I'd like to put a simple loading indicator on my website that's triggered by a script. It should be a simple circle arc that's got a gradient and is spinning while the user is waiting. I haven't tried the animation part, but got stuck on the static styling for now. Here's what I've got so far: <svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" width="100" height="100"> <defs> <linearGradient id="grad1"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color=