How make .ktx(Khronos Texture) to .png converter [closed]

Я не сильно хороший програмист но мне срочно нужен конвентер файлов. Сами файлы ktx можно открыть с помощью PVRTexTool но там нудно скачивать файлы по одному а у меня объем в 200-300 файлов и такой способ обработки займет тысяцу лет. Раньше был сайт который также конвентировал файлы но его больше нет и он не поддерживается, если вдруг кто знает как сделать ktx конвентер то пожалуйста расскажите!

I’m not a very good programmer, but I urgently need a file converter. The ktx files themselves can be opened using PVRTexTool, but it is tedious to download the files one by one, I have a volume of 200-300 files, and this processing method takes a thousand years. There used to be a site that also converted files, but it no longer exists and it does not have any instructions. If anyone knows how to make a KTX converter, please tell me!

Пробывал pyktx(даже запустить без ошибок не смог и установка через pip не работает!)
Пробывал PVRTexTool но он конвертит по 1 файлу а у меня объем 200-300 файлов

Seeking Review of TalentLMS Course Completion Tracker(Python, Flask)

I’ve built a web application to streamline course completion tracking from TalentLMS, integrating it with a MySQL database which would all be hosted on an Ubuntu VM. It includes a dashboard for managers to monitor progress of employee’s newly completed courses. I am still very new to programming and this is my first application like this so I am a still not completely confident that I am doing everything the best way possible.

Functionality:
Automates course completion data capture from TalentLMS (using webhooks).
Stores data in a MySQL database.
Features a dashboard for managers to track course completions.

Code Repository (See the branch for the final version, not the master): https://github.com/DLoszak/TLMS-Sync

I’d love to learn if I’m missing any Python best practices that would make my code cleaner or more maintainable, or if there is just anything I should do differently (or there’s a better alternative).

Technology Stack:
Python
Flask
Flask-SQLAlchemy
MySQL
JavaScript
Bootstrap

I’ve used ChatGPT and Google Gemini to review the code but since this is for my job (it’s still a pet project, but just one that is a little more important), I was hoping to get some insight from actually experienced programmers.

Implementing JS Promise.all without using closures/callbacks

I am trying to implement JS Promise.all and this is the code that I manage to get it to work in JS:

function promiseAll(promises) {
    var results = [];
    var numCompleted = 0;

    return new Promise(function(resolve, reject){ 
        promises.forEach(function(promise, index){ 
            var onThen = function(result) { 
                results[index] = result;
                numCompleted += 1;
                if (nunCompleted === promises.length) fulfill(results);
            };
            var onCatch = function(error) { reject(error); };
            promise.then(onThen).catch(onCatch);
        });
    });
}

However, Id like to port this code into a different language that does not support anonymous functions and closure variable capture. In this case, how do I transform the above code to without using callbacks? I know that the promises.forEach(closure) call can be converted into a simple for loop, but how about the rest? Or is this not possible at all?

MERN Stack Development – Fix Cookie is not storing in my frontend

My Frontend Code:

 const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");

  const nav = useNavigate();

  useEffect(() => {
    const token = Cookies.get("token");
    if (token) {
      nav("/");
      return;
    }
  }, []);

  axios.defaults.withCredentials = true;

  const handleSubmit = async (e) => {
    e.preventDefault();
    const tLoader = toast.loading("Authenticating");

    try {
      const result = await axios.post("/auth/login", { email, password });
      if (result) {
        console.log(result);
        console.log(result.data);
        toast.dismiss(tLoader);
        toast.success("Login Successful");
        nav("/");
      }
    } catch (error) {
      console.log(error);
      toast.dismiss(tLoader);
      toast.error(error.response.data);
      console.error(error.response.data);
    }
  };

My Backend Code:

if (pswrd) {
const token = jwt.sign({ id : user._id, email: user.email, role: user.role, department: user.
department }, key, {
expiresIn: “1d”,
});

    res.status(200).cookie("token", token, {sameSite: 'none', secure: true}).send("Login Successful");
  } 

–Here the jwt token is saved while in my local development but after deployed in render both client & server, the cookie is not getting stored in my client side

I need to fix the storing of jwt token in my client side

What are the key features of Corexta and how can they benefit businesses?

Corexta offers a centralized platform for businesses to manage their workflows efficiently.

I attempted to provide a detailed description of the key features of Corexta and how they can benefit businesses while adhering to your specifications, including using simpler language and an active voice. I aimed to deliver an informative article that would be easily understandable to 7th-grade students. The result is a comprehensive overview of Corexta’s features and business benefits, presented in a clear and accessible manner.

Github Actions using Graphql

I am trying to build GitHub Workflows using the GitHub Actions.

I can create them using the octokit rest API using JS, but I recently came across Graphql API which is much more efficient and I want to use the same to build the GitHub workflows via JS. I tried with the examples on the Internet but was not able to build due to incomplete information. If you can provide a complete example or an online resource specifically video tutorial then it will great.

Below is the example I want to build using Graphql.

I pin a GitHub Issue then a GitHub action is initialized that will unpin it.

I use the unpinIssue mutation, but I am not to build a JS file for it.

I have used the same, but i am getting error in the github runner environment

MAIN.js

const CORE = require('@actions/core')
const GITHUB = require('@actions/github')
const GRAPHQL = require('graphql-js')

/**
 * The main function for the issue-pinned.
 * @returns {Promise<void>} Resolves when the action is complete.
 */
async function RunAction() {
  try {
    const GHTOKEN = CORE.getInput('GHTOKEN', { required: true })
    const GHPAYLOAD = GITHUB.context.payload
    const ISSUENODEID = GHPAYLOAD.issue.id
    const GQCLIENT = new GRAPHQL('https://api.github.com/graphql', {
      headers: { Authorization: `Bearer ${GHTOKEN}` }
    })
    const GHMUTATION = `mutation UnpinIssue($issueId: ID!){
      unpinIssue(input: {issueId: $issueId}){
        issue{
          title
        }
      }
    }`

    const variables = { issueId: ISSUENODEID }

    const response = await GQCLIENT.mutate({ GHMUTATION, variables })

    console.log('Issue Unpinned: ', response.unpinIssue.issue.title)
  } catch (error) {
    // Fail the workflow step if an error occurs
    CORE.setFailed(error.message)
  }
}

module.exports = {
  RunAction
}
ISSUE-PINNED.yml

name: Issue Pinned

on:
  issues:
    types:
      - pinned

jobs:
  issue-pinned:
    name: Issue Pinned
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        id: checkout-repository
        uses: actions/checkout@main
      
      - name: Install GraphQL
        id: install-graphql
        if: steps.checkout-repository.outcome == 'success'
        run: npm install graphql

      - name: Unpin the Issue
        id: unpin-issue
        if: steps.install-graphql.outcome == 'success'
        uses: ./.github/actions/issue-pinned
        with:
          GHTOKEN: ${{ secrets.PAT }}
Error in Github Action Environment

3s
Run npm install graphql

added 1 package in 1s
0s
Run ./.github/actions/issue-pinned
  with:
    GHTOKEN: ***
node:internal/modules/cjs/loader:1051
  throw err;
  ^

Error: Cannot find module 'graphql-js'
Require stack:
- /home/runner/work/gh-workflow-build/gh-workflow-build/.github/actions/issue-pinned/dist/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at 3959 (/home/runner/work/gh-workflow-build/gh-workflow-build/.github/actions/issue-pinned/dist/index.js:28522:33)
    at __nccwpck_require__ (/home/runner/work/gh-workflow-build/gh-workflow-build/.github/actions/issue-pinned/dist/index.js:30392:43)
    at 1713 (/home/runner/work/gh-workflow-build/gh-workflow-build/.github/actions/issue-pinned/dist/index.js:28479:17)
    at __nccwpck_require__ (/home/runner/work/gh-workflow-build/gh-workflow-build/.github/actions/issue-pinned/dist/index.js:30392:43)
    at /home/runner/work/gh-workflow-build/gh-workflow-build/.github/actions/issue-pinned/dist/index.js:30414:23
    at /home/runner/work/gh-workflow-build/gh-workflow-build/.github/actions/issue-pinned/dist/index.js:30418:3 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/gh-workflow-build/gh-workflow-build/.github/actions/issue-pinned/dist/index.js'
  ]
}

Node.js v20.8.1

Getting Error “Worker was Destroyed” while loading large sized Pdf

I’m using “ng2-pdf-viewer”: “9.1.5” version

I’m getting Error “Worker was Destroyed” in (error) handling function provided to component from pdf.mjs.

I wanted to say that it is not getting every time replicated, for me i was trying to load the PDF file around 1.25GB from the server URL of the file also it has 1303 pages.

Also even after this error text, file content chunk is getting downloaded as normal, File gets shown after whole content gets downloaded.

For the User convenience we are showing error to the User, but here if we think as user perspective it is wrong as file content download is still in process.

Can any one have faced the same issue, I’m looking for the actual RCA where why the Worker is getting Destroyed.

any detail/help is appreciable from any one.

Thanks

How add tailwindcss in to vue using typescript?

How add tailwindcss in to vue using typescript?
I have run “vue add tailwindcss” and got this error
ERROR Error: ENOENT: no such file or directory, open ‘D:VueJSTSe-commercesrcmain.js’
Error: ENOENT: no such file or directory, open ‘D:VueJSTSe-commercesrcmain.js’

I just use “vue create ” to create the app, not use “vite”. Who can help me?

How do you make an overlay div sticky relevant to a parent div that is horizontally scrollable?

Pretty much whats in the title. I am trying to make those circular buttons to be horizontal scrollable. I also would like to provide some kind of feedback to the user whether there is more to scroll to either direction, so I am trying to do it via the overlay. As of now, the overlays seem to be moving when scrolling, I would like it to stick to the sides of the circular buttons.

Here is the code I tried:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Scrollable Circular Buttons</title>
    <style>
        /* Custom styles */
        .scrollable-div {
            position: relative;
            width: 50%;
            overflow-x: auto;
            white-space: nowrap;
            padding: 10px 0; 
            margin-bottom: 20px;
            /* Hide the scrollbar */
            scrollbar-width: none;
        }
        .scrollable-div::-webkit-scrollbar {
            display: none; /* WebKit (Safari, Chrome) */
        }
        .circular-btn {
            display: inline-block;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #007bff; /* Bootstrap primary color */
            color: #fff;
            text-align: center;
            line-height: 40px;
            margin-right: 5px; /* Reduced margin */
            cursor: pointer;
            font-size: 16px;
        }
        .scroll-overlay {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 50px; /* Adjust as needed */
            pointer-events: none; /* Allow clicks to pass through */
        }
        .scroll-overlay-left {
            left: 0;
            background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);

        }
        .scroll-overlay-right {
            right: 0;
            background: linear-gradient(to left, rgba(0, 0, 0, 0.5), transparent);

        }
        .selected {
            background-color: #28a745 !important; /* Bootstrap success color */
        }
    </style>
</head>
<body>

    <div class="scrollable-div" id="scrollableDiv">
        <!-- List of circular buttons -->
        <div class="circular-btn selected">1</div>
        <div class="circular-btn">2</div>
        <div class="circular-btn">3</div>
        <div class="circular-btn">4</div>
        <div class="circular-btn">5</div>
        <div class="circular-btn">6</div>
        <div class="circular-btn">7</div>
        <div class="circular-btn">8</div>
        <div class="circular-btn">9</div>
        <div class="circular-btn">10</div>
        <div class="circular-btn">11</div>
        <div class="circular-btn">12</div>
        <div class="circular-btn">13</div>
        <div class="circular-btn">14</div>
        <div class="circular-btn">15</div>
        <div class="circular-btn">16</div>
        <div class="circular-btn">17</div>
        <div class="circular-btn">18</div>
        <div class="circular-btn">19</div>
        <div class="circular-btn">20</div>
        <div class="circular-btn">21</div>
        <div class="circular-btn">22</div>
        <div class="circular-btn">23</div>
        <div class="circular-btn">24</div>
        <div class="circular-btn">25</div>
        <div class="circular-btn">26</div>
        <div class="circular-btn">27</div>
        <div class="circular-btn">28</div>
        <div class="circular-btn">29</div>
        <div class="circular-btn">30</div>
        <!-- Scroll overlays to indicate end of content -->
        <div class="scroll-overlay scroll-overlay-left"></div>
        <div class="scroll-overlay scroll-overlay-right"></div>
    </div>

    <script>
        document.addEventListener("DOMContentLoaded", function() {
            const scrollableDiv = document.getElementById('scrollableDiv');
            const scrollOverlayLeft = document.querySelector('.scroll-overlay-left');
            const scrollOverlayRight = document.querySelector('.scroll-overlay-right');

        // Check scroll status on initial load
            updateOverlayVisibility();

        // Update overlay visibility based on scroll position
            scrollableDiv.addEventListener('scroll', updateOverlayVisibility);

            function updateOverlayVisibility() {
                const scrollPosition = scrollableDiv.scrollLeft;
                const scrollWidth = scrollableDiv.scrollWidth;
                overlayWidth = Math.min((scrollPosition / scrollWidth) * 50 , 50);
                scrollOverlayLeft.style.width = overlayWidth + ' px';
                scrollOverlayRight.style.width = overlayWidth + ' px';
                scrollOverlayLeft.style.display = scrollPosition > 0 ? 'block' : 'none';
                scrollOverlayRight.style.display = scrollPosition < scrollWidth ? 'block' : 'none';

            }

        // JavaScript for circular button selection
            const circularButtons = document.querySelectorAll('.circular-btn');

            circularButtons.forEach(function(btn) {
                btn.addEventListener('click', function() {
                // Remove 'selected' class from all buttons
                    circularButtons.forEach(function(btn) {
                        btn.classList.remove('selected');
                    });
                // Add 'selected' class to the clicked button
                    this.classList.add('selected');
                });
            });
        });
    </script>
</body>
</html>

Thanks!

“100 Birds of the World” – JavaScript – code.org – Not Displaying Value From DropDown menu [closed]

So basically I have a screen where depending on the color dropdown and conservative dropdown there is a on event when the user clicks the search button and after that there is a function in the on event that checks for the colorof the bird that the user selected and the conservative status dropdown selection the user selected for and then in that for loop wiht parameters it appends the item to the empty list from earlier and that is set on the output to “colorConsvOutput”, the default is select for both the drop downs, if there is no such thing for the combinations of the data then it should print no such bird. So I need help updating the program I am using a app lab “Java Script” with the Data table named “100 birds of the world”. I have most of the code done, but its not working properly on the App screen.

I am looking for a person that could help me in the meeting.

React(Vite) web app runs on localhost but when I deploy it to vercel, I get a blank page

When I try to access the website from my browser I get this error in the console:
index-3d1f8e86.js:126 Uncaught TypeError: fw.div is not a function at index-3d1f8e86.js:126:916 and blank page.
When I try to check logs on vercel I get none.

I have git repository with the folder structure which looks like this:
folder structure

My vercel.json file is found in the client folder and looks like this:

{
    "rewrites": [
      {
        "source": "/(.*)",
        "destination": "/"
      }
    ]
  }

Vite.config.js file also resides in the client folder and it looks like this:

/** @type {import('tailwindcss').Config} */
export default {
  content: [
    "./index.html",
    "./src/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {
      colors: {
        'light-blue-primary': '#4AC9FF',
        'light-blue-secondary':'#1098F7',
        'dark-blue-primary': '#001F3F',
        'dark-blue-secondary': '#0059A3',
        'light-green-primary': '#77D353',
        'light-green-secondary': '#47A620',
        'dark-green-primary': '#217F24',
        'dark-green-secondary': '#3EAB4D',
      },
      fontFamily:{
        titleFont: ['Poppins', 'sans-serif']
      }
    },
  },
  plugins: [],
}

During deployment I chose build framework to be “Vite” and the root directory to be WEB-DEVELOPMENT/web-app/client. I left other things to be default.

Can someone please help me figure out how I will solve the problem?

Correct use of Javascript map function [duplicate]

I am trying to use map function in my code, but I am afraid that I am making some silly mistakes. It just does not work!

Here is my code. I have 2 buttons captioned “ID” and “Text”. Clicking them should show the list of IDs and texts of the input field. The program works fine until the map.

Can you Gurus help me understand my mistake?

<!DOCTYPE html>
<html>
    <head>
        <script>
            getID = (x) => x.id;
            getText = (x) => x.value;
            function Click(x) {
                input = document.getElementsByTagName("input");
                alert(input.map((x.id == "id") ? getID : getText));
            }
        </script>
    </head>
    <body>
        <input type="input" id="input1"> </input>
        <input type="input" id="input2"> </input>
        <button id="id" onclick="Click(this)"> ID </button>
        <button id="text" onclick="Click(this)"> Text </button>
    </body>
</html>

cannot set properties in undefined setting [duplicate]

Why i am getting cannot set properties of undefined setting (background color) in JavaScript code.

let btn = document.querySelector('button');
let h1 = document.querySelector('h1');
let h2 = document.querySelector('h2');
let p = document.querySelector('p');

function changeColor () {
    console.dir(this.innerText);
    this.style.backgroundColor = "blue";
}

btn.addEventListener("click", changeColor());

h1.addEventListener("click", changeColor());

h2.addEventListener("click", changeColor());

p.addEventListener("click", changeColor());

Javascript Document.evalute failing with ‘name()’ in XPath

I am attempting to use the Javascript Document evaluate function with valid XPath that uses the name() / local-name() function but am consistently getting the following error in Jfiddle:

The string '/foods/*[position()=1</a>/local-name()' is not a valid XPath expression

It is unclear how or why the </a> fragment is introduced

Sample code is as follows:

const xml = "<foods><meat>chicken</meat><fruit>orange</fruit><fruit>apple</fruit><fruit>banana</fruit></foods>";

const doc = new DOMParser().parseFromString(xml,'application/xml');

for ( var i = 0 ; i < 4; i++ ){
const xpath = `/foods/*[position()=${i+1}]`;
const xpathValue = document.evaluate(
  xpath,
  doc,
  null,
  XPathResult.STRING_TYPE,
  null
);
const xpathName = document.evaluate(
  `${xpath}/local-name()`,
  doc,
  null,
  XPathResult.STRING_TYPE,
  null
);

console.log(`${xpathName.stringValue} = ${xpathValue.stringValue}`);
}

The XPath evalutaing the value works fine, just not the node name. Any assistance would be appreciated.