instruction stringlengths 0 30k ⌀ |
|---|
Unable to deploy to GAE from Github Actions |
|node.js|google-cloud-platform|google-app-engine|github-actions| |
[Bun.js][1] has a [useful native API to read periodical user input][2]:
```js
const prompt = "Type something: ";
process.stdout.write(prompt);
for await (const line of console) {
console.log(`You typed: ${line}`);
process.stdout.write(prompt);
}
```
Is there a way to read user inputs, outside a loop?
... |
Combining multiple Find and Replace functions into one |
|google-apps-script| |
I am working on a virtualised data grid for my application.
I use transform: translateY for the table offset on scroll to make table virtualised.
I developed all the functionality in React 17 project, but when migrated to React 18 I found that the data grid behaviour changed for the worse - the data grid started to b... |
Why is this String suddenly null in my chat_gpt_sdk run? |
|flutter|dart|chatgpt-api| |
null |
I'm trying to create a picker to select a ShoppingCategory from a menu. However, when displaying the menu, none of the images show up besides the selected image. The user can still click on the empty cells, but no images are displayed.
Here's the view code:
```
@State private var category: ShoppingCategory?... |
Why aren't images appearing inside of SwiftUI's Picker? |
|swift|swiftui|picker| |
null |
- See this [answer][1] for the correct way to pass positional arguments to the seaborn plotting API.
- Dataframes passed to seaborn should be tidy (long-form), not a wide-form, which can be implemented with `pandas.DataFrame.melt`, as shown in the answers to this [question][2].
- Seaborn’s preferred approach is to ... |
I've the following string containing HMTL. What would be sample code in JavaScript to remove leading and trailing white spaces that would appear in the rendering of this string? In other words: how can I obtain a string that would not show any leading or training white spaces in the HTML rendering but otherwise be iden... |
I want the `addNumbers` function to always return a number, adding `b` or `c` to `a`. Argument `a` is always required, `b` and `c` are required, but [mutually exclusive][1], meaning only `b` or `c` should be passed, but not both at the same time.
I tried:
```ts
function addNumbers1({
a,
b,
c,
}: { a: num... |
SQL Server: Joining Multiple Columns to the Same DIM Table |
|sql-server| |
I'm working on writing some tests for a function that takes some user supplied data and returns a JSON string based on a template. Up until now, I have simply been doing assertions that compare the entire output string against an 'expected' json document. It works, but the tests are brittle. Any change to the output re... |
I have an HTML table with the following structure:
```
<table>
<thead>..</thead>
<tbody>
<tr>
<td>some</td>
<td>content</td>
<td>etc</td>
</tr>
<tr class="certain">
<td><div class="that-one"></div>some</td>
<td>content</td>
<td>etc</td>
</tr>
several other rows...
<tbody>
</tabl... |
I need to extract info from a professional experience section like the following and store the result in a dataframe.
https://www.linkedin.com/in/maxlvsq/details/experience/
[enter image description here][1]
I have been reading about how to do it, including this stack overflow thread: https://stackoverflow.com/que... |
Image: https://i.stack.imgur.com/3dIm0.png
I have a method called Background Blur, but it completely blurs the background of the window, and even if the window is transparent, the corners of the window look bad. How can I ensure that this is applied only to the background of the border?
Blur.cs:
```
namespa... |
Depending on what exactly you mean by "the text", you probably want the [`get_body` method.](https://docs.python.org/3/library/email.message.html#email.message.EmailMessage.get_body) But you are thoroughly mangling the email before you get to that point. What you receive from the server isn't "HTML" and converting it t... |
Thats my first post on stackoverflow so i hope i'm doing this properly, if not let me know.
i have a problem with the code, but i cant see were. The CS50 check gives me un output error:
**
*":( encrypts "This is CS50" as "Cbah ah KH50" using yukfrnlbavmwzteogxhcipjsqd as key.
Cause:
output not valid ASCII text"*... |
I figured it out. The issue was the script was running before the loading js was. I couldn't change the order of the code in the theme, so I added a delay when the code is run on click.
// Update reveal with all .post-list-card items
function updateReveal() {
setTimeout(function() {
const... |
I solved the problem.
This configuration is for window, but I think it will have been working on Linux too.
You need to configure 3 files.
--------------------
1-httpd.conf
2-httpd-vhost.conf
3-httpd-ssl.conf
General rules
do not use 0.0.0.0:80
do not use 0.0.0.0:443... |
#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;
... |
```
void _rotateScreen() {
final currentOrientation = MediaQuery.of(context).orientation;
if (currentOrientation == Orientation.portrait) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitDown,
]);
} else {
SystemChrome.setPreferredOrientations([
... |
Flutter rotate the screen |
|android|flutter|rotation|screen| |
null |
I am trying to make an animation where n points are equally distributed around a circle and an animation displays the permutations of those points by swapping their positions simultaeneously .
My issue is that when the animation ends either one of the points disappears from the scene or two distinct points get se... |
Indeed, KeyboardAvoidingView is not always easy to handle. Here are a few ideas:
1. Try to use KeyboardAvoidingView without absolute positioning. If needed, wrap such view in another that uses `position: absolute`, but leave this one with relative positioning.
2. Try replacing `behaviour={"position"}` with `paddi... |
I want the `addNumbers` function to always return a number, adding `b` or `c` to `a`. Argument `a` is always required, `b` and `c` are required, but [mutually exclusive][1], meaning they are not to be passed at the same time.
I tried:
```ts
function addNumbers1({
a,
b,
c,
}: { a: number } & (
| { b: n... |
Swap method results in disappearing points in Manim scene |
|animation|permutation|swap|manim| |
null |
I wrote the code using the pyautogui library. I tried to compile the file using modules such as pyinstaller, nuitka, auto-py-to-exe, but when opening the resulting file it gives the error "No module named pyautogui". How can I import this library into an exe file so that everything works and there are no errors?
I w... |
Error "No module named autopygui" after opening the compiled exe file |
|python|python-3.x|pyinstaller|auto-py-to-exe|nuitka| |
null |
Question:
Given an integer array S of length N(N=100,000),there are M(M≥2) workers concurrently accessing and updating S.Each worker repeats the following operation 10,000 times:
Generate random numbers i and j, 0≤i, j<100,000. Update S such that S(j)=S(i)+S(i+1)+S(i+2). If i+1 or i+2 is out of bounds, then use (i+1)... |
The problem of "fine-grained locks and two-phase locking algorithm" |
|c++|multithreading|locking| |
null |
I'm making a YouTube downloader. A bug has come up with playlists and I want it to check if the inputed link is a playlist. This is done by checking for the presence of `list`. So, I copied my normal `if` statement and ran it, but it didn't like this:
```shell
if "%link:list=%" == "%link%" goto Playlist
```
I t... |
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 {
... |
|python|pyqt5|qlabel|qwidgetaction| |
Joining Multiple Columns to the Same DIM Table |
|sql|sql-server| |
I have an HTML table with the following structure:
```
<table>
<thead>..</thead>
<tbody>
<tr>
<td>some</td>
<td>content</td>
<td>etc</td>
</tr>
<tr class="certain">
<td><div class="that-one"></div>some</td>
<td>content</td>
<td>etc</td>
</tr>
several other rows...
<tbody>
</tabl... |
Basically, this is a Bash/shell question. Let's talk about this variable:
```
'JAVA_TOOL_OPTIONS' : '-Djavax.net.ssl.trustStore=${TRUSTSTORE} -Djavax.net.ssl.trustStorePassword=${TRUSTSTORE_PASSWORD}'
```
First, you need to understand who expands (replaces) the strings of the form `$FOO` at which point in time. I... |
I figured out what was going on here. On macOS you need to load some specific extensions that are not loaded by default because macOS doesn't have native support for Vulkan.
Turns out that the environment variables *do not matter at all*.
It was all about loading the proper extensions. This is the code with the e... |
I think I found the solution.
This is the new configuration inside `editorTheme`:
```javascript
editorTheme: {
projects: {
// To enable the Projects feature set this value to true
enabled: false
},
palette: {
catalogues: [ // Alternative palette... |
So i'm trying to replicate a very fast C library which basically preallocates X amount of bytes to accomodate 99% of the use cases.
Data comes in, if size needed is less than X then it uses a stack pre-allocated buffer. If it doesnt the C library uses malloc.
I'm trying to do the same with rust but i think i'm us... |
Single-instanced struct with maybe preallocated databuffer |
|rust| |
Somewhen I wanted to create a case insensitive autoloader, so I used the Example here:
https://www.php-fig.org/psr/psr-4/examples/
... and modified it a bit.
I added a method to create pattern for `glob()`. It creates a pattern where every single char exists in uppercase and lowercase, as long it differs in case... |
|windows|if-statement|batch-file|special-characters|variable-expansion| |
I was developing a simple application to learn redis caching. Until I add redis as a caching mechanism on spring boot project the API's works fine. **REST** project you can say. Using Postman for calling different API. After adding redis I saw that `@CacheEvict` which is used for deleting data works fine. But when I ca... |
Cannot serialize (Spring Boot) |
|java|spring-boot|caching|redis|postman| |
This is some kind of bug in SwiftData since you are not doing anything wrong.
The issue is that your `CarMakeView` has a property `make` of type `CarMake` but you are not updating that property directly but via the relationship and this means that the view doesn't see anything dependent being updated and has no reas... |
I want to be able to generate a (pseudo)random binary sequence (for example, a sequence of Rs and Ls like RLLRRLR) which is counterbalanced such that the same item does not occur more than twice in a row in the sequence and if I, for example, have a sequence of 20, I get 10 of each. Is there a function in R that can do... |
Generating a pseudorandom binary sequence where the same number does not occur more than twice in a row |
I'm trying to write tests to see if a form is posting data properly. Specifically I'm trying to test that form data (name and phone_number) are being sent to a contact info form for takeout. I keep running into an error that I think is due to the fact I'm using FormField and I'm not sure what the correct data to send i... |
How can I test a post request to a wtform that uses FormField in flask? |
|unit-testing|flask|wtforms| |
null |
I'm running a set of tests on the database using `.directory(TEST_DIRECTORY)` as instructed [in the docs](https://docs.objectbox.io/android/android-local-unit-tests). There's a `setUp()` and a `tearDown()` for `@Before` and `@After`, respectively.
I test the following cases:
1. queries on the database return empty ... |
Coroutine tests break automatically assigned id for ObjectBox Entity in Kotlin Jetpack Compose |
In Rust, I have created a struct Foo. I now want to initialise that from a string using a macro, for example:
```rust
create_struct!("Foo");
```
I am struggling to do this - any help would be hugely appreciated! Thanks.
src/main.rs:
<!-- language: rust -->
pub struct Foo {
}
// ... |
Now I am writing Fortran on Notepad++, and every time I want to execute my program (namely, test), I would open cmd, change the path to current dictionary, type ``gfortran test.f90 -o test``, finally type ``test.exe`` again. I wonder if there is a simpler way for execution, so that I can run Fortran with the click of a... |
I need to generate a distance matrix with the geographic (Euclidian) distances between 48 points sampled in a regular grid with exactly 120 centimeters between neighbouring points both vertically and horizontally:
[![Sampling matrix][1]][1]
Thus, the distance between sample 1K (cell A1) and both 1NP(cell A2) a... |
How to generate a regular matrix of 48 samples with distances between them in Euclidian values in R? |
|r|distance-matrix| |
I updated Flutter to 3.19. Then when I try to run the iphone15 simulator I get the following error. what should I do?
Error: The pod "Firebase/Firestore" required by the plugin "cloud_firestore" requires a higher minimum iOS deployment version than the plugin's reported minimum version.
To build, remove... |
In my Api Platform Symfony Application, I have a class called `Membership`, which represents a many-to-many relationship between Users and Communities. It contains only two routes: DELETE, for user leaving a community, and POST, for joining.
`Membership` entity class:
```php
#[ORM\Entity(repositoryClass: Membe... |
How can I connect to a local SSAS (OLAP) server from Python? |
I'm facing intermitents 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`.
... |
I have a group of items that I'm running an animation on. After clicking on a button, more items are added with the same class. These items are being added in groups of 4.
At first intersection observer ignores the new items, but if I click the button again, they work.
The funny thing is, my code works as intende... |
Fluent bit v3.0.0 is configured on Ubuntu 22.04.3 LTS and on Windows server 2016 standart. The configs (fluent-bit.conf, parser.conf) on these linux and windows machines are absolutely the same. however I ran into a problem. The modify filter works correctly only on a Windows machine and does not work on Linux.
Flue... |
|kotlin|objectbox| |
I have a large CSV file without a header row, and the header is available to me as a vector. I want to use a subset of the columns of the file without loading the entire file. The subset of columns required are provided as a separate list.
*Edit: in this case, the column names provided in the header list are importa... |
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/3uUjE.png
In this image, which is from figma. There is keypad on screen, which, when entered shows up in that square box. How do I make it? |
How to make such functioning screen like this in flutter? |
|flutter| |
I have Magento CE 2.4.6 running on a ubuntu server with Elasticsearch 8.11.4.
For a mandatory module I absolutely need, I need to downgrade to ES 7.9.3
I read everywhere it was not possible to downgrade ES.
Is there a way to uninstall ES 8.4.11 and install ES 7.9.3 wihtout damaging the system?
If yes, how?
... |
Magento 2.4 : how to change server Elasticsearch version? |
|elasticsearch|magento2| |
Getting RedisConnectionFailureException intermittently |
I have an esp32 and i wish to use it to drive a HC-SR04 sonar module. I use interrupts to get information from sensors,then I use a queue to pass the data to a freertos task to output it. At first, it work and output the correct data, but after few second, it report an error and reboot.
Here is the error:
Guru ... |
it's my test code
```
public class Test {
public static SoftReference<byte[]> cache = new SoftReference<>(new byte[0]);
public static List<byte[]> list = new ArrayList<>();
public static void main(String[] args) {
try {
func();
} catch (OutOfMemoryError e) {
... |
Java SoftReference: Soft references were not collected before the occurrence of OOM |
|java|garbage-collection|soft-references| |
null |
I have recently started working on a Spring Boot project and chose MongoDB as my database. I have the following Document structure.
Following is the User document structure.
```
@Data
@Builder(setterPrefix = "with")
@Document(collection = "users")
@JsonIgnoreProperties(value = {"password", "createdAt", "updat... |
Spring Data Mongo Property Expression Query not returning any results |
|mongodb|spring-boot|spring-data-jpa|mongodb-query|spring-data-mongodb| |
null |