instruction stringlengths 0 30k ⌀ |
|---|
If a popup/tab is opened from Javascript using `window.open` where
- The popup/tab is on a different domain from the opener
- The page in the popup/tab has the HTTP header `Cross-Origin-Opener-Policy: same-origin-allow-popups` set
Then does the opener have access to the popup via the return value of `window.open... |
Popup loaded with "Cross-Origin-Opener-Policy: same-origin-allow-popups" in it (not its opener) |
|javascript|google-chrome|security|http-headers|cross-origin-opener-policy| |
I have two following models created in my SwiftData project in Xcode
@Model
class Notebook {
var id: String = ""
var name: String = ""
var desc: String?
var notes: [Note]?
init(id: String, name: String, desc: String? = nil) {
self.id = id
self.name = name
... |
How can I retrieve the remote Git address of a repository?
I tried `git remote`, but that just lists the branches.
|
How can I retrieve the remote Git address of a repository? |
This ...
> ```
> int xyGrid[10][5];
> ```
... in `main` declares `xyGrid` as an array of 10 arrays of 5 `int`s. In most contexts, such an array value is automatically converted upon evaluation to a pointer to the first array element. In this case, the first array element has type "array of 5 `int`", so the re... |
I'm making a psychological quiz шт REACT. There is text. In a text editor. The text consists of 100 questions and 340 answers. How to make a React program that took at least 2 questions, preferably 10 questions at once, and inserted brackets and other characters so that this data could be taken from an array file? I pu... |
It’s not possible to take text and translate it into a convenient format. I'm completely confused |
|reactjs| |
null |
For my model evaluation, I am using cosine similarity with below code:
```
cosine_similarity = (np.dot(np.array(v1), np.array(v2))) / (norm(np.array(v1)) * norm(np.array(v2)))
```
But getting below error, any help here
```
<scipy.stats._distn_infrastructure.rv_continuous_frozen object at 0x000001E703C665A0>
<sci... |
amplify gen2 sandbox with existing stack |
|amazon-web-services|aws-amplify| |
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 commas that are followed ([LookAhead](https://www.regular-expressions.info/lookaround.html)) by a date string:
<span />
$Csv = $OneL... |
My website preloader is not showing properly first the website appears for a few mili seconds then preloader then the website.
I am using Elementor WordPress, I have added the preloader code in my theme file editor here is the code snippet
"add_action('wp_footer', 'Allprocoding_Preloader');
function Allprocodi... |
In JavaScript (including ES6), there isn't a concept of upcasting or downcasting like in statically-typed languages such as Java or C++. However, you can achieve a similar effect by treating objects of a subclass as if they were objects of their superclass. This is because JavaScript objects are based on prototypes, an... |
**<h2>In my nextjs project,this solved me:</h2>**
1. deleting the .next folder
2. deleting package.json
3. npm run build again |
I have a textarea where users can paste text from the clipboard.
The text pasted `clipboarddata.getData('text')` gets modified.
However, I need a switch that if pressing <kbd>CTRL</kbd> <kbd>SHIFT</kbd> <kbd>V</kbd> instead of <kbd>CTRL</kbd> <kbd>V</kbd> the pasted text does not get modified.
I tried to cat... |
Get keys pressed with Clipboard event in Javascript? |
|javascript|events|clipboard| |
I'm trying to build navbar component in react with tailwindCss.
I've added `space-y-2` to get spacing on y axis, for all `li` elements.
But the first li element (Home) is not getting spacing as expected.
It looks like
[![enter image description here][1]][1]
Why Home is behaving differently ?
Can anybody pls he... |
The answer, in case anyone else comes across this, is that the default Blazor template comes without interactivity enabled which leaves a lot of developers baffled (me included). Basic stuff such as button click event handler no longer works and there is no warning or exception.
This means that you must select a typ... |
In my angular app there can be 2 type of layout(e.g. List and Detail).
I have to get the layoutConfig based on activated route. For this I'm using a route resolver.
My plan is ResolveFn will return a signal not an observable.
My *LayoutService* has an additional requirement, if its a List, it will get list data from... |
Currently have this and it automatically connecting the plot if they are continues marks.
```
plot(stopLossPrice, color=color.rgb(255, 153, 0), title="Mark", linewidth=2, style=plot.style_steplinebr, offset=0)
if (not na(stopLossPrice))
label.new(bar_index, stopLossPrice, text="SL - 2%", style=label.style... |
My website appears for few mili seconds then preloader then website |
|javascript|php|css|wordpress-theming|preloader| |
null |
When running the game in the editor when I press the keys sequence N,O,T,E,S it's opening a small window. then when I type inside the window some text and also type /exit or /close it will close the window.
but then when I try to type the sequence of keys N,O,T,E,S again it's not opening the window again only after... |
Why sometimes the sequence keys is working and sometimes not responding? |
Tailwindcss not aligning element <li> as expected with utility space-y-3 |
[error show when I run my code in android studio I want to run my app in emulator[this is showing when I want to select device](https://i.stack.imgur.com/ltR9j.png)](https://i.stack.imgur.com/FhssX.png)
I want to run my code in verchular device
error - (Installation did not succeed.
The application could not be in... |
when I try to run my app in emulator showing error |
Try doing:
pip install -U datasets
>This error stems from a breaking change in fsspec. It has been fixed in the latest datasets release (2.14.6). Updating the installation with pip install -U datasets should fix the issue.
git link : https://github.com/huggingface/datasets/issues/6352
************
... |

for the given example html page:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<div class="ia-secondary-content">
<div class="plugin_pagetree conf-macro output-inline" data-hasb... |
OP here. I've reached an offline solution for now. It became very clear how to get the timestamps I wanted once I installed JSONvue on my browser and saw the structure of the JSON data. Excuse any inefficiencies as the timestamp data was quite nested.
It's also obvious that retrieving the JSON by putting .json at th... |
|pine-script|pine-script-v5|tradingview-api|pine-script-v4| |
{"Voters":[{"Id":2518285,"DisplayName":"Brett Donald"},{"Id":1427878,"DisplayName":"CBroe"},{"Id":6463558,"DisplayName":"Lin Du"}],"SiteSpecificCloseReasonIds":[13]} |
{"Voters":[{"Id":2446254,"DisplayName":"Cody Geisler"},{"Id":14732669,"DisplayName":"ray"},{"Id":5053002,"DisplayName":"Jaromanda X"}],"SiteSpecificCloseReasonIds":[11]} |
1. grab that div element using the the id or class
2. then in js file render the result in that element
refer:- https://www.geeksforgeeks.org/dom-document-object-model/ |
Your functions don't match is why: missing `- 1` on the orange and red lines. `linewidth` will control the line width.
ggplot() + xlim(0, 50) +
geom_function(fun = function(x) exp(I0 - b * x), colour = "blue", linewidth = 0.1) +
geom_function(fun = function(x) exp(d * x) - 1, colour = "orange", lin... |
|shell| |
|python|python-requests| |
I have setup a declarative Jenkins-Pipeline which runs fine so far. During a post-action I would like to publish issues found by warnings-ng-plugin. This had worked till 4 weeks ago or so. Suddenly the publish doesn't work anymore.
This is my post-action
post {
always {
script {
... |
In my angular app there can be 2 type of layout(e.g. List and Detail).
I have to get the layoutConfig based on activated route. For this I'm using a route resolver.
My plan is ResolveFn will return a signal not an observable.
My *LayoutService* has an additional requirement, if its a List, it will get list data from... |
|c#|unity-game-engine| |
Localization languages are defined in the `AdministrationServiceDomainModule` (under **services/administration** folders). So, you can configure the localization languages there.
Alternatively, you can configure the localization languages in your final application. For example, if you selected the MVC UI, you can c... |
It is recommended to use [Title bar customization][1] to get the effect you want. Add the image in the custom title bar.
### MainPage.xaml
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="48"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid x:Name... |
|php|symfony|doctrine| |
null |
I want to add a moving circle on MKMapView it will remain in the centre of the map and start moving when the user moves the map and zoom in and zoom out when the user zooms in/out the map I am able to achieve this by using the centre coordinate of the map but when I move the app it is flickering as I am removing and ad... |
Accelerated PyTorch for Macbook with AMD GPUS |
I am trying to run flet code on ubuntu 22.04 and keep getting the following error message
(flet:6177): Gdk-CRITICAL **: 11:08:50.080: gdk_window_get_state: assertion 'GDK_IS_WINDOW (window)' failed
What could be wrong? I have updated my system so its not about updates.
I have tried to run flet code on ubuntu 22... |
GDK Assertion IS_Window failed |
|flet| |
null |
|python|machine-learning|xgboost|shap| |
I have a question about understanding the behavior of clearRect() in JavaFX, using JavaFX 18.0.2 & OpenJDK 17.0.9+9:
In the following example, clearRect() doest not clear the given 10x10px area as expected.Output is:
**Try with Clear:**
Color:0xffffffff : 100
Color:0x0000ffff : 22379
... |
Here is the official document about uninstalling the JDK.
https://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html#uninstall |
Upon checking, I found that there was no issue with the Flutter application; the problem was with the cache policy of the website I was trying to access. |
I am attempting to perform Device Authorization Flow on a CLI in Go. I have followed the steps in https://auth0.com/blog/securing-a-python-cli-application-with-auth0/ to set up my application in Auth0. After successfully requesting a device code, I attempt to get a request token.
```
// Gets a request token.
func (l... |
Auth0 return status code 400 after on subsequent polls for request token |
|go|httprequest|auth0| |
I'm trying to add items to a linked list, however if an node's data repeats instead of returning the new node it should return the original node with the same data.
I have a test file along with the methods I'm testing. the trouble comes from my addOnce() method returning the node parsed through instead of the first o... |
What line of code do I change to avoid duplication in a linked list? |
|java|generics|linked-list|duplicates|nodes| |
null |
{"Voters":[{"Id":-1,"DisplayName":"Community"}]} |
After upgrading to openjdk 17, test cases are failing with error<br>
**Exception in thread "closer-shutdown-hook" java.lang.NoClassDefFoundError: org/apache/maven/plugin/surefire/booterclient/output/InPluginProcessDumpSingleton
at org.apache.maven.plugin.surefire.booterclient.ForkStarter$CloseableCloser.run(For... |
Thread 46: "UIGraphicsBeginPDFContextToFile() failed to allocate CGPDFContext: bounds={{inf, inf}, {0, 0}}, path=/Users/kishanvirani/Library/Developer/CoreSimulator/Devices/B1AA298A-2DDE-46BA-9091-9D9A45F9240C/data/Containers/Data/Application/0FC5CFB0-916F-4646-9342-5A463F84F10A/Library/Caches/EasyPdfViewer/F9807771-01... |
libc++abi: terminating due to uncaught exception of type NSException when load PDF on IOS Device |
|ios|flutter| |
null |
I'm making a psychological quiz шт REACT. There is text. In a text editor. The text consists of 100 questions and 340 answers. How to make a React program that took at least 2 questions, preferably 10 questions at once, and inserted brackets and other characters so that this data could be taken from an array file? I pu... |
The redirect URI in the initial auth link should not be pointing to redirect_uri=https://mysecurity.keycloak.com/realms/myrealm/account, instead it should point back to your application.
This redirect_URI needs to match the redirect URL defined inside KeyCloak EXACTLY.
The URL should not be your welcome page, i... |
Seems like nativewind has two separate documentations. One for v2 (default) and one for v4.
With v2 I was encountering this error. But with v4, the setup works
V4 link: https://www.nativewind.dev/v4/overview
Here is my complete setup.
package.json
```{
"name": "habitapp",
"version": "1.0.0",
"... |
Add this Code to your script
<script>
function logicalAND($opA, $opB) {
if($opA) {
if($opB) {
return true;
}
}
return false;
}
if (logicalAND(script.readyState, script.onload) !== null){
...
</script> |
If you're after building an `Explanation` object (not `Explainer` like you stated in your question), then you can do the following:
import xgboost as xgb
import shap
from sklearn.model_selection import train_test_split
X, y = shap.datasets.california()
X_train, X_test, y_train, y_test =... |
First set up some test files and create `features`. Now read the files into `DFs` and create a `years` vector that gives the corresponding year for each entry in `DFs` splitting `DFs` by `years` giving `spl`. Then for each component of the split perform the merge.
# set up test files
for(year in c(2015, 2... |
My method of generating a random string with full range of ascii.
use rand::Rng;
fn main() {
let value: String = (0..100).map(|_| char::from(rand::thread_rng().gen_range(32..127))).collect();
println!("{}", value);
}
Example output:
**n/5;X D0}xbc8sEGY^cHSW3BiV-W... |
Using any sed:
$ sed 's/\\/\\\\/' file
Hello\\nmate
$ sed 's/\(.*\)\\\(.*\)/{"output":"\1\\\\\2"}/' file
{"output":"Hello\\nmate"}
The above was run on this input file:
$ cat file
Hello\nmate
If your input instead looked like this:
$ cat file
Hello
mate
and ... |
Adding moving circle overly on MKMapView on iOS 16 and above |
|ios|swiftui|mkmapview|overlay|mkcircle| |
I have several larger files (400-800MiB) in which I need to convert Hex values to others.
I can do this in some Hex editor, but I would like to do it automatically, in a Bash script.
I know how to check with xxd whether a given value is in a file:
FILE='file.vpk'
SEARCH_STRING='MaxRagdollCount'
OLD... |
Edit the file and replace the Hex value with Bash script |
|linux|bash|hex| |
Change your code from:
@{
await Component.InvokeAsync("Edit", new { config = new List<EditConfiguration>() });
}
To:
@await Component.InvokeAsync("Edit",new { config = new List<EditConfiguration>() })
|
I have a vectorised def:
def selection_update_weights(df):
# Define the selections for 'Win'
selections_win = ["W & O 2.5 (both untested)", "Win (untested) & O 2.5", "Win & O 2.5 (untested)", "W & O 2.5",
"W & O 1.5 (both untested)", "Win (untested) & O 1.5", "Win & ... |
> ...and the problem seems doesn't reach to solution
This is exactly the problem that is also mentioned on [Wikipedia](https://en.wikipedia.org/wiki/Knight%27s_tour):
> A brute-force search for a knight's tour is impractical on all but the smallest boards. For example, there are approximately 4×10<sup>51</sup> po... |
On the Docker Engine earlier than version 23.0, the legacy Docker Engine builder processes all stages of a Dockerfile leading up to the selected **`--target`**. It will build a stage even if the selected target doesn't depend on that stage.
However, since Docker Engine 23.0, **BuildKit** is the default builder for u... |
How I solved my issue?
I don't know the actual reason for this error and its solution but I deleted mongodb database folders `C:\data\db` and restarted my PC.
**Note:** This is not a recommended solution for production env. |
I am writing a package to be shared by various projects. I have import statements in my package such as:
```from my_package.module.script import foo```
However if I place this package in my project under any name other than `my_project` then the code will break. Is there a way around this **without** relying on r... |
Absolute import in package of unknown name |
|python|import|package| |
I am trying to run java microservices on an Macbook Pro with M1 Arm processor.
The Internet is awash with instructions on this. Most of them declare victory at getting Minikube to run. I haven't found any that carry this all the way to having even a Hello World service deployed all the way from source code.
My ... |
Minikube cannot access Podman Registry |
|minikube|podman|apple-silicon| |
For some reason I had next as a dev-dependency, once i moved it to a dependency, it fixed it for me. |
Add these two permission in the androidmanifest file:
```xml
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
``` |
Add this code snippet to your script
<script>
function logicalAND($opA, $opB) {
if($opA) {
if($opB) {
return true;
}
}
return false;
}
if (logicalAND(script.readyState, script.onload) !== null){
...
</script> |