instruction stringlengths 0 30k ⌀ |
|---|
I don't understand why my Node.js code is not executing concurrently |
|node.js| |
null |
I've verified I am recording an audio file correctly. I would now like to send it to open ai for speech to text. Here is my nextjs code pages/api/speechToText.js file:
import { OpenAI } from "openai";
const openai = new OpenAI(process.env.OPENAI_API_KEY);
export const config = {
api:... |
Is it possible to format a chart axis label with leading 'figure spaces'? |
|.net|charts|string-formatting| |
ok, so, ill apologise first, I am quite new to python and this is going to be a easy fix I'm sure, I just cant see it, I am so used to C#, anyway here it is, hopefully someone can point out my flaw
I have a domain dataclass:
from pydantic import BaseModel
from pydantic.dataclasses import dataclass
... |
I think you are doing the deletion wrong.
This code should work correctly without errors:
```js
import React from 'react';
import { Routes, Route } from 'react-router-dom';
import HomePage from './HomePage';
import PlanTripPage from './PlanTripPage';
import NavBar from './NavBar';
import ItineraryPage from '.... |
I am trying to have the album images for each of the top tracks shown next to their song but no matter what I do they are showing up as little green boxes.
[Photo of What's Happening][1]
Here is the relevant code:
```
public void onGetUserProfileClicked() {
if (mAccessToken == null) {
Toast.make... |
In case you need to cancel one of the jobs it would probably be easier to use separate stages.
Or, if you need to choose which job(s) to run at queue time, use boolean pipeline parameters.
## Running jobs in the same stage
The trick is to add boolean pipeline parameters for each job type and select which jobs ... |
I'm trying to compile an eBPF program inside a Docker container based on an ARM64 Ubuntu 20.04 image. I'm encountering a compilation error where the `clang` compiler cannot find the definition for the `__u64` type, which should be provided by the kernel headers. Here's the error I'm getting:
```
/usr/include/bpf/bp... |
Compiling eBPF program in Docker fails due to missing '__u64' type |
|c|linux|docker|ubuntu|ebpf| |
{"Voters":[{"Id":3518383,"DisplayName":"Juraj"},{"Id":522444,"DisplayName":"Hovercraft Full Of Eels"},{"Id":354577,"DisplayName":"Chris"}],"SiteSpecificCloseReasonIds":[18]} |
|string|google-sheets| |
I write code for the ESP32 microcontroller.
I set up a class named "dmhWebServer".
This is the call to initiate my classes:
An object of the dmhFS class is created and I give it to the constructor of the dmhWebServer class by reference. For my error see the last code block that I posted. The other code block could ... |
```
const express = require('express');
const router = express.Router();
const db = require('../db'); // Import MySQL connection
// Handle GET request to the root URL
router.get('/', function(req, res) {
// Query to count the number of rows in the products table
db.query('SELECT COUNT(*) AS productCount FR... |
The top rated answer does not work with the new Reflection implementation of [JEP416](https://openjdk.org/jeps/416) in e.g. Java 21 that uses MethodHandles and ignores the flags value on the Field abstraction object.
One solution is to use Unsafe, however with [this JEP](https://openjdk.org/jeps/8323072) Unsafe and ... |
I'm trying to connect to a postgres database using Adminer.
Here is my Makefile:
```
.PHONY: postgres adminer migrate
postgres:
docker run --rm -ti -p 5432:5432 -e POSTGRES_PASSWORD=secret postgres
adminer:
docker run --rm -ti -p 8080:8080 adminer
migrate:
migrate -source file://migrations... |
Can't connect to postgres with Adminer using Docker |
|postgresql|docker|makefile|adminer| |
null |
> Is it possible to correctly document the mixin?
Apparently not, The mixin's methods (URL helpers) remain undocumented by YARD unless manually documented elsewhere in your project's documentation.
[John Bachir](https://stackoverflow.com/users/168143/john-bachir) mentions [`lsegal/yard` issue 1542](https://github... |
Products aren't displayed after fetching data from mysql db (node.js & express) |
|mysql|node.js|express| |
null |
Alert! I am feeling so embarassed asking such an entry level question here!!!!
Hey guys, I have been working on a project that involves timeseries total electron content data. My goal is to apply statistical analysis and find anomalies in TEC due to earthquake.
I am following this research paper for sliding IQR ... |
Need help realigning python fill_between with data points |
|python|pandas|outliers|rolling-computation|anomaly-detection| |
null |
Here is a script I use to find out which namespaces have problem pods and what the problems might be. I call the script `notrunning`
```sh
kubectl get po -A --no-headers |
awk '
BEGIN {
SUBSEP=" "
format = "%-20s %20s %5s\n"
printf format, "NAMESPACE", "STATUS", "COUNT"
}
!/Running/ {a[$1... |
**mapper.py:**
#!/usr/bin/env python
import sys
for line in sys.stdin:
parts = line.strip().split(',')
article_id = parts[0]
section_text = parts[3]
for term in section_text.split():
print(f"{term}\t{article_id}")
**Reducer.py:**
#!/usr/bin/... |
I am trying to build something simple with Selenium but cannot get it off the ground at all
I have the below code:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import os
os.environ['WDM_... |
I am trying to program a COM object with the Enumerable and Enumerator inside in Delphi. It's a nightmare.
First in the .ridl file:
[![enter image description here][1]][1]
next in the _tlb.pas I have this:
// *********************************************************************//
// Interface : ITracki... |
How to program a COM object with an IEnumerator, IEnumerable interface inside |
|delphi|com| |
Upon looking and researching online it does seem that there a numerous way of doing this but not sure if it fits the way that I want it for. Personally I would still like my dates as this format "3/30/24". I am extracting data from some which has numerous amount of data and everything works as expected but when I tried... |
I'm defining the following flag for my CLI in Golang:
```go
var flags flag.FlagSet
phoneRegexp := flags.String("phone_regexp", "", "custom regex for phone checking.")
```
But, it fails when I'm passing the following argument:
```
./cli --phone_regexp='^\d{1,5}$'
cli: no such flag -5}$
```
While I un... |
Python is an interpreted language.
When you write something like:
```
print("1"*n)
```
The Python interpreter performs a loop internally.
It is more efficient in Python because the interpreter is usually written in a compiled language like C (or C++) and so the loop is more efficient when done internally.
... |
If you run with strace:
$ strace -fe execve bash -c 'exec -a fake ./test.sh'
execve("/usr/bin/bash", ["bash", "-c", "exec -a fake ./test.sh"], 0x7ffd9c557aa0 /* 56 vars */) = 0
execve("/home/xxx/test.sh", ["fake"], 0x58fc3a91a130 /* 56 vars */) = 0
# /home/xxx/test.sh #
you will notice that... |
It's a bit late for answers to this post, but could be useful to someone getting tired of IBApi which is still got so many complications and they add up more in each versions. I tried IBApi_insync which is better to use IBApi asynchronously. I tried a few myself and updated here,
[https://github.com/cosmoarunn/ib_... |
|c#|asp.net-core|.net-6.0| |
I get an error response when a full simple logistic model is run in R. However this only occur when I include SHTCVD191_A (which is not the variable with the most missing values). Including the variables with the most missing values SHTCVD19NM_A and SHOTTYPE_A without SHTCVD191_A (which is integral to the study) runs ... |
How do I fix the response: Error in contrasts in R |
|error-handling|glm|contrast|binomial-coefficients| |
null |
|oracle|plsql| |
I'm encountering an issue while trying to scrape data using Puppeteer Cluster and write it to an Excel file using Excel4node.
Here's a summary of the script's functionality:
I'm using Puppeteer Cluster to scrape data from multiple URLs concurrently.
For each URL, I scrape various pieces of information from the w... |
{"Voters":[{"Id":472495,"DisplayName":"halfer"},{"Id":354577,"DisplayName":"Chris"},{"Id":522444,"DisplayName":"Hovercraft Full Of Eels"}],"SiteSpecificCloseReasonIds":[13]} |
|unity-game-engine|input| |
I am attempting to dynamically update filters in my shiny app. For example, if one selects `California` as a state then the only cities that populate in the City filter should be cities from California.
However, if I select `California`, the code shows all the cities in the dataframe regardless if they are in Califo... |
{"Voters":[{"Id":874188,"DisplayName":"tripleee"},{"Id":354577,"DisplayName":"Chris"},{"Id":522444,"DisplayName":"Hovercraft Full Of Eels"}]} |
{"Voters":[{"Id":11810933,"DisplayName":"NotTheDr01ds"},{"Id":874188,"DisplayName":"tripleee"},{"Id":522444,"DisplayName":"Hovercraft Full Of Eels"}],"SiteSpecificCloseReasonIds":[13]} |
While there is no built-in way to remove page reloads from your analytics, there are a few approaches that will allow you to separate analytics from reloads from the others.
The easiest to implement would be to add a parameter to your URL in case your page is reloaded. This can be done with `PerformanceNavigationTim... |
this is my controller challenges.php
```
<?php
include("../../tbs_3150/tbs_class.php");
include("../connect.php");
$tbs = new clsTinyButStrong;
try {
$pdo = new PDO($host, $login, $password);
$message = "connexion établie";
if(isset($_GET["category"])){
$r... |
null |
null |
I have a table with a varchar column that is formated as json. I want to query my table by json. This is achievable with SQL
```
SELECT *
FROM [db].[dbo].[table]
WHERE JSON_VALUE(ColName, '$.jsonkey') = "value"
```
Is it posible with GraphQl and Hot Chocolate?
I tried
```
public IQueryable<Class> Ge... |
edSubject.aggregate([
{
$match: {
stageid: stageid,
boardid: boardid,
scholarshipid: scholarshipid,
},
},
{
$lookup: {
from: "edcontentmasterschemas",
let: {
stageid: "$stageid",
subjectid: "$subjectid",
... |
I run multiple (400 python processes at once)
I start new one each 1.5 sec and repeat
I found that sometimes my CPU usage goes 100%
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/8KTim.png
While sometimes it is as low as 30%-50%
I need to understand what push it so high, is it ... |
Python process CPU usage going high suddenly. how to detect the place? |
|python|cpu| |
{"Voters":[{"Id":5468463,"DisplayName":"Vega"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[18]} |
## The Really Easy Way to Generate SwiftUI Custom Shapes
[](https://i.stack.imgur.com/fPUBP.png)
### Why would I do this?
As developers we, sooner or later, find ourselves wanting to add some clever custom shape to our application user interfa... |
Overview
========
This is a very interesting question with a surprising number of answers. The "correct" answer is something you must decide for your specific application.
With months, you can choose to do either *chronological computations* or *calendrical computations*. A chronological computation deals wit... |
It's likely that Firefox is not looking for your `userChrome.css` on startup.
1. Open up a tab and navigate to `about:config` and click `Accept the Risk and Continue`.
2. In the `Search for Preference` box type `userprof`.
3. It should find the `toolkit.legacyUserProfileCustomizations.stylesheets` option. Just cli... |
{"Voters":[{"Id":238704,"DisplayName":"President James K. Polk"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[13]} |
{"Voters":[{"Id":5910058,"DisplayName":"Jesper Juhl"},{"Id":1940850,"DisplayName":"karel"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[13]} |
In Angular Material 15, you can use `subscriptSizing="dynamic"`.
```html
<mat-form-field class="w-full" appearance="outline" subscriptSizing="dynamic">
</mat-form-filed>
```
Result:
[![result][1]][1]
[1]: https://i.stack.imgur.com/9KZcE.png |
{"Voters":[{"Id":11683,"DisplayName":"GSerg"},{"Id":1940850,"DisplayName":"karel"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[18]} |
{"Voters":[{"Id":1126841,"DisplayName":"chepner"},{"Id":1940850,"DisplayName":"karel"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[18]} |
I'm trying to estimate the potential reach of my Facebook ad campaign using the Reach Estimate API, but I need to input the budget as a parameter. However, it seems the endpoint doesn't accept budget as a parameter. Can anyone advise on how to accurately estimate reach while specifying the budget
I attempted to use ... |
We inherited a site with zero version control / no info on how it was built - only enough info to ssh onto the server. We want to add git, so we can start developing locally and pushing updates via git.
What's the best way to do this, without breaking anything?
My first inclination is to create a blank repo on gi... |
Best way to add git to existing project |
|git|deployment|version-control| |
Let's say I have an example data set like this. My real data is much larger.
df <- data.frame(ID = rep(c(1:8),each = 8 ),
var1 = factor(rep(rep(c('1','2'), each = 4),8)),
var2 = factor(rep(c("EXP", "CTR"), 32)),
var3 = factor(rep(c('X','Z','Z',... |
Calling `NestedReference.builder()` should work.
Which version of Java and Lombok are you using?
Have you tried calling the `NestedReferenceBuilder` constructor directly?
```java
public static NestedReference of(ReferenceId referenceId) {
return new NestedReferenceBuilder()
.referenceId(refe... |
This is the error I'm getting:
```
2024-03-15T10:05:58.263-04:00 INFO 12408 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1828 ms
2024-03-15T10:05:58.356-04:00 ERROR 12408 --- [ main] com.zaxxer.hikari.HikariConfig : F... |
Spring Boot - Application Fails to run. I thought it had to do with my datasource setup but now I think it a dependency issue |
|c++|compiler-errors|comparator|priority-queue| |
{"Voters":[{"Id":1431720,"DisplayName":"Robert"},{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[18]} |
I'm trying to set up a little python script showing me e.g. my current CPU temperature. I imported psutil to do so. As mentioned in the [psutil documentation](https://psutil.readthedocs.io/en/latest/), I tried the command `psutil.sensors_temperatures(fahrenheit=False)`. Nevertheless, the only output of the program is `... |
{"OriginalQuestionIds":[32170456],"Voters":[{"Id":341994,"DisplayName":"matt","BindingReason":{"GoldTagBadge":"swift"}}]} |
I am developing a project where we have a Java Spring backend server connecting with a front-end page through endpoints.
At the moment in one of our endpoints we are sending an image url to be represented in the frontend. Currently we can see some performance issues on the frontend when loading the images as the si... |
--summary-interval=SEC
Set interval in seconds to output download progress summary.
Setting 0 suppresses the output. Default: 60
https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-summary-interval |
Here is an example to break a string into multiple lines in a @dataclass for use with QT style sheets. The end of each line needs to be terminate in double quote followed by a slash, except for the last line. Indentation of the start of each line is also critical.
`@dataclass
class button_a:
i: str = "QPus... |
I have an Order model that contains Items
```
@Model
class Order: Decodable {
@Attribute(.unique) var orderId: String
var items: [Item]
}
```
When inside the list view, I fetch all the orders, the Items are not loaded and shows empty
var body: some View {
List {
DynamicQuery(orderDescriptor) {... |
How can I estimate the reach of my Facebook ad using the Reach Estimate API while specifying the budget |
|api|facebook|meta| |
null |
I'm encountering a persistent "UserWarning" during the execution of my Python code and have been unable to suppress it despite trying various methods. I'd appreciate some guidance on resolving this issue.
Here's the context:
I have a function in my code called get_water_data, which downloads water data and perfor... |
Need assistance suppressing specific UserWarning in Python code execution |
|python|warnings|geopandas| |
So if you tell me that your Subscriptions are created using Stripe Checkout, then you have a perfect solution.
If not, you still have a solution, but is awkward enough...
If you create your Checkout Session from the backend, then you can just use this code to create variable Products with a custom name:
... |
SQL Json_value alternative in GraphQL with Hot Chocolate |
|sql-server|graphql|.net-6.0|hotchocolate|json-value| |
null |
I had a similar problem with mui-one-time-password-input and I solved it by changing the version of the library to an older one |
embedPy needs to make a call to Python.
It tests `python3` first and if that fails it tries `python`.
You can test on your command prompt to check if they run:
```
C:\Users\rianoc>where python3
C:\Users\rianoc\AppData\Local\Microsoft\WindowsApps\python3.exe
C:\Users\rianoc>where python
C:\Users\rianoc\Ap... |
There is no need to clone the stream (which has a performance impact and is not always possible as not all types are cloneable), and certainly no need for unsafe. We just need `BufReader` and `BufWriter` that forward `Write` and `Read`, respectively, to their inner stream. The default ones in std do not do that, but th... |