on-internet

Do airports conduct drug tests when you arrive from another country?

I have had marijuana in the last 3 months, and am now planning a Europe trip. I am not taking any drugs with me. It is my first time travelling to another country so I am now feeling paranoid that I’ll get drug tested and they’ll find that I’m positive. My brother told me he got a random drug test done in Greece, so now feeling paranoid. I’m thinking of going to United Kingdom Spain Switzerland Germany Italy Iceland Turkey Any thoughts? Why would they drug test passengers? What happens if it is positive? I know this is probably a dumb question but I am feeling very paranoid so would appreciate

Join the discussion →

DateTimeParseException for LocalDateTime object despite having the format mapped

I have a Java 8 application that has to accept any number of date and time formats from a user. Obviously that yields an exhaustive list, as there are many ways to write a date and time. For locale purposes, though, this is all US-formatted dates (and yes, I checked that the locale was indeed en_US). However, what should be a simple date/time string has been causing a great deal of strife for me. Here is my code: String dateString = // user generated thing // Remove whitespace for simplicity's sake dateString = dateString.replaceAll("\\s+", ""); // There are A LOT of formats here, but I only p

Join the discussion →

Chinese Visa (M) for dual national of UK and Australia

I live in Kenya with a work visa on my British passport. I also have an Ausi passport but that has nothing to do with my status in Kenya. I was planning on visiting China for the canton fair. I applied for a visa using the British passport. After the application, I realized that Australian's are exempt for 15days for certain Chinese visas. Do you guys think there would be any issues going to China with both passports (UK+Ausi) with the pending visa application?

Join the discussion →

OpenGraph Image Works on OpenGraph.xyz but Not on WhatsApp

I’m using Next.js with the ImageResponse API from next/og to generate a dynamic OpenGraph image for my website. The issue I’m facing is that the OpenGraph image displays correctly on tools like OpenGraph.xyz and Facebook Sharing Debugger, but it does not show up when sharing the link on WhatsApp. Here’s the relevant setup: OpenGraph Image URL: https://www.presupuestouniversitario.com.ar/opengraph-image?f1e1d2a5a4c83247 The dynamic image is generated via the /opengraph-image route using ImageResponse from next/og. Meta tag used in the HTML: <meta property="og:image" content="https://www.presupu

Join the discussion →

Problema ao fechar conexões do SQLalchemy

Estou desenvolvendo uma aplicação web em python e flask-sqlalchemy e estou tendo problemas com o pool de conexões, as conexões não estão sendo fechadas após as operações no banco de dados, mesmo eu utilizando o gerenciador de contexto with. a configuração do meu projeto esta da seguinte forma: __init__.py: db = SQLAlchemy() scheduler = APScheduler() def create_app(): app = Flask(__name__) CORS(app) app.config.from_object(Config) db.init_app(app) scheduler.init_app(app) scheduler.start() run.py: from app import create_app, db app = create_app() with app.app_context(): db.create_all() if __name_

Join the discussion →

R swimmer plot error in data frame length

I know I am SO close to getting this swimmer plot in R correct, but keep having an issue where it says "Error in data.frame(id_fix, start_blank, end_blank) : arguments imply differing number of rows: 1, 0 I think the error is in my ther_end and ther_start columns but I've confirmed they are numeric, without NAs, and the same length as study_id. Thank you for the help! library(swimplot) library(ggplot2) library(dplyr) #example data study_7 <- data.frame( study_id = c(7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8), ther_type = c("S", "S", "S", "S", "E", "E", "E", "A", "A", "A", "A", "A"), ther_start_date =

Join the discussion →

Simplify tacit fork definition

I have the following tacit fork (intended to be used monadically): F&.I G H&.I I.e., the left and right verbs F and H of the fork get I applied with &. (under) before feeding the outputs to G. Is there a way to simplify the fork definition, in the sense that &.I is only specified once? (F G H)&.I is not equivalent since I^:_1 is applied after G, not before. (F G&(I^:_1) H)@I is equivalent, but clearly not simpler/conciser.

Join the discussion →

/proc/$pid/statm application reports on x86_64 (amd64) 4 times more mapped pages as same application on arm64 (aarch64)

