sharepoint online – SPFx calls blocked by CORS policy

I have tried to access different apis via SPFx and I constantly see this problem. I do not know how to solve this problem. Can someone help or explain what I'm doing wrong or missing?

It works perfectly with $ .getJSON ("https://www.mindicador.cl/api") .then (console.log)

workbench.html: 1 Access to extraction on & # 39; https: //www.mindicador.cl/api'
since the beginning https: // localhost: 4321 & # 39; was blocked by the CORS policy:
The response to the preflight request fails to verify access control:
does not have the ok HTTP status.

My function:

        private makeRequest (): Promise {
const url = `https: // www.mindicador.cl / api`;

const requestHeaders: Headers = new Headers ();

requestHeaders.append ("Content-type", "application / json");
requestHeaders.append ("Accept", "application / json");
requestHeaders.append ("Access-Control-Allow-Origin", "*");

const httpClientOptions: IHttpClientOptions = {
headers: requestHeaders,
method: "GET"
};

return this.context.httpClient
.get (url, HttpClient.configurations.v1, httpClientOptions)
.then (answer => {
console.log (response);
return response.json ();
});
}

Website Design – What is the best way to illustrate the calls and answers on a timeline?

Problem:

I have a platform that sends and receives notifications from mobile users. Here is how the process works.

  1. A platform user steals a mobile user.
  2. A little later, the mobile user will respond with a boolean answer (good or bad) to the platform.

The user of the platform can send several pokes a day or at a time, and the mobile user can respond in seconds to a few hours. I would like to give the platform user an overview of the poke / response activity over time. I am also used to using a graph because the whole of my platform site is slowly turning into a simple collection of pages with different tables + detailed maps.

Current solution

Here is what I have now. You can see that the selected event is higher on the timeline's graph to show the accent:

Current solution
This poses many problems. This is not attractive, the height only serves to distinguish the pokes from the answers, and the quick answers of the users are simply stacked on top of each other.

Any ideas on how to convey this information?

Call Screening – How to filter automated calls by forcing the caller to press a certain key combination? (CAPTCHA audio)

I try to stop all the unwanted calls I receive. I have tried several applications such as Hiya, TrueCaller, etc. unfortunately, phone numbers are easy to steal and these apps can not filter all this spam

Allow only calls from my contact list is not an option for the moment

