问:
How to write a spec file for encryption and decryption in angular for (Login component service.ts)
```<code>  login(params: EncryptedParams): Observable<User> {
    return this.http
      .post<User>(`${this.url}/v1/login`, params, {
        observe: 'response',
      })
      .pipe(
        map((httpResponse: HttpResponse<any>) => {
          const key = httpResponse.headers.get('Authorization');
          const userInfo = this.rsaHelperService.decryptWithKey(
            httpResponse.body.user,
            key.replace('Bearer ', '')
          );

          if (userInfo) {
            const parsedUserInfo = JSON.parse(userInfo);
            const role_key = `${parsedUserInfo.email}_${parsedUserInfo.id}_${parsedUserInfo.first_name}`;
            const decrypted_role = this.rsaHelperService.decryptWithKey(
              parsedUserInfo.role,
              role_key
            );
            const userDetails: User = {
              id: parsedUserInfo.id,
              role: decrypted_role,
              email: parsedUserInfo.email,
              first_name: parsedUserInfo.first_name,
              token: httpResponse.headers.get('Authorization'),
              last_name: parsedUserInfo.last_name,
              confirmed_at: parsedUserInfo.confirmed_at,
              sign_in_count: parsedUserInfo.sign_in_count,
              last_sign_in_at: parsedUserInfo.last_sign_in_at,
              organization_id: parsedUserInfo.organization_id,
              current_sign_in_at: parsedUserInfo.current_sign_in_at,
              preferred_time_zone: parsedUserInfo.preferred_time_zone,
              dimension: parsedUserInfo.dimension,
              organization_name: parsedUserInfo.organization_name,
              contact_info: parsedUserInfo.contact_info,
              preferred_language: parsedUserInfo.preferred_language,
              shipping_addresses: parsedUserInfo.shipping_addresses,
              billing_address: parsedUserInfo.billing_address,
            };
            return userDetails;
          }
        })
      );
  }
</code>```

Model file for Login component service.ts

```<code>export interface EncryptedParams {
  auth: string;
}
</code>```

This code snippet is from the login component service.ts file. So my problem is to write a spec file for this login component service file. So if anyone knows the task please comment it.

Thank you

Body:
  login(params: EncryptedParams): Observable<User> {
    return this.http
      .post<User>(`${this.url}/v1/login`, params, {
        observe: 'response',
      })
      .pipe(
        map((httpResponse: HttpResponse<any>) => {
          const key = httpResponse.headers.get('Authorization');
          const userInfo = this.rsaHelperService.decryptWithKey(
            httpResponse.body.user,
            key.replace('Bearer ', '')
          );

          if (userInfo) {
            const parsedUserInfo = JSON.parse(userInfo);
            const role_key = `${parsedUserInfo.email}_${parsedUserInfo.id}_${parsedUserInfo.first_name}`;
            const decrypted_role = this.rsaHelperService.decryptWithKey(
              parsedUserInfo.role,
              role_key
            );
            const userDetails: User = {
              id: parsedUserInfo.id,
              role: decrypted_role,
              email: parsedUserInfo.email,
              first_name: parsedUserInfo.first_name,
              token: httpResponse.headers.get('Authorization'),
              last_name: parsedUserInfo.last_name,
              confirmed_at: parsedUserInfo.confirmed_at,
              sign_in_count: parsedUserInfo.sign_in_count,
              last_sign_in_at: parsedUserInfo.last_sign_in_at,
              organization_id: parsedUserInfo.organization_id,
              current_sign_in_at: parsedUserInfo.current_sign_in_at,
              preferred_time_zone: parsedUserInfo.preferred_time_zone,
              dimension: parsedUserInfo.dimension,
              organization_name: parsedUserInfo.organization_name,
              contact_info: parsedUserInfo.contact_info,
              preferred_language: parsedUserInfo.preferred_language,
              shipping_addresses: parsedUserInfo.shipping_addresses,
              billing_address: parsedUserInfo.billing_address,
            };
            return userDetails;
          }
        })
      );
  }

Model file for Login component service.ts

export interface EncryptedParams {
  auth: string;
}

This code snippet is from the login component service.ts file. So my problem is to write a spec file for this login component service file. So if anyone knows the task please comment it.

Thank you


来源: stackexchange

问:
event.stop(e) and returnfalse statemens are not working
```<code><div class = "heading">
   Add Service Order
</div>
<%= link_to "Back" ,:action => "list"%>

<div style="float: left;">
        <%#= form_tag ({:action => 'create' do %>
     <%= form_tag({:action => 'create'}, :multipart=>true, :id=> @add_service_order, :method => :post) do %>
            <%= render :partial => 'form' %>
<br>
<center><%= submit_tag 'Save',:class=>"buttons",:id => "save_button", :onClick => "po_num();"%></center>
</br>
        <% end %>
</div>

<script>
function po_num(){
//alert ("11")

  var po = document.getElementById('add_service_order_service_order_no').value
//alert(po);
//return false;

    if (po == "")
    {
            alert("Please fill PO Number");
       Event.stop(e);
    }
}

</script>
</code>```

event.stop(e) and Returnfalse are not working.Whenever i am going to save without filling mandatory fields it's giving alert but it is not stoping there and it is going to next page and saving..How can i resolve this ?

ContentLicense: CC BY-SA 4.0

Body:
   Add Service Order

<%= link_to "Back" ,:action => "list"%>

        <%#= form_tag ({:action => 'create' do %>
     <%= form_tag({:action => 'create'}, :multipart=>true, :id=> @add_service_order, :method => :post) do %>
            <%= render :partial => 'form' %>

<%= submit_tag 'Save',:class=>"buttons",:id => "save_button", :onClick => "po_num();"%>

        <% end %>

event.stop(e) and Returnfalse are not working.Whenever i am going to save without filling mandatory fields it's giving alert but it is not stoping there and it is going to next page and saving..How can i resolve this ?


问:
All paths after slash are counted as id
Api routes:

```<code>router.get("/", passport.authenticate('jwt', { session: false }), Controller.getAll);
router.get("/category_items",  passport.authenticate('jwt', { session: false }), Controller.getCategoryItems);
</code>```

Error Message on postman and console :

```<code>{
    "message": "TypeError: Cannot read properties of undefined (reading 'itemCategories')"
}
</code>```

The error occurs because of a getById route, which is not the route that I want to send the request to.

I have an API with following Routes:

```<code>router.get("/:id", passport.authenticate('jwt', { session: false }), Controller.getById);
router.get("/", passport.authenticate('jwt', { session: false }), Controller.getAll);
router.get("/category_items",  passport.authenticate('jwt', { session: false }), Controller.getCategoryItems);
router.post("/", passport.authenticate('jwt', { session: false }), Controller.create);
router.put("/", passport.authenticate('jwt', { session: false }), Controller.update);
router.delete("/:id", passport.authenticate('jwt', { session: false }), Controller.destroy
</code>```

The problem is that when I try to test getCategoryItems on Postman by typing /category_items after my link, post counts category_items as an id, so an error in getById method appears in the console.

Does anybody have any idea about this issue?

Title: All paths after slash are counted as id

Body:
Api routes:

router.get("/", passport.authenticate('jwt', { session: false }), Controller.getAll);
router.get("/category_items",  passport.authenticate('jwt', { session: false }), Controller.getCategoryItems);

Error Message on postman and console :

{
    "message": "TypeError: Cannot read properties of undefined (reading 'itemCategories')"
}

The error occurs because of a getById route, which is not the route that I want to send the request to.

I have an API with following Routes:

router.get("/:id", passport.authenticate('jwt', { session: false }), Controller.getById);
router.get("/", passport.authenticate('jwt', { session: false }), Controller.getAll);
router.get("/category_items",  passport.authenticate('jwt', { session: false }), Controller.getCategoryItems);
router.post("/", passport.authenticate('jwt', { session: false }), Controller.create);
router.put("/", passport.authenticate('jwt', { session: false }), Controller.update);
router.delete("/:id", passport.authenticate('jwt', { session: false }), Controller.destroy

The problem is that when I try to test getCategoryItems on Postman by typing /category_items after my link, post counts category_items as an id, so an error in getById method appears in the console.

Does anybody have any idea about this issue?


问:
Error: Unsupported strips at Object.writeSTL in vtk.js
I am trying to create STL files using vtk.js of a vtkTubeFilter polyData.

The error am getting is:

Error: Unsupported strips
    at Object.writeSTL
```
<p>The code I'm using to get STL data:</p>
<pre class="lang-js prettyprint-override"><code>const data = vtkSTLWriter.writeSTL(
      polyData,
      'ascii',
      transform.getMatrix()
    );
</code>```

where, transform is a vtkTransform object and polyData is the polyData obtained from getOutputData() on vtkTubeFilter source.

As per vtk.js source code for writeSTL function, the number of strips must be 0 or null.

I checked on the polyData object, it has an array of length 140 for getStrips().getData().

let strips = newPolyData.getStrips().getData();
console.log(strips.length);
console.log(strips)
```
```140
Uint32Array(140) [6, 1, 0, 21, 20, 41, 40, 6, 2, 1, 22, 21, 42, 41, 6, 3, 2, 23, 22, 43, 42, 6, 4, 3, 24, 23, 44, 43, 6, 5, 4, 25, 24, 45, 44, 6, 6, 5, 26, 25, 46, 45, 6, 7, 6, 27, 26, 47, 46, 6, 8, 7, 28, 27, 48, 47, 6, 9, 8, 29, 28, 49, 48, 6, 10, 9, 30, 29, 50, 49, 6, 11, 10, 31, 30, 51, 50, 6, 12, 11, 32, 31, 52, 51, 6, 13, 12, 33, 32, 53, 52, 6, 14, 13, 34, 33, 54, 53, 6, 15, …]
```

How can fix/debug this error, and still write it to STL file. Or, what am I doing wrong?

Body:
I am trying to create STL files using vtk.js of a vtkTubeFilter polyData.

The error am getting is:

Error: Unsupported strips
    at Object.writeSTL

The code I'm using to get STL data:

const data = vtkSTLWriter.writeSTL(
      polyData,
      'ascii',
      transform.getMatrix()
    );

where, transform is a vtkTransform object and polyData is the polyData obtained from getOutputData() on vtkTubeFilter source.

As per vtk.js source code for writeSTL function, the number of strips must be 0 or null.

I checked on the polyData object, it has an array of length 140 for getStrips().getData().

let strips = newPolyData.getStrips().getData();
console.log(strips.length);
console.log(strips)

140
Uint32Array(140) [6, 1, 0, 21, 20, 41, 40, 6, 2, 1, 22, 21, 42, 41, 6, 3, 2, 23, 22, 43, 42, 6, 4, 3, 24, 23, 44, 43, 6, 5, 4, 25, 24, 45, 44, 6, 6, 5, 26, 25, 46, 45, 6, 7, 6, 27, 26, 47, 46, 6, 8, 7, 28, 27, 48, 47, 6, 9, 8, 29, 28, 49, 48, 6, 10, 9, 30, 29, 50, 49, 6, 11, 10, 31, 30, 51, 50, 6, 12, 11, 32, 31, 52, 51, 6, 13, 12, 33, 32, 53, 52, 6, 14, 13, 34, 33, 54, 53, 6, 15, …]

How can fix/debug this error, and still write it to STL file. Or, what am I doing wrong?


问:
What is the character limit of full links (not shortened) created by twitter's t.co?
I understand there's no theoretical character limit to a URL, but it's 255 for the domain.

The consensus seems to indicate a safe bet is about 2000 characters, but it all depends on the browser and web server.

The twitter API faq for t.co doesn't mention a limit for expanded links, but instead only the shortened links.

Does anyone know what the maximum character count for a fully-expanded t.co link is, regardless of browser or target web server?

Is there a quick and easy way to check?

What happens if a link is too long?


问:
Command PhaseScriptExecution failed with a nonzero exit code

License verification fails

Command PhaseScriptExecution failed with a nonzero exit code

**./Scripts/PodsLicenseCheck.sh: line 8:

path/ruby/bin/ad_licenselint: No such file or directory**

I m using Xcode 14.2, MacOS Ventura 13.1, pod 1.11.3, ruby 2.6.10p210


问:
Firebase Analytics google_analytics_automatic_screen_reporting_enabled not working
i am using these versions for firebase analytics:

firebase_analytics: ^10.1.0
firebase_core: ^2.1.0
firebase_crashlytics: ^3.0.9

i have added

in application tag, after that its adding screen reporting on firebase dashboard,


问:
The spring cloud gateway does not respond after multiple visits to the Actuator interface
The spring cloud gateway does not respond after multiple visits to the Actuator interface. In the actuator access path, I set up a webfilter to authenticate to token using the restTemplate access authentication service. After accessing the actuator multiple times, all requests fail to respond, and other services that use Tomcat do not.

The following versions have been tried, and the same problem will occur
Operating environment: Windows10 22H2, Intellij IDEA 2022.3, JDK1.8 8u341 Oracle HotSpot
SpringBoot version: 2.3.12.RELEASE, 2.6.3
Gateway version: 2.2.9.RELEASE, 3.1.1
Registration Center: Nacos 2.1.1
Cloud version: Hoxton. SR12, 3.1.1
CloudAlibaba version: 2.2.7.RELEASE, 2021.0.1.0

It would be better if you could answer in Chinese!


问:
Upgraded pgAdmin shows warning, not displaying Tables list, queries working without problem
I upgraded my local Postgresql test server to PostgreSQL15 today morning.
Opening pgAdmin gave me a warning that some of the features may not work correctly because I have a server with version 9 added to pgAdmin.

Steps done:

Upgraded Postgresql v14 to v15.

PgAdmin shows warnings and couldn't see the tables list.

Uninstalled v15 and installed v14. Again the same issue.

Uninstalled v14 and get v12 of Postgresql.

Clean uninstall was done by removing the Postgresql folder from the "ProgamFiles" folder and  "AppData/Roaming"

Current situation:

Still, pgAdmin is not showing the list of tables for the older server version (v9).
I cannot upgrade this server, but have to use it in PgAdmin as before.
But I can run the all queries without any problem.

When adding the V9 server, pgAdmin shows a warning like this

It is listing up all schemas, views, and sequences. But when clicking the Tables, it keeps loading and never gives the list of tables.

By the way, I am using Windows 10 64bit OS.

After five days, I degraded my Postgresql to V12 and now getting an error like this:

```<code>ERROR: column "wait_event_type" does not exist LINE 10: wait_event_type || ': ' || wait_event AS wait_event, ^
enter code here
</code>```

Have anybody gone through such an issue? Need some help. Thanks in advance.

Body:
I upgraded my local Postgresql test server to PostgreSQL15 today morning.
Opening pgAdmin gave me a warning that some of the features may not work correctly because I have a server with version 9 added to pgAdmin.

Steps done:

Upgraded Postgresql v14 to v15.

PgAdmin shows warnings and couldn't see the tables list.

Uninstalled v15 and installed v14. Again the same issue.

Uninstalled v14 and get v12 of Postgresql.

Clean uninstall was done by removing the Postgresql folder from the "ProgamFiles" folder and  "AppData/Roaming"

Current situation:

Still, pgAdmin is not showing the list of tables for the older server version (v9).
I cannot upgrade this server, but have to use it in PgAdmin as before.
But I can run the all queries without any problem.

When adding the V9 server, pgAdmin shows a warning like this

It is listing up all schemas, views, and sequences. But when clicking the Tables, it keeps loading and never gives the list of tables.

By the way, I am using Windows 10 64bit OS.

After five days, I degraded my Postgresql to V12 and now getting an error like this:

ERROR: column "wait_event_type" does not exist LINE 10: wait_event_type || ': ' || wait_event AS wait_event, ^
enter code here

Have anybody gone through such an issue? Need some help. Thanks in advance.


问:
Expo publish updates are not available on new installs?
I have build an app with expo. Let's say version 1.0.10
This app is available on test flight and I can install and check the functionality.
Now, if I find some issue, I use expo publish --release-channel production to fix the same.
Next time when I open my app, I receive the latest updates and issue is fixed.

But the problem is, if I delete the app, and install it again from the test flight, it still has the old version of code i.e. from 1.0.10. To see the latest updates, I have to kill the app and open it again. Is there a way to handle updates correctly? All the new installs should get the latest updates.

I tried multiple updates over version 1.0.10. But the latest updates are not available on new installs. I always have to kill the app and open it again to get the latest, which is not what i want.
Should I include a step to check if updates are available, and if yes, get the latest updates. Build this with version 1.0.11 and try expo publish and see new installs has the latests updates?


问:
Selenium - How to use the old Firefox webbrowser instead opening a new webbrowser?
When I use selenium to automate programes in web, if I made some mistakes in my python codes, the IDLE will stop and appear to be full of red words.
I correct my codes, and then run my program again, program execution starts from the zero, not to contine from my previous process.It wasted me so much time.
How to solve the problem in Firefox?
Thanks a lot!</p>


问:
Excel: How do i auto extract updated info from the main sheet to individual sheets
I am currently doing a sales summary consist of lots of customers, and I am trying to find a way to automatically update the value from the main sheet to individual customers sheet as there are too many customers for me to do that.
The Main Sheet would look like like this with headers

```<code>| Serial|   | Date |   | Customer Name|   | Product Info|
| 001   |   |Jan4th|   | Mike         |   | Apple       |
</code>```

i am trying to create a formula so that the other individual sheet could only extract rows that was from only the customer (Mike), and other sheets would be of other customers as well.
It would help a lot if the formula can auto add in value that would soon be update as well, as other method i found only able to distribute available values, and when there are new value to be add, i have to repeat the process again which is not effiecent given the number of customers i have to summary for

If not formula then any other method would help too, but VBA is a bit above my capability so if you can provide detail for how i can make use of it, it would be delightful

If anyone can come up with anything i would be grateful, thank you for your attention

i have tried the copy paste link but they do not auto update new value after the paste.

Body:
I am currently doing a sales summary consist of lots of customers, and I am trying to find a way to automatically update the value from the main sheet to individual customers sheet as there are too many customers for me to do that.
The Main Sheet would look like like this with headers

| Serial|   | Date |   | Customer Name|   | Product Info|
| 001   |   |Jan4th|   | Mike         |   | Apple       |

i am trying to create a formula so that the other individual sheet could only extract rows that was from only the customer (Mike), and other sheets would be of other customers as well.
It would help a lot if the formula can auto add in value that would soon be update as well, as other method i found only able to distribute available values, and when there are new value to be add, i have to repeat the process again which is not effiecent given the number of customers i have to summary for

If not formula then any other method would help too, but VBA is a bit above my capability so if you can provide detail for how i can make use of it, it would be delightful

If anyone can come up with anything i would be grateful, thank you for your attention

i have tried the copy paste link but they do not auto update new value after the paste.


问:
Debug with remote android emulator in visual studio
my system which I develop MAUI on is not enough for running android emulator, so I decided to run android emulator on another Computer and debug my project remotely on it, I use this help to make a connection between computers, then when I build my project to debug it, visual studio recognize the emulator, install the app on it, and shows the splash screen, but after some minute, it shows this error and debuger agent can not connect:

[monodroid-debug] Trying to initialize the debugger with options:
--debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:36845,embedding=1

[mono] debugger-agent: Unable to connect to 10.0.2.2:36845

I should notice that the port is random

in this documentation of developer.android it shows that

10.0.2.2 is Special alias to your host loopback interface (127.0.0.1 on your development machine)

how should I fix it to can debug remotely in my development machine?


问:
Laravel code hinting not working (PhpStorm)
I am trying to get code hinting for collection code block

```<code>public static function find($slug)
{
    return static::all()->firstWhere("slug", $slug);
}

public static function all()
{
    return collect(File::files(resource_path("posts")))
        ->map(fn($file) => YamlFrontMatter::parseFile($file))
        ->map(fn($document) => new Post(
            $document->title,
            $document->excerpt,
            $document->date,
            $document->slug,
            $document->body(),
        ));
}
</code>```

But when I do static::all()-> it gives me 0 code hinting.

I have Laravel Idea plugin.

I install laravel-ide-helper and generated it.

I install  require doctrine/dbal

I cannot get the code hinting.

Body:
I am trying to get code hinting for collection code block

public static function find($slug)
{
    return static::all()->firstWhere("slug", $slug);
}

public static function all()
{
    return collect(File::files(resource_path("posts")))
        ->map(fn($file) => YamlFrontMatter::parseFile($file))
        ->map(fn($document) => new Post(
            $document->title,
            $document->excerpt,
            $document->date,
            $document->slug,
            $document->body(),
        ));
}

But when I do static::all()-> it gives me 0 code hinting.

I have Laravel Idea plugin.

I install laravel-ide-helper and generated it.

I install  require doctrine/dbal

I cannot get the code hinting.


问:
Ansible: Install Qualys Cloud Agent in Windows
I've been trying to get this running but it just won't go for me.
Here's the thing, I need to install Qualys through Ansible and it's making me mad.
The script I've got (that works) is a powershell script and it's like this:

```<code>Invoke-Command -ScriptBlock {& cmd /c .\QualysCloudAgent_4.6.1.6.exe CustomerId=$CId ActivationId=$AId WebServiceUri="http://qagpublic.qg2.apps.qualys.eu/CloudAgent/"}
</code>```

Now, I've tried to use win_shell, win_powershell, win_raw, win_package...
I've tried to pass the parameters separately, to use become to become another user and elevate it.... but it just won't go.

It looks something like this what I need:

```<code>- name: Install Qualys Agent on the machine
  ansible.win_shell: Invoke-Command -ScriptBlock {& cmd /c C:\\_IDTDeploy\\SW\\Qualys\\QualysCloudAgent_4.6.1.6.exe CustomerId="'{'{{customer_id}}'}'" ActivationId="'{'{{activation_id}}'}'" WebServiceUri="http://qagpublic.qg2.apps.qualys.eu/CloudAgent/"}
</code>```

I've tried this

```<code>- name: Install Qualys agent
  ansible.windows.win_package:
    path: "{{ installingpath46 }}"
    arguments:
    - ActivationId="'{'{{activation_id}}'}'"
    - CustomerId="'{'{{customer_id}}'}'"
    - WebServiceUri="{{uripath}}"
    - /install
    - /passive
    - /norestart
    - /S
    state: present
</code>```

still, nothing.
Some of them won't go through, and some of them will but will install nothing.
Note that if I am to run the original script in PS or if I do just the CMD bit in a command prompt window it works perfectly.

Has any of you had to deal with this?
Thank you in advance!

I by now think I've tried pretty much everything I could find, there's even a script in github to install particularly Qualys, but I haven't found any that would have to use those arguments I'm having trouble with, I don't know if that's normal in all qualys installations.

Any advice will be much appreciated.
Cheers!

Body:
I've been trying to get this running but it just won't go for me.
Here's the thing, I need to install Qualys through Ansible and it's making me mad.
The script I've got (that works) is a powershell script and it's like this:

Invoke-Command -ScriptBlock {& cmd /c .\QualysCloudAgent_4.6.1.6.exe CustomerId=$CId ActivationId=$AId WebServiceUri="http://qagpublic.qg2.apps.qualys.eu/CloudAgent/"}

Now, I've tried to use win_shell, win_powershell, win_raw, win_package...
I've tried to pass the parameters separately, to use become to become another user and elevate it.... but it just won't go.

It looks something like this what I need:

- name: Install Qualys Agent on the machine
  ansible.win_shell: Invoke-Command -ScriptBlock {& cmd /c C:\\_IDTDeploy\\SW\\Qualys\\QualysCloudAgent_4.6.1.6.exe CustomerId="'{'{{customer_id}}'}'" ActivationId="'{'{{activation_id}}'}'" WebServiceUri="http://qagpublic.qg2.apps.qualys.eu/CloudAgent/"}

I've tried this

- name: Install Qualys agent
  ansible.windows.win_package:
    path: "{{ installingpath46 }}"
    arguments:
    - ActivationId="'{'{{activation_id}}'}'"
    - CustomerId="'{'{{customer_id}}'}'"
    - WebServiceUri="{{uripath}}"
    - /install
    - /passive
    - /norestart
    - /S
    state: present

still, nothing.
Some of them won't go through, and some of them will but will install nothing.
Note that if I am to run the original script in PS or if I do just the CMD bit in a command prompt window it works perfectly.

Has any of you had to deal with this?
Thank you in advance!

I by now think I've tried pretty much everything I could find, there's even a script in github to install particularly Qualys, but I haven't found any that would have to use those arguments I'm having trouble with, I don't know if that's normal in all qualys installations.

Any advice will be much appreciated.
Cheers!


问:
Getting error as xcodebuild failed with code 65 Event 'wdaStartFailed'
Hi getting below error while running appium automation sript for ios device using xcode 14.I tried all th possible solutions but no luck so far.
As per below link there is a changes in xcode 14 which support only appium 2,but before trying appium 2 i wanted to confirm once whether this is the actual root cause or there is any other config issue https://forum.katalon.com/t/failed-to-build-webdriveragent-to-deployed-on-ios-16/78524
Below is the complete appium log</p>
```<code>[info] [35m[Appium][39m Appium v1.22.0 creating new XCUITestDriver (v3.53.1) session
[info] [35m[Appium][39m Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[debug] [35m[BaseDriver][39m Creating session with W3C capabilities: {
[debug] [35m[BaseDriver][39m   "alwaysMatch": {
[debug] [35m[BaseDriver][39m     "platformName": "ios",
[debug] [35m[BaseDriver][39m     "appium:VERSION": "15.6.1",
[debug] [35m[BaseDriver][39m     "appium:automationName": "XCUITest",
[debug] [35m[BaseDriver][39m     "appium:bundleId": "com.mobisy.bizom",
[debug] [35m[BaseDriver][39m     "appium:deviceName": "Bizom Iphone",
[debug] [35m[BaseDriver][39m     "appium:udid": "00008110-001475EE0C80401E",
[debug] [35m[BaseDriver][39m     "appium:xcodeOrgId": "CM3KB1234",
[debug] [35m[BaseDriver][39m     "appium:xcodeSigningId": "iPhone Developer"
[debug] [35m[BaseDriver][39m   },
[debug] [35m[BaseDriver][39m   "firstMatch": [
[debug] [35m[BaseDriver][39m     {}
[debug] [35m[BaseDriver][39m   ]
[debug] [35m[BaseDriver][39m }
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [35m[iProxy@00008110:8100][39m Connection was refused to port 8100
[info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus'
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [35m[iProxy@00008110:8100][39m Connection was refused to port 8100
[info] [35m[WD Proxy][39m socket hang up[error] [35m[WebDriverAgent][39m xcodebuild exited with code '65' and signal 'null'
[info] [35m[WebDriverAgent][39m Launching WebDriverAgent on the device
[info] [35m[WebDriverAgent][39m WebDriverAgent does not need a cleanup. The sources are up to date (1644399105000 >= 1632535255000)
[debug] [35m[WebDriverAgent][39m Killing running processes 'xcodebuild.*00008110-001475EE0C80401E' for the device 00008110-001475EE0C80401E...[debug] [35m[WebDriverAgent][39m 'pgrep -if xcodebuild.*00008110-001475EE0C80401E' didn't detect any matching processes. Return code: 1
[debug] [35m[WebDriverAgent][39m Using Xcode configuration file: '/var/folders/nt/rb3yh81n7m543x9rl4996v7c0000gp/T/202303-842-1lzs80g.e5g4/appium-temp.xcconfig'
[debug] [35m[WebDriverAgent][39m Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/divya.p/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou -destination id=00008110-001475EE0C80401E IPHONEOS_DEPLOYMENT_TARGET=15.6 -xcconfig /var/folders/nt/rb3yh81n7m543x9rl4996v7c0000gp/T/202303-842-1lzs80g.e5g4/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
[debug] [35m[WebDriverAgent][39m Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus'
[info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus'
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus'
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [35m[iProxy@00008110:8100][39m Connection was refused to port 8100
[info] [35m[WD Proxy][39m socket hang up
[error] [35m[WebDriverAgent][39m xcodebuild exited with code '65' and signal 'null'
[debug] [35m[BaseDriver][39m Event 'wdaStartFailed' logged at 1672738945363 (15:12:25 GMT+0530 (India Standard Time))
[debug] [35m[XCUITest][39m Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [35m[XCUITest][39m xcodebuild error message:
[debug] [35m[XCUITest][39m . Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[warn] [35m[XCUITest][39m Quitting and uninstalling WebDriverAgent
[info] [35m[WebDriverAgent][39m Shutting down sub-processes[debug] [35m[WebDriverAgent][39m Uninstalling WDAs: 'com.mobisy.bizom.xctrunner'[error] [35m[XCUITest][39m {}
[info] [35m[DevCon Factory][39m Releasing connections for 00008110-001475EE0C80401E device on any port number
[info] [35m[DevCon Factory][39m Found cached connections to release: ["00008110-001475EE0C80401E:8100"]
[info] [35m[DevCon Factory][39m Releasing the listener for '00008110-001475EE0C80401E:8100'
[debug] [35m[iProxy@00008110:8100][39m Closing the connection
[debug] [35m[DevCon Factory][39m Cached connections count: 0
[debug] [35m[XCUITest][39m Not clearing log files. Use `clearSystemFiles` capability to turn on.
[info] [35m[iProxy@00008110:8100][39m The connection has been closed
</code>```

Body:
Hi getting below error while running appium automation sript for ios device using xcode 14.I tried all th possible solutions but no luck so far.
As per below link there is a changes in xcode 14 which support only appium 2,but before trying appium 2 i wanted to confirm once whether this is the actual root cause or there is any other config issue https://forum.katalon.com/t/failed-to-build-webdriveragent-to-deployed-on-ios-16/78524
Below is the complete appium log

[info] [35m[Appium][39m Appium v1.22.0 creating new XCUITestDriver (v3.53.1) session
[info] [35m[Appium][39m Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[debug] [35m[BaseDriver][39m Creating session with W3C capabilities: {
[debug] [35m[BaseDriver][39m   "alwaysMatch": {
[debug] [35m[BaseDriver][39m     "platformName": "ios",
[debug] [35m[BaseDriver][39m     "appium:VERSION": "15.6.1",
[debug] [35m[BaseDriver][39m     "appium:automationName": "XCUITest",
[debug] [35m[BaseDriver][39m     "appium:bundleId": "com.mobisy.bizom",
[debug] [35m[BaseDriver][39m     "appium:deviceName": "Bizom Iphone",
[debug] [35m[BaseDriver][39m     "appium:udid": "00008110-001475EE0C80401E",
[debug] [35m[BaseDriver][39m     "appium:xcodeOrgId": "CM3KB1234",
[debug] [35m[BaseDriver][39m     "appium:xcodeSigningId": "iPhone Developer"
[debug] [35m[BaseDriver][39m   },
[debug] [35m[BaseDriver][39m   "firstMatch": [
[debug] [35m[BaseDriver][39m     {}
[debug] [35m[BaseDriver][39m   ]
[debug] [35m[BaseDriver][39m }
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [35m[iProxy@00008110:8100][39m Connection was refused to port 8100
[info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus'
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [35m[iProxy@00008110:8100][39m Connection was refused to port 8100
[info] [35m[WD Proxy][39m socket hang up[error] [35m[WebDriverAgent][39m xcodebuild exited with code '65' and signal 'null'
[info] [35m[WebDriverAgent][39m Launching WebDriverAgent on the device
[info] [35m[WebDriverAgent][39m WebDriverAgent does not need a cleanup. The sources are up to date (1644399105000 >= 1632535255000)
[debug] [35m[WebDriverAgent][39m Killing running processes 'xcodebuild.*00008110-001475EE0C80401E' for the device 00008110-001475EE0C80401E...[debug] [35m[WebDriverAgent][39m 'pgrep -if xcodebuild.*00008110-001475EE0C80401E' didn't detect any matching processes. Return code: 1
[debug] [35m[WebDriverAgent][39m Using Xcode configuration file: '/var/folders/nt/rb3yh81n7m543x9rl4996v7c0000gp/T/202303-842-1lzs80g.e5g4/appium-temp.xcconfig'
[debug] [35m[WebDriverAgent][39m Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/divya.p/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou -destination id=00008110-001475EE0C80401E IPHONEOS_DEPLOYMENT_TARGET=15.6 -xcconfig /var/folders/nt/rb3yh81n7m543x9rl4996v7c0000gp/T/202303-842-1lzs80g.e5g4/appium-temp.xcconfig GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
[debug] [35m[WebDriverAgent][39m Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus'
[info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus'
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus'
[debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [35m[iProxy@00008110:8100][39m Connection was refused to port 8100
[info] [35m[WD Proxy][39m socket hang up
[error] [35m[WebDriverAgent][39m xcodebuild exited with code '65' and signal 'null'
[debug] [35m[BaseDriver][39m Event 'wdaStartFailed' logged at 1672738945363 (15:12:25 GMT+0530 (India Standard Time))
[debug] [35m[XCUITest][39m Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [35m[XCUITest][39m xcodebuild error message:
[debug] [35m[XCUITest][39m . Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[warn] [35m[XCUITest][39m Quitting and uninstalling WebDriverAgent
[info] [35m[WebDriverAgent][39m Shutting down sub-processes[debug] [35m[WebDriverAgent][39m Uninstalling WDAs: 'com.mobisy.bizom.xctrunner'[error] [35m[XCUITest][39m {}
[info] [35m[DevCon Factory][39m Releasing connections for 00008110-001475EE0C80401E device on any port number
[info] [35m[DevCon Factory][39m Found cached connections to release: ["00008110-001475EE0C80401E:8100"]
[info] [35m[DevCon Factory][39m Releasing the listener for '00008110-001475EE0C80401E:8100'
[debug] [35m[iProxy@00008110:8100][39m Closing the connection
[debug] [35m[DevCon Factory][39m Cached connections count: 0
[debug] [35m[XCUITest][39m Not clearing log files. Use `clearSystemFiles` capability to turn on.
[info] [35m[iProxy@00008110:8100][39m The connection has been closed


问:
app crash after closing dialog with navigator.popUntil Flutter
I have a popup dialog on onPressed function in a button, that deletes the Firebase category inside the CATEGORY screen. When I click "ok", then dialog close with Navigotor.pop.context, but then I want to close also the screen to go back the homepage, but the app crash using Navigator.popUntil.
Am i using async await in a correct way?
Because I am quite sure the crash is caused by the Navigator that does not wait Firebase.

this is my custom dialog:

```<code>Widget build(BuildContext context) {
return CupertinoAlertDialog(
  content: Text('delete_cat_msg'.tr()),
  title: ....
  ),
  actions: <Widget>[
    CupertinoDialogAction(
      child: Text("OK"),
      onPressed: () async {
        await userCol.doc(_services.getUserID())
            .collection(widget.collectionName).doc(widget.docID).delete();
        Navigator.pop(context);

      },
    ),
    CupertinoDialogAction(
      child: Text("cancel".tr()),
      onPressed: () {
        Navigator.of(context).pop();
      },
    ),
  ],
);
}
</code>```

This is the category screen with DELETE button:

```<code>TextButton(
  onPressed: () async {
     await showDialog(
              context: context,
              builder: (_) {
                return  DeleteCatDialog(docID: widget.document,
    collectionName: widget.collectionName,);
              }).then((value) => Navigator.popUntil(context,
     ModalRoute.withName('mis_en_place')));
        },
          child: Text(
            'DELETE CATEGORY',
        ),
</code>```

Body:
I have a popup dialog on onPressed function in a button, that deletes the Firebase category inside the CATEGORY screen. When I click "ok", then dialog close with Navigotor.pop.context, but then I want to close also the screen to go back the homepage, but the app crash using Navigator.popUntil.
Am i using async await in a correct way?
Because I am quite sure the crash is caused by the Navigator that does not wait Firebase.

this is my custom dialog:

Widget build(BuildContext context) {
return CupertinoAlertDialog(
  content: Text('delete_cat_msg'.tr()),
  title: ....
  ),
  actions: <Widget>[
    CupertinoDialogAction(
      child: Text("OK"),
      onPressed: () async {
        await userCol.doc(_services.getUserID())
            .collection(widget.collectionName).doc(widget.docID).delete();
        Navigator.pop(context);

      },
    ),
    CupertinoDialogAction(
      child: Text("cancel".tr()),
      onPressed: () {
        Navigator.of(context).pop();
      },
    ),
  ],
);
}

This is the category screen with DELETE button:

TextButton(
  onPressed: () async {
     await showDialog(
              context: context,
              builder: (_) {
                return  DeleteCatDialog(docID: widget.document,
    collectionName: widget.collectionName,);
              }).then((value) => Navigator.popUntil(context,
     ModalRoute.withName('mis_en_place')));
        },
          child: Text(
            'DELETE CATEGORY',
        ),


问:
How to fix error validation split in MLP using Keras?
I'm newbie in Neural Network. I'm going to do a text classification research using MLP model with keras. Input layer consisting of 900 nodes, 2 hidden layers, and 2 outputs.

The code I use is as follows:

```<code>#Split data training & testing (90:10)
Train_X, Test_X, Train_Y, Test_Y = model_selection.train_test_split(dataset['review'],dataset['sentimen'],test_size=0.2, random_state=8)

Encoder = LabelEncoder()

Train_Y = Encoder.fit_transform(Train_Y)
Test_Y = Encoder.fit_transform(Test_Y)

Tfidf_vect = TfidfVectorizer(max_features=None)
Tfidf_vect.fit(dataset['review'])
Train_X_Tfidf = Tfidf_vect.transform(Train_X)
Test_X_Tfidf = Tfidf_vect.transform(Test_X)

#ANN Architecture
model = Sequential()
model.add(Dense(units = 100, activation = 'sigmoid',  input_shape=(32, 900)))
model.add(Dense(units = 100, activation = 'sigmoid'))
model.add(Dense(units = 2, activation = 'sigmoid'))
opt = Adam (learning_rate=0.001)
model.compile(loss = 'binary_crossentropy', optimizer = opt,
              metrics = ['accuracy'])

print(model.summary())

#Hyperparameter
epochs= 100
batch_size= 32
es = EarlyStopping(monitor="val_loss",mode='min',patience=10)
model_prediction = model.fit(Train_X_Tfidf, Train_Y, epochs=epochs,
                             batch_size=batch_size, verbose=1,
                             validation_split=0.1, callbacks =[es])

</code>```

But getting Error:

```<code>/usr/local/lib/python3.8/dist-packages/keras/engine/data_adapter.py in train_validation_split(arrays, validation_split)
   1478   unsplitable = [type(t) for t in flat_arrays if not _can_split(t)]
   1479   if unsplitable:
-> 1480     raise ValueError(
   1481         "`validation_split` is only supported for Tensors or NumPy "
   1482         "arrays, found following types in the input: {}".format(unsplitable))

ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following types in the input: [<class 'scipy.sparse.csr.csr_matrix'>]
</code>```

How to Fix it? Thank you so much.

Body:
I'm newbie in Neural Network. I'm going to do a text classification research using MLP model with keras. Input layer consisting of 900 nodes, 2 hidden layers, and 2 outputs.

The code I use is as follows:

#Split data training & testing (90:10)
Train_X, Test_X, Train_Y, Test_Y = model_selection.train_test_split(dataset['review'],dataset['sentimen'],test_size=0.2, random_state=8)

Encoder = LabelEncoder()

Train_Y = Encoder.fit_transform(Train_Y)
Test_Y = Encoder.fit_transform(Test_Y)

Tfidf_vect = TfidfVectorizer(max_features=None)
Tfidf_vect.fit(dataset['review'])
Train_X_Tfidf = Tfidf_vect.transform(Train_X)
Test_X_Tfidf = Tfidf_vect.transform(Test_X)

#ANN Architecture
model = Sequential()
model.add(Dense(units = 100, activation = 'sigmoid',  input_shape=(32, 900)))
model.add(Dense(units = 100, activation = 'sigmoid'))
model.add(Dense(units = 2, activation = 'sigmoid'))
opt = Adam (learning_rate=0.001)
model.compile(loss = 'binary_crossentropy', optimizer = opt,
              metrics = ['accuracy'])

print(model.summary())

#Hyperparameter
epochs= 100
batch_size= 32
es = EarlyStopping(monitor="val_loss",mode='min',patience=10)
model_prediction = model.fit(Train_X_Tfidf, Train_Y, epochs=epochs,
                             batch_size=batch_size, verbose=1,
                             validation_split=0.1, callbacks =[es])

But getting Error:

/usr/local/lib/python3.8/dist-packages/keras/engine/data_adapter.py in train_validation_split(arrays, validation_split)
   1478   unsplitable = [type(t) for t in flat_arrays if not _can_split(t)]
   1479   if unsplitable:
-> 1480     raise ValueError(
   1481         "`validation_split` is only supported for Tensors or NumPy "
   1482         "arrays, found following types in the input: {}".format(unsplitable))

ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following types in the input: [<class 'scipy.sparse.csr.csr_matrix'>]

How to Fix it? Thank you so much.


问:
Show active speaker in the another div (agora web SDK)
I am using agora web SDK, and I want to show the active speaker in the center of the screen(like the google meet sidebar feature). How can I do that?

I tried to replace the HTML using jQuery to center the div, but it's not rendering the video.


问:
Source code for styled Material UI Autocomplete component showing for a moment before fully loading in browser. I am using Next js
Hello I tried implementing Material UI Autocomplete component to use it as a search input. I used styled function from "@mui/material/styles" and added some custom CSS but when the page first loads you can see the CSS code instead of the actual component for a split second before appearing. Here is a screenshot of the problem:
The source code appears for a split second on the first load of the page before the Autocomplete component appears
Here is the Autocomplete component:

```<code><Autocomplete
        value={undefined || autoValue}
        freeSolo
        id="autocomplete"
        autoHighlight={true}
        autoSelect={true}
        autoComplete={true}
        open={open}
        onClose={() => setOpen(false)}
        onOpen={() => setOpen(true)}
        disableClearable
        // className="w-full"
        fullWidth
        options={items.map((item: string) => ({
          url: item,
          title: makeTitle(item),
        }))}
        getOptionLabel={(option: any) => option.title || ""}
        renderOption={(props, option: Item) => {
          return (
            <li
              key={option.url}
              className=" hover:bg-slate-200 "
              onClick={handleOptionClick}
            >
              <Link
                href={`/calculators/${option.url}`}
                className="block p-4 w-full"
              >
                {makeTitle(option.title)}
              </Link>
            </li>
          );
        }}
        renderInput={(params) => (
          <SearchTextField
            {...params}
            ref={textInput}
            // onChange={(e) => console.log(e.target.value)}
            // value="Hello"
            variant="outlined"
            // onChange={handleChange}
            InputProps={{
              ...params.InputProps,
              type: "search",

              startAdornment: (
                <InputAdornment position="start">
                  <SearchIcon style={{ color: "white" }} />
                </InputAdornment>
              ),
            }}
          />

        )}
      />
</code>```

And here is the CSS:

```<code>const SearchTextField = styled(TextField)({
  "& .MuiInputBase-root": {
    backgroundColor: "rgb(40,80,170)",
    "&:hover": {
      backgroundColor: "rgb(36,69,159)",
    },
    "&.Mui-focused": {
      backgroundColor: "rgb(36,69,159)",
    },
  },
  // "& .MuiAutocomplete-input": {
  //   paddingLeft: "10px !important",
  // },
  "& .MuiInputBase-input": {
    backgroundColor: "white",
    borderRadius: `90px`,
    paddingLeft: "16px !important",
  },
  "& label.Mui-focused": {
    color: "white",
  },
  "& .MuiInput-underline:after": {
    borderBottomColor: "white",
  },
  "& .MuiOutlinedInput-root": {
    borderRadius: `90px`,
    "& fieldset": {
      borderStyle: "none",
      borderRadius: `90px`,
      paddingRight: "10px",
    },
    "&:hover fieldset": {
      borderStyle: "none",
      borderColor: "white",
    },
    "&.Mui-focused fieldset": {
      borderStyle: "none",
      borderColor: "white",
    },
  },
});
</code>```

I've never seen CSS source code rendering on the browser tried looking in Material UI forums but could not find anything. It does not look to happen in mobile browsers only desktop.

Body:
Hello I tried implementing Material UI Autocomplete component to use it as a search input. I used styled function from "@mui/material/styles" and added some custom CSS but when the page first loads you can see the CSS code instead of the actual component for a split second before appearing. Here is a screenshot of the problem:
The source code appears for a split second on the first load of the page before the Autocomplete component appears
Here is the Autocomplete component:

<Autocomplete
        value={undefined || autoValue}
        freeSolo
        id="autocomplete"
        autoHighlight={true}
        autoSelect={true}
        autoComplete={true}
        open={open}
        onClose={() => setOpen(false)}
        onOpen={() => setOpen(true)}
        disableClearable
        // className="w-full"
        fullWidth
        options={items.map((item: string) => ({
          url: item,
          title: makeTitle(item),
        }))}
        getOptionLabel={(option: any) => option.title || ""}
        renderOption={(props, option: Item) => {
          return (

              <Link
                href={`/calculators/${option.url}`}
                className="block p-4 w-full"
              >
                {makeTitle(option.title)}
              </Link>

          );
        }}
        renderInput={(params) => (
          <SearchTextField
            {...params}
            ref={textInput}
            // onChange={(e) => console.log(e.target.value)}
            // value="Hello"
            variant="outlined"
            // onChange={handleChange}
            InputProps={{
              ...params.InputProps,
              type: "search",

              startAdornment: (
                <InputAdornment position="start">
                  <SearchIcon style={{ color: "white" }} />
                </InputAdornment>
              ),
            }}
          />

        )}
      />

And here is the CSS:

const SearchTextField = styled(TextField)({
  "& .MuiInputBase-root": {
    backgroundColor: "rgb(40,80,170)",
    "&:hover": {
      backgroundColor: "rgb(36,69,159)",
    },
    "&.Mui-focused": {
      backgroundColor: "rgb(36,69,159)",
    },
  },
  // "& .MuiAutocomplete-input": {
  //   paddingLeft: "10px !important",
  // },
  "& .MuiInputBase-input": {
    backgroundColor: "white",
    borderRadius: `90px`,
    paddingLeft: "16px !important",
  },
  "& label.Mui-focused": {
    color: "white",
  },
  "& .MuiInput-underline:after": {
    borderBottomColor: "white",
  },
  "& .MuiOutlinedInput-root": {
    borderRadius: `90px`,
    "& fieldset": {
      borderStyle: "none",
      borderRadius: `90px`,
      paddingRight: "10px",
    },
    "&:hover fieldset": {
      borderStyle: "none",
      borderColor: "white",
    },
    "&.Mui-focused fieldset": {
      borderStyle: "none",
      borderColor: "white",
    },
  },
});

I've never seen CSS source code rendering on the browser tried looking in Material UI forums but could not find anything. It does not look to happen in mobile browsers only desktop.


问:
why framer motion exit animation not working when changing URL manually?
I have some routes and I used AnimatePresence component from framer motion to make animation for routes. here is my structure:

in index.js file:

```<code>    <BrowserRouter>
      <App />
   </BrowserRouter>
</code>```

in App component file :

```<code>  <AnimatePresence mode="wait">
  <Routes location={location} key={location.pathname}>
    <Route path="*" element={<NotFound />} />
    <Route path="/" element={<Login />} />
    <Route path="register" element={<Register />} />
  </Routes>
</AnimatePresence>
</code>```

the animation on entering and exiting works fine while I change URL with navigate() from useNavigation hook but when I input URL manually only entering animation works and animation on exit ( when I change URL manually) does not work. I guess it has something with rendering the whole document and backend thing but I don't know how to solve it. currently I am working on localhost

Body:
I have some routes and I used AnimatePresence component from framer motion to make animation for routes. here is my structure:

in index.js file:

    <BrowserRouter>
      <App />
   </BrowserRouter>

in App component file :

  <AnimatePresence mode="wait">
  <Routes location={location} key={location.pathname}>
    <Route path="*" element={<NotFound />} />
    <Route path="/" element={<Login />} />
    <Route path="register" element={<Register />} />
  </Routes>
</AnimatePresence>

the animation on entering and exiting works fine while I change URL with navigate() from useNavigation hook but when I input URL manually only entering animation works and animation on exit ( when I change URL manually) does not work. I guess it has something with rendering the whole document and backend thing but I don't know how to solve it. currently I am working on localhost


问:
while installing dependencies from the repo its giving me error
here are the dependencies required to run this simple repository on my mac book for tiny face detection in python and it's giving me errors while installing the requirements.txt file
here is the error :

```<code>PackagesNotFoundError: The following packages are not available from current channels:
  - torchvision==0.3
  - pyclust==0.2.0
  - prompt-toolkit==1.0.15
  - ipython-genutils==0.2.0
  - torch==1.1.0
  - pyclustering==0.8.1
Current channels:
</code>```

I'm using conda env for this and python 3.7 I'm using for PyTorch
here is the URL of the repo: https://github.com/varunagrawal/tiny-faces-pytorch

i tried to install in a it again and again and follow the steps :
I used the "git clone" command to clone the repository.

I installed the necessary dependencies using the appropriate package manager.

However, I am still encountering the following error

Body:
here are the dependencies required to run this simple repository on my mac book for tiny face detection in python and it's giving me errors while installing the requirements.txt file
here is the error :

PackagesNotFoundError: The following packages are not available from current channels:
  - torchvision==0.3
  - pyclust==0.2.0
  - prompt-toolkit==1.0.15
  - ipython-genutils==0.2.0
  - torch==1.1.0
  - pyclustering==0.8.1
Current channels:

I'm using conda env for this and python 3.7 I'm using for PyTorch
here is the URL of the repo: https://github.com/varunagrawal/tiny-faces-pytorch

i tried to install in a it again and again and follow the steps :
I used the "git clone" command to clone the repository.

I installed the necessary dependencies using the appropriate package manager.

However, I am still encountering the following error


问:
Is it possible to overlap the whole page in svelte using routing?
I am using this as reference for my test front end application.

Is it possible that when I click the other navigation links that the whole page is covered with the component instead of the lower part changing? I have a button that returns to the main page applied on my code so returning isn't an issue.

I have a modal example working but it's not using routes and I want to be able to go directly to the page using the path

example:

```<code>localhost:5173/blog
</code>```

then it will go to the blog page but covering the entire page

Body:
I am using this as reference for my test front end application.

Is it possible that when I click the other navigation links that the whole page is covered with the component instead of the lower part changing? I have a button that returns to the main page applied on my code so returning isn't an issue.

I have a modal example working but it's not using routes and I want to be able to go directly to the page using the path

example:

localhost:5173/blog

then it will go to the blog page but covering the entire page


问:
NoSuchMethodError JedisCommands.del(String s) when upgrade Spring Boot 3.0.1
I'm getting this error after upgrade Spring Boot from 2.7.3 to 3.0.1:
Here the error :

Exception in thread "schedulerFactoryBean_QuartzSchedulerThread" java.lang.NoSuchMethodError: 'java.lang.Long redis.clients.jedis.commands.JedisCommands.del(java.lang.String)' at net.joelinn.quartz.jobstore.AbstractRedisStorage.unlock(AbstractRedisStorage.java:118) at net.joelinn.quartz.jobstore.RedisJobStore.doWithLock(RedisJobStore.java:1169) at net.joelinn.quartz.jobstore.RedisJobStore.acquireNextTriggers(RedisJobStore.java:1043) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:287)

enter image description here

The error come from:
public boolean unlock(T jedis) { String currentLock = jedis.get(this.redisSchema.lockKey()); if (!this.isNullOrEmpty(currentLock) && UUID.fromString(currentLock).equals(this.lockValue)) { jedis.del(this.redisSchema.lockKey()); return true; } else { return false; } }

enter image description here

I can start the project and run it perfectly but anytime I start my project I will see this error.

Redis-client version is 4.3.1

quartz-redis-jobstore version is 1.2.0

I tried to remove the old version and install the latest version of Redis-client and quartz-redis-jobstore but cant not resolve the problem.


问:
How to validate written css code is valid css or not?
I'm working on a project where the user can write custom CSS which will be applied to his website.
My concern is how can I validate that CSS code, whether it is right or not?
I want to implement a CSS editor like WordPress custom CSS editor.
Any leads will be appreciated.</p>


问:
VSCode Inline completion won't show up if there are some trailing text in the line?
This one works. Example from vscode-extension-samples.

But won't show up if there are some trailing text in the line.

How to make it display in spite of trailing text? Is there something I'm missing?


问:
Is there a way to extract data from web engage?
We are working with webengage and defined some events and funnels. to analyze this data we have to manual go to each event and export some data.

Is there a way to get all webengage data in a way so we can automatically analyze it?


问:
Is there a way to pass an object as a lambda function so the dependent class accesses through this function?
I have a manager class which initializes child classes with some dependencies. The problem with the dependencies is that in some instances a new object for them is created. This particular part is out of my control and cannot be updated to reuse the same reference.

My manager class receives an event which contains the new object and I update my manager to use that. The same dependency is used in the child classes as well and now I have to update them there as well. I want to check if there's a way through which I can write a lambda function in my manager class and pass that function to the child classes such that the reference to the object in child classes is always the latest one? Something that can prevent the hassle of maintaining/updating references in all the classes.

I tried adding a lambda function and passing it to the child classes but it's not allowing me to call the functions of the value returned by the lambda function. Error: Property '....' does not exist on type '() =>....' and Property '....' does not exist on type '(this: Function, thisArg: any, ...argArray: any[]) => any'

Following is the code for the lambda that I wrote:

```<code>private dep1 = (): Dep1 => {
    return this._dep1Object;
  };
</code>```

I'm passing dep1 directly to the child classes and tried using it like this:

```<code>dep1.METHOD_REFERENCE
dep1.call().METHOD_REFERENCE
</code>```

Body:
I have a manager class which initializes child classes with some dependencies. The problem with the dependencies is that in some instances a new object for them is created. This particular part is out of my control and cannot be updated to reuse the same reference.

My manager class receives an event which contains the new object and I update my manager to use that. The same dependency is used in the child classes as well and now I have to update them there as well. I want to check if there's a way through which I can write a lambda function in my manager class and pass that function to the child classes such that the reference to the object in child classes is always the latest one? Something that can prevent the hassle of maintaining/updating references in all the classes.

I tried adding a lambda function and passing it to the child classes but it's not allowing me to call the functions of the value returned by the lambda function. Error: Property '....' does not exist on type '() =>....' and Property '....' does not exist on type '(this: Function, thisArg: any, ...argArray: any[]) => any'

Following is the code for the lambda that I wrote:

private dep1 = (): Dep1 => {
    return this._dep1Object;
  };

I'm passing dep1 directly to the child classes and tried using it like this:

dep1.METHOD_REFERENCE
dep1.call().METHOD_REFERENCE


问:
How Can I Decode My Ibeacons manufacturerData React-Native?
We want to get ibeacon's major,minor and uuid datas. How can we get to major,minor,uuid datas? (Btw we already got to "rssi,localname,macadress). We want to develop android project with react native and we use react-native-ble-plx. What can you suggest to us? We are trying to shred the manufacturer data, but we couldn't shred it (base64 format). If you know how to get major minor values can you give us some advice?

Our Manifecturer Data =  "TAACFYV40oX9H097NvIbMpfW8OMAAQA2vQ== "

We want to convert this to meaningful output, we can do it with python, but how can we do it with react-native?

Our Codes:

```<code>import React, {useState} from 'react';
import {
  Button,
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
} from 'react-native';
import {DeviceEventEmitter} from 'react-native';

import {
  Colors,
  DebugInstructions,
  Header,
  LearnMoreLinks,
  ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

import {BleManager} from 'react-native-ble-plx';
import useBLE from './useBLE';
var Buffer = require('buffer/').Buffer;
import base64 from 'react-native-base64';
const Parser = require('binary-parser').Parser;

import Kontakt, {KontaktModule} from 'react-native-kontaktio';
const {
  connect,
  init,
  startDiscovery,
  startRangingBeaconsInRegion,
  startScanning,
} = Kontakt;
import {decode as atob, encode as btoa} from 'base-64';

import RNFetchBlob from 'rn-fetch-blob';
import {stringToBytes} from 'convert-string';

// const kontaktEmitter = new NativeEventEmitter(KontaktModule);

const App = () => {
  const manager = new BleManager();
  const {requestPermissions} = useBLE();

  useState(() => {
    requestPermissions(isGranted => {
      if (!isgranted) {
        alert('android permission granted: ' + isGranted);
      }
    });
  }, []);

  function bleManagerRun() {
    manager.startDeviceScan(null, null, (error, device) => {
      console.log('device id: ', device.id);
      console.log('device name: ', device.localName);
      console.log('device rssi: ', device.rssi);
      // console.log(device.readCharacteristicForService());
      console.log('device manufacturerData: ', device.manufacturerData);
      // console.log("device manufacturerData: ", base64_to_text(device.manufacturerData));

      // const base64 = RNFetchBlob.base64;

      // const advertisingData = stringToBytes(
      //   base64.decode(device.manufacturerData),
      // );
      // console.log(advertisingData);
      // let data = numbers_to_text(advertisingData);
      // console.log(data);

      console.log('--------------------');

      // let data = new Buffer(device.manufacturerData.toString("base64"));
      // console.log(data);
      // let data = device.manufacturerData[0x004C];
      // let beacon = ibeacon_format.parse(data);
      // console.log(beacon);

      // let data = Buffer.from(device.manufacturerData, "base64");
      // console.log(ibeaconFormat.parse(data));

      if (error) {
        console.log(error);
      }
    });
  }

  function numbers_to_text(numbers) {
    let text = '';
    for (let number of numbers) {
      text += String.fromCharCode(number);
    }
    return text;
  }

  function base64_to_text(b64_string) {
    const decoded_bytes = Buffer.from(b64_string, 'base64');
    return decoded_bytes.toString('utf-8');
  }

  async function kontaktRun() {
    // await connect();
    // await startScanning();

    5;

    DeviceEventEmitter.addListener('beaconDiscovered', ({beacon, region}) => {
      console.log(beacon);
    });
  }

  // const ibeacon_format = Struct(
  //   "uuid" / Array(16, Byte),
  //   "major" / Int16ub,
  //   "minor" / Int16ub,
  //   "power" / Int8sl,
  // )

  const ibeaconFormat = new Parser().int16('major').int16('minor');

  function ara() {
    // kontaktRun();
    // beaconSetup();
    bleManagerRun();
  }

  function durdur() {
    manager.stopDeviceScan();
  }

  return (
    <View>
      <Text>Hello World</Text>
      <Button title="Deneme" onPress={ara} />
      <Button title="Durdur" onPress={durdur} />
    </View>
  );
};

export default App;
</code>```

Body:
We want to get ibeacon's major,minor and uuid datas. How can we get to major,minor,uuid datas? (Btw we already got to "rssi,localname,macadress). We want to develop android project with react native and we use react-native-ble-plx. What can you suggest to us? We are trying to shred the manufacturer data, but we couldn't shred it (base64 format). If you know how to get major minor values can you give us some advice?

Our Manifecturer Data =  "TAACFYV40oX9H097NvIbMpfW8OMAAQA2vQ== "

We want to convert this to meaningful output, we can do it with python, but how can we do it with react-native?

Our Codes:

import React, {useState} from 'react';
import {
  Button,
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
} from 'react-native';
import {DeviceEventEmitter} from 'react-native';

import {
  Colors,
  DebugInstructions,
  Header,
  LearnMoreLinks,
  ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

import {BleManager} from 'react-native-ble-plx';
import useBLE from './useBLE';
var Buffer = require('buffer/').Buffer;
import base64 from 'react-native-base64';
const Parser = require('binary-parser').Parser;

import Kontakt, {KontaktModule} from 'react-native-kontaktio';
const {
  connect,
  init,
  startDiscovery,
  startRangingBeaconsInRegion,
  startScanning,
} = Kontakt;
import {decode as atob, encode as btoa} from 'base-64';

import RNFetchBlob from 'rn-fetch-blob';
import {stringToBytes} from 'convert-string';

// const kontaktEmitter = new NativeEventEmitter(KontaktModule);

const App = () => {
  const manager = new BleManager();
  const {requestPermissions} = useBLE();

  useState(() => {
    requestPermissions(isGranted => {
      if (!isgranted) {
        alert('android permission granted: ' + isGranted);
      }
    });
  }, []);

  function bleManagerRun() {
    manager.startDeviceScan(null, null, (error, device) => {
      console.log('device id: ', device.id);
      console.log('device name: ', device.localName);
      console.log('device rssi: ', device.rssi);
      // console.log(device.readCharacteristicForService());
      console.log('device manufacturerData: ', device.manufacturerData);
      // console.log("device manufacturerData: ", base64_to_text(device.manufacturerData));

      // const base64 = RNFetchBlob.base64;

      // const advertisingData = stringToBytes(
      //   base64.decode(device.manufacturerData),
      // );
      // console.log(advertisingData);
      // let data = numbers_to_text(advertisingData);
      // console.log(data);

      console.log('--------------------');

      // let data = new Buffer(device.manufacturerData.toString("base64"));
      // console.log(data);
      // let data = device.manufacturerData[0x004C];
      // let beacon = ibeacon_format.parse(data);
      // console.log(beacon);

      // let data = Buffer.from(device.manufacturerData, "base64");
      // console.log(ibeaconFormat.parse(data));

      if (error) {
        console.log(error);
      }
    });
  }

  function numbers_to_text(numbers) {
    let text = '';
    for (let number of numbers) {
      text += String.fromCharCode(number);
    }
    return text;
  }

  function base64_to_text(b64_string) {
    const decoded_bytes = Buffer.from(b64_string, 'base64');
    return decoded_bytes.toString('utf-8');
  }

  async function kontaktRun() {
    // await connect();
    // await startScanning();

    5;

    DeviceEventEmitter.addListener('beaconDiscovered', ({beacon, region}) => {
      console.log(beacon);
    });
  }

  // const ibeacon_format = Struct(
  //   "uuid" / Array(16, Byte),
  //   "major" / Int16ub,
  //   "minor" / Int16ub,
  //   "power" / Int8sl,
  // )

  const ibeaconFormat = new Parser().int16('major').int16('minor');

  function ara() {
    // kontaktRun();
    // beaconSetup();
    bleManagerRun();
  }

  function durdur() {
    manager.stopDeviceScan();
  }

  return (
    <View>
      <Text>Hello World</Text>
      <Button title="Deneme" onPress={ara} />
      <Button title="Durdur" onPress={durdur} />
    </View>
  );
};

export default App;


问:
Parameterize VARIABLE names in python | VARIABLE SHOULD BE PICKED UP DYNAMICALLY DURING RUNTIME
Below is the code snippet where i am trying to parameterize the variable name using PYTHON but unable to do so.

Is it even possible?

```<code>
PROJECT_ID = 'dev' # this will change according to environment(like test,prod)
ENV=PROJECT_ID.upper()

#consider these values needs to be present in the code, ie., we cannot parameterize the VALUES of SA_DEV, SA_TEST, SA_PROD

SA_DEV = f'{PROJECT_ID}.account.com'

SA_TEST = f'{PROJECT_ID}.account.com'

SA_PROD = f'{PROJECT_ID}.account.com'

chain=SA_{ENV} #this value i want to capture as per environment

</code>```

Like for PROJECT_ID='test'
chain should be SA_TEST and similarly for
PROJECT_ID='prod', chain should be SA_PROD

Body:
Below is the code snippet where i am trying to parameterize the variable name using PYTHON but unable to do so.

Is it even possible?

PROJECT_ID = 'dev' # this will change according to environment(like test,prod)
ENV=PROJECT_ID.upper()

#consider these values needs to be present in the code, ie., we cannot parameterize the VALUES of SA_DEV, SA_TEST, SA_PROD

SA_DEV = f'{PROJECT_ID}.account.com'

SA_TEST = f'{PROJECT_ID}.account.com'

SA_PROD = f'{PROJECT_ID}.account.com'

chain=SA_{ENV} #this value i want to capture as per environment

Like for PROJECT_ID='test'
chain should be SA_TEST and similarly for
PROJECT_ID='prod', chain should be SA_PROD


问:
How to transform React material ui makestyles to emotion
I want to make a resizable drawer and I found this code:
https://codesandbox.io/s/34ife?file=/src/CustomDrawer.js:0-2307

I know current Material UI 5 no longer supports makestyles and I want to convert this code to use material UI 5 emotion style.

I have looked up some articles but still feel so complicated for conversion.

Can anyone provide some examples of how to convert this resizable drawer code to material UI 5 style?
Thank you.


问:
MaxDistance function for Postgis?
Does Postgis have a Max Distance function for two geographies? It has ST_MaxDistance defined on two geometries:

ST_MaxDistance — Returns the 2D largest distance between two geometries in projected units.

But I'm not able to find a similar function that does the same for two geographies. Does it have that kind of function? As a reference, here would be an example: https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_maxdistance. I am not looking to cast the geographies to geometries.

Title: MaxDistance function for Postgis?


问:
Draggable Element Event Listeners (JS / React)
For example, if i have a draggable list of divs and I wanna manipulate classes on dragStart, dragEnd, dragOver etc. how should my event listeners look like and how and where do I remove them.

this is the div element:

```<code><StyledDragableContainer
              id="draggable"
              draggable
              onDragStart={(e) => dragItem.current = index}
              onDragEnter={(e) => dragOverItem.current = index}
              onDragEnd={handleSort}
 >
     <h3>label</h3>
     <input type="checkbox/>
</code>```

and these are event listeners I have so far:

```<code>window.onload = function (){

    const source = document.getElementById("draggable");

    let target

    source.addEventListener("dragover", (event) => {
      target = event.target;
      target.classList.add("dragging");
    });

    source.addEventListener("dragend", (event) => {
      target = event.target;
      if(target.classList.contains("dragging")) target.classList.remove("dragging");
    });
  }
</code>```

Never manipulated with event listeners and wanted to give it a shot. It adds the classname but it doesn't work properly as intended, so if anyone can take a look and guide me on how to manipulate classes via event listeners on draggable div I would really appreciate it.

I was thinking of opacity 0.5 when dragging, i achieved this with active classname on the div, now I 'd like background colour change on dragOver / dragEnter just see it in work and remove classnames on dragEnd and also remove event listeners as intended.


问:
Is the output content of the debug filter related to the output time
if debug output in same time, debug filter can't filter anything. why and how to fix this.
thanks for your help
like this

not same time, it's ok


问:
the code below has failed to update db. thought it echos success
```<code>if (isset($_GET['edit'])) {
    global $conn;

    $stmt = mysqli_prepare($conn, "UPDATE orders SET customerTelephone='delivered' WHERE orderId=? ");

    if (!$stmt){
        echo "Error preparing statement: " . mysqli_error($conn);
        exit;
    }

    if (!mysqli_stmt_bind_param($stmt, "i", $_POST['edit'])){
        echo "Error binding parameters: " . mysqli_stmt_error($stmt);
        exit;
    }

    if (!mysqli_stmt_execute($stmt)){
        echo "Error executing statement: " . mysqli_stmt_error($stmt);
        exit;
    } else {
        echo "Success! Order has been updated.";
    }

} else {
    echo "edit not set";
}
</code>```

I have tried to check the query but found no issues, i need extra set of eyes on it. Help correct this code

Body:
if (isset($_GET['edit'])) {
    global $conn;

    $stmt = mysqli_prepare($conn, "UPDATE orders SET customerTelephone='delivered' WHERE orderId=? ");

    if (!$stmt){
        echo "Error preparing statement: " . mysqli_error($conn);
        exit;
    }

    if (!mysqli_stmt_bind_param($stmt, "i", $_POST['edit'])){
        echo "Error binding parameters: " . mysqli_stmt_error($stmt);
        exit;
    }

    if (!mysqli_stmt_execute($stmt)){
        echo "Error executing statement: " . mysqli_stmt_error($stmt);
        exit;
    } else {
        echo "Success! Order has been updated.";
    }

} else {
    echo "edit not set";
}

I have tried to check the query but found no issues, i need extra set of eyes on it. Help correct this code


问:
AWS API RunInstance is not using the ssh key-pair specified
I've found a very strange issue with AWS API, and this is not happening all the time.
Let me explain what I'm trying to achieve.

I've created a deployment procedure with node.js

The deployment procedure is used even by the application to deploy other instances from the script. So, the application once deployed to AWS, can deploy other instances in AWS by itself.

All communication is done through SSH and AWS API is used to create policies, key pairs, etc.

The private key of SSH used to connect to the Primary Server (master) stays on my PC. Let's say this key pair is "KEY-M". The private keys for the rest client instances (that are automatically deployed by the primary) stay on the primary server. Let's say this key pair is "KEY-C". So, two ssh key pairs are created by the application.

After deploying, The key pairs are correctly set and attached as shown in the AWS instances list:

That Is,

```<code>MASTER => KEY-M
CLIENT => KEY-C
</code>```

But when I looked into the authorized_keys by connecting through the AWS interface, both the master and the client have the same content, i.e. public key of "KEY-M"

Below is the code to understand the run-instance method call for deployment:

const deploy_key = await aws.createDeployKeyIfNotExists(region);

...
...

const run_config = {
    ImageId: image.ami_id,
    InstanceType: this.options.type || 't2.micro',
    MinCount: Math.max(this.options.number || 1, 1),
    MaxCount: Math.max(this.options.number || 1, 1),
    KeyName: deploy_key.name,
    AssociatePublicIpAddress: true,
    SecurityGroups: [security_group.GroupName],
};

const instances = (await aws.ec2(region).runInstances(run_config)).Instances;

```

Attached Keys

Key Pairs

Body:
I've found a very strange issue with AWS API, and this is not happening all the time.
Let me explain what I'm trying to achieve.

I've created a deployment procedure with node.js

The deployment procedure is used even by the application to deploy other instances from the script. So, the application once deployed to AWS, can deploy other instances in AWS by itself.

All communication is done through SSH and AWS API is used to create policies, key pairs, etc.

The private key of SSH used to connect to the Primary Server (master) stays on my PC. Let's say this key pair is "KEY-M". The private keys for the rest client instances (that are automatically deployed by the primary) stay on the primary server. Let's say this key pair is "KEY-C". So, two ssh key pairs are created by the application.

After deploying, The key pairs are correctly set and attached as shown in the AWS instances list:

That Is,

MASTER => KEY-M
CLIENT => KEY-C

But when I looked into the authorized_keys by connecting through the AWS interface, both the master and the client have the same content, i.e. public key of "KEY-M"

Below is the code to understand the run-instance method call for deployment:

const deploy_key = await aws.createDeployKeyIfNotExists(region);

...
...

const run_config = {
    ImageId: image.ami_id,
    InstanceType: this.options.type || 't2.micro',
    MinCount: Math.max(this.options.number || 1, 1),
    MaxCount: Math.max(this.options.number || 1, 1),
    KeyName: deploy_key.name,
    AssociatePublicIpAddress: true,
    SecurityGroups: [security_group.GroupName],
};

const instances = (await aws.ec2(region).runInstances(run_config)).Instances;

Attached Keys

Key Pairs


问:
Send dynamic zip files using nodemailer
I have a group of attachments which are to be zipped by js and the zip file should be sent to the user as an attachment.

I am trying to zip the file using archiver.

If I add this zip files to the array of attachments in node mailer the file is corrupted since path is required for node mailer.

Any other way to dynamically create zip files without saving a copy on local or on server which can be reused to send to the client

```<code>var zip = Archiver('zip');
  zip.append(file_to_be_zipped, { name: 'file2.txt' })
.finalize();

from: configuration.data.from,
to: req.body.to.join(';'),
cc: req.body.cc && req.body.cc.join(';'),
bcc: req.body.bcc && req.body.bcc.join(';'),
subject: subject,
html: body,
attachments: zip
</code>```

Title: Send dynamic zip files using nodemailer

Body:
I have a group of attachments which are to be zipped by js and the zip file should be sent to the user as an attachment.

I am trying to zip the file using archiver.

If I add this zip files to the array of attachments in node mailer the file is corrupted since path is required for node mailer.

Any other way to dynamically create zip files without saving a copy on local or on server which can be reused to send to the client

var zip = Archiver('zip');
  zip.append(file_to_be_zipped, { name: 'file2.txt' })
.finalize();

from: configuration.data.from,
to: req.body.to.join(';'),
cc: req.body.cc && req.body.cc.join(';'),
bcc: req.body.bcc && req.body.bcc.join(';'),
subject: subject,
html: body,
attachments: zip


问:
Couldn't send 'multipart/form-data;boundary=' request through Postman
I am trying to publish a workbook through rest api to the tableau server.
This is the below curl request which I am importing in the postman:

```<code>curl "https://MY_SERVER/api/3.4/sites/site-id/workbooks" -X POST -H "X-Tableau-Auth:credentials token" -H "Content-Type: multipart/mixed;" -F "request_payload=@publish-workbook.xml" -F "tableau_workbook=@MY_WORKBOOK.twbx"
</code>```

But it is throwing this below error:

```<code><?xml version='1.0' encoding='UTF-8'?>
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api https://help.tableau.com/samples/en-us/rest_api/ts-api_3_18.xsd">
    <error code="406000">
        <summary>Bad Request</summary>
        <detail>Content type 'multipart/form-data;boundary=--------------------------313748027746018569295475' not supported</detail>
    </error>
</tsResponse>
</code>```

Also we are trying to publish datasource using postman. But same type of error is coming. Kindly help regarding this issue.

I am trying to hit this below curl from postman:

```<code>curl "https://MY_SERVER/api/3.4/sites/site-id/workbooks" -X POST -H "X-Tableau-Auth:credentials token" -H "Content-Type: multipart/mixed;" -F "request_payload=@publish-workbook.xml" -F "tableau_workbook=@MY_WORKBOOK.twbx"
</code>```

I am expecting to publish the workbook in tableau server.

References:
https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#publish_data_source

https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_publish.htm

Body:
I am trying to publish a workbook through rest api to the tableau server.
This is the below curl request which I am importing in the postman:

curl "https://MY_SERVER/api/3.4/sites/site-id/workbooks" -X POST -H "X-Tableau-Auth:credentials token" -H "Content-Type: multipart/mixed;" -F "request_payload=@publish-workbook.xml" -F "tableau_workbook=@MY_WORKBOOK.twbx"

But it is throwing this below error:

<?xml version='1.0' encoding='UTF-8'?>
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api https://help.tableau.com/samples/en-us/rest_api/ts-api_3_18.xsd">
    <error code="406000">
        Bad Request
        <detail>Content type 'multipart/form-data;boundary=--------------------------313748027746018569295475' not supported</detail>
    </error>
</tsResponse>

Also we are trying to publish datasource using postman. But same type of error is coming. Kindly help regarding this issue.

I am trying to hit this below curl from postman:

curl "https://MY_SERVER/api/3.4/sites/site-id/workbooks" -X POST -H "X-Tableau-Auth:credentials token" -H "Content-Type: multipart/mixed;" -F "request_payload=@publish-workbook.xml" -F "tableau_workbook=@MY_WORKBOOK.twbx"

I am expecting to publish the workbook in tableau server.

References:
https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#publish_data_source

https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_publish.htm


问:
ntdll!RtlWaitOnAddress exception when gdb starts
When gdb starts in windows 10, error message is received.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffe7c493466 in ntdll!RtlWaitOnAddress () from C:\windows\SYSTEM32\ntdll.dll

enter image description here

Does anyone know how to fix it?


问:
How to read PDF/DOCX page by page using tika library in python?
```<code>`# #!/usr/bin/env python
import tika
tika.initVM()
from tika import parser

parsed = parser.from_file('frank_diary.docx')
print(parsed["metadata"])
print(parsed["content"])`
</code>```

From this code i am able to read whole file but not page by page.

Ref. I go through this reference but it's not working.
Is there any way to read PDF/DOCX using tike page by page?

I expect to read PDF/DOCX using tika page by page.

Example:
Dict = [{"page_number" : 1, "content":"content"},{"page_number" : 2, "content":"content"},{"page_number" : 3, "content":"content"}]

Body:
`# #!/usr/bin/env python
import tika
tika.initVM()
from tika import parser

parsed = parser.from_file('frank_diary.docx')
print(parsed["metadata"])
print(parsed["content"])`

From this code i am able to read whole file but not page by page.

Ref. I go through this reference but it's not working.
Is there any way to read PDF/DOCX using tike page by page?

I expect to read PDF/DOCX using tika page by page.

Example:
Dict = [{"page_number" : 1, "content":"content"},{"page_number" : 2, "content":"content"},{"page_number" : 3, "content":"content"}]


问:
How to use AWS Secret Manager with Node Docker container running on Elastic Beanstalk
We have a Node application which is running as a Docker container in AWS Elastic Beanstalk. The application has access to PostgreSQL RDS. We want to use AWS Secrets Manager, so that our Container can access RDS without the credentials being exposed in code.
Once we create the Secrets in AWS Secrets Manager a code is generated which may be in java/javascript etc. So do we add that code in our source code and attach policy of Secret Manager to both aws-elasticbeanstalk-ec2-role and aws-elasticbeanstalk-service-role?
Please advise how this can be done.

We have created the Secrets in Secret Manager. We have not proceeded further as the application is up and running, making any changes may affect it.

As this is our first time, we need help.


问:
Twitterscrapper error solution is throwing a different error
if i use twitterscraper-1.6.1

```<code>list_of_tweets = query_tweets('ukraine', limit=10, begindate=dt.date.today(), enddate=dt.date.today(), poolsize=20, lang='en')
</code>```

i get AttributeError: 'NoneType' object has no attribute 'find_all'

if i use twitterscraper-0.2.7 as suggested at Import of twitterscraper returns 'NonType' error
i get unexpected keyword 'begindate'

I am trying to pull tweets using https://github.com/taspinar/twitterscraper and following along with the examples.

Body:
if i use twitterscraper-1.6.1

list_of_tweets = query_tweets('ukraine', limit=10, begindate=dt.date.today(), enddate=dt.date.today(), poolsize=20, lang='en')

i get AttributeError: 'NoneType' object has no attribute 'find_all'

if i use twitterscraper-0.2.7 as suggested at Import of twitterscraper returns 'NonType' error
i get unexpected keyword 'begindate'

I am trying to pull tweets using https://github.com/taspinar/twitterscraper and following along with the examples.


问:
Untar Files present on google cloud storage using cloud composer
I have scenario where I have to untar landed files on google cloud storage and and place them in some other folder on bucket to process and and after untaring, I have to remove some xml header's from the extracted xml file , we are have to use cloud composer to do all these tasks, in current on-premise the is all handled using bash scripts.

I have tried to use a python function which will be invoked using PythonOperator to untar and place the files in output location and I am thinking of using bashoperator to run sed and grep commands to remove the headers in the extracted file.
The below code seems to not produce any output

```<code>import io
import os
import tarfile

from google.cloud import storage

client = storage.Client("project_id")
input_bucket = client.get_bucket('bucket_name')
output_bucket = client.get_bucket('bucket_name')

def untar(context):
    # Get the contents of the uploaded file
    file_name="testzip.tar.gz"
    print("Starting_untar")
    input_blob = input_bucket.get_blob(f'/LnS_landing/{file_name}').download_as_string()
    print("file_name:",input_blob.name)
    tar = tarfile.open(fileobj=io.BytesIO(input_blob))
    for member in tar.getnames():
        file_object = tar.extractfile(member)
        # print(file_object)
        if file_object:
            output_blob = output_bucket.blob(os.path.join(f'/LnS_landing/{file_name}', member))
            output_blob.upload_from_string(file_object.read())
</code>```

Body:
I have scenario where I have to untar landed files on google cloud storage and and place them in some other folder on bucket to process and and after untaring, I have to remove some xml header's from the extracted xml file , we are have to use cloud composer to do all these tasks, in current on-premise the is all handled using bash scripts.

I have tried to use a python function which will be invoked using PythonOperator to untar and place the files in output location and I am thinking of using bashoperator to run sed and grep commands to remove the headers in the extracted file.
The below code seems to not produce any output

import io
import os
import tarfile

from google.cloud import storage

client = storage.Client("project_id")
input_bucket = client.get_bucket('bucket_name')
output_bucket = client.get_bucket('bucket_name')

def untar(context):
    # Get the contents of the uploaded file
    file_name="testzip.tar.gz"
    print("Starting_untar")
    input_blob = input_bucket.get_blob(f'/LnS_landing/{file_name}').download_as_string()
    print("file_name:",input_blob.name)
    tar = tarfile.open(fileobj=io.BytesIO(input_blob))
    for member in tar.getnames():
        file_object = tar.extractfile(member)
        # print(file_object)
        if file_object:
            output_blob = output_bucket.blob(os.path.join(f'/LnS_landing/{file_name}', member))
            output_blob.upload_from_string(file_object.read())


问:
Discrepancy for new users Play Console vs Firebase vs AppsFlyer
I am getting a huge percentage of discrepancy for new user's installation on Play Console vs Firebase vs AppsFlyer for my app.

For example, as on 2nd Jan 2023

Play Console Installed: 847
Firebase Installed: 2344
AppsFlyer Installed: 1173
Database: 627

Please help me to understand which statistics are accurate and how Play Console, FireBase, and AppsFlyer work for this particular case.


问:
Angular Upgrade Throws Reference Error: Cannot Access zl before initialization
I am trying to upgrade from 10.2 to 12. Migration ran successfully. After migrating i am getting the cannot access error.

Everytime the error keeps on changes from zl of undefined, kr of undefined. This error is throwing from the main.js bundle. Unable to figure out the cause. Tried fixing the circular dependency, but still error persists.


问:
how to get the scraped values on a website that has fingerprintjs?
I am trying to scrape this site using google colab.
https://www.blibli.com/p/facial-tissue-tisu-wajah-250-s-paseo/is--LO1-70001-00049-00001?seller_id=LO1-70001&sku_id=LO1-70001-00049-00001&sclid=7zuGEaS4hh5SowAA6tnfd5i2wKjR6e3p&sid=c5746ccfbb298d3b&pid=LO1-70001-00049-00001

The idea here is to get the fingerprint to be used and parsed in the requests.

currently my code is

```<code>from seleniumwire import webdriver
options = webdriver.ChromeOptions()

options.set_capability(
                        "goog:loggingPrefs", {"performance": "ALL", "browser": "ALL"}
                    )
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# open it, go to a website, and get results
driver = webdriver.Chrome('chromedriver',options=options)

dataranch=[1]
dataulrs=['https://www.blibli.com/p/facial-tissue-tisu-wajah-250-s-paseo/is--LO1-70001-00049-00001?seller_id=LO1-70001&sku_id=LO1-70001-00049-00001&sclid=7zuGEaS4hh5SowAA6tnfd5i2wKjR6e3p&sid=c5746ccfbb298d3b&pid=LO1-70001-00049-00001']
for prod_id,urls in zip(dataranch,dataulrs):
  try:

    driver.get(urls)
    sleep(randint(3,5))

    product_name=driver.find_element(By.CSS_SELECTOR, ".product-name").text

    try:
      normal_price=driver.find_element(By.CSS_SELECTOR, ".product-price__before").text
    except:
      normal_price="0"
    normal_price=normal_price.replace('Rp',"").replace(".","")
    try:
      discount=driver.find_element(By.CSS_SELECTOR, ".product-price__discount").text
    except:
      discount="0"
    compid=urls.split(".")[4].split("?")[0]
    dat={
      'product_name':product_name,
      'normal_price':normal_price,
      'discount':discount,
      'competitor_id':compid,
      'url':urls,
      'prod_id':prod_id,
      'date_key':today,
      'web':'ranch market'
      }
    dat=pd.DataFrame([dat])
  except Exception as e:
    print(f"{urls} error")
    print(e)
</code>```

What am I doing wrong here? Can someone help? Because I tried inspecting the elements and the css . is there. Is there a way to scrape the data needed? Do I need to use a different module just selenium to get the data?

Body:
I am trying to scrape this site using google colab.
https://www.blibli.com/p/facial-tissue-tisu-wajah-250-s-paseo/is--LO1-70001-00049-00001?seller_id=LO1-70001&sku_id=LO1-70001-00049-00001&sclid=7zuGEaS4hh5SowAA6tnfd5i2wKjR6e3p&sid=c5746ccfbb298d3b&pid=LO1-70001-00049-00001

The idea here is to get the fingerprint to be used and parsed in the requests.

currently my code is

from seleniumwire import webdriver
options = webdriver.ChromeOptions()

options.set_capability(
                        "goog:loggingPrefs", {"performance": "ALL", "browser": "ALL"}
                    )
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# open it, go to a website, and get results
driver = webdriver.Chrome('chromedriver',options=options)

dataranch=[1]
dataulrs=['https://www.blibli.com/p/facial-tissue-tisu-wajah-250-s-paseo/is--LO1-70001-00049-00001?seller_id=LO1-70001&sku_id=LO1-70001-00049-00001&sclid=7zuGEaS4hh5SowAA6tnfd5i2wKjR6e3p&sid=c5746ccfbb298d3b&pid=LO1-70001-00049-00001']
for prod_id,urls in zip(dataranch,dataulrs):
  try:

    driver.get(urls)
    sleep(randint(3,5))

    product_name=driver.find_element(By.CSS_SELECTOR, ".product-name").text

    try:
      normal_price=driver.find_element(By.CSS_SELECTOR, ".product-price__before").text
    except:
      normal_price="0"
    normal_price=normal_price.replace('Rp',"").replace(".","")
    try:
      discount=driver.find_element(By.CSS_SELECTOR, ".product-price__discount").text
    except:
      discount="0"
    compid=urls.split(".")[4].split("?")[0]
    dat={
      'product_name':product_name,
      'normal_price':normal_price,
      'discount':discount,
      'competitor_id':compid,
      'url':urls,
      'prod_id':prod_id,
      'date_key':today,
      'web':'ranch market'
      }
    dat=pd.DataFrame([dat])
  except Exception as e:
    print(f"{urls} error")
    print(e)

What am I doing wrong here? Can someone help? Because I tried inspecting the elements and the css . is there. Is there a way to scrape the data needed? Do I need to use a different module just selenium to get the data?


问:
Nested content control and nested images in Power Automate
I would like to create a word document by adding images into nested content controls. So for example I want to create multiple paragraphs, which have different number of images.

When I want to populate the word template, microsoft PAA deletes the outer layer of the repeating content control for plain text, and the option to add images doesn't show up at all. PAA says there ist no option for putting images into repeating sections with the Word connector.

Does anyone know how to work around this?

I tried to populate the template with the word connector.
The Plumsail connector is not allowed by the company.
Adobe connector costs money and takes time to create since is a premium connector, so I would onhly use it if nothing else works.