问:
CKEditor Decoupled-Document configuration doesn't display the UI as it should
I've followed the steps in the documentation to implement a custom editor, going for the decoupled document style.
I get a text area and the toolbar, but the page looks nothing at all like the decoupled document should look like. The isn't any document/paper like UI, just the text area and the toolbar.

This is my component:

```<code>import { CKEditor } from "@ckeditor/ckeditor5-react";
import DecoupledEditor from "@ckeditor/ckeditor5-build-decoupled-document";

export const EditorPresentational = () => {
  // let editor = null;
  return (
    <CKEditor
      onReady={(editor) => {
        console.log("Editor is ready to use!", editor);

        // Insert the toolbar before the editable area.
        editor.ui
          .getEditableElement()
          .parentElement.insertBefore(
            editor.ui.view.toolbar.element,
            editor.ui.getEditableElement()
          );

        this.editor = editor;
      }}
      onError={(error, { willEditorRestart }) => {
        // If the editor is restarted, the toolbar element will be created once again.
        // The `onReady` callback will be called again and the new toolbar will be added.
        // This is why you need to remove the older toolbar.
        if (willEditorRestart) {
          this.editor.ui.view.toolbar.element.remove();
        }
      }}
      onChange={(event, editor) => console.log({ event, editor })}
      editor={DecoupledEditor}
      data="<p>Hello from CKEditor 5's decoupled editor!</p>"
      // config={ /* the editor configuration */ }
    />
  );
};
</code>```

Body:
I've followed the steps in the documentation to implement a custom editor, going for the decoupled document style.
I get a text area and the toolbar, but the page looks nothing at all like the decoupled document should look like. The isn't any document/paper like UI, just the text area and the toolbar.

This is my component:

import { CKEditor } from "@ckeditor/ckeditor5-react";
import DecoupledEditor from "@ckeditor/ckeditor5-build-decoupled-document";

export const EditorPresentational = () => {
  // let editor = null;
  return (
    <CKEditor
      onReady={(editor) => {
        console.log("Editor is ready to use!", editor);

        // Insert the toolbar before the editable area.
        editor.ui
          .getEditableElement()
          .parentElement.insertBefore(
            editor.ui.view.toolbar.element,
            editor.ui.getEditableElement()
          );

        this.editor = editor;
      }}
      onError={(error, { willEditorRestart }) => {
        // If the editor is restarted, the toolbar element will be created once again.
        // The `onReady` callback will be called again and the new toolbar will be added.
        // This is why you need to remove the older toolbar.
        if (willEditorRestart) {
          this.editor.ui.view.toolbar.element.remove();
        }
      }}
      onChange={(event, editor) => console.log({ event, editor })}
      editor={DecoupledEditor}
      data="
Hello from CKEditor 5's decoupled editor!
"
      // config={ /* the editor configuration */ }
    />
  );
};


来源: stackexchange

问:
Springboot @Valid throw exception outside of Rest scope
How can I make a method throw a custom exception if @Valid / @Validated fails?

For example:

```<code>public class OAuthCredentialsModel {

    private Long id;

    @NotBlank
    private String clientId;

    @NotBlank
    private String clientSecret;

    @NotBlank
    private String providerURL;

    @NotBlank
    private String authorizationGrantType;

    @NotBlank
    private String scope;

}
</code>```
```<code>public OAuthCredentialsModel create(@Valid OAuthCredentialsModel input)
    throws InvalidParameterException {
    ...
}
</code>```

I want to make the create() method throw a InvalidParameterException if the parameter OAuthCredentialsModel input is invalid. I don't want to get that exception in some Rest Controller, I want to throw that Exception to anything calling this method.

ContentLicense: CC BY-SA 4.0

Body:
How can I make a method throw a custom exception if @Valid / @Validated fails?

For example:

public class OAuthCredentialsModel {

    private Long id;

    @NotBlank
    private String clientId;

    @NotBlank
    private String clientSecret;

    @NotBlank
    private String providerURL;

    @NotBlank
    private String authorizationGrantType;

    @NotBlank
    private String scope;

}

public OAuthCredentialsModel create(@Valid OAuthCredentialsModel input)
    throws InvalidParameterException {
    ...
}

I want to make the create() method throw a InvalidParameterException if the parameter OAuthCredentialsModel input is invalid. I don't want to get that exception in some Rest Controller, I want to throw that Exception to anything calling this method.


问:
IQueryable difference between .NET 6 and 7
TL;DR: Disable Nullable on entities which are not manually configured using IEntityTypeConfiguration when upgrading.

I am currently in the process of upgrading our ASP.Net Core app to .NET 7. In theory this should work flawless since there aren't any changes that could potentially cause issues.

But after some testing I found out that a lot of our database interactions failed with weird behaviour. Right now I have on entity in my database, when running this following code I get two completely different results:

```<code>public static async Task<PaginatedList<T>> CreateAsync(IQueryable<T> source, int pageIndex, int pageSize)
{
    var count = await source.CountAsync();
    var items = await source.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToListAsync();

    return new PaginatedList<T>(items, count, pageIndex, pageSize);
}
</code>```

.NET 6: count = 1 and items.Count = 1

.NET 7: count = 1 and items.Count = 0.

The query used is this:

```<code>var types = Entities.Include(p => p.Template).AsQueryable();
return await types.OrderBy(request.SortBy, request.OrderBy)
     .PaginatedListAsync(request.PageNumber, request.PageSize);
</code>```

The OrderBy method is an extension method which uses LINQ's OrderBy but with a property name as input (view here if relevant). Entities is the DbSet itself.

Can someone explain to me why this does change between .NET versions? I did NOT upgrade EF to version 7 yet. It's still 6.0.12.

I checked the breaking changes and couldn't find anything about changes to queryables or enumerables.

Body:
TL;DR: Disable Nullable on entities which are not manually configured using IEntityTypeConfiguration when upgrading.

I am currently in the process of upgrading our ASP.Net Core app to .NET 7. In theory this should work flawless since there aren't any changes that could potentially cause issues.

But after some testing I found out that a lot of our database interactions failed with weird behaviour. Right now I have on entity in my database, when running this following code I get two completely different results:

public static async Task<PaginatedList<T>> CreateAsync(IQueryable<T> source, int pageIndex, int pageSize)
{
    var count = await source.CountAsync();
    var items = await source.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToListAsync();

    return new PaginatedList<T>(items, count, pageIndex, pageSize);
}

.NET 6: count = 1 and items.Count = 1

.NET 7: count = 1 and items.Count = 0.

The query used is this:

var types = Entities.Include(p => p.Template).AsQueryable();
return await types.OrderBy(request.SortBy, request.OrderBy)
     .PaginatedListAsync(request.PageNumber, request.PageSize);

The OrderBy method is an extension method which uses LINQ's OrderBy but with a property name as input (view here if relevant). Entities is the DbSet itself.

Can someone explain to me why this does change between .NET versions? I did NOT upgrade EF to version 7 yet. It's still 6.0.12.

I checked the breaking changes and couldn't find anything about changes to queryables or enumerables.


问:
Vision range around my position in google maps
I want to create a vision range around my position in google maps. I know I have to write a subclass of MyLocationOverlay, and rotate triangle image in drawCompass method, but does anyone have a example of it, because I cant rotate image in right way. </p>

<p>!e
nter image description here</p>

ContentLicense: CC BY-SA 3.0

Body:
I want to create a vision range around my position in google maps. I know I have to write a subclass of MyLocationOverlay, and rotate triangle image in drawCompass method, but does anyone have a example of it, because I cant rotate image in right way.

!e
nter image description here


问:
Failed initial migration in Entity Framework Core on .NET 6 Isolated
I'm trying to get Entity Framework Core to run the initial migration for my Azure functions app, but I'm getting the following error when running Add-Migration Initial:

Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Migrations.IMigrator'. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions object in its constructor and passes it to the base constructor for DbContext.

I'm overriding OnConfiguring like this:

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        => optionsBuilder.UseCosmos(
                accountEndpoint: "https://<redacted>.documents.azure.com:443/",
                accountKey: <redacted>,
                databaseName: <redacted>);
```
<p>This is my <code>.csproj</code> file:</p>
<pre class="lang-xml prettyprint-override"><code><Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.10.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Cosmos" Version="7.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.1">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.1">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
  </ItemGroup>
</Project>
</code>```

I have tried following multiple guides online but cannot seem to fix this issue and I'm at a loss for what to try, so I think I must be missing something basic.

Body:
I'm trying to get Entity Framework Core to run the initial migration for my Azure functions app, but I'm getting the following error when running Add-Migration Initial:

Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Migrations.IMigrator'. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions object in its constructor and passes it to the base constructor for DbContext.

I'm overriding OnConfiguring like this:

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        => optionsBuilder.UseCosmos(
                accountEndpoint: "https://<redacted>.documents.azure.com:443/",
                accountKey: <redacted>,
                databaseName: <redacted>);

This is my .csproj file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.10.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Cosmos" Version="7.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.1">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.1">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
  </ItemGroup>
</Project>

I have tried following multiple guides online but cannot seem to fix this issue and I'm at a loss for what to try, so I think I must be missing something basic.


问:
Jupyter notebook from other notebook returns error
I have one big notebook that I want to run for different variables, but it is really big without functions and I was thinking to cut the work to make functions by running from another notebook.

So I tried to do something like:

```<code>values = [val1, val2...]
for value in values:
   %run original_notebook.ipynb
</code>```

But I have the following errors:

```<code>     12 for value in values:
---> 13     get_ipython().run_line_magic('run', './original_notebook.ipynb')

File /usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.py:2364, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth)
   2362     kwargs['local_ns'] = self.get_local_scope(stack_depth)
   2363 with self.builtin_trap:
-> 2364     result = fn(*args, **kwargs)
   2365 return result

File /usr/local/lib/python3.8/dist-packages/IPython/core/magics/execution.py:717, in ExecutionMagics.run(self, parameter_s, runner, file_finder)
    715     with preserve_keys(self.shell.user_ns, '__file__'):
    716         self.shell.user_ns['__file__'] = filename
--> 717         self.shell.safe_execfile_ipy(filename, raise_exceptions=True)
    718     return
    720 # Control the response to exit() calls made by the script being run

File /usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.py:2867, in InteractiveShell.safe_execfile_ipy(self, fname, shell_futures, raise_exceptions)
   2865 with prepended_to_syspath(dname):
   2866     try:
-> 2867         for cell in get_cells():
   2868             result = self.run_cell(cell, silent=True, shell_futures=shell_futures)
   2869             if raise_exceptions:

File /usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.py:2856, in InteractiveShell.safe_execfile_ipy.<locals>.get_cells()
   2854 if fname.suffix == ".ipynb":
   2855     from nbformat import read
-> 2856     nb = read(fname, as_version=4)
   2857     if not nb.cells:
   2858         return

File /usr/local/lib/python3.8/dist-packages/nbformat/__init__.py:141, in read(fp, as_version, **kwargs)
    138     with io.open(fp, encoding='utf-8') as f:
    139         return read(f, as_version, **kwargs)
--> 141 return reads(fp.read(), as_version, **kwargs)

AttributeError: 'PosixPath' object has no attribute 'read'
</code>```

