mercredi 31 mars 2021

How to Display Api Data in HTML?

<script>
     function fetchdata() {
     $.get("http://10.10.35.138:5000/data", function (data) { //The link of this line is my api link
                $("#visitor").html('Visitor Count : ' + data.people);
                $("#time").html('Time : ' + data.time);
            });
        }
</script>

****HTML PART****
<div class="details">
<p id="visitor">Person Count:</p>
<p id="time">Time:</p>`enter code here`
</div>

My Api data is consist of 2 things count and time. I have mentioned two paragraphs above: I want to display count in first paragraph tag. And I want to display Time is another paragraph. I try more time but API data will not appear paragraph tags. Plz help me




How to use vite2.0 in vue2.x project

I used vue-cli4.5 to create a simple project, and i want to use vite2.0 to start this project, i have add a vite.config.js file,and i config it, but have a bug, please help me enter image description here




Solution for CyberTalents web

after searching and finding many stuffs but I didn't solve the assignments in the Cybertalents. Could anyone show me some hints for it, please? I'm just a beginner with the security web

Here are the assignments: https://cybertalents.com/challenges/web/comrade-iii




Trying to make for loop that updates grade as age raises

I am currently developing a website for some tutoring services I host. I am making a for loop that automatically updates my grade as my age increases. I have the loop written out, but for some reason it is not working as intended. I am usually good with JS, but it is always the loops (for) that get me! Any help would be appreciated! Thanks!

var finalGrade;
function grade() {
    for (i = 10; i <= 12; i++) {
        if (i === 10) {
            finalGrade = 10;
            return grade;
        } else {
            finalGrade = finalGrade++;
            return grade;
        }

    }
};
console.log(grade(finalGrade));

Thank you for spending your time helping me fix my bugs! Feel free to comment easier ways to do what I am trying to do!




How can I make a text to speech website/app by recording my own voice for a language that doesn't have any text to voice engines?

I want to record my voice for all of the sounds and turn them into a text-to-speech website.




Why does my menu doesn't works on Apple smartphones while it is working on Android devices? (Website related)

Created a menu at my website, but while it is working properly on Android devices (clicking a small image opens a whole menu, the basic/known system), it is not working at all on iPhones. Is there a reason for that? I could show my code, but I do not think that it could explain these differences between iOS and Android.

Would be grateful for an answer from someone who understands this.




Chart.js couldn't refresh even setState has been called

I need to set several point plotting in chart, using scatter and line. But I don't know why, when I changed new value and use setState to change state of the chart. It wouldn't work.

main.js

import React, { Component } from 'react';
import Control from './Control/Control';
import './Main.css'

class Main extends Component {
    constructor(props){
        super(props);
        this.state = {
            data: {
                upperX : 0,
                upperY : 0,
                lowerX : 0,
                lowerY : 0
            }
        }
    }
    handleCallback = (childData) => {
        this.setState({
            data: {
                upperX : childData.upperX,
                upperY : childData.upperY,
                lowerX : childData.lowerX,
                lowerY : childData.lowerY,
            }
        }, () => {
            console.log(this.state.data)
        })
    }
    render() {
        return (
            <div className="main-container">
                <Control parentCallback={this.handleCallback}></Control>
                <Cartesian data={this.state.data}></Cartesian>
            </div>
        );
    }
}

export default Main;

**control.js**

    import React, { Component } from 'react';
import {InputGroup, FormControl, Row, Col, Button} from 'react-bootstrap'
import './Control.css'

class Control extends Component {
    run = (event) => {
        const upperArm = document.querySelector(".upperarm > input").value;
        const lowerArm = document.querySelector(".lowerarm > input").value;
        const upperAngle = document.querySelector(".upperangle > input").value;
        const lowerAngle = document.querySelector(".lowerangle > input").value;
        
        const upperX = Math.cos(upperAngle) * upperArm; 
        const upperY = Math.sin(upperAngle) * upperArm; 
        const lowerX = Math.cos(lowerAngle) * lowerArm; 
        const lowerY = Math.sin(lowerAngle) * lowerArm;

        document.querySelector(".upperx > input").value = upperX + lowerX;
        document.querySelector(".uppery > input").value = upperY + lowerY;
        document.querySelector(".lowerx > input").value = lowerX;
        document.querySelector(".lowery > input").value = lowerY;

        const data = {
            upperX : upperX + lowerX,
            upperY : upperY + lowerY,
            lowerX : lowerX,
            lowerY : lowerY,
        }

        this.props.parentCallback(data);
        // event.preventDefault();
    }
    render() {
        return (
            <div id="control">
                <Row className="mt-5">
                    <Col>
                        <InputGroup size="sm" className="mb-3 upperarm">
                            <InputGroup.Prepend>
                            <InputGroup.Text id="inputGroup-sizing-sm">Upper Arm</InputGroup.Text>
                            </InputGroup.Prepend>
                            <FormControl aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
                        </InputGroup>
                    </Col>
                    <Col>
                        <InputGroup size="sm" className="mb-3 lowerarm">
                            <InputGroup.Prepend>
                            <InputGroup.Text id="inputGroup-sizing-sm">Lower Arm</InputGroup.Text>
                            </InputGroup.Prepend>
                            <FormControl aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
                        </InputGroup>
                    </Col>
                </Row>
                <Row className="mt-2">
                    <Col>
                        <InputGroup size="sm" className="mb-3 upperangle">
                            <InputGroup.Prepend>
                            <InputGroup.Text id="inputGroup-sizing-sm">Upper Angle</InputGroup.Text>
                            </InputGroup.Prepend>
                            <FormControl aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
                        </InputGroup>
                    </Col>
                    <Col>
                        <InputGroup size="sm" className="mb-3 lowerangle">
                            <InputGroup.Prepend>
                            <InputGroup.Text id="inputGroup-sizing-sm">Lower Angle</InputGroup.Text>
                            </InputGroup.Prepend>
                            <FormControl aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
                        </InputGroup>
                    </Col>
                </Row>
                <Row>
                    <Button className="ml-3 mb-2" variant="primary" onClick={this.run}>Run</Button>
                </Row>
                <Row>
                    <Col>
                        <InputGroup size="sm" className="mb-3 upperx">
                            <InputGroup.Prepend>
                            <InputGroup.Text id="inputGroup-sizing-sm">Upper X</InputGroup.Text>
                            </InputGroup.Prepend>
                            <FormControl aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
                        </InputGroup>
                    </Col>
                    <Col>
                        <InputGroup size="sm" className="mb-3 uppery">
                            <InputGroup.Prepend>
                            <InputGroup.Text id="inputGroup-sizing-sm">Upper Y</InputGroup.Text>
                            </InputGroup.Prepend>
                            <FormControl aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
                        </InputGroup>
                    </Col>
                </Row>
                <Row>
                    <Col>
                        <InputGroup size="sm" className="mb-3 lowerx">
                            <InputGroup.Prepend>
                            <InputGroup.Text id="inputGroup-sizing-sm">Lower X</InputGroup.Text>
                            </InputGroup.Prepend>
                            <FormControl aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
                        </InputGroup>
                    </Col>
                    <Col>
                        <InputGroup size="sm" className="mb-3  lowery">
                            <InputGroup.Prepend>
                            <InputGroup.Text id="inputGroup-sizing-sm">Lower Y</InputGroup.Text>
                            </InputGroup.Prepend>
                            <FormControl aria-label="Small" aria-describedby="inputGroup-sizing-sm" />
                        </InputGroup>
                    </Col>
                </Row>
            </div>
        );
    }
}

export default Control;

**Cartesian.js**

    import React, { Component } from 'react';
import './Cartesian.css'
import {Scatter} from 'react-chartjs-2';
         
class Cartesian extends Component {
    state = {
        mydata : {
            datasets: [{
                label: 'Manipulator Robot',
                data: [{
                        x: 0,
                        y: 0
                    }, {
                        x: this.props.data.lowerX,
                        y: this.props.data.lowerY
                    }, {
                        x: this.props.data.upperX,
                        y: this.props.data.upperY
                    }
                ],
                borderColor: 'black',
                borderWidth: 10,
                pointBackgroundColor: ['#000', '#00bcd6', '#d300d6'],
                pointBorderColor: ['#000', '#00bcd6', '#d300d6'],
                pointRadius: 5,
                pointHoverRadius: 5,
                fill: false,
                tension: 0,
                showLine: true
            }]
        },
        option : {
            scales: {
                xAxes: [{
                    type: 'linear',
                    position: 'bottom',
                    ticks : {       
                        autoSkip: true,
                        suggestedMax: 10,
                        suggestedMin: -10,
                    },
                }],
                yAxes: [{
                    ticks : {
                        suggestedMax: 10,
                        suggestedMin: -10
                    },
                }]
            },
            rotation: 90
        }
    }
    render() {
        return (
            <div id="cartesian">
                <Scatter data={this.state.mydata} options={this.state.option} height={300} width={700} redraw/>
            </div>
        );
    }
}

export default Cartesian;



Is there a way to extend SVGElement like HTMLElement

I'm making a small JS library. I was creating custom elements using the HTMLElement interface. Now I want to make a custom graphing tool and for that, I want my element to extend SVGElement.

I have a class Graph.js which extends SVGElement and a main.js which instantiates a graph.

This is my class Graph.js :


export class Graph extends SVGElement {

    constructor() {
        super();

    }

}

and Main.js:

import { Graph } from './Experimental/Graph/Graph.js';

customElements.define('pro-graph', Graph);

let graph = new Graph();


But for some reason I get this error:

Uncaught TypeError: Illegal constructor.
    <anonymous> debugger eval code:1



I want to know about the website platform? [closed]

website : https://3mshop.vip

Login id : 9785278474 Pass : 123456

I want to find out 3mshop website build with which platform.

Like php, Angular, React

I don't know. If anyone knows please tell me




PHP Form not showing Success or Error messages when submitted

I checked so many posts on here but I am unable to fix this. I have a PHP form and although the email is sent it doesn't show any massage and I don't know what I am missing.

In the PHP it mentions a success and failed but no reference on where that message sits? I set up PHP forms before but this is throwing me off.

Anyone can help, please?

The sendmail.php code

<?php

// Define some constants
define( "RECIPIENT_NAME", "Email" );
define( "RECIPIENT_EMAIL", "email@email.com" );


// Read the form values
$success = false;
$senderName = isset( $_POST['username'] ) ? preg_replace( "/[^\s\S\.\-\_\@a-zA-Z0-9]/", "", $_POST['username']) : "";
$senderEmail = isset( $_POST['email'] ) ? preg_replace( "/[^\.\-\_\@a-zA-Z0-9]/", "", $_POST['email'] ) : "";
$message = isset( $_POST['message'] ) ? preg_replace( "/(From:|To:|BCC:|CC:|Subject:|Content-Type:)/", "", $_POST['message'] ) : "";

// If all values exist, send the email
if ( $senderName && $senderEmail && $message) {
  $recipient = RECIPIENT_NAME . " <" . RECIPIENT_EMAIL . ">";
  $headers = "From: " . $senderName . "";
  $msgBody = " Email: ". $senderEmail . " Message: " . $message . "";
  $success = mail( $recipient, $headers, $msgBody );

  //Set Location After Successsfull Submission
  header('Location: contact.html?message=Successfull');
}

else{
    //Set Location After Unsuccesssfull Submission
    header('Location: contact.html?message=Failed');    
}

?>

The HTML code of the contact.html:

 <!--Contact Section-->
    <section class="contact-section">
        <div class="auto-container">

            <div class="info-container">
                <div class="row clearfix">
                </div>
            </div>

            <div class="contact-container">
                <div class="row clearfix">
                    <!--Form-->
                    <div class="form-column col-lg-6 col-md-12 col-sm-12">
                        <div class="inner wow fadeInLeft" data-wow-delay="0ms" data-wow-duration="1500ms">
                            <div class="sec-title">
                                <h2>Send <strong>Your Message</strong></h2>
                                <div class="lower-text">Don’t Hesitate to Contact Us</div>
                            </div>
                            <div class="default-form contact-form">
                                <form method="post" id="contact-form" action="sendemail.php">
                                    <div class="row clearfix">          
                                        <div class="form-group col-lg-6 col-md-6 col-sm-12">
                                            <div class="field-label">Name</div>
                                            <div class="field-inner">
                                                <input type="text" name="username" placeholder="Your Name" required="" value="">
                                            </div>
                                        </div>

                                        <div class="form-group col-lg-6 col-md-6 col-sm-12">
                                            <div class="field-label">Email</div>
                                            <div class="field-inner">
                                                <input type="email" name="email" placeholder="Email Address" required="" value="">
                                            </div>
                                        </div>

                                        <div class="form-group col-lg-12 col-md-12 col-sm-12">
                                            <div class="field-label">Message</div>
                                            <div class="field-inner">
                                                <textarea name="message" placeholder="Write your message..." required=""></textarea>
                                            </div>
                                        </div>
                
                                        <div class="form-group col-lg-12 col-md-12 col-sm-12">
                                            <button type="submit" class="theme-btn btn-style-three"><span class="btn-title">Send Your Message</span></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </section>

Thank you anyone who can help. :)




transferring a project from a 2005 visual web developer to 2015 visual web developer

I Have a website that is written in visual studio 2005 and I would like to work on it in a 2015 version I have the files but i dont know how to open them in 2015 version the web site also have a DB on the Microsoft Access app here is a picture of the files - enter image description here

enter image description here

enter image description here

enter image description here




Requisições encadeadas de API - Angular 11 [closed]

Como iniciante no Angular, me deparei com o seguinte cenário: Antes de excluir um usuário no sistema preciso realizar a confirmação de senha do usuário a ser excluído no servidor.

Como não encontrei nenhum exemplo de uma API para DELETE afim de passar como parâmetro um JSON como parâmetro, qual seria a melhor abordagem a ser aplicada?

  1. Ter uma API que vai fazer a exclusão com método POST, passando como parâmetro as credenciais do usuário para antes de excluir, fazer a validação da senha no servidor;

  2. Tentar aplicar a abordagem abaixo, onde faço a chamada de duas APIs (acho que não está legal por realizar duas chamadas simultâneas no servidor e além do mais, não está capturando o erro de senha inválida):

Observação: Os métodos this.autenthicate(credencials) e super.delete(id) retornam um Observable

deleteUsuario(id:number, email:string, senha:string):Observable{

    var credencials={
        EMail: email,
        Senha: senha
    }   
    /*valido a senha do usuário a ser excluído..*/
    this.autenthicate(credencials).subscribe(
        (success:any)=>{
            return super.delete(id);/*exclusão do usuário*/
        },
        (error:any)=>{
            return new Observable<Usuario>(obs=>{
                ()=>{
                    obs.error(error.error);
                }
            })
        }            
    );

    return new Observable<Usuario>(obs=>{
        ()=>{
            obs.error(null);
        }
    })
    
}



update query is not working in my PHP code [closed]

check image of code here In my PHP code my update query is not working kindly help me.




section weight size to fit text in html css

section size to fit text

greetings. I am a beginner in CSS and I want to ask. Please how do I adjust the section or text so that the height of the section adjusts (automatically enlarges) the text? well thank you

I am attaching images.




Hide subdirectory from URL using .htaccess

I am working on a website project in which I want to hide the directory name. I have an HTML document in a subfolder like this. root/posts/hello.html

I want that when someone clicks on www.example.com/hello, then it actually shows www.example.com/posts/hello.html. But the browser must display www.example.com/hello in URL to the user. How can I achieve this?




This happens because you used a `BuildContext` that does not include the provider of your choice

I am Working on Flutter App Both for web and mobile and stuck at the Following Error:

======== Exception caught by widgets library =======================================================
The following ProviderNotFoundException was thrown building Products(dirty):
Error: Could not find the correct Provider<List<ProductsModel>> above this Products Widget

This happens because you used a `BuildContext` that does not include the provider
of your choice. There are a few common scenarios:

- You added a new provider in your `main.dart` and performed a hot-reload.
  To fix, perform a hot-restart.

- The provider you are trying to read is in a different route.

  Providers are "scoped". So if you insert of provider inside a route, then
  other routes will not be able to access that provider.

- You used a `BuildContext` that is an ancestor of the provider you are trying to read.

  Make sure that Products is under your MultiProvider/Provider<List<ProductsModel>>.
  This usually happens when you are creating a provider and trying to read it immediately.

  For example, instead of:

  ```
  Widget build(BuildContext context) {
    return Provider<Example>(
      create: (_) => Example(),
      // Will throw a ProviderNotFoundError, because `context` is associated
      // to the widget that is the parent of `Provider<Example>`
      child: Text(context.watch<Example>()),
    ),
  }
  ```

  consider using `builder` like so:

  ```
  Widget build(BuildContext context) {
    return Provider<Example>(
      create: (_) => Example(),
      // we use `builder` to obtain a new `BuildContext` that has access to the provider
      builder: (context) {
        // No longer throws
        return Text(context.watch<Example>()),
      }
    ),
  }
  ```


The relevant error-causing widget was: 
  Products file:///E:/Flutter%20Projects/flutter_web_firebase_host/lib/screens/home/home.dart:37:63
When the exception was thrown, this was the stack: 
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 236:49  throw_
packages/provider/src/provider.dart 332:7                                                                                  _inheritedElementOf
packages/provider/src/provider.dart 284:30                                                                                 of
packages/flutter_web_firebase_host/screens/databaseScreens/products.dart 10:31                                             build
packages/flutter/src/widgets/framework.dart 4569:28                                                                        build
...
====================================================================================================

Main.dart

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_web_firebase_host/model/users.dart';
import 'package:flutter_web_firebase_host/provider/product_provider.dart';
import 'package:flutter_web_firebase_host/screens/wrapper.dart';
import 'package:flutter_web_firebase_host/services/auth.dart';
import 'package:flutter_web_firebase_host/services/firestore_service.dart';
import 'package:provider/provider.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    final firestoreServise = FirestoreService();
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(
          create: (context) => ProductProvider(),
        ),
        StreamProvider(
          create: (context) => firestoreServise.getProducts(),
          initialData: [],
        ),
        StreamProvider<Users>.value(
          value: AuthService().user,
          initialData: null,
        ),
      ],
/*      child: StreamProvider<Users>.value(
        value: AuthService().user,
        initialData: null*/
      child: MaterialApp(
        debugShowCheckedModeBanner: false,
        home: Wrapper(),
      ),
    );
    // );
  }

Home.dart

import 'package:flutter/material.dart';
import 'package:flutter_web_firebase_host/screens/databaseScreens/products.dart';
import 'package:flutter_web_firebase_host/services/auth.dart';
import 'package:flutter_web_firebase_host/shared/drawer.dart';

