path

Java: getResource image, cannot be found.

白昼怎懂夜的黑 提交于 2019-12-13 08:14:52
问题 I just came up with an error in Java (using Eclipse). I want to load an image from the resource folder into the application. Using the follwoing lines: URL url = this.getClass().getClassLoader().getResource("/resources/images/icon.png"); BufferedImage i = ImageIO.read(url); But this results in a java.lang.IllegalArgumentException: input == null! exception. My folder structure is: How can I access this image? Thank you a lot! 回答1: getResource() returns null if it can't find the resource on the

gwt getting abosulte path on server side

£可爱£侵袭症+ 提交于 2019-12-13 08:02:06
问题 Iam trying since 1 hour to get the absolute path of a file ony server side: String path = request.getRequestURL(); JasperCompileManager.compileReportToFile(path+"/test.jrxml",path+"/test.jasper"); this didnt work my expection is : not found : http\12.0.0.13:8080]\test\test.jrxml wrong syntax in dataname...etc 回答1: Try this one in your RemoteServiceServlet class to get the absolute path of any resources placed under war directory that will be actually the path of server directory when deployed

clang on Windows - incorrect header file path

[亡魂溺海] 提交于 2019-12-13 07:42:19
问题 I built clang using VS2013 and then ran it from the command line with a -v option (clang -v testfile.c). Among the things it reported was: #include <...> search starts here: C:\Program Files (stand-alone)\LLVM\bin..\lib\clang\3.7.0\include C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include I don't understand why it is even looking at the Microsoft headers in the first place. I do not have an environment variable named INCLUDE. I verified this by doing "set INCLUDE" from the

Data parsing issue at android while using Flow path to create the same screen again

北城余情 提交于 2019-12-13 07:20:41
问题 I am playing around with square up android Motor & Flow library . I tried to pass the data from Screen A to Screen B and I am able to successfully retrieve data at Screen B . The problem araise while I try to call Screen B from Screen B (Re creation of same screen again). Screen A @Override public Object createComponent(MainActivity.Component parent) { return DaggerScreenA_Component.builder().component(parent).fingerPrintModule(new FingerPrintModule()).moduleDependencies(new

Powershell - listing folders in mulitple places and changing files in those places

旧城冷巷雨未停 提交于 2019-12-13 06:25:26
问题 I'm trying to set up a script designed to change a bit over 100 placeholders in probably some 50 files. In general I got a list of possible placeholders, and their values. I got some applications that have exe.config files as well as ini files. These applications are stored in c:\programfiles(x86)\ and in d:\In general I managed to make it work with one path, but not with two. I could easily write the code to replace twice, but that leaves me with a lot of messy code and would be harder for

recursive implementation of Depth first search to find path from source to destination in Java

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 06:13:10
问题 I have this working code for finding path between source to destination non-recursively. I would like to implement recursively, but I am having difficulty in how to do it. This is my code for non-recursive implementation public boolean depthFirstSearch(String name1, String name2){ Vertex source = vertexMap.get(name1); Vertex dest = vertexMap.get(name2); clearAll(); Stack<Vertex> stack = new Stack<Vertex>(); source.setVisited(true); stack.push(source); while(!stack.isEmpty()){ source = stack

WAMP showing absolute path when echoing dirname(__FILE__)

本秂侑毒 提交于 2019-12-13 06:02:30
问题 I did this: echo dirname(____FILE____) and it keeps showing as full absolute path as C:/Program Files (x86)/VertrigoServ/www/dir/file.php Why is that? I expect it to show dir/file.php I am using WAMP which is Apache on Windows. BTW, calling $_SERVER['DOCUMENT_ROOT'] does the same thing - it shows full path. 回答1: Try: $webPath = str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', __FILE__)); It'll take the absolute path to the file and remove the document root portion of it which

How to give a relative path in Java for database

限于喜欢 提交于 2019-12-13 05:54:46
问题 I want ask how to give a relative path in java for a database(ms access) so that when I put my project in other drive then I don't have to edit the path section. Given below is the absolute path for the database: con=DriverManager.getConnection( "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};**DBQ=c:\\project\\a.mdb"** ); But if I change my project to another folder, suppose d: then I have to edit this path section like this: con=DriverManager.getConnection( "jdbc:odbc:Driver={Microsoft

How to parse a folder path with spaces in C code

和自甴很熟 提交于 2019-12-13 05:31:29
问题 I'm using this simple C code: char * command = NULL; sprintf (command, "ls %s", folderpath); system(command); The problem is when the folder name has a space in it... I know that in Unix I need to add a "\", for example ls my\ folder\ name How can I get around this ? Thank you! 回答1: Simple way out is to put the folder name inside single quotes - sprintf( command, "ls '%s'", folder ); . Watch out for command injection as @ndim reminds us. 回答2: Use fork() and exec*() instead. 回答3: If your

Starting 7zip from QProcess gives error “cannot find archive”

时间秒杀一切 提交于 2019-12-13 04:47:38
问题 i am working on an application made with Qt5 that downloads a .zip-file to a temporary directory and extracts the .zip-file to a specified directory. I already managed to download the .zip-file and now I'm trying to extract it using 7zip. I use QProcess to start 7Zip. Here the file structure of my Qt-build-kit-thingy: build-ExtractTest-Desktop_Qt_5_3_MSVC2013_64bit-Debug 7za.exe build ExtractTest.exe Here is the code I use for starting the Process: // assemble extraction command QString