if it's relevant in the first cell on the original jupyter I have the following:

```<code># Check the loaded variables
if 'source' in locals():
    print("Run for", source)
else:
    print("Not found source use dummy one: ...")
    source = "value"
</code>```

Body:
I have one big notebook that I want to run for different variables, but it is really big without functions and I was thinking to cut the work to make functions by running from another notebook.

So I tried to do something like:

values = [val1, val2...]
for value in values:
   %run original_notebook.ipynb

But I have the following errors:

     12 for value in values:
---> 13     get_ipython().run_line_magic('run', './original_notebook.ipynb')

File /usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.py:2364, in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth)
   2362     kwargs['local_ns'] = self.get_local_scope(stack_depth)
   2363 with self.builtin_trap:
-> 2364     result = fn(*args, **kwargs)
   2365 return result

File /usr/local/lib/python3.8/dist-packages/IPython/core/magics/execution.py:717, in ExecutionMagics.run(self, parameter_s, runner, file_finder)
    715     with preserve_keys(self.shell.user_ns, '__file__'):
    716         self.shell.user_ns['__file__'] = filename
--> 717         self.shell.safe_execfile_ipy(filename, raise_exceptions=True)
    718     return
    720 # Control the response to exit() calls made by the script being run

File /usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.py:2867, in InteractiveShell.safe_execfile_ipy(self, fname, shell_futures, raise_exceptions)
   2865 with prepended_to_syspath(dname):
   2866     try:
-> 2867         for cell in get_cells():
   2868             result = self.run_cell(cell, silent=True, shell_futures=shell_futures)
   2869             if raise_exceptions:

File /usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.py:2856, in InteractiveShell.safe_execfile_ipy.<locals>.get_cells()
   2854 if fname.suffix == ".ipynb":
   2855     from nbformat import read
-> 2856     nb = read(fname, as_version=4)
   2857     if not nb.cells:
   2858         return

File /usr/local/lib/python3.8/dist-packages/nbformat/__init__.py:141, in read(fp, as_version, **kwargs)
    138     with io.open(fp, encoding='utf-8') as f:
    139         return read(f, as_version, **kwargs)
--> 141 return reads(fp.read(), as_version, **kwargs)

AttributeError: 'PosixPath' object has no attribute 'read'

if it's relevant in the first cell on the original jupyter I have the following:

# Check the loaded variables
if 'source' in locals():
    print("Run for", source)
else:
    print("Not found source use dummy one: ...")
    source = "value"


问:
Selenium Grid: Browser running in headless mode when the nodes are triggered remotely
Java: "1.8.0_181|
Selenium Grid: 4.6

Problem statement: The web browser is running in headless mode in remote machine when the nodes are launched from remote machine.

For example:

Working case:

Machine A: Hub

Machine B: Node (Launched manually in cmdline)

Expected: The browser should launch successfully.

Actual: The browser is launched successfully.

Problem case:

Machine A: Hub

Machine B: Node (Launched remotly from Machine A via powershell scripts)

Expected: The browser should launch successfully.

Actual: The browser is launched in HEADLESS MODE.

Powershell script:-

```<code>workflow RunScripts {
parallel {
InlineScript {
    $User = "foo\boo"
    $PWord = ConvertTo-SecureString -String "koo" -AsPlainText -Force
    $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
    Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
    Invoke-Command -ComputerName "11.111.111.222" -ScriptBlock {cmd /c "\\11.111.111.222\c$\foo\boo\Node.bat"} -Credential $Credential -ErrorAction Stop
   }
}
}
RunScripts
</code>```

Selenium: (Sample Code)

```<code>ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://11.111.111.111:4444/wd/hub"), options);
</code>```

I have no clue why browsers are running in headless mode despite of not asked for. Kindly suggest.

Body:
Java: "1.8.0_181|
Selenium Grid: 4.6

Problem statement: The web browser is running in headless mode in remote machine when the nodes are launched from remote machine.

For example:

Working case:

Machine A: Hub

Machine B: Node (Launched manually in cmdline)

Expected: The browser should launch successfully.

Actual: The browser is launched successfully.

Problem case:

Machine A: Hub

Machine B: Node (Launched remotly from Machine A via powershell scripts)

Expected: The browser should launch successfully.

Actual: The browser is launched in HEADLESS MODE.

Powershell script:-

workflow RunScripts {
parallel {
InlineScript {
    $User = "foo\boo"
    $PWord = ConvertTo-SecureString -String "koo" -AsPlainText -Force
    $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
    Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
    Invoke-Command -ComputerName "11.111.111.222" -ScriptBlock {cmd /c "\\11.111.111.222\c$\foo\boo\Node.bat"} -Credential $Credential -ErrorAction Stop
   }
}
}
RunScripts

Selenium: (Sample Code)

ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://11.111.111.111:4444/wd/hub"), options);

I have no clue why browsers are running in headless mode despite of not asked for. Kindly suggest.


问:
Object 'default' not found
I'm trying to connect with solr but I get this error

Object 'default' not found

I'm trying to connect with solr but I get this error

Object 'default' not found

Title: Object 'default' not found


问:
How to start Github Action (self-runner) on own machine with Ubuntu and Docker?
I successfully downloaded and started GitHub runner on my own Ubuntu machine. GitLab have a nice runner installer, but GitHub have only package with files and run.sh file.

When I will start the run.sh, it works and GitHub runner starts for listening of actions.

But I couldn't find it anywhere in the documentation, how to correctly integrate the package with sh file into Ubuntu to start sh automatically after Ubuntu starts.

Also I didn't find, if there is needed to do some steps to make runner secure from the internet.

...and also I don't know, where I can setup to be able to run parallel actions, and also where I can setup the limitations of resources, etc...

Thanks a lot for an each help.


