October 22, 2024
Chicago 12, Melborne City, USA
javascript

Simple assignment versus push method in prototypal inheritance

Say I have this block of code: let hamster = { stomach: [], eat(food) { this.stomach.push(food); } }; let speedy = { __proto__: hamster }; let lazy = { __proto__: hamster }; speedy.eat("apple"); alert( speedy.stomach ); // apple . alert( lazy.stomach ); // apple Both speedy and lazy objects share the same stomach array, but

Read More
pdf

replace text in pdf file with node.js

It is necessary to make a simple web form where will be downloaded pdf file, different they can be with pictures with etc. I want it to change (in place of one word was another) these words can be scattered in different parts of the pdf file, and this pdf without changes could be downloaded

Read More
templates

Issues with boilerplate HTML in the Django templates folder

"I’ve tried reinstalling all extensions, adjusting settings, and reinstalling VS Code, but the auto-suggestion of snippets in templates/index.html doesn’t work. However, when I move index.html out of the templates folder to ./index.html, the snippets start working again. How can I fix auto-suggestions for snippets inside the templates folder?" What I tried: Reinstalled all VS Code

Read More
security

How to create and apply GPO's to individual users or groups on local machine

How can GPO’s be created on a non-domain machine? How can they be applied to individual users or groups. Is there a Group Policy Management Console? (I find only GPEDIT.MSC) I am talking about Windows 10 Pro 22H2 and Windows 11 You need to sign in to view this answers

Read More
SQL

Stream and Task not loading the data into the target table in Snowflake

I have created the external stage in Snowflake as below: CREATE or REPLACE STAGE sk_demo_stage URL='s3://raw-data/' FILE_FORMAT=(type = csv) STORAGE_INTEGRATION = s3_int DIRECTORY = ( ENABLE = TRUE); For a full load, I am using the below syntax: COPY INTO sk_demo.sk_schema.sk_employees FROM @sk_demo_stage/sample/employees; And since CDC is enabled for MySQL and the first column indicates

Read More
CSS

Vega-Lite: Add custom inline CSS for each mark item

In my React app, I would like to render an SVG-based chart with Vega-Lite where each mark can be customized to get its own inline CSS? But the CSS is different for each item (the view-transition-name). Something like a function that is being called for each item to customize the rendered output. Is that even

Read More
C++

PAM pam_prompt function returning conversation failed error if called from pam_sm_open_session

I am trying to create a custom PAM module, where I check amount of sessions a user has and if the user has the right permissions offer him to kill a session, I am trying to give the user a prompt with a list of sessions and offer to kill one of them. But if

Read More
jQuery

Todolist: Remove dynamically added divs

I have a kind of todolist, in which I add elements when clicking on the ‘add’ button. There are two default lines. The add function works great, here’s the original code $(function() { $(".container").on('input', 'input[type=text]', function(event) { var i = $(this).closest(".flex-row").index(); var v = (i == 0) ? $(this).val() : "|" + $(this).val(); $("#custom_wrapper .output").eq(i).html(v);

Read More
HTML

How to optimize LCP in React + Webpack 5

I’m woking on a React (v18) project in a Microfrontend architecture with Single-SPA and Wepack 5. I’m running Lighthouse on localhost and I get that the LCP takes too much and that the render is over 95% of the total time. I’ve tried all sorts of things to improve this to no avail: I’ve implemented

Read More
Android

Run connectedAndroidTests without re-installing APK

I have several instrumentation tests that I want to run as part of a build pipeline. I’m assembling and installing the APK on the device in a previous step and don’t want it to run through that process for the module again when I run ./gradlew app:cAT, is there an easy way to do that?

Read More