element plus issue after migration from vue 2 to vue 3

I’m encountering issue with element ui after migrating from vue 2 to vue 3

the clearable attribute doesn’t work anymore.

for the while el tags like el-select, el-input.

And that’s the issue output

    <el-input v-model="searchForm.societe" type="text" placeholder="Nom de societe"  clearable>
                        </el-input>

app.min.js?id=8d88cd5b8f72df7e3f3a656da29bf8b7:24634 [Vue warn]: (deprecation INSTANCE_ATTRS_CLASS_STYLE) Component has inheritAttrs: false but is relying on class/style fallthrough from parent. In Vue 3, class/style are now included in $attrs and will no longer fallthrough when inheritAttrs is false. If you are already using v-bind=”$attrs” on component root it should render the same end result. If you are binding $attrs to a non-root element and expecting class/style to fallthrough on root, you will need to now manually bind them on root via :class=”$attrs.class”.
Details: https://v3-migration.vuejs.org/breaking-changes/attrs-includes-class-style.html
at <ElIcon key=1 class=”el-input__icon el-input__clear” onMousedown=fn … >
at <ElInput modelValue=”d” onUpdate:modelValue=fn type=”text” … >

Error when dragging external element using FormKit drag-and-drop

When using FormKit’s drag and drop JS library, and dragging an external element over a region which has drag and drop enabled, the console shows the following error.
Please see screenshot showing what I am doing from the FormKit documentation website.

enter image description here

This is the error in the developer tools console, which is the same error I receive in my project:

Uncaught TypeError: Cannot read properties of undefined (reading 'el')
    at La (CGmjAurY.js:64:49253)
    at Re (CGmjAurY.js:64:51565)
    at Ta (CGmjAurY.js:64:48897)
    at HTMLLIElement.<anonymous> (CGmjAurY.js:64:51516)

I have tried to set the accepts property, however receive the same issue:

const [source, items] = useDragAndDrop(["dungeon_master.exe", "map_1.dat", "map_2.dat", "character1.txt", "character2.txt", "shell32.dll", "README.txt"],
  {draggable: (el) => { return el.id !== "no-drag"; }, }
);

Any suggestions on how to prevent this error would be great, it doesn’t cause the application to crash but would be nice to avoid this error in the console. Wondering how to fix it since the documentation examples seem to do it as well.

Hex color code in Javascript gives invalid character error

I’m adding a few hex color codes to a const in JavaScript. It works fine when the hex code includes both letters and numbers. However, if the hex code is numbers only, I get an “Invalid character” error – the error occurs on the “purple” color below. I know I could use rgb(), but I’d prefer to go with hex codes. How can I fix this?

const color = {
  orange: #C65E09,
  purple: #000060,
  lightgray: #E5E5E5
};

Undefined at the end of the loop [duplicate]

I don’t know why its giving me undefined at the end of printing a string characters using for loop inside a function. When I use the code outside the function it works fine but inside it it giving me undefined at the end of printing the characters.

Here is the code:

console.log(vowelsAndConsonants("javascriptloops"));

function vowelsAndConsonants(ss) {

    let vowels = ss.match(/[aeiou]/g);
    for(let i =0; i<vowels.length;i++){
        console.log(vowels[i]);
    }
}

Here is the result:

a
a
i
o
o
undefined

Properly passing Docker secrets for npmrc and auth tokens

I’m having an issue where I want my javascript project to build in Docker. I copy all projects file that are needed and then I run pnpm i. This will not work because I have a private npm registry for some dependencies. My solution is to copy over the npmrc file with a secret. The problem however is that this npmrc file also should have an environment variable replaced with it. How do I do this?

In package.json script I have the following to build the docker image:

"build:server:docker": "DOCKER_BUILDKIT=1 docker build . -f apps/my-app/Dockerfile -t my-app --secret id=npmrc,src=$HOME/.npmrc --secret id=my-npm-token,env=$MY_NPM_TOKEN",

Inside of the Dockerfile:

RUN --mount=type=secret,id=my-npm-token,env=MY_NPM_TOKEN 
    --mount=type=secret,id=npmrc,target=/root/.npmrc 
    pnpm install

In the copied over npmrc file there is a mention to my private npm registry:

//artifactory.mystuff.io/artifactory/api/npm/npm-release-local/:_authToken=${MY_NPM_TOKEN}

The pnpm install command fails with a 401 “No authorization header was set for the request.”

This makes me thing the environment variable is not loaded correctly in combination with the npmrc file.

Everything works fine when using pnpm install without using Docker.

Color overrides in theme.extend.colors not applying to aliased classes in config

I’m working on a Tailwind CSS configuration where I’m overriding some default color values (for example, cyan.400) inside theme.extend.colors. I’m also defining aliased color tokens (such as button-primary-default-bg) that reference those colors.

However, the aliased classes are not picking up the overridden color values – they still use Tailwind’s original colors instead of my custom ones.

Here’s a slimmed-down version of my tailwind.config.js to illustrate the issue:

const defaultTheme = require("tailwindcss/defaultTheme");
const colors = require("tailwindcss/colors");

module.exports = {
  content: [
    "./app/views/**/*.{erb,html}",
  ],
  darkMode: "selector",
  theme: {
    extend: {
      colors: {
        ...colors, // keeping other Tailwind utility colors available
          cyan: {
          ...colors.cyan,
          400: "#01C5D1", // My custom cyan.400
        },
        "button-primary-default-bg": {
          DEFAULT: colors.blue[600], // Light mode: uses default Tailwind color
          dark: colors.cyan[400],    // Dark mode: should pick up my override but does not
        },
      },
    },
  },
  plugins: [],
};

What I expect:
The class using theme('colors.button-primary-default-bg.dark') in dark mode should result in a background of #01C5D1 (my cyan.400 override).

What happens instead:
It still uses the original Tailwind cyan.400 color (#22d3ee), not my overridden value.

I’ve tried moving the ...colors spread both above and below my overrides, but no matter what, the alias (button-primary-default-bg) seems to reference the original imported colors object, not the extended theme.

I also tried putting the color override code into theme.colors instead of theme.extend.colors, and that had no positive effect either.

Cell Renderers on AG Grid detail subgrid

I’ve been implementing the Master/Detail functionality on an existing AG Grid and the cellRenderers don’t seem to be getting applied to the cells in the detail grid. Looking at the documentation I didn’t see any examples there of using them, though styling through the cellStyle/Class and using the valueFormat do work.

Are cellRenderers not support in details, or is there some other key I missed in the doc?

Example setup:

    const detailCellRendererParams = useMemo(
        () => ({
            // provide the Grid Options to use on the Detail Grid
            detailGridOptions: {
                columnDefs: [
                    { field: 'label' },
                    {
                        field: 'detailValue',
                        cellRenderer: 'DetailValue',
                        filter: 'agNumberColumnFilter',
                        cellStyle: { textAlign: 'right'},
                    },
                ],
            },
            // get the rows for each Detail Grid
            getDetailRowData: params => {
                params.successCallback(params.data.details);
            },
        }),
        []
    );

Regular expression matching three character words separated by comma and space and all of partial versions of such string

I would like to validate user input in an web application with a regex. The user is allowed to type three character words and separate them by a comma or comma followed by space.

Valid input could be: ‘B’ ‘BR’ ‘BRU’ ‘BRU,’ ‘BRU, ‘ ‘BRU, A’ ‘BRU, ALC’ ‘BRU, ALC,B’ and so on.

Invalid input would be ‘BRUU’ or ‘BRU ALC’

I wanted to solve this task with a Regex match, but I could not quite get it right. I ended up with this Regex:

/^(?:[A-Z0-9]{1,3}(?:, |,)?)*$/

which unfortunately allows input like “BRUALC”

I solved it with additional runtime check:

function isValid(input) {
  const format = /^(?:[A-Z0-9]{1,3}(?:, |,)?)*$/;
  if (!format.test(input)) return false;

  // Split the words and validate each
  const words = input
    .split(/, ?/)
    .filter(w => w.length > 0); // skip empty trailing entries

  return words.every(w => /^[A-Z0-9]{1,3}$/.test(w));
}

but I wonder if there is a solution using only a regular expression

How to create 2 row titles? First for year and second for quarters

I’m implementing a 5 year view in resourceTimeline type.

resource5YearsSlide:
                {
                    type: 'resourceTimeline',
                    buttonText: '5 Years',
                    dateIncrement: { year: 1 },
                    slotDuration: {
                        month: 3
                    },
                    slotLabelInterval: {
                        month: 3
                    },
    
                    slotLabelFormat: function(arg) {
                        const date = new Date(arg.date.marker);
                        const month = date.getMonth();
                        const year = date.getFullYear();
                        const quarter = Math.floor(month / 3) + 1;
                        return 'T' + quarter + ' ' + year;
                    },
                    visibleRange: function (currentDate) {
                        const start = new Date(currentDate);
                        start.setMonth(0);
                        start.setDate(1);
                        const end = new Date(currentDate);
                        end.setFullYear(start.getFullYear() + 4);
                        end.setMonth(11); // Décembre
                        end.setDate(31);
                        return {
                            start: start.toISOString(),
                            end: end.toISOString()
                        };
                    }
                },  

This works great, but I would find a way to have a 2 row titles, first for year, and second for quarters.

I’ve tryed :

slotLabelFormat: [
                        {
                            year: 'numeric',
                        },
                        {
                            custom:function(arg) {
                                    // Conversion explicite en objet Date natif
                                    const date = new Date(arg.date.marker);
                                    const month = date.getMonth();
                                    const quarter = Math.floor(month / 3) + 1;
                                    return 'T' + quarter;
                                }
                        }
                    ],

and other key instead of ‘custom’, but the function is not called at all, but the year row well printed.

Is there any way to circunviene that?

Incomplete and Unseekable WEBM Video from MediaRecorder Streamed via WebSocket to FastAPI and Azure Append Blob

I am building a large-scale video monitoring application that needs to record a user’s webcam and screen for up to 3 hours and upload the streams in real-time to Azure Blob Storage. The target is to handle up to 10,000 concurrent users.

My current architecture is:

Frontend: Uses the MediaRecorder API in JavaScript to capture webcam and screen streams. It sends video chunks every second over two separate WebSockets.

Backend: A FastAPI server receives the binary data from the WebSockets and appends it directly to an Azure Append Blob.

Playback: A separate FastAPI endpoint (/video/{session_id}) streams the final .webm file from Azure Blob Storage for playback.

Despite the basic functionality being in place, I’m encountering critical issues with reliability and playback.

The Problems

**Incomplete Recordings: **For a 3-hour session, the final video file in Azure is often incomplete. The duration might be much shorter, or the video just stops abruptly, indicating significant data loss.

Unseekable Video Files: When playing the saved .webm video from Azure, the video player’s seek bar does not work. The video plays from the beginning, but you cannot skip to different timestamps.

Inconsistent File Sizes: For recordings of the same duration, the final file sizes vary dramatically between sessions, which I suspect is another symptom of the data loss problem.

Frontend (JavaScript)

let websocketWebcam = null;
let websocketScreen = null;
let webcamRecorder = null;
let screenRecorder = null;
let isRecording = false;

// Connects to a WebSocket endpoint
function connectWebSocket(streamType, sessionId) {
    // Replaced 'your-backend-domain.com' with your actual domain
    const wsUrl = `wss://your-backend-domain.com/upload_video/${sessionId}_${streamType}`;
    const ws = new WebSocket(wsUrl);
    ws.onopen = () => console.log(`WebSocket connected: ${streamType}`);
    ws.onclose = () => console.log(`WebSocket closed: ${streamType}`);
    ws.onerror = error => console.error(`WebSocket error (${streamType}):`, error);
    return ws;
}

// Periodically reconnects WebSockets to keep the connection alive
function reconnectWebSockets(sessionId) {
    console.log("Attempting to reconnect WebSockets...");
    if (websocketWebcam) websocketWebcam.close();
    if (websocketScreen) websocketScreen.close();
    
    websocketWebcam = connectWebSocket("webcam", sessionId);
    websocketScreen = connectWebSocket("screen", sessionId);
    console.log("WebSockets reconnected.");
}

// Starts the recording process
async function startRecording(sessionId) {
    try {
        isRecording = true;
        
        // Assume webcamStream and screenStream are already acquired from navigator.mediaDevices
        
        websocketWebcam = connectWebSocket("webcam", sessionId);
        websocketScreen = connectWebSocket("screen", sessionId);
        
        // Recorder for webcam stream
        webcamRecorder = new MediaRecorder(webcamStream, { mimeType: "video/webm; codecs=vp9" });
        webcamRecorder.ondataavailable = event => {
            if (event.data.size > 0) sendToWebSocket(event.data, websocketWebcam);
        };
        webcamRecorder.start(1000); // Send data every 1 second

        // Recorder for screen stream
        screenRecorder = new MediaRecorder(screenStream, { mimeType: "video/webm; codecs=vp9" });
        screenRecorder.ondataavailable = event => {
            if (event.data.size > 0) sendToWebSocket(event.data, websocketScreen);
        };
        screenRecorder.start(1000); // Send data every 1 second

        console.log("Recording started for session:", sessionId);

        // Set interval to reconnect WebSockets every 45 minutes
        setInterval(() => reconnectWebSockets(sessionId), 2700000); // 45 minutes

    } catch (error) {
        console.error("Error starting recording:", error);
    }
}

// Sends a blob of data to the WebSocket
function sendToWebSocket(blob, ws) {
    if (ws && ws.readyState === WebSocket.OPEN) {
        ws.send(blob);
    } else {
        console.warn("WebSocket not open. Data chunk might be lost.");
        // Simple retry logic, which might not be robust enough
        setTimeout(() => sendToWebSocket(blob, ws), 1000);
    }
}
import asyncio
from fastapi import FastAPI, WebSocket, HTTPException, Request
from fastapi.responses import StreamingResponse, Response
from azure.storage.blob import BlobServiceClient, BlobClient, AppendBlobService
import re

# Assume blob_service_client and container_name are configured
# blob_service_client = BlobServiceClient.from_connection_string(...)
# container_name = "videos"

app = FastAPI()

@app.websocket("/upload_video/{session_id}")
async def upload_video(websocket: WebSocket, session_id: str):
    """ WebSocket endpoint to receive video chunks and append to an Append Blob """
    await websocket.accept()
    
    blob_name = f"{session_id}.webm"
    blob_client = blob_service_client.get_blob_client(container=container_name, blob=blob_name)

    try:
        # Create Append Blob if it doesn't exist
        if not blob_client.exists():
            blob_client.create_append_blob()
    except Exception as e:
        print(f"Error initializing blob: {e}")
        await websocket.close()
        return

    try:
        while True:
            data = await websocket.receive_bytes()
            blob_client.append_block(data)
            
    except Exception as e:
        print(f"Error during video upload for session {session_id}: {e}")
    finally:
        print(f"Upload completed for session {session_id}")
        await websocket.close()

# Video streaming endpoint (simplified for brevity)
@app.get("/video/{session_id}")
async def get_video(session_id: str, request: Request):
    """ Video Streaming API with Range Support """
    blob_client = blob_service_client.get_blob_client(container=container_name, blob=f"{session_id}.webm")
    
    try:
        blob_properties = blob_client.get_blob_properties()
        file_size = blob_properties.size
        range_header = request.headers.get("Range")
        
        start, end = 0, file_size - 1
        status_code = 200 # Full content
        
        if range_header:
            match = re.search(r"bytes=(d+)-(d*)", range_header)
            if match:
                start = int(match.group(1))
                end = int(match.group(2)) if match.group(2) else file_size - 1
                status_code = 206 # Partial content

        length = end - start + 1
        headers = {
            "Content-Range": f"bytes {start}-{end}/{file_size}",
            "Content-Length": str(length),
            "Accept-Ranges": "bytes",
            "Content-Type": "video/webm",
        }
        
        def stream_video():
            stream = blob_client.download_blob(offset=start, length=length)
            yield from stream.chunks()

        return StreamingResponse(stream_video(), headers=headers, status_code=status_code)

    except Exception as e:
        raise HTTPException(status_code=404, detail="Video not found or error in streaming")

My Questions

How to Create a Seekable WEBM file? My current process of appending raw MediaRecorder chunks results in a webm file without the proper metadata (like a Cues element) needed for seeking. How can I fix this? Should I be post-processing the file on the server (e.g., with FFmpeg) after the stream ends to inject the right metadata? Is there a way to generate this metadata on the client?

How to Prevent Data Loss? My strategy of reconnecting the WebSocket every 45 minutes feels wrong and is likely a major source of data loss. What is a more robust method for maintaining a long-running, stable connection for 3+ hours? Should I implement a heartbeat (ping/pong) mechanism instead?

**Is Append Blob the Right Architecture? **Is streaming to a single, large Append Blob for 3 hours a sound strategy? Or would it be more reliable to create smaller, timed video chunks (e.g., a new blob every 5 minutes) and then create a manifest file or concatenate them later?

Unable to Install PHP 8.1 on CentOS 7 using Remi Repository [closed]

I’m trying to install PHP 8.1 on CentOS 7 using the Remi repository, but I’m facing issues with the installation. The Remi repository remi-php81 is enabled, but when I attempt to install PHP 8.1 using yum, I get the error:
No package php available. Error: Nothing to do

Here are the steps I’ve already tried:

Verified Remi Repository:
I checked that the remi-php81 repository is enabled:

yum repolist enabled | grep remi

Output:

remi-php81     Remi's PHP 8.1 RPM repository for Enterprise Linux 7 - 6+383
remi-safe      Safe Remi's RPM repository for Enterprise Linux 7 - x86  217+5379

Attempted PHP Installation:

I attempted to install PHP 8.1 explicitly with:

yum install php --enablerepo=remi-php81

But I still receive the message: No package php available.

Verified Available Packages:

I ran:

yum list available php* --enablerepo=remi-php81

but no PHP packages are listed.

Confirmed PHP Package Availability in Repository:

I checked if the PHP 8.1 package is available in the Remi repository:

yum list available | grep php

But no PHP packages are shown as available for installation.

Could someone help me understand what I might be missing or if there are other steps to properly install PHP 8.1 on CentOS 7?

System Details:

  • CentOS 7
  • Remi repository (remi-php81) is enabled
  • PHP 8.1 package should be available in remi-php81

how to get uploaded images form moodle database in moodle file system

I make a moodle file system in which user user upload there files and then after uploading I fetch the user on to another page on which user sees there inserted record with the image that they are uploading but I cant get images from attachment on to that page instead of showing image it shows default image logo ):

I was expecting that images will shown from moodle database but I m wrong ):

How to print Marathi text correctly in PDF using PHP libraries?

I need to generate a PDF file in PHP that includes dynamic Marathi text.

I’ve tried multiple libraries like TCPDF, mPDF, FPDF, DomPDF, and even generated SVG images with fonts like Noto Sans Devanagari and Mangal. Some of these approaches work partially, but none of them print the Marathi text exactly as I input it.

For example, my input is:

माझं नाव हर्ष आहे. मी वेब डेव्हलपर आहे.
But the output looks distorted or incorrect see this image

I’m using a shared hosting server, so I can’t install any system-level fonts or binaries.

Has anyone successfully printed accurate Marathi text in a PDF using PHP, especially on shared hosting? Any suggestions or workarounds that work reliably?

Thanks in advance!

Object in if statement returns true when compared to 1 and false to any other number [duplicate]

I noticed the following strange behavior in PHP (tested with several versions) where comparing an object == 1 returns true and the same object == 5000 returns false.

I managed to simulate this only with the following code, to test change 1 in the if to 5000 e.q.

$object = new stdClass();

$object->name = "John Doe";
$object->age = 30;
$object->email = "[email protected]";


if(1 == $object){
    echo 'true';
} else {
    echo 'false';
}
// returns true

if(500 == $object){
    echo 'true';
} else {
    echo 'false';
}
//returns false

I tried testing this also with JSON objects and classes, but doesn’t behave the same way.

PS: Asking AI will give really wrong answers.

How to send S/MIME email with MIME headers set to smime.p7m but actual attachment filename as timestamped .edi in PHP?

I’m trying to send a secure EDI email to the ABF via SMTP using PHP. The content must be encrypted and signed using S/MIME (PKCS#7).

Here’s what ABF requires:

The MIME headers of the attachment must be:
MIME-Version: 1.0
Content-Disposition: attachment; filename=”smime.p7m”
Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data; name=”smime.p7m”
Content-Transfer-Encoding: base64
However, when the recipient downloads the attachment, the file should be named something like:
AA*****_202504021256.edi
How can I send an encrypted S/MIME email where:

MIME headers show the filename as smime.p7m, as required by the recipient

But the downloaded attachment is named like AA*****_202504021256.edi?

I use openssl_pkcs7_sign() and openssl_pkcs7_encrypt() in PHP to generate the .p7m file
$mail->addAttachment(‘ AA*****_202504021256.edi’, ‘smime.p7m’, ‘base64’, ‘application/x-pkcs7-mime; smime-type=enveloped-data’);