问:
Problem with load balancing web app (CyberArk's pvwas) with HAProxy over ssl
I have some difficulties with setting up a load balancer for a web app (CyberArk's pvwas, but i'm not sure it matters). Here is my certificate and page.cfg config file info:

`Subject:

CN=my.machine.name.in.DNS.A.record

Subject Alternative Name:

DNS name=page1.I.want.to.lb

DNS name=page2.I.want.to.lb
`

`global

log 127.0.0.1 local0

resolvers dns

nameserver localdns x.x.x.x:53

hold valid 2s

frontend web_lb

bind my.machine.name.in.DNS.A.record.domain.name:443 ssl cert /path/to/my/cert.pem

timeout client 1h

default_backend web

backend web

balance leastconn

mode http

timeout server 1h

timeout connect 4s

server web1 page1.I.want.to.lb.domain.name:443 check resolvers dns

server web2 page1.I.want.to.lb.domain.name:443 check resolvers dns`

I am sure my dns settings are fine, I just can't figure out whether problem is in my certificate or on the webpage site (i can go there straight through page1.I.want.to.lb and page2.I.want.to.lb). Haproxy service restarts fine and haproxy -f /path... -c says config file is valid. My haproxy version is 2.4.17 and I'm using CentOS 9.

I was already load balancing some apps using tcp mode and i am sure dns settings work. I also disabled requiring ssl on one server (hosting page1.I.want.to.lb), but still couldn't load page via LB dns's name


问:
error: [Dagger/MissingBinding] core.domain.usecase.NotePreferencesUseCase cannot be provided without an @Provides-annotated method
I am trying to create sharedpreferences using Hilt. Already take a look for some search but I get this error.
error: [Dagger/MissingBinding] core.domain.usecase.NotePreferencesUseCase cannot be provided without an @Provides-annotated method.

Here's my code

NotePreferenceRepository

```<code>@Singleton
class NotePreferencesRepository @Inject constructor(
    private val sharedPreferences: SharedPreferences
): INotePreferencesRepository {

    private val edit = sharedPreferences.edit()

    override fun setTheme(theme: String) {
        edit.putString(THEME, theme)
    }

    override fun getTheme(): String? {
        return sharedPreferences.getString(THEME, "")
    }

    companion object {
        private val THEME = "theme"
    }
}
</code>```

NotePreferencesModule

```<code>@Module
@InstallIn(SingletonComponent::class)
object NotePreferencesModule {

    @Provides
    @Singleton
    fun provideNotePreferences(@ApplicationContext context: Context): SharedPreferences {
        return context.getSharedPreferences("note_prefs", Context.MODE_PRIVATE)
    }
}
</code>```

Repository Module

```<code>@Module
@InstallIn(SingletonComponent::class)
abstract class RepositoryModule {

    @Binds
    abstract fun providePreferencesRepository(notePreferencesRepository: NotePreferencesRepository): INotePreferencesRepository
}
</code>```

INotePreferencesRepository

```<code>interface INotePreferencesRepository {

    fun setTheme(theme: String)

    fun getTheme(): String?
}
</code>```

NotePreferencesInteractor

```<code>class NotePreferencesInteractor @Inject constructor(private val notePreferencesRepository: INotePreferencesRepository): NotePreferencesUseCase {

    override fun setTheme(theme: String) {
        notePreferencesRepository.setTheme(theme)
    }

    override fun getTheme(): String? = notePreferencesRepository.getTheme()
}
</code>```

NotePreferencesUseCase

```<code>interface NotePreferencesUseCase {

    fun setTheme(theme: String)

    fun getTheme(): String?
}
</code>```

SettingViewModel

```<code>@HiltViewModel
class SettingViewModel @Inject constructor(private val notePreferencesUseCase: NotePreferencesUseCase): ViewModel() {

    fun getTheme() = notePreferencesUseCase.getTheme()

    fun setTheme(theme: String) {
        notePreferencesUseCase.setTheme(theme)
    }
}
</code>```

SOLVED
forgor to add AppModule

```<code>@Module
@InstallIn(ViewModelComponent::class)
abstract class AppModule {

    @Binds
    @ViewModelScoped
    abstract fun provideNotePreferencesUseCase(notePreferencesInteractor: NotePreferencesInteractor): NotePreferencesUseCase
}
</code>```

So view model can use usecase

Body:
I am trying to create sharedpreferences using Hilt. Already take a look for some search but I get this error.
error: [Dagger/MissingBinding] core.domain.usecase.NotePreferencesUseCase cannot be provided without an @Provides-annotated method.

Here's my code

NotePreferenceRepository

@Singleton
class NotePreferencesRepository @Inject constructor(
    private val sharedPreferences: SharedPreferences
): INotePreferencesRepository {

    private val edit = sharedPreferences.edit()

    override fun setTheme(theme: String) {
        edit.putString(THEME, theme)
    }

    override fun getTheme(): String? {
        return sharedPreferences.getString(THEME, "")
    }

    companion object {
        private val THEME = "theme"
    }
}

NotePreferencesModule

@Module
@InstallIn(SingletonComponent::class)
object NotePreferencesModule {

    @Provides
    @Singleton
    fun provideNotePreferences(@ApplicationContext context: Context): SharedPreferences {
        return context.getSharedPreferences("note_prefs", Context.MODE_PRIVATE)
    }
}

Repository Module

@Module
@InstallIn(SingletonComponent::class)
abstract class RepositoryModule {

    @Binds
    abstract fun providePreferencesRepository(notePreferencesRepository: NotePreferencesRepository): INotePreferencesRepository
}

INotePreferencesRepository

interface INotePreferencesRepository {

    fun setTheme(theme: String)

    fun getTheme(): String?
}

NotePreferencesInteractor

class NotePreferencesInteractor @Inject constructor(private val notePreferencesRepository: INotePreferencesRepository): NotePreferencesUseCase {

    override fun setTheme(theme: String) {
        notePreferencesRepository.setTheme(theme)
    }

    override fun getTheme(): String? = notePreferencesRepository.getTheme()
}

NotePreferencesUseCase

interface NotePreferencesUseCase {

    fun setTheme(theme: String)

    fun getTheme(): String?
}

SettingViewModel

@HiltViewModel
class SettingViewModel @Inject constructor(private val notePreferencesUseCase: NotePreferencesUseCase): ViewModel() {

    fun getTheme() = notePreferencesUseCase.getTheme()

    fun setTheme(theme: String) {
        notePreferencesUseCase.setTheme(theme)
    }
}

SOLVED
forgor to add AppModule

@Module
@InstallIn(ViewModelComponent::class)
abstract class AppModule {

    @Binds
    @ViewModelScoped
    abstract fun provideNotePreferencesUseCase(notePreferencesInteractor: NotePreferencesInteractor): NotePreferencesUseCase
}

So view model can use usecase


问:
Next.js on Cloud Run - how to get environment variable
How to get access to env vars in Next.js running on Cloud Run. I explicitly need to set variables through Clour Run config (as our team is using it for other services), but  Next.js does not seem to pick those up in runtime.

I saw this answer How to Access ENV Variables in Google Cloud Run using Next.js but it seem to be focusing more on getting variables into the browser.


问:
Check table for empty cells or cells with zero
I have project with gui - table, few input fields, output field and buttons. I created a simple code to check if numbers in input fields are positive, and if they are not - stop further calculation and print out error message in output field. How to check table cells for negative numbers or empty?
my logic - Data inputed in fields and table, button pressed and if one of input fields or one of table cells have negative\zero\empty data code stops and in output field post error text.
Lot_Mean_r, Lot_SD_r, SSB_DF_r, SSW_DF_r, SST_DF_r are input fields qdoubleSpinBox

```<code>if self.Lot_Mean_r<=0 or self.Lot_SD_r<=0 or self.SSB_DF_r<=0 or self.SSW_DF_r<=0 or self.SST_DF_r<=0 or float(item.text())<=0 or item==None:
            if self.Lot_Mean_r<=0:
                self.ui.textEdit_status_N.append("Error: Lot Mean negative or less than 0")
            if self.Lot_SD_r<=0:
                self.ui.textEdit_status_N.append("Error: Lot SD negative or less than 0")
            if self.SSB_DF_r<=0:
                self.ui.textEdit_status_N.append("Error: SSB DF negative or less than 0")
            if self.SSW_DF_r<=0:
                self.ui.textEdit_status_N.append("Error: SSW DF negative or less than 0")
            if self.SST_DF_r<=0:
                self.ui.textEdit_status_N.append("Error: SST DF negative or less than 0")
            if item==None:
                self.ui.textEdit_status_N.append("Error: Input table has wrong data")
            elif float(item.text())<=0: self.ui.textEdit_status_N.append("Error: Input table has negative or 0 data")
else: [further calculations]
</code>```

if I delete parts about cheking table cells, it works. In current state it not working if one of cells in table has zero\negative\empty data, it not printing error and further calculations goes, intstead of - error message about wrong data in table and stop further calculations. Single input fields works fine

Body:
I have project with gui - table, few input fields, output field and buttons. I created a simple code to check if numbers in input fields are positive, and if they are not - stop further calculation and print out error message in output field. How to check table cells for negative numbers or empty?
my logic - Data inputed in fields and table, button pressed and if one of input fields or one of table cells have negative\zero\empty data code stops and in output field post error text.
Lot_Mean_r, Lot_SD_r, SSB_DF_r, SSW_DF_r, SST_DF_r are input fields qdoubleSpinBox

if self.Lot_Mean_r<=0 or self.Lot_SD_r<=0 or self.SSB_DF_r<=0 or self.SSW_DF_r<=0 or self.SST_DF_r<=0 or float(item.text())<=0 or item==None:
            if self.Lot_Mean_r<=0:
                self.ui.textEdit_status_N.append("Error: Lot Mean negative or less than 0")
            if self.Lot_SD_r<=0:
                self.ui.textEdit_status_N.append("Error: Lot SD negative or less than 0")
            if self.SSB_DF_r<=0:
                self.ui.textEdit_status_N.append("Error: SSB DF negative or less than 0")
            if self.SSW_DF_r<=0:
                self.ui.textEdit_status_N.append("Error: SSW DF negative or less than 0")
            if self.SST_DF_r<=0:
                self.ui.textEdit_status_N.append("Error: SST DF negative or less than 0")
            if item==None:
                self.ui.textEdit_status_N.append("Error: Input table has wrong data")
            elif float(item.text())<=0: self.ui.textEdit_status_N.append("Error: Input table has negative or 0 data")
else: [further calculations]

if I delete parts about cheking table cells, it works. In current state it not working if one of cells in table has zero\negative\empty data, it not printing error and further calculations goes, intstead of - error message about wrong data in table and stop further calculations. Single input fields works fine


问:
How i can delete a user auth (email , password ) firebase angular
in This app , there's on user who can create accounts and delete !</p>
```<code>  deleteAuthTech (){
  return this.fireauth.user.subscribe((y)=>y.delete())

  }
</code>```

Body:
in This app , there's on user who can create accounts and delete !

  deleteAuthTech (){
  return this.fireauth.user.subscribe((y)=>y.delete())

  }


问:
Why openpyxl is hidding some rows?
I'm having a little trouble with openpyxl. I'm updating an excel with historic data something like this:

The excel has 2 sheets with this data, both are almost the same. The thing is that after I add the new rows and aply the formats, in the second sheet for some reason a lot of row are hidden, like this:

This is my code:

```<code>from copy import copy
import pandas as pd
from openpyxl import load_workbook

datos = pd.Dataframe(my_data)  # This is not right but I already have the data in a DF
today = datos[col1].loc[0].strftime("%Y-%m-%d")
tomorrow = datos[col1].loc[1].strftime("%Y-%m-%d")
historic = 'my_excel.xlsx'
logger.info('Reading Excel')
wb = load_workbook(historic)
sheets = wb.sheetnames
for sheet in sheets:
    logger.warning(f'************* {sheet} *************')
    ws = wb[sheet]
    logger.info(f'active: {wb.active}')
    logger.info(f"len D: {len(ws['D'])}")
    logger.info(f"len E: {len(ws['E'])}")
    max_row = len(ws['D'])
    logger.info('Last D cell')
    last_D_cell = ws.cell(row=max_row, column=4)
    last_D_cell_value = last_D_cell.value.strftime("%d/%m/%Y")

    logger.info('New Cell')
    new_D_cell = ws.cell(row=max_row + 1, column=4)
    new_D_cell.font = copy(last_D_cell.font)
    new_D_cell.border = copy(last_D_cell.border)
    new_D_cell.number_format = copy(last_D_cell.number_format)
    new_D_cell.alignment = copy(last_D_cell.alignment)
    new_D_cell.fill = copy(last_D_cell.fill)
    new_D_cell.value = datos[col1].loc[1].strftime("%d/%m/%Y")

    logger.info('Penultimate D Cell')
    penultimate_D_cell = ws.cell(row=max_row - 1, column=4)
    last_D_cell.font = copy(penultimate_D_cell.font)
    last_D_cell.border = copy(penultimate_D_cell.border)
    last_D_cell.number_format = copy(penultimate_D_cell.number_format)
    last_D_cell.alignment = copy(penultimate_D_cell.alignment)
    last_D_cell.fill = copy(penultimate_D_cell.fill)

    logger.info('Last E Cell')
    last_E_cell = ws[f'E{max_row}']
    new_E_cell = ws.cell(row=max_row + 1, column=5)
    new_E_cell.font = copy(last_E_cell.font)
    new_E_cell.border = copy(last_E_cell.border)
    new_E_cell.number_format = copy(last_E_cell.number_format)
    new_E_cell.alignment = copy(last_E_cell.alignment)
    new_E_cell.fill = copy(last_E_cell.fill)
    new_E_cell.value = tomorrow_value

    logger.info('Penultimate E')
    penultimate_E_cell = ws[f'E{max_row - 1}']
    last_E_cell.font = copy(penultimate_E_cell.font)
    last_E_cell.border = copy(penultimate_E_cell.border)
    last_E_cell.number_format = copy(penultimate_E_cell.number_format)
    last_E_cell.alignment = copy(penultimate_E_cell.alignment)
    last_E_cell.fill = copy(penultimate_E_cell.fill)

logger.info('SAving Excel')
wb.save(historic)
</code>```

With this code, the last sheet it works will have the hidden rows, and I don't know why is this happening.

Hope someone can help me thanks

EDIT: I'm on Ubuntu 20.4 LTS, and the resulting files has been opened in both Ubuntu and Windows 10 and the same situation appears.

Title: Why openpyxl is hidding some rows?

Body:
I'm having a little trouble with openpyxl. I'm updating an excel with historic data something like this:

The excel has 2 sheets with this data, both are almost the same. The thing is that after I add the new rows and aply the formats, in the second sheet for some reason a lot of row are hidden, like this:

This is my code:

from copy import copy
import pandas as pd
from openpyxl import load_workbook

datos = pd.Dataframe(my_data)  # This is not right but I already have the data in a DF
today = datos[col1].loc[0].strftime("%Y-%m-%d")
tomorrow = datos[col1].loc[1].strftime("%Y-%m-%d")
historic = 'my_excel.xlsx'
logger.info('Reading Excel')
wb = load_workbook(historic)
sheets = wb.sheetnames
for sheet in sheets:
    logger.warning(f'************* {sheet} *************')
    ws = wb[sheet]
    logger.info(f'active: {wb.active}')
    logger.info(f"len D: {len(ws['D'])}")
    logger.info(f"len E: {len(ws['E'])}")
    max_row = len(ws['D'])
    logger.info('Last D cell')
    last_D_cell = ws.cell(row=max_row, column=4)
    last_D_cell_value = last_D_cell.value.strftime("%d/%m/%Y")

    logger.info('New Cell')
    new_D_cell = ws.cell(row=max_row + 1, column=4)
    new_D_cell.font = copy(last_D_cell.font)
    new_D_cell.border = copy(last_D_cell.border)
    new_D_cell.number_format = copy(last_D_cell.number_format)
    new_D_cell.alignment = copy(last_D_cell.alignment)
    new_D_cell.fill = copy(last_D_cell.fill)
    new_D_cell.value = datos[col1].loc[1].strftime("%d/%m/%Y")

    logger.info('Penultimate D Cell')
    penultimate_D_cell = ws.cell(row=max_row - 1, column=4)
    last_D_cell.font = copy(penultimate_D_cell.font)
    last_D_cell.border = copy(penultimate_D_cell.border)
    last_D_cell.number_format = copy(penultimate_D_cell.number_format)
    last_D_cell.alignment = copy(penultimate_D_cell.alignment)
    last_D_cell.fill = copy(penultimate_D_cell.fill)

    logger.info('Last E Cell')
    last_E_cell = ws[f'E{max_row}']
    new_E_cell = ws.cell(row=max_row + 1, column=5)
    new_E_cell.font = copy(last_E_cell.font)
    new_E_cell.border = copy(last_E_cell.border)
    new_E_cell.number_format = copy(last_E_cell.number_format)
    new_E_cell.alignment = copy(last_E_cell.alignment)
    new_E_cell.fill = copy(last_E_cell.fill)
    new_E_cell.value = tomorrow_value

    logger.info('Penultimate E')
    penultimate_E_cell = ws[f'E{max_row - 1}']
    last_E_cell.font = copy(penultimate_E_cell.font)
    last_E_cell.border = copy(penultimate_E_cell.border)
    last_E_cell.number_format = copy(penultimate_E_cell.number_format)
    last_E_cell.alignment = copy(penultimate_E_cell.alignment)
    last_E_cell.fill = copy(penultimate_E_cell.fill)

logger.info('SAving Excel')
wb.save(historic)

With this code, the last sheet it works will have the hidden rows, and I don't know why is this happening.

Hope someone can help me thanks

EDIT: I'm on Ubuntu 20.4 LTS, and the resulting files has been opened in both Ubuntu and Windows 10 and the same situation appears.


问:
How to change Android SDK (AVD) path in expo-cli for React Native?
I've recently started learning React Native. My Android SDK is located in this path - D:\Apps\Android SDK\platform-tools but expo-cli thinks it is in the default directory and throws me errors. Is there a way I change the path that expo checks for Android SDK?

I expect that expo cli checks for the Android SDK in this path D:\Apps\Android SDK\platform-tools


问:
Why react app is still loading in the browser due to react-router-dom
```<code><div className="app">
  <BrowserRouter>
    <ThemeProvider theme={theme}>
      <CssBaseline />
      <Routes>
        <Route element={<Layout />}>
          <Route path="/" element={<Navigate to="/dashboard" replace />} />
          <Route path="/dashboard" element={<Dashboard />} />
        </Route>
      </Routes>
    </ThemeProvider>
  </BrowserRouter>
</div>
</code>```

I cannot figure out what is the issue with my routing. Actually, I'm following a youtube tutorial in which he implement routing this way. When i do comment the routing code my app renders otherwise it keeps loading

Body:
  <BrowserRouter>
    <ThemeProvider theme={theme}>
      <CssBaseline />
      <Routes>
        <Route element={<Layout />}>
          <Route path="/" element={<Navigate to="/dashboard" replace />} />
          <Route path="/dashboard" element={<Dashboard />} />
        </Route>
      </Routes>
    </ThemeProvider>
  </BrowserRouter>

I cannot figure out what is the issue with my routing. Actually, I'm following a youtube tutorial in which he implement routing this way. When i do comment the routing code my app renders otherwise it keeps loading


问:
How can we set values through openAPI yaml file and can be used in C#?
Existing code :-

```<code>openapi: "3.0.0"
info:
  version: 1.0.0
  title: ConfigCheckKeys
  x-namespace: ConfigCheck
  license:
    name: MIT

paths:
  /:
    get:
      responses:
        '200':
           description: OK
components:
  schemas:

    ConfigCheckKeysEnumerations:
      type: object
      description: 'Config check keys enumerations.'
      x-aggregate-version: v1
      properties:
        ConfigCheckKeys:  # AGGREGATE-NAME  ENUM-FIELD-SCHEMA ...
          type: integer
          format: enum-int32  # ENUM-TYPE
          x-enumName:      # ENUM-NAME
          x-enumSuffix: ConfigCheckKeys  # ENUM-SUFFIX
          x-enumNames: [ DeviceGroup, Language, Licensing, NetworkSettings, Programs, Users, Incidents, RunData, DlogManagement, SoftwareUpdate ]  # ENUM-VALUE-NAME, ...
          x-generateEnumDescriptions: [ 'DeviceGroup', 'Language', 'Licensing', 'NetworkSettings', 'Programs', 'Users', 'Incidents', 'RunData', 'DlogManagement', 'SoftwareUupdate' ]  # ENUM-VALUE-DESCRIPTION, ...
          enum: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]   # ENUM-VALUE, ENUM-VALUE, ...

      x-meta-data:
        versions:
          v1:   # VERSION-STRING
            properties:
              ConfigCheckKeys:
                x-version-ref: 'v1'  # VERSION-STRING
</code>```

Trying to set QOS values in below
enter image description here

and then want to use these values(QOS) after converted into .cs file via code-generated repository in C# code as below:-

```<code>      });
         subs.AddTopicFilter(new MqttTopicFilter()
         {
            //Topic =
            RetainAsPublished = false,
            QualityOfServiceLevel = qOSEnum.AtLeastOnce,
         });
      }

</code>```

Body:
Existing code :-

openapi: "3.0.0"
info:
  version: 1.0.0
  title: ConfigCheckKeys
  x-namespace: ConfigCheck
  license:
    name: MIT

paths:
  /:
    get:
      responses:
        '200':
           description: OK
components:
  schemas:

    ConfigCheckKeysEnumerations:
      type: object
      description: 'Config check keys enumerations.'
      x-aggregate-version: v1
      properties:
        ConfigCheckKeys:  # AGGREGATE-NAME  ENUM-FIELD-SCHEMA ...
          type: integer
          format: enum-int32  # ENUM-TYPE
          x-enumName:      # ENUM-NAME
          x-enumSuffix: ConfigCheckKeys  # ENUM-SUFFIX
          x-enumNames: [ DeviceGroup, Language, Licensing, NetworkSettings, Programs, Users, Incidents, RunData, DlogManagement, SoftwareUpdate ]  # ENUM-VALUE-NAME, ...
          x-generateEnumDescriptions: [ 'DeviceGroup', 'Language', 'Licensing', 'NetworkSettings', 'Programs', 'Users', 'Incidents', 'RunData', 'DlogManagement', 'SoftwareUupdate' ]  # ENUM-VALUE-DESCRIPTION, ...
          enum: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]   # ENUM-VALUE, ENUM-VALUE, ...

      x-meta-data:
        versions:
          v1:   # VERSION-STRING
            properties:
              ConfigCheckKeys:
                x-version-ref: 'v1'  # VERSION-STRING

