Nifty Corners Cube

VN:F [1.9.22_1171]
Rating: 7.0/10 (1 vote cast)

Rounded corners the javascript way
Nifty Corners Cube

StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

PyTorch SRGAN Training Extremely Slow on CPU for Image Super-Resolution – How to Optimize?

20 April 2026 @ 5:55 pm

I am working on the Plant Leaves Super Resolution challenge using PyTorch. I built an SRGAN-based model with Generator and Discriminator networks for image super-resolution. The model takes low-resolution plant leaf images and generates high-resolution outputs. During training, the process is taking too much time because I am running it on CPU instead of GPU. Each epoch is very slow due to Generator, Discriminator, and perceptual loss computations. I am using mixed precision and optimization techniques, but CPU performance is still slow. I want to know how to reduce training time and optimize this code for CPU execution. Suggestions for improving speed, reducing epochs, or simplifying the model would be helpful. Code: best_loss = float('inf') for epoch in range(1, NUM_EPOCHS + 1): G.train(); D.train() g_losses, d_losses = [], [] for lr_img, hr_img in train_dl:

compiler_depend.make:4: *** multiple target patterns. Stop. (Windows Path issue while using cmake)

20 April 2026 @ 5:49 pm

I'm writing C code on a windows machine, this is my setup: MSYS with the UCRT64 environment. VSCode CMake to build with "Unix Makefiles" generator Project directory looks like this: .vscode build scripts src/lib CMakeLists.txt Variables.cmake root CMakeLists.txt # SPDX-License-Identifier: Unlicense # Author: Derrick Lyndon Pallas <[email protected]> cmake_minimum_required(VERSION 3.10) set(PROJECT hangman ) project(${PROJECT} LANGUAGES C VERSION 1.0.0 DESCRIPTION "Fun hangman game") # Get CFILES, HFILES, CFILES, HFILES, RCFILES variables include("${CMAKE_CURRENT_SOURCE_DIR}/Variables.cmake") #get internal library add_subdirectory(src/lib) add_executable(${PROJECT} ${CFILES} ${HFILES}) target_link_libraries(${PROJECT} PUBLIC libhangman) target_include_directories(${PROJECT} PRIVATE src/lib/include) //Vari

Trying to understand instruction cache (for repeated Jit compilation reusing memory pages)

20 April 2026 @ 5:44 pm

I am playing with jit compilation on a Raspberry Pi 5 (aarch64) using linux. My goal is to generate native code, execute it, then continue generating more native code and execute that (which might or might not called previously generated native code). My first approach is to append new code to a single memory-page: Allocate a memory page with mmap Copy the code to that page with memcpy Make it executable with mprotect Execute it Make it writable with mprotect Append new code to that page with memcpy Make it executable with mprotect Execute the newly copied instructions <-- Here the process crashes My educated[1] guess is, that the instruction cache of a CPU does not seem to get updated and the CPU tries to execute the old zero-filled content of that part of the cache. According

How to have one element always be right above a chosen other element

20 April 2026 @ 5:20 pm

