instruction stringlengths 0 30k ⌀ |
|---|
chrome.tabs.onRemoved.addListener((tabId, removeInfo) => {
chrome.tabs.query({}, (tabs) => {
if (tabs.length === 1) {
console.log("your code here");
}
});
}); |
To check if a user is logged in and display content based on this condition within an Antlers template, you can use the {{ user }} tag or its aliases. Here’s a simple way to do it:
{{ if user }}
<!-- Content to display if the user is logged in -->
<p>Welcome back, {{ user:name }}!</p>
... |
I have interfaces
**Angular Typescript Class**
interface A_DTO {
type: string,
commonProperty: string,
uniquePropertyA: string,
etc..
}
interface B_DTO {
type: string,
commonProperty: string,
uniquePropertyB: string,
etc...
}
type AnyDTO... |
(random ideas)svg animation ,masking, skia-shopify Any idea
thanks for help |
Is there any way to page transition in react native (stack navigation) |
|react-native|react-native-navigation|react-animations| |
## Update 3/31/24
I wrote a blog post explaining all the uses of a [Firestore Reference Type](https://code.build/p/firestore-reference-type-fxhopT).
___
# Original Post
___
Automatic JOINS:
**DOC**
```typescript
expandRef<T>(obs: Observable<T>, fields: any[] = []): Observable<T> {
return obs.pipe(
... |
Set Expiry Dates for Google Drive
step to open the way to solve this issue, i need step to step handle this issue
step to open the way to solve this issue, i need step to step handle this issue
step to open the way to solve this issue, i need step to step handle this issue
step to open the way to solve... |
C6067 and other warnings with numbers 6000+ are Code Analysis warnings and are not associated with the compiler warnings.
As suggested in the comments, [`/analyze`](https://learn.microsoft.com/en-us/cpp/build/reference/analyze-code-analysis?view=msvc-170) enables Code Analysis warnings while compiling.
|
I was given this block of code where `call by Reference` had to be used for every method call, and I had to give an output of a in the format:
```none
y:[result]; y: [result]; y:[result]; x:[result]; a:[result]
```
```java
public class Main {
static int x = 2;
public static void main(String[] args)... |
You should pass a custom `key` with [`to_datetime`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_datetime.html) to [`sort_values`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.sort_values.html), this will use the defined logic to sort while leaving the data unchanged:
```
(df.... |
I just spent a day with this, there is something you must be aware of when you try to fix the credential problem: aws does lot of magic where it gets your credentials from, you might be not using the ones you explicitely enter, but some from .env or user_home/.aws or from old settings when you opened your terminal.... |
I have a geometric dataset of point features associated with values. Out of ~ 16000 values, about 100-200 have NaNs. I'd like to populate those with the average of the values from the 5 nearest neighbors, assuming at least 1 of them is not also associated with a NaN.
The dataset looks something like:
```
FID PPM_P ... |
Try using Scala 2 syntax
fastparse.parse("1234", implicit p => parseAll(MyParser.int(p)))
https://scastie.scala-lang.org/DmytroMitin/MrFZ0EhiSPeFDHd1IyBhrA
Possible Scala 3 syntaxes are
fastparse.parse("1234", p => {given P[_] = p; parseAll(MyParser.int(p))})
https://scastie.scala-lang.org/Dmytro... |
Declarations and definitions are about **names**, not necessarily about objects.
A somewhat simplified (hence, wrong) description of those terms is that a declaration tells the compiler that some name will be used in a particular way; a definition gives the compiler all the details of what that name means.
This i... |
I've replaced the default button function, thus I'm adding a new one.
Trying to create a custom 50px circle "add to cart" button (fa-solid fa-cart-shopping icon, #F5F5F5 background, 5px padding, I want it to be placed in the bottom left corner of product images with 10px margins.
My archive template is made with El... |
I have a camera that I am able to use with older applications built in c/c++ and VB6 (circa 2003). I didn’t write the older code.
The device driver is recognized in Imaging Devices but cannot be updated to Camera in Device Manager.
I can find the camera using Manager request functions.
I am trying to use the ... |
Finding and Using Camera found in “Imaging Devices” in VB.NET |
|vb.net|directshow|aforge|device-manager| |
null |
null |
Screenshot demonstrating the use of Excel's Solver:
![See Screenshot demonstrating the use of Excel's Solver][1]
I have a task to automate a certain excel worksheet. The worksheet happens to implement a logic with an excel plugin called Solver. It uses a single value(-1.95624) in Cell $O$9 (which is the result o... |
You can move-construct a _new_ `T` object in the `std::vector` in the same way you move-construct any object, i.e. `vector_of_ts.push_back(std::move(*t))`, but you can't somehow move _the same_ `T` object into the vector.
---
A `std::vector<T>` is a _contiguous_ container. That is, under the hood it's a pointer ... |
I have simple helm which I try to run but I'm getting error when doing `lint/tamplate --debug`.
The error:
vagrant@ubuntu2010:~/java/projects$ helm template --debug ./message-server-helm
install.go:214: [debug] Original chart version: ""
install.go:231: [debug] CHART PATH: /home/vagrant/java/project... |
Helm getting :at <.Values.serviceAccount.create>: nil pointer evaluating interface {}.create |
[enter image description here][1]After drop_na it shows 0 obs. of 68 variables:
[![(https://i.stack.imgur.com/elrGR.png)][2]][2]
[![(https://i.stack.imgur.com/txJEv.png)\]][3]][3]
After drop_na I don't see any results in the Table except dates. This was not the case when I tried it before, I could see the valu... |
I found how to easily insert pngs as axes tick labels, following [this post.](https://stackoverflow.com/questions/54247880/image-as-axis-tick-ggplot)
However, this seems to work only for a single axis. I am not quite sure how to draw both my y axis and x axis grob to my plot.
To plot one grob for **either** y or ... |
I'm looking for an equivalent to x86/64's FTZ/DAZ instructions found in <immintrin.h>, but for M1/M2/M3. Also, is it safe to assume that "apple silicon" equals ARM?
I am in the process of porting a realtime audio plugin (VST3/CLAP) from x64 Windows to MacOS on apple silicon hardware. At least on x64, it is importa... |
struct MyStruct {
var a = 0
func foo() {
print("Ok")
}
mutating func increase() {
a += 1
}
}
func runner(_ function: () -> Void) {
function()
}
var myStruct = MyStruct()
runner(my... |
How is passing a function as a parameter related to escaping autoclosure? |
|printing| |
So I have a grid of 12 buttons with a set of 12 divs. when i click button 1 div 1 appears ! correct. however when i click button 2 div 2 appears, great. However button one still exists. How do I make it so that when i click button 2 div 1 is display none and div 2 is displaying.
Below is what I have tried, I have th... |
Jquery: How to stop other divs from still showing when i click a different button |
|jquery| |
null |
{"OriginalQuestionIds":[26548495],"Voters":[{"Id":22180364,"DisplayName":"Jan"},{"Id":2530121,"DisplayName":"L Tyrone"},{"Id":-1,"DisplayName":"Community","BindingReason":{"DuplicateApprovedByAsker":""}}]} |
Creating a module for this purpose is inevitable and not a strenuous task at all. All u need is a `package.json` with an `exports` field to limit which submodules can be loaded from within the package. From the [official Node.js docs](https://nodejs.org/api/packages.html#exports):
> The "exports" field allows defini... |
null |
To emphasize on [Mark Gravel's answer](https://stackoverflow.com/a/73786244/14860947)
I have implemented a simple method, to demonstrate an example.
```cs
public static void CopyWithoutAllocation(long value, Span<byte> dest)
{
for (var i = 0; i < sizeof(long); i++)
{
dest[i] = (byte)((value >... |
> The item specific Brand is missing
I do see ["ItemSpecifics" in the documentation](https://developer.ebay.com/devzone/xml/docs/Reference/eBay/AddItem.html#Request.Item.ItemSpecifics)
So eBay might expect [item specifics](https://developer.ebay.com/api-docs/user-guides/static/trading-user-guide/include-item-spec... |
I have a problem with the next auth session. For some reason it returns these errors.
[enter image description here](https://i.stack.imgur.com/ik810.png)
Also, if I create inside api another folder with route.ts and try to access example, api/hello/route.ts => localhost:3000/api/hello => 404. it doesn't work eithe... |
Route Handler not working Next auth, Next Intl & Next 14 |
|next.js|next-auth|next-intl| |
null |
Also, when using gitconfig files to enable GPG signing, make sure to use the long key from when you created your gpg key i.e.:
[user]
email = example@email.com
name = My Name
signingkey = ########################################
[gpg]
program = gpg
[commit]
gpgsign = true
Which sho... |
I am trying to use DGS Codegen plugin in my spring boot GQL project,
Here is the build.gradle.kts file, where the respective dependencies mentioned
`
plugins {
java
id("org.springframework.boot") version "3.2.4"
id("io.spring.dependency-management") version "1.1.4"
id("com.netflix.dgs.codegen") version "6.... |
I want to check an array of dates to see if they are increasing. For example, ['12/12/2023','13/12/2023'] would return true. However, ['12/12/2023','11/12/2023'] would return false.
I have been playing around with a function suggested by users for checking integer values. I thought I could do the same but use dates in... |
Check array of dates to see if increasing |
|javascript|arrays|date| |
null |
You could simply replace [`DataFrame.with_columns()`](https://docs.pola.rs/py-polars/html/reference/dataframe/api/polars.DataFrame.with_columns.html) with [`DataFrame.select()`](https://docs.pola.rs/py-polars/html/reference/dataframe/api/polars.DataFrame.select.html) method:
```python
df = pl.DataFrame(
{"A (%... |
I am writing a front end in Access that connects to SQL Server. I am using the default {SQL Server} driver since some of the computers/laptops/tablets that will be using it probably will not have a driver installed for SQL Server. The FE opens fine on my computer as one would expect, and will open on another computer (... |
Custom styled "Add to cart" button in WooCommerce product archive pages |
I feel like I have a good understanding of pointers, but I want to make sure I am understanding this correctly. Basically, I am completing a computer architecture lab for virtual memory and we have 2 pointers. One pointer represents main memory, and other represents an array of structs(frame_table) that starts at mem[0... |
C pointer addresses and casting |
|c++|c| |
null |
Harris uses the structure tensor. For the structure tensor you must blur the square of the x derivative (not square the blurred derivative), and likewise for the y derivative. The two diagonal elements are the blurred of the product of the x and y derivatives (you compute the product of the magnitudes of the blurred de... |
{"Voters":[{"Id":10952503,"DisplayName":"Elikill58"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":7201774,"DisplayName":"Rich"}],"SiteSpecificCloseReasonIds":[13]} |
Screenshot demonstrating the use of Excel's Solver:
![See Screenshot demonstrating the use of Excel's Solver][1]
I have a task to automate a certain excel worksheet. The worksheet happens to implement a logic with an excel plugin called Solver. It uses a single value(-1.95624) in Cell $O$9 (which is the result o... |
[enter image description here][1]After drop_na it shows 0 obs. of 68 variables:
[![1https://i.stack.imgur.com/oqjo8.png][1]][1]
[![(https://i.stack.imgur.com/elrGR.png)][2]][2]
[![(https://i.stack.imgur.com/txJEv.png)\]][3]][3]
After drop_na I don't see any results in the Table except dates. This was not t... |
I feel like I have a good understanding of pointers, but I want to make sure I am understanding this correctly.
Basically, I am completing a computer architecture lab for virtual memory and we have 2 pointers. One pointer represents main memory, and other represents an array of structs (`frame_table`) that starts at... |
Unresolved reference error is showing up after adding the dgs codegen plugin successfully |
|spring-boot|gradle-kotlin-dsl|netflix-dgs| |
null |
{"OriginalQuestionIds":[76851422],"Voters":[{"Id":8690857,"DisplayName":"Drew Reese","BindingReason":{"GoldTagBadge":"reactjs"}}]} |
I want to open a file for reading and writing if it exists, or if not, create it and open it for writing.
The following code
```
FILE *file = fopen(argv[file_position], "r+");
if (!file)
file = fopen(argv[file_position], "w");
```
causes the error `file_name: Bad file descriptor`.
What is t... |
Why can't I use the file pointer after the first read attempt fails? |
|c|file| |
I am getting a new error today when I try to access contacts in my react-native app that has been built using expo
> This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explai... |
I was given this block of code where `call by Reference` had to be used for every method call, and I had to give an output of a in the format:
```none
y:[result]; y: [result]; y:[result]; x:[result]; a:[result]
```
```java
public class Main {
static int x = 2;
public static void main(String[] args)... |
|node.js|firebase|google-cloud-firestore|google-cloud-functions| |
null |
I have this data the id here (lr_01HT89SX627dFDPCAXBS4H2T9d) is dynamic.
https://www.example.com/api/pub/v2/verifications/lr_01HT89SX627dFDPCAXBS4H2T9d
I need to extract the id- lr_01HT89SX627dFDPCAXBS4H2T9d from https://www.example.com/api/pub/v2/verifications/ the id will be different for every response.
`... |
How to extract specific data from php header response data |
|php| |
null |
I was able to solve this problem by using a flat object.
https://opensearch.org/docs/latest/field-types/supported-field-types/flat-object/ |
To get some code executed just once in this function, you need to tag the order like:
```php
add_action( 'woocommerce_order_status_changed', 'bacs_payment_complete', 10, 4 );
function bacs_payment_complete( $order_id, $old_status, $new_status, $order ) {
// 1. For Bank wire and cheque payments
if ( $order-... |
I am building a programming language using C++, LLVM, Clang, LLDB, user can write `import "@stdio.h"` which is similar to `#include <stdio.h>` so now I need to support C like imports of headers, however I can't get the path to system headers, let alone parse them !
Other answers have gotten old, since llvm and clang... |
I have stuck with a pretty simple problem - I can't communicate with process' stdout.
The process is a simple stopwatch, so I'd be able to start it, stop and get current time.
The code of stopwatch is:
```python
import argparse
import time
def main() -> None:
parser = argparse.ArgumentParser()
par... |
Asyncio: how to read stdout from subprocess? |
I'm developing an Android web view app, that has an image chooser option, I am making some progress, and here it is,
```
webChromeClient = object : WebChromeClient() {
override fun onProgressChanged(view: WebView?, newProgress: Int) {
super.onProgressChanged(view, newProgress)
backEnabled = v... |
I have a Django REST Framework backend API with a ProductViewSet that handles product creation. When creating a new product, I'm expecting to receive an image file along with other product data from a React-admin frontend. Here's the relevant part of my backend API:
```
class ProductViewSet(ModelViewSet):
quer... |
"Troubleshooting Image Upload Failure: React-admin to Django REST Framework Backend" |
|django-rest-framework|react-admin| |
null |
I am trying to create a modal, but when I make it, it disappears below 992px which is one of the Bootstrap's breakpoints. I made the modal like one of the examples in the docs. I have tried many solution including CSS changing the class modal to position fixed, but without success.
Also tried:
- CSS changing the cl... |
using infoPlist in app.json for expo project seems to not be working |
|react-native|expo|info-plist| |
**Aspects worth to consider from the very beginning**:
- In order to maintain the degree of simplicity of the problem this post presents, I haven't provided the exact requirement, on the basis of the bellow E-R diagram was sketched;
- If the given information aren't satisfactory further details will be provided with... |
When an E-R attribute should be perceived as a relationship attribute or as an entity set attribute? |
|entity-relationship| |
Looks like there's an already accepted answer. But @user23919330 was onto something. The most obvious idea would be to convert this:
for (size_t i = 0; i < SIZE; i++, a_ptr++, b_ptr++, c_ptr++, data++) {
*a_ptr = data->a;
*b_ptr = data->b;
*c_ptr = data->c;
}
To this:
fo... |
The MedaCy library is dependent on Python version 3.7. Using Python version 3.7.0 worked completely fine. Follow the below steps with python 3.7 installed:
1. `pip install git+https://github.com/NLPatVCU/medaCy.git`
2. `pip install git+https://github.com/NLPatVCU/medaCy_model_clinical_notes.git`
|
Subscriptions do not require activation [unless you specify][1] `application_context.user_action = 'CONTINUE'`. Doing so also requires you to show an order review page before activation, otherwise it is misleading to the payer.
The default behavior of SUBSCRIBE_NOW avoids needing a review page before activation, and... |
Android jetpack compose webview, image selector not works |
|android|kotlin|webview|jetpack| |
**I've got this error on my flutter client ( registration page )**
**It is a registration page and the backend is on php. But the Connection timed out error is showing. I've done lot of things from the internet but nothings works well. I'm using linux(Ubuntu**).
**For database I've used mysql**
```E/flutter (218... |
Flutter Unhandled Exception: Connection Time Out |