on-internet

how can I add methods to a frozen/pre-compiled module

In micropython, lots of very useful stuff you'd find (such as in regular Cython) isn't available because of code space. As just one example, on my stock linux machine there are 67 entries in math.__dict__ but on my ESP32 there are only about 45. Sadly, a couple of the missing ones are things I would like to use, such as greatest common denominator: math.gcd() or least common multiple: math.lcm() and neither of these are built. In regular python I'd just do something like this: def my_lovely_lcm(a, b): return a * b // gcd(a, b) and then math.lcm = my_lovely_lcm BUT... apparently one of the micr

Join the discussion →

What are the key libraries and documentation for implementing anomaly detection in Python?

I am starting a role in industry where I will be working on anomaly detection using machine learning, particularly for data analysis tasks. I would like to understand which tools and libraries are most commonly used in practice, and where to find their official documentation. Context I am working with Python My focus is on anomaly detection in real-world datasets (e.g., time-series or tabular data) I am especially interested in practical implementations rather than theory Question Which Python libraries are commonly used for anomaly detection, and where can I find their official documentation

Join the discussion →

Applying relief (emboss) effect to bitmap using GetPixel/SetPixel in C# WinForms

I am trying to apply a simple relief (emboss-like) effect to an image in a WinForms application using Bitmap.GetPixel and SetPixel. The idea is to compare the brightness of the current pixel with a shifted pixel (offset by 5 pixels) and compute a new grayscale value. Here is my code: public static void ApplyReliefEffect(Form form) { if (ImageStorage.bitmap != null) { int brightness; int brightness1; int brightness2; Bitmap sourceBitmap = new Bitmap(ImageStorage.bitmap); Bitmap offsetBitmap = new Bitmap(ImageStorage.bitmap); Color currentPixel; Color offsetPixel; Graphics graphics = form.Create

Join the discussion →

How to run 2 commands at once, in parallel, auto-executing each command in a pane. For PowerShell but looking for a cross-platform terminal workflow

About running 2 commands at once, for example to run 2 console programs with 1 single command, in PowerShell, one way to do this is with a command in the next format, just by adding ; between each of the 2 commands/sub-commands, all in 1 single line: python C:/path/to/program_2/program_2.py; C:/path/to/program_1/program_1.exe Or if the 2 programs are in the same path, and already being in that path: python program_2.py; ./program_1.exe In this way, the 2 programs run sequentially, one after the other, all in the same terminal window/tab. Now I'm looking for a way to run 2 commands in the next

Join the discussion →

Retrieve property of map object with arrow function

My map includes an arrow function which I can't access one of its properties/values of: Map(1) { '<id>' => User { id: '<id>', bot: false, system: false, flags: UserFlagsBitField { bitfield: 0 }, username: 'someUserName', globalName: 'someGlobalUsername', discriminator: '0', avatar: '<numbers>', banner: null, accentColor: null, avatarDecoration: null, avatarDecorationData: null, collectibles: null, primaryGuild: null } } Both <id>s are always the same. This is a discord.js result after fetch(). I need to access that map's username value. I've tried let someVar = thisVar.username; and maps.get()

Join the discussion →

Retrieve property of [object Map] with arrow function - JS

Elo, my issue is the following... I have a map in js, which was created through a fetch(). This map however includes an arrow function, of which I can't grasp how to access one of its properties/values Map(1) { '<id>' => User { id: '<id>', bot: false, system: false, flags: UserFlagsBitField { bitfield: 0 }, username: 'someUserName', globalName: 'someGlobalUsername', discriminator: '0', avatar: '<numbers>', banner: null, accentColor: null, avatarDecoration: null, avatarDecorationData: null, collectibles: null, primaryGuild: null } } Additionally, when this map is returned through fetch, both <i

Join the discussion →

How to minimize number of lookups in a Hash?

say you want to find the first duplicate in an array. you could do something like this: cnt = {}; [ 11, 22, 77, 22, 33 ].each_with_index { |x,i| j = cnt[x]; ## <1> break [x, j, i] if j cnt[x] = i ## <2> } #=> [ 22, 1, 3 ] this is O(n) as long a Ruby Hash is O(1) for lookup and insert. but still it does lookup two times ( <1>, <2>). Is there a way to avoid it? something like this: cnt = {} some_array.each_with_index { |x,i| j = cnt.exchange( x, i ); break [x, j, i] if j } Yes, I could easily implement such a method: def exchange( k, val ) old, self[k] = self[k], val return old end but this woul

Join the discussion →

Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7

I recently noticed I'm getting the following error in my tsconfig.json: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. How can I fix this error? Here is my tsconfig, which I'm using to run my Next.js project with Typescript and shadcn/ui. { "compilerOptions": { "target": "ES2017", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "resolveJsonModule": tru

Join the discussion →

Pandas DataFrame Pivot, reset index

I have a data-frame which looks in as simplified way like following: import pandas as pd df = pd.DataFrame({ 'catYM': [202601,202601,202602,202603,202603,202501,202501], 'prod': [20,26,34,45,18,19,20]}) print(df) catYM prod 0 202601 20 1 202601 26 2 202602 34 3 202603 45 4 202603 18 5 202501 19 6 202501 20 The data-frame has a total length of m= index+1 rows. The column catYM defines the categories with respective values in column prod. The number of rows per category varies. I could have n categories. When using df.pivot I see a new data-frame with n columns and m rows with a lot of NaN fille

Join the discussion →

Centered/Floating search bar in Visual Studio Code

Does anyone know the settings to set search bar in visual studio code to centered/floating like in the picture? tbh, i don't remember how i change my settings to be like that and when i synced my old vs setup to my new laptop this settings specifically for search bar set to centered/floating is not working. if anyone knows please let me know thank you.enter image description here

Join the discussion →

Need to design a pdf batch file processsing system

I get around 100,000 pdf files (1-50MB each) a month. We get file IDs, pull and parse files, build chunks, embed them, and store documents + vectors for semantic search. What can be the best design for processing these files in batch, speed is a major concern me. How I am doing currently is, I take the file, download the file, create the markdown using Azure DI, then use LLM to process chunks and create embeddings and store these

Join the discussion →

How to switch between ADB and ADBD

How to switch between the the two (ADB and ADBD)? I'm trying to get to ADB but it keeps kicking me into ADBD. I'm new at this. I'm trying to unlock the boot loader to get a custom ROM on my device.

Join the discussion →

How to customise the colour theme in Visual Studio 2026

I'm missing the UI colour contrast of the 2022 blue theme in the new Visual Studio 2026. After a lot of try and error I had no success to change that. Apparently VS 2026 has a completely new and incompatible theme system. But nobody seems to know how to operate it. I want to fix those colours and bring back the contrast I need to find stuff on the screen and provide some orientation for my eyes. Here's what I've tried. Created a file "CoolBreezeDeepBlue.vstheme" with this content: <Theme Name="CoolBreezeDeepBlue" GUID="{B1E6A1F0-8C3A-4F2A-9A1E-123456789ABC}" FallbackId="{de3dbbcd-f642-433c-835

Join the discussion →

Metadata-based deepfake detection

I want to develop an mvp metadata-based deepfake detection tool under one month for my final year project and I am still a beginner in Python. Any advice on how I can accomplish this without failing this course will be very helpful.

Join the discussion →

Wordpress webhook is not live to paypal API and simulator

I am buliding a wordpress plugin. To take payment I am using Paypal. Users wil get an paypal link to pay the payment. I am using webhook for backend confirmation. But paypal can't reach may webhook endpoint. I have tried the webhook from my broswer. The url is live. But Whenever I try to reach from paypal's webhook simulator I can't get any responpose. In the sandbox box I tried to reach the webook by simulating payment vai sandbox acount. Rather I found this error. "reason_phrase": "recvAddress(..) failed: Connection reset by peer; nested exception is io.netty.channel.unix.Errors$NativeIoExce

Join the discussion →

How to make sure users read and modify only their own data in Supabase?

I'm connecting an Android app to Supabase. The Supabase project includes users and tasks tables. I would like to allow users to read, update and delete their own tasks only. From what I understand, the Supabase documentation states that applying appropriate Row Level Policies on the tables will limit who has access to what. So if I apply the following policy to the tasks table, will the android app select and access only the rows of the logged in user? create policy "Anonymous and permanent users can read their own tasks only" on public.tasks for select to authenticated using ((select auth.uid

Join the discussion →

How to share the JavaScript files for the Blazor via Nuget packages and include them to consuming projects?

Let us get the question Blazor get div position / coordinates for example. According to both answers, currently it is possible only via JavaScript: function GetElementLocation(elementId){ var element = $("#"+elementId); var position = element.position() var width = element.outerWidth(); var height = element.outerHeight(); return { Width: width, Height: height, Top: position["top"], Left: position["left"], } } public class ElementLocation { public double Width { get; set; } public double Height { get; set; } public double Top { get; set; } public double Left { get; set; } } [Inject] protected I

Join the discussion →

Difference between MongoDB and MongoDB altas

I am a learner and right now at Database thing and choose MongoDB to learn as my stack is MERN so, but I am very confused about what MongoDB actually is and is MongoDB Atlas part of it or is it the actual server in MongoDB , and also what did it mean by using locally MongoDB? Everything connected to each other or things are work differently ?

Join the discussion →

Is there a standard for plane passenger compensation in the US?

This is currently a hypothetical scenario, but I want to get ahead of the possibility that it turns real. Currently I have a flight SAF (Santa Fe) to LAX on an American Airlines subsidiary (with an onward connection from LAX, all on the same ticket. I chose this flight as it gave me a relatively short layover of 4 hours in LAX. Since booking the flight, it has been changed once to now give me a 1 1/2 hr layover in LAX. But I can deal with that. However, local travelers have reported lots of flights from SAF simply being cancelled, and I have a similar fear that due to the higher cost of Avgas

Join the discussion →

AWS Aurora: too many connections

I have a problem I am seeing a significant discrepancy between my AWS Aurora (MySQL Compatible) metrics and the actual database state. When viewing the DatabaseConnections metric in the AWS Console/CloudWatch/ Aurora Metrics, the graph shows [Insert Number, e.g., 50] connections, open all the time. When I connect to my database and run SHOW PROCESSLIST;, it reports only [Insert Number, e.g., 3] active connections, and they are all from my application, But when I want to see how many threads are connected it says around 50. I have two Aurora instances one for write and one for read, In my code

Join the discussion →

I have Cors issues developping an app with ionic that interact with Odoo SaaS, is there an easy way to fix the issue?

So I work for a company that help other companies to use Odoo (usually SaaS version). One of them want us to dev a simplified app for their employees that will interact with Odoo (they consider the Odoo mobile app to be too messy and complex for what they want). So I started developping that, and I'm stuck because I have Cors issues. Sadly it seems like their is no easy way to configure Odoo in a way that allow me to allow cross origin. So here I am, hoping someone tell me their is in fact a way of doing it, instead of having to build a middleman that will let the app interact with Odoo

Join the discussion →

How to use TFLite model signatures with InterpreterApi in LiteRT from Google Play Services ()?

I’m migrating my Android project from the bundled TensorFlow Lite to TensorFlow Lite via Google Play Services (LiteRT). I use Movinet, which uses signatures and I’m feeding it individual video frames one by one for streaming inference. In the old bundled Interpreter class, I could use: interpreter.runSignature(inputs, outputs, "serving_default") However, after migrating to InterpreterApi from Play Services, this method does not appear to be available — InterpreterApi only exposes run() and runForMultipleInputsOutputs(). How to use TFLite model signatures with InterpreterApi?

Join the discussion →

Weighted Score in Excel

How do I build a weighted scoring model in Excel that calculates a final score from multiple columns, where some metrics are higher-is-better and others are lower-is-better? Starting in Row 4 D - $ amount - higher is better G - % - lower is better H - number - higher is better I - % - lower is better K - % - higher is better L - % - higher is better N - % - lower is better Current Formula: =MAX(0, MIN(100, ROUND( (D4 / MAX($D$4:$D$100)) * 20 + (1 - G4 / MAX($G$4:$G$100)) * 15 + ((H4 - 500) / (850 - 500)) * 15 + (1 - I4 / MAX($I$4:$I$100)) * 10 + (K4 / MAX($K$4:$K$100)) * 15 + (L4 / MAX($L$4:$L

Join the discussion →

How does C know the value of DBL_EPSILON in machines that do not follow the IEEE floating point convention

I was trying to solve the problem posed in this question where the author asks that the value of DBL_EPSILON be computed portably without using the macro. My solution : #include <stdio.h> int main(void) { double one = 1, next = 1, zero = -0.0; unsigned char * ptr_next = (unsigned char *)&next, * ptr_zero = (unsigned char *)&zero; int endianness; if (ptr_zero[7] >> 7) endianness = 0; if (ptr_zero[0] >> 7) endianness = 7; ptr_next[endianness] |= 1; printf("DBL_EPSILON = %e", (next - one)); return 0; } I determined the endianness of the machine by finding out at what position the 1 bit of -0.0 is

Join the discussion →

How can I copy a WordPress/WooCommerce site from hosting to a local environment?

I have access to a Sered hosting account for a WordPress/WooCommerce site, and I need to set it up locally for development. I’m new to working with hosting panels, so I’m unsure what I need to export from the hosting account. From what I understand, I likely need: the WordPress site files the MySQL database configuration details such as wp-config.php Is that correct? And in a typical hosting panel, where are those usually accessed or exported from? For example, should I be looking for a file manager/FTP for the files and phpMyAdmin for the database?

Join the discussion →

How could I specifically get the name of a window that I want to focus and not have to sort through them oddly?

How would I find a specific window without having to oddly sort through every window I have open? I'm looking to just get the name of my open Spotify window but the solution I made wasn't very good and it would often pick up on other open windows. I want to be able to track the artist name and the title of the song that I'm listening to. How I got this was I just looked up "How to get the name of a specific opened window" and I searched for a bit and this was the best I found. import pygetwindow as a import os, time #Just a few words that it'll ignore ignore = [ "Spotify", "Firefox", "Steam",

Join the discussion →

Could my leaves work as currency?

I have a modern nation that uses unique leaves as a form of currency. The government has access to endemic trees that can only grow within the nation's lands. It monopolizes the seeds, extensively grows them into trees in protected areas, and harvests the leaves from the trees to be used as currency. There are multiple types of currency trees, each producing their own unique leaves. Denominations are determined by how pretty the leaf is. For example: Silver Trees produce Silver Leaves that resemble silver. Worth one Leaf (ℒ1) Gold Trees produce Gold Leaves that resemble gold. Worth five Leaves

Join the discussion →
Older stories