Combining 2 problems in NP into one

Say I have a deterministic turing machine which solves decision problem S with oracle access to both problems B, C that are in $NP$.
Can S be solved with oracle access to only one problem in $NP$?

That is, can B and C somehow be combined into one problem in $NP$ (thus showing S is in $P^{NP}$)?

jquery – Problems with javascript functionality

I am trying to improve or perform this function, but I am not obsessing about the success of a feedback that could be appreciated.

On request, no bank or process, no backend, being feito in 480ms, to carry the dice on the web, it is taking 8sec.

Or that I think I'm mistaken?

 function listarPlanejamentoCompras() {
$.ajax({
    url: "/Almoxarifado/PlanejamentoCompra/ListaPlanejamentoCompras",
    data: {
        pEstabelecimento: $('#ddlEstabelecimento').val()
    },
    beforeSend: function () {
        adicionarLoadingTela();
        $('#tabCotacao').empty();            
        $('#qtdeCotacao').text('0');            
    }
}).done(function (result) {
    if (result) {                        
        let contador = 1;
        $.each(result, function (i, value) {                
            if ($(`#pnGrupo${value.Id}`).length === 0) {      
                $('#qtdeCotacao').text(contador++);                                        
                $(`#tabCotacao`).append(`
                    
${value.Descricao}
${value.Cotacoes.map(value => `

${value.Planejamento.Grupo.Item.Item.Id} - ${value.Planejamento.Grupo.Item.Item.Descricao}

${value.Planejamento.Grupo.Item.Fabricante}

${value.Planejamento.Grupo.Item.Quantidade.formatMoney(2, ',', '.')}

${value.Planejamento.Grupo.Item.Concentracao.formatMoney(2, ',', '.')} ${value.Planejamento.Grupo.Item.Dosagem}

${moment(value.Planejamento.DataPlanejamento).format('MM/YYYY')}

${value.Planejamento.Grupo.Item.Item.PlanejamentoComICMS.formatMoney(2, ',', '.')}

${value.Planejamento.Grupo.Item.Item.Fornecedores.map(fornecedor => ` `).join('')}
Fornecedor Nome Abrev. Cidade/Estado Contato Condição de Pagamento Marca Entrega Icms Valor
0 ? 'readonly' : ''} value="${fornecedor.Id === 0 ? '' : fornecedor.Id}" />

0 ? '' : 'hidden'}>

Últimas Compras

${value.Planejamento.Grupo.Item.Item.UltimasCompras.map(compra => ` `).join('')}
Estab Fornecedor Nome abrev Data Valor Unit ICM IPI PIS COFINS SS Dif ICMS Desconto Vlr Liquido Qtde Vlr Total Entrega Cond Pagto Marca Contato
${compra.Ordem.Estabelecimento.Sigla} ${compra.Ordem.Cotacao.Fornecedor.Id} ${compra.Ordem.Cotacao.Fornecedor.NomeAbrev} ${moment(compra.Ordem.Cotacao.DataCotacao).format("DD/MM/YYYY")} ${compra.Ordem.Cotacao.PrecoUnitario.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.Icms.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.Ipi.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.Pis.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.Cofins.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.SuperSimples} ${compra.Ordem.Cotacao.DiferencialIcms.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.Desconto.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.PrecoLiquido.formatMoney(2, ',', '.')} ${compra.Ordem.QuantidadeSolicitada.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.PrecoTotal.formatMoney(2, ',', '.')} ${compra.Ordem.Cotacao.DiasEntrega} ${compra.Ordem.Cotacao.Fornecedor.CondicaoPagamento.Id} ${compra.Ordem.Cotacao.Marca.toUpperCase()} ${compra.Ordem.Cotacao.Contato.replace(/s.*$/, "").toUpperCase().trim()}
`).join('')}

`); } }); } }).fail(function () { }).always(function () { datePckr(".txbEntrega"); $('.ddlCondicaoPagamento').selectpicker('refresh'); $('.ddlMarca').selectpicker('refresh'); $('.txbFornecedorId').mask('000000'); $(`.txbIcms`).mask("00,00", { reverse: true, maxlength: true }); $(`.txbValor`).mask("#.##0,00", { reverse: true, maxlength: true }); carregamentoDaTela = false; removerLoadingTela(); });

}

linear algebra – Problems with rank of a matrix

Thanks for contributing an answer to MathOverflow!

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

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, see our tips on writing great answers.

nonce – Draft preview and customize permission problems on multisite main site

So I’ve been stuck on this problem for quite a while now and it feels like I’ve tried everything. I would love for some support here.

Setup

  • A WordPress multisite with Bedrock structure
  • PHP 7.3.17 (local) and PHP 7.2.24 (live)
  • Apache
  • Themes: Custom “mother theme” and child themes for each site.

Problem

The first site among the multisites seem to have some kind of structural problem. The other sites works just fine.

When previewing drafts on posts and pages the user (including superadmin) gets a message: Sorry, you are not allowed to preview drafts. I’ve tracked it down to _show_post_preview() in wp-includes/revision.php and it seems like the nonce check fails.

A similar problem occurs when customizing the site. When trying to save changes you get: You need a higher level of permission. Sorry, you are not allowed to customize this site. This error is thrown in wp-admin/js/customize-controls.js in function cheatin() which seem to be used when the nonce is off.

What I’ve tried (no luck)

  • Deactivating all plugins
  • Switching to one of the other child themes that works on their sites
  • Clear WordPress cache
  • Clear browser cache
  • Creating the nonce by myself in the preview_post_link filter.
  • Double, triple check .htaccess and wp-config.php (in Bedrock: config/application.php)

