问:
FilePond,Laravel restore uploaded temporary files on validation failure
after searching a lot here and there I am going to put my question here . If any body can help out in this regard . Let me explain the things I am working on Laravel and Filepond .
Filepond upload and revert is working perfectly but I am facing problem in restoring the file back if the validation gets failed i-e restore the file on filepond.

```<code>
                 files: [{
                     source: 'filename',
                     options: {
                       type: 'limbo',
                    },

                }, ],
</code>```

the source is coming from laravel controller function

```<code>FilePond.setOptions({
                server: {

                    process: './filepond-upload',
                    revert: './filepond-delete',
                    restore: './filepond-restore',
                    // restore: {
                    //     url    :'./filepond-restore/?id=',
                    //     method :'GET',

                    // },
                    headers: {
                        'X-CSRF-TOKEN': '{{ csrf_token() }}',
                        'Access-Control-Expose-Headers': 'Content-Disposition,'
                        // 'Access-Control-Expose-Headers': 'Content-Disposition',
                    }

                }

            });
</code>```

Controller function -

```<code>public function filepondRestore(Request $request, string $id) {
   $abc = ('/posts/tmp/post6399a6ba2ea280.18814893/presentation_1.png');
   return response()->json('', 200, [
      'Content-Type' => 'image/png',
      'Content-Disposition' => 'inline;
      filename="'.$abc.'"',
   ]);
}
</code>```

but either get 302 redirection or 500 server error.
If any body have implemented such kind of functionality I ll be thankful for sharing.
Thanks in advance.
Happy Coding

Body:
after searching a lot here and there I am going to put my question here . If any body can help out in this regard . Let me explain the things I am working on Laravel and Filepond .
Filepond upload and revert is working perfectly but I am facing problem in restoring the file back if the validation gets failed i-e restore the file on filepond.

                 files: [{
                     source: 'filename',
                     options: {
                       type: 'limbo',
                    },

                }, ],

the source is coming from laravel controller function

FilePond.setOptions({
                server: {

                    process: './filepond-upload',
                    revert: './filepond-delete',
                    restore: './filepond-restore',
                    // restore: {
                    //     url    :'./filepond-restore/?id=',
                    //     method :'GET',

                    // },
                    headers: {
                        'X-CSRF-TOKEN': '{{ csrf_token() }}',
                        'Access-Control-Expose-Headers': 'Content-Disposition,'
                        // 'Access-Control-Expose-Headers': 'Content-Disposition',
                    }

                }

            });

Controller function -

public function filepondRestore(Request $request, string $id) {
   $abc = ('/posts/tmp/post6399a6ba2ea280.18814893/presentation_1.png');
   return response()->json('', 200, [
      'Content-Type' => 'image/png',
      'Content-Disposition' => 'inline;
      filename="'.$abc.'"',
   ]);
}

but either get 302 redirection or 500 server error.
If any body have implemented such kind of functionality I ll be thankful for sharing.
Thanks in advance.
Happy Coding


来源: stackexchange

问:
Using VBA to launch chrome with flags. UIAutomation
I made a custom class library in Excel that uses the "Windows UIAutomationClient" to automate some processes at work (Mostly automating vendor websites).  Edge somewhat works ok, but seems to have compatibility issues with the invoke pattern on several sites.  Using chrome on my home PC seems to resolve the issue, but I can't seem to get chrome to launch with accessibility enabled at work.  Inspect.exe shows the webpage as one big element when I'm at my desk.  I'm thinking there may be some UAC restriction at play.  I'm attempting to launch chrome using the "--force-renderer-accessibility" flag to try and get around it, but can't seem to get it to work.  Here is the current code:

```<code>Enum uiBrowserType
    Chrome = 0
    Edge = 1
End Enum

Public Function launchBrowser(urlTxt As String, browserType As uiBrowserType) As Long

Dim filePath As String, cFlags As String, myUrl As String, dblShellReturned As Boolean

If browserType = Chrome Then
    filePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
    cFlags = " -url --force-renderer-accessibility "
End If

If browserType = Edge Then
    filePath = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
    cFlags = " -url --force-renderer-accessibility "
End If

On Error Resume Next
dblShellReturned = Shell(filePath & cFlags & urlTxt, vbNormalFocus)
Err.Clear

If dblShellReturned = True Then
    launchBrowser = 1
Else
    launchBrowser = 0
End If

End Function
</code>```

Am I doing anything wrong?  Or does anyone have any alternative suggestions?

Oh and our IT Security departments official policy is as follows:

"Any request for access to any system; For any reason; Is a serious security risk and will be denied. Even if you need it to do your job.  Now go away and stop bothering me."

So getting them to help isn't exactly an option.  ¯_(ツ)_/¯

ContentLicense: CC BY-SA 4.0

Body:
I made a custom class library in Excel that uses the "Windows UIAutomationClient" to automate some processes at work (Mostly automating vendor websites).  Edge somewhat works ok, but seems to have compatibility issues with the invoke pattern on several sites.  Using chrome on my home PC seems to resolve the issue, but I can't seem to get chrome to launch with accessibility enabled at work.  Inspect.exe shows the webpage as one big element when I'm at my desk.  I'm thinking there may be some UAC restriction at play.  I'm attempting to launch chrome using the "--force-renderer-accessibility" flag to try and get around it, but can't seem to get it to work.  Here is the current code:

Enum uiBrowserType
    Chrome = 0
    Edge = 1
End Enum

Public Function launchBrowser(urlTxt As String, browserType As uiBrowserType) As Long

Dim filePath As String, cFlags As String, myUrl As String, dblShellReturned As Boolean

If browserType = Chrome Then
    filePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
    cFlags = " -url --force-renderer-accessibility "
End If

If browserType = Edge Then
    filePath = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
    cFlags = " -url --force-renderer-accessibility "
End If

On Error Resume Next
dblShellReturned = Shell(filePath & cFlags & urlTxt, vbNormalFocus)
Err.Clear

If dblShellReturned = True Then
    launchBrowser = 1
Else
    launchBrowser = 0
End If

End Function

Am I doing anything wrong?  Or does anyone have any alternative suggestions?

Oh and our IT Security departments official policy is as follows:

"Any request for access to any system; For any reason; Is a serious security risk and will be denied. Even if you need it to do your job.  Now go away and stop bothering me."

So getting them to help isn't exactly an option.  ¯_(ツ)_/¯


问:
Xamarin Forms: System.InvalidProgramException: Invalid IL code in Android.Runtime.AndroidTypeManager:RegisterNativeMembers
I'm getting the following exception while building my Xamarin Forms app in release mode:

```<code>[GraphicsEnvironment] Neither updatable production driver nor prerelease driver is supported.
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[MultiDex] VM with version 2.1.0 has multidex support
[MultiDex] Installing application
[MultiDex] VM has multidex support, MultiDex support library is disabled.
[monodroid-gc] GREF GC Threshold: 46080
[CompatibilityChangeReporter] Compat change id reported: 183155436; UID 10158; state: ENABLED
[FirebaseApp] Device unlocked: initializing all Firebase APIs for app [DEFAULT]
[FirebaseInitProvider] FirebaseApp initialization successful
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in Android.Runtime.AndroidTypeManager:RegisterNativeMembers (Java.Interop.JniType,System.Type,System.ReadOnlySpan`1<char>): IL_0240: stloc.s   19
[mono-rt]
[mono-rt]
[mono-rt]   at Android.Runtime.JNIEnv.RegisterJniNatives (System.IntPtr typeName_ptr, System.Int32 typeName_len, System.IntPtr jniClass, System.IntPtr methods_ptr, System.Int32 methods_len) [0x00088] in <7685f94735ec4635bcf7c23732e3db0f>:0
</code>```

Application while deploying in release mode stuck on splash screen.

XF version: 5.0.0.2545

Visual studio MAC 17.4.1

Referred this thread, but didn't help.

Body:
I'm getting the following exception while building my Xamarin Forms app in release mode:

[GraphicsEnvironment] Neither updatable production driver nor prerelease driver is supported.
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[MultiDex] VM with version 2.1.0 has multidex support
[MultiDex] Installing application
[MultiDex] VM has multidex support, MultiDex support library is disabled.
[monodroid-gc] GREF GC Threshold: 46080
[CompatibilityChangeReporter] Compat change id reported: 183155436; UID 10158; state: ENABLED
[FirebaseApp] Device unlocked: initializing all Firebase APIs for app [DEFAULT]
[FirebaseInitProvider] FirebaseApp initialization successful
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in Android.Runtime.AndroidTypeManager:RegisterNativeMembers (Java.Interop.JniType,System.Type,System.ReadOnlySpan`1<char>): IL_0240: stloc.s   19
[mono-rt]
[mono-rt]
[mono-rt]   at Android.Runtime.JNIEnv.RegisterJniNatives (System.IntPtr typeName_ptr, System.Int32 typeName_len, System.IntPtr jniClass, System.IntPtr methods_ptr, System.Int32 methods_len) [0x00088] in <7685f94735ec4635bcf7c23732e3db0f>:0

