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.

How to control zigbee devices directly from code?

29 November 2025 @ 9:53 am

I want to create smart home automation system like home assistant. I know about zigbee2MQTT, but I think it would be better to control everything directly. How to do this, I know Assembly, C, Java, Python

During red–black tree insertion fix-up, when (if ever) does the black-height of nodes change?

29 November 2025 @ 9:39 am

Here’s a cleaned-up Stack Overflow version you can copy–paste and tweak: I’m studying red–black trees (CLRS style) and I’m confused about how black-height behaves during RB-INSERT-FIXUP. Definitions I’m using (same as CLRS): Leaves are the sentinel nil nodes, which are black. For a node x, the black-height bh(x) is the number of black nodes on any simple path from x down to a leaf, excluding x itself. All paths from x to its leaves contain the same number of black nodes, so bh(x) is well defined. Consider the usual insertion Case 1 (parent is a left child and the uncle is red). Before the fix-up, the situation is: C (black) / \ A D / \ z ... where:

How to avoid per-process memory duplication when using rapidgzip with multiprocessing in Python?

29 November 2025 @ 9:39 am

I have a Python file: from concurrent.futures import ProcessPoolExecutor import tarfile, rapidgzip def processNdjson(ndjsonName): with rapidgzip.open(inTarDir) as myZip: myZip.import_index(rapidgzipDir) with tarfile.open(fileobj=myZip, mode="r:*") as f: member = f.getmember(ndjsonName) dataFile = f.extractfile(member) for oneLine in dataFile: # process oneLine here if __name__ == "__main__": rapidgzipDir = ... inTarDir = ... rapidgzipDir = ... nCore = 5 ndjsonNames = ["name1.ndjson", "name2.ndjson"] with ProcessPoolExecutor(nCore) as pool: results = pool.map(worker, ndjsonNames) Above, inTarDir is the directory to a .tar.gz file that contains multiple .ndjson files. rapidgzipDir is the pre-index file to be used by

Counting Robot Container Stacking Operations in C++

29 November 2025 @ 9:26 am

I’m trying to solve a problem where a robot stacks containers in a warehouse, and I want to calculate the number of operations it performs. The rules are: There are N containers arranged in a single row. Each container has a size Ai (1 ≤ Ai ≤ M). The robot can pick a container and place it inside a larger container to its right. A container that already contains another cannot be used again. I need to count the total number of robot operations (nestings). Input: First line: two integers M (max container size) and N (number of containers). Second line: N integers A1, A2, ..., AN representing the container sizes in order. Output: One integer: the number of robot operations performed.

Scope Tailwind to certain element

29 November 2025 @ 6:29 am

New to Tailwind and I am asking this as Tailwind is defined as a framework. Not sure if it's feasible but can we scope tailwind to particular div? Putting this in a bit detail as you can understand where I stand. I have got this div with custom css- <div id="contend"> <div id='contendcustomcss"> <!--- contend here owned by another team. Works perfectly. Cannot touch ---> </div> <div> Now my team is late to the party <div id="contend"> <div id='contendcustomcss"> <!--- contend here owned by another team. Works perfectyly. Cannot touch ---> </div> <div id='contendtailwindcss"> <!--- contend owned by my team. Active work happening here ---> </div> <div> Is there any way to tell Tailwind, not to go anywhere inside "contendcustomcss"

How to modify mulitple columns applying if else to multiple pandas dataframe columns

29 November 2025 @ 3:19 am

I have a dataFrame with columns Age, Salary and others, if I used: df['Age'] = df['Age'].apply(lambda x : x+100 if x>30 else 0) Then I can modify the Age column with the if else condition. Also, if I used: df[['Age', 'Salary']] = df[['Age', 'Salary']].apply(lambda x : x+100) Then, I can apply the lambda equation to each column independently. But as soon as I use an if else condition on both columns as: df[['Age', 'Salary']] = df[['Age', 'Salary']].apply(lambda x : x+100 if x>30 else 0) Then I get the following error: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). So, how can I modify the Age, Salary and n columns applying the same if else or other lambda condition to each column independently? I know two possible solution are: To use a for to call each column: cols = ['Age', 'Salary'] for i i

