behavior of path on unpublished/draft nodes

We have a Drupal 8 site with a press releases page. Currently the press releases page is provided by a view with a page display. The path in the page display is set to /press-releases.

I’ve been tasked with changing the design of the press releases page. We want to use paragraphs to allow the marketing department to edit the page. This means that I must first disable the view’s press releases page display (to free up the path), then create a Basic Page (which we’ve added a paragraphs field to) and set its path to /press-releases.

We use configuration export, so in my feature branch, I’ve set the “Press Releases” view page display to be disabled when the config is imported.

To speed deployment, I’ve already created the “Press Releases” Basic Page on production, along with all the paragraphs that we want on it. Of course, it’s not published (its current state is “Draft”, which in Drupal 8, I’m not entirely certain which module provides those workflow states), because we don’t want it live yet.

We use the pathauto module, so when I created the “Press Releases” Basic Page, it automatically generated the path /press-releases-0, presumably because the /press-releases path was already in use by views.

This means that, as a post-deploy step, in addition to publishing the new Press Releases node, I also have to edit the URL alias, from /press-releases-0 to /press-release (the cim command deactivates the view display).

I tried changing the URL alias on the draft node to /press-releases before it was published, but what ended up happening was that on the site, the /press-releases path returned a 404. I confirmed this by looking in the watchdog log, and, sure enough, I got an access denied at /press-releases. Finally, I published the node and cleared the cache. When I reloaded the URL, I got the Press Releases node. So it looks like the node is taking control of that path.

So my question is, is this the expected the behavior of nodes (or entities that take paths in general) in Drupal 8? And that it does this without a form validation error, or a warning or notice that an existing path was overridden? Or is this something that could be being caused by Pathauto or the Draft workflow state?

What concerns me is that any one of our editors (or even myself, as careful as I try to be) could override the URL of a view (or perhaps anything else), simply by specifying an alias for a new node.

(Also, I would prefer to be able to just publish the page in a post-deploy step. Since our deploy process involves deploying to a test and a staging environment before production, extra deploy steps are multiplied.)

Reconstruct shortest path from a list of predecessors

I am trying to do a shortest path reconstruction with the given parameters:

  • an array P, which contains the predecessors of every vertex on a shortest path from S to I
  • a starting vertex S, defined by a P[S] = -1
  • end vertex T, which is the destination of the shortest path I’m trying to reconstruct

My idea was to start from the end of the array, find the predecessor of vertex T and continue looking for the predecessors of the predecessors until I’m on the starting vertex S. Is my solution correct? Thanks!

Using the decision problem, PATH in order to solve the optimization problem, SHORTEST-PATH in polynomial time

So, if I were using a black-box decision algorithm, PATH in which I could say, “does a path of weight k exist in this graph from S to V“, problably the typical way one would solve the optimization problem of shortest path is to start at k at zero and increment until PATH returns true. But since paths start at -inf shouldn’t we be starting there? (Thus making this optimization problem not solvable in polynomial time)

I know this isn’t right, I’m just having a hard time seeing which part I am missing here.

ReactJS Dynamically Path Looping Function

How do I make this coding from like this and change it into looping like the for loop.

As you can see in the require path, I wanna make the path from static to a dynamic path where it read the file.

I tried using var a = path, then call the path but instead got an error. So I found out this way have no error, but this is like hard coded.

Here is my coding :

        let jsonData = require(`../../component_NodeJS/server/files/downloads/1558401247494-MFRS.pdf/1558401247494-MFRS.pdfoutput-1-to-20.json`)             jsonData = jsonData.responses.map((details,index) =>{             return details.fullTextAnnotation.text;             })         let jsonData01 = require(`../../component_NodeJS/server/files/downloads/1558401247494-MFRS.pdf/1558401247494-MFRS.pdfoutput-21-to-40.json`)             jsonData01 = jsonData01.responses.map((details,index) =>{             return details.fullTextAnnotation.text;             })         let jsonData02 = require(`../../component_NodeJS/server/files/downloads/1558401247494-MFRS.pdf/1558401247494-MFRS.pdfoutput-41-to-44.json`)             jsonData02 = jsonData02.responses.map((details,index) =>{             return details.fullTextAnnotation.text;             })             console.log(`File Content JSON Mapping File Combine :\n`+ jsonData + `\n` + jsonData01 + `\n` + jsonData02); 

