instruction stringlengths 0 30k ⌀ |
|---|
null |
I'm working on process holllowing and each time I build someone program in visual studio.
I pass through the same error:
```
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex'
```
```
using System;
using sta... |
I'm building a string of text in my template from multiple sources. Each of the fields fires it's own change event successfully, but I'm trying to get the value of the `constraint` field from within the change event of the `identifier` field and it's not working. When the change event fires on the `identifier` field, i... |
I'm wondering if there's any way to use a patch to "/root/subdir", which will either create "root" if it doesn't exist (plus "subdir"), or simply add or replace "subdir" if "root" already exists.
Example:
```
patchesJson6902:
- target:
kind: MyKind
name: config
version: v1beta1
gro... |
kubernetes patch or add nested structure depending on if it exists |
|kubernetes|kubectl|kustomize| |
As pointed out in the comments, you're not providing your program a way to sort "bookList". should it sort it based on tilte? author? something else?
java isn't gonna just assume what is the natural order of "bookList".
You must tell your program to sort based on specific criteria such as title, author, or any othe... |
I encountered the same issue and managed to resolve it.
Here's how I did it:
$tag = 'mytag';
$key = 'topmenu';
$value = collect(Cache::tags($tag)->getTags()->flush())->first(fn($item) => $item === $key);
// Now, you can check if the value is empty or not using an if con |
Lets be honest, the reason that there was no response to this earlier is that this topic and the way the question was asked is too broad to be properly on-topic for SO. I'll draft this here and find somewhere else to publish it later ;).
> **[OData _IS_ the best way to REST][1]**
An open protocol to allow the cre... |
So im trying to implement a weighted loss function, i took two different approaches (first using python functions, then using keras.losses.loss class inheritance). They both yield the same loss when i take the predictions of my model and compute the loss between predictions and ground truths. However, when i pass the l... |
Why is my keras custom loss function not working properly when training my model? |
|tensorflow|keras|deep-learning|neural-network|loss-function| |
null |
I've been trying to remove the skucode after the product title in the order email page. Could you please help?
I have tried this code. but didn't work. the order email remains the skucode after the product title.
```
function sv_remove_product_page_skus( $enabled ) {
if ( ! is_admin() && is_product() ) {
... |
Remove SKU Code after the Product Title in the Order Email #woocommerce |
|php|wordpress|woocommerce| |
null |
I coded a timer to last for 1 minute before the program continues, but the timer keeps on stopping at around 12 seconds and prevents the program from moving forward.
I read somewhere that the `time.sleep` function doesn't work if the system clock changes, and to replace it with `time.monotonic`, but doing that just... |
You are attempting to link a program compiled with Windows `g++` (`x86_64-w64-mingw32-g++.exe`)
against an import library `C:/Python310/libs/python310.lib` that was built with Micosoft MSVC.
That will not work because `x86_64-w64-mingw32` libraries are incompatible with MSVC libraries.
Get the [`x86_64-w64-mingw32` ... |
To make it work on newly enabled High Performance Orders Storage (and in legacy mode too), use the following revised and optimized code:
```php
add_action('manage_shop_order_posts_custom_column', 'custom_orders_list_column_content', 20, 2);
add_action('manage_woocommerce_page_wc-orders_custom_column', 'custom_orders... |
Your code is a little confusing, it looks like you copy and pasted bits and pieces of your code because what you have has lots of issues.
I would like to see how the useSearchParams() is defined. Are you trying to use react hooks here? Why aren't these variables being destructured from useState()? State is how we t... |
I am using functools.lru_cache to implement Fibonacci using memoization. But I do not understand the number of hits that my output generates. My code is as follows:
```
`@lru_cache(maxsize=8)
def fib(n):
if n <2:
return n
else:
return fib(n-1) + fib(n-2)
print(fib(8))
print(fib.cache_... |
Number of hits in fibonacci using lru_cache |
|python-3.x|data-structures|dynamic-programming|lru| |
null |
[Expected behaviour](https://i.stack.imgur.com/NVEGT.jpg)
[Expected behaviour](https://i.stack.imgur.com/832sF.jpg)
I want to use material top tape bar in the middle of my application but when I am trying to scroll it just scrolling but I want Twitter type behaviour so when we Scroll it can get full screen width ... |
In Blazor versions 6/7 I can get the remote IP address in _Host.cshtml with:
@inject ILogger<Pages__Host> Logger
RemoteIp = HttpContext.GetRemoteIpAddress(Logger);
But this does not work in App.razor in version 8. So how can I get this in version 8?
|
How do I get the Remote IP address in Blazor version 8 |
|blazor|blazor-server-side| |
I have a generic Java class
```
public class Person<T> {
private String name;
private List<T> attributes;
}
public class AttributeOne {
// some fields
}
public class AttributeTwo {
// some fields
}
```
and I want to convert from a Spark DataSet to a list of Java `Person<T>` objects. (ea... |
|android|flutter|manifest-merging| |
`read` by default trims leading and trailing whitespace and consumes backslashes. You can disable those by setting `IFS` to empty string and specifying the `-r` flag, respectively. See:
```
$ echo ' \" ' | while read i; do echo ${#i}; done
1
$ echo ' \" ' | while IFS= read i; do echo ${#i}; done
3
$ echo ' \" ' |... |
Here is the html:
[html of the site to be scrapped](https://i.stack.imgur.com/BLh9k.png)
There seems to be an error in my code/logic since I can't seem to extract the affected assets (ex: EURUSD).
Here is my code:
```
def extract_name_and_assets(html_content):
soup = BeautifulSoup(html_content, 'html.... |
`modelclassinstance.objects.filter(anyfield='value').order_by('check-in', 'check-out', 'location')` |
using node v20.12.0
"react": "^18.2.0"
I have create react application using yo man generator for office version 5.0.0.
file code is like:
async function getExcelOOXML() {
try {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getAct... |
I have a project where I need to implement a chatbot. Due to the requirement I can't use existing chatbot services and need to create one from scratch.
The simplest idea that I can think of is to have a server side client which act as the bot (probably impelemented in smack) which will connect to an xmpp server (pro... |
How to Implement Chatbot at Scale |
|xmpp|chatbot|smack| |
|vba|text|ms-word|reformatting| |
The fully qualified selector name (with the class name) is not required, even in methods not marked with `@objc`. Of course the selector itself must be either an Objective-C method or a Swift method marked with `@objc`.
Oddly, none of the documentation shows any example of a `#selector` without the fully qualified n... |
Get current value of an Angular 17 FormBuilder field not reflecting actual value |
|angular|angular-formbuilder| |
I'm trying to send Emojis to telegram bot. I managed to send text message but i don't know how to send Emoji.
I tried the below code but doesn't seem to work. Any suggestions?
```
string x_emoji="\x1F4B";
string text = "Order modified: "+x_emoji+" \n" + TimeToString( TimeLocal() );
SendTelegramMessage( T... |
Sendig Emojis from MQL4 to Telegram Bot |
|telegram-bot|emoji|mql4|mql| |
null |
The company I work for uses excel sheets to find the cheapest available fuel in their desired fueling location. I have managed to make the formulas of the sheet they had already in place work properly except for 1 very specific case where more than 1 location offers fuel at the same price.
Image Example
[. I am... |
There are a couple of things to consider when using `composer init`. The first question (`<vendor><name>`) defines quite a lot and defaults to whatever user is logged on (?) and what folder she is working in. Of course this can be changed but it needs some thinking ahead. Therefor take this step by step.
## Setting ... |
Instead of using a `ZStack`, try showing the yellow circle as an `.overlay` over the `Image`.
- Put the `.scaleEffect` after the green background and the overlay, this way it applies to these too.
- The blue background can be applied using another `.background` modifier to the `Image`.
- When you update the fl... |
If you want to implement `async/await` inside `useEffect`, go like this. `useEffect` itself only accepts a normal callback without `async`.
```
useEffect(() => {
const yourFetch = async() => {
const res = await fetch(xxxx)
// Do something to res.
}
yourFetch();
}, [Deps])
//... |
Find text and numbers Formatted: "Case: BE########" and format them, regardless of the number |
In spring boot, the method of the same service is used. When called from the controller, an internal event is issued and runs normally, but when consumed using eventHandler, the internal event is not issued.
The event uses @transactionalEventListener to operate only when the transaction ends normally.
The service... |
Internal events cannot be consumed in spring boot. Only when using Kafka Consume |
|spring|spring-boot|apache-kafka|transactions|spring-kafka| |
I have two commands: `System.out.println("something");` and `System.out.println("another thing");`.
I want to execute them sequentially in a continuous loop as follows:
1. Execute `System.out.println("something");`.
2. Wait X seconds.
3. Execute `System.out.println("another thing");`.
4. Wait X seconds.
5. Ex... |
I need to execute the macro that is associated with the 'Insertar Fila Debajo' button that is within the 'FrmBuscarTxt_Frm' form with python xlwings. Help!!

macro1 = app.macro('FrmBuscarTxt_Frm.Add_linea_Dw_Click')
macro1()
macro2 = app.... |
|python|excel|vba|xlwings| |
In the below program is it possible to access __breadth attribute in area(self) method?
```
class Rectangle:
def __init__(self, L):
self.__length = L
def area(self):
return self.__length * self.__breadth
b = Rectangle(10)
b.__breadth = 5
print(b.__dict__)
print(... |
TS2339: Property 'getOoxml' does not exist on type 'Worksheet' |
|reactjs|office-js| |
I'm trying to run a Java application that integrates with Apache Kafka. The code compiles and runs successfully from within IntelliJ IDEA, but when I try to run the compiled JAR file, I get the following error:
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/kafka/clients/consumer/KafkaConsumer... |
NoClassDefFoundError when running JAR file with Apache Kafka dependencies |
|java|apache-kafka|confluent-cloud| |
null |
{"Voters":[{"Id":243925,"DisplayName":"Tony"},{"Id":2320961,"DisplayName":"Nic3500"},{"Id":5947043,"DisplayName":"ADyson"}],"SiteSpecificCloseReasonIds":[13]} |
You need to use a colourspace that sets the gamma correctly for display on your device. Try:
convert -colorspace sRGB img0001.pcd img0001.tif
You might also be interested in getting images larger than the base 512 × 768 size. In that case you can add a suffix to extract the larger versions. Depending on what ... |
If you don't declare the class, PHP >=8 creates a fatal error.
Is there a short form for nested classes?
`$obj -> key1 -> var1 = "quick and easy"; `
Or is this the only possible way:
```
$obj = new stdClass();
$obj -> key1 = new stdClass();
$obj -> key1 -> var1 ="nasty";
```
respectively
```
$obj ... |
I am pulling a date in from an excel file and it comes in as a string. When I export the date to a new excel sheet, I am not able to perform math functions on it i.e. subtract the date cell from another date cell. I am trying to convert the incoming date to something I can work with on the new excel sheet and am runnin... |
Convert date string into a number in Python |
|python|date| |
null |
```
import os
import json
import requests
import pandas as pd
from tqdm.notebook import tqdm
streamings = dict(
amazon='amp',
disney='dnp',
darkmatter='dkm',
rakuten_viki='vik',
hbo='hbm',
netflix='nfx',
hulu='hlu',
paramount='pmp',
funimation='fmn',
crunchyro... |
[{
"service": "abc",
"capability": "s"
},
{
"service": "def",
"capability": "s"
},
{
"service": "abc",
"capability": "v"
},
{
"service": "def",
"capability": "v"
}
]
The api data is returned with capability ke... |
I simply do in my code :
```scala
df.write.parquet(...)
```
It's a simple HDFS writing of Parquet files from a given Dataframe, at the end of the spark app.
When running the app, I get a `task failed while writing rows` Exception, caused by a `futures timed out`, as you can see bellow :
[![TimeoutException:... |
Mido Library Not Taking Inputs From MIDI Keyboard |
|python|midi|mido| |
null |
I'm working on a web application where users can search for data and paginate through the results. I've implemented search functionality, allowing users to search for specific data and sorting functionality to sort the results based on certain criteria.
However, I'm facing two main issues:
Search State Persistenc... |
Maintaining search and sort state across paginated results in web application |
{"OriginalQuestionIds":[24644436],"Voters":[{"Id":446594,"DisplayName":"DarkBee"},{"Id":1116230,"DisplayName":"Nico Haase"},{"Id":13376511,"DisplayName":"Michael M."}]} |
ok, heres whats wrong with your code
1. after assigning the srcObject of a video element you have to call play
2. in the setInterval function you get the image data in your let statement but you havent drawn anything to the canvas yet, although it would be available in the second iteration
3. when you actua... |
We've got an AWS EC2 hosted site, and we're trying to add a CloudFront Distribution infront of it. Everything works fine in our staging environment, but when we pointed the production DNS to CloudFront, a handful of users complained that the site would no longer load.
I realize this is lacking in detail, but it's a... |
Switch to Cloudfront CDN causing issues for small number of users |
|amazon-ec2|amazon-cloudfront| |
null |
|assembly|arm| |
i am trying speed up my implementation of rolling zscore.
What I'm doing: I've a matrix features (nxm). And each column of features I wanna apply a rolling window that are different from one column to the other.
So right now, i 'm doing:
- for each row >= maximum rollong window
- for each column of feature
- ... |
MYSQL Subtracting values between rows where the subtracted number is displayed along with the rows from which it is subtracted |
|mysql| |
null |
I think the problem stems from how you're reducing the polygon's points. (You're forming a triangle with the first three points and then removing the second point from the list for the next recursion.) While this should *theoretically* work for convex polygons, ensuring that all triangles are valid, it doesn't handle t... |
null |
This error appears if someone is installing a full raspberry pi os for whatever reason.
So just `run sudo apt install rpicam-apps-lite` and after that try again
the problem solved, this is for everyone who experience this problem.
[image of the error at install crowsnest from kiauh][1]
https://github.com/dw-0... |
You can trade your `select` for an [`update..returning`][1] that targets the same row, but updates it based on your conditions, then returns the new values:
```pgsql
WITH t AS (
UPDATE task_pool
SET status=case when status=0
then 1
else status
... |
I had a same issue and tried to ask the community in [GitHub Here][1] and waiting for the answer.
For now I've solved my problem this way :
Add this link to the **\<head\>** of **Layout.razor** or **App.razor**
<link rel="stylesheet" href="_content/Microsoft.AspNetCore.Components.QuickGrid/Microsoft.As... |
SparkException: Task failed while writing rows, caused by Futures timed out |
|apache-spark|databricks| |
My intention is to have:
- A kafka producer and exposes an API to send messages, running in a container
- A kafka consumer running in another container
- zookeeper running in another container
- kafka server running in another container
For the last two I use https://github.com/conduktor/kafka-stack-docker-compo... |
I'm using devextreme vue, I'm trying to implement asynchronous loading in a select component.
I create a customstore like this
const loadDataSource = (searchValue: string) => {
if (!asyncSettings.value) return
const asyncFunction = asyncSettings.value.asyncFunction
const asyncName = "asyncName"... |