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
(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);
}
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.
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
Were you able to solve this issue?
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.
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.
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
The only reliable way I found to get away with this error is,
Click the "User Switcher" icon on the top right corner in the Status bar
Click "Login Window...", this will take you to the Lock screen
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.
As of .NET 8.0, System.Data.SqlClient is obsolete. Instead, use Microsoft.Data.SqlClient.
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.
This is exactly what you need: https://github.com/jab/bidict
It's mature and easy to use.
I don't have an answer but how did you go about setting the "offset" to one for the second notebook?
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.
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
enter code here
When 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)
}
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}
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.
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.
(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);
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"
}
]
}
@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'
}
}
i fixed the issue by adding the needed events into a pareload.
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
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.
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
Also, you can try installing/updating your project packages: npm install
.
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
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>
Maybe I am 2 years behind and late but what theme are you using in VSCODE yours seems very nice!
Thank you!
The same article now says.
Tip
There is no limit to how many repositories you can index.
header 1 | header 2 |
---|---|
cell 1 | cell 2 |
cell 3 | cell 4 |
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 errors
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)
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.
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.
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.
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!
Seeing the "Office script service is unreachable" message myself. Script will not run.
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
You can only group join to two tables, so you would need to call group join twice.
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.
Answer: WHERE (ColumnName) IS NOT NULL
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"
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'])`
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/
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
There is no emulator for DPL viewing.
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
I am using the same model and have ended up in the same question. Did you get an answer?
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
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>
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');
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
–
For me the following query works without a problem:
SELECT <col1>, <col2>, <col3>
FROM `tablename`
where date like "2025-03-06%"
limit 20
Nowadays toPromise
method is being deprecated, so it's better to use firstValueFrom
:
import { firstValueFrom } from 'rxjs';
return await firstValueFrom(this.store);
=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")))
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.
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.
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.
There's no built-in switch or simple command-line option to force Cppcheck into aggressive interprocedural leak detection mode.
It is also very much possible to just use backspace, delete the folder and write the name of the folder you want.
I also want to know the answer to this question. or share any spotify podcast 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
yes you can use the mlflow.pyfunc.log_model(<model_name>) to log the model
solved
... https://rdrr.io/cran/lidR/man/st_crs.html:
# Overwrite the CRS (but does not reproject)
st_crs(ctg) <- 26918
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?
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.
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
.
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
}
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;
};
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
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
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.
Create 2 rules for your WebAcl
{
"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"
}
}
{
"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?
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:
ALTER TABLE "Player_Stats" RENAME TO player_stats;
@Table(name="player_stats")
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
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.
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
The FastAPI web-site provides instructions on building a Docker image for FastAP: https://fastapi.tiangolo.com/deployment/docker/
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
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.
A class is a factory of objects and a place for object method implementation.
In Ruby a class is also an object.
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);
}
}
}
}
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.
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:
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" />
It seems that the solution is to use another setting on the "all-purpose" compute, Access Mode "Standard".
In this case, it worked.
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);
}
}
}
}
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;
}
}
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
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 );
});
It means you already have a venv setup and you're trying to create a new one over the top of it.
The following will do it in a single DB query.
User.where(id: some_id).update_all(attributes)
the most used one is maven central and if you will never support anything but android you can use google maven too
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.
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.
This modification of Heinzi's answer also works:
var usefulBuffer = RecvBuffer2.TakeWhile(x => x != 0).ToArray();
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.
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.