Random snippets of all sorts of code, mixed with a selection of help and advice.
How to handle scrolling while dragging in flutter web
19 May 2026 @ 6:41 pm
I have few nested widgets
SingleChildScrollView(
child: GestureDetector(
child: MouseRegion(
child: CustomPainter
)));
I am building an application the needs something from each of them
I need:
mouse position from MouseRegion for highlighting.
drag position from GestureDetector for dragging items around
Scrolling from single SingleChildScrollView since the CustomPainter is larger than the available space.
The user has to be able to drag an item from one area to another that might not be visible on the screen, so scrolling needs to be possible while dragging.
1 is an exception
The following assertion was thrown while handling a pointer data packet:
Assertion failed:
file:///...dev/flutter/packages/flutter/lib/src/gestures/events.dart:1639:15
!identical(kind, PointerDeviceKind.trackpad)
is not true
What is the corr
Ethical crawling of academic websites
19 May 2026 @ 6:41 pm
I have developed a specialty search engine based on a Word2Vec language model mixed with BM25+ and focusing on technical and scientific topics. To aggregate relevant resources and train the underlying model, I need to crawl extensive amounts of quality data from Wikipedia and scientific journals.
And, since 2022 that I started this project, this is becoming increasingly difficult: doi.org and most academic journals (even open-access ones) are aggressively preventing any crawling (unless you are Bing or Google) through Cloudflare and captchas.
I use to use Python requests package, which worked well in 2022-2023 without having to resort to spoofing or timeouts, but I had to migrate to Python cURL with user-agent spoofing over the years. But even with generous timeouts (1 request/second without javascript support, which takes weeks to crawl some journals), trying to follow robots.txt policies (which are often badly written), and even onyl craw
How to extract project size for 800 projects?
19 May 2026 @ 6:39 pm
I am trying to know the siE of my projects.
They have the option to export document log but it is manual work .
No api for it
Excel: Match multiple keywords from cell A then return all matches in cell B
19 May 2026 @ 6:28 pm
So I am trying to create a formula that will automatically match all of the keywords from a source cell with their corresponding ID codes, then return all of the matched ID codes in another cell. How to do this in Excel for Mac version 16/2021, without falling back on VBA?
The spreadsheet is a timeline for a tabletop RPG I'm running.
The Timeline sheet has a column for NPCs. Cells in the NPC column will contain multiple names, separated by commas.
A master list of NPCs' names and their corresponding ID codes is in a sheet called "NPC_Codes".
I would like the codes of all the NPCs listed in an NPC cell to be shown in the neighbouring cell (eg, "Candi, Giles" returns "NPC-001, NPC-005").
I used XLOOKUP to match a single keyword and
The spreadsheet is a timeline for a tabletop RPG I'm running.
The Timeline sheet has a column for NPCs. Cells in the NPC column will contain multiple names, separated by commas.
A master list of NPCs' names and their corresponding ID codes is in a sheet called "NPC_Codes".
I would like the codes of all the NPCs listed in an NPC cell to be shown in the neighbouring cell (eg, "Candi, Giles" returns "NPC-001, NPC-005").
I used XLOOKUP to match a single keyword andYouTube Data API v3 - videos.insert hitting ~100/day channel upload limit despite increased API quota - how to raise per-channel daily upload cap?
19 May 2026 @ 6:22 pm
Background
I have a private internal desktop application that bulk-uploads videos to YouTube channels using the YouTube Data API v3 (videos.insert). The app is used by a single operator and is not a public-facing product.
Our use case requires uploading a high volume of videos daily. Each ad creative is produced in 3 aspect ratios (1x1, 16x9, 9x16) and approximately 50 geographic variations, resulting in ~150 videos per campaign. Our target is 600+ uploads per day to get us through our backlog.
The problem
We recently had our API quota increased from 10,000 to 71,000 units/day. Since videos.insert costs 100 units per call, I expected to be able to upload up to 710 videos/day.
However, we are still hitting a hard wall at approximately 100 uploads per day per channel, regardless of how much API quota remains. At the point of failure, our quota usage is typically only 10 to 30% of the daily l
How to have Python child data class inherit properties from parent data class? [closed]
19 May 2026 @ 6:14 pm
from dataclasses import dataclass
@dataclass(kw_only=True)
class Foo:
id: int
@dataclass(kw_only=True)
class Bar(Foo):
name: str
Bar(id=0, name="foo")
print(Bar.id)
This throws
Traceback (most recent call last):
File "/home/repl339/main.py", line 12, in <module>
print(Bar.id)
^^^^^^
AttributeError: type object 'Bar' has no attribute 'id'
I understand the issue with needing kw_only because that affects the order of params in the (invisible) __init__, but why doesn't Bar inherit the properties of Foo? it would without @dataclass, and I don't see why this wouldn't be the expected behavior.
Dataclasses are just syntax sugar to simplify boilerplate, right? If so, shouldn't under the hood this just be interpreted as
class Foo:
def __init__(self, *, id: int):
self.id = id
class Bar(Foo):
def __init__(self
i want to learn oop in 1 month. how can i do what?
19 May 2026 @ 6:01 pm
I want to learn OOP for an interview and understand how I can study it effectively within one month. Can I fully learn and understand the topic with ChatGPT’s help and regular practice every day? for stronger progress.!!
Why is getElementsByClassName(cn) empty if called in a function that's called recursively and elements with cn are still on the page/in the DOM?
19 May 2026 @ 5:57 pm
The script is running on this newspaper page: https://www.derstandard.at/story/3000000320803/biobaeuerin-riegler-wir-koennen-nicht-mit-ochsenfuhrwerken-uebers-feld-ziehen which has a message board following the article. It should do two things:
Click button Weitere Postings laden (Load more postings) at the bottom of the board. Which possibly shows:
another button of this kind at the bottom of the page
more buttons of the kind mentioned in 2.
Click buttons Weitere Antworten anzeigen (Show more answers) if they appear at the end of longer threads. Which possibly shows more buttons of this kind.
Repeat from 1. until buttons' getElementsByClassName(...).length == 0 by calling the a
how do I get workspace id configured for AVD host pool using Python?
19 May 2026 @ 5:53 pm
I am trying to get the workspace id of Log Analytics for a given AVD host pool so I can query it. This is what I have tried so far.
from azure.mgmt.monitor import MonitorManagementClient
monitoring_client = MonitorManagementClient(
"myAwesomeAzureCreds",
"myAwesomeSubscriptionId"
)
monitoring_settings = monitoring_client.diagnostic_settings.list(
"myAwesomeHostPoolId"
)
I am getting an error saying AttributeError: 'MonitorManagementClient' object has no attribute 'diagnostic_settings'
RSYSLOG regex stuck on NO MATCH whatever the expression used
19 May 2026 @ 5:22 pm
I'm trying to use rsyslog regexp feature without any results.
Here a sample log line
May 19 08:52:14 - ansible-exploitation-6cbcf9cb87ty-j8cqw - local0.info - ansible message bla bla bla
What I want to do:
I want to use ansible-exploitation for naming the log file
ansible-exploitation is an example. There will be numerous pods that will send rsyslog messages to the rsyslog pod.
I know that there are better solutions to get kube pod logs but it is that solution that I need to make work
I obviously began by using the rsylog official tool page (rsyslog.com/regex)
Usefull rsyslog informations:
Version: 8.2512.0 aka 2025.12
PLATFORM: x86_64-alpine-linux
FEATURE_REGEXP: Yes
Environment:
Kube cluster
Rsyslog current template
definition: (successfuly tested on rsyslog.com/regex)
template(name="SimpleFormat" type="string" strin