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.

Form page reloads on submit despite calling event.preventDefault() in JavaScript

8 January 2026 @ 12:49 pm

I am trying to prevent a form from reloading the page when it is submitted. I am calling event.preventDefault(), but the page still reloads every time I click the submit button. Here is my HTML: <form id="loginForm"> <input type="text" id="username" /> <button type="submit" id="submitBtn">Submit</button> </form> And my JavaScript: const btn = document.getElementById("submitBtn"); btn.addEventListener("click", function (event) { event.preventDefault(); console.log("Button clicked"); }); I expected the form submission to be stopped and only the console message to be printed. However, the page still reloads after clicking the submit button. I tried using preventDefault() and confirmed that the event handler is running, but the reload still happens. What is the correct way to prevent th

How to end NodeJS(TS) operation gracefully on manual SIGINT?

8 January 2026 @ 12:43 pm

I know that this question has many answers, but neither works cleanly as I intend. Goal: I have a Typescript script that is triggered via Commander command, and then I process data. I want to finish database update, calculation for current data cycle, then break and exit. I listen to signint, and gracefully handling works great. My only issue is with logs output that I see a new terminal prompt on Mac some time after SIGINT request and then the rest of the logs. Example Code main.ts import { program } from 'commander'; import { logger } from '@src/logger'; async function cleanup(): Promise<void> { await db.destroy(); redis.disconnect(); await pubsub.close(); } program .name('process-data') .version('0.0.0') .option('--config <string>', 'path to a config file') .actio

Homebrew: formula fails to run with error ZIP does not support timestamps before 1980

8 January 2026 @ 12:41 pm

I maintain a Homebrew formula on my own tap, and I'm having issues to update it. I'm not sure if this is Python- or Homebrew-related. Here is my formula: class Kosmorro < Formula include Language::Python::Virtualenv desc "Ephemerides calculation program" homepage "https://kosmorro.space" url "https://files.pythonhosted.org/packages/8e/62/9c1f4377a50615be7046e3c6112ea7238bc5296d622946a3b360b6807765/kosmorro-1.0.1.tar.gz" sha256 "7eabe34410ace99d850786665276bf417ed33df998376adbc0af2d1c4431b873" revision 1 depends_on "[email protected]" depends_on "certifi" depends_on "numpy" depends_on "python-argcomplete" resource "babel" do url "https://files.pythonhosted.org/packages/7d/6b/d52e42361e1aa00709585ecc30b3f9684b3ab62530771402248b1b1d6240/babel-2.17.0.tar.gz" sha256 "0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d" e

How to compute expected payoff of a game with stopping conditions (Markov / DP approach?)

8 January 2026 @ 12:38 pm

A game pays +4 with probability 0.6 and −3 with probability 0.4 each round. The game stops the first time either two losses occur consecutively or the cumulative payoff reaches +10, whichever happens first. What is the expected total payoff? I have a game defined as follows: Each round: +4 with probability 0.6 −3 with probability 0.4 The game stops the first time either: the cumulative payoff reaches +10 or more, or two losses occur consecutively I want to compute the expected total payoff at the stopping time, starting from a payoff of 0. I believe this can be modeled as a finite-state process (e.g., a small Markov chain or dynamic programming setup), where the state needs to track both the current cumulative payoff and whether the previous round was a loss, but I am unsure how to: define the minimal state space cleanly, write the recurrence equations for the expected payoff, and handle the stop

How do I search a number of archived tar files for a specfic file

8 January 2026 @ 12:34 pm

I have a number of dated archives and I want to be able to search each one, but I don't want to have to search each one individually. The command I started using using is tar tvfz 20260107.tgz | grep <filename> I am using the grep because I don't necessarily know the exact path or the whole file name. I have used tried to use xargs to iterate through the file list but I need a way to report back which filename was successful. ls *.tgz | xargs -I{} tar tvfz {} | grep <filename>

How can I trigger software on a Windows PC from the internet while the PC is sleeping?

8 January 2026 @ 12:33 pm

I want to build a piece of software that can be invoked remotely from a server on the internet, even when the target linux/(proffered Windows) PC is in sleep mode. The goal is roughly: A Windows PC is sleeping (not hibernated or shut down) A remote server sends some kind of request The PC wakes up and runs my software (or a service that then runs the software) I understand that a sleeping PC is not actively running applications, so I’m trying to figure out what mechanisms are realistically possible for this.

My first programming exercises in College

8 January 2026 @ 12:23 pm

this is my first posting questions here in stackoverflow Machine Problem 1: Create a program to print your name on the screen. You may add some info. like Course etc.: Name: Juan Dela Cruz Course: BSIT  My code: #include <stdio.h> int main(){ printf("Name: scythress"): printf("Course: BSIT"); return 0; } Is there any other approach to solve this problem (I guess this is not a problem) but a unique way of coding this like ascii numbers?

Python ValueError while training Logistic Regression model

8 January 2026 @ 11:48 am

I am trying to train a Logistic Regression model using scikit-learn in Python. When I try to fit the model, I get the following error: ValueError: could not convert string to float Here is the code I am using: from sklearn.linear_model import LogisticRegression model = LogisticRegression() model.fit(X_train, y_train) I checked my dataset and noticed that some columns contain string values. How can I preprocess the data to fix this error?

offsetWidth does not match visible element width

8 January 2026 @ 11:29 am

I am running into a very confusing issue when measuring the width of a button using offsetWidth. I am using Vue 3 and Quasar. I have a q-btn inside the #append-slot of a q-field. I am trying to calculate the width of the button so I can move it to the right of the field. I am aware that I could simply put the button in a different template, like #after instead of #append and I wouldn't have to worry about calculating the width and moving the button in an absolute position. Sadly in my very specific case that is simply not possible. Visually, the button looks completely correct and the text I am trying to display on it is rendered on a single line. However, when I measure the width via offsetWidth, the value is incorrect for labels with spaces. label on button offsetWidth hello 45px (correct) hello world 45

How to configure email alerts for Service Control Policy (SCP) changes in AWS?

8 January 2026 @ 9:42 am

I want to configure alerts in AWS so that I receive an email notification whenever a Service Control Policy (SCP) is modified. Specifically, I want to be notified when any of the following actions occur in AWS Organizations: CreatePolicy UpdatePolicy DeletePolicy AttachPolicy DetachPolicy These actions should apply only to Service Control Policies (SCPs). I am looking for a step-by-step procedure to set this up, including which AWS services to use (for example, CloudTrail, EventBridge, SNS, etc.). Can someone explain the recommended approach and how to configure it correctly?

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

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> […]

Celebrating WebAIM’s 25th Anniversary

30 September 2024 @ 10:25 pm

25 years ago, in October of 1999, the Web Accessibility In Mind (WebAIM) project began at Utah State University. In the years previous, Dr. Cyndi Rowland had formed a vision for how impactful the web could be on individuals with disabilities, and she learned how inaccessible web content would pose significant barriers to them. Knowing […]

Introducing NCADEMI: The National Center on Accessible Digital Educational Materials & Instruction 

30 September 2024 @ 10:25 pm

Tomorrow, October 1st, marks a significant milestone in WebAIM’s 25 year history of expanding the potential of the web for people with disabilities. In partnership with our colleagues at the Institute for Disability Research, Policy & Practice at Utah State University, we’re launching a new technical assistance center. The National Center on Accessible Digital Educational […]

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.