Remains API – Multiple API and Multiple Value of Access-Control-Allow-Origin

I use this in the htaccess file to enable cross-domain queries:

Set of Access-Control-Allow-Origin Headers "*"

The problem is that when I try to use jquery to load a query, I get the following error: Access XMLHttpRequest at the address & # 39; https: // **** / wp-json / wp / v2 / restaurant? Statuses = public & per_page = 5 & page = 1 & # 39; since the beginning http: // localhost & # 39; was blocked by the CORS policy: The & # 39; The Access-Control-Allow-Origin header contains multiple values ​​& # 39; http: // localhost, * & # 39; but only one is allowed.

I've checked, there are no multiple values, only "*". Even verified with an external site (this:, he gives me these:

HTTP / 1.1 200 OK =>
Date => Thu, Jun 13, 2019 19:44:42 GMT
Server => Apache
X-Robots-Tag => noindex
X-Content-Type-Options => nosniff
Access Control Headers => X-WP-Total, X-WP-TotalPages
Access-Control-Allow-Headers => Authorization, Content Type
X-WP-Total => 20
X-WP-TotalPages => 4
Link =>; rel = "next"
Allow => GET
Set-Cookie => _icl_current_language = en; Expires = Fri, 14-Jun-2019 19:44:42 GMT; Max Age = 86400; path = / demo / themes /
Cache-Control => max-age = 0
Expires => Thu, 13 Jun 2019 19:44:42 GMT
Vary => Accept-Encoding, User-Agent
Connection => keep alive, close
Access-Control-Allow-Origin => *
Content-Type => application / json; character set = UTF-8

Authorized access control is only a value, so what is it?

Thank you.

division remains rest in the Excel solver

Could anyone tell me how can I create a restriction on the Excel solver in which the variable divided by 50 must return the value 0 of rest of Division?

keyboard – How to remove the remains of applications without root privileges?

I have installed Chrooma Keyboard on an Android Nougat device. It worked well, including dragging to enter text.

After setting Chrooma's settings over and over, he began to have a problem where the ever-sweeping keyboard gave rise to an exclamation point instead of a word.

No problem, I thought. I erased the cache and data from Chrooma and tried it again. The scan error persisted. I then Chrooma uninstalled, cleaned the device using SD Pro Maid and CCleaner and restarted. I thought that these measures would do everything possible to restore Chrooma to its original state (and correct the bug).

But alas, even after taking all these steps, the bug in Chrooma (which was not present at the time it was installed) persisted. This indicates that he probably wrote some sort of configuration file to a storage location that was not erased by erasing the data and the application cache, and even uninstalling it.

Without root privileges, how to completely remove the remains of an application?

dual boot – The reboot after installing Ubuntu 16.04 remains stuck on SCSI cache synchronization

This is the screen I get after pressing restart now at the end of the installation.

He gets stuck in [sda] Synchronization of the SCSI cache.

I'm trying to start both Ubuntu 16.04 on my laptop.

Specifications of the laptop –

  • HP Pavilion Power 15 Notebook PC
  • Intel (R) Core (TM) i7-7700HQ CPU at 2.80 GHz
  • NVIDIA GeForce GTX 1050
  • 1 TB hard drive and 128 GB SSD

I'm trying to install it on my hard drive with a 70 GB partition. Plus, I've disabled Secure Boot.

security – WordPress remains api basic auth with IP verification

I'd like to use basic authentication with the WordPress API, but limit the ability to a single IP address. I've updated the existing code from here: accordingly.

It seems to work well, but I would be interested in any comments on security or improvements.