Trying to set QOS values in below
enter image description here

and then want to use these values(QOS) after converted into .cs file via code-generated repository in C# code as below:-

      });
         subs.AddTopicFilter(new MqttTopicFilter()
         {
            //Topic =
            RetainAsPublished = false,
            QualityOfServiceLevel = qOSEnum.AtLeastOnce,
         });
      }


问:
spring boot 3 jpa inheritance not working properly
After upgrading to spring boot 3 from 2.x the JPA inheritance strategy InheritanceType.JOINED is behaving incorrectly.

I have below Entities Book and ComputerBook

Book

```<code>@Entity(name = "book")
@Inheritance(strategy = InheritanceType.JOINED)
abstract class Book @JvmOverloads constructor(

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
open var id: Long,
open var author: String,
open var publisher: String
)
</code>```

Computer Book

```<code>@Entity(name = "computer_book")
@DiscriminatorValue("computer")
data class ComputerBook @JvmOverloads constructor(

    override var id: Long,
    override var author: String,
    override var publisher: String,
    var language: String

): Book(
    id,
    author,
    publisher
)
</code>```

When I get the ComputerBook entity using BookRepository I get it as follows:

```<code> id = 1
 author= null
 publisher = null
 language = "Php"
 Book.id = 0
 Book.author = "Jhon Doe"
 Book.publisher = "Bright publishers"
</code>```

but when I was using spring boot 2.x the entity I used to get was

```<code> id = 1
 author= "Jhon Doe"
 publisher = "Bright publishers"
 language = "Php"
 Book.id = 0
 Book.author = null
 Book.publisher = null
</code>```

Is this Bug in spring boot 3 or I am missing something?

Body:
After upgrading to spring boot 3 from 2.x the JPA inheritance strategy InheritanceType.JOINED is behaving incorrectly.

I have below Entities Book and ComputerBook

Book

@Entity(name = "book")
@Inheritance(strategy = InheritanceType.JOINED)
abstract class Book @JvmOverloads constructor(

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
open var id: Long,
open var author: String,
open var publisher: String
)

Computer Book

@Entity(name = "computer_book")
@DiscriminatorValue("computer")
data class ComputerBook @JvmOverloads constructor(

    override var id: Long,
    override var author: String,
    override var publisher: String,
    var language: String

): Book(
    id,
    author,
    publisher
)

When I get the ComputerBook entity using BookRepository I get it as follows:

 id = 1
 author= null
 publisher = null
 language = "Php"
 Book.id = 0
 Book.author = "Jhon Doe"
 Book.publisher = "Bright publishers"

but when I was using spring boot 2.x the entity I used to get was

 id = 1
 author= "Jhon Doe"
 publisher = "Bright publishers"
 language = "Php"
 Book.id = 0
 Book.author = null
 Book.publisher = null

Is this Bug in spring boot 3 or I am missing something?


问:
Create a column while this new column is a qcut
I have to use qcut with a column called "PriceEuro", the combination of qcut and "PriceEuro" should be in another column that it must be created. The new column is called "Price_Category". The column "Price_Category" should contain one of these three labels: low, medium or high.

I checked here in stackoverflow and I found this:

Assignment of qcut as new column

After reading the previous link I did the following thing:

```<code>import pandas as pd

new_labels = ['low','medium','high']

new_column = pd.qcut(df_csv3.rank(method='first')['PriceEuro'], q=5, labels=new_labels, duplicates='drop')

df_csv3 = df_csv3.assign(Price_Category=new_column.values)
</code>```

