79507856

Date: 2025-03-13 23:26:36
Score: 1.5
Natty:
Report link

The currently-accepted answer (using "editor.formatOnSave": false) does not work for me, unfortunately.

I had to explicitly add yaml files to .prettierignore:

*.yaml
*.yml
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Sam Hinshaw

79507853

Date: 2025-03-13 23:23:36
Score: 1
Natty:
Report link

(improved version of https://stackoverflow.com/a/45319485/4557005 )

Override the EditText's onTextContextMenuItem, in older devices without pasteAsPlainText just do as AppCompatReceiveContentHelper.maybeHandleMenuActionViaPerformReceiveContent but forcing FLAG_CONVERT_TO_PLAIN_TEXT

  @Override
  public boolean onTextContextMenuItem(int id) {
    if (id == android.R.id.paste) {
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        id = android.R.id.pasteAsPlainText;
      } else if (ViewCompat.getOnReceiveContentMimeTypes(this) != null) {
        // older device, manually paste as plain text
        ClipboardManager cm = (ClipboardManager) getContext().getSystemService(
          Context.CLIPBOARD_SERVICE);
        ClipData clip = (cm == null) ? null : cm.getPrimaryClip();
        if (clip != null && clip.getItemCount() > 0) {
          ContentInfoCompat payload = new ContentInfoCompat.Builder(clip, ContentInfoCompat.SOURCE_CLIPBOARD)
            .setFlags(ContentInfoCompat.FLAG_CONVERT_TO_PLAIN_TEXT)
            .build();
          ViewCompat.performReceiveContent(this, payload);
        }
        return true;
      }
    }
    return super.onTextContextMenuItem(id);
  }
Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Asiel Diaz Benitez

79507841

Date: 2025-03-13 23:14:34
Score: 2
Natty:
Report link

for future brothers comes this topic about executing selenium as a service at linux vps with docker;

guys, dont forget, docker is NEW COMPUTER. if you have chromedriver on your computer , selenium uses at LOCAL.

but

if you are trying to dockerize application at vps , you HAVE TO create a DOCKERFILE and tell docker "HEY DOWNLOAD CHROME DRIVER FOR ME"

https://www.youtube.com/watch?v=gtGiS9FbOhE&lc=Ugw6znf0abkeBtyXs9d4AaABAg

im a turkish guy and i explained in 6 minutes.

if you download chrome-driver to your vps machine and dockerize app, still no working.

i hope someone can use this comment and fix his problem.

Reasons:
  • Blacklisted phrase (1): youtube.com
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: emirhankarakoc

79507838

Date: 2025-03-13 23:11:34
Score: 1
Natty:
Report link

You could try using a lambda function when binding your button:

new_card.clicked.connect(lambda _, x=card: self.click_card(x))

def click_card(self, card):
    print(f"I am {card}")

You need to be carefull with lambda function inside a for loop, that's why I've put x=card. The argument _ is just a placeholder for the regular argument to the "clicked" signal

https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QAbstractButton.html#PySide2.QtWidgets.PySide2.QtWidgets.QAbstractButton.clicked

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Geneviève Le Houx

79507813

Date: 2025-03-13 23:00:30
Score: 11.5 🚩
Natty: 5.5
Report link

Were you able to solve this issue?

Reasons:
  • Blacklisted phrase (1): you able to solve
  • RegEx Blacklisted phrase (1.5): solve this issue?
  • RegEx Blacklisted phrase (3): Were you able
  • Low length (2):
  • No code block (0.5):
  • Ends in question mark (2):
  • Single line (0.5):
  • Low reputation (1):
Posted by: user29973406

79507810

Date: 2025-03-13 22:58:29
Score: 0.5
Natty:
Report link

In your code, you have this line:

package_data={"test_package": ["**/*.pxd", "**/*.pxy"]},

Which is the cause of this problem. Changing it to

package_data={"test_package": ["**/*.pxd", "**/*.pyx"]},

Will use the pyx function and fix this issue.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Starship

79507795

Date: 2025-03-13 22:47:27
Score: 2
Natty:
Report link

if process.env doesn't works by changing in config. Use const VITE_YOUR_API_KEY = import.meta.env.VITE_YOUR_API_KEY Use the VITE_ for successfull configuration with Vite support. Add VITE_YOUR_API_KEY in .env and use it fearlessly with the import.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Zameer a Lucknowi

79507768

Date: 2025-03-13 22:31:24
Score: 2.5
Natty:
Report link

I found this code looking very helpful for me but I'm facing issue as this code in written in version 5, if you can convert it to version 6 with efficient and error free code compatible with version 6 this will be very helpful for me.

Thank You

Reasons:
  • Blacklisted phrase (0.5): Thank You
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Muneeb Tahir

79507765

Date: 2025-03-13 22:29:24
Score: 0.5
Natty:
Report link

The only reliable way I found to get away with this error is,

  1. Click the "User Switcher" icon on the top right corner in the Status bar

  2. Click "Login Window...", this will take you to the Lock screen

  3. Now login back using your credentials.

The only reason why it might be working is, when you follow above steps you are essentially killing all of your user processes and launching them back once you login back. So the process which is responsible for the timestamp might have been killed and restarted.

Let me know if this is working for you as well, or any better technical explanation.

enter image description here

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Trident

79507750

Date: 2025-03-13 22:16:21
Score: 4
Natty: 4.5
Report link

As of .NET 8.0, System.Data.SqlClient is obsolete. Instead, use Microsoft.Data.SqlClient.

https://techcommunity.microsoft.com/blog/sqlserver/announcement-system-data-sqlclient-package-is-now-deprecated/4227205

