samedi 30 novembre 2019

Unable to clear cache of chrome or safari in mobile

I working on a Laravel project and I need to check responsive in mobile iPhone 6, 6s, 8 and Samsung A7 2017 I clear the browser cache of chrome and when I reload the page nothing is changed I remove every code in style.css in iPhones nothing changed again, I can't figure out where is the problem

the browsers are lastest version and have the same problem in safari




How to prevent Action Post method called from Submit form Hit twice?

I have the following control in my .cshtml view:

<"a id="BtnSubmit" onclick="SubmitForm();">

    function SubmitForm() {
       $('#Form_Create_Edit_Customer_Contact_FollowUp').submit();
    }

Where '#Form_Create_Edit_Customer_Contact_FollowUp' is the name of the form.

The problem is that the corresponding controller POST method is being hit twice, how can i stop the current behavior.

Note: i need to use a link rather than Button/Input with type submit for design reasons.




problem in display incompletely wp site on local host

I used to work with my wp site without problems before but I have a problem now and that is that my site is displayed without style(just html) on local host. -I think the problem occurred after installing IIS or Microsoft SQL Server or VisualStudio. -I also stopped the IIS through the "IIS Manager" but the problem was not resolved. -I use xampp. Please help me get my site fully running again on local host.




Removing Custom Domain in Github

I want to remove custom Domain from Github. Any help, please.

enter image description here




So I embedded a facebook page on my website, Doesn't the embedded facebook page show when I am not connected to the internet?

I embedded a page from facebook to my website, when I am trying to load my website offline since I'm working on it for a project for school, the facebook page does not show. But when I try to load my website online it shows. Is this normal? can I embed a facebook page and show it offline since I need it for school without internet access.




Request.Form[] always null

I have a problem in c# web (aspx, aspx.cs): I have database with usernames of people and i want to show them in select tag, i did this at the server side to get from the database the usernames and put the as option in select tag:

    string tb = "tbUsers";
    string db = "database.mdf";
    string mainConn = ConfigurationManager.ConnectionStrings[db].ConnectionString;
    SqlConnection sqlconn = new SqlConnection(mainConn);
    string querySQL = "SELECT * From " + tb;
    SqlDataAdapter sda = new SqlDataAdapter(querySQL, sqlconn);
    sqlconn.Open();
    DataTable dt = new DataTable();
    sda.Fill(dt);
    sel.DataSource = dt;
    sel.DataTextField = "userName";
    sel.DataValueField = "userName";
    sel.DataBind();
    sqlconn.Close();

and this is the client side with the select tag:

            <div class="center">
               <h1>Delete User:</h1>
               <br />
               <select id="sel" name="sel" runat="server" class="form-control">
               </select>
               <br />
               <button type="submit" class="btn btn-primary">ok</button>
               <br /><br />
               <asp:Label ID="msg" runat="server" Font-Bold="true" Font-Size="X-Large" ForeColor="black"></asp:Label>
           </div> 

after this codes in the server side i did an event when the submit button is clicked:

    if (IsPostBack)
    {
        string sel = Request.Form["sel"];
        sel = sel.Replace(" ", String.Empty);
        string query = "";
        query = "SELECT * FROM " + tb + " WHERE userName= '" + sel + "'";
        if (MyAdoHelper.IsExist(db, query))
        {
            query = "DELETE FROM " + tb + " WHERE userName = '" + sel + "'";
            int row = MyAdoHelper.RowsAffected(db, query);
            if (row != 0)
            {
                msg.Text = "deleted";
            }
            else
            {
                msg.Text = "not deleted";
            }
        }
        else
        {
            msg.Text = "try again";
        }
    }

but the string called sel allways gets NULL. What i did wrong? If someone could help i'll be very thankfull.

Sorry for language mistakes if there are**.




Im getting an undefined error in my proyect made with React

I am sending as a prop an array of objects. When i console.log(this.props) i get the array of objects, but when i try to assign it to a variable it gives me

TypeError:ninjas is undefined

import React from 'react';

class Ninjas extends React.Component {
    render(){
        const { ninjas } = this.props;
        const ninjasList = ninjas.map(ninja => {
            return(
                <div className="ninja" key={ ninja.key }>
                <div>Name: { ninja.name }</div>
                <div>Age: { ninja.age }</div>
                <div>Belt: { ninja.belt }</div>
                </div>
            )
        })
        return (
            <div className="ninja-list">
                { ninjasList }
            </div>
        );
    }
}

export default Ninjas;



Problem getting html data from Websites ESP8266

I got a code here.(C++)

At the website: "github.com" the code works fine and I get the index of "meta" = 53

As soon as I change the address to for example "timeanddate.com", I get the index (-1) = no result.

My question: What is the difference between these two websites?

"meta" is included in both HTML source pages both are HTTPS What's missing?

Tests:

https://github.com = HTTP Status: 200 Index: 53.00

https://www.timeanddate.de = HTTP Status: 200 Index: -1.00

https://timeanddate.de = HTTP Status: 302

https://www.timeanddate.com = HTTP Status: 200 Index: -1.00

https://timeanddate.com = HTTP Status: 301 Index: -1.00

P.S. with google.com it even crashes

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecure.h>

#define   SSID_NAME                 "XXXXXXXXXX"                                                                             
#define   SSID_PASSWORD             "XXXXXXXXXX"  


ESP8266WiFiMulti WiFiMulti;
//WiFiClientSecure client;
HTTPClient https;
BearSSL::WiFiClientSecure client;




void setup() {
  Serial.begin(115200);

  WiFi.mode(WIFI_STA);
  WiFiMulti.addAP(SSID_NAME, SSID_PASSWORD);

  //Connect to WIFI
  Serial.print("Connecting to ");
  Serial.print(SSID_NAME);
  Serial.println(".");
  Serial.print("Waiting for Wifi to connect...");
  while (WiFiMulti.run() != WL_CONNECTED){
    Serial.print(".");
    delay(1000);
  }
  Serial.println("  Done.");

  IPAddress ip(192,168,0,172);   
  IPAddress gateway(192,168,0,1);   
  IPAddress subnet(255,255,255,0);   
  WiFi.config(ip, gateway, subnet);


}

void loop() {
  int code = 0;
  double bodyTag;

     client.setInsecure();
     client.setTimeout(8000);

      https.begin(client,"https://www.google.com");

      code = https.GET();
      while (code != HTTP_CODE_OK){
        Serial.print("HTTPCODE FAIL: ");
        Serial.println(code); 
        code = https.GET(); 
        delay(500);
      }

        Serial.print("HTTP Status: ");
        Serial.println(code);

        //Check if KeyWord is Found in Search.ch
        bodyTag = https.getString().indexOf("meta");
        Serial.print("Index: ");
        Serial.println(bodyTag); 
        delay(5000);
}



If referer = chrome history, then redirect to. _

im trying to make a code using javascript that looks if youve been redirected from chrome://history , and if you have it redirects to an adress. Is there a way to do this?




Why can't I access my Wordpress admin website?

Yesterday I created a website using Hostinger and Wordpress, I customized it and it worked. Today, when I tried to access my wp admin website, it gave a 404 error like the website. I tried to search for a solution but it didn't work !

The website is still in preview mode : http://lhodierno-com.preview-domain.com/wp-admin




how can i build a website like this one? Basically I need same website with same functionality

how can i build a website like this one?
Basically I need same website with same functionality
https://www.steadfastcourier.com/




Tracking Webpage Activity for a Class C#

I am new to StackOVerflow and this is my first post. Please let me know if I am doing this incorrectly or if there is another way of formatting this to be more conducive to getting help.

I am attempting to track a users activity on a website, but only what webpages they are visiting, their UserID, IP Address, and date and time.

So far, we have gotten the UserID, IPAddress, and DateandTime, to work as well as storing them in a database with an increment logID. However, when we visit a webpage - it's only logging the Activity as the UserActivity page, not any other page that was visited. I have added the code created below and could use some help to determine why it does not log the name of a different webpage on the same website. Thank you.

public static void SaveUserActivity(string FormAccessed)
    {
        try
        {
            SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder();
            sqlBuilder.DataSource = "mas-application.database.windows.net,1433";
            sqlBuilder.UserID = "masadmin";
            sqlBuilder.Password = "t3Admin123!!";
            sqlBuilder.InitialCatalog = "mas-application";
            sqlBuilder.ConnectTimeout = 30;
            sqlBuilder.MultipleActiveResultSets = false;
            sqlBuilder.PersistSecurityInfo = false;
            sqlBuilder.Encrypt = false;
            sqlBuilder.TrustServerCertificate = false;
            string loggedInUser = HttpContext.Current.User.Identity.Name;

            using (SqlConnection sqlConnection = new SqlConnection(sqlBuilder.ConnectionString))
            {
                sqlConnection.Open();
                StringBuilder sb = new StringBuilder();
                sb.Append("Insert into UserActivity(UserIP, DateOfActivity, UserID, FormAccessed) values(" +
                    "'" + GetIP4Address() + "'," +
                    "'" + DateTime.Now + "'," +
                    "'" + loggedInUser + "'," +
                    "'" + FormAccessed + "')");

                String sql = sb.ToString();

                SqlCommand command = new SqlCommand(sql, sqlConnection);

                command.ExecuteNonQuery();
                sqlConnection.Close();

            }
        }
        catch (SqlException ex)
        {

        }





    }
    // This function gets the IP Address
    public static string GetIP4Address()
    {
        string IP4Address = string.Empty;
        foreach (IPAddress IPA in
        Dns.GetHostAddresses(HttpContext.Current.Request.UserHostAddress))
        {
            if (IPA.AddressFamily.ToString() == "InterNetwork")
            {
                IP4Address = IPA.ToString();
                break;
            }
        }
        if (IP4Address != string.Empty)
        {
            return IP4Address;
        }
        foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName()))
        {
            if (IPA.AddressFamily.ToString() == "InterNetwork")
            {
                IP4Address = IPA.ToString();
                break;
            }
        }
        return IP4Address;
    }
}

}




How long will it take at least a simple web service in Java?

