lundi 31 août 2020

How to validate input tag for One Bit using Html and JavaScript? [closed]

**

I want that input tag must accept the input if we enter either 0 and 1 but not inputs like 00 and 01

**




SEO Basics in HTML [closed]

Can you guys recommend websites to learn the basics of SEO in HTML? Thank you




How to make a small part of code in views.py to run for every x minutes in django server (using gunicorn and nginx)

  1. I have to run a reset the all values of a game every four minutes.
  2. Meanwhile, if the game runs for 2 minutes last 30sec should be used to compute the result. Following the above two criteria how to design my game. And I have made some effort to do this which is successful on localserver but on the production server it is not working properly. Here is my source code link

Please help me to solve this issue.




How to make easy home booking?

Website Design Cyprus- We are a Cyprus based web design and development agency providing solutions for businesses across the world, We provide the best digital marketing operates services in Cyprus Nicosia, contact us- (357) 22-23 24 82




How to handle the dynamic cookies when crawling a website by python?

I am a very beginner of Python. And I tried to crawl some product information from my www.Alibaba.come console. When I came to the visitor details page, I found the cookie changed every time when I clicked the search button(icon). I found the cookie was dynamic change. I can not crawl the data in the way I crawled from other pages where the cookies were fixed in a certain period. After comparing the cookie data, I found here were only 3 key-value pairs were changed. I think those 3 values made me fail to crawl the data. So I want to know how to handle such situation.Thanks for everyone's kindly help in advance.

Here please find the 3 values below:

l : eBSJ7_CuQqV04nWaKO5w-urza77t5QdfhsVzaNbMiIncC62fTJpT7ZxQKxmYqd-RJ8XVM9Tw4intcKytXFE3-ykfCAfrAiQ1cqRDdeTC.

l : eBSJ7_CuQqV04bB3KO5w-urza77t2IOfGsVzaNbMiInca6af9FNkxNQ493-DWdtxgt5A0exPDcnX3R3MWkU38x6sI_oCDNsjudpwSe1..

tfstk : cCuABA48RLv00xP-TmKu18lVYknAae5YIswOWBUoWavcAn5dOsXs-2hYZnNNHzdR.

tfstk : cadABAfRO0mc3n7J8KHl5g84L9dAap4AjrsT62Ck67m0OzNassV6tBLArx_aD_3R.

isg : BE9PlywoTAqAZknBokn9RZ-b3uNZdKOW4ECpS2FfDL6tMGkybkbk50RmN2COE3sO

isg : BFRUABMR90vAr2KwbeC25DgyJZLGrXiXZ1kCGu40119i2fAjFL-MJgAf3NHBAbDv




When i am deploying my angular app in tomcat it creates two foldername in the url leads to 404 error

When i am deploying my angular app in tomcat it creates two filename in the url leads to 404 error.I have used the command ng build --base-href=usersfront. Please help me with the issue.enter image description here




How to prevent horizontal containers from overlapping or moving when screen size is reduced?

I am trying to align two boxes next to each other like the following. This works as shown below until you shrink the screen size. Then the items get jumbled up as shown in the second picture.

The code I am using is the following:

CSS

#leftbox { 
  margin-top: 30px;
  margin-bottom: 30px;
  margin-right: 10px;
  margin-left: 35%;
  float:left;    
} 

#rightbox { 
  margin-top: 30px;
  margin-bottom: 30px;
  margin-right: 35%;
  margin-left: 10px;
  float:right;
} 

HTML

<div id = "leftbox">
        <a target="_blank" href="link" style="text-decoration: none">
          <code>
           <img src="github.png" height="25" width="25"/>
          </code>
        </a>
      </div>
      <div id = "rightbox">
        <a target="_blank" href="link" style="text-decoration: none">
          <code>
           <img src="linkedin.png" height="25" width="25"/>
          </code>
        </a>
      </div>

How can I fix this?




i am running npm run start but its taking too much time no errors?

my node version: PS node -v v14.9.0

npm

npm version { 'player': '4.4.1', npm: '6.14.8', ares: '1.16.0', brotli: '1.0.7', cldr: '37.0', icu: '67.1', llhttp: '2.0.4', modules: '83', napi: '6', nghttp2: '1.41.0', node: '14.9.0', openssl: '1.1.1g', tz: '2020a', unicode: '13.0', uv: '1.39.0', v8: '8.4.371.19-node.13', zlib: '1.2.11' }




Excel on a webpage but with Data Imported from a database [duplicate]

I am looking for a solution to display excel pages on web but there is a catch. There are alternatives such as Kendo UI spreadsheet, Jexcel or PhpSpreadSheet.

What I specifically need is displaying an excel sheet on web which has data imported to it using "Data" tab on the program. If it was just the excel page I would use one of these solutions or anything similar but now I do not know which one supports this as a feature, either the official tehnical name of this database import feature to make further research on this.




Не могу центрировать текст по вертикали в css / I can't center text vertically in css [closed]

Не могу центрировать текст по вертикали. Пробовал методы, которые описывали люди на других форумах, не получилось, поэтому прошу совета тут. Заранее спасибо

Html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Old Gamers</title>
    <link rel="stylesheet" href="style.css">
    <link href="https://fonts.googleapis.com/css2?family=Lexend+Peta&family=Poppins:wght@300&family=Roboto:wght@300;400&display=swap" rel="stylesheet">
</head>
<body>
    <header>
        <h1 class="title">Old Gamers</h1>
    </header>
</body>
</html>

Css:

*{
    padding: 0;
    margin: 0;
}
body{
    margin: 0 auto;
    background: white;
}
header{
    background: #32bce9;
    height: 80vh;
    color: white;
}
.title{
    font-family: 'Lexend Peta', sans-serif;
    font-size: 80px;
    text-align: center;
}



Is there a way to make an email auto responder for Gmail

I am trying to make a code that reads my emails, check for new emails, when it sees a new email ,it forwards it to my other email and it makes a ticket (some database stuff), i can use javascript for the tickets and database,i kinda know how to make it send an email, but i never found, anywhere, a way to make it read the emails and reply to them.

if i was able to do it, i would later make it not make a ticket if someone replied to its email and it will be added as an email to the same ticket, but right know i just want it to be able to detect new emails

I know javasctipt, Node.js, a little python, a little html. i dont know if that helps, but i would hope i would be able to do it in one of those.

another question: Idk how this exactly works, but will this also be able to be hosted on heroku? so the code stays working all time.

Thank you, sorry for the stupid question

I also just wanna mention, i actually did research, all i saw was auto respond paid services, samples/examples of what a reply would look like (no code), and the free included one in Outlook, and the only code related stuff i found were only for sending emails, not responding to new emails, so it wasn't eve mentioned online, idk why no one mentioned this topic, is it not even possible to code it?




how can Find a question in the internet with python? [closed]

It is possible to create a python script that have as input a multiple choice question and find the answer by searching on the internet?




number of select types did not match || unparseable date "Tue Jan 15 00:00:00 SGT 2013"

I am having an error, I'm not sure why number of select types did not match those for insert. I have Request entity, with 3 values. billing_cycle, start_date, & end_date. I tried adding 0 at insert but still doesn't work.

UPDATE: My date is in String. It should be Date type. I changed SELECT to VALUES. I got new error: Unparseable date: "Tue Jan 15 00:00:00 SGT 2013"

My insert method

    @Override
    @Transactional
    public void insertRequest(Request request) {
    
     try {
    DateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd" );
    DateFormat inputFormat = new SimpleDateFormat("E MMM dd HH:mm:ss Z 
    yyyy");
    Date sdate = outputFormat.parse(request.getStart_date()) ;
    Date edate= outputFormat.parse(request.getEnd_date()) ;
    
    String sqlQuery;
    
        sqlQuery = "INSERT INTO Request "
                + "(billing_cycle, start_date, end_date) VALUES ("
                +  
                + request.getBilling_cycle() +", "
                + "'"+ sdate +"', "
                + "'"+ edate+"')";
        Query query = entityManager.createQuery(sqlQuery);
        query.executeUpdate();
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }   

My values

{
    "billing_cycle":"1", 
    "start_date":"Tue Jan 15 00:00:00 SGT 2013", 
    "end_date":"Thu Feb 14 00:00:00 SGT 2013"
}

My entity

@Entity
@Table(name="request")
public class Request {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="request_id")
    private int request_id;

    @Column(name="billing_cycle")
    private int billing_cycle;

    @Column(name="start_date", columnDefinition="Date")
    private String start_date;

    @Column(name="end_date", columnDefinition="Date")
    private String end_date;

Error:

Unparseable date: "Tue Jan 15 00:00:00 SGT 2013"
at java.base/java.text.DateFormat.parse(DateFormat.java:395)



Using jMeter to test IIS web garden - requests are using the same worker thread

I am using an IIS web garden for long running requests with 15 worker processes.

With, for example, 3 browsers, typically multiple worker processes are used.

With Apache jMeter, all requests are using the same worker process.

Is there a way to force the use of multiple worker processes?




how can i delete arabic language in my browser? [closed]

I often have trouble if i visiting websites that provide auto translate Screenshot




How to DJANGO Web Token and Save Procces (POST)?

I am trying to add data on views.py, I send username and password parameters on JSON body with POST method from POSTMAN . Normally The function work succesfully like below:

json_str=((request.body).decode('utf-8'))
    json_data = json.loads(json_str)
    new_device = Device(id=json_data["id"], status=json_data["status"])
    try:
        new_device.save()
        resp_data = {
        'code': 200,
        "success": True
    }
        return JsonResponse(resp_data)
    except Exception as e:
        error_data = {
            "success": False,
            "error": str(e)
            }

        return JsonResponse(error_data)

After enable djangorestframework_simplejwt package on my project and run it successfully I changed urls.py link like: path('add/', add_device) to path('add/', add_device.as_view()) On views.py:

class add_device(APIView):
    permission_classes = (IsAuthenticated,)
    
    def get(self,request):
        
        json_str=((request.body).decode('utf-8'))
        json_data = json.loads(json_str)
        new_device = Device(id=json_data["id"], status=json_data["status"])
        try:
            new_device.save()
            resp_data = {
            'code': 200,
            "success": True
        }
            return JsonResponse(resp_data)
        except Exception as e:
            error_data = {
                "success": False,
                "error": str(e)
                }

            return JsonResponse(error_data)

But now, always a json error message returns to me:

{
    "detail": "Method \"POST\" not allowed."
}

How do I fix it ?

Thank for all helps..




Current software technology stack being used [closed]

I had taken a hiatus from software development for just over 2 years. And I would like to get back into it. Obviously there's been quite a bit of movement in software technologies in these last couple of years.
My background was in Asp.Net C#, MVC, Databases like SQL Server/Oracle/MySQL, Web technology (Javascript, JQUery, CSS etc).
I have two questions, since I couldn't think of anywhere better to get answers than StackOverflow (used it a lot previously)

  1. Is the above still being used in your software development efforts?

  2. If not the above, what is the current software stack you are using in your current development?

    Thank you for any help that will guide me towards where I can put my efforts moving forward.




Node.js: puppeteer focus() function

I am trying to login on the site using puppeteer and then some other stuff after I am logged in. Connection to site was successful, but I have problem with function focus(). It needs a selector as an parameter, but after inserting one, it show an error (selector is good, because I ran document.querySelector("input.login-field") in console of the site and returned this: <input class="login-field" type="text" inputmode="email" autocapitalize="none" name="m" placeholder="Email or username" value="">). What's the problem?

Here's my code:

const puppeteer = require('puppeteer');

(async () => {
const browser = await puppeteer.launch({headless: false, slowMo: 25});

const page = await browser.newPage();
await page.goto("site");
await page.focus("input.login-field");
await page.keyboard.type("information");
await browser.close();

})();



How could a client know if new messages are there for it for a web based chat app?

I am developing a chat app using NodeJS as backend and using MongoDB. I had designed the database for storing messages between every clients. But just then, I have no idea how the client could be notified of new messages.

If a client logs in, the client can send an API request to get the most recent messages. But if the client stays logged in, and new messages are delivered that are meant for this client, the server records them in the database but cannot notify it until it requests for it(either by reloading the page or some other way). How could this be accomplished?

I was thinking of constantly polling the server for new messages, but wouldn't that be a lot of requests? I hope there could be some better ways to implement this. I'm relatively new to web development and this is my first project.




Can I develop a full advanced app on multi-platform with flutter dart language without anybody else just me?

I really want to know that because I have different ideas on how to work on high levels that give you many big things will gain from it.




TypeError: can only concatenate list (not "str") to list -

I am trying to get an email when user submit the contact us form. all the data is successfully getting updated in database but getting the err while sending this detail to my mail: -TypeError: can only concatenate list (not "str") to list. there is no '+' sign i have added, where I add anything.

from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
from flask_mail import Mail, Message
import json

with open('./templates/config.json','r') as f:
    params = json.load(f)["params"]

app = Flask(__name__)
app.config.update(
    MAIL_SERVER='smtp.gmail.com',
    MAIL_PORT=465,
    # MAIL_PORT=587,
    MAIL_USE_SSL=True,
    MAIL_USERNAME=params['gm_user'],
    MAIL_PASSWORD=params['gm_password']

)
mail = Mail(app)


if params['local_server']:
    app.config['SQLALCHEMY_DATABASE_URI'] = params['local_uri']
else:
    app.config['SQLALCHEMY_DATABASE_URI'] = params['prod_uri']

app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)

class Contacts(db.Model):
    sno = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50), primary_key=False)
    phone = db.Column(db.String(13), unique=False, nullable=False,primary_key=False)
    email = db.Column(db.String(120), unique=False, nullable=False,primary_key=False)
    msg = db.Column(db.String(500), nullable=False,primary_key=False)



@app.route("/")
def home():
    return render_template('index.html',urlDict = params)

@app.route("/post")
def post():
    return render_template('post.html',urlDict = params)

@app.route("/contact",methods = ['GET','POST'])
def contact():
    if request.method == 'GET':
        return render_template('contact.html',urlDict = params)
    elif request.method =='POST':
        fName = request.form.get("name")
        fEmail = request.form.get("email")
        fMsg = request.form.get("msg")
        fPhone = request.form.get("phone")
        entry = Contacts(name=fName, email=fEmail, msg=fMsg, phone=fPhone)
        db.session.add(entry)
        db.session.commit()
        **mail.send_message(subject='', sender=fEmail, recipients=params['gm_user'], body = '')**

        return render_template('contact.html',urlDict = params)

@app.route("/about")
def about():
    return render_template('about.html',urlDict = params`enter code here`)

app.run(debug=True)



Uploading large files, triggering shell scripts and displaying results

I need a method to upload large files (10GB+) from a web interface (or any other GUI) as client, trigger some shell scripts on the server's back-end (Ubuntu machine) and then display the results (.png and .txt files) in the web interface. What solution would you guys recommend?




How to do I Architect my Website Builder using Django and React

I am planning to make a website builder of my own using which a user can generate websites based on a category they like . I am using django rest framework to handle the backend part in django and send data in api format to the front end. I am using ReactJS to render the components in Frontend. I am Very much confused regarding the architecture of the Project. Should i be storing the React/ Html components in the database or Should I Declare a Few React Components and pass the parameters which is returned for a particular site




dimanche 30 août 2020

Web frontend designer

I am trying to learn web development and I did take some Django courses. I would like to know is there some kind of "Frontend Designer" (some think similar to wordpress) that can create templates like html etc. which are easy to use for Django developer? Or are there some kind of "Frontend Designer" that are more optimized for Django?

Many many thank in advance.




Why I can't re-fetch my website's data using vanilla JavaScript?

I am working on a practice project which is a clone of New York Times website. There, I do a default query and fetch some data. But now I want to add the functionality for a user to put their own search-term and fetch new data.

I have an array in which I store all of the data that I fetch from NYT's API and everytime I try to use the input field to manually search for data I get this error logged to the console:

the error which is logged to the console

--

Here's my JS:

const searchForm = document.getElementById('search-form');
const searchBox = document.getElementById('search-box');
const searchResults = document.getElementById('search-results');

const authKey = 'HL1zkPePcTNLTnPBpcDKBpWZWsAngbnq';
const apiKey = `api-key=${authKey}`;
const url = 'https://api.nytimes.com/svc/search/v2/articlesearch.json';

let content = [];

// DEFAULT QUERY
async function doQuery(queryTerm) {
  let query = `q=${queryTerm}`;

  const response = await fetch(`${url}?${query}&${apiKey}`);
  const data = await response.json();

  let newContent = data.response.docs.map(doc => ({
    id: doc._id,
    image: `https://www.nytimes.com/${doc.multimedia[5].url}`,
    headline: doc.headline.main,
    abstract: doc.abstract,
    author: doc.byline.original,
    section: doc.section_name,
    words: doc.word_count + ' words',
    readTime: Math.ceil(doc.word_count / 200) + ' min read time',
    rawDate: new Date(doc.pub_date),
    date: new Date(doc.pub_date).toLocaleDateString('en-US', {
      month: 'long',
      day: 'numeric'
    }),
    url: doc.web_url
  }));

  content = [...newContent];
  let li = [];

  for (i = 0, length = content.length; i < length; i++) {
    const pSuper = document.createElement('p');
    pSuper.innerHTML = content[i].section;
    const h3Headline = document.createElement('h3');
    h3Headline.innerHTML = content[i].headline;
    const pAbstract = document.createElement('p');
    pAbstract.innerHTML = content[i].abstract;
    const pSub = document.createElement('p');
    pSub.innerHTML = `${content[i].author} | ${content[i].words} | ${content[i].readTime}`;

    const imgImage = document.createElement('img');
    imgImage.src = content[i].image;

    const divDate = document.createElement('div');
    divDate.innerHTML = content[i].date;
    const divContent = document.createElement('div');
    divContent.append(pSuper, h3Headline, pAbstract, pSub);
    const divCard = document.createElement('div');
    divCard.append(divDate, divContent, imgImage);

    const aLink = document.createElement('a');
    aLink.href = content[i].url;
    aLink.setAttribute('target', '_blank');
    aLink.setAttribute('rel', 'noopener noreferrer');
    aLink.className = 'no-select';
    aLink.append(divCard);

    li = [...li, document.createElement('li')];
    li[i].append(aLink);

    searchResults.append(li[i]);

    // CLASSES
    divCard.className = 'card';
    divDate.className = 'date';
    divContent.className = 'content';

    pSuper.className = 'super';
    h3Headline.className = 'headline';
    pAbstract.className = 'abstract';
    pSub.className = 'sub';
  }
}

doQuery('covid');

// USER QUERY
function doSearch(e) {
  e.preventDefault();
  doQuery(searchBox.value);
}

searchForm.addEventListener('submit', doSearch);

--

P.S.




deploying:calling deep learning model into java spring back end web page

i'm familiar with both python ,java but i use java as back-end. my question is: Is there any API that I could use to contact back-end web implemented with java with deep learning model implemented with python ? or I'll face a lot of problems so it's better if i used python and flask ?




Is there an industry standard for implementing infinite scroll while loading (almost) only the items that are on the screen?

A lot of websites have an infinite scroll where they do not load all the contents. They load only the items you go to (and maybe a little more) and also remove the items above on the page from memory when you have scrolled down (so when you go back up, the items are reloaded). An example is Behance search: https://www.behance.net/search

