path

Find the closest tile along a path

I have a tile based game and I need to find the closest tile within a 32px radius. So say a user is at 400, 200 and the user clicks at 500, 400. I need to create a path or line from the player to the mouse position on click and the closest tile that is underneath the path within 32px (or 2 tiles) must be chosen. The map is tiled at 16px....

CMake and absolute header paths

Hi folks, I've been googling for a while and I no result yet so I turn to you guys ^^ I'm trying to use CMake to build my C++ project and I have a problem in the header paths. Since I'm using a lot of classes organized in several directories, all my include statements are with absolute paths (so no need to use "../../") but when try to...

Specifying base url for css

I had to split up a long css file. I put the smaller css files within a "styles" directory. Now I have to update the the urls to go up one level with the "../" notation. Is there anyway to specify the base url from which to load assets like with the base tag in html, but with CSS? ...

Regex: How to validate that a path does not contain //

I need help to create a regex (for JavaScript .match and PHP preg_match) that validates a unix type absolute path to a file (with international characters such as åäöøæð and so on) so that: /path/to/someWhere is valid /path/tø/sömewhere is valid /path/to//somewhere is invalid path/to/somewhere is invalid /path/to/somewhere/ is invalid ...

How two different task can goto one task in SSIS

Hi, please see the figure to get idea of the scenario. Now when my Package will run after executing the s! task, either A or B path will be followed. So If A is followed then Task S2 and F2 is executed. But if path B is followed, task F1 and F3 is executed. But also after completing task F3, the flow should go to task S2 via path E. ...

%HOMEDRIVE% vs. %ProgramFiles% vs. %HOMEPATH%: When should an Application choose which installation directory?

Some cross-platform packages like Ruby or Qt prefer %HOMEDRIVE% as the default installation path, Google Chrome uses something in %HOMEPATH%. What's the advantage and disadvantage of each choice? What's the best choice for a simple private application (i.e. a game, where the installation should work without administrator rights)? On the...

Draw parallel lines along a path - PHP GD

I need to draw something like a subway map (multiple routes along the same path) using PHP's image library. Here's an example: ********* ******** * ******* * * * * * * * * * * * * * * * * * * * * * * * ...

Get full path without filename from path that includes filename

Is there anything built into System.IO.Path that gives me just the filepath? For example, if I have a string @"c:\webserver\public\myCompany\configs\promo.xml", is there any BCL method that will give me "c:\webserver\public\myCompany\configs\"? ...

Resolve path of Excel

Actually I intended to ask the following question: For an executable that lies in a directory defined in %PATH%, how can I find out in which of these directory it is found? because I need to run Excel from C# using Process.Run(...), and just indicating "Excel" works fine: Windows seems to know where to find it. However I need...

How to search the correct directory for imports

I am trying to test some code. The main script requires imports from a number of subdirectories. The structure of the scripts is like this (I edited it to make it clear that dir1 and 2 are subdirectories of build): build ascript.py dir1 script2.py dir2 script3.py subdir1 script4.py script5.py subdir2 ...

Setting Href to a server path

How do I set Href to a file on a server (example: \myserver\test\a.txt) correctly? When I assign the path to Href, it adds the domain name in front (http://mydomain.com/myserver/test/a.txt) which is not the correct path. ...

Android: how to combine the paths of two shapes and remove overlap?

Hi all, I want to create a speech balloon type shape, where there is a rectangle or ellipse with a triangular shape jutting out of it. How I'm attempting to do this is to create a Path object that combines the triangle with the other shape (round rect). I'm doing it as follows: Path path = new Path(); // Create triangular segment Po...

Can a script.bat make changes to Windows PATH Environment Variable

I'm trying to write a script that when clicked will add a couple of entries to the PATH Environment variable in Windows, instead of making the changes manually. I see .bat files being used all the time on Windows for a variety of reasons, so can a .bat script help me with something like that? I actually need to download a zip from a lo...

WPF GifBitmapDecoder Uri Relative Path Issue

Hi All I am trying to set the uriString of a Uri object to a relative path for use in a GifBitmapDecoder. At runtime i get the following error: Invalid URI: The format of the URI could not be determined. My relative path follows the following format: /TestApplication;component/Images/Busy.gif If i use the absolute path to t...

getting the path of a file in .Net library

Hi, My library project is trying to open an XmlDocument from a file that's also contained in the library. How do I get the path of a file in the library so I can open it? The current directory is not useful and Server.MapPath returns me the path of the main web application (MVC), so how do I get the path of the file in the library? --...

Change Git repository download path on Mac

Hi, I often use git from Terminal on Mac to download some repositories and then use it. When I use this command:git clone git://git repository URL repositories are downloaded in my Start folder (name account folder e.g. Matthew, if the name of my Mac account is Matthew). I'd like to change this folder where repositories are downloa...

Selecting path to a folder in my computer (as in OpenFileDialog but without filename) in Silverlight 4

I have seen OpenFileDialog and SaveFileDialog in silverlight but, what if I required to select path of folder in my computer? Scenario: The user want to select path in the Computer which he can use for his files. For example there is a button (e.g. Select path to save your work button) which he will use to browse folder. When he is done...

Silverlight XAML: Binding to property in EntityClass from assosiated EntityCollection (advanced?!)

This question relates to this question. I have a EF model like this. Using Silverlight 4 I have an application showing questions to the user, defined through the QuestionSet. If a question has more than one answer alternative, a ComboBox is rendered. If only one alternative is given, a TextBox is rendered, in which the user can put fre...

Variable containing a path as a string to multi-dimensional array?

I'm looking to take a string such as /var/www/vhosts and turn it into a multi-dimensional, nested array such as: array( 'var'=>array( 'www'=>array( 'vhosts'=>array() ), ), ); Anyone got any pointers? I've had a look through Google and the search here, but I've not seen anything. Thank...

Visual Studio 2008 always build to C:\Users\bin\Debug\MyLibrary.dll

Although I have set the output build path to: ..\..\..\..\..\..\bin\Debug\ All other projects accept the relative path above. Why not that newly added project? When I choose the FolderDialog to set the output path, press ok then I see the absolute path in the output path textbox. Now I copy paste my relative path into the output path t...