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.

What is the optimal way to define a global constant string in C++20?

27 November 2025 @ 12:22 am

I need to define several constant strings that will be used across an entire C++20 project. I am considering the following options : constexpr char[] str1 = "foo"; constexpr std::string str2 = "foo"; constexpr std::string_view str3 = "foo"; but I hesitate about which one I must choose. constexpr char[] is efficient but is not modern C++. constexpr std::string is modern C++ and takes advantage of the fact "since C++20 std::string is a constexpr class to perform operations at compile time" but even so, I heard it uses dynamic allocation anyway so it may not be the best option. constexpr std::string_view is probably the optimal choice but I have checked several resources including Professional C++ (5th Edition) by Marc Gregoire and I didn't find clear guidelines it was the reco

Find path of Python file run from Pyzo

27 November 2025 @ 12:05 am

I need to load some data from the folder in which my Desktop\diodo_laser\grafici_diodo_laser.py file that I'm using is saved. I run my Python files with Pyzo IDE and I'm not running it as a script, rather I'm running it from the editor. Other topics on this (like Find path to currently running file or How to get the path and name of the Python file that is currently executing?) suggest using one amongst os.getcwd(), sys.argv[0], sys.path[0] or __file__, but neither of these get me where I want, because I'm neither running it as a script nor running it from the cmd terminal, so all of those commands result in C:\Users\myname or a blank string (and __fi

Date function vba how to

26 November 2025 @ 11:57 pm

I have this code that works great except for when the end of the week comes up I have to change 8 to 15 or vise versa in order to get to the correct workbook. Is there another way? This code is to help find a workbook with the Title Sched and a date (i.e Sched 12.07.25). That workbook is usually created on Monday's or Tuesdays for future schedules (can be up to 2 weeks, usually 1 week). Once I get the schedule I have to put 15 (for more than 7 days from date of creation). Once that week has started and progresses, say now it in that week and is Saturday I have to change it from 15 to 8 to find less than 7 days). So I am working in 2 different workbooks at a time. 1- Schedule 11.30.25 and 2-Schedule 12.07.25. "dat" needs to know which sched to look for. Date always ends on a sunday. Option Explicit Function strgen() Dim dat As Variant Dim datstring As Variant dat = Date - Weekday(Now(), 1) + 15 ''Change 8(this wk) or 15(next wk) to find right wb dat

Embedded Youtube-Player (WKYTPlayerView) Error 4

26 November 2025 @ 11:35 pm

Since perhaps 3 weeks the YouTube player (WKYTPlayerView / ObjectivC) embedded in our app doesn't play films any more, instead it raises "Error 4".

Two-digit year error when converting string variable into date variable (dates span from 1962 to 1981)

26 November 2025 @ 11:28 pm

I have a dataset that spans 1962 to 1981. The dates are formatted as a string in a single field like this: 15-Mar-62. When I use the as.Date function to convert the field into a date format (so I can later group by year), all dates before 1969 end up with a Y2K type error. Reproducible form: dfexample <- tibble::tibble( event = c(1:5), cause = c("human error", "environment", "environment", "human error", "environment"), date = c("13-Mar-62", "15-Dec-65", "19-Apr-69", "22-Jun-70", "07-Sep-81") ) dfexample$date <- as.Date(dfexample$date, "%d-%b-%y") show(dfexample) Output: # A tibble: 5 × 3 event cause date <int> <chr>

Why does sequential array access have a high cache miss rate?

26 November 2025 @ 10:38 pm

I have the following C code that I am testing to understand perf and caching. It sequentially accesses an array of doubles. // test.c #include <stdio.h> #include <stdlib.h> #include <emmintrin.h> int main(int argc, char **argv) { size_t n = 10000000; double* arr; if (posix_memalign((void**)&arr, 64, n * sizeof(double)) != 0) { fprintf(stderr, "posix_memalign failed\n"); exit(1); } for (size_t i = 0; i < n; i += 64) { _mm_clflush(&arr[i]); } for (size_t i = 0; i < n; i++) arr[i] = (double)i; double sum = 0; for (size_t i = 0; i < n; i++) sum += arr[i]; printf("Sum: %f\n", sum); free(arr); return 0; } I compile the code without optimization, and run perf. $ gcc -o test test.c $ perf stat -e LLC-loads,LLC-loads-misses -- ./test Sum: 4

Get all implementations of an interface for a class, including for base

26 November 2025 @ 9:15 pm

public interface A<out T> { public T Property { get; } } public class BaseClass : A<string>, A<int> { string A<string>.Property => "BaseClass"; int A<int>.Property => 0; } public class DerivedClass : BaseClass, A<string>, A<int> { string A<string>.Property => "DerivedClass"; int A<int>.Property => 1; } [Fact] public async Task Test1() { var obj = new DerivedClass(); var values = obj.GetType().GetInterfaces().Where(i => i.GetGenericTypeDefinition() == typeof(A<>)).Select(i => i.GetProperty(nameof(A<>.Property))!.GetValue(obj)!); Assert.Equal(4, values.Count()); } With this dummy code values only holds ["DerivedClass",1]. Is it possible to get all 4 values (so including those of the base class), or are the base interface implementations completely ove

For unity builds is there any tradeoff/correctness issues between #pragma once vs include guards [duplicate]

26 November 2025 @ 6:09 pm

Suppose I have a unity build: //impl1.h //impl1.cpp -> #include s impl1.h //impl2.h //impl2.cpp -> #include s impl2.h AND impl1.h //main.cpp #include "impl1.cpp" #include "impl2.cpp" int main(){ //stuff } Does it matter that impl1.h is like so: #ifndef IMPL1_H #define IMPL1_H //impl1.h stuff #endif as opposed to #pragma once //impl1.h stuff The reason I ask is that the semantics of the header guard seem to me to make it absolutely certain that #include "impl2.cpp" does not again process impl1.h. With #pragma once, and assuming #include " " engages in more or less plain straightforward textual substitution, are there issues with the compiler seeing multiple #pragma onces corresponding to the same or different header files when it processes

How do I select the right language for my C program's output?

26 November 2025 @ 4:47 pm

I am writing a C application, to be distributed as a single static binary (so it doesn't have a chance to do anything like install message catalog files). It only needs to support a few natural languages; I want to get the "current language" the program is supposed to be speaking, and then print one thing if it is English, another if it is, say, Japanese, and a third if it is Polish, and maybe something else if it isn't any of those. I know that a C program starts up with the "C" locale. This is not the "correct" language for the program to speak in its output, based on the standard environment variables like LANG. To get the program to consult its environment and determine the correct locale for messages to the user, I need to do something like: char* message_locale = setlocale(LC_MESSAGES, ""); This has the side effect of configuring the message-catalog system to the correct locale

Nodriver does not take exception if element not found?

26 November 2025 @ 1:42 pm

I am trying to search for elements on a webpage and have used various methods, including text and XPath. It seems that the timeout option does not work the way I expected, and no exception is raised even if the text or XPath is not present in the website's HTML. The code below demonstrates why I am confused. There are three page.find queries. The first one just removes the cookies pop-up, so it can be ignored. The second query: page.find(("emailOrGhin", timeout = 1) works, and as shown in the results, it executes in about 0.01 seconds, which is great. The third query is where I have questions: page.find("emailOrGhinnowayjunkXyq", timeout=1) As shown in the results, this statement seems takes 1.52 seconds to execute, which is longer than the specified timeout of 1 second. Why does t

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

ThemeForest.net

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

WordPress Themes, HTML Templates.

Interface.eyecon.ro

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

Interface elements for jQuery
Interface.eyecon.ro

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.