Random snippets of all sorts of code, mixed with a selection of help and advice.
C# WPF MVVM Command class not working - ICommand implementation
21 April 2026 @ 6:05 am
I am working on a WPF project using the MVVM pattern. My project is structured into three separate projects/namespaces to maintain a clean separation of concerns:
• Model: Contains the data classes (e.g., class.cs)
• ViewModel: Contains the Command implementation and the ViewModels (e.g., VMClass.cs, VMMainWindow.cs).
• View (Main Project): The XAML UI that references the ViewModel project.
The Issue:
Even though my DataContext is correctly set in XAML and the bindings don't show any errors in the output, the logic inside my Command is never executed.
My Code Implementation:.
Here is my code:
// Inside ViewModel Project
public class Command : ICommand
{
private Action<object> action;
public Command(Action<object> action) { this.action = action; }
public bool CanExecute(object parameter) => true;
pub
Detect orphan pages and calculate PageRank-style link equity in TypeScript
21 April 2026 @ 6:02 am
I'm building an SEO audit tool where I need to analyze the internal link structure of a website. I have three specific problems:
I need to find orphan pages — pages that no other page links to, making them invisible to crawlers
I want to calculate link equity scores (PageRank-style) to understand which pages accumulate the most authority
I need contextual link suggestions based on topic overlap between pages that aren't currently linking to each other
What I've tried:
// Manual orphan detection — O(n²) and hard to maintain
const allLinks = pages.flatMap(p => p.links);
const orphans = pages.filter(p => !allLinks.includes(p.url));
// No link equity scoring, no suggestions, no graph structure
Problems with this approach:
URL normalization issues — trailing slashes cause m
i want to practice python problems without dsa so is anyone can prescribe me any source
21 April 2026 @ 5:58 am
how are you
My name is kk i am learning Python from YouTube. I will watch approximately full tutorials, but I didn't remember some things. I know these things are removed by practice, but I can't find where I practice Python codes, so can anyone prescribe me any source to practice Python codes
How do QA engineers choose screen sizes and device breakpoints for testing a responsive static website?
21 April 2026 @ 5:56 am
I’m doing manual QA for a responsive static website and want to define a professional set of screen sizes/devices for testing (mobile, tablet, desktop), including edge cases and in-between widths.
How do teams typically decide:
Which viewport widths to test (e.g. 375, 768, 1440)?
Whether to prioritize CSS breakpoints vs real device resolutions?
How many real devices vs browser emulators to use?
How to cover “in-between” widths where layout bugs often appear?
I’m looking for industry best practices or QA workflows.
How to intercept a response before it is seen by Logbook
21 April 2026 @ 5:48 am
A question about interceptors. How can I intercept an HTTP response with one interceptor before Logbook intercepts it? The goal is to clean the JSON from unnecessary fields before Logbook intercepts it. That is, the first interceptor removes unnecessary fields and only then passes the cleaned model to Logbook. How can this be implemented? And is it even possible?
I tried writing an interceptor, but when calling execution.execute(request, body), Logbook immediately sees the response and intercepts it before I have a chance to modify anything. What should I do?
I have this configuration:
@Configuration
public class ClientConfiguration {
@Bean
public SomeApiClient apiClient(RestClient.Builder restClientBuilder,
Logbook logbook,
@Value("${api.external.service.url}") String url,
ObjectM
Next.js 14 App Router: useEffect not running on route change when navigating between dynamic segments
21 April 2026 @ 5:28 am
I am building a Next.js 14 app using the App Router. I have a dynamic route /products/[id] and I'm using useEffect with the params.id as a dependency to fetch data whenever the user navigates to a different product.
The problem: When I navigate from /products/1 to /products/2 using <Link>, the useEffect does not re-run. The component does not re-render with the new product data — the page still shows the old product.
My component (app/products/[id]/page.tsx):
'use client';
import { useEffect, useState } from 'react';
import { useParams } from 'next/navigation';
interface Product {
id: number;
title: string;
description: string;
}
export default function ProductPage() {
const params = useParams();
const id = params.id as string;
AWS IoT Things authorizing
21 April 2026 @ 5:16 am
I have a bunch of Things in the AWS IoT and every now and then different customers ask me to add another Thing.
Now one customer would like to maintain their own Things (add/update).
What is the best way to authorize the Things so that they cannot delete/edit other Things than their own? It's ok if they can see other Things as well.
I tried to achieve this with Thing Groups, but so far haven't succeeded. Is it possible to do this with groups? Things can be named whatever, they do not have certain prefix.
How to go from theoretical Concept of Layers (Input, Hidden and Output) of AI Neural Network and Write in CODE
21 April 2026 @ 1:37 am
I am currently working on a project to create a working Ai Neural Network in C++, I have watched and read many articles on Layers concept but I still don't know from where to start with the layers things, like do I need a specific function or something like that, since we input x and compute to get y the output.
Everything seems quite vague about this.
class Layers{
};
WPF MVVM: ComboBox not updating correctly after adding new item
21 April 2026 @ 1:17 am
I am working on a WPF application using the MVVM pattern. I have an ObservableCollection bound to a ComboBox, and I add new items via a button.
The problem:
The ComboBox initially shows items, but when I add a new recipe, the UI behaves unexpectedly (e.g., it doesn’t update correctly or shows strange behavior).
Trying to design a flask sql cart and products page [closed]
21 April 2026 @ 12:34 am
Could someone help me design code for a shopping page and working cart.
# Import Flask tools for routes, templates, JSON, redirects, and URL building
from flask import Flask, render_template, jsonify, redirect, url_for
# Import sqlite3 to work with the SQLite database directly
import sqlite3
# Create the Flask app
app = Flask(__name__)
# Database file name
DATABASE = "shopping.db"
# -----------------------------
# DATABASE CONNECTION FUNCTION
# -----------------------------
def get_db_connection():
# Connect to the SQLite database file
conn = sqlite3.connect(DATABASE)
# Let rows behave like dictionaries
conn.row_factory = sqlite3.Row
# Return the connection
return conn
# -----------------------------
# CREATE DATABASE TABLES
# -----------------------------
def init_db():
# Open database connection
conn = get_db_connection()
cursor = conn.cursor()
# Create the products table
cursor.execute("&qu