But, once I run it i get the following ValueError:

first not supported for non-numeric data

Body:
I have to use qcut with a column called "PriceEuro", the combination of qcut and "PriceEuro" should be in another column that it must be created. The new column is called "Price_Category". The column "Price_Category" should contain one of these three labels: low, medium or high.

I checked here in stackoverflow and I found this:

Assignment of qcut as new column

After reading the previous link I did the following thing:

import pandas as pd

new_labels = ['low','medium','high']

new_column = pd.qcut(df_csv3.rank(method='first')['PriceEuro'], q=5, labels=new_labels, duplicates='drop')

df_csv3 = df_csv3.assign(Price_Category=new_column.values)

But, once I run it i get the following ValueError:

first not supported for non-numeric data


问:
Kubernetes pod scheduling failed with 1 node(s) didn't satisfy existing pods anti-affinity rules
Our K8S setup runs on baremetal with 1 master-node and 1 worker-node and we already deployed few pods on it

We added a new worker-node

```<code>NAME              STATUS   ROLES                  AGE   VERSION
master-node       Ready    control-plane,master   27d   v1.20.2
worker-node-new   Ready    <none>                 20h   v1.20.2
worker-node-2     Ready    worker                 27d   v1.20.0
</code>```

and wanted to evenly distribute some of the pods to both the worker nodes

PodAffinity snippet is provided below

```<code> affinity:
   podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: app
              operator: In
              values:
              - ursip-siphttp
          topologyKey: kubernetes.io/hostname
</code>```

but pod remains in state Pending

Pod Status

```<code>NAME                         READY    STATUS              RESTARTS   AGE
http-574f66f744-2xckb         0/1     Pending             0          15m
http-7867465c7d-nn8zw         1/1     Running             0          84m
</code>```

Error Message (from Pending Pod)

```<code>Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  58s (x2 over 58s)  default-scheduler  0/3 nodes are available: 1 node(s) didn't match pod affinity/anti-affinity, 1 node(s) didn't satisfy existing pods anti-affinity rules, 2 node(s) had volume node affinity conflict.
</code>```

I google'd a lot but unfortunately I am unable to fix this

Body:
Our K8S setup runs on baremetal with 1 master-node and 1 worker-node and we already deployed few pods on it

We added a new worker-node

NAME              STATUS   ROLES                  AGE   VERSION
master-node       Ready    control-plane,master   27d   v1.20.2
worker-node-new   Ready    <none>                 20h   v1.20.2
worker-node-2     Ready    worker                 27d   v1.20.0

and wanted to evenly distribute some of the pods to both the worker nodes

PodAffinity snippet is provided below

 affinity:
   podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: app
              operator: In
              values:
              - ursip-siphttp
          topologyKey: kubernetes.io/hostname

but pod remains in state Pending

Pod Status

NAME                         READY    STATUS              RESTARTS   AGE
http-574f66f744-2xckb         0/1     Pending             0          15m
http-7867465c7d-nn8zw         1/1     Running             0          84m

Error Message (from Pending Pod)

Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  58s (x2 over 58s)  default-scheduler  0/3 nodes are available: 1 node(s) didn't match pod affinity/anti-affinity, 1 node(s) didn't satisfy existing pods anti-affinity rules, 2 node(s) had volume node affinity conflict.

I google'd a lot but unfortunately I am unable to fix this


问:
powershell modules missing / Aws
I'm trying to setup powershell to work with AWS services. First I loaded the AWS
Install-Module -Name AWS.Tools.Common from powershell then tried to import various modules. I noticed folders for s3, Ec2 and Redshift and thats what I want. When I type Get-Help AWS in powershell, I don't see all of my folders. I only see folders for EC2 and the AWS.Tools.Common modules, AWS.Tools.Installer modules and EC2 modules. I don't think I installed this correctly.  I used the link below

https://www.powershellgallery.com/packages/AWS.Tools.Common/4.1.237

also this link:

https://docs.aws.amazon.com/pdfs/powershell/latest/userguide/aws-pst-ug.pdf#pstools-getting-set-up-windows

I just wanted to work with my AWS services without using AWS CLI. I had Windows Powershell, but recently upgrade to Powershell Core 7. I'm not sure if there are too many Powershells on my system, but please let me know what I did wrong.

Title: powershell modules missing / Aws


问:
Selenium Dropdown is not working in Jenkins
Im having a problem with dropdown element when running from Jenkins while it is all working perfectly when running locally. I was taking some Applitools screenshots from both runs and I can see a difference there. Local run is using Chrome headless as well as Jenkins. In Jenkins click element pass in Jenkins but nothing really happens while running locally I see the dropdown list expanded.
Im using this method for click where selectors are taken from json file:

```<code>String Object = getObjectProperties(jsonpath, locator);
    By loc = getWebLocator(jsonpath, locator);
    waitElementToBePresent(loc);
    WebElement element = convertElement(Object);

    try {
        if (element.isEnabled() && element.isDisplayed()) {
            waitElementToBeClickable(element);
            scrollToElement(element);
            element.click();
            APIlib.logReport("Clicked on the element : " + elementDescription);
        } else {
            APIlib.validationMessage("fail", "Element not displayed: " + elementDescription);
        }
    } catch (StaleElementReferenceException var7) {
        retryFindClick(element);
    } catch (NoSuchElementException var8) {
        safeJavaScriptClick(element);
    } catch (Exception var9) {
        safeJavaScriptClick(element);
    }
</code>```

Any ideas what may causing this issue? Ive got there wait for clickable also:

```<code>WebDriverWait wait = new WebDriverWait(DriverManager.getInstance().getDriver(), 50L);
    wait.until(ExpectedConditions.elementToBeClickable(element));
</code>```

I need to first expand this dropdown by clicking it so the list data is getting populated in other DIV which then I need to get data from. Thanks for any support!

Body:
Im having a problem with dropdown element when running from Jenkins while it is all working perfectly when running locally. I was taking some Applitools screenshots from both runs and I can see a difference there. Local run is using Chrome headless as well as Jenkins. In Jenkins click element pass in Jenkins but nothing really happens while running locally I see the dropdown list expanded.
Im using this method for click where selectors are taken from json file:

String Object = getObjectProperties(jsonpath, locator);
    By loc = getWebLocator(jsonpath, locator);
    waitElementToBePresent(loc);
    WebElement element = convertElement(Object);

    try {
        if (element.isEnabled() && element.isDisplayed()) {
            waitElementToBeClickable(element);
            scrollToElement(element);
            element.click();
            APIlib.logReport("Clicked on the element : " + elementDescription);
        } else {
            APIlib.validationMessage("fail", "Element not displayed: " + elementDescription);
        }
    } catch (StaleElementReferenceException var7) {
        retryFindClick(element);
    } catch (NoSuchElementException var8) {
        safeJavaScriptClick(element);
    } catch (Exception var9) {
        safeJavaScriptClick(element);
    }

Any ideas what may causing this issue? Ive got there wait for clickable also:

WebDriverWait wait = new WebDriverWait(DriverManager.getInstance().getDriver(), 50L);
    wait.until(ExpectedConditions.elementToBeClickable(element));

I need to first expand this dropdown by clicking it so the list data is getting populated in other DIV which then I need to get data from. Thanks for any support!


问:
i have a simple error when presenting precision recall and F1score of a logestic regression model
hi i want my results to be presented as i single number like the output below
for example

Precision   0.94  Recall      0.93  F1 score    0.93

these are my data

data.head()

the variables with series (dummy variables the data has gender 1 for female and 2 for male so i add separated them into female 0 and 1 , male 0 and 1 that explains the series)

this is my logistic regression code

```<code>
from imblearn.under_sampling import RandomUnderSampler
rus = RandomUnderSampler(random_state=0)
x_resampled,y_resampled = rus.fit_resample(x1_data,y1_data)
train_x, test_x, train_y, test_y = train_test_split(x_resampled,y_resampled, test_size=0.2, random_state=42)
logreg_under = LogisticRegression()
logreg_under.fit(train_x,train_y)
print("Logistic Regression Accuracy after undersampling :",logreg_under.score(test_x, test_y))
print("Logistic Regression F1 Score after undersampling :",f1_score(test_y,logreg_under.predict(test_x),average=None))

ymc1_pred=logreg.predict(test_x)

Mc1 = metrics.confusion_matrix(test_y,ymc1_pred)

sns.heatmap(Mc1,annot = True, fmt ='0.3f', linewidth=0.5 ,
            square = True, cbar = False)

plt.ylabel('actual values')
plt.xlabel('predicted Values')
plt.show()
</code>```

and this is my out put

```<code> Logistic regression model accuracy:0.94
 Logistic Regression F1 Score : [0.9655461  0.47566509] Logistic
 Regression Accuracy after undersampling : 0.902297169964584 Logistic
 Regression F1 Score after undersampling : [0.90023556 0.9042753 ]
</code>```

this is my confusion matrix

please i am a beginner and i looked for code to find the preciion and the recall and the avergae F1 score like the below but i could not find any

```<code>Precision   0.94
Recall      0.93
F1 score    0.93
</code>```

Help me
Thank you

Body:
hi i want my results to be presented as i single number like the output below
for example

Precision   0.94  Recall      0.93  F1 score    0.93

these are my data

data.head()

the variables with series (dummy variables the data has gender 1 for female and 2 for male so i add separated them into female 0 and 1 , male 0 and 1 that explains the series)

this is my logistic regression code

from imblearn.under_sampling import RandomUnderSampler
rus = RandomUnderSampler(random_state=0)
x_resampled,y_resampled = rus.fit_resample(x1_data,y1_data)
train_x, test_x, train_y, test_y = train_test_split(x_resampled,y_resampled, test_size=0.2, random_state=42)
logreg_under = LogisticRegression()
logreg_under.fit(train_x,train_y)
print("Logistic Regression Accuracy after undersampling :",logreg_under.score(test_x, test_y))
print("Logistic Regression F1 Score after undersampling :",f1_score(test_y,logreg_under.predict(test_x),average=None))

ymc1_pred=logreg.predict(test_x)

Mc1 = metrics.confusion_matrix(test_y,ymc1_pred)

sns.heatmap(Mc1,annot = True, fmt ='0.3f', linewidth=0.5 ,
            square = True, cbar = False)

plt.ylabel('actual values')
plt.xlabel('predicted Values')
plt.show()

and this is my out put

 Logistic regression model accuracy:0.94
 Logistic Regression F1 Score : [0.9655461  0.47566509] Logistic
 Regression Accuracy after undersampling : 0.902297169964584 Logistic
 Regression F1 Score after undersampling : [0.90023556 0.9042753 ]

this is my confusion matrix

please i am a beginner and i looked for code to find the preciion and the recall and the avergae F1 score like the below but i could not find any