Suppose that we make a very simple web service in Java, with an embedded server like Jetty. A simple GET by id like:

GET /entity/{id}

Suppose that to response, the web service need to access some in memory collection (a cache list for example), get the entity, serialize the object into JSON, and reply with a HTTP Code 200 and the entity.

No more!

How long is reasonably for this service to take, taking into account all the pipeline execution that Java has to do: handlers, interceptors, etc.

I know that the answer depends on hardware resources (CPU, RAM, etc), but anyway I would like to know an estimate answer.

For example:

  • 1 millisecond is a racional duration or it's not posible at all?

  • Can this service perform in the order of the microseconds? And nanoseconds?

My goal is to know how much we can optimize a service and when it could be said that we reach the maximum performance limit.

Note that I mean the time of the service itself, measured within the host. I do not mean time from the client's point of view, which will be much more variable due to aspects of the network that do not interest me in this context.

Thanks in advance!




Project like uber and careem

Can any one tell me that how much project cost is needed for development of Application like Uber/Kareem with versions of IoS, Android, and Web?. How much amount(Lump-sump) for these three versions will be required.




Control animation with a range input

I have a carousel of images with an animation, and I would like to control this animation with a range input, in css the animation goes from 0 to 100%, and I wanted the range input to control this percentage, for example if the input is halfway through the animation would be at 50%.




How to keep python script keep running indefinitely

I made a GUI app from Tkinter in python and want to make such that after a specific time the program runs again and prints accordingly.

def check_price():
    name = entry_1.get()
    p = entry_2.get()
    ex_price = float(p)
    usr_email = entry_3.get()
    client_response = Client(name)
    source = client_response.html
    soup = BeautifulSoup(source, 'html.parser')
    try:
        title=soup.find('span', id ='productTitle').get_text().strip()
        label_4 = Label(root, text=title)
        label_4.grid(row=4, column=0)
    except AttributeError:
        title = "Wrong URL"
        label_4 = Label(root, text=title)
        label_4.grid(row=4, column=0)
        exit()
    try:
        price = soup.find('span', id ='priceblock_dealprice').get_text().strip()
        x="The item is currently discounted at : "+price
        label_5 = Label(root, text=x)
        label_5.grid(row=5, column=0)
    except AttributeError:
        try:
            price = soup.find('span', id ='priceblock_ourprice').get_text().strip()
            x = "The product is not discounted currently and Currently the price is : "+price
            label_5 = Label(root, text=x)
            label_5.grid(row=5, column=0)
        except AttributeError:
            x = "Product Unavailable!!"
            label_5 = Label(root, text=x)
            label_5.grid(row=5, column=0)
            exit()
    px = ""
    for ch in price:
        if(ch.isdigit()):
            px=px+ch
    converted_price=float(px)
    converted_price=converted_price/100
    if(converted_price < ex_price):
        send_mail(name, usr_email)
    else: 
        x = "The price is not currently below the price at which you would like to buy"
        label_6 = Label(root, text=x)
        label_6.grid(row=6, column=0)
        self.after(10, self.check_price)

So I want that function check_price be called again after 1 hour how can I do so? I used self.after but it is not working.




ngx Print: Data not loading on printing

am using:

"ngx-print": "^1.2.0-beta.3",

it works but not consistently. 1 out of 3 times I get the result in the attached image. The data is not loading properly. It loads when I try two or three times. Please Help.

enter image description here




i can not get the element height in javascript

here is my html code HTML

<div class="section s1">
    <div class="background" id="bgimage">
       .......
    </div>
</div>

CSS

.background {
    width: 100%;
    height: 500vh;
}

JavaScript

var background = document.getElementById('bgimage');
console.log(background.style.height);

but it brings nothing. i can not get the height of my element. it just brings an empty space in console of my browser




Update the text for making progress bar using Django

To show the progress on the web using Django, I want to show the progress using text on the web.

In the code, there are few functions, I want to update the text on the web right after the function is completed

I wonder, How can I solve this problem, is it possible to solve this problem by changing the code in views.py?

[views.py]

