on-internet

Pydantic- avoid duplicating validation logic for create and update models

I'm building a REST API using FastAPI and Pydantic. This is an example for my problem: class RestaurantCreate(BaseModel): name: str email: EmailStr max_tables: int @field_validator("max_tables") @classmethod def validate_tables(cls, v): if v <= 0: raise ValueError("must be positive") return v class RestaurantUpdate(BaseModel): name: Optional[str] = None email: Optional[EmailStr] = None max_tables: Optional[int] = None @field_validator("max_tables") @classmethod def validate_tables(cls, v): if v is not None and v <= 0: raise ValueError("must be positive") return v In general, I have two schemas

Join the discussion →

Messages are not sent to the queue. RabbitMQ + Apache Camel

enter image description here I'm trying to test RabbitMQ and Apache Camel. Events are registered in the exchanger, but they aren't sent to the queue. Messages rates are changing in Exchange and Queue (Consumers ACK). The service Apache Camel communicates with RabbitMQ, there is a connection, logs are available. Response Debug only works if you publish a message through ui in rabbit. Code: package com.example.camel_demo.routes; import org.apache.camel.builder.RouteBuilder; import org.springframework.stereotype.Component; import java.util.Map; @Component public class CommandRoute extends RouteBu

Join the discussion →

Can user input cause a SyntaxError?

A SyntaxError occurs when you violate the programming language, for example if the coder forgets to close parentheses. But how can a user's input cause a SyntaxError? A user can’t change the code can they?

Join the discussion →

Find an explicit criterion about a specific class of integer sequences expressed by a recursive predicate

Let a "branching" operation be an operation that, given a finite sequence of integers, increments and duplicates one element in place. For example: (3,1,4,1,7) → (3,1,5,5,1,7) A tree sequence is a sequence of integers that can be derived from the "root" sequence (0) by applying a sequence of such branching operations. For example, (1,2,2) is a tree sequence (derived via (0) → (1,1) → (1,2,2)), but (2,1,2) is not. Below is a recursive algorithm that (I think) determines whether a given sequence is a tree sequence. Algorithm A Input: an integer sequence (a0, a1, ..., an−1) If (a0, a1, ..., an−1)

Join the discussion →

Sensitive data and AI

I am developing a tool using Python that integrates AI (GitHub Copilot SDK). This tool processes CI/CD pipeline definitions and analyze their data. I was thinking about how to deal with security in those cases that sensitive data is in plain text in the pipeline definitions. Is there a way of masking or temporary removing this data (depending on the format obviously) from the definitions. Furthermore, is there any way of indexing this data in some way to restore it after the AI response? Thanks!

Join the discussion →

How to disable or configure the rhythmic "progress" sound effect cues in GitHub Copilot/VS Code?

I noticed that during GitHub Copilot code generation ("vibe coding"), VS Code emits a rhythmic audio signal to indicate progress. While this is a helpful accessibility feature, it causes audio buffer contention when running high-CPU low-latency audio software (like a DAW or DJ software), resulting in distorted "croaking" artifacts. (Not limited to interference with professional audio software, this sound effect is also disruptive when one simply plays Apple Music aloud on a MacBook.) I’ve searched the Copilot extension settings but couldn't find a specific toggle. Technical details identified:

Join the discussion →

Add a tab with an iframe that shows the contents of a URL

I want a new tab or side panel in the customer screen in Acumatica, with an external link embedded. I want the link to be dynamic so it has the selected customer id as a parameter. https://mywebsite?f=CustomerID=CustomerID is embedded in the Customer Screen within a tab. I want to pass the selected CustomerID to the URL so that it refreshes the embedded screen and shows the information specific to that CustomerID. How can I do this?

Join the discussion →

Vertical table borders overlap header table on second page (wkhtmltopdf multi-page issue)

