path

How to change a path fill (on a button) with triggers in XAML

女生的网名这么多〃 提交于 2019-12-17 19:27:29
问题 I have a button with a path as icon,i want to change the fill of the path when the mouse is over the whole button (not only the path). Thanks. <Button Name="Test_Button" Width="220" Height="80" Padding="2"> <Canvas Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0"> <Path Canvas.Left="19" Canvas.Top="19" Width="38" Height="38" Data="F1 M 35,19L 41,19L 41,35L 57,35L 57,41L 41,41L 41,57L 35,57L 35,41L 19,41L 19,35L 35,35L 35,19 Z " Stretch="Fill"> <Path.Style> <Style TargetType="{x

How are Delphi 'environment variables' such as $(BDS) evaluated?

夙愿已清 提交于 2019-12-17 18:51:46
问题 I'm making some tidy installers for our internal libraries (instead of just opening the DPK's and clicking 'install' and getting in a mess later...) and this has caused me to have to understand how to get at various Delphi variables such as Known Packages, the registry RootDir value etc. I see that within Delphi there are a number of variables that you can use (within a search path for example) such as $(BDS) etc. When I look into my machine environment variables I dont see these, either in

Call a function that is not on the Matlab path WITHOUT ADDING THAT PATH

佐手、 提交于 2019-12-17 18:35:38
问题 I have been searching an entire afternoon and have found no solution to call in matlab a function by specifying its path and not adding its directory to the path. This question is quite similar to Is it possible to call a function that is not in the path in MATLAB?, but in my case, I do not want to call a built-in function, but just a normal function as defined in an m-file. I think handles might be a solution (because apparently they can refer to functions not on the path), but I again found

How to escape colon (:) in $PATH on UNIX?

本秂侑毒 提交于 2019-12-17 18:01:07
问题 I need to parse the $PATH environment variable in my application. So I was wondering what escape characters would be valid in $PATH . I created a test directory called /bin:d and created a test script called funny inside it. It runs if I call it with an absolute path. I just can't figure out how to escape : in $PATH I tried escaping the colon with \ and wrapping it into single ' and double " quotes. But always when I run which funny it can't find it. I'm running CentOS 6. 回答1: This is

How to normalize a path in PowerShell?

假如想象 提交于 2019-12-17 17:53:02
问题 I have two paths: fred\frog and ..\frag I can join them together in PowerShell like this: join-path 'fred\frog' '..\frag' That gives me this: fred\frog\..\frag But I don't want that. I want a normalized path without the double dots, like this: fred\frag How can I get that? 回答1: You can use a combination of pwd , Join-Path and [System.IO.Path]::GetFullPath to get a fully qualified expanded path. Since cd ( Set-Location ) doesn't change the process current working directory, simply passing a

Manhattan Distance between tiles in a hexagonal grid

不问归期 提交于 2019-12-17 17:50:48
问题 For a square grid the euclidean distance between tile A and B is: distance = sqrt(sqr(x1-x2)) + sqr(y1-y2)) For an actor constrained to move along a square grid, the Manhattan Distance is a better measure of actual distance we must travel: manhattanDistance = abs(x1-x2) + abs(y1-y2)) How do I get the manhattan distance between two tiles in a hexagonal grid as illustrated with the red and blue lines below? 回答1: I once set up a hexagonal coordinate system in a game so that the y -axis was at a

Getting just the filename from a path with Javascript

亡梦爱人 提交于 2019-12-17 17:46:05
问题 I have a full path to an image, which I am using jquery to read, in the form $('img.my_image').attr('src') however I just want the filename portion (discarding the path). Are there any built-in functions to do this, or would a regex be the only option? 回答1: var fileNameIndex = yourstring.lastIndexOf("/") + 1; var filename = yourstring.substr(fileNameIndex); 回答2: var Filename= path.split('/').pop() 回答3: function getFileName(path) { return path.match(/[-_\w]+[.][\w]+$/i)[0]; } 回答4: I found a

Windows PATH to posix path conversion in bash

北城余情 提交于 2019-12-17 17:39:25
问题 How can I convert a Windows dir path (say c:/libs/Qt-static ) to the correct POSIX dir path ( /c/libs/Qt-static ) by means of standard msys features? And vice versa? 回答1: I don't know msys , but a quick google search showed me that it includes the sed utility. So, assuming it works similar in msys than it does on native Linux, here's one way how to do it: From Windows to POSIX You'll have to replace all backslashes with slashes, remove the first colon after the drive letter, and add a slash

How do I use '~' (tilde) in the context of paths?

孤街浪徒 提交于 2019-12-17 17:36:55
问题 I'm a web application development noob. I have a function that opens a file and reads it. Unfortunately, the directory structures between the test and production servers differ. I was told to "use a path relative to ~". I haven't been able to find any resources on the '~', though! How do I use the tilde character in the context of paths? EDIT: This is in Python. I fixed the problem, using os.path.expanduser('~/path/in/home/area'). 回答1: it is your $HOME var in UNIX, which usually is /home

How can I make PowerShell handle [ or ] in file name well?

坚强是说给别人听的谎言 提交于 2019-12-17 17:13:57
问题 I modified PowerShell script from PowerShell - Batch change files encoding To UTF-8. # Modified version of https://stackoverflow.com/q/18684793 [Threading.Thread]::CurrentThread.CurrentUICulture = 'en-US' $Encoding = New-Object System.Text.UTF8Encoding($True) # If UTF8Encoding($False), It will be UTF-8 without BOM $source = "C:\Users\AKULA\Desktop\SRC" # source directory $destination = "C:\Users\AKULA\Desktop\DST" # destination directory if (!(Test-Path $destination)) { New-Item -Path