Why does subprocess.run fail to run notepad in Win11 due to missing “package identity”, when os.system succeeds?

On Windows 10 with admin-installed Anaconda distribution, I had no problem using subprocess.run to open Notepad. However, when I now try to run the same command on Windows 11 from a user-installed Miniforge python environment, it fails with the following package identity error: > import subprocess > subprocess.run([r’C:\WINDOWS\notepad.exe’]) OSError: [WinError 15700] The process has no … Read more

In Unity Hub, why can’t I see a remote project

I’ve just spent the last 2h trying to find information about why I can’t see a cloud project when clicking on “Add remote project” in “Unity Hub”. I’ve added the correct email to the project in Unity. https://cloud.unity.com/home/organizations/[Organisation Number]/projects/[Project UID]/members The issue was not very well documented from Unity. You have to add the user … Read more

handle redirect in K8S cluster in localhost

I have K8S cluster running on my host (docker desktop) I have 6 components, each of them in it’s own deployment. Each of them has service (Loadbalancer or ClusterIP) Spring API GW (host api-gw on port 8000) Spring eureka server (host service-discovery on port 8001) Order service (host order-service on port 8002) Product Service (host … Read more

Javalin run-time error “No Renderer registered for extension ‘.vm'”

I’m trying to build small Web application based on Javalin framework. I’ve selected javalin-website-example (https://github.com/tipsy/javalin-website-example.git) as application template with following changes in setup: Javalin version changed to 5.6.3 Google guava version changed to 32.1.3-jre package app replaced with longer one ending with org.xxxxx.yyyyy.app My development environment is Eclipse version 2023-09, project is configured to use … Read more

How to optionally prevent/exclude an sqlalchemy relationship field from being loaded during Pydantic model validation

I am using FastAPI with SQLAlchemy ORM and Pydantic models. I’ve encountered an issue where lazy-loaded ORM fields are inadvertently loaded by Pydantic’s model_validate method. I want to exclude certain fields when loading a model using model_validate, particularly for cases where I need to prevent the loading of lazily loaded relationships. With the release of … Read more

Take Data from Main Table else Backup Table

Using a oracle DB. Table1: Dept Deptno Dname 10 HR 20 IT Table2: Dept_Backup Deptno Dname 10 HR 20 IT Lets say I have a join with emp table and dept table: (Query Below) select e.*, d.dept_name from emp e left join dept d on e.deptno = d.deptno; Lets say the table dept do not … Read more

How to store an ArrayList of in Shared Preferences in Java

I got a listview with custom items containing an image and three text views. I put the images in an ArrayList<Uri> of Uri. The other text views are put in an ArrayList<String> of String. But when I save the items with shared preferences, I save the String ArrayLists directly with the TinyDB library; the ArrayList<Uri> … Read more

Find the right url for image

I have a list of urls with images on it(there are around 170 000 urls) and i have a folder with images named by those urls and they are messed up: the image named “url3” is actualy “url10000” and etc. for example: I have 3 urls represented in list and 3 images in my folder … Read more

Using gpt-4v to depict an image(in python), “json.decoder.JSONDecodeError” and “requests.exceptions.JSONDecodeError” occurs, how to fix it?

import requests import json import base64 from dotenv import find_dotenv, load_dotenv from openai import OpenAI import os def encode_image(image_path): with open(image_path, “rb”) as image_file: return base64.b64encode(image_file.read()).decode(‘utf-8’) image_path1 = “2.jpg” base64_image = encode_image(image_path1) url = “https://api.openai-hk.com/v1/chat/completions” load_dotenv(find_dotenv(‘.env’)) openai_api_key = os.getenv(“OPENAI_API_KEY”) headers = { “Content-Type”: “application/json”, “Authorization”: f”Bearer {openai_api_key}” } data = { “model”: “gpt-4-vision-preview”, “messages”: [ … Read more

File handling in lua

I am trying to write something to a file using a function then read it using another function. Here is my code:- local getContent = function(fName) local file = io.open(fName, “r”) if file == nil then print(“Could not open the file”) return end local fData = file:read(“*all”) print(“File data:-\n” .. fData) file:close() end local writeToFile … Read more