class Home extends StatefulWidget {

  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  final AuthService _auth = AuthService();

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Scaffold(
        backgroundColor: Colors.brown[100],
        appBar: AppBar(
          title: Text('Brew Crew'),
          backgroundColor: Colors.brown[100],
          elevation: 0.0,
          actions: <Widget>[
            FlatButton.icon(
              icon: Icon(Icons.person),
              label: Text('logout'),
              onPressed: () async {
                await _auth.signOut();
              },
            ),
            IconButton(
                icon: Icon(Icons.add, color: Colors.black),
                onPressed: () {
                  Navigator.of(context).push(
                      MaterialPageRoute(builder: (context) => Products()));
                }),
          ],
        ),
        body: SingleChildScrollView(
          child: Center(
            child: Column(
              children: <Widget>[
                Container(
                  child: Padding(
                    padding: const EdgeInsets.fromLTRB(0.0, 50, 0, 0),
                    child: Container(
                        child: Text(
                          'Stock Market',
                          style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
                        )),
                  ),
                ),
                Container(
                  child: Padding(
                    padding: const EdgeInsets.fromLTRB(20, 0, 0, 0),
                    child: Image.asset(
                      "assets/graph.jpg",
                      width: 500,
                      height: 600,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
        drawer: MyDrawer(),
      ),
    );
  }
}

product_provider.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter_web_firebase_host/model/ProductModel.dart';
import 'package:flutter_web_firebase_host/services/firestore_service.dart';
import 'package:uuid/uuid.dart';

class ProductProvider with ChangeNotifier {
  final firestoreService = FirestoreService();
  String _name;
  double _price;
  String _productId;
  var uuid = Uuid();

  //Geters
  String get name => _name;
  double get price => _price;

//Seters
  changeName(String value) {
    _name = value;
    notifyListeners();
  }

  changePrice(String value) {
    _price = double.parse(value);
    notifyListeners();
  }

  loadValues(ProductsModel product) {
    _name=product.name;
    _price=product.price;
    _productId=product.productId;
  }



  saveProduct() {
    print(_productId);
    if (_productId == null) {
      var newProduct = ProductsModel(name: name, price: price, productId: uuid.v4());
      firestoreService.saveProduct(newProduct);
    } else {
      //Update
      var updatedProduct =
      ProductsModel(name: name, price: _price, productId: _productId);
      firestoreService.saveProduct(updatedProduct);
    }
  }
}

Authservise.dart

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter_web_firebase_host/model/users.dart';
import 'package:google_sign_in/google_sign_in.dart';

class AuthService {

  final FirebaseAuth _auth = FirebaseAuth.instance;

  // create user obj based on firebase user
  Users _userFromFirebaseUser(User user) {
    return user != null ? Users(uid: user.uid) : null;
  }

  // auth change user stream
  Stream<Users> get user {
    return _auth.authStateChanges().map(_userFromFirebaseUser);
  }

  // sign in anon
  Future signInAnon() async {
    try {
      UserCredential result = await _auth.signInAnonymously();
      User user = result.user;
      return _userFromFirebaseUser(user);
    } catch (e) {
      print(e.toString());
      return null;
    }
  }

  // sign in with email and password
  Future signInWithEmailAndPassword(String email, String password) async {
    try {
      UserCredential  result = await _auth.signInWithEmailAndPassword(email: email, password: password);
     User user = result.user;
      return user;
    } catch (error) {
      print(error.toString());
      return null;
    } 
  }

  // register with email and password
  Future registerWithEmailAndPassword(String email, String password) async {
    try {
      UserCredential  result = await _auth.createUserWithEmailAndPassword(email: email, password: password);
     User user = result.user;
      return _userFromFirebaseUser(user);
    } catch (error) {
      print(error.toString());
      return null;
    } 
  }

  // sign out
  Future signOut() async {
    try {
      return await _auth.signOut();
    } catch (error) {
      print(error.toString());
      return null;
    }
  }

  //sign in with google
  Future<bool> loginWithGoogle() async {
    try {
      GoogleSignIn googleSignIn = GoogleSignIn();
      GoogleSignInAccount account = await googleSignIn.signIn();
      if(account == null )
        return false;
      UserCredential res = await _auth.signInWithCredential(GoogleAuthProvider.credential(
        idToken: (await account.authentication).idToken,
        accessToken: (await account.authentication).accessToken,
      ));
      if(res.user == null)
        return false;
      return true;
    } catch (e) {
      print(e.message);
      print("Error logging with google");
      return false;
    }
  }
}

Basically my app is connect to firebase both for web app and android app. Also i send data to firestore from my app but when i click the add button to go to textfield to send data it give the error as i mention it in start. I am using multiprovider as you can see my main.dart code

Is There anything I missing. I need Help.




sugestions for solutions to renaming/copying files on client storage

I am a beginner to writing most web services, and currently i am was hoping to build a service which would need to access files on the client storage system and rename or copy them to a different file name.

I was hoping to have a file system browsing window for clients to select the folders containing the files in question. However i have not been able to find any solution for this, and i was hoping someone might be able to help with a suggestion.

The first iteration i was working with required the user to upload the files desired renamed, to the web server, which would rename and bundle the files and send them back as a zip archive. However if possible im hoping to avoid having to do the file upload/processing/downloading and instead simplify it to just a local processing, as the operations are extremly simple.

Is this possible to do in react or can someone suggest a way to achieve this?




Do we need to use on_delete argument in ManyToManyField in django? [duplicate]

While designing Models do we need to add on_delete attribute in Manytomanyfield in django just like the foreign key.




¿Cómo puedo crear un sistema en función de PHP? [closed]

Buen día, quisiera saber si es viable crear un sistema en el cual se gestione el proceso de producción en php, mediante una app web que permita al usuario cargar datos del producto y dar cálculos de materia prima, tiempo de producción, costos y ganancia.




Development of Anti-Crawl System

I've been asked by a customer.

The request is to provide a solution to prevent crawling on customer's homepage.

However, no matter how hard look, I don't know how to develop a real-time log connection verification system.

Unless buy it.

The customer's homepage has been continuously scratched and registered in several domains that are assumed to be fake, reducing the quality of the homepage.

As a result, if search Google, the ranking on the customer's homepage will be lowered.

  1. To avoid this, I need a solution that can block the crawling bot.
  2. I need a log of everyone accessing the customer's homepage. (To determine if it is a bot or not)
  3. When it turns out to be a bot, I need a solution that can automatically force to redirect to honeypot page.

Do you have any advice?




How can I move more than one element to the right using css&html

  • bootstrap
    • content
    • about
    • portfolio
    • menu
    • I want to move content, about, portfolio and menu to the right while bootstrap stay at the left.




  • Change encrypted password on mysql

    I am trying to enter the admin panel of a web which I don't know the password of, the web has an older backup where I can enter the admin panel, from the old db I copied the field of the old encrypted password that works on the new db, but it does not work, I don't know that much about webs, so I don't really know if the password field is linked to something that decrypts the password, thanks for you help.

    database image




    mardi 30 mars 2021

    What actually is a 'Standard'?

    The WHATWG maintains Living Standards for the web. What exactly is this standards? I mean are these some protocols like a standard universal way of doing things or something like that?




    How do I use document.getElementById() in a separate js file?

    Learning how to do webdev for the first time, and to make things neater, I'm storing my scripts in their own files. I've been trying to figure out how to access elements from this separate file but I cannot figure out how.

    This is the relevant bit of the JS file

    function getSelectedText() {
            if document.getElementById("card1").checked == true {
                //code here
            }
    }
    

    This is the relevant HTML it's trying to access

    <script type="text/javascript" src="js/cards.js"></script>
    <input id="card1" type="radio" name="card" value="1" checked>Test1<br>
    <input id="card2" type="radio" name="card" value="2">Test2<br>
    <input id="card3" type="radio" name="card" value="3">Test3<br>
    <button onclick="updateCard()">View card</button>
    

    I want to access and edit the radio inputs but the JavaScript file throws an error when I try to reference document. Is there any way to reference the HTML file or do I need to use a different method/shove the code into the html?




    Bundled Javascript r is null

    It's been several days this error accured. I'm trying to build simple website which can interact with covid-19 API to get data. I'm done with the html and css, and also i managed to write JS code to retrieve data from API. At first, all i do is write the html, and using JS as embedded script (inside tag).

    Everythings work fine, and as i wanted to. But, problem happen when i try to separate html, css and JS using webpack and webcomponent. The main problem is the html and css works fine, but lost all JS effect. All event listener simply can't work.

    this is the files which i think causing problem:

    ./src/index.js (webpack entry point)

    import "./styles/main.css";
    import "./component/jumbotron.js";
    import "./component/footer.js";
    import main from "./view/main.js";
    
    const boxConfirmed = document.querySelector("#globalConfirmed");
        const boxRecovered = document.querySelector("#globalRecovered");
        const boxDeath = document.querySelector("#globalDeath");
        const searchBarConfirmed = document.querySelector(".search-bar-confirmed");
        const searchBarRecovered = document.querySelector(".search-bar-recovered");
        const searchBarDeath = document.querySelector(".search-bar-death");
        const searchBarButtonConfirmed = document.querySelector("#searchBarButtonConfirmed");
        const searchBarButtonRecovered = document.querySelector("#searchBarButtonRecovered");
        const searchBarButtonDeath = document.querySelector("#searchBarButtonDeath");
    
    let value;
    console.log(value);
    
    
    boxConfirmed.addEventListener("click", function(){
        getGlobalData(searchBarConfirmed, boxConfirmed, "confirmed");
        console.log("test");
    });
    
    boxRecovered.addEventListener("click", function(){
        getGlobalData(searchBarRecovered, boxRecovered, "recovered");
        console.log("test");
    });
    
    boxDeath.addEventListener("click", function(){
        getGlobalData(searchBarDeath, boxDeath, "death");
        console.log("test");
    });
    
    searchBarButtonConfirmed.addEventListener("click", () => {
        value = searchBarButtonConfirmed.value;
        const querySearch = document.getElementById("searchBarConfirmedField").value;
        console.log(value);
        getCountryData(querySearch, value, "confirmed");
    });
    
    searchBarButtonRecovered.addEventListener("click", () => {
        value = searchBarButtonRecovered.value;
        const querySearch = document.getElementById("searchBarRecoveredField").value;
        console.log(value);
        getCountryData(querySearch, value, "recovered");
    });
    
    searchBarButtonDeath.addEventListener("click", () => {
        value = searchBarButtonDeath.value;
        const querySearch = document.getElementById("searchBarDeathField").value;
        console.log(value);
        getCountryData(querySearch, value, "death");
    });
    

    ./src/component/box-menu.js (act as a custom tag)

    const template = document.createElement('template');
    template.innerHTML = `
        <style>
            .container-menu{
                display: flex;
                flex-direction: column;
            
                width: 99%;
                padding: 10px;
                margin: auto;
            }
            
            .box-menu{
                display: flex;
                flex-direction: row;
                flex-grow: 1;
            
                padding: 10px;
            }
            
            .box{
                flex-grow: 1;
            
                margin: 1%;
                padding: 5px;
                border: 1px solid black;
                background-color: white;
                height: 100px;
                overflow-x: auto;
                flex-basis: auto;
                flex: 1 1;
                text-align: justify;
            
                box-shadow: 5px 10px;
                overflow-y: hidden;
            }
            
            .box:hover{
                box-shadow: 6px 12px rgb(44, 43, 43);
                border: 3px solid black;
                cursor: pointer;
            }
            
            .box:active{
                box-shadow: 6px 12px rgb(216, 216, 58);;
                border: 2px solid green;
            }
            
            .box-title{
                padding: 12px;
                
            }
            
            h3{
                text-align: center;
                font-size: 18px;
            }
            
            h5{
                text-align: center;
                font-size: 14px;
                margin-bottom: -1%;
            }
            
            .header-menu{
                font-family: 'Times New Roman', Times, serif;
                font-size: 24px;
                margin: 1% auto auto 0%;
            }
            
            .search-bar-confirmed, .search-bar-recovered, .search-bar-death{
                visibility: hidden;
                margin-left: 15%;
            }
        
        </style>
    
        <div>
            <h3 class="header-menu">
                See All About Covid-19 Info Updates in just 1 Website!
            </h3>
            <h5>Click the element to see complete updates info</h5>
        </div>
        <div class="container-menu">
            <div class="box-menu">
                <div id="globalConfirmed" class="box" value="confirmed"><h3 class="box-title">Confirmed Infected Cases</h3>
                    <div id="total-infected"></div>
    
                    <div class="search-bar-confirmed">
                        <input placeholder="Type country name" id="searchBarConfirmedField" type="search">
                        <button id="searchBarButtonConfirmed" type="submit" value="countryConfirmed">Search</button>
                    </div>
    
                    <div id="countryConfirmedField"></div>
                </div>
                <div id="globalRecovered" class="box"><h3 class="box-title">Fully Recovered from Infection</h3>
                    <div id="total-recovered"></div>
    
                    <div class="search-bar-recovered">
                        <input placeholder="Type country name" id="searchBarRecoveredField" type="search">
                        <button id="searchBarButtonRecovered" type="submit" value="countryRecovered">Search</button>
                    </div>
    
                    <div id="countryRecovered"></div>
                </div>
                <div id="globalDeath" class="box"><h3 class="box-title">Death Cases from Covid-19</h3>
                    <div id="total-death"></div>
    
                    <div class="search-bar-death">
                        <input placeholder="Type country name" id="searchBarDeathField" type="search">
                        <button id="searchBarButtonDeath" type="submit" value="countryDeath">Search</button>
                    </div>
    
                    <div id="countryDeath"></div>
                </div>
            </div>
        </div>
    `;
    
    class BoxMenu extends HTMLElement{
        constructor(){
            try{
                super();
                this.attachShadow({mode: 'open'});
                this.shadowRoot.appendChild(template.content.cloneNode(true));
                console.log("test");
            }catch{
                console.log("error here!");
            }
        }
    }
    
    window.customElements.define('box-menu', BoxMenu);
    

    ./src/view/main.js

    import '../component/box-menu.js';
    
    const main = () =>{
        function getGlobalData(searchBar,boxMenu,identifier){
                
            boxMenu.style.height = "320px";
            let writeData;
            let globalValue;
            let globalInfo;
    
            fetch(`https://covid19.mathdro.id/api`)
            .then(response => {
                return response.json();
            })
            .then(responseJson => {
                if(responseJson.error) {
                    console.log(responseJson.error);
                } else {
                    if(identifier == "confirmed"){
                        writeData = document.querySelector("#total-infected");
                        globalValue = formatNumber(responseJson.confirmed.value);
                        globalInfo = "people have been infected.";
                    }else if(identifier == "recovered"){
                        writeData = document.querySelector("#total-recovered");
                        globalValue = formatNumber(responseJson.recovered.value);
                        globalInfo = "managed to be cured from covid19.";
                    }else if(identifier == "death"){
                        writeData = document.querySelector("#total-death");
                        globalValue = formatNumber(responseJson.deaths.value);
                        globalInfo = "people lost their live because of this pandemic.";
                    }
                    writeData.innerHTML = `<p style="padding-left:15px; padding-right: 10px; text-align: center"> Globally, <strong>${globalValue}</strong> ${globalInfo}
                    <br>Last Updated: ${responseJson.lastUpdate}</p>
                    <h5 style="text-align: center; padding-left:10px; padding-right:10px; margin-bottom: 0%">Or you can type your country name for local data<br></h5>
                    `;
    
                    searchBar.style.visibility = "visible";
                }
            })
            .catch(error => {
                console.log(error);
            })
        }
        
        function formatNumber(num) {
            return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1.')
        }
    
        function randomInteger(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        }
    
        function getCountryData(querySearch, value, identifier){
            const querySearchLowerCase = querySearch.toLowerCase();
            let data;
            let explanationString;
            let fieldSelector;
            let advice;
    
            fetch(`https://covid19.mathdro.id/api/countries/${querySearchLowerCase}`)
            .then(response =>{
                return response.json();
            })
            .then(responseJson =>{
                
    
                if(responseJson.error){
                     writeDataCountryConfirmed.innerHTML = `
                        <p style="padding-left:12px; padding-right: 12px;">
                            ${responseJson.error.message}
                            </p>
                     `;
    
                }else{
                    if(value == "countryConfirmed"){
                        data = responseJson.confirmed.value;
                        explanationString = "people have been infected with covid-19";
                    }else if(value == "countryRecovered"){
                        data = responseJson.recovered.value;
                        explanationString = "managed to be cured from covid19.";
                    }else if(value == "countryDeath"){
                        data = responseJson.deaths.value;
                        explanationString = "people lost their live because of this pandemic.";
                    }
    
                    data = formatNumber(data);
                    
                    if(randomInteger(0,3) == 0){
                        advice = "<strong><br>Remember, use your mask everytime and everywhere.</strong>";
                    }else if(randomInteger(0,3) == 1){
                        advice = "<strong><br>Never let your guard down, corona virus is still hunting us!</strong>"
                    }else if(randomInteger(0,3) == 2){
                        advice = "<strong><br>Wash your hands, as long as you still use them.</strong>";
                    }else{
                        advice = "<strong><br>Nothing better than staying at home in this situation.</strong>"
                    }
    
                    if(identifier == "confirmed"){
                        fieldSelector = document.querySelector("#countryConfirmedField");
                    }else if(identifier == "recovered"){
                        fieldSelector = document.querySelector("#countryRecovered");
                    }else if(identifier == "death"){
                        fieldSelector = document.querySelector("#countryDeath");
                    }else{
                        console.log("Nothing Happened");
                    }
                    
                    fieldSelector.innerHTML = `
                        <p style="padding-left:12px; padding-right: 12px; text-align:center">
                            In ${querySearch.toUpperCase()}, <strong>${data}</strong> ${explanationString}<br>
                            ${advice}
                            </p>
                            `;
                }
            })
        };
    };
     
    
    export default main;
    

    after i bundle all file (not only all the previous files) and execute index.html file, i got this error message from Mozilla Console:

    Uncaught TypeError: r is null https://ift.tt/3dnKKIP https://ift.tt/3dnKKIP https://ift.tt/3dnKKIP

    And then i see the bundle.js file, i tried to locate where "r" are, but in column 7201, there is no "r". I cant wrote what's inside bundle.js here, please comment if you need to see that. i have done so many search a few days ago, including Youtube and StackOverflow, but nothing could help. So what is wrong with my code, and how i fix this? Any help will be appreciate. Thanks.




    How can I make a feature that google have in html and css or js?

    I want a feature like google.

    Google

    When i search for some image in google then then results appears.

    then if i click on a image then the image details shows in the right side and can be scrolled. And when click on another image then the details of the image appears. and details section can be cross.

    How can i make that?




    How to make simple web android?

    How to make a web droid application with bootstrap in android studio.

    I want make simple application with bootstrap and PHP but i want use android studio for make android application.




    best programming language for cataloging and searching metadata for 1000+ images (jpg and tif)

    I have a large number of family pics and have entered into metadata the names of people, location, and events for each. I would like a web-based method to do a boolean search for people, location and event to pull up relevant photo images. My questions are: 1) is this doable? and 2) what software/programming approach would work best for this application. Thank you in advance for advice. I am new to programming but will teach myself how to use the software once I know which is best.




    No Recommended Modules and Services on PrestaShop

    PrestaShop system don't show Recommended Modules and Services. Console shows:

    Failed to load resource: the server responded with a status of 503 (Service Unavailable)

    enter image description here




    Webscraping all text in an article in R

    I am creating a webscraper where I am gathering the full text of an article. As so right now I have not been able to grab the html needed for the full text of the arrticle. The text should later be outputted onto a csv with the text all in one row

    My output is currently blank

    My program is below:

    library(rvest)
    library(RCurl)
    library(XML)
    library(stringr)
    #for Fulltext to read pdf
    ####install.packages("pdftools")
    library(pdftools)
    
    fullText <- function(parsedDocument){
      fullText <- parsedDocument %>%
        html_nodes("a.article-body") %>%
        html_text() %>%
        return(fullText)
    }
    
    #main function with input as parameter year
    testFullText <- function(DOIurl){
      parsedDocument <- read_html(DOIurl)
      DNAresearch <- data.frame()
      allData <- data.frame("Full Text" = fullText(parsedDocument), stringsAsFactors = FALSE)
      DNAresearch <-  rbind(DNAresearch, allData)
      write.csv(DNAresearch, "DNAresearch.csv", row.names = FALSE)
    }
    testFullText("https://doi.org/10.1093/dnares/dsm026")
    



    Is there any way to make the edited image downloadable in javascript

    Hi I am making a web app that takes a normal image and helps you to edit it.

    > > This is the function for applying the filters on the user image.
    function applyFilter() {
      var computedFilters = "";
      controls.forEach(function (item) {
        computedFilters +=
          item.getAttribute("data-filter") +
          "(" +
          item.value +
          item.getAttribute("data-scale") +
          ") ";
      });
      image.style.filter = computedFilters;
      downloadableImage.style.filter = computedFilters;
    }
    
    > > > Here I am adding the eventListener for showing the live editing image to the user.
    userFile.addEventListener("change", function () {
      const reader = new FileReader();
    
      reader.addEventListener("load", () => {
        localStorage.setItem("userImage", reader.result);
        image.setAttribute("src", localStorage.getItem("userImage"));
        downloadableImage.setAttribute("src", reader.result);
        downloadLink.setAttribute("href", localStorage.getItem("userImage"));
      });
      reader.readAsDataURL(this.files[0]);
    });
    

    I want to make the image that is downloadable to be edited according to the user.




    Does anyone know how to position a hyperlink box on a web banner to be position-specific to pixels as opposed to 'left' or 'right'?

    I need to change the position of a box that has a hyperlink that takes me to order a product. The code that is currently producing the web banner is as follows:

    ...
    
    <img src="assets/file/home-page-slider/gofogwebbanner.png" width="1470" height="380" border="0" usemap="#map" />
    <map name="map">
    <div class="banner-text-03-left"><a class="home-slider-button" href="products/anti-viral-room-fogger-200ml-canister" title="Order now">Order now</a></div>
    ...
    

    I know that I can change the 'left' to be 'right' and that moves my hyperlink box to the right side of the banner, but I would live to place it, preferably to the pixel if I could, around the middle bottom of the banner.

    NOTE: I am working on QVS3 and I am editing our live website that is already built. A link to the website is here and the banner in question is the 'GoFog' ad on the first banner slide when you visit the website. Link: https://www.ehmltd.co.uk/

    I am sure this is like ABCs to someone who has the know-how, but it is proving difficult for me at the minute. Any help would be appreciated! I will reply pretty much instantly to all/any help I can get, so feel free to ask me questions if you need more info.




    actix-web url parameters?

    In NodeJS a route can be defined like:

    app.get('/:x', (req, res) => {
      console.log(req.params.x)
      res.sendStatus(200)
    });
    

    Is there an actix-web equivalent? (or a better recommended approach?)

    Specifically, I want to upload a file with an id identifier, such that something like img.save(format!("{}.png",id)); could be written. M

    My current code for this:

    use actix_multipart::Multipart;
    use actix_web::{web, App, HttpServer, Responder};
    use futures_util::{StreamExt, TryStreamExt};
    use serde::Deserialize;
    use image::ImageFormat;
    
    async fn get() -> impl Responder {
        web::HttpResponse::Ok()
            .content_type("text/html; charset=utf-8")
            .body(include_str!("../page.html"))
    }
    
    async fn post(mut payload: Multipart) -> impl Responder {
        if let Ok(Some(mut field)) = payload.try_next().await {
            println!("field: {:.?}", field);
    
            let content_type = field.content_disposition();
            println!("content_type: {:.?}", content_type);
    
            if let Some(filename) = content_type.unwrap().get_filename() {
                println!("filename: {:.?}", filename);
            }
    
            let mut full_vec: Vec<u8> = Vec::new();
            while let Some(Ok(chunk)) = field.next().await {
                full_vec.append(&mut chunk.to_vec());
            }
            println!("full_vec: {}", full_vec.len());
    
            let img = image::load_from_memory_with_format(&full_vec, ImageFormat::Png)
                .expect("Image load error");
            img.save("img.png");
        }
        web::HttpResponse::Ok().finish()
    }
    
    #[actix_web::main]
    async fn main() -> std::io::Result<()> {
        println!("Started.");
    
        // Starts server
        HttpServer::new(move || {
            App::new()
                // Routes
                .route("/", web::get().to(get))
                .route("/", web::post().to(post))
        })
        .bind("127.0.0.1:8080")?
        .run()
        .await
    }
    

    The html would be templated to have the id in the form action (in the more general use case their may be multiple forms which have different id's).

    <!DOCTYPE html>
    <html>
      <body>
        <!-- <form id="form" action="/<% id %>" method="post"> -->
        <form id="form" action="/" method="post">
          <input type="file" name="file" required><br>
          <input type="submit" value="Submit">
        </form>
      </body>
    </html>
    



    How To make Custom Links Without Showing page not found error [duplicate]

    I want to make custom links to my website without showing page not found error. all links will show same webpage without redirecting.

    As example my website is samplewebsite.com. i want to create custom links like samplewebsite.com/123 and that link must be show the samplewebsite.com interface without redirecting.

    can i use htaccess to this ? and how ?




    Can I store users' names and their passwords in a file instead of a data-base table?

    I am writing a very simple web-service that I am going to run online (as a web page on the Internet). So far, I do not have a need to have a data base behind the service. However, I need to have user's registration (where each user provide a pair: user name, password). So, I need to store these values somewhere and then retrieve them, when needed.

    I thought that maybe I can just store them in a txt file. I do not want to star a data base server and to create a table in there and then run SQL queries, for me it is easier just to write those values to a file and then read them from a file.

    Is there some drawbacks of this solution? In particular, can I get a problem when two users register in more or less the same time and then two instances of the web server try to write simultaneously into one file.




    How to embed youtube videos dynamically into website with custom url

    my Youtube custom URL has /c/ [ https://www.youtube.com/c/Coingraph ]. Hence with this, I'm not able to add Youtube videos dynamically on my website. Kindly help.




    is there a way to build web with local json file [closed]

    im trying to build a web involving a database, for now im trying to store the database in json file saves in my computer. Can i edit,add,delete the data just by using the json file and HTML ?.

    *i already try the node.js , but it cant be access in html

    *i try to avoid using php because it will be access by a lot of people (i'm trying to host it in github pages)

    do you guys have any idea how to do it ? or did i miss anything in node.js or php ? really appreciate your answer guys




    Exposing multiple docker containers running locally

    I am creating a SaaS project that lets end-users run and access a dashboard as a web app which is a Docker container, which means every user has his own dashboard which is a running docker container, and I would like them to access their servers/containers using my domain (HTTP) as follow: user1: subdomain.mydomain.com/user1app, user2: subdomain.mydomain.com/user1app, etc.

    Currently, I am using LocalTunnel however it is not stable and requires me to use 1 subdomain for every user, for example: user1.mydomain.com, user2.mydomain.com, etc. but what if we scale and get more users? I need a dynamic and automatic way to create users custom URL link to expose their running docker containers and give them access such as, subdomain.mydomain.com/user123, subdomain.mydomain.com/user456, etc.

    I tried to use ngrok, however, it is limited in many ways e.g. 40-requests/minute limit, and not free. Thanks




    What is the best plugin in Wordpress for WooCommerce marketplace?

    Good day all,

    I want to make eCommerce marketplace website (multivendor) by Wordpress So my question here is What is the best plugin for this website?what is best theme No matter is paid or free I already use elementor for interface + woocommerce




    does not connect to the site to find out the version [duplicate]

    Good day, the question is, I uploaded a text document to my site in a separate folder in which I store the version of the application, but when I connect to it, it gives me an error ..

    Error: The underlying connection is closed. Failed to establish trust for secure channel. enter image description here

            try
            {
                using (var client = new WebClient())
                using (var stream = client.OpenRead(link_version)) // link in check
                using (var reader = new StreamReader(stream))
                {
                    ClientInfo.activ_version_launcher_site = reader.ReadToEnd();
                    //=========//
                    if (version_launcher == ClientInfo.activ_version_launcher_site)
                    {
                        Status = LauncherStatus.Launcher_Ready;
                        Check_Default_Launcher(sender, e);
                    }
                    else
                    {
                        Status = LauncherStatus.Launcher_update_ready;
                        Button_update.Width = 185;
                        Button_update.Height = 30;
                        Button_update.Opacity = 1;
                        ClientInfo.for_check_old_version_Setup = true;
                        StockSaveAll_parametr();
                    }
                }
            }
            catch (Exception ex)
            {
                Status = LauncherStatus.Launcher_update_download_error;
    
                ErrorLauncher.ErrorMessager = ex.Message;
    
                var closeds = new LauncherError();
                img_bg.Opacity = 0.3;
                closeds.Owner = this;
                ApplyEffect(this);
                closeds.ShowDialog();
                ClearEffect(this);
                 
            }
    



    ReferenceError: process is not defined Module.../../../node_modules/graphql/jsutils/instanceOf.mjs

    I am using graphql subcriptions for my project, it is an instagram clone and I am doing function to like or unlike post, I use npx create-react-app to create my client and I use express to make my server.

    at the client side, I set up my client like that:

    src/apis/client.js

    import {
      ApolloClient,
      ApolloLink,
      HttpLink,
      InMemoryCache,
      split,
    } from 'apollo-boost';
    import {getMainDefinition} from '@apollo/client/utilities';
    import {WebSocketLink} from '@apollo/client/link/ws';
    const httpUrl = 'http://localhost:5000/graphql';
    const wsUrl = 'ws://localhost:5000/graphql';
    
    const httpLink = ApolloLink.from([
      new ApolloLink((operation, forward) => {}),
      new HttpLink({uri: httpUrl}),
    ]);
    
    const wsLink = new WebSocketLink({
      uri: wsUrl,
      options: {
        // connectionParams: () => {},
        lazy: true,
        reconnect: true,
      },
    });
    
    function isSubscription(operation) {
      const definition = getMainDefinition(operation.query);
      return (
        definition.kind === 'OperationDefinition' &&
        definition.operation === 'subscription'
      );
    }
    
    const client = new ApolloClient({
      cache: new InMemoryCache(),
      link: split(isSubscription, wsLink, httpLink),
      defaultOptions: {query: {fetchPolicy: 'no-cache'}},
    });
    
    export default client;
    

    As you can see, I use both websocket and https connection. Previously, I use only http connection, and everything works perfectly.

    This is my server side:

    app.js

    const {ApolloServer, gql} = require('apollo-server-express');
    const http = require('http');
    const fs = require('fs');
    const bodyParser = require('body-parser');
    const cors = require('cors');
    const express = require('express');
    
    const app = express();
    app.use(cors(), bodyParser.json());
    
    const typeDefs = gql(fs.readFileSync('./schema.graphql', {encoding: 'utf8'}));
    
    const resolvers = require('./resolvers');
    
    const apolloServer = new ApolloServer({
      typeDefs,
      resolvers,
    });
    apolloServer.applyMiddleware({app, path: '/graphql'});
    
    const httpServer = http.createServer(app);
    apolloServer.installSubscriptionHandlers(httpServer);
    const port = 5000;
    httpServer.listen(port, () => console.log(`Server started on port ${port}`));
    

    This is the error:

    enter image description here

    I tried to google but it looks like an shortage of something in the webpack.config file of React but I don't know webpack. Please tell me how to deal with it, thank you so much and have a good day




    What is the road map to become fullstack developer in microsoft technology?

    The problem is it is too confusing when a beginner start programing instead of a getting a simple road map there are a lot of random people who misguide many people and the result is that developer lost in the way of exploring thing, hopefully people will answer this to help our beginner community.




    Backdrop Filter is not applied in CSS & HTML

    I am trying to make a glassmorphism effect and my problem is that the webkit backdrop filter is not applied to the background of the div. the css code:

    .glassmorphism {
        background: rgba( 255, 255, 255, 0.20);
        box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37);
        -webkit-backdrop-filter: blur(10em);
        backdrop-filter: blur(10em);
        border-radius: 10px;
        border: 1px solid rgba( 255, 255, 255, 0.18);
    }
    

    html:

    <div id="content__body" class="glassmorphism"></div>
    

    And I get this error in chrome: invalid property value




    How can i get the contact e-mail from a webpage by a script [closed]

    So for example, i have a weblist.txt

    www.helenarohner.com
    www.100porcienmexico.es
    www.24fab.com
    www.masllorensestudi.com
    www.3i-ingenieria.com
    www.360corporate.com
    www.7camiciemadrid.es
    www.centrodereuniones.com
    www.ab-internacional.com
    www.aba-abogadas.com
    

    Like this one and i would like to get the contact mail from these websites, so i came to the idea of reading the html tags and take the href="mailto:test@test.com" where i can find this contact mail. Is there any command i can use for this? like curl o wget?

    Edit: i found wget -r --no-parent URL can download all website files and then i could scan them, but i would like to know if i can do this process without downloading.

    PD: Some of the example websites are down i know, pls dont close my post until i accept the answer or i feel like i get it. Thanks.




    TypeError: this.props.onIncrement is not a function

    I,m totally new in react and try to create counter app but when i try to move counters component functionality to the main App.js i receive an error in counter component. I will be very thankful for help enter image description here

    Counters component

    import React, { Component } from 'react';
    import Counter from './counter';
    class Counters extends Component {
    render() { 
        return (
        <div>
            <button 
            className="btn btn-primary btn-large m-2" 
            onClick={this.props.OnReset}
            >Reset
            </button>
    
           {this.props.counters.map(counter => (
           <Counter 
           key={counter.id} 
           onDelete ={this.props.OnDelete} 
           onIncrement ={this.props.OnIncrement}
           counter={counter}
           />
          ))}
        </div>
        );
    }
    

    }

    render part from App.js

    render(){
    return (
      <React.Fragment>
        <NavBar/>
        <main className="container">
          <Counters
          counters={this.state.counters}
          onReset = {this.handleReset}
          onDelete ={this.handleDelete} 
          onIncrement ={this.handleIncrement}
          />
        </main>
      </React.Fragment>
    
    
    );
    

    }




    Select C++ Web framework for Linux web development [closed]

    Appreciate to share your experience to select a C++ open source for Linux web development, in terms of easy programming, nice web presentations, providing continuity of simple start to more feature expansions.

    Boost beast (not the framework, more works?), Wt, Qdjango, TreeFrog, CppCMS ...

    Thank you.




    I can't make my website responsible for phones [closed]

    Hi this is my website in Android phone size, It is not very good at this size. How can I add some CSS code to put it on the downside of the image just in mobile size? Actually, I know how to put it there but It appears also for pc size.




    How to set custom domain in laravel

    I make project laravel in local 127.0.0.1:8000/create but when I deploy it must 127.0.0.1:8000/project1/create

    how to set, root domain to 127.0.0.1:8000/project1/

    web server using apache




    lundi 29 mars 2021

    UnityWebRequest cannot receive data in some urls response

    I have some problems with UnityWebRequest.

    I have several URLs to communicating with my server. Some URLs working fine expectly and other few URLs not working expectly.

    It's a weird thing that there is no error in any unity and my server. My server respond with status 200 normally, but Unity client cannot receive any data from the server. (And later showed unity editor curl error 42 callback aborted in console) So I had testing my server on POSTMAN, Restlet Client, Curl, and even testing Axios on javascript. and it's working perfectly. and I think response data size does not matter about this problem because other working URLs data is the much bigger than response data size

    I don't know why UnityWebRequest cannot receive any data in some URLs responses.

    My web server using spring framework and unity client version is 2019.2.12f1 and I tried 2019.3.0.f1 but it's not working too.

    I think there is no matter about the server because the server respond with 200 and done with communication.

    Thanks for reading my problem and please give me some advice about solving this problem.

    UPDATE:

    here is my request code

    private IEnumerator SendPutRequest() {
            var req = new UnityWebRequest("not/wokring/uri") {
                downloadHandler = new DownloadHandlerBuffer(),
                uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(requestBody)) {
                    contentType = "application/json"
                }
            };
            req.SetRequestHeader("Authorization", "ACCESS TOKEN");
            req.method = UnityWebRequest.kHttpVerbPUT;
    
            yield return req.SendWebRequest();
    
            Logger.Debug(this, req.downloadHandler.text);
        }
    



    How to serve 2 different flask domain on single VPS server?

    I am trying to serve 2 website(domain1.com and domain2.com) running on flask with 2 different domain on 1 VPS server. I have configure the domain.conf files but now with I run the domain1.com I am getting the website but when I run domain2.com I am getting apache default website. Below is my snippet of conf file . appreciate if can help. Thanks.

    Domain1 conf file.

    <VirtualHost www.domain1.com:80>
    
             ServerName domain1.com
             ServerAlias www.domain1.com
    
             Redirect permanent / https://domain1.com/
    
            # DocumentRoot /var/www/html/domain1/app.wsgi
            WSGIScriptAlias /app1  /var/www/html/domain1/app.wsgi
            <Directory /var/www/html/domain1>
            Order allow,deny
            Allow from all
            </Directory>
    
           
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    </VirtualHost>
    <IfModule mod_ssl.c>
    <VirtualHost _default_:443>
             WSGIScriptAlias / /var/www/html/domain1/app.wsgi
            <Directory /var/www/html/domain1>
            Order allow,deny
            Allow from all
            </Directory>
    
             ErrorLog ${APACHE_LOG_DIR}/error.log
             CustomLog ${APACHE_LOG_DIR}/access.log combined
        </VirtualHost>
    </IfModule> 
    

    Domain 2

    <VirtualHost www.domain2.com:80>
    
    #        ServerAdmin webmaster@localhost
             ServerName domain2.com
             ServerAlias www.domain2.com
    
    #         Redirect permanent / https://domain2.com/
    
    #        DocumentRoot /var/www/html/domain2/app.wsgi
            WSGIScriptAlias /app2  /var/www/html/domain2/app.wsgi
            <Directory /var/www/html/domain2>
            Order allow,deny
            Allow from all
            </Directory>
    
            # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
            # error, crit, alert, emerg.
            # It is also possible to configure the loglevel for particular
            # modules, e.g.
            #LogLevel info ssl:warn
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost> 
    

    APP wsgi setup for both files are the same, just change the last name(domain1 to domain2)

    import sys
    sys.path.insert(0, "/var/www/html/domain1")
    from init import app as application 
    



    Clear RouteReuseStrategy on certain page

    I implement RouteReuseStrategy on my project, then I specifically stated certain component can be reuse. Now my question is when I am in certain page, I wish to clear all the snapshot and reset all the reuse component. What is the best approach I can do?

    Sample flow of my page

    page A --> page B (cache for reuse) --> page C
    
    page C --> page A (I wish to clear cache here)
    

    I know we can implement a function to clear handlers in this CustomReuse class but whenever I call the function on other component I will hit NullInjectorError: StaticInjectorError(AppModule)

    Below are my RouteReuseStrategy code

    export class CustomRouteReuseStrategy implements RouteReuseStrategy {
      
      private handlers = new Map<string, DetachedRouteHandle>();
      
      constructor() {
    
      }
    
      shouldDetach(route: ActivatedRouteSnapshot): boolean {
        return true;
      }
    
      store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle): void {
        this.handlers[route.url.join("/") || route.parent.url.join("/")] = handle;
      }
    
      shouldAttach(route: ActivatedRouteSnapshot): boolean {
        return !!this.handlers[route.url.join("/") || route.parent.url.join("/")];
      }
    
      retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle {
        return this.handlers[route.url.join("/") || route.parent.url.join("/")];
      }
    
      shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {
        return future.routeConfig === curr.routeConfig;
      }
    



    how can i apply join query in codiginator with where clause?

    `

    $this->db->select('*');
          $this->db->from('doctor_list');
          $this->join('status','doctor_list.id != status.doctor','inner');
          $this->db->where('status.app_date',$_POST['date']);
          $query=$this->db-get();
    

    `

    I used this...I am getting call to undefined method




    Is variable shared in ASP.NET C#?

    When I define a variable as below:

    public static int x;
    

    The program works properly but the variable is shared by users who enter the site. So the program doesn't work when users access at same time.

    If I define a variable as below:

    private int x;
    

    the program doesn't work properly. for example, Can't find where checkbox true is.

    The below code is for finding where the user check changed most recently.

    public static CheckBox[,] cbs = new CheckBox[14, 28];
    public static bool[,] diffmap = new bool[14, 28];
    

    or

    private CheckBox[,] cbs = new CheckBox[14, 28];
    private bool[,] diffmap = new bool[14, 28];
    
    
    
    protected void CBs_CheckedChanged(object sender, EventArgs e)
    {
        int cur_x = 0;
        int cur_y = 0;
    
        int num_reserve = 0;
    
        for (int i = 0; i < 14; i++)
        {
            for (int j = 0; j < 28; j++)
            {
                if (cbs[i, j].Checked != diffmap[i, j])
                {
                    cur_x = i;
                    cur_y = j;
                    break;
                }
            }
        }
    
    
        for (int i = 0; i < 14; i++)
        {
            for (int j = 0; j < 28; j++)
            {
                diffmap[i, j] = cbs[i, j].Checked;
            }
        }
    
    }
    



    What is the Difference between running react native code on Web Browser and Expo GO?

    I am running React Native Code on the Web browser and in Expo Go. In the web browser, it runs fine without any error but in Expo Go, it is not importing even a single module and showing module not found error again and again on almost all modules even after reinstalling them and also reinstalling node_modules.

    Can anyone tell what's the difference between running react-native code on Expo Go and Web Browser?

    Also what is this issue and how to solve it?




    How can I use a library such as requests-html to substitute image sources of local files on the web server in html source code to the url + local file

    Remember when we were younger and we copied the source code of a website and did not understand why it broke so much?



    Well as I know now it is because if you do not have webserverfile.png downloaded, it can not render.

    How can I use python to replace

    <img src='webserverfile.png'> to <img src='webserverurl/webserverfile.png'>
    

    Note: I do not need help getting the source of the site, I know how to do that with requests.

    Also Note: If you can just use native python syntax like replace or startswith than you do not need to use for example bs4 or requests-html to do it.

    Also if the site already uses webserverurl/webserverfile I do not want to replace it to webserverurl/webserverurl/webserverfile.png




    Trying to scrape Aliexpress

    So I am trying to scrape the price of a product on Aliexpress. I tried inspecting the element which looks like

    <span class="product-price-value" itemprop="price" data-spm-anchor-id="a2g0o.detail.1000016.i3.fe3c2b54yAsLRn">US $14.43</span>

    I'm trying to run the following code

    '''

    import pandas as pd
    from bs4 import BeautifulSoup
    from urllib.request import urlopen
    import re
    
    url = 'https://www.aliexpress.com/item/32981494236.html?spm=a2g0o.productlist.0.0.44ba26f6M32wxY&algo_pvid=520e41c9-ba26-4aa6-b382-4aa63d014b4b&algo_expid=520e41c9-ba26-4aa6-b382-4aa63d014b4b-22&btsid=0bb0623b16170222520893504e9ae8&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_'
    
    source = urlopen(url).read()
    soup = BeautifulSoup(source, 'lxml')
    soup.find('span', class_='product-price-value')
    

    ''' but I keep getting a blank output. I must be doing something wrong but these methods seem to work in the tutorials I've seen.




    Is there any command line style web framework?

    In the Python community, there is a popular library prompt-toolkit that allows us to build a command-line tool with auto-completion and syntax highlighting. Some popular tools like mycli are built with it.

    When I start to build a web app that will be used by the development team, I don't want to build an app with a complex GUI as it may take time and I am not really good at it. An idea comes to my mind that it would be much easier to build this app if I can use command-line UI instead of traditional GUI. The user sends a command to the app by typing text in the browser, with the help of auto-complete and global search, and a rich-media message will be received after the command being executed.

    I have done some research by myself and found there is a similar concept named Conversational UI that design for chatbots. But what I want is different from it as Conversational UI is designed for chat, which uses natural language while the app I want to build is more like a command-line tool. I want to have a UI like mycli which runs in the browser instead of the terminal.

    Is there any existed solution that I can stand on, or I have to build such a tool myself? I find there are tools build with a similar idea: https://github.com/kubernetes-sigs/kui.




    I have a error when i try to download wordpress

    enter image description here I don't know what cause it.




    API with JWT trying to authenticate without OWIN

    Hi so I am new to all of this so please bare with me if this is a silly question. I have so far figured out how to generate a JWT and validate it (created a little program while learning). I have also learnt how to create a web api (again created a little program which queries the db and shows in postman). What I am trying to accomplish is that we want to create api so our customers can create their own site/apps. we are using JWT so how would I tell all my controllers to first go off and validate the JWT coming in the url. It will also be base64 encoded with the claims being encrypted. However I know what i need to do with all of that as I have been playing around. My issue is how do i tell a call to one of what will be many controllers to first go off and validated the token. I have looked online and it seems that a lot use OWIn which i do not have the luxury off.

    Thanks




    user permissions like yes or no at admin side [closed]

    how to give permission like yes or no using checkbox…so could I handle that at admin side in PHP. enter image description here




    How to post your website in a search engine [closed]

    Can someone tell me how to upload your website on the Google and other search engines in detail please help 🆘🆘🆘




    Populating different SQL search results in modal

    My SELECT SQL query has multiple rows. I echo the title only and when the user to clicks 'more' button I want more information to appear in a modal.

    The code I use keeps opening details of the first row even though I select different titles.

    How can I make my modal to show information that corresponds to the title?




    Php Issue - ERR_TOO_MANY_REDIRECTS

    Up until recently my web application was working fine. Then when I try visiting the site im getting a ERR_TOO_MANY_REDIRECTS error. Nothing has changed with the site and this has been working for several years without issue. I have checked with the hosting company to confirm nothing has automatically updated such as the PHP version etc. When I look at the error logs this states an issue with line 161 below.

    if( ! $session->contains('waste_uuid') or ! $session->contains('waste_pwd') )
    

    Why all of a sudden would the site just stop working? Im perplexed as nothing has changed. The code has remained the same. Any help with this would be much appreciated.

    I have tried clearing down all the logs, clearing the caches etc thinking this may be causing the issue however no luck.

    Full Code block I believe is affected

    static protected function installCredentials()
        {
            $session    = &self::$registry->session();
            $request    = &self::$registry->request();
            $output     = &self::$registry->output();
            $db         =  self::$registry->db();
                            
            do
            {
                if( ! $session->contains('waste_uuid') or ! $session->contains('waste_pwd') )
                {               
                    //if( ! strcasecmp($request['app'], 'account') and ! strcasecmp//($request['module'], 'login') )
                        //return ;
                                    
                    break;
                }
                            
                $session_uuid = $session['waste_uuid'];
                $session_pass = $session['waste_pwd'];
                
                $credentials = $db->scalar(array (
                    'select'    => '*',
                    'from'      => 'users',
                    'where'     => '`id` = ? and `password` = ?',
                    'params'    => array( $session_uuid, $session_pass )
                ));
                            
                if( ! $credentials || $credentials['disabled'] == '1' )
                {
                    $session->removeSession('waste_uuid');
                    $session->removeSession('waste_pwd');
                    
                    if( ! strcasecmp($request['app'], 'account') and ! strcasecmp($request['module'], 'login') )
                        return ;
                    
                    break;
                }
                
                $kick = $db->scalar(array (
                    'select'    => 'kick',
                    'from'      => 'users_online',
                    'where'     => 'user_id = ?',
                    'params'    => array( $credentials['id'] )
                ));
                
                if( $kick && $kick['kick'] == '1' )
                {
                    $session->removeSession('waste_uuid');
                    $session->removeSession('waste_pwd');
                    
                    $statement = $db->prepare('UPDATE `users_online` SET `kick` = ? WHERE `user_id` = ?');
                    $statement->execute(array( '0', $credentials['id'] ));
                    
                    if( ! strcasecmp($request['app'], 'account') && ! strcasecmp($request['module'], 'login') )
                        return ;
                    
                    break;
                }
                
                $credentials['group'] = $db->scalar(array (
                    'select'    => '*',
                    'from'      => 'groups',
                    'where'     => 'id = ?',
                    'params'    => array( $credentials['group'] )
                ));
                
                $credentials['sites'] = $db->all(array (
                    'select'    => 'site_id',
                    'from'      => 'sites_users',
                    'where'     => 'user_id = ? and disabled = ?',
                    'params'    => array( $credentials['id'], '0' )
                ));
                
                $user = registry::getClass('user', array( self::$registry ));           
                $user->merge($credentials);
                            
                self::$registry->resolveUser($user);
                self::$registry->output()->atomize(array (
                    'menu'          => array (),
                    'breadcrumb'    => array (),
                    'title'         => array ()
                ));
                
                $user->detect_notifications();
                
                if( $user['opt_messages'] == '1' )
                    $user->detect_chats();
                
                $logger = registry::getClass('logger', array( self::$registry ));
                self::$registry->resolveLogger($logger);
                
                self::registerActivity();
                
                return ;
            }
            while (false);
                    
            $output->redirect('login'); 
        }
    



    connecting with mysql database failed [closed]

    i download a website from github and i have this issue when i connect to database The requested URL was not found on this server.




    Python DJANGO input fields

    Hi Mans. I want to make simple "calculator" on django app. I want to make 2 fields. Visitor put 2 numbers into fields and multiplication this numbers. I want to make input1 = 2, input2 = 3 and output will be 6. only this inputs make customer on website. Thanks for help and hve a great day




    Could not post value to web API using IFormFile

    i have a web application that does an action to upload image to api the code like this

    [HttpPost]
    public async Task<IActionResult> Upload([FromForm] UploadModel model)
    {
        var upload = AccountApi.UploadFile(model);
        return Ok("OK");
    }
    
    public static object UploadFile(UploadModel model)
    {
        RestClient client = InitClient();
        request.Resource = "Account/UploadFile";
        request.Method = Method.POST;
        request.AddJsonBody(model);
        IRestResponse<object> response = client.Execute<object>(request);
        return response.Data;
    }
    
    public class UploadModel
    {
        public long UserId { get; set; }
        public string Token { get; set; }
        public IFromFile File { get; set; }
    }
    

    and there's a web API to handle Rest request above the code like this

    [HttpPost("UploadFile")]
    public async Task<object> UploadFileAction(UploadModel model)
    {
        // the code handle upload file request here
        return "Success";
    }
    

    my issue is the UploadModel model in web application contains the right value that requested from front-end (UserId = 10, Token = "eyJ..........", File = [object]) but when it posted to API, the 3 properties in UploadModel didn't get the value posted from web application (UserId = 0, Token = null, File = null)

    could you help me to find the solution for this. Thanks all




    initialize client socket in node file that will be sent

    I send information to clients from a nodejs server like this :

    app.get([...]
        let index = await readFileAsync(path.join(__dirname, 'file.js'), 'utf8');
        res.send(index);
    )
    

    I want to initialise a socket in my file.js.

    In the socket io documentation, you can do this:

    <script src="/socket.io/socket.io.js"></script>
    <script>
      var socket = io();
    </script>
    

    So I try to copy/paste socket.io.js directly in my file.js and add var socket = io(); at the end, but I got this error on my client : GET http://127.0.0.1:5500/socket.io/?EIO=4&transport=polling&t=NXz6N1S 404 (Not Found)

    There is a way to initialize my client socket in the file.js?




    Jquery load function don't execute javascript the second time

    Well, here is a mysterious problem, i'll explain :

    I want to load a page into a div with the jquery load function. In my included file, i have some html, and a js script. My script, in a dom ready, (for test purposes) replace the content of a p balise.

    I load this page on a button click event.

    When i click it the first time, it all works. When i click the second time, all works, except that the javascript isn't executed.

    What i tested :

    • Using dom ready or not (no difference)
    • Removing php in my include file (no difference, and i was desperate lol)
    • Removing success callback function from load method (again, no difference)

    index.php (simplified):

    <div id="truc">
    </div>
    <script>
    $(function () {
        $('button#test').on('click', function () {    
            $('#truc').load('truc.inc.php');
        });
    });
    </script>
    

    truc.inc.php :

    <div>
        <p id="brebis">Je suis une brebis</p>
    </div>
    
    <script>
        $(function () {
            $('#brebis').text($('#brebis').text() + " égarée");
        });
    </script>
    

    First time it shows "Je suis une brebis égarée", second time "Je suis une brebis"

    Do you guys have an idea ?




    dimanche 28 mars 2021

    Changing website hyperlink target from link to your choice on your computer [closed]

    See in the image as I opened NASA (NASA as an example ). Now if there you see the cursor is in pointer form which on clicking opens another webpage now if I want to change that webpage link like if it opens to any NASA project so I change it adding a photo to my choice only on my computer how can I do it

    image of a link in nasa




    Click on submit button which does not have an id using selinium

    i have tried to click on the submit button using on submit function but i cant see the result, the website i am trying to scrape is

    Jntuh

    The submit button has the following properties

    <input type="submit" value="Submit">
    

    i have used this .execute script

    Resultbrowser.execute_script("""document.getElementById("myForm").onsubmit();""")
    

    i dont know if the website has an on submit function

    Entire code




    How to Configure a Web Audio PannerNode to be Larger than One Point?

    How do I configure a PannerNode to be larger than one point?

    I have an object that is a right triangle shape, with a bounding box that is 10 by 10. How do I make it so that:

    1. While the listener is approaching any point on the flat side, the sound will be strait from the listener along any point of that side
    2. When the user enters the object the sound will play equally in both speakers while the user is in the object
    3. When the user is outside of the object at the center of the hypotenuse, the sound is coming from multiple directions at once, like forward and right?

    I have been looking at the cone attributes (PannerNode.coneInnerAngle, PannerNode.coneOuterAngle, and PannerNode.coneOuterGain), but they look like they only deal with the 1 point size of the sound object and change what direction the sound is facing (like in the Boombox example).

    I'm probably misunderstanding how the attributes work, but it doesn't seem as if the Web Audio API allows for multiple sized sound objects.

    The only solution I have found, is to calculate the nearest point to the listener, and change the object's position to be that nearest point every time the listener moves. When the listener is inside the object, the sound is positioned at the same location as the user. There are two major problems with this approach:

    1. It is extremely slow updating the nearest point of multiple complex objects.
    2. This approach does not handle sounds coming from multiple sides of the user.

    Please let me know what I can do to make sounds larger than one point.

    Thank you,




    Can i use JNI in a java based web application? If so how to do that?

    I am currently working on a project which uses JNI , but i dont know how to exactly do that in a web based application. Anyone help to resolve this.

    Thanks in advance!!1




    Inheritance in Css [closed]

    I was learning different type of inheritance and I came across Revert. I was trying to use it and veerytime it did something else I wanted it to do. SO can someone in quick easy words explain what revert actualy means?




    need help to loggin into my sql management studio

    Iam really stuck.. I have a local database in my Sql management server. Once i upload my website to filezilla and when trying to access it online, it wont show.

    Iam working in C#

    and my webconfig file is like:

    . I cannot log into sql server authentication using any info my host has sent me. So i have no idea what it can be.

    I just need some help please. Iam new to this.




    How to dynamically embed a pdf(locally stored in browser) in HTML?

    I tried to use embed and iframe tags which work for the first page.

    <iframe src="~/Documents/Upload/myPDF.pdf" id="pdfDisplay"> 
    

    But when I try to change the src in javascript, I get the same page displayed over again.

    document.getElementById('pdfDisplay').setAttribute("src", "~/Documents/TextDetection/Upload/" + files[currentIndex]);
    

    Where files[current] is the dynamically generated filename that exists in the local storage.

    I don't know what I am doing wrong because its not working.




    Webscraping with Python Requests and getting Access Denied even after updating headers

    this webscraper was working for a while but the website must have been updated so it no longer works. After each request I get an Access Denied error, I have tried adding headers but still get the same issue. This is what the code prints:

    </html>
    
    <html><head>
    <title>Access Denied</title>
    </head><body>
    <h1>Access Denied</h1>
    
    You don't have permission to access "http://www.jdsports.co.uk/product/white-nike-air-force-1-shadow-womens/15984107/" on this server.<p>
    Reference #18.4d4c1002.1616968601.6e2013c
    </p></body>
    </html>
    

    Heres the part of the code to get the HTML:

    scraper=requests.Session()
    
    headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
    }
                
    html = scraper.get(info[0], proxies= proxy_test, headers=headers).text
    soup = BeautifulSoup(html, 'html.parser')
    
    print(soup)
    stock = soup.findAll("button", {"class": "btn btn-default"})
    

    What else can I try to fix it? The website I was to scrape is https://www.jdsports.co.uk/




    I Just want To Play Animation With Audio In model-viewer

    I want to augment an animated 3d model in model-viewer where the animation should play in sync with audio. I have the implementation but there is some issue with augmentation surface pointing and audio sync with different browsers (Android And iOs) . Glitch Editor

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <title>&lt;model-viewer&gt; example</title>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
    
        
    
        <!-- The following libraries and polyfills are recommended to maximize browser support -->
        <!-- NOTE: you must adjust the paths as appropriate for your project -->
    
        <!-- 🚨 REQUIRED: Web Components polyfill to support Edge and Firefox < 63 -->
        <script src="https://unpkg.com/@webcomponents/webcomponentsjs@2.1.3/webcomponents-loader.js"></script>
    
        <!-- 💁 OPTIONAL: Intersection Observer polyfill for better performance in Safari and IE11 -->
        <script src="https://unpkg.com/intersection-observer@0.5.1/intersection-observer.js"></script>
    
        <!-- 💁 OPTIONAL: Resize Observer polyfill improves resize behavior in non-Chrome browsers -->
        <script src="https://unpkg.com/resize-observer-polyfill@1.5.0/dist/ResizeObserver.js"></script>
    
        <!-- 💁 OPTIONAL: Fullscreen polyfill is required for experimental AR features in Canary -->
        <!--<script src="https://unpkg.com/fullscreen-polyfill@1.0.2/dist/fullscreen.polyfill.js"></script>-->
    
        <!-- 💁 OPTIONAL: Include prismatic.js for Magic Leap support -->
        <script src="https://unpkg.com/@magicleap/prismatic/prismatic.min.js"></script>
        
        
      </head>
      <body>
      
          <!-- pfc sync between audio time and model-viewer animation time -->
        <script>
          function Sync(selector, audioSelector) {
            var checkExist = setInterval(function() {
              if (document.querySelector(selector) != null) {
                var modelViewer = document.querySelector(selector);
                var sound = document.querySelector(audioSelector);
    
                sound.addEventListener("timeupdate", () => {
                  modelViewer.currentTime = sound.currentTime;
                });
    
                
                var promise = sound.play();
                if (promise !== undefined) {
                  promise
                    .then(_ => {
                      // Autoplay started!
                    })
                    .catch(error => {
                      // Autoplay was prevented.
                      // Show a "Play" button so that user can start playback.
                    });
                }
                
                
                clearInterval(checkExist);
              }
            }, 1000);
          }
        </script>  
      <!-- 
      Penguin + Train Sound = ok
      "https://cdn.glitch.com/7d7e8236-5fa5-4809-ab74-eb6bf2bef1c6%2Fmodel.glb?sound=https://cdn.glitch.com/99537520-86ee-43b2-9c9a-4e6b399f9e42%2FSteamTrain.ogg&link=https://prefrontalcortex.de"
    
      Train + Train sound = kein Sound
    "https://cdn.glitch.com/99537520-86ee-43b2-9c9a-4e6b399f9e42%2FTrain-br111.glb?sound=https://cdn.glitch.com/99537520-86ee-43b2-9c9a-4e6b399f9e42%2FSteamTrain.ogg&link=https://prefrontalcortex.de"
       --> 
        
      <model-viewer
            src="https://cdn.glitch.com/7fa75de4-559e-4a0e-9d57-bbfce6666947%2FTrainAnimated-Blender-3.glb?sound=https://cdn.glitch.com/99537520-86ee-43b2-9c9a-4e6b399f9e42%2FSteamTrain.ogg&link=https://google.com"
            ios-src="https://cdn.glitch.com/7fa75de4-559e-4a0e-9d57-bbfce6666947%2FTrain-br111-fixedTangents.usdz?sound=https://cdn.glitch.com/7fa75de4-559e-4a0e-9d57-bbfce6666947%2FSteamTrain.mp3&link=https://google.com"
            ar
            background-color="#fffff"
            alt="BR 111"
            exposure="1"
            shadow-intensity="1"
            camera-controls
            auto-rotate
            autoplay
            quick-look-browsers="safari chrome"
            id="modelviewer"
            style="position:absolute; left:0; top:0; margin:0; padding:0; width:100%; height:100%;"
          >
      </model-viewer>
    
      <section class="attribution">
      <span>
            <span><audio controls autoplay loop id="sound">
                  <source src="https://cdn.glitch.com/99537520-86ee-43b2-9c9a-4e6b399f9e42%2FSteamTrain.ogg" type="audio/ogg">
                  <source src="https://cdn.glitch.com/7fa75de4-559e-4a0e-9d57-bbfce6666947%2FSteamTrain.mp3" type="audio/mp3">  
              </audio></span>
          </span>
        </section> 
        
        <script>
            Sync("#modelviewer", "#sound");
        </script>  
        
        <!-- 💁 Include both scripts below to support all browsers! -->
        <!-- Import the component -->
        <script
          type="module"
          src="https://unpkg.com/@google/model-viewer/dist/model-viewer.js"
        ></script>
        <script
          nomodule
          src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"
        ></script>
      </body>
    </html>

    Can any one help me fixing the issue . The audio is not properly in sync with the animated model. The Model rendering is also having some issue . Thank in Advance