def post_list(request):

    print("start")

    functionA()
    print("function A is done")

    functionB()
    print("function B is done")

    return render(request, 'blog/post_list.html', {'posts' : "function A is Done})

Expected outcome:

On web "Start" => function A is running => "Function A is done" => function B is running => "Function B is done"




vendredi 29 novembre 2019

I want to read and write the value in a certain line spacing with Python

I want to print the text of the line spacing in the HTML code that I set with python on a web page. For example, I want to get the articles in line 29 and 30.




Website transferring from web hosting to my local server

I'v a virtual dedicated server away from my country in Australia, hosting 5-6 websites and urls. I'v purchased hp dl380 g8 server and installed Windows Server 2019 with licenses.I want to host all websites on my local server. I'v copied all websites on my local server, iis is ok on local,how can I configure the port forwarding/dns DNS/ do I need dyndns account?/what settings on my current host (Australia) that if any one type www.mydomainsetc.com my local windows server 2019 should response.




How to create System Field for auto generated URL in Wix?

I am trying to create a System field in my Wix website for generating URL for my dynamic page, which is similar to one of their preset "team".

enter image description here

As you can see in the picture above, the field "Team (Title)" is a System Field and it generates the URL for every new entry on its own and shown.

I am unable to figure out how to do this. If you can help me out, it would be a great help.

Thanks, Zeeshan




How to write newest img with PHP?

I have a camera that save img every 60 sec and upload to my FTP server.
I would like to upload this img to my website.
The problem is the folder change every day and the img name change every time.
Have any PHP code that find the last uploaded file?
the img location is: camera/"year,month,day"/images/"img file"
https://phuket.hu/camera/20191130/images/




How to decode a base64 string properly in javascript

I tried to convert a base64 string generated from pdf file using FileReader.readAsDataURL() to its original format.
In NodeJS I did it like this and it was able generated the pdf to its initial state.

filebuffer = "data:application/pdf;base64,JVBERi0xLjQKJSDi48/..........."
let base64file = fileBuffer.split(';base64,').pop();
fs.writeFileSync('download.pdf',base64file,{encoding:'base64'},function(err){
    if(err === null){
        console.log("file created");
        return;
    }
    else{
        console.log(err);
        return;
    }
})

But i tried to do it in HTML + Javascript in this way.But in this way , pdf was empty/no letter wasn't in it

let stringval = "data:application/pdf;base64,JVBERi0xLjQKJSDi48/..........."
let encodedString = stringval.split(';base64,').pop();

let data = atob(encodedString);
let blob = new Blob([data]);

// //if you need a literal File object
let file = new File([blob], "filename");

link.href = URL.createObjectURL(file);
link.download = 'filename';

what i am doing wrong .. and how to solve it?




How to convert a String to actual file that was generated from FileReader.readAsDataURL()

I have generated a string of a file using this:

const reader = new window.FileReader();
reader.readAsDataURL(file);
reader.onloadend = () => {
  var x = reader.result.toString();
  console.log("File String :: ", x);
};

How to get back the actual file using this string?
ReadAsDataUrl




SASS : (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px) isn't a valid CSS value

I am trying to process this on https://www.sassmeister.com/ the following file :


$grid-breakpoints: (
  xs: 0,
  sm: 576px,
  md: 768px,
  lg: 992px,
  xl: 1200px
) !default;
$utilities: () !default;

$utilities: map-merge(
  (
    "align": (
      property: vertical-align,
      class: align,
      values: baseline top middle bottom text-bottom text-top
    ),
    "float": (
      responsive: true,
      property: float,
      values: left right none
    )
), $utilities);


// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
// Makes the @content apply to the given breakpoint and wider.
@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
  $min: breakpoint-min($name, $breakpoints);
  @if $min {
    @media (min-width: $min) {
      @content;
    }
  } @else {
    @content;
  }
}


// Loop over each breakpoint
@each $breakpoint in map-keys($grid-breakpoints) {

  // Generate media query if needed
  @include media-breakpoint-up($breakpoint) {
    $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

    // Loop over each utility property
    @each $key, $utility in $utilities {
      // The utility can be disabled with `false`, thus check if the utility is a map first
      // Only proceed if responsive media queries are enabled or if it's the base media query
      @if type-of($utility) == "map" and (map-get($utility, responsive) or $infix == "") {
        @include generate-utility($utility, $infix);
      }
    }
  }
}


// Print utilities
@media print {
  @each $key, $utility in $utilities {
    // The utility can be disabled with `false`, thus check if the utility is a map first
    // Then check if the utility needs print styles
    @if type-of($utility) == "map" and map-get($utility, print) == true {
      @include generate-utility($utility, "-print");
    }
  }
}

I have the following error :

(xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px) isn't a valid CSS value.

enter image description here

Any idea of what is wrong here ?




PHP Connection Problem with MySQL on localhost

I'm trying to connect to my database on the localhost using wampserver, but I unable to connect to the database my code is::

 public function getConnection(){

        $this->conn = null;

        try{


            $this->conn = new PDO("mysql:host=localhost;dbname=crms", "root", "");
            echo"connect";

        }catch(PDOException $exception){
            echo "Connection error: " . $exception->getMessage();
        }

        return $this->conn;
    }



React websites scraping using python coding

hi i am trying to build python code to extract data from website which use react. i know how to extract data from html websites but react websites does not give the hole DOM elements, how can i get data from these websites? example and libraries would help a lot

Thank You




Count all joined table rows when filtering by the same joined table

So I'm querying a table districts, that has one to many relationship with the positions table. I want to select the districts that have the positions with particular name AND count ALL districts positions at the same time. Can I do this?

With the current code

 SELECT districts.*, COUNT(DISTINCT(positions.id)) as positions_count FROM "districts"
  LEFT JOIN positions ON positions.id = districts.position_id
 WHERE ("positions"."name" IN ($1, $2)) GROUP BY districts.id ORDER BY positions_count desc, "districts"."name" ASC

If I have 20 positions in some district but only 2 are filtered, positions_count eq 2 as well, I want it to be 20

I've tried to join twice on the same table with an alias but this gives me the same result

SELECT districts.*, COUNT(DISTINCT(positions_to_count.id)) as positions_count FROM "districts"
  LEFT JOIN positions ON positions.id = districts.position_id
  LEFT JOIN positions AS positions_to_count ON positions_to_count.id = districts.position_id WHERE ("positions"."name" IN ($1, $2)) GROUP BY districts.id ORDER BY positions_count desc, "districts"."name" ASC



Adding User Input to the Array

I am trying to take user input by form and add it to array. Basically, I have one form which has "name" and "description" fields, and "Submit" button. Every time user fills in the form and clicks the submit button, I want it to be added into array. Right now it takes input and stores it, but I have no idea how to add more names and description from the user without removing the existing ones.

This is my Form in HTML:

<form method="post" action="">
            <div class="row form-group">
                <div class="col-md-12">
                    <label class="sr-only" for="name">Project Name</label>
                    <input type="text" name="project_name[]" id="name" class="form-control" placeholder="Project Name">
                </div>
            </div>
            <div class="row form-group">
                <div class="col-md-12">
                    <label class="sr-only" for="desc">Project Description</label>
                    <input type="text" name="project_desc[]" id="desc" cols="30" rows="10" class="form-control" placeholder="Project Description">
                </div>
            </div>
            <div class="form-group">
                <input type="submit">
            </div>
        </form>

And this is how I display it:

<h2 id="admin_project_name">
                            <?php
                                $project_names = $_POST['project_name'];
                                foreach( $project_names as $key => $n ) {
                                  print "The name is ".$n;
                                }
                            ?>
                        </h2>
                        <p id="admin_project_desc">
                            <?php
                                $project_desc = $_POST['project_desc'];
                                foreach( $project_desc as $key => $d ) {
                                    print "The description is ".$d;
                                }
                            ?>
                        </p>

How I can implement what I want? Thanks in advance!




Redirect with custom link to an external source and track the redirect

I want to share links like https://ift.tt/2OxudHm where twitter/headline represents the link I put in my twitter headline. Then I use something like nginx to configure what would happen. I want to redirect the source to an external page like a profile and I want to track how many people clicked the link with something like bitly or google analytics or does anyone know an elegant solution for my use case?

Problems with bitly 1. You can not have two links for the same destination. So let's pretend I have domain.com/twitter/a and domain.com/twitter/b and both redirect to two bitly links that forward to my linkedin profile. This does not work.

Problems with Google Analytics 1. ga is not made to track redirects. it can track where the traffic comes from but since I forward to external sources like linkedin I cannot put a ga code on my linkedin profile to do it.




How to continuously read an online/web file in java?

I am making a simple text-only instant messenger in java. The way that it currently works is that all the messages are put into an online text file by sending a php file a request (I know this is bad for security, but this is just to learn how to do web-connected apps in java.) Currently, I am continually fetching the entire contents of the messages.txt file and placing them into my JTextPane like this:

while(true) {
URL url = new URL("{path to text file}");
InputStream in = url.openStream();
Scanner s = new Scanner(in).useDelimiter("\\A");
String conversation = s.hasNext() ? s.next() : "";
textPane.setText(conversation);
}

But when the conversation becomes long enough, it lags as it is fetching 100kb+ files constantly from a web server.

What I want to happen is to only read the changes to the file so that it doesn't lag and max out my internet connection by requesting enourmous amounts of plain text files. I don't want to just make it run every 2 seconds because it's an instant messenger, no delays.

How would I go around only fetching the changes to the file and adding them to the text pane?




Is It possible to make a chatbot in Python and which can be integrated on any website?

I have a created a chatbot/voicebot in python , now I want to integrate it on any website which is using .net or PHP or any other language at the backend? Is it possible to do so if yes can anyone please guide me how to do that?




How can i improve this form all in one php form?

So i did this all in one form for a project and was wondering how i could go about making it better, or more efficient. The form adds a player to a text box and then displays confirmation.Here is my code. The form validates using another file but im fine with what that portion is doing. I just want to make sure im doing things properly.

<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>
            New Player
        </title>
        <link href="https://fonts.googleapis.com/css?family=Fjalla+One|Odibee+Sans&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href=".\styles\styles.css">
    </head>

    <body>
        <div id="title">
      <h1>Add Player</h1>
</div>

<?php

include "playerFunctions.php";

$displayForm=true;
$firstName ="";
$lastName = "";
$email ="";
$city="";
$country="";
$proornot="";
$passWord="";
$passWordCon="";
$firstNameError ="";
$lastNameError ="";
$emailError ="";
$cityError="";
$pwError="";
$pwconError="";


if (isset($_POST["myB"])){

    $displayForm=false;

    $firstName = $_POST["fname"];
    $lastName = $_POST["lname"];
    $email = $_POST["email"];
    $city = $_POST["city"];
    $country=$_POST["country"];
    $proornot= $_POST["pro"];
    $passWord=$_POST["pwd"];
    $passWordCon=$_POST["confirmpwd"];


    if(!validName($firstName)){

            $firstNameError="Enter valid first name";
            $displayForm = true;

     }
     if(!validName($lastName)){
        $lastNameError="Enter valid last name";
        $displayForm = true;
 }

 if(!validEmail($email)){
    $emailError="Please enter a valid email";
    $displayForm = true;
}

if(!validCity($city)){
    $cityError="Please enter a valid city";
    $displayForm = true;
}
if(!$passWord){
    $pwError="Please enter a password";
    $displayForm = true;
}
if(!validPassword($passWord,$passWordCon)){
    $pwconError="Please confirm your password";
    $displayForm = true;
}

else if(!$displayForm)
  {
   $proornot=(!($proprnot)?"yes":"no");
   $myfile = fopen("player.txt", "a") or die("Unable to open file!");
   $txt = $firstName."~".$lastName."~".$email."~".$city."~".$country."~".$proornot."\r\n";
   fwrite($myfile, $txt);
   fclose($myfile);
  }
}
if($displayForm){


?>






<form id="myForm" name="myFormName" action="NewPlayer.php" method="post">

<label for="fname"> First Name:</label>
<input type="text" name="fname" id="fname" <?php if($firstNameError){echo 'style="border:1px solid red;"';}?> value="<?php  echo $firstName;?>"/>
<br/><span id="errorf"><?php echo $firstNameError;?></span><br/>

<label for="lname"> Last Name:</label>
<input type="text" name="lname" id="lname"<?php if($lastNameError){echo 'style="border:1px solid red;"';}?> value="<?php echo $lastName;?>"/>
<br/><span id="errorl"><?php echo $lastNameError;?></span><br/>

<label for="email"> Email Address:</label>
<input type="text" name="email" id="email" <?php if($emailError){echo 'style="border:1px solid red;"';}?>   value="<?php echo $email;?>"/>
<br/><span id="errort"><?php echo $emailError;?></span><br/>

<label for="city"> City:</label>
<input type="text" name="city" id="city" <?php if($cityError){echo 'style="border:1px solid red;"';}?> value="<?php echo $city;?>"/>
<br/><span id="errort"><?php echo $cityError;?></span><br/>


<label for="country"> Country:</label>

<select name="country" >
  <option value="Canada">Canada</option>
  <option value="United States">United States</option>
  <option value="Columbia">Argentina</option>
  <option value="Argentina">Brazil</option>
  <option value="Peru">Columbia</option>
  <option value="Brazil">Ecuador</option>
  <option value="Ecuador">Peru</option>
  <option value="Poland">Poland</option>
</select> <br/>

<label for="pro" id="checkLabel"> Professional:</label>
<input type="checkbox" id="check" name="pro" value="<?php echo $proornot;?>"/><br>

<label for="pwd" id="pw"> Password:</label>
<input type="password" name="pwd" <?php if($pwError){echo 'style="border:1px solid red;"';}?>  value="<?php echo $passWord;?>"/> <br/>
<span id="errorpw"><?php echo $pwError;?></span><br/>

<label for="confirmpwd" id="conpw">Confirm Password:</label>
<input type="password" id="conpw" name="confirmpwd"  <?php if($pwconError){echo 'style="border:1px solid red;"';}?> value="<?php echo $passWordCon;?>"/> <br/>
<span id="errorlpwcon"><?php echo $pwconError;?></span><br/>

<button type="submit" name="myB" id="myB" class="myButton" value="Add Player">Add Player</button><br/>
</form>
<?php
}

else{
    echo "<div id=title><h1>".$firstName." ".$lastName." has been added to your roster. Good Luck with your pool </h1></div><br/>";
    echo "<button type=button onClick=location.href='NewPlayer.php' name=myB id=myB class=myButton value=BackToForm>Back to Form</button><br/>";
}



?>
    </body>
</html>```



How to Choose the Best CMS for Graphic Design Website?

I have a website on the graphic design website and the site built with WordPress platform. First few years my site performed well but after that site going slow so I wanna decide to build a new web on the clipping path design category. I don't want to use WordPress again. So I'm looking for an alternative CMS platform. Keep in mind, I have to use lots of high-quality images in my blog. Please suggest to me.




React and MaterialUI - GridLayout using papers

I'm using react-grid-layout library to create an adapting grid which each item is a paper component from react material ui.

I'm having a problem when running the application I receive in the broswer: "TypeError: react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext is not a function" Under the module of "./node_modules/@material-ui/styles/esm/useTheme/ThemeContext.js"

I'm pretty new to react and all so maybe I've done something very stupid but help will be much appreciated because I'm kind of clueless :)

The Home component is:

import { makeStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import { withStyles } from '@material-ui/styles';
import { Paper } from 'material-ui';
import React from 'react';
import GridLayout from 'react-grid-layout';

const useStyles = makeStyles(theme => ({
    root: {
        padding: theme.spacing(3,2),
    },
}));

class Home extends React.Component {


    render() {
        var layout = [
            {i: 'a', x: 0, y: 0, w: 1, h: 2, static: true},
            {i: 'b', x: 1, y: 0, w: 3, h: 2, minW: 2, maxW: 4},
            {i: 'c', x: 4, y: 0, w: 1, h: 2}
        ];

        const { classes } = this.props;

        return (
            <GridLayout className="layout" layout={layout} cols={12} rowHeight={30} width={1200}>
                <Paper className={classes.root}>
                    <Typography key="a" variant="h5" component="h3">
                        This is a set of paper!
                    </Typography>
                </Paper>
                <Paper className={classes.root}>
                    <Typography key="b" variant="h5" component="h3">
                        This is a set of paper!
                    </Typography>
                </Paper>
                <Paper className={classes.root}>
                    <Typography key="c" variant="h5" component="h3">
                        This is a set of paper! 
                    </Typography>
                </Paper>
            </GridLayout>
        );
    }


    /* 
    <MapContainer latitude={31.97973975} longitude={34.74769792490634}/>
    */
}

export default withStyles(useStyles)(Home);

This is the App.js file:

import { MuiThemeProvider } from 'material-ui/styles';
import React from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import './App.css';
import Home from './pages/Home';

class App extends React.Component {

    render() {
        return (
            <MuiThemeProvider>
                <Router>
                    <Route path="/" component={Home}/>
                </Router>
            </MuiThemeProvider>
        );
    }
}

export default App;

Thank you heads up!




Why is the audio playing restricted by default on my demopage?

What I want to archive: I am working on a proof of concept for visualising mp3 files in a simple manner.

What I am running into: If I visit the demopage https://poc-soundwave-ajmbesrkms.now.sh the soundfile is not playing (after interaction with the audio control bar! So no autoplay etc.). If I take a look into the browser settings there is always a domain restriction for playing audio files (no matter if chrome or safari).




why is not my code working when I try to run it?

Hey there I am trying to develop a website and have some codes that does not work (not because it is wrong written) even tried online guides but no use when I run program in VS or VS code it is useless I want to know what I am doing wrong ? what do I need to run the code and what code files do I need as well. hope u guyz understand what I want :D :D :D




Laravel controller won't pass parameter to service

so i made this input view which input some data, and then some services to process the data, these services are being called from the controller, the problem is when i try to call this particular function SUPMPFunc($index, $loop, $length) the controller seems to be not passing the arguments to the service

this is the too few arguments error

controller :

<?php

class supmpController extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    public function Store(Request $request)
    {

        $medInput = new MedInput();
        $deviceId = $medInput->MedInput();
        $toolsInput = new ToolsInput();
        $toolsRes = $toolsInput->ToolsInput(request("toolsIndex"));
        $toolsfunctionInput = new ToolsFunctionInput();
        $functionality = $toolsfunctionInput->ToolsFunctionInput(request("checkIndex"));
        $temperature = new TempFunc();
        $humidity = new HumidFUnc();
        $condition = array(
            $temperature->TempFunc(),
            $humidity->HumidFUnc(),
        );
        $electricity = new Electricityinput();
        $elInput = $electricity->ElectricityInput(request("electricIndex"));

        $index = request("tablesupmpindex");
        $loop = request("loopVal");
        $length = request("supmpLength");
        $SUPMP = new SUPMPFunc();
        $result = $SUPMP->SUPMPFunc($index, $loop, $length);
        $analysis = new AnalysisFunc();
        $texttoShow = $analysis->AnalysisFunc();

        $data = array (
            array($deviceId, $texttoShow, $toolsRes, request("loopVal")), //0
            $condition, //1
            $functionality,//2
            $elInput, //3
            $result[0], //4
            $result[1], //5
            $result[2], //6
            $result[3], //7
            $result[4], //8 
            $result[5], //9
            $result[6], //10
        );


        return view('laporan', ['data' => $data]);

    }

}

service :

<?php

class SUPMPFunc
{
    public function SUPMPFunc($index, $loop, $length)
    {
        $Avg = new AvgFunc();
        $TINV = new TINVFunc();
        $round = new RoundFunc();
        $stdev = new StdevFunc();
        $budget = new BudgetFunc();
        $drift = new DriftFunc();
        $driftres = $drift->Drift1895040();
        $medInput = new MedInput();
        $deviceId = $medInput->MedInput();
        $resolution = $deviceId[6];

        ///////////////////////////////////////////////////////////////////////////////

        // everything below is related to calibration value

        $settingsArray = [];
        $valueArray = [];

        for($i = 0; $i <= $length; $i++)
        {
           array_push($settingsArray, request("table".$index."setVal".$i)); 
        }

        $A1 = request('inVal_A-1');
        $B1 = request('inVal_B-1');
        $C1 = request('inVal_C-1');
        $D1 = request('inVal_D-1');
        $E1 = request('inVal_E-1');
        $F1 = request('inVal_F-1');
        $G1 = request('inVal_G-1');

        $A2 = request('inVal_A-2');
        $B2 = request('inVal_B-2');
        $C2 = request('inVal_C-2');
        $D2 = request('inVal_D-2');
        $E2 = request('inVal_E-2');
        $F2 = request('inVal_F-2');
        $G2 = request('inVal_G-2');

        $A3 = request('inVal_A-3');
        $B3 = request('inVal_B-3');
        $C3 = request('inVal_C-3');
        $D3 = request('inVal_D-3');
        $E3 = request('inVal_E-3');
        $F3 = request('inVal_F-3');
        $G3 = request('inVal_G-3');

        $A4 = request('inVal_A-4');
        $B4 = request('inVal_B-4');
        $C4 = request('inVal_C-4');
        $D4 = request('inVal_D-4');
        $E4 = request('inVal_E-4');
        $F4 = request('inVal_F-4');
        $G4 = request('inVal_G-4');

        $A5 = request('inVal_A-5');
        $B5 = request('inVal_B-5');
        $C5 = request('inVal_C-5');
        $D5 = request('inVal_D-5');
        $E5 = request('inVal_E-5');
        $F5 = request('inVal_F-5');
        $G5 = request('inVal_G-5');

        $A6 = request('inVal_A-6');
        $B6 = request('inVal_B-6');
        $C6 = request('inVal_C-6');
        $D6 = request('inVal_D-6');
        $E6 = request('inVal_E-6');
        $F6 = request('inVal_F-6');
        $G6 = request('inVal_G-6');

        $A7 = request('inVal_A-7');
        $B7 = request('inVal_B-7');
        $C7 = request('inVal_C-7');
        $D7 = request('inVal_D-7');
        $E7 = request('inVal_E-7');
        $F7 = request('inVal_F-7');
        $G7 = request('inVal_G-7');

        $Aval = array(-$A1, -$A2, -$A3, -$A4, -$A5, -$A6, -$A7);
        $Bval = array(-$B1, -$B2, -$B3, -$B4, -$B5, -$B6, -$B7);
        $Dval = array(-$D1, -$D2, -$D3, -$D4, -$D5, -$D6, -$D7);
        $Fval = array(-$F1, -$F2, -$F3, -$F4, -$F5, -$F6, -$F7);
        $Cval = array(-$C1, -$C2, -$C3, -$C4, -$C5, -$C6, -$C7);
        $Eval = array(-$E1, -$E2, -$E3, -$E4, -$E5, -$E6, -$E7);
        $Gval = array(-$G1, -$G2, -$G3, -$G4, -$G5, -$G6, -$G7);

        $koreksiStd = array(
            array(0.0, 0.6, 0.7, 1.0, 0.9, 1.4, 1.3), //koreksistdUp
            array(0.0, 0.7, 0.8, 1.1, 1.1, 1.7, 1.7), //koreksi tdDn
            array(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5), //Usertifikat up
            array(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5) //Usertifikat dn
        );

        $usertifikat = 0.5;

        for($i = 0; $i < count($koreksiStd[0]); $i++ )
        {
            $Bval[$i] = $Bval[$i] + $koreksiStd[0][$i];
            $Dval[$i] = $Dval[$i] + $koreksiStd[0][$i];
            $Fval[$i] = $Fval[$i] + $koreksiStd[0][$i];
        }

        for($j = 0; $j < count($koreksiStd[1]); $j++ )
        {
            $Cval[$j] = $Cval[$j] + $koreksiStd[1][$j];
            $Eval[$j] = $Eval[$j] + $koreksiStd[1][$j];
            $Gval[$j] = $Gval[$j] + $koreksiStd[1][$j];
        }

        $valVi = 2;
        $valVi2 = 50;
        $valVi3 = 50;
        $dividerD = 2 / sqrt(3);
        $dividerA = 2 / sqrt(6);
        $valURes = $resolution / $dividerA;
        $stdSertifikat = [];
        $UstdSertifikat = [];
        $hysterisis = [];

        for($i = 0; $i < count($koreksiStd[2]); $i++)
        {
            $stdSertifikat[$i] = $koreksiStd[2][$i];
            array_push($UstdSertifikat, $stdSertifikat[$i] / 2);    
        }

        for($i = 0; $i < count($Aval); $i++)
        {
            array_push($hysterisis, abs((($Cval[$i] - $Bval[$i])) + 
                                        ($Eval[$i] - $Dval[$i]) + 
                                        ($Gval[$i] - $Fval[$i])) / 3
            );
        }

        $upAvg = [];
        $dnAvg = [];
        $upKoreksi = [];
        $dnKoreksi = [];
        $upStdev = [];
        $dnStdev = [];
        $upURepeat = [];
        $dnURepeat = [];
        $zeroErr = [];
        $zeroErrU = [];

        for($i = 0; $i < count($koreksiStd[0]); $i++)
        {
            $array = array(
                $Bval[$i], $Dval[$i], $Fval[$i]
            );

            array_push($upAvg, $round->Roundto($Avg->Average($array), 1));
        }

        for($i = 0; $i < count($koreksiStd[0]); $i++)
        {
            $array = array(
                $Cval[$i], $Eval[$i], $Gval[$i]
            );

            array_push($dnAvg, $round->Roundto($Avg->Average($array), 1));
        }

        for($i = 0; $i < count($Aval); $i++)
        {
            array_push($upKoreksi, $round->Roundto(($upAvg[$i] - $Aval[$i]), 1));
        }

        for($i = 0; $i < count($Aval); $i++)
        {
            array_push($dnKoreksi, $round->Roundto(($dnAvg[$i] - $Aval[$i]), 1));
        }

        for($i = 0; $i < count($Aval); $i++)
        {
            $array = array(
                $Bval[$i], $Dval[$i], $Fval[$i]
            );

            array_push($upStdev, $stdev->Stdev($array));
        }

        for($i = 0; $i < count($Aval); $i++)
        {
            $array = array(
                $Cval[$i], $Eval[$i], $Gval[$i]
            );

            array_push($dnStdev, $stdev->Stdev($array));
        }

        for($i = 0; $i < count($Aval); $i++)
        {
            array_push($upURepeat, $upStdev[$i] / (2 * sqrt(3)));
        }

        for($i = 0; $i < count($Aval); $i++)
        {
            array_push($dnURepeat, $dnStdev[$i] / (2 * sqrt(3)));
        }

        for($i = 0; $i < count($Aval); $i++)
        {
            array_push($zeroErr, max(abs($Cval[$i] - $Bval[$i]), 
                                    abs($Eval[$i] - $Dval[$i]), 
                                    abs($Gval[$i] - $Fval[$i])
                                ));
        }

        //this one has the same value as u hysterisis column
        for($i = 0; $i < count($Aval); $i++)
        {
            array_push($zeroErrU, $zeroErr[$i] / (2 * (pow(3, 0.5))));
        }

        $KANval = 7.5;

        $UPbudgetua = [];
        $UPbudgetRes = [];
        $UPjumlahuicipow = [];
        $UPjumlahuicivi = [];
        $UPketidakpastianGab = [];
        $UPkebebasanEff = [];
        $UPfaktorCakup = [];
        $UPketidakpastianBen = [];
        $UPfinalRes = [];

        for($i = 0; $i < 7; $i++)
        {
            array_push($UPbudgetua, $upStdev[$i], $zeroErr[$i], $resolution, 0, $stdSertifikat[$i], $hysterisis[$i], ((0.1 * $driftres[0][$i]) / 2));
            $UPbudgetRes[$i] = $budget->Budget($UPbudgetua);
            $UPjumlahuicipow[$i] = $round->Roundto(array_sum($UPbudgetRes[$i][6]), 3);
            $UPjumlahuicivi[$i] = $round->Roundto(array_sum($UPbudgetRes[$i][7]), 3);
            $UPketidakpastianGab[$i] = $round->Roundto(sqrt($UPjumlahuicipow[$i]), 3);
            $UPkebebasanEff[$i] = $round->Roundto((pow($UPketidakpastianGab[$i], 4) / $UPjumlahuicivi[$i]), 3);
            $UPfaktorCakup[$i] = $round->Roundto($TINV->TINV(0.05, $UPkebebasanEff[$i]), 3);
            $UPketidakpastianBen[$i] = $round->Roundto($UPketidakpastianGab[$i] * $UPfaktorCakup[$i], 3);

            if($UPketidakpastianBen[$i] <= $KANval)
            {
                $UPfinalRes[$i] = $KANval;
            }
            else
            {
                $UPfinalRes[$i] = $round->Roundto($UPketidakpastianBen[$i], 1);
            }
            array_splice($UPbudgetua, 0, count($UPbudgetua));
        }

        $DNbudgetua = [];
        $DNbudgetRes = [];
        $DNjumlahuicipow = [];
        $DNjumlahuicivi = [];
        $DNketidakpastianGab = [];
        $DNkebebasanEff = [];
        $DNfaktorCakup = [];
        $DNketidakpastianBen = [];
        $DNfinalRes = [];

        for($i = 0; $i < 7; $i++)
        {
            array_push($DNbudgetua, $dnStdev[$i], $zeroErr[$i], $resolution, 0, $stdSertifikat[$i], $hysterisis[$i], ((0.1 * $driftres[0][$i]) / 2));
            $DNbudgetRes[$i] = $budget->Budget($DNbudgetua);
            $DNjumlahuicipow[$i] = $round->Roundto(array_sum($DNbudgetRes[$i][6]), 3);
            $DNjumlahuicivi[$i] = $round->Roundto(array_sum($DNbudgetRes[$i][7]), 3);
            $DNketidakpastianGab[$i] = $round->Roundto( sqrt($DNjumlahuicipow[$i]), 3);
            $DNkebebasanEff[$i] = $round->Roundto((pow($DNketidakpastianGab[$i], 4) / $DNjumlahuicivi[$i]), 3);
            // $DNfaktorCakDN[$i] = $round->Roundto($round->TINV(0.05, $DNkebebasanEff[$i]), 3);
            $DNfaktorCakup[$i] = $round->Roundto($TINV->TINV(0.05, $DNkebebasanEff[$i]), 3);
            $DNketidakpastianBen[$i] = $round->Roundto($DNketidakpastianGab[$i] * $DNfaktorCakup[$i], 3);

            if($DNketidakpastianBen[$i] <= $KANval)
            {
                $DNfinalRes[$i] = $KANval;
            }
            else
            {
                $DNfinalRes[$i] = $round->Roundto($DNketidakpastianBen[$i], 1);
            }
            array_splice($DNbudgetua, 0, count($DNbudgetua));
        }

        $result = array(
            $Aval,
            $upAvg,
            $dnAvg,
            $upKoreksi,
            $dnKoreksi,
            $UPfinalRes,
            $DNfinalRes,
            $length,
        );

        return $result;
    }
}




What are the best tools for pentester in windows?

What are the best tools for pentester in windows?




jeudi 28 novembre 2019

hover over a element click it not working in python. Thanks

from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Chrome("C:\\Users\\rahuls1\\chromedriver.exe") #code to get you to the page
driver.get('url')
time.sleep(2)
driver.find_element_by_id('user').send_keys('xxx')
driver.find_element_by_id('password').send_keys('xxx')
time.sleep(2)
driver.find_element_by_xpath("//input[@type='submit' and @value='Sign In']").click()
driver.maximize_window()
time.sleep(5)

popup = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="wm-shoutout-55704"]/div[3]/div[2]/div[1]')))

print ("Pop up completed")
popup.click()
time.sleep(5)

driver.find_element_by_xpath('//*[@id="__button67-BDI-content"]').click()


Dot = WebDriverWait(driver, 80).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="__button54-inner"]')))
print ("Dot completed")
Dot.click()
time.sleep(85)

driver.find_element_by_xpath('//*[@id="__toolbar4_downloadMenuItem"]').click() time.sleep(3)

wait = WebDriverWait(driver, 10) element = wait.until(EC.element_to_be_located((By.XPATH, '//*[@id="__text974"]'))) element.click()

ERROR

Traceback (most recent call last):
  File "C:\Users\rahuls1\Desktop\PYT\asp.py", line 37, in <module>
    element = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="__text974"]')))
  File "C:\Users\rahuls1\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:



How to use generic method instead of domain.com in web.config rule

I have following rule in web.config file that works fine, for prefixing www to a URL


    <rewrite>

          <rules>
            <rule name="ForceWWW" stopProcessing="true">
              <match url=".*" ignoreCase="true" />
              <conditions>
                <add input="{HTTP_HOST}" pattern="^domain.com" />
              </conditions>
              <action type="Redirect" url="https: // www.domain.com/{R:0}" redirectType="Permanent" />
            </rule>

        </rewrite>

How to replace domain.com with something generic? something like {HTTP_HOST} or {C:1} ?

so that I can copy paste this rule to other domain's web.config file without modigying?




java.lang.IllegalStateException: No primary or default constructor found for interface org.springframework.data.domain.Pageable

I am working on Spring Boot REST and Mockito Test cases. In this example I am getting below error.

Error

0:30:37.547 [main] DEBUG org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod - Failed to resolve argument 5 of type 'org.springframework.data.domain.Pageable'
java.lang.IllegalStateException: No primary or default constructor found for interface org.springframework.data.domain.Pageable
    at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.createAttribute(ModelAttributeMethodProcessor.java:212)
    at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.createAttribute(ServletModelAttributeMethodProcessor.java:84)
    at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:132)
    at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:124)
    at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:161)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:131)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
    at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:68)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:166)
    at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:165)

Controller

@GetMapping("/{empId}/employees")
public ResponseEntity<Object> getemployees(@PathVariable(name = "empId") String empId,
        @RequestParam(required = false, name = "page") Integer page,
        @RequestParam(required = false, name = "size") Integer size,
        @RequestParam(defaultValue = "empId", name = "sortParam") String sortParam,
        @RequestParam(required = false) Direction direction,
        Pageable pageable) {

    Page<EmployeeDto> employeePage = employeeService.getDetails(empId, pageable, sortParam, direction);

    return new ResponseEntity<>(pagedResourcesAssembler.toResource(employeePage), HttpStatus.OK);
}

Test Case

@Test
public void testEmployees() throws Exception {
    Sort sort = new Sort(Sort.Direction.ASC, "billingNumber");
    Pageable pageable = PageRequest.of(0, 10, sort);

    when(employeeService.getDetails("1111", pageable, "A", Direction.ASC)).thenReturn(employeePages);

    mockMvc.perform(get("/employees/1111/employees?page=0&size=10&sortParam=billingNumber")
            .contentType(MediaType.APPLICATION_JSON))
            .andDo(print())
            .andExpect(status().isOk());
}



I need an extremely simple website - where to get?

I want an extremely simple website. I just want to store files in it. No pages is needed.

For example, I can download files when entering the URL:

http://www.mywebsite.com/example.json

http://www.mywebsite.com/pig.exe

No other needs.


I viewed many hosting companies but their hosting is too powerful to satisfy my need. I need neither a database, wordpress, webpage, etc.




Is there a way to dump loaded scripts from a webpage via a commandline?

Rather than viewing/dumping the a webpage source, I'm wanting to have a page render and dump the url's being loaded by a site? (via a command line).

So if I visit google.com for example.

https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png https://ssl.gstatic.com/gb/images/i1_1967ca6a.png https://www.gstatic.com/images/branding/googlemic/2x/googlemic_color_24dp.png https://www.google.com/images/searchbox/desktop_searchbox_sprites302_hr.webp ...

Is this possible?




Decimal Line-Heights - Does it makes any difference?

I've been doing web design for a few years and lately I've been learning a lot about typography, as everyone, I had the curiosity to inspect different websites and see how they are doing stuff.

What I'm finding odd is that design applications like Figma or Sketch does not allow decimals for line-heights. For example, if I'm having a 18px font-size, and a line-height of 140%, or 1.4, that would result into a 25.2px line-height. Figma is rendering the line-height as 25 and Sketch doesn't even allow decimals for line-heights. Even tho, in CSS it's possible to set a line-height to that value.

As a designer, I'm always using baseline grids, and I don't know how to manage some line-heights.

And a few people told me that even tho there are decimals into a line-height, it's still rendered as an integer, which is wrong, you can definitely go to an website and try to change the line-height from 22.3 to 22.4 and you will see the change.

I'm really curious about this...




I can not access the link using iframe

I try to access the different URLs from my current domain using iframe but it's not loading into my domain but it's working in the localhost. I used this code X-Frame-Options ALLOW-FROM=http://my-secound-url.com in my .htaccess nothing happened and I used this code X-Frame-Options: ALLOW-FROM http://my-secound-url.com inside my httpd.conf file and I restart the server it's showing the error

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

My Iframe code

<iframe style="height: 283px;width: 100%;" src="http://secound-url.com" scrolling="no"></iframe>

And I check my site through developer option console it's showing this message,

Mixed Content: The page at 'https://my-domain.com/' was loaded over HTTPS, but requested an insecure resource 'http://secound-url.com'. This request has been blocked; the content must be served over HTTPS.

I using the Amazon EC2 server and my domain is SSL active site. Please help me and give a solution to access the different URL inside my domain




Updating my website based on files on a github repo

I use a website for documentation. I want to fetch some markdown files from a repository which contains different folders (markdowns are in the folders) on GitHub. What I would like to do is have my site periodically check the repository and pull any changes to a folder in my site.

I am using NGINX as docker and would like to try it with python or Hugo go website maker.




path option in sanic query params do not include ? or =

If I have an endpoint "/brawlstats/rankings/global/brawlers/16000001?limit=200", in the route I have @app.get("/brawlstats/<endpoint:path>"). I want endpoint to include the entire url above, but instead it cuts off at the question mark ("/brawlstats/rankings/global/brawlers/16000001"). How do I make it include the whole path?




Pagescroll when keyboard is invoked in mobile devices in *REGULAR* React (Not React-Native)

don't ask how or why, but I have an edge case where I need to make the page scroll when a keyboard opens in a mobile device (and for example covers an input) in React without using React-Native

Best practices? easiest way of doing so?

Thanks!




What kind of transition is this and how can i do it? [on hold]

So i`ve found a nice website and i really like the tabs transition after the main page but i dont really know how to achieve that.

The site: https://fir.im/




Online DNS with automatic resolution of local IPs

I remember using an online service that automaticaly translate "fake" subdomain to local IPs.

For example 192.168.1.1.THATSERVICE.COM would resolve to 192.168.1.1

But i can't manage to find that service anymore ...

Does anyone have a clue ?

Thanks a lot !




Django managing the icons and images

This is a Best practice question about how to manage my media in my django site.

I know this is not an "confusion with a code snippet" question like the most of the questions, but seriously i could imagine that this is a dilemma of some of the web developers.

Instead of managing all of my media content by a model with a key of ImageField key like this:

class myLogos(models.Model):
   foo = models.ImageField(upload_to = 'media/')

I was thinking its more "manageable" to store all of my media content in a kind of separated server, and to call a specific image everytime from my template, like this:

<img src="https://www.mysitepictures.com/app1/foo1.png" alt="Smiley face" height="42" width="42">
<img src="https://www.mysitepictures.com/app2/foo2.png" alt="Smiley face" height="42" width="42">

The reason is, i found it way too complicated to display images in an django project with multiple applications on it.

Is that a great idea to have kind of an third party server just for calling the images from it?

If not, then how should i manage a huge django project with a hundreds of images on the whole site?

Thanks!




I need help making an app or website that shows which seat is taken [on hold]

For a project I need to make an app or website that shows which seat is taken but I don't know where to start. It is possible to replace the chairs with a programm where I can enter a chair number and add available or unavailable. Do I need to connect this to a database that holds all the chair information and make the website connect to the database? I know a little bit about web developing, C# and arduino.




Reading request headers inside a service worker

I've created a very basic service worker, that logs the request headers on fetch event:

self.addEventListener('fetch', event => {
  console.log("- Fetch -");
  for (const pair of event.request.headers.entries()) {
    console.log(pair[0]+ ': '+ pair[1]);
  }
});

On the main page, I'm fetching the same page like so:

function fetchPage() {
   fetch(location.href);
}

When logging the headers I'm getting just the following 2 headers:

- Fetch -
service-worker.js:12 accept: */*
service-worker.js:12 user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36

Why can't I see any other/custom headers?
Is it a security limitation?




Brighteon Videos: Change video player

Brighteon.com is alternative of Youtube. How can you change the default player of Brighteon, when we embed videos in websites?

We can change to make it responsive with a lot of code. I am searching a different video player.

Thank you!




Is it possible to make a CSV localization file, using JavaScript on a website

So my question is this, is it possible to create a CSV localization file, and make it like this: ID;English;German;Italian;and-so-on;

And if it is possible, how can it be done?




How to open new screen on ReactJS on Web

How to open InvokeScreen Thank you very much.

This is App.js

import React from "react";
import { Grid } from "semantic-ui-react";
import QueryAllCars from "./components/queryAllCars";

const App = () => {
return (
<div>
 <QueryAllCars/>
</div>
);
};

export default App;

This is QueryAllCars.js

import React, { useEffect } from "react";
import { Button } from "semantic-ui-react";

const QueryAllCars = () => {
return (
<div>
 <Button onClick={moveToInvokeScreen}>Move to InvokeScreen</Button>
</div>
);
};

const moveToInvokeScreen = () => {
   //???????What code is here??? 
}
export default QueryAllCars;

This is InvokeScreen file

import React, { useEffect } from "react";
import { Button } from "semantic-ui-react";

const InvokeScreen = () => {
return (
  <div>
    Invoke Screen
  </div>
);
};
export default InvokeScreen;

What code is here???

const moveToInvokeScreen = () => {
 //???????What code is here??? 
}

Please help me. How to open InvokeScreen Thank you very much.




How to scrape multiple pages trouble with loop?

here is my code to scrape only one page but I have 11000 of them. The difference is in their id.

https://www.rlsnet.ru/mkb_index_id_1.htm
https://www.rlsnet.ru/mkb_index_id_2.htm
https://www.rlsnet.ru/mkb_index_id_3.htm
....
https://www.rlsnet.ru/mkb_index_id_11000.htm

How can I loop my code to scrape all that 11000 pages? is it even possible with such a big amount of pages ? It is possible to put them into a list and then scrape but with 11000 of them it will be a long way.

import requests
from pandas import DataFrame
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup

page_sc = requests.get('https://www.rlsnet.ru/mkb_index_id_1.htm')
soup_sc = BeautifulSoup(page_sc.content, 'html.parser')
items_sc = soup_sc.find_all(class_='subcatlist__item')
mkb_names_sc = [item_sc.find(class_='subcatlist__link').get_text() for item_sc in items_sc]
mkb_stuff_sce = pd.DataFrame(
    {
        'first': mkb_names_sc,
    })
mkb_stuff_sce.to_csv('/Users/gfidarov/Desktop/Python/MKB/mkb.csv')




The absolute uri: https://ift.tt/IED0jK cannot be resolved in either web.xml or the jar files deployed with this application

In Eclipse,I can't use "run as" function to open a dynamic web project. Error Message:"The absolute uri: http://www.springframework.org/tags/form cannot be resolved in either web.xml or the jar files deployed with this application"

However, when I export the project to a war file and deploy it, I can access the webpage.

The way I use the war file:

  1. export the war file in webapps folder
  2. click startup.bat
  3. use browser to visit the page : localhost:8080/****

My framework: spring4.1 tomcat8.5




How to block domains with python

does anyone know how to block a domain with python? It doesn't really matter what package it is but standard library is better. So what I think when I say blocking domains is when I type in my python program facebook.com. It will block any request any kind of thing related to the website, it will be blocked. I was thinking about typing a script that will check for the IP address of the domain and type it into the iptables on my Ubuntu Linux. But then I was told that Facebook and other big companies switch/change domain IP addresses often. Does anyone have a solution to this problem?




I am getting HTTP 400 error in application

I am getting this error sometimes in application. This page isn’t working. If the problem continues, contact the site owner. HTTP ERROR 400.

I am using apache 2.2 on web server and tomcat 7 on app server.




mercredi 27 novembre 2019

The POST method is not supported for this route. Supported methods: GET, HEAD. When I want to save a form data with modal

basically i want to save the data from a modal form to databases.

the modal that i use is modal from a bootstrap i place it at main.blade.php and i create a AuthControler with artisan without -r. and add a new routes into web.php if you ask why i didnt use php artisan make:auth. well it's because its more complicated to edit the whole code to my own html code that i already made it from the first time IMO. hope you all can help me.

here is the main layout

main.blade.php

    
        <div id="modal-register" class="modal fade">
            <div class="modal-dialog modal-register">
                <div class="modal-content">
                    <form method="post" action="">
                        <div class="modal-header">
                            @csrf
                            <h4 class="modal-title">Register</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        </div>
                        <div class="modal-body">
                            <div class="form-group">
                                <label>Nama Lengkap</label>
                                <input type="text" name="name" id="input-name"class="form-control" required="required">
                            </div>
                            <div class="form-group">

                                <label>Email</label>
                                <input type="email" name="email" id="input-email" class="form-control" required="required" placeholder="ex:abcdefg@gmail.com">
                            </div>

                            <div class="form-group">
                                <div class="clearfix">
                                    <label>Password</label>
                                    <input type="password" name="password" id="input-password" class="form-control" required="required">
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="clearfix">
                                    <label>Konfirmasi Password</label>
                                    <input type="password" name="password-confirmation" id="input-password" class="form-control" required="required" placeholder="Masukkan kembali password anda">
                                </div>
                            </div>

                        </div>
                        <div class="modal-footer">
                            <input type="submit" class="btn btn-primary pull-right service-btn" value="Register">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    

AuthController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class AuthController extends Controller
{
    //
    public function getLogin(){
        return view('login');
    }

    public function postLogin(Request $request){
        //
    }

    public function getRegister(){
        return view('Register');
    }


    public function postRegister(Request $request){
        dd('ok');
    }


}

web.php

<?php

//register
route::get('/register','AuthController@getRegister');
route::post('/register','AuthController@postRegister');

//login
route::get('/login','AuthController@getLogin');
route::post('/login','AuthController@postLogin');




Web devlopment reusable templets

As like we use style.css in our .html files can we use the .html files in another .html file. What is the best way to create reusable HTML templates components (like nav bar, footer, customer comments) that can be reused across the site?




I need to display the output of a python function that recognizes plate number characters which runs automatically with flask framework on a web page

I need to display the output of a python function that recognizes plate number characters which runs automatically with flask framework on a web page Please, I need a solution ASAP This is the relevant part of the python function. Thanks Read the number plate

text = pytesseract.image_to_string(img, config='--psm 11')
print(text)
pattern = re.compile('\W')
text = re.sub(pattern, '', text)
print(text)
first_part = text[:3]
last_part = text[-2:]
middle_part = text[3:len(text)-2]
print(first_part)
print(middle_part)
print(last_part)
middle_part = middle_part.replace('L', '1')
middle_part = middle_part.replace('G', '6')
first_part = first_part.replace('O', 'D')
last_part = last_part.replace('4', 'A')
text = first_part + middle_part + last_part
print(text)
print("Detected Number is:",text)
conn = sqlite3.connect('cars_data.db')
cursor = conn.cursor()
query_pass = """select * from CarsInfo WHERE PlateNumber = ?"""

cursor.execute(query_pass, (text,))
record = cursor.fetchall()
cursor.close()

if record:
    print('found')
    gpio.output(32,True)
    gpio.output(36,False)
    return record
else:
    print('not found')
    gpio.output(32,False)
    gpio.output(36,True)
    return



Javascript framework to build simple 5 page website

I need to build a website with 5 pages with javascript framework. Which one is easiest to learn and quickly implement 5 pages with backend content editor.

Please suggest.




This site is not open by me after turning off my computer

This site is not open by me after turning off my computer https://www.bookspk.site/search?q=Romantic+Urdu+Novels




Is any best way to Intraction of Excel with formula To web In Asp.net with real time data?

I want to develop Web application for Automated Excel,All calculation will Done in Excel nee to just show on web and Giving input from Web.




Is it possible to have a QR Code without exposing the URL of the website?

I have generated a QR Code for a website which I have done some form of masking on, which means the actual URL of the website is hidden and it is not revisitable by means such as refreshing the page, going back to the page after going to another website and going via browser history.

However, users are still able to revisit the site by going into the QR Code Scanner App (Mobile) to view the history of the QR Codes it scanned.

Is there anyway I can resolve this or work around? Please kindly advise.

Thanks.




Is it possible for front-end to know the local supported font-family?

I know we could define @fontface to download web-font. However, this could be problematic especially for chinese fonts due to its large size.

Yet in modern system, it's likely that it already installed some pre-set fonts. For example, a Windows might already installed fonts like SimHei, SimSun, NSimSun, FangSong, KaiTi, a Mac might installed fonts like Hiragino Sans GB, STHeiti Light, STHeiti, STKaiti.

So is it possible for a web-app to know what font this system had installed?




how to make an android app based on javascript not reload every time?

Hi guys this is my first question. so lets explain it by a example: i want to build a counter for android.I convert my web to app by phonegap. unfortunately every time I open the app everything is gone. so is there any way to fix it?




A: I need a developer's hand on my website

Good morning, I need help from a developer on my website to reset the web page or database of the page to another previous date, I had a problem of dispute in which if something is uploaded, there is error in the database and files, help thank you




Choosing client side technology for simple web app that should display excel-like table

I'm backend developer (C#/Java/Python) unfortunately without much experience in web client side. I need to write simple project that performs following:

  • On one gcp instance I runnning bash/python script that creates a report in JSON format.
  • This JSON should be displayed on a web page in form of table (I can just copy the json to the webserver folder).
  • The table should have options to edit some cells and ofcourse to save table as JSON locally (on web server) or in simple DB.
  • I also need an ability to export the table as Excel format.

My question is what web client technology to choose in order to write a client side of this thing?

There so much frameworks... Jquery, Angular, React, Vue etc..

I just need something simple and quick for someone that not a pro in Website development.

Please advise.




Generate guitar chords from mp3 file with java [closed]

Guys I like to develop a website that generates guitar chord for an uploaded mp3 file. Is there any material I can learn to develop that kind of thing or is there any library in java to generate a guitar chord from an mp3 song. Please help me, I don't know where to start.




Redirect Web page does not work in server

I am working on laravel framework. I have done a web site. It is working properly in localhost. but after deploying into the server its not working properly. I got following error in network calling view.

enter image description here




Vue/Vuecli3 - How to route from one component to another with parameters

I'm running into an issue when trying to redirect from one component to another. It appears that it's not routing to the URL thats specified in my router to the desired component and is staying on my home page instead. I can't figure out where the error is occuring.

I'm using the Vue CLI version 3.
Below is my index.js, Home.vue and Model.vue

Then under that is images of the Home.vue then it shows what happens when I try to redirect to the link in my href tag.
You can see that it's not going to the other component and it's staying on my home page.

Any ideas on whats causing the issue here? Thanks!

/router/index.js

import Vue from 'vue'
import Router from 'vue-router'
import Homefrom '@/components/Home'
import Model from '@/components/Model'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/model/:model_tag_name',
      name: 'Model',
      component: Model
      // props: true 
    }
  ]
})  

/components/Home.vue

<template>
  <div class="hello container-fluid">
    <h1></h1>
    <div class="row">
      <div class="col-4 text-left">
        <ol>
          <li v-for="tag in tags" v-bind:key="tag.model_tag_name">
            <a :href="'/model/'+ tag.model_tag_name"> </a>
          </li>
        </ol>
      </div>
      <div class="col-8">
        <p>Data</p>
      </div>
    </div>
  </div>

</template>

<script>
var axios = require('axios');

export default {
  name: 'Home',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      tags: []
    }
  },
  mounted: function() {
    var url = 'http://10.0.0.5:5000';
    console.log(url)
    axios.get(url + '/')
      .then((response) => {
        console.log(response.data);
        this.tags = [{"model_tag_name": response.data}];
      })
      .catch(function(error) {
        console.log(error);
      });
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}

a {
  color: #42b983;
}
</style>

/components/Model.vue

<template>
  <div class="container-fluid">
    <h1> Model </h1>
  </div>

</template>

<script>
var axios = require('axios');

export default {
  name: 'Model',
  data () {
    return {
      model_tag_name: this.$route.params.model_tag_name
    }
  }

}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}

a {
  color: #42b983;
}
</style>

http://localhost:8080/ Home page

Then this is what happenes when I click the href link on the home page. It's redirecting back to the home page even though the URL matches the routerview for Model.vue Next Page




Support for Animation on the Web

I am trying to animate algorithms on a web page. Sorting algorithms, search algorithms etc.I've worked with the web before, but it was simple.for example, I want to show the quick sorting algorithm to the user by changing the position of the columns, but I have no idea how to do this.I'm sorry for my English. And thanks for help.I want to deal with myself, not just help me with resources or guide.if I have a question, I will ask :)




How to render a .mht file inside an iframe

I want to take a snapshot of a page using headless chrome which will return a file to me, so I am creating an mht file as it will contain more information about the web page. So, now I want to render this snapshot inside an iframe but I am unable to do so.

<iframe src="file:///home/user/untitled1.mht"></iframe>

This is returning an error after it is rendered.

Attempted to load a multipart archive into an subframe



Wrong favicon when i share the link of my react app

I have a landing page write in react (with create-react-app), and i put as a favicon the logo of my app, but the problem is that when i share the link of that landing page by text message (SMS), the favicon is still the react icon instead of the favicon on my project repository.

I don't understand why because when i go to this link through my browser, it displays well my favicon.




Which Platform to Choose for better Future

I am a student currently doing my bachelors in Computer Science. I wanted to get some suggestions about which platform should I choose to secure my future. I am a hardworking person and I have a good experience in Web development (HTML, CSS, JavaScript, bootstrap, and SQL and PHP), Android Development and C# .NET Windows Applications. Can anyone help me to suggest me What i have to choose from these and earn Money

I just wanted to get knowledge about how to get started in any field or suggest me something with good opportunities so i can start it ASAP. I have passion to learn something with extra ordinary skills.

it would be great if you help me in getting started.

Thanks




How to send http post request every 5 minute using vb.net

i want to send a request on my stock market account for selling a company shares every 5 minutes. But i want to do this action faster. My first question is it possible? If it is. Here is a few pictures and information that i captured from the site.

2.Can i do this action automatically by vb.net?

Thanks.

A

B




web service using different ports

I have proggramming knowledge in C and Matlab and learning python so I am a newbee in web developing. I want to ask that how can i send pieces of some document with different ports of computer which seperated by a program and these pieces will be taken by selected ip address with different ports. In short i try to develop a cyriptograpy program and this program will send a document to another computer by using different ports of computer itself and other computer different ports. Thanks.




Firebase Web Push Notification stops firing on background

I have a scenario where the push notification does not fire on the background for some reason . this happens intermittently and starts working a while later ! I can see the notification received on the Push Messaging console on chrome. Has anyone faced this issue ?

Here is my notification handle on my service worker


importScripts('https://www.gstatic.com/firebasejs/6.3.4/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/6.3.4/firebase-messaging.js');

var firebaseConfig = {
    ...
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

const messaging = firebase.messaging();


messaging.setBackgroundMessageHandler(function (payload) {
    console.log('[firebase-messaging-sw.js] Received background message ', payload);
    // Customize notification here
    const notificationTitle = 'Background Message Title';
    const notificationOptions = {
        body: 'Background Message body.',
        icon: '/Assets/Mystays/images/mystays-logo.png',
        image: '/Assets/Mystays/images/mystays-logo512.png',
        badge: '/Assets/Mystays/images/mystays-logo256.png'
    };


    return self.registration.showNotification(notificationTitle,notificationOptions);
}); 

Any sort of help is appreciated




Anyway can open mobile (for android and IOS) flash by using javascript?

I am doing a video call in web, and I am trying to open user's mobile flash when capture photo, is it anyway can do this in javascript?

The flash I mentioned is the flash light on the mobile devices.

I had tried media stream track method, but can only work for some devices only. cannot work in iphone.

thanks




I want when the user will search for Trace.axd to get error 404?

I want when the user will search for /Trace.axd on my website to get 404 error page?




mardi 26 novembre 2019

Access website and its functionality using java (jsoup)

I was wondering if there is a library for java where it is possible to search on a website. I would like to use the functionality of the website and read out the results using 'JSoup'.

I can use the search engine using placeholders

https://at.rs-online.com/web/c/SEARCHTERM

Example: searchSite On the left of the side is a tool where I can refine the search (contacts, voltage,...). These elements I want to manipulate.

It would also be preferable to run this in the background (firefox or chrome) over this Web-Java-Interface

I looked at a commercial tool like 'Parsehub' or the 'jdmp' package for java.




How to Set Keep-Alive Timeout in VertrigaServ?

In the apache configuration file httpd.config, there is no Keep-Alive setting and in the VertrigaServ configuration file, too. I don’t know where to find him. The is Response Headers:

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
Date: Tue, 26 Nov 2019 13:27:47 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=5, max=100
Pragma: no-cache
Server: Apache/2.4.20 (Win64) OpenSSL/1.0.2g PHP/5.6.20
Transfer-Encoding: chunked
X-Powered-By: PHP/5.6.20



Basic question about a php tag, veryyyyyy basic

So im on a site which has a pretty nice CMS, in the site there is a lookup option and you can search for employees in the company and their photos, all the photos are under a tag called portrait.php, for example, my image is img class="full-width" src="/portrait.php?id=1311&size=constrain200"> So I was wondering how can I get all the photos without going thru and saving all the photos by querying ?id=1 then 2 then 3 etc, any response would be amazing, Thanks.




Web designing And Development

I want to grow up my web designing, web developmemt and android development career. I have learn html,css,js, and c# for further pl guide me.




webAPI calls using swift

I am working with webAPI calls using GeoNames WebServices to find the earthquake information for a given city and surrounding area. How does one make webAPI calls. So far I've gotten the longitude and latitude of the address. I am having difficulty understanding how we get the information. I would like to display the Display the datetime and magnitude of each earth quick

@IBAction func getAddress(_ sender: Any) {
    let addString = location.text
    CLGeocoder().geocodeAddressString(addString!, completionHandler:
    {(placemarks, error) in

        if error != nil {
            print("Geocode failed: \(error!.localizedDescription)")
        }else if placemarks!.count > 0{
            let placemark = placemarks![0]
            let location = placemark.location
            let coords = location!.coordinate

            self.lat = coords.latitude
            self.long = coords.longitude

            print(self.lat, "\n")
            print(self.long, "\n")
        }
        self.south = self.south + self.lat
        self.north = self.north + self.lat
        self.east = self.east + self.long
        self.west = self.west + self.long
        print("\n",self.north, "\n", self.south, "\n", self.east, "\n", self.west)
    })


    let urlAaString = "http://api.geonames.org/earthquakesJSON?north=" + String(self.north) +
    "&south=" + String(self.south) +
    "&east=" + String(self.east) +
    "&west=" + String(self.west) + "&username=demo"

    let url = NSURL(string: urlAaString)!
    let urlSession = URLSession.shared

    let jsonQuery = urlSession.dataTask(with: url as URL, completionHandler: { data, response, error -> Void in
        if (error != nil) {
            print(error!.localizedDescription)
        }
        var err: NSError?


        let jsonResult = (try! JSONSerialization.jsonObject(with: data!, options: JSONSerialization.ReadingOptions.mutableContainers)) as? NSDictionary
        if (err != nil) {
            print("JSON Error \(err!.localizedDescription)")
        }

        print(jsonResult)

    })

    jsonQuery.resume()
}



Were can i get life forex news that scrolls automatically for my site project?

I want automated forex news for my new project with horizontal scrolling ability.




what framework/language should I use to build a contact us website

a relative of mine wants me to build a contact us website for his business. I just finished systems engineering first year and have no experience with web development. I understand that this is an easy task as there is no database managment or things like that. I have played around with django and javascript but I'm not sure what kind of technologies are the best for this cases. Is django a good choice? or is the task too simple to use django? What should I use? The website should have an admin mode in which my relative can easily add and change information whenever he wants. Thanks, any suggestion as to what frameworks or languages to use for backend and frontend will be appreciatted.




How to upload image, pdf and display with react and express?

I am building a react app with express server. I need to upload images and pdf's. After uploaded they need to be displayed in web pages. The original plan was to upload to mongodb as Buffer type or with gridfs. But I could not find a way to display images or pdfs with buffer in mongodb? Is there a way to display with buffer and pdf with buffer? Or I should rather store files on server?




this.state.annonces.map is not a function

I want to update State variable on react, when i set it by default my map function work well. But now when i update my state variable with setState i have the response map is not a function here is my code.

import React from 'react';

class Corps extends React.Component{

    state = {
      annonces : [
        {
          nom : " Karim Ngami",
          annonces: " selon le CEO de google Mr Karim Ngami google lens prends une nouvelle tournure"
        },
        {
          nom : " Brigitte Bami",
          annonces: "Je n'ai jamais douté de mon fils, je savais qu'il sera un grand home"
        },
        {
          nom : "Gladice Ngami",
          annonces: "Le monde est étonné par ces proesses, mais nous non (rire) il savait clairement ou il allait"
        },

      ]
    }

    addAnonces = () =>{

      this.setState({
        annonces : this.state.annonces.push({
          nom : "Nkodi Ngami",
          annonces: "Le monde est étonné par ces proesses, mais nous non (rire) il savait clairement ou il allait"
        })
      })

      console.log(this.state.annonces.length);
    }

    render(){



      return(<div>
                <h5>Mes annonces</h5>
                <div className ="row">

                   <div className="col-sm-10 col-sm-push-1">
                        listes

                      {this.state.annonces.map((item) =>(
            <div className ="row"> 
              <div className="col-sm-4">
                <span>{item.nom} :</span>

              </div>
              <div className="col-sm-7 col-sm-push-1">
                <span>{item.annonces}</span>
              </div>
            </div>) 
            )}
                  <button className="btn-success" onClick={this.addAnonces}> Envoyé </button>
                   </div>
                   <div className="col-sm-10 col-sm-push-1">
                        <form>
                            <label for="nom">Votre nom:</label> <input type="text" id="nom" /><br/>
                            <label for="texte">votre annonce:</label><textarea placeholder="Ecrivez votre annonce" name="texte" id="texte">
                            </textarea><br/>

                        </form>
                   </div>
                </div> 
             </div>
            );  
    }
}

export default Corps; 



React Redux sync action return error when giving plain object

I'm learning React/Redux. I have an action file:

import { RESIZE } from './actionType';

export const setSize = msg => (dispatch) => { 
    dispatch({ type: RESIZE, size: msg }); 
};

If I use above action, it will fail updating the redux store. But if I do it like below, redux store will be updated successfully:

import { RESIZE } from './actionType';

export const setSize = msg => ({ type: RESIZE, size: msg }); 

In the first example, console keeps giving an error which is 'action must be a plain object. Use custom middleware for async actions'. I am using a plain object in action. Then what's the problem with my code. I have search similar posts but nothing is applicable to my problem.




How to add security so that a modal window is not deleted from the html code of the browser?

I hope you can help me with this problem in advance, thank you very much.

I have a modal window of bootstrap 4, The modal window is displayed on a user's page so that it cannot query data. This modal window is displayed when the information is not yet available to the user.

When I did the test my page shows me the modal but when accessing the web code I could delete the modal and enter the form so I could consult data although the grid did not show me records.

My question is: How can I make this modal cannot be deleted from the html code in the web browser and the user tries to consult data?

The code of my modal is this:

<div id="PopupInformation" class="modal fade" data-backdrop=”static” data-keyboard=”false” tabindex=”-1″>
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-body">
                    <br />
                    <h6 style="text-align: center; font-weight: bold">
                        The information is not available at the moment consult later
                    </h6>
                </div>
                <div class="modal-footer">                     
                    <div class="container">                                                               
                        <div class="row">                            
                            <input id="btnAccept" type="button" value="Accept" CssClass="btn btn-primary btn-block data-dismiss="modal"  />
                            <div class="col-lg-6">
                            </div>
                        </div>                                     
                    </div>
                </div>
            </div>
        </div>
    </div>



sending data from a servlet javaEE to an angular component

am a beginner in javaEE,I work with angular in FrontEnd and javaEE in BackEnd.I want to send data from a servlet to an angular component and I wanna know if is it possible what instruction i should include in my servlet,in this example i wanna send the list of users(utilisateurs) to angular component for treatment,here is my code of servlet. ps1: I use module HttpClient in angular. ps2: I don't use Spring framework.

Test.java

package com.coors.servlets;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.octest.beans.Utilisateur;
import com.octest.dao.DaoFactory;
import com.octest.dao.UtilisateurDao;
import com.octest.dao.UtilisateurDaoImpl;

import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/test")
public class Test extends HttpServlet {
private static final long serialVersionUID = 1L;
private UtilisateurDao utilisateurDao;
private DaoFactory daoFactory; 

public Test() {
    super();
}

@Override
public void init() throws ServletException {
    daoFactory=DaoFactory.getInstance();
    utilisateurDao=daoFactory.getUtilisateurDao();
}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    this.utilisateurDao.lister();//I  get the list of users

    //here what instruction ?????????????????????????????????????????
}

public void doPost( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
}

}