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.

Error with XGBoost predicting on new data, when there is no target column in the new data (such as in data science competitions)

13 March 2026 @ 5:54 pm

In many data science competitions the user is asked to predict on new data when the target is not given in the new data set. The target is given in the training data set, but not the test set. For example: https://www.kaggle.com/competitions/playground-series-s6e3/overview I'm not able to do this using XGBoost on any data set. Simple example: # Set up train and test sets train <- MASS::Pima.tr train$type <- ifelse(train$type == "No", 0, 1) test <- MASS::Pima.te test$type <- ifelse(test$type == "No", 0, 1) train_x = data.matrix(train[, 1 : ncol(train)]) train_y = train[,ncol(train) : ncol(train)] #define predictor and response variables in test set test_x = data.matrix(test[, 1 : ncol(test) -1]) xgb_train = xgb.DMatrix(data = train_x, label = as.matrix(train_y))

Do C standards allow nested member designators in offsetof()?

13 March 2026 @ 5:43 pm

I have the following struct: struct case_a { int a; int b; int c; }; struct case_b { int x; int y; int z; }; struct foo { int a; union { struct case_a a; struct case_b b; } u; }; I also have a pointer to struct case_a and would like to convert it to pointer to foo: #define CONTAINER_OF(ptr, type, member) \ ((type*)(((char*)ptr) - offsetof(type, member))) int main(int argc, char **argv) { struct foo foo; struct case_a *aptr = &foo.u.a; struct foo *fooptr = CONTAINER_OF(aptr, struct foo, u.a); if (fooptr == &foo) { printf("OK\n"); } return 0; } Note how I'm nesting members when using the CONTAINER_OF macro that calls offsetof. Is this nesting of members permitted by the C standards? At least both clang and gcc with -pedantic, and even with a standard as old as C89, allow it. Are there any major compiler

In React, s it really bad to call a potentially asynchronous function directly in render code?

13 March 2026 @ 5:40 pm

I have a question regarding best practices in React.js. Recently, I came across a blogpost that claimed you shouldn't directly invoke a callback in React render code. And while intuitively I would agree to that statement (and I have never invoked a callback directly in render code before), I started questioning this statement and am wondering why (and if) that is really the case). In other words, my question is: Why should I not do something like in the following? What would break if I did? export const MyComponent = ({callback}) => { callback(); // <-- Why not? return <div>Irrelevant text here</div>; } Note that callback could be an asynchronous function returning a promise (or not). Some further thoughts: The react documentation itself

Phaser collision detection between a group and a tile layer

13 March 2026 @ 5:37 pm

How can you detect a collision between a group and a tilelayer in Phaser? A reason could be for example to delete bullets hitting a wall. In theory it is easy, just use a collider, but nothing works. I have tried overlap instead of collide, making the bullets a physics group, using world.addCollider, etc. Some tiles have been set to collide with this following line: this.groundLayer.setCollisionByProperty({ collides: true }); by getting the collide property from a JSON file produced by Tiled. So collision works fine between the player and the tiles. The dysfunctional code is below: this.physics.add.collider( this.bullets, this.groundLayer, (bullet, tile) => { console.log("hit"); bullet.setActive(false); bullet.setVisible(false); });

How to check a `struct gps_data_t*` for a NULL value the safe way?

13 March 2026 @ 5:28 pm

I'm using the gpsmm library and the gpsd service in a C++ program querying a GPS module. I get a struct gps_data_t* variable with all the data the GPS module spits out, but when it can't fix enough satellites or the gpsd isn't running, the content of the variable is a nullptr. Please don't ask me how someone can come with such an unsafe solution (well, C++ is not Rust). Now I've got a branch in my program, which reads somehow like this: gpsmm gps_handler; struct gps_data_t *gps_data; tmc::tmc () : gps_handler ("localhost", DEFAULT_GPSD_PORT), { } tmc* tmc::Initialize () { tmc* instance = new tmc (); gps_data_t* response; if (!(response = instance -> gps_handler.stream (WATCH_ENABLE | WATCH_JSON))) { cout << "No GPSD running." << endl; } else { // do somethin' with the GPS data } }

Passing texture between shaders

13 March 2026 @ 5:27 pm

