path

Get root path of a tree with pure MySQL

落花浮王杯 提交于 2020-01-16 05:00:47
问题 I want to get path from node to root of a tree. This is my tree for example: id | name | parent_id ------------------------------ 1 | mike | 0 2 | danny | 1 3 | peter | 1 4 | clark | 2 5 | lily | 1 6 | stefan | 3 7 | simon | 3 8 | boby | 1 9 | john | 4 10 | elly | 4 I write an algoritm with php and mysql but it is slowly public function GetRootPath($a_id) { $root=""; $results=""; while(1==1){ $result = DB::select("SELECT id, parent_id FROM users WHERE id=$a_id"); if($result[0]->refr!=0) { if(

how to set PATH=%PATH% as environment in Python script?

社会主义新天地 提交于 2020-01-16 04:12:20
问题 I'am trying to start an exe file (the exe file is the output of c++ project compiled with visual studio) from a python program. In the properties of this c++ project (configuration ->properties-> debugging-> environment) the following setting in the (PATH = %PATH%;lib\testfolder1;lib\testfolder2) is given. is there any way to set path environment variable to PATH = %PATH% lib\testfolder1 lib\testfolder2 in a python program? Thanks in advance for your replay 回答1: You can update PATH using

Path with broken shadow effect

别等时光非礼了梦想. 提交于 2020-01-16 02:01:07
问题 I hope that it is clear enough in the image, I have a triangle with shadow effect that doesn't look so good, seems to be broken somehow. Any help will be greatly appreciated. ( Update: the rectangle and the path have to be separated) XAML: <Grid Height="50" Width="60" > <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="20" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Rectangle Grid.Column="1" Stroke="Black" Fill="White"> <Rectangle.Effect> <DropShadowEffect Opacity="0.5

c# Visual Studio appears to follow an incorrect code path

£可爱£侵袭症+ 提交于 2020-01-15 11:56:07
问题 Below is a small snippet taken from a fairly large app to simplify my question. I submitted this question before, but my poor wording caused it to be closed before I managed to edit my question. This is the current snippet to which I have added some logging lines. int i = 0; Console.WriteLine("Before brackets"); if (i < 0) { Console.WriteLine("Inside brackets"); return MyArray[i]; } When I debug with VS I see: i set to 0 if evaluates as false (when I hover over it in VS) In Output: Before

Overlapping Dashed / Dotted Strokes on Adjacent Paths in SVG

笑着哭i 提交于 2020-01-15 11:05:10
问题 I'm building a map of several counties that share borders. Each county is it's own enclosed path, and therefore the borders of adjacent counties are stacked over one another. I'd like to give each county a dashed stroke. However, when applied, the intersecting borders look ugly as the dashed borders of each county overlap, creating an uneven dash appearance. My users will be selecting counties by mousing over the area within the county borders, thus (I believe) making it necessary to create

Overlapping Dashed / Dotted Strokes on Adjacent Paths in SVG

六眼飞鱼酱① 提交于 2020-01-15 11:03:27
问题 I'm building a map of several counties that share borders. Each county is it's own enclosed path, and therefore the borders of adjacent counties are stacked over one another. I'd like to give each county a dashed stroke. However, when applied, the intersecting borders look ugly as the dashed borders of each county overlap, creating an uneven dash appearance. My users will be selecting counties by mousing over the area within the county borders, thus (I believe) making it necessary to create

ImageMagick PATH not being recognized with engine = “tikz” in knitr

做~自己de王妃 提交于 2020-01-15 06:14:27
问题 I am trying to compile TikZ graphics from knitr . I am using the example available here. I am specifically trying to knit from Rstudio. The output I get from the "R Markdown" tab is as follows: processing file: test.Rmd Invalid Parameter - /test_files Quitting from lines 16-31 (test.Rmd) Error in (knit_engines$get(options$engine))(options) : problems with `convert`; probably not installed? Calls: <Anonymous> ... process_group.block -> call_block -> block_exec -> in_dir -> <Anonymous>

The system cannot find the file specified

微笑、不失礼 提交于 2020-01-15 04:56:07
问题 The file is inside the directory where the software is. I am trying to add the text file to the memo box. procedure TForm4.FormCreate(Sender: TObject); var dir : string; begin Form4.Caption:='Abateri instrumente'; dir := GetCurrentDir; Memo1.Lines.LoadFromFile(dir+'\abateri.txt'); end; 回答1: In your specific situation, you should load the file with the code Memo1.Lines.LoadFromFile(dir+'\abateri.txt.txt'); This is because in the below screenshot that you provided, the extension of the Project3

Android Path addArc in canvas between two points

谁都会走 提交于 2020-01-15 04:29:28
问题 I'm trying to draw an arc in android. In IOS, it's really easy to do it with this method [path addArcWithCenter: radius: startAngle: endAngle: clockwise:] In android, I have 3 points (the center of my circle, and the two points I want to draw an arc between) : Point center = new Point(..., ...); Point p1 = new Point(..., ...); Point p2 = new Point(..., ...); int radius = (int) Math.sqrt(Math.pow(p1.x - center.x, 2) + Math.pow(p1.y - center.y, 2)); But how can I use the Path.addArc method to

Networkx - How to get shortest path length between nodes showing node id instead of label

时光毁灭记忆、已成空白 提交于 2020-01-15 04:11:28
问题 I'm new to using NetworkX library with Python. Let's say that I import a Pajek-formatted file: import networkx as nx G=nx.read_pajek("pajek_network_file.net") G=nx.Graph(G) The contents of my file are (In Pajek, nodes are called "Vertices"): *Network *Vertices 6 123 Author1 456 Author2 789 Author3 111 Author4 222 Author5 333 Author6 *Edges 123 333 333 789 789 222 222 111 111 456 Now, I want to calculate all the shortest path lengths between the nodes in my network, and I'm using this function