Any ideas ? 😀

lnd SendPayment “unable to find a path to destination”

I got an error “unable to find a path to destination” when I call SendPayment to an invoice, created at starblocks.acinq.co, from my local private LND node.

It seems getinfo and getnetworkinfo are no problem. Am I missing something? (e.g. open port or connect channel) How can I debug it?

  • my local private LND node
# lncli --macaroonpath=/home/bitcoin/.lnd_1/chain/bitcoin/testnet/admin.macaroon --rpcserver=localhost:10010 --lnddir=/home/bitcoin/.lnd_1 getinfo {     "version": "0.6.1-beta commit=v0.6.1-beta-21-g863bf2f91b245afd58c8edc078a171a55e48f931",     "identity_pubkey": "02a5d8c2fa771570cefd4ab00be298daffca4d64c77cfc8a0d411a6c1b638cc092",     "alias": "02a5d8c2fa771570cefd",     "num_pending_channels": 0,     "num_active_channels": 0,     "num_inactive_channels": 0,     "num_peers": 3,     "block_height": 1517489,     "block_hash": "00000000000000723b9b81a3d7433385eec9e03fe1ecff2a3ea850171f70f639",     "best_header_timestamp": 1558348537,     "synced_to_chain": true,     "testnet": true,     "chains": [         {             "chain": "bitcoin",             "network": "testnet"         }     ],     "uris": null }  # lncli --macaroonpath=/home/bitcoin/.lnd_1/chain/bitcoin/testnet/admin.macaroon --rpcserver=localhost:10010 --lnddir=/home/bitcoin/.lnd_1 getnetworkinfo {     "graph_diameter": 0,     "avg_out_degree": 6.239715591670899,     "max_out_degree": 775,     "num_nodes": 1969,     "num_channels": 6143,     "total_network_capacity": "48768373513",     "avg_channel_size": 7938852.924141299,     "min_channel_size": "4000",     "max_channel_size": "16777216",     "median_channel_size_sat": "5000000" } 
  • invoice created at starblocks.acinq.co

https://starblocks.acinq.co/order/75c4e1cceefa2b59c49890f1e5466680

Why isn’t a binary not being found in my PATH?

I’ve got a Python project which uses a virtual environment. In my project folder, there is a bin/ folder which contains all the executables needed by the project. To use these, you run source bin/activate to insert the path to that bin/ directory to your PATH variable.

Now, most of the time this works as I’d expect. I run the source command and when I run which python, it shows the one I’d expect from the virtual environment. Sometimes however, it doesn’t list that one. It lists a different one on my PATH. Here’s an example of what I see:

We can see we are in the project directory:

$   pwd /Users/dalemy/Projects/my_project 

We can also see that the python and python3 binaries (actually symlinks) are in the bin/ directory:

$   ls -al /Users/dalemy/Projects/my_project/bin/python* lrwxr-xr-x  1 dalemy  staff    7 10 Feb 15:16 /Users/dalemy/Projects/my_project/bin/python -> python3 lrwxr-xr-x  1 dalemy  staff   44 10 Feb 15:16 /Users/dalemy/Projects/my_project/bin/python3 -> /usr/local/Cellar/python/3.7.2_1/bin/python3 

Here we can see that this is the first entry in the PATH variable:

$   echo $  PATH /Users/dalemy/Projects/my_project/bin:/Users/dalemy/.poetry/bin:/usr/local/opt/python3/bin:/usr/local/opt/ruby/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Users/dalemy/Config/scripts:/Users/dalemy/.poetry/bin:/Users/dalemy/.local/bin 

But when we ask about where Python is located, it doesn’t find it:

$   which python /usr/local/bin/python  $   which python3 /usr/local/opt/python3/bin/python3 

Running type -a shows the same thing:

$   type -a python python is /usr/local/bin/python python is /usr/bin/python python is /usr/local/bin/python python is /usr/bin/python 

I’ve got no idea why this is happening. The bin/activate command runs hash -r and I’ve run it manually to be sure that it’s clearing out anything cached. If I remove every single entry on my PATH except for the first one, I just get that it can’t be found.

Once it starts doing this, the only solution I’ve found is to remove the virtual environment completely and recreate it.

What could possibly be going wrong here?

Clipping Path With Pixel Perfect Quality for $20

Hi, ASK ME BEFORE YOU ORDER IF IMAGES HAS HAIR/MODELS I am very experienced and quick.I will remove background from your images using hand made photoshop clipping path. My service starts at 15 images at $ 5 Background remove.. White, transparent or any color you want Multiple format image delivery(jpg,png,psd,tiff…etc…) Resizing Basic touch up 24-hour Express delivery Unlimited revisions N.B- Ask me for Best price If the images are complex jewelry, Bicycle, or Models with hair. Shadowing/Reflection is not included. Please ask for price. PLEASE CONTACT BEFORE ORDERING

by: muhammadmim
Created: —
Category: Graphics & Logos
Viewed: 204


Images Remove Background By Photoshop Clipping Path for $5

10 Images For the only 5USD. I am very experienced and quick. I will remove the background from your images using hand made Photoshop clipping path. Background cut out. White Background, transparent Background or any other Background Multiple format image delivery Resizing is full Free Basic touch up 12 Hrs Super Fast Delivery Unlimited revisions For details please feel free to send a message. we have more then 2+ years experience in Adobe Photoshop and graphic design. Thanks

by: kingmakers
Created: —
Category: Graphics & Logos
Viewed: 185


Shortest Path in Layerwise Complete Graph

Consider a directed $ k$ partite graph $ G$ with a source node $ s$ and a sink node $ t$ . Each vertex in the graph is labeled with a positive integer value. Both the source and sink are labeled with $ 0$ . There are directed edges from the $ s$ to all vertices in partition $ 0$ . There are directed edges from all vertices in partition $ k$ ,, ie, the last partition to $ t$ . $ G$ is layerwise complete that is, in addition to the above, there is a directed edge from all vertices in partition $ i$ to all vertices in partition $ i+1$ , ie, adjacent partitions form complete bipartite graphs. An edge between any two nodes is labeled with a negative integer value or with $ 0$ .

There could also be directed edges between nodes in partitions $ m$ and $ n$ where $ 1 \leq m, n \leq k, m \lt n, n \neq (m+1)$ , and labeled with a negative value. This is depicted in the following figure where there are two edges between partition $ 1$ and partition $ 3$ indicated with dashed lines. Non adjacent partitions do not form complete bipartite graphs. They only comprise edges as indicated. In the figure, the edge labels are shown with negative values, wherever edges are not labeled with values, they are labeled with $ 0$ by default.

enter image description here

Consider all paths from $ s$ to $ t$ . The length of this path would be calculated as the addition of all the integer labels of the nodes on this path and the addition of the edge labels if there is an edge between any pair of vertices in this path. For example, the length of the path taking the first vertex from each partition would thus be $ 0 + 50 + 30 + 50 + 0 -8$ , where the negative value of $ -8$ corresponds to the edge between nodes labeled with $ 50$ and $ 50$ . Similarly, if we took the first vertex from partition $ 1$ , the last vertex from partition $ 2$ and the first vertex from partition $ 3$ , the length of this path would be $ 0 + 50 + 40 + 50 + 0 – 6$ , where the $ -6$ value corresponds to the edge between the first vertex in partition $ 1$ and partition $ 2$ . The $ 0$ values correspond to the source and sink vertices.

Find the shortest path from $ s$ to $ t$ taking exactly one vertex from each $ k$ -partition where the length would be calculated as described.