Question – is there a way to answer the call, ask the caller to press certain keys (message like "Press 4-5-6 to be connected) and disconnect the call if the caller failed to do it?" (CAPTCHA audio)

I have Android 7.1.1

mathematical optimization – NMinimize calls a function defined by itself

I want to call a function defined by NMinimize. For simplicity, let's define the problem as follows:

radpatt[x1_] : =
(Impression[x1];
x1
)

NMinimize[{radpatt[xx], 0.1 <= xx <= 1.1}, {xx}]

If you execute the instructions listed above, you will notice that x1 is not a number as soon as the radpatt function is called by NMinimize, but it is equal to xx. This causes me a problem because in my initial problem, x1 must be a number just at the beginning of my own function. Ideas?

Thank you very much in advance.

Test – concise simulations against affirmation of calls received

Let's say we have this method:

string Add (int a, int b) {
var sum = _calculator.Add (a, b);
var answer = _formatter.Format (sum);
return of response;
}

Now, I want to test this method. Of course, suppose that the code is not really trivial, _calculator and _formatter could be external services, there is a logic in the method itself and I want to make sure that all my dependencies are correctly called and that the correct result is returned. Of course, we will make fun of the calculator and formatting, but what should I laugh at and what should I check?
I also see options –

Configure the templates to respond to any input with a specific output and then make sure that they were called with the expected input:

calculator = Substitute.For();
calculator.Add (Arg.Any(), Arg.Any()). returns (123);
formatter = Substitute.For();
formatter.Format (Arg.Any()). returns ("yup");

var subject = new DidntThinkOfClassName (calculator, trainer);
var res = subject.Add (1, 2);

calculator.Received (1) .Add (1, 2);
trainer.Received (1) .Format (123);
res.ShouldBe ("yup");

Or configure the simulacra to ONLY answer the expected input, then check only the final result:

calculator = Substitute.For();
calculator.Add (1, 2) .Return (123);
formatter = Substitute.For();
trainer.Format (123) .returns ("yup");

var subject = new DidntThinkOfClassName (calculator, trainer);
var res = subject.Add (1, 2);

res.ShouldBe ("yup");

In the first option, I accept any input, which simply means sham, but then I have to check the received calls.
In the second option, I arrange my simulacra so that the final result can only be achieved if everyone simulates receiving exactly what it was configured for, so I only have to check the final result.

What would you say better? Is there a better solution that I miss?

Call Screening – How to filter automated calls by forcing the caller to press a certain key combination?

I try to stop all the unwanted calls I receive. I have tried several applications such as Hiya, TrueCaller, etc. unfortunately, phone numbers are easy to steal and these apps can not filter all this spam

Allow calls from my contact list is not an option for the moment

Question – is there an application that will answer the call, ask the caller to press certain keys (type message "Press 4-5-6 to connect) and disconnect the call if the caller failed to do so?

I have Android 7.1.1

Theme making ajax direct calls to a theme folder

So, I'm using a wordpress theme (unfortunately, I can not get any support for this theme anymore), and it has a contact form that directly calls an ajax file to a php file in the "includes" folder of the theme . However, any ajax calls to this file result in a 404 error. Therefore, the contact form is not able to successfully post messages.

Which server setting is probably responsible for restricting public access to php files in the themes folder?

java – Test of a service that makes database calls, without a database

I am working on a new service. For a year, I have not needed to write tests from scratch. I've either fixed a bug or added features that require a test change, but without writing everything from scratch.
I have to make sure I get it right. The unit tests below test a service that queries a database.

* Proc files use Springs @Deposit annotation, and each calls a different stored procedure in the database. For these tests, I do not care about everything. Did I do it right? Is there something I forgot? Something I have possibly missed? The tests all succeed when I run them in my IDE or with maven. In this particular case, these method calls simply return the object or objects extracted from the database; so there is no real business logic except call the get() method of proc objects that I do not care.
Did I do things right?

                @RunWith (MockitoJUnitRunner.class)
@SpringBootTest
Public class FusServiceImplTest {

@Mock
private GetFileInfoByIdProc getFileInfobyIdProc;
@Mock
private GetFileInfoProc getFileInfoProc;
@Mock
private GetFileInfoByFileNameProc getFileInfoByFileNameProc;
@Mock
FileInfoVO voMock;
@Mock
FileInfoVO voMock2;

@InjectMocks
private FusServiceImpl service;

@Test
public void whenGetFileById_thenReturnFile () {
Final final ID = 99999L;

when (getFileInfobyIdProc.get (ID)). thenReturn (voMock);



FileInfoVO voResult = service.getFile (ID);

assertThat (voResult.getFileName ())
.isEqualTo (voMock.getFileName ());


}

@Test
empty public whenGetFileByName_thenReturnFile () {
final String NAME = "test.file";

when (getFileInfoByFileNameProc.get (NAME)). thenReturn (voMock);

FileInfoVO voResult = service.getFile (NAME);

assertThat (voResult.getFileName ())
.isEqualTo (voMock.getFileName ());


}

@Test
empty public when GetAllFiles_thenReturnAllFiles () {

listing list = new ArrayList <> ();
list.add (voMock);
list.add (voMock2);

when (getFileInfoProc.get ()). thenReturn (list);

listing voListResult = service.getAllFiles ();

assertThat (voListResult.size ())
.isEqualTo (list.size ());


}

}

postgresql – Where are the calls to the PG systemd model unit? And how to remove them?

On Ubuntu 16.04, if I run systemctl list-units postgres *, I receive:

        UNITE CHARGE ACTIVE SUB DESCRIPTION
active loaded postgresql.service running the PostgreSQL RDBMS
● postgresql@10-main.service loaded failed failed PostgreSQL Cluster 10-hand
● postgresql@9.6-main.service failed failed PostgreSQL Cluster 9.6-main

The first line (postgresql.service) is my own unit file for PG 10.1, which I wrote myself, and works well. The other two are the result of calls to the /lib/systemd/system/postgresql@.service model of unity. I do not know where these calls are coming from, and therefore I do not know how to remove them so that I do not have two failing services that I do not need.

For "call", I mean a line like systemctl start postgresql @ 10 / main which creates a unit based on the model. I did not write any script with such a line.

Hence, where do these attempts to instantiate the model come from? And how to eliminate them?

PD. I have old installations of PG 9.6 and PG 10, which I rarely use. All were installed from the PG repository. I prefer to use systemd to handle the PG daemon against PG native commands.

simcard not found emergency calls only

I use the glory of Samsung Galaxy. When I flashed cm12, my phone is unable to detect a sim card when I've dialed ## 4636 ## I can not even turn on the radio there. When I chose the preferred network option, this indicates unknown.
The main problem is that my phone indicates a number but can not detect a SIM card. Thank you for helping me and giving me solutions. His request.