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.

.nut script does not pass data to SQL database when params[3] in the script is set to 1

27 December 2025 @ 2:42 am

I have a problem with a .nut file that's part of a game server that's written in c++. I did not write these server files, they're part of an open source project that is no longer available to download, otherwise I would link to the github page. The .nut script is supposed to create/modify an entry in an SQL database, with the following information: UID: ID of the entry Character: the ID of the player attached to this entry, if any. RelatedTo: The ID of the player's clan, if any. Type: The ID of the counter. Counter: The value of the counter. PreExpireType: I'm not 100% sure what this value does. GroupCounter: I'm not 100% sure what this value does. TimeStamp: Timestamp of when counter was changed. The .nut script that's called by the server's event system looks lik

C# TSS Interacting with the TPM

27 December 2025 @ 1:35 am

public static AESTPMKey OpenOrCreateAesRootKey() { const uint persistentHandleValue = 0x81000001; var persistentHandle = new TpmHandle(persistentHandleValue); // 1️⃣ Connect to TPM var tpmDevice = new TbsDevice(); tpmDevice.Connect(); var tpm = new Tpm2(tpmDevice); bool recreateKey = false; // 2️⃣ Check if persistent key exists try { var existingPub = tpm.ReadPublic(persistentHandle, out _, out _); if (existingPub.parameters is SymDefObject sym && sym.Algorithm == TpmAlgId.Aes) { MessageBox.Show("Persistent AES key exists. Reusing key.", "Info", MessageBoxButton.OK, MessageBoxImage.Information); return new AESTPMKey(tpm, persistentHandle); } else { // Existing key is not AES → evict tpm._AllowEr

Failure to enumerate USB device with DWC2 USB host

27 December 2025 @ 1:33 am

I am working on an embedded RTOS system for a 32-bit MIPS SOC, which supports DWC2 OTG. (It can run Linux well.) I ported an open-source USB stack to this system by following the porting guidance. const struct dwc2_user_params param_test = { .phy_type = DWC2_PHY_TYPE_PARAM_UTMI, .phy_utmi_width = 16, #ifdef CONFIG_USB_DWC2_DMA_ENABLE .device_dma_enable = true, #else .device_dma_enable = false, #endif .device_dma_desc_enable = false, .device_rx_fifo_size = (2048 - 16*16), .device_tx_fifo_size = { [0] = 16, // 64 byte [1] = 16, // 64 byte [2] = 16, // 64 byte [3] = 16, // 64 byte [4] = 16, [5] = 16, [6] = 16, [7] = 16, [8] = 16, [9] = 16, [10] = 16, [11] = 16, [12] = 16, [13] = 16, [14] = 16, [15] = 16 }, .device_gccfg = 0, .host_gccfg = 0, .host_rx_fifo_size = 1096, // (reg: 0x24) .host_nperio_

Resolving itanium-abi demangling for a template <type> with a <substitution>

27 December 2025 @ 1:20 am

The Itanium ABI BNF gives two possible demangling resolutions for a <type> entity that is given as <substitution><template-args>. (eg: in "_Z1aSaIcE", "SaIcE" must be a <type> and it's made up of a <substitution> ("Sa"), plus a (single-term) <template-args> ("c" = char)). <type> = "<substitution><template-args>" can be demangled as either: (A) <type> <template-template-param><template-args> <substitution><template-args> (B) <type> <class-enum-type> <name> <unscoped-template-name><template-args> <substitution><template-args>

How to automate versioning via CI in a Python project?

27 December 2025 @ 1:07 am

I have a Python project using pyproject.toml and I want to figure out the best method to automate incrementing the version. The requirements are: Each time the package is modified (e.g.: src/**, pyproject.toml, or requirements.txt), automatically increment the patch version and publish a new package. Allow for manually incrementing the major/minor versions when necessary My solution so far has been to have a $NEXT_VERSION variable set in the repo settings. This defines what version to use the next time the package is published. Then my pyproject.toml contains: [tool.hatch.version] source = "env" variable = "NEXT_VERSION" Each time I merge a change in the specified fil

printf() not working on colab while running a CUDA c++ code

26 December 2025 @ 9:58 pm

This is my first time working with CUDA programs. So I just wrote a simple hello world program. #include <stdio.h> __global__ void hello(){ printf("Hello block: %u and thread: %u\n", blockIdx.x, threadIdx.x); } int main(){ hello<<<2,2>>>(); cudaDeviceSynchronize(); } I compiled this using nvcc hello.cu -o hello and ran it using ./hello. %%shell nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Thu_Jun__6_02:18:23_PDT_2024 Cuda compilation tools, release 12.5, V12.5.82 Build cuda_12.5.r12.5/compiler.34385749_0 I'm running it on Google Colab using the T4 GPU. When I run the code, I do not get any output printed. Any ideas on how to fix it?

How does attribute access (.) actually work internally?

26 December 2025 @ 9:33 pm

When I write obj.attribute in Python, what is the sequence of operations and lookups that Python performs to resolve this attribute? A step-by-step would really help understand how Python's objects work.

Being too reliant on AI, roast the crap out of my coding please

26 December 2025 @ 8:30 pm

Alright, I feel like this needs to be said. Lately I've become way too dependent on AI as a junior developer, and honestly, it's starting to hurt my growth. Instead of properly thinking through problems, I’ve been outsourcing my brain — and that's on me. That’s exactly why I want this code to be absolutely roasted. No sugarcoating, no polite feedback. I haven't touched C# in a while, and combined with relying too much on AI, my fundamentals have clearly gotten rusty. This exercise is meant to force me to confront that and actually improve as a programmer. Here's the code. using System; namespace MyApp { internal class Program { static void Main(string[] args) { Generator generator = new Generator(); generator.numberGenerator(); } } class Generator() { public void numberGenerator() { Console.WriteLine("Give the difficulty of the game: +" +

Why does statement expression ({...}) not exist in the C standard? [closed]

26 December 2025 @ 7:44 pm

I have encountered an issue in the C language. In GCC and Clang there is a feature called statement expression which is often used in macros. Its main feature is that several statements can be placed in a single block inside a macro, and the difference with do-while(0) is that with do-while the macro cannot have a return value, but in ({ ... }) the last member is chosen as the return value. On the other hand, functions are not always a suitable replacement, because macros have the ability to accept arguments of unspecified type, and with constructs like _Generic one can call a specific function based on the input type. Consider the following example: #define FIND (haystack, needle, n_occurrence) ({ \ STR_EXPECT_STRING_OR_ARR_PTR(haystack); \ STR_EXPECT_STRING_OR_ARR_PTR(needle); \ internal_find_fnc_arr (INTERNAL_AUTO_CHANGE(haystack), INTERNAL_AUTO_CHANGE(needle), n_occurrence); \ }) The function prototype is:

Ranking and Comparing Beta Distributions [closed]

26 December 2025 @ 7:36 pm

What I have: I built a Thompson sampler which given a data set it classifies data with a key and determines if it is considered a success or not, thus having for each key an alpha and beta value for a Beta distribution. With this it is easy given n keys take a random sample of each one and pick the one with the highest value (this is what the method was made for). The Problem: Given this configuration of n beta distributions (built with the observed a & b values), I want to rank them from best to worse and calculate a value that represents "how much better (i.e how much probable is to obtain a favorable value)" one distribution is compared to the others (so I can say something like "this distribution is x times better than this other one"). My Solution: My first approach was ranking them by expected value. The problem with this is that or beta distributions the size o

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.