Is it possible to connect steering wheel to html

I am thinking if it is possible to connect my steering wheel to an app I made. The app I made is a dashboard of car I am thinking when I press gas pedal instead on up arrow key in keyboard, I can change speed of dashboard. I want to know if there is any api to do this. I dont have a steering wheel yet so I want to know if it is possible or not or if there are any steering wheel companies that give steering wheels with api.

I have researched a lot but dint get much results.

CSS nth-child selector works everywhere except on X

I just found something very weird. Its about this css selector

div:nth-child(3) a

On X I have a container div selected in my DevTools

enter image description here

Now, with the css selector div:nth-child(3) a I want to find the link holding the 4h text

I copied the HTML from X to produce a demo here. You can see there that it works as expected, I see the correct href value!

Although this sounds super easy, which it is. Simplified the HTML looks like this:

        <div><a href="/elonmusk">@elonmusk<a/></div>
           <a href="/status/234324234234234">3h</div>

However, when I try to reproduce this on it doesn’t work

To reproduce, first select the container element
enter image description here

Now if I perform that query I get
enter image description here

It selects the first div. It can be fix when I query it as follows


Why does it work in my demo and not on X?

where to apply the filtering in the service repository pattern

I have userRepository, userService and userController and I want to filter users on the basis of the email and I am using prisma with postgresql, where can I filter. In future I would also like to filter the user on the basis of the account creation date or number of posts posted.


export class UserRepositoryPrisma implements UserRepository {
  constructor(@inject('PrismaClient') private prisma: PrismaClient) {}

  async getAll(filter?: object): Promise<User[]> {
    const whereClause = filter ?? {};

    return this.prisma.user.findMany({
      where: whereClause,


export class UserService implements IUserService {
    @inject('UserRepository') private userRepository: UserRepository,
  ) {}

  getAll(filter?: object): Promise<User[]> {
    const whereClause = filter ?? {};
    return this.userRepository.getAll(whereClause);

there will be query for some fields like:

http://localhost:3000/api/[email protected]&accountCreated=gt[somedate]

  handleAsync(async (req: Request, res: Response, next: NextFunction) => {
    const users = await userService.getAll();

    if (!users.length) return next(new AppError(404, `No users found.`));

      results: users.length,
      data: {

What is the best practice.

Mongodb error handling nodejs. Mongoclient ignores timeout completley

I am trying to use mongodb and have experienced some issues.

If mongod service is stopped, i expect the db to not be able to connect and throw an error, even though i’ve set the idle params to a very low time (1 sec) it still takes a looong while before it errors out. here’s my code:

const { MongoClient } = require('mongodb');

const client = new MongoClient(process.env.MONGODB_URI, {
    connectTimeoutMS: 1000,
    socketTimeoutMS: 1000,    

async function get() {
    try {
        await client.db("admin").collections()
        return client;
    } catch (e) {
        throw e;

module.exports = { get };

I have awaited client collections to make sure the db tries to do an operation.
here’s my main function:

const db = require('./db/db')
async function exit_program() {
  try {
    const client = await db.get()
    await client.close()
    console.log("shouldn't get here")
  } catch (e) {


the shouldn’t get here message gets printed if i just return the client without await or anything
my mongodb is on localhost just connect reguarly with mongodb://localhost:27017

so in essence i want to test the connection and if it can’t connect to exit and error. this is not happening.

How do I export a javascript anonymous module file (or it-s’ functions ) into another javascript file?

I need to export AMD javascript functions into another javascript file to be used as helper functions; similar to C++ include header files and their corresponding functions, classes, etc.


    (function(root, factory)
     if (typeof define === 'function' && define.amd)
      // AMD. Register as an anonymous module.
      define([], factory);
      // Browser globals
      root.m4 = factory();
    (this, function()
     "use strict";

     let X_Type = Float32Array;

     function vec4( x0, x1, x2, x3, dst)
      dst = dst || new X_Type(4);

      dst[0] = x0;
      dst[1] = x1;
      dst[2] = x2;
      dst[3] = x4;

      return dst;

     return {
     vec4: vec4



export and import resulted in errors.
export => Unexpected token ‘export’

Error when moving variable to another page [duplicate]

On one page I have this button:

<a href="add_purchase_detail.php?purchase_id=<?php echo (int)$id_purchase; ?>" class="btn btn-primary">Agregar producto</a>

And on the landing page I pick it up like this:


But he doesn’t admit it to me:

Warning: Trying to access array offset on value of type bool in C:xampphtdocssistemaincludessql.php on line 133

Warning: Undefined array key “purchase_id” in C:xampphtdocssistemaadd_purchase_detail.php on line 5

Fatal error: Uncaught mysqli_sql_exception: Cannot add or update a child row: a foreign key constraint fails (sistema.purchase_details, CONSTRAINT purchase_details_ibfk_1 FOREIGN KEY (purchase_id) REFERENCES purchases (id) ON DELETE CASCADE ON UPDATE CASCADE) in C:xampphtdocssistemaincludesdatabase.php:28 Stack trace: #0 C:xampphtdocssistemaincludesdatabase.php(28): mysqli->query(‘INSERT INTO pur…’) #1 C:xampphtdocssistemaadd_purchase_detail.php(25): MySqli_DB->query(‘INSERT INTO pur…’) #2 {main} thrown in C:xampphtdocssistemaincludesdatabase.php on line 28

I’ve tried request and get, but it’s the same thing.
Also, I don’t know how to fix the problem of the alien key.

By placing this, it no longer tells me that the variable doesn’t exist, but the other errors remain the same:

$id_purchase=isset($_GET['purchase_id']) ? $_GET['purchase_id'] : '';

compiling shared php-module as dll (windows)

i’m trying to compile a shared extension for php 8.3.6 x64 for windows
i basicly followed these instructions:

Problem: PHP Warning: PHP Startup: Unable to load dynamic library 'php_mailparse.dll' (tried: ./extphp_mailparse.dll (Die angegebene Prozedur wurde nicht gefunden)) in Unknown on line 0

so what did i do:

  • installed basic components of Visual Studio 2019
  • create folder c:php-sdk
  • extracted php-source from into php-sdk
  • extracted contents of to php-sdk/ext/mailparse
    as of instructions i should run buildconf and configure, what it said binary tools are missing, so
  • downloaded and extracted to php-sdk/php-sdk-binary-tools-master
  • open vs command prompt
  • goto php-sdk/php-sdk-binary-tools-master
  • run phpsdk-vs16-x64.bat
  • go back to php-sdk
  • run configure --disable-all --enable-cli --enable-mbstring --enable-mailparse --disable-zts --with-all-shared
| Extension  | Mode   |
| mailparse  | shared |

Enabled SAPI:
| Sapi Name |
| cli       |

| Build type          | Release         |
| Thread Safety       | No              |
| Compiler            | Visual C++ 2019 |
| Target Architecture | x64             |
| Host Architecture   | x64             |
| Optimization        | PGO disabled    |
| Native intrinsics   | SSE2            |
| Static analyzer     | disabled        |
  • run nmake

now in php-sdkx64Release i found a php_mailparse.dll, but this dll gives me the error written at the beginning … anybody know what i’ve done wrong?

PHP Header redirect doesn’t work when file upload is implemented [duplicate]

I have the following issue that I’ve been struggling with for hours now and just can’t seem to get past: I have an HTML form that, upon submission, saves the entered data to a database. After submission, a redirection should occur using the header function in the PHP script. The form includes an option to upload a file. The problem now is that the redirection no longer works once a file is uploaded. The file is indeed saved correctly in the target folder, and the file path is also saved in the database, but instead of redirecting to the URL specified in the header function, only the form is reset. When the form is submitted without selecting a file, the redirection works without any issues.

I’ve also tried using output buffering and checking for whitespaces etc. but without success. Also the community thread here on stackoverflow regarding problems with redirects didn’t help.I don’t get any error messages and the ‘Headers already sent’ check gives no output.
I hope someone can help me solve the problem. Thanks in advance. Here is the PHP code:

include '../data/testconnect.php'; 


    $fotoPath = NULL;

    if (isset($_FILES['foto']) && $_FILES['foto']['error'] == UPLOAD_ERR_OK) {
        $uploadDir = '../assets/img/passbilder/';
        $tmpName = $_FILES['foto']['tmp_name'];
        $fileName = basename($_FILES['foto']['name']);
        $safeFileName = preg_replace('/[^a-zA-Z0-9-_.]/', '', $fileName);
        $uploadFile = $uploadDir . $safeFileName;

        if (move_uploaded_file($tmpName, $uploadFile)) {
            $fotoPath = $uploadFile; 
        } else {
            die("An error occured.");

    $name = $_POST['name'];
    $birthdate = $_POST['birthdate'];
    $ort = $_POST['ort'];
    $street = $_POST['street'];
    $hausnummer = $_POST['hausnummer'];
    $stadt = $_POST['stadt'];
    $plz = $_POST['plz'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $type = $_POST['type'];
    $bauart_typ = $_POST['bauart_typ'];
    $exam_date = $_POST['exam_date'];
    $reg_nr = $_POST['reg_nr'];
    $password = password_hash($_POST['password'], PASSWORD_DEFAULT);

    $sql = "INSERT INTO users (name, birthdate, ort, foto, street, hausnummer, stadt, plz, phone, email, type, bauart_typ, exam_date, reg_nr, password)
            VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
    $stmt = $conn->prepare($sql);
    if (false === $stmt) {
        die('MySQL prepare error: ' . $conn->error);

    $stmt->bind_param("sssssssisssssss", $name, $birthdate, $ort, $fotoPath, $street, $hausnummer, $stadt, $plz, $phone, $email, $type, $bauart_typ, $exam_date, $reg_nr, $password);



Laravel query relationship with different connection not working

I’m using Laravel 11, Oracle Database for my project. I have some models:

class Order extends Eloquent
    use HasFactory;

    protected $connection = 'db_order';
    protected $table = 'orders';

    public function event()
        return $this->belongsTo(Event::class, 'event_id', 'id');
class Event extends Eloquent
    use HasFactory;

    protected $connection = 'db_event';
    protected $table = 'events';

    public function orders()
        return $this->hasMany(Order::class);

I want to query list orders with search by Event name. This is my query:

$query = Order::with('event');

if (isset($request->name_search)) {
    $searchText = "'%".trim($request->name_search)."%'";

    $query->where('id', 'like', $searchText)
        ->orWhere('transaction_id', 'like', $searchText)
        ->orWhere('user_id', 'like', $searchText)
        ->orWhere('customer_name', 'like', $searchText)
        ->orWhereHas('event', function($q) use ($searchText) {
            $q->where('name', 'like', $searchText);

$orders = $query->orderBy('', 'DESC')->paginate(20);

But i got error:

Error Code : 942 Error Message : ORA-00942: table or view does not exist Position : 166 Statement : select count(*) as aggregate from “ORDERS” where “ID” like :p0 or “TRANSACTION_ID” like :p1 or “USER_ID” like :p2 or “CUSTOMER_NAME” like :p3 or exists (select * from “EVENTS” where “ORDERS”.”EVENT_ID” = “EVENTS”.”ID” and “NAME” like :p4) Bindings : [‘%abc%’,’%abc%’,’%abc%’,’%abc%’,’%abc%’]

  count(*) AS aggregate
  "ID" LIKE '%abc%'
  OR "USER_ID" LIKE '%abc%'
      AND "NAME" LIKE '%abc%'

How can it fix it?

React / Javascript best practice : Better to pass big objects and have less calculations vs passing primitive values and more calculations?

Is it better to pass bigger objects as props to components and to functions + less calculations or just primitive values (generally as I read or primitive values are considered best practice) + more calculations

const productList = [{id: 1, name: "laundry", ...}, {}]

const App = () => {
  const = addProduct(id) => {
 return <></>


const func = (id) => {
  const  productInList = savedProducts.find(product => === id)
    if (productInList) ...
    else {
       const item = productList.find(product=> === id) //here as I passed the id I have to filter a potentionally big list item


const App = () => {
  const = addProduct(todo) => {
 return <></>


const func = (product) => {
  const  productInList = savedProducts.find(productItem => ===
    if (productInList) ...
    else { item //here as I already passed the product I dont have do do any fetching
  //doing something with it

How can I add multiple elements from the checkbox instead of just the first element to the active array

here is my code.

const fieldSelectOrNot = (field) => {
let newValues = [...currentValue]; 
let active = [];
active = newValues.filter((f) => f.fomular_alias === field.fomular_alias);

if (active.length > 0) {
    // setIsCheck(true);
    console.log("ja", active, currentValue);
} else {

updateSelectedComponent(newValues, splittedPath);


this is my ui checkbox

enter image description here

this is my display

enter image description here

I want to get all the elements when I click the checkbox one by one but currently only get the first one because I’m using

 active = newValues.filter((f) => f.fomular_alias === field.fomular_alias);

how can I get all the elements when I click the checkbox into the active array and display it? Show correct order when I checkbox?

System crash by using Flask and text to speech library

I’m creating a chatbot using JavaScript for putting a message and Python for generating a response by ChatGPT and its audio file by text to speech library such as pyttsx3 or gtts.
When the text to speech library creates and saves an audio file, the system stops.
I don’t know the reason why this problem happens.

Actually, I couldn’t find the other way to do that.
However, I expect that flask and function for saving file are incompatible.

How i can get data from post request?

I have linked my website to a payment gateway, and when the payment process is completed successfully, the payment gateway will transfer me to my website via a post request with the data of the completed transaction.
Question: How can I obtain this data to perform some operations on the site, knowing that I use react.js

i try get data from post request

Accessing child of object – React JavaScript

import React from "react";

const VideoDetails = ({ info }) => {
  const { snippet, statistics } = info;
  return (

export default VideoDetails;

Hi everyone,
I have pasted the code in which I’m facing the issue. Here I can easily console.log the “snippet and statistics”, which are children of info props. But there are children in the “snippet” too. When I’m trying to access the child of “snippet/statistics”, I’m getting the value for the first run of code. When I’m refreshing the page then I’m facing an error as shown.When refreshing the page

I’m not able to understand if I can log “snippet” then why can’t I use the children present in “snippet”.

“snippet” console output –
{publishedAt: ‘2024-04-18T04:10:49Z’, channelId: ‘UCl_vAxZpvbO-PFXdDu7EdHw’, title: ‘I JOINED A BIG GANG IN NEW GANGSTER CITY’, description: ‘Join the Best GTA RP Server Grand RP!!!nhttps://gt…here I post gaming videos & live stream everyday.’, thumbnails: {…}, …}