Application while deploying in release mode stuck on splash screen.

XF version: 5.0.0.2545

Visual studio MAC 17.4.1

Referred this thread, but didn't help.


问:
Black edges appear when window is transparent
I used the following method to successfully make the window transparent, but some windows will have black edges, how should I solve it

```<code>WindowApi.SetWindowLong(winPtr, -20, WindowApi.GetWindowLong(winPtr, -20) | 524288);
WindowApi.SetLayeredWindowAttributes(winPtr, 0, checked((uint)config.Transparency), 2);
</code>```

I tried the following methods to judge, although there is no black edge, but it can't make the window transparent,What should I do to make the window transparent and have no black edges

```<code>WindowApi.GetWindowLong(winPtr, -20)
</code>```

Body:
I used the following method to successfully make the window transparent, but some windows will have black edges, how should I solve it

WindowApi.SetWindowLong(winPtr, -20, WindowApi.GetWindowLong(winPtr, -20) | 524288);
WindowApi.SetLayeredWindowAttributes(winPtr, 0, checked((uint)config.Transparency), 2);

I tried the following methods to judge, although there is no black edge, but it can't make the window transparent,What should I do to make the window transparent and have no black edges

WindowApi.GetWindowLong(winPtr, -20)


问:
Adding a decimal point automatically to a value in mui textfield
I'am using a @material-ui TextField in my reactjs application and at one input field I need to add a decimal point to it's value when user enter certain number of digits. For example,

as in this picture when user enter 3 & 7 , then I need to add decimal point (.) to make it like 37. which allows him to enter it's decimal value (1).

I tried to come up with a solution using PatternFormat in react-number-format package like below.

```<code>   <PatternFormat
    {...other}
    thousandSeparator
    format={format}
    getInputRef={inputRef}
    onValueChange={(values) => {
      data.weight = parseFloat(values.formattedValue).toFixed(1);
      onTextChange({
        target: {
          name,
          value: parseFloat(values.formattedValue).toFixed(1),
        },
      });
    }}
    // isNumericString
  />
</code>```

But in that user must enter two digits before adding a decimal value. For example, here user can enter 37.1 but can't enter 5.1.

Body:
I'am using a @material-ui TextField in my reactjs application and at one input field I need to add a decimal point to it's value when user enter certain number of digits. For example,

as in this picture when user enter 3 & 7 , then I need to add decimal point (.) to make it like 37. which allows him to enter it's decimal value (1).

I tried to come up with a solution using PatternFormat in react-number-format package like below.

   <PatternFormat
    {...other}
    thousandSeparator
    format={format}
    getInputRef={inputRef}
    onValueChange={(values) => {
      data.weight = parseFloat(values.formattedValue).toFixed(1);
      onTextChange({
        target: {
          name,
          value: parseFloat(values.formattedValue).toFixed(1),
        },
      });
    }}
    // isNumericString
  />

But in that user must enter two digits before adding a decimal value. For example, here user can enter 37.1 but can't enter 5.1.


问:
jupyterhub unreachable would you like to restart it when I used notebook
I find some error logs from singleusersever:
[E 2022-12-15 00:48:30.755 SingleUserLabApp mixins:579] Error notifying Hub of activity
2022-12-15T00:48:30.756977001Z     Traceback (most recent call last):
2022-12-15T00:48:30.756980470Z       File "/opt/conda/lib/python3.10/site-packages/jupyterhub/singleuser/mixins.py", line 577, in notify
2022-12-15T00:48:30.756983594Z         await client.fetch(req)
2022-12-15T00:48:30.756986254Z       File "/opt/conda/lib/python3.10/asyncio/tasks.py", line 304, in __wakeup
2022-12-15T00:48:30.756989078Z         future.result()
2022-12-15T00:48:30.756991816Z     tornado.simple_httpclient.HTTPTimeoutError: Timeout during request

jupyterhub config :

```<code>Authenticator
  .whitelist = set()
DockerSpawner
  .debug = True
  .environment = {'GRANT_SUDO': '1', 'UID': '0'}
  .extra_create_kwargs = {'user': 'root'}
  .extra_host_config = {'network_mode': 'jupyterhub_network'}
  .image = 'dc/jupyter_lab_spark:1.0.0'
  .network_name = 'jupyterhub_network'
  .notebook_dir = '/home/jovyan/work'
  .remove_containers = False
  .use_internal_ip = True
  .volumes = {   '/home/jupyter/work': {'bind': '/home/jovyan/work/shared', 'mode': 'rw'},
    '/home/jupyterhub/new-env': {   'bind': '/home/jovyan/my-conda-envs/new-env',
                                    'mode': 'rw'},
    'jupyterhub-user-{username}': '/home/jovyan/work'}
JupyterHub
  .admin_access = True
  .admin_users = {'yangbo', 'admin'}
  .base_url = '/jupyter/'
  .cookie_max_age_days = 7
  .hub_ip = '172.25.0.2'
  .ip = '0.0.0.0'
  .port = 8000
  .spawner_class = 'dockerspawner.DockerSpawner'
</code>```

who can give me some advice to solve this problems

Body:
I find some error logs from singleusersever:
[E 2022-12-15 00:48:30.755 SingleUserLabApp mixins:579] Error notifying Hub of activity
2022-12-15T00:48:30.756977001Z     Traceback (most recent call last):
2022-12-15T00:48:30.756980470Z       File "/opt/conda/lib/python3.10/site-packages/jupyterhub/singleuser/mixins.py", line 577, in notify
2022-12-15T00:48:30.756983594Z         await client.fetch(req)
2022-12-15T00:48:30.756986254Z       File "/opt/conda/lib/python3.10/asyncio/tasks.py", line 304, in __wakeup
2022-12-15T00:48:30.756989078Z         future.result()
2022-12-15T00:48:30.756991816Z     tornado.simple_httpclient.HTTPTimeoutError: Timeout during request

jupyterhub config :

Authenticator
  .whitelist = set()
DockerSpawner
  .debug = True
  .environment = {'GRANT_SUDO': '1', 'UID': '0'}
  .extra_create_kwargs = {'user': 'root'}
  .extra_host_config = {'network_mode': 'jupyterhub_network'}
  .image = 'dc/jupyter_lab_spark:1.0.0'
  .network_name = 'jupyterhub_network'
  .notebook_dir = '/home/jovyan/work'
  .remove_containers = False
  .use_internal_ip = True
  .volumes = {   '/home/jupyter/work': {'bind': '/home/jovyan/work/shared', 'mode': 'rw'},
    '/home/jupyterhub/new-env': {   'bind': '/home/jovyan/my-conda-envs/new-env',
                                    'mode': 'rw'},
    'jupyterhub-user-{username}': '/home/jovyan/work'}
JupyterHub
  .admin_access = True
  .admin_users = {'yangbo', 'admin'}
  .base_url = '/jupyter/'
  .cookie_max_age_days = 7
  .hub_ip = '172.25.0.2'
  .ip = '0.0.0.0'
  .port = 8000
  .spawner_class = 'dockerspawner.DockerSpawner'

who can give me some advice to solve this problems


问:
EWS exception while trying to read email from exchange
I am facing an issue while reading emails from my exchange email account using EWS Microsoft API.

Please help me with a solution if anybody has.

Used below code

```<code>
public static void Main(string[] args)
{
  string UserName = "**";
  string Password = "**";
  string EXCHANGEMAILURL = @ "<Exchange Webservice URL>";

  ExchangeService service = new ExchangeService();

  service.Timeout = 500000;
  service.Credentials = new NetworkCredential(UserName, Password);
  service.Url = new Uri(EXCHANGEMAILURL);

  try
  {
    ServicePointManager.SecurityProtocol = (SecurityProtocolType) 3072;

    ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;

    FindFoldersResults folderSearchResults = service.FindFolders(WellKnownFolderName.MsgFolderRoot, new FolderView(int.MaxValue));

    Folder xChangeSourceFolder = folderSearchResults.Folders.ToList().Find(

      f => f.DisplayName.Equals("Inbox", StringComparison.CurrentCultureIgnoreCase));

    ItemView itemView = new ItemView(50);

    FindItemsResults<Item> findIncomingMails = service.FindItems(xChangeSourceFolder.Id, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false),

      new ItemView(50));

    Item item = findIncomingMails.First();
    EmailMessage messageHTML = (EmailMessage) item;

    messageHTML.Load(new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Attachments, ItemSchema.Body) {
      RequestedBodyType = BodyType.HTML
    });

    string htmlString = messageHTML.Body.Text.ToString();
  }
  catch (Exception ex)
  {
    Console.WriteLine("Exception Occurred: " + ex);
  }
}
</code>```

The exception

Unable to connect to the remote server :

A connection attempt failed because the connected party did not properly respond after a period of time,or established connection failed because connected host has failed to respond.

```<code>It was working before, but since last 1-2 weeks, it stopped working.
</code>```