We have a C++ multi-threaded application with shared libraries, running on linux x86_64 (debian-12, kernel 6.1.xx) and on a raspberry pi 5 ( arm64, debian-12, kernel 6.3.xx ). If I lock at /proc/$pid/statm. /proc/$pid/statm reports 4 times the number of pages on x86_64 as on arm64 on the RPI5. The gcc- release generation command lines are identical with the exception of the -mtune option. The application creates the same number of threads with same stack-sizes on both architectures. RPI5 arm64: cat /proc/$(pgrep x4rtflex)/statm 150018 65643 7904 1 0 57587 0 Sum 1124.612061 MB x85_64 ( core-i5-

Join the discussion →

Error when build AOSP 14 - internal error: undefined variable CTS_TEST_SUITES_DEFAULT

When attempting to build AOSP 14, I encountered an error during the build process. The build environment was configured according to the requirements for AOSP 14, but I encountered the following error: internal error: undefined variable CTS_TEST_SUITES_DEFAULT 11:02:32 fatal errors encountered #### failed to build some targets (02:25 (mm:ss)) #### Steps Taken Environment Setup: Executed source build/envsetup.sh. Selected the build environment with the command lunch aosp_cf_x86_64_phone-trunk_staging-userdebug. Build Information: PLATFORM_VERSION_CODENAME=VanillaIceCream TARGET_PRODUCT=aosp_cf_

Join the discussion →

Is there any use for a top-level global variable declaration?

In Python, the global declaration is used inside function definitions to specify that assigning the variable will create/update a global variable, rather than the default local variable. Python also allows the global statement outside of function definitions. This doesn't cause an error, which leads many beginners to misuse it by writing the top-level declaration once instead of putting it in each function that needs it. It seems like this should be a syntax error, like using return outside a function or break outside a loop. Do these declarations serve any purpose, which would explain why it'

Join the discussion →

The purpose of adding a plugin with "apply false" to the root project with version catalogs?

When following the instructions for migrating Jetpack Compose compiler to the dedicated Compose compiler Gradle plugin, I found this step a bit confusing: Add the Gradle plugin to the root build.gradle.kts file: plugins { // ... alias(libs.plugins.compose.compiler) apply false } The plugin itself is actually applied with same exact version in each submodule: Apply the plugin to every module that uses Jetpack Compose: plugins { // ... alias(libs.plugins.compose.compiler) } To me, step 2 seems redundant: the plugin itself doesn't execute anything in the root project the version of the plugin has

Join the discussion →

Connect to MongoDB Atlas using Delphi Firedac Driver?

I am struggling to connect to a MongoDB Atlas database using the Firedac component. I have the MongoDB Atlas connection string but am unsure how to setup the connection in Delphi. I note that the Data API has been recently deprecated in MongoDB so a REST connection is not a viable option. Grateful for any advice from anyone who has successfully created a connection.

Join the discussion →

mcmapply stalls with Rcpp/Armadillo function using openMP

I have issues with mcmapply that only occures if an Rcpp-function, testfun(), is first called outside mcmapply and then called through mcmapply. The issue only exists if: testfun() uses openMP mcmapply uses parallelization (mc.cores>1) If I call mcmapply with testfun(), it runs and finishes without errors. If I first call testfun() separately and afterwards mcmapply, then mcmapply stalls. MWE: Rcpp::sourceCpp(code= " #include <RcppArmadillo.h>; // [[Rcpp::depends(RcppArmadillo)]] // [[Rcpp::export]] void testfun(int n) { arma::mat foo = arma::sqrt(arma::zeros(n,n)); }") library(parallel) print

Join the discussion →

Choose CPU processor (intel or AMD) of machine hosting action runner

Besides choosing between linux/windows/mac and 32/64 bit, is it possible to choose the processor of the machine where the action runner will be running? In my organization we have been using actions smoothly, but a partner of ours, compiling and using our code, reports runtime crashes when running on a AMD machine. We are waiting for more information from their side: we don't know whether they compiled on an intel machine and then tried running on an AMD machine, or if both compilation and execution where on an AMD machine In the meantime, to try and reproduce his problem we were wondering whe

Join the discussion →

「ふーみん」の10分でとれる挽き肉だし だしがらは肉みそに!|料理通信

日本の食品ロス量は年間570万トン*と言われています。生鮮食品においても、豊作で余ったり、規格外、傷、スレがあって売り物にならず、行き場のない食品が日々廃棄されているのです。生産者が丹精込めて作った食材を無駄にしないための活用レシピ、今回のテーマは「豚肉」です。挽き肉を使ってクイックにとれる“挽き肉だ...

Join the discussion →

How to properly echo filtered product price inside a WooCommerce template function

I have two functions for a project I am working on. One of them modifies a WooCommerce archive layout and the other returns "Call for price" on products that have no price set: // Modify category page layout function woocommerce_after_shop_loop_item_title_short_description() { global $product; if ( ! $product->get_short_description() ) return; ?> <div class="category_description_container" itemprop="description"> <h2><?php the_field('product_title'); ?> <span class="non-bold"><?php the_field('product_subtitle'); ?></span></h2> <div class="category_description"> <?php the_field('category_descri

Join the discussion →

Android Studio Emulator Running but Not Visible (Out of View)

I'm encountering an issue where the Android Studio Emulator is running but not appearing on the screen. It was working fine previously, but now it's consistently out of view even when I try different device types. Here's what I've already tried: Restarting Android Studio Creating new AVDs Checking for updates to Android Studio and the emulator Adjusting screen resolution and scaling settings I've tried everything I can think of, but the emulator still won't show up.

Join the discussion →

Getting and changing the text content in Lexical Editor on React

So, I'm using the lexical editor in my react project. My app get the text from a API that transcribe audio and then I need to put on the Lexical editor, but I'm having problem to manipulate the text, I just don't know how to do. TextEditor.tsx: import { useEffect } from "react"; import { LexicalComposer } from "@lexical/react/LexicalComposer"; import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin"; import { ContentEditable } from "@lexical/react/LexicalContentEditable"; import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin"; import { ListPlugin } from "@lexical/reac

Join the discussion →

Obtaining a Vec from a &HashSet [closed]

Assume I have some function do_stuff that takes a &HashSet<X> and wants to collect the items into a Vec<X> by copying all the elements. What is the canonical way to do that? I have basically found the following ways to do this: Using _.clone().into_iter().collect() (GodBolt Link): use std::collections::HashSet; #[derive(Copy, Clone, Eq, Hash, PartialEq)] struct X {} struct Y { xs: HashSet<X>, } fn do_stuff(y: &Y) -> Vec<X> { y.xs.clone().into_iter().collect() } This is recommended here: How can I collect Vec from &HashSet? - Answer by at54321 Using _.iter().cloned().collect() (GodBolt Link): u

Join the discussion →

Hi I am getting his error : Unexpected token '<', "

I a beginner in web developing, I am trying to build a todo list using MERN stack but when I try to render my todos on frontend (react app ), I encountered an error saying Here's my code (App.jsx) Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON import { useEffect,useState } from "react"; export default function App() { const[todos,setTodos] = useState([]); useEffect( () => { async function getTodos(){ const response = await fetch("/api/todos"); console.log(typeof response); const todos = await response.json(); setTodos(todos); } getTodos(); } ,[]); re

Join the discussion →

Getting "Array to string conversion" error when creating a custom field type in WooCommerce

I'm developing a custom WooCommerce shipping method and trying to create a custom field type called multiselect_with_limits. This custom field type should allow selecting multiple neighborhoods and specifying a minimum order limit for each one. However, when I try to use this custom field type, I get the following error: Warning: Array to string conversion in /wp-includes/formatting.php on line 1096 function woocommerce_form_field_multiselect_with_limits( $key, $args, $value ) { // Eğer multiselect değerleri array ise işle if ( is_array( $value ) ) { $value = implode(',', $value); } $field = '

Join the discussion →

How can I use a constructor as a parameter to another constructor in c++?

I created two classes, Book & Date. The Date constructor simply takes 3 int arguments for day, month and year. The Book constructor takes string isbn, string title, string author, Date copyright_date. I thought I could use the Date constructor to create a Date object inside the Book constructor but it doesn't seem to be working. #include <bits/stdc++.h> using namespace std; class Date{ public: class Invalid{};//to throw in error Date(int d,int m,int y); Date() = default; //getters int get_day(){return day;}; int get_month(){return month;}; int get_year(){return year;}; //helper functions priva

Join the discussion →

How can i use a contructor as parameter to another constructor in c++

An exercise am working on, I created two classes, Book & Date. The Date constructor simply takes 3 int arguments for day, month and year. The Book constructor takes string isbn, string title, string author, Date copyright_date. I thought i could use the Date constructor to create a Date object inside the Book constructor but it doesnt seem to be working. #include <bits/stdc++.h> using namespace std; class Date{ public: class Invalid{};//to throw in error Date(int d,int m,int y); Date() = default; //getters int get_day(){return day;}; int get_month(){return month;}; int get_year(){return year;}

Join the discussion →

How to Implement APK Tamper Detection in a FinTech Android App

I am working on a FinTech Android app, and I recently discovered that the APK can be tampered with using tools like APKTool. Specifically, the strings.xml file can be modified, and the APK can be recompiled without any issues. This poses a significant security risk, as the app handles sensitive financial data. I want to implement APK tamper detection to ensure that any modifications to the app's resources or code are detected before the app is allowed to run. 1.What are the best practices for implementing tamper detection in Android apps, especially in the context of a FinTech application? 2.A

Join the discussion →

Set filetype based on custom file extension in neovim

I have created filetype config in below format .config/nvim ├── after │ └── ftplugin │ └── gitconfig-gh.lua And the content is: vim.opt.filetype = 'gitconfig' But still the syntax highlighting with treesitter is not working. It only works when I open the file and set it each time nvim ~/.gitconfig-gh :set filetype=gitconfig Am I missing something here? Is there any other way to set filetype based on extension?

Join the discussion →

Rcpp C++ binary object not found when adding a new function to an old R package

I am running the latest R and Rcpp under MacOS Sonoma. I am attempting to add a new function call C++ code to a very old package (Hmisc), setting things up using Rcpp::compileAttributes(). The new R function's .Call() to the C++ binary object results in object not found. Here's what I have in place: DESCRIPTION: Imports: Rcpp and LinkingTo: Rcpp NAMESPACE: export('pMedian') and useDynLib(Hmisc, .registration=TRUE, .fixes='F_') .fixes='F_' handles old Fortran binary objects in the package src/init.c: several references to the old Fortran routines, nothing about the new C++ routine src/RcppExpor

Join the discussion →

How can I make an infinite-scrolling marquee? I can't get my items to repeat

I'm sorry if this question is a bit elementary but I've been hitting into a wall with CSS for a bit now. And I can't wrap my head around infinite scrolling marquees. I still feel pretty confident/happy because I was able to figure out how to do the rest of the styling and sort of business on my own on the spot, but I just had a problem with making the .marquee-row-items repeat once they left the parent element. I know I can just add more marquee row items but I only have a limited number to work with and I really wanna make this infinite scrolling without any large or noticeable gaps between a

Join the discussion →

Using a fine-tuned model in Spring AI (Vertex AI)

I have created a finetuned model on Vertex AI and I would like to use this model in my RAG application. Does Spring AI support fine-tuned models? Or is it only these models you can use: Supported Vertex AI Gemini Chat model to use include the (1.0 ) gemini-pro, gemini-pro-vision (deprecated) and the new gemini-1.5-pro-001, gemini-1.5-flash-001 models. Tried specifying my model name in the application.properties but it defaults to 'gemini-flash-001' when I debug.

Join the discussion →

docx2pdf set permissions on docx fie

I am calling an api to download a docx file which I save locally. I then want convert it to PDF. When I run docx2pdf on the file, I get a pop-up stating that MS Word needs permissions. What can I do to automate this step and remove the popup so a user is not involved? Should I set appropriate permissions on the file when I download it? What are those permissions? I tried chmod but no luck. this is excerpts from my code: response = requests.get(url, headers=HEADERS) if response.status_code == 200: content = response.content with open("ex.docx", "wb") as file: file.write(content) os.chmod("ex.do

Join the discussion →
Older stories