How Reduction works in proving NP-Hard?

A problem $ X$ is $ NP$ -Hard if for all $ Y \in NP$ , $ Y \leq_P X$ . Further, if a problem $ Z$ is $ NP$ -Complete, and $ Z \leq_P X$ , then I can prove (rather mechanically) that $ X$ is $ NP$ -Hard.

I also found that, for a given X, say TSP, to prove it is $ NP$ -Hard, we often found a Z say $ HAM-CYCLE$ (Hamiltonian-Cycle), and try to show that $ HAM-CYCLE$ can be reduced to a $ TSP$ in polynomial time.

My confusion is, why don’t we try to show that for each instance of $ TSP$ , there exists a corresponding instance of $ HAM-CYCLE$ . Specifically, what if there exists an instance of $ TSP$ , for which there is no corresponding instance in $ HAM-CYCLE$ ! In this case, how can the prior knowledge about the hardness of $ HAM-CYCLE$ help in inferring on TSP’s hardness!

Note: I also had similar concerns with proving $ NP$ -complete class. However, since all $ NPC$ are also $ NP$ , I felt, similar reduction of a known NPC problem to a given problem, say Q, works. However, for $ NP$ -hard case, a given problem X need not to be $ NP$ at all.

WP Rest Api GET method restriction on route, but POST method also works

I’m doing some basic API testing and notice that restricting my new route to GET doesn’t work. POST requests also go though using Postman. (PUT, PATCH, DELETE do not however, displaying a “no matching route/method” error):

function displayDummyData() {   return 'dummy data'; // responds 'dummy data' on POST request }  function checkIfAnyone() {   return true; }   function registerDummyRoute() {   register_rest_route('wp/v2', 'tut', [     'methods' => 'GET',     'callback' => 'displayDummyData',     'permission_callback' => 'checkIfAnyone'   ]); } add_action('rest_api_init', 'registerDummyRoute'); 

How can I restrict this route to only GET requests?

How to set correctly a big title which works on desktop and mobile as well?

I’m working on webpage main title. I want to set a 100% height background image and a big title on the front of it. This is how I did:

In the CSS file:

body, html {   height: 100%; }  .bg {   background-image: url("../img/image.JPG");   height: 100%;    background-position: center;   background-repeat: no-repeat;   background-size: cover;     }  .bigtitle {      /**    padding-left:15%;***/          padding-top: 20%;      color: white;      font-family: 'Trocchi', serif;      font-size: 1500%;      font-weight: normal;      margin: 0;      /*line-height: 1.0em;*/ } 

In HTML file:

<div class="bg">     <center><h1 class="bigtitle">My title</h1></center> </div> 

This is good on the desktop but completely fail on mobile or small screen size. How can do to work on mobile and on desktop as well?

Vypr VPN no more works in 18.10

I have tried to find some solution online, but none has turned up so far, so I ask here: I have a paid VPN connection using VYPR-VPN. After updating to 18.10, I find quite a strange situation:

  • The new network manager widget opens a terminal based program to configure my connections, but there is no VPN option (or is “VLAN” what I need? If yes, it seems quite complicated?).
  • In preferences (main menu) I find a network connection app which actually works as desired (like the ones in the previous lubuntu versions), but whatever I enter there seems to have no influence on the network widget down in the launch bar, and these connections are not offered to me anywhere.

Since I pay for my VPN service, I’d really like to USE it. Does anybody have any idea how to configure my VPN without first having to make a PhD in Linux System Administration? Does it work better in 19.XX? Thanks in advance!

Internet not working on Firfox and Chromium, but works on Tor

I have problem with internet connection for Firefox and Chromium on Ubuntu. I tried few solution. One of them is My browsers can not connect to the internet while my Ubuntu is connected. But no one works.

Ping 8.8.8.8:

ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 

Ping google.com:

ping https://www.google.com ping: unknown host https://www.google.com 

Any help regrading this will be appreciated.

Its this thing with forex works ?

Well i see ads on facebook groups and i make relationship with people .Then they said me if i invest some money i will make like 150% profit or something more ,i use this as an example
and they said that from my profit i need to pay them a little poercent and the rest i will keep it
The think its they said its almost no risks involved .It has someone experience with this as i am thinking its too good to be true ,if it was so easy ,everyone will invest and will make profit
What do you…

Its this thing with forex works ?

Sound only works via bluetooth 18.10

My laptop was totally fine until I wanted to try some Bluetooth speaker I have, since then I can’t have sound through the laptop speaker or anything connected to the mini-plug connector. I tried several things, re installing pulseaudio alsa-base, deleting and ./config/pulse and restart. I don’t know what else to do. I know the speakers work because I have the laptop on dual boot and they work just fine on windows.

Docker run command does not works in bash script

Trying to run a docker container through a bash script. I need the container to start and exit as soon as it is started in the bash script so that I will note the time it took for starting the container. Image is a tar file, copied from another machine using save and load technique. Can run a container from the image in the terminal but not in the shell script using docker run -it imageId command.It displays error “docker:Error response from daemon:OCI runtime create failed:container_linux.go starting process caused executable file not found in $ PATH: unknown. Help is highly appreciated. Thanks

tl_start=$  (date +%s) docker load>alpine.tar tl_end$  (date +%s) tl_load=$  ((tl_end-$  tl_start)) image_id=$  (docker images -a | awk '$  2 ~/none/print{print $  3}') ts_start=$  (date +%s) docker run -i -d alpine:latest $  image_id