instruction
stringlengths
0
30k
I have a basic Maven/Spring test project with some simple JUnit tests and Selenium/Cucumber tests that I later want to run using Github Actions, but first I want to make sure they run locally. This is the JUnit "test": ``` package com.example.CucumberSelenium; import org.junit.jupiter.api.Test; import org.spri...
Match multiple combinations of two columns
|mariadb|
I'm trying to get the selected option (value) of the dropdown menu in a variable but I'm having trouble with getting it stored because I'm getting errors about it not existing. I understand that html can have order issues but because the popup's html elements are all written in a JS file's function I'm not sure how to ...
There isn't necessarily an error. If the p-value is smaller than the smallest double precision floating point number, it [underflows](https://en.wikipedia.org/wiki/Arithmetic_underflow) and you get a zero. This would not be a bug in your code or in SciPy; it's just a fundamental limitation of floating point arithmetic....
Here is my HTML, CSS, JAVASCRIPT (THREE.JS) code. Can you please analyze the code and check for my desired output that i put in my title. ``` //**HTMLCODE** <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <meta name="viewpor...
import { useCallback, useMemo, useState, useEffect } from 'react'; import Head from 'next/head'; import ArrowDownOnSquareIcon from '@heroicons/react/24/solid/ArrowDownOnSquareIcon'; import ArrowUpOnSquareIcon from '@heroicons/react/24/solid/ArrowUpOnSquareIcon'; import PlusIcon from '@heroic...
next js routing issue
|javascript|reactjs|next.js|next.js13|
I am using Bootstrap responsive table. The problem I am facing here is the text in the table column is overflowing. As per my knowledge the table adjusts the column width automatically if it is responsive. But the problem here is I have a input field inside td and I have a placeholder for that input field. The placehol...
There are two options 1. install the driver using `chromedriver-autoinstaller` install package `chromedriver-autoinstaller` `pip install chromedriver-autoinstaller` from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Serv...
I am facing some difficuilty desiding on the best way to structure a large test. This is more of an end-to-end test of a particular workflow within the application. I am using python 3.11 and pytest. My current test stands like this ``` def test_workflow(fixture_1, fixture_2, fixture_3): # Some arrange cod...
What's the best way to breakup a large test in pytest
|python-3.x|unit-testing|pytest|fixtures|end-to-end|
I just started to work with LED matrix (16*16) and attiny85. The current purpose is to switch on a led on each row, where led number is the number of row (I know that led strip is like a snake, it does not matter for now). So, I written an `byte matrix[16][16]` and manually put a digit into target cells. It worke...
It's immensely hacky and time consuming, and so suitable only for a chart that you really care about, but you can annotate a plot with rectangles to produce the desired effect. First, you have to work out (by trial and error) where ggplot is placing each dodged bar's centre point (a manual process, but for factor varia...
The login page is only one in the application and you should *not* use a dynamic result returned from the action which hase a `location` hardcoded in the code. There's should be a getter for the parameter in the `${page}`. Such as ``` public String getPage() { return page; } ``` The JSP file should be cont...
|deep-learning|large-language-model|huggingface|llama|peft|
I'm creating my own links manually within a module of a divi theme, since divi doesn't support three links side by side. It's supposed to look like this: [Three side-by-side links](https://i.stack.imgur.com/RZ5iM.png) But when the screen is resized it looks like this: [Split looking link](https://i.stack.img...
Since you are doing a left join, it's possible that TABLE2.DATE and TABLE2.ProductCode will be null so you need to include that possibility in your WHERE clause. You will also need to update the SUM arguments as shown: SELECT TABLE1.Date, TABLE1.ProductCode , SUM(CASE WHEN TABLE2.ProductCode IS NULL THEN 0 ...
I want to implement Spring Cloud Kubernetes. I created this test project: https://github.com/rcbandit111/mockup/tree/master configuration: spring: application: name: mockup cloud: kubernetes: discovery-server-url: "http://spring-cloud-kubernetes-discoveryserver" ...
[CSS layers][1] are awesome, except one (in my opinion) unintuitive behavior: they have a lower priority than unlayered styles: ```css /* site style */ div { color: red; } /* user style */ @layer myflavor { div { color: blue; } } /* The div is still red :-( */ ``` So I can not,...
currently i am working on a Java question that is related to Java thread and concurrency. The thread should handles Multiple Processes, Multiple Processors and Single Priority Queue. It has 5 main functions which are set_number_of_processors, reg, start, schedule, and terminate. My code works fine with 3 sessi...
Multiple Processes, Multiple Processors, Single Priority Queue - Java Thread-Safe and Concurrency -
|java|session|concurrency|thread-safety|
The code `char *line; line = strncpy(line, req, size);` has undefined behavior: `line` is an uninitialized pointer, so you cannot copy anything to it. My recommendation is [**you should never use `strncpy`**][1]: it does not do what you think. In your code, you should instead use `char *line = strndup(req, size);...
I have a simple animation where I have a static rectangle slowly moving horizontally so that it pushes a circle across the 'floor'. How can I make the circle roll instead of slide? I tried adding friction to the circle and the floor, and removing friction from the pushing rectangle, but it makes no difference. ...
How to have circle roll when pushed using MatterJS?
|javascript|matter.js|
here is my code ``` function ScrollToActiveTab(item, id, useraction) { if (item !== null && item !== undefined && useraction) { dispatch(addCurrentMenu(item)); } requestAnimationFrame(() => { // Ensure this runs after any pending layout changes var scrollableDiv = documen...
In chorme horizontal scroll work , but in safari browser its not work
|javascript|google-chrome|scroll|safari|mobile-safari|
null
**My current setup is:** Multipage Applications JSP, JS and CSS PWA is URLs precached **I have kind of a unique usecase here:** Phones that are used to connect to the app might be shared Connections are very unstable (sometimes no connection for half a day) Data should be accessible through the interface...
PWA Offline Login Procedure
|authentication|browser|progressive-web-apps|offline|
The key takeaway from [Harshita](https://stackoverflow.com/users/19648279/harshitha)'s [link](https://stackoverflow.com/a/77263657/6309) is the flexibility of the `RoutePrefix` setting in Swagger UI options, which allows you to tailor Swagger's accessibility based on the environment (local vs. Azure). See "[Customize t...
The error message indicates that the **Simple-QRCode** package requires the **PHP GD extension**, which is currently missing or not enabled on your system. Here are the steps to enable the GD extension: > **1.** Open your PHP configuration file (**php.ini**). In your case, it seems to be located at `C:\xampp\php\...
I am trying to migrate from legacy FCM(Firebase Cloud Messaging) API to the new FCM API V1. For this I have done a few things on the FCM side as per the FCM documentation, I have created the service account, downloaded the JSON file for authenticating requests. My code is in C#, so on C# side, I have made the following...
I have pandas dataframe with this input: data = { 'document_section_id': ['1', '', '1.2', '1.3', '1.3.1', '1.3.2', '2', '2.1', '2.2', '2.3', '', '2.3.2', '2.3.3', '3', '4', '4.1', '4.1.1', '4.2', '4.3', '4.4', '5', '5.1', '5.2', '5.3', '5.3.1', '5.3.2', '5.3.3', '5.3.4', '5.3.5', '5.4', '5.5', '6', ...
I have created the following Photoshop script designed to convert selected layers into smart objects: // Function to convert selected layers to smart objects function convertToSmartObject() { var doc = app.activeDocument; var selectedLayers = getSelectedLayers(doc); // Ite...
Convert selected layers into smart objects via script in photoshop
|javascript|jsx|photoshop|
Update: perhaps it's a bug in the package but out of curiosity I swapped the REST API client implementation out to use asyncio and aiohttp instead of http3 and retried the request and it works perfectly so yeah, I guess if anyone encounters the same thing - try that instead
As said in other answers, a `.webmanifest` file is recognized as a simple JSON file by the editors. But using the `.webmanifest` extension allows you to setup a specific process in your development tools (linting, deployment). For example, you can configure VSCode editor to check your `.webmanifest` file against ...
Is it possible to combine two plots and make it one plot? These are the plots I am trying to combine. I have tried the "combined_plot" command, but I get the same result - two separate plots. [![\[enter image description here\](https://i.stack.imgur.com/rNHuA.png)][1]][1] Here are my codes: Plot 1: ...
Problems running both JUnit tests and Selenium/Cucumber tests at the same time
|java|spring|selenium-webdriver|junit|cucumber|
null
I only have access to `libusbdi` documentation for QNX 6.5 and prior. At that time, QNX libusbdi did not supply synchronous messaging functions, only an asynchronous completion callback interface via `usbd_io`. You will need to write your own shim function. `usb_bulk_msg` itself is actually implemented using an un...
I tried in this way library(ggplot2) library(reshape2) # Melt the data melted_data <- melt(data, id.vars = c("gene", "Class")) colnames(melted_data) <- c("gene", "Class", "Sample", "Presence") # Define a color palette for the classes class_colors <- c("Aminoglycoside" = ...
Here is a complete [MVCE](https://stackoverflow.com/help/minimal-reproducible-example): package com.example.countcharacters; /** * EXAMPLE OUTPUT: * Enter some words here: * How now brown cow * Enter a character here: * abc * Please enter one character. Try again. ...
How to combine two plots?
|r|ggplot2|
from bs4 import BeautifulSoup as bs import requests as rq #Replace <your url> with the url you want to scrap url ='<your url>' r=requests.get(url) soup=bs(r.content,"html.parser") links = soup.find_all("a") # Create an empty dict dct = {} for x in li...
I'm evaluating some Plan Cache behaviors and this is my scenario. I'm running the following two queries separately: ``` SELECT TOP 10 * FROM dbo.Countries CT LEFT JOIN dbo.Continents CN ON CT.ContinentId=CN.ContinentId WHERE CountryId='AR' ``` ``` SELECT TOP 10 * FROM dbo.Countries CT LEFT JOIN dbo.Con...
Since you're discarding things after 11pm, we can do this: ```r library(dplyr) library(tidyr) # unnest doseq <- function(z) { z <- as.integer(z) if (length(z) > 1) { if (z[2] < z[1]) z[2] <- 24 z <- z[1]:max(z[1], z[2]-1) } z } df1 |> mutate(time = lapply(strsplit(time, "-"), doseq)) ...
null
Currently you are blocking thread where events are coming in and IO Operations can take some time. You could use something like this. When have you data coming from an event you immediately give it to a handler which keep track of data in a queue which is safe to be accessed from many threads. This handler runs a loop ...
For this I would simply: * Concatenate everything to a single line: <span /> $OneLine = -Join (Get-Content .\VerticalFile.txt) * Than split the rows based on the comas followed ([LookAhead](https://www.regular-expressions.info/lookaround.html)) by a date string: <span /> $Csv = $OneLine -Split...
I was facing the same issue, and none of the above answers worked for me. I received the following error: docker run -d -p9090:9090 --name prometheus --network my-network -v ./prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus docker: Error response from daemon: source /var/lib/docker/overlay2...
I'm looking through this [SNES controller][1] made with HTML and CSS. The background here is taken almost directly from this. I was wondering what the [num] [num] / [num] [num] no-repeat following the linear-gradient() does. I can't seem to find any documentation on numbers following gradients outside their parentheses...
No need to add an extra element, add the background coloration to the outer element <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> .container{ width: 300px; height: 200px; background-color: blue; position: relative; } ...
I'm new in react native, and I'm creating a simple test app. I followed the firebase documentation and inserted the dependencies and the google-services.json file. The problem is that now I would like to read the data from my realtime database, and following the documentation I did something like this: `... import ...
null
I'm developing an app with Expo and facing an issue with push notifications where the custom sound only plays when the app is in the foreground. When the app is backgrounded or closed, the notifications default to the system sound instead of the custom sound I've specified also it uses miscellaneous channelId. I can't ...
Custom Sound for Expo Push Notifications Only Works in Foreground
|android|react-native|push-notification|expo|expo-notifications|
More of a general question more than anything. I am authenticating during login and storing the token jwt response in local storage and on each route change running checkLogin which checks the token is valid by hitting /token/validate. Im doing this asynchronously for unprotected pages to help with performance and requ...
Authenticating vue app on each route change
|javascript|vue.js|api|rest|
|powershell|inno-setup|synchronous|start-process|
``` p1 = new Promise((res,rej)=>{ console.log("p1 setTimeout"); setTimeout(()=>{ res(17); }, 10000); }); p2 = new Promise((res,rej)=>{ console.log("p2 setTimeout"); setTimeout(()=>{ res(36); }, 2000); }); function checkIt() { console.log("Started"); let val1 = this.p1; console.log("...
How to connect connect firebase to react-native app?
|reactjs|firebase|react-native|
null
Here's a good discussion on CDECL vs. STDCALL: https://stackoverflow.com/questions/3404372/stdcall-and-cdecl Regardless of calling convention, the callee will typically save the current stack pointer to the frame pointer (EBP) so he can push and pull local variables to/from the stack at will. When he's read...
You can just execute commands in bash/other and change directory yourself! That's what worked best for me. For example: ```yaml - repo: local hooks: - id: go-unit-tests name: run go test s(go test) language: system entry: bash -c 'cd subdir && exec go test ./...' ...
Mac M1, Docker version 25.0.3 I enjoy a good keyboard shortcut. The most useful of my shortcuts so far has actually turned out to be simply opening specific applications with one press: "hyperkey + V" opens VS Code, "hyperkey + t" opens terminal, etc. i have found this approach to be much more useful than using "cmd...
I have a dataframe which looks like below [![enter image description here][1]][1] Here as you can see in the "Schema" Column there are values like PCP / LCP string, Data Load Supplier string, Cost Type string, Latest Cost CPN,SU,Loc,Med double This column actually holds the schema of a particular dataset. ...
Transformation in Dataframe Column in pySpark
|pyspark|databricks|azure-databricks|
> [![enter image description here](https://i.stack.imgur.com/kxnaD.png)](https://i.stack.imgur.com/kxnaD.png) Mac mini M1, 2020 Xcode 14.0 react-native 0.73.2 Can you help me! please I tried many ways but couldn't solve it, There was a time when I tried deleting those two error codes and it was able to build, bu...
Error: Expected a type in FBSDKConversionValueUpdating file while install react-native-fbsdk-next
|react-native|fbsdk|react-native-fbsdk|fbsdksharekit|react-native-fbsdk-next|
null
I am getting null in image **ImageView** Object while getting **activity_dialog**. the context is activity in **ReadActivityMVCView** based on MVC pattern, Any idea how to fix this? java.lang.NullPointerException: Attempt...
Callback and Microtask Queue of Java Script
|javascript|asynchronous|event-loop|asynccallback|
null
|c|linux|docker|ubuntu|clang|
Here is one possible option using [`cKDTree.query`][1] from [tag:scipy]: ```py from scipy.spatial import cKDTree def knearest(gdf, **kwargs): notna = gdf["PPM_P"].notnull() coordinates = gdf.get_coordinates().to_numpy() dist, idx = ( cKDTree(coordinates[notna]).query( coord...
{"Voters":[{"Id":14868997,"DisplayName":"Charlieface"},{"Id":17562044,"DisplayName":"Sunderam Dubey"},{"Id":1127428,"DisplayName":"Dale K"}],"SiteSpecificCloseReasonIds":[11]}
Given an array `Array<VkDeviceQueueCreateInfo>` I want to convert it to a C Array of C values (or pointer to the first item), i. e. `VkDeviceQueueCreateInfo*`. This is where I'm getting a type mismatch (obviously): [![type mismatch][1]][1] How do I convert this `Array<VkDeviceQueueCreateInfo>` to `CPointer<VkDev...
I know `serialVersionUID` is used serialization and deserialization. I read https://stackoverflow.com/questions/285793/what-is-a-serialversionuid-and-why-should-i-use-it So if we are using distributed cache like hazelcast or coherence or redis we need serialVersionUID. Example entity or VO classes needs that. My que...
|java|spring-boot|
I create two services in .NET Web API. One service is for Identity and generates a jwt token. The second service GET the jwt token from the Identity. These two services are connected using http. This is the code from the second service which get jwt token from the Identity Service ``` builder.Services.AddAuthenti...
401 unauthorized .NET Web API microservices
|asp.net|api|microservices|
null