Why does password_hash() gives me a fatal error? [duplicate]

I’m coding a website with a DB for register/login purposes.
I’ve got the setup of the DB and the connection figured out, but hashing the password is my main problem, at the moment.

For some reason, it doesn’t work and I’m out of ideas to the reason.

The code for the connection to the DB and for hashing (ignore the comments):
(I’m using PHP 8.4.7)

<?php

session_start();
require_once 'server.php';  #conectar á BD

if(isset($_POST ['criar_conta'])){  #se o botão de registar foi clicado: 
    $nome = $_POST['username'];
    $email = $_POST['email'];
    $password = password_hash($_POST['password'],  PASSWORD_DEFAULT);

    $verEmail = $conn->query("SELECT email FROM login  WHERE email = '$email'");  #verificar se o email inserido não está na BD
    if ($verEmail-> num_rows > 0) { 
        $_SESSION['erro_registo'] = 'Email já foi registado'; # se estiver, informa o user mas não continua o processo e nao poe na BD
        $_SESSION['active_form'] = 'registo';
    } else {
        $conn->query("INSERT INTO login (nome, email,  password) VALUES('$nome', '$email',  '$password')"); #se o email nao estiver na BD, insere todos os dados fornecidos na BD
    }
    
    header("Location: pagina-login.php"); #apos isto tudo, redireciona para a pagina de login
    exit();
}
?>

I think it’s also worth noting, that in VSCODE, the “PASSWORD_DEFAULT” doesn’t turn any color, its white as if its not recognized.

When I try to insert data into the DB, the webpage redirects me to this error:

“Fatal error: Call to undefined function password_hash() in
C:xampphtdocsWebsite-PAPregisto-data.php on line 9”

(Website-PAP is the name of the folder I’m using to save the project, not a library)

Any help would be appreciated.

Reinstalling PHP;
Read the password_hash manual from PHP and found nothing wrong;
No typos.

php cURL having issues with special characters in passwords

I’m encountering an issue with 2 separate API providers who are insisting this is a problem in our code. Maybe so, but I am not sure what else I need to do here.

Say a user has a password of abc%123. Normally when posting with cURL it handles the encoding.

The cURL code is pretty straight forward:

    $params = [
      'userid' => $_POST['username'],
      'userpw' => $_POST['password']
    ];
    $url = 'https://api-service.com/whatever';
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

    $headers = array("Content-Type: application/json");
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    
    $data = json_encode(array('data' => $params));
    
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, true);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
    
    $resp = curl_exec($curl);
    curl_close($curl);
    
    $response = json_decode($resp);

The error I get back, which is specific to the services, more or less say “The submission failed because it contained non-standard characters. Please contact the website administrator to request that they update the settings to allow submission of non-standard characters.”

It sounds like they are asking for the password to be urlencoded. When I do that, it accepts the transport, but then errors saying the password is incorrect as though it is literally reading my posted password as “abc%25123”

Am I missing something here? Some cURL setting or header setting that I just somehow didn’t know about after all these years? To me this seems like the service is disallowing special characters and they need to handle that case, but they both separately insist this is not the case. Any ideas?

Capacitor build error. Cause: java.nio.file.InvalidPathException: Illegal char at index 38

I’ve been stuck with problem for the past 2 days. no progress whatsoever.

I tried removing platform. adding platform

gradle version upgrade..

literally everything

I don’t even know what’s causing the issue.

If it’s a plugin issue or a configuration issue or an app icon

these are what i’ve tried:

  1. Removed and re-added android platform (cordova platform rm android && cordova platform add android)

  2. Deleted .gradle/, build/, node_modules/, platforms/ and reinstalled everything

  3. Upgraded Gradle version to 8.11.1 and wrapper distribution to gradle-8.11.1-all.zip

  4. Tried running with:

    ./gradlew clean
    ./gradlew assembleDebug --refresh-dependencies --no-daemon

  5. Ensured Android Studio is not in offline mode

  6. Downgraded/Upgraded Capacitor plugins

  7. Verified res/values/strings.xml — no visible typos or special characters

 FAILURE: Build failed with an exception.
[capacitor]
[capacitor]         * What went wrong:
[capacitor]         Execution failed for task ':app:mergeDebugResources'.
[capacitor]         > A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
[capacitor]         > Resource compilation failed (Failed to compile values resource file D:AppandroidappbuildintermediatesincrementaldebugmergeDebugResourcesmerged.dirvaluesvalues.xml. Cause: java.nio.file.InvalidPathException: Illegal char <:> at index 38: com.package.app-mergeDebugResources-59:/values/values.xml). Check logs for more details.
follwoing is my package.json 

{
  "name": "app",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "lint": "ng lint",
    "android": "ionic capacitor run android --livereload --external"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^16.2.8",
    "@angular/cdk": "^16.2.8",
    "@angular/common": "^16.2.8",
    "@angular/compiler": "^16.2.8",
    "@angular/core": "^16.2.8",
    "@angular/forms": "^16.2.8",
    "@angular/google-maps": "^19.0.4",
    "@angular/material": "^16.2.8",
    "@angular/platform-browser": "^16.2.8",
    "@angular/platform-browser-dynamic": "^16.2.8",
    "@angular/router": "^16.2.8",
    "@awesome-cordova-plugins/android-permissions": "^6.4.0",
    "@awesome-cordova-plugins/barcode-scanner": "^6.4.0",
    "@awesome-cordova-plugins/camera": "^6.14.0",
    "@awesome-cordova-plugins/core": "^6.4.0",
    "@awesome-cordova-plugins/diagnostic": "^6.14.0",
    "@awesome-cordova-plugins/file": "^6.4.0",
    "@awesome-cordova-plugins/flashlight": "^6.4.0",
    "@awesome-cordova-plugins/in-app-browser": "^6.3.0",
    "@awesome-cordova-plugins/in-app-update": "^6.4.0",
    "@awesome-cordova-plugins/launch-navigator": "^6.4.0",
    "@awesome-cordova-plugins/network": "^6.4.0",
    "@awesome-cordova-plugins/ocr": "^6.4.0",
    "@awesome-cordova-plugins/toast": "^6.14.0",
    "@byteowls/capacitor-filesharer": "^6.0.0",
    "@capacitor-community/contacts": "^6.1.1",
    "@capacitor-community/image-to-text": "^7.0.0",
    "@capacitor/android": "^7.2.0",
    "@capacitor/app": "^7.0.0",
    "@capacitor/app-launcher": "^7.0.0",
    "@capacitor/browser": "^7.0.0",
    "@capacitor/camera": "^7.0.0",
    "@capacitor/core": "^7.0.0",
    "@capacitor/device": "^7.0.0",
    "@capacitor/filesystem": "^7.0.0",
    "@capacitor/haptics": "^7.0.0",
    "@capacitor/keyboard": "^7.0.0",
    "@capacitor/network": "^7.0.0",
    "@capacitor/screen-orientation": "^7.0.0",
    "@capacitor/share": "^7.0.0",
    "@capacitor/status-bar": "^7.0.0",
    "@ionic-native/android-fingerprint-auth": "^5.36.0",
    "@ionic-native/android-permissions": "^5.36.0",
    "@ionic-native/app-version": "^5.36.0",
    "@ionic-native/base64-to-gallery": "^5.36.0",
    "@ionic-native/camera": "^5.36.0",
    "@ionic-native/camera-preview": "^5.36.0",
    "@ionic-native/contacts": "^5.36.0",
    "@ionic-native/core": "^5.36.0",
    "@ionic-native/device": "^5.36.0",
    "@ionic-native/file": "^5.36.0",
    "@ionic-native/flashlight": "^5.36.0",
    "@ionic-native/geolocation": "^5.36.0",
    "@ionic-native/http": "^5.36.0",
    "@ionic-native/launch-navigator": "^5.36.0",
    "@ionic-native/location-accuracy": "^5.36.0",
    "@ionic-native/native-geocoder": "^5.36.0",
    "@ionic-native/navigation-bar": "^5.36.0",
    "@ionic-native/network": "^5.36.0",
    "@ionic-native/open-native-settings": "^5.36.0",
    "@ionic-native/photo-library": "^5.36.0",
    "@ionic-native/qr-scanner": "^5.36.0",
    "@ionic-native/screenshot": "^5.36.0",
    "@ionic-native/sms-retriever": "^5.36.0",
    "@ionic-native/social-sharing": "^5.36.0",
    "@ionic-native/status-bar": "^5.36.0",
    "@ionic-native/toast": "^5.36.0",
    "@ionic-native/touch-id": "^5.36.0",
    "@ionic-native/video-player": "^5.36.0",
    "@ionic/angular": "^8.3.1",
    "@ionic/cordova-builders": "^10.0.0",
    "@ionic/storage": "^4.0.0",
    "@ionic/storage-angular": "^4.0.0",
    "@ngx-translate/core": "^15.0.0",
    "@ngx-translate/http-loader": "^8.0.0",
    "@zxing/browser": "^0.1.4",
    "@zxing/library": "^0.20.0",
    "capacitor-native-biometric": "^4.2.2",
    "capacitor-resources": "^2.0.5",
    "cordova-plugin-contacts": "^3.0.1",
    "cordova-plugin-file": "^8.1.3",
    "cordova-plugin-statusbar": "^4.0.0",
    "cordova-plugin-x-socialsharing": "^6.0.4",
    "crypto-js": "^4.2.0",
    "easyqrcodejs": "^4.6.1",
    "es6-promise-plugin": "^4.2.2",
    "file-saver": "^2.0.5",
    "html2canvas": "^1.4.1",
    "ionicons": "^7.0.0",
    "jetifier": "^2.0.0",
    "js-sha512": "^0.9.0",
    "jsbarcode": "^3.11.5",
    "jsencrypt": "^3.3.2",
    "localforage-cordovasqlitedriver": "^1.8.0",
    "ng-otp-input": "^1.9.3",
    "rxjs": "^7.8.1",
    "svg-country-flags": "^1.2.10",
    "swiper": "^10.3.1",
    "tslib": "^2.6.2",
    "util": "^0.12.5",
    "zone.js": "~0.14.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^16.2.5",
    "@angular-eslint/builder": "^16.2.0",
    "@angular-eslint/eslint-plugin": "^16.2.0",
    "@angular-eslint/eslint-plugin-template": "^16.2.0",
    "@angular-eslint/schematics": "^16.2.0",
    "@angular-eslint/template-parser": "^16.2.0",
    "@angular/cli": "^16.2.5",
    "@angular/compiler-cli": "^16.2.8",
    "@angular/language-service": "^16.2.8",
    "@capacitor/assets": "^3.0.5",
    "@capacitor/cli": "^7.0.0",
    "@ionic/angular-toolkit": "^10.0.0",
    "@types/crypto-js": "^4.2.1",
    "@types/googlemaps": "^3.43.3",
    "@types/jasmine": "~5.1.0",
    "@types/node": "^20.8.10",
    "@typescript-eslint/eslint-plugin": "6.7.5",
    "@typescript-eslint/parser": "6.7.5",
    "autoprefixer": "^10.4.19",
    "cordova-android": "^12.0.1",
    "cordova-plugin-actionsheet": "^2.3.3",
    "cordova-plugin-android-fingerprint-auth": "^1.5.0",
    "cordova-plugin-android-permissions": "^1.1.5",
    "cordova-plugin-app-version": "^0.1.14",
    "cordova-plugin-camera": "^8.0.0",
    "cordova-plugin-camera-preview": "^0.12.3",
    "cordova-plugin-device": "2.1.0",
    "cordova-plugin-dialogs": "^2.0.2",
    "cordova-plugin-flashlight": "github:EddyVerbruggen/Flashlight-PhoneGap-Plugin",
    "cordova-plugin-geolocation": "^5.0.0",
    "cordova-plugin-mobile-ocr": "^3.1.3",
    "cordova-plugin-nativegeocoder": "^3.5.1",
    "cordova-plugin-navigationbar": "^1.0.31",
    "cordova-plugin-qrscanner": "^3.0.1",
    "cordova-plugin-request-location-accuracy": "^2.3.0",
    "cordova-plugin-sms-retriever-manager": "^1.0.4",
    "cordova-sqlite-storage": "^6.1.0",
    "cordova.plugins.diagnostic": "^7.1.3",
    "eslint": "^8.51.0",
    "eslint-plugin-import": "2.28.1",
    "eslint-plugin-jsdoc": "46.8.2",
    "eslint-plugin-prefer-arrow": "1.2.3",
    "jasmine-core": "~5.1.1",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "~6.4.2",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.1",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "onesignal-cordova-plugin": "^5.2.7",
    "postcss": "^8.4.38",
    "tailwindcss": "^3.4.3",
    "ts-node": "^10.9.1",
    "typescript": "~5.0.0",
    "uk.co.workingedge.phonegap.plugin.launchnavigator": "^5.0.6"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-sms-retriever-manager": {
        "PLAY_SERVICES_VERSION": "15.0.1"
      },
      "cordova-sqlite-storage": {},
      "cordova-plugin-nativegeocoder": {},
      "cordova-plugin-geolocation": {
        "GPS_REQUIRED": "true"
      },
      "cordova-plugin-navigationbar": {},
      "cordova.plugins.diagnostic": {
        "ANDROIDX_VERSION": "1.0.0",
        "ANDROIDX_APPCOMPAT_VERSION": "1.3.1"
      },
      "uk.co.workingedge.phonegap.plugin.launchnavigator": {
        "GOOGLE_API_KEY_FOR_ANDROID": "xx",
        "OKHTTP_VERSION": "3.12.0"
      },
      "cordova-plugin-youtube-video-player": {},
      "cordova-plugin-app-version": {},
      "cordova-plugin-android-fingerprint-auth": {},
      "cordova-plugin-android-permissions": {},
      "cordova-plugin-camera-preview": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-tesseract": {},
      "cordova-plugin-mobile-ocr": {},
      "cordova-plugin-flashlight": {},
      "onesignal-cordova-plugin": {},
      "cordova-plugin-request-location-accuracy": {
        "PLAY_SERVICES_LOCATION_VERSION": "16.+"
      },
      "cordova-plugin-qrscanner": {}
    },
    "platforms": [
      "android"
    ]
  }
}

PDF generated with Puppeteer is corrupted and shows binary data when opened as text

I’m using Node.js with Express and Puppeteer to generate PDFs from HTML content. The PDF file gets generated and saved, but when I try to open it with a PDF reader, it appears corrupted. When I open the PDF file in a text editor like Notepad, it displays something like this:

0,”189253″:48,”189254″:48,”189255″:48,”189256″:48,”189257″:49,”189258″:56,”189259″:48,”189260″:52,”189261″:54,…

What could be causing this issue? Are there any known breaking changes or common pitfalls after Puppeteer updates that could lead to corrupted PDF output? How can I troubleshoot or fix this problem to correctly generate and save PDFs again?

Close dialog box when button is clicked

In “Incident” form there is a field called “AI” with yes and no option if “Yes” is selected , dialog box will open with “Acknowledged” button. If Acknowledged button is clicked the dialog box should close but its not closing.

Using “On change” Client script:

var fullMessage = message + "<br><br><button type='button' onclick='closeDialog()' class='btn btn-primary'>Acknowledge</button>";
    dialog.setBody(fullMessage);

    window.closeDialog = function () {
      dialog.destroy();
    };

    dialog.render();
  }
}

When I click the Acknowledged button the dialog box should close.

Why doesn’t my JavaScript code append rows to the HTML table on page load? [closed]

Why doesn’t this work?

document.addEventListener("DOMContentLoaded",() => {
    const students = data.map(student => createStudent(student))
    students.forEach(el => document.getElementById("tartalom").appendChild(el))
})

function createStudent(student){    
    const tr = document.createElement("tr")

    const nevTd = document.createElement("td")
    nevTd.textContent = student.nev
    tr.appendChild(nevTd)

    const osztalyTd = document.createElement("td")
    osztalyTd.textContent = student.osztaly
    tr.appendChild(osztalyTd)

    const korTd = document.createElement("td")
    korTd.textContent = student.kor
    tr.appendChild(korTd)

    const torlesTd = document.createElement("td")
    torlesTd.innerHTML = "<button class='btn btn-danger'>Törlés</button>"
    tr.appendChild(torlesTd)

    return tr
}

const data = [
    { "id": 1, "nev": "Kovács Anna", "osztaly": "10.A", "kor": 16 },
    { "id": 2, "nev": "Nagy Péter", "osztaly": "11.B", "kor": 17 },
    { "id": 3, "nev": "Szabó Eszter", "osztaly": "9.C", "kor": 15 },
    { "id": 4, "nev": "Varga Dániel", "osztaly": "12.A", "kor": 18 },
]
<table id='tartalom'></table>

Input field to have two buttons: add and average where the user can click on each to add a number and find the average too

I am trying to create an input field with two buttons one for add and the other for
average in which when a user clicks on the add it will add numbers and the other button will find the average.

Below is the html code

<center>

    <input type="text" id="result">

    <br> <br>

    <button onclick="add_more()">Add</button>

    <button on click="aver()">Add</button>

    

Below is the java script

  <script>

    function add_more(){
        
        // Get user inputs

        var Addon = document.getElementById('result').value

        console.log(Addon)


    }

  </script>

How can I get handle the situation when window.scrollY to be 0?

I’m now using throttle to optimize the window’s scroll event, but sometimes I scroll to the top too fast and cannot get the window.scrollY to be 0

  function throttle(fn, delay) {
let timer = null
return function(...args) {
  if(timer == null) {
    timer = setTimeout(() => {
      fn.apply(this, args)
      clearTimeout(timer)
      timer = null
    }, delay)
  }
}
  }

function handleScroll() {
  if(window.innerWidth >= 1024) {
    const currentScroll = window.scrollY
    console.log('currentScroll'+'----------------------------------'+currentScroll)
    if(currentScroll === 0) {
      stickyHeader.style.top = '40px'
      announcementBar.style.top = '0'
      blogHeader.style.top = '100px'
    } else if (currentScroll > lastScroll) {
      blogHeader.style.top = '0px'
      stickyHeader.style.top = '-60px'
      announcementBar.style.top = '-40px'
    } else if (currentScroll < lastScroll) {
      blogHeader.style.top = '60px'
      stickyHeader.style.top = '0px'
    }
    lastScroll = currentScroll;
  }
}
window.addEventListener("scroll", throttle(handleScroll, 250), { passive: true })

I hope when i scroll to the top, I can get the window.scrollY to be 0 while using throttle

Text in the png texture appears blurry when applied to 3d model in threejs preview in windows chrome

I’ve a 3d model for shot glass(glb), which has a named material for populating textures dynamically from JS.

I traverse through the objects in the scene object and when I find the required node/mesh, I do the following to update the texture on the fly from JS.

childMesh.material.map = texture;
childMesh.material.map.flipY = false;
childMesh.material.needsUpdate = true;

When the texture has transparency and also text, the text shows up blurry on the 3d model. The issue is more pronounced in windows for some reason! It is fine if I use the same png image in blender. Below are the screenshots of threejs in windows and mac at a browser resolution of ~1366x610px

Preview in Windows chrome – text is blurry:
Preview in Windows chrome - text is blurry

Preview in Mac chrome – text is legible but can do better:
Preview in Mac chrome - text is legible but can do better

Blender:
blender

Original texture with transparency and text:
shotglass lowres

ThreeJS version: 0.162.0
Chrome version: 136.0.7103.49 (Official Build) (64-bit) (cohort: M131 Rollout)

Here’s where it gets interesting! If the texture doesn’t have transparency, the text is better. The below are the screenshots and the original texture

Windows chrome – little better:

enter image description here

Mac chrome – no issues I guess:
enter image description here

Blender:
enter image description here

Original texture with solid background, no transparency:
enter image description here

Here’s what I’ve tried so far, with no avail:

  1. Up the anisotropy using childMesh.material.map = renderer.capabilities.getMaxAnisotropy(); childMesh.material.needsUpdate = true;
  2. Changed all possible minFilters and magFilters
  3. Using a higher resolution texture to begin with. I tried till ~1720x1300px height but no use
  4. antialias is already true while creating WebGLRenderer

I’m sorry, I cannot provide the glb here as it is owned by the client.
The code I’ve is almost similar to Online GLTF Viewer by Don McCurdy

How can I find a reliable debt collection lawyer near me?

To find a reliable debt collection lawyer near you, start by searching online for local attorneys who specialize in debt recovery. Look for firms with strong reviews, proven success in handling similar cases, and experience with both creditors and debtors. Many lawyers offer free consultations, which can help you understand your legal options and fees before committing. You can also check local bar association directories or ask for referrals from business associates or friends.

Inspect shows Charset Encoding of ISO even when i have mentioned UTF-8 in all files

When i open the menu of my web application, i use inspect > network tab and see that pdamnu.do file has charset encoding of ISO.
Now in my pdamnu.jsp i have mentioned the encoding of utf-8

<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file = "/common/Include.jsp" %>
<%@ page import="bancmate.common.web.SessionHandler"%>
<%@ page import="java.util.*"%>
<%StringBuilder cssMenu = null ;%>
<%
String broadCast = null ; 
     if(session.getAttribute("BroadCast")!=null){
      broadCast = (String)session.getAttribute("BroadCast") ;
      broadCast = broadCast + "n";
      System.out.println("------------>>>>>>>>>>>>>>>>>>  "+broadCast);
     }
%>
    
<script>
    var cssMenujs="";
       var menu=sessionStorage.getItem('cssMenuLocal') || false;
       console.log("session storage get n"+menu);
       if(menu){
           <%
           cssMenu=new StringBuilder("<script>document.writeln(menu);</script>");
         System.out.print("if ok n"+cssMenu);
         %>
         console.log("session storage get menu set");
       }else{
           
        var url="<%=request.getContextPath()%>/menu/Pdamnu.do";
        var xhttp = new XMLHttpRequest();
            
        xhttp.onreadystatechange = function() {
                if (this.readyState == 4 && this.status == 200) {
                            console.log("In response");
                            cssMenujs = xhttp.responseText;
                            console.log("1");
                            cssMenujs = eval("cssMenujs");
                            console.log("2");
                                if(cssMenujs!=null)
                                {
                                    sessionStorage.setItem('cssMenuLocal',cssMenujs);
                                    console.log("session storage set n"+cssMenujs);
                                    <%
                                        cssMenu=new StringBuilder("<script>document.writeln(cssMenujs);</script>");
                                        System.out.print("n else ok n"+cssMenu);
                                    %>
                                }
                        }
                
        };
        xhttp.open("POST",url,false);
            xhttp.send();
    }
    if(cssMenujs=="" || !cssMenujs)
    {
        cssMenujs=eval("menu");
    }
</script>
<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
        
         <!-- All CSS links -->

            <link rel = "stylesheet" href="<%=request.getContextPath()%>/jsp/css/style.css"  type = "text/css">
            <link rel="stylesheet" href="<%=request.getContextPath()%>/jsp/css/style-2.css" type="text/css"/>

            <!-- SmartMenus core CSS (required) -->
            <link href="<%=request.getContextPath()%>/jsp/css/sm-core-css.css" rel="stylesheet" type="text/css" />

            <!-- "sm-blue" menu theme -->
            <link href="<%=request.getContextPath()%>/jsp/css/sm-blue.css" rel="stylesheet" type="text/css" />

            <!--Css for slider-->
            <link href="<%=request.getContextPath()%>/jsp/css/js-image-slider.css" rel="stylesheet" type="text/css" />

        <!-- End of CSS links -->


        <!-- All jQueries links -->

            <!-- <script language=JavaScript src = "<%=request.getContextPath()%>/jsp/js/jquery-1.3.1.min.js" ></script>
            <script language=JavaScript src = "<%=request.getContextPath()%>/jsp/js/jquery1.js"></script>
            <script language=JavaScript src="<%=request.getContextPath()%>/jsp/js/jquery.dropdownPlain.js"></script> -->

            <script language=JavaScript src = "<%=request.getContextPath()%>/jsp/js/hammer.js"></script>
        
            <!-- jQuery -->
            <script type="text/javascript" src="<%=request.getContextPath()%>/jsp/js/jquery.js"></script>

            <!-- SmartMenus jQuery plugin -->
            <script type="text/javascript" src="<%=request.getContextPath()%>/jsp/js/jquery.smartmenus.js"></script>

            <!-- SmartMenus jQuery Keyboard Addon -->
            <script type="text/javascript" src="<%=request.getContextPath()%>/jsp/js/jquery.smartmenus.keyboard.js"></script>

            <!--JS for slider-->
            <script src="<%=request.getContextPath()%>/jsp/js/js-image-slider.js" type="text/javascript"></script>
 
        <!-- End of JQueries links -->
        <style>
        #main-menu>li>ul{display:block!important;
        width:100%;}
        </style>

<script>
    var outIn = 'in';
    
    $(document).ready(function(e) {
    
    var startX, curX, startY, curY; // Variables
    var newXScroll, newYScroll, genXScroll; // More Variables!
    
    // Change the height of the sidebar, as well as a few things to do with the main content area, so the user
    // can actually scroll in the content area.
    function sideBarHeight() { 
    
        var docHeight = $(document).height();
        var winHeight = $(window).height();
        
        $('.slide-in').height(winHeight);
        $('#main-container').height(winHeight);
        $('#sub-container').height($('#sub-container').height());
    } 
    
    sideBarHeight();
    
    var outIn = 'in';
    
    Hammer(document.getElementById('main-container')).on('swiperight', function(e) {
            //$('.slide-in').toggleClass('on');     
            //$('#main-container').toggleClass('on');
            //outIn = 'out';
            
    });
    
    Hammer(document.getElementById('main-container')).on('swipeleft', function(e) {
            $('.slide-in').toggleClass('on');   
            $('#main-container').toggleClass('on');
            outIn = 'in';
    });
    
    
    function runAnimation() {
        if(outIn == 'out') {
            document.getElementById("main-menu").style.display="block";
            $('.slide-in').toggleClass('on');
            $('#main-container').toggleClass('on'); 
            outIn = 'in';
            
        } else if(outIn == 'in') {
        
            $('.slide-in').toggleClass('on');   
            $('#main-container').toggleClass('on'); 
            outIn = 'out';
            
        }
    
    }
    
    $('.menu-icon')[0].addEventListener('touchend', function(e) {

        $('.slide-in').toggleClass('on');       
        $('#main-container').toggleClass('on');
    });
    
    $('.menu-icon').click(function() {      
        //$('.slide-in').toggleClass('on');     
        //$('#main-container').toggleClass('on');
    });
    
    

    });



</script>

        <!-- SmartMenus jQuery init -->
            <script type="text/javascript">
                $(function() {
                $('#main-menu').smartmenus({
                subMenusSubOffsetX: 1,
                subMenusSubOffsetY: -8
            });
                
                        
            $('#main-menu').smartmenus('keyboardSetHotkey', '123', 'shiftKey');
            });
            </script>


        

    
        <!-- #main-menu config - instance specific stuff not covered in the theme -->
        <style type="text/css">
        /*@media screen and (min-width: 768px) {
        #main-menu {
            position:relative;
            z-index:9999;
            width:230px;
            margin-top:0px;
            display:block;
            
        }*/
        /*#main-menu ul {
            width:12em; /* fixed width only please - you can use the "subMenusMinWidth"/"subMenusMaxWidth" script options to override this if you like */
        }
    }
</style>
        <script type="text/javascript">
        function formopen(menunext) {
                var url = "/BancMate/servlet/bancmate.common.menu.servlet.PdaMenuServlet?mnunext="+ menunext+"&Opentype=F&index=0&connectFrm=M&newMenu=Y" ;
                document.forms[0].action=""+url;
                document.forms[0].method="post";
                document.forms[0].submit();
                return ;
            }

    function callmenu() {
 $('.slide-in').toggleClass("on");
     $('#main-container').toggleClass("on");
     count = 1;
    }
    var count;
function check(){
//  debugger;
    if(count==1){
//  $('.slide-in').toggleClass("on");
    }
    if(document.getElementById("main-menu").style.display=="block" )
    {
    //  document.getElementById("main-menu").style.display="none";
//  if(document.getElementById("sm-15865158296919065-1")==true){
//      document.getElementById("main-menu").style.display="none";
//      document.getElementById("menuDiv").style.display="none";
//  }
        document.getElementById("right").src="<%=request.getContextPath()%>/jsp/images/right.jpg";
    //  document.getElementById("menuDiv").style.display="none";    
        count =2;
    }
    else 
    {
        document.getElementById("main-menu").style.display="block";
        document.getElementById("right").src="<%=request.getContextPath()%>/jsp/images/left1.jpg";
        document.getElementById("menuDiv").style.display="block";
        count =2;
    }

}
</script>

</head>
    <body style="width:1200px;height:200px;overflow-y:hidden;" onload="callmenu()">
        <form>
        
            <div>
                        
              <div id="main-container" class="tk-chaparral-pro">

             
              </div>
            
              <div class="menu-icon" onclick="check()" title="Main-Menu">
               <a href="#" tabindex="1" id="imglnk"><img
                 src="<%=request.getContextPath()%>/jsp/images/right.jpg" id="right"
                 style="width: 10%; height: 10%;" role="button"></a>        
               </div> 
               
              <div id="menuDiv" class="slide-in" style="display:block;height:100%;" onclick="check()" title="Main-Menu" >
            <div id="menuHtmlContent"></div>

<script>
  var menu = sessionStorage.getItem('cssMenuLocal');
  if (menu) {
    document.getElementById("menuHtmlContent").innerHTML = menu;
  } else {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function () {
      if (this.readyState == 4 && this.status == 200) {
        var menuHTML = this.responseText;
        sessionStorage.setItem('cssMenuLocal', menuHTML);
        document.getElementById("menuHtmlContent").innerHTML = menuHTML;
      }
    };
    xhttp.open("POST", "<%=request.getContextPath()%>/menu/Pdamnu.do", true);
    xhttp.send();
  }
</script>

              </div>
            
             <div style=" border: 5px solid #495566; width: 35%; height: 200px; margin-top: 10%; margin-left: 40%;border-radius:10px;">
               <center>
               <B><h2 style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;color:blue;">Message</h2></B>
               <!--<input type="button" value="check" name="check" onclick="pdamenu()"/>-->
               <MARQUEE  behavior="alternate" style="margin-top:18%;" SCROLLDELAY=150>
               <%if(broadCast!=null){%>
               <B><%= broadCast %></B>
               <%}%>
               </MARQUEE>
               </center>
               </div>
               
               
               
              </div>
             
        </form>
</body>
</html>

and then in include.jsp as well it has utf-8 encoding.
In the doFilter also i have added the utf-8 encoding:

public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain chain) throws IOException, ServletException {
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        response.setContentType("text/html; charset=UTF-8");
        BMLogger logger = new BMLogger(BMIbFilter.class);
        HttpServletRequest httpRequest = (HttpServletRequest)request;
        logger.info("Filter Called for : " + httpRequest.getRequestURI());
        logger.info("Session Value is : " + httpRequest.getSession(false));

I have two folders, one is war which has frontend files and jar which has backend files and backend is in eclipse which also has default encoding of utf-8 and front end which is in vscode also have default utf-8.
i was trying to display hindi language but it shows question marks instead of hindi. and that is when i inspected and saw the encoding of iso in network tab.
some of the other pages show hindi perfectly and they also have utf-8 encoding in the network tab. except the menu (pdamnu.do) which shows the iso encoding in inspect network tab.

I have tried the page encoding in the jsp file. and i also added the response.setContent in filter to utf-8
In another file in MenuPdaAction i have added response.setContent like this:

if((mySession.getAttribute("cssMenu")==null)||(mySession.getAttribute("cssMenu").equals("")))
                {
                    System.out.println("New Menu Creating");
                    cssMenu = menuRemote.getCSSMenuTree(suserid, sustid, "  ", lang.intValue(), loginParameter);
                    response.setContentType("text/html; charset=UTF-8");
                    response.setCharacterEncoding("UTF-8");
                    mySession.setAttribute("cssMenu",cssMenu);
                    mySession.setAttribute("nextlvl",null);
                }
                else
                {
                        System.out.println("Existing menu get");
                        cssMenu=(StringBuilder)mySession.getAttribute("cssMenu");
                }
                 target = "success";
                 PrintWriter out = response.getWriter();
                 sCssMenu = cssMenu.toString().replace("'","&quot;");
            //      out.write(sCssMenu);  
                    out.print(sCssMenu);
                    out.flush();
                    return null;
                //  out.close();
             }

i tried removing replace() if it was messing with encoding but no results. Also my database written content of hindi seems to be in utf-16. i tried changing jsp and java files to utf-16 but no results. i cant change database content to utf-8.

IllegalViewOperationException – Trying to update non-existent view with tag during rapid D-pad input

I’m encountering a fatal crash on Android TV in a React Native app when rapidly navigating using the D-pad (Up, Down, Left, Right, OK, Back). The app occasionally throws the following exception:

Fatal Exception: com.facebook.react.uimanager.IllegalViewOperationException: Trying to update non-existent view with tag 6445
at com.facebook.react.uimanager.UIImplementation.updateView(UIImplementation.java:287)
at com.facebook.react.uimanager.UIManagerModule.updateView(UIManagerModule.java:505)
at com.facebook.react.uimanager.ReanimatedUIManager.updateView(ReanimatedUIManager.java:77)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:223)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:923)

Environment
[email protected]
[email protected]
Device: Android TV (Android 11)

What I’ve Observed:

  1. Crash only occurs under specific, high-stress input conditions.
  2. Triggered by very fast D-pad input causing rapid focus changes across a complex UI.
  3. Low reproduction rate, but occurs consistently when stress tested.
  4. No crash during normal app usage (30+ mins) or idle playback (6–7 hrs).

Has anyone encountered this issue with react-native-tvos and react-native-reanimated on Android TV?

Are there any known workarounds or suggestions to avoid this crash?

Any help would be greatly appreciated!

Trying to create a new user in google firestore with react and I get a 400 error

I am creating for the first time a new user registration and using firestore auth

this is the signup part of the code

const signup = async (
  email,
  password,
  firstName,
  lastName,
  groupName = 'default',
  userProfile = {},
) => {
  try {
    console.log('Attempting signup for:', email);
    setAuthError(null);

    const result = await createUserWithEmailAndPassword(auth, email, password);
    const user = result.user;
    console.log('User created successfully:', user.uid);

    const userData = {
      uid: user.uid,
      email: user.email,
      firstName: String(firstName || ''),
      lastName: String(lastName || ''),
      groups: [groupName],
      createdAt: serverTimestamp(),
      profileComplete: !!(firstName && lastName),
    };

    console.log('About to write to Firestore...');
    console.log('User data:', JSON.stringify(userData, null, 2));
    console.log('Database instance:', db);
    console.log('Document path:', `users/${user.uid}`);

    try {
      await setDoc(doc(db, 'users', user.uid), userData);
      console.log('Firestore write successful!');
    } catch (firestoreError) {
      console.error('Firestore write failed:');
      console.error('Error code:', firestoreError.code);
      console.error('Error message:', firestoreError.message);
      console.error('Full error:', firestoreError);

      // Check if it's a permissions issue
      if (firestoreError.code === 'permission-denied') {
        console.error(
          'This is a permissions issue - check your Firestore rules',
        );
      }

      throw firestoreError;
    }

    setUserGroups([groupName]);
    console.log('Signup completed successfully');
    return result;
  } catch (error) {
    console.error('Signup error:');
    console.error('Error type:', error.constructor.name);
    console.error('Error code:', error.code);
    console.error('Error message:', error.message);
    console.error('Full error object:', error);

    setAuthError(error.message);
    throw error;
  }
};

The call to createUserWithEmailAndPassword works and I have a valid user

createUserWithEmailAndPassword(auth, email, password);
    const user = result.user;

This is from the dev console

AuthContext.jsx:147 User created successfully: newUID
AuthContext.jsx:159 About to write to Firestore...
AuthContext.jsx:160 User data: {
   "uid": "newUID",
   "email": "[email protected]",
   "firstName": "Randy",
   "lastName": "Paries",
   "groups": [
       "default"
    ],
   "createdAt": {
       "_methodName": "serverTimestamp"
   },
"profileComplete": true
}
AuthContext.jsx:161 Database instance: Firestore {_authCredentials: 
  __PRIVATE_FirebaseAuthCredentialsProvider, _appCheckCredentials: 
  __PRIVATE_FirebaseAppCheckTokenProvider, _databaseId: _DatabaseId, _app: 
   FirebaseAppImpl, type: 'firestore', …}
AuthContext.jsx:162 Document path: users/newUID
AuthContext.jsx:165

GET https://firestore.googleapis.com/google.firestore.v1.Firestore/Write/channel? 
net::ERR_ABORTED 400 (Bad Request)

In my database rules I have

rules_version = '2';
service cloud.firestore {
   match /databases/{database}/documents {
      match /{document=**} {
         allow read, write: if true; // ONLY FOR TESTING!
      }
   }
}

I do not know what to look at next… Nothing seems to work or change the error . I always get a 400.

Thanks for anyhelp

my web app shows this error: meta tag you specified is not allowed

I am following a web app series on Youtube and faced the following issue. Actually it was working well a few days ago but now the page shows the following error. I am using google app script and google sheet. I need load data from sheet to the website and if any changes happened about the data on the website it needs to update that in the database(google sheet).

Error: Exception: The meta tag you specified is not allowed in this context. (line 2, file "Code")

Here is my code which the error comes from:

function doGet() {
  const htmlService = HtmlService.createTemplateFromFile("main").evaluate().addMetaTag("viewport", "width=device-width, initial-scale=1.0")
  return htmlService
}

Is there anyone who can help me?

I am trying to load/open the web page but it shows error.