Body:
I am facing an issue while reading emails from my exchange email account using EWS Microsoft API.

Please help me with a solution if anybody has.

Used below code

public static void Main(string[] args)
{
  string UserName = "**";
  string Password = "**";
  string EXCHANGEMAILURL = @ "<Exchange Webservice URL>";

  ExchangeService service = new ExchangeService();

  service.Timeout = 500000;
  service.Credentials = new NetworkCredential(UserName, Password);
  service.Url = new Uri(EXCHANGEMAILURL);

  try
  {
    ServicePointManager.SecurityProtocol = (SecurityProtocolType) 3072;

    ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;

    FindFoldersResults folderSearchResults = service.FindFolders(WellKnownFolderName.MsgFolderRoot, new FolderView(int.MaxValue));

    Folder xChangeSourceFolder = folderSearchResults.Folders.ToList().Find(

      f => f.DisplayName.Equals("Inbox", StringComparison.CurrentCultureIgnoreCase));

    ItemView itemView = new ItemView(50);

    FindItemsResults<Item> findIncomingMails = service.FindItems(xChangeSourceFolder.Id, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false),

      new ItemView(50));

    Item item = findIncomingMails.First();
    EmailMessage messageHTML = (EmailMessage) item;

    messageHTML.Load(new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Attachments, ItemSchema.Body) {
      RequestedBodyType = BodyType.HTML
    });

    string htmlString = messageHTML.Body.Text.ToString();
  }
  catch (Exception ex)
  {
    Console.WriteLine("Exception Occurred: " + ex);
  }
}

The exception

Unable to connect to the remote server :

A connection attempt failed because the connected party did not properly respond after a period of time,or established connection failed because connected host has failed to respond.

It was working before, but since last 1-2 weeks, it stopped working.


问:
(Angular) Should Entry Components count as Dumb Components?
I'm refactoring my code into Smart and Dumb Components.
However, I don't know whether an entry component is a Dumb Component or not?

Should I put it to another module (Dumb Component Module) or put it inside Smart Component Module and just declare it inside entryComponents property or not?

This is my entry component

```<code>export class ComfirmBoxComponent implements OnInit {
  constructor(
    @Inject(MAT_DIALOG_DATA) public data: ConfirmBoxModel
  ) {}

  ngOnInit() {}

  confirm() {
    ...
  }

  cancel() {
    ...
  }

  ...
}
</code>```

This is how I call it

```<code>  const dialogRef = this.dialog.open(ConfirmBoxComponent, configData);
</code>```

Body:
I'm refactoring my code into Smart and Dumb Components.
However, I don't know whether an entry component is a Dumb Component or not?

Should I put it to another module (Dumb Component Module) or put it inside Smart Component Module and just declare it inside entryComponents property or not?

This is my entry component

export class ComfirmBoxComponent implements OnInit {
  constructor(
    @Inject(MAT_DIALOG_DATA) public data: ConfirmBoxModel
  ) {}

  ngOnInit() {}

  confirm() {
    ...
  }

  cancel() {
    ...
  }

  ...
}

This is how I call it

  const dialogRef = this.dialog.open(ConfirmBoxComponent, configData);


问:
How to configure schema.xml for geoSpatial Search in solr
I want to filter data nearby location using Solr Spatial Search but can't find any data

I want to filter data nearby location using Solr Spatial Search but can't find any data.

I have done the following changes in schema.xml:

```<code><fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true" />
<field name="latlong" type="text_general" indexed="true" stored="false" multiValued="false"/>
<field name="location" type="location" indexed="true" stored="true" multiValued="false"/>
</code>```

Query :

q=:&fq={!geofilt%20sfield=location}&pt=22.303894,70.802162&d=5

Response :

```<code>{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":0,
    "params":{
      "q":"*:*",
      "pt":"22.303894,70.802162",
      "d":"5",
      "fq":"{!geofilt sfield=location}"}},
  "response":{"numFound":0,"start":0,"numFoundExact":true,"docs":[]
  }}
</code>```

Expected Document:

```<code>{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":0,
    "params":{
      "q":"*:*",
      "indent":"true",
      "q.op":"OR",
      "_":"1671173790419"}},
  "response":{"numFound":1,"start":0,"numFoundExact":true,"docs":[
      {
        "brandnd_name":["Luxury"],
        "country":["India"],
        "latitude":[22.2913494],
        "longitude":[70.8023621],
        "updated_date":["54:03.6"],
        "added_date":["0018-05-14T11:19:00Z"],
        "active_ind":[true],
        "synxis_hotel_id":[37273],
        "id":"4598a178-d984-41f1-b009-bbda37469b7c",
        "_version_":1752351636887437312},
</code>```

Body:
I want to filter data nearby location using Solr Spatial Search but can't find any data

I want to filter data nearby location using Solr Spatial Search but can't find any data.

I have done the following changes in schema.xml:

<fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true" />
<field name="latlong" type="text_general" indexed="true" stored="false" multiValued="false"/>
<field name="location" type="location" indexed="true" stored="true" multiValued="false"/>

Query :

q=:&fq={!geofilt%20sfield=location}&pt=22.303894,70.802162&d=5

Response :

{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":0,
    "params":{
      "q":"*:*",
      "pt":"22.303894,70.802162",
      "d":"5",
      "fq":"{!geofilt sfield=location}"}},
  "response":{"numFound":0,"start":0,"numFoundExact":true,"docs":[]
  }}

Expected Document:

{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":0,
    "params":{
      "q":"*:*",
      "indent":"true",
      "q.op":"OR",
      "_":"1671173790419"}},
  "response":{"numFound":1,"start":0,"numFoundExact":true,"docs":[
      {
        "brandnd_name":["Luxury"],
        "country":["India"],
        "latitude":[22.2913494],
        "longitude":[70.8023621],
        "updated_date":["54:03.6"],
        "added_date":["0018-05-14T11:19:00Z"],
        "active_ind":[true],
        "synxis_hotel_id":[37273],
        "id":"4598a178-d984-41f1-b009-bbda37469b7c",
        "_version_":1752351636887437312},


问:
Celery setup for multiple Django Projects running in Docker Swarm
We have multiple Django Projects (in dedicated GitHub repos) running in Docker Swarm. We want to set up Celery in such a way that it can be used across all the projects.

Is there a way to achieve this? I am looking for more ideas and considerations while architecting this.

I have tried setting it up on one of the projects and invoking its tasks from the other projects by using the send_task method. It kind of works in one direction.
How can I make it execute tasks whose definition is not present in the project in which it is running? Or in other words, how can I execute un-unregistered tasks from other projects?


问:
How to dynamic aggregation function (Min, Max, Sum) on generic list using C#?
Here I am trying to perform different aggregation functions like Min, Max, Sum from IEnumerable on the generic list (Transaction->Value). Here is the code:

```<code>List<string> funcs = new List<string> { "Min", "Max", "Sum" };
List<Transaction> transactions = new List<Transaction> { new Transaction { Value = 10 }, new Transaction { Value = 20 } };

foreach(string function in funcs)
{
    // transactions.Sum(item => item.Value);
    var func = BuildFunc<Transaction>(nameof(Transaction.Value), function);
    double result = func(transactions);
    Console.WriteLine(result);
}

Console.ReadKey();

Func<IEnumerable<T>, double> BuildFunc<T>(string propertyName, string func) //Count, Last, First
{
    var source = Expression.Parameter(typeof(IEnumerable<T>), "source");
    var item = Expression.Parameter(typeof(T), "item");
    Expression value = Expression.PropertyOrField(item, propertyName);

    var selector = Expression.Lambda<Func<T, double>>(value, item);
    var methodCall = Expression.Lambda<Func<IEnumerable<T>, double>>(
        Expression.Call(typeof(Enumerable), func, new Type[] { item.Type, selector.ReturnType }, source, selector),
        source);

    return methodCall.Compile();
}

internal class Transaction
{
    public double Value { get; set; }
}
</code>```

This code is working for functions Min and Max, but somehow for Sum throwing an error

System.InvalidOperationException: 'No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments.

These functions are just extensions provided on IEnumerable. I am not sure what went wrong here. Any help would be apricated.

Body:
Here I am trying to perform different aggregation functions like Min, Max, Sum from IEnumerable on the generic list (Transaction->Value). Here is the code:

List<string> funcs = new List<string> { "Min", "Max", "Sum" };
List<Transaction> transactions = new List<Transaction> { new Transaction { Value = 10 }, new Transaction { Value = 20 } };

foreach(string function in funcs)
{
    // transactions.Sum(item => item.Value);
    var func = BuildFunc<Transaction>(nameof(Transaction.Value), function);
    double result = func(transactions);
    Console.WriteLine(result);
}

Console.ReadKey();

Func<IEnumerable<T>, double> BuildFunc<T>(string propertyName, string func) //Count, Last, First
{
    var source = Expression.Parameter(typeof(IEnumerable<T>), "source");
    var item = Expression.Parameter(typeof(T), "item");
    Expression value = Expression.PropertyOrField(item, propertyName);

    var selector = Expression.Lambda<Func<T, double>>(value, item);
    var methodCall = Expression.Lambda<Func<IEnumerable<T>, double>>(
        Expression.Call(typeof(Enumerable), func, new Type[] { item.Type, selector.ReturnType }, source, selector),
        source);

    return methodCall.Compile();
}

internal class Transaction
{
    public double Value { get; set; }
}

This code is working for functions Min and Max, but somehow for Sum throwing an error

System.InvalidOperationException: 'No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments.

These functions are just extensions provided on IEnumerable. I am not sure what went wrong here. Any help would be apricated.


问:
How to get Firebase Cloud Messaging Server key by firebase API(e.g https://firebase.googleapis.com)?
I have searched lot but I did not get any solution to find out Server key for my firebase project</p>


问:
send linting error from command prompt to specific file
In my Angular js project  we are using karma as a testing tool.

I am using karma-eslint plugin to capture linting errors in my JavaScript files

I have configure it in my karma.conf.js like -

```<code> preprocessor : {'path of js files' : ['eslint']}
</code>```

I have also configured eslint configurations like-

```<code>esling : {engine : { consfigFile : './ eslintrc.js' }}
</code>```

I am able to get linting errors in command prompt but I want to send the result of this linting errors to specific reporting  file (like .txt , xml , html )

I have done a lot of searching but could not found any solution
If the above requirement can not be fulfilled with karma-eslint plugin please suggest any other tool that I can use with karma.

Body:
In my Angular js project  we are using karma as a testing tool.

I am using karma-eslint plugin to capture linting errors in my JavaScript files

I have configure it in my karma.conf.js like -

 preprocessor : {'path of js files' : ['eslint']}

I have also configured eslint configurations like-

esling : {engine : { consfigFile : './ eslintrc.js' }}

I am able to get linting errors in command prompt but I want to send the result of this linting errors to specific reporting  file (like .txt , xml , html )

I have done a lot of searching but could not found any solution
If the above requirement can not be fulfilled with karma-eslint plugin please suggest any other tool that I can use with karma.


问:
react-chartjs-2 BAR GRAPH resulting in hundreds of pages when printing to PDF
you can see here 722 pages are showing for pdf while i have created a single bar graph which is on one page

I am trying to create a Dashboard for client with pie charts, line bar graphs. I wanted to convert that dashboard inclusive of pie charts, line bars into PDF. All the graphs are accommodated in single screen or one page. While printing or creating PDF , it is printing or creating unnecessary blank pages. I have tried to find the solution. Extra pages appearing on line bar only.

I have tried to keep aspect ratio false and adjusting width, height ratio but it is not happening.


问:
DynamicLinks iOS: await dynamicLinks().getInitialLink() works on debug, but doesn't work on release mode
await dynamicLinks().getInitialLink() works in debug mode, but doesn't work in release mode on iOS.

await dynamicLinks().getInitialLink() work fine for android debug and release mode but  when i use dynamic link in debug mode it work fine but when i create release mode for app this will return always null. not getting after sometimes of wait because i research on that issue somebody getting link after some wait of times but in my case it will not return any link after wait of sometimes.

I spent a day for finding the solution for that but nothing work for me. I tried all most the solution which mention in #2660  #4548 #3450 but not work any solution for me.

Project Files

```<code>export const getInitialLink = async ()=> {
  const link = await dynamicLinks().getInitialLink();
  const id = onHandleDynamicLink(link);
  return id;
};

export const onHandleDynamicLink = link => {
  if (link) {
    const linkUrl = url.parse(link.url, true);
    const VideoId = linkUrl.path.split('/')[2];
    return VideoId;
  }
  return null;
};

import {getInitialLink} from '../../helpers/dynamicLinksHelper';
const Id = await getInitialLink();`
</code>```

package.json:

```<code>"@react-native-firebase/app": "^16.4.6",
"@react-native-firebase/dynamic-links": "^16.4.6",
 "react-native": "0.64.2",
</code>```

iOS

source 'https://github.com/CocoaPods/Specs.git

```<code>target 'project' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  # add the Firebase pod for Google Analytics
  # pod 'Firebase/Analytics'

  # pod 'react-native-webview', :path => '../node_modules/react-native-webview'

  # pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js'

  # pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"

  # pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

  target 'newslineisitanywayTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
  end
end
</code>```

AppDelegate.m:

```<code>#import "AppDelegate.h"
#import <React/RCTLinkingManager.h>
#import <RNFBDynamicLinksAppDelegateInterceptor.h>
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
@import Firebase;
#import "RNFBMessagingModule.h"
#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [RNFBDynamicLinksAppDelegateInterceptor sharedInstance];
#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif`your text`

  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
  center.delegate = self;

  NSDictionary *appProperties = [RNFBMessagingModule addCustomPropsToUserProps:nil withLaunchOptions:launchOptions];

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"newslineisitanyway"
                                            initialProperties:appProperties];

  if (@available(iOS 13.0, *)) {
      rootView.backgroundColor = [UIColor systemBackgroundColor];
  } else {
      rootView.backgroundColor = [UIColor whiteColor];
  }

  [[FBSDKApplicationDelegate sharedInstance] application:application
                             didFinishLaunchingWithOptions:launchOptions];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  [FIRApp configure];
  return YES;
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
  return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                         openURL:url
                                               sourceApplication:sourceApplication
                                                      annotation:annotation];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
  [FBSDKAppEvents activateApp];
}

// Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
// [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
//  [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
// [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for localNotification event
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
         withCompletionHandler:(void (^)(void))completionHandler
{
//  [RNCPushNotificationIOS didReceiveNotificationResponse:response];
}

-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
  completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
 restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
 return [RCTLinkingManager application:application
                  continueUserActivity:userActivity
                    restorationHandler:restorationHandler];
}
- (BOOL)application:(UIApplication *)application
   openURL:(NSURL *)url
   options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  RNFBDynamicLinksAppDelegateInterceptor *interceptor = [RNFBDynamicLinksAppDelegateInterceptor sharedInstance];
      if (url && !interceptor.initialLinkUrl)
      {
          FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
          if (dynamicLink.url)
          {
              interceptor.initialLinkUrl = dynamicLink.url.absoluteString;
              interceptor.initialLinkMinimumAppVersion = dynamicLink.minimumAppVersion == nil ? [NSNull null] : dynamicLink.minimumAppVersion;
          }
      }
      return [RCTLinkingManager application:application openURL:url options:options];
      return YES;

}

@end`
</code>```

Environment

react-native info output:

Platform that you're experiencing the issue on:

[x] iOSyour text

Are you using TypeScript?

NO

Body:
await dynamicLinks().getInitialLink() works in debug mode, but doesn't work in release mode on iOS.

await dynamicLinks().getInitialLink() work fine for android debug and release mode but  when i use dynamic link in debug mode it work fine but when i create release mode for app this will return always null. not getting after sometimes of wait because i research on that issue somebody getting link after some wait of times but in my case it will not return any link after wait of sometimes.

I spent a day for finding the solution for that but nothing work for me. I tried all most the solution which mention in #2660  #4548 #3450 but not work any solution for me.

Project Files

export const getInitialLink = async ()=> {
  const link = await dynamicLinks().getInitialLink();
  const id = onHandleDynamicLink(link);
  return id;
};

export const onHandleDynamicLink = link => {
  if (link) {
    const linkUrl = url.parse(link.url, true);
    const VideoId = linkUrl.path.split('/')[2];
    return VideoId;
  }
  return null;
};