My .htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - (L)

# add a trailing slash to /wp-admin
RewriteRule ^((_0-9a-zA-Z-)+/)?wp-admin$ $1wp-admin/ (R=301,L)

RewriteCond %{REQUEST_FILENAME} -f (OR)
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - (L)
RewriteRule ^((_0-9a-zA-Z-)+/)?(wp-(content|admin|includes).*) wp/$2 (L)
RewriteRule ^((_0-9a-zA-Z-)+/)?(.*.php)$ wp/$2 (L)
RewriteRule . index.php (L)

20.04 – Software store missing apps + Chrome remote Desktop problems

So this is how the store looks:

View post on imgur.com


Which is fine, but when I click a category, this is all the apps that show up: (this is editors pick, happens to all)

View post on imgur.com


There’s supposed to be more, I’ve tried reinstalling gnome software and that doesn’t work
I’m using Ubuntu 20.04 (external live persistence hard drive, “Try Ubuntu” selected)

Also problems with chrome remote desktop:
https://imgur.com/a/879urQa (I click turn on, set up a name and password, and this shows up)

blockchain – Problems Setting a Transaction Fee on a Per Transaction Basis Bitcoind

I’ve spent hours and hours trying to find a solution to this problem, with no success.

Using Bitcoin Core on a Linux machine, so using bitcoin-cli to process commands back to the daemon.

Here’s what I want to achieve: I want to send a transaction and be able to specify a custom transaction fee in Bitcoin/KB on a “per transaction basis”.

So far, I haven’t found a solution. These are the areas I have been looking at:

Change the paytxfee global variable and then just send the transaction. —> If I do this, the resultant fee once the transaction has been sent is about 40% lower than what I specified in the paytxfee variable. Why is it smaller?

So…. does anyone please have any ideas how I can just send a transaction and specify a custom fee which is the actual fee used when the transaction is broadcast to the network?

Thanks in advance for your help.

Edit

Hi. Thank you for your reply. I’m panicking a bit as I have to get this sorted by tomorrow. I’ve tried setting “paytxfee” with the “settxfee” command. In the last example I sent a dummy transaction using “sendtoaddress”. I entered “0.00170” in the “paytxfee” global variable (170 satoshis per byte). Having looked at the resultant transaction on Blockchain.com explorer, only 114 sat/B were used instead of the requested 170. When I used “fundrawtransaction” and specified a “feeRate” option, it was calcultaing the fee on the virtual size rather than the total size, so once again I was getting about a 40% reduction in fees once the transaction was broadcast. I now have loads of transactions stuck!! Anyway, that’s not a problem as they were only tests… Any ideas how I can resolve this? Happy to send screenshots or maybe we can email/use messenger? Desperate to get this sorted …. Thank you so much!

Examples of problems / tests that can (surprisingly) be represented in terms of graphics

I'm looking for examples of math problems or tests that have an equivalent representation in terms of graphs, which makes solving the problem easier.

For example, the problem of finding how many investments are required to order a matrix can be solved by representing the problem as a graph.

magento2.3 – Performance problems with Magento 2.3.5-p1 out of box (no changes made whatsoever). Is tweaking necessary after initial install?

fresh install of Magento 2.3.5-p1 via Softaculous
php 7.2
4 x 2.50GHz Cores
8 GB RAM
160 GB SSD Space
5 TB Bandwidth
cPanel/WHM/Softaculous
5000 Mbps Network Out

We moved to a new hosting company which clams to be Magento friendly. We have a Cloud VPS package with the specs above. We are able to run Magento 1.9.x on there with no problems whatsoever. However, every time I tried to install a version of 2.x – we always seem to experience the same issue where both the front end and the back-end are extremely slow (we get the progress circle going round and round).

Most recently, I have installed the latest Magento version (2.3.5-p1) via Softaculous with Sample Data. When going through the front end ordering a sample product (which was already included in the default LUMA theme) – it is extremely slow (again – getting the progress circle going round and round and round – it eventually goes away). Also, the back end is the same – slow with the progress circle going round and round.

I have cleared and enabled all Cache. Index Management is set to Update by Schedule. I tried googling this but have not found any important steps one should do AFTER an out of box install (other than configuring store, installing extensions etc – we have NOT made any changes to the store at all).

Our hosting company confirmed that we meet all of the minimum system requirements.

enter image description here

enter image description here

Google search: hobbyist needs help on subfolders and url problems

I am in the process of writing a website for my grandfather's business, but I am still quite fond and have little experience in web development, and I have some difficulties that bother me.

Basically, my website now consists of an English home page (my index.html file) and a German and Russian translation of this page (de.html + ru.html), which can be accessed via a button in the upper right corner.

After some SEO research, I found that putting a keyword in the URL itself is helpful for visibility of search results.

Now I wonder how I can achieve that …

Should I create a new subfolder in my public root and assign it a keyword as a name? Then put the file index.html (and the two translations: de.html + ru.html) in this folder, so my URL is always at www.my-domain.com/keyword/***.html in search results? I suspect this requires a redirect and .htaccess change, but I'm not sure how.

It would be great if someone can help me with this, because I can't find an answer to these problems, even if it seems quite common. I've even reviewed most of Google Webmaster's office hours videos on YouTube, but this problem is probably so basic that I'm almost embarrassed to ask.

Covid-19 Exchange rate problems.

[enter image description here] [1]

[1]: https://i.stack.imgur.com/EnzST.png.