Questions tagged [path]
17 questions
41
votes
4 answers
What algorithm is used by elevators to find the shortest path to travel floor orders?
I'm trying to simulate an elevator, as always I started very simple by taking only a single order at a time, then added memory to the elevator in the form of queues so that floors are traveled in the order in which they were pressed, which obviously…

Raed Tabani
- 537
- 1
- 4
- 7
4
votes
1 answer
Should I specify my header include path in the source code, or as a project option?
Basically, I am asking, whether my code should say
#include “../libs/src/my_lib.h”
or
#include “my_lib.h”
with a complier option of
-I ../libs/src/
I feel (reasonably strongly) that the former is preferable, because:
it is independent…

Mawg says reinstate Monica
- 4,142
- 3
- 33
- 51
3
votes
4 answers
Are short-circuiting paths considered for path coverage?
In a book Doron A. Peled, he states that "
path coverage does not subsume multiple condition coverage because you
can execute all the paths without exercising all the conditions.
But I believe this is not right (it implies path is only "visible"…

John V
- 4,898
- 10
- 47
- 73
3
votes
3 answers
Is there an elegant way to write code with differing paths having a common middle segment?
I started out with the following, simple routine:
void originalCode(){
boolean status = getStatus();
function2(status);
if(status){
return;
}
function3();
}
But then, additional functionality required calling…

executor21
- 139
- 1
3
votes
1 answer
How to deal with relative paths in out of source build?
An out of source build is a build which can be in any directory other than the source directory
I have a project which contains relative paths to some resource files, needed at runtime, which are located close to the source directory.
But when I…

user695652
- 529
- 3
- 16
2
votes
3 answers
filesystem::path vs. optional as argument to function
Sometime ago in a code-review (C++) I suggested to change the input argument from Path type to Optional, where the function has specific logic for unset path. It looks for me intuitively better, but the author appealed that Path::empty()…

abyss.7
- 135
- 2
2
votes
3 answers
long (or bizarre) file paths
I know that (on Linux at least, with native file systems like Ext3) file paths can in theory be quite long, and PATH_MAX is often (but not always) as big as 4096 (see this; and this explains it could be longer or runtime defined!).
However, file…

Basile Starynkevitch
- 32,434
- 6
- 84
- 125
1
vote
2 answers
How to find all possible paths with specific length in hexagonal game board?
I am currently developing a simple game in Unity.
I got a game board composed of hexagons. Let's say, the red dot is the player.
Now I want to show the user on which fields he can go, depending on the number he diced.
The user should not be allowed…

Lolo
- 11
- 1
1
vote
1 answer
Find fastest connection to a certain point
What i'm trying to implement is a program that is searching for the fastest connection from one station to other at a given time of the day.
I have a number of stations n, and a number m of lines that connect this stations. Each line has…

Ion
- 111
- 5
1
vote
1 answer
Algorithm for creating a looping 3D path that complete fills a cube
I'm creating a game world that consists of a 16 x 16 x 16 rubix cube (pictured), where the individual cubes are floating in space. The cubes continuously move along a single set path that links up with itself at the end. It might be helpful to…

Adam
- 33
- 2
1
vote
0 answers
Finding the longest acyclical path in a 2D maze
I have a n by n maze, like this:
[0, 1, 0, 0, 0, 1]
[1, 1, 0, 1, 1, 0]
[1, 0, 0, 1, 0, 1]
[0, 1, 1, 0, 0, 1]
[0, 0, 0, 1, 0, 1]
[1, 0, 1, 0, 1, 1]
Only 0-fields are passable, and one can only move directly up, down, left, or right.
I want to find…

b_pcakes
- 119
- 1
1
vote
1 answer
When to use absolute path?
I had given an answer on SO, the question was concerning a problem with a relative path. My answer was to use an absolute path, which I thought seemed simpler. The asker claimed to need a relative path, but I couldn't tell why.
It seems reasonable…

Will
- 131
- 1
- 5
0
votes
0 answers
Sync image files from network with mariadb-Database
i have as a mechanical engineering student in my practice semester to create a database that includes about 100k+ paths to images in our network. Every, lets say week, i have to synchronize all changes in the network with my DB. So i have to delete…

Prodigy
- 1
- 1
0
votes
2 answers
Drawing all lines from right to left - fast
I have several drawings from SVG files which basically contain basic outlines of figures. They are constructed in segments of various shapes (lines, ellipse arcs, Bezier curves ect.) Something like this (maybe not the best example):
I want to…

DrDress
- 127
- 4
0
votes
2 answers
Should I put request context in path or in headers?
I'm designing a system that will
Act as proxy calling a service on a back-end in context of user and his session
Manage sessions for users on multiple back-ends
I will expose the system over HTTP.
Most of the requests will need back-end-id,…

AGrzes
- 379
- 2
- 9