import {getInitialLink} from '../../helpers/dynamicLinksHelper';
const Id = await getInitialLink();`

package.json:

"@react-native-firebase/app": "^16.4.6",
"@react-native-firebase/dynamic-links": "^16.4.6",
 "react-native": "0.64.2",

iOS

source 'https://github.com/CocoaPods/Specs.git

target 'project' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  # add the Firebase pod for Google Analytics
  # pod 'Firebase/Analytics'

  # pod 'react-native-webview', :path => '../node_modules/react-native-webview'

  # pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js'

  # pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"

  # pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

  target 'newslineisitanywayTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
  end
end

AppDelegate.m:

#import "AppDelegate.h"
#import <React/RCTLinkingManager.h>
#import <RNFBDynamicLinksAppDelegateInterceptor.h>
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
@import Firebase;
#import "RNFBMessagingModule.h"
#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [RNFBDynamicLinksAppDelegateInterceptor sharedInstance];
#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif`your text`

  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
  center.delegate = self;

  NSDictionary *appProperties = [RNFBMessagingModule addCustomPropsToUserProps:nil withLaunchOptions:launchOptions];

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"newslineisitanyway"
                                            initialProperties:appProperties];

  if (@available(iOS 13.0, *)) {
      rootView.backgroundColor = [UIColor systemBackgroundColor];
  } else {
      rootView.backgroundColor = [UIColor whiteColor];
  }

  [[FBSDKApplicationDelegate sharedInstance] application:application
                             didFinishLaunchingWithOptions:launchOptions];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  [FIRApp configure];
  return YES;
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
  return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                         openURL:url
                                               sourceApplication:sourceApplication
                                                      annotation:annotation];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
  [FBSDKAppEvents activateApp];
}

// Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
// [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
//  [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
// [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for localNotification event
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
         withCompletionHandler:(void (^)(void))completionHandler
{
//  [RNCPushNotificationIOS didReceiveNotificationResponse:response];
}

-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
  completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
 restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
 return [RCTLinkingManager application:application
                  continueUserActivity:userActivity
                    restorationHandler:restorationHandler];
}
- (BOOL)application:(UIApplication *)application
   openURL:(NSURL *)url
   options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  RNFBDynamicLinksAppDelegateInterceptor *interceptor = [RNFBDynamicLinksAppDelegateInterceptor sharedInstance];
      if (url && !interceptor.initialLinkUrl)
      {
          FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
          if (dynamicLink.url)
          {
              interceptor.initialLinkUrl = dynamicLink.url.absoluteString;
              interceptor.initialLinkMinimumAppVersion = dynamicLink.minimumAppVersion == nil ? [NSNull null] : dynamicLink.minimumAppVersion;
          }
      }
      return [RCTLinkingManager application:application openURL:url options:options];
      return YES;

}

@end`

Environment

react-native info output:

Platform that you're experiencing the issue on:

[x] iOSyour text

Are you using TypeScript?

NO


问:
Visual Studio: How to detect any changes on project properties and trigger event from extension when user click apply
I'm trying to write VS extension for VC++ projects, I want to detect any changes on project properties (Additional include directories, additional using directories etc.) when user change and click apply on project properties page.

I don't want to trigger event until user clicks apply. If user click, I want to fire an event from My extension. Thanks for your help.

I tried to capture Command Events from EnvDTE but I did not find Command code for Apply button. In the case of clicking apply, VsStd97CmdId will be 684 or 1990. Those are not specific for apply command.

Other thing that I tried was, detecting changes on project file, but Changes are not saved vcxproj file until save or save-all


问:
How do I limit the number of times a user can perform an action in Swift using CloudKit?
I'm trying to limit the number of times a user can perform an action in a month. I understand that storing a counter in NSUserDefaults is low security as the user can easily go in and modify the stored variable, which I want to avoid. Since I don't have a server, I was thinking of using CloudKit to store a user's possible allocated number of times along with their current count - is that even possible?

1- I've gone ahead and created a 'Record Type' called UserLimits with two int keys: 'call_current' and 'call_limit' in the public database. Do I also need to store the user's UserRecordID as well?

2- For permissions, I've opted to set UserLimits as Read for _world, _creator, _icloud so that no user can modify these variables.

At this point I'm kind of stuck as I can't seem to find any documentation outlining similar steps, or whether I'm doing things correctly or not.

Fetching a user's ID is as easy as:

```<code>CKContainer.default().fetchUserRecordID { recordID, error in
            guard let recordID = recordID, error == nil else {
                // error handling magic
                return
            }

            print("Got user record ID \(recordID.recordName).")
        }
</code>```

How would I use this ID to fetch their current limit, update their count, etc?
Any help would be greatly appreciated!

Body:
I'm trying to limit the number of times a user can perform an action in a month. I understand that storing a counter in NSUserDefaults is low security as the user can easily go in and modify the stored variable, which I want to avoid. Since I don't have a server, I was thinking of using CloudKit to store a user's possible allocated number of times along with their current count - is that even possible?

1- I've gone ahead and created a 'Record Type' called UserLimits with two int keys: 'call_current' and 'call_limit' in the public database. Do I also need to store the user's UserRecordID as well?

2- For permissions, I've opted to set UserLimits as Read for _world, _creator, _icloud so that no user can modify these variables.

At this point I'm kind of stuck as I can't seem to find any documentation outlining similar steps, or whether I'm doing things correctly or not.

Fetching a user's ID is as easy as:

CKContainer.default().fetchUserRecordID { recordID, error in
            guard let recordID = recordID, error == nil else {
                // error handling magic
                return
            }

            print("Got user record ID \(recordID.recordName).")
        }

How would I use this ID to fetch their current limit, update their count, etc?
Any help would be greatly appreciated!


问:
How to set special character in password in Ansible?
I have following Ansible configuration

rabbitmq_user:
  user: "{{ rabbitmq_application_user }}"
  password: "{{ rabbitmq_application_password }}"
  vhost: "{{ rabbitmq_application_vhost }}"
  state: "present"
```

The content of the variable rabbitmq_application_password is something like asdf&$as.

Above playbooks works fine, I can see user is being created with application user.

However I can't authenticate by using "{{ rabbitmq_application_password }}".

If I replace the special characters & and $ with other numerical characters and run the playbook then it works fine, i.e the user is being authenticated.

So the problem appears to be in special characters, how to fix it?

Any help would be appreciated.

Body:
I have following Ansible configuration

rabbitmq_user:
  user: "{{ rabbitmq_application_user }}"
  password: "{{ rabbitmq_application_password }}"
  vhost: "{{ rabbitmq_application_vhost }}"
  state: "present"

The content of the variable rabbitmq_application_password is something like asdf&$as.

Above playbooks works fine, I can see user is being created with application user.

However I can't authenticate by using "{{ rabbitmq_application_password }}".

If I replace the special characters & and $ with other numerical characters and run the playbook then it works fine, i.e the user is being authenticated.

So the problem appears to be in special characters, how to fix it?

Any help would be appreciated.


问:
Getting an error when trying to deploy a react app to heroku
As Im upgrading my react app on Heroku from stack-18 to stack-22, I m keep getting this error in Heroku logs. Not sure why it is getting error, could you please help me in the same.

```<code>-----> Building on the Heroku-22 stack
-----> Using buildpack: https://github.com/mohitkr01/create-react-app-buildpack
-----> React.js (create-react-app) multi app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
=====> Detected Framework: Multipack
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true

-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)

       Resolving node version 18.x...
       Downloading and installing node 18.12.1...
       Using default npm version: 8.19.2

-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack
       Module installation may take longer for this build

-----> Installing dependencies
       Installing node modules
       npm ERR! code 1
       npm ERR! path /tmp/build_11bc449b/node_modules/node-sass
       npm ERR! command failed
       npm ERR! command sh -c -- node scripts/build.js
       npm ERR! Building: /tmp/build_11bc449b/.heroku/node/bin/node /tmp/build_11bc449b/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
       npm ERR! gyp info it worked if it ends with ok
       npm ERR! gyp verb cli [
       npm ERR! gyp verb cli   '/tmp/build_11bc449b/.heroku/node/bin/node',
       npm ERR! gyp verb cli   '/tmp/build_11bc449b/node_modules/node-gyp/bin/node-gyp.js',
       npm ERR! gyp verb cli   'rebuild',
       npm ERR! gyp verb cli   '--verbose',
       npm ERR! gyp verb cli   '--libsass_ext=',
       npm ERR! gyp verb cli   '--libsass_cflags=',
       npm ERR! gyp verb cli   '--libsass_ldflags=',
       npm ERR! gyp verb cli   '--libsass_library='
       npm ERR! gyp verb cli ]
       npm ERR! gyp info using node-gyp@3.8.0
       npm ERR! gyp info using node@18.12.1 | linux | x64
       npm ERR! gyp verb command rebuild []
       npm ERR! gyp verb command clean []
       npm ERR! gyp verb clean removing "build" directory
       npm ERR! gyp verb command configure []
       npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
       npm ERR! gyp verb `which` failed Error: not found: python2
       npm ERR! gyp verb `which` failed     at getNotFoundError (/tmp/build_11bc449b/node_modules/which/which.js:13:12)
       npm ERR! gyp verb `which` failed     at F (/tmp/build_11bc449b/node_modules/which/which.js:68:19)
       npm ERR! gyp verb `which` failed     at E (/tmp/build_11bc449b/node_modules/which/which.js:80:29)
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/which/which.js:89:16
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/isexe/index.js:42:5
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/isexe/mode.js:8:5
       npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:207:21)
       npm ERR! gyp verb `which` failed  python2 Error: not found: python2
       npm ERR! gyp verb `which` failed     at getNotFoundError (/tmp/build_11bc449b/node_modules/which/which.js:13:12)
       npm ERR! gyp verb `which` failed     at F (/tmp/build_11bc449b/node_modules/which/which.js:68:19)
       npm ERR! gyp verb `which` failed     at E (/tmp/build_11bc449b/node_modules/which/which.js:80:29)
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/which/which.js:89:16
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/isexe/index.js:42:5
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/isexe/mode.js:8:5
       npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:207:21) {
       npm ERR! gyp verb `which` failed   code: 'ENOENT'
       npm ERR! gyp verb `which` failed }
       npm ERR! gyp verb check python checking for Python executable "python" in the PATH
       npm ERR! gyp verb `which` succeeded python /usr/bin/python
       npm ERR! gyp ERR! configure error
       npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
       npm ERR! gyp ERR! stack   File "<string>", line 1
       npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
       npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
       npm ERR! gyp ERR! stack
       npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:412:12)
       npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
       npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
       npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
       npm ERR! gyp ERR! System Linux 4.4.0-1104-aws
       npm ERR! gyp ERR! command "/tmp/build_11bc449b/.heroku/node/bin/node" "/tmp/build_11bc449b/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
       npm ERR! gyp ERR! cwd /tmp/build_11bc449b/node_modules/node-sass
       npm ERR! gyp ERR! node -v v18.12.1
       npm ERR! gyp ERR! node-gyp -v v3.8.0
       npm ERR! gyp ERR! not ok
       npm ERR! Build failed with error code: 1

       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.dUlwP/_logs/2022-12-16T06_53_44_046Z-debug-0.log
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       Some possible problems:

       - Node version not specified in package.json
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

       Love,
       Heroku

 !     Push rejected, failed to compile React.js (create-react-app) multi app.
 !     Push failed
