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.

When should I use threads or processes with asyncio instead of trying to make everything awaitable?

2 February 2026 @ 6:41 am

I am building a Python service using asyncio and I am trying to keep my code fully async. However, my real workload includes CPU-heavy tasks like parsing large files and data transformations, plus some third-party libraries that are blocking and do not provide async APIs. I know I can use loop.run_in_executor or asyncio.to_thread for blocking operations, and I could also use multiprocessing. But in practice, how do experienced developers decide which parts should stay fully async, which should use a thread pool, and when it is better to isolate work into a separate process or service? I am looking for practical decision rules and patterns that work in production, not just toy examples. What are the tradeoffs?

How to send object references to function via std::span

2 February 2026 @ 6:40 am

I have this function: bool TmrwRenderImpl::copyTexture( std::optional<std::pair<std::unique_ptr<tmrw::opengl::TmrwPassRenderer>, std::unique_ptr<tmrw::opengl::TmrwPassRenderer>>>& pass_copier, const opengl::TmrwTexture& src_texture, const opengl::TmrwTexture& dst_texture, bool flip) { tmrw::opengl::TmrwPassRenderer* renderer = flip ? pass_copier->second.get() : pass_copier->first.get(); std::string uniform_texture = "src_texture"; //std::span<const std::string&> named_uniform_values = { uniform_texture }; return renderer->Render({ std::cref(src_texture) }, { std::cref(dst_texture) })); //, named_uniform_values)); } Here renderer->Render should accepc std::span object references, I tried to declare it in many ways: 1. virtual bool Render(std::span<std::reference_wrapper<const TmrwTexture>> src_texture, std::span<

Implementing Callouts and Cards and Accordian [closed]

2 February 2026 @ 6:24 am

I’m planning to add custom block components to Tiptap—specifically callouts (info, success, warning, tip), and later cards and accordions. Since Markdown doesn’t natively support these kinds of blocks, I’m looking for guidance on the cleanest long-term approach. Overview of what I’m trying to do Use Tiptap to author content with callouts and other custom block components Persist the content as Markdown (for portability and static rendering) Render the same Markdown consistently on hosted/static sites Current idea (high level) At a conceptual level, I’m considering representing callouts in Markdown using a custom, HTML-like wrapper, while keeping the inner content as standard Markdown. For example: Markdown content inside *italic* and **bold** On the rendering side, this would be transformed into a styled HTML block (e.g. a with classes), while ensuring the inner Markdown remains untouched and renders normally.

Why isn't my ESP32 sending the full payload to my python server [closed]

2 February 2026 @ 5:34 am

I'm recently working on a project that has an ESP32 as the client and Python FastAPI as the server. After the connection, there's an authentication process, which requires them to communicate using WebSocket (messages are in JSON format). The problem is that the ESP32 said it sent out the message: {"type":"auth_response","id":"CHY","data":{"hash":"f6bb6993e5a44bcde621d6bdd4a3dcb7fcfa5ac0b9a8137d88bed81510849fed","time":19726}} but the server only received {. The server didn't receive the whole message sent from the ESP32. I was expecting the server to receive the whole message, but it didn't. I've used Postman to test the server, and it's working fine, so I suspect the problem lies in the ESP32. This is the code for ESP32. void webSocketEvent(WStype_t type, uint8_t *payload

Sending emails through local proxy

2 February 2026 @ 5:22 am

I need to bypass Iran's internet censorship to send emails using R's emayili package. The standard gmail() function fails because the regime blocks the default SMTP protocol. My goal: Use local HTTP/HTTPS/SOCKS proxies to route emayili's email traffic through a local proxy server (192.168.1.50:8080). Current setup that doesn't work: message_content <- "something" smtp <- gmail( username = sender_email, password = sender_email_pass # Gmail app password ) smtp(message_content) # Fails due to blocking What I've tried without success: # Direct proxy specification smtp <- gmail( username = sender_email, password = sender_email_pass, proxy = "https://192.168.1.50", proxyport = 8080 ) # Colon-separated format smtp

How to systematise a checking of "a quite equals to b" (either with round method or | a - b | ~ 0) for any value of a?

2 February 2026 @ 4:53 am

My context I have implemented an equals(Object o) method for a speed object (Vitesse here) that when it faces a comparand being in m/s when it is itself in km/h (in example) puts the comparand in km/h too before comparing the values. And I'm testing it in this test where it is triggered by the last assertEquals(...) statement: @Test @DisplayName("Ex E1, Benson Ch. 3") void ex_Benson_Ch3_E1() { LOGGER.info("Asafa Powell (Jamaïque) court 100m en 9.74s. Quelle est sa vitesse moyenne ?\nSerait-il en infraction dans une zone scolaire où la vitesse est limitée à 30 km/h ?"); Vitesse vitesseMoyenne = new Vitesse(100, 9.74); // Par défaut, en mètres secondes assertEquals(10.3, vitesseMoyenne.vitesse(), 0.1, "La vitesse moyenne du coureur n'est pas la bonne, en m/s"); // Vérifier les conversions, étape

Insert Data from Java to MySql

2 February 2026 @ 4:37 am

I don't know how to convert Java string numbers to insert them into MySQL table. The field 'peso' in MySQL is declared as float. public void Conferma() { // Creo un oggetto Prodotto Prodotti prod = new Prodotti(txtCod.getText(), txtDescr.getText(), txtDicAdr.getText(), txtUdm.getText(), Float.parseFloat(txtPeso.getText())); // inserisce il record nel database try (Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/DDTFornitori", "root", "mA19720306#")) { // Crea l'istruzione PreparedStatement insStmt = conn .prepareStatement("insert into tblProd (idprod, descr, dicituraADR, udm, peso) values(?,?,?,?,?)"); // Specifico il valore dei parametri insStmt.setString(1, prod.getCodice()); insStmt.setString(2, prod.getDescrizione()); insStmt.setString(3, pro

How do I bypass "erasableSyntaxOnly" error when using React Testing Library with Jest

2 February 2026 @ 4:06 am

I'm trying to use React Testing Library with Jest and I'm not sure how to address it. I'm trying to test React components with Jest and RTL and I keep getting caught with erasableSyntaxOnly errors. Here are my configurations: package.json: { "name": "06-jest-setup", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", "preview": "vite preview", "test": "jest" }, "dependencies": { "react": "^19.2.0", "react-dom": "^19.2.0" }, "devDependencies": { "@babel/core": "^7.29.0", "@babel/preset-env": "^7.29

R: How to ensure that text does not intersect with a ggplot graph?

2 February 2026 @ 2:32 am

I have the following R code that makes a visualization using ggplot: library(ggplot2) set.seed(42) n <- 100 time <- 1:n baseline <- 10 + rnorm(30, sd = 2) intervention <- 10 + seq(0, 5, length.out = 40) + rnorm(40, sd = 2) post <- 15 + rnorm(30, sd = 2) values <- c(baseline, intervention, post) df <- data.frame(time = time, value = values) intervention_start <- 31 intervention_end <- 70 shaded_region <- data.frame( xmin = intervention_start, xmax = intervention_end, ymin = -Inf, ymax = Inf, Period = "Intervention Period" ) vlines <- data.frame( xintercept = c(intervention_start, intervention_end), Line = "Intervention Start/End" ) ggplot(df, aes(x = time, y = value)) + geom_rect(data = shaded_region, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, fill = Period), inherit.aes = FALSE, alpha = 0.3) + geom_line(aes(color = "Observed Data"), linewidth = 0

Can arbitrary precision integer increment in Brainfuck be done in O(1) code size?

2 February 2026 @ 1:29 am

I was fiddling with the Brainfuck esolang over the past few days, and tried to implement an increment operation on an N-byte-wide integer in big-endian format. Note that I am imposing a structural constraint on the data. Consider BF tape on the left and right side of this int to be infinite and all initialized to 0. The exact integer value is not known and the data pointer starts at the LSB. The very important additional constraints are that the bytes other than the N integer bytes must be reset before end and the pointer must end at LSB. I have managed to establish 2 algorithms which generate O(N) instructions for this increment, using ripple carry, which are structurally very different. Unrolled: We hardcode the int length, by opening N - 1 loops which after increment, check if the current position is zero (overflow occurred) and if then so, move forward, which we then close at the exact same position it was opened and from there we m

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.