dimanche 28 février 2021

In 12 grid bootstrap system is there a need to design for each and every breakpoint?

I have already provided designs for 19201080 and 360760 will be providing designs for the tablet version so is there a need to provide designs of every breakpoint or can it be made responsive with 3 designs for desktop tablet and mobile and can these designs be used for Mac as well, I have specified the breakpoints below. 360px to 719px 720px to 1079px 1080px to 1295px 1260px to 1439px 1800pn to ..




The attempt to bind "/%PUBLIC_URL%/manifest.json" in the workspace failed as this URI is malformed when running on Netlify

Having this error on my website when it goes live but the error is not shown in local:host just for the live build. I cannot seem to find a solution. Help would be great! [the error that is shown when inspecting the website][1] [1]: https://ift.tt/3dSz17f

  "short_name": "TestWeb",
  "name": "TestWeb",
  "description": "Best Place On Earth",
  "icons": [
    {
      "src": "favicon.ico",
      "type": "image/x-icon",
      "sizes": "256x256"
    }
  ],
  "start_url": ".",
  "display": "standalone",
  "theme_color": "#000000",
  "background_color": "#ffffff"
}



cannot be cast to jakarta.servlet.Servlet [duplicate]

I am studying Java Web. I added the dependency and created a servlet class. After starting tomcat, I received the errors that this is not a servlet and cannot be cast to jakarta.servlet.Servlet. Could you help me find what the root cause is?

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class HelloServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("hello servlet");
        PrintWriter writer = resp.getWriter();
        writer.print("hello,servlet");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req,resp);
    }
}



Apache Web Errors

We've recently been getting these errors under load. We think it might have to do with Apache or the Web server running out of connections but can't seem to tell if that is the issue or not. Both of these happen at the same time. One in the app logs, one in the web logs.

"POST /api/url/url HTTP/1.1" - 29

message(connect() failed (PORT)(IP)) function(bool Client::mConnectInternal(bool)) errno(99/Cannot assign requested address) pid(28004)

Anyone experience this?




when i try to use npm i apify command i get 243 error

-Latitude-E7240:~/apifyScraper$ npm i apify npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm ERR! code 243 npm ERR! path /home/susant/apifyScraper/node_modules/better-sqlite3-with-prebuilds npm ERR! command failed npm ERR! command sh -c prebuild-install || npm run build-release

npm ERR! A complete log of this run can be found in: npm ERR! /home/susant/.npm/_logs/2021-03-01T01_25_15_665Z-debug.log




Is it possible to make a webview inside webpage?

I have got regular webpage with url one. Is there a way to make a window inside it that will open URL two? So the user will be on URL one but part of the page will show content of URL two?

enter image description here




Collapsed menu page

I saw a site on the Internet with a collapsible side menu

Collapsed menu

Expanded menu

Help please, stalled - I really need help. It seems to me that the error is inside the js code. There is a code (should collapse into a column on the side when the icon is clicked and expand on hover)