</code>```

Although here is my Package.json, it seems to be good to me

`

```<code>{
  "name": "react-portfolio",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "emailjs-com": "^2.6.3",
    "formik": "^2.2.2",
    "ionicons": "^2.0.1",
    "moment": "^2.29.1",
    "node-sass": "4.x",
    "react": "17.x",
    "react-dom": "^17.0.1",
    "react-lazy-load-image-component": "^1.5.0",
    "react-router-dom": "^5.2.0",
    "react-router-hash-link": "^2.2.2",
    "react-scripts": "4.0.0",
    "react-transition-group": "^2.9.0",
    "rxjs": "^6.3.3",
    "web-vitals": "^0.2.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

</code>```

I have no idea why it cant resolve the file, as it is located exactly where i specified. Can someone help me?

Thanks in advance

Body:
As Im upgrading my react app on Heroku from stack-18 to stack-22, I m keep getting this error in Heroku logs. Not sure why it is getting error, could you please help me in the same.

-----> Building on the Heroku-22 stack
-----> Using buildpack: https://github.com/mohitkr01/create-react-app-buildpack
-----> React.js (create-react-app) multi app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
=====> Detected Framework: Multipack
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true

-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)

       Resolving node version 18.x...
       Downloading and installing node 18.12.1...
       Using default npm version: 8.19.2

-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack
       Module installation may take longer for this build

-----> Installing dependencies
       Installing node modules
       npm ERR! code 1
       npm ERR! path /tmp/build_11bc449b/node_modules/node-sass
       npm ERR! command failed
       npm ERR! command sh -c -- node scripts/build.js
       npm ERR! Building: /tmp/build_11bc449b/.heroku/node/bin/node /tmp/build_11bc449b/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
       npm ERR! gyp info it worked if it ends with ok
       npm ERR! gyp verb cli [
       npm ERR! gyp verb cli   '/tmp/build_11bc449b/.heroku/node/bin/node',
       npm ERR! gyp verb cli   '/tmp/build_11bc449b/node_modules/node-gyp/bin/node-gyp.js',
       npm ERR! gyp verb cli   'rebuild',
       npm ERR! gyp verb cli   '--verbose',
       npm ERR! gyp verb cli   '--libsass_ext=',
       npm ERR! gyp verb cli   '--libsass_cflags=',
       npm ERR! gyp verb cli   '--libsass_ldflags=',
       npm ERR! gyp verb cli   '--libsass_library='
       npm ERR! gyp verb cli ]
       npm ERR! gyp info using node-gyp@3.8.0
       npm ERR! gyp info using node@18.12.1 | linux | x64
       npm ERR! gyp verb command rebuild []
       npm ERR! gyp verb command clean []
       npm ERR! gyp verb clean removing "build" directory
       npm ERR! gyp verb command configure []
       npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
       npm ERR! gyp verb `which` failed Error: not found: python2
       npm ERR! gyp verb `which` failed     at getNotFoundError (/tmp/build_11bc449b/node_modules/which/which.js:13:12)
       npm ERR! gyp verb `which` failed     at F (/tmp/build_11bc449b/node_modules/which/which.js:68:19)
       npm ERR! gyp verb `which` failed     at E (/tmp/build_11bc449b/node_modules/which/which.js:80:29)
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/which/which.js:89:16
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/isexe/index.js:42:5
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/isexe/mode.js:8:5
       npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:207:21)
       npm ERR! gyp verb `which` failed  python2 Error: not found: python2
       npm ERR! gyp verb `which` failed     at getNotFoundError (/tmp/build_11bc449b/node_modules/which/which.js:13:12)
       npm ERR! gyp verb `which` failed     at F (/tmp/build_11bc449b/node_modules/which/which.js:68:19)
       npm ERR! gyp verb `which` failed     at E (/tmp/build_11bc449b/node_modules/which/which.js:80:29)
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/which/which.js:89:16
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/isexe/index.js:42:5
       npm ERR! gyp verb `which` failed     at /tmp/build_11bc449b/node_modules/isexe/mode.js:8:5
       npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:207:21) {
       npm ERR! gyp verb `which` failed   code: 'ENOENT'
       npm ERR! gyp verb `which` failed }
       npm ERR! gyp verb check python checking for Python executable "python" in the PATH
       npm ERR! gyp verb `which` succeeded python /usr/bin/python
       npm ERR! gyp ERR! configure error
       npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
       npm ERR! gyp ERR! stack   File "<string>", line 1
       npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
       npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
       npm ERR! gyp ERR! stack
       npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:412:12)
       npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
       npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
       npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
       npm ERR! gyp ERR! System Linux 4.4.0-1104-aws
       npm ERR! gyp ERR! command "/tmp/build_11bc449b/.heroku/node/bin/node" "/tmp/build_11bc449b/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
       npm ERR! gyp ERR! cwd /tmp/build_11bc449b/node_modules/node-sass
       npm ERR! gyp ERR! node -v v18.12.1
       npm ERR! gyp ERR! node-gyp -v v3.8.0
       npm ERR! gyp ERR! not ok
       npm ERR! Build failed with error code: 1

       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.dUlwP/_logs/2022-12-16T06_53_44_046Z-debug-0.log
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       Some possible problems:

       - Node version not specified in package.json
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

       Love,
       Heroku

 !     Push rejected, failed to compile React.js (create-react-app) multi app.
 !     Push failed

Although here is my Package.json, it seems to be good to me

`

{
  "name": "react-portfolio",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "emailjs-com": "^2.6.3",
    "formik": "^2.2.2",
    "ionicons": "^2.0.1",
    "moment": "^2.29.1",
    "node-sass": "4.x",
    "react": "17.x",
    "react-dom": "^17.0.1",
    "react-lazy-load-image-component": "^1.5.0",
    "react-router-dom": "^5.2.0",
    "react-router-hash-link": "^2.2.2",
    "react-scripts": "4.0.0",
    "react-transition-group": "^2.9.0",
    "rxjs": "^6.3.3",
    "web-vitals": "^0.2.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

I have no idea why it cant resolve the file, as it is located exactly where i specified. Can someone help me?

Thanks in advance


问:
Can't use Jest to test responsive design using Tailwind CSS
I'm using TailwindCSS to implement a React App, and Jest to test it. I expect changing the window size can cause some elements to appear and disappear. Then I realized jsDom doesn't load TailwindCSS, and I followed React testing library can't read styles using Tailwind CSS classes and successfully injected the compiled CSS into document.head of jsDom. However, after I changed the window size by using

```<code>window.innerWidth = 480;
window.dispatchEvent(new Event("resize"));
expect(window.innerWidth).toBe(480); // This passes
expect(screen.getByTestId("nav-bar-bottom")).not.toBeVisible(); // fails
</code>```

the element that should be gone still exists.

I hear someone mentioned jsDom doesn't support responsive test. So how responsive tests should be conducted then?

Body:
I'm using TailwindCSS to implement a React App, and Jest to test it. I expect changing the window size can cause some elements to appear and disappear. Then I realized jsDom doesn't load TailwindCSS, and I followed React testing library can't read styles using Tailwind CSS classes and successfully injected the compiled CSS into document.head of jsDom. However, after I changed the window size by using

window.innerWidth = 480;
window.dispatchEvent(new Event("resize"));
expect(window.innerWidth).toBe(480); // This passes
expect(screen.getByTestId("nav-bar-bottom")).not.toBeVisible(); // fails

the element that should be gone still exists.

I hear someone mentioned jsDom doesn't support responsive test. So how responsive tests should be conducted then?


问:
Is it safe to use same reCaptcha v3 Token for multiple requests?
I have an upload form with reCaptcha v3 in PHP with DropzoneJS. I am uploading 10 files with 10 different Post requests. When a User uploads 10 files, the client gets 10 different Captcha Tokens in a few milliseconds. The Server then timeouts because he has to check 10 different Tokens within some very short time.

Would it still be safe if the user would get the reCaptcha Token only on the first post request? The Captcha State would be saved in the user Session and if it's valid, the client would not have to get 9 more Captcha tokens.

Like: (logic code)

```<code>if Captcha is valid: $SESSION['captcha'] = 'valid';

