instruction stringlengths 0 30k ⌀ |
|---|
I have set up firebase analytics for my app including some custom events. Events are correctly displayed in the firebase console, and I can see for instance how many times an event has occurred in the specified time frame in total.
However, it would be interesting to see as well in what order these events are called... |
Google Firebase Event logging: why to see sequence of events |
|flutter|firebase|google-analytics| |
I am creating a website for the sale of goods, and for each product I create a card based on data from the database. When a new card appears, a dynamic page based on the same database data should be automatically connected to it. The page is created, but the data from the model is not loaded. I watched the Django guide... |
YUV is a raw **pixel** format. Meaning that there is absolutely no information other than the pixels' intensity values in it.
If you want your VUI data:
- Pre-save the FPS elsewhere and/or use a custom delay (FPS) during the decoding process.
- Write your YUV data into a formats that supports timing info (_eg... |
In this line, `video_clip = VideoClip(image_clip)` of your code, you are treating `image_clip` as function. If you check the documentation for the `VideoClip` class, the first item in the parameter list is function named `make_frame` which is a function that generates frames at a given time. You seem to be using the `I... |
I recently came across a similar project.
[The project is finally deployed here.][3]
I am using the latest version of Next.js and Docusaurus.
The most important step is to read the Next.js documentation.
I found the override method in the Next.js documentation.
[Rewrites allow you to map an incoming requ... |
HTML
```html
<span id="spn"></span>
```
JS :
```js
const span = document.getElementById("spn")
span.addEventListener("change", function(){
let value = span.innerText
// Your code
})
``` |
I've written the following code to compare the theoretical alpha = 0.05 with the empirical one from the buit-in t.test in Rstudio:
```
set.seed(1)
N=1000
n = 20
k = 500
poblacion <- rnorm(N, 10, 10) #Sample
mu.pob <- mean(poblacion)
sd.pob <- sd(poblacion)
p <- vector(length=k)
for (i in 1:k){
muestra ... |
You may missing some intents such as 'GuildVoiceStates':
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildVoiceStates,
... |
I'm no linux expert but I'm trying to learn.
I wrote a simple bash script to run my vpn connection automatically upon start up.
#!/bin/bash
cyberghostvpn --country-code PL --connect
I works fine when I run it through my CLI
sudo ./cyberghostvpn-launcher.sh
I tried to wrap it in a service ... |
bash script works in CLI but fails in systemctl service |
|linux|systemctl| |
This can be handled in Angular on the component side instead of the html by using this routine.
- The reference to the collection is made
- A subscription to that reference is created.
- we then check each document to see if the field we are looking for is empty
- Once the empty field is found, we store that docum... |
{"OriginalQuestionIds":[17615260],"Voters":[{"Id":2029983,"DisplayName":"Thom A","BindingReason":{"GoldTagBadge":"sql-server"}}]} |
This can be handled in Angular on the component side instead of the html by using this routine.
- The reference to the collection is made
- A subscription to that reference is created.
- we then check each document to see if the field we are looking for is empty
- Once the empty field is found, we store that docum... |
null |
{"Voters":[{"Id":1266756,"DisplayName":"Volker"},{"Id":496038,"DisplayName":"pringi"},{"Id":839601,"DisplayName":"gnat"}],"SiteSpecificCloseReasonIds":[11]} |
This solution create groups for the "D"s and, for each one, identify the first "2A" position. With this information, an unique id is created. Look:
library(tidyverse) # (Edited)
df <- mutate(df, id = row_number())
aux <- df %>%
mutate(d_group = cumsum(if_else(activity == "D", 1, 0))) %>... |
[![cmd palette][1]][1]
Open menu *File* → *Preferences* → *Settings* and add the following setting:
```json
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#553955" // Change this color!
},
"window.titleBarStyle": "custom"
```
[![result][2]][2]
From the following source tut... |
null |
Starting from @Clemens answer, the TextBlock's Margin can be bound to the ActualWidth of the TextBlock, then setting the Left Margin equal to the ActualWidth / -2 in a converter results in no need to hardcode the Width and Margin of the TextBlocks:
```
<Grid>
<Grid.Resources>
<converters:ActualWidthTo... |
You are wrapping your code with a `try`/`catch` - good.
However you are catching a specific exception `EmailException` which my guess is that this is not getting thrown, so the exception bubbles up somewhere else.
If you changed `EmailException` to `Exception`, my guess is that you *still* won't catch the problem... |
According to the VsCode documentation: [User Defined snippets variables](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_variables) , one can use certain variables to properly customize the snippets. They also work with [Transformations](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_vari... |
Can you create custom VsCode snippets variables? |
|visual-studio-code|variables|transformation|code-snippets| |
null |
I'd be really saved if someone could help me on this!
I've been working with an old open source C++ project from github that has not had an official update since Python 3.4: https://github.com/Mindwerks/plate-tectonics
Using a fresh install of Python 3.10.11 I've been able to compile this project in a PyCharm ven... |
Need help compiling C++ Python project from Github for Conda environment |
Compare theoretical and empirical alpha in R |
|r|rstudio|alpha| |
In Jupyter Notebook, run:
!echo y | jupyter kernelspec uninstall unwanted-kernel
In the [Anaconda][1] prompt, run:
jupyter kernelspec uninstall unwanted-kernel
[1]: https://en.wikipedia.org/wiki/Anaconda_(Python_distribution)
|
null |
null |
null |
null |
There are two ways which is what I found. Either go to the directory where kernels are residing and delete from there. Secondly, using this command below.
List all kernels and grab the name of the kernel you want to remove
jupyter kernelspec list
to get the paths of all your kernels.
Then simply uninst... |
I am trying to make a leaderboard but is says Interaction has already been acknowledged, and I am very confused on how to fix this, if someone could help that would be awesome!
```
const { Client, Intents, MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
const fs = require('fs');
const c... |
Interaction has already been acknowledged when trying to make leaderboard script |
|discord.js|leaderboard| |
null |
The following code does not execute any test
let testCases = [];
beforeAll(async () => {
input = {description:"x", queryStatement:"", expectedStatusCode:200,assertStatement:""}
testCases.push(input);
});
testCases.forEach(({ description, queryStatement, expectedStatusCode, assertSt... |
I have research back and forth on this issue and so far nothing has worked. I'm unable to open sublime while using git using a command such as sublime . or subl .
I have used other command on git but it shows in config --list but it is not opening. |
Is there a way to make sublime as core.editor (git) on Mac |
|git|sublimetext3|editor|git-bash|text-editor| |
null |
Your fairly "verbose" code can be written a lot shorter if you leave out all the repetitions:
<!-- begin snippet:js console:true -->
<!-- language:lang-html -->
A<button id="na">1</button>
B<button id="nb">1</button>
X<button id="nx">1</button>
Y<button id="ny">1</button>
Z<button id="nz">1</button>
<div id="... |
I'm having trouble with special characters.
It worked:
```
x <- 1:10
y <- rnorm(10)
plot(x, y, main = "Main Title")
```
It doesn't work:
```
x <- 1:10
y <- rnorm(10)
plot(x, y, main = "Main Tütle")
```
`Error: unexpected symbol`
Plus, I can not knit, I can not run basic Shiny codes. So on. I can't ... |
Special Characters Issue in R 4.3.2 |
|r|utf-8| |
I'm trying to build ffmpeg with Rust with the library ffmpeg-next and staticlly link ffmpeg on Windows inside msys2 `ucrt64` environment,
When compile with `cargo build --release`
It throws many undefined reference errors
```
undefined reference to `ENGINE_load_builtin_engines'
undefined reference to `GdipBitmap... |
Static link ffmpeg with Rust in msys2 |
|rust|ffmpeg|compilation| |
I'm following the Next.js 14 Learning Tutorial ([https://nextjs.org/learn/dashboard-app/fetching-data][1]) and I'm able to do everything they show.
To show data in the frontend they first create a file with the definitions of our data:
**definitions.tsx**
// This file contains type definitions for your... |
I have many json files (example below), I am interested in converting these json to a table version in the csv file format [example below] with the help of python script from jupyter notebook provided my one of my collaborator [example below]. The notebook works on extracting one gene_name along with summary, and score... |
Error while converting json file to a csv file |
|python|json|csv|jupyter-notebook| |
null |
Creating a script to ease the way of reading Apache Airflow data, I was able to retrieve failed tasks and other data, but could not find a way to get errors logs for the task that failed.
I looked through the docs for any possible endpoints that could help. Looking to get something back like this:
raise AirflowEx... |
Retrieve Error Logs for Task Failure within Apache Airflow with STABLE REST API |
|python|api|rest|apache|airflow| |
null |
Would anyone suspect why my React Native app on the emulator just suddenly stop working and show a "No connection to the Metro server error" out of the blue?
The screenshots refer to the same error. The longer message one is what comes up after I refresh the emulator.
[First error](https://i.stack.imgur.com/YvkNP.p... |
|python|c++|python-3.x|anaconda|conda| |
I'm trying to Implement a K-means algorithm, with semi-random choosing of the initial centroids.
I'm using Python as a way to process the data using numpy to choose initial centers and stable API in order to implement the iterative part of K-means in C.
However, when I am entering relatively large datasets, I get S... |
Python and stable API Segmentation Error (core dumped) |
|python|c|memory-management|cpython| |
null |
I gave up trying to use class based tasks. No idea how to get that to work.
I ended up using task_success, to perform operations after a task completes.
```
@task_success.connect
def task_success_handler(sender=None, result=None, **kwargs):
if sender.name == 'customer':
# Extract result dictionary
... |
You cannot directly use `localStorage` to init the state value because as you said `localStorage` is not available on the server side.
You can init the state with a default value and use an `effect` to update its value as soon as the app is loaded on client side.
```
const [color, setColor] = useState<...>('... |
for me:
@EnableWebSecurity
public class WebSecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
// ...
http.cors(Customizer.withDefaults()); // disable this line to reproduce the CORS 401
return htt... |
I have a multipolygon shapefile that i want to rotate. I can do the rotation but the problem is that the roatation changes the inner vertices. This creates overlap of polygon which i dont want.
This is what i have tried.
import geopandas as gpd
input_poly_path = "poly3.shp"
gdf = gpd.read_file(input... |
Rotate a multipolygon without changing the inner spatial relation |
|python|polygon|geopandas|multipolygons| |
I’ve been working on an application for a couple of years and received a simple design request: Round the corners on a UIView and add a drop shadow.To do as given below.
I want a custom `UIView`... : I just wanted a blank white view with rounded corners and a light drop shadow (with no lighting effect). I can do eac... |
null |
The [`Serializer`](https://github.com/symfony/serializer/blob/7.0/Serializer.php) class is not final, so you can extend it and override the `denormalize()` method:
``` lang-php
require('vendor/autoload.php');
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use... |
Django dynamic pages. Why is my code not working? |
|django|django-models|django-views| |
null |
A property is not an instance attribute, it is a [descriptor][1] attribute of the class which is bound to the object which accessed it. Here is a simplified example:
class A:
@property
def x(self):
return True
print(A.x) # <property object at 0x0000021AE2944548>
pri... |
In the Android app "Lua Interpreter" I want to extract wiki text on demand.
I'm going to use the additional system command "curl".
curl -s "https://uk.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&exintro&explaintext&titles=%D0%91%D0%B0%D1%80%D0%B0%D1%85%D1%82%D0%B8" > "/storage/emulated/0/iGO_Pal/sa... |
One alternative is doing the following using `ifelse`:
> data.frame(
+ 't' = c(1, 2, 3, 4),
+ 'v' = c(2, 3, 4, 3)
+ ) |>
+ mutate(status = ifelse(t < v, "Increasing", "Decreasing"))
t v status
1 1 2 Increasing
2 2 3 Increasing
3 3 4 Increasing
4 4 3 D... |
Making a column nullable **is** making it optional.
In PostgreSQL, a NULL value uses no extra storage space. |
I am in the process of importing some data where the descriptions are essentially the same, but may have some small variation. I started with adding substitute and regreplace to deal with these. The formula is getting a little long so wanted to know if I could replace the specific substitute and regreplace in the formu... |
I'm trying to record a video from the Camera using `AVAssetWriter`.
The video recording works perfectly fine, but I cannot figure out how to add GPS location EXIF tags to the video files (mp4/mov).
I tried this:
```swift
func initMetadataWriter() throws {
let locationSpec = [
kCMMetadataFormatDescript... |
## [Go 1.22 has now introduced this functionality natively in `net/http`][1]
This can now be achieved by calling [`req.PathValue()`][2]
> PathValue returns the value for the named path wildcard in the [ServeMux][3] pattern that matched the request. It returns the empty string if the request was not matched agains... |
If you don't know the timezone, use a zone-less timestamp, which postgres supports:
```
CREATE TABLE MYTABLE (
...
LOGGED_AT TIMESTAMP WITHOUT TIME ZONE,
...
)
``` |
There are currently two articles proposals in the [Actions for You tab](https://stackoverflow.com/collectives/google-cloud?tab=dashboard) that are waiting to be reviewed by RMs.
[This one](https://stackoverflow.com/collectives/google-cloud/articles/review/78120800) is an outline for an article about security... |
New article proposals to be reviewed [UPDATED March 12] |
As far as I know and read the official documentation, updates will only be triggered if the value is different.
> The set function that lets you update the state to a different value and trigger a re-render.
However, after my testing in version 18.2, there is a situation that triggers repeated rendering.
![e... |
I ran the code on my local device, MacOS Ventura 13.6.4 with R version 4.2.1, and had the same issues/improper joining of UUID data type. A many to many relationship occurred. If I adjust ```id1 <- UUIDgenerate(n = 999, output = "uuid")``` the join works properly. |
I have a JavaScript function which recursively calls the Spotify API in order to get data for a users saved songs such as track name, album, date added etc. (call limit is 50 so I need to repeat the call many times). It then manipulates the data into .csv format for the user to download. It is shown below (it works com... |
In the Android app "Lua Interpreter" I want to extract wiki text on demand |
|curl|lua| |
I created an iframe component with ref and I wanted to create a unit test for that component, then I created a mock iframe so that the component could be run in the unit test, unfortunately the unit test failed, what's wrong with the following code, I'm a beginner at Jest.
So how do you make the unit test successful?
... |
Jest click event not firing a ref |
|jestjs|ts-jest|babel-jest| |
I was playing with computed columns and I noticed some weird behaviour with persisted computed columns.
The query:
DROP TABLE IF EXISTS #tmp
CREATE TABLE #tmp
(
ExternalId UNIQUEIDENTIFIER NULL,
UniqueId UNIQUEIDENTIFIER NOT NULL DEFAULT(NEWID()),
--Id AS ISNULL(Externa... |