c# – Should my API return the image or path to an image?

Client -> API -> BLOB
Has the advantage that the Blob storage could be hidden from the outside, therefore from a security perspective thats quite nice. But on the other side the images have to go through your servers. That means it eats your bandwith, and a small amount of CPU.

Client -> API and then Client -> BLOB
Has the advantage that the first call is quite small (just getting a link), and the second one could theoreticly also take advantages of a CDN (if necessary).

If you think that your application will take heavy load, then you should definitly think about the Client->API Client->Blob approach, because it really reduces the traffic on your servers.

algorithm – Finding a path to a circular zone in continuous space

I need to find the shortest path for an agent that wants to use a ranged attack against the specified target. This means that path’s ending point should be a) inside range of the attack and b) have line-of-sight on target, which can be blocked by various static obstacles. This part of the game is turn-based, so I only have to worry about finding a path for one agent at a time, and can allow myself to take a small performance hit (anything under 100ms is probably acceptable).

I’m operating in a continuous space, but even if I constrain it with an overlaid grid, the problem doesn’t get much easier, because the only way I can think of to solve it is to find a path (using A*) to every grid cell inside the range that has LOS on target and compare their length to find the shortest one – which is prohibitively expensive, given longer ranges (e.g. calculation of path to target 3000 cells takes up to 600ms). What’s worse, LOS check is also somewhat expensive, so even determining a complete set of cells which have LOS is out of question.

But before we even consider LOS, I can find no good way to find the shortest path to the target circle. Of course, I can sample a number of points on the circumference and find a path to each one, but this sounds too unreliable and also costly enough for long ranges. And of course, this approach breaks down completely if we take LOS into account, because it is possible that no point on circumference has LOS, but some point inside circle does.

I was unable to find any algorithms or even research papers on the topic (of finding a path to a circular zone in continuous space), so maybe I’m using wrong keywords or missing something. Are there any known algorithms for this problem? Or is finding path to every (sampled) point inside circle is my best be, and I should work on optimizing this approach somehow?

putty – Why isn’t filezilla accepting the keyfile path for SFTP connection


Your privacy


By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.




general topology – why is deleted infinite broom not path connected

There are many posts in google about this. I am not from core mathematics background. Deleted infinite broom are lines connecting (0,0) to $(1,frac{1}{n})$ but point (1,0) is not included.

I know this is NOT path-connected but connected.

If i had to prove that it is not path connected, there should exist 2 points between which no path exists. But in proof why is that (1,0) is considered when it is not part of X. X = deleted infinite broom.

I understood defn of path connectedness as any 2 points x and y in X, there should be path P(which is continuous function from (0,1) to X)

How to append path to begginig of every url for visitors from specific country or specific browser language via .htaccess

I would like to append zh-hans to beginning of every URL path, for visitors from specific country or visitors who use specific browser language.

In first I was able to redirect visitors from specific country or visitors who use specific browser language to desired URL, by adding this in .htaccess:

RewriteCond %{ENV:IP2LOCATION_COUNTRY_SHORT} ^DE$
RewriteRule ^$ http://example.com/zh-hans [R,L,NC]
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^$ http://example.com/zh-hans [R,L,NC]

How I want to path zh-hans be in front of every URL visitor from specific country or visitors who use specific browser language want to access.

For example:
If they want to access:
example.com/retailers or example.com/shop
I want them to be redirected to
example.com/zh-hans/retailers, example.com/zh-hans/shop…etc.

Thank you.

Why do I keep getting a path error in my python code?

Why do I keep getting a path error in my python code? – Web Applications Stack Exchange

Shortest path in a grid with turnstile and waypoints

This segment of video shows a grid maze with a type of tile which I’d call turnstiles.
https://youtu.be/NENxxq24xic?t=422

The textual description of the mechanics of those tiles could be the following:

  • A turnstile tile has two bars on adjacent sides of the tile
  • You cannot step into a turnstile tile if it would mean crossing a bar
  • You can exit a turnstile tile in any direction
  • If you exit the tile in a the direction where there was one of the bars, then the pair of bars rotate by a 1/4 turn such that there’s no more bar in the direction you exited the tile from (see video at 7:02).

Here’s an example before and after exiting a turnstile tile:

On a turnstile tile Exited the turnstile tile to the south

If we’re looking for a shortest path from A to B in a maze containing this kind of tile, then I think we can prove that we can just implement the turnstile as one-way arcs in the graph and then just use a regular Dijkstra or A*. Ignoring completely the modification of the orientation of the turnstiles on the way.

However, if we introduce a single waypoint, like fetching a key before going to the door, then we can no longer ignore the state in which we left the turnstiles. We might indeed revisit some tiles.
Although taking the shortest path from A to K and then from K to B would produce a valid A-K-B path, we can easily construct examples where this wouldn’t produce the shortest path overall, like this one:
Example of suboptimal iterative solution

I couldn’t figure out a way to turn this problem into a regular shortest path without blowing up the graph size exponentially with the number of turnstiles.

I couldn’t figure out a way to prove it’s NP-complete either.

So, how to find the shortest path in a grid maze with turnstiles? With what complexity?

url – Redirect in .htaccess when page numbers are both in a query parameter and in the path

My blog is creating duplicate pagination, and Google understands this as duplicate content.
How to 301 redirect pagination as in the following examples?

  • https://example.com/page/33?page=34
    to: https://example.com/page/33
  • https://example.com/page/23?page=25
    to: https://example.com/page/23

I need redirect all ?page= to your correct link /number

Recently, I was able to remove broken links ?m=0 with:

RewriteCond %{QUERY_STRING} ^m=(01)$
RewriteRule (.*) /$1? (R=301,L)

complexity theory – Maximum length $s-t$ simple path in a directed graph

Given a directed graph $G = (V, E)$ and vertices $s, t$, how to find the maximum length simple path starting at $s$ and ending at $t$? Here length means the number of edges in the path.
I know that the Longest path problem is NP-Hard, but since this problem seems to be a little more restrictive, can it be solved in polynomial time?

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123