if files_ammount > 10 = getNewCaptchaToken();
</code>```

Body:
I have an upload form with reCaptcha v3 in PHP with DropzoneJS. I am uploading 10 files with 10 different Post requests. When a User uploads 10 files, the client gets 10 different Captcha Tokens in a few milliseconds. The Server then timeouts because he has to check 10 different Tokens within some very short time.

Would it still be safe if the user would get the reCaptcha Token only on the first post request? The Captcha State would be saved in the user Session and if it's valid, the client would not have to get 9 more Captcha tokens.

Like: (logic code)

if Captcha is valid: $SESSION['captcha'] = 'valid';

if files_ammount > 10 = getNewCaptchaToken();


问:
Basic authorization header not working in Angular from Power bi web portal URL
So I have a link from the Power bi report server, I configure the report server to use Basic Authorization. The link is working in Postman but whenever I use it in my angular app it keeps asking me for username and password even though I already provided the basic authorization.

This is the screenshot from postman:

As you can see it gives me the status of 200 OK

This is my code

```<code>let headerss = new HttpHeaders();
headerss = headerss.append("Authorization", "Basic dGVzdFx0ZXN0OnRlc3Q=");
headerss = headerss.append("Content-Type", "text/html; charset=UTF-8");
this.http.get("http://<my ip address>/Reports/powerbi/supplierDefects?rs:embed=true", { headers: headerss }).subscribe({
  next: (data: any) => {
    console.log(data);
  },
  error: (err: any) => {
    console.log(err);
  }
});
</code>```

The problem is that when I run the angular app it always asks me for username and password. What seems to be the problem?

Body:
So I have a link from the Power bi report server, I configure the report server to use Basic Authorization. The link is working in Postman but whenever I use it in my angular app it keeps asking me for username and password even though I already provided the basic authorization.

This is the screenshot from postman:

As you can see it gives me the status of 200 OK

This is my code

let headerss = new HttpHeaders();
headerss = headerss.append("Authorization", "Basic dGVzdFx0ZXN0OnRlc3Q=");
headerss = headerss.append("Content-Type", "text/html; charset=UTF-8");
this.http.get("http://<my ip address>/Reports/powerbi/supplierDefects?rs:embed=true", { headers: headerss }).subscribe({
  next: (data: any) => {
    console.log(data);
  },
  error: (err: any) => {
    console.log(err);
  }
});

The problem is that when I run the angular app it always asks me for username and password. What seems to be the problem?


问:
How to get the current year on each time the year changed using left and right arrows in the react datepicker
enter image description here

Iam using a div child element to display the current selected year inside the datepicker. Currently the selected year can only be updated when an onchange event is fired. Because of that i have to open the datepicker again after selecting a date to see an updated year in the red text.

Is there any event to get the current year before a date is selected inside the datepicker ?


问:
Adobe sign Webhook : Invalid webhook url
Currently we are trying to use webhook for getting back the signed document. But in the creation of webhook itself, we are getting an error that "webhook URL is invalid". We have tried becceptor for testing purpose. So it worked there . But when we tried with our production environment's webapi URL, we weren't able to create webhook.
We were thinking that due to change in the web hook url which contains special characters like "@" , ":" and few like that in text, for authenticating our webapi URL.
Does adobe is making validation over the webapi URL? If someone is facing similar kind of issues, assistance over this will be really helpful.

Thanks in advance.


问:
How do I add a column to DataGridView through code?(Using C# Windows Application)
I have added database table data to DataGridView in the C# Windows application form.I have added Edit column to it .Now I need to add a Edit Button in each row in that Edit colum.How can I do it with code?(Using C# Windows Application)

```<code> public Form1()
        {
            InitializeComponent();
            SqlConnection con = new SqlConnection(@"Server= DESKTOP-AK4NH6J\SQLEXPRESS;Database=Interview;Trusted_connection=True");
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from Person", con);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable dt = new DataTable();
            da.Fill(dt);
            dt.Columns.Add("Edit", typeof(string));
            con.Close();
            dataGridView1.DataSource = dt;
        }
</code>```

Name
Edit

Cell 1
EDIT

Cell 3
EDIT

"EDIT" should be a button and I need to add it with every row(Using C# Windows Application)

Body:
I have added database table data to DataGridView in the C# Windows application form.I have added Edit column to it .Now I need to add a Edit Button in each row in that Edit colum.How can I do it with code?(Using C# Windows Application)

 public Form1()
        {
            InitializeComponent();
            SqlConnection con = new SqlConnection(@"Server= DESKTOP-AK4NH6J\SQLEXPRESS;Database=Interview;Trusted_connection=True");
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from Person", con);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable dt = new DataTable();
            da.Fill(dt);
            dt.Columns.Add("Edit", typeof(string));
            con.Close();
            dataGridView1.DataSource = dt;
        }

Name
Edit

Cell 1
EDIT

Cell 3
EDIT

"EDIT" should be a button and I need to add it with every row(Using C# Windows Application)


问:
Creating cross region autonomous database failing with 'message': "The following tag namespaces / keys are not authorized or not found: 'oracle-tags'"
Need help in creating cross region standby database via python have tried creating with
oci.database.models.CreateCrossRegionAutonomousDatabaseDataGuardDetails
I am unable to find an example for the same so i tried with whatever i can find through sdk documentation

```<code>response = oci_client.get_autonomous_database(autonomous_database_id=primary_db_id)
primary_db_details = response.data
</code>```
```<code>def create_cross_region_standby_db(db_client, primary_db_details: oci.database.models.AutonomousDatabase):
    adw_request = oci.database.models.CreateCrossRegionAutonomousDatabaseDataGuardDetails()
    adw_request.compartment_id = primary_db_details.compartment_id
    adw_request.db_name = primary_db_details.db_name
    adw_request.data_storage_size_in_tbs = primary_db_details.data_storage_size_in_tbs
    adw_request.data_storage_size_in_gbs = primary_db_details.data_storage_size_in_gbs
    adw_request.cpu_core_count = primary_db_details.cpu_core_count
    adw_request.db_version = primary_db_details.db_version
    adw_request.db_workload = primary_db_details.db_workload
    adw_request.license_model = primary_db_details.license_model
    adw_request.is_mtls_connection_required = primary_db_details.is_mtls_connection_required
    adw_request.is_auto_scaling_enabled = primary_db_details.is_auto_scaling_enabled
    adw_request.source_id = primary_db_details.id
    adw_request.subnet_id = <standby subnet id>

    adw_response = db_client.create_autonomous_database(create_autonomous_database_details=adw_request)
    print(adw_response.data)
    adw_id = adw_response.data.id
    oci.wait_until(db_client, db_client.get_autonomous_database(adw_id), 'lifecycle_state', 'AVAILABLE')
    print("Created ADW {}".format(adw_id))
    return adw_id
</code>```

create_cross_region_standby_db is done using standby region credentials. Creation of primary db in the same region works fine.

Body:
Need help in creating cross region standby database via python have tried creating with
oci.database.models.CreateCrossRegionAutonomousDatabaseDataGuardDetails
I am unable to find an example for the same so i tried with whatever i can find through sdk documentation

response = oci_client.get_autonomous_database(autonomous_database_id=primary_db_id)
primary_db_details = response.data

def create_cross_region_standby_db(db_client, primary_db_details: oci.database.models.AutonomousDatabase):
    adw_request = oci.database.models.CreateCrossRegionAutonomousDatabaseDataGuardDetails()
    adw_request.compartment_id = primary_db_details.compartment_id
    adw_request.db_name = primary_db_details.db_name
    adw_request.data_storage_size_in_tbs = primary_db_details.data_storage_size_in_tbs
    adw_request.data_storage_size_in_gbs = primary_db_details.data_storage_size_in_gbs
    adw_request.cpu_core_count = primary_db_details.cpu_core_count
    adw_request.db_version = primary_db_details.db_version
    adw_request.db_workload = primary_db_details.db_workload
    adw_request.license_model = primary_db_details.license_model
    adw_request.is_mtls_connection_required = primary_db_details.is_mtls_connection_required
    adw_request.is_auto_scaling_enabled = primary_db_details.is_auto_scaling_enabled
    adw_request.source_id = primary_db_details.id
    adw_request.subnet_id = <standby subnet id>

    adw_response = db_client.create_autonomous_database(create_autonomous_database_details=adw_request)
    print(adw_response.data)
    adw_id = adw_response.data.id
    oci.wait_until(db_client, db_client.get_autonomous_database(adw_id), 'lifecycle_state', 'AVAILABLE')
    print("Created ADW {}".format(adw_id))
    return adw_id

create_cross_region_standby_db is done using standby region credentials. Creation of primary db in the same region works fine.


问:
Buill react-native ios
Can I ask how to make the other virtual machines show usable colors and how to use them?
enter image description here

Can I ask how to make the other virtual machines show usable colors and how to use them? enter image description here

Title: Buill react-native ios


问:
I want to change a filed in admin 'New Customer' to be default 'English'
I already try to use sort order provided by magento but didnt work , now i wrote a JS that overwrites and when page is loaded it just change from 'deutch' to 'english' but doesnt work properly , can somebody take a look and veryfy why ?

```<code>location: module-name/view/adminhtml/web/js/customer.js
</code>```

$(document).ready(function() {
console.log('customer ready');

```<code>// Set the default value for the "associate-to-website" element
$("#associate-to-website").val("Main Website");