I have created a first webgl2 program, which defines a FrameBuffer and writes 2 floats in a 1x2 texture: gl.texImage2D( gl.TEXTURE_2D, 0, // level, gl.R32F, // internalFormat, 1, // targetTextureWidth, 2, // targetTextureHeight, 0, // border, gl.RED, // format, gl.FLOAT, // type, null // data ) This works fine, as I can readPixels() and get the expected result. I would like this texture to be an input to a vertex shader of another program, but I am unsuccessful. // in shader uniform sampler2D u_texture; ... void main() { ... // this ymin always is equals 0 :( float ymin = texelFetch(u_texture, ivec2(0, 0), 0).x; ... } My javascript: // first compute the float values in first program gl.useProgram(programCompute) gl.bindFramebuf

End to End Automation of Kofax + FileNet Application

13 March 2026 @ 5:21 pm

I have to Automate the End to End flow of the Kofax + FileNet Application. Kofax uploads documents which has some unique ID and some metadata of the document which is further stored in FileNet where it has to be validated by searching for the Document Title and the unique ID. When the document is searched and is clicked in the FileNet, it shows the properties/metadata of the document from which it is verified that the document uploaded from Kofax has been stored in the FileNet. Give me a guide how should I start with the End to End Automation of the two application. We are using WebDriverIO + Typescript + Cucumber BDD + SuperTest (for API). How should I do the UI + API Automation Testing of this end to end flow?

AWS Cognito Custom Auth: How to differentiate authentication methods in first Lambda trigger (DefineAuthChallenge/CreateAuthChallenge)?

13 March 2026 @ 5:20 pm

I am implementing custom authentication in Amazon Cognito using the standard three triggers: DefineAuthChallenge CreateAuthChallenge VerifyAuthChallengeResponse My system supports multiple authentication methods for the same user: Phone OTP login Email OTP login Google ID token verification The flow starts with: AdminInitiateAuth AuthFlow = CUSTOM_AUTH AuthParameters = { USERNAME: <existing Cognito username> } The problem is that the first invocation of DefineAuthChallenge and CreateAuthChallenge does not contain ClientMetadata. From my testing, ClientMetadata only appears when the trigger is invoked from AdminRespondToAuthChallenge. Because of this, in the first CreateAuthChallenge call I cannot determine which authentication method is being

need code for this: when a cell is selected, highlight that row and all rows with the same value in column B

13 March 2026 @ 4:26 pm

Need code for this: when a cell is selected, highlight that row and all rows with the same value in column B (table only, if possible). I tried an even simpler code suggested by google, and it didn't work. if I could get that fixed, that would be an ok plan-B: function onSelectionChange(e) { const sheet = e.source.getActiveSheet(); const range = e.range; const selectedValue = range.getValue(); // Clear previous highlights (optional, but recommended) // Change 'Sheet1' to your actual sheet name if different const fullRange = sheet.getRange('A:Z'); // Adjust this range as needed (e.g., 'A1:E100' or 'A:Z') fullRange.setBackground(null); if (selectedValue) { // Apply new highlights using a conditional formatting rule const rule = SpreadsheetApp.newConditionalFormatRule() .withFormulaCode(`=$A1="${selectedValue}"`) // This formula compares each cell to the selected value .setBackground("#ff0000") // Change to

Nextflow slurm jobName issues

13 March 2026 @ 3:39 pm

I am trying to customize the SLURM jobs submitted via Nextflow v.25.04.7 for tracking purposes. However, after multiple attempts and tests, I still cannot figure out the proper syntax. Here are a couple of tests I tried: withLabel: large_res { executor = "slurm" executor.jobName = "${params.projectName}_${task.name}_${task.hash}" cpus = 8 memory = 100.GB time = 24.h clusterOptions = "--account=myGroup --qos=myGroup-b" } This gives the following warnings and errors: WARN: Cannot read project manifest -- Cause: No such property: jobName for class: java.lang.String ERROR ~ No such variable: jobName I also tried modifying the job name in the cluster options instead: withLabel: large_res { executor = "slurm" // executor.jobName = "${params.projectName}_${task.name}_${task.hash}" cpus = 8 memory = 100.GB

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

A New Path for Digital Accessibility?

27 February 2026 @ 7:02 pm

Please note This post will explore how an adaptive, intelligent system could empower users with disabilities to optimize their experience in digital environments. Even were such a system available tomorrow, developers of digital content, services, and products would still be responsible for providing equal access to ALL users. Consider a few of the many exciting […]

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

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.