Random snippets of all sorts of code, mixed with a selection of help and advice.
iOS presentationDetents behaves incorrectly on iOS 16–18 but works correctly on iOS 26
5 December 2025 @ 5:33 pm
I'm using a custom modifier called AutoSheetDetentModifier to automatically size a sheet based on its content. (in SwiftUI)
On iOS 26, it works as expected: the content height is measured and the sheet shrinks to match that height.
However, on iOS 16, 17 and 18, the same code doesn’t work.
The content height is still measured, but the sheet does not reduce its height. Instead, the sheet remains larger and the content appears vertically centered.
public struct AutoSheetDetentModifier: ViewModifier {
@State private var height: CGFloat = 380 // default value to avoid bouncing
public func body(content: Content) -> some View {
content
.modifier(MeasureHeightViewModifier(height: $height))
.presentationDetents([.height(height)])
}
}
public struct MeasureHeightViewModifier: ViewModifier {
@Binding var height: CGFloat
public func body(content: Content) -> some View {
content
custom OneTimeToken class causes IllegalStateException: No primary or single unique constructor found for interface
5 December 2025 @ 5:25 pm
I am trying to implement a concrete class from the interface org.springframework.security.authentication.ott.OneTimeToken. Nothing fancy, just a JPA Entity:
@Entity
@Component
public class PersistentOneTimeToken implements OneTimeToken {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String tokenValue;
private String username;
private Instant expirationTime;
... constructors, getters, and setters
Repository:
public interface PersistentOneTimeTokenRepository extends JpaRepository<PersistentOneTimeToken, Long> {
Optional<PersistentOneTimeToken> findByTokenValue(String tokenValue);
Optional<PersistentOneTimeToken> deleteByTokenValue(String tokenValue);
}
OneTimeTokenService
@Service
public class JpaOneTimeTokenService implements OneTimeTokenService {
private final PersistentOneTimeTokenRepository repository;
p
Icon in the taskbar [closed]
5 December 2025 @ 5:19 pm
In the taskbar, the application icon remains the default icon even though it is in the resources, in Icon and manifest by Resources\Implication.ico, as well as in the body of the application by
“this.Icon = Properties.Resources.Implication”;
What should I do when the step-by-step guide ensures that the instruction “this.Icon = Properties.Resources.Implication” is actually executed?
configuration ingress traefik regex
5 December 2025 @ 5:19 pm
I installaed traefik, next to ingress-nginx to test it for possible migration, with helm on azure aks. I give it following values:
podLabels:
app: traefik
service:
enabled: true
type: LoadBalancer
annotations:
service.beta.kubernetes.io/azure-load-balancer-ipv4: myip
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
service.beta.kubernetes.io/port_80_health-probe_protocol: "Tcp"
service.beta.kubernetes.io/port_443_health-probe_protocol: "Tcp"
externalTrafficPolicy: Cluster
loadBalancerIP: "myip"
helm installaed correctly traefik. I did a test changing an ingress build for ingress-nginx:
ingress-nginx ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-myservice-health
namespace: health
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /myservice/health
nginx.ingress.kubernetes.io/ssl-redirect: "
Intermittent “Could not reach driver of cluster” errors on DBR 16.4 LTS despite large driver size and normal driver metrics
5 December 2025 @ 5:16 pm
We recently upgraded our Azure Databricks cluster from DBR 12.2 LTS to DBR 16.4 LTS, and since then we have been seeing intermittent job failures with the error:
Run failed with error message
Failed to reach the driver
This happens even though the cluster appears healthy, and re-running the same job immediately afterwards succeeds.
Cluster Configuration:
"driver": {
"node_type_id": "Standard_E48as_v5"
}
"executors":
{
"node_type_id": "Standard_D8ds_v5"
}
Spark Config
"spark_conf": {
"spark.databricks.io.cache.enabled": "true",
"spark.databricks.io.cache.maxDiskUsage": "50g",
"spark.databricks.io.cache.maxMetaDataCache": "1g",
"spark.databricks.service.port": "8804",
"spark.databricks.service.server.enabled"
Alembic autogenerate creates tables in wrong order with multi-tenant PostgreSQL schema
5 December 2025 @ 5:16 pm
I have a FastAPI application with SQLAlchemy + Alembic managing a multi-tenant PostgreSQL database. My models use schema='per_tenant', and I translate this to actual tenant schemas (tenant_1, tenant_2, etc.) at migration runtime in env.py.
When I run alembic revision --autogenerate, the generated migration creates tables in the wrong order, causing foreign key constraint errors because dependent tables are created before their referenced tables.
How to dynamically select latest file in Snowflake Copy into command?
5 December 2025 @ 5:14 pm
I'm having issues trying to parameterize my file name to be used in snowflake copy into script dynamically. I have a snowflake notebook that will be scheduled once a day. Here's what I have:
SET today = TO_VARCHAR(CURRENT_DATE, 'MMDDYYYY');
-- Set transaction file path
SET transaction_file_path = 'Transactions_' || $today || 'M.csv';
select $transaction_file_path correctly returns Transactions_12052025M.csv
The flat file is uploaded to S3 as Transactions_12052025M.csv
Then I want to use in my copy into script like this:
COPY INTO SRC_TRANSACTIONS_TBL
...
FROM @EXTERNAL_S3_STAGE/$transaction_file_path
However, this is not working. But if I hardcode it it works:
FROM @EXTERNAL_S3_STAGE/Transactions_12052025M.csv
How can I make this work? Please help.
How can I combine two or more arrays into a unique set without changing the data type in Powershell?
5 December 2025 @ 4:40 pm
Say I have a combination of the following:
# This is a [string[]] type
$A = [string[]]@("Aasdf","Casdf","Basdfs")
# This is a [string] type
$B = "Dasdfs"
# This is another [string[]] type
$C = [string[]]@("Aasdf","Edasfa","Basdfs")
The problem is that when I try to do something like this:
@($A, $B, $C) | Sort-Object -Unique
I always get an Object array data type.
You'd think this would work:
[string[]]@($A, $B, $C) | Sort-Object -Unique
# or
[string[]](@($A, $B, $C) | Sort-Object -Unique)
But, it does not.
I've used this repeatedly in my script to deal with the nuances around combining arrays:
@((@($A) + @($B) + @($C)) | ForEach-Object { $_ }) | Sort-Object -Unique
But, of course, the output is an Object array.
I've wrestled with ChatGPT on this extensively. And through a millio
What Is The Best Way to Retrieve Vector Embeddings from AlloyDB Using Code [closed]
5 December 2025 @ 4:16 pm
How can I retrieve data from AlloyDB? My vector embeddings are already uploaded, and the table has four columns as shown in the screenshot. I’ve tried multiple methods suggested by ChatGPT, but none of them worked. What’s the best practice for retrieving this data through code?
ClassCastException Mono<Void> unit test Java
5 December 2025 @ 4:10 pm
i have the method in springboot that consume a endpoint
public Mono<Void> mesaVisadoCalculadoraNotificar(NotificarIn in) {
setTimeoutErrorCode("MVC-01");
return Mono.fromCallable(() -> {
WebTarget path = target.path(MesaVisadoCalculadora.NOTIFICAR.getUri());
return restHelper.performRequest(path, in, new GenericType<Void>(){}, HttpAction.POST);
});
}
}
and this test
@Test
public void mesavisadoCalculadoraNotificaTest(){
when(target.path(Mockito.anyString())).thenReturn(target);
when(restHelper.performRequest(Mockito.any(WebTarget.class), Mockito.any(), Mockito.any(GenericType.class),Mockito.any(HttpAction.class))).thenReturn(Mono.empty());
Mono<Void> promise = agent.mesaVisadoCalculadoraNotificar(in);
promise.block()
Assertions.assertNotNull(pro