<style type="text/css">
  * {
    list-style: none;
    text-decoration: none;
    margin: 0;
    padding: 0;
  }
  
  ul {
    background: #afafaf;
    display: inline-block;
    width: 420px;
    border-right: 1px solid #000;
  }
  
  ul li {
    padding: 6px 0;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
  }
  
  ul li:hover {
    background: lightgreen;
  }
  
  ul li a {
    color: #000;
  }
  
  ul li:hover a,
  ul li:hover .fa {
    color: #fff;
  }
  
  ul li .fa {
    display: inline-block;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .leftside {
    margin-left: 16px;
    display: inline-block;
    width: 30px;
    height: 30px;
    display: inline-flex;
  }
  
  .rightside {
    margin-right: 16px;
    visibility: hidden;
    width: 30px;
    height: 30px;
    display: inline-flex;
  }
  
  .centerplace {
    width: 328px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .nestedblock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
  }
</style>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="testsite.js">
  let elemmenuitemli = document.querySelectorAll('.fa');
  let sidemenu = document.querySelector('#sidemenu');

  elemmenuitemli.addEventListener("onmouseenter", checkitem);
  elemmenuitemli.addEventListener("onmouseleave", checkitem);


  function checkitem() {
    if sidemenu.classList.contains("active") {
      /* Удаление меню ul*/
      sidemenu.delete();
      /* Сворачивание меню ul */
      <
      ul id = "sidemenu" >
        <
        li >
        <
        div class = "leftside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        /li> <
        li >
        <
        div class = "leftside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        /li> <
        li >
        <
        div class = "leftside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        /li> <
        li >
        <
        div class = "leftside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        /li> <
        /li> <
        /ul>
    }
    else {
      /* Удаление меню ul*/
      sidemenu.delete(); <
      ul id = "sidemenu" >
        <
        li >
        <
        div class = "leftside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        div class = "centerplace" >
        <
        a href = ""
      class = "nestedblock" > Техника для кухни < /a> <
        /div> <
        div class = "rightside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        /li> <
        li >
        <
        div class = "leftside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        div class = "centerplace" >
        <
        a href = ""
      class = "nestedblock" > Бытовая техника для дома < /a> <
        /div> <
        div class = "rightside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        /li> <
        li >
        <
        div class = "leftside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        div class = "centerplace" >
        <
        a href = ""
      class = "nestedblock" > Ноутбуки и компьютеры < /a> <
        /div> <
        div class = "rightside" >
        <
        i class = "fa fa-home" > < /i> <
        /div>     <
        /li> <
        li >
        <
        div class = "leftside" >
        <
        i class = "fa fa-home" > < /i> <
        /div> <
        div class = "centerplace" >
        <
        a href = ""
      class = "nestedblock" > Комплектующие < /a> <
        /div> <
        div class = "rightside" >
        <
        i class = "fa fa-home" > < /i> <
        /div>     <
        /li> <
        /li> <
        /ul>
      sidemenu.classList.add('active');
      /* Разворачивание меню ul */
    }
  }
</script>
<ul id="sidemenu">
  <li>
    <div class="leftside">
      <i class="fa fa-home"></i>
    </div>
    <div class="centerplace">
      <a href="" class="nestedblock">Техника для кухни</a>
    </div>
    <div class="rightside">
      <i class="fa fa-home"></i>
    </div>
  </li>
  <li>
    <div class="leftside">
      <i class="fa fa-home"></i>
    </div>
    <div class="centerplace">
      <a href="" class="nestedblock">Бытовая техника для дома</a>
    </div>
    <div class="rightside">
      <i class="fa fa-home"></i>
    </div>
  </li>
  <li>
    <div class="leftside">
      <i class="fa fa-home"></i>
    </div>
    <div class="centerplace">
      <a href="" class="nestedblock">Ноутбуки и компьютеры</a>
    </div>
    <div class="rightside">
      <i class="fa fa-home"></i>
    </div>
  </li>
  <li>
    <div class="leftside">
      <i class="fa fa-home"></i>
    </div>
    <div class="centerplace">
      <a href="" class="nestedblock">Комплектующие</a>
    </div>
    <div class="rightside">
      <i class="fa fa-home"></i>
    </div>
  </li>
  </li>
</ul>

Why doesn't it work in the above way?




How to use custom domain instead of localhost on Flask?

I have python programm that uses Flask to send request/response. Flask do it on localhost (http://127.0.0.1:5000/). How to replace it with my domain *****.tk ?




Django static tags don't recognize cPanel

enter image description here

this is my HTML file




PHP vs Node.js for video sharing website, which would make more sense? [closed]

I'm trying to create a similar website like YouTube, where people can upload and share videos, my question is for the backend should I use PHP or Node.js, which makes more sense? From research I can see Node.js is faster, but PHP is easier? Is there any negatives to just using PHP? and if so what are the positives of switching and using Node.js instead? Thanks for your help much appreciated.




How Do I Make It Download A File When You Click The Button [duplicate]

<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Exite Premium</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css'><link rel="stylesheet" href="style3.css">

</head>
<body>
<!-- partial:index.partial.html -->
<div class='button'>
<h1>Exite Premium</h1>
<a>
 <i class='ion-social-codepen'></i>
 <span>Click Donwload To Get Premium</span>
</a>
<input id='button' type='checkbox'>
<label for='button'>
 <div class='button_inner q'>
   <i class='l ion-log-in'></i>
   <span download href="serious-rick.jpg" class='t'>Download</span>
   <span>
     <i class='tick ion-checkmark-round'></i>
     <input type="button" href="serious-rick.jpg" download>
   </span>
   <div class='b_l_quad'>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
     <div class='button_spots'></div>
   </div>
 </div>
</label>
</div>
<!-- partial -->

</body>
</html>

Please Could I Get A Solution To This In The Language HTML or JavaScript Since I Would Like It When You Click The Button it Downloads A File

All That Happens is An Animation And I Have No Way To Make it download i file when you click the download butt, since it isn't a conventional button me And A Few Other People Have Tried Fixing But We Had No Luck I Would Appreciate Some Help On This




Slider within an image

Any advise on creating a slider within an image? Similar Lyft's website

https://www.lyft.com/drive-with-lyft/

enter image description here




Array type is undefined despite declaring, asigning a value and filling the array? [duplicate]

I'm designing a game in JavaScript and have encountered the following issue wich despite research I cannot fix.

I have a Map class (shown below) that has the attribure tiles. During the contructor, I assign tiles to a new array and fill the array with objects.

When I then come to render, I get the error "this.tiles is undefined". If I log the value to this.tiles to the console, at the end of the constructor it is full of values: [object Object],[object Object]... yet when it reaches the render function, it prints this.tiles: undefined.

Does anyone know why this is and can explain it to me? Thanks!

Code

class Map {

    tiles = [];

    constructor(x, y, tileNumX) {
        this.x = x;
        this.y = y;
        let tileNumY = tileNumX * 3;

        for (let y = 0; y < tileNumY; y++) {
            for (let x = 0; x < tileNumX; x++) {
                this.tiles.push(new GameObject("images/game/map/tile" + getRandomValue(0, 6) + ".jpg",
                    this.x + (x * 1500), this.y + (y * 300)));
            }
        }
        console.log("tiles:" + this.tiles);
    }

    update() {

    }

    render() {
        console.log("Rendering map");

        let context = CANVAS.getContext("2d");
        context.clearRect(0, 0, CANVAS.width, CANVAS.height);
        console.log("Tiles:" + this.tiles);
    }

}

let Game = {

    start : function() {
        console.log("Game initiated!");

        this.run(new Map(0, 0, 5));
    },

    run : function (map) {
        let now,
            dt = 0,
            last = time_stamp(),
            step = 1 / 60,
            update = map.update,
            render = map.render;

        function loop() {
            now = time_stamp();
            dt = dt + Math.min(1, (now - last) / 1000);
            while (dt > step) {
                dt = dt - step;
                update(step);
            }
            render(dt);
            last = now;
            requestAnimationFrame(loop);
        }
        requestAnimationFrame(loop);
    }
}

...

Game.start();



Open and send data to authentication app from website

What is the question?

Would it be possible to send otp setup info (name, secret) to the installed authentication app (Google authenticator or Authy) via a universal link or something else?

What is the goal here?

Imagine this scenario where user wants to activate the 2FA on a website.
The available options are that:

  1. User copy the secret and then paste it into the auth app
  2. User scan the QR code with the auth app

However, we want a third option, where the user just clicks a button and the authentication app opens up automatically with prefilled data.

Requirements of the perfect solution

  1. It must works on both android and ios (If it works on desktop as well, it would be awesome)
  2. Preferably it should work for both Google authenticator and Authy
  3. Preferably it shouldn't be limited to PWA websites

Almost a similar question for android

Intent to Open Google Authenticator




How to change login link URL in shopify checkout

I have implemented an SSO service into shopify using multipass but i just finally need to edit the checkout so when someone clicks the little blue login button they are taken to my authentication url.

I am on shopify plus and can access the checkout.liquid file but no idea on how to actually just change the url within the login button.




Copy a text file to a webpage

Currently, I export a text file to my desktop from my MS Access database and copy and paste the data from the text file onto a webpage one box at a time. Is it possible to automatically export the data to the webpage? If so, how would I do this, and some of the boxes on the webpage are list boxes, how do I import that data?




I want to hide the search bar in my webpage using javascript

I am making a strip menu which turns to hamburger when the page shrinks, am doing it with js, but the search bar is next to it and gets ugly when it toggles, question is how to hide the search bar when the ham-menu is clicked.. I think i can add some lines inside the function to hide it, i have tryed a several options but didn't work

const toggleButton = document.getElementsByClassName('toggle-button')[0]
const topNav = document.getElementsByClassName('top-nav')[0]
const search = document.getElementsByClassName('search-box')[0]


toggleButton.addEventListener('click',()=> {
    topNav.classList.toggle('active') & search.style.display('none')
    
})



Python Proxy Request Interceptor

I am working on a vulnerability scanner for my final thesis and i am trying to scan headers and intercept them in order to read their content type, sometimes i cannot intercept all the headers because of how the web page loads, so i am trying to understand how to create a python proxy to intercept and modify all the headers that i need to.

So my questions are:

How do i do this?

How do i intercept all the headers like the ones that are send after pressing a button?

How do i config my app to work along with this proxy interceptor?

Thanks!




What Back-end technologies to use to create my website

I'm thinking to start a website where some specific people can upload and publish educative content for a specific community or for the public, I'm a python programmer with some front end web skills, Now for my website, I don't know exactly which back-end technology would be good, please when you tell me your suggestions give me the reason why, All my regards.




Default value in input function (HTML) that can't be removed

So I'm trying to create a form where user will enter their phone number. Since it's supposed to be used in single country, I want country code as a default value that can't be erased, only added to. How that could be done, or maybe there are alternative best practices for such case?

<form class="form__wrapper">
            <h2 class="form__wrapper_text">Just form</h2>
            <div class="form__wrapper_number">
                <p>Your number:</p>
                <!--<span>+380</span>-->
                <input type="tel" value="+380" o>
            </div>
</form>



HTTP load failed with status 404. Load of media resource https://ift.tt/3r5kAAl failed

So i am practicing out some stuff related javascript and now at one point i need to play sounds.But the media files don't load and keeps failing everytime. I checked for some related questions where they mentioned to check the paths altho it seems to me that my path is correct since when i click on follow link it shows that audio file on VS code. I can't figure out what is going wrong.

I have not included the css part since the error is possibly in the JS or the HTML part.But i will edit if thats needed

Exact Error: "HTTP load failed with status 404. Load of media resource http://127.0.0.1:5500/kick-sound failed."

class Drumkit {
  constructor() {
    this.playBtn = document.querySelector(".play");
    this.pads = document.querySelectorAll(".pad");
    this.kickAudio = document.querySelector(".kick-sound");
    this.snareAudio = document.querySelector(".snare-sound");
    this.hihatAudio = document.querySelector(".hihat-sound");
    this.index = 0;
    this.bpm = 150;
  }
  activePad() {
    this.classList.toggle("active");
  }
  repeat() {
    let step = this.index % 8;

    this.index++;
    const activebars = document.querySelectorAll(`.b${step}`);
    //Loop over the pads
    activebars.forEach((bar) => {
      bar.style.animation = `playTrack 0.3s alternate ease-in-out 2`;
      //Check if pads are active
      if (bar.classList.contains("active")) {
        if (bar.classList.contains("kick-pad")) {
          this.kickAudio.currentTime = 0;
          this.kickAudio.play();
        }
        if (bar.classList.contains("snare-pad")) {
          this.snareAudio.currentTime = 0;
          this.snareAudio.play();
        }
        if (bar.classList.contains("hihat-pad")) {
          this.hihatAudio.currentTime = 0;
          this.hihatAudio.play();
        }
      }
    });
  }
  start() {
    const interval = (60 / this.bpm) * 1000;
    setInterval(() => {
      this.repeat();
    }, interval);
  }
}
const drumKit = new Drumkit();
drumKit.pads.forEach((pad) => {
  pad.addEventListener("click", drumKit.activePad);
  pad.addEventListener("animationend", function () {
    this.style.animation = "";
  });
});
drumKit.playBtn.addEventListener("click", function () {
  drumKit.start();
});
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Beatmaker</title>
    <link rel="stylesheet" href="./style.css" />
  </head>
  <body>
    <div class="sequencer">
      <div class="kick-tracker">
        <div class="controls">
          <h1>Kick</h1>
          <button data-track="0" class="mute kick-volume">
            <i class="fas fa-volume-mute"></i>
          </button>
          <select name="kick-select" id="kick-select">
            <option value="./sounds/kick-classic.wav">Classic Kick</option>
            <option value="./sounds/kick-808.wav">808 Kick</option>
            <option value="./sounds/kick-heavy.wav">Kick Heavy</option>
          </select>
        </div>
        <div class="kick">
          <div class="pad kick-pad b0"></div>
          <div class="pad kick-pad b1"></div>
          <div class="pad kick-pad b2"></div>
          <div class="pad kick-pad b3"></div>
          <div class="pad kick-pad b4"></div>
          <div class="pad kick-pad b5"></div>
          <div class="pad kick-pad b6"></div>
          <div class="pad kick-pad b7"></div>
        </div>
      </div>
      <div class="snare-tracker">
        <div class="controls">
          <h1>Snare</h1>
          <button data-track="0" class="mute snare-volume">
            <i class="fas fa-volume-mute"></i>
          </button>
          <select name="snare-select" id="snare-select">
            <option value="./sounds/snare-acoustic01.wav">Classic Snare</option>
            <option value="./sounds/snare-808.wav">808 Snare</option>
            <option value="./sounds/snare-vinyl102.wav">Snare Vinyl</option>
          </select>
        </div>
        <div class="kick">
          <div class="pad snare-pad b0"></div>
          <div class="pad snare-pad b1"></div>
          <div class="pad snare-pad b2"></div>
          <div class="pad snare-pad b3"></div>
          <div class="pad snare-pad b4"></div>
          <div class="pad snare-pad b5"></div>
          <div class="pad snare-pad b6"></div>
          <div class="pad snare-pad b7"></div>
        </div>
      </div>
      <div class="hihat-tracker">
        <div class="controls">
          <h1>Hihat</h1>
          <button data-track="0" class="mute hihat-volume">
            <i class="fas fa-volume-mute"></i>
          </button>
          <select name="hihat-select" id="hihat-select">
            <option value="./sounds/hihat-classic.wav">Classic Hihat</option>
            <option value="./sounds/hihat-808.wav">808 Hihat</option>
          </select>
        </div>
        <div class="hihat">
          <div class="pad hihat-pad b0"></div>
          <div class="pad hihat-pad b1"></div>
          <div class="pad hihat-pad b2"></div>
          <div class="pad hihat-pad b3"></div>
          <div class="pad hihat-pad b4"></div>
          <div class="pad hihat-pad b5"></div>
          <div class="pad hihat-pad b6"></div>
          <div class="pad hihat-pad b7"></div>
        </div>
      </div>
      <button class="play">Play</button>
    </div>

    <audio src="kick-sound" src="./sounds/kick-classic.wav"></audio>
    <audio src="snare-sound" src="./sounds/snare-acoustic01.wav"></audio>
    <audio src="hihat-sound" src="./sounds/hihat-acoustic01.wav"></audio>
    <script
      src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/js/all.js"
      integrity="sha512-lG4ecFD33e8IENm9b2zEBGaYRXNoPlPFekN8Dlk5NXx5PrrkuVGt2cm9yeSliyKVUIeI10f8NLMO/493qeJcBg=="
      crossorigin="anonymous"
    ></script>
    <script src="./app.js"></script>
  </body>
</html>



Image upload in Laravel app does not show when uploaded to web server

I created a symbolic link with php artisan storage:link this allows laravel to link files from the public/storage folder to the storage/app/public folder.

I am able to view the images stored in the storage folder with when I work locally on my system.

However, when I upload to the web server, the image cannot be found. Although the image was uploaded successfully to the storage/app/public/images folder and the public/storage/images folder is empty.




Align with symmetry

I create an online store. The menu needs to be cleaned up. For this, 3 elements are created .leftside, .rightside, .centerplace and .nestedblock. They are used for marking (rightside must be invisible)

<html>

<head>
  <style type="text/css">
    * {
      list-style: none;
      text-decoration: none;
      margin: 0;
      padding: 0;
    }
    
    ul {
      background: #afafaf;
      display: inline-block;
      width: 420px;
      border-right: 1px solid #000;
    }
    
    ul li {
      padding: 6px 0;
      background: #fff;
      display: inline-flex;
    }
    
    ul li:hover {
      background: lightgreen;
    }
    
    ul li a {
      color: #000;
    }
    
    ul li:hover a,
    ul li:hover .fa {
      color: #fff;
    }
    
    ul li .fa {
      margin-left: 16px;
      display: inline-block;
      width: 30px;
      height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    
    .leftside {
      margin-left: 16px;
      display: inline-block;
      width: 30px;
      height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
    }
    
    .rightside {
      margin-right: 16px;
      display: none;
      width: 30px;
      height: 30px;
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
    }
    
    .centerplace {
      width: 328px;
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
    }
    
    .nestedblock {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
  </style>

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

</head>

<body>
  <ul>
    <li>
      <div class="leftside">
        <i class="fa fa-home"></i>
      </div>
      <div class="centerplace">
        <a href="" class="nestedblock">Техника для кухни</a>
      </div>
      <div class="rightside">
        <i class="fa fa-home"></i>
      </div>
    </li>
    <li>
      <i class="fa fa-star"></i>
      <a href="">Бытовая техника для дома</a>
    </li>
    <li>
      <i class="fa fa-youtube"></i>
      <a href="">Техника для прихожей и гостинной</a>
    </li>
    <li>
      <i class="fa fa-facebook"></i>
      <a href="">Телевизоры и аудиотехника</a>
    </li>
  </ul>
</body>

</html>

How can I get the icon to be on the side and the hyperlink centered using flex? (the second icon from the right is made invisible, and the picture and inscription are in the desired positions)




How to make a website home screen friendly?

If you add a bookmark on your home screen on an iPhone, you will see how different they are. Some, like BBC Future (https://bbc.com/future), look like an app when are opened, and some just redirect you to Safari.

How do I make a website that will look like an app in bookmark?

Thanks




Use home network for learning browser-server communcation

I'm really new to html, css, javascript and all kind of web development. After I coded my first own website, I'd like to play a little with communcation between the browser and a server.

I'd like to be able to access a website hosted on my PC (using my PC as "Web" server) over my home network (my router) so that I can load and use it for example on my smartphone. There's no need for it being accessible over the internet, I only want to use it at home when being connected to my WiFi.

Is that possible and do you know any guide/tutorial for how to do this?




samedi 27 février 2021

How to change images on the background of my home page

Please great web developers I want to creat a website that the images on the home page will be changing like the ones in this site👉 www.chikaike.com Please and please an answer from you will be extremely appreciated. 🙏 thanks a lot in advance




copy code in html file and paste it into javascript file

I'm trying to get entire html file content and paste it inside the JavaScript file.

for example, I have a html file like this: hello.html

<div>
   <a>hello world</a>
</div>

and in js file I want to paste that html content. so it looks like this: hello.js

//pasted html file
   <div>
       <a>hello world</a>
    </div>

is their method or function that can do similar job like that?




Python Web Scrapping cannot extract table data I wanted

Here is what I am trying to accomplish from the page https://stellar.expert/explorer/public/asset/native?cursor=15297&filter=asset-holders

  1. extract the data in the table columns (Account and Account balance)
  2. write the extracted data fields into a text file.
  3. I am trying to extract multiple pages like from 15297 to 15500.

I am still very new to python and web scrapping and I had been struggling to get the desired output. Help will be very appreciated. Thank you.

from bs4 import BeautifulSoup
try:
    import urllib.request as urllib2
except ImportError:
    import urllib2
from time import sleep

url = 'https://stellar.expert/explorer/public/asset/native?cursor=15297&filter=asset-holders'
page = urllib2.urlopen((url))
soup = BeautifulSoup(page, 'html.parser')

for div in soup.find_all('div', attrs={'class': 'table exportable space'}):
    address = div.find('tbody', attrs={'class': "account-address"})
    address = address.text.strip() 
    print (address)

    bal = div.find('tbody', attrs={'class': "text-right nowrap"})
    bal = bal.text.strip() 
    print (balance)
print ("%s%s\n" % ("page=", str(URL)))

Output I wanted to get written to (result.txt):

 GBMN2KIUQS66JMJHVOCA7N3S35F4F5PTY63XG3BJKKDMLPI4HPHA7QNU: 27,005 XLM
 GBWVMIVJQNILFPHACV4Q7QM7VBOOQ35IQXEOOXO7WBXA4KX7OEADOU65: 27,004 XLM
 GD3UXDHKS5EIKSL3PIG3NTVCCK5EQX73JMFJBFBROX3BAZ4K6437TZAC: 27,003 XLM
 GBYUHMDQYNNDMJWOVODTZUKWOTVJXA2PCTDOF6J5NQS5DGMMJAL6B66L: 27,002 XLM
 GDD3AQFXWWHWEFAOU4AWPZCT3Q6EVK4WYHWSG2EBQB3Z43KZSXJEK6WB: 27,001 XLM



Write to file using Django?

I'm trying to do what I thought was straightforward but am discovering is not. I'm hosting a webserver locally on a Raspberry Pi using Django and I want to allow the user to browse to the server, type something in a text box and then have that appended to a file sitting on the Pi.

So far, I have Django displaying a really basic HTML page, but I can't get it to execute any of the functions in my views file and I also don't know if the easiest route here is to work with a POST request and have some function set up to listen and write the contents of that?




WEB API does not work anymore after I publish to local IIS server

I follow this article ("https://ift.tt/3pVp4bq) and create simple web api within VS 2019 and using IIS express to test, everything working(return result as json file and I can open it) as it support to be. But after I publish to local IIS server, I never get result (I can still see the file return, but NOT downloadable). Does anyone know how to fix that?

BTW, I am following this article ("https://ift.tt/3b1UE30) to publish to local IIS server. FYI.

Below is the detail error message : "{ "Message": "An error has occurred.", "ExceptionMessage": "Keyword not supported: 'server'.", "ExceptionType": "System.ArgumentException", "StackTrace": " at System.Data.Entity.Core.EntityClient.Internal.DbConnectionOptions.ParseInternal(IDictionary2 parsetable, String connectionString, IList1 validKeywords)\r\n at System.Data.Entity.Core.EntityClient.Internal.DbConnectionOptions..ctor(String connectionString, IList1 validKeywords)\r\n at System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)\r\n at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection)\r\n at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config)\r\n at System.Data.Entity.Internal.LazyInternalConnection.Initialize()\r\n at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()\r\n at System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext context)\r\n at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()\r\n at System.Data.Entity.Internal.InternalContext.Initialize()\r\n at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)\r\n at System.Data.Entity.Internal.Linq.InternalSet1.Initialize()\r\n at System.Data.Entity.Internal.Linq.InternalSet1.GetEnumerator()\r\n at System.Collections.Generic.List1..ctor(IEnumerable1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)\r\n at EmployeeService.Controllers.EmployeesController.Get() in C:\Users\xxxx\source\repos\EmployeeService\EmployeeService\Controllers\EmployeesController.cs:line 16\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.b__2(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__15.MoveNext()" }"

Thanks!




Open a file in php for prepending [duplicate]

Is there a way to open a file for prepending in php without having the previous contents deleted. This my code but it deletes the previous contents $fp=fopen ("new.html",'r+');




How do I make a picture in my html website clickable?

I am trying to make a website, but Im kind of new to html and dont know how to make a picture clickable.

<div class="portfolio-img-background" style="background-image:url(Images/Dirt.jpg)">
                    
                </div>

This is how I am displaying the image, because I am later changing te style in css. So i would like to know what I need to add to make this image clickable. Thank you in advance for any help!

My entire code: https://pastebin.com/uiHH4vdB




Laravel storage images

My images were working fine, but right now i have a problem with my storage directory.

Before they were going here :

enter image description here

But now they are going here :

enter image description here

My code Profile Controller :

        if($r->hasFile('profile_avatar')){
            Auth::user()->update([
            'profile_avatar' => $r->profile_avatar->store('public/avatars')
            ]);
        }

        if($r->hasFile('banner')){
            Auth::user()->profile()->update([
            'banner' => $r->banner->store('public/avatars')
            ]);
        }

        Session::flash('success', 'Perfil Atualizado com Sucesso!');
        return redirect()->back();
    }

This was working before, but right now it doesnt show any picture

 <img src="" width="400px" height="400px" style="border-radius: 50%; display: inline-block" alt="" class="unselectable">



Making auto refreshe span in laravel

I have a span in which the number (value) is displayed and it is a variable, someone does some action and the value changes, but I will find out only after reloading the page. I need the span value to be reloaded every 5 minutes. It is possible to load the entire <a class="nav-link" href="">Admin panel @if($admin == 2 && $reqnum != 0)<span class="badge badge-warning"></span>@endif</a> link because it still checks to see if the value is 0. Hi, I have a span in which the number (value) is displayed and it is a variable, someone does some action and the value changes, but I will find out only after reloading the page. I need the span value to be reloaded every 5 minutes. It is possible to load the entire XXXXXXXX link because it still checks to see if the value is 0. Everything is in laravel!!

<li class="nav-item <?php echo (Route::currentRouteName() == "admin" ? "active" : "") ?>">
<a class="nav-link" href="">Admin panel @if($admin == 2 && $reqnum != 0)<span class="badge badge-warning"></span>@endif</a>
</li>



How can I find a twitter user using his profile picture?

I have a profile picture and I would like to know how I can find the user only using the profile picture. I also know one person that that user if following but there are 24k thousand others following that person.

I was wondering whether there is a command that can cycle through all those 24,000 followers and reverse image search for my profile picture.




How to disable chrome zoom-in and zoom-out menu programmatically in flutter web

Im creating flutter web application. I want to disable chrome zoom panel which occurs when pressing ctrl + for zoom in and ctrl - for zoom out. I want to do it programmatically.I have already disabled right click context menu by using below code

 html.window.document.onContextMenu.listen((e) => e.preventDefault());

But couldnt find the code to disable the zoom panel. Kindly give me the suggestion to hide disable zoom panel. enter image description here




how to get ajax post request data in php

I Want To Get Sent Data From Ajax in PHP This My Javascript Code:

var formdata = "Hello"
$.ajax({
url: "test.php",
method: "POST",
data: formdata,
async: false,

So How Can I Get This Data in PHP?




How to set opacity of svg from 0 - 1 when hovering a parent element?

I'd like to create a hover statement on a container, where when i hover over the Parent, it moves 40px to the right, and a yellow box sets its opacity from 0 to 1. The 40px to the right works just fine. But the box problem is killing me.

   <div class="Parent">
            <svg class="YELLOW_BOX" viewBox="0 0 1180 140">
                <rect class="Yellow_box_class" rx="0" ry="0" x="0" y="0" width="1180" height="140">
                </rect>
            </svg>
            <div class="TEXT_Class">
                <span>TEXT</span>
            </div>
        </div>

.Parent:hover {
    position: absolute;
    transform: translate(40px, 0);
    width: 1180px;
    height: 199px;
    left: 46px;
    top: 50px;
    overflow: visible;
}

How do i set the opacity of "YELLOW_BOX" to 1, when hovering the parent?




CORS requset did not send cookie

I set a cookie under the www.example.com, and then when I send CROS requests (POST) to api-request.com, the cookie is not carried in the request header.

The SameSite of cookie is None and i set withCredentials: true with axios.




Calculation of the length/width of the picture and the hyperlink

It is necessary that the menu items are located as on the site http://positronica.ru (picture on the side, and the inscription in the center)

Menu view

that is, it is necessary that the li item is displayed as follows:

li Item

I'm having some math problems (and how to code it). The code looks like

.menu {
  position: relative;
  width: 370px;
}

.menu ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.menu li {
  padding: 0.5em 0 0.5em 0em;
  cursor: pointer;
}

ul.level1 {
  border: 1px solid thistle;
}

ul.level1>li {
  background-color: #fff;
  border-bottom: 1px solid thistle;
}

ul.level1>li>a {text-decoration: none; display: block; line-height: 32px; padding: 5px 0px 5px 0px; border-bottom: 1px solid lightgray;}

.one::before,
.two::before {
  content: ""; float: left; display: block;
  margin-left: 30px; margin-right: 16px; width: 25px; height: 25px;
  background-size: 25px;
}

.one::before {background-image: url(http://s1.iconbird.com/ico/2013/1/615/w255h2421390849748Sushi09.png);}

.two::before {background-image: url(http://s1.iconbird.com/ico/2013/1/615/w255h2421390849748Sushi19.png);}

ul.level1>li:last-child {
  border-bottom: none;
}

ul.level2 {
  position: absolute;
  top: -25px;
  left: 100%;
  max-width: 559px;
  max-height: 1010px;
  padding: 0em 0em 0em 0em;
  background-color: #fff;
  border: 1px solid thistle;
  visibility: hidden;
  white-space: nowrap;
  column-count: 2;
}

ul.level2>li {
  padding: 0;
  border-bottom: 1px solid #fff;
}

ul.level2>ul>li {
  padding: 0;
}

ul.level2>li>ul>li {
  padding: 0;
}

ul.level1>li:hover ul.level2 {
  visibility: visible;
}

.menu a {
  color: #333;
}

.alignblock {
  text-align: center;
  vertical-align: middle;
}

.submenu__title {
  margin-bottom: 5px;
}

.submenu__title a {
  display: block;
  color: black;
  font: 13px Roboto, Tachoma, Arial, sans-serif;
  /* line-height: 1.5; */
  text-decoration: none;
  padding: 7px 0px 0px 7px;
}

.submenu__item {
  /* margin-bottom: 0px; */
}

.submenu__item a {
  display: block;
  color: gray;
  font: 13px Roboto, Tachoma, Arial, sans-serif;
  text-decoration: none;
  padding: 0px 0px 0px 7px;
}

body {
    display: block;
    margin: 0px;
}
<html>
<head>
<link rel="stylesheet" href="mysite.css">
</head>
<body>
<div class="mainwrap">
  <div class="mainmenu">
    <span>
                <span>
                    <button data-toggle="dropdown" data-target="#menu" class="hamburger animated fadeInLeft noclose is-open" type="button">
                    <span class="hamb-top"></span>
    <span class="hamb-middle"></span>
    <span class="hamb-bottom"></span>
    </button>
    </span>
    <span><div class="label menu-label" id="myelement">КАТАЛОГ ТОВАРОВ</div></span>
    </span>

    <nav class="menu">
      <ul class="level1">
        <li id="l1">
          <div class="alignblock">Бытовая техника для кухни</div>
          <ul class="level2">
            <li class="submenu">
              <ul>
                <li class="submenu__title">
                  <a href="#">Крупная бытовая техника</a>
                </li>
                <li class="submenu__item">
                  <a href="#">Холодильники</a>
                </li>
                <li class="submenu__item">
                  <a href="#">Морозильные камеры</a>
                </li>
                <li class="submenu__item">
                  <a href="#">Морозильные лари</a>
                </li>
                <li class="submenu__item">
                  <a href="#">Плиты газовые </a>
                </li>
              </ul>

              <ul>
                <li class="submenu__title">
                  <a href="#">New title</a>
                </li>
                <li class="submenu__item">
                  <a href="#">Холодильники</a>
                </li>
                <li class="submenu__item">
                  <a href="#">Морозильные камеры</a>
                </li>
                <li class="submenu__item">
                  <a href="#">Морозильные лари</a>
                </li>
                <li class="submenu__item">
                  <a href="#">Плиты газовые </a>
                </li>
              </ul>
            </li>
          </ul>
        </li>
        <li id="l2">
          <div class="alignblock">Item 2</div>
        </li>
        <li id="l3">
          <div class="alignblock">Item 3 +</div>
          <ul class="level2">
            <li>Sub-Item 3-1</li>
            <li>Sub-Item 3-2</li>
            <li>Sub-Item 3-3</li>
            <li>Sub-Item 3-4</li>
            <li>Sub-Item 3-5</li>
            <li>Sub-Item 3-6</li>
            <li>Sub-Item 3-7</li>
            <li>Sub-Item 4-8</li>
          </ul>
        </li>
        <li id="l2">
          <div class="alignblock">Item 4</div>
        </li>
        <li id="l2">
          <div class="alignblock">Item 5</div>
        </li>
        <li id="l2">
          <div class="alignblock">Item 6</div>
        </li>
      </ul>
    </nav>
  </div>

</div>
</body>
</html>

Tell me how to program so that the drawing is on the side and the text is centered




vendredi 26 février 2021

Unable to render the HTML page in Django

I am trying to return the HTML page on the success of login but unable to render in the web. Do I need to do add in urls.py or views.py in Dashboard?

the sample folder structure of my project

  • login
    • views.py
  • Dashboard
    • templates
      • dashboard
        • sign_up_otp_pop_up.html
    if login=='Success':
       return render(request, 'dashboard/sign_up_otp_pop_up.html', {'content':content})
    else:
       return 400```





Platform for search builder / indexer website load external database

I made a search form on my website, that displays search results from my pages. Right now I am using "Search maker pro" software that index my pages, and works with java. The problem is that I want something much better, for 2021 year. I am looking something similar, but to save and load my search results from an external database platform, with php, java, etc

So, can anyone tell me if there exist a platform for search builder that can index my pages and load the search results from an external database?

Buy the way, I am not using wordpress, just html pages.

https://snipboard.io/Fp8iHW.jpg




Errro add component in Angular 11

When I try to add a component to app, appears this error but I don't know what is happen

My code

Error: src/app/product/product.component.ts:7:14 - error NG6002: Appears in the NgModule.imports of AppModule, but could not ble.imports of AppModule, but could not be resolved to an NgModule class.

Is it missing an @NgModule annotation?

product.component.ts in app/product

import { Component, OnInit } from '@angular/core';
@Component({
  selector: 'app-product',
  templateUrl: './product.component.html',
  styleUrls: ['./product.component.scss']
})
export class ProductComponent implements OnInit {

  constructor() { }

  ngOnInit(): void {
  }

}

app.module.ts

import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { ProductComponent } from './product/product.component';

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    ProductComponent
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

app.component.html

<app-product></app-product>



DOM manipulating HTML - icon nested inside button tag

I'm building a todo list right now and wondering about the usage of innerHTML. If I want an icon inside of a button tag:

btn.innerHTML = '<i class="fas fa-times fa-lg"></i>';

which is <button><i class="fas fa-times fa-lg"></i></button> am I right?

What is the difference between the above and below?

btn.innerHTML += '<i class="fas fa-times fa-lg"></i>';



How to stucutre my website and configure my .htaccess

I am really just now getting into web programming, I do know Powershell, C++, and C# but I am just wondering a few things as I dive in.

Whats the best way to structure the folder? Do you put different portions of the site in different folders? Like Logins in one, profiles and users in another etc? Or do people generally leave everything in one big folder?

In my .htaccess file what would my file look like based on a good folder structure? I tried everything flat, then the server guy came out and I threw everything into folder like logins, register, profiles, with the html and php files for that portion under the directory. Im having a hard time understanding how to write a htaccess file to only show the folder, and mask the file and name. I also have a file share in there. How would you rewrite the URLS to generate a random download link. Is that even the right wording? Hell I dont know.. Any help would be greatly appreciated!




Why does my Web Api PUT using Entity Framework 6 keep writing new duplicate records rather than updating them?

I created my database in Entity Framework, and I also created a Web Api that uses Entity Framework. When I perform a GET or a POST (ADD) everything works great, but When I do a PUT (Update) my record is not updated, it is added as if I performed a Post. I think that the following does not recognize that the Entity has been modified:

db.Entry(contact).State = EntityState.Modified;

So, here is my entire Entity Contact.cs created by Entity Framework:

  public partial class Contact
    {
        public int Contact_ID { get; set; }
        public int Dataset_ID { get; set; }
        public string Booth_UCID { get; set; }
        public string First_Name { get; set; }
        public string Last_Name { get; set; }
        public string Title_Role { get; set; }
        public int Contact_Type_ID { get; set; }
        public string Email { get; set; }
        public string Phone_Number { get; set; }
        public string Email_2 { get; set; }
        public string Phone_Number_2 { get; set; }
    
        public virtual Contact_Type Contact_Type { get; set; }
        public virtual Dataset Dataset { get; set; }
    }

Here is the Contact model from my application that is being sent to the Web Api:

public class Contact
    {
        public int Contact_ID { get; set; }
        public int Dataset_ID { get; set; }
        public string Booth_UCID { get; set; }
        public string First_Name { get; set; }
        public string Last_Name { get; set; }
        public string Title_Role { get; set; }
        public int Contact_Type_ID { get; set; }
        public string Email { get; set; }
        public string Phone_Number { get; set; }
        public string Email_2 { get; set; }
        public string Phone_Number_2 { get; set; }
    }

And here is my MVC Application to Edit Contact

 [HttpPost]
        public ActionResult EditContact(Contact contact)
        {
            using (var client = new HttpClient())
            {

                client.BaseAddress = new Uri("http://localhost:4251/");

                //HTTP POST
                // var postTask = client.PostAsJsonAsync<Dataset>("api/datasets/1", dataset);
                var postTask = client.PostAsJsonAsync("api/contacts/2", contact);
                postTask.Wait();

                var result = postTask.Result;
                if (result.IsSuccessStatusCode)
                {
                    return RedirectToAction("Index");
                }
            }

            ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator.");

            return View(contact);
        }

and lastly, here is my Web Api with the Entity Framework scafolding: this is straight out of the box, when I created my Web Api

 // PUT: api/Contacts/5
        [ResponseType(typeof(void))]
        public async Task<IHttpActionResult> PutContact(int id, Contact contact)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != contact.Contact_ID)
            {
                return BadRequest();
            }

             
            

            db.Entry(contact).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ContactExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }

I am at a loss as to what I could possible do. I feel like I should just abandon the Web Api with Entity Framework and just go ahead build an Empty Web Api where I control the update. And if so, how will this be different?




how create price history table in selected product for website?

I have see the website www.dealdaddy.shop this website is blog type but it has 2 different features. these are

  1. it has comparing product system
  2. It has selected product past prices are shown like below image.

and I am trying to develop like that graph. if you can please tell me how that is create for my website.

selected product price history table Image

If you want to check : https://www.dealdaddy.shop/




Writing a simple http login bruteforcer in python, getting diferent behavior when reading from wordlist

Im messing around with the OWASP juice shop site, and trying to implement a bruteforcer to break admin password.

this is my code:

#! /usr/bin/env python3

import requests

def try_login(password):
    url = "http://10.10.187.141/rest/user/login"
    req = requests.post(url, data = {"email":"admin@juice-sh.op","password":password})
    return req

wordlist = open('testlist.txt', 'r')
list = wordlist.readlines()
for item in list:
    req = try_login(item)
    print(item)
    print(req.text)

I know the password is 'admin123', and the wordlist I'm using has this entry. When i run the script if gets a invalid password response when it tries the correct password.

if i call the try_login functions passing 'admin123' directly like that:

req = try_login('admin123')
print(item)
print(req.text)

i get the login success response

content of my testlist.txt

aaa
admin
admin1
admin12
admin123
adminadmin

output from my script

root@kali:~/thm/brute_forcing# python brute.py
aaa

Invalid email or password.
admin

Invalid email or password.
admin1

Invalid email or password.
admin12

Invalid email or password.
admin123

Invalid email or password.
adminadmin

Invalid email or password.
adminadmin

output when I pass the correct password directly:


{"authentication":{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdGF0dXMiOiJzdWNjZXNzIiwiZGF0YSI6eyJpZCI6MSwidXNlcm5hbWUiOiIiLCJlbWFpbCI6ImFkbWluQGp1aWNlLXNoLm9wIiwicGFzc3dvcmQiOiIwMTkyMDIzYTdiYmQ3MzI1MDUxNmYwNjlkZjE4YjUwMCIsInJvbGUiOiJhZG1pbiIsImRlbHV4ZVRva2VuIjoiIiwibGFzdExvZ2luSXAiOiIxMC45LjIwNy4xNDAiLCJwcm9maWxlSW1hZ2UiOiJhc3NldHMvcHVibGljL2ltYWdlcy91cGxvYWRzL2RlZmF1bHQuc3ZnIiwidG90cFNlY3JldCI6IiIsImlzQWN0aXZlIjp0cnVlLCJjcmVhdGVkQXQiOiIyMDIxLTAyLTI2IDE4OjA2OjE4LjYyMiArMDA6MDAiLCJ1cGRhdGVkQXQiOiIyMDIxLTAyLTI2IDE5OjM4OjE2LjI3NSArMDA6MDAiLCJkZWxldGVkQXQiOm51bGx9LCJpYXQiOjE2MTQzNjk2MjMsImV4cCI6MTYxNDM4NzYyM30.C8i0CXA0F7KC33zS_EyJxnPRSP23bNMbkv3lldaIFvS0qwaE26cpIDuW9iS1VgabQQi15KqVqpJdeUPS1PIRjHNAxRHepQF2UxY_mjIF7fiDtST1FG6ZSb05M9N-0dt_wxWBSzTeJHX2p4ixu0GD5pZ3yjJZK9QzHg6IoFjajIQ","bid":1,"umail":"admin@juice-sh.op"}}

Does enyone know why there is a diference?




How to set claims from flutter in firebase

I am try to set role using claims in Firebase using cloud function for Flutter web and app. But don't how to do it.

Anyone who give solution thanks in advance




HMI web vs HMI native which to choose in terms of performance? [closed]

I have to work on an interface project but I lack the knowledge to compare the two technologies. One of the very important parameters to take into account is performance. And also security!




Generating data on button click in vue

create a web panel, using vue. Add a button to generate a random employee dataset. When clicked on the button it should generate dataset of 100k employees in JSON format and feed to datatable. Please help mw with API's or methods to solve the problem. Each time we click on the button a pageloader will be displayed and the data gets generated and updated in data table




How to integrate python chatbot to website

I have created a chatbot in python. Now, I want to integrate it with an existing website. Is there some way where I can write code for the chatbot ui in different file and use that file in the main website code via some script.




Internal Error 500 Asp.net core 3.1 Web API in Browser

I’m working on an ASP.NET Core 3.1 Web API project with ReactJS for it’s front-end. When I send a get request from back-end to Postman everything is fine and the data is returned. But when the data is sent by the client via ReactJS I get Internal Error 500.

I’ve tried every solution I could find online and they didn’t really help. Am I supposed to change anything in IIS settings or in web config?

this is Web Config :

    <configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\Core.API.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
    <connectionStrings>
        <remove name="LocalSqlServer" />
        <add connectionString="Server=.;Database=AuthenticationDb;User ID=sa;Password=123" name="AuthenticationDb" />
    </connectionStrings>
</configuration>



My template installation ruining admin login page

My zencart installation giving me error upon attempting to admin login page and can't view login page. I've errors on log file as below:

Request URI: /admin5555/login.php?camefrom=index.php, 

#1  trigger_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:171]
#2  queryFactory->show_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:143]
#3  queryFactory->set_error() called at [/public_html/includes/classes/db/mysql/query_factory.php:270]

#4  queryFactory->Execute() called at [/public_html/admin5555/includes/installers/zen_lightbox/1_7_0.php:295]
#5  include(/public_html/admin5555/includes/installers/zen_lightbox/1_7_0.php) called at [/public_html/admin5555/includes/init_includes/init_zen_lightbox.php:47]
#6  require(/public_html/admin5555/includes/init_includes/init_zen_lightbox.php) called at [/public_html/includes/autoload_func.php:48]
#7  require(/public_html/includes/autoload_func.php) called at [/public_html/admin5555/includes/application_top.php:171]

#8  require(/public_html/admin5555/includes/application_top.php) called at [/public_html/admin5555/login.php:9]

--> PHP Fatal error: 1292:Incorrect datetime value: 'now()' for column 'last_modified' at row 1 :: INSERT INTO configuration SET  configuration_key="ZEN_LIGHTBOX_STATUS", configuration_title="<b>Zen Lightbox</b>", configuration_value="true", configuration_description="<br />If true, all product images on the following pages will be displayed within a lightbox:<br /><br />- document_general_info<br />- document_product_info<br />- page (EZ-Pages)<br />- product_free_shipping_info<br />- product_info<br />- product_music_info<br />- product_reviews<br />- product_reviews_info<br />- product_reviews_write<br /><br /><b>Default: true</b>", sort_order="100", use_function="null", set_function="zen_cfg_select_option(array(\'true\', \'false\'), ", last_modified="now()", date_added="now()", configuration_group_id="40" ==> (as called by) /public_html/admin5555/includes/installers/zen_lightbox/1_7_0.php on line 295 <== in /public_html/includes/classes/db/mysql/query_factory.php on line 171.```

Is there a way to get login page running??



Slider auto scrolling

Im trying to figure out how to make an auto scrolling in slider in pure JS. I need slides to scroll every n time, for example 5 secs, can I somehow renew the timer after manual scrolling?

HTML + CSS + JS: https://jsfiddle.net/k72nth41/

Js code:

let slideIndex = 1;
showSlides(slideIndex);

let prev = document.getElementById ('prev');
let next = document.getElementById ('next');

next.addEventListener ("click", function () {
  showSlides(slideIndex += 1);

});

prev.addEventListener ("click", function () {
  showSlides(slideIndex -= 1);
});

function currentSlide(n) {
  showSlides(slideIndex = n);
}


function showSlides(n) {
    let slides = document.getElementsByClassName("myslide");
    if (n > slides.length) {
      slideIndex = 1;
    }
    if (n < 1) {
        slideIndex = slides.length;
    }
 
    for (let slide of slides) {
        slide.style.display = "none";
    }
    slides[slideIndex - 1].style.display = "flex";    
  }

 let timer = setInterval(function(){
    slideIndex++;
    showSlides(slideIndex);
  },5000);



How to Increase size of AppBar leading property in flutter?

I'm trying to add my custom text button into AppBar leading property. However when the text gets too long then it end up in multi lines.How to solve this problem ?




Have you used Wix or Weebly before?

Please tell me how does it work to create a website on these platforms and what do you think about it?




How to show a video in AR environment using webXR?

I'm playing around with webXR api by following this guide from google, I'm able to render cube and flower as defined in this tutorial to AR world but what I'm trying to do is to render a video stream/video in AR environment using webXR API, while checking for possible solutions I found following links https://discourse.threejs.org/t/videotexture-chromakey-webxr-ar-three-js/16690 but there is no luck in rendering video to AR environment, the video plays actually as I'm able to hear the sound but it is not getting rendered into AR environment using three js.

Can anyone help me with finding a solution for doing so?

Thanks and Regards




When press button to go to other pages and it shows sorry unable to open file at this time google appscript

I've tried to build multi web by using google appscript for other people to check or edit their information in database(google spreadsheet), reserve time to photo which also link to google spreadsheet.

However, when I test web in incognito mode to test that anyone can use this web appropriately and when pressing button to go to another page, it just show me 'Sorry but unable to open file at this time, please check the address'. I 've search about how to solve in similar question but nothing works for me. Of course I didn't login many accounts when I deploy web and also very sure that I choose to 'anyone, even anonymous' before I deploy web.

so my question is that how can I fix this? This is some of my Code.gs and HTML

Some of Code.gs

  function doGet(e) {
  var htmlOutput = HtmlService.createTemplateFromFile('home')
  htmlOutput.search = '';
  htmlOutput.search2 = '';
  htmlOutput.message = '';
  return htmlOutput.evaluate()
}

function doPost(e) {
  Logger.log(JSON.stringify(e));
  if(e.parameter.checkdata == 'checkdata'){
    var htmlOutput =  HtmlService.createTemplateFromFile('checkdata');
    htmlOutput.message = '';
    return htmlOutput.evaluate()
  } 
else if (e.parameter.reservetime == 'reservetime'){
      var htmlOutput =  HtmlService.createTemplateFromFile('club');
      return htmlOutput.evaluate()

HTML

<body class="background row align-items-center">

  <div class="container" align = "center">

  <?var url = getUrl();?>
    <form method="post" action="<?= url ?>" >  
  <div class="row justify-content-center mt-4">
    <div class="col-3 d-grid">
      <button type="submit" class="btn btn-primary" value="checkdata" name="checkdata">Check Information</button>
    </div>
    <div class="col-3 d-grid">
      <button type="submit" class="btn btn-primary" value="reservetime" name="reservetime">Reserve Time</button>
    </div>
    <div class="col-3 d-grid">
      <button type="submit" class="btn btn-primary" value="paybook" name="paybook">Upload Slip</button>
    </div>

  </form>
  <h4><?= message ?></h4> 
</div>
  </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
  </body>

As can be seen, from home page if I click 'reserve time button' it will show the error that I mentioned above and I have no idea why.

I am sorry if my question is not clear and if you think you would like to get more information to help me, please feel free to ask me or request me to give some information more.

Thanks for any further assistances.




How do I change back my site links on google? I was hacked and they changed them as seen in the attachment

The hackers changed my sitelinks, is there any way I can remove them? I've tried googling a solution but it seems Google generated sitelinks automatically and there's no option to change them. I've already removed the affected URLs from my site and requested a review, I've even requested for indexing/ crawl on my site again. Is there anything else I can do? Thanks

screenshot from google results




Microsoft edge multi element copy

Does anyone know a fast way to copy multiple elements from an inspect page? What I mean by that is I have a number of elements with same qualities i.e. same class and I want to copy all of them to my clipboard. Is there a way within inspect tool to do such a "trick" ? :)

Thank you in advance!




Question about updating website for firebase hosting

I deployed the website using firebase hosting and was wondering if there was a way to update the website so that the changes I made can be applied to the website.




Is it possible to create single path SVG for below image?

enter image description here

  • I was able to create this(however it has the transparent part at the center - want it solid white)
  • "M62,31c0,17.1-13.9,31-31,31S0,48.1,0,31S13.9,0,31,0S62,13.9,62,31z M48.5,43.9L46,44l-7.3-11.3 c-0.5-0.8-1.4-1.2-2.3-1.2L26.7,32l-0.2-2.8l9.6-2.7c0.9-0.3,1.4-1.2,1.2-2.1c-0.2-0.9-1.2-1.4-2.1-1.2l-8.9,2.5L25.9,19 c-0.1-1.4-1.3-2.5-2.7-2.4c-1.4,0.1-2.5,1.3-2.4,2.7l0.9,15.6c0.1,1.4,1.3,2.5,2.7,2.4l10.7-0.6L42.5,48c0.5,0.7,1.3,1.2,2.1,1.2 c0,0,0.1,0,0.1,0l4-0.1c1.4-0.1,2.5-1.2,2.5-2.6C51.1,44.9,49.9,43.8,48.5,43.9z M23.4,6c-2.8,0-5.1,2.3-5.1,5.1s2.3,5.1,5.1,5.1 s5.1-2.3,5.1-5.1S26.2,6,23.4,6z M35.2,42.4c-0.2,5.7-4.8,10.2-10.5,10.2c-5.8,0-10.5-4.7-10.5-10.5c0-3.5,1.8-6.7,4.5-8.6v-3.9 c-4.6,2.3-7.9,7-7.9,12.5c0,7.7,6.2,13.9,13.9,13.9c6.1,0,11.3-4,13.2-9.5L35.2,42.4z"
  • Path 1 result : enter image description here

Also, for some reason, there is a black border too.

  • Later, I was able to extract another path for the center figure, which is:
  • "M40.3,40.3c0.1,1.4-1,2.6-2.5,2.6l-4,0.1c0,0-0.1,0-0.1,0c-0.9,0-1.7-0.4-2.1-1.2l-7.3-11.3l-10.7,0.6 c-1.4,0.1-2.6-1-2.7-2.4L10,13.3c-0.1-1.4,1-2.6,2.4-2.7c1.4-0.1,2.6,1,2.7,2.4l0.4,6.8l8.9-2.5c0.9-0.2,1.8,0.3,2.1,1.2 c0.3,0.9-0.3,1.8-1.2,2.1l-9.6,2.7l0.2,2.8l9.6-0.5c0.9,0,1.8,0.4,2.3,1.2L35.1,38l2.5-0.1C39.1,37.8,40.3,38.9,40.3,40.3z M12.5,10.2c2.8,0,5.1-2.3,5.1-5.1S15.4,0,12.5,0C9.7,0,7.4,2.3,7.4,5.1S9.7,10.2,12.5,10.2z M13.9,46.6c-5.8,0-10.5-4.7-10.5-10.5 c0-3.5,1.8-6.7,4.5-8.6v-3.9C3.2,25.9,0,30.6,0,36.1C0,43.8,6.2,50,13.9,50c6.1,0,11.3-4,13.2-9.5l-2.7-4.1 C24.2,42,19.6,46.6,13.9,46.6z"
  • Path 2 result : enter image description here

Looking for a single path SVG, which creates an exact image like enter image description here.

Thank you in advance.




jeudi 25 février 2021

WebStorm: make Live Edit work without debug mode

There's a plugin in Visual Studio called Live Server. When you edit and save changes to an html/css file, you don't have to refresh the page if it's open in your browser, it refreshes automatically. Webstorm has similar functionality called Live Edit, but it works in debug mode only.

Also is it possible to make it work with Safari or at least another Chromium browser like Vivaldi, or corresponding extension works in Google Chrome only? Because Live Edit doesn't work without Google Chrome. Thank you.




Generate custum number of lorem ipsum words in html

With lorem+TAB I am able to generate some random words.

<body>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat nonproident, sunt in culpa qui officia deserunt mollit anim id est laborum.</body>

Now I want to generate more number of words, say 100 sentences of lorem text. Is there any way to do it in sublime text 3?




How to set up domain hosting one server whilst having a subdomain hosted on another

So I bought a domain at NameCheap (supposed its called mydomain.me), and I want to use this domain to host my website on netlify.

The normal way to do this is by setting 4 custom DNS servers to
dns1.p02.nsone.net
dns2.p02.nsone.net
dns3.p02.nsone.net
dns4.p02.nsone.net

This method does work, however I also want to host a subdomain on a DIFFERENT DigitalOcean droplet at api.mydomain.me

I wasn't sure what to do so I added digitalocean's three nameservers to it as well:
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com

(Suppose my DigitalOcean droplet's IP is 12.345.67.890)
On DigitalOcean, I have the following DNS records:
A Record: Hostname api.mydomain.me directs to 12.345.67.890
A Record: Hostname traefik.api.mydomain.me directs to 12.345.67.890
NS Record: Hostname mydomain.me directs to ns1.digitalocean.com
NS Record: Hostname mydomain.me directs to ns2.digitalocean.com
NS Record: Hostname mydomain.me directs to ns3.digitalocean.com

This configuration works.. kind of

Occasionally my netlify website at mydomain.me would go down, but spamming the refresh button would bring it back.
My API at api.mydomain.me would go down a LOT, and when it does come back it only works on desktop for some reason... then a little later it will work on mobile devices. Then it goes back down and repeats this process.



I feel like this kind of configuration I'm using is somehow interfering with each other. I kind of suck with this DNS record stuff. If someone could please let me know how to do this correctly, it would help a lot!




WebAuthenticationDetails and OAuth2AuthenticationDetails

Any can explain what is the difference and similarities between OAuth2AuthenticationDetails and WebAuthenticationDetails? How can I use this? Where should I use this? Also can use WebAuthenticationDetails instead of OAuth2AuthenticationDetails or vice-versa?




How to enable push notifications for a website I am making using wix?

Want to setup push notification on my website so that subscribers get latest news from me .




How can I use a website I made, offline and reconnect to local files instead of files on the google drive?

I made a website that links to files loaded on google drive. Its a basic website and you can navigate to different sections and then access pdf files and images that are stored on a google drive. I need to figure out a way to make this be usable offline. I was thinking of just copying the whole website to a thumbdrive. However I dont know a way to make the external google files work offline. Is there a easy way to do this?




On my MVC Web Api Put what may be causing an Internal Server Error: 500

I am somewhat new to working with MVC Web Api and I was excited to get my MVC Web Api GET to work, but really frustrated trying to formulate my Web Api Put

I tried to create my dataset to be identical to the the but I did add one property, could that be an issue? Also, I noticed that some of my values on my checkboxes and such are returning nulls these are set up in the model as boolean, so I don't know.

Here is my Web Api put

// PUT: api/Datasets/5
        [ResponseType(typeof(void))]
        public async Task<IHttpActionResult> PutDataset(int id, Dataset dataset)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != dataset.Dataset_ID)
            {
                return BadRequest();
            }

            db.Entry(dataset).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DatasetExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }

Here is my HttpPost from my form with my datamodel

[HttpPost]

 public ActionResult TestDataset(Dataset dataset)
    {
        using (var client = new HttpClient())
        {
        
        client.BaseAddress = new Uri("http://localhost:4251/");

        //HTTP POST
        
        var postTask = client.PostAsJsonAsync<Dataset>("api/datasets/1", dataset);
        postTask.Wait();

        var result = postTask.Result;
        if (result.IsSuccessStatusCode)
        {
            return RedirectToAction("Index");
        }
    }

    ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator.");

    return View(dataset);
}

This is my dataset.cs created from Entity Framework on my Web Api Project

public partial class Dataset
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Dataset()
        {
            this.Attachment = new HashSet<Attachment>();
            this.Contact = new HashSet<Contact>();
            this.Location1 = new HashSet<Location>();
        }
    
        public int Dataset_ID { get; set; }
        public int Category_ID { get; set; }
        public string Provider { get; set; }
        public string Name { get; set; }
        public string Institution { get; set; }
        public string Description { get; set; }
        public string Location { get; set; }
        public Nullable<bool> Domestic { get; set; }
        public Nullable<bool> International { get; set; }
        public Nullable<bool> Includes_PHI { get; set; }
        public Nullable<bool> PHI_Limited { get; set; }
        public Nullable<bool> Includes_PIL { get; set; }
        public Nullable<bool> PIL_Limited { get; set; }
        public Nullable<bool> Citation_Requirements { get; set; }
        public string Citation_Comments { get; set; }
        public Nullable<System.DateTime> Availability_Beg_DT { get; set; }
        public Nullable<System.DateTime> Availability_End_DT { get; set; }
        public Nullable<bool> Subscription_Renewal { get; set; }
        public Nullable<System.DateTime> Subscription_Renewal_DT { get; set; }
        public Nullable<bool> Retention_Expiry { get; set; }
        public Nullable<System.DateTime> Retention_Expiry_DT { get; set; }
        public Nullable<bool> Data_Destruction { get; set; }
        public Nullable<System.DateTime> Data_Destruction_DT { get; set; }
        public string Data_Destruction_Instructions { get; set; }
        public Nullable<int> Contract_ID { get; set; }
        public bool Draft_Status { get; set; }
        public bool Admin_Only { get; set; }
        public string Dataset_Alias { get; set; }
        public Nullable<bool> Loc_Amazon { get; set; }
        public Nullable<bool> Loc_IT_Research { get; set; }
        public Nullable<bool> Loc_Research_Proj { get; set; }
        public Nullable<bool> Loc_Secure_Data { get; set; }
        public Nullable<bool> Loc_Mercury { get; set; }
        public Nullable<bool> Loc_Research_CC { get; set; }
        public Nullable<bool> Loc_Research_VM { get; set; }
        public Nullable<bool> Loc_External { get; set; }
        public Nullable<bool> Access_Url { get; set; }
        public Nullable<bool> Access_Download_App { get; set; }
        public Nullable<bool> Access_Lab_Terminal { get; set; }
        public Nullable<bool> Access_Email_Req { get; set; }
        public Nullable<bool> Access_File_Download { get; set; }
        public Nullable<bool> Access_Other { get; set; }
        public string Location_Notes { get; set; }
        public string Access_Notes { get; set; }
        public Nullable<System.DateTime> Date_Added { get; set; }
        public Nullable<System.DateTime> Date_Modified { get; set; }
        public string Added_By_User { get; set; }
        public string Updated_By_User { get; set; }
        public Nullable<bool> External_Collaborators { get; set; }
    
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Attachment> Attachment { get; set; }
        public virtual Category Category { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Contact> Contact { get; set; }
        public virtual Contract Contract { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Location> Location1 { get; set; }
    }

this is the model I am returning:

 public class Dataset
    {
        public int Dataset_ID { get; set; }
        public int Category_ID { get; set; }
        public string Provider { get; set; }
        public string Name { get; set; }
        public string Institution { get; set; }
        public string Description { get; set; }
        public string Location { get; set; }
        public Nullable<bool> Domestic { get; set; }
        public Nullable<bool> International { get; set; }
        public Nullable<bool> Includes_PHI { get; set; }
        public Nullable<bool> PHI_Limited { get; set; }
        public Nullable<bool> Includes_PIL { get; set; }
        public Nullable<bool> PIL_Limited { get; set; }

       
        public Nullable<bool> Citation_Requirements { get; set; }
        public string Citation_Comments { get; set; }
        public Nullable<System.DateTime> Availability_Beg_DT { get; set; }
        public Nullable<System.DateTime> Availability_End_DT { get; set; }
        public Nullable<bool> Subscription_Renewal { get; set; }
        public Nullable<System.DateTime> Subscription_Renewal_DT { get; set; }
        public Nullable<bool> Retention_Expiry { get; set; }
        public Nullable<System.DateTime> Retention_Expiry_DT { get; set; }
        public Nullable<bool> Data_Destruction { get; set; }
        public Nullable<System.DateTime> Data_Destruction_DT { get; set; }
        public string Data_Destruction_Instructions { get; set; }
        public Nullable<int> Contract_ID { get; set; }
        public bool Draft_Status { get; set; }
        public bool Admin_Only { get; set; }
        public string Dataset_Alias { get; set; }
        public Nullable<bool> Loc_Amazon { get; set; }
        public Nullable<bool> Loc_IT_Research { get; set; }
        public Nullable<bool> Loc_Research_Proj { get; set; }
        public Nullable<bool> Loc_Secure_Data { get; set; }
        public Nullable<bool> Loc_Mercury { get; set; }
        public Nullable<bool> Loc_Research_CC { get; set; }
        public Nullable<bool> Loc_Research_VM { get; set; }
        public Nullable<bool> Loc_External { get; set; }
        public Nullable<bool> Access_Url { get; set; }
        public Nullable<bool> Access_Download_App { get; set; }
        public Nullable<bool> Access_Lab_Terminal { get; set; }
        public Nullable<bool> Access_Email_Req { get; set; }
        public Nullable<bool> Access_File_Download { get; set; }
        public Nullable<bool> Access_Other { get; set; }
        public string Location_Notes { get; set; }
        public string Access_Notes { get; set; }
        public Nullable<System.DateTime> Date_Added { get; set; }
        public Nullable<System.DateTime> Date_Modified { get; set; }
        public string Added_By_User { get; set; }
        public string Updated_By_User { get; set; }
        public Nullable<bool> External_Collaborator { get; set; }

        public ICollection<Attachment> Attachment { get; set; }
        public ICollection<Contact> Contact { get; set; }

        public ICollection<Category> Categories { get; set; }

        public IEnumerable<SelectListItem> CategoryList { get; set; }
    }



How do I add mySQL JDBC Driver when creating a Driver definition?

I am currently trying to make a connection to a database through a dynamic java web application in eclipse. I found this helpful youtube video and while I am trying to follow it, I have ran into an issue.

This led me to more research where I found this link

At Step 5 when he clicks on MySql, it presents him with drivers to the mySql JDBC Driver versions. However when I do this, there is nothing there. I cannot add the jar connector file without clicking on a version but there are no versions to click. I have not been able to find an answer to how to fix this, and would appreciate the help if anyone has any. I have provided a screenshot of what my page looks like below. When trying to add a driver:




Fetched Data in react is appended to output but only on post method

I stumbled uppon a issue when working on my first react app. I have rest api defined by me in flask-python and this endpoint looks like this:

@app.route('/personal_data', methods=['GET', 'POST'])
def personalData():
    if 'language' in request.args:
        personaldata = PersonalData(request.args.get('language'))
    else:
        personaldata = PersonalData('pl')
    if request.method == "POST":
        db.session.add(personaldata)
        db.session.commit()
    return jsonify(object_as_dict(personaldata))

My issue is when i call get in react, my data refreshs on sceen, but when i try to save it it append to last displayed "personal data".

My react code:

const Header =({title}) =>{

    const [pdButtonClicked, setpdclicked] = useState(false)
    const [pdButtonClicked1, setpdclicked1] = useState(false)
    const [creditDataClicked, setcreditdataClicked] = useState(false)
    const [companyDataClicked, setcompanyDataClicked] = useState(false)
    const [personal_data, setPD] = useState([])
    const [personal_data1, setPD1] = useState([])
    const [credit_data, setCreditData] = useState([])
    const [company_data, setCompanyData] = useState([])

    const PdbuttonClicked = ()=>{
        axios.get('/personal_data')
            .then(res => {
                setPD([res.data]);
            });
        setpdclicked(true)
    }

    const CreditDataClicked = ()=>{
        axios.get('/credit_data')
            .then(res => {
                setCreditData([res.data]);
            });
        setcreditdataClicked(true)
    }

    const CompanyDataClicked = ()=>{
        axios.get('/company_data')
            .then(res => {
                setCompanyData([res.data]);
            });
        setcompanyDataClicked(true)
    }

    const SavePersonalDataClicked = ()=>{
        axios.post('/personal_data')
            .then(res => {
                setPD1([res.data]);
            });
        setpdclicked1(true)
    }

    return (
        <>
       <header className='header'>
           <h1> {title} </h1>
            <Button title = "personal data" onClick = {PdbuttonClicked}/>
            <Button title = "credit data" onClick = {CreditDataClicked}/>
            <Button title = "company data" onClick = {CompanyDataClicked}/>
            <Button title = "save personal Data" onClick = {SavePersonalDataClicked}/>
       </header>
        <body>
        <div>   <h8>Personal Data:</h8>
                {pdButtonClicked == true ? <PersonalData data = {personal_data}/> : ""}
                {pdButtonClicked1 == true ? <PersonalData data = {personal_data1}/> : ""}
            <h8>Credit Data:</h8>
                {creditDataClicked == true ? <CreditData data = {credit_data}/> : ""}
                <h8>Company Data: </h8>
                {companyDataClicked == true ? <CompanyData data = {company_data}/> : ""}
        </div>
        </body>
        </>
    )
};

Header.defaultProps ={
    title: "Test Data Generator",
}

Header.propTypes ={
    title: PropTypes.string.isRequired,
}
export default Header

For the start i don't exactly understand why on get it refreshes my display. When i click button responsible for post method i can append output to infinite.




When the content actually gets rendered on the browser screen?

what i understand is that the browser combines DOM and CSSOM together into one renderTree and this is what actually gets rendered on the screen?

Now if i have a JS file it will block the constructing of the DOM but i can avoid this by using the defer attribute to make the browser complete the DOM then download and execut the JS files.

Now my question is that in this case does the browser render on the screen the renderTree as soon as it is completed even if i use defer and no JS files ready yet ?? or it just wait for the DOM to be constructed but it will also wait for the JS files to get downloaded and executed then render the the renderTree on the screen does not matter if i use defer or not it will always wait for everything to be ready to render the content on the screen ??




What stach can I use to have AI on the server for my robots

I would like to know what programming languages and frameworks I can use to make a server to run AI for my robots.




How to normalize CSS ::after element to work on Chrome as it does on FF?

I have this CSS:

h1::after{
    content:  "==========================";
    position: absolute;
    bottom:   5px;
    left:     0;
    display:  1;
}

h2::after{
    content:  "--------------------------";
    position: absolute;
    bottom:   5px;
    left:     0;
    display:  1;
}

In Firefox it looks like this Screenshot of Firefox

and in Chrome like this Screenshot of Chrome

My question is: How can I make it look like Firefox in Chrome?




Make the selection of date range in filter optional in Django

I have been working on a simple inventory stock system and I want to make a search which has various options, but when I search without having an input in the date range boxes, the application crashes.

if request.method == 'POST':
    category = form['category'].value()
    queryset = StockHistory.objects.filter(
                            item_name__icontains=form['item_name'].value(),
                            last_updated__range=[
                                                    form['start_date'].value(),
                                                    form['end_date'].value()
                                                ],
                            issue_to__icontains=form['issue_to'].value()
                            ).order_by('-last_updated')

    if (category != ''):
        queryset = queryset.filter(category_id=category)



How to make selected value always appear as first option in React Select?

enter image description here

I want to make selected option to render as first option in my dropdown. eg heading3 should be the first item in dropdown highlighted with blue color and similarly if I change the selected value to heading2 then it should be the first option in dropdown




How do i create this static scrolling animation css effect? [closed]

I found this awesome effect at https://cuberto.com/ In the featured projects section, when we scroll, there is a smartphone-like object in which different images change with a wavy animation. I was really curious about how to make it. Is it done with static divs? I started web development a few months ago. Thanks in advance! BTW, this is my first time on stack overflow.




How do I get the information in the tag into C# and HTMLAgilityPack?

I want to get some info without the C# HTMLAgilityPack tag. (Example: <(a) href = "https://ift.tt/2ZP9XWr = ""...>) I want to get the href value.)

How do I do it?




Hello Friends.I have some problem for developing java server -side softwears

I want to ask about something that I downloaded apache-tomcat,openjdk-15,and also eclipse ide on my Ubuntu (focal fossa).Do I need to download java ee SDK for my web development???I saw that Oracle Linsence is changed so java ee SDK(jarkarta ee) is not open source anymore.Plz give me some idea if I need to download.




Best way to store image on web api

I have an android project which is link to a dedicated web api on flask and which is deployed on a raspberry pi. They are no front web page for this web application. Link to this api i have a database. The Api receive json request from android app, ask to the database, and send response also in json.

my problematic is, i have to upload images on the server from android on and send it back when android send a resquest for have access to them. my question is: How can i store images efficiently?

Until now, i save it on a ftp server and when the android app send a request, i download it on the web serveur from the ftp and send a link to download it. Of course a ftp server is not really the best way for do this job.

what is the good way to store images? should i store them directly in the db?

thank you in advance