I am using Odoo 16 with a custom QWeb PDF report for purchase.order. When the report has multiple pages, the vertical borders of the line items table overlap the header table on page 2. It looks like wkhtmltopdf redraws the vertical lines incorrectly when the page breaks. What happens Page 1 renders correctly On page 2: thead repeats correctly But vertical borders from the line table extend upward and overlap the header table above it **Paperformat** ``` <record id="paper_format_po_a4" model="report.paperformat"> <field name="name">PO A4 Format</field> <field name="default" eval="False"/> <fie

Join the discussion →

Copilot inline suggestions in VS Code stopped formatting code correctly (ignoring line breaks and indentation)

I am currently using GitHub Copilot within VS Code, primarily to write my thesis in LaTeX, but I've noticed my issue is not limited to .tex files. Everything was working perfectly until yesterday, but I am now encountering a frustrating formatting issue specifically with inline suggestions (the ghost text that appears as I type). Instead of suggesting structured code blocks, Copilot now generates everything on a single line. It no longer respects standard formatting conventions, such as: Line breaks for new environments (e.g., after \begin{itemize} or \begin{equation}). Proper indentation for

Join the discussion →

How to deal with the Mittag-Leffler function in MATLAB or Mathematica?

I want to calculate a solution involving the Mittag-Leffler function in MATLAB or Mathematica. $f(p) = \sum\limits_{k=0}^{\infty} (v/D)^k L^{(\alpha-1)k+\alpha-3} E^{k+1}{\alpha,(\alpha-1)k+\alpha-2}(-p/D L^\alpha)|{L=1} = 0$, $v=0.8\ cm/min, D=0.01\ cm^\alpha/min, \alpha =1.97, K=0.6\ 1/min$. There are only 15 lines of code, but it takes about 10 hours to run. clc clear all tic alpha = 1.97; v = 0.8; D1 = 0.01; L = 1.0; kmax = 10; term3 = 0; p = 10^(-3):10^(-3):5; syms z; for k=0:kmax term1 = subs(mittag_leffler([alpha,(alpha-1)*k+alpha-2,k+1],z),z,-p/D1.*L^alpha); term2 = 1/factorial(k) * (v

Join the discussion →

Vite + React + TypeScript failing to resolve @/components import path

I'm working on a React + TypeScript project using Vite. When I run npm run dev, I get an import resolution error: Error: Failed to resolve import "@/components/layout/AppLayout" Project details: Framework: React + TypeScript Build tool: Vite OS: Windows Node version: 18+ I tried: Checked that the file exists Restarted dev server Verified folder structure Folder structure Folder layout: src/ components/ layout/ AppLayout.tsx pages/ CheckoutPage.tsx

Join the discussion →

Spring Cloud Open Feign: Custom Jackson Object Mapper via Decoder

Following this (https://github.com/spring-cloud/spring-cloud-openfeign/issues/1306) we have an Issue on our side. Before we updated to SpringBoot 4.0.2 and OpenFeign 5.0.0 we had the following config in out application.yml (which should now work again, thanks to mentioned changes): # Spring boot settings spring: jackson: property-naming-strategy: SNAKE_CASE deserialization: fail-on-unknown-properties: true This was to ensure, that incoming REST Requests to our RestControllers fail, if someone used our API "wrong" (-> sending unknown JSON properties). And we had a Decoder-Bean defined that woul

Join the discussion →

Odoo community Server Automation [Odoo 19]

I recently started developing with Odoo Community (I came from Odoo enterprise/Odoo Studio) and I want to know what is the right way of coding OnSave, OnChange, and OnDelete of Server Automation. Thank you

Join the discussion →

Multiple x-axes one above the other in MATLAB

I have three time series of data for different variables, Var1, Var2, and Var3. Although the lengths of these data sets are different, their start and end times are the same. Consequently, one can plot one over the other (one may check this with the help of the hold on command). Now I use the command plot(Time4Var1,Var1) to plot the variable Var1. clc; clear; close all; Time4Var1=(datetime(2021,11,24,1,4,0:60000))'; xx=(linspace(2,65,length(Time4Var1)))'; Var1=sin(xx).*log(xx).*tand(xx); Time4Var2=datetime(2021,11,24,1, (4:25:1010)', 00); Var2=bessely(1,linspace(2,23,length(Time4Var2)))'; Time

Join the discussion →

Injecting .pth file for auto instrumentation

I am developing a library that requires 'zero-touch' installation to inject a .pth file directly into the environment's site-packages directory (lib/python3.x/site-packages). While I am using Poetry for packaging, I’ve hit a roadblock: pyproject.toml is static, but the target path needs to be dynamic to account for varying Python versions (e.g., python3.9 vs. python3.11). How can I ensure that a simple pip install handles this injection automatically without requiring the developer to run additional CLI commands? Current pyproject.toml sections: [tool.setuptools.data-files] "lib/python3.x/site

Join the discussion →

Visualizing percentages values in Euler diagrams in R

I will use Euler diagrams (from the eulerr package) to visualize A, B, and the intersections of A and B. My data points are A: 21%, B: 24%, and “A&B”: 14%, and my goal is to visualize all three values as percentages. So far, everything is working well, but I have a problem visualizing the percent sign. I have tried three different options: Option 1: Visualizing the percentage values using labels. The problem with this is that visualizing the intersection value (14%) does not work. Option 2: Visualizing the percentage values using quantities and type = “Percentage.” Here I have percentage value

Join the discussion →

Design feedback for an open-source Odoo → Power BI connector using secure JSON endpoints

I’m planning to build an open-source Odoo module that allows Power BI to consume Odoo data directly via a secure web endpoint, and I’m looking for design feedback and potential pitfalls before implementing it. Proposed Workflow Odoo Side: User configures a Dataset record: Selects an Odoo model (e.g. sale.order, res.partner) Selects specific fields to expose Module generates a unique, secret access token A REST-style endpoint returns JSON data for that dataset Security Each dataset has its own token Token is required in the request URL or headers Power BI Side Use Get Data → Web Paste the gener

Join the discussion →

How to obtain a table from an online pdf in R

I have a problem I have this link pdf_data and I want to download therein the pdf entitled "New index of apartment prices by age". I downloaded this pdf in my working directory and saved it with the name "name" and then I run library(RCurl) library(tabulapdf) library(pdftools) txt <- pdf_text("name.pdf" ) lines <- lapply(txt, function(t) readLines( textConnection(t)) ) It seems to be working. Yet, I was wondering if it is possible to extract the table from that pdf using the online pdf directly, that is, just the link, without having to download the pdf. Any code provided is greatly appreciate

Join the discussion →

How to remove the "Start Free Trial" button in the new versions of the PyCharm 2025.3?

Recently I've updated my PyCharm IDE to the newest version and, together with the annoying AI suggestions, I see that there is a permanent "Start Free Trial" button that apear non-removable. I searched for older versions of PyCharm but it apears that on their site they allow to download only Pro versions - no community versions are available for download. Is there any place where I can find the old community version without the new features and the built-in ads?

Join the discussion →

How do I dump a vector table to a destination database with pgdump and psql?

I am trying to migrate between DB instances using the pg_dump util, but running into some odd behavior where it tries to create the types and operators belonging to pgvector (and the extension itself if I have not already created it!) under a schema named after the old db: % pg_dump -h localhost -U postgres -p 5432 -t my_resnet_embeddings old_db | psql -h foo.bar.com -U postgres -p 5432 new_db SET SET SET SET SET set_config ------------ (1 row) SET SET SET SET SET SET ERROR: type "old_db.vector" does not exist LINE 3: embedding old_db.vector(2048) My next move is creating the table at the dest

Join the discussion →

How to add arrowheads to a line in a MATLAB figure

I have plotted a trajectory curve in a MATLAB figure. I need to add arrowheads along the curve that show the direction of the UAV trajectory, exactly like in the picture below. How can I do this? This is what I want to achieve: Picture of the desired result

Join the discussion →

How can I have text next to my axis left and bottom in TMS FNC Charts within FMX?

I am trying to recreate this chart in TMS FNC Charts: This is what I have so far: procedure TfrmGraphTemperature.InitializeChart; begin Chart.BeginUpdate; try Chart.Series.Clear; var sMin := Chart.Series.Add; sMin.LegendText := 'Min (°C)'; sMin.Markers.Visible := True; var sMax := Chart.Series.Add; sMax.LegendText := 'Max (°C)'; sMax.Markers.Visible := True; // Axes setup per-series: integer days on X, °C formatting on Y sMin.XValues.MajorUnit := 1; sMin.XValues.MajorUnitFormat := '%.0f'; sMin.YValues.MajorUnitFormat := '%.0f'; sMin.AutoYRange := arCommonZeroBased; sMin.AutoXRange := arCommon;

Join the discussion →

React Native Skia on RN 0.81+ with New Architecture causes massive build time, huge build size, and poor performance

I’m facing serious installation time, build-time, disk-usage, and runtime performance issues when using @/shopify/react-native-skia with the React Native New Architecture enabled on RN 0.81+. Current Behavior First Android build after installing Skia takes 10–15 minutes Project directory size increases from ~1–2 GB to ~7–8 GB (with a few basic Libs) Development runtime performance feels noticeably slow Hot reload / rebuild cycles become very slow If newArchEnabled=false, the Skia Canvas does not render (blank screen or runtime error) Environment: React Native: 0.81.2 Skia: 2.4.14 Hermes enable

Join the discussion →

PPO performance drops drastically when reducing observation from 180-dim lidar to 12-dim handcrafted state (Flappy Bird)

Body I am training a PPO agent on flappy_bird_gymnasium. Setup Algorithm: PPO (stable-baselines3) Environment: FlappyBird-v0 Two observation designs: Case A: High-dimensional lidar 180 ~ 2000 ray lidar-style observation Derived from either gym lidar or CV-based ray casting Result: agent can reach very high scores (hundreds to thousands) Case B: Low-dimensio 12-dimensional vector: bird y position bird vertical velocity pipe x positions gap centers gap sizes relative offsets (bird y − gap y) All values normalized and consistent between tr Issue With the 12D observation: PPO consistently plateaus

Join the discussion →

How to control the content rendering within the tool-tip?

I have a Recharts BarChart with a custom tooltip whose position is manually controlled. When the user hovers over the tooltip, I freeze its position so it doesn’t move. However, when the tooltip is tall enough to overlap multiple bars, moving the mouse inside the tooltip causes the tooltip content to change, because Recharts detects hover on another bar underneath. Expected behavior: While hovering over the tooltip, both position and content should remain locked. Actual behavior: Position stays fixed, but tooltip content updates as the mouse moves vertically inside the tooltip. "use client"; i

Join the discussion →

Looking for first hand experience crossing Ecuador over land from Peru without a criminal-record document

Persons entering Ecuador from Peru (and Colombia) over land must show a criminal record from their home country. Here the link from Ecuadorian government tourism https://www.turismo.gob.ec/https-www-turismo-gob-ec-wp-content-uploads-2024-04-bp-sn-requisitos-de-ingreso-al-ecuador-por-fronteras-terrestres-02-04-2024-pdf/ Various governments confirm this Germany USA Canada UK Other than the German link, all links say that if one does not have a criminal-record document, the Ecuador border authorities will do a check. As a tourist, can somebody with first hand experience confirm that this is so (i

Join the discussion →

Modbus TCP (libmodbus) error after reconnection due to network failure

In an experimental setup, I would like to control a valve manifold with my PC via Modbus TCP. Environment libmodbus Visual Studio Direct connection between PC and valve terminal (no switch in between) What works Establishing the connection and simply controlling the coils works perfectly. What the problem is However, if the network is interrupted during an established connection (e.g. by pulling the communication cable), the following phenomenon occurs in about 20% of cases after the connection is re-established: The coil can no longer be switched on permanently. You can hear it switching on a

Join the discussion →

Different ways of printing my name on the screen [closed]

The problem statement is: Create a program to print your name on the screen. You may add some info. like Course etc.: Name: Juan Dela Cruz Course: BSIT My code: #include <stdio.h> int main(){ printf("Name: scythress"); printf("Course: BSIT"); return 0; } Is there any other approach to solve this problem (I guess this is not a problem) but a unique way of coding this like ascii numbers?

Join the discussion →

My first programming exercises in College

this is my first posting questions here in stackoverflow Machine Problem 1: Create a program to print your name on the screen. You may add some info. like Course etc.: Name: Juan Dela Cruz Course: BSIT My code: #include <stdio.h> int main(){ printf("Name: scythress"); printf("Course: BSIT"); return 0; } Is there any other approach to solve this problem (I guess this is not a problem) but a unique way of coding this like ascii numbers?

Join the discussion →
Older stories