instruction stringlengths 0 30k ⌀ |
|---|
Exists not working in Firebase Security Rules |
|firebase|firebase-security| |
null |
```ts
import { A } from "https://example.com/type.d.ts";
type B = A | A
```
[Playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgQTgXzgMyhEcBEAFjDGAM4BcA9FQKYAeAhuADa0B0AxrlTAJ5gOAE3Ywy+ANwAofoLgAhOAF4UcAD4ogA)
If you hover on `B` in both TS Playground and VS Code, it will display it as `A` i... |
This is an issue with `mkdir` itself and is due to the `umask` as you mentioned. In the [mkdir spec][1] it's specified that when you use the `-p` flag `chmod` is only called on the full filepath after all the intermediate directories are created.
The Kubernetes [empty dir implementation][2] follows this same logic, ... |
I make a video editing scripts but there is a bug here |
|opencv|operating-system|tqdm| |
null |
I had the same problem on React JS and I found the simplest way to implement the @IvanSanchez solution.
You just need to make React execute the `<div id="leafletmap">` first, before executing javascript.
To do this, you just need to add the javascript code inside the useEffect hook, because useEffect is asynchron... |
I had the same problem on React JS and I found the simplest way to implement the @IvanSanchez solution.
You just need to make React execute the `<div id="leafletmap">` first, before executing javascript.
To do this, you just need to add the javascript code inside the useEffect hook, because useEffect is asynchron... |
I'm using df.compare where I'm doing a diff between 2 csv's which have same index/row names, but when it does df.compare, it does the diff as expected but gives the row index numbers as 0,2,5,... where ever it find the diff between the csv's.
What I'm looking out is instead of the row numbers where It finds the diff, ... |
How do I display row names instead of index numbers while doing df.compare()? |
|python|dataframe| |
null |
In object-oriented programming, your program is objects that can communicate with other objects through their interfaces (invoke their methods).
For your needs, you can use a "regular" association with the object (put the object into the constructor).
class Greetings {
hello() {
return "... |
I am using boto3 for uploading files to s3 bucket
Here is the code I am using
# s3 client initialization
```s3_client = boto3.client(
service_name='s3',
region_name='us-west-2',
aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
#endpoint_url='https://s3:us-west-2.amazonaws.... |
I am using glove embeddings in embeddings layer of LSTM. I wrote a function to build model as below:
def build_model(hp):
model = keras.Sequential()
model.add(Embedding(input_dim=vocab_size, # Size of the vocabulary
output_dim=EMBEDDING_DIM, # Length of the ... |
How do I solve this Error while using keras tuner in building LSTM model? |
|runtime-error|hyperparameters|keras-tuner| |
In my company we were initially using the most voted answer on this thread https://stackoverflow.com/a/39835908/14204063.
Kudos to him for coming up with this algorithm.
Although there is a common missed case for this.
Consider plurals for words like company -> companies, category -> categories cannot be h... |
Django comes translated in my language however I don't like some of the translated phrases (personal preference).
So I set the ```locale``` folder up and run ```python manage.py makemessages -l fa_IR``` and I get the file ```django.po``` but when I open it, I find that the phrases that are already translated and inc... |
I'm using WSL 2 and want to dockerize a spring boot kotlin app with gradle (kotlin) and have it all running in Docker so I don't have to install anything locally. But everytime I run a `docker-compose` command I get the same message:
`2024-01-13 13:26:19 Error: Unable to access jarfile ./build/libs/app.jar`
and t... |
Just store the data in variables (likely global).
Try to NOT think about all the things that a real database provides; like persistence. You may have to assume that the test cases will all use the same memory when run, which again is not normal. It would be fair for them to share those kinds of details.
It is eas... |
I am trying to combine multiple macros into one. How do I add a loop so that it repeats itself 'x' amount of times, with 'x' being the values of Sheet3!A1, and then it executes the print preview function?
This is the VBA code I have so far. I cant seem to get the loop to work correctly. Im trying to work out what I ... |
You are utilizing the method wrong. It should be:
addEntity: rxMethod<entity>(pipe(
// ...
));
Follow this:
1. https://github.com/ngrx/platform/discussions/3796#rxmethod
2. https://www.angulararchitects.io/blog/the-new-ngrx-signal-store-for-angular-2-1-flavors/
2. https://ngrx.io/guid... |
For this problem, I would like to model out this constraint in cplex.But I get an error saying Operator not available for dvar float+[][Periods] == dvar float+. Is there a way to model this
```
forall(p in Products,l in Operations,t in Periods)
ct3:
X[p][t-LeadTime[p][l]] == Y[p][l][t];
```
The LeadTime is ... |
Modelling leadtime in cplex (Production Planning Problem) |
|indexing|cplex| |
null |
null |
{"Voters":[{"Id":3358272,"DisplayName":"r2evans"}],"DeleteType":1} |
I have 5 (soon to be more) clients. For each of them I am developing 1-2 custom apps. Each of these apps requires a react front-end, and functions backend (cloudflare workers). And the apps for a given client roll up into a "container" app, so the route maps can all be combined into a single react and functions deploym... |
Multiple customers forking off same monorepo |
|monorepo|nrwl-nx|pnpm|nx-monorepo| |
I'm trying to develop a simple js runtime on top of v8 (rusty_v8) and I'm having some trouble with async stuff.
I have a function that is an entry point from the js realm:
```rust
fn message_from_worker(
scope: &mut v8::HandleScope,
args: v8::FunctionCallbackArguments,
_ret: v8::ReturnValue,
)
... |
As @Christopher-Renauro pointed out, you currently have a list of length 10.
Setting the diagonal of a matrix to zeros can be easily done using Numpy.
- convert your list to a numpy array of 10x10 shape :
new_m = np.array(m).reshape(10,10)
- use fill_diagonal() :
fill_diagonal(new_m, val=0)
|
In my Flutter app, there is a custom drawer that is accessed through a button. In this drawer, there is a widget (InfoCard) which displays some of the user's information. However, in this widget, there is a FutureBuilder, so every time the drawer is displayed it shows a CircularProgressIndicator until it gets all the p... |
Here is my code: https://github.com/d0uble-happiness/DiscogsCsvVue
App.vue
<template>
<div>
<FileUpload @file="setFile" />
<ParseCsvToArray v-if="file" :file="file" />
<ProcessReleaseData />
<FetchRelease />
</div>
</template>
<script... |
Hello I have a problem I use the annotated string of Kotlin I am creating a string but I realize that when I created a string the text inside the build noted string , in the withstyle we have 2 parameters the first parameter is style this is where we can define the style of the text that we are creating but the 2nd par... |
Hello, how can I use a block parameter of withstyle parameter when we create a annotated string in jetpackpack compose |
|string| |
null |
I have setup a postgres:13.3 docker container and scram-sha-256 authentication.
Initially, I ran:
```
docker run -d --name my-postgres13 -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=fbp123 -e POSTGRES_DB=mydb -e POSTGRES_HOST_AUTH_METHOD=scram-sha-256 -v pgdata13:/var/lib/postgresql/data postgres:13... |
null |
Storing the preferred font-size in localStorage |
The trouble with importing MirageJS seems to be linked to how its modules are understood in the Jest setup. Since MirageJS is an add-on for Ember CLI, its module system might not be fully ready to work seamlessly with a Jest environment set up for ES modules.
Try to simplify your jest setup for typescript something ... |
I was searching for a solution of this problem and I have encountered number of threads/topic/issues regarding ssh agent forwarding not working through vscode. My problem is quite opposite - I want to prevent vscode from forwarding agent to dev container, and I could not find solution to it neither through googling, no... |
Is there a way to prevent vscode from forwarding ssh agent to remote dev container? |
|visual-studio-code|ssh|vscode-remote| |
I am trying out testing for the first time since I have started my journey with Express and TS. I decided to do some testing on a new project with Jest, but I want to use import/exports instead of require...but now jest is complaining that I cant use import statement outside a moduel. I looked at different solutions on... |
Which datapicker you are using doesn't make any difference, since the behaviour you are searching for is from `RxJs`. You can use `pairwise` for that
HTML
----
<form [formGroup]="dateForm">
<mat-form-field style="margin-right: 10px;">
<input matInput [matDatepicker]="picker" formControl... |
IN MbedTls with RSA in a C-programm encryption/decryption works when using separate buffers (for plainText, cipherText, and decryptedText, i.e. the content of plainText and decryptedText is the same), but not when using just one buffer to perform in-place encryption/decryption as i get gibberish/not correctly encrypted... |
The data returned from `useSearch` needs to be an array in order for you to map it, so in your `useSearch` hook you need to only get the `value` array if you want to only render the results.
```javascript
// in useSearch hook
// we only take the array of webpages value
// looking from your console.log screenshot... |
I managed to solve my question. I was trying to adapt on old macro and mis-understanding the loop function.
I have removed the following from the above code:
' Set targetRange as the last cell in column C with a value.
Set targetRange = pasteSheet.Cells(pasteSheet.Rows.Count, 3).End(xlUp).Offset(1, 0)
... |
Hej i am new here and i am NOT a techsavy guy (coding) so please dont be to harsh with me ;-)
I am trying to add an extra field in the products backend but struggle a lot because i dont understand the coding. I got help from ChatGPT and it works 50%.
What i am trying to acomplish is to have a extra field similar... |
Using ES Modules with TS, and Jest testing(cannot use import statement outside module) |
|testing|jestjs|esmodules| |
How do you calculate the in-tangents and out-tangents of a cubic Bézier curve, knowing the following: start control point (x1, y1), end control point (x2, y2) and end point (x, y)? |
Function for calculating tangents in a cubic Bézier curve |
{"OriginalQuestionIds":[56658553],"Voters":[{"Id":4518341,"DisplayName":"wjandrea","BindingReason":{"GoldTagBadge":"python"}}]} |
ese metodo de descarga no me esta funcionando para mi proyecto, porfa necesito ayuda, ya que estoy trabajando en .xaml y .xaml.cs
private void OnDescargarDocumento()
{
foreach (var item2 in ListadoInfDoc)
{
Num_CodDocumentos = item2.Num_CodDocumentos;
... |
metodo de descarga de archivo en visual studio 2017 |
|c#|.net|visual-studio-2017| |
null |
I'm developing a [macOS desktop application](https://github.com/milanvarady/Applite) that interfaces with [Homebrew](https://brew.sh/). It does this by calling actual shell commands. Sometimes brew needs the user's password to complete some tasks and I want to provide a graphical way for the user to enter the password,... |
> I expect to first have `hi` in my console then the error and at the end `why`
That's what you'd get **if** you were handling the rejection of the promise, like this:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
const test = new Promise((resolve, reject) ... |
{"Voters":[{"Id":10248678,"DisplayName":"oguz ismail"},{"Id":1765658,"DisplayName":"F. Hauri - Give Up GitHub"},{"Id":874188,"DisplayName":"tripleee"}]} |
I answer my question, if you refine the postinst script, then everything works (it seems)
```
if [ -n "$SUDO_USER" ]; then
user_home=$(getent passwd $SUDO_USER | cut -d: -f6)
else
user_home=$HOME
fi
sed -i "s:%homedir%:$user_home:g" /lib/systemd/system/mydemon.service
``` |
I am using an asp.net core web api with entity framework core (pomelo). I have a MariaDB database. I use Swagger UI to explore my api, as per the template. When I try to use it to delete a row, I get the following error:
```
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity ... |
EntityFrameworkCore.DbUpdateException: Unable to delete row with Swagger, SQL Syntax error |
|asp.net-web-api|entity-framework-core|swagger-ui|dbcontext| |
null |
I have understood and solved the notebook available on Coursera for the Deep Learning Specialization (Sequence Models course) by Andrew Ng.
In the notebook, he provides a detailed walkthrough for building a wake word detection model. However, at the end, **he loads a pre-trained model trained on the word "activate."**... |
Only really useful if you need to do something specific when the exception is thrown. There's a slight performance cost to catching and throwing exceptions, so you generally only do it if you really have to |
null |
Suppose I have colmap camera poses, is it possible and how to obtain a new view of input image `I` (planar object) from a different viewpoint/camera pose using those poses?
Colmap camera poses has following data:
```
extr = cam_extrinsics[key]
intr = cam_intrinsics[extr.camera_id]
height = int... |
How to do Perspective Transformation of Image |
|graphics|computer-vision|transformation|perspectivecamera| |
null |
I have a txt file where I store data and with that is stored backslash escape characters too. I read the content of that file and then substitute that value in a json field so I want to add double backslash to be able to parse the json later from different programming language.
for eg. create a file named abc.txt wi... |
macOS - Most secure way of a GUI SUDO_ASKPASS |
|macos|shell|sudo| |
You can do it by creating a function that changes the `fontSize` and add it on the `LocalStorage` every time a person clicks on it.
After that you can use the `window.onload()` to always check, when the page loads, if there is any `fontSize` on the `LocalStorage` and set it if there is.
Example:
**HTML**
... |
Sdk 34 WRITE_EXTERNAL_STORAGE not working |
|java|android|bluetooth-lowenergy|android-bluetooth| |
null |
How to receive Bluetooth value in Android app |
```
# Import the AWS PowerShell module
Import-Module AWSPowerShell -Force
# Define the S3 bucket and object key
$bucketName = "bucket-name"
$objectKey = "new ad account/fd new ad account V4.ps1"
# Define the local file path where you want to save the downloaded code
$localFilePath = "D:\Script Test\fd new ad... |
The strings are of the form:
```
Item 5. Some text: 48
Item 5E. Some text,
```
The result of the search should produce
4 groups as follows.
```
Group(1) = "#"
Group(2) = "5" or "5E"
Group(3) = "Some text"
Group(1) = "48" or ","
```
I have tried:
```
(a) r"(.*)Group (.*)\.(.+)(?::(.+))|(,)... |
{"OriginalQuestionIds":[2299469],"Voters":[{"Id":157882,"DisplayName":"BalusC","BindingReason":{"GoldTagBadge":"jakarta-ee"}}]} |
|c|winapi|operating-system|kill-process| |
|jdbc|servlets| |
I tried to upload my django project to Render which contains plenty of HTML files as well CSS styles. The latter is used in a CSS file called 'styles.css' within the static folder. When I run the project, the images are shown, but it's like the styles have not been applied to everything, not even the Django Admin panel... |
how to globally replace backslash with double backslash in a text file using bash? |
|string|bash|file| |
null |
I'm running a group of tasks in Celery like so:
```python
def run_many(n):
job_id = str(uuid4())
g = group(dummy.s(job_id) for _ in range(n))
job = task.apply_async(task_id=job_id)
job.save() # so children are accessible later in the GroupResult
@app.task(bind=True, ignore_result=True)
def... |
Celery - Specify task parent manually? |
|python|celery| |