path

Path for image file in Eclipse src folder, on a Mac

天大地大妈咪最大 提交于 2019-12-13 04:30:02
问题 I'm trying to load an image file. File imageCheck = new File("Users/me/Documents/workspace/ChineseChess/src/RCar.gif"); if (imageCheck.exists()) System.out.println("Image file found!"); else System.out.println("Image file not found! :("); button.setIcon(new ImageIcon("Users/me/Documents/workspace/ChineseChess/src/RCar.gif")); Should I put RCar.gif in the src or bin folder of an eclipse project? How would I refer to it without the explicit path? (I'm using a mac. I believe it should be

Importing another module from another subdirectory of the current directory's parent directory (python)

眉间皱痕 提交于 2019-12-13 04:28:54
问题 I'm attempting to write a game. I therefore have lots of different types of code and want to arrange them in a useful hierarchy. I've looked at solutions that involve placing __init__.py in each folder but I'm still somewhat confused, though not as much as the python interpreter. Now suppose resource1.py wants to import a function from physics1.py , or indeed any other .py file in the Game directory, how would I go about doing so? I've tried from bin.physics.physics1 import function but

Asp.NET / VB.NET: Getting the path from the URL / URI?

ε祈祈猫儿з 提交于 2019-12-13 04:15:59
问题 Say I have a project that I am deploying at www.foo.com/path1/default.aspx and www.foo.com/path2/default.aspx What would be the most reliable way to know if I was in the folder "path1", or "path2"? Can I grab that directly, or do I need to split() somehow on the Request.Url.AbsolutePath, or... ? I just want to change colors, etc. based on which folder the user is in. Thanks for any assistance! 回答1: If you want to code that logic directly into the page, then yeah, I'd go with split() on

use lib relative path not working

最后都变了- 提交于 2019-12-13 04:13:44
问题 I have a perl script #!/usr/bin/perl use strict; use lib 'lib'; use SOME_MOD; that works on my old server. On the new server, it only works with absolute path, like #!/usr/bin/perl use strict; use lib '/var/www/apps/myapp/lib'; use SOME_MOD; What do i miss? 回答1: The directories in @INC is always relative the current working directory, but some web servers set the cwd to / . If you want a patch relative to the directory in which the script resides, you can use use FindBin qw( $RealBin ); use

Finding the right Path

三世轮回 提交于 2019-12-13 04:01:29
问题 I want to generate a PDF with Apache PDFBox and put it under docs/file1.pdf . The folder docs is already created, but I don't know how to access it from Java. My project structure looks like this: build nbprojects docs src <-- this is where the generated files belong java generator generator.java <-- this is where the files are being generated [some other folders] When I try: System.getProperty("user.dir"); I get (I'm on Linux): /home/user1/.netbeans/9.0/config/GF_5.0/domain1/config My guess

WPF Dispay image from relative location

放肆的年华 提交于 2019-12-13 03:59:19
问题 I would like to display an image on my dialog which could be located in a directory relative to the one the .exe is located in, e.g. project - data -- logo //<-- that's where the image is located -bin //<-- that's where the .exe is in A default image should be included in the .exe but on displaying the dialog, the \data\logo directory should be checked first and if an image with the given filename could be found there that one should be used for display instead of the one that is inside the

Paths for images using Apache with Windows

北慕城南 提交于 2019-12-13 03:54:20
问题 I have a problem with links testing locally using Apache with Windows. The final links have the following format: file:///C:/Documents and Settings/USUARIO/My Documents/xampp/htdocs/my_website/images/january/my_image.jpg The images do not show. However, if I directly copy the src from the img tag and paste it into the browser (Firefox), the image shows up. I generate the links using the following code: I define the images directory using: define(IMAGE_DIR, dirname(__FILE__).'/images/'); Then

Path to Android folder with all images

坚强是说给别人听的谎言 提交于 2019-12-13 03:53:49
问题 I'm trying to build a feature to load the latest saved image from the device into an app. Currently I'm using this path DCIM/Camera/ but it only stores camera taken images. Is there a folder that stores all images? (screenshots, images saved from the web or camera roll) 回答1: Instead of searching in in folders for the images, you can let the system take care of that for you. Android indexes most media-data (images, music, etc) on it's own and offers Content Providers to query these databases.

Report folders which have a specific subfolder

99封情书 提交于 2019-12-13 03:48:26
问题 I am building a script which I use to deploy files to multiple specific folders. The destination folders are collected using this part. $destinations = Get-ChildItem "C:\this\is\*\my\path\" So my script replaces only if the folder has the subfolders "\my\path\" If I now check my variable it will return the fullpathes but I only need the folder name. I tried using select -path to show at least only the path but it returned as well the length, mode etc. my goal is to return only values like

Visual Studio 2008 (C++) additional directories for debugging?

扶醉桌前 提交于 2019-12-13 03:43:17
问题 In prior versions of Visual Studio one could specify paths for DLL files when debugging an application. I do not see a way to do this in version (2008). Is this due to the move toward deployment of applications with all DLL files, etc. in the application's directory(ies)? Am I missing something, or is there no way to do this? It was in Visual C++ 6. I think it was menu Tools -> Options -> Directories -> executable files. Perhaps now this was not what I thought it was - this may be the same as