path

NODE.JS - how to handle a mix of OS and URL-style “paths” correctly?

北城余情 提交于 2020-01-14 07:59:09
问题 In my node.js app I have functions which can be passed either OS-style paths e.g. c:\my\docs\mydoc.doc (or /usr/docs/mydoc.doc or whatever is local) File URLS e.g. file://c:/my/docs/mydoc.doc (which I'm not sure about the validity of '\'s in??) Either way, I need to check to see if they refer to a specific location which will always exist as a local OS-style path e.g. c:\mydata\directory\ or /usr/mydata/directory Obviously for OS-style paths I can just compare them as strings - they SHOULD

How to add Maven to the Path variable?

我的梦境 提交于 2020-01-14 07:30:48
问题 I have downloaded the maven 3.5.0 from here. I have set it in the path: C:\apache-maven-3.5.0 Then i treid to add it to the path of Windows 7 as below: Right click on my computer Properties Advanced System Setting Environment Variable New user variable and added Maven_Home with value C:\apache-maven-3.5.0 Add it to path variable with: %Maven_Home%\bin Open cmd and ask for mvn -version in desktop Result : It does not recognize maven 回答1: In windows: Download the latest version of Maven from

Back slash causing problems c++

大兔子大兔子 提交于 2020-01-14 04:56:07
问题 I'm trying to use back slash in C++ in a string like this : HWND hwnd = FindWindowA(NULL, "C:\Example\App.exe"); So for this example I would get these errors/warnings :"unknown escape sequence: '\E'" "unknown escape sequence: '\A'" . Since I need to type in the exact name of the window , is there any way to avoid using back slashes or stop the compiler from interpreting them as "escape sequences" ? 回答1: You have to escape them properly, C++11 added raw string which eases this thing: HWND hwnd

java file relative path in eclipse

回眸只為那壹抹淺笑 提交于 2020-01-14 04:25:07
问题 Three days i was trying to figure out how to read file using relative file path. In eclipse this compiles and works great, but when i export app. It says that it can't find the file. here is the screenshot and code i work on. This code works, but only in eclipse, it compiles and does job perfectly. But when i export it as as runnable jar file i get an error, that it cannot locate licenca.txt BufferedReader in = new BufferedReader(new FileReader(new File("licenca.txt").getPath())); String str;

Prolog - Solving game, implementing heuristics

一曲冷凌霜 提交于 2020-01-14 04:20:29
问题 I want to solve a 'game'. I have 5 circles, we can rotate circles into left or into right (90 degrees). Example: Goal: 1,2,3,....,14,15,16 Ex. of starting situations: 16,15,14,...,3,2,1 I'm using BFS. Heuristic function: heuristic(NextState,Goal,H)), Desctiption of function: For each number 1 <= i <= 16, find the minimum number of rotations needed to put i back in its correct position (disregarding all other numbers) Take the maximum over all these minimums. This amounts to reporting minimum

Object following custom path

感情迁移 提交于 2020-01-14 04:05:00
问题 I'm working on 2d game dev project. It's some kind of board game. As background I have board game with path, that isn't real circle, but some kind of wavy line. Objects are moving across that path. On touch event...I need to my player's object get at that exact position, but they need to follow that path. How to translate (draw) objects over some custom path? 回答1: You could draw your path (i.e. your wavy line) using an actual Path object onto the Canvas , and then use PathMeasure to calculate

How do I change the lookup path for .NET libraries referenced via #using in Managed C++?

孤街浪徒 提交于 2020-01-14 04:00:12
问题 I developed a DLL in Managed C++ which loads some plugins (implemented in any .NET language) at runtime using System.Reflection.Assembly.LoadFile. The interface which is implemented by all plugins is implemented in C#. It's used by the Managed C++ code like this: #using <IMyPluginInterface.dll> // Make the 'IMyPluginInterface' type available ref class PluginManager { List<IMyPluginInterface ^> ^m_plugins; // Load all plugins in a well-known directory. void load() { for ( string dllFile in

Save file from byte array on servermap path

半城伤御伤魂 提交于 2020-01-14 03:39:07
问题 I Want to save a PDF file from a byte array and want to save that file on my server map path location. Below is my code snippet. It's giving no errors nor saving the file. You are welcome to correct my syntax if it is wrong or help me by referring other code snippets. byte[] data = (byte[])listDataset.Tables[0].Rows[0][0]; System.IO.FileStream file = System.IO.File.Create(Server.MapPath(".\\TmpImages\\"+hfFileName+".pdf ")); file.Write(data, 0, data.Length); file.Close(); 回答1: It could be a

Is a “file://” path a URL?

匆匆过客 提交于 2020-01-13 20:31:26
问题 I sometimes see people refer to file system paths (POSIX/Windows) as both URIs and URLs. I'm no file system buff, but I have yet to find a file system path that conflicts with my understanding of the URL format. That is, of course, given that it includes the scheme name (e.g. file://localhost/path/to/file.txt). File system paths are most definitely URIs - I mean, what's not - so everyone referring to file system paths as URIs is inside the safe zone. But is it safe to call them URLs? If the

Inno Setup (How to get dynamically path to file)?

Deadly 提交于 2020-01-13 08:59:33
问题 I'm making a setup script in Inno and I was wondering, how can I get non "hardcoded" path. Here is example: Thanks in advance! SOLUTION: You can get .iss folder by using predefined variable SourcePath Usage would be like: {#SourcePath}\???\bin\x86\Release\???.exe Thanks all who contributed! 回答1: The reference about the source directory says (emphasized by me): By default, the Setup Compiler expects to find files referenced in the script's [Files] section Source parameters, and files