Precision   0.94
Recall      0.93
F1 score    0.93

Help me
Thank you


问:
Unable to load local html file in WebView2
Trying loading HTML from Bin>Debug>html folder.
Want to achieve loading HTML from any location from the project package.

Code -

```<code>using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.WinForms;

namespace WebViewPOC
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            initWebView();
        }

        async void initWebView()
        {
            await webView21.EnsureCoreWebView2Async(null);
            webView21.CoreWebView2.Navigate(Path.Combine("file:", Application.StartupPath, "html", "index.html"));
        }

    }
}
</code>```

Output and location of HTML

Body:
Trying loading HTML from Bin>Debug>html folder.
Want to achieve loading HTML from any location from the project package.

Code -

using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.WinForms;

namespace WebViewPOC
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            initWebView();
        }

        async void initWebView()
        {
            await webView21.EnsureCoreWebView2Async(null);
            webView21.CoreWebView2.Navigate(Path.Combine("file:", Application.StartupPath, "html", "index.html"));
        }

    }
}

Output and location of HTML


问:
How to set the spacing between the labels and input box properly
I want to set the spaces between the labels and input boxes properly but applying vertical spaceing and horizontal spacing is not working. I used a grid_layout and I would like the spacing between the labes and input boxes to be symetrical. Here is how they are displayed:

My code:

```<code>grid_layout = QGridLayout()
        grid_layout.setHorizontalSpacing(5)
        grid_layout.setVerticalSpacing(5)
        self.setLayout(grid_layout)

        grid_layout.addWidget(self.order_id_label, 0, 0)
        grid_layout.addWidget(self.order_id_lineedit, 1, 0)
        grid_layout.addWidget(self.defined_label, 2, 0)
        grid_layout.addWidget(self.defined_dateedit, 3, 0)
        grid_layout.addWidget(self.org_label, 4, 0)
        grid_layout.addWidget(self.org_combobox, 5, 0)
        grid_layout.addWidget(self.request_label, 6, 0)
        grid_layout.addWidget(self.request_lineedit, 7, 0)
        grid_layout.addWidget(self.address_label, 8, 0)
        grid_layout.addWidget(self.address_lineedit, 9, 0)
        grid_layout.addWidget(self.customer_label, 10, 0)
        grid_layout.addWidget(self.customer_lineedit, 11, 0)
        grid_layout.addWidget(self.tel_no_label, 12, 0)
        grid_layout.addWidget(self.tel_no_lineedit, 13, 0)
        grid_layout.addWidget(self.close_button, 16, 0)

        grid_layout.addWidget(self.order_type_label, 0, 1)
        grid_layout.addWidget(self.order_type_combobox, 1, 1)
        grid_layout.addWidget(self.scheduled_label, 2, 1)
        grid_layout.addWidget(self.scheduled_dateedit, 3, 1)
        grid_layout.addWidget(self.request_gps_label, 4, 1)
        grid_layout.addWidget(self.request_gps_checkbox, 5, 1)
        grid_layout.addWidget(self.night_shift_label, 6, 1)
        grid_layout.addWidget(self.night_shift_checkbox, 7, 1)
        grid_layout.addWidget(self.wo_comment_label, 8, 1)
        grid_layout.addWidget(self.wo_comment_textedit, 9, 1)

        grid_layout.addWidget(self.reason_label, 0, 2)
        grid_layout.addWidget(self.reason_textedit, 1, 2)
        grid_layout.addWidget(self.completed_label, 2, 2)
        grid_layout.addWidget(self.completed_dateedit, 3, 2)
        grid_layout.addWidget(self.signed_by_label, 4, 2)
        grid_layout.addWidget(self.signed_by_combobox, 5, 2)
        grid_layout.addWidget(self.status_label, 6, 2)
        grid_layout.addWidget(self.status_combobox, 7, 2)
</code>```

Body:
I want to set the spaces between the labels and input boxes properly but applying vertical spaceing and horizontal spacing is not working. I used a grid_layout and I would like the spacing between the labes and input boxes to be symetrical. Here is how they are displayed:

My code:

grid_layout = QGridLayout()
        grid_layout.setHorizontalSpacing(5)
        grid_layout.setVerticalSpacing(5)
        self.setLayout(grid_layout)

        grid_layout.addWidget(self.order_id_label, 0, 0)
        grid_layout.addWidget(self.order_id_lineedit, 1, 0)
        grid_layout.addWidget(self.defined_label, 2, 0)
        grid_layout.addWidget(self.defined_dateedit, 3, 0)
        grid_layout.addWidget(self.org_label, 4, 0)
        grid_layout.addWidget(self.org_combobox, 5, 0)
        grid_layout.addWidget(self.request_label, 6, 0)
        grid_layout.addWidget(self.request_lineedit, 7, 0)
        grid_layout.addWidget(self.address_label, 8, 0)
        grid_layout.addWidget(self.address_lineedit, 9, 0)
        grid_layout.addWidget(self.customer_label, 10, 0)
        grid_layout.addWidget(self.customer_lineedit, 11, 0)
        grid_layout.addWidget(self.tel_no_label, 12, 0)
        grid_layout.addWidget(self.tel_no_lineedit, 13, 0)
        grid_layout.addWidget(self.close_button, 16, 0)

        grid_layout.addWidget(self.order_type_label, 0, 1)
        grid_layout.addWidget(self.order_type_combobox, 1, 1)
        grid_layout.addWidget(self.scheduled_label, 2, 1)
        grid_layout.addWidget(self.scheduled_dateedit, 3, 1)
        grid_layout.addWidget(self.request_gps_label, 4, 1)
        grid_layout.addWidget(self.request_gps_checkbox, 5, 1)
        grid_layout.addWidget(self.night_shift_label, 6, 1)
        grid_layout.addWidget(self.night_shift_checkbox, 7, 1)
        grid_layout.addWidget(self.wo_comment_label, 8, 1)
        grid_layout.addWidget(self.wo_comment_textedit, 9, 1)

        grid_layout.addWidget(self.reason_label, 0, 2)
        grid_layout.addWidget(self.reason_textedit, 1, 2)
        grid_layout.addWidget(self.completed_label, 2, 2)
        grid_layout.addWidget(self.completed_dateedit, 3, 2)
        grid_layout.addWidget(self.signed_by_label, 4, 2)
        grid_layout.addWidget(self.signed_by_combobox, 5, 2)
        grid_layout.addWidget(self.status_label, 6, 2)
        grid_layout.addWidget(self.status_combobox, 7, 2)


问:
GCP use cloud storage file to pull the code from git
I am trying to put a start-up script in cloud storage file for a vm. this cloud storage file will contain pull related command.

so the first step to get a ssh-key, I generate it from bitbucket, now when I went for adding the ssh-key in vm metadata, I saw there is already ssh there in metadata.

How can I use this metadata ssh key to pull the repo from bitbucket. I want to write the shell script to pull the code in cloud storage file and then give this file as startup script for the vm.

I am stuck on how can I access ssh-key. I saw somewhere

```<code>cat ~/.ssh/id_rsa.pub
</code>```

I was guessing this file should show the keys it has as I am able to see the ssh-keys in vm metadata, but it says file not found.

I am looking into wrong file

Thanks,

Body:
I am trying to put a start-up script in cloud storage file for a vm. this cloud storage file will contain pull related command.

so the first step to get a ssh-key, I generate it from bitbucket, now when I went for adding the ssh-key in vm metadata, I saw there is already ssh there in metadata.

How can I use this metadata ssh key to pull the repo from bitbucket. I want to write the shell script to pull the code in cloud storage file and then give this file as startup script for the vm.

I am stuck on how can I access ssh-key. I saw somewhere

cat ~/.ssh/id_rsa.pub

I was guessing this file should show the keys it has as I am able to see the ssh-keys in vm metadata, but it says file not found.

I am looking into wrong file

Thanks,


问:
Not sending email content to webhooks in pipedream
I used the following code in pipedream to send the received email content via webhook.
In the code below, the content of the email is sent to the Discord webhook, but it is not sent to the webhooks that I have placed in the webhook_urls section.
I first used email as a trigger and then put the code in the HTTP / Webhook API in Python.
In addition, after the test, I did not receive any error, but the webhooks that I put in the webhook_urls section are not sent.
I don't know which part of the code has a problem. Please help me if anyone knows where the problem is.
Thank you for your attention and help.

import re
import json
import requests
from requests.adapters import HTTPAdapter, Retry
from datetime import datetime

# =====================================
# SETTING
# =====================================

webhook_urls = [
  r"https://www.example.com/webhook-1/",
  r"https://www.example.com/webhook-2/",
]

# vv for logging (fill in the webhook URL if you need)
discord_webhook_url = r"https://discord.com/api/webhooks/xxxxx"

# 4 = info, ok, warning, error
# 3 = ok, warning, error
# 2 = warning, error
# 1 = error only
# 0 = OFF
log_level = 4

# =====================================
# CODE
# =====================================

show_welcome_msg = False

url_regex = "https?://([A-Za-z_0-9.-]+).*"

dc_embeds_sample = [{
    "type":"rich",
    "title": "",
    "description": "",
    "color": 5533306,
    "footer": {
        "text": "",
        "icon_url": ""
      },
    }]

class log:
    def info(payload):
        if (log_level < 4 or log_level < 0):
            return
        embeds = dc_embeds_sample.copy()
        embeds[0]["title"] = "INFO"
        embeds[0]["description"] = payload
        embeds[0]["color"] = 5533306
        send_msg_to_dc("", embeds)

    def ok(payload:str):
        if (log_level < 3 or log_level < 0):
            return
        embeds = dc_embeds_sample.copy()
        embeds[0]["title"] = "OK"
        embeds[0]["description"] = payload
        embeds[0]["color"] = 5763719
        send_msg_to_dc("", embeds)

    def warning(payload:str):
        if (log_level < 2 or log_level < 0):
            return
        embeds = dc_embeds_sample.copy()
        embeds[0]["title"] = "WARNING"
        embeds[0]["description"] = payload
        embeds[0]["color"] = 16776960
        send_msg_to_dc("", embeds)

    def error(payload:str):
        if (log_level < 1 or log_level < 0):
            return
        embeds = dc_embeds_sample.copy()
        embeds[0]["title"] = "ERROR"
        embeds[0]["description"] = payload
        embeds[0]["color"] = 15548997
        send_msg_to_dc("", embeds)

def extract_domain_name(url:str):
    m = re.search(url_regex, url)
    if m:
        return m.group(1)
    return None

def post_request(webhook_url:str, payload:str or json, auto_json_dumps:bool = True):
    headers = {
            "Content-Type": "application/json",
            "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11"
        }
    data = json.dumps(payload) if auto_json_dumps else payload
    # start a session
    session = requests.Session()
    # set retry policy
    retry = Retry(connect=3, backoff_factor=0.5)
    adapter = HTTPAdapter(max_retries=retry)
    # add adapter to session
    session.mount('http://', adapter)
    session.mount('https://', adapter)
    # send request
    response = session.post(webhook_url, data=data, headers=headers)
    return response

