8 – How to prevent views from replacing single quotes with double quotes in HTML output?

I am using the option to rewrite a field of view to generate some HTML. A tag has a data attribute, which must contain an array for later use in JavaScript with JSON.parse ():

...

by JSON.parse () it is necessary to enclose the matrix fields within double quotes, that's why I have to use single quotes for the enclosure of the HTML attribute. The output should look like this:

...

But somewhere in the process, Drupal replaces the single quotes with double quotes, changing the output to:

...

What is apparently badly formatted.

My question is: why does this happen, where does it occur and is there an alternative solution?

I know it would be a much cleaner approach to write a custom field of views. But, again, this feels a bit like an exaggeration.

port forwarding – Plex over double NAT

I am trying to circumvent the NAT of my Internet Service Provider (ISP) and still I can access my plex server from the outside.

I found two guides:

Tunneling out of Carrier Grade Nat (CGNAT) with SSH and AWS

https://amoss.me/2017/05/port-forwarding-behind-a-carrier-grade-nat/

To implement I have a ubuntu 16.04 virtual machine hosted by digitalocean, which has a public IP. I can send an ssh from my plex server (also ubuntu 16.04) to the remote server of the digital ocean.

On my Plex server I execute the following command:

ssh -nNTv -R 32400: localhost: 32400 root @

And leave that running on a screen.

The tunnel is successful. From the remote host here is netstat and nc -v to the loopback interface:

