apache 2.4 – CORS and Preflight problems while making api calls

I have some CORS and preflight problems with my software I can’t solve. To test it I was ursing a cors test site to simulate it. When I make an api request to my server application I get the following error:

Access to XMLHttpRequest at 'https://example.org/api/articles/2387' from origin 'https://www.test-cors.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

I was adding the follwing code at the end of my .htaccess file, but I still get the same error:

<IfModule mod_headers.c>
Header append X-Frame-Options SAMEORIGIN
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
Header always set Access-Control-Allow-Headers "*, Authorization, authorization"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
# always return 200 for preflight OPTIONS requests
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 (R=200,L)

Also the server is returning “Status Code: 401 Unauthorized”.
As Request Headers I was adding an authorization header (example string):

Authorization: Basic DJFNCNDJKS7574hdfnDDBHr4593834nfnd=

But it’s the right authorization, because I tested the exact same header locally with curl several times (without cross origin) and I always get the requested data. Any idea what’s going on here and how I can solve it?

complexity theory – Hardness of a problem which is the sum of two NP-Hard problems

Consider the problem of computing an exponential sum over a certain function $g(x)=f(x)+h(x)$, that is computing

$$sum_{x}g(x)=sum_{x}f(x)+sum_{x}h(x)$$

now if we know that $sum_{x}f(x)$ and $sum_{x}h(x)$ are two NP-Hard problems, what can we say about the hardness of $sum_{x}g(x)$?

Authentication Gmail vs. Outlook (and problems with Outlook)

To a certain extent, this is related to hosting security since our email address accounts are connected to the management to our hosting acc… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1835705&goto=newpost

Arithmetic Progression Problems

Please solve the following utilizing an arithmetic progression:

Divide 10 apples among 10 students, such that the common difference is 1/8 of an apple.

Problems in plotting a function of two variables

Clear("Global`*")

a = Re(Sqrt(x^2 - 2 x y + y^2 - 1^2));

You cannot take the derivative of a function which contains Re. Use ComplexExpand to avoid use of Re

mat = {{0, -a/Sqrt((x - y)^2 + Abs(a)^2)}, {(x - y)/
       Sqrt((x - y)^2 + Abs(a)^2), 0}} // 
    ComplexExpand(#, TargetFunctions -> {Re, Im}) & // Simplify;

d1 = D(mat, x);
d2 = Simplify(mat . d1, {x >= 0, y >= 0});
fun(x_, y_) = Simplify(
   Tr(d1 . d1) + (1/Det(mat)) Tr(d2 . d2),
   {x >= 0, y >= 0});

Plot3D(
  fun(x, y), {x, 0, 5}, {y, 0, 5},
  PlotPoints -> 75,
  MaxRecursion -> 5,
  ClippingStyle -> None) // Quiet

enter image description here

theming – CSS problems styling the search box block created by Search API Pages module

I’m using Search API and Search API Pages on Drupal 9 and I’m trying to style the Search API Pages search block. The problem is that when placed anywhere but bottom in the sidebar, the search block overlaps with the block below as seen in the attached pics. This makes the blocks visually too close and also (in Firefox) disables the overlapped part of the search box from being clicked in, which is really annoying. Any suggestions for resolving this?

The other issue I’m having is that the fontawesome search icon only appears within the search box in Firefox. In Chrome and Safari the icon is placed at the top left of the page, relative to the body instead of to the search block. What am I missing here?

Overlap between search block and block below

Another view of the overlap

.search-api-page-block-form-search input {
  width: 100%;
}
.search-api-page-block-form-search .form-item {
  width: 70%;
  float: left;
}
.search-api-page-block-form-search .form-actions {
  width: 30%;
  float: right;
}
.search-api-page-block-form-search .form-type-search input {
  border-right: none !important;
  text-indent: 25px;
  background-color: transparent;
  position: relative;
}
.search-api-page-block-form-search .form-type-search:before {
  content: "f002";
  font-family: FontAwesome;
  position: absolute;
  top: 25px;
  left: 35px;
  background-color: transparent;
}
.search-api-page-block-form-search .form-item,
.search-api-page-block-form-search .form-actions {
  margin: 5px auto!important;
  display: inline-block;
  font-family: Consolas, "courier new";
}
.search-api-page-block-form-search .form-actions input {
  font-family: FontAwesome;
  margin: 0 !important;
}

I don’t know whether I’m allowed to provide a link but you can see the problem here: https://verygomez.com/theatre.
Before downvoting this please note that I’m not a coder. I’m trying my best but I’m making this up as I go along.

Thanks!

real analysis – Equivalence of minimization problems for Lipschitz function

Assume that $f: mathbb{R}^n rightarrow mathbb{R} $ is Lipschitz continuous with constant $M$ and that $S subseteq mathbb{R}^n$ is closed. Show that for $lambda > M$ problem of minimizing $f(x) + lambda d(x, S)$, where $d(x,S)$ is a distance from $x$ to $S$ have the same solutions as problem of minimizing $f(x)$ over $S$.

I know that because $S$ is closed, then there exists $b in S$ such that $d(x, S) = d(x, b)$,
Because I now have some $b$ I can use Lipschitz condition to get $d(f(x), f(b)) leq M d(x, b)$. But I don’t see how to proceed further or if this actually gives something useful.

convergence divergence – Do gradient descent converge in convex optimization problems? If so, how?

Sorry in advance if this question sounds too broad or a little bit too obvious.

I know for sure that gradient descent, i.e., the update equation

$x_{k+1} = x_k – epsilon_k nabla f(x_k)$

converge to the unique minimizer of $f$ with domain $text{dom}(f) = mathbb{R}^n$ whenever $f$ is strictly or strongly convex.

However, I could not remember if it converges to a minimizer in convex functions, and how it achieves this convergence.

What is bothering me is that

  1. I’ve seen some conflicting results where instead of $x_k$, an averaged sequence $hat x_{k} = frac{1}{K} sum_k x_k$ converges.

  2. I’ve also seen conflicting results where the step size is decreasing $o(1/k)$ vs it is constant.

  3. There is also the issue of weak vs strong convergence. I’m not sure what this means exactly.

I have know some results but they are for quadratic functions, not for convex functions in general.

Can someone chime in on what this basic result in optimization look like?

Java task, where I had problems

enter image description here

I try to do it but I had 2 simple errors

Problems with formula in google sheet

I have no idea left how to solve the problem:

=WENN(B29="v";SVERWEIS($C$29;Inventarliste!$A$2:$M$109146;3;WENN(B29="m";SVERWEIS($C$29;Merchandise!$A$2:$O$109146;3;))))

I have two when arguments which I need to connect.

desperate in Berlin, thank you Birgit