Reasons:
  • Probably link only (1):
  • Low length (1.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Trint

79507746

Date: 2025-03-13 22:15:21
Score: 3.5
Natty:
Report link

Im also experiencing this. I have been trying to re-format my YAML file in multiple ways, also tried to generate just a simple one with firebase-tools npm package's cli command firebase init + added some test secrets with cli tools too, but no luck. Any apphosting.yaml content is not applied to build process.

Reasons:
  • Blacklisted phrase (1): no luck
  • No code block (0.5):
  • Unregistered user (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Mika

79507738

Date: 2025-03-13 22:12:20
Score: 1
Natty:
Report link

This is exactly what you need: https://github.com/jab/bidict

It's mature and easy to use.

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • High reputation (-1):
Posted by: Andriy Makukha

79507734

Date: 2025-03-13 22:10:20
Score: 5
Natty: 5
Report link

I don't have an answer but how did you go about setting the "offset" to one for the second notebook?

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Ends in question mark (2):
  • Single line (0.5):
  • Low reputation (1):
Posted by: sklearning

79507731

Date: 2025-03-13 22:08:19
Score: 1
Natty:
Report link

2025 still running into this cryptic error message:

Can't connect to MySQL server on 'localhost' ([Errno 2] No such file or directory)")

I had 2 cloud run functions connecting to the same SQL instance, one working and the other getting that error message. The code was literally copy-paste from the working to the not-working.

The above link from @Josh Bloom gave me the idea to contrast "gcloud run services describe x" output and, sure enough, the working service had a "SQL connection" defined and the other didn't. I added the missing connection in the console and the bad guy started working.

What gives? I generated both these cloud run functions from the same laptop, with the same "gcloud functions deploy" and the same exact code copy-pasted.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @Josh
  • Low reputation (0.5):
Posted by: Yanay Lehavi

79507723

Date: 2025-03-13 22:05:18
Score: 1
Natty:
Report link

All the answers helped me with the problem. I did run gem update, and concurrent-ruby was updated to 1.3.5

I did run

gem install concurrent-ruby -v 1.3.4

then

gem uninstall concurrent-ruby -v 1.3.5

Cocoapods come back to the life

Reasons:
  • Low length (0.5):
  • No code block (0.5):
Posted by: Ronaldo Albertini

79507702

Date: 2025-03-13 21:53:14
Score: 1.5
Natty:
Report link

enter code hereWhen we inherit by extension we call the Shape() in the Rectabgle constructor. to decouple their prototypal chains we say Rectangle.prototype = Object.create(Shape.prototype)

lastly Rectangle.prototype.constructor = Rectangle;


function Rectangle ( x, y ) {
Shape.cali(this)  
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): When we in
  • Low reputation (1):
Posted by: user3440335

79507678

Date: 2025-03-13 21:38:11
Score: 0.5
Natty:
Report link

Drawing on this conversation, I was able to resolve the issue on the author's GitHub page as follows:

    ---
    output: 
        pdf_document:
    header-includes:
      - \usepackage{tabularray}
    ---
    
    ```{=latex}
    \DefTblrTemplate{firsthead,middlehead,lasthead}{default}{}
    \DefTblrTemplate{firstfoot,middlefoot}{default}{}
    \DefTblrTemplate{lastfoot}{default}% 
    {
      \UseTblrTemplate{caption}{default}
    }
    ```
    
    ```{r, echo=FALSE}
    library(modelsummary)
    library(tinytable)
    mod <- list()
    mod[['One variable']] <- lm(mpg ~ hp, mtcars)
    mod[['Two variables']] <- lm(mpg ~ hp + drat, mtcars)
    
    modelsummary(mod,
                  title = "Regression Models")|>
      style_tt(tabularray_outer = "label={tblr:test}")
    ```
    
    Table \ref{tblr:test}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Florian Reiche

79507673

Date: 2025-03-13 21:36:11
Score: 2
Natty:
Report link

I found the problem. I started changing things around according to mykaf's suggestion and realized that I had a tag at the top of the included file. I don't know why but this caused the problem. I remove it and the original code worked fine. Thanks so much for the help.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Low length (0.5):
  • No code block (0.5):
  • Self-answer (0.5):
Posted by: user460114

79507664

Date: 2025-03-13 21:28:09
Score: 0.5
Natty:
Report link

Not only can you move rows down, you can also move rows up. So instead of deleting a certain number of rows, you can use move_range with translate=True to move everything coming after the to be deleted rows up by the same amount and have the the relative references in formulae adapted.

Reasons:
  • Whitelisted phrase (-1.5): you can use
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Sandy Hope

79507657

Date: 2025-03-13 21:25:08
Score: 2.5
Natty:
Report link

(treat this as a comment ı don't have 50+ reputation) ı was using gizmos for debugging raycasts it is good to visually see the rays, make it change color based on some conditions etc.

Gizmos.DrawLine(transform.position, target.position);
Reasons:
  • RegEx Blacklisted phrase (1.5): reputation
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: stan oref

79507656

Date: 2025-03-13 21:24:08
Score: 1.5
Natty:
Report link

thanks to @Rishard i tried to custom the endpoint by add this code in WP snippet

add_filter('woocommerce_rest_prepare_product_object', function ($response, $product, $request) {
    if (!empty($response->data['attributes'])) {
        foreach ($response->data['attributes'] as &$attribute) {
            if (!empty($attribute['options'])) {
                $options_with_ids = [];
                foreach ($attribute['options'] as $option) {
                    $term = get_term_by('name', $option, $attribute['slug']);
                    if ($term) {
                        $options_with_ids[] = [
                            'id' => $term->term_id,
                            'name' => $term->name
                        ];
                    } else {
                        $options_with_ids[] = [
                            'id' => null,
                            'name' => $option
                        ];
                    }
                }
                $attribute['options'] = $options_with_ids;
            }
        }
    }
    return $response;
}, 10, 3);

now to response is

{
                "id": 7,
                "name": "Size",
                "slug": "pa_size",
                "position": 4,
                "visible": true,
                "variation": true,
                "options": [
                    {
                        "id": 123,
                        "name": "L"
                    },
                    {
                        "id": 138,
                        "name": "XL"
                    }
                ]
            }
Reasons:
  • Blacklisted phrase (0.5): thanks
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Rishard
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Mohamed Sabry

79507647

Date: 2025-03-13 21:20:08
Score: 1.5
Natty:
Report link

@Szymon Stepniak mentions about the map key names being the stage names is incorrect. They're called branch names. They seem relatively unimportant, except for the backend to identify them.

If you run that code it's all nested under the parent stage, "Run"

If you run the below code, you will see they now have individual stages.

def somefunc() {
    stage("Echo1 Stage") {
        echo 'echo1'
    }
}

def somefunc2() {
    stage("Echo2 Stage") {
        echo 'echo2'
    }
}
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @mentions
  • Low reputation (1):
Posted by: Timothy Eggers

79507643

Date: 2025-03-13 21:18:07
Score: 2
Natty:
Report link

i fixed the issue by adding the needed events into a pareload.

Reasons:
  • Whitelisted phrase (-2): i fixed
  • Low length (1.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: MrWhoSBOSS

79507642

Date: 2025-03-13 21:17:07
Score: 0.5
Natty:
Report link

I would go with the basic way:
EDIT: fixed code formatting to return None outside of loop

for key, sets_list in d.items():
        for sets in sets_list:
            if target_number in sets:
                return key
return None
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Eric Formo

79507635

Date: 2025-03-13 21:14:06
Score: 2
Natty:
Report link

Read the documentation. There are almost all the answers there.
https://codeigniter4.github.io/userguide/libraries/validation.html#redirect-and-validation-errors

Add helper(['form']); in Home::index and use in template validation_show_error('username')

There are no property of $this->validation, there is a $this->validator but it is created after the validate() call.

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: ozornick

79507633

Date: 2025-03-13 21:13:05
Score: 3.5
Natty:
Report link
Hello, I'm using a translator for English:

Hello, I have the same problem and have been working on it for a few days now. Here's my suggested solution:

Arduino IDE
Use Board Manager:
ESP32 from Espressif version 3.1.0 or lower!

Then it might work. But please don't ask me why.

Greetings from Berlin
Reasons:
  • Blacklisted phrase (1): I have the same problem
  • Blacklisted phrase (1): days now
  • Whitelisted phrase (-2): solution:
  • Low length (0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I have the same problem
  • Low reputation (1):
Posted by: LDN001

79507623

Date: 2025-03-13 21:05:03
Score: 2
Natty:
Report link

Also, you can try installing/updating your project packages: npm install.

Reasons:
  • Low length (1.5):
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: DavidC

79507617

Date: 2025-03-13 21:02:03
Score: 1.5
Natty:
Report link

So I've researched this on several occasions (more than I should, admittedly) and the most accurate/common definitions I've found are:

Fault - actual line of code that causes the error
Error - incorrect internal state (manifestation of the fault)
Failure - what the program does wrong as a result of the fault/error

Here's an image with an example

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: TrustKibou

79507609

Date: 2025-03-13 20:58:02
Score: 3
Natty:
Report link

I'm having the same problem 'Undefined variable $payment' even using Livewire\Volt\Component'

<?php

use Livewire\Volt\Component;

new class extends Component
{
    public string $payment = 'cc'; 

    public function subscription()
    {
        //TODO
    }
    
}

?>
<x-layouts.app :title="__('Subscription')">
    <form wire:submit="subscription" class="flex flex-col gap-6">
        
        <flux:select size="sm" wire:model.live="payment" :label="__('Select your payment method')">
            <flux:select.option value="cc">{{ __('Credit Card') }}</flux:select.option>
            <flux:select.option value="pix">Pix</flux:select.option>
        </flux:select>

        @if ($payment === 'cc')
            <div wire:key="credit-card-fields">
                <label for="card-number">Número do Cartão</label>
                <input type="text" id="card-number" name="card_number" placeholder="Número do Cartão">

                <label for="card-holder">Nome do Titular</label>
                <input type="text" id="card-holder" name="card_holder" placeholder="Nome do Titular">

                <label for="card-expiry">Data de Expiração</label>
                <input type="text" id="card-expiry" name="card_expiry" placeholder="MM/AA">
            </div>
        @endif
       
        @if ($payment === 'pix')
            <div wire:key="pix-details" class="pix-details">
                <p>Escolha a opção Pix para realizar o pagamento.</p>
            </div>
        @endif

        <button type="submit">Assinar</button>
    </form>
</x-layouts.app>
Reasons:
  • Blacklisted phrase (1): I'm having the same problem
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): I'm having the same problem
  • Low reputation (1):
Posted by: joaovictormramos

79507605

Date: 2025-03-13 20:57:01
Score: 3
Natty:
Report link

Maybe I am 2 years behind and late but what theme are you using in VSCODE yours seems very nice!

Thank you!

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Scemi

79507571

Date: 2025-03-13 20:41:58
Score: 2.5
Natty:
Report link

The same article now says.

Tip

There is no limit to how many repositories you can index.

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Muhammad Khuzaima Umair

79507559

Date: 2025-03-13 20:35:57
Score: 3
Natty:
Report link
header 1 header 2
cell 1 cell 2
cell 3 cell 4
Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Ms Nupur

79507556

Date: 2025-03-13 20:31:56
Score: 4
Natty:
Report link

I tried this solution but when I did it and I reload the page, my app is trying to save the page in my downloads, I'm not sure exactly why is happening, so I changed a little bit the config to only get the .mjs files, but then I'm getting new errorsenter image description here

And the errors are: enter image description here

Reasons:
  • RegEx Blacklisted phrase (1): I'm getting new error
  • Probably link only (1):
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Javier Torres

79507546

Date: 2025-03-13 20:26:54
Score: 1.5
Natty:
Report link

Here is the answer that worked, thank you very much for your help

SELECT ROW_NUMBER() OVER(PARTITION BY SomeVal ORDER by case when SomeVal IS NULL THEN 1 ELSE 0 END)
Reasons:
  • Blacklisted phrase (0.5): thank you
  • Low length (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: James

79507542

Date: 2025-03-13 20:25:54
Score: 2
Natty:
Report link

DOH...This turns out to be an SELinux configuraiton issue.

I found that by 'sudo setenforce 0' allows the file to load properly.

Now I just have to get my system administrator to adjust the SELinux config.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: user2379881

79507536

Date: 2025-03-13 20:21:53
Score: 3
Natty:
Report link

I am not sure if this helps but I tried to install tabulizer from ropensci but it did not work. tabulizerjars installed and so did tabulapdf. However, it seems more work than it is worth. I have instead gone with the pdftools and tesseract (ocr) packages and those seem to work well enough. I am using a M1 Mac with RStudio Version 2024.12.1+563 (2024.12.1+563) and mac OS Sequoia 15.3.1.

Reasons:
  • Blacklisted phrase (1): did not work
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Haraldur Karlsson

79507529

Date: 2025-03-13 20:18:52
Score: 0.5
Natty:
Report link

According to documentation you should not invoke flush after every change to an entity or every single invocation of persist/remove/... This is an anti-pattern and unnecessarily reduces the performance of your application. Instead, form units of work that operate on your objects and call flush when you are done. While serving a single HTTP request there should be usually no need for invoking flush more than 0-2 times.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Borys

79507525

Date: 2025-03-13 20:16:52
Score: 2.5
Natty:
Report link

in tailwind 4 the breakpoints handle this way:

Breakpoint prefix Minimum width CSS sm 40rem (640px)

@media (**width >= 40rem**) { ... }

md 48rem (768px)

@media (**width >= 48rem**) { ... }

lg 64rem (1024px)

@media (**width >= 64rem**) { ... }

xl 80rem (1280px)

@media (**width >= 80rem**) { ... }

2xl 96rem (1536px)

@media (**width >= 96rem**) { ... }

but these media query works just on iphone safari 16.4 to up !

it must be such this (such as past tailwind version (3)):

@media (**min-width: 640px**) { ... }

how to handle these?!

but i do not know how to fix this entirely in tailwind!

Reasons:
  • RegEx Blacklisted phrase (2): i do not know how to fix
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: abol

79507524

Date: 2025-03-13 20:16:52
Score: 4
Natty:
Report link

Seeing the "Office script service is unreachable" message myself. Script will not run.

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: user29973116

79507518

Date: 2025-03-13 20:13:48
Score: 6 🚩
Natty:
Report link

I am having the same issue, but there is only 2 parameters not 3, and I can't use the importrange because I don't want all of the data, and I want it to sort alphabet order when it pulls in

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Low length (0.5):
  • No code block (0.5):
  • Me too answer (2.5): I am having the same issue
  • Single line (0.5):
  • Low reputation (1):
Posted by: Deb Brown

79507517

Date: 2025-03-13 20:13:48
Score: 3.5
Natty:
Report link

You can only group join to two tables, so you would need to call group join twice.

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Chad

79507512

Date: 2025-03-13 20:11:48
Score: 1.5
Natty:
Report link

Using VS 2022, I attempted to use Wix Toolset 5.0.4 and it wouldn't add it to my Windows Service project.

I just ran installutil in the Developer command prompt as Administrator.

Using an installer didn't work either.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Jeff Binnig

79507506

Date: 2025-03-13 20:09:47
Score: 4
Natty:
Report link

Answer: WHERE (ColumnName) IS NOT NULL

Reasons:
  • Low length (2):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Liam

79507504

Date: 2025-03-13 20:08:47
Score: 2
Natty:
Report link

Update, this is not working anymore.

https://learn.microsoft.com/en-us/answers/questions/2201920/bing-news-search

"Here the error message indicates that new deployments of Bing Search v7 API are no longer available. Instead, Microsoft has introduced a new product called "Grounding with Bing Search", which integrates with LLMs to provide search results"

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Alex Oliveira

79507498

Date: 2025-03-13 20:04:45
Score: 0.5
Natty:
Report link

In your action, flexform-settings are available via `$this->settings`. Just pass your limit to the called method of your repository: `ItemRepository->findAllFilteredByXy($xy, $this->settings['limit'])`

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Single line (0.5):
  • High reputation (-1):
Posted by: Julian Hofmann

79507493

Date: 2025-03-13 20:02:45
Score: 4.5
Natty: 4
Report link

I did face the same issue with the error "The server is unwilling to process the request"

But in my case it was throwing an error, while creating a New Organizational Unit.

This article help me and it worked for me: https://techijack.com/fixing-the-server-is-unwilling-to-process-the-request/

Reasons:
  • Blacklisted phrase (1): This article
  • Blacklisted phrase (1): help me
  • Whitelisted phrase (-1): it worked
  • Whitelisted phrase (-1): worked for me
  • Low length (0.5):
  • No code block (0.5):
  • Me too answer (2.5): face the same issue
  • Low reputation (1):
Posted by: Rohit

79507488

Date: 2025-03-13 19:59:44
Score: 1.5
Natty:
Report link

Yes I faced similar issue today, and there is a compatibility issue between python3.13 and odoo, especially odoo dependencies (as you stated greenlet, lxml, Pillow).

You should use python3.12

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: awasi

79507487

Date: 2025-03-13 19:59:44
Score: 3
Natty:
Report link

There is no emulator for DPL viewing.

Reasons:
  • Low length (2):
  • No code block (0.5):
  • Single line (0.5):
Posted by: Elton Saunders

79507485

Date: 2025-03-13 19:57:43
Score: 1
Natty:
Report link

Even if @scanny is right and there is a long discussion about python_pptx slide duplication, there are a lot of gist suggesting good partial solution.

Indeed, copying slides is not just duplicating the xml but it requires to rebuild complex entities like charts (by ref), thus it a little more complete and fixed solution can be this:

def _object_rels(obj):
    rels = obj.rels

    # Change required for python-pptx 0.6.22
    check_rels_content = [k for k in rels]
    if isinstance(check_rels_content.pop(), str):
        return [v for k, v in rels.items()]
    else:
        return [k for k in rels]


def _exp_add_slide(ppt, slide_layout):
    """
    Function to handle slide creation in the Presentation, to avoid issues caused by default implementation.

    :param slide_layout:
    :return:
    """

    def generate_slide_partname(self):
        """Return |PackURI| instance containing next available slide partname."""
        from pptx.opc.packuri import PackURI

        sldIdLst = self._element.get_or_add_sldIdLst()

        existing_rels = [k.target_partname for k in _object_rels(self)]
        partname_str = "/ppt/slides/slide%d.xml" % (len(sldIdLst) + 1)

        while partname_str in existing_rels:
            import random
            import string

            random_part = ''.join(random.choice(string.ascii_letters) for i in range(2))
            partname_str = "/ppt/slides/slide%s%d.xml" % (random_part, len(sldIdLst) + 1)

        return PackURI(partname_str)

    def add_slide_part(self, slide_layout):
        """
        Return an (rId, slide) pair of a newly created blank slide that
        inherits appearance from *slide_layout*.
        """
        from pptx.opc.constants import RELATIONSHIP_TYPE as RT
        from pptx.parts.slide import SlidePart

        partname = generate_slide_partname(self)
        slide_layout_part = slide_layout.part
        slide_part = SlidePart.new(partname, self.package, slide_layout_part)
        rId = self.relate_to(slide_part, RT.SLIDE)
        return rId, slide_part.slide

    def add_slide_ppt(self, slide_layout):
        rId, slide = add_slide_part(self.part, slide_layout)
        slide.shapes.clone_layout_placeholders(slide_layout)
        self._sldIdLst.add_sldId(rId)
        return slide

    # slide_layout = self.get_master_slide_layout(slide_layout)
    return add_slide_ppt(ppt.slides, slide_layout)


def copy_shapes(source, dest):
    """
    Helper to copy shapes handling edge cases.

    :param source:
    :param dest:
    :return:
    """
    from pptx.shapes.group import GroupShape
    import copy

    # Copy all existing shapes
    for shape in source:
        if isinstance(shape, GroupShape):
            group = dest.shapes.add_group_shape()
            group.name = shape.name
            group.left = shape.left
            group.top = shape.top
            group.width = shape.width
            group.height = shape.height
            group.rotation = shape.rotation

            # Recursive copy of contents
            copy_shapes(shape.shapes, group)

            # Fix offset
            cur_el = group._element.xpath(".//p:grpSpPr")[0]
            ref_el = shape._element.xpath(".//p:grpSpPr")[0]
            parent = cur_el.getparent()
            parent.insert(
                parent.index(cur_el) + 1,
                copy.deepcopy(ref_el)
            )
            parent.remove(cur_el)

            result = group
        elif hasattr(shape, "image"):
            import io

            # Get image contents
            content = io.BytesIO(shape.image.blob)
            result = dest.shapes.add_picture(
                content, shape.left, shape.top, shape.width, shape.height
            )
            result.name = shape.name
            result.crop_left = shape.crop_left
            result.crop_right = shape.crop_right
            result.crop_top = shape.crop_top
            result.crop_bottom = shape.crop_bottom
        elif hasattr(shape, "has_chart") and shape.has_chart:
            from .charts import clone_chart
            result = clone_chart(shape, dest)
        else:
            import copy

            newel = copy.deepcopy(shape.element)
            dest.shapes._spTree.insert_element_before(newel, "p:extLst")
            result = dest.shapes[-1]


def duplicate_slide(ppt, slide_index: int):
    """
    Duplicate the slide with the given number in presentation.
    Adds the new slide by default at the end of the presentation.

    :param ppt:
    :param slide_index: Slide number
    :return:
    """
    source = ppt.slides[slide_index]

    dest = _exp_add_slide(ppt, source.slide_layout)

    # Remove all shapes from the default layout
    for shape in dest.shapes:
        remove_shape(shape)

    # Copy all existing shapes
    # is_duplication removed cause it is deprecated here
    copy_shapes(source.shapes, dest)

    # Copy all existing shapes
    if source.has_notes_slide:
        txt = source.notes_slide.notes_text_frame.text
        dest.notes_slide.notes_text_frame.text = txt

    return dest

def remove_shape(shape):
    """
    Helper to remove a specific shape.

    :source: https://stackoverflow.com/questions/64700638/is-there-a-way-to-delete-a-shape-with-python-pptx

    :param shape:
    :return:
    """
    el = shape.element  # --- get reference to XML element for shape
    el.getparent().remove(el)  # --- remove that shape element from its tree
Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @scanny
  • Low reputation (0.5):
Posted by: Deleter

79507484

Date: 2025-03-13 19:56:41
Score: 8.5 🚩
Natty:
Report link

I am using the same model and have ended up in the same question. Did you get an answer?

Reasons:
  • RegEx Blacklisted phrase (3): Did you get an answer
  • Low length (1.5):
  • No code block (0.5):
  • Ends in question mark (2):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Mushruff S

79507483

Date: 2025-03-13 19:55:40
Score: 1
Natty:
Report link

Even if @Saleh is right, there are a lot of gist suggesting good partial solution.

Indeed, copying slides is not just duplicating the xml but it requires to rebuild complex entities like charts (by ref), thus it a little more complete and fixed solution can be this:

def _object_rels(obj):
    rels = obj.rels

    # Change required for python-pptx 0.6.22
    check_rels_content = [k for k in rels]
    if isinstance(check_rels_content.pop(), str):
        return [v for k, v in rels.items()]
    else:
        return [k for k in rels]


def _exp_add_slide(ppt, slide_layout):
    """
    Function to handle slide creation in the Presentation, to avoid issues caused by default implementation.

    :param slide_layout:
    :return:
    """

    def generate_slide_partname(self):
        """Return |PackURI| instance containing next available slide partname."""
        from pptx.opc.packuri import PackURI

        sldIdLst = self._element.get_or_add_sldIdLst()

        existing_rels = [k.target_partname for k in _object_rels(self)]
        partname_str = "/ppt/slides/slide%d.xml" % (len(sldIdLst) + 1)

        while partname_str in existing_rels:
            import random
            import string

            random_part = ''.join(random.choice(string.ascii_letters) for i in range(2))
            partname_str = "/ppt/slides/slide%s%d.xml" % (random_part, len(sldIdLst) + 1)

        return PackURI(partname_str)

    def add_slide_part(self, slide_layout):
        """
        Return an (rId, slide) pair of a newly created blank slide that
        inherits appearance from *slide_layout*.
        """
        from pptx.opc.constants import RELATIONSHIP_TYPE as RT
        from pptx.parts.slide import SlidePart

        partname = generate_slide_partname(self)
        slide_layout_part = slide_layout.part
        slide_part = SlidePart.new(partname, self.package, slide_layout_part)
        rId = self.relate_to(slide_part, RT.SLIDE)
        return rId, slide_part.slide

    def add_slide_ppt(self, slide_layout):
        rId, slide = add_slide_part(self.part, slide_layout)
        slide.shapes.clone_layout_placeholders(slide_layout)
        self._sldIdLst.add_sldId(rId)
        return slide

    # slide_layout = self.get_master_slide_layout(slide_layout)
    return add_slide_ppt(ppt.slides, slide_layout)


def copy_shapes(source, dest):
    """
    Helper to copy shapes handling edge cases.

    :param source:
    :param dest:
    :return:
    """
    from pptx.shapes.group import GroupShape
    import copy

    # Copy all existing shapes
    for shape in source:
        if isinstance(shape, GroupShape):
            group = dest.shapes.add_group_shape()
            group.name = shape.name
            group.left = shape.left
            group.top = shape.top
            group.width = shape.width
            group.height = shape.height
            group.rotation = shape.rotation

            # Recursive copy of contents
            copy_shapes(shape.shapes, group)

            # Fix offset
            cur_el = group._element.xpath(".//p:grpSpPr")[0]
            ref_el = shape._element.xpath(".//p:grpSpPr")[0]
            parent = cur_el.getparent()
            parent.insert(
                parent.index(cur_el) + 1,
                copy.deepcopy(ref_el)
            )
            parent.remove(cur_el)

            result = group
        elif hasattr(shape, "image"):
            import io

            # Get image contents
            content = io.BytesIO(shape.image.blob)
            result = dest.shapes.add_picture(
                content, shape.left, shape.top, shape.width, shape.height
            )
            result.name = shape.name
            result.crop_left = shape.crop_left
            result.crop_right = shape.crop_right
            result.crop_top = shape.crop_top
            result.crop_bottom = shape.crop_bottom
        elif hasattr(shape, "has_chart") and shape.has_chart:
            from .charts import clone_chart
            result = clone_chart(shape, dest)
        else:
            import copy

            newel = copy.deepcopy(shape.element)
            dest.shapes._spTree.insert_element_before(newel, "p:extLst")
            result = dest.shapes[-1]


def duplicate_slide(ppt, slide_index: int):
    """
    Duplicate the slide with the given number in presentation.
    Adds the new slide by default at the end of the presentation.

    :param ppt:
    :param slide_index: Slide number
    :return:
    """
    source = ppt.slides[slide_index]

    dest = _exp_add_slide(ppt, source.slide_layout)

    # Remove all shapes from the default layout
    for shape in dest.shapes:
        remove_shape(shape)

    # Copy all existing shapes
    # is_duplication removed cause it is deprecated here
    copy_shapes(source.shapes, dest)

    # Copy all existing shapes
    if source.has_notes_slide:
        txt = source.notes_slide.notes_text_frame.text
        dest.notes_slide.notes_text_frame.text = txt

    return dest

def remove_shape(shape):
    """
    Helper to remove a specific shape.

    :source: https://stackoverflow.com/questions/64700638/is-there-a-way-to-delete-a-shape-with-python-pptx

    :param shape:
    :return:
    """
    el = shape.element  # --- get reference to XML element for shape
    el.getparent().remove(el)  # --- remove that shape element from its tree
Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Saleh
  • Low reputation (0.5):
Posted by: Deleter

79507479

Date: 2025-03-13 19:54:40
Score: 0.5
Natty:
Report link

To insert a newline in the email body, you should use the URL-encoded value for a newline, typically %0A (or %0D%0A for a carriage return plus newline).

<a href="mailto:name[pxrp]domainname?subject=Reaction&body=First row%0ASecond row">Your reaction</a><br>
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Emad Kerhily

79507474

Date: 2025-03-13 19:50:39
Score: 1
Natty:
Report link

Try looking at SEQUENCE


CREATE SEQUENCE member_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
CACHE 1;

And you can get the next id:

SELECT nextval('member_id_seq');
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Андрей

79507471

Date: 2025-03-13 19:49:38
Score: 4.5
Natty:
Report link

UPDATED ANSWER: Use Detect-It-Easy

enter image description here

Reasons:
  • Probably link only (1):
  • Low length (2):
  • No code block (0.5):
  • Has no white space (0.5):
  • Single line (0.5):
Posted by: Alon Alush

79507440

Date: 2025-03-13 19:33:35
Score: 1
Natty:
Report link

I managed to write a new routine that implements 32x32=64 bit multiplication using the shift and add with double register method. If multiplier lsb is 1 add multiplicand to high 32bit register then shift right high result & low result register 1 bit. If multiplier lsb is 0 shift the result high & low result register right 1 bit. Also shift right 1 bit the multiplier. This above process repeated 32 times. When multiplicand is added to the high result if carry occurs 1 is ORed to the MSB of the carry register. During shifting carry register, result_hi register, result_lo is shifted as a block towards right by 1 bit each time. This is the final code and works for the previous value 0xffffffff X 0x19 = 0x18ffffffe7. Thanks to everybody for the support

.data 
result_lo: .word 0
result_hi: .word 0
modulo:    .word 0



.text
 li a1,0xffffffff       # multiplicand
 li a2,0x19         # multiplier
 li a3,0x00000000       # result_lo
 li a4,0x00000000       # result_hi
 li a5,0            # working register 
 




    li x5,32        # number of bits to be tested/counter
loop:
    mv x3,a2        # copy multiplier to test lsb 1 or 0
    andi x3,x3,1        # extract lsb in x3
    bnez x3,addnshift1  # if x3 is 1 branch to add and shift
    call shift      # if x3 is 0 call routine to shift result hi and lo + carry register right
    addi x5,x5,-1       # decrease counter
    bnez x5,loop        # if counter is not 0 go to label loop
    slli t6,t6,1        # if counter is 0, shift carry register left 1 time ( i dont know why but corrects answer)
    j exit          # exit multiplication procedure
addnshift1:
    call addnshift      # call addnshift routine to add multiplicand to result_hi and shift both result_hi & result_lo
    addi x5,x5,-1       # decrease counter
    bnez x5,loop        # if counter is more than 0 branch to label loop
    slli t6,t6,1        # if counter is 0, shift carry register left 1 time ( i dont know why but corrects answer)
    j exit          # exit multiplication procedure



shift:
    srli a2,a2,1        # multiplier right shift, 1 lsb lost
    srli a3,a3,1        # 2n low register(a3) right shift and 0 in msb (a4:a3)
    mv x4,a4        # a copy of high 2n register(a4) to x4 (a4:a3)
    andi x4,x4,1        # copy lsb of a4 high 2n register
    beqz x4,lsb0        # if lsb extracted is 0 , branch to lsb0 label
    li x4,0x80000000    # if lsb of a4 was 1
    or a3,a3,x4     # lsb of a4 now in msb of a3. (a4:a3 >> 1)
lsb0:
    srli a4,a4,1        # 2n high register right shift ,same as 0 shifted between a4 to a3 >>
    srli t6,t6,1        # shift right carry register together with a4:a3
    ret         # return to main program


addnshift:
    add a4,a4,a1        # add multiplicand to high 2n register
    sltu x8 a4,a1       # set x8 to 1 if result of addition (a4 + a1) answer_hi and multiplicand
    bnez x8,setcarry    # if x8 is not 0 , branch to setcarry label
return:
    srli a2,a2,1        # multiplier right shift
    srli a3,a3,1        # 2n low register right shift and 0 in msb
    mv x4,a4        # a copy of lw 2n
    andi x4,x4,1        # copy lsb of a4 high 2n register
    beqz x4,addlsb0     # if lsb extracted is 0 , branch to addlsb0 label 
    li x4,0x80000000    # if lsb of a4 was 1
    or a3,a3,x4     # lsb of a4 now in msb of a3. (a4:a3 >> 1)
addlsb0:
    srli a4,a4,1        # 2n high register right shift
    srli t6,t6,1        # shift right carry register together with a4:a3
    ret         # return to main program
setcarry:
    li x7,0x80000000    # set msb of x7 with 0x80000000
    or t6,t6,x7     # set msb of x7 by oring t6 with x7
    j return        # jump to shifting routine

exit:
    beqz t6,nocarry     # if t6 is not set , 0 , no overflow occurred, branch to nocarry
    mv a4,t6        # if carry set , copy t6 to answer hi register
nocarry:
    la a0,result_hi     # 
    sw a4,0(a0)     # save to data section
    la a0,result_lo
    sw a3,0(a0)     # save to data section
end:
    j end
 

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Filler text (0.5): ffffffff
  • Low reputation (1):
Posted by: sajeev sankaran

79507438

Date: 2025-03-13 19:32:34
Score: 1.5
Natty:
Report link

For me the following query works without a problem:

SELECT <col1>, <col2>, <col3> 
FROM `tablename`
where date like "2025-03-06%"
limit 20
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Stephan Georgiev

79507431

Date: 2025-03-13 19:29:33
Score: 1
Natty:
Report link

Nowadays toPromise method is being deprecated, so it's better to use firstValueFrom:

import { firstValueFrom } from 'rxjs';
return await firstValueFrom(this.store);
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Artico

79507428

Date: 2025-03-13 19:28:33
Score: 1
Natty:
Report link
=IIf(Fields!absenteeismPercentage.Value < 5, "Green", 
    IIf(Fields!absenteeismPercentage.Value >= 5 And Fields!absenteeismPercentage.Value < 9, "Yellow", 
        IIf(Fields!absenteeismPercentage.Value >= 9 And Fields!absenteeismPercentage.Value <= 10, "Red", "Black")))
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: stan oref

79507418

Date: 2025-03-13 19:20:31
Score: 1
Natty:
Report link

Unfortunately, this is a known wish request(FORMS-9678) and there is no Webhook event for Forms at this moment. But if you can provide more business scenario that would help a lot for our engineering team to prioritize this wish.

About the 3LO, yes, Forms support 3LO only, if you want pure automation without user interact, please hold on, we are working on a new feature which could support you to use 3LO without user interaction, but it's still not ready yet at this moment(2025/3/13), if you are urgent to try that, please contact us directly for more details.

Reasons:
  • RegEx Blacklisted phrase (2): urgent
  • Long answer (-0.5):
  • No code block (0.5):
  • High reputation (-1):
Posted by: Zhong Wu

79507411

Date: 2025-03-13 19:19:31
Score: 3
Natty:
Report link

From B()->??->C(): ?? means B call func of some debug strippet (system) library internally. I think actual problem is somewhere predecing C and ??. Smells like invalid input supplied somewhere.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: postala

79507410

Date: 2025-03-13 19:18:30
Score: 0.5
Natty:
Report link

So I've created the desired answer for your problem, also here is the snippet:

    document.addEventListener('DOMContentLoaded', () => {
      const formSection = document.getElementById('overflow');
      const textarea = formSection.querySelector('textarea');

      const checkOverflow = () => {
        const hasOverflow = formSection.scrollHeight > formSection.clientHeight;
        formSection.classList.toggle('overflowing', hasOverflow);
      };

      textarea.addEventListener('input', checkOverflow);
      checkOverflow(); // Initial check
    });
    div {
      border: 1px solid #CCC;
      background-color: #FFF;
      margin-bottom: 1rem;
      padding: 1rem;
      width: 8.5in;
      max-height: 7in;
    }

    .static-section {
      display: grid;
      overflow: hidden;
      max-height: 3in;
      width: 7.5in;
    }

    .static-section * {
      margin-top: 0.5rem;
      margin-bottom: 0.5rem;
      padding: 0.5rem;
    }

    .static-section.overflowing {
      background-color: #ffcccc !important; /* Red background for overflow */
    }

    textarea {
      field-sizing: content;
      width: 100%;
      box-sizing: border-box;
    }
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Overflow Detection Example</title>
</head>
<body>
  <form id="entry">
    <section id="top">
      <h1>HEADER</h1>
    </section>

    <section id="middle">
      <div id="overflow" class="static-section">
        <label>This section is locked at a max 3 inches. I want the background color to be red if anything makes this section overflow.</label>
        <textarea placeholder="Type in this section until the following paragraph starts to go off the screen. This is when I want the background color to change."></textarea>
        <p>When this information starts to go off the screen (i.e., enabling overflow - which the scrollbars are being hidden by the static-section class), I want the background color of this div to change. This will provide a visual indication that the provided response is too long.</p>
      </div>
    </section>

    <section id="footer">
      <h1>FOOTER</h1>
    </section>
  </form>
</body>
</html>

This will create the background red when the paragraph overflows.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Faizan Ahmad

79507405

Date: 2025-03-13 19:13:29
Score: 2
Natty:
Report link

There's no built-in switch or simple command-line option to force Cppcheck into aggressive interprocedural leak detection mode.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
Posted by: Alon Alush

79507403

Date: 2025-03-13 19:13:29
Score: 2.5
Natty:
Report link

It is also very much possible to just use backspace, delete the folder and write the name of the folder you want.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Ariadni Makari

79507402

Date: 2025-03-13 19:12:29
Score: 3.5
Natty:
Report link

I also want to know the answer to this question. or share any spotify podcast link

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: apkexpert

79507401

Date: 2025-03-13 19:12:29
Score: 2.5
Natty:
Report link

How can I ensure that ClickHouse distributes queries across all replicas?

distributed queries by default use only one live replica per shard
you can change it with SETTINGS max_parallel_replicas=3
and check
SELECT hostName(), count() FROM db.distributed_table GROUP BY ALL

Do I need to configure a specific load balancing strategy for read queries?

use <load_balacing> only if you understand why do you need it, for example nearest_hostname usually used for geo-distributed cluster to select from the same region which encoded in DNS hostnames in <remote_servers> <host>

Is there any way to confirm which replica is being used for queries?

SELECT hostName(), count() FROM db.distributed_table GROUP BY ALL
Reasons:
  • Blacklisted phrase (0.5): How can I
  • Blacklisted phrase (0.5): I need
  • Blacklisted phrase (1): Is there any
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): How can I
  • High reputation (-1):
Posted by: Slach

79507389

Date: 2025-03-13 19:07:28
Score: 2
Natty:
Report link

yes you can use the mlflow.pyfunc.log_model(<model_name>) to log the model

Reasons:
  • Whitelisted phrase (-1.5): you can use
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: DHIRAJ JAGTAP

79507373

Date: 2025-03-13 19:02:27
Score: 4
Natty:
Report link

solved

... https://rdrr.io/cran/lidR/man/st_crs.html:


# Overwrite the CRS (but does not reproject)
st_crs(ctg) <- 26918
Reasons:
  • Probably link only (1):
  • Low length (1.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • No latin characters (0.5):
  • Low reputation (1):
Posted by: sunnyR

79507343

Date: 2025-03-13 18:48:11
Score: 5.5
Natty:
Report link

I followed your suggestion and added the view setup in the on_ready method, like this:

@bot.event
async def on_ready():
    print(f"Logged in as {bot.user.display_name}!")
    await bot.tree.sync()
    bot.add_view(CloseView())
    bot.add_view(ClaimView())

However, I'm still encountering an error:

2025-03-13 19:38:00 ERROR    discord.client Ignoring exception in on_ready
Traceback (most recent call last):
  File "C:\Users\ryad\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 449, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\ryad\Documents\Clients\March 2025\mystichrome\main.py", line 264, in on_ready
    bot.add_view(CloseView())
                 ^^^^^^^^^^^
TypeError: CloseView.__init__() missing 2 required positional arguments

What should I do to resolve this issue?

Reasons:
  • Blacklisted phrase (2): What should I do
  • RegEx Blacklisted phrase (1.5): resolve this issue?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Amine Gazit

79507335

Date: 2025-03-13 18:43:10
Score: 3.5
Natty:
Report link

I don't have the problem anymore, I have reported it to MS that denied it (at the time of this article), but obviously they fixed a bug (very recently what I can see) in the later print dlg dll. If they fixed it with W11 or Office upgrades I don't know.

Reasons:
  • Blacklisted phrase (1): this article
  • Low length (0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Jan Bergström

79507333

Date: 2025-03-13 18:42:10
Score: 1
Natty:
Report link

Is there any way to force Google Drive products besides the drive.google.com web interface to realize new files exist?

Sharing the files to user accounts with Viewer access is one way.

From what I know, what you're getting is expected behavior. By default, files set to Anyone with the link that haven't been opened aren't fully accessible in the APIs, which is why nothing shows up in the Method: files.list of the user accounts.

I found Behaviour of "drive.file" scope on a shared folder on Google's Issue Tracker, which has a similar issue as yours. However, its current status is Won't fix (Obsolete), as this is intended.

Another one is Drive files.list returns inconsistent results when searching for files that were shared with an account via a group's member. Although this is currently Assigned, similar to the other ticket, it's likely the user hasn't opened the file shared to them, resulting in no results from the API. Feel free to +1 it if sharing with viewer permissions won't work for you or submit a feature request as this was set as a Bug.

Reasons:
  • Blacklisted phrase (1): Is there any
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Is there any
Posted by: Saddles

79507331

Date: 2025-03-13 18:41:10
Score: 1
Natty:
Report link
function updateSheet() {
    var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); // Change to your sheet name
    sheet.getRange("A2").setValue(new Date()); // Example: Updates A2 with current date
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Manmohan ji Mishra

79507328

Date: 2025-03-13 18:41:10
Score: 1
Natty:
Report link

How can I make it so that I don't have to include both A.h and THandle.h in B.h?

No need to #include "A.h".

#include "THandle.h"

struct A;

class B {
  THandle<A> SomeAInstance;
};
Reasons:
  • Blacklisted phrase (0.5): How can I
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): How can I
  • High reputation (-2):
Posted by: 3CxEZiVlQ

79507319

Date: 2025-03-13 18:38:10
Score: 0.5
Natty:
Report link

Found this online JSON tool that can convert from Json to Proto directly

https://jsonet.seagit.com/json-to-proto

not sure if that is what you want but leave a comment in case you need any help

Reasons:
  • Blacklisted phrase (1): any help
  • Low length (1):
  • No code block (0.5):
  • High reputation (-2):
Posted by: Muhammad Soliman

79507315

Date: 2025-03-13 18:37:09
Score: 2.5
Natty:
Report link

I have figured it out for those who may come across this

the culprit was in fact OnDestroy() where sharedpreferences saved just fine on the medium phone, it was not properly firing on the other phone. After moving around saveData() to other places and now something im looking to optimise more efficiently, the saving of shared preferences worked on other emulators besides medium phone 35

Thank you for your assistance

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Maysey

79507314

Date: 2025-03-13 18:36:09
Score: 3
Natty:
Report link

When the project is run in tests on a real device, it finds images with endings other than *.jpg, *.png (or allowed). Delete these different images from the ones allowed and the problem will disappear.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Starts with a question (0.5): When the
  • Low reputation (1):
Posted by: Jordi

79507312

Date: 2025-03-13 18:35:09
Score: 2
Natty:
Report link

Create 2 rules for your WebAcl

For header 1

{
  "Name": "block-not-header-1",
  "Priority": 0,
  "Statement": {
    "AndStatement": {
      "Statements": [
        {
          "ByteMatchStatement": {
            "SearchString": "/some_uri",
            "FieldToMatch": {
              "UriPath": {}
            },
            "TextTransformations": [
              {
                "Priority": 0,
                "Type": "NONE"
              }
            ],
            "PositionalConstraint": "EXACTLY"
          }
        },
        {
          "NotStatement": {
            "Statement": {
              "SizeConstraintStatement": {
                "FieldToMatch": {
                  "SingleHeader": {
                    "Name": "header1"
                  }
                },
                "ComparisonOperator": "GT",
                "Size": 0,
                "TextTransformations": [
                  {
                    "Priority": 0,
                    "Type": "NONE"
                  }
                ]
              }
            }
          }
        }
      ]
    }
  },
  "Action": {
    "Block": {}
  },
  "VisibilityConfig": {
    "SampledRequestsEnabled": true,
    "CloudWatchMetricsEnabled": true,
    "MetricName": "block-not-header-1"
  }
}

For header 2 and so on....

{
  "Name": "block-not-header-2",
  "Priority": 1,
  "Statement": {
    "AndStatement": {
      "Statements": [
        {
          "ByteMatchStatement": {
            "SearchString": "/some_uri",
            "FieldToMatch": {
              "UriPath": {}
            },
            "TextTransformations": [
              {
                "Priority": 0,
                "Type": "NONE"
              }
            ],
            "PositionalConstraint": "EXACTLY"
          }
        },
        {
          "NotStatement": {
            "Statement": {
              "SizeConstraintStatement": {
                "FieldToMatch": {
                  "SingleHeader": {
                    "Name": "header2"
                  }
                },
                "ComparisonOperator": "GT",
                "Size": 0,
                "TextTransformations": [
                  {
                    "Priority": 0,
                    "Type": "NONE"
                  }
                ]
              }
            }
          }
        }
      ]
    }
  },
  "Action": {
    "Block": {}
  },
  "VisibilityConfig": {
    "SampledRequestsEnabled": true,
    "CloudWatchMetricsEnabled": true,
    "MetricName": "block-not-header-2"
  }
}

This is the result that you are looking for, right?

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Vincent Tjianattan

79507310

Date: 2025-03-13 18:35:09
Score: 1.5
Natty:
Report link

The problem is how you have named the `Player_Stats` table.

You can rename the table using snake_case for example 'player_stats' or by changing the value of the name property in the @Table annotation as indicated in another answer to @Table(name="`Player_Stats`") .

I recommend to you to change the table name and change it in the @Table annotation too.

Steps to do it:

  1. ALTER TABLE "Player_Stats" RENAME TO player_stats;

  2. @Table(name="player_stats")

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Table
  • User mentioned (0): @Table
  • Low reputation (1):
Posted by: KSatWood

79507306

Date: 2025-03-13 18:34:08
Score: 1
Natty:
Report link

first thing you have to check

1. enable google play service in firebase

2. enable google sign in

3. check the OAuth Consent screen and OAuth Cliend ID's generated

4. download the googleServiceinfo.plist file again there you can see your CLIENT_ID,REVERSED_CLIENT_ID,ANDROID_CLIENT_ID , some othe updated data in googleServiceinfo.plist ( compare old and new info file you can see the changes)

4. need to add the below in info.plist

    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>($REVERSED_CLIENT_ID
}</string>
            </array>
        </dict>
    </array>

5 . also you need to add your REVERSED_CLIENT_ID in Url Types like below in the URL Schemes
Target--> info--> URL types--> add in URL Schemes
enter image description here

6. flutter clean, flutter pub get
7. check the flow

hope this solution works for you

Reasons:
  • Blacklisted phrase (1): enter image description here
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: chenna

79507298

Date: 2025-03-13 18:29:07
Score: 0.5
Natty:
Report link

To change the default user in a running Docker container without specifying the user in each command, you can modify the container's entrypoint script to switch users after starting the main process. Here's a general approach:

Start Main Process as Root: Ensure the main process that requires root privileges starts first in the entrypoint script.

Switch to Non-Root User: After the main process initiates, use a command like su -user to switch to the desired non-root user within the script.

The following commands in the entrypoint script will run as the non-root user, and any Docker exec commands will default to this user unless otherwise specified.

Example Entrypoint Script:

#!/bin/bash # Start main process as root /root_process & # Switch to non-root user su - user # Keep the container running tail -f /dev/null

In this script, /root_process starts with root privileges, and then switches to the non-root user for all subsequent operations. This setup ensures that any Docker exec commands default to the non-root user without explicit user specification.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Bangalore Web Guru

79507294

Date: 2025-03-13 18:23:06
Score: 3
Natty:
Report link

In vscode install the deno language server from the extensions tab. then ctrl+shift+p and search "deno:enable", run it and it should configure the workspace

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Ethan Claude Ogle

79507293

Date: 2025-03-13 18:22:06
Score: 4.5
Natty:
Report link

The FastAPI web-site provides instructions on building a Docker image for FastAP: https://fastapi.tiangolo.com/deployment/docker/

Reasons:
  • Probably link only (1):
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Denis Kazakov

79507284

Date: 2025-03-13 18:13:04
Score: 2.5
Natty:
Report link

This is very strange. I decided to create a new project on my desktop mac. Then I copied it to my laptop Idea folder. Then I opened and ran it. the program ran and the console opened and I saw the results. There was something wrong with the the original sample file created by intellij - so the it was working all along, but the file sample project was not

Reasons:
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Bill Sundstrom

79507282

Date: 2025-03-13 18:12:04
Score: 1.5
Natty:
Report link

Issue You're trying to use a Unicode character (\ue755) as an icon inside Ant Design's component, but it's displaying as an artifact instead of a proper icon.

Solution Ant Design does not parse Unicode characters directly as icons. Instead, you should use createFromIconfontCN to load the icon from a custom icon font.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Meekail Aslam

79507277

Date: 2025-03-13 18:06:02
Score: 0.5
Natty:
Report link

A class is a factory of objects and a place for object method implementation.

In Ruby a class is also an object.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • High reputation (-1):
Posted by: Artur INTECH

79507276

Date: 2025-03-13 18:05:02
Score: 0.5
Natty:
Report link

FFMediaToolkit

public void ConvertMp4ToMp3(string fileFrom="some.mp4", string fileTo="some.mp3") 
{ 
   using (var mediaFile = MediaFile.Open(fileFrom))
   {
       var audioEncoderSettings =
           new AudioEncoderSettings(mediaFile.Audio.Info.SampleRate, mediaFile.Audio.Info.NumChannels, AudioCodec.MP3);
       using (var file = MediaBuilder.CreateContainer(fileTo)
                  .WithAudio(audioEncoderSettings).Create())
       {
           while (mediaFile.Audio.TryGetNextFrame(out var audioFrame))
           {
               file.Audio.AddFrame(audioFrame);
           }
       }
   }
}
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Stanislav

79507270

Date: 2025-03-13 18:04:02
Score: 5.5
Natty: 4.5
Report link

just wanna say thanks to came back with your own solution, helped me a lot now! StackOverflow still has its value haha! GPT, for example, gave me a such more laborious solution.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (1): StackOverflow
  • Blacklisted phrase (1): helped me a lot
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: DatalakeMermaid

79507264

Date: 2025-03-13 18:03:01
Score: 0.5
Natty:
Report link

According to the Android documentation, you have to use MindfulnessSessionRecord:

healthConnectClient.insertRecords(
    listOf(
        MindfulnessSessionRecord(
            startTime = startTime,
            endTime = endTime,
            startZoneOffset = ZoneOffset.UTC,
            endZoneOffset = ZoneOffset.UTC,
            mindfulnessSessionType = MINDFULNESS_SESSION_TYPE_MEDITATION,
            metadata = Metadata.manualEntry()
        )
    )
)

Here is a list of the available mindfulnessSessionType values:

enter image description here

If you want to read the entry:

val mindfulnessResponse = healthConnectClient.aggregate(
    AggregateRequest(
        metrics = setOf(MINDFULNESS_DURATION_TOTAL),
        timeRangeFilter = TimeRangeFilter.between(startTime, endTime)
    )
)

val time = mindfulnessResponse[MINDFULNESS_DURATION_TOTAL]?.toMinutes()

Mindfulness is available since 1.1.0-alpha12

androidx-health-connect = { module = "androidx.health.connect:connect-client", version = "1.1.0-alpha12" }

Don't forget the add the required permissions in the manifest

<uses-permission android:name="android.permission.health.READ_MINDFULNESS" />
<uses-permission android:name="android.permission.health.WRITE_MINDFULNESS" />
Reasons:
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: carlos menjivar

79507259

Date: 2025-03-13 18:01:01
Score: 1
Natty:
Report link

It seems that the solution is to use another setting on the "all-purpose" compute, Access Mode "Standard".
In this case, it worked.

Reasons:
  • Whitelisted phrase (-1): it worked
  • Whitelisted phrase (-1): solution is
  • Low length (1):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Sunchaser

79507256

Date: 2025-03-13 18:00:00
Score: 0.5
Natty:
Report link

I was trying to find a working example for converting mp4 video to mp3 audio for the FFMediaToolkit library. I didn't find it, so I decided to supplement this article.

public void ConvertMp4ToMp3(string fileFrom="some.mp4", string fileTo="some.mp3") 
{ 
   using (var mediaFile = MediaFile.Open(fileFrom))
   {
       var audioEncoderSettings =
           new AudioEncoderSettings(mediaFile.Audio.Info.SampleRate, mediaFile.Audio.Info.NumChannels, AudioCodec.MP3);
       using (var file = MediaBuilder.CreateContainer(fileTo)
                  .WithAudio(audioEncoderSettings).Create())
       {
           while (mediaFile.Audio.TryGetNextFrame(out var audioFrame))
           {
               file.Audio.AddFrame(audioFrame);
           }
       }
   }
}
Reasons:
  • Blacklisted phrase (1): this article
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Stanislav

79507252

Date: 2025-03-13 17:59:00
Score: 1.5
Natty:
Report link

Minha solução abaixo

import 'dart:io';

import 'package:aws_client/rekognition_2016_06_27.dart' as aws;
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:nonio_ponto/db/usuario.dart';
import 'package:nonio_ponto/db/validacao_facial.dart';
import 'package:quickalert/quickalert.dart';

class AWSRekognitionScreen extends StatefulWidget {
  final List<CameraDescription>? cameraDescriptions;
  final Usuario? usuario;
  final ValidacaoFacial? validacaoFacial;

  AWSRekognitionScreen({Key? key, this.cameraDescriptions, this.usuario, this.validacaoFacial}) : super(key: key);

  @override
  _AWSRekognitionScreenState createState() => _AWSRekognitionScreenState();
}

class _AWSRekognitionScreenState extends State<AWSRekognitionScreen> {
  final ImagePicker _picker = ImagePicker();

  late CameraController _cameraController;
  late Future<void> _initControllerFuture;

  // Chaves de acesso (substitua pelas suas)
  final _awsAccessKey = "---------";
  final _awsSecretKey = "---------";
  final _awsRegion = "us-east-1"; // Altere conforme necessário

  bool _toggleCamera = false;

  Future<void> _analyzeImage(File imageFile) async {
    try {
      aws.Rekognition rekognition = aws.Rekognition(
        region: _awsRegion,
        credentials: aws.AwsClientCredentials(
          accessKey: _awsAccessKey,
          secretKey: _awsSecretKey,
        ),
      );
      print(rekognition.toString());
      final imageBytes = await imageFile.readAsBytes();

      final response = await rekognition.compareFaces(
        sourceImage: aws.Image(bytes: imageBytes),
        targetImage: aws.Image(bytes: imageBytes),
      );

      //String detectedText = response.sourceImageFace?.map((detection) => detection.detectedText).join("\n") ?? "Nenhum texto detectado";
      //print(detectedText);
      setState(() {
        //_result = detectedText;
      });
    } catch (e) {
      setState(() {
        //_result = "Erro ao analisar imagem: $e";
      });
    }
  }

  @override
  void initState() {
    super.initState();
    _cameraController = CameraController(widget.cameraDescriptions![0], ResolutionPreset.high);
    _initControllerFuture = _cameraController.initialize();
  }

  @override
  void dispose() {
    _cameraController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: FutureBuilder(
        future: _initControllerFuture,
        builder: (context, snapshot) {
          if (snapshot.connectionState == ConnectionState.done) {
            final scale = 1 / (_cameraController.value.aspectRatio * MediaQuery.of(context).size.aspectRatio);
            return Transform.scale(
              scale: scale,
              alignment: Alignment.topCenter,
              child: Stack(
                children: [
                  CameraPreview(
                    _cameraController,
                    child: Container(
                      padding: EdgeInsets.all(20.0),
                      child: Row(
                        mainAxisSize: MainAxisSize.min,
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        crossAxisAlignment: CrossAxisAlignment.end,
                        children: [
                          Expanded(
                            child: InkWell(
                              borderRadius: BorderRadius.all(Radius.circular(50.0)),
                              onTap: () async {
                                try {
                                  // Ensure that the camera is initialized.
                                  await _initControllerFuture;

                                  // Attempt to take a picture and get the file `image`
                                  // where it was saved.
                                  XFile image = await _cameraController.takePicture();

                                  if (image.path != null) {
                                    setState(() {
                                      //_image = File(image.path);
                                    });
                                    await _analyzeImage(File(image.path));
                                    print(File(image.path).toString());
                                  }
                                  Navigator.of(context).pop();
                                } catch (e) {
                                  // If an error occurs, log the error to the console.
                                  print(e);
                                }
                              },
                              child: Container(
                                padding: EdgeInsets.all(4.0),
                                child: Icon(Icons.camera_alt, color: Colors.white, size: 35.0),
                              ),
                            ),
                          ),
                          Expanded(
                            child: InkWell(
                              borderRadius: BorderRadius.all(Radius.circular(50.0)),
                              onTap: () {
                                if (!_toggleCamera) {
                                  onCameraSelected(widget.cameraDescriptions![0]);
                                  setState(() {
                                    _toggleCamera = true;
                                  });
                                } else {
                                  onCameraSelected(widget.cameraDescriptions![1]);
                                  setState(() {
                                    _toggleCamera = false;
                                  });
                                }
                              },
                              child: Container(
                                padding: EdgeInsets.all(4.0),
                                child: Icon(Icons.flip_camera_android, color: Colors.white, size: 35.0),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  IgnorePointer(
                    child: CustomPaint(
                      painter: CirclePainter(),
                      child: Container(),
                    ),
                  ),
                ],
              ),
            );
          } else {
            // Otherwise, display a loading indicator.
            return const Center(child: CircularProgressIndicator());
          }
        },
      ),
    );
  }

  void onCameraSelected(CameraDescription cameraDescription) async {
    _cameraController = CameraController(cameraDescription, ResolutionPreset.high);
    _cameraController.addListener(() {
      if (mounted) setState(() {});
      if (_cameraController.value.hasError) {
        showMessage('Camera Error: ${_cameraController.value.errorDescription}');
      }
    });
    try {
      _initControllerFuture = _cameraController.initialize();
    } on CameraException catch (e) {
      showMessage('Camera Error: $e');
    }
    if (mounted) setState(() {});
  }

  void showMessage(String s) {
    QuickAlert.show(
      disableBackBtn: false,
      showConfirmBtn: false,
      context: context,
      type: QuickAlertType.error,
      title: 'Error',
      text: s.toString(),
    );
  }
}

class RectanglePainter extends CustomPainter {
  double? topMargin;
  Size? Function(Size)? size;

  // style
  double strokeWidth = 2.0;
  Color strokeColor = Colors.white;
  Color? overlayColor;
  Radius? borderRadius;

  RectanglePainter({
    this.topMargin,
    this.strokeWidth = 2.0,
    this.strokeColor = Colors.white,
    this.overlayColor,
    this.borderRadius,
  });

  @override
  void paint(Canvas canvas, Size size) {
    final topMargin = this.topMargin ?? (size.height * 0.3);
    final width = this.size?.call(size)?.width ?? size.width * 0.8;
    final height = this.size?.call(size)?.height ?? ((size.width * 0.8) / 1.5);
    final borderRadius = this.borderRadius ?? const Radius.circular(10);

    // Step 1: Draw the overlay with transparent rectangle
    final overlayPath = Path()
      ..addRRect(
        RRect.fromRectAndRadius(
          Rect.fromCenter(
            center: Offset(size.width / 2, topMargin),
            width: width,
            height: height,
          ),
          borderRadius,
        ),
      )
      ..addRect(Rect.fromLTWH(0.0, 0.0, size.width, size.height))
      ..fillType = PathFillType.evenOdd;

    final overlayColor = this.overlayColor ?? Colors.black.withOpacity(0.7);
    final overlayPaint = Paint()
      ..style = PaintingStyle.fill
      ..color = overlayColor; // semi-transparent black overlay

    canvas.drawPath(overlayPath, overlayPaint);

    // Step 2: Draw the white stroke around the circle
    final strokePath = Path()
      ..addRRect(
        RRect.fromRectAndRadius(
          Rect.fromCenter(
            center: Offset(size.width / 2, topMargin),
            width: width,
            height: height,
          ),
          borderRadius,
        ),
      );

    final strokePaint = Paint()
      ..style = PaintingStyle.stroke
      ..strokeWidth = strokeWidth
      ..color = strokeColor; // white stroke

    canvas.drawPath(strokePath, strokePaint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}

class CirclePainter extends CustomPainter {
  double? topMargin;
  double? Function(Size size)? circleRadius;

  double progress = 0.0;

  // style
  double strokeWidth = 2.0;

  Color strokeColor = Colors.white;
  Color? overlayColor;
  Color progressColor = Colors.green;

  CirclePainter({
    this.topMargin,
    this.circleRadius,
    this.progress = 0.0,
    this.strokeWidth = 2.0,
    this.strokeColor = Colors.white,
    this.overlayColor,
    this.progressColor = Colors.green,
  });

  @override
  void paint(Canvas canvas, Size size) {
    final circleRadius = this.circleRadius?.call(size) ?? ((size.width / 1.25) / 2);
    final topMargin = this.topMargin ?? (size.height * 0.35);

    // Step 1: Draw the overlay with transparent circle
    final overlayPath = Path()
      ..addOval(
        Rect.fromCenter(
            center: Offset(
              size.width / 2, // x-axis center
              topMargin, // y-axis center with margin
            ),
            width: size.width / 2,
            height: size.height / 3)
        /*Rect.fromCircle(
          center: Offset(
            size.width / 2, // x-axis center
            topMargin, // y-axis center with margin
          ),
          radius: circleRadius,
        )*/,
      )
      ..addRect(Rect.fromLTWH(0, 0, size.width, size.height))
      ..fillType = PathFillType.evenOdd;

    final overlayColor = this.overlayColor ?? Colors.black.withOpacity(0.7);
    final overlayPaint = Paint()
      ..style = PaintingStyle.fill
      ..color = overlayColor;

    canvas.drawPath(overlayPath, overlayPaint);

    // Step 2: Draw the white stroke around the circle
    final strokePath = Path()
      ..addOval(  Rect.fromCenter(
          center: Offset(
            size.width / 2, // x-axis center
            topMargin, // y-axis center with margin
          ),
          width: size.width / 2,
          height: size.height / 3)/*Rect.fromCircle(
        center: Offset(
          size.width / 2, // x-axis center
          topMargin, // y-axis center with margin
        ),
        radius: circleRadius,
      )*/);

    final strokePaint = Paint()
      ..style = PaintingStyle.stroke
      ..strokeWidth = strokeWidth
      ..color = strokeColor; // white stroke

    canvas.drawPath(strokePath, strokePaint);

    if (progress != 0.0) {
      assert(this.progress >= 0.0 && this.progress <= 1.0);
      // Step 3: Draw the progress arc (quarter circle)
      final progressRect = Rect.fromCircle(
        center: Offset(
          size.width / 2, // x-axis center
          topMargin, // y-axis center with margin
        ),
        radius: circleRadius,
      );

      final strokeProgressPaint = Paint()
        ..style = PaintingStyle.stroke
        ..strokeWidth = strokeWidth
        ..color = progressColor;

      final progress = this.progress * 4; // 4 means full of circle, 2 means half of circle, 1 means quarter of circle
      // Draw only a portion of the circle, progress defines how much
      canvas.drawArc(
        progressRect,
        -90 * 3.1416 / 180, // Start angle (-90° = top of the circle)
        progress * (3.14 / 2), // Sweep angle based on progress (quarter of circle = π/2 radians)
        false,
        strokeProgressPaint,
      );
    }
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}

class OverlayPainter extends CustomPainter {
  final double screenWidth;
  final double screenHeight;

  OverlayPainter({required this.screenWidth, required this.screenHeight});

  @override
  void paint(Canvas canvas, Size size) {
    final radius = screenWidth * 0.45;
    final strokeWidth = 2.0;
    final circlePath = Path()
      ..addOval(Rect.fromCircle(
        center: Offset(screenWidth / 2, screenHeight / 2.5),
        radius: radius,
      ));

    final outerPath = Path()
      ..addRect(Rect.fromLTWH(0, 0, screenWidth, screenHeight));
    final overlayPath =
    Path.combine(PathOperation.difference, outerPath, circlePath);

    final paint = Paint()
      ..color = Colors.black.withOpacity(0.7)
      ..style = PaintingStyle.fill;

    final borderPaint = Paint()
      ..color = Colors.white
      ..style = PaintingStyle.stroke
      ..strokeWidth = strokeWidth;

    canvas.drawPath(overlayPath, paint);
    canvas.drawCircle(
      Offset(screenWidth / 2, screenHeight / 2.5),
      radius,
      borderPaint,
    );
  }

  @override
  bool shouldRepaint(CustomPainter oldDelegate) {
    return false;
  }
}
Reasons:
  • Blacklisted phrase (2): solução
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: George Freire

79507243

Date: 2025-03-13 17:55:59
Score: 3
Natty:
Report link

This can be a possible solution:
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.html

Or maybe this way with @Async

https://www.baeldung.com/spring-async#:~:text=Simply%20put%2C%20annotating%20a%20method,for%20async%20processing%20if%20necessary.

Reasons:
  • Whitelisted phrase (-2): solution:
  • Probably link only (1):
  • Low length (1.5):
  • No code block (0.5):
  • User mentioned (1): @Async
  • Low reputation (1):
Posted by: Weslley Mateus

79507226

Date: 2025-03-13 17:45:57
Score: 0.5
Natty:
Report link

More testing, and changes & finally got it to work.

Seems you can't fetch from a content script?

anyhoo, if anyone else needs this... it seems to be workin

content script


async function refresh() {    
        browser.runtime.sendMessage({
        status:  "load"
  });  
    setTimeout(refresh,30000);  // 30 sec
};
refresh();

background script

browser.runtime.onInstalled.addListener(() => {

function handleMessage(request) { 

let url       = "https://www.bungie.net/Platform/Settings";

 fetch(url)
    .then(res  => res.json())
    .then(data => {
      let c = data.Response.systems.Destiny2;
      let msg = c.enabled ? "up" : "down";     
      if( msg === "up" ) {
                browser.browserAction.setIcon({   
                     path: "icons/leaf-64.png"
               });       
      } 
     else if ( msg === "down" ){
            browser.browserAction.setIcon({   
                     path: "icons/redleaf-64.png"
           });     
      } 
    })  
    .catch(err => {   
    });  


     
};
 browser.runtime.onMessage.addListener( handleMessage  );

});
Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Greenman

79507224

Date: 2025-03-13 17:44:57
Score: 3
Natty:
Report link

It means you already have a venv setup and you're trying to create a new one over the top of it.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: FoxaLabs

79507214

Date: 2025-03-13 17:41:56
Score: 0.5
Natty:
Report link

The following will do it in a single DB query.

User.where(id: some_id).update_all(attributes)
Reasons:
  • Low length (1):
  • Has code block (-0.5):
Posted by: Sandip Mane

79507194

Date: 2025-03-13 17:31:54
Score: 1
Natty:
Report link

the most used one is maven central and if you will never support anything but android you can use google maven too

Reasons:
  • Whitelisted phrase (-1.5): you can use
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Abdelrahman Esam

79507193

Date: 2025-03-13 17:31:54
Score: 1
Natty:
Report link

The good reason to cleanup libraries is so that libraries may be unloaded without leaking system resources: files, memory (memory mappings), and any other unneeded kernel based process resources.

Compiled library modules are a high level of modularization that modern operating systems provide. It can be a powerful tool to build larger tools, on the fly (as the program runs). It's a kind of software plug-n-play. It's operator-in-the-loop interactive programming with binary code groups. It requires libraries to be robust, and not leaky; in order to be able to unplug stuff in such a dynamic scenario. Most libraries can't be unloaded, if at all, or without leaking. So it's currently hard to do this type of dynamic programming. I can dream. Dynamic linker/loader systems are crazy powerful.

I'm currently trying to fix Cairo (related to FontConfig). So I can work on my dream. Wow, 10 years.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Lance Arsenault

79507191

Date: 2025-03-13 17:31:54
Score: 0.5
Natty:
Report link

You want:

use-conda: true

It has to be lower case. You might think it would be use-conda: True because we have to use True and False in Python code, but in YAML it's all lowercase. Any other variant like TRUE is treated as a string.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Tim Booth

79507185

Date: 2025-03-13 17:28:53
Score: 1.5
Natty:
Report link

This modification of Heinzi's answer also works:

var usefulBuffer = RecvBuffer2.TakeWhile(x => x != 0).ToArray();
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: jensatch

79507184

Date: 2025-03-13 17:28:53
Score: 1
Natty:
Report link

I was able to identify / solve this error on my end. Maybe it will help someone today...

In my case I notice that this error triggers for both Firestore.write and Firestore.query api methods. I can say that for the Firestore.query error happened simply because one of my docs contained a key which it's value was an empty array e.g: my_key: []

I'm pretty sure the Firestore.write api error triggered for the same reason.

Once I removed/handled this key the error was gone.

I hope this would help someone.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Yoray

79507177

Date: 2025-03-13 17:23:51
Score: 0.5
Natty:
Report link

This is the top result when googling this question, but none of the answers present in this thread (or any other resources I was able to find) resolved my issue so I wanted to contribute my solution.

import paramiko as pm
import time

USER = "user"
PASSWORD = "password"
HOST = "host"

client = pm.SSHClient()
client.set_missing_host_key_policy(pm.AutoAddPolicy())
client.connect(HOST, username=USER, password=PASSWORD)

channel = client.get_transport().open_session()
channel.invoke_shell()

commands = [
    "command1",
    "command2",
    "command3"
    ]

for cmd in commands:
    channel.send(cmd + "\n")

    wait_time = 0
    while wait_time <= 5:
        if channel.recv_ready():
            out = channel.recv(1024).decode('utf-8')
            print(out)
        else:
            time.sleep(1)
            wait_time += 1

channel.close()
client.close()

I would say this answer is most similar to the one provided by @nagabhushan, but I had issues with deploying child threads to handle processing the stdout of each command. My method is fairly compact and makes it easy to wrap into a function that accepts inputs for user, password, host, and a list of commands.

The biggest point that I haven't seen emphasized in other posts is that (on the servers I tested with) the channel.send(cmd) method needs to be instantly received via channel.recv() or else the subsequent commands will not be executed. I tested this on a Dell switch and an Ubuntu server, which both exhibited the same behavior. Some resources online have examples showing multiple channel.send() executions without receiving the output, and I was unable to get that working on any target device. It's worth noting that the Dell switch OS is built on Ubuntu, so this may be an Ubuntu-architecture specific issue.

As mentioned in other sources (but worth reiterating) the exec_command() method creates a new shell for each execution. If you have a series of commands that must be executed in a single shell session, exec_command() will not work.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @nagabhushan
  • Low reputation (1):
Posted by: Jujimufoo