instruction stringlengths 0 30k β |
|---|
How do you turn on flags for a capturing subgroup using re2 regular expressions with BigQuery |
|regex|google-bigquery|re2| |
Use a nested capturing group within the non-capturing group like this
`(?is:(My name is ))(\w+)`
`REGEXP_REPLACE(str, r'(?is:(My name is ))(\w+). ', r'\1 C')` |
That is a **very** bad idea. A randomized delay would change the ordering of the packets passed between the layers. That is definitely something that does not happen in real life systems. A fixed, non-random delay may or may not be ok.
INET supports modeling processing delay in Switches where it models the processin... |
I am creating a report for Business Central and unfortunately this change can't be made within AL so I'm having to try an expression change for the field in RDLC.
The field is currently, =Fields!HighDescription.Value
I need to get rid of leading values if the value pulled in begins with: RS-BE
Here is what I... |
{"Voters":[{"Id":17303805,"DisplayName":"zephryl"},{"Id":2530121,"DisplayName":"L Tyrone"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[11]} |
QueryAsync returns intermittent errors 'This MySqlConnection is already in use.' and 'Connection must be Open; current state is Connecting' |
|c#|mysql|dapper|pomelo-entityframeworkcore-mysql| |
{"Voters":[{"Id":7758804,"DisplayName":"Trenton McKinney"},{"Id":9214357,"DisplayName":"Zephyr"},{"Id":466862,"DisplayName":"Mark Rotteveel"}]} |
How would I write *n* nested *for* loops without knowing what *n* is?
For example, how would I write the following using recursion or another method?
for (int i = 0; cond1; i++) {
for (int j = 0; cond2; j++) {
for (int k = 0; cond3; k++)
...
for (int l = 0; ... |
Multiple nested 'for' loops without knowing the number of 'for' loops |
I'm facing intermittent issues like:
> This MySqlConnection is already in use.
and
> Connection must be Open; current state is Connecting
They are hard to reproduce but in logs I can see a lot of them.
I'm using the library `Pomelo.EntityFrameworkCore.MySql` and running queries with dapper `QueryAsync`.... |
|asp.net|assembly|dll|.net-4.8|.net-standard-2.1| |
|loops|if-statement|merge| |
Is there a way to make this request with UrlFetchApp in app script?
`curl -X GET http://test.com/api/demo -H 'Content-Type: application/json' -d '{"data": ["words"]}'`
I attempted it with this code:
```
const response = UrlFetchApp.fetch(API_URL, {
method: "GET",
headers: { "Content-Type": "applicatio... |
As [ltk][1] said, you can add shadow. I just show you example with SliverAppBar that worked for me.
```
SliverAppBar(
bottom: PreferredSize(
preferredSize: Size.fromHeight(0),
child: Container(
... |
I have seen a few other questions here but none of them really achieve what I want them to. I guess I'm open to using Javascript or jQuery here, whatever works best.
Question:
I have a page with a link that redirects the user to a FAQ page, if this link is clicked, I want the user to be redirected to the new page A... |
Scroll to DIV on click from another page and open FAQ-dropdown |
|javascript|html|jquery|css| |
import 'package:flutter/material.dart';
import 'package:hlibrary/main.dart';
class Panel extends StatelessWidget {
const Panel({Key? key});
@override
Widget build(BuildContext context) {
return Stack(
children: [
Scaffold(
appBar: AppBar(
centerTitle: fa... |
how can I add list of categories to my body in flutter? please I'm new to it |
|flutter|dart|listview|categories| |
null |
You would create a base `projen` configuration, then make it available for target projects, e.g. as a package published to a shared NPM registry.
When you make changes to the base configuration, you would go to the target repositories, update the package, make any necessary updates, e.g. for breaking changes, re-app... |
DB_CONNECTION=sqlite3
worked for me |
Should I train my model with a set of pictures as one input data or I need to crop to small one using Pytorch |
I wanted to add a modern, functional-style recursive function based on @AndrewMoore's script.
None of the logic has changed. Iterate over all keys of a level. If the value is an array, traverse into the array. Prepend the carried prefix to each encountered key.
`array_map()` version: ([Demo][1])
function ... |
null |
Hovering doesn't want to work by any way.
Code Below: -
```
self.setStyleSheet("""
QMenuBar {
background-color: white;
color: black;
border: 3px solid silver;
font-weight: bold;
font-size: 23px;
}
QMenuBar::item {
... |
I am trying coding a test automation for a mobile application but this application has a restriction about the root devices so when I try running the application on the device, the application take me out.... is there a way to start the mobile on andriod studio as unroot device? |
how to remove the root on a simulate android studio device |
|testing|automation|appium-android| |
I'm buiding a React component that changes state on button click *AND* after some timed interval, after button click, changes back to its original state.
Here is my simple code:
import React, { useState, useEffect } from "react";
const TimedButton = (props) => {
const [user_id, setUserId] = ... |
null |
I have a simple question.
I'm using "**app folder**" in my Next js 14 project.
In the **layout.tsx** file (**can also be page.tsx**) I get data from the server side API and pass it to the child components using props. This gets annoying when there are many nested children components. In addition, I also need to t... |
Next js 14 - prop drilling |
|reactjs|next.js| |
null |
#include <stdio.h>
#include <math.h>
#define MAX_BITS 32
int counter = 0, dec_eqv = 0;
int runcounter = 1;
int binToDec(char *bit)
{
printf("dec_eqv is %d\n", dec_eqv);
if (counter == 0 && runcounter)
{
dec_eqv = 0;
... |
Clang possibly skipping line(s) of code while compiling |
I have tried to isolate my problem in a very simple (and working) project. Let's say I have a simple model with 2 fields, and I have configured its properties and a `PropertyChanged` event. This is a simplified implementation of my model, please notice the last method just gets a new client object from a list and retur... |
Assigning an object to another doesn't raise PropertyChanged event in WPF |
Is your code using the defined `AppDataSource`? I suggest just providing a `ormconfig.json` file with the details. See example with full working stack below.
Assuming that your project is something like this:
```
βββ docker-compose.yml
βββ Dockerfile
βββ ormconfig.json
βββ package.json
βββ package-lock.json
... |
Using VLCKit I am able to display subtitles by setting the current video subtitle index. But I can't find an option in the documentation that allows to change the font and font size. So I have know idea how to increase or decrease the font size.
```Swift
import VLCKit
let player = VLCMediaPlayer()
let media = ... |
VLCKit: How to adjust subtitle font size in Swift macOS? |
|macos|swiftui|subtitle|vlckit| |
The [accepted answer](https://stackoverflow.com/a/71094531/6243352) logs an empty refs array in Vue < 3.2.32:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
const {ref, onMounted} = Vue;
Vue.createApp({
setup() {
const items = [
... |
Architecture: Flask app running in its own container, Celery running in its own container. Message broker is Redis. This is all python btw.
Problem: I cant figure out how to register a class based task with a custom name.
Versions:
```
celery==5.2.7
redis==5.0.3
```
Details: I want to build class based t... |
React setState inside handleClick after setTimeout |
|javascript|reactjs| |
|html|css|html-table|css-selectors| |
i Do this on Ubuntu(WSL on Windown *normaly it should work on Ubuntu*) : `sudo apt install libgl1-mesa-dev` |
Here is one solution assuming that your structure is only 3 levels deep
``` lang-txt
variable "input_list" {
default = {
"a" = {
"a1" = {}
"a2" = {}
}
"b" = {
"b1" = {}
"b2" = {
"b21" = {}
}
}
}
}
locals {
paths = flatten([
for k0 in ... |
What are you trying to do is called _pivoting_, so use [`DataFrame.pivot()`][1]:
```py
import pandas as pd
df = pd.read_csv("your_file.csv", header=None)
out = (
df.pivot(index=1, columns=0, values=2)
.rename_axis(index="ID", columns=None)
.reset_index()
)
print(out)
```
Prints:
```non... |
Given an linear system Ax=b, x = [x1; x2], where A,b are given and x1 is also given. A is symmetric. I want to compute the gradient of x1 in terms of A,b, i.e. dx1/dA, dx1/db. It seems that torch.autograd.backward() can only compute the gradient by solving the whole linear system. But I want to make it more efficient b... |
I have a problem where my table users have:
@OneToMany(mappedBy = "id.utenti", cascade = {CascadeType.ALL}, orphanRemoval = true)
private List<UtentiCatenaRuoli> ruoliUtente = new ArrayList<>();
that is linked to a relation table with 3 foreign keys, user, role and section where role apply.
Using maps... |
Entity relation isn't updated when referencing more than one field |
|spring-boot|hibernate|mapstruct| |
I am trying to create a custom widget for DropDownButton. It seems to work fine. The onChanged() func is also working when I take console print of the changed value.
However, I am not able to view the text in the box after the Onchanged() func.
Can someone let me know what could be wrong with the same?
My code ... |
DropdownMenu Widget issues = Flutter |
|flutter|widget|dropdown|dropdownbutton| |
I was able to solve this issue by installing .NET 6.0 WebAssembly Build Tools. |
You're using a string as `src` instead of the actual import. Use the imports as the `src`.
```
import React from "react";
import ReactLogo from "./image/react.svg";
import TypeScript from "./image/typescript.svg";
import MongoDB from "./image/logo_mongodb_icon.svg";
import JavaScript from "./image/logo-javascript... |
I have a pretty simple queue which happens to have heaps of messages on it (by design). Heaps can be "thousands" here.
Right now I'm playing around with using Azure Web Jobs with a Queue Trigger to process the messages. Works fine.
I'm worried about performance though. Let's assume my method that processes the me... |
I am using the following code to call my REST API from SQL Server but I am getting empty string in the response message. I put a breakpoint in visual studio on getTravelerInfoById method but it is also not triggered. Can you please check and let me know what am I doing wrong?
DECLARE @URL NVARCHAR(MAX) = 'http... |
Calling a REST API from SQL Server |
|sql-server|t-sql|stored-procedures| |
null |
> I'm not a native English speaker, so please try to avoid abbreviations or slang in your answers.
I want to try to declare an abstract class field in a Python base class.
I know that python can declare an abstract object field via `@property` and `@abstractmethod`, but I haven't checked for a viable abstract cla... |
How to register celery class based task with a custom name in 5.x? |
|class|celery|task|naming| |
I hope method with @Transactional of CommandLineRunner, or ApplicationRunner can resolve this problem. Am I right? |
> for POC purposes, as mentioned
I'm using:
- NodeJS v20
- Typescript 5.3
- using [ESM][1]
- stage 3 TC39 Proporsal Decorators
```js
class LambdaFunctionExample {
lambdaResponse = [1, 2, 3]
@tryCatchWrapper
async handler(event) {
const data = this.lambdaResponse;
const result = a... |
I have a large dataset that is difficult to investigate without analysis tools. It's general form is this, but with 16 "ItemType0" columns and 16 "ItemType1", "ItemType2", etc columns.
It represents the properties (many of them) of up to 16 different items recorded at a single timestep, then properties of that times... |
Pandas - Python: Using either melt or wide_to_long for large dataset with inconsistent naming |
|python|pandas|pandas-melt| |
I'm writing a Tkinter program that so far creates a window with a menu bar, a File menu, and a single item. The menu is successfully created, but with two items, the first being one that I did not specify, whose name is "-----".
If I don't add an item, the spontaneous one is still added. This still happens if I spec... |
I ask same question to chatgpt and below code is working for me
import threading
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
def send_whatsapp_message():
# Path to your Chrome WebDriver executable
chrome_driver_... |
You have to make a clean build.
Go to File > Build Settings. Click on the arrow right to the Build button then click on "Clean Build..."
Here's an image[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/jOrJZ.png |
|python|python-3.x|properties|ttkwidgets| |
I need to add a space between the data on the X axis where in the print there are markings in red I need a margin that doesn't let the data touch, I'm using the heatmap to make a graph with a lot of data and I need this to make it cleare, But I couldn't add.
I already looked in the documentation, I couldn't find a f... |
I need to add a space between the X axis data in heatmap echarts |
|heatmap|echarts| |
null |
There are two types of errors can be occured in our server. So try catch block can handle Synchronous errors.
try {
my_function();
}
catch(e){
};
But for asynchronous errors
try {
my_function();
}... |
Use
SELECT `Order ID` FROM Returnedsss;
or
SELECT [Order ID] FROM Returnedsss;
or
SELECT "Order ID" FROM Returnedsss;
The issue is how single quotes are used to enclose a literal value character string in preference to enclosing a component name (column table etc).
|
I was getting the same error. I tried a lot of fixes from the internet but nothing worked but thanks to our teacher, with his help i was able to fix it. so the error i was getting said that
> my worker node has python3.10 while the driver has python3.11
that's not the exact wording of the error but you get the po... |
Let's consider your statement `let mut last = *self.tail;`. As The Rust Reference documents under [`let` statements](https://doc.rust-lang.org/reference/statements.html#let-statements):
> A *`let` statement* introduces a new set of [variables](https://doc.rust-lang.org/reference/variables.html), given by a [pattern... |
In the past, I placed the following code snippet in function.php to speed up the checkout process in WooCommerce:
add_filter( 'woocommerce_defer_transactional_emails', '__return_true' );
However, recently I have not been receiving emails when there are new orders. After removing the above code snippet, ever... |
Not receiving emails after delay in WooCommerce checkout |
The algo is the following:
1. Calculate total size of all items
2. Get size of a group
3. Iterate items and push to groups according to the current sum of item sizes
It doesn't include a case when there's both groups share equal amount of an item.
<!-- begin snippet: js hide: false console: true babel: false... |
I saw this [thread](https://www.reddit.com/r/unrealengine/comments/gpc2hh/ghost_trail_motion_trail_removal/) where they describe an issue that I've been having where the machine struggles with calculating AA so it leaves a ghost trail.
I want to record the viewport and use these as videos so no real time calculation... |
Unreal Engine - Does rendering/baking get rid of any Antialiasing ghosting? |
|unreal-engine4|unreal| |
null |
I was trying to generate a presigned URL for an S3 bucket in the `me-central-1` region using the boto3 library, as demonstrated below
```
client = boto3.client("s3", region_name="me-central-1")
return client.generate_presigned_url(
ClientMethod="put_object",
Params={"Bucket": bucket, "Key": path},
)
... |
Here is a slightly edited version that will work in the expected way:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
$("#test-form").on("input",function(ev){
const checked=$(".form-check-input:checked").get().map(el=>el.value)
$("#selected-cases")... |
Our production pipeline builds fine under Ubuntu 20.x. I don't have access to a 23.x system, but have you tried only installing and running only `hugo` from `hugo-extended` like this:
```console
$ npx -p hugo-extended \hugo version
```
If that fails then the problem is with the [hugo-extended](https://github.co... |
|php|wordpress|woocommerce| |
Based on an image to text analysis of the input, we see the following commands being issued:
sudo /opt/lampp/lampp stop && sudo rm /opt/lampp && sudo ln -s 7.4 /opt/lampp && sudo /opt/lampp/lampp start
Now this is being run in a shell extension. These don't have a terminal associated with them, and thus won't... |