Search Results

Search found 14344 results on 574 pages for 'path'.

Page 6/574 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • WPF, convert Path.DataProperty to Segment objects

    - by user275587
    I was wondering if there was a tool to convert a path data like "M 0 0 l 10 10" to it's equivalent line/curve segment code. Currently I'm using: string pathXaml = "<Path xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" Data=\"M 0 0 l 10 10\"/>"; Path path = (Path)System.Windows.Markup.XamlReader.Load(pathXaml); It appears to me that calling XamlParser is much slower than explicitly creating the line segments. However converting a lot of paths by hand is very tedious.

    Read the article

  • How to determine where on a path my object will be at a given point in time?

    - by Dave
    I have map and an obj that is meant to move from start to end in X amount of time. The movements are all straight lines, as curves are beyond my ability at the moment. So I am trying to get the object to move from these points, but along the way there are way points which keep it on a given path. The speed of the object is determined by how long it will take to get from start to end (based on X). This is what i have so far: //get_now() returns seconds since epoch var timepassed = get_now() - myObj[id].start; //seconds since epoch for departure var timeleft = myObj[id].end - get_now(); //seconds since epoch for arrival var journey_time = 60; //this means 60 minutes total journey time var array = [[650,250]]; //way points along the straight paths if(step == 0 || step =< array.length){ var destinationx = array[step][0]; var destinationy = array[step][1]; }else if( step == array.length){ var destinationx = 250; var destinationy = 100; } else { var destinationx = myObj[id].startx; var destinationy = myObj[id].starty; } step++; When the user logs in at any given time, the object needs to be drawn in the correct place of the path, almost as if its been travelling along the path whilst the user has not been at the PC with the available information i have above. How do I do this? Note: The camera angle in the game is a birds eye view so its a straight forward X:Y rather than isometric angles.

    Read the article

  • Ant path/pathelement not expanding properties correctly

    - by Jonas Byström
    My property gwt.sdk expands just fine everywhere else, but not inside a path/pathelement: <target name="setup.gwtenv"> <property environment="env"/> <condition property="gwt.sdk" value="${env.GWT_SDK}"> <isset property="env.GWT_SDK" /> </condition> <property name="gwt.sdk" value="/usr/local/gwt" /> <!-- Default value. --> </target> <path id="project.class.path"> <pathelement location="${gwt.sdk}/gwt-user.jar"/> </path> <target name="libs" depends="setup.gwtenv" description="Copy libs to WEB-INF/lib"> </target> <target name="javac" depends="libs" description="Compile java source"> <javac srcdir="src" includes="**" encoding="utf-8" destdir="war/WEB-INF/classes" source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source"> <classpath refid="project.class.path"/> </javac> </target> For instance, placing an echo of ${gwt.sdk} just above works, but not inside "project.class.path". Is it a bug, or do I have to do something that I'm not? Edit: I tried moving the property out from target setup.gwtenv into "global space", that helped circumvent the problem.

    Read the article

  • Eclipse cannot find existing project in build path

    - by PNS
    Here is probably one of the idiosyncrasies of Eclipse and its handling of build paths, which cannot be fixed despite all sorts of workarounds tested so far. The issue relates to a workspace of several projects, each of which compiles into its own JAR. Dependencies among the projects are resolved by adding the relevant ones to the build path (no Maven or other external tool or plugin is used), via Project -> Properties -> Java Build Path -> Projects Among all these projects, a couple (say, com.example.p1 and com.example.p2) refuse to recognize a third (and simple) one (say, com.example.p3), while all other projects do. So, although P3 is added to the build path, all related classes from P3 are imported properly and the source code of each such class is accessible by hitting F3, Eclipse keeps complaining that The import com.example.p3 cannot be resolved and SomeClass cannot be resolved to a type where com.example.p3.SomeClass is one of the P3 classes. If instead of the P3 project I put its compiled JAR in the build path, the issue disappears. However, code in P3 changes frequently and it is a time waste to keep compiling and refreshing the workspace so that the change is picked up, not to mention that this should not happen in an IDE anyway (and it does not for the other projects using P3). Among the workarounds tried are things like: Removing and adding again P1, P2, P3 Cleaning up and recompiling everything Checking whether any other project loads the P3 JAR Putting P3 at the top of the Eclipse build path "Order and Export" list Using the "Fix project setup" suggestion of Eclipse (available when hovering the mouse over the red-underlined-error compilation line). Actually, this option offers adding to the build path either P3 or its JAR, but if P3 is added, the issue reappears. Any ideas?

    Read the article

  • Finding a Relative Path in .NET

    - by Rick Strahl
    Here’s a nice and simple path utility that I’ve needed in a number of applications: I need to find a relative path based on a base path. So if I’m working in a folder called c:\temp\templates\ and I want to find a relative path for c:\temp\templates\subdir\test.txt I want to receive back subdir\test.txt. Or if I pass c:\ I want to get back ..\..\ – in other words always return a non-hardcoded path based on some other known directory. I’ve had a routine in my library that does this via some lengthy string parsing routines, but ran into some Uri processing today that made me realize that this code could be greatly simplified by using the System.Uri class instead. Here’s the simple static method: /// <summary> /// Returns a relative path string from a full path based on a base path /// provided. /// </summary> /// <param name="fullPath">The path to convert. Can be either a file or a directory</param> /// <param name="basePath">The base path on which relative processing is based. Should be a directory.</param> /// <returns> /// String of the relative path. /// /// Examples of returned values: /// test.txt, ..\test.txt, ..\..\..\test.txt, ., .., subdir\test.txt /// </returns> public static string GetRelativePath(string fullPath, string basePath ) { // ForceBasePath to a path if (!basePath.EndsWith("\\")) basePath += "\\"; Uri baseUri = new Uri(basePath); Uri fullUri = new Uri(fullPath); Uri relativeUri = baseUri.MakeRelativeUri(fullUri); // Uri's use forward slashes so convert back to backward slashes return relativeUri.ToString().Replace("/", "\\"); } You can then call it like this: string relPath = FileUtils.GetRelativePath("c:\temp\templates","c:\temp\templates\subdir\test.txt") It’s not exactly rocket science but it’s useful in many scenarios where you’re working with files based on an application base directory. Right now I’m working on a templating solution (using the Razor Engine) where templates live in a base directory and are supplied as relative paths to that base directory. Resolving these relative paths both ways is important in order to properly check for existance of files and their change status in this case. Not the kind of thing you use every day, but useful to remember.© Rick Strahl, West Wind Technologies, 2005-2010Posted in .NET  CSharp  

    Read the article

  • Changing $PATH doesn't work?

    - by Ashwini Chaudhary
    I was trying to set PATH in etc/environment file, but after adding the desired path the $PATH is showing an error in terminal: bash: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: No such file or directory Here's the content of environment file: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/monty/google_appengine" I was trying to add the path to the folder google_appengine to the PATH as mentioned in this Answer, but it doesn't seem to work.

    Read the article

  • WPF: How to autosize Path to its container?

    - by 742
    I have a Path that must resize to its StackPanel container. <StackPanel x:Name="TrackSurface"> <Path Fill="AliceBlue" Stroke="Black" StrokeThickness="1" Data="{StaticResource TranslateZ}"> </Path> </StackPanel> I think about using a transformation bound to the container but don't know how to it actually. Can someone give me hint?

    Read the article

  • Nunit Relative Path failing

    - by levi.siebens
    I'm having an issue with Nunit where I cannot find an image file when I run my tests and each time it looks for images it looks in the Nunit folder instead of looking inside the folder where the binary resides. Below is a detailed description of what's happening. I'm building a binary that is under test which contains the definition for some game elements and png files which will define the sprites I'm using (for sanity sake call it Binary1) Nunit runs tests from a seperate binary (Binary1Test) executing test methods against the first binary (Binary1). All tests pass, unless the test executes code in Binary1 which then requires Binary1 to use one of the image files (which are defined via a relative path). When the method is called, Nunit throws a file not found exception stating that it cannot find the file and states it's looking inside of the Program Files\Nunit.net 2.0 folder So I have no idea why the code is doing this, and to make matters more confusing when I pull up Enviornment.CurrentDirectory it gives me the correct path (the path to my debug folder) and not the path to nunit. Also if I use this instead of using the relative path, my tests will run without issue. So my question is, does anyone know why in the case of loading relative paths from within my binary that nunit decides to use it's directory instead of the directory where the binary is located and where the images are stored? Thanks.

    Read the article

  • Code coverage (c++ code execution path)

    - by Poni
    Let's say I have this code: int function(bool b) { // execution path 1 int ret = 0; if(b) { // execution path 2 ret = 55; } else { // execution path 3 ret = 120; } return ret; } I need some sort of a mechanism to make sure that the code has gone in any possible path, i.e execution paths 1, 2 & 3 in the code above. I thought about having a global function, vector and a macro. This macro would simply call that function, passing as parameters the source file name and the line of code, and that function would mark that as "checked", by inserting to the vector the info that the macro passed. The problem is that I will not see anything about paths that did not "check". Any idea how do I do this? How to "register" a line of code at compile-time, so in run-time I can see that it didn't "check" yet? I hope I'm clear.

    Read the article

  • Path element of Siverlight issue

    - by George2
    Hello everyone, Suppose I have the following XAML code, my confusions are, (1) I do not know the exact meaning of Data attribute, especially items starts with letter M/C, (2) there is no special configuration for TransformGroup (all using default settings), why put the TransformGroup here? <Path Height="2.75" Width="2.75" Data="M2.75,1.375 C2.75,2.1343915 2.1343915,2.75 1.375,2.75 C0.61560845,2.75 0,2.1343915 0,1.375 C0,0.61560845 0.61560845,0 1.375,0 C2.1343915,0 2.75,0.61560845 2.75,1.375 z" Fill="#FF9F9B9B" Stretch="Fill" Stroke="#FF000000" StrokeThickness="0" Canvas.Top="7" x:Name="p3"> <Path.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Path.RenderTransform> </Path> thanks in advance, George

    Read the article

  • forslash as the default path separator in windows?

    - by Meitham
    Since windows now accept the forslash "/" as a path separator in addition to its default backslash path separator, so that both c:\windows and c:/windows are valid paths (though the later is invalid in cygwin since backslash is escape char) Is there any chance we could set the forslash as the default path separator on windows (GUI), so that the address bar in windows will automatically use it? I heard its possible in a powershell session but anyone knows if it is also possible in a CMD session? Thanks M

    Read the article

  • How to get Path Separator in Perl?

    - by ram
    In case of Java, we can get the path separator using System.getProperty("path.separator"); Is there a similar way in Perl? All I want to do is to find a dir, immediate sub directory. Say I am being given two argumens $a and $b; I am splitting the first one based on the path separator and joining it again except the last fragment and comparing with the second argument. The problem is my code has to be generic and for that I need to know whats the system dependent path separator is? Could you help if there is any way to get it? TIA

    Read the article

  • conflicting cygwin and windows path

    - by David
    if my windows path looks like this: c:\ruby\bin;c:\cygwin\bin then when i go into cgywin and enter "ruby" it will execute the ruby from c:\ruby\bin, failing to find the ruby installed in my cygwin. I have to exclude that path so cygwin would execute the one from /usr/bin. But i need those 2 paths, since i want to run ruby in windows too. Anyway to have cygwin have its own path and not inherit those in windows? thanks.

    Read the article

  • XAML Multi-Level Binding Source/Path Issue

    - by tpartee
    So I have this issue I've been trying various ways to tackle all day and nothing's catching and working for it. Basically I have a XAML object called ChromeWindow (derived from Window) which has in it's code-behind a DependencyProperty called AppChrome which stores a reference to an associated ApplicationChrome XAML object (derived from UserControl). ApplicationChrome's XAML file has a few x:Name'd objects (a TextBlock and Border for instance) to which I want to bind to from the ChromeWindow's XAML. The root of the ChromeWindow is x:Name'd as 'rootWindow' in the XAML, so I figured one of these bindings would work: {Binding ElementName=rootWindow, Path=AppChrome.CaptionTextBlock.Text, Mode=OneWay} But that complains of a BindingExpression path error such that the property 'CaptionTextBlock' (an x:Name'd TextBlock in AppChrome's XAML) cannot be found on object of type ApplicationChrome So I tried this binding intead: {Binding Source=AppChrome.CaptionTextBlock, Path=Text, Mode=OneWay} And still no luck, this time complaints of a BindingExpression path error again, but this time that it cannot find the 'CaptionTextBlock' property on object of type String I know I'm missing something really simple here, please help! ;D

    Read the article

  • Java - Loading dlls by a relative path and hide them inside a jar

    - by supertreta
    Hi guys, I am developing a Java application that should be release as a jar. This program depends on c++ external libraries called by JNI. To load them, I use the method System.load with an absolute path and this works fine. However, I really want to "hide" them inside the jar, so I have created a package to collect them. This forces me to load an relative path - the package path. By this approach, I let the user run the jar in any directory, without being worried about linking the dll's or bored with a previous installation process. This throws the expected exception: Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library How can I get this working? Thanks for your help!

    Read the article

  • String path validation

    - by CMAñora
    I have here a string(an input from the user) for a file path. I checked the string so that it will qualify the criteria: check for invalid characters for a file path will not accept absolute path (\Sample\text.txt) I have tried catching the invalid characters in catch clause. It work except for '\'. It will accept 'C:\\Sample\text.txt' which is an invalid file path. The following examples should be invalid paths: :\text.txt :text.txt \:text.txt \text.txt C:\\\text.txt I have been through similar questions posted here but none of them seemed to solve my issue. What would be the best way to do such check?

    Read the article

  • Path Length in Windows

    - by Dexter
    Is there any reason paths are still limited to ~250 characters in Windows? I'm not asking about a solution here (since there isn't one, other than \\?\ perhaps), but about why this is still an issue in 2012. Microsoft itself has failed to provide an explanation, so I'm hoping that maybe someone here, who has more insight into this than me, can provide an answer. Also, if \\?\ is supposed to be the "cure" to this, why aren't paths implicitly converted to the \\?\ notation by Microsoft's own programs?

    Read the article

  • Team Build: The path 'Path' is already mapped in workspace 'workspace' error even after deleting all

    - by Glenn Slaven
    I have this problem when I queue a build. The build dies with the error The path C:\[Path]\Sources is already mapped in workspace [Server Name]. the same as this question. but I've removed all the workspaces on the build agent by running this command: tf workspaces /remove:* and also by deleting the TFS cache folder. I've also restarted the server, but the error keeps happening on each build.

    Read the article

  • Regex to replace relative link with root relative link

    - by Kendall Hopkins
    I have a string of text that contains html with all different types of links (relative, absolute, root-relative). I need a regex that can be executed by PHP's preg_replace to replace all relative links with root-relative links, without touching any of the other links. I have the root path already. Replaced links: <tag ... href="path/to_file.ext" ... > ---> <tag ... href="/basepath/path/to_file.ext" ... > Untouched links: <tag ... href="/any/path" ... > <tag ... href="protocol://domain.com/any/path" ... >

    Read the article

  • Is there a way I can use $PATH as defined by my bash profile?

    - by Adam Backstrom
    I spend most of my day ssh'd into servers. I have a series of aliases/functions/scripts that allow me to type p hostname from the terminal and execute GNU screen(1) on the remote side, using the following command: exec ssh hostname -t 'screen -RD'` I've only recently noticed that ssh -t does not get my custom $PATH. Here's some terminal output: adam@workstation:~:0$ sh server 'echo $PATH' /home/adam/bin:/usr/local/bin:/bin:/usr/bin:/opt/git/bin:/opt/git/libexec/git-core adam@workstation:~:0$ ssh server -t 'echo $PATH' /usr/local/bin:/bin:/usr/bin Connection to uranus.plymouth.edu closed. My biggest problem is my custom aliases only try to execute screen, since I can't guarantee an absolute path, and my $PATH is structured so the shell should find the correct one. If my $PATH settings aren't honored, my scripts don't work. Is there a way I can use $PATH as defined by my .bashrc/.bash_profile? I believe PermitUserEnvironment is disabled.

    Read the article

  • How do I reset the $PATH variable on Mac OS X?

    - by Neil
    I've messed up my path variable, and now some apps that I run raise errors saying Command Not Found (error 127) for commands like 'date' and 'sleep'. These commands work fine when executed directly in the shell. I'm guessing this has something to do with a malformed $PATH variable, and need to know how to reset it. I've deleted the files ~/.bashrc , ~/.bash_profile, /etc/bash.bashrc, and ~/.bashrc and ~/.profile. What other files could hold my $PATH? Is there some simpler way to reset the Path than dig into the myriad files which could hold my path? Note, this path problem is only with my user. I made a test user on my system, and the path was fine, back to normal.

    Read the article

  • intelligent path truncation/ellipsis for display

    - by peterchen
    I am looking for an existign path truncation algorithm (similar to what the Win32 static control does with SS_PATHELLIPSIS) for a set of paths that should focus on the distinct elements. For example, if my paths are like this: Unit with X/Test 3V/ Unit with X/Test 4V/ Unit with X/Test 5V/ Unit without X/Test 3V/ Unit without X/Test 6V/ Unit without X/2nd Test 6V/ When not enough display space is available, they should be truncated to something like this: ...with X/...3V/ ...with X/...4V/ ...with X/...5V/ ...without X/...3V/ ...without X/...6V/ ...without X/2nd ...6V/ (Assuming that an ellipsis generally is shorter than three letters). This is just an example of a rather simple, ideal case (e.g. they'd all end up at different lengths now, and I wouldn't know how to create a good suggestion when a path "Thingie/Long Test/" is added to the pool). There is no given structure of the path elements, they are assigned by the user, but often items will have similar segments. It should work for proportional fonts, so the algorithm should take a measure function (and not call it to heavily) or generate a suggestion list. Data-wise, a typical use case would contain 2..4 path segments anf 20 elements per segment. I am looking for previous attempts into that direction, and if that's solvable wiht sensible amount of code or dependencies.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >