dimanche 30 juin 2019

JavaScript is not function properly when set it locally

I want to import raphael-min.js for my jsp. I'm using tag for importing of the script. But the I want to include this js locally because when rendering this script is blocked by the browser. I copy the code from the url above and save it as a js file. and include as this src="${pageContext.request.contextPath}/resources/raphael/raphael-min.js". But the problem is js is not function at all. Are there any method to download this and include in jsp file?




WebSocket connection to 'ws://127.0.0.1:8888/' failed: WebSocket opening handshake timed out

im developing a websocket with ratchet, and when i try to connect to it, after a few minutes it only prints "WebSocket connection to 'ws://127.0.0.1:8888/' failed: WebSocket opening handshake timed out" in console, but in the shell prints:

New connection! (48)
Connection 48 sending message "GET / HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Accept: */*
Accept-Language: es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Sec-WebSocket-Version: 13
Origin: http://socketo.me
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: kMUmcl5+slye1dy0ISFOtQ==
DNT: 1
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket

" to 0 other connections

server code:

    <?php

use Ratchet\Server\IoServer;
use MyApp\Chat;
    require dirname(__DIR__) . '/vendor/autoload.php';

    $server = IoServer::factory(
        new Chat(),
        8888
    );

    $server->run();
?>

client code:

<!DOCTYPE html>
    <script>
    const conn = new WebSocket('wss://127.0.0.1:8888');
conn.onopen = function(e) {
    console.log("Connection established!");
};

conn.onmessage = function(e) {
    console.log(e.data);
};

    </script>

i have tried with another browser, changing the port and doesnt work yet




Web site as a tree of links including documents

I need a tool that can take a domain and crawl it just listing links as a tree including things like PDFs. I don't need the content, just the links. Google is failing me.




Why isn't Azure VM website displaying images?

So I have an issue with Azure VM not displaying any images on my webpage... I have Index.html in the /var/www/html/ folder and the image in the same folder. I've linked to the image in the html file with:

<img src="sunsetforbackground.jpg" alt="background image">

But it doesnt even display on the page. I went to "inspect" on the website and to "sources" where the image was located but when trying to open it in a new tab gave a blank screen.

note: The html file works on my computer fine just not on the server.

I am running the latest ubuntu with nginx and my file permissions are code 777 when I edit the site and 755 when i'm not so permissions shouldn't be an issue...

Help would be greatly appreciated!




Passing Access Tokens from a website to another

Lets have this explained by example: Can we have a website (A) dedicated for creating access tokens and handing it to another website (B) to access its endpoints? is there anything like that or a practice for having such thing?




What are the basic requirements of an API or a client-server system to be considered as RESTFul?

I'm having trouble to find exactly the core concepts or basic requirements to call an API or a system RESTful, what are the most basic core points needed to be fulfilled in order to make a system considered as RESTFul?




Can i build a stolen or lost cell phone tracking software or website in Javascript??

Can i build a stolen or lost cell phone tracking software or website in Javascript? I was wondering if it would be possible. To build a website where on can enter imei or something and make use of google maps to track phone location.




Astrology PHP Software

I have been searching Google for hours but I have not found anything that has solved my issue, I am making a PHP Western Astrology Web App.

How would I receive the Western Position of the Moon & Mercury by just using a date?

Thank you




How to randomly assign a web page icon?

In HTML you might do something like link rel="icon" type="image/x-icon" href="IMG/favicon.ico" and your web page would have an icon. I want to know if I had multiple icons (favicon2.ico, favicon3.ico, etc.) is there a way to get the browser to randomly assign an icon from the icon files in a folder?

So one user might load the page and get favicon2 as the pages icon while another user might get favicon3, is this possible?




samedi 29 juin 2019

What's the difference between a blueprint and a template in Flask?

I'm self-learning web development, and I was confused about how blueprint and templates were different.

Blueprints support "common patterns within an application or across applications" - http://flask.pocoo.org/docs/1.0/blueprints/ but I don't see why templates can't suffice

Also, are these standard web terminology or just Flask specific?




How to fix loop not returning in perl?

I have this code, and it is only returning one value per line, I want it to be a loop but none of my strategy is working

I tried to make it read from file but it's not working it is returning only one value

sub show_xss_bug {
    my $self = shift;
    return undef unless $self->vulnerable;
    my $uri = URI->new($self->action);
#    $uri->query_form(map { $_ => '<s>test</s>' } $self->names);
   my $filelist = <STDIN>;
  $uri->query_form(map { $_ => $filelist } $self->names);
    return $uri;
}

It's only returning one value per line and discarding everything else




CANNOT SET CURRENT DATE IN ASP.NET MVC

I want to set current date in @Html.EditorFor but i don't know the correct syntax. what syntax that can i use to set curent date?

this is the code that i've tried but it not work

@Html.EditorFor(model => model.ID_Emp, new { htmlAttributes = new { @value = @Session["Username"].ToString(), @class = "form-control"} })

i expect that would set automatically when run the page but it wasnt showed




Why my website theme always showing 2 featured images

My name is Daniyal. I am a newbie in the website field. I have a website that shows featured image 2 times in a post. Anyone have a CSS code or something like that for hide feature image from the post. Please give me.

My website is: https://ondrotech.com




vendredi 28 juin 2019

Selection of design pattern(Gof) in below scenario

I need help with a Exam problem:

Let's suppose you are building an E-commerce web application which contains thousands of products in database. A web page displays 100 products in current view of products listing. Upon scrolling down event it loads next 100 products from database and displays. products listing web page shows product name, price and thumbnail image. Web page response gets slow on scrolling or refreshing due to fetching data from web server. Which design pattern strategy(GOF) you will chose to make your webpage loading fast every time when user refresh or scroll webpage?




Using Webpack, React, Babel7, for a website with 2 web pages

I want to set up a web page that is two pages(multiple in the long run, but just 2 for this example). The first page looks like this picture and just has a link that says "Click Me". When you click this link, it takes you to the second webpage which says "Hello World".

enter image description here

I can get the webpage working for a website with one page. It uses this webpack.config.js file

webpack.config.js

const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackTemplate = require('html-webpack-template');
const path = require('path');

const config = {
  entry: {
    index: './src/index.js'
  },
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: "bundle.js",
  },
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        use: 'babel-loader',
        exclude: /node_modules/,
      },
    ],
  },
  resolve: {
    extensions: ['.js', '.jsx'],
  }
};

module.exports = config;

I tried modifying this config file, so that I could have multiple pages. You can see the modifications in the following config file, which I modified based on these instructions

webpack.config.js for multiple pages

const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackTemplate = require('html-webpack-template');
const path = require('path');

const config = {
  entry: {
    index: './src/index.js',
    services: '../src/services.js'
  },
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: "[name].js",
  },
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        use: 'babel-loader',
        exclude: /node_modules/,
      },
    ],
  },
  resolve: {
    extensions: ['.js', '.jsx'],
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './index.html',
      inject: true,
      chunks: ['index'],
      filename: 'index.html'
    }),
    new HtmlWebpackPlugin({
        template: './src/services.html',
        inject: true,
        chunks: ['services'],
        filename: 'services.html'
    })
  ]
};

module.exports = config;

I receive the following output error when using the latter webpack.config.js file

Jacob-Air:Dir Jacob$ npm start

> default@1.0.0 start Dir/Dir_html
> webpack-dev-server

ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from Dir/Dir_html
✖ 「wdm」: Hash: 7e17e6d8bd9ec606703d
Version: webpack 4.35.0
Time: 2547ms
Built at: 06/28/2019 11:09:27 AM
        Asset       Size    Chunks             Chunk Names
   index.html  629 bytes            [emitted]  
     index.js   1.25 MiB     index  [emitted]  index
services.html  752 bytes            [emitted]  
  services.js    359 KiB  services  [emitted]  services
Entrypoint index = index.js
Entrypoint services = services.js
[0] multi (webpack)-dev-server/client?http://localhost ./src/index.js 40 bytes {index} [built]
[1] multi (webpack)-dev-server/client?http://localhost ../src/services.js 40 bytes {services} [built]
[./es6/Banner.js] 1.7 KiB {index} [built]
[./es6/Footer.js] 345 bytes {index} [built]
[./es6/Header.js] 579 bytes {index} [built]
[./es6/HomePageServices.js] 3.4 KiB {index} [built]
[./node_modules/react-dom/index.js] 1.33 KiB {index} [built]
[./node_modules/react/index.js] 190 bytes {index} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {index} {services} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost] (webpack)-dev-server/client?http://localhost 4.29 KiB {index} {services} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {index} {services} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {index} {services} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.77 KiB {index} {services} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {index} {services} [built]
[./src/index.js] 534 bytes {index} [built]
    + 35 hidden modules

ERROR in Entry module not found: Error: Can't resolve '../src/services.js' in 'Dir/Dir_html'

ERROR in multi (webpack)-dev-server/client?http://localhost ../src/services.js
Module not found: Error: Can't resolve '../src/services.js' in 'Dir/Dir_html'
 @ multi (webpack)-dev-server/client?http://localhost ../src/services.js services[1]
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./index.html] 789 bytes {0} [built]
    [./node_modules/lodash/lodash.js] 527 KiB {0} [built]
    [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
    [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
Child html-webpack-plugin for "services.html":
     1 asset
    Entrypoint undefined = services.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/services.html] 909 bytes {0} [built]
    [./node_modules/lodash/lodash.js] 527 KiB {0} [built]
    [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
    [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
ℹ 「wdm」: Failed to compile.

OTHER FILES THAT MAY BE USEFUL

src/index.js

import React from 'react';
import ReactDOM from 'react-dom';

const Content = () => {
    return (
        <React.Fragment>
            <div>
                <a src='./about.html'>Click Me</a>
            </div>            
        </React.Fragment>
    )
}

const root = document.getElementById('Content');
ReactDOM.render (
    <Content />,
    root
)

src/services.js

import React from 'react';
import ReactDOM from 'react-dom';

const Content = () => {
    return (
        <React.Fragment>
            <span>Hello World</span>
        </React.Fragment>
    )
}

const root = document.getElementById('Content');
ReactDOM.render (
    <Content />,
    root
)

package.json

{
  "name": "default",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "start": "webpack-dev-server",
    "build": "webpack"
  },
  "devDependencies": {
    "@babel/cli": "^7.4.3",
    "@babel/core": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "@babel/preset-react": "^7.0.0",
    "babel-loader": "^8.0.5",
    "html-webpack-plugin": "^3.2.0",
    "html-webpack-template": "^6.2.0",
    "webpack": "^4.29.6",
    "webpack-cli": "^3.3.0",
    "webpack-dev-server": "^3.2.1"
  },
  "dependencies": {
    "react": "^16.8.6",
    "react-dom": "^16.8.6"
  }
}

.babelrc

{ "presets": ["@babel/preset-env", "@babel/preset-react"] }

Both index.html and services.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Web Dexter</title>
    
    <link rel="stylesheet" type="text/css" href="css/myCss">
    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.00, maximum-scale=1.10, minimum-scale=0.80">

  </head>
  <body>
    <div id='Content'></div>
  </body>
  <script src='./bundle.js'></script>
</html>

File hierarchy

enter image description here




problems with Python Django NSException

I am working on a project using Django and Python and I am trying to plot a simple graph using matplotlib and I keep getting the error

uncaught exception of type NSException

Python also crashed after that. I am using mac if that helps.

Matplotlib version '3.1.0'

I have already tried using the most simple graphs but still the problem persists.

This is my code in the views.py file

def get_svg(request):
    t = np.arange(0.0, 2.0, 0.01)
    s = 1 + np.sin(2 * np.pi * t)

    fig, ax = plt.subplots()
    ax.plot(t, s)

    ax.set(xlabel='time (s)', ylabel='voltage (mV)',
               title='Sample')
    ax.grid()

    response = HttpResponse(content_type = 'image/png')
    canvas = FigureCanvasAgg(fig)
    canvas.print_png(response)
    return response

This is the error message I get:

Terminating app due to uncaught exception 'NSInternalInconsistencyException',
  reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
  libc++abi.dylib: terminating with uncaught exception of type NSException




Build weburl for google directory contact preview

I need to build the web URL for particular google directory contact with id. I achieved the URL for private contacts but I am not able to build URL for directory contacts.

For private contact, web URL is working fine.

https://contacts.google.com/contact/{contactId}?authuser={gmailid}

Now I need to build the web URL for the directory or public contact. That needs to open the contacts page and open the modal dialog for that particular contact.




Clarification in AWS Elastic Mapreduce

I have started to learn about AWS ElasticMapreduce,I had few doubts in that. what is the difference between Steps, Jobs and Applications and also is appsfailed or jobsfailed metrics directly related to steps FAILED or not.When i get appsfailed or jobsfailed metric values ,Please help me with this ?




How do I allow access to a folder only if the content is embedded on another site?

I have a site on a.example.com which is a web application to which I cannot, for many reasons, upload media files.

I want to be able to upload these files to b.example.com/media/ (an Apache/PHP server) so that one is only able to access the files on the /media/ folder through <img>, <media>, <a> and other elements on pages found on a.example.com.

I've tried an .htaccess inside the /media/ folder with Require host and Require forward-dns a.example.com, but this just denies basically all requests.

What else can I try?

Thank you all in advance for your help & time!




Azure Web Functions Consuming SOAP service - how to make async / WinHttpHandler error

I am trying to consume a soap web service from an Azure web functions project. I am having difficultly coding the call to the soap service. I have successfully added a WCF web service reference. The reference.cs file has been generated and the SOAP service is asynchronous.

The code is written in C# DOT.NET core 2.0, connecting to a database hosted in an Azure environment.

I believe I should be using threading and making call to an Asynchronous function. When I try to reference code in a separate class file, I get errors relating to using the static keyword.

public class ExpireData
{
    private readonly string _Endpoint;

    public ExpireData(IConfiguration config)
    {
        _Endpoint = config["ServiceURL"];
    }
    [FunctionName("ExpireData")]
    public void Run([TimerTrigger("0 * * * * *")]TimerInfo myTimer, ILogger log)
    {

        BasicHttpBinding binding = new BasicHttpBinding();
        EndpointAddress address = new EndpointAddress(_Endpoint);
        ServiceSoapClient client = new ServiceSoapClient(binding, address);

        var result = client.ExpireDataAsync();    
    }

The value stored in result is: Id = 1018, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"




War is not deploying in Glassfish Server

I tried to deploy a war file in glassfish server. But the following error occured in the glassfish. Please any one know the solution for this?enter image description here




Connect Customer Databases directly to a Webapplication for uploads

I'm currently working on my bachelor in Business Information Technology. For my final work I need to evaluate a interface management for a cloud application. The users should be customers, which have their own databases. Now if they want to upload some Data from the database, I want to make it possible, that they don't need to make an export and upload it afterwards. They should can do a direct upload. And everytime they logout and login, the connection should be open again.

Now my question is if and how it is possible to link those databases directly to my application?

No code needed! - Just concepts..

I already thought of ODBC, but I am not really shure if it would work with it as a "ODBC Engine" between my application and the databases.




jeudi 27 juin 2019

How to add datasource for lit-html web component table?

I recently started creating web component with lit-html. The question is, after I create the component as a js file, I need to set datasource to the element from the page I am calling the component from. I dont want to be doing it from component at all.

Is there a way to define an array from HTML page I am calling the web component from and inserting the datasource inside so it would be fully dynamic ?




Implement xApi technologie in an Angular project

Currently working with the xApi technologie, i’m facing some issues.

In fact, I want to use xApi in an Angular project, in order to follow every the actions of a user on a website (Account creation, delete …).

My problem, is that i couldn’t find any way to implement the xApi functions in my Angular project, using the npm xapiwrapper to get every xApi js functions i need to use.

I tried the usal way to implement js files in Angular, aswell i tried to follow tutorials on how to implement JS in Angular 6/7, but still i don’t why nothing is working so far.

There is the xapiWrapper file, which contains every js functions i need to use in order to send datas to the LRS, and I have a custom js file which use the wrapper functions and the mail + name of the user I need to "follow".

I already tried to call my js files in the usual way with the html, with the angular json file. I also followed the tutorials on how to implement js files in Angular, but still nothing actually works ...

            xApi function i need to use : 
    function sendStarted(){
        var startedStatement = {  
            "actor": {  
            "mbox": "mailto:"+email,  
            "name": name,  
            "objectType": "Agent"  
           },  

       "verb": {  
       "id": "https://w3id.org/xapi/dod-isd/verbs/started",  
       "display": {"en-US": "started"}  
       },  

       "object": {  
       "id": "http://learningdojo.net/xapi/simple_button",  
       "definition": {  
       "name": {"en-US": "Simple button started"},  
       "description": {"en-US": "User clicked on the started button."}  
      },  
       "objectType": "Activity"  
    }  
    };

    ADL.XAPIWrapper.sendStatement(startedStatement); 

    // Alert message
    alert('Started statement has been sent!')
    }


 The LRS configuration is in the xApiwrapper.js file. 

So here is my question : Is it possible to use or implement in any way the external xApi js files (xapiWrapper, xapi verbs, statement …) in my Angular Project, in oder to use it in my app component.

Thanks for your time and your answers.




Convert JSON to OData in ASP.NET

I have a web service that converts a list of objects to json and returns that json. For some reasons I need to change the return type to OData. I don't know how to do it. Anyone can help?

 return serializer.Deserialize(stream) as MyObject;




Webpage centering on the web browser

I am having problem on when I zoom out my webpage on the web browser. when I zoom in, it grows smaller and goes to the top right corner I.e it does stay at the center of the page. Please guide me on this




Website with Database for students subjects

I want to build a website with a database that would allow a school's management to upload their students tests and exam questions and the questions would be sorted according to class, subjects, the term and the academic session. So the site wouldn't just be used to just upload tests and stuff, but should also be able to store them for future references.




How do I upload an image from another directory of my project on web site with Selenium - Python?

I need to upload an image on web site, and I wanna store the image in my project in a separate directory "image", so everyone can run my test and upload image with no path issues.

here's html code of uploading form:

<form id="imageUploadForm" class="ant-form ant-form-horizontal image-upload-form">
<div class="ant-row ant-form-item">
<div class="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-4">
<label class="" title="Image list">Image list</label>
</div>
<div class="ant-col ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-16">
<div class="ant-form-item-control">
<span class="ant-form-item-children">
<div class="images-list">
<div class="images-list__upload-btn">
<span class="">
<div class="ant-upload ant-upload-select ant-upload-select-text">
<span tabindex="0" class="ant-upload" role="button">
<input id="image" type="file" accept="" style="display: none;">
<button type="button" class="ant-btn image-upload__btn">
<i aria-label="icon: plus" class="anticon anticon-plus">
<svg viewBox="64 64 896 896" class="" data-icon="plus" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false">

as for uploading form : there's no input field on a site, u can choose a file only via a system window.

here's my code:

import os

image_upload = wd.find_element_by_xpath("//*[@id='imageUploadForm']/div[1]/div[2]/div/span/div/div[1]/span/div")

// tap on a button which opens a system window
 image_upload.click()

//trying to send path to a file which stored in my project
image_upload.send_keys(os.getcwd().replace("fixture", "") + "images/variant_1.png")

obviously, does not work. Also read smth about interaction with "input file", but didn't get how to apply.

Any ideas? Thanks in advance!




haproxy url based routing not forward

I have a little problem with my haproxy config. I would like that if the URL : http://myserver.com/style/ is called always redirects to another backend. Here it should be no matter what is called it should always be forwarded everything that concerns the folder /style/.

My config

frontend ft_web
 bind *:80
 default_backend bk_web
 acl url_style path_beg -i /style
 use_backend web_style if url_style
 reqadd X-Forwarded-Proto:\ http

backend bk_web
 server jenkins1 10.100.100.5:8080 check
 server jenkins2 10.100.100.6:8080 check backup

backend web_style
 server web1_stlye 10.0.0.5:80 check




Which Leaflet library or workaround to control toolbar size

I need to change styling of the toolbar like the size of the button to have a bigger touch area for mobile (draw toolbar and other controls).

I already tried to change the size to 48px for width and height of toolbar button using css.

Current css :

/*
  ##Device = Mobile, Tablet
*/
@media (max-width: 1024px) {
    .leaflet-top a, .leaflet-bottom a, .leaflet-left a, .leaflet-right a {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
        line-height: 45px !important;
    }
}

When i change the size in the css way, the toolbar is not responsive anymore (leaflet-draw toolbar background should fit size)

It also glitch when you click on a toolbar button and it show the horizontal sub-toolbar (text is overlapping).

Is anyone know a plugin or a way to have a bigger touch area for mobile?




Is there any way to get firebase Auth UID without login?

What i want to know is without login get Auth User UID from firebase that already registered user

I already read firebase document but all the explain focus on when user logged only at that time can get UID...

but i just want to get UID and user email address without login situation Is there any way?




Change backgound color of input text after submit successfully

I want to change background of name and mail text input to yellow (default: white), content of button is "Sent". And deactivate the button. All of them are in a form. I write in JSP and want to change background by CSS.

<form action="/FashionBlog/ContactController" class="blockForm">
                    <!--display name and mail--> 
                    <div class="mainForm">
                        <div id="nameAndMail">
                            <div id="name">
                                <input id="myName" class="fontArial inputText" type="text" name="txtName" value="${name}" placeholder="Write name here"/>
                            </div>
                            &nbsp;&nbsp;
                            <div id="mail">
                                <input class="fontArial inputText" type="text" name="txtMail" value="${mail}" placeholder="Write mail here"/>
                            </div>
                        </div>
                        <!--display text are of message-->
                        <div id="meassageArea">
                            <textarea class="areaText fontArial" name="txtArea" placeholder="Write message here">${mess}</textarea>
                        </div>
                        <!--display button confirm send--> 
                        <div id="btnSend">
                            <input class="fontArial btnSendRadius" type="submit" value="Send - Click here"/>
                        </div>
                    </div>
                </form>




web assembly charconv file not found

I am building webassembly files from qt project . its qt 5.12.2 here https://www.qt.io/download and i am working on bash.Whenever i run my make file it give the following error charconv file not found. I seem to remove it complelety from code but it did not work. I am using em++ compiler not c++. I have my make file produced automatically by runing qmake .Please help.I am working on custom library that is using boost , arabica, zlib, libzip and xerces.




mercredi 26 juin 2019

Full stack Web Development

Full Stack web Development Guide https://www.crampete.com/resources/blogs/guide-to-full-stack-web-development/




Which Stack is good for FLASK Development?

I have start learning python for data science, meanwhile I also choose python for web development and initiating with Flask micro framework.

I dont have any prior experience with python, I am thinking that which stack is good for web development with Flask ? which framework should I choose for the frontend ? like Angular or React or any other ? Any suggestion will be really appreciated.....




Add student without avatar

I created a project where you can add a student with an avatar and without an avatar. The problem is that when I add a student without an avatar, there is still a tag. How can I remove the tag. Now I will add an image and a couple of classes. I kind of wrote everything correctly, I don’t know where the error might be

@Controller
public class AvatarController {

    @Value("${storage.location}")
    private String storageLocation;

    private StudentService studentService;

    @Autowired
    private ServletContext servletContext;

    // Constructor based Dependency Injection
    @Autowired
    public AvatarController(StudentService studentService) {
        this.studentService = studentService;
    }

    @GetMapping(value = "/avatar")
    public void getAvatar(HttpServletResponse response, @Param("avatar") String avatar) {
        if (avatar == null || avatar.isEmpty()) {
            return;
        }
        response.setContentType(MediaType.IMAGE_JPEG_VALUE);
        try (FileInputStream input = new FileInputStream(studentService.loadAvatarByFileName(avatar))){
            IOUtils.copy(input, response.getOutputStream());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @RequestMapping(value = "/image", method = RequestMethod.GET)
    public void image(@RequestParam String url, HttpServletResponse response) throws IOException {
        InputStream in = new FileInputStream(url);
        response.setContentType(MediaType.IMAGE_JPEG_VALUE);
        IOUtils.copy(in, response.getOutputStream());
    }
}

Image

enter image description here

Student Service Impl

@Service
@Transactional
public class StudentServiceImpl implements StudentService {

    @Value("${storage.location}")

    private String storageLocation;

    private StudentRepository repository;

    public StudentServiceImpl() {

    }

    @Autowired
    public StudentServiceImpl(StudentRepository repository) {
        super();
        this.repository = repository;
    }

    @Override
    public List<Student> getAllStudents() {
        List<Student> list = new ArrayList<Student>();
        repository.findAll().forEach(e -> list.add(e));
        return list;
    }

    @Override
    public Student getStudentById(Long id) {
        Student student = repository.findById(id).get();
        return student;
    }

    @Override
    public boolean saveStudent(Student student) {
        try {
            repository.save(student);
            return true;
        } catch (Exception ex) {
            return false;
        }
    }

    @Override
    public boolean deleteStudentById(Long id) {
        try {
            repository.deleteById(id);
            return true;
        } catch (Exception ex) {
            return false;
        }

    }

    @Override

    public File loadAvatarByFileName(String filename) {

        return new File(storageLocation + "/" + filename);

    }

    @Override

    public File saveAvatarImage(MultipartFile avatarImage) throws IOException {

        File newFile = File.createTempFile(
                avatarImage.getName(),
                "." + avatarImage.getOriginalFilename().split("\\.")[1],
                new File(storageLocation));

        avatarImage.transferTo(newFile);

        return newFile;

    }

    @Override
    public Student updateStudent(String name, String surname, MultipartFile avatar, Student targetStudent)
            throws IOException {

        if (name != null && !name.equals(targetStudent.getName())) {

            targetStudent.setName(name);

        }

        if (surname != null && !surname.equals(targetStudent.getSurname())) {

            targetStudent.setSurname(surname);

        }

        File newAvatar;
        if (!avatar.getOriginalFilename().isEmpty()) {
            if (targetStudent.getAvatar() != null) {
                Files.deleteIfExists(Paths.get(storageLocation + File.separator + targetStudent.getAvatar()));
            }
            newAvatar = saveAvatarImage(avatar);
            assert newAvatar != null;
            targetStudent.setAvatar(newAvatar.getName());
        }

        boolean isSaved = saveStudent(targetStudent);

        if (!isSaved) {

            throw new IOException();

        }

        return targetStudent;

    }

}

Student Controller

@Controller
public class StudentController {

    @Autowired
    private ServletContext servletContext;

    // Constructor based Dependency Injection
    private StudentService studentService;

    public StudentController() {

    }

    @Autowired
    public StudentController(StudentService studentService) {
        this.studentService = studentService;
    }

    @RequestMapping(value = "/allStudents",  method = {RequestMethod.GET, RequestMethod.POST})

    public ModelAndView displayAllUser() {
        System.out.println("User Page Requested : All Students");
        ModelAndView mv = new ModelAndView();
        List<Student> studentList = studentService.getAllStudents();
        mv.addObject("studentList", studentList);
        mv.setViewName("allStudents");
        return mv;
    }

     @Secured("ROLE_ADMIN")
    @RequestMapping(value = "/allStudentsAdmin",  method = {RequestMethod.GET, RequestMethod.POST})

    public ModelAndView displayAllUsers() {
        System.out.println("User Page Requested : All Students");
        ModelAndView mv = new ModelAndView();
        List<Student> studentList = studentService.getAllStudents();
        mv.addObject("studentList", studentList);
        mv.setViewName("allStudentsUser");
        return mv;
    }



    @Secured("ROLE_USER")
    @RequestMapping(value = "/allStudentsUser",  method = {RequestMethod.GET, RequestMethod.POST})

    public ModelAndView displayAllUsers() {
        System.out.println("User Page Requested : All Students");
        ModelAndView mv = new ModelAndView();
        List<Student> studentList = studentService.getAllStudents();
        mv.addObject("studentList", studentList);
        mv.setViewName("allStudentsUser");
        return mv;
    }



    @RequestMapping(value = "/addStudent", method = RequestMethod.GET)
    public ModelAndView displayNewUserForm() {
        ModelAndView mv = new ModelAndView("addStudent");
        mv.addObject("headerMessage", "Add Student Details");
        mv.addObject("student", new Student());
        return mv;
    }

    @PostMapping(value = "/addStudent")
    public String saveNewStudent(@RequestParam("name") @NonNull String name,
            @RequestParam("surname") @NonNull String surname,
            @RequestParam("avatar") MultipartFile file)
            throws IOException {

        Student student = new Student();
        student.setSurname(surname);
        student.setName(name);

        if (file != null && !file.isEmpty()) {
            student.setAvatar(studentService.saveAvatarImage(file).getName());
        }

        studentService.saveStudent(student);
        return "redirect:/allStudents";
    }

    @GetMapping(value = "/editStudent/{id}")
    public ModelAndView displayEditUserForm(@PathVariable Long id) {
        ModelAndView mv = new ModelAndView("editStudent");
        Student student = studentService.getStudentById(id);
        mv.addObject("headerMessage", "Редактирование студента");
        mv.addObject("student", student);
        return mv;
    }

    @PostMapping(value = "/editStudent")
    public String saveEditedUser(
            @RequestParam("id") Long id,
            @RequestParam("name") String name,
            @RequestParam("surname") String surname,
            @RequestParam("avatar") MultipartFile file) {

        try {

            studentService.updateStudent(name, surname, file, studentService.getStudentById(id));

        } catch (FileSystemException ex) {
            ex.printStackTrace();
        } catch (IOException e) {
            return "redirect:/error";
        }

        return "redirect:/allStudents";
    }

    @GetMapping(value = "/deleteStudent/{id}")
    public ModelAndView deleteUserById(@PathVariable Long id) {
        studentService.deleteStudentById(id);
        ModelAndView mv = new ModelAndView("redirect:/allStudents");

        return mv;

    }

}




is there any way to use buttons for opening and closing with specific time period

I am going to develop cinema ticketing software I use QR code on tickets for authentication. now i wanna scan tickets only for current show for example show time 11 to 12, 1, 2 and 3 to 4. just current shows tickets should be scanned before and after 15 minutes. how can I achieve this using c# asp. net web forms




Integrate dialogflow with website widget ui

I want to integrate the dialogflow bot I made to a website and change the logo and make it show up when a button is clicked and stay floating I tried looking the source code of the webdemo and copy pasted it to my website and edited the img src but didnt work any solutions?




lightning-formatted-date-time - showing previous date (LWC)

I am using the tag "lightning-formatted-date-time" in my lightning web components with the value "2019-06-02" but it is displaying the previous date.

I am not getting if the value is not a valid one for the tag. Please suggest.

Here is the playground code.

https://developer.salesforce.com/docs/component-library/tools/playground/nLT72mjyV/1/edit

Thank you.

https://developer.salesforce.com/docs/component-library/tools/playground/nLT72mjyV/1/edit

Jun 02, 19




Not able to style nested animations with keyframes with styled-components

I am creating the animation for an Image with a customized animation in styled-component with conditional styling. But it gives me the error saying that "Uncaught Error: It seems you are interpolating a keyframe declaration (bZfjDs) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css`` helper (see https://www.styled-components.com/docs/api#css), which ensures the styles are injected correctly." I did it with the v4 syntax but it still does not work. Is there a way to do it?

I've tried follow the syntax but it still won't work.

First I did:

animation: ${props => (props.animating === 'true' ? `${fadeInSlide} 1s ease-in-out infinite forwards` : '')} ;

where fadeInSlide is my own keyframes, then I tried doing:

const fadeInAnimation = css`
    animation: ${fadeInSlide} 1s ease-in-out infinite forwards;
  `
const BlockImage = styled(Image)`
  animation: ${props => (props.animated === 'true' ? `${fadeInAnimation}` : '')} ;
`

but this also gives me the error.




I'm having trouble with using .htpasswd

I have project with admin panel. Admin panel folder in the main file directory. localhost/mywebsite/adminpanel

this morning when I was coding, I encrypted the admin panel file with .htpasswd and .htacces file but then I noticed that htaccess also asked for a password in my home directory. After looking for a while I understood the problem. The reason is the include functions that I use in the PHP files in the main directory.

The include functions in my main directory referring to php files in the admin panel folder.

I want .htaccess password auth to work only in the admin panel, not in my home directory. How can I solve this problem?




Having trouble trying to make an circle move on a canvas element, while programming with JS compiled Kotlin

I am building a very simple web-based 'breakout', and I have run into trouble when trying to make the ball move on the canvas element. I do have the game up and running in javascript. Thing is, I am now trying to port it to Kotlin(javascript compiled). Even after doing the adaptations I think were necessary, the ball won't move.

I am also having trouble with types(thats why you will see those "*1.0" lying around), since I've not been able to convert from int to double, but I wouldn't say that's the issue here. Also, the IDE is showing a remark I am not familiar with. I talk about that on the section about error messages, but the message is as follows: "Wrapped into a reference object to be modified when captured in a closure".

I am not sure where exactly the problem lies, but so far I have tried: -Other signatures for my 'setInterval' call -Reformating the program so that my code is within main(), as to get rid of the return and 'val canvas = initializeCanvas()' call.

import org.w3c.dom.*
import kotlin.browser.*
import kotlin.math.*


val canvas = initializeCanvas()
fun initializeCanvas(): HTMLCanvasElement {
    val canvas = document.createElement("canvas") as HTMLCanvasElement
    val ctx = canvas.getContext("2d") as CanvasRenderingContext2D
    ctx.canvas.width = 480
    ctx.canvas.height = 320
    document.body!!.appendChild(canvas)
    var x = canvas.width/2
    var y = canvas.height-30
    val dx = 2
    val dy = -2
    fun drawBall(){
        ctx.beginPath()
        ctx.arc(x*1.0, y*1.0, 10.0, 0.0, PI*2)
        ctx.fillStyle = "#000000"
        ctx.fill()
        ctx.closePath()
    }
    fun draw(){
        ctx.clearRect(0.0, 0.0, canvas.width*1.0, canvas.height*1.0)
        drawBall()
        x += dx
        y += dy
    }
    window.setInterval(draw(),10)
    return canvas
}

The expected output would be that of the ball moving towards the top-right of the canvas, and then vanishing into the wall, since I have not yet implemented collisions.

The current output, as I stated, is of a static ball.

As for error messages, there are none. But an "IDE Note" has been bothering me. on the code I provided, inside the draw function, I increment x and y. When I hover over them, intellij says that they are "Wrapped into a reference object to be modified when captured in a closure". I have never seen such warning before and a web search has not been fruitful.




Is there a drupal 8 module that allows you to manage application constants/flags to turn features on/off

Is there a drupal 8 module that lets you manage application constants/flags to turn features on/off?




Website loading time (5.22s) only on root

If I access my current test-project on root (http://la-tickets.eu/) the loading time takes 5.22s. If I access any subsite (http://la-tickets.eu/login), which refers to the very same files (since there is a htaccess "FallbackResource /index.php") the load time is okay.

I already tried to remove all Javascripts, and analyzed the site with firefox developer tools and chrome developer tools


  <div class="container-fluid">
          <?php
                $path = explode('/', ltrim($_SERVER['REQUEST_URI'], '/'));
            if(empty($path[0])) {                       // No path elements means home
                 Print ("home");
                     include ("inc/login.inc.php");
             } else switch(array_shift($path))             // Pop off first item and switch
            {
                     case 'login':
                            include ("inc/login.inc.php");
                            break;
                      default:
                        break;
        }
          ?>
          <div id="server-results"><!-- For server results --></div>
</div>

´´´




Can I get my visual basic project to interact with my website on a server

I am trying to get my visual basic project to bring up the web browser component. This will bring you to a website where you will put in a password and then if the password is correct the website will tell my visual basic project to go ahead to the page.

I am trying to use this as verification for my users. I hope this is possible and if so could you please provide some code.




Only sort pairs in array

I have an array of objects, like this for example:

  const arr = [
  {
    type: 2,
    name: 'A',
  },
  {
    type: 1, 
    name: 'B'},
  {
    type: 2, 
    name: 'C'},
  {
    type: 1,
    name: 'D',
  },
];

Now what you don't see is, there are pairs of objects. So "A" and "B" belong together. Now I want to sort this array, so in the end it becomes this:

const result = [
  {
    type: 1,
    name: 'B',
  },
  {
    type: 2, 
    name: 'A'},
  {
    type: 1, 
    name: 'D'},
  {
    type: 2,
    name: 'C',
  },
];

So basically I only want to sort the pairs.

I tried using the indexes like here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Sorting_with_map

And basically just use the modulo operator for the index of the current value, but I fear the sort mechanism works a bit differently.




what is the web 1,2,3 and what are the difference between these?

I have recently heard that in the web-technology there are three types of web are that are web 1,2,3 so i am not know that what is difference between these three.




How do ETags in the HTTP header actually work?

I don't know if I am not correctly understanding how the caching aspect of ETags work if there is some other issue I am dealing with, but I'll walk you through my situation.

From my understanding ETags are a unique hash that is created based on the file information and they are sent as part of Response header to uniquely identify the file. If the file is updated then the info is changed and hence the ETag for the file is also changed.

In my project, I need a fresh JS file to be fetched everytime I make changes to the file. I can't use version tags or unique hashes as part of the file name. I thought an ETag would work where

                 Http Request 
                 GET myFile.js
        Client ------------------> SERVER
                 Http Response 200
                 Http Response Header
                      accept-ranges: bytes
                      cache-control: max-age=86400, public
                      etag: "a7-58c3bb52101c4"
                      ......

                     myFile.js
        Client <------------------ SERVER


        // myFile.js has not been changed

                 Http Request 
                 GET myFile.js
        Client ------------------> SERVER
                 Http Response 304
                 Http Response Header
                      accept-ranges: bytes
                      cache-control: max-age=86400, public
                      etag: "a7-58c3bb52101c4"
                      ......
        Client uses cached version of file

        // myFile has been changed

                 Http Request 
                 GET myFile.js
        Client ------------------> SERVER
                 Http Response 200
                 Http Response Header
                      accept-ranges: bytes
                      cache-control: max-age=86400, public
                      etag: "88-58c3a1cb8474f" // new etag generated
                      ......

                     myFile.js
        Client <------------------ SERVER

So, if you request the file again and no changes have been made..the etag will remain the same and you'll get a 304 will indicate that the cached version should be used.

If the file has been changed the etag will be different as well and a fresh copy of the file will be sent by the server.

This is how I expected it to work.

MY PROBLEM: When I update myFile.js it seems like I never get the new ETag has back. It just defaults to the cahced version of the file. If I clear the cache then I get the latest file and the new ETag. This to me seems to defeat the purpose. Is this how it works or am I understanding something incorrectly here?




web console for pods in kubernetes

I want to create a dashboard for kubernetes by python. My user want to see their container in dashboard and run command in it. so I want to give them a web console to their pods. I see that some cloud provider name this as web ssh. The question is What should I do?




Absolute Path redirection using .htaccess when shifting from one shared Linux cpanel web hosting to another

Absolute Path redirection using .htaccess when shifting from one shared Linux cpanel web hosting to another

I have shifted my hosting from one hosting to another. I am attempting to redirect the absolute path of old server with the absolute of new one.

There are many includes in the script, which calls for a php or html file using include(" ");. Example: /home/cpanel-username/public_html/domainname.com/templates/default/filename.php

I am trying to redirect files such as the above with the new server absolute path. Example: /home2/new-cpanel-username/public_html/same-domainname.com/templates/default/same-filename.php.

I have made an attenmpt as below.

RewriteEngine On RewriteCond %{REQUEST_URI} ^/home/username/public_html/domainname.com/templates/default/ RewriteRule ^(.*)/.php /home2/new-server-username/public_html/same-domainname.com/templates/default/$2 [L,R=301]

The above redirect is for .php file. There are so many other such files with extensions .php and .html. Hence, I am unable to change the old absolute path with new one individually through notepad edit.

The above code is not working. Any help?




How to put Flask web site online?

I have simple system in Flask+HTML. For now it is only available on local network, but I want to put online on web to be able to access from any computer.

The problem is that there is a lot of data (+20GB), so I cant just put it to some hosting. I was thinking to get domain name and put whole machine online. Is this possible?




Can someone help me in how to fix issue of disabling "eyelash/views" icon from my featured posts on my website www.startfurnishing.com?

I have a website www.startfurnishing.com A freelancer designed the website for me. Now, the problem is he is not reachable. There is a date icon and pafe view icon on every featured post of my website.

Can someone help me in how to disable "eyelash/views" icon from my featured posts on my website www.startfurnishing.com?

I checked the sourcecode and the class is "Total-views". But I don't know where to disable it in wordpress. Not sure, where to put the "Display:None" CSS code in wordpress.

Thanks!

Top Home furnishing eCommerce websites of India Byadminon June 25, 2019June 26, 2019 59

                                </div>




What is the fastest way to do http requests in Python

I am trying to build a web application fuzzer. It will take a wordlist and a url from the user and will do request to those urls. At the end, It will give output according to their responses' status codes.

I have written some code, it does ~600req/s in local (takes about 8 seconds to finish 4600 lines of wordlist) but since I'm using requests library I was thinking if there is a faster way to do so.

Only time consuming part as I analyzed is fuzz() and req() functions as they are doing the most job. I have also other functions but those that I've shown must be enough for you to understand (I didn't want to put so much code).

def __init__(self):
    self.statusCodes = [200, 204, 301, 302, 307, 403]
    self.session = requests.Session()
    self.headers = {
        'User-Agent': 'x',
        'Connection': 'Closed'
        }

def req(self, URL):
# request to only one url
    try:
        r = self.session.head(URL, allow_redirects=False, headers=self.headers, timeout=3)
        if r.status_code in self.statusCodes:
            if r.status_code == 301:
                self.directories.append(URL)
                self.warning("301", URL)
                return
            self.success(r.status_code, URL)
            return
        return
    except requests.exceptions.ConnectTimeout:
        return
    except requests.exceptions.ConnectionError:
        self.error("Connection error")
        sys.exit(1)

def fuzz(self):
    pool = ThreadPool(self.threads)
    pool.map(self.req, self.URLList)
    pool.close()
    pool.join()
    return

#self.threads is number of threads
#self.URLList is a list of full urls 




How to change a live Laravel site?

I have to work on a Laravel site someone made but I've never worked with Larvel. I've done some research and as far as I gather it works on a MVC system. We have our own servers/domain and I need to make some changes to the site.

How can I access the Views/Models of the site? What applications do I need to make changes if any?(other than normal editors like vs,atom,ect)

I tried connect via remote editor with Atom but can't seem to find the actual site files and views to change them

Do i need to make the changes with Larvel

edit: I've found the views under a storage folder but the naming for the folders seems to be randomized letters/numbers. Can I edit from here?




Is the font end considered as a software?

someone told me that the front end is not software ? is that right ? how do we tell that something is software ? I think that its a software ? I need to know what is software and what is not ?




Trouble making dropdown buttons within navbar clickable in react

I managed to make the buttons activate a dropdown menus that disappear when you click off, but the problem is that when you click any button, all of the dropdowns appear. It seems that when I try to set the state of one button, it sets the state of all buttons. I want the state of each button to have a displayMenu variable that is either true or false. When a button is clicked, it should change its displayMenu state to true, and false when clicked off. What am I doing wrong here?

import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import './NavBar.css'; 
import './Body.css'
class NavBar extends Component {
  state = {
    displayMenu: false 
  }

  showDM = () => {
    const displayMenu = true;
    this.setState({ displayMenu }, () => {
      document.addEventListener('click', this.hideDM);
      //document.getElementById("ddc").classList.toggle('show');
    });
  }

  hideDM = (ev) => {
    this.setState({ displayMenu: false }, () => {
      document.removeEventListener('click', this.hideDM)
      //document.getElementsByClassName("dropdown-content").classList.remove('show');

    });
  }

  render() {
    return (
      <header>
        <div className="navbar">
          <div className="dropdown">
            <button onClick={this.showDM} className="dropbtn">About 
              <i className="fa fa-caret-down"></i>
            </button>
            { this.state.displayMenu ? ( 
            <div className="dropdown-content" id="ddc">
              <a href="#mission"><Link to="/mission">Mission</Link></a>
              <a href="#history"><Link to="/history">History</Link></a>
              <a href="#alumni"><Link to="/alumni">Alumni</Link></a>
            </div>
            ):
            ( 
              null 
            )
            }
          </div>
          <div className="dropdown">
            <button onClick={this.showDM} className="dropbtn">Academics 
              <i className="fa fa-caret-down"></i>
            </button>
            { this.state.displayMenu ? (
            <div className="dropdown-content" id="ddc">


              <a href="#curriculum"><Link to="/curriculum">Our Curriculum</Link></a>
              <a href="#study-abroad"><Link to="/study-abroad">Study Abroad</Link></a>
            </div>
            ):
            ( 
              null 
            )
            }
          </div> 

}
export default NavBar;




How to open messenger lite on mobile from web Page

I am trying to set a button to go back in messenger lite app from a web page on click.

it works fine for messenger simply using a window.open with fb-messenger for messenger, but I tried to use some syntax such as fb-messenger-lite for messenger lite and it still going to messenger. If the app wasn't installed, it redirected me to messenger store page...

this is the simple code onclick that is working properly:

window.open("fb-messenger://user-thread/...");




mardi 25 juin 2019

Adding a non rectangular header with a image over the background

I designed a website on Photoshop and I would like to implement it using BOOTSTRAP. When I use other methods, I found that not half of the hoodie will have the backdrop, but all of the hoodie will have the same background. Anyone know how I could go about doing this?https://i.stack.imgur.com/708Bt.png




How to add download speed indicator to web

I want to add to my website an indication about download speed (of the clinet), I want to know how you would recommend me to do it.

thanks.




is onload or onerror called after or before xmlhttprequest.abort() call

If i call abort do onload or onerror called

I am using need to update data base after abort I am already updating it after onload or onerror so I need to know I I also have to update it after abort




How to convert coded website to web builder?

I am currently coding a website using ASP.NET and react. How can I convert this coded web application to a web builder or a CMS so that other users who can not code can easily do things like dropping images or changing text? I have not been able to find any services that do tit currently.

I have contacted different web builders like wix, word press etc.

render() { return ( {this.props.children} ); }

Not sure




How to call a function before and after a function is called in django?

I have to check number of calls user has made to an function. I need to know what can be used i.e. Signal calls or logging.




NanoHTTPD to process one concurrent request only

I want NanoHTTPD to process one request at a time. Is there a way to achieve it?

All other requests made at the same time should either wait or be dropped.

Here's my NanoHTTPD server:

    package com.example;
    import java.io.IOException;
    import org.nanohttpd.NanoHTTPD;
    import java.util.concurrent.TimeUnit;

    public class App extends NanoHTTPD {

        public App() throws IOException {
            super(8080);
            start(NanoHTTPD.SOCKET_READ_TIMEOUT, false);
            System.out.println("Running!");
        }

        public static void main(String[] args) {
            try {
                new App();
            } catch (IOException ioe) {
                System.err.println("Couldn't start server:\n" + ioe);
            }
        }

        @Override
        public Response serve(IHTTPSession session) {
            try {
               TimeUnit.SECONDS.sleep(2);
            } catch (InterruptedException e) {}

            String msg = "<html><body>Hello server</body></html>";
            return newFixedLengthResponse(msg);
        }
    }




can I connect applications from a website

Please answer the question I started to do applications. And whether it is possible to put it on the website.To be used by several users. This write in javaFX




On a website, is it possible to fill in fields of a form on another domain that doesn't use query string parameters?

I have a website that links to a donation form on another domain's website. Is there any possible way to fill in some of the fields of that form when the page loads on the other domain? (The other domain's website doesn't use query string parameters.)

I'm open to any suggestions using any kind of web frameworks and technologies to try to hack this together. E.g. loading the donation website's form in an iframe, or cookie manipulation (though I'm pretty sure there's no path of success here since security features prevent anything applicable), or recreating the form on my website and targeting the same submission action that's on the donation website's form.




unrecognised browser login functionality implmentation

What is the best way to implement "unrecognised browser login" feature in web application if a particular user login from different browsers without tracking the IP address of the user.

Is there any client or server side plugin plugin already available to do this.




Place an image above a navigation bar

The image is placed beside the navigation bar to the left, not above the navigation bar.

I have tried all other answers on this site

  .topnav {
    overflow: hidden;
    background-color: #00003f;
}
.topnav a {
    float: left;
    font-size: 1em;
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: 14px;
    text-decoration: underline;
}
.topnav a:hover, .dropbtn, .dropdown:hover {
    background-color: #3f61a1;
    text-decoration: underline;
}
.topnav a.active {
    background-color: #3f61a1;
    color: #fff;
}

<img src="images/ERAU_WW_0809.png" alt="Flying Fixed Wing drone" style="display: block; float: left; padding-right: 10px; padding-bottom: 10px"; width="400" title="Flying Fixed Wing drone"/>
    <nav class="topnav">
        <a class="active" href="index.html" title="x"> Computer Information &amp; Download Versions </a>
        <a href="FAQ's.html" title="x"> FAQ </a>
        <a href="faq.html" title="x"> Hub Resources</a>
        <a href="table.html" title="x"> Technical Assistance &amp; Contact Information</a>
    </nav>

I want the image to be placed above the navigation bar, not beside it.




VBA to enter one cell into a webpage, then enter another

I have a list of numbers to put into a webpage. I want to enter the first value (cell A3) then enter A4 and so on. The VBA code I currently have logs a user onto the website, clicks initiate request, enters the first cell, presses submit, copy/paste the data back into excel, then returns to the first page. I want to make my code so that it does this process (clicks initiate, enters the number, presses submit,copy/paste,) again and again for however many numbers are in the column. How do I accomplish this?

I currently am able to log on , click the buttons, enter the first value (cell A3), click submit etc. When I return to the first page with this code, excel just stops. It doesnt enter the next number on the list.

Set IE = CreateObject("InternetExplorer.application")
    IE.Visible = True
    IE.Navigate ("http://URL.com")


   With IE
    Do
    If IE.readystate = 4 Then
            Exit Do
        Else
            DoEvents
        End If
    Loop

     'Enters username and password , submits with continue button
    With .document.forms("signning")
             .UserName.Value = "userr"
             .Password.Value = "password"
        .document.forms(0).submit

    End With


With .document

        t = Timer
        Do
            On Error Resume Next
            Set elems = .document.queryselectorall("input[value=InitiateRequest]")
            On Error GoTo 0
            If Timer - t > MAXWAIT_sec Then Exit Do
        Loop While elems Is Nothing
            If Not elems Is Nothing Then
             elems.Item.Click
            Else
            End If

    lastrow = ws.Cells(ws.rows.Count, "A").End(xlUp).Row


    For i = 3 To lastrow
        Set svalue1 = .getElementbyID("accountNumber")
            svalue1.Value = ws.Cells(i, 1).Value
            i = i + 1

        For Each eInput In .getElementsbyTagName("input")
                If eInput.getAttribute("value") = "Submit Request" Then
                    eInput.Click

        Exit For

                End If
        Next eInput

             IE.Visible = True

Then I copy and paste the info (this works correctly) and I protect the sheet. Then I navigate back to the start where I want to click initate request again. IE.Navigate ("https://URL.com")

    Exit For

Next i

    End With

 End With




Need to interview a Professional

I'm doing my assignment for my ENC 3249 couse which require me to interview at least 2 people from the tech field. I'm looking to interviewing a software developer and a web designer. If anyone know someone I can interview or you can give an interview. Please contact me.




How to get value of ON/OFF switch

I have On/Off switcher in my web project :

HTML:

<div  class="onoffswitch">
   <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" 
    id="myonoffswitch" checked>
   <label class="onoffswitch-label" for="myonoffswitch">
     <span #onoffswitch class="onoffswitch-inner"></span>
     <span class="onoffswitch-switch"></span>
   </label>
</div>

CSS:

.onoffswitch-inner:before {
    content: "ON";
    padding-left: 10px;
    background-color: #93297E; color: #FFFFFF;
}

.onoffswitch-inner:after {
    content: "OFF";
    padding-right: 10px;
    background-color: #EEEEEE; color: #999999;
    text-align: right;
}

I want to know if the switcher is turned ON or OFF, I tried to get the value, using the next code, but it does not work:

getSwitcherValue(onoffswitch) {
   console.log("onoffswitch:"+onoffswitch.style.content);
}

Do you have any ideas how to get the value of on/off switcher?




Performance and Architectural comparison of nodejs and chrome extention

I have to perform a task on web sites checkout page, one way is to create a chrome-extension, user will install it and at checkout page extension will work and send the data to our server , other way is to create our own boot through puppeteer to perform those operations on our separate server. I need some guidance from seniors on which methodology should i work by means theoretically and practically strong prospective.Thanks




Java Web crawler and scrapper

My intention is to read cost details of a product from various websites , so that i can display cost comparison details in a html page of my Spring application. Can anyone suggest me on how to do it . is there any technologies to achieve this ? so that i can always read the updated data from other websites and display it in my Spring application. I saw some Web scrapper tools as a Chrome extension but it generates an Excel workbook. how could i use it in my Spring application and display it in HTML page ?




Need to implement Encryption and decryption on web.config without using connection string

I need to implement encryption and decryption in .net Web config file

I have tried connection string by using following commands aspnet_regiis.exe -pef " path" . But i need to implement with out connection strings parameters and encryption/decryption of full web config file in .net application




Cannot send variable name from one node module to another to use it as a room-name for chat application using socket.io

I am able to get the room name from user but as I use module.exports in another file to retrieve it shows undefined . This might be because it is asynchronous.

//roomcheck.js

var nsp = io.of("/gameroom");
nsp.on('connection', (socket) => {
socket.on('check', (data) => {
    if (rm.includes(data)) {
        roomname = data;
        console.log(roomname);
        console.log("Room exist!!!");
        socket.emit('success', 'room already made');

});

        module.exports=roomname;

//userpage.js

var r=require('roomcheck.js');
console.log(r.roomname);

expected- my output- undefined




Create a online tutor platform like Chegg Tutors

I am building an online tutoring platform like Chegg Tutors / Tutor.com. The platform is a two-sided marketplace with Tutors on Supplier side and Students on customer side.

I need help with figuring out which technology to be used to build this web application.

The basic capabilities that I need on the website are as follows:

  1. Register students and tutors by allowing them to make user accounts.

  2. Enable tutors to list their subjects and allow the students to filter out the tutors based on the subjects and sort the tutors based on ratings, lessons, etc.

  3. Allow the students to post their queries and notify the tutors when a student posts an opportunity.

  4. Enable live lesson through audio/video/text and passive lessons wherein tutors submit the answers to assignment queries.

  5. Integrate with payment providers like Paypal and credit cards to facilitate payments.

Do we have some pre-existing plug-ins which can be directly used to perform the mentioned tasks. Any suggestions wull be highly appreciated. Thanks!




lundi 24 juin 2019

Is it possible to read bar code on medicine product and can I get bar code read or scan event in php laravel web application?

I have to develop bar code functionality like POS system in php laravel web application.

I have generated bar code and printed on medicine product in medicine store. When ever I read bar code through bar code reader or scanner machine. Can I get bar code reader event in my laravel php web application?

My web application is open in browser. It is not a desktop application.

I have created bar code and tried to read it via bar code scanner.




Can the current web UI and mobile UI be generated directly by drag and drop using tools?

I am a Java programmer, very interested in Angular and JHipster, but not familiar with CSS and Html. I hope to find some UI generation tools based on angular. At the same time, I hope everyone can give some suggestions and references. Thanks!




Mobile environment on your desktop computer/PC

I was wondering if anybody knew of any sort of desktop computer software's that allow you to upload your website using your desktop computer and view what it would look like on numerous other platforms, such as iPhone, iPad, etc.




I'm making this working "tuner laptop" as an example for a friend but Im struggling with onclick functions

EDIT: If there is a better way of me producing this code for you please let me know.

I'm making this working "tuner laptop" as an example for a friend but I'm struggling with click functions. I've partially found code from various places and brought it all together in this final format.

I'm fairly amateur at coding but I've managed to get this far. The only thing I'm struggling with is where and what I need to put into the JS to make the text animation start upon clicking the "save" button.

As you can see, the text animation starts immediately when the html is loaded. I want people to open the laptop, select their desired performance and then click "save". Once they've clicked save, the settings are applied and the text animation begins. The text doesn't actually do anything, it's merely for example/immersion.

I've also noticed that for some reason the buttons still have a green border when I click them and go fully green when I right-click them. I'm fairly new to bootstrap so if you could help with editing that as well, that would be great.

The actual actions/functions for this laptop are coded in .lua which is why it might just seem like a useless object to you guys.

The code is as follows:

index.html:

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
        <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js" crossorigin="anonymous"></script>
        <link rel="stylesheet" type="text/css" href="index.css">
        <link href = "https://code.jquery.com/ui/1.10.4/themes/ui-darkness/jquery-ui.css" rel = "stylesheet">
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
        <link rel="stylesheet" type="text/css" href="custom.css">
        <link rel="stylesheet" type="text/css" href="textanim.css">
    </head>

    <body>
        <div class="background">
        <div class="container monitor">
            <div class="program">
                <div class="fixed-top position-relative program-top-bar">
                    <div class="row">
                        <div class="col"><span id="appName">London Motors</span></div>
                        <div class="col text-right"><i class="fa fa-sm fa-window-minimize" id="minimizeProgram"></i> <i class="fa fa-sm fa-window-maximize"></i> <i class="fa fa-sm fa-times-circle" id="exitProgram"></i></div>
                    </div>
                </div>
                <div class="container">
                    <div class="row">
                        <div class="col col-lg-6">
                            <p>Boost Pressure <small class="text-muted">(STANDARD-HIGH)</small></p>
                            <div class="slider" id="boost"></div><br>
                            <p>Fuel Mixture <small class="text-muted">(LEAN-RICH)</small></p>
                            <div class="slider" id="fuelmix"></div><br>
                            <p>Transmission Speed <small class="text-muted">(STANDARD-FAST)</small></p>
                            <div class="slider" id="gearchange"></div><br>
                            <p>Brake Force Allocation <small class="text-muted">(REAR-FRONT)</small></p>
                            <div class="slider" id="braking"></div><br>
                            <p>Drive Train <small class="text-muted">(REAR-FRONT)</small></p>
                            <div class="slider" id="drivetrain"></div>
                        </div>
                        <div class="col col-lg-6">
                            <p>ABS Strength <small class="text-muted">(WEAK-STRONG)</small></p>
                            <div class="slider" id="brakeforce"></div>
                        </div>
                 <div class="ecutext-container">
                    <pre id="typewriter">
 <span class="var-highlight">Init</span> lmECU.exe = {
<span class="string">--------------------------------</span>
 lmECU:\ <span class="string">validating engineer key</span>
 lmECU:\ <span class="string">validation success</span>
 lmECU:\ <span class="string">accessing sensors</span>
 lmECU:\ <span class="string">parsing senslog.xml</span>
 lmECU-senslog:\ <span class="string-highlight">running diagnostics</span>
         <span class="string-highlight">- {0 faults detected</span>
 lmECU:\ <span class="string">applying Modifications...</span>
 lmECU:\ <span class="string">generating senslog.xml</span>
 lmECU:\ <span class="string">parsing senslog.xml</span>
 lmECU-senslog:\ <span class="string-highlight">running diagnostics</span>
         <span class="string-highlight">- {0 faults detected</span>
 lmECU:\  <span class="string">ECU remap successful</span>
 lmECU:\  <span class="string">end lmECU.exe</span>
                    <br></br>
                    </pre>
                </div>
                    <div class="savebtn">
                       <div class="colbtns"><button class="btn btn-success form-control" id="savebtn">SAVE</button></div>
                       <input id="clickMe" type="button" value="clickme" onclick="doFunction(setupTypewriter());" />
                   </div>
                       <div class="colbtnd"><button class="btn btn-success form-control" id="defaultbtn">DEFAULT</button></div>
                </div>
            </div>
    </div>
        <script src="config.js"></script>
        <script src="index.js"></script>
        <script src="textanim.js"></script>
    </body>
</html>

index.css:

.monitor {
    display:block;
    background-image: url("https://doc-08-9s-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/6rfloh5t77j7vobuhjfr7pr8ou0ju1ou/1561413600000/03452464485581425039/*/1qA3_b6NWsHIm5FJtp1vtMhEEmOgNXbz6");
    background-size: 100%;
    background-repeat: no-repeat;
    position: absolute;
    margin-top: 5%;
    height:700px;
    width:100%;
    padding:0 !important;
    z-index: 2;
}

.monitor-brand {
    display:block;
    position:fixed;
    text-align:center;
    height:100%;
    width:100%;
    top:81%;
    font-size:24px;
    font-weight: 700;
    font-family: "YaHei UI";
}

.program {
    display:block;
    position:relative;
    top: 71px;
    left: 165px;
    height: 440px;
    width: 803.5px;
    background-image: url("https://doc-04-9s-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/mc80aggjohrv54phak19aj4eq1a9lc18/1561413600000/03452464485581425039/*/1whCzPNt2E6REry7I0a0Xy6CU5G_mi4q7");
    background-repeat: no-repeat;
    background-size: 100%;
    overflow: hidden;
    padding-bottom:19px;
}

.program-top-bar {
    display:block;
    padding-left:310px;
    padding-right:10px;
    padding-top:3px;
    width:100%;
    height:40px;
    color:white;
    background-color: rgba(26, 117, 255, 0.8);
    background-image: linear-gradient(to bottom left, lightblue, #4d94ff)
    font-family: roboto;
    font-weight: 600;
    font-size: 20px;
}

.colbtns {
    left: 50px;
    bottom: 37.5px;
    position: relative;
    width: 140px;
    z-index: 3;
}

.colbtnd {
    left: 115px;
    bottom: 37px;
    position: relative;
    width: 140px;
    z-index: 3;
}

.ecutext-container {
    background-color: #000000;
    border-radius: .25rem;
    position: relative;
    height: 235px;
    width: 380px;
    left: 413px;
    bottom: 290px;
    z-index: 1;
}

custom.css (for overwriting bootstrap):

.col {
    color: #fff;
}

.text-muted {
    color: #fff!important;
}

.btn-success {
    color: #fff;
    background-color: #1a75ff;
    border-color: #1a75ff;
}

.btn-success:hover {
    color: #fff;
    background-color: #005ce6;
    border-color: #005ce6;
}

.btn-success:active {
    color: #fff;
    background-color: #005ce6;
    border-color: #005ce6;
}

.btn-success:focus {
    color: #fff;
    background-color: #005ce6;
    border-color: #005ce6;
}

.ui-widget-content {
    border: 1px solid;
    border-color: #fff;
    background-color: #1a75ff;
    background: none;
}

.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
    border: 1px solid #fff;
}

.slider {
    border: 1px solid;
    border-color: #fff;
    background-color: #fff;
}

#boost {
    color: #fff;
}

index.js:

function sliderUpdated(event,ui) {
}

function getSliderValues() {
    return {boost:$("#boost").slider("value"),fuelmix:$("#fuelmix").slider("value"),gearchange:$("#gearchange").slider("value"),braking:$("#braking").slider("value"),drivetrain:$("#drivetrain").slider("value"),brakeforce:$("#brakeforce").slider("value")};
}

function setSliderValues(values) {
    $(".slider").each(function(){
        if(values[this.id]!=null) {
            $(this).slider("value",values[this.id]);
        }
    });
    sliderUpdated();
}

function menuToggle(bool,send=false) {
    if(bool) {
        $("body").show();
        $(".monitor-brand").css("top",$(".monitor").offset().top+$(".monitor").height()*1.075);
    } 
    if(send){
        $.post('http://solrp_tuner/togglemenu', JSON.stringify({state:false}));
    }
}

$(function(){
    $(".monitor-brand").css("top",$(".monitor").offset().top+$(".monitor").height()*1.075);
    $("#monitorBrand").text(Config.monitorBrand);
    $("#appName").text(Config.appName);
    $("#boost").slider({min:0.1,value:0.25,step:0.01,max:0.75,change:sliderUpdated});
    $("#fuelmix").slider({min:1,value:1.3,step:0.01,max:2,change:sliderUpdated});
    $("#gearchange").slider({min:1,value:9,max:50,change:sliderUpdated});
    $("#braking").slider({value:0.5,max:1,step:0.05,change:sliderUpdated});
    $("#drivetrain").slider({value:0.5,max:1,step:0.05,change:sliderUpdated});
    $("#brakeforce").slider({value:1.4,max:2,step:0.05,change:sliderUpdated});
    $("#defaultbtn").click(function(){setSliderValues({boost:0.25,fuelmix:1.3,gearchange:9,braking:0.5,drivetrain:0.5,brakeforce:1.4});});
    $("#savebtn").click(function(){
        $.setupTypewriter();
        $.post('http://solrp_tuner/save', JSON.stringify(getSliderValues()));

    });
    $("#exitProgram").click(function(){
        menuToggle(false,true);
    });
    $("#shutDown").click(function(){
        menuToggle(false,true);
    });
    document.onkeyup = function (data) {
        if (data.which == 27) {
            menuToggle(false,true);
        }
    };
    window.addEventListener('message', function(event){
        if(event.data.type=="togglemenu") {
            menuToggle(event.data.state,false);
            if(event.data.data!=null) {
                setSliderValues(event.data.data);
            }
        }
    });
});

textanim.js:

function setupTypewriter(t) {
    var HTML = t.innerHTML;

    t.innerHTML = "";

    var cursorPosition = 0,
        tag = "",
        writingTag = false,
        tagOpen = false,
        typeSpeed = 1,
    tempTypeSpeed = 0;

    var type = function() {

        if (writingTag === true) {
            tag += HTML[cursorPosition];
        }

        if (HTML[cursorPosition] === "<") {
            tempTypeSpeed = 0;
            if (tagOpen) {
                tagOpen = false;
                writingTag = true;
            } else {
                tag = "";
                tagOpen = true;
                writingTag = true;
                tag += HTML[cursorPosition];
            }
        }
        if (!writingTag && tagOpen) {
            tag.innerHTML += HTML[cursorPosition];
        }
        if (!writingTag && !tagOpen) {
            if (HTML[cursorPosition] === " ") {
                tempTypeSpeed = 0;
            }
            else {
                tempTypeSpeed = (Math.random() * typeSpeed) + 0;
            }
            t.innerHTML += HTML[cursorPosition];
        }
        if (writingTag === true && HTML[cursorPosition] === ">") {
            tempTypeSpeed = (Math.random() * typeSpeed) + 0;
            writingTag = false;
            if (tagOpen) {
                var newSpan = document.createElement("span");
                t.appendChild(newSpan);
                newSpan.innerHTML = tag;
                tag = newSpan.firstChild;
            }
        }

        cursorPosition += 1;
        if (cursorPosition < HTML.length - 1) {
            setTimeout(type, tempTypeSpeed);
        }

    };

    return {
        type: type
    };
}

var typer = document.getElementById('typewriter');

typewriter = setupTypewriter(typewriter);

typewriter.type();

textanim.css:

.var-highlight{
    color: #008ae6;
}
.string-highlight{
    color: #008ae6;
}

#typewriter{
    padding-top: 5px;
    font-size: 10px;
    color: #fff;
    margin: 0;
    overflow: hidden;
    font-family: "Lucida Sans Typewriter", "Lucida Console", Monaco, "Bitstream Vera Sans Mono", monospace;

        &:after{
            content: "|";
            animation: blink 500ms linear infinite alternate;
        }
}

@-webkit-keyframes blink{
    0%{opacity: 0;}
    100%{opacity: 1;}
}

@-moz-keyframes blink{
    0%{opacity: 0;}
    100%{opacity: 1;}
}

@keyframes blink{
    0%{opacity: 0;}
    100%{opacity: 1;}
}




Payment from a website to another background running website

Is it possible (and legal) to have a chrome plugin feature for making a payment from a website to another website without accessing the second website? For example, skyscanner redirects the user to the air flight companies' websites. Would it be possible for the user to make the payment directly on Skyscanner without being redirected to the company's website?




Infinite scroll without infecting element

I try to implement an infinite scroll as a marquee with a defined post limit.

A basic infinite scroll is made by injecting new pages to the end of the scrollable section when you reach the end of the scroll section.

My layout is quite like a marquee but scrollable, as the content is always the same I do not wanted to inject new element.

You can check the behavior here: http://jensingvarsson.studio-push.com

This is the behavior I want, what I've done is duplicate the content of the scroll section in order to have two layout in the scroll section. Then, on scroll, you track the 1/4 and the 3/4 position in the scroll section and jump to the other side. It gives the effect of infinite scroll where you just jump in the scroll section from one side to another.

It display exactly the same but without adding new element at the end.

This behavior works like a charm in every device and browser EXCEPT iOs. iOs seems to optimize the GPU by hiding the elements that is not in the bounds of the screen so when I jump from 3/4 of the scroll to 1/4. It blinks to a white element and show finally the 1/4 scroll.

Here is a schema of the scroll

scroll start post limit   first elem  first elem clone
                      |   |           |
                      v   v           v
                      [1111111-22222222]
                          ^         ^
                          |         |
                          -----------
when you reach one of those points it goes to the other one to make an effect of infinite

Is there a way to get rid of this blink?




Looking for PHP code example to connect to a webapi using a bearer-token authentication

Need to connect to a webapi using bearer-token authentication preferably in PHP. Looking for sample code, first time doing this and I am a little lost. The instructions for the api call is something like this: https://api.mlsgrid.com/PropertyResi?$filter=ModificationTimestamp%20gt%202018-12-30T23:59:59.99Z

I am not sure how to setup header and the request object. Any suggestions or sample code would be great.

Tried a lot of variations of the code. I have seen a lot of code example snippets but nothing that covers the basics of putting together the calls.

    <?php
``http.Request.Headers.Add("Authorization", "Bearer tokennumber");

request.get('https://api.mlsgrid.com/PropertyResi?$filter=ModificationTimestamp%20gt%202018-12-30T23:59:59.99Z', 
{
'auth': {
'bearer': 'tokennumber'
}
});

request.get('https://api.mlsgrid.com/xxxxx$filter=MlgCanView%20eq%20true/', 
{
'auth': {
'bearer': 'tokennumber'
}
});


?>




Implement vibration in ReactJS

I want that the device vibrate in some part of my code (not relevant), I have seen some methods for js but they are not working on react

window.navigator.vibrate(200);
navigator.vibrate([1000,      500,    1000]);
navigator.vibrate(Infinity); // Infinity is a number

It is in a function, this does not matter




Create a zoom or enlarge image function without using jQuery

I need to create a zoom or enlarge function to make images on my website bigger in some way (like some popup or something similar) but I can't use jQuery.

The reason why I can't use it is because it somehow disables the dropdown function in my navbar (made with Bootstrap 4).

The web page is going to have multiple images and I want to apply the function to clicked or hovered one.

<img width="30%"  height="200px;" class="page-images" src="img1.jpg"/>
<img width="30%"  height="200px;" class="page-images" src="img2.jpg"/>
...

If someone could help that would be great. Thanks.




Making apis web apis ssl enabled In https Do I need any change in code

I had done binding with https for one of web api ...I checked by browsing it..it was working...When I uswe it in application config file where I need to call it it was not working...Do I need to do any code changes to consume the api with https..code is in c# MVac




Error when trying to make request to API using require request

Trying to make request to Google.com using code from npm require website:

var request = require('request');
request('http://www.google.com', function (error, response, body) {
  console.log('error:', error); // Print the error if one occurred
  console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
  console.log('body:', body); // Print the HTML for the Google homepage.
}); , but receiving this error: 

error: { Error: getaddrinfo ENOTFOUND www.google.com www.google.com:80
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'www.google.com',
  host: 'www.google.com',
  port: 80 }
statusCode: undefined
body: undefined. 

I've installed request. How can I fix this?




Why JNDI InitialContext can work fine in jsp but not in a class?

I'm working with Database connection using JNDI. I'm sure the deployment is fine. Because when I test it in the JSP below, it works fine.

</head> 
<body> 
<% 
try { 
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    DataSource ds = (DataSource)envCtx.lookup("jdbc/airlineticket");
    Connection conn = ds.getConnection();
out.println(conn); 
conn.close(); 
} catch (Exception e) { 
e.printStackTrace(); 
}
%> 
</body> 
</html>

success connection picture

But when I use ConnectionFactory class, an error occurs: ConnectionFactory cannot be resolved. I just put the connection code in the ConnectionFactory class, why this happened? ConnectionFactory class:

public static Connection getConnection()
{
    try {
        Context initCtx = new InitialContext();
        Context envCtx = (Context) initCtx.lookup("java:comp/env");
        DataSource ds = (DataSource)envCtx.lookup("jdbc/airlineticket");
        return ds.getConnection();
    }
    catch (NamingException e)
    {
        System.out.print("connection failed");
        return null;
    }
    catch(SQLException e)
    {
        e.printStackTrace();
        return null;
    }
}

test JSP:

</head> 
<body>     
<% 
try {       
Connection conn = ConnectionFactory.getConnection(); 
out.println(conn); 
conn.close(); 
} catch (Exception e) { 
e.printStackTrace(); 
}
%> 
</body> 
</html>

web.xml(/WEB-INF/web.xml):

<resource-ref>
  <res-ref-name>jdbc/airlineticket</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>

context.xml(/META-INF/context.xml):

<Context>
    <Resource name="jdbc/airlineticket" 
        auth="Container" 
        type="javax.sql.DataSource"
        username="Manager" 
        password="123456"
        driverClassName="org.mariadb.jdbc.Driver"
        url="jdbc:mariadb://localhost:3306/airlineticket"
        maxActive="50"
        masIdle="20"> </Resource>
</Context>




How to make sort arrows in angular mat-table always visible?

I want to make sorting arrows from angular mat-table always visible (e.g. they have always opacity set to 0.54). How do I do that?

I've already tried adding css-code to my css-file for cthe component. It made all arrows visible (with opacity: 0.54), but in this case all arrows stay with this opacity always. Even if an arrow was clicked, it has the opacity set to 0.54, but it should have the opacity set to 1.

I tried it by adding this code into my css-file:

::ng-deep .mat-sort-header-arrow.ng-trigger.ng-trigger-arrowPosition {
  opacity: 0.54 !important;
}

I want that the arrows are always displayed with the Opacity 0.54. The remaining behavior of the arrows should remain unchanged. In the case where a column is unsorted, e.g. the arrow is in an undefined state, the arrow should be an up arrow and have the opacity: 0.54. If I click an arrow, it should have the opacity set to 1. If I cancel the sorting, the arrow should have the opacity: 0.54 again.

There is an example here: https://stackblitz.com/edit/angular-isxoc5. All arrows are displayed as I want. But if you click an arrow, it still have the opacity 0.54, not 1.




UAT Website not working in Microsft Edge browser

I have UAT website, which is hosted in client's domain. So on all other browser its working fine, but when i try that to open into microsoft edge it gives me an error. I already tried below steps 1) I cleared all history, cache,cookies etc 2) I have also updated the allow sites from internet options->security->Trusted Sites. And in that I have added UAT website address, still no luck.

Error "Cant reach this page". Is it network issue or microsoft edge issue? If anyone know the resolution on this then kindly let me know




I want to compress my project , but there is a problem

I am in a small Web project with Wordpress, when I want to compress it, an error message is displayed

! C:\wamp64\www\dhaaad.zip: Impossible d'ouvrir C:\wamp64\www\dhaaad\wp-content\uploads\GeoLite2-Country.mmdb Accès refusé.Accès refusé




Open source Dataset (workload-requests/second) required for amazon(e-commerce) or Facebook kind of applications

Is there any opensource workload dataset available for Facebook or Amazon (e-commerce) type of applications? The dataset I'm looking for should include the number of requests coming to the application on per second basis. Example: time 1: 5requets, time 2: 6requets, ... and so on...




Why a student is not edited

I wrote a project where you can add and edit students. I have a list of students, all functions work except editing. I want to change the name and surname, avatar student, but does not work. Can see the code, I think I wrote everything correctly, why the function for editing a student does not work

Student Controller

package adil.java.schoolmaven.controller;

@Controller
public class StudentController {

    @Autowired
    private ServletContext servletContext;

    // Constructor based Dependency Injection
    private StudentService studentService;

    public StudentController() {

    }

    @Autowired
    public StudentController(StudentService studentService) {
        this.studentService = studentService;
    }

    @RequestMapping(value = "/allStudents",  method = {RequestMethod.GET, RequestMethod.POST})

    public ModelAndView displayAllUser() {
        System.out.println("User Page Requested : All Students");
        ModelAndView mv = new ModelAndView();
        List<Student> studentList = studentService.getAllStudents();
        mv.addObject("studentList", studentList);
        mv.setViewName("allStudents");
        return mv;
    }



    @RequestMapping(value = "/addStudent", method = RequestMethod.GET)
    public ModelAndView displayNewUserForm() {
        ModelAndView mv = new ModelAndView("addStudent");
        mv.addObject("headerMessage", "Add Student Details");
        mv.addObject("student", new Student());
        return mv;
    }

    @PostMapping(value = "/addStudent")
    public String saveNewStudent(@RequestParam("name") @NonNull String name,
            @RequestParam("surname") @NonNull String surname,
            @RequestParam("avatar") MultipartFile file)
            throws IOException {

        Student student = new Student();
        student.setSurname(surname);
        student.setName(name);

        if (file != null && !file.isEmpty()) {
            student.setAvatar(studentService.saveAvatarImage(file).getName());
        }

        studentService.saveStudent(student);
        return "redirect:/allStudents";
    }

    @GetMapping(value = "/editStudent/{id}")
    public ModelAndView displayEditUserForm(@PathVariable Long id) {
        ModelAndView mv = new ModelAndView("editStudent");
        Student student = studentService.getStudentById(id);
        mv.addObject("headerMessage", "Редактирование студента");
        mv.addObject("student", student);
        return mv;
    }

    @PostMapping(value = "/editStudent")
    public String saveEditedUser(
            @RequestParam("id") Long id,
            @RequestParam("name") String name,
            @RequestParam("surname") String surname,
            @RequestParam("avatar") MultipartFile file) {

        try {

            studentService.updateStudent(name, surname, file, studentService.getStudentById(id));

        } catch (FileSystemException ex) {
            ex.printStackTrace();
        } catch (IOException e) {
            return "redirect:/error";
        }

        return "redirect:/allStudents";
    }

    @GetMapping(value = "/deleteStudent/{id}")
    public ModelAndView deleteUserById(@PathVariable Long id) {
        studentService.deleteStudentById(id);
        ModelAndView mv = new ModelAndView("redirect:/allStudents");

        return mv;

    }

}

Edit Student JSP

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
        <title>Home</title>
    </head>
    <body>

        <center>
                <h1>${headerMessage}</h1>


                <form:form method="POST" action="${pageContext.request.contextPath}/editStudent" enctype="multipart/form-data">
                    <table>
                        <input type="hidden" value="${student.id}" name="id"/>
                        <tr>

                            <td><label path="Name">Name</label></td>
                            <td><input type="text" name="name" value="${student.name}"/></td>
                        </tr>
                        <tr>
                            <td><label path="Surname">Surname</label></td>
                            <td><input name="surname" value="${student.surname}"/></td>
                        </tr>
                        <tr>
                            <td><label path="Avatar">Avatar:</label></td>
                            <td>
                                <img src="${pageContext.request.contextPath}/avatar?avatar=${student.avatar}"
                                     style="max-height: 200px; max-width: 200px;"/>
                            </td>
                            <td>
                                <input type="file" name="avatar"/>
                            </td>
                        </tr>
                        <tr>
                            <td><input class="btn btn-primary" type="submit" value="Save"></td>
                        </tr>
                    </table>
                </form:form>
        </center>
    </body>
</html>