AudioSystem,isAudioLineSupported returns false

29 November 2025 @ 2:34 am

I am trying to use some Java audio code that worked back in 2019. I am now using the Eclipse IDE with JavaSE-21 running on Windows 11. The following code is not working: AudioFormat af = makeAudioFormat(); DataLine.Info info = new DataLine.Info(TargetDataLine.class, af); if (!AudioSystem.isLineSupported(info)) { System.out.println("Unsupported audio format"); System.out.println(info); } The println outputs this information: Unsupported audio format interface TargetDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, mono, 2 bytes/frame, big-endian I have tried mono/stereo and big-endian/little-endian: they all fail. After looking at the Oracle documentation I tried this code: if (AudioSystem.isLineSupported(Port.Info.MICROPHONE)) { It also fails with Port.Info.LINE_IN. Audio input definitely works with Audacity, and with t

How do I use Socket.io with Fastay? I can’t access the server instance

28 November 2025 @ 8:32 pm

I’m trying to run Fastay.js as a separate backend, and I really need Socket.io because my app depends on real-time features. But I’m stuck: Fastay doesn’t give me access to the underlying HTTP server, and Socket.io needs that to start. Fastay boots up fine, but I have no way to grab the server instance to pass into Socket.io.Does anyone know how to fix this? Is there ANY way to access the internal server? Really need to get this working ASAP. Thanks! // src/index.ts import { createApp } from '@syntay/fastay'; import { Server as SocketServer } from 'socket.io'; void (async () => { const app await createApp({ apiDir: './src/api', baseRoute: '/', port: 3000 }); const io = new SocketServer(app); // breaks because "server" doesn't exist io.on('connection', socket => { console.log('User connected:', socket.id); }); })();

Define runtype with npm lib "runtypes" that shall check a recursive typescript type

28 November 2025 @ 5:34 pm

I would like to define a runtype that is equivalent to the following static typescript type: export type Tourney2 = { type: 'flat'; name: string; scoreType: TScoreType; matches: string; } | { type: 'tree'; name: string; scoreType: TScoreType; subTourneys: Tourney2[]; } I have tried some variants with Lazy, but they do not work and throw the following error when I try to call guard(). My last trial was: import * as rt from 'runtypes'; export const ScoreType = rt.Object({ type: rt.Literal('welove'), min: rt.Number, max: rt.Number, divisor: rt.Number, }) export type TScoreType = rt.Static<typeof ScoreType>; export const Tourney: rt.Runtype<Tourney2> = rt.Union( rt.Object({ type: rt.Literal('flat'), name: rt.String, scoreType: ScoreType, matches: rt.String, }), rt.Object({ type: rt.Literal('tree'),

Cant open more than 8000 tcp connections with Java

28 November 2025 @ 2:27 pm

I am trying to open to open 10K+ connections to a server, but my app stops at 8K connections when looking at the server logs. When using two remote servers it will struggles when reaching between 8K and 9K connections. Making me belief the problem is on the client side. I tried the following settings on the client: Setting the ephemeral ports:net.ipv4.ip_local_port_range = 32768 60999 Setting the ulimit to 65535 But still my Java application can't open more than 8K outgoing connections. Some experimenting showed that: Doing a little less than 8K in rapid succession is fine. Doing 8.1K requests causes a 30 delay before it continues with only little bursts. During the tests the machine never runs out of CPU or memory. During the delay it goes back to running at an idle 1-2%. No error or exception is being thrown. The code:

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

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

Decoding WCAG: “Change of Context” and “Change of Content” 

31 July 2024 @ 4:54 pm

Introduction As was mentioned in an earlier blog post on “Alternative for Time-based Media” and “Media Alternative for Text,” understanding the differences between terms in the Web Content Accessibility Guidelines (WCAG) is essential to understanding the guidelines as a whole. In this post, we will explore two more WCAG terms that are easily confused—change of […]

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.