document.addEventListener("change", function(event) {
    console.log('change event triggered', event);

    if (event.target.id === "associate-to-website" && event.target.value === "Main Website") {
        $("#send-welcome-email-from").attr("English");
    }
});
</code>```

});

```<code>
</code>```

also view\adminhtml\layout\customer_index_edit.xml

```<code><?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="Printq_X1::js/customer.js"/>
        <script src="https://code.jquery.com/jquery-1.4.1.min.js"></script>
    </head>
</page>
</code>```
```<code>
</code>```

Body:
I already try to use sort order provided by magento but didnt work , now i wrote a JS that overwrites and when page is loaded it just change from 'deutch' to 'english' but doesnt work properly , can somebody take a look and veryfy why ?

location: module-name/view/adminhtml/web/js/customer.js

$(document).ready(function() {
console.log('customer ready');

// Set the default value for the "associate-to-website" element
$("#associate-to-website").val("Main Website");

document.addEventListener("change", function(event) {
    console.log('change event triggered', event);

    if (event.target.id === "associate-to-website" && event.target.value === "Main Website") {
        $("#send-welcome-email-from").attr("English");
    }
});

});

also view\adminhtml\layout\customer_index_edit.xml

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

</page>


问:
Set quser result in Combobox Winforms
i want to build a small Tool, to show all Connected User on my Terminalserver in a Combobox to select and kick them.

Can anyone explain me how to integrate the "quser /server:SERVERNAME" Result off "Username" into my Combobox.

Thanks !

quser /server:SERVERNAME

Title: Set quser result in Combobox Winforms


问:
hg-git: `unknown revision` with one git clone, ok with another

Closed: I started a hg clone... by error in the git repository and this created an empty hg repository. So hggit checks the differences with the empty hg repo and not the git conversion.

$ hg incoming -r branchname_bkm G1
comparing with /home/xxxx/src
abort: unknown revision 'branchname_bkm'
```
<p><code>_bkm</code> is the suffix I use between git branches and hg bookmarks.</p>
<p>I have a mercurial repository for long time (named <code>HG0</code>).
I converted it to git using the hggit extension, pushed it to gitlab.</p>
<p>I usually develop in the git repo (named <code>G1</code>) but our official repo is still mercurial.
When needed, I import a git branch (as bookmarks) this way:</p>
<ul>
<li><p>update the hg-git map:</p>
<pre class="lang-bash prettyprint-override"><code>cd HG0
hg pull
hg update main_bkm  # bookmark on default == main
hg git-cleanup
hg outgoing G1
</code>```

import git branch:

hg in -r <branchname> G1
```

It worked perfectly during months.

For about 2 weeks, hg out shows me all the changesets, not only the new ones and hg in returns unknown revision!

I created a new git clone G2 from gitlab. hg out G2 is correct and only shows few revs as expected.
I could exchange my git branch from G1 to G2 and get it in HG0, ok.

How can I "re-synchronize" my hg repo with G1?

git-cleanup does not change anything.

I even tried to entirely rebuild the embedded .hg/git (~2 hours), no change.

If I grep a revision shown by hg out G1 in .hg/git-mapfile, it corresponds to the related revision in G1...

May git garbage collection process "hides" something used to identify the repo?

Thanks in advance.

Body:
Closed: I started a hg clone... by error in the git repository and this created an empty hg repository. So hggit checks the differences with the empty hg repo and not the git conversion.

$ hg incoming -r branchname_bkm G1
comparing with /home/xxxx/src
abort: unknown revision 'branchname_bkm'

_bkm is the suffix I use between git branches and hg bookmarks.

I have a mercurial repository for long time (named HG0).
I converted it to git using the hggit extension, pushed it to gitlab.

I usually develop in the git repo (named G1) but our official repo is still mercurial.
When needed, I import a git branch (as bookmarks) this way:

update the hg-git map:

cd HG0
hg pull
hg update main_bkm  # bookmark on default == main
hg git-cleanup
hg outgoing G1

import git branch:

hg in -r <branchname> G1

It worked perfectly during months.

For about 2 weeks, hg out shows me all the changesets, not only the new ones and hg in returns unknown revision!

I created a new git clone G2 from gitlab. hg out G2 is correct and only shows few revs as expected.
I could exchange my git branch from G1 to G2 and get it in HG0, ok.

How can I "re-synchronize" my hg repo with G1?

git-cleanup does not change anything.

I even tried to entirely rebuild the embedded .hg/git (~2 hours), no change.

If I grep a revision shown by hg out G1 in .hg/git-mapfile, it corresponds to the related revision in G1...

May git garbage collection process "hides" something used to identify the repo?

Thanks in advance.


问:
Calling component method in Nuxt from external JS file
I've got an external code that calls on a specific function name callbackFunc() and I cannot change this file as it belongs externally.

Currently, I have defined the function someEvent() in a separate callback.js file in the /static folder:

`

```<code>function callbackFunc(e) {
    // I want to call my Nuxt page methods here
}
</code>```

`

and added to nuxt.config.js:
`

```<code>script: [

      { src: '/callback.js' },
    ],
</code>```

`

How do I call my index.vue methods here in this callback.js? Or if you have a better method, I welcome any suggestions.

Body:
I've got an external code that calls on a specific function name callbackFunc() and I cannot change this file as it belongs externally.

Currently, I have defined the function someEvent() in a separate callback.js file in the /static folder:

`

function callbackFunc(e) {
    // I want to call my Nuxt page methods here
}

`

and added to nuxt.config.js:
`

script: [

      { src: '/callback.js' },
    ],

`

How do I call my index.vue methods here in this callback.js? Or if you have a better method, I welcome any suggestions.


问:
How to Authenticate to LDAP server when the available managerPassword is not in cleartext but hashed using a secure salt?
EDIT- The server currently hashes the incoming cleartext user password and compares that with the hash that is stored in the server. My problem is that my application is sending the password already hashed, so when the server tries to hash it again, it obviously doesn't match the cleartext password's hash stored with the server.

An example-

Let's assume the password to be abc and the hash to be
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

Normally the LDAP server receives abc as password, computes the hash
and compares it with what it has stored and it is matched.

My Case: Instead of sending abc, I'm now sending it's hashed form
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad. Now the server hashes this which results in
b6291ce396cb2fd46f4a5410b4f9a739ae89e182fc0bd0fc7f8d064e5bfe35e9, obviously different from the actual hash of abc and the source of my

problem.


问:
Transformation function to be applied on every row in data frame
I load a JSON file into a dataframe and want to apply one function on every single row. I will use the existing column "item_name" and do some logical checks and add a new column in the dataframe. But this doesn't work actually and throwing some error.

```<code> def load_data(data_file):
    with open(data_file, 'r', encoding='utf8') as d:
       data = json.load(d)
    df = pd.DataFrame.from_dict(data)
    df = df_gt.apply(name_list, axis=1)

def name_list(df):
    for column in df[['item_name']]:
        names = []
        #processing ...
        names.append(value)
    df['names_list'] = names
    return(df)
</code>```

Inside my second function, name_list, when I try to print df, I am getting error. Hence would like to know how to pass the entire dataframe as argument

Body:
I load a JSON file into a dataframe and want to apply one function on every single row. I will use the existing column "item_name" and do some logical checks and add a new column in the dataframe. But this doesn't work actually and throwing some error.

 def load_data(data_file):
    with open(data_file, 'r', encoding='utf8') as d:
       data = json.load(d)
    df = pd.DataFrame.from_dict(data)
    df = df_gt.apply(name_list, axis=1)

def name_list(df):
    for column in df[['item_name']]:
        names = []
        #processing ...
        names.append(value)
    df['names_list'] = names
    return(df)

Inside my second function, name_list, when I try to print df, I am getting error. Hence would like to know how to pass the entire dataframe as argument


问:
How to run schedule every 7 minutes
my current schedule runs everyFiveMinutes .</p>
```<code>$schedule->command('booking:cron')->everyFiveMinutes();
</code>```

Title: How to run schedule every 7 minutes

Body:
my current schedule runs everyFiveMinutes .

$schedule->command('booking:cron')->everyFiveMinutes();