I am trying to extend CanvasRenderingContext2D to add a few more methods. I know that it’s not a simple matter of using extends because, apparently CanvasRenderingContext2D doesn’t permit normal construction. I found the technique at How to extend CanvasRenderingContext2D (in ES6-style scripts, if possible) . I have that working well enough, but I now want to add a private method. I can’t get that working at all using the normal technique. Here is an unsuccessful test script: class Context2D extends CanvasRenderingContext2D { constructor(context) { Object.setPrototypeOf(context, new.target.pro
I am building a small task list where items are added with JavaScript. Instead of adding a click listener to every button, I added one listener to the list itself. Each item has a delete button with a small icon inside it. When I click the text part of the delete button, the item is removed as expected. When I click directly on the icon inside the same button, nothing happens. There is no error in the console, and the item stays on the page. Here is a simplified version of what I have: <ul id="taskList"> <li>Buy milk <button data-action="delete">Delete <svg viewBox="0 0 10 10"><path d="M1 1 L9
In my current project, one of the planets is a water world. I was wondering how water temperature would vary with depth. I know that, on Earth, water temperature decreases with increasing depth at a pretty constant rate (except for the surface, where local climate and water currents apply, but I'm ignoring that). On water worlds, though, I feel that water temperature would increase with depth, as all of the planet's internal heat must go through the oceans instead of having land available to conduct through. I'm not sure how quickly it would heat, though, or if my hypothesis is even correct.
The Python 3.14 docs say annotations are now evaluated lazily, so forward references work without from __future__ import annotations. I removed that import from my mini ORM. Now defining any model that refers to itself crashes. Reading Category.__annotations__ after the class is defined works fine. class Model: registry = {} def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) cls.fields = dict(cls.__annotations__) Model.registry[cls.__name__] = cls class Category(Model): name: str parent: Category | None print(Category.fields) What I expected (Python 3.14.6): {'name': <cl
Is there a chance to simply scale the visible content of main() globally, making it bigger? There will be ways to implement it in the DragWidget class, I assume, but is a broader question, of course... #include <QApplication> #include "dragwidget.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); DragWidget window; window.setStyleSheet("background-color:lightyellow;"); //scale content of window here ?? window.show(); return app.exec(); }
I'm trying to install a legacy system which used php 5.4 to a windows 11 64 bit environment using php 8.5.12. The system uses Apache 2.4 (32 bit) and Firebird 2.5 (which has been installed and working for about 4yrs) and have installed php 8.5.12. The fundamental system works OK showing static pages, but on starting Apache the following error is given. Unable to load dynamic library 'pdo_firebird' (tried: ext\pdo_firebird (The specified module could not be found), ext\php_pdo_firebird.dll (The specified module could not be found)) in Unknown on line 0 I have enabled extension=pdo_firebird in p
I am developing an educational Android application using Kotlin and Jetpack Compose. My application displays mathematical solutions step by step using animations. When a user taps the Next Step button multiple times quickly, the currently running animation gets cancelled, and some intermediate steps are skipped. I want every button press to be processed sequentially, regardless of how quickly the user taps. class StepViewModel : ViewModel() { private val _currentStep = MutableStateFlow(0) val currentStep = _currentStep.asStateFlow() fun nextStep() { _currentStep.value++ } } @Composable fun Ste
I'd like to customize the generated .rst files with sphinx.ext.apidoc. As a test, I edited the installed package files at site-packages/sphinx/templates/apidoc/*.rst.jinja, and that worked, but of course that's not the correct way to do this. I tried copying those files into my configured _templates directory, renaming the file to *_t, without success. I know I can do this with sphinx-apidoc --templatedir _templates, but that's outside the sphinx-build process per https://stackoverflow.com/a/57520238/2214933. I also know I could also create a script or add a Make target that runs sphinx-apidoc
Estoy haciendo un formulario sencillo para subir una imagen al servidor con PHP, pero al enviarlo no se guarda el archivo y me aparece una advertencia. Formulario (index.html): <form action="subir.php" method="post"> <input type="file" name="archivo"> <button type="submit">Subir</button> </form> Código PHP (subir.php): <?php $carpeta = "uploads/"; $destino = $carpeta . basename($_FILES["archivo"]["name"]); if (move_uploaded_file($_FILES["archivo"]["tmp_name"], $destino)) { echo "Archivo subido correctamente."; } else { echo "Error al subir el archivo."; } ?> Error que obtengo: Warning: Undefin
Let's say we are building curve loops to build surfaces that will be combined to build a volume (for example, 6 squares to build a cube). Each curve loop requires an ordered list of connected curves, which could be clockwise or anti-clockwise. When the surfaces resulting from the curve loops are combined to build a surface loop and subsequently a volume, does it matter if the curve loops corresponding to the six surfaces are in the same direction or different directions? Essentially, does the direction of the curve loop (clockwise or anticlockwise) determine the direction of the normal to the
Estoy trabajando con Spring Boot 3.2 y Java 17. Tengo un servicio que guarda un pedido y luego sus líneas de detalle, todo dentro de un método anotado con @Transactional. Si algo falla al guardar las líneas, espero que también se deshaga el pedido, pero el pedido queda guardado en la base de datos. @Service public class PedidoService { private final PedidoRepository pedidoRepository; private final LineaRepository lineaRepository; // constructor omitido @Transactional public void crearPedido(Pedido pedido, List<Linea> lineas) throws StockInsuficienteException { pedidoRepository.save(pedido); fo
Estoy trabajando en una aplicación Java 11 que permite registrar citas con fecha y hora utilizando MySQL y JDBC. En Java utilizo LocalDateTime, ya que necesito manejar la fecha y hora programadas para cada cita. En MySQL definí el campo de esta manera: CREATE TABLE citas ( id INT AUTO_INCREMENT PRIMARY KEY, cliente VARCHAR(100) NOT NULL, fecha_hora DATETIME NOT NULL, servicio VARCHAR(255) NOT NULL ); Para almacenar la fecha utilizo un PreparedStatement: sentencia.setTimestamp( 2, Timestamp.valueOf(cita.getFechaHora()) ); Posteriormente, al consultar los datos, recupero la fecha de la siguiente
I running into an issue whereby the audio player, is not creating an error event for media types it doesn't support. My test is providing an MP4 file containing an Apple Lossless Audio (ALE) payload as an audio source. Behaviour: Safari: Nothing logged in the console; no 'error' event or on play() promise Chrome: Nothing logged in the console; no 'error' event or on play() promise Firefox: Warnings displayed in the console; no 'error' event or on play() promise The HTML: <audio controls="" class="main-audio"> <source src="/music/myaudiofile.mp4" type="audio/x-flac"> </audio> The JS for initiat
estoy desarrollando un tipo software en JavaScript para calcular la resistencia equivalente de circuitos eléctricos mixtos, estoy usando HTML,CSS y JavaScript. El programa permite declarar resistencias y organizarlas mediante grupos conectados en serie o paralelo. Los grupos pueden estar anidados para representar circuitos más grandes. Para explicar el problema, este es un ejemplo reducido de la estructura de datos: const resistencias = { R1: 100, R2: 200, R3: 300, R4: 150 }; const circuito = { tipo: "serie", elementos: [ { tipo: "paralelo", elementos: ["R1", "R2"] }, "R3" ] }; En este ejemplo
We are investigating high database latency in a multi-tenant application using .NET 10, Entity Framework Core, Npgsql and PostgreSQL 18. Configuration We register a singleton NpgsqlDataSource and use scoped EF Core DbContext instances. Our maximum Npgsql connection pool size is 30. builder.Services.AddSingleton<NpgsqlDataSource>( _ => new NpgsqlDataSourceBuilder(connectionString).Build()); builder.Services.AddDbContext<FacturacionDbContext>( (services, options) => options.UseNpgsql( services.GetRequiredService<NpgsqlDataSource>())); Observed behavior When running a benchmark with 250 virtual u
Estoy haciendo una aplicación de control de combustible en Java 21. Tengo una lista de cargas de combustible y cada carga tiene la placa del vehículo y el costo como BigDecimal (uso BigDecimal porque es dinero). Quiero: Sumar el costo total por vehículo. Obtener la placa del vehículo con el total más alto. Este es mi código: import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; public class Main { static class Carga { private final String placa; private final BigDecimal costo; Carga(String placa, BigDecimal costo) { this.placa = placa; this.costo = costo; } publi
Estoy desarrollando una aplicación Android para administrar gastos personales. La aplicación permite registrar varios usuarios y cada uno puede guardar su sueldo mensual. Utilizo SQLite para almacenar los datos. Para relacionar el sueldo con cada usuario, guardo el identificador del usuario como clave de la tabla de sueldos. ¿Cómo puedo implementar correctamente las operaciones de insertar, actualizar y consultar el sueldo mensual de cada usuario utilizando SQLite en Kotlin?
Descripción del problema Estoy desarrollando una aplicación Android con Jetpack Compose y Room en Kotlin. Tengo una pantalla que observa una lista de entidades ProjectWithTasks desde la base de datos usando un Flow de Kotlin, el cual convierto a estado con collectAsStateWithLifecycle(). Cuando cambia el estado de una sola tarea dentro de un proyecto, toda la lista se vuelve a componer (recomposición), lo que causa un retraso visual perceptible en dispositivos de gama baja. Código Dao: @Transaction @Query("SELECT * FROM projects") fun getProjectsWithTasks(): Flow<List<ProjectWithTasks>> val uiS
submitted by billionsandbillions to books 14 points | 1 comments https://bigreaderbadgrades.substack.com/p/we-always-leave-things-unfinished “William T. Vollmann is dying. In his Sacramento studio, he talks America, unfinished work, and the 3,096-page opus he finished just in time.”
Un hadron est une particule composite, composée de particules subatomiques régies par l'interaction forte, nous dit Wikipédia. Si cela vous fait penser à Proton, ce n’est peut-être pas parce qu’un proton est un hadron, mais parce que Hadron, comme Proton, promet de faire tourner vos jeux (et plus) n’importe où, même sur des systèmes terreux. Vous connaissez peut-être Proton, l’assemblage de Wine et d’autres composants libres que Valve emploie pour faire tourner des jeux Windows sous Linux pour sa plate-forme Steam. Hadron propose la même chose pour macOS. Des jeux Windows ? Sous macOS ? Quel e
China has a 240-hour visa-free transit policy. It is only eligible to citizens of certain countries, for people arriving at certain major airports, and importantly, it is restricted to certain provinces. It also requires your onward destination to be in a different country to your origin, so it is clearly intended to allow people to take an extended break in certain parts of the China en route. I am contemplating using this to break a journey between Taipei (in Taiwan, which counts as a separate country for the purposes of this policy) and London at Shanghai in order to visit the Zhangjiajie N
I have a client-only Nuxt 4 app (ssr: false) that I build once with nuxt generate and distribute as a ZIP (the contents of .output/public). When unpacking it on a custom Apache server the app can end up at the web root or in any subfolder (/, /myapp/, /a/b/), sometimes next to other apps on the same server. Problem: In a sub-folder the page loads, but the browser requests /_nuxt/*.js from the server root. Apache answers with the SPA fallback (index.html), so I get: Loading module from "http://192.168.10.44/_nuxt/XXXX.js" was blocked because of a disallowed MIME type ("text/html"). Goal: One bu
I have two series and one continued fraction method. They all give slightly different answers when x gets large and disagree with OEIS A057754 about Li(10^16) when computed in double precision. Compiled to long double precision all the algorithms agree to a few ULP on the 64 bit significand and OEIS is correct. The logarithmic integral is defined as: They all have the zero at 1.45136923488338105 to within 1 ULP in double precision and out to 10^16 are in pretty good agreement. The first series seems slightly off when evaluated in double precision no matter how hard I try to help it be more acc
I try to record system sound with mciSendString but no sound that it records. How to fix this? Imports System.Runtime.InteropServices Public Class Form1 ' Importeer de mciSendString functie uit winmm.dll <DllImport("winmm.dll", EntryPoint:="mciSendStringA", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> Private Shared Function mciSendString(lpstrCommand As String, lpstrReturnString As String, uReturnLength As Integer, hwndCallback As IntPtr) As Integer End Function Private Sub btnStart_Click_1(sender As Object, e As EventArgs) Handles btnStart.Click ' ' Open en start de opnam
My previous passport has my US visa and some random page is slightly damaged. Can I still travel with my new and old passport which has the US visa? The bio page and visa page in the old passport are intact.
submitted by AFKBRBChocolate to books 18 points | 0 comments cross-posted from: lemmy.ca/post/73113357 Set in a future in which there are basically two types of governments: the Eastern countries have formed into a brutal autocracy called “The Federation,” which is ruled by a president who gets copied into a new body when the old one fails, and the Western countries have each turned to AI Prime Ministers, programmed to make the most beneficial decisions without human influence, with less than utopian results. We follow the stories of dissidents of the former, and cabinet members of the latter,