Random snippets of all sorts of code, mixed with a selection of help and advice.
I get an error when I delete a user (cascade delete)
9 January 2026 @ 1:37 pm
I use a peer-to-peer messaging system.
Here is its class:
public class MessagesModel
{
public long Id { get; set; }
public ApplicationUser UserExp { get; set; }
public ApplicationUser UserDest { get; set; }
public Articles Article { get; set; }
public string Message { get; set; }
public messageStatus Status { get; set; }
public DateTime Created_at { get; set; }
public string Topic { get; set; }
public bool NewMsg { get; set; }
public bool NewMsg_Exp { get; set; }
public bool NewMsg_Dest { get; set; }
public int Offre { get; set; }
public OfferStatus OffreStatus { get; set; }
public enum messageStatus
{
Sent,
Delivered
}
public enum OfferStatus
{
None,
Sent,
Accepted,
Denied,
Cancelled,
Expired
}
public Mess
Creating a score for user's screen time
9 January 2026 @ 1:27 pm
I'm wondering if its possible to take a user's current screen time for a day, and then have them set a limit thats say 3 hours. And then from that determine the percentage they've used up and give a sort of score to them. I've seen some similarish stuff from some apps but I can't seem to work out how to do it or even where to start looking anymore. I've tried everything I can possibly think of
Bedrock Agent core Evaluation
9 January 2026 @ 1:25 pm
Hey I am exploring bedrock agent core evaluations I have created using create evaluation configuration and filled necessary sources and evaluators and created it and on clicking view results I am unable to view/see anything.
Why does my recursive backtracking solution exceed time limits for large inputs? [closed]
9 January 2026 @ 1:24 pm
I am implementing a backtracking solution in C++ to generate all valid combinations for a given constraint. The solution works correctly for small inputs but exceeds the time limit when the input size increases.
AADSTS7000215: Invalid client secret provided for unexpired key
9 January 2026 @ 1:22 pm
While loading a project I hadn't touched in a few weeks in Visual Studio 2022, I received this:
MsalServiceException: A configuration issue is preventing authentication... Original exception: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app
In the Azure App Registrations, the secret that the application was configured to use had not expired, but another secret had. I deleted the expired key, but the error persists. The production application still works with the same unexpired key that my local application is using.
I have tried:
Generating new keys and using those for my local application. The keys I have tried have not had any special characters requiring escaping.
I am using the secret value, not the ID.
Generated a 6-month key with no name (as suggested in other articles).
MIOpen(HIP): Warning [IsEnoughWorkspace] : what does it mean?
9 January 2026 @ 1:18 pm
I have been experimenting with PyTorch on a Debian 13 system with an AMD GPU (RX 7800 XT). I have installed ROCm software from the AMD repository but currently, only Ubuntu is supported, so I'm on my own.
I have had success with some simple scripts using PyTorch for matrix multiplication, as these use the GPU. However, what I really want is to allow an application called CosmicClarity (for improving astronomical images) to use the GPU. By default, it tries CUDA, which does not find AMD GPUs on Linux. Hence my experimentation.
When I run the CosmicClarity scripts on my modified system, I see many warnings which begin
MIOpen(HIP): Warning [IsEnoughWorkspace]
The GPU is being used but performance is poor. I can find some reports on the web about these warnings but have found no solutions which have helped. I have made many attempts at "performance tuning", without really knowing what I'm doing, without reducing the number of warn
KendoUI display wrong Turkey currency when value over 100K
9 January 2026 @ 1:15 pm
i have a page which display simple value with this control & JS, appreciate anyone could correct my mistake below. Thanks.
*Remove all un-necessary code to simplified sample code
Javascript
kendo.culture("tr-TR");
<script src="@Url.Content($"/cultures/kendo.culture.tr-TR.min.js")"></script>
HTML
<span data-format="n2" data-bind="text: TotalCompletePrice" />
if less than 100K, the value display fine -->12.232,00
but, when the value over 100K it will display like below which is incorrect foramt
Wrong- 1.24.544,00
expected-124.544,00
Prettifying XML files (with Prettier) and handling inline tags
9 January 2026 @ 12:54 pm
I'm using Prettier with the XML plugin. For some elements the formatting is odd, because Prettier does not know what element is a block element or an inline element. Is there a smart CI-ready solution or better alternative to Prettier? I'd like to specify what elements are block or inline elements and when whitespace must be preserved.
Webclient - Connection with proxy gives timeout error [closed]
9 January 2026 @ 12:36 pm
I am facing a proxy unrecognised error in Webclient even though proxy is set. This results in a time out error.I tried adding the proxyprovider host but still get a timeout exception when connecting.I tried the below:
ConnectionProvider provider = ConnectionProvider.builder("fixed")
.maxConnections(maxTotalConnections)
.pendingAcquireTimeout(Duration.ofMillis(connectTimeout))
.maxIdleTime(Duration.ofMillis(connectionRequestTimeout)).build();
HttpClient httpClient = HttpClient.create(provider).proxy(proxy -> proxy.type(ProxyProvider.Proxy.HTTP)
.host("myhost")
.port(Integer.parseInt("123")))
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeout)
.doOnConnected(conn -> conn.addHandlerLast(new ReadTimeoutHandler(connectionRequestTimeout))
.addHandlerLast(new WriteTimeou
Stored Procedure Syntax Error (SQL Error [1064] [42000])
9 January 2026 @ 11:35 am
DELIMITER //
CREATE PROCEDURE CreateProductTable()
BEGIN
CREATE TABLE IF NOT EXISTS product (
product_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
product_name TINYTEXT NOT NULL,
product_price SMALLINT UNSIGNED NOT NULL
) ENGINE=InnoDB;
END //
DELIMITER ;
Error Overview
Occasional Result
For some reason it occasionally parses through without an error. However, it continues to not create an SP under my Procedures directory on my database or product table. This is a switch from MSSQL using Azure Data Studio and to MySQL through DBeaver. Both times having used Docker on Arch Linux, except this time it's not a multi-container composition.
I've tried minimizing my query, remove spaces, add them, remo