root @ Ubuntu1604: ~ / .ssh # nc -v 127.0.0.1 32400
Connection to 127.0.0.1 32400 ports. [tcp/*] had success

root @ Ubuntu1604: ~ / .ssh # netstat -tln
Active internet connections (servers only)
Proto Recv-Q Send-Q Local address Foreign address State
tcp 0 0 127.0.0.1:32400 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :: 1: 32400 ::: * LISTEN
tcp6 0 0 ::: 22 ::: * LISTEN
root @ Ubuntu1604: ~ / .ssh # 

But as you can see, it's not listening on its public IP. The only other active interface, besides the return loop, is eth0, to which the public IP address is assigned. So if I try to access public IP remote server: 32400 I do not get anything.

How can I make my remote server listen on 32400 eth0, while I forward it to my local server: 32400?

javascript: the ejs form redirects to the double copy of URL (express.js)

I am new to the backend and I have problems for the fast shipping method to work.
I created a file called new.ejs that contains a form that redirects to a URL http: // localhost: 3000 / campgrounds /

new.ejs file

<% include partials/header %>

    

Create a new campsite

<% include partials/footer %>

I checked my index.js file and I do not see any problem at all. but when I click on the Submit button, it redirects me to http: // localhost: 3000 / campgrounds / campgrounds instead if http: // localhost: 3000 / campgrounds /

index.js file

const express = require (& # 39; express & # 39;);
const app = express ();
const bodyParser = require ("body-parser");

app.use (bodyParser.urlencoded ({extended: true}));
app.set (& # 39; view engine & # 39 ;, & # 39; ejs & # 39;);

leave camps = [
    {name: "salmon creek", image: "https://pixabay.com/get/e837b1072af4003ed1584d05fb1d4e97e07ee3d21cac104491f4c278a7eeb1bc_340.jpg"},
    {name: "Granite Hill", image: "https://pixabay.com/get/e83db7082af3043ed1584d05fb1d4e97e07ee3d21cac104491f4c278a7eeb1bc_340.jpg"},
    {name: "Mountain Goat's Rest", image: "https://pixabay.com/get/ef3cb00b2af01c22d2524518b7444795ea76e5d004b0144591f3c079a4e9b1_340.jpg"}
]


app.get (& # 39; / & # 39 ;, (req, res) => {
res.render (& # 39; landing & # 39;);
});

app.get (& # 39; / campgrounds & # 39 ;, (req, res) => {

res.render ("campgrounds", {campgrounds: campgrounds});
});

app.post (& # 39; / campgrounds & # 39 ;, (req, res) => {
Let name = req.body.name;
let image = req.body.image;
let newCampground = {name: name, image: image}
campgrounds.push (newCampground);

res.redirect (& # 39; / campgrounds & # 39;)
});

app.get (& # 39; / campgrounds / new & # 39 ;, (req, res) => {
res.render (& # 39; new & # 39;)
});

app.listen (3000, () => {
console.log (& # 39; Now the application is listening on port 3000! & # 39;);
});

I can not get this application to work. but all the other app.get methods work fine.

Database design: a double associative entity in a business environment that involves revisions of order items?

Suppose you have Item (Article ID, item_name) and Order (Request ID, user_id, order_date) entities, with primary keys denoted in bold. Because an order can consist of several items, and one item can be present in several orders, there is a many-to-many relationship between these entities that is normally divided by inserting an additional associative entity between them, in this case Article – Order (Article ID, Request ID, item_count) with an additional attribute, and dividing the relationship from many to many into two one-to-many relationships.

So far we have the following:

  • Item (Article ID, Article name)
  • Order (Request ID, user_id, order_date)
  • Article – Order (Article ID, Request ID, item count)

Suppose further that a user can review each item received from their order. Is it advisable to create the following additional entity:

  • revision (Article ID, Request ID, grade, comment_content, comment_date),

or it would be more usual to subsume it under Article-Order, in which case we would obtain the following:

  • Article – Order (Article ID, Request ID, item_count, grade, comment_content, comment_date)?

Of course, the latter would allow the possibility of NULL, and for me it does not seem completely conceptual.

Would the first option be the best option if we had to generate an additional attribute, id_review, and declare it as the main key in the revision relationship?

Database design – Double associative entity?

Suppose you have Item (Article ID, item_name) and Order (Request ID, user_id, order_date) entities, with primary keys denoted in bold. Because an order can consist of several items, and one item can be present in several orders, there is a many-to-many relationship between these entities that is normally divided by inserting an additional associative entity between them, in this case Article – Order (Article ID, Request ID, item_count) with an additional field, and dividing the many-to-many relationship into two one-to-many relationships.

So far we have the following:

  • Item (Article ID, Article name)
  • Order (Request ID, user_id, order_date)
  • Article – Order (Article ID, Request ID, item count)

Suppose further that a user can review each item received from their order. Is it advisable to create the following additional entity:

  • revision (Article ID, Request ID, grade, comment_content, comment_date),

or it would be more usual to subsume it under Article-Order, in which case we would obtain the following:

  • Article – Order (Article ID, Request ID, item_count, grade, comment_content, comment_date)?

Of course, the latter would allow the possibility of NULL, and for me it does not seem completely conceptual.

Would the first option be the best option if we had to generate an additional attribute, id_review, and declare it as the main key in the revision relationship?

All bets are activated. Now, let's DOUBLE! ⚡⚡

[COLOR=”#0000FF”]Everything doubles! ⚡⚡
Buy 1 month and receive 2 months. Buy 3 months and get 6. Buy 6 and get 12 and so on.
… Read the rest of http://www.webhostingtalk.com/showthread.php?t=1743176&goto=newpost

Double exposure photo with Gimp.

Interestingly, while the other obvious answer is good enough for more practical purposes, averaging layers with 50% opacity does not always give the true double exposure effect. It's all due to the lack of linearity of sRGB and the fact that often our photo processing applications do not care about gamma, which works as if the pixel values ​​were bright.

So, for those interested:

On the left: superimposing images with 50% opacity in the sRGB space, ignoring gamma (this was the only option in Gimp before 2.9). The result do not It reflects the real effect of double exposure.

On the right: the same, but using the Lineal light Mode (it is only possible in Gimp 2.9 and later versions and it is not the default mode, of course, professional applications like PS can always do it). The result is similar but slightly different, especially in places where the bright pixels of one image meet the dark pixels of the other. This is simulates the double real exposure Where we add light and not pixel values.

comparing sRGB versus linear with 50% opacity

Differential equations: solution of the problem of the eigenvalue for a double well potential using a 1D particle in a box as a basic set

Some of your previous responses have not been well received and you are in danger of being blocked.

Please pay close attention to the following guide:

  • Please make sure answer the question. Provide details and share your research!

But avoid

  • Ask for help, clarifications or respond to other answers.
  • Make statements based on opinion; Support them with references or personal experience.

For more information, see our tips on how to write excellent answers.

Development of double rear camera

Now I have such a problem. The function that I need to develop is the development of the dual rear camera of the Android phone. How can I distinguish it?
The mobile phone that I am using is HUAWEI P5.
I hope to get advice and help here, thanks.

I want to get the value after the decimal point of a double

example
entry…
34,567
exit…
entreo) _34
decimal) _567

but that the value after the decimal point comes out without the 0. (number) simply the number as if it were whole