instruction stringlengths 0 30k ⌀ |
|---|
null |
The only thing that comes to mind using height and overflow on exact same elements as you is `line clamp`
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
.parent {
margin: 5px;
max-height: 100px;
max-width: 400px;
... |
I was trying handle message from server by using rsocket-dart package in Flutter
A Server send me message by fireAndForget
Server is Spring boot
Server Code:
`@Scheduled(fixedRate = 10000)
public void push() {
rSocketRequester
.route("api.push")
.data("some push... |
RSocket: How to handle fireAndForget message from server in Flutter |
|spring|flutter|dart|rsocket|spring-rsocket| |
null |
`(a == b) & (c == d)` will return true if all of the conditions are true.
Another way to express this is with [`pl.all_horizontal()`](https://docs.pola.rs/docs/python/dev/reference/expressions/api/polars.all_horizontal.html#polars.all_horizontal)
```python
pl.all_horizontal(a == b, c == d)
```
- [`pl.any_hor... |
{"OriginalQuestionIds":[13618233],"Voters":[{"Id":4108803,"DisplayName":"blackgreen"}]} |
I have Map in Java:
Map<Pair<String, String>, MyClass> myMap;
I need the Pair to **NOT** be case sensitive.
The solution in case of regular string key is simple:
TreeMap<String, MyClass> myMap= new TreeMap(String.CASE_INSENSITIVE_ORDER);
But, what about case of strings-pair key?
I need to comp... |
|python|deep-learning|neural-network|recurrent-neural-network| |
## tl;dr
Call [`List#reversed`][1] for a reversed-encounter-order view onto the original list, without changing the original.
```java
Double l = lat.reversed().get(i); // A different encounter order, but *not* changing the list’s original encounter order.
Double ll = lng.reversed().get(i);
```
## `Seque... |
Alright, so you want to:
1. Rotate the weapon in the mouse direction
2. Shoot the bullets from the weapon
3. Add a recoil force from the shot
There're indeed many methods to implement this, so let me show you how I'd do it my way. I assume you haven't done it yet, so I'll try to explain as clear as I can.
-... |
I added the following to my theme. It may also apply when using styled()
MuiSnackbar: {
styleOverrides: {
root: {
"& .MuiSnackbar-root": {
padding: 0,
},
"&.MuiSnackbar-root.MuiSnackbar-anchorOri... |
It should work like this
```
library(terra)
# do not make a list
red <- list.files(pattern = "red")
nir <- list.files(pattern = "nir")
calc_ndvi <- function(nir, red) {
(nir-red)/(nir+red)
}
ndvi <- list()
for (i in 1:9){
ndvi[[i]] <- calc_ndvi(rast(nir[i]), rast(red[i]))
}
ndvi <- rast(ndvi)
... |
Vite on production is taking assets from `http` despite APP_URL is set to `https://`.
[![enter image description here][1]][1]
How to resolve this in the Vite config? I can't change Laravel AppServiceProvider to force to use https because this would cause other issues.
I use `@vite` directive to get resources, ... |
I'm doing some experiments with direct manipulation of pointers to `PyObject` (and its derivated types) from Cython. Is there a tool or debugging technique that I could use to check I didn't mess up with the reference counting mechanism? Especially, I would like to know when a program terminates if I forget to `Py_DECR... |
How to check reference counting issues when doing direct manipulations of CPython objects? |
|debugging|cython|cpython|reference-counting| |
Build failed.
Error: Expected content key 8e22976280a5d25d to exist
Error: Expected content key 8e22976280a5d25d to exist
at nullthrows (C:\Users\sonuh\OneDrive\Desktop\PetPuja\node_modules\nullthrows\nullthrows.js:7:15)
at AssetGraph.getNodeIdByContentKey (C:\Users\sonuh\OneDrive\Desktop\PetPuja\... |
6 While creating a react app from scratch (without using create-react-app) using parcel bundler, the parcel throws the following error: |
|reactjs| |
null |
There is some additional setup for Reanimated.You can follow steps in doc
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/
I think you're missing ```babel.config.js``` configuration. |
I use quasar framework for development.
In child windows, I cannot call the code of my myWindowAPI, do you know why?
In electron-preload.ts I have this
function createWindow() {
let x, y;
const currentWindow = BrowserWindow.getFocusedWindow();
if (currentWindow) {
const [current... |
Image needs to maintain width between 50-100% and scroll if aspect ratio is greater than 2:1 |
|css| |
I wrote code to call a function from PostgreSQL. In the pgAdmin, I call the function and it works fine.
This is my code in C#:
_db.Database.SqlQuery<CreateOrderInfo>($"select * from Asset_CreateOrderInfo('{request.Data!.UserId}',{request.Data!.SymbolId})")
The generated command is like this:
select... |
|c#|postgresql|entity-framework-core| |
**For the bank transfer (bacs) payment method**, since the store manager manually confirms that the order is paid by changing the order status, you need to use the special ```woocommerce_order_status_changed``` hook.
The status of successful orders can be changed from
1. On Hold to Processing,
2. On Hold to Comp... |
Fire woocommerce_order_status_changed only once |
|php|wordpress|woocommerce|hook-woocommerce|orders| |
Whenever I run my `authorize` callback in NextAuth from my `signIn` function in my page, the result is undefined regardless of what I do. The page also refreshes immediately with the `callbackUrl` query.
- I am using the [Credentials Provider](https://next-auth.js.org/configuration/providers/credentials) from NextAu... |
When using a Room database on an Android application, is it possible to pre-populate data |
|android|kotlin|sqlite|android-room| |
null |
I am the admin on our Heroku account and broke my phone (MFA device). I have been locked out of our Heroku account for 2 weeks and can't get any response from Heroku support? Does anyone know a different way to contact them?
Note: the support website says: "If you have lost your MFA device or are receiving "Accoun... |
How to get Heroku Support to answer an email? |
|heroku| |
I have a ViewPager 2 inside a plannerFragment, which calls 2 fragments: one (localeChoosingFragment) contains a recyclerview for the user to choose a locale, and another to choose places within that locale (localeExploringFragment). A ViewModel (japanGuideViewModel) stores the data (as MutableLiveData), including the i... |
You can add it to your PATH. First evaluate the node path:
sudo which node
In `~/.bashrc` or `~/.zshrc`, add the line with the evaluated node path:
export PATH="node_path:$PATH"
In the end, you need to restart a shell or source the file. |
You can use scikit image. if its a normal tiff file
```
from skimage import io
my_img = io.imread('myimage.tiff')
```
Alternatively if your tiff file is a georeferenced image. You can use gdal
```
from osgeo import gdal
import numpy as np
ds = gdal.Open("myimage.tiff")
myarr1 = np.array(ds.GetRasterBand... |
I recently made a bot that can play music. Now I decided to add a new functionality to it and that is playing the radio.
Everything works great on my PC, but as soon as I upload it to the server. The bot connects and immediately disconnects.
I used `generateDependencyReport()` to generate report.
on PC i get:
... |
I'm developing a Python application aimed at appending data to a Google Sheet via the Google Sheets API. Despite ensuring public access through the sheet's sharing settings and verifying the service account's permissions, I'm faced with HttpError 403 and HttpError 500, indicating permission issues and internal errors, ... |
Encountering HttpError 403 and 500 When Using Google Sheets API with Service Account |
I just figured out how to make a sorted table! First, you have to make sure that you don’t need a primary key in that ordered table, which is very probably the case! What you do is you do your sekect statement into a temporary table then you select the first row in the temporary table and insert it in the ordered table... |
This is being done from the command line of macOS 14 (Sonoma).
Can someone explain why a parameter doesn't seem to be processed correctly in the following function.
First, note that the following works fine (called directly from the command lilne), so it's not a keychain problem:
# [1] succeeds
codesi... |
It's not quite "intersection over union". You care that the entire positive Ground Truth is also called positive by the model, and the same for the negative GT. So that requires "intersection over GT".
```python
GT = cv.imread("GT.png", cv.IMREAD_GRAYSCALE)
GT_negative = cv.inRange(GT, 100, 125)
GT_positive = cv.... |
Is this normal behaviour? I'm getting this with Angular 17.3
getProject is an aynchronous function that sets the projectSignal variable to project ID. But the ngOnInit is executing the if branch, and then later also the else branch, and then keeps executing the else branch 100+ times until there is a call stack fail... |
|sqlclr|oracle-data-integrator| |
Ansible facts (and variables - which are almost, but not exactly the same thing) are belonging to a host. There is no such concept as a global variable in Ansible (except the magic, or special, variables that behave in a different way) - in the end, all the variables are flattened to the host level. That means, that yo... |
Here is example code using .map with simplified data:
import pandas as pd
df = pd.DataFrame({'x1': [65, 66, 67],
'x2': [68, 69, 70],
'x3': [71, 72, 73],
'y': [10, 11, 12]
})
x_list = ['x1', 'x2', 'x3... |
Bash function parameters conundrum |
|bash|macos|command-line| |
> Why am I getting this error ? error CS0103: The name 'EnhancedStackTrace' does not exist in the current context
You are getting this error because the compiler/visual studio cannot locate a type named `EnhancedStackTrace` in your program code or within any referenced assembly (dll).
If I assume that the maintai... |
use the following:
python setup.py install --prefix=<path to where you want to install the package> |
|cuda|gpu|side-channel-attacks| |
The date format is `dd-mm-yyyy` (it's the format here in Portugal), and the hour is `hh:mm`. My code is this:
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
struct DateTime {
int day, month, year, hour, minute;
};
// Function to convert date and time to minutes s... |
|java|string|compare|case-insensitive| |
I want to install Redis Vector DB in GCP running on GKE cluster. I am not sure on how to start the process and complete the installation.
I have seen the steps shared in langchain framework to install and run the redis vector locally using this command.
docker run -d -p 6379:6379 -p 8001:8001 redis/redis-stack:lat... |
Install redis vector database on GCP in a GKE cluster |
|redis|vector-database| |
null |
Can you try `flush` to ensure the message is sent immediately and `close` function?
import json
from kafka import KafkaProducer
def main():
bootstrap_servers = 'localhost:34715'
topic = 'dev'
message = {'message': 'Hello from the producer'}
try:
... |
I faced the same problem while using Country Code Picker, In my case I need only 2 countries, so I created a static JSON
export const CountryCodes = [
{
label: "+91",
value: "91",
flag: INDIA_FLAG,
name: "India",
flag_string: "",
},
{
la... |
Discord bot cannot play radio |
|javascript|discord.js| |
null |
Here's another easy way to add truly empty columns to your query.
[enter image description here][1]
=query(A:E;"SELECT Col1, 1/0, Col2, 2/0 label 1/0 'blank', 2/0 'blank'";1)
, where 1/0 and 2/0 (any number divided by zero) result in empty columns
[1]: https://i.stack.imgur.com/BBgaa.png |
Coding a two-dimensional, dynamically allocated array of `int` is a non-trivial task. If you use a _double pointer_, there are significant memory allocation details. In particular, you need to check every allocation attempt, and, if any one fails, back out of the ones that didn't fail, without leaking memory. And, fina... |
You can add it to your PATH. First evaluate the node path:
sudo which node
In `~/.bashrc` or `~/.zshrc`, add the line with the evaluated `node_path`:
export PATH="node_path:$PATH"
In the end, you need to restart a shell or source the file. |
How can I lock a rigidbody's rotation on all axis? Bullet Physics |
Is it possible to write a Chrome/Firefox plug-in that can automatically open the dev tools for every open tab and execute code in the console?
I have already done this with Selenium, but I would like to have it as a plug-in.
Unfortunately, I haven't found a chrome api yet that allows you to automatically insert and... |
The VCALENDAR object, as supplied, is not strictly valid: the EXDATE property must have one or more date-time or date values (see [3.8.5.1. Exception Date-Times](http://icalendar.org/iCalendar-RFC-5545/3-8-5-1-exception-date-times.html)).
Despite that, *vobject* parses the data successfully, ending up with an empty ... |
I have access to 2 nodes, each has 2 GPUs. I want to have 4 processes, each has a GPU. I use `nccl` (if this is relevant).
Here is the Slurm script I tried. I tried different combinations of setup.
It works occasionally as wanted. Most of time, it creates 4 processes in 1 node, and allocate 2 processes to 1 GPU. It... |
methods in contextBridge not working in child window |
|vue.js|electron| |
null |
`GetBitLength` is [documented](https://learn.microsoft.com/en-us/dotnet/api/system.numerics.biginteger.getbitlength?view=net-8.0) as:
> Gets the number of bits required for shortest two's complement representation of the current instance without the sign bit.
And also, helpfully:
> For positive integers the re... |
|typescript|deno|freshjs| |
## Next.js (SSR)
If you are using a modern React framework like [Next.js](https://nextjs.org/) that supports SSR, dynamically importing SVG is very easy. The following guide demonstrates the concept, which should be applicable for any other frameworks that support SSR.
Assuming SVG files are placed in assets fold... |
|python|excel|openpyxl|python-datetime| |
I want to make a HTML,CSS,JS app in which
you can enter you face image, and it will give you all the image
in which your face is present
i want to do this in frontend , pls tell how to implement it ,
I had used face-api and other tools but nothing worked ?
Please tell any resource or code to make it
als... |
How to make image recognition classifier in frontend html,css,js |
|javascript|html|web|frontend| |
null |
I am trying to get the sample rate of each chunk of audio recorded using AudioContext but when I run my current code it prints the sample rate once and then keeps printing ```Uncaught (in promise) DOMException: Failed to execute 'decodeAudioData' on 'BaseAudioContext': Unable to decode audio data.``` Why is this occurr... |
How can I get the difference in minutes between two dates and hours? |
In OWASP ZAP what does the summary in the Token Generation and Analysis tool mean?
What do each of the tests mean? There is not very much info about this tool online.
[1]: [https://i.stack.imgur.com/ruOla.png][1]
[1]: https://i.stack.imgur.com/g9KvG.png |
How do you use the Token Generation and Analysis tool in ZAP? |
|zap| |
Your side effect does not guarantee that the `OutlinedTextField` has finished its composition. To address this, you can request the focus within the [`onGloballyPositioned`](https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/OnGloballyPositionedModifier#onGloballyPositioned(androidx.compose.ui.la... |
Snowflake doesn’t hold data as files (assuming that you are using standard tables) so in this case your last comment, particularly “Snowflake to overwrite it's old files”, still doesn’t make much sense.
Assuming your Snowflake tables have a column that indicates a “day” then you can delete these records and load yo... |
use the following:
python setup.py install --prefix=<your path> |
From [\[bit.cast\]/2](https://timsong-cpp.github.io/cppwp/n4950/bit.cast#2):
> [...] A bit in the value representation of the result is indeterminate if it does not correspond to a bit in the value representation of _from_ [...].
For each bit in the value representation of the result that is indeterminate, the smal... |
NextAuth.js signIn response always undefined |
|node.js|next.js|next-auth| |
null |
```
import { NextResponse } from "next/server";
import User from "../../models/post";
const POST = async (req, res) => {
try {
const body = req.json();
console.log(req);
const userData = {
Title: body.title,
content: body.content,
tag: body.... |
Error occurred while saving user data: TypeError: req.json is not a function |
|next.js|nextjs-api-router| |