Is there an industry standard way of implementing this? I'd ask for recommendations on the best way to do it if there isn't a standard but that would go against StackOverflow's guidelines.




Django view field and rendering data

Is it possible to multiple view field for a single page/template?

as example, suppose I have built site where people can post movie review and see others one as well. Now, I have to add an edit button to the review page and I don't want to let other viewers see that edit option. everyone can only see that edit option when they will be on their own article's page. Can you suggest me how to do that? Still now I have thought to create two different views, one for seeing the review and another one to edit and render them into a single template.




Is there a `v-html` equivalent in Svelte?

I have recently taken on Svelte and I have been coding a couple of things with it. I have been just doing

<script>
  let title = "Amazing title"
</script>

<h1>{ title }</h1>

when setting the complete value of an html element to the variable, but I would like to know if there is a better way to accomplish this such as the v-html in Vue JS

<template>
  <h1 v-html="title" />
</template>

<script>
export default {
  data() {
    return {
      title: "Amazing title"
    }
  }
}
</script>

Thanks a ton for all of your help and have a great day!




Best way to put a kotlin program on a website?

I have written a duel simulator in Kotlin for an online video game. The user has to input the combat levels of both players, then how many duels they want to simulate, and then click start and it will recreate the duels and return the win% and other stats to the user. It takes <2 seconds to run 100,000 simulations on my laptop.

I really need help working out how to get this onto a website though because I am only now learning html, css, and javascript. So what should I do, the options I have come across so far are

  1. turn it into an applet/application (but I read this is deprecated in java?) and then embed it into my webpage, or
  2. convert it into JavaScript and have it run on the users browser (but I worry this will be slow, or look laggy, or allow someone else to simply copy the entire thing?), or
  3. just have a form on my page that sends the details the user enters to a server (?) where it runs and then returns the result to the user whilst the user sees some pretty loading animation?

So am I on the right track or way off here? Any advice will be appreciated, like pointers on what to learn and where to look for good information.




30 days from first visit Javascript

I need to show a modal on my Webpage to the users after 30 days of the first visit.

I made a cookie which expires after 1 year of the first visit, I tried to subtract 335 days from the expiration date to have 30 days from creation date but it doesn't work.

Here's my cookie code

function GetCookie(name) {
  var arg=name+"=";
  var alen=arg.length;
  var clen=document.cookie.length;
  var i=0;
  while (i<clen) {
    var j=i+alen;
    if (document.cookie.substring(i,j)==arg)
      return "here";
    i=document.cookie.indexOf(" ",i)+1;
    if (i==0) break;
  }
  return null;
}
function testFirstCookie(){
    var visit=GetCookie("FirstTimeVisitCookie");
    if (visit==null){
      //it does something
   
   }
        var expire=new Date();
       expire=new Date(expire.getTime()+(1000 * 60 * 60 * 8760)); //expires in 1 year
       document.cookie="FirstTimeVisitCookie=here; expires="+expire + "; path=/";

       var month = new Date(expire.getTime() - (1000 * 60 * 60 * 8040)); // I substracted 335 days from expiration date to get 30 days from the creation of the cookie
        var time_now = new Date();
       time_now  = time_now.getTime();

        if (time_now >= month) {

            //shows a popup
         }
            
       
}
$(document).ready(function(){
    testFirstCookie();
});

Any help would be much appreciated!




Chrome compiling problems

So, I developed a website and it looks good on all browsers. But when I uploaded it to webserver, it looks different on google chrome. I tried to open my html project directly from computer via chrome and it looks ok. Why G.Chrome compiling different on webserver when directly from computer it looks good. Where can be a problem? How can I fix it?




public, date database to get information about dates [closed]

I am trying to build a webpage with django. I like to have section that has a sentence about current day and name of it like fathers day or independence day.. Since these days change every year how sould I write the code. Tnx




Interact Java Discord Bot with Java Spring Boot Website

Good afternoon, I would like to do a communication between a Java Discord Bot and a website. I have heard that Java Spring Boot is suitable. How does it work and are there examples. With kind regards




Restrict HTTP access in CakePHP

I have a Controller class that extends from AppController in CakePHP. And this Controller class has a public function .. lets say testFunc()

    class xyzController extends AppController {
          ..
          ..
          public function testFunc($params, $auth_username)
          {
                 ..
                 ..
          }
    }

I have made this function public since I need to call it from another Controller that too extending from AppController.

class abcController extends AppController {
      ..
      ..
      public function callingFunc()
      {
             ...
             $controller = new xyzController($this->request, $this->response);
             $controller->testFunc($params, $username);
      }
      ..
      ..
}

But since I made it public, I see that testFunc() is accessible using curl command for the below https path

https://[ip_address]/xyz/testFunc/arg=test/root

As you can see, the above path takes "root" as argument to testFunc() and gives full access to anyone using the above path in curl command.

My requirement is to remove this security issue.

I am totally new to PHP and CakePHP. Can someone please give any pointers to how I can proceed?




Deploying a custom domain with Heroku and Domain.com

I'm new to web dev and this would be my first proper deployment so apologies if this is a basic question. After following the steps on Heroku and Domain.com, my app is not showing at the desired url: www.rocketcreative.agency

Heroku I've set up a basic web app (a draft version atm) on Heroku, and the code is working fine on https://hidden-sierra-22116.herokuapp.com . I've followed the Heroku instructions to generate a DNS target (cubic-orange-7jtaz36102kt9f8dir53koko.herokudns.com) for a domain I own (www.rocketcreative.agency) Heroku Dashboard Screenshot

Domain.com I added the DNS target to Domain.com as a CNAME (with 'www' as the host name). I've waited 24 hours for the changes to propagate, and DNS checking sites indicate that the DNS has propagated. I've spoken to Domain.com support and they said everything appears to be set up correctly. Domain.com DNS Screenshot

Terminal: In the terminal, when I input host www.rocketcreative.agency, it returns www.rocketcreative.agency is an alias for encircled-horseradish-4mpqnlzar9say364tz3hgy80.herokudns.com.

Browser Results for www.rocketcreative.agency

Safari: 'Safari Can't Find The Server'

Chrome: 'www.rocketcreative.agency’s server IP address could not be found. DNS_PROBE_FINISHED_NXDOMAIN'

I imagine this is a really basic question but if anybody could help that would be great. If there's any other info I need to provide please let me know. :)




Does Google Chrome's message "A data breach on a site or app exposed your password" indicates a vulnerability in my webpage?

I have a website with typical login page, however when i login to the website with specific credentials, the Google Chrome's message "A data breach on a site or app exposed your password. Chrome recommends checking your saved passwords now";

Does this message indicates that there's a vulnerability in my login page in which enabled hackers to breach my password, and accordingly shall change some code regarding the functionality of my webpage, or does it indicate something different am unaware of, as after a research on the following link there's apparently other aspects Google Chrome takes into consideration prior to displaying this message.

Please Advise, Thanks in Advance,




Detect and Deleted Duplicate addresses in Django. Foreign key constraint failed Error

I am creating a Billing Platform for my Web Control Panel(https://github.com/sbsarnava/HostingEcom/). In the checkout page, when saving an instance of BillingAddress Model, in a post_save signal a code is run to check the instance against previously saved instances, if it is a duplicate then, The Order model references to the duplicate BillingAddress Instance and the current instance is deleted. The Code is not working and is raising a Foreign Key Constraint Error. I am nub, please help !. Please Look into my github repo for full structure of the project. My signals.py file :-

from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from .models import BillingAddress


@receiver(post_save, sender=BillingAddress)
def dont_save_if_all_fields_matching(sender, instance, created, **kwargs):
    if created:
        previousBilling = BillingAddress.objects.all()
        currentBilling = BillingAddress.objects.get(id=instance.id)
        print('From the Signal: ')
        print(instance.id)
        range1 = 10
        range2 = len(previousBilling)
        match = [[False] * range1] * range2
        c1 = 0
        for i in range(len(previousBilling)):
            if previousBilling[i].firstname == instance.firstname:
                match[c1][0] = True
            if previousBilling[i].lastname == instance.lastname:
                match[c1][1] = True
            if previousBilling[i].phonenumber == instance.phonenumber:
                match[c1][2] = True
            if previousBilling[i].email == instance.email:
                match[c1][3] = True
            if previousBilling[i].address1 == instance.address1:
                match[c1][4] = True
            if previousBilling[i].address2 == instance.address2:
                match[c1][5] = True
            if previousBilling[i].city == instance.city:
                match[c1][6] = True
            if previousBilling[i].country == instance.country:
                match[c1][7] = True
            if previousBilling[i].state == instance.state:
                match[c1][8] = True
            if previousBilling[i].pincode == instance.pincode:
                match[c1][9] = True
            c1 += 1
        print('Match:')
        print(match)
        sort = [True] * len(match)

        for i in range(len(match)):
            for j in range(len(match[i])):
                if match[i][j] == False:
                    sort[i] = False
                else:
                    continue
        print('Sort:')
        print(sort)
        for i in range(len(sort)):
            if i == True:
                # relatedOrder = currentBilling.order
                # relatedOrder.billingAddress = BillingAddress.objects.get(id=i)
                # relatedOrder.save()
                # currentBilling.delete()
                relatedOrder = instance.order_set.get(billingAddress=instance)
                currentBilling.order_set.clear()
                relatedOrder.billingAddress_id = i
                relatedOrder.save()
                instance.delete()
                return

My Billing Model and Order Model :-

class BillingAddress(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    firstname = models.CharField(max_length=200)
    lastname = models.CharField(max_length=200)
    phonenumber = models.CharField(max_length=20)
    email = models.EmailField(blank=True, null=True)
    address1 = models.CharField(max_length=1000)
    address2 = models.CharField(max_length=1000, blank=True, null=True)
    city = models.CharField(max_length=100, blank=True, null=True)
    country = models.CharField(max_length=100)
    state = models.CharField(max_length=100)
    pincode = models.IntegerField()
    saveAddress = models.BooleanField(default=False, null=True)

    def __str__(self):
        return self.user.username


class Order(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT)
    orderId = models.CharField(max_length=10, default=randomNumber(), unique=True)
    cartItems = models.OneToOneField(Cart, on_delete=models.CASCADE)
    created_date = models.DateTimeField(default=datetime.now)
    placed_date = models.DateTimeField(null=True, blank=True)
    updated_date = models.DateTimeField(auto_now=True)
    ordered = models.BooleanField(default=False)
    billingAddress = models.ForeignKey(BillingAddress, null=True, on_delete=models.SET_NULL)
    status = models.CharField(choices=ORDER_STATUS, default='processing', max_length=11)

    def __str__(self):
        return f"{self.user} - {self.placed_date}"



Hi, am trying to install composer and it keeps give me the following. Am new to laravel. Any assistance is appreciated :)

Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Your requirements could not be resolved to an installable set of packages.

Problem 1 - Installation request for league/flysystem 1.1.3 -> satisfiable by league/flysystem[1.1.3]. - league/flysystem 1.1.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system. Problem 2 - Installation request for league/mime-type-detection 1.4.0 -> satisfiable by league/mime-type-detection[1.4.0]. - league/mime-type-detection 1.4.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system. Problem 3 - league/flysystem 1.1.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system. - laravel/framework v7.26.1 requires league/flysystem ^1.0.34 -> satisfiable by league/flysystem[1.1.3]. - Installation request for laravel/framework v7.26.1 -> satisfiable by laravel/framework[v7.26.1].

To enable extensions, verify that they are enabled in your .ini files: - C:\xampp\php\php.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.




How can I make webbuilder application?

I'm asking how can I make (exe) application to make website like wyswiygwebbuilder

I know Python, C# and Some C++. I asked the owner he said he made it on C++/Visual Studio How can I make something like that. what i need to learn and which frameworks because I have no idea about it




why these error ??? django.db.utils.OperationalError: foreign key mismatch - "new__bloodapp_profile" referencing "bloodapp_user"

class User(AbstractUser): user_id = models.UUIDField(default=uuid.uuid4, primary_key=True, unique=True, editable=False)

class Meta:
    ordering = ['username']
    verbose_name_plural = 'User'

class Profile(models.Model):

GENDER = (('m','Male'), ('f','Female'))


user = models.OneToOneField(User, on_delete=models.CASCADE)
gender = models.CharField(max_length=1, choices=GENDER)
phone = models.CharField(max_length=11, blank=True, null=True)
country = CountryField()
address = models.TextField()
image = models.ImageField(default='default.jpeg',   upload_to='profile_pics')
blood_group = models.ForeignKey(UserGroup, default=1, on_delete=models.CASCADE)

def __str__(self):
    return f'{self.user.username} ({self.user.email})'

when i run python manage.py migrate the bellow error pops up




Using HTTrack to download links only under a certain subdomain (nothing external)

So, this is what I am trying to download - https://www.slader.com/textbook/9781337624183-calculus-9th-edition/

Looks fairly simple, I tried adding a few lines to "scan rules" to force it to download everything under it but for some reason, the entire process finishes under 10 seconds and it doesn't go further than just downloading the aforemention link itself. For example, in addition to having https://www.slader.com/textbook/9781337624183-calculus-9th-edition/ itself, I would like to have all links originating from it, such as https://www.slader.com/textbook/9781337624183-calculus-9th-edition/311/ too. Essentially, everything that starts with the first link above (including embedded pictures originating from other domains, but no external links beyond that point).




How to reinstall or uninstall font custom from ubuntu?

I am using Ubuntu 18 version. I installed font custom version 2.0. and fontforge version "libfontforge 20170924". but it has some problems while compiling. so i want to reinstall or uninstall fontcustom in my computer.i tried some commnads like - "sudo apt remove fontcustom", "sudo apt get remove fontcustom". but nothing works. if anyone know please let me know.




What best solution for prevent browser cache file in react

My problem is when I deploy new version react web to production some user browser display old version from previous deploy My user have to press ctrl+f5 for clear cache browser then I think which bad solution please suggest best solution for me thx bro.




samedi 29 août 2020

Google Chrome Violation Problem. Why Showing, I don't Know. Please Help Me

Maybe Jquery Or Javascript Problem.Click For Image




how to configure reverse proxy to internal web server

I am using Apache/2.4.29 (Ubuntu) and need to configure it as reverse proxy server for internal web server. my virtual host configuration in like below.

<VirtualHost *:80>

    ServerName      web.example.com
    ServerAlias     web.example.com
    ProxyRequests off
    ProxyPreserveHost On
    ProxyPass / http://192.168.1.15/web/public/
    ProxyPassReverse / http://192.168.1.15/web/public/
    ProxyPassReverseCookiePath / /
    <Location "/">
    Order allow,deny
    Allow from all
    </Location>
    ErrorLog ${APACHE_LOG_DIR}/web-error.log
    CustomLog ${APACHE_LOG_DIR}/web-access.log combined

Expected result: http://web.example.com and Actual result: http://web.example.com/web/public/




NGINX act as a forward proxy?

is NGINX best solution to used as a forward proxy server?

current design

What do you think will be the advantage and disadvantage of this approach?




How to create an address bar within a website?

So im looking to make a address bar within my website. I want to be able to redirect customers to the invoice that they need to pay. For example, they will go to website.com/pay then there will be a box where they can type in there invoice number and when they submit it will redirect them to website.com/pay/(whatever the invoice number they just typed). Is this sort of thing possible? Thanks




I have made a new website and I am not sure if it is possible to add page transitions when looking at items

I have just made this new website and I would really like to add a transition to it when looking at products can you tell my if it is possible to add a transition, here's the website link https://agile-dawn-24847.herokuapp.com




(Python) Trying to parse with beautifulsoup on a webpage that updates after its initial load

For example, if you go here: https://www.basspro.com/shop/en/herters-hunting-rifle-ammo/

you'll notice on the first load, it'll show everything in stock. Then, the page will update again and show all the things which are out of stock.

Is there any way to use beautifulsoup to account for this? I'm starting to think I'm going to need to use a different strategy to pull the updated HTML code.

Because as it stands, my code

`content_wrapper = soup.find('div', class_='col2 gridCell StoreAvail editable anchored', id='StoreAvail_7') cheese = content_wrapper.find('div', class_='sublist instore_inventory_section nodisplay', id='WC_InStore_Inventory_Section_3074457345618960372')

print(cheese)`

returns nothing because there is no "out of stock" text in the code that beautifulsoup pulls.

Thanks for reading.




What are the resources most useful for musician startup for marketing?

I thought to promote my friend for her music I need tools to help her any one knows about the tools for marketing?




How to does a product review web application works? [closed]

I'm trying to create my own product review web application that can run on my web site so people can easily post review through website. I have experience in HTML and CSS but I'm new to JS, PHP and databases attached to websites.

An example review application is as follows,

product search for review

This review site has a simple design where people can enter a brand name or product name in a search bar and the site drop downs a menu to choose from and write a review. See below picture,

Drop downs a list of products and brands

Could you explain how this kind of application basically works ? What are the back end technologies involved here. I just need to know how this Works. (I DON'T need codes or debugging know-how.)

Thank you.




How to program a product review application for a website? [closed]

I'm intending to make a product review website. I'm trying to create my own product review web application that can run on my web site so people can easily post review through website and also smartphone app. I have experience in HTML and CSS but I'm very new to JS, PHP and databases attached to websites.

An example review application is as follows,

product search for review

This review site has a simple design where people can enter a brand name or product name in a search bar and the site drop downs a menu to choose from and write a review. See below picture,

Drop downs a list of products and brands

Could you tell me how to design an web application like this from scratch? What are the programming languages involved and how does the data bases are attached to work like above application. Any online tutorial that might give me an idea of how to create a review web application would also very helpful.

Thank you.




How can I get a User input and add it in a url and open the url in a new tab?

I know nothing about it. I need to make a simple website.

I will take an input from user. Suppose the input is 'LOL' Then I need to open a new tab with this url - "https://www.help.me/LOL"

#Help me Please




Should I have multiple firebase projects for a single web app but separate user bases?

I'm developing a web app using Firebase and I need to be able to provide it to different customers, ie. as if each had it's own independent web app with it's own user base, database etc…

Should I create one Firebase project per client ? And if so, how can I then make it such that updates to the web app in a single place reach every customer ?




How to forward to other web pages with web forwarding

I'm currently creating a website with node.js and I'm using ngrok to make it public. I have registered a domain for forwarding to the URL generated by ngrok, so that the users can access to the node.js website by entering a domain e.g. http://www.example.com.

However, when I tried to visit another web page (http://www.example.com/login), it would always display the main page while URL remains the same (still displays as /login). but it works perfectly if I do the same thing with the URL of ngrok. so what should I do to make the web forwarding works for other web pages?

Thanks!




How do I have background shapes on my webpage?

I am very new to HTML and CSS and for the life of me cant work out how to have the background shapes I want in my design I have added an image below. Any help would be much appreciated.

Thank you!

Image of background shapes




Can anyone help me why VS Code server is not opening automatically?

I am using VS code in windows 7 and its live server is not working but when I type in chrome tab localhost:5500 the website is showing. Can anyone explain to me why the Live server is not coming up automatically?




Can anyone help me why VS Code server is not opening automatically?

I am using VS code in windows 7 and its live server is not working but when I type in chrome tab localhost:5500 the website is showing. Can anyone explain to me why the Live server is not coming up automatically?




How to Setup Cloudfare SSL on Freehosting.com

I have a website Registration with Hostinger.in I did my website hosting in Freehosting.com

I copied the namespace details from freehosting on to hostinger.in and designed my website using wordpress in freehosting.com

The website is working fine.

I am trying to create a free ssl certificate using cloudfare but where should i update the namespace details of cloudfare? either on hostinger.in or freehosting.com

Freehosting.com doesn't have the option to change namespace details.

Thanks for the help.




what is the wrong with the alignment in the webpage at https://ift.tt/3hGyog7 [closed]

I was asked in a interview that the specified webpage has a single alignment error or has a wrong single alignment. I could not answer it. what is the procedure to find it?




THE USEFULNESS OF WEB DEVELOPMENT [closed]

Hello friends I hope you are doing well. Please, I would like you to tell me clearly with supporting examples what is the point of learning web development given that nowadays there are CMS that allow us to create websites without knowing how to code. I would really like you to give me some answers with concrete examples.

 THANK YOU IN ADVANCE



Django Foreign key on Modelform

I'm working on the project that Django tutorial provides. I'm just trying to expand functionality like: login, registration, poll CRUD and so on. I have two models:

class Question(models.Model):
    question_text = models.CharField(max_length=70)
    describtion = models.TextField(null=True, max_length=200)
    pub_date = models.DateTimeField(auto_now=True)

    def was_published_recently(self):
        return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
    was_published_recently.admin_order_field = 'pub_date'
    was_published_recently.boolean = True
    was_published_recently.short_description = 'Published recently?'

    def __str__(self):
        return self.question_text

class Choice(models.Model):
    question = models.ForeignKey(Question, on_delete = models.CASCADE)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)

    def __str__(self):
        return self.choice_text

Thet connected via foreignkey. So, each choice has it's own question. And set up in admin dashboard,so if i try to create new question i can add as many choices i want. I just configured it in admin.py. Problem is this I want to have a form that user can submit a question and its choices. I've done first part that user can create poll question, but cannot handle to add choices while creating question itself. Choices should automatically connected to Question. Please help me solve this problem. My ModelForm looks like this


class QuestionForm(ModelForm):
    class Meta:
        model = Question
        fields = ['question_text','describtion']
        widgets = {
            'question_text': forms.TextInput(attrs={'class':'form-control','placeholder':'Enter name for poll','id':'title'}),
            'describtion': forms.Textarea(attrs={'class':'form-control','placeholder':'Enter name for poll','id':'describtion'})
        }



Consider a warehouse with the following characteristics:

Consider a warehouse with the following characteristics: Wide aisle pallet racking; block pallets which are 1.7m high. Free building height is 11m. For each sub-question below, show your calculations, and indicate any assumptions you make.

a) Calculate the number of locations that can fit one above the other. (20 marks) b) How many floor sections do you need to realize for the storage of 2000 pallets. (20 marks)




Python Selenium Geckodriver should be in PATH

I'm trying to fill a form automatically using Selenium. Here is the HTML code:

<!DOCTYPE html>
<html>
<body>

<h2>Text input fields</h2>

<form>
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" name="fname" value="John"><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" name="lname" value="Doe"><br>
    <label for="cars">Choose a car:</label>
  <select id="cars" name="cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="fiat">Fiat</option>
    <option value="audi">Audi</option>
  </select><br>
  <textarea name="message" rows="10" cols="30">The cat was playing in the garden.</textarea>
</form>

Here is the Python/Selenium code: It says the Geckodriver needs to be in PATH. Previously when I got this error, I specified the executablepath but that doesn't seem to be working anymore. What am I doing wrong?

import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox(executable_path="C:\Users\Anna\Downloads\geckodriver")
driver.get("example form.html")

#First name
element = driver.find_element_by_name("fname")
element.clear()

element.send_keys("Anna")

#Last name
element = driver.find_element_by_name("lname")
element.clear()

element.send_keys("Zharavina")

#Dropdown list | Car selection
select = Select(driver.find_element_by_name("cars"))
select.deselect_all()
select.select_by_value(volvo)

#Textarea
element = driver.find_element_by_name("message")
element.clear()

element.send_keys("Test message 10013341381")

This is the error I am getting:

Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 7, in <module>
    driver = webdriver.Firefox(executable_path="geckodriver.exe")
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
    self.service.start()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver.exe' executable needs to be in PATH.

What am I doing wrong?




Web speech recognition automatically disconnects

So I have a project where I need to make a Web based Virtual Assistant. The problem is that the Web Speech Recognition Api automatically disconnects the microphone if it does not hear something in like 5 seconds (so I need to turn it back on). My question is how can I keep the mic active so that when I say the wake word it uses the next recognition result as a command. *Extra explication: -The mic should be always listening so that when I say the wake word it hears it. -If I don't speak for about 5 seconds the mic disconnects so I need to turn it back on manually (how to get rid of this auto-disconnect?) Thanks!




Responsive grid in webdesign

I am a student, currently, I am learning UI and UX designer without coding background, My in doubt responsive grid Layout I use adobe xd to design a webpage (artboard 1366x766) I use default layout 12 Colum, gutter width 16, a colum with 76 margins 139 when I show my design to developer friends they told use bootstrap grid for responsive to make the responsive design for mobile-friendly. I ask them Colum size, colum width, gutter width and margin size (left and right margins size like in android), they told me to refer internet. I read may article many of the use of different numbers and size, it makes me confuse.

can any know please tell me...

Explain to me the following doubts

1.I have a static showcase website (How to pick grid for this site)? i need Colum size, colum width, gutter width and margin size

2.how to set a Layout grid for an e-commerce website? Colum size, colum width, gutter width and margin size

3 how to set a bootstrap grid for the website in xd?




vendredi 28 août 2020

Where is the code for http authentication?

I was researching HTTP Authentication and came across several questions. Where do you define the username and password? Is the code for this feature in web engines such as Apache or somewhere else? Where are http authentication username and password stored? How does the server check if the http header password matches the actual one?




Deploying Django App to Heroku Cant load Staticfiles

I have successfully deployed my django app to heroku. but for some reason, they cant load the templates and staticfiles.

my directories are as such: eximia (project directory)

  • eximia: init.py asgi.py settings.py wsgi.pyurls.py
  • web: templates, static: web: style.css, images: (all the images are in this folder)

and the rest of the files are normal typical django app files.

my settings.py are as follows:

Django settings for eximia project.

Generated by 'django-admin startproject' using Django 3.1.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""

from pathlib import Path
import os

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'sy4a^dk+1%2!g2@4s$2ihk0^9%!9or&+ycy2#0a^*qqhdksk#t'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = [
    "eximia-denim.herokuapp.com"
]


# Application definition

INSTALLED_APPS = [
    'web',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'eximia.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'eximia.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}


# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'

Im very new to django and this is sorta my first website. So if theres any help i would really appreciate it!! thank you! :D




How language of programming is most used for web?

Which language is currently being used for web and mobile development in the world, and which technologies are most promising within a year?




Is there a free and good website builder I can use? [closed]

me and a couple of friends are setting up a website. I'm looking for software that allows me to easily edit the html/css part of the site (like element drag and drop or something). I would like something that is very configurable and allows me to edit the html css and javascript code directly. Unfortunately I cannot afford something like the adobe products but I haven't been able to find something that is free and suits me.

Does anyone know a program that I could use?




Why should use 'venv' when use Flask framework?

Nowadays I've studied Flask Web framework for developing app. And I use python for programming language. I searched how to use the Flask then the most people say that when I use flask, I should activate virtual environment so called venv. I got the curiosity at that point why I should use virtual environment when I use Flask Web framework. I appreciate to answer this from everyone. Anybody help me please!




grpc-web protobuf compilation: How to enable jspb.Message.GENERATE_FROM_OBJECT option?

I have a react-app that uses grpc-web to interface with our grpc server. I want to be able to convert POJOs to the compiled GRPC classes so I can easily initiate requests. It seems like the protobuf compiler has an option jspb.Message.GENERATE_FROM_OBJECT that is set to false by default here:

https://github.com/protocolbuffers/protobuf/blob/master/js/message.js

It seems like this option is what I want: I can call Object.fromObject(pojo) and it will give me a protobuf class object that I can then initiate requests with. A similar function Object.toObject() already exists that gives me a POJO from a generated class object.

However, I cannot figure out a way to enable this option. How exactly do I make this happen?




Event on new data load

Is there any event that happens when new data is loaded? For example, when new data is loaded in the feed of social media sites such as Facebook, does any event fire on that?




Atom Does Not Let Me Add a Picture

On Atom, I added a hyperlink that led to another page. However, whenever I type on that new page, the text seems to be grey. It does not let mr code or add a picture. For example, when I write: <img src="Picture address" alt="picture name", <img src="Picture address" alt="picture name" will be written on the page and the picture won't be seen. I checked my code over and over again but I still can't manage to find out what's wrong with it. Thank you in advance!




How does web browsers render image/video/audio

This is a basic question, I forgive me if it does not fit the posting criteria.

Does web browser contain codecs for multimedia purposes?




Create Quiz using Javascript

I am creating a multiple choice quiz using Javascript. The option will turn green if the user select correct answer and turn red if answer is wrong. But I need to show the correct answer with answer user selected if the selected answer is wrong. I need to congratulate the user if the user get 60% marks or more. Please help me to find a solution.

HTML

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  <title>Quick Quiz - Play</title>
  <link rel="stylesheet" href="/Main/main.css" />
  <link rel="stylesheet" href="game.css" />
</head>

<body>
  <div class="container">
    <div id="game" class="justify-center flex-column">
      <div id="hud">
        <div id="hud-item">
          <p id="progressText" class="hud-prefix">
            Question
          </p>
          <div id="progressBar">
            <div id="progressBarFull"></div>
          </div>
        </div>
        <div id="hud-item">
          <p class="hud-prefix">
            Score
          </p>
          <h1 class="hud-main-text" id="score">
            0
          </h1>
        </div>
      </div>
      <h2 id="question">What is the answer to this questions?</h2>
      <div class="choice-container">
        <p class="choice-prefix">A</p>
        <p class="choice-text" data-number="1">Choice 1</p>
      </div>
      <div class="choice-container">
        <p class="choice-prefix">B</p>
        <p class="choice-text" data-number="2">Choice 2</p>
      </div>
      <div class="choice-container">
        <p class="choice-prefix">C</p>
        <p class="choice-text" data-number="3">Choice 3</p>
      </div>
      <div class="choice-container">
        <p class="choice-prefix">D</p>
        <p class="choice-text" data-number="4">Choice 4</p>
      </div>
      <div class="timer-quiz">Time left : <span id="timer"></span>
      </div>
    </div>
    <audio id="crctmusic" src="/Assets/win31.mp3" preload="auto"></audio>
    <audio id="wrngmusic" src="/Assets/computerError.mp3" preload="auto"></audio>
    <script src="game.js"></script>
</body>

</html>

CSS

.choice-container {
  display: flex;
  margin-bottom: 0.5rem;
  width: 100%;
  font-size: 6vw;
  border: 0.1rem solid rgb(86, 165, 235, 0.25);
  background-color: white;
  text-align: justify;
}

.choice-container:hover {
  cursor: pointer;
  box-shadow: 0 0.4rem 1.4rem 0 rgba(86, 185, 235, 0.5);
  transform: translateY(-0.1rem);
  transition: transform 150ms;
}

.choice-prefix {
  padding: 1.5rem 2.5rem;
  background-color: #56a5eb;
  color: white;
}

.choice-text {
  padding: 1.5rem;
  width: 100%;
}

.correct {
  background-color: #28a745;
}

.incorrect {
  background-color: #dc3545;
}

/* HUD */

#hud {
  display: flex;
  justify-content: space-between;
}

.hud-prefix {
  text-align: center;
  font-size: 8vw;
}

.hud-main-text {
  text-align: center;
}

#progressBar {
  width: 15rem;
  height: 3rem;
  border: 0.3rem solid #56a5eb;
  margin-top: 1.5rem;
}

#progressBarFull {
  height: 3rem;
  background-color: #56a5eb;
  width: 0%;
}

/*TIMER*/
.timer-quiz {
  color: #efd0ca;
  text-align: center;
  font-size: 10vw;
  background-color: #56a5eb;
  width: 100%;
}

Javascript

const question = document.getElementById("question");
const choices = Array.from(document.getElementsByClassName("choice-text"));
const progressText = document.getElementById("progressText");
const scoreText = document.getElementById("score");
const progressBarFull = document.getElementById("progressBarFull");
let currentQuestion = {};
let acceptingAnswers = false;
let score = 0;
let questionCounter = 0;
let availableQuesions = [];

let questions = [{
    question: "Inside which HTML element do we put the JavaScript??",
    choice1: "<script>",
    choice2: "<javascript>",
    choice3: "<js>",
    choice4: "<scripting>",
    answer: 1
  },
  {
    question: "What is the correct syntax for referring to an external script called 'xxx.js'?",
    choice1: "<script href='xxx.js'>",
    choice2: "<script name='xxx.js'>",
    choice3: "<script src='xxx.js'>",
    choice4: "<script file='xxx.js'>",
    answer: 3
  },
  {
    question: " How do you write 'Hello World' in an alert box?",
    choice1: "msgBox('Hello World');",
    choice2: "alertBox('Hello World');",
    choice3: "msg('Hello World');",
    choice4: "alert('Hello World');",
    answer: 4
  }
];

//CONSTANTS
const CORRECT_BONUS = 1;
const MAX_QUESTIONS = 50;

startGame = () => {
  questionCounter = 0;
  score = 0;
  availableQuesions = [...questions];
  getNewQuestion();
};

getNewQuestion = () => {
  if (availableQuesions.length === 0 || questionCounter >= MAX_QUESTIONS) {
    localStorage.setItem("mostRecentScore", score);
    //go to the end page
    return window.location.assign("/End/end.html");
  }
  questionCounter++;
  progressText.innerText = `Question ${questionCounter}/${MAX_QUESTIONS}`;
  //Update the progress bar
  progressBarFull.style.width = `${(questionCounter / MAX_QUESTIONS) * 100}%`;

  const questionIndex = Math.floor(Math.random() * availableQuesions.length);
  currentQuestion = availableQuesions[questionIndex];
  question.innerText = currentQuestion.question;

  choices.forEach(choice => {
    const number = choice.dataset["number"];
    choice.innerText = currentQuestion["choice" + number];
  });

  availableQuesions.splice(questionIndex, 1);
  acceptingAnswers = true;
};

choices.forEach(choice => {
  choice.addEventListener("click", e => {
    if (!acceptingAnswers) return;

    acceptingAnswers = false;
    const selectedChoice = e.target;
    const selectedAnswer = selectedChoice.dataset["number"];

    const classToApply =
      selectedAnswer == currentQuestion.answer ? "correct" : "incorrect";

    if (classToApply === "correct") {
      incrementScore(CORRECT_BONUS);
    }
    if (classToApply === "correct") {
      document.getElementById('crctmusic').play();
    } else {
      document.getElementById('wrngmusic').play();
    }

    selectedChoice.parentElement.classList.add(classToApply);

    setTimeout(() => {
      selectedChoice.parentElement.classList.remove(classToApply);
      getNewQuestion();
    }, 1000);
  });
});

incrementScore = num => {
  score += num;
  scoreText.innerText = score;
};

startGame();



how to confirm password in react to change it and post in api?

i have api URL: X/profile/password which take oldpassword and newpassword as request body build in express now i need to use it to allow user to change password but i cant realize how to confirm new password this is my code in react:

export default function UserProfile() {
const classes = useStyles();
const [user, setUser] = useState({
old_password: "",
new_password: "",
});

const updatePass = (event) => {
setUser({ ...user, [event.target.name]: event.target.value });
};

const submitHandler = async (e) => {
e.preventDefault();
try {
  console.log(user);
  const resp = await Axios({
    method: "POST",
    url: `http://localhost:3001/api/profile/password`,
    headers: {
      "Content-Type": "application/json",
    },
    data: user,
  });
  console.log(resp);
} catch (error) {
  console.log(error.message);
}
};
 const [mail, setMail] = useState({
 new_email: "",
 });

 const updateMail = (event) => {
 setMail({ ...mail, [event.target.name]: event.target.value });
 };

 const submitHandler2 = async (e) => {
 e.preventDefault();
try {
  console.log(user);
  const resp = await Axios({
    method: "POST",
    url: `http://localhost:3001/api/profile/email`,
    headers: {
      "Content-Type": "application/json",
    },
    data: mail,
  });
  console.log(resp);
  } catch (error) {
  console.log(error.message);
 }
 };

return (
<div>
  <GridContainer>
    <GridItem xs={12} sm={12} md={12}>
      <Card>
        <CardHeader color="primary">
          <h4 className={classes.cardTitleWhite}>Edit Email</h4>
          <p className={classes.cardCategoryWhite}>
            Update your current email address
          </p>
        </CardHeader>
        <CardBody>
        <form className={classes.form} noValidate onSubmit={submitHandler2}>
          <GridContainer>
            <GridItem xs={12} sm={12} md={4}>
            <TextField
                label="Email address"
                id="new_email"
                fullWidth
                  required
                  name="new_email"
                  autoComplete="new_email"
                  autoFocus
                  onChange={updateMail}
                
              />
            </GridItem>
          </GridContainer>
          </form>
        </CardBody>
        <CardFooter>
          <Button color="primary"
          type="submit"
          variant="contained"
          className={classes.submit}>Update Email</Button>
        </CardFooter>
      </Card>
    </GridItem>
    <GridItem xs={12} sm={12} md={12}>
    <form className={classes.form} noValidate onSubmit={submitHandler}>
      <Card>
        <CardHeader color="primary">
          <h4 className={classes.cardTitleWhite}>Edit Password</h4>
          <p className={classes.cardCategoryWhite}>Update your Password</p>
        </CardHeader>
        <CardBody>
          <GridContainer>
            <GridItem xs={12} sm={12} md={4}>
              <TextField
                id="old_password"
                label="Old Password"
                type="password"
                name="old_password"
                autoComplete="old_password"
                required
                autoFocus
                onChange={updatePass}
              />
            </GridItem>
          </GridContainer>
          <GridContainer>
            <GridItem xs={12} sm={12} md={4}>
              <TextField
                id="new_password"
                label="New Password"
                required
                type="password"
              />
            </GridItem>
            <GridItem xs={12} sm={12} md={4}>
              <TextField
                id="new-password-2"
                label="Confirm Password"
                required
                type="password"
              />
            </GridItem>
          </GridContainer>
        </CardBody>
        <CardFooter>
          <Button type="submit"
          variant="contained"
          color="primary"
          className={classes.submit}>Update Password</Button>
        </CardFooter>
      </Card>
      </form>
    </GridItem>
    </GridContainer>
    </div>
    );
     }

this is the code which contain email change and password change, is it okay? and how to confirm password,that's mean disable submit if password not match, and show a message that password don't match.




Why PHP unit test is unable to locate factory for [App\Reply]?