BasicAuth class
Public static function addAction (): void
$ instance = new static;
add_filter (& # 39; determ_current_user & # 39 ;, [$instance, 'json_basic_auth_handler']20);
add_filter (& # 39; rest_authentication_errors & # 39 ;, [$instance, 'json_basic_auth_error']20);

protected $ result;

/ **
* Based on:
* @param int | bool $ user
* @return int | bool | null $ user
* /
function json_basic_auth_handler ($ user)
$ this-> result = null;
// Do not authenticate twice
if (! empty ($ user)) {
return $ user;
// Check that we are trying to authenticate ourselves
if (! isset ($ _ SERVER['PHP_AUTH_USER'])) {
return $ user;
// Check the customer's IP
if (! $ this-> checkIpPermitted ()) {
return $ user;
$ username = $ _SERVER['PHP_AUTH_USER'];
$ password = $ _SERVER['PHP_AUTH_PW'];
/ **
* In multi-site, the filter wp_authenticate_spam_check is running on the authentication. This filter calls
* get_currentuserinfo which in turn calls the filter Determine_Current_user. This leads to the infinite
* recursion and stack overflow, unless the current function is removed from determ_current_user
* filter when authenticating.
* /
remove_filter (& # 39; determination_current_user & # 39 ;, & quot; json_basic_auth_handler & # 39 ;, 20);
$ user = wp_authenticate ($ username, $ password); / ** @var WP_User | WP_Error $ * /
add_filter (& # 39; determ_current_user & # 39 ;, & quot; json_basic_auth_handler & # 39 ;, 20);
// Failed to authenticate
if (is_wp_error ($ user)) {
$ this-> result = $ user;
return null;
// successful authentication
$ this-> result = true;
return $ user-> ID;

protected function checkIpPermitted (): bool
$ options = get_option (OptionsPage :: CONNECT_OPTIONS);
$ ip = $ options['ip'] ?? & # 39; & # 39 ;;
if (($ _SERVER['REMOTE_ADDR'] ?? null)! == $ ip) {
$ this-> result = new WP_Error (& # 39; ip-blocked & # 39 ;, & quot; Invalid request & quot;);
returns false;
return true;

json_basic_auth_error function ($ error)
// Passthrough more errors
if (! empty ($ error)) {
return $ error;
// WP_Error if authentication error, null if the authentication method was not used, true if the authentication was successful.
returns $ this-> result;

validation – AlertDialog remains open when fields are empty – Kotlin

With Kotlin, how to make sure that an AlertDialog stays open after you verify that the EditText properties are empty
and the user tried to click OK.
I'm currently using the most basic method, closing AlertDialog …
And drop a toast …

Here is the code snippet:

replace fun onClick (view: see) {
if ( == {
showFormTeacher ()

private fun showFormTeacher () {
val view: View = LayoutInflater.from (this) .inflate (R.layout.dialog_add_teacher, null)
AlertDialog.Builder (this)
.setTitle ("Add a teacher")
.setView (see)
.setPositiveButton ("OK") {dialog, which ->
// I'm not sure it's in this part that the code should check
// The interesting thing was to check with the isBlank () function and add setError ()
.setNegativeButton (getString (R.string.cancel), null)
.show ()


XML Layout:

Any help, sincere thanks

remains – API successful, but now what

REST data can be consumed by just about anything: JavaScript, C #, PowerShell and of course Power BI.

  1. Launch Power BI Desktop
  2. Click Get Ribbon Data.
  3. Click OData Feed.
  4. Enter a URL to a SharePoint Web Service. It recovers all the touring bikes.
    This example assumes a list named "Motorcycles for Power BI".
    Example:'Bikes for Power BI & # 39;) / Items? $ filter = category eq & # 39; Touring & # 39;
  5. Click OK.
  6. Search and check your SharePoint list.
  7. Review your data and click Edit. (SharePoint adds a number of hidden / internal columns that you will probably want to exclude.)
  8. Optional: In the Query Parameters area, click in the Name box and enter a new name for the imported data.
  9. Select all the columns you do not need and click Remove Columns. Or, select the columns you want to keep, click the drop-down menu under Delete Columns, and then click Remove Other Columns.
    For the list of class examples, keep the bikeID, color, category, size and price columns.
  10. Click Close and Apply.
  11. Create your visuals!

Magento 2: Remains Api for the customer ID with token

I want to get the client ID with the token. Currently, we only receive access tokens with the help of this API.
– remainder / V1 / integration / customer / token
Method: Post

"username": "",
"password": "customer1pw"

} `

how to receive the token and the customer ID

A Mac Mini headless server remains stuck (not SSH compatible) after reboot (macOS Mojave)

When I restart a Mac Mini headless server that runs macOS Mojave with a sudo reboot, it becomes non ssh -able. The same thing happens if a "wrong monitor" HDMI display emulator is connected. This happens consistently with several Mac Mini machines. Interestingly, a "hard reboot" (holding down the power button until the machine turns off and on again) allows the host to come back online. even without having to plug in a monitor.

Also, this problem does not occur if an actual monitor is plugged in – in this case, the machine reboots correctly and returns online.

boot – Can not open the BIOS / UEFI, the screen remains black

I have an XMG Walker on which I wanted to make a new installation.
The included Win10 reset did not work. I've tried booting from a bootable USB drive, which runs on other devices (support creation tool), but I was unable to access the boot menu / UEFI / BIOS when you press F2 / F9 / F10 / F12 / ENTER / DEL.
So I started the configuration on the stick from Windows itself. The installation process started and at some point the device tried to reboot.

Since the screen remains black. When I press F2 on startup, it seems to go into hibernation (depending on which light is flashing slowly).

An idea of ​​what could do the business or what happened? I've connected both: HDMI and Display Port to be sure to capture a signal when there is one. Also, I once removed the SSD and still no picture.