Random snippets of all sorts of code, mixed with a selection of help and advice.
DatabaseException "out of memory" when opening SQLCipher 3 encrypted DB on versions > 2.2.1
1 May 2026 @ 8:18 am
I’m encountering a crash when opening an encrypted database using sqflite_sqlcipher on versions above 2.2.1. The same code works fine on 2.2.1, but fails consistently on newer versions.
Code Snippet:
Future<Database> _open(String databasePath, String key) async {
try {
if (key.isEmpty) {
return await openDatabase(databasePath, version: 1);
} else {
return await openDatabase(databasePath, password: key, version: 1);
}
} catch (e) {
print(
"Error opening database normally: $e. Retrying with cipher compatibility...");
return await openDatabase(
databasePath,
password: key,
version: 1,
onConfigure: (db) async {
await db.execute('PRAGMA cipher_compatibility = 3;');
},
);
}
}
Error Logs:
flutter: Error opening database normally: DatabaseException(open_failed .
Kerberos Authentication Flow on Openshift
1 May 2026 @ 8:06 am
I’m trying to implement Kerberos SSO (SPNEGO / Integrated Windows Authentication) for a web application in an Active Directory environment.
The application is deployed on OpenShift Kubernetes and exposed via the ingress/routing layer.
Kerberos authentication itself seems to work — my account successfully authenticates and I receive an HTTP 200 response. However, the login flow does not complete. I only get a Kerberos success response, but the rest of the application’s authentication/authorization flow does not proceed.
Additionally, I’m experiencing intermittent authentication issues that I cannot reliably reproduce or isolate.
Has anyone encountered a similar issue with Kerberos (SPNEGO) behind OpenShift ingress? Could this be related to headers, routing, or session handling at the ingress level?
Any suggestions on what to check or debug would be appreciated.
Comment/note for instructions inside .md markdown
1 May 2026 @ 8:01 am
If writing .md markdown instructions (e.g. Installation instruction steps),
what would be the best way to give a note, why specific step is needed, some give some references.
In other words,
if I write .sh, I can add # like
# this step is optional, but recommended by https://documentation.ubuntu.com/
sudo apt-get update
So how would I add comment to a line of markdown text ?
This question is not about how to comments out a portion of .md file,
for that one can use HTML tags
to comment/disable anything inside .markdwon use HTML comments
<!--
anything here is invisible
-->
So using the above example, how can I add a comment/a note text to the line
"to comment/disable anything inside"
?
Python code in train.py how to update it into confusion matrix
1 May 2026 @ 7:58 am
I have a project on iris classifier, I have done most of the steps but I am stuck. How do I:
1 Update the Python code in train.py so that it can:
Save the confusion matrix as a PNG image in an outputs/ folder.
Save the trained model in the same outputs/ folder (e.g., using the joblib library).
How to test the database security - phpmyadmin [closed]
1 May 2026 @ 7:56 am
I created and hosted a dynamic website .
I created /phpmyadmin also to it so i can access database easily .
How to test the domain/phpmyadmin security vulnerability ?
i dont have credentials to it . i dont have credentials to VPS as well .
But i want to test my website vulnerabilities . Can anyone help me with this ?
One aync lock call or multiple async lock calls, what is better and safer in Python?
1 May 2026 @ 6:43 am
I trying to make ratelimiter for users in aiogram bot with middlware, now I created class for requests and class for ratelimiter, where reuqest are. My problem is what is better for performance and safety, use multiple async lock calls for each operation or make these operations under one async lock.
my rate_limiter.py:
import asyncio
import time
from collections import defaultdict
from dataclasses import dataclass
class RequestsData:
def __init__(
self,
seconds_interval: int = 3,
max_requests_per_day: int = 5,
):
self.seconds_interval: int = seconds_interval
self.max_requests_per_day: int = max_requests_per_day
self.day_len_seconds: int = 60 * 60 * 24
self.last_time: float | None = None
self.just_limit_exited: bool = True
self.total_requests: int = 0
self.total_requests_start_time: float | None = None
self._async_lock = async
AWS IoT Core Policy - Fail to Authenticate Error with restrictive Action and Resource
1 May 2026 @ 4:43 am
I have a device that uses MQTT via 8883 to send data to AWS IoT Core. During intial testing I applied a very permissive policy and it can connect. When I try to make the policy more restrictive I run into a weird scenario where the connection fails to authenticate when I use anything other than "iot:*" for action and "*" for the resource. The policy that succeeds is
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ConnectIfCertAttachedToAThing",
"Condition": {
"Bool": {
"iot:Connection.Thing.IsAttached": "true"
},
"StringEquals": {
"iot:ClientId": "${iot:Connection.Thing.ThingName}"
}
},
"Effect": "Allow",
"Action": "iot:*",
"Resource": "*"
},
{
SwiftUI PhaseAnimator causing AttributeGraph cycle crash when nested in List with @Observable
1 May 2026 @ 4:18 am
I’m hitting a very specific runtime crash in iOS 19.2 (Xcode 17.1) that I haven't seen documented anywhere.
I have a List where each row uses the new @Observable macro for its view model. Inside the row, I’m using phaseAnimator to run a continuous pulsing effect on an icon. Everything works fine until I swipe to delete a row or reorder the list.
The Error:
=== AttributeGraph: cycle detected through attribute 124832 ===
CoreAnimation: [Warning] Aggregated stats for Animation ID 42: { ... }
(lldb)
The app freezes for a second and then crashes with EXC_BAD_ACCESS inside the AttributeGraph private framework.
What I've tried:
Switching back to withAnimation and onAppear (this fixes it, but I lose the phase-based logic).
Moving the @Obse
Do Apache 2.0 licensed segmentation models (e.g., SegNeXt, PP‑LiteSeg) include commercial‑free pretrained weights?
1 May 2026 @ 3:57 am
I’m evaluating semantic segmentation models like SegNeXt and PP‑LiteSeg, which are released under the Apache 2.0 license. The code is clearly permissive, but I’m unsure about the pretrained weights.
Many segmentation models are trained on datasets such as Cityscapes, which has non‑commercial restrictions. My concern is:
When a model repo says it’s Apache 2.0 licensed, does that license also cover the released pretrained weights?
If the weights were trained on a non‑commercial dataset (like Cityscapes), does that mean I cannot use those weights in a commercial product, even if the code is Apache 2.0?
Are SegNeXt and PP‑LiteSeg safe to use commercially with their provided weights, or do I need to retrain them on a fully commercial‑friendly dataset?
I’d like clarification from
How do I Register Open Generics in ServiceCollection when they aren't "equal"
30 April 2026 @ 3:14 pm
I have an open generic registration that works fine
services.AddScoped(typeof(IAsyncRepository<>), typeof(AsyncRepository<>));
My point is that I have this other case
public interface IAsyncEvent<in TEvent> where TEvent : class
{
Task HandleAsync(TEvent eventArg, CancellationToken ct);
}
public class CreateAction<TModel>(TModel model) : ICloneable where TModel : class
{
public TModel Model
{
get;
} = model;
}
public class CreateEventAsync<TModel>(IAsyncRepository<TModel> repository) : IAsyncEvent<CreateAction<TModel>> where TModel : class
{
public async Task HandleAsync(CreateAction<TModel> eventArg, CancellationToken ct)
{
await repository.CreateAsync(eventArg.Model, userContext, ct);
}
}
and what I wanted was to register the open generic type and resolve it