def send_msg_to_dc(message, embeds=None):
    if (len(discord_webhook_url.strip()) == 0):
        return # empty URL
    if extract_domain_name(discord_webhook_url) is None:
        print("Invalid Discord Webhook URL")
        return
    payload = json.dumps({'content': f"{message}", "embeds":embeds} )
    post_request(discord_webhook_url, payload, False)

def send_webhook(payload:str):
    # load json
    try:
        payload = json.loads(payload)
    except ValueError as err:
        pass
    # loop
    for webhook_url in webhook_urls:
        domain = extract_domain_name(webhook_url)
        if domain is None:
            log.warning(f"Send webhook failed.\nReason: invalid URL <{webhook_url}>\nContent: {payload}")
            continue
        currentTime = datetime.now()
        response = post_request(webhook_url, payload)
        time_used = (datetime.now()-currentTime).total_seconds() * 1000
        if (response.status_code == 200):
            log.ok(f"Webhook Sent!\n\nProcess Time: {time_used}ms\nDomain: {domain}\nFull URL: {webhook_url}\nContent: {payload}")
        else:
            log.error(f"Send webhook failed.\nReason: {response.text}\nStatus: {response.status_code}\n\nDomain: {domain}\nFull URL: {webhook_url}\nContent: {payload}")

def handler(pd: "pipedream"):
    global show_welcome_msg
    if not show_welcome_msg:
        log.info("You are GOOD to go!\n\n")
        show_welcome_msg = True

    # extract data from previous steps
    content = pd.steps["trigger"]["event"]["body"]["text"]
    from_email = pd.steps["trigger"]["event"]["headers"]["from"]["value"][0]["address"]

    if from_email in ["noreply@tradingview.com"]:
        send_webhook(content)```


问:
Replacing the session id then it is logging in
If there are two users Alice and Bob both logged in different browser,Now if i put alice's session id in bob's it is logging in.

I am using express-session in node.js but not able to fix the issue.If this happens it should go to login in page.


问:
Google Earth Engine Server-side authentication with a service account
I'm working on a react project which requires to use a Server-side authentication with a service account  and it says that i have to use OAuth, instead.

is there is any way to use GEE Api from react with a Server-side authentication?

I try this code :

```<code>import React from 'react'

const Satellite = () => {
    // Require client library and private key.
    var ee = require('@google/earthengine');
    var privateKey = require('./asset/filename.json');

    // Initialize client library and run analysis.
    var runAnalysis = function () {
        ee.initialize(null, null, function () {
            // ... run analysis ...
        }, function (e) {
            console.error('Initialization error: ' + e);
        });
    };

    // Authenticate using a service account.
    ee.data.authenticateViaPrivateKey(privateKey, runAnalysis, function (e) {
        console.error('Authentication error: ' + e);
    });

    return (
        <div>Hello to GEE</div>
    )
}

export default Satellite
</code>```

th output is :
enter image description here

Body:
I'm working on a react project which requires to use a Server-side authentication with a service account  and it says that i have to use OAuth, instead.

is there is any way to use GEE Api from react with a Server-side authentication?

I try this code :

import React from 'react'

const Satellite = () => {
    // Require client library and private key.
    var ee = require('@google/earthengine');
    var privateKey = require('./asset/filename.json');

    // Initialize client library and run analysis.
    var runAnalysis = function () {
        ee.initialize(null, null, function () {
            // ... run analysis ...
        }, function (e) {
            console.error('Initialization error: ' + e);
        });
    };

    // Authenticate using a service account.
    ee.data.authenticateViaPrivateKey(privateKey, runAnalysis, function (e) {
        console.error('Authentication error: ' + e);
    });

    return (

Hello to GEE

    )
}

export default Satellite

th output is :
enter image description here


问:
How to create long format data frame (specific example)
I wonder how i could transform this data frame:

To this kind of data frame:

I have tried it with melt functions but I can not get a correct solution.

Thanks in advance!


问:
Issue with tinyMCE textbox in High Contrast Themes (Aquatic and Desert themes)
We are using tinyMCE editor and we came across has the following issues in high contrast themes-

The icons associated with the format tool bar buttons like - arrow icons, table icons etc., are not clearly visible in high contrast themes.

On accessing the buttons of tiny toolbar using keyboard, the focus is not identifiable to the end user in high contrast themes.

Before entering anything in editor->table icon pops up->table icon not clearly visible in high contrast themes.

Formatting toolbar->after selecting rows and columns to create table and inserting table in editor->table properties popup not clearly visible.

Formatting toolbar->table->table properties->General tab->checkbox next to 'Show caption' not clearly visible.

The focus on dropdown items is not visible in high contrast themes.

Tried overwriting existing classes with custom styling but not able to cover all the themes available in Windows.


问:
operator() : Connection interrupted with Error='aws-c-common: AWS_ERROR_SYS_CALL_FAILURE, System call failure'
I am getting this error message whenever any sensor tries to send the data to AWS IOT endpoint.

The first error comes is :
operator() : Connection interrupted with Error='aws-c-common: AWS_ERROR_SYS_CALL_FAILURE, System call failure'

And then it start showing error messages continuously :
operator() : Connection interrupted with Error='libaws-c-mqtt: AWS_ERROR_MQTT_UNEXPECTED_HANGUP, The connection was closed unexpectedly.'
operator() : Connection resumed, sessionPresent=1

The error message does not show initially at first time when the data is sent to AWS IOT but afterwards it keeps on giving the errors

```<code>  auto onInterrupted = [&](Mqtt::MqttConnection &, int error) {
      SLOG_ERR("Connection interrupted with Error='%s'", ErrorDebugString(error));
    };
</code>```

Body:
I am getting this error message whenever any sensor tries to send the data to AWS IOT endpoint.

The first error comes is :
operator() : Connection interrupted with Error='aws-c-common: AWS_ERROR_SYS_CALL_FAILURE, System call failure'

And then it start showing error messages continuously :
operator() : Connection interrupted with Error='libaws-c-mqtt: AWS_ERROR_MQTT_UNEXPECTED_HANGUP, The connection was closed unexpectedly.'
operator() : Connection resumed, sessionPresent=1

The error message does not show initially at first time when the data is sent to AWS IOT but afterwards it keeps on giving the errors

  auto onInterrupted = [&](Mqtt::MqttConnection &, int error) {
      SLOG_ERR("Connection interrupted with Error='%s'", ErrorDebugString(error));
    };


问:
charging Mutheme While reloading takes time ( 1 sec )
I'm having a Fullstack application(.Net/Blazor)  , I'm trying to add Light/dark Mode and store the current mode in a localstorage, I already did all of that, but i'm facing a problem while opening my application for the first time (or even refreshing ) because it takes 1 sec delay to set the current theme then it works properly.

This is my OnInitializedAsync() function :

```<code>MudTheme _currentTheme = null;
  protected override async Task OnInitializedAsync()
    {
        _themeName = await localStorage.GetItemAsync<string>("CurrentTheme");
        Console.WriteLine(_themeName);
        if (_themeName.Equals("DarkTheme"))
        {
             _currentTheme= _darkTheme;
            var module = await _jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/ThemeChanging.js");
            await module.InvokeVoidAsync("setTheme", _themeName);
        }
        else
        {
            _currentTheme= _lightTheme;
            var module = await _jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/ThemeChanging.js");
            await module.InvokeVoidAsync("setTheme", _themeName);
        }
}
</code>```

I don't know why while refresing the page or opening it for the first time _currentTheme takes time to get its value(  _darkTheme, _lightTheme  ) , it takes null as its value( in the first 1 sec of reloading ) then it takes the correspond value(  _darkTheme, _lightTheme  ).

I added that GIF for more explication.

Any help please ?

Body:
I'm having a Fullstack application(.Net/Blazor)  , I'm trying to add Light/dark Mode and store the current mode in a localstorage, I already did all of that, but i'm facing a problem while opening my application for the first time (or even refreshing ) because it takes 1 sec delay to set the current theme then it works properly.

This is my OnInitializedAsync() function :

MudTheme _currentTheme = null;
  protected override async Task OnInitializedAsync()
    {
        _themeName = await localStorage.GetItemAsync<string>("CurrentTheme");
        Console.WriteLine(_themeName);
        if (_themeName.Equals("DarkTheme"))
        {
             _currentTheme= _darkTheme;
            var module = await _jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/ThemeChanging.js");
            await module.InvokeVoidAsync("setTheme", _themeName);
        }
        else
        {
            _currentTheme= _lightTheme;
            var module = await _jsRuntime.InvokeAsync<IJSObjectReference>("import", "./js/ThemeChanging.js");
            await module.InvokeVoidAsync("setTheme", _themeName);
        }
}

I don't know why while refresing the page or opening it for the first time _currentTheme takes time to get its value(  _darkTheme, _lightTheme  ) , it takes null as its value( in the first 1 sec of reloading ) then it takes the correspond value(  _darkTheme, _lightTheme  ).

I added that GIF for more explication.

Any help please ?


问:
Sending email through Salesforce in Microsoft Power Automate
I am facing some issues in sending emails via Salesforce: I am able to create a new record "Email Messages":

but although the email is created and visible in Salesforce, but the email is never sent to the recipients

Looking online, I found the we might use one standard actions "/services/data/vXX.X/actions/standard/emailSimple" to sent the email previously created.
Unfortunately I am not able to find this action in the list of the available actions for this connector.

Can you please help me to solve this issue using directly the Salesforce connector?
Thank you very much,
Roberto

Create and sending email through Salesforce


问:
Android Bluetooth Permission Variable Issue
error: cannot find symbol
android.Manifest.permission.BLUETOOTH_CONNECT
^
symbol:   variable BLUETOOTH_CONNECT
location: class permission

I tried both android.Manifest.permission.BLUETOOTH_CONNECT and Manifest.permission.BLUETOOTH_CONNECT same error on both

Am using

compileSdkVersion 31
buildToolsVersion '31.0.3'


问:
Sum only cells that contain notes/comments in Excel
I have several sheets included in an Excel file and I need to sum some cells, but ONLY the ones that contain notes/comments, those that are inserted with Shift + F2.

Each cell has a value, and they all have notes/comments, and each comment refers to a different product.

Excel itself has a function to find all the comments, whether from the worksheet or the entire archive. It helps, it returns me all the cells that contain the comment that I searched AND the values of the cell, however it does not add up all the values, and I need that.

How can I do it? Thanks!

I used Excel's native function to find values, which worked. However, it returns me a cell-by-cell report, and does not add up all the values.


问:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sveltejs/kit' imported from /var/task/.svelte-kit/vercel-tmp/index.js
I'm trying to deploy a sveltekit app to vercel with adapter-vercel. It's just a basic SPA app.

I've created a sveltekit app with:

```<code>npm create svelte@latest my-app
</code>```

package.json

```<code>"scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "preview": "vite preview",
    "test": "playwright test",
    "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
    "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"dependencies": {
    "@sveltejs/kit": "^1.0.0"
},
"devDependencies": {
    "@playwright/test": "^1.28.1",
    "@sveltejs/adapter-vercel": "^1.0.0",
    "@sveltejs/kit": "^1.0.0",
    "@typescript-eslint/eslint-plugin": "^5.45.0",
    "@typescript-eslint/parser": "^5.45.0",
    "eslint": "^8.28.0",
    "eslint-plugin-svelte3": "^4.0.0",
    "svelte": "^3.54.0",
    "svelte-check": "^2.9.2",
    "tslib": "^2.4.1",
    "typescript": "^4.9.3",
    "vite": "^4.0.0",
    "vitest": "^0.25.3"
}
</code>```

svelte.config.js

```<code>import { vitePreprocess } from '@sveltejs/kit/vite';
import vercel from '@sveltejs/adapter-vercel';