When I run the same test of Feature test,it passes the test. But when I run the same test on Unit test, It gives me {InvalidArgumentException: Unable to locate factory for [App\Reply]}. Here is the My test

  <?php

namespace Tests\Unit;

use Illuminate\Foundation\Testing\RefreshDatabase;
use PHPUnit\Framework\TestCase;

class ReplyTest extends TestCase
{
use RefreshDatabase;

/** @test */
public function a_reply_has_user()
{
    $reply = factory("App\Reply")->create();
    $this->assertInstanceOf("App\User",$reply->user);
}
}

Here is the Error

1) Tests\Unit\ReplyTest::a_reply_has_user
InvalidArgumentException: Unable to locate factory for [App\Reply].

Here is the factory for the Reply:

<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Reply;
use Faker\Generator as Faker;

$factory->define(Reply::class, function (Faker $faker) {
    return [
        "user_id"=>factory("App\User")->create(),
        "thread_id"=>factory("App\Thread")->create(),
        "body"=>$faker->sentence
    ];
});



How to read keys of childs of a reference in firebase realtime database?

I have a reference to "a" named as 'ref'. And I want to read all the key(name,age and car) of the child of the reference. If my JSON looks like ths:

{"a":{ "name":"John", "age":30, "car":null } }




How to solve fatal error after updating wordpress version?

Warning: require(/home/vol4_4/epizy.com/epiz_265421##/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php): failed to open stream: No such file or directory in /home/vol4_4/epizy.com/epiz_265421##/htdocs/wp-settings.php on line 256

Fatal error: require(): Failed opening required '/home/vol4_4/epizy.com/epiz_265421##/htdocs/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php' (include_path='.:/usr/share/pear/') in /home/vol4_4/epizy.com/epiz_265421##/htdocs/wp-settings.php on line 256

There has been a critical error on your website.

line 256 in wp-settings is:

require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-types-controller.php';



why i am getting ModelNotFoundException error?

Why it passes the first test but for second test, it gives ModelNotFondException error? here are test

enter image description here




Why is my localhost:8000 loading differently from 127.0.0.1:8000 django website

I'm very confused on my django website right now. I have always used localhost:8000 to check my website and it used to work. Now whenever i make changes to the style.css file, the localhost:8000 wont update the website. Instead, it updates only when i open the website through 127.0.0.1:8000. Anyone know whats the problem here?




how to send a Hyper Text Transfer Protocol Secure post request to server and receive response in C#? [closed]

i'm beginner in web programming and want to create an app for send and receive Hyper Text Transfer Protocol Secure POST request to/from server (not mine) by c#. first i want to login and then send some request.now i want to help me about what data i need to send and what i do respectively from begin to end. also it better help about codes but if you just guide me step by step without codding it 's helpful for me. i found a code here MSDN but i got an error. thanks




Getting IP address of client using PHP [duplicate]

I was trying to get client's IP using laravel's request()->ip() but it's giving me Google Cloud's i.e. my server's IP. How am I able to get client's IP and how to try it locally?

I am trying $ips = $_SERVER['HTTP_CLIENT_IP'] ? : ($_SERVER['HTTP_X_FORWARDED_FOR'] ? : $_SERVER['REMOTE_ADDR']);. As to test on locally it's giving me 127.0.0.1 How will I able to test on local that it's giving me my client's IP.




detect browser window resize without event

I would like to know if, in Javascript in general (and in Angular in particular), it is possible to check if the browser window has been previously resized by the user, e.g. if the user has landed on my page on an already resized browser.

Thanks in advance,




2-way communication between two services(front-end and standalone)

The standalone service is responsible for creating a printing job on a local system on which it is installed after being triggered from the front-end that is hosted on web, the status of the job must be sent to the front-end with options to cancel the job from front-end in between the job is started and completed.

The front-end will show the status of the printing in real time but we don't want the front-end to continuously listen to the standalone app.

What's the best way to have the two-way communication between the two services without polling.




Banning an ip to visit a particular page

I am making a forum for a project. I wish the users to be anonymous to the public but want to store their ip addresses in my database so that I can block them if they pass any derogatory remarks or vulgar content on the forum. Once a user is blacklisted, he/she cannot make a post request to the forum. So they cannot post. What are the possible flaws in this project? And how do I come over this solution. Thanks in advance.




jeudi 27 août 2020

Why IT Support required?

To truly get the most from your IT assets, you need access to a team of IT professionals that understands both technology and the work that you do.

The Setton Consulting team’s focus targets providing you with an optimized IT environment that allows you to get the most out of the technology assets you already own.

Keep your IT infrastructure strong and efficient by solving many IT problems. The highly-knowledgeable and skilled professionals maximize the latest technology to make your business grow at full potential. Various IT services are Managed IT Services, Cloud Services, VOIP, Network Support, Cyber Security, and many more.




Angular: hiding a component with *ngIf doesn't work

I'm just starting with Angular and have already faced an issue: a button actually toggles the variable I need (show) but it doesn't affect the course.component

course.component must show app-csgo-course, boolean show is true because the component is visible, but after it toggles in navbar.component, nothing changes.

<app-csgo-course *ngIf="show"> </app-csgo-course>

import { Component, OnInit} from '@angular/core';
import { CourseService } from 'src/app/course.service';


@Component({
  selector: 'app-course',
  templateUrl: './course.component.html',
  styleUrls: ['./course.component.css']
})
export class CourseComponent implements OnInit {

  constructor() { }

  ngOnInit(): void { }

  service = new CourseService;
  show = this.service.GetShow();
}

In navbar.component there's a button which toggles the "show" variable

      <button (click)="ToggleShow()" >
        <li class="nav-item active" id="csgo-logo">
          <a href="#">
            <img class="game-logo" src="assets\img\csgo-logo.png" title="Counter Strike: Global Offensive">
            <!-- <a>CS:GO <span class="sr-only">(current)</span></a> -->
          </a>
        </li>
      </button> 
import { CourseService } from 'src/app/cheat.service';
import { Component, OnInit, Input, Output, } from '@angular/core';

@Component({
  selector: 'app-navbar',
  templateUrl: './navbar.component.html',
  styleUrls: ['./navbar.component.css']
})
export class NavbarComponent implements OnInit {

  service = new CourseService;
  show = this.service.GetShow();

  ngOnInit(): void {
    
  }

  public ToggleShow() {

    this.service.show = this.service.ToggleShow();
    console.log(this.service.show);
    return this.service.show;
  }
}

The course.service file


@Injectable({
  providedIn: 'root'
})
export class CourseService {

  show: boolean = true;

  GetShow() {
    return this.show;
  }

  ToggleShow() {
    return this.show = !this.show
  }

  constructor() { }
  }
}

Would appreciate your help!




How to show form action result in modal

i want to show my action result in modal, after submit button is clicked, i want modal popup show my action result........................................................................... This is html form

              <form class="g-py-15" id="submit-button" action="<?php echo base_url('cekongkir/cek_ongkir') ?>" method="POST" role="form">
                <div class="row">
                  <div class="col-xs-12 col-sm-6 mb-4">
                    <div class="form-group u-select--v3 g-pos-rel g-brd-none g-brd-bottom g-brd-gray-light-v7 rounded-0 mb-0">
                      <center><label><strong>From</strong></label></center>
                       <select name="province_id" id="provincefrom" onchange="loadCityfrom()"  class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-15 g-px-15" required="">
                          <?php
                              echo "<option value=''> Select Province</option>";
                          foreach ($province as $p) {
                              echo "<option value='$p->province_id'>$p->prov_name</option>";
                          }
                          ?>
                      </select>
                      <div class="d-flex align-items-center g-absolute-centered--y g-right-0 g-color-gray-light-v6 g-color-lightblue-v9--sibling-opened g-mr-15">
                        <i class="hs-admin-angle-down"></i>
                      </div>
                  </div>
                  </div>

                  <div class="col-xs-12 col-sm-6 mb-4">
                    <div class="form-group u-select--v3 g-pos-rel g-brd-none g-brd-bottom g-brd-gray-light-v7 rounded-0 mb-0">
                      <center><label><strong>To</strong></label></center>
                       <select name="province_id" id="provinceto" onchange="loadCityto()"  class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-15 g-px-15" required="">
                          <?php
                              echo "<option value=''> Select Province</option>";
                          foreach ($province as $p) {
                              echo "<option value='$p->province_id'>$p->prov_name</option>";
                          }
                          ?>
                      </select>
                      <div class="d-flex align-items-center g-absolute-centered--y g-right-0 g-color-gray-light-v6 g-color-lightblue-v9--sibling-opened g-mr-15">
                        <i class="hs-admin-angle-down"></i>
                      </div>
                  </div>
                  </div>
                </div>

                <div class="row">
                  <div class="col-xs-12 col-sm-6 mb-4" required="required">
                    <div class="form-group u-select--v3 g-pos-rel g-brd-none g-brd-bottom g-brd-gray-light-v7 rounded-0 mb-0" id="cityAreafrom" required="required">
                       <select class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-15 g-px-15" required>
                          <option value="">Select City</option>
                      </select>
                      <div class="d-flex align-items-center g-absolute-centered--y g-right-0 g-color-gray-light-v6 g-color-lightblue-v9--sibling-opened g-mr-15">
                        <i class="hs-admin-angle-down"></i>
                      </div>
                    </div>
                  </div>

                  <div class="col-xs-12 col-sm-6 mb-4" required="required">
                    <div class="form-group u-select--v3 g-pos-rel g-brd-none g-brd-bottom g-brd-gray-light-v7 rounded-0 mb-0" id="cityAreato" required="required">
                       <select class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-15 g-px-15" required>
                          <option value="">Select City</option>
                      </select>
                      <div class="d-flex align-items-center g-absolute-centered--y g-right-0 g-color-gray-light-v6 g-color-lightblue-v9--sibling-opened g-mr-15">
                        <i class="hs-admin-angle-down"></i>
                      </div>
                    </div>
                  </div>
                </div>

                <div class="row">
                  <div class="col-xs-12 col-sm-6 mb-4" required="">
                    <div class="form-group u-select--v3 g-pos-rel g-brd-none g-brd-bottom g-brd-gray-light-v7 rounded-0 mb-0" required="required" id="subdistrictAreafrom">
                       <select class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-15 g-px-15" required>
                          <option value="">Select Subdistrict1</option>
                      </select>
                      <div class="d-flex align-items-center g-absolute-centered--y g-right-0 g-color-gray-light-v6 g-color-lightblue-v9--sibling-opened g-mr-15">
                        <i class="hs-admin-angle-down"></i>
                      </div>
                    </div>
                  </div>

                  <div class="col-xs-12 col-sm-6 mb-4" required="">
                    <div class="form-group u-select--v3 g-pos-rel g-brd-none g-brd-bottom g-brd-gray-light-v7 rounded-0 mb-0" required="required" id="subdistrictAreato">
                       <select class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-15 g-px-15" required>
                          <option value="">Select Subdistrict</option>
                      </select>
                      <div class="d-flex align-items-center g-absolute-centered--y g-right-0 g-color-gray-light-v6 g-color-lightblue-v9--sibling-opened g-mr-15">
                        <i class="hs-admin-angle-down"></i>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="mb-4">
                  <center><label>Berat Barang</label></center>
                  <center>
                  <div class="col-6">
                  <input class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-15 g-px-15" name="username" type="text" placeholder="(Kg)" required="">
                </div>
              </center>
                </div>
              <footer class="text-center">
                <div class="col-12">
                    <button type="submit" class="btn btn-block u-btn-primary rounded g-px-30 g-py-11 ml-1" >Cari Ongkir</button>
                  </div>
              </footer>
          </form>