I'm working on a calendar for a project where, when a chosen event is clicked, a pop-up box is supposed to appear right above the clicked element. I originally tried to do it where it works based on the position of the physical element the user clicked, but it's inconsistent and unresponsive, so it is always off to one side (the attached image will give you an idea of what I mean. Also, ignore the weird formatting of the text in the popup; I got rid of some text for the sake of anonymity). What I'm wondering is if there is a way for me to have it just always be displayed above the yellow event relative to that event so that no matter the page size, it always pops up there. Here's the code I used to try and make it so the pop-up box with the text in it is just always above the yellow box that is on the calendar (the one over the 13 in the calendar itself, not the one at the bottom). const Cal = () => { const [popupBoxVis

unrelated element affected by another's hover

20 April 2026 @ 5:19 pm

When hovering over the nav links at the top, an underline effect is animated (through transition). During that brief 0.2s transition, the pink text "ABC" in the lower corner of the cards appear to momentarily reduce the font weight. If I remove the box-shadow from the card class, the visual glitch goes away. This happens in chrome and Edge, but not Firefox. So I'm thinking some kind of chromium rendering bug. While not game-breaking, it is an unwanted side-effect. Does anyone have any insight or solution? edit: The visual bug was apparent in the code preview on this page, but viewing it embedded it doesn't happen. So here's a fiddle just in case: https://jsfiddle.net/yjf80Lrv/

Python ast.literal_eval: raw strings recommended?

20 April 2026 @ 5:08 pm

If I do something like >>>import ast >>>testinput = "\S" >>>something = ast.literal_eval('"'+testinput+'"') Warning (from warnings module): File "<unknown>", line 1 SyntaxWarning: invalid escape sequence '\S' >>>something = ast.literal_eval('r"'+testinput+'"') >>>print(something) \S Is it therefore recommended or necessary (or safe?) always to use raw strings?

Would This be correct my Teacher said we could only use her solution but here is mine

20 April 2026 @ 4:40 pm

namespace ViewModel { public class VMMannschaft : INotifyPropertyChanged { private Mannschaft mannschaft; public VMMannschaft(string nation) { mannschaft = new Mannschaft(nation); } public string Nation { get =\\\> mannschaft.Nation; } public int Spiele { get =\\\> mannschaft.Spiele; } public int Punkte { get =\\\> mannschaft.Punkte; } public void Sieg() { mannschaft.Sieg(); OnPropertyChanged("Punkte"); OnPropertyChanged("Spiele"); } public void Niederlage() { mannschaft.Niederlage(); OnPropertyChanged("Punkte"); OnPropertyChanged("Spiele"); } public void Unentschieden() { mannschaft.Unentschieden(); OnPropertyChanged("Punkte"); OnPropertyChanged("Spiele");

Nested implicit lifetime type of implicit lifetime type not created: clang bug?

20 April 2026 @ 1:16 pm

This question is a follow up of Making the non-trivial creation of an array constexpr and Accessing objects of implicit lifetime type in the storage provided by std::allocator, before any explicit construction where I was looking for a way to create a constexpr array of not default-constructible types. The solution, hinted by the answer of the first question, is to use std::allocator::allocate, which is constexpr. The second question deals with the fact that this function does not create objects but arrays of objects. Yet I concluded when creating arrays of std::array, the latest were implicitly created as being implicit lifetime type subobjects of implicit lifetime type

Django Order by based on field in unrelated model

20 April 2026 @ 1:04 pm

I have two models in my Django Project. The first one is UserProfile and the second one is Interests: class UserProfile(models.Model): user_model_for_profile = models.ForeignKey(CustomUser, on_delete=models.CASCADE) first_name = models.CharField(max_length = 25) middle_name = models.CharField(max_length = 25) last_name = models.CharField(max_length= 50) gender = models.CharField(choices = gender_choices, max_length = 30) profile_created_by = models.CharField(choices = profile_creation_choices, max_length = 30) date_of_birth = models.DateField() time_of_birth = models.TimeField() Height = models.IntegerField() #Day of birth needed? Country_of_birth = models.CharField(choices = Countries_choices, max_length = 30) State_of_birth = models.CharField(choices = State_choices, max_length = 40) City_of_birth = models.CharField(max_length = 30) Mobile_number = models.CharField( max_length=10, # Adjust based on you

Discriminated Unions and converting types

20 April 2026 @ 12:56 pm

I have a function that is used to change the type of an API input (simple dummy example given): interface BaseInput { version: '3' | '4'; } interface InputA extends BaseInput{ version: '4'; foo: string; } interface InputB extends BaseInput{ version: '3'; bar: string; } const convert3to4 = (apiBodyInput: InputB) => { return { version: '4', foo: apiBodyInput.bar } as InputA; }; const convert4to3 = (apiBodyInput: InputA) => { return { version: '3', bar: apiBodyInput.foo } as InputB; }; // adapted from https://dev.to/maikelev/discriminated-unions-in-typescript-5fia#exhaustiveness-checking function assertNever(version: never): never { throw new Error(`Unrecognised api version: ${version}`); } export const changeApiVersion = (apiBodyInput: InputA | InputB, targetVersion: '3' | '4') => { if(apiBodyInput.version !== '3' && apiBodyInput.version !== '4'){ return assertNever(apiBodyInput) } sw

960.gs

VN:F [1.9.22_1171]
Rating: 8.0/10 (1 vote cast)

CSS Grid System layout guide
960.gs

IconPot .com

VN:F [1.9.22_1171]
Rating: 7.0/10 (1 vote cast)

Totally free icons

Interface.eyecon.ro

VN:F [1.9.22_1171]
Rating: 6.0/10 (1 vote cast)

Interface elements for jQuery
Interface.eyecon.ro

ThemeForest.net

VN:F [1.9.22_1171]
Rating: 7.0/10 (2 votes cast)

WordPress Themes, HTML Templates.

kuler.adobe.com

VN:F [1.9.22_1171]
Rating: 8.0/10 (1 vote cast)

color / colour themes by design

webanalyticssolutionprofiler.com

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

Web Analytics::Free Resources from Immeria
webanalyticssolutionprofiler.com

WebAIM.org

VN:F [1.9.22_1171]
Rating: 4.0/10 (1 vote cast)

Web Accessibility In Mind

Ask AIMee: An accessible accessibility-focused AI chatbot

31 March 2026 @ 4:49 pm

We’re happy to introduce AIMee – an easy-to-use, AI-powered conversational chatbot focused on accessibility. AIMee has been designed to be highly accessible to users with disabilities. Ask her accessibility questions to get quick answers and guidance. The name “AIMee” plays off of the “AIM” (Accessibility In Mind) from “WebAIM” and also “AI”. Here are some […]

A New Path for Digital Accessibility?

27 February 2026 @ 7:02 pm

Please note This post will explore how an adaptive, intelligent system could empower users with disabilities to optimize their experience in digital environments. Even were such a system available tomorrow, developers of digital content, services, and products would still be responsible for providing equal access to ALL users. Consider a few of the many exciting […]

2026 Predictions: The Next Big Shifts in Web Accessibility

22 December 2025 @ 11:22 pm

I’ve lived long enough, and worked in accessibility long enough, to have honed a healthy skepticism when I hear about the Next Big Thing. I’ve seen lush website launches that look great, until I activate a screen reader. Yet, in spite of it all, accessibility does evolve, but quietly rather than dramatically. As I gaze […]

Word and PowerPoint Alt Text Roundup

31 October 2025 @ 7:14 pm

Introduction In Microsoft Word and PowerPoint, there are many types of non-text content that can be given alternative text. We tested the alternative text of everything that we could think of in Word and PowerPoint and then converted these files to PDFs using Adobe’s Acrobat PDFMaker (the Acrobat Tab on Windows), Adobe’s Create PDF cloud […]

Accessibility by Design: Preparing K–12 Schools for What’s Next

30 July 2025 @ 5:51 pm

Delivering web and digital accessibility in any environment requires strategic planning and cross-organizational commitment. While the goal (ensuring that websites and digital platforms do not present barriers to individuals with disabilities) and the standards (the Web Content Accessibility Guidelines) remain constant, implementation must be tailored to each organization’s needs and context.   For K–12 educational agencies, […]

Up and Coming ARIA 

30 May 2025 @ 6:19 pm

If you work in web accessibility, you’ve probably spent a lot of time explaining and implementing the ARIA roles and attributes that have been around for years—things like aria-label, aria-labelledby, and role="dialog". But the ARIA landscape isn’t static. In fact, recent ARIA specifications (especially ARIA 1.3) include a number of emerging and lesser-known features that […]

Global Digital Accessibility Salary Survey Results

27 February 2025 @ 8:45 pm

In December 2024 WebAIM conducted a survey to collect salary and job-related data from professionals whose job responsibilities primarily focus on making technology and digital products accessible and usable to people with disabilities. 656 responses were collected. The full survey results are now available. This survey was conducted in conjunction with the GAAD Foundation. The GAAD […]

Join the Discussion—From Your Inbox

31 January 2025 @ 9:01 pm

Which WebAIM resource had its 25th birthday on November 1, 2024? The answer is our Web Accessibility Email Discussion List! From the halcyon days when Hotmail had over 35 million users, to our modern era where Gmail has 2.5 billion users, the amount of emails in most inboxes has gone from a trickle to a […]

Using Severity Ratings to Prioritize Web Accessibility Remediation

22 November 2024 @ 6:30 pm

So, you’ve found your website’s accessibility issues using WAVE or other testing tools, and by completing manual testing using a keyboard, a screen reader, and zooming the browser window. Now what? When it comes to prioritizing web accessibility fixes, ranking the severity of each issue is an effective way to prioritize and make impactful improvements. […]

25 Accessibility Tips to Celebrate 25 Years

31 October 2024 @ 4:38 pm

As WebAIM celebrates our 25 year anniversary this month, we’ve shared 25 accessibility tips on our LinkedIn and Twitter/X social media channels. All 25 quick tips are compiled below. Tip #1: When to Use Links and Buttons Links are about navigation. Buttons are about function. To eliminate confusion for screen reader users, use a <button> […]

CatsWhoCode.com

VN:F [1.9.22_1171]
Rating: 7.0/10 (1 vote cast)

Titbits for web designers and alike

Unable to load the feed. Please try again later.