/** @type {import('@sveltejs/kit').Config} */
const config = {
    // Consult https://kit.svelte.dev/docs/integrations#preprocessors
    // for more information about preprocessors
    preprocess: vitePreprocess(),

    kit: {
        adapter: vercel({

        })
    }
};

export default config;
</code>```

When I try to deploy to vercel I am greeted with these messages in the Functions tab:

```<code>undefined   ERROR   Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sveltejs/kit' imported from /var/task/.svelte-kit/vercel-tmp/index.js
    at new NodeError (node:internal/errors:393:5)
    at packageResolve (node:internal/modules/esm/resolve:865:9)
    at moduleResolve (node:internal/modules/esm/resolve:958:20)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:909:12)
    at defaultResolve (node:internal/modules/esm/resolve:1173:79)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
RequestId: 1aff6783-3836-446a-99a9-2741ab5175a5 Error: Runtime exited with error: exit status 1
Runtime.ExitError
</code>```

These are my settings in Vercel:

```<code>Build Command:    npm run build

Output Directory: build

Install command: npm install

Development command:
</code>```

I have tested the following things:

I used to have in package.json this:

```<code>"@sveltejs/adapter-vercel": "next",
</code>```

Changed to this:

```<code>"@sveltejs/adapter-vercel": "^1.0.0",
</code>```

I added this to the root layout:

```<code>export const ssr = false;
</code>```

Body:
I'm trying to deploy a sveltekit app to vercel with adapter-vercel. It's just a basic SPA app.

I've created a sveltekit app with:

npm create svelte@latest my-app

package.json

"scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "preview": "vite preview",
    "test": "playwright test",
    "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
    "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"dependencies": {
    "@sveltejs/kit": "^1.0.0"
},
"devDependencies": {
    "@playwright/test": "^1.28.1",
    "@sveltejs/adapter-vercel": "^1.0.0",
    "@sveltejs/kit": "^1.0.0",
    "@typescript-eslint/eslint-plugin": "^5.45.0",
    "@typescript-eslint/parser": "^5.45.0",
    "eslint": "^8.28.0",
    "eslint-plugin-svelte3": "^4.0.0",
    "svelte": "^3.54.0",
    "svelte-check": "^2.9.2",
    "tslib": "^2.4.1",
    "typescript": "^4.9.3",
    "vite": "^4.0.0",
    "vitest": "^0.25.3"
}

svelte.config.js

import { vitePreprocess } from '@sveltejs/kit/vite';
import vercel from '@sveltejs/adapter-vercel';

/** @type {import('@sveltejs/kit').Config} */
const config = {
    // Consult https://kit.svelte.dev/docs/integrations#preprocessors
    // for more information about preprocessors
    preprocess: vitePreprocess(),

    kit: {
        adapter: vercel({

        })
    }
};

export default config;

When I try to deploy to vercel I am greeted with these messages in the Functions tab:

undefined   ERROR   Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sveltejs/kit' imported from /var/task/.svelte-kit/vercel-tmp/index.js
    at new NodeError (node:internal/errors:393:5)
    at packageResolve (node:internal/modules/esm/resolve:865:9)
    at moduleResolve (node:internal/modules/esm/resolve:958:20)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:909:12)
    at defaultResolve (node:internal/modules/esm/resolve:1173:79)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
RequestId: 1aff6783-3836-446a-99a9-2741ab5175a5 Error: Runtime exited with error: exit status 1
Runtime.ExitError

These are my settings in Vercel:

Build Command:    npm run build

Output Directory: build

Install command: npm install

Development command:

I have tested the following things:

I used to have in package.json this:

"@sveltejs/adapter-vercel": "next",

Changed to this:

"@sveltejs/adapter-vercel": "^1.0.0",

I added this to the root layout:

export const ssr = false;


问:
Can we provide AST as input to the clang?
file.c

```<code>#include <stdio.h>
#include <stdlib.h>

int main()
{
    int data;
    scanf("%d", &data);

    char *array = (char *)malloc(sizeof(char) * data);
    free(array);

    return 0;
}
</code>```
```<code>clang -Xclang -ast-dump file.c -shared -Xclang -ast-dump-filter=main > dumped-file.ast
</code>```

The above command will dump AST and print.

By adding -o pre-compiled-file.ast instead of output redirection, will generate a precompiled AST file.

```<code>clang -Xclang -ast-dump file.c -shared -Xclang -ast-dump-filter=main -o pre-compiled-file.ast
</code>```

Final Command to be run from the dumped AST:

```<code>clang --analyze -Xclang -analyzer-checker=alpha.security.taint.TaintPropagation dumped-file.ast
</code>```

The above command to be done from the dumped one but not from the pre-compiled AST file.

There's something missing between to be done. Can anyone help with this?

Body:
file.c

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int data;
    scanf("%d", &data);

    char *array = (char *)malloc(sizeof(char) * data);
    free(array);

    return 0;
}

clang -Xclang -ast-dump file.c -shared -Xclang -ast-dump-filter=main > dumped-file.ast

The above command will dump AST and print.

By adding -o pre-compiled-file.ast instead of output redirection, will generate a precompiled AST file.

clang -Xclang -ast-dump file.c -shared -Xclang -ast-dump-filter=main -o pre-compiled-file.ast

Final Command to be run from the dumped AST:

clang --analyze -Xclang -analyzer-checker=alpha.security.taint.TaintPropagation dumped-file.ast

The above command to be done from the dumped one but not from the pre-compiled AST file.

There's something missing between to be done. Can anyone help with this?


问:
How to reuse and keep the state of uncontrolled component across open/close state of responsive MUI drawer
Here is the problem. I have added the checkbox as a common component and stored it inside a variable to reuse later for the drawer component as well. The checkbox is uncontrolled, it means we are not managing the checked state. This is a simple and similar thing what I want to achieve. I want the checkbox to be in checked state if it's checked from drawer from mobile view, when returning to desktop view.

I made a simple demo of what I have currently. This is just clone of responsive drawer from their documentation. I have just replaced the content of drawer to just an uncontrolled checkbox.

Let me know if there is any way to keep the state of checkbox persistent across close and open state of drawer i.e, same state in mobile and desktop view.

Demo: https://codesandbox.io/s/material-demo-forked-2tosrb

Steps to reproduce:

Check the checkbox on left.

Decrease the screen size until hamburger (menu) icon is visible.

Click on the hamburger icon so the drawer will appear.

You can see that the checkbox is in unchecked state even we have used the same variable.

What I have tried:
Adding ModalProps={{ keepMounted: true }} to MUI drawer component. By the way I'm using v4 of MUI.

Expectation:
The checkbox state should be shared across both inside drawer and outside drawer as we are using the same variable who is storing the content of drawer.


问:
Neo4J Traversal for finding paths
I can't figure out how to describe a Cypher pattern using Traversal API.

If there are graphs:

```<code>(:nA {id: 1}} - [:rA] -> (:nB {id: 2}) - [:rB] -> (:nC {id: 3})
(:nA {id: 4}} - [:rB] -> (:nB {id: 5}) - [:rA] -> (:nC {id: 6})
(:nA {id: 7}} - [:rA] -> (:nB {id: 8}) - [:rB] -> (:nC {id: 9})
</code>```

and pattern

```<code>(:nA} - [:rA] -> (:nB) - [:rB] -> (:nC)
</code>```

with resutl

```<code>(:nA {id: 1}} - [:rA] -> (:nB {id: 2}) - [:rB] -> (:nC {id: 3})
(:nA {id: 7}} - [:rA] -> (:nB {id: 8}) - [:rB] -> (:nC {id: 9})
</code>```

How should TraversalDescription be described?

Title: Neo4J Traversal for finding paths

Body:
I can't figure out how to describe a Cypher pattern using Traversal API.

If there are graphs:

(:nA {id: 1}} - [:rA] -> (:nB {id: 2}) - [:rB] -> (:nC {id: 3})
(:nA {id: 4}} - [:rB] -> (:nB {id: 5}) - [:rA] -> (:nC {id: 6})
(:nA {id: 7}} - [:rA] -> (:nB {id: 8}) - [:rB] -> (:nC {id: 9})

and pattern

(:nA} - [:rA] -> (:nB) - [:rB] -> (:nC)

with resutl

(:nA {id: 1}} - [:rA] -> (:nB {id: 2}) - [:rB] -> (:nC {id: 3})
(:nA {id: 7}} - [:rA] -> (:nB {id: 8}) - [:rB] -> (:nC {id: 9})

How should TraversalDescription be described?


问:
Problems running InstaPy
I want to install instPy but every time I get errors. When I type in terminal python3 instagram.py I get this error:

```<code>RuntimeError: Error, unable to determine correct filename for 64bit macOS
</code>```

Can someone help me to solve this problem?

I went to the InstaPy website and did everything it said, but I still get this error. I searched on the internet and found this GitHub issue, which says:

You just have to find where webdriverdownloader.py is stored and change the line 320 into:

```<code>filename = [name for name in filenames if os_name + bitness in name and >name[-3:] != 'asc' ]
</code>```

I did it too but it does not work.

Title: Problems running InstaPy

Body:
I want to install instPy but every time I get errors. When I type in terminal python3 instagram.py I get this error:

RuntimeError: Error, unable to determine correct filename for 64bit macOS

Can someone help me to solve this problem?

I went to the InstaPy website and did everything it said, but I still get this error. I searched on the internet and found this GitHub issue, which says:

You just have to find where webdriverdownloader.py is stored and change the line 320 into:

filename = [name for name in filenames if os_name + bitness in name and >name[-3:] != 'asc' ]

I did it too but it does not work.