The following program returns 1 on all compilers except MSVC, where it returns 2: struct E1 { }; struct E2 { }; struct #ifdef _MSC_VER __declspec(empty_bases) // This doesn't make any difference #endif S : E1 { char c; [[no_unique_address]] #ifdef _MSC_VER [[msvc::no_unique_address]] #endif E2 e; }; int main() { return sizeof(S); } Why is this? Shouldn't no_unique_address cause e and c to overlap?
I have a cryptography project and want to decrypt sentences using python. I wrote this code but can't get an output, where the words have spaces between them. def vigenere_decrypt(key: str, text: str) -> str: decrypted_text = "" encrypted_text = text.replace(" ", "") key_length = len(key) for i, char in enumerate(encrypted_text): #ex. 0 y, 1 a... key_char = key[i % key_length] # ex. key = KEY, text = MESSAGE => KEYKEYK shifted_char = (ord(char) - (ord(key_char))) % 26 for c in text: if c in text == " ": decrypted_char = " " else: decrypted_char = chr((shifted_char) + ord('a')) decrypted_text +
O laravel 10 tem uma classe Auth que pode verificar se o usuario está autenticado. Mas eu venho notando que, quando uma rota não está protegida pelo middleware de autenticação, Auth::check() retorna falso, mesmo se no header da requisição, o Bearer token está sendo enviado. E quando a rota está protegida pelo middleware de autenticação, ai sim o Auth::check() funciona. Alguem poderia me explicar o por quê isso acontece, ou se existe alguma forma para reverter essa situação? Poder ter acesso ao possível user autenticado mesmo quando a rota não esta autenticada. Alguém tem alguma dica, algum art
I am exploring the potential of creating a real-time data streaming application that involves integration with the MT5 server. The application aims to fetch real-time symbol pricing and trade profit data. Currently, I have managed to connect to the MT5 server through a traditional Web API provided by MetaQuotes. However, this doesn't provide real-time data fetching capabilities that are critical to my project. I've also tried using some pre-existing codes (https://www.mql5.com/en/code/169) to establish connection for single instruments, but they lack the feature of real-time trade profit fetch
I was trying to create a function that trasform a Vec to i32 fn vec_to_int(digits: Vec<i32>) -> i32 { let n = &digits.iter().fold(0, |acc, digit| acc * 10 + digit); println!("Vec:{:?} to: {}",digits,n); *n } the results of this function was just as expected Vec:[3, 4, 2] to: 342 Vec:[4, 6, 5] to: 465 Vec:[9] to: 9 Vec:[9, 9, 9, 9, 9, 9, 9] to: 9999999 but when i try using the vec[9, 9, 9, 9, 9, 9, 9, 9, 9, 1] the result was Vec:[9, 9, 9, 9, 9, 9, 9, 9, 9, 1] to: 1410065399 why this happen and what i can do to improve the code? I know that i could just parse the Vec to a string than parse to a
This is the window I am creating a UI using tkinter and I am trying to display 4 multiple video stream in a window. I created a 6 x 4 grid system and I put the first video display in row 1 column Second vid is row 1 column 2 third is row 2 column 1 and fourth row 2 column 2. Whenever I try to display it using label the video has a space between them. I tried to set the padx and y to 0 but nothing changes. I want to make the videos has no gap between them. frame_w = 300 frame_h = 300 frame_rate = 30 delay_between_frames = 1/frame_rate def segment_a(mask, video_path, label): mask_img = cv2.imrea
I tried many combinations of parameters of rsa.RSAPrivateKey.private_bytes but none of them work: from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives.serialization import Encoding, PrivateFormat, PublicFormat, NoEncryption private_key = rsa.generate_private_key(public_exponent=65537, key_size=2048, backend=default_backend()) pvt_bytes = private_key.private_bytes(Encoding.Raw, PrivateFormat.Raw, NoEncryption()) # ERROR # ValueError: format is invalid with this key public_key = private_key.public_k
I am struggling to find a way to get page title in Nuxt 3 and reuse it in layout. I am pretty sure there is a way to do it through some meta object but I just can not find it. I tried to do it through route meta /layouts/default.vue <template> <h1> {{ route.meta.title }} </h1> </template> <script setup> const route = useRoute(); </script> But now when I have to set title I need to do it twice so this method works /pages/catalog.vue <script setup> definePageMeta({ title: 'Catalog Page', }); useHead({ title: 'Catalog Page', }); </script> Seems realy hacky so I open to ideas here
I'm trying to make a small PowerShell program to display a toast notification after log on. I'd like the custom toast notification will stay there until user closes it. But but it disappears quickly. (about 5 seconds) How can I do that ? Script: Import-Module BurntToast $button = New-BTButton -Dismiss -Content "OK" New-BurntToastNotification -Text 'Yoooo, this is a toast notification... from PowerShell!' -Button $button
I wanted to create a simple signup page using React in TypeScript. My goal was to create two input fields on a signup page asking for a first and last name, and once the form was submitted, it would redirect the user to a page called "complete" that would display their first and last name. I was able to do this using the get method, as I was able to use url parameters as displayed below. Signup page: import React, { useState, useRef } from 'react'; export default function SignUpPage() { return ( <> <form autoComplete="off" action="/complete" method="get"> <label htmlFor="firstNameInputField">F
I've created a new project in Android Studio, but when I run the application to test it, it shows me this error: An issue was found when checking AAR metadata: 1. Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.2 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compi
I need a help with CommunityToolkit.MVVM to utilize messenger for communication between view models. The issue I have is that that at the same time user can open the same view twice (because it's a desktop app) so simple implementation of messenger doesn't work for me - I need to register my view model with some token to so it only listens for specific view model (I have trouble finding any example in documentation). Thank you for any help in advance. I tried to simplify the code to include only needed parts of it. UserListView.xaml <UserControl x:Class="ProjectIdeas.Core.Users.View.UsersListV
I'm running into an issue with a Spark job that fails roughly every 2nd time with the following error message: org.apache.spark.SparkException: Job aborted due to stage failure: A shuffle map stage with indeterminate output was failed and retried. However, Spark cannot rollback the ResultStage XYZ to re-process the input data, and has to fail this job. Please eliminate the indeterminacy by checkpointing the RDD before repartition and try again. This happens on Databricks 13.3 LTS (based on Apache Spark 3.4.1). I started out by step-wise eliminating calls to repartition(...) until there was non
In a more complicated setup using the python dependency injector framework I use the lifespan function for the FastAPI app object to correctly wire everything. When testing I'd like to replace some of the objects with different versions (fakes), and the natural way to accomplish that seems to me like I should override or mock the lifespan function of the app object. However I can't seem to figure out if/how I can do that. MRE follows import pytest from contextlib import asynccontextmanager from fastapi.testclient import TestClient from fastapi import FastAPI, Response, status greeting = None @
Its my code. I have a excel datas and wanna search these on that url but vscode cant finding elements. Why it cant find that element? I tried css selector,id, xpath but didnt work. import openpyxl from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait path = "dvt.xlsx" driver = webdriver.Chrome() url = "https://www.boschaftermarket.com/xc/en/keysecure.html" driver.implicitly_wait(5) driver.get(url) wb = openpyxl.load_workbook(path) sheet = wb.active sayac = 1 while sayac <= 14109: str_getVal = "A" + str(sayac) # Bir
I went to start xampp and suddenly mysql isn't starting. This happened the other day, I deleted the ib_logfiles and restarated it, and that worked. But that isn't working this time. I tried copying everything from backup to the data folder, but when I log into localhost, it is asking me to reinstall wordpress, which isn't what I want either. I've looked through countless posts but nothing people are recommending seems to work. I am not a coder by any means. This is my first time using a localhost to build a website. Here's the error: 2023-10-04 13:48:34 0 [Note] Starting MariaDB 10.4.28-MariaD
This plot is generated with alpha = 0.5 for the points. In the legend most of the point shapes are not displayed on-screen. The fix suggested here doesn't work. Full code for this display: qq <- data.table(LSGrp = factor(1:4), Incent=1:4, Size=1:4, LnNum = 1:4, Actual=4:1, Age=10:13) ggplot(data=qq, aes(x=Incent, y=Actual, fill=Age, shape=LSGrp, size=LnNum) ) + geom_point(col='black', alpha=0.5) + scale_fill_distiller(type='seq', palette='Spectral', guide='colorbar') + scale_shape_manual(values=c(21:24)) + guides(size=guide_legend(override.aes=list(shape=21, title='Ln Num', alpha=1)), shape=gu
This error appears when I try to run Gradle Run: Plugin [id: 'com.android.application', version: '8.3.0', apply: false] was not found in any of the following sources: - Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:8.3.0') Searched in the following repositories: Gradle Central Plugin Repository Google MavenRepo My Build.Gradle Properties is the following: buildscript { ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { classp
I have a Flutter application. I have to perform a penetration test on it. I used proxydroid to intercept requests since normal proxy settings don't work with this app. I successfully see the requests on burp, and receive a response from the server. However as soon as the response is sent to the application, a generic error message appears. I already thought about a parsing error. Without burp or with tls passthrough the app works perfectly. How can I understand what may cause the problem? I also tried to change iptables settings and set up invisible proxy on burp settings. The behaviour of the
This was my Conan (1.59) profile: [settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=clang compiler.libcxx=libstdc++11 compiler.version=14 os=Linux os_build=Linux [options] [build_requires] [env] Which didn't work, because CMake detected not the Clang executable, but executable /usr/bin/c++: -- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC) -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF -- The CXX compiler identification is GNU 11.4.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compil
This was my Conan (1.59) profile: [settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=clang compiler.libcxx=libstdc++11 compiler.version=14 os=Linux os_build=Linux [options] [build_requires] [env] Which didn't work, because CMake detected not the Clang executable, but executable /usr/bin/c++: -- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC) -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF -- The CXX compiler identification is GNU 11.4.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compil
This was my Conan (1.59) profile: [settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=clang compiler.libcxx=libstdc++11 compiler.version=14 os=Linux os_build=Linux [options] [build_requires] [env] Which didn't work, because CMake detected not the Clang executable, but executable /usr/bin/c++: -- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC) -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF -- The CXX compiler identification is GNU 11.4.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compil
Would it be cheaper to withdraw money at the ATM, or bring euros and exchange at the airport? I'm also considering sending euros via PayPal and collecting in Malaysia. Bonus question: How well are cards accepted in Kuala Lumpur, Malaysia?
When using keyword only dataclasses to define fields of a base class that are inherited by subclasses, how should the fields be type hinted in the subclasses to denote that the fields have a limited set of permissible values without re-assigning the default value? Example (for illustrative purposes - not a real world example): from dataclasses import dataclass from enum import auto, StrEnum from typing import Literal class Direction(StrEnum): DOWN = auto() LEFT = auto() UP = auto() RIGHT = auto() UNKNOWN = auto() @dataclass(kw_only=True) class Base: direction: Direction = Direction.UNKNOWN @da
I want to use opensearch-rest-high-level-client and elasticsearch-rest-high-level-client libraries within my application. Both of these jars use different version of lucene-core as dependencies. Is it possible to use different version of lucene-core at runtime? I tried to find a version of both the libraries with common version of lucene-core, but couldn't find one.
I am trying to add js debug code for my library built in vue3 and i want it to be automatically removed when building to production using a separate vite.config.js file. The debug code can be sandwiched in specific comment lines like this : /* ------------test---------- */ console.log("this is a testing test"); /* ------------test---------- */ is there a way to do that in vite configuration, or which special plugins or i will need to manually open files and remove those code snippets with a node script before the compilation
I'm using the pdf.js (v3.10.111) stable version (for modern browsers) from https://mozilla.github.io/pdf.js/getting_started/#download . I'm able to load a pdf file and make graphical modification on it, and save the modified file onto my desktop. The code for this is the following: However, my goal would be to save the file back to the server. I'm not really aware how I can get the data of the modified file with Javascript / Jquery. How can I do that? Here's my current code: <!DOCTYPE html> <html> <head> <script src="build/pdf.js"></script> <script src="build/pdf.worker.js"></script> <script s
I have a code that is returning a list of directions for a csv with the latitude and longitude of several vehicles and their stops from OpenRouteService (ORS), an open source API. The data is in the format "EqupimentID,", "Latitude", "Longitude". I'm doing this using an api call through the ORS module. This should return a geojson of the directions, which is converted to an ESRI shapefile: import pandas as pd import openrouteservice as ors import fiona from openrouteservice import exceptions import requests import time csv_file = '24hourtrucks.csv' api_key = 'your key here' df = pd.read_csv(cs
I am using the git hub actions to deploy to app service but i am unable to fetch the submodule and getting exit code as 1 I tried by creating PAT token in the settings and authorizes SSO but i am getting the exit code 1 when i am fetching the submodule from yml file in git hub action. Fetching the repository /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/v2*:refs/remotes/origin/v2* +refs/tags/v2*:refs/tags/v2* The process '/usr/bin/git' failed with exit code 1 Waiting 16 seconds before trying again /usr/bin/git -c prot
I have a polars dataframe along the lines of: df = pl.DataFrame( { "group": [1, 1, 1, 2, 2, 2, 2], "mean": [25.5, 25.2, 24.9, 50.5, 55.1, 54.2, 60], "std": [2.5, 3.5, 1.7, 10.2, 5.5, 7.8, 20.5], } ) For each row we have a mean and standard deviation for a normal distribution. I'd like to add a column which represents the probability that when sampling, that row would have the lowest value in its group. It is a strict requirement that the column is added with an expression which can be entered into a with_columns call. I was able to write the following: def probability_smallest_in_group(series)