how to call the modal after form action calling action in controller

    <script type="text/javascript">
            function loadCityfrom(){
                var province = $("#provincefrom").val();
                $.ajax({
                    type:'GET',
                    url:"<?php echo base_url(); ?>register/cityList",
                    data:"province_id=" + province,
                    success: function(html)
                    { 
                       $("#cityAreafrom").html(html);
                    }
                }); 
            }
            function loadSubdistrictfrom(){
                var city = $("#city").val();
                $.ajax({
                    type:'GET',
                    url:"<?php echo base_url(); ?>register/subdistrictList",
                    data:"city_id=" + city,
                    success: function(html)
                    { 
                        $("#subdistrictAreafrom").html(html);
                    }
                }); 
            }
    </script>

    <script type="text/javascript">
            function loadCityto(){
                var province = $("#provinceto").val();
                $.ajax({
                    type:'GET',
                    url:"<?php echo base_url(); ?>register/cityListto",
                    data:"province_id=" + province,
                    success: function(html)
                    { 
                       $("#cityAreato").html(html);
                    }
                }); 
            }
            function loadSubdistrictto(){
                var city = $("#cityto").val();
                $.ajax({
                    type:'GET',
                    url:"<?php echo base_url(); ?>register/subdistrictListto",
                    data:"city_id=" + city,
                    success: function(html)
                    { 
                        $("#subdistrictAreato").html(html);
                    }
                }); 
            }
    </script>

[Here my codepen] https://codepen.io/hasta2103/pen/qBZmvjL




How to setup interactive Dashboard for user from python notebook?

I am looking for a solution to setup a Dashboard for user to query my data with plots. Basically I have my jupyter notebook script that is able to plat many useful figures, but my data source is live so I need a way to show the semi realtime plots with configurable parameters.

I try Jupyter Dashboard which is great but not sure how to setup multiple query on a web server for user to use.

I also consider Grafana, but the way it plot stuff is too limited and slow.

I also think about ODS system from facebook but looks like it is too complicated to setup.

I am looking to have a python friendly solution that run on a single server that can let people see and play my script easily.

Thank you so much!




Why is the navigation bar for my website stuck on the middle of the page?

So my website has different pages to click through, and on the home page everything is fine. I am adding this page currently, and once I added the pop up cards, my nav bar went to the middle of the screen for some reason. I am completely new to coding, so sorry if this is an easy fix. Any help would be appreciated. Here is the website

HTML:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Harvard</title>
    <link href="https://fonts.googleapis.com/css2?family=Oswald&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="styles1.css">
</head>
<body>
    <div class="container">
        <div class="nav-wrapper">
            <div class="left-side">
                <div class="nav-link-wrapper">
                    <a href="index.html">Data Sets</a>
                </div>
                <div class="nav-link-wrapper">
                    <a href="compare.html">Compare</a>
                </div>
            </div>

            <div class="right-side">
                <div class="brand">
                    <div>A2C Common Data Sets</div>
                </div>
            </div>
        </div>
    </div>
    <div class="card">
        <div class="card-image"></div>
        <div class="card-text">
          <span class="date">top</span>
          <h2>One</h2>
          <p>body</p>
        </div>
        <div class="card-stats">
          <div class="stat">
            <div class="value">4<sup>m</sup></div>
            <div class="type">#</div>
          </div>
          <div class="stat border">
            <div class="value">5123</div>
            <div class="type">#</div>
          </div>
          <div class="stat">
            <div class="value">32</div>
            <div class="type">#</div>
          </div>
        </div>
      </div>
      <div class="card">
        <div class="card-image card2"></div>
        <div class="card-text card2">
          <span class="date">top</span>
          <h2>Two</h2>
          <p>body</p>
        </div>
        <div class="card-stats card2">
          <div class="stat">
            <div class="value">7<sup>m</sup></div>
            <div class="type">#</div>
          </div>
          <div class="stat border">
            <div class="value">7152</div>
            <div class="type">#</div>
          </div>
          <div class="stat">
            <div class="value">21</div>
            <div class="type">#</div>
          </div>
        </div>
      </div>
      <div class="card">
          <div class="card-image card3"></div>
          <div class="card-text card3">
            <span class="date">top</span>
            <h2>Three</h2>
            <p>body</p>
          </div>
          <div class="card-stats card3">
            <div class="stat">
              <div class="value">5<sup>m</sup></div>
              <div class="type">#</div>
            </div>
            <div class="stat border">
              <div class="value">3021</div>
              <div class="type">#</div>
            </div>
            <div class="stat">
              <div class="value">15</div>
              <div class="type">#</div>
            </div>
          </div>
        </div>
    </body>
</html>

CSS:

.container {
    display: grid;
    grid-template-columns: 1fr;
}

/* Nav Styles */
.nav-wrapper {
    display: flex;
    justify-content: space-between;
    padding: 38px;
}

.left-side {
    display: flex;
}

.nav-wrapper > .left-side > div {
    margin-right: 20px;
    font-size: 0.9m;
    text-transform:uppercase;
}

.nav-link-wrapper {
    height: 22px;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.5s;
}

.nav-link-wrapper a {
    color: #8a8a8a;
    text-decoration: none;
    transition: color 0.5s;
}

.nav-link-wrapper:hover {
    border-bottom: 1px solid black;
}

.nav-link-wrapper a:hover {
    color: black;
}

.active-nav-link {
    border-bottom: 1px solid black;
}

.active-nav-link a{
    color: black;
}

/* Cards */
body {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:url();
    overflow: hidden;
  }
  .card {
    display: grid;
    grid-template-columns: 300px;
    grid-template-rows: 210px 210px 80px;
    grid-template-areas: "image" "text" "stats";
  
    border-radius: 18px;
    background: white;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.9);
    font-family: roboto;
    text-align: center;
    
  
    transition: 0.5s ease;
    cursor: pointer;
    margin:30px;
  }
  .card-image {
    grid-area: image;
    background: url("images/princeton1.png");
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    background-size: cover;
  }
  
  .card-text {
    grid-area: text;
    margin: 25px;
  }
  .card-text .date {
    color: rgb(255, 7, 110);
    font-size:13px;
  }
  .card-text p {
    color: grey;
    font-size:15px;
    font-weight: 300;
  }
  .card-text h2 {
    margin-top:0px;
    font-size:28px;
  }
  .card-stats {
    grid-area: stats; 
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    background: rgb(255, 7, 110);
  }
  .card-stats .stat {
    padding:10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
  }
  .card-stats .border {
    border-left: 1px solid rgb(172, 26, 87);
    border-right: 1px solid rgb(172, 26, 87);
  }
  .card-stats .value{
    font-size:22px;
    font-weight: 500;
  }
  .card-stats .value sup{
    font-size:12px;
  }
  .card-stats .type{
    font-size:11px;
    font-weight: 300;
    text-transform: uppercase;
  }
  .card:hover {
    transform: scale(1.15);
    box-shadow: 5px 5px 15px rgba(0,0,0,0.6);
  }
  
  /*card2*/
  .card-image.card2 {
    background: url("img2.jpg");
    background-size: cover;
  }
  .card-text.card2 .date {
    color: rgb(255, 77, 7);
  }
  .card-stats.card2 .border {
    border-left: 1px solid rgb(185, 67, 20);
    border-right: 1px solid rgb(185, 67, 20);
  }
  .card-stats.card2 {
    background: rgb(255, 77, 7);
  }
  /*card3*/
  .card-image.card3 {
    background: url("img3.jpg");
    background-size: cover;
  }
  .card-text.card3 .date {
    color: rgb(0, 189, 63);
  }
  .card-stats.card3 .border {
    border-left: 1px solid rgb(14, 122, 50);
    border-right: 1px solid rgb(14, 122, 50);
  }
  .card-stats.card3 {
    background: rgb(0, 189, 63);
  }