samedi 30 juin 2018

Links in Webview followed by dots

After links which are too long, I am getting ...

for e.g. https://en.wikipedia.org/List_...

how do i get the full link?

here is my code

wv_result_display.setWebViewClient(new MyBrowser());
    wv_result_display.getSettings().setLoadsImagesAutomatically(true);
    wv_result_display.getSettings().setJavaScriptEnabled(true);
   wv_result_display.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);


wv_result_display.loadUrl("https://www.google.com/searchq="+tv_query.getText().toString());

Here is my output enter image description here




Load a public website and execute a script

I have my own website and when i press a button i want to load a website not owned by me ( i.e Google.com ). When this page loads i want to execute a script.

For example, click the button on my site, load google.com and preload the search bar with a value from the script file passed from my website.

I can do this if i open the developer console when i visit google.com and type the command in, however, i want to automate this so instead of loading he console myself, my script will manipulate the value of a DOM element of this new page.

I just don't know how to load a new website and give it a script to run.

Is this possible ? can anyone point me in the right direction ?




Steam Web API get all genres of app?

I'm trying to make a fun little program that incorporates showing information about steam games, but I'm not sure how to get all the genres of a specific game.

For this example I'll be using Borderlands 2.

This first image is from the steam store (https://store.steampowered.com/app/49520/Borderlands_2/)

steam store tags

This second image is from the web api (https://store.steampowered.com/api/appdetails?appids=49520)

steam web api tags

Why is it that it only has 2 genres on the webapi but way more on the steam store? Is there another place I can use to get the rest of the genres?




how to use ckeditor in my php

I am building a CMS system and I found that i can not configure the ckeditor script on my text area, can anyone help me to solve the issue.... My code is bellow: header.php

<?php ob_start(); // helps to buffer our project ?>
<?php include "../includes/db.php"?>
<?php include "functions.php"?>
<?php ob_start(); ?>
<?php session_start(); ?>
<?php
        if (!isset($_SESSION['rl'])){
                header("Location:../index.php");
        }
?>

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

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SB Admin - Bootstrap Admin Template</title>we

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/sb-admin.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- FOR CHART API -->
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>


    <!-- CDN for TEXT EDITOR -->
    <script src="https://cdn.ckeditor.com/ckeditor5/10.1.0/classic/ckeditor.js"></script>


</head>

<body>
<script>
    DecoupledEditor
        .create( document.querySelector( '#body' ) )
        .then( editor => {
            const toolbarContainer = document.querySelector( '#body' );

            toolbarContainer.appendChild( editor.ui.view.toolbar.element );
        } )
        .catch( error => {
            console.error( error );
        } );
</script>

I used 'body' to ensure the code must apply on TEXTAREAS with id 'body'... here's code for text area:

<div class="form-group">
        <label for="title">Post Content</label>
        <textarea class="form-control" name="post_content" id="body" cols="30" rows="10"></textarea>
    </div>




Do you know any coding bootcamp who supports I-20 for an international students? [on hold]

I am looking for bootcamp in the US who supports I-20 for an international students and more focused to web development.




Do I really need to use framework for search autocompletion and search results filtering?

I'm fairly new to web development and I have to say that I am learning it in one particular reason - to build a website where people can rate and write reviews of specific type of thing (I don't want to reveal it yet). The problem is that I want to make it as professional as possible, because I'm planning to maintain/improve the website for long time, if it's professional it's easier to do that - I guess :)

I need a search engine with auto-completion and I don't want the website to be reloaded during filtering search results. I've heard of Ajax, but I'm not sure how to bite it. I can make use of HTML/CSS and PHP, however I'm not an expert.

  1. What technologies are best to achieve that? Any libraries/frameworks?
  2. Do I really need theses frameworks? Can I do it in vanilla PHP/JS?
  3. Maybe the whole website should be build using a particular technology/framework? Will it simplify upgrades? Should I only go for front-end/back-end(PHP) framework only or both?



how to fix $_SESSION["user"] inside navigation?

i want to display logged in member username inside my nav tag but after running it doesn't display anything. i have checked the varibles $_SESSION['u_user']= $row['username']; and it displays the correct username. below is the code. please fix it.

   <?php 
             if(isset($_SESSION['u_id'])) {
             echo '<li class="dropdown"><a href="#" class="dropdown-toggle"><?php $_SESSION["u_user"]; ?><span class="caret"></span></a>
                <ul class="dropdown-menu">
                <li><a href="login">DashBoard</a></li>
                <li><a href="includes/logout.php" >Log out</a></li>
            </ul>
        </li>';
    }
    else {
      echo '<li class="dropdown"><a href="#" class="dropdown-toggle">Account<span class="caret"></span></a>
      <ul class="dropdown-menu">
        <li><a href="login.php">Log in</a></li>
        <li><a href="signup.php">Sign up</a></li>
      </ul>
    </li>';
    }
        ?>




An exception occurred processing JSP page /index.jsp at line 39

36:         <c:forEach items="${list }" var="movie">
37:             <tr data-genuitec="wc1-0-18">
38:     
39:                 <td data-genuitec="wc1-0-19">${movie.moviename}</td>        
40:                 <td data-genuitec="wc1-0-20">${movie.time}</td>
41:                 <td data-genuitec="wc1-0-21">${movie.endtime}</td>
42:                 <td data-genuitec="wc1-0-22">${movie.

price}

I really don't know what is wrong with my code .Help~




More languages website

I am trying to create a website with more languages. I don't know how to do it without create more files. Please help me.

P.S: I don't know java and PHP.




Spring Boot Application generated by Spring Initializr on running in eclipse gives A child container failed during start for a

I have created a spring boot web application using spring initializr with dependency as web. I tried running it in eclipse without any modifications in the generated project. I am getting ERROR

o.apache.catalina.core.ContainerBase.log - A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]

.. I have searched in stackoverflow, similar questions are there but I didn't get the answer working for me?




Access td elments inside li tag

i am trying to access td element which is inside an li tag .my code is like this

$(document).on("click",".open",function(){
  var $url;
          var $row = $(this).closest("tr"),         
    $tds = $row.find("td:nth-child(1)"); 
$.each($tds, function() {               
      $("#file").val(($(this).text()));
      $("#type").val("open");
 });

Servlet Code :

 sb.append("<ul class=\"child\">");
          if(listOfFiles!=null){
    for (int i = 0; i < listOfFiles.length; i++) {


    sb.append("<tr>");

     if (listOfFiles[i].isFile()) {
        sb.append("<li class=\"file\">");
        sb.append("<td>"+listOfFiles[i].getName()+"</td>");
        sb.append("<td><button class=\"open\">OPEN</button></td>");
        sb.append("<td><button class = \"edit\">EDIT</button></td>");
        sb.append("<td><button class =\"share\">SHARE</button></td>");
        sb.append("<td><button class =\"log\">VIEW LOG</button></td>");
        sb.append("</li>");

      } else if (listOfFiles[i].isDirectory()) {
        sb.append("<li class=\"folder false\">"+listOfFiles[i].getName()+"</li>");

      }
 sb.append("</tr>");
    }
sb.append("</ul>");
}

I don't whether iam doing it correctly.Iam calling an ajax call to sevlet and append the Responsetext to an li tag.Then i try to access the td element inside it but it is not working .I don't if it is good practice to put td inside li so Please Help.. Thanks in Advance




vendredi 29 juin 2018

Which is the best tool to create a simple web service?

Now I'm using netbeans 8.0 but i want some other tools to create a simple web service?




How to make a program that stores cookies?

I'd like to know how a person could see all cookies of a browser.
I mean, if I would download all cookies of my browser, how could I do without using Chrome/Firefox plugins? Via JavaScript? I appreciate your help :)




Is it possible to process HTML forms without an own webserver stack?

I would like to know, that how is it possible to process a submitted HTML form without my own webserver and the appropriate web stack, and also provide a return value in the browser, after the submitting happens. If one use an own webserver and using let's say Ruby or Pyhton language, then it is relatively easy to make a program, script, which processes the form's data, and provides an output which is displayed in the browser. But what can I do if I have no webserver with the full web stack? Is there some general web service (Google or other), where I can "host" such form processing scripts, written in any language or made by some wizard-like mechanism?

My goal would be: blog visitor enters 5 codes (similar to hash-codes), for example into a textarea, and then submits it, and if all the five codes are accepted by the processing script as valid codes, then another code, a voucher-code would be shown on the blog, which the visitor can use for something (for discount). The valid codes which should be accepted by the form processing program would be stored even in the script itself, or in a text file, database, spreadsheet, etc.




Image Hover Animation Not Working in Slider Revolution 5.5

I am having a hard time getting an animation to work on slider revolution. I want to create flip boxes that flip and show a back side with text but the animation doesnt seem to work. I've tried everything, help?




AngularJS ng-repeat refresh with new API call

Currently working on an application where I'm doing an API call to get the data and then using ng-repeat directive to populate the table on the view.

<tr md-row ng-repeat="request in requests">
        <td md-cell></td>
        <td md-cell></td>
        <td md-cell></td>
        <td md-cell></td>
        <td md-cell></td>
        <td md-cell></td>
</tr>

And in the controller, a user makes a new request and it adds a row to the database and after the success dialog comes up, I want to make a new request to the API to get the new row that the server generated, so I want to make a new API request.

So, I contact the API and get all the requests again and want to replace the data on the table with the refreshed data from the API

Here's my js promise resolve function:

var onRequests = function(response) {
  $scope.requests = [];

      response.forEach(function() {
          //Processing here and pushing to the new array
      });
  });
};

But, on creating this new array I'm assuming that the reference to the original array, which the scopes of the ng-repeat pieces have, is lost.

So, I'm trying to get a way for it to just refresh the ng-repeat table with a new array.

Here are things I've tried:

  • New array and then $applying

  • Keeping same array reference and just removing everything and doing it again, but this seems like a hacky way and I want an elegant solution

  • Using $rootScope instead for the array, which seems to work for some reason...

This is how I did the $rootScope one, which works (but seems hacky):

 var onRequests = function(response) {
      $rootScope.requests = [];

          response.forEach(function() {
              //Processing here and pushing to the new array
          });
      });
    };

For some reason this works, and I don't know why.

If anyone could help me out, that would be awesome. I've read around on other questions similar and couldn't seem to find anything helpful or exact along what I'm trying to do, from what I've found, it hasn't worked.

EDIT: Just to be clear, I've read over about a dozen other posts that have similar wording and none were exact to what I am trying to do as I said, so before flagging as duplicate, know that a lot of the other ones didn't work as solutions.




javascript - multiple moving walls

I am making a game like flappy bird , the only difference is that the bird moves by using the mouse pointer location any where on the canvas. So for the obstacle i made walls but the walls are appearing in a bunch. I am not able to make walls that appear on regular interval in the canvas .

Required image :-

i am getting this :-

var context;
var screenWidth;
var screenHeight;
var ball;
var wall = [];
var gameStatus;
var mouseX;
var mouseY;

var running = false;
var raf;

gameIntialize();
gameDraw();

function Ball() {
  this.radius = 16;
  this.x = 25;
  this.y = screenHeight / 2;
  this.ballDraw = function() {
    context.beginPath();
    context.arc(this.x, this.y, 16, 0, 2 * Math.PI);
    context.fillStyle = 'green';
    context.fill();
  }
};


function Wall() {
  this.thickness = 10;
  this.wallPositionY = screenHeight;
  this.wallPositionX = screenWidth;

  this.spacing = 0;

  if (this.wallPositionY > 400 && this.wallPositionY <= 500) {
    this.spacing = Math.floor(Math.random() * (100 - 50) + 50);
  } else if (this.wallPositionY > 500) {
    this.spacing = Math.floor(Math.random() * (200 - 100) + 100);
  } else {
    this.spacing = 45;
  }

  this.heightFromTheTop = Math.floor(Math.random() * (this.wallPositionY / 6 - 3 / 4 * this.wallPositionY) + this.wallPositionY);
  this.heightFromTheBottom = this.wallPositionY - (this.heightFromTheTop + this.spacing);
  this.speed = 6;

  this.draw = function() {

    context.fillStyle = 'yellow';
    context.fillRect(this.wallPositionX, 0, this.thickness, this.heightFromTheTop);
    context.fillRect(this.wallPositionX, this.wallPositionY - this.heightFromTheBottom, this.thickness, this.heightFromTheBottom);
  }

  this.update = function() {
    this.wallPositionX = this.wallPositionX - this.speed;
  }

  this.offscreen = function() {
    if (this.wallPositionX < -this.thickness) {
      return true;
    } else {
      return false;
    }
  }
  this.newWall = function() {
    if (this.wallPositionX < screenWidth / 2) {
      return true;
    } else {
      return false;
    }
  }
};


function gameIntialize() {
  var canvass = document.getElementById('canvas');
  context = canvas.getContext('2d');

  screenWidth = window.innerWidth;
  screenHeight = window.innerHeight;

  canvas.width = screenWidth;
  canvas.height = screenHeight;

  ball = new Ball();
  wall.push(new Wall());


  window.addEventListener('resize', resizeScreen, false);

  canvas.addEventListener('mousemove', function(e) {
    if (!running) {
      ball.x = e.clientX;
      ball.y = e.clientY;

    }
  });


}

function gameDraw() {
  context.fillStyle = "#aaaaaa";
  context.fillRect(0, 0, screenWidth, screenHeight);

  ball.ballDraw();

  for (var i = wall.length - 1; i >= 0; i--) {

    wall[i].draw();
    wall[i].update();

    if (wall[i].offscreen()) {
      wall.splice(i, 1);
    }
    var test_interval = setInterval(function() {
      wall.push(new Wall());
    }, 5000);

  }


  raf = window.requestAnimationFrame(gameDraw);

}
body {
  margin: 0px
}
<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
  <meta charset="utf-8">
  <title>game-run</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
  <canvas id="canvas"></canvas>

</body>
<script src="game.js"></script>


</html>

What is wrong with this code? I appreciate any help!




Embedded Bokeh Server + Flask launching is extremely slow

I create a web application(Flask + Embedded Bokeh server) to render data. But, when I launch the web application, it would take me around 6 ~ 10 minutes to get everything ready.

Welcome any suggestions, thanks a lot




TypeError: $.ajax is not a function work fine in one page but not in another

I have a problem, while I am trying to use ajax function I am getting the following message: TypeError: $.ajax is not a function.

In the same project on another page AJAX function call work fine but in this page it doesn't work.

I am using in both pages with the same header

<!doctype html>
<html lang= "he">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
   <link rel="stylesheet" type="text/css" href="../CSS/mainCSS.css">


<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->

   <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
     <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  </head>
  <body dir ="rtl">
<button type="button" class="btn btn-primary" id = "singUpBtn">singup</button>
<button type="button" class="btn btn-primary" id = "loginBtn" >Login</button>
<script>
$('#loginBtn').click(function(){
    $.ajax({
        type:"POST",
        url:"registration.php",
        data:$('#regForm').serialize(),
        success:function(result){
                if(result == 1){
                window.location.assign("../Pages/page1.php");
                }else{
                    $('#regAlert').html(result).show();
                }
            }
        })  
})
$('#singUpBtn').click(function(){
    $.ajax({
            type:"POST",
            url:"registration.php",
            data:$('#singUpForm').serialize(),
            success:function(result){
                if(result == 1){
                window.location.assign("../Pages/page1.php");
                }else{
                    $('#singUpAlert').html(result).show();
                }
            }
        })  
})  
})
</script>
</body>
</html>

I don't understand why on my other page page1.php the ajax call work fine but on my main page it doesn't.

what I am doing wrong?

I will be thankful for any help.




changing the text color according to the active tab

following my question posted here Unable to add a background colour to the button in navigation

I have managed to fix my issues and move on with my work , however an issue i came across was to change the font color of the navigation bar elements according to the active tab.The "currently active" tab is given the correct color through css so im hoping the css part is correct thus leaving the JavaScript part an issue. I am still very new to this so any form of help is greatly appreciated

This is my html part of the navigation bar div id="navbar" >

            <ul>
                <li> <a class="topnavbar active" href="" id="home"title="Home">HOME </a> </li>
                <li> <a class="topnavbar"        href="" id="movies" title="Movies">MOVIES </a> </li>
                <li> <a class="topnavbar"        href="" id="theaters" title="Theaters">THEATERS </a> </li>
                <li> <a class="topnavbar"        href="" id="buytickets" title="Buy Tickets Online">BUY TICKETS ONLINE </a> </li>
                <li style="float:right"><a class="btn btn-scope1 navbar-btn" id="btn1" href="">TEST YOUR KNOWLEDGE </a> </li>

            </ul>   

            </div>

this is my css part for the active tab

    .active {
text-decoration: none;
color: #4da6ff;
outline: none;  }

this is what i have on my JavaScript.

var header = document.getElementById("navbar");
var btns = header.getElementsByClassName("topnavbar");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}

Please bare with me if iv made a silly mistake since im fairly new to this any explanation on where i have gone wrong is greatly appreciated . Thank you




Creating web form for achriving and exporting

I lack the terminology for what I search for so I will explain, I have a form on excel with questions.(audit) I would like this in a web site that I can use regularly and share the data much easier. I started an asp.net form site with visual studio but if there are templates available please point me in the right direction. As far as the type of site, I have a mysequal server set up for the form data to test but is storing locally better? I also would like to export the form to share, store it on an intranet.. I'm trying to learn as much as I can and I appreciate any help pointing me in the right direction. Am I doing this right or are there templates for what I need to save time? I plan on storing the data by location, giving user access to provide action plans and retrieve the non compliant items only. I really would like to learn and do this as much as I can but like I said, I do a search for what I think I want and I get nothing related or similar to that. In a nutshell I want to open my form, give it a name(the location I audit) fill out the audit data, save it, and provide user accesss to retrieve and answer the items. I assume asp.net form site is the right approach?




javascript append and prepend not working on IE

I'm trying to append and prepend html block inside text-area using button click, but it's not working on Internet Explorer.

 $(document).ready(function () {
        "use strict";
       $('#export-file').click(function () {          
          document.getElementById("codeToSave").prepend('<!doctype html>\n<html> \n<head>');
          document.getElementById("codeToSave").append($.trim('</body>\n</html>'));
       });
    });


<ul class="control-list">
      <li class="controls" id="export-file" data-toggle="tooltip" title="Export " ><i class="fas fa-download"></i></li>                    
</ul>

<textarea id="codeToSave" disabled class="scrollStyle-3" ></textarea>




Load PDF from API without caching

I generate a report by calling an API that return a PDF to the client. Problem is after one load the call is cached and the API isn't called anymore so the report won't be updated if it need to be.

I use this piece of code to get my report in a new window:

$window.open("generate/my/pdf");

Is there another way that will call the API every time (and won't trigger some anti pop-up)?




Does socket.io support PUBSUB?

I did an extensive search on the web and found that most people mentioned that socket.io + redis --> pub/sub.

On the other hand, socket.io is claimed to be a realtime web service.

So my question is: does socket.io itself support PUB/SUB? If not, should I integrate socket.io with other tools(such as redis) to implement PUB/SUB?




Using Proxy in URL adress

I try to send request via web-browser using proxy server in URL, like this :

https://178.128.222.54:8080//https://github.com

But always got an error :

This site can’t provide a secure connection 178.128.222.54 sent an invalid response.

Is it possible or I try to do some wrong ?




Page assets (html, css, js) loading animation with percentage

How do we achieve page assets (html, css, js and images) loading animation with percentage indicator through ajax or some other plugins?

Example: Most of the websites from http://awwwards.com

Sample one: http://www.lafamiliaxsiempre.cl/

I tried with the following code and stuck with when multiple files to download. Please check the below code

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400' rel='stylesheet' type='text/css'>
<style type="text/css">

body {
    margin: 0;
    font-family: "Titillium Web";
    font-size: 15px;
}

#demo-container {
    width: 400px;
    margin: 60px auto;
}

#download-button {
    background-color: white;
    color: #2980b9;
    border: 2px solid #2980b9;
    font-family: inherit;
    outline: none;
    min-width: 100px;
    padding: 10px;
    font-size: inherit;
    border-radius: 2px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

#start-download {
    text-align: center;
    display: none;
}

#download-progress-container {
    border: 1px solid #cccccc;
    padding: 4px;
    display: none;
    height: 20px;
}

#download-progress {
    background-color: #2980b9;
    display: inline-block;
    height: 100%;
}

#save-file {
    color: #2980b9;
    text-decoration: none;
    display: none;
    text-align: center;
}

#save-file:hover {
    text-decoration: underline;
}

</style>
</head>

<body>

<div id="demo-container">
    <button id="download-button">Download</button>
    <div id="download-ui-container">
        <div id="start-download">Starting Download..</div>
        <div id="download-progress-container"><div id="download-progress"></div></div>
        <a id="save-file">Save File</a>
    </div>
</div>

<script>

var _OBJECT_URL;

document.querySelector('#download-button').addEventListener('click', function() {
    var request = new XMLHttpRequest();
    request.addEventListener('readystatechange', function(e) {
        if(request.readyState == 2 && request.status == 200) {
            document.querySelector('#start-download').style.display = 'block';
            document.querySelector('#download-button').style.display = 'none';
        }
        else if(request.readyState == 3) {
            document.querySelector('#download-progress-container').style.display = 'block';
            document.querySelector('#start-download').style.display = 'none';
        }
        else if(request.readyState == 4) {
            _OBJECT_URL = URL.createObjectURL(request.response);

            document.querySelector('#save-file').setAttribute('href', _OBJECT_URL);
            document.querySelector('#save-file').setAttribute('download', "file-name.avi"); //here i wish to download all the html, css, js, and image files 

            document.querySelector('#save-file').style.display = 'block';
            document.querySelector('#download-progress-container').style.display = 'none';

            setTimeout(function() {
                window.URL.revokeObjectURL(_OBJECT_URL);
                document.querySelector('#download-button').style.display = 'block';
                document.querySelector('#save-file').style.display = 'none';
            }, 60*1000);
        }
    });
    request.addEventListener('progress', function(e) {
        var percent_complete = (e.loaded / e.total)*100;
        document.querySelector('#download-progress').style.width = percent_complete + '%';
    });
    request.responseType = 'blob';
    request.open('get', 'file-name.avi');  //here i wish to download all the html, css, js, and image files 
    request.send(); 
});

</script>

</body>
</html>




How to load a part of Image on Demand like GMap Does?

I have a big big image lets say 1000 MP (700MB), Like a Map of a particular area, What I want to do is load only the specific part if if zoom in to the image. This is important to make the app efficient to work in web.

I did it by storing the image by slicing it in various part and on demand load only that sliced image available.

The slices are done according to the zoom level.

But I don't want to do this way, Is there any efficient and proper way to do it, how any map does it ?




Google maps JavaScript Marker Not Working in httpRequest

i have written the following code and google markers are not working. If I put the marker creation outside the httpRequest work fine. What is the problem ?

var xhttp = new XMLHttpRequest();
                xhttp.onreadystatechange = function () {
                    if (this.readyState == 4 && this.status == 200) {
                        var coordinates = JSON.parse(this.responseText);
                        for (point of coordinates) {
                            console.log(point);
                            var marker = new google.maps.Marker({
                                map: map,
                                position: new google.maps.LatLng(point[0], point[1])
                            })
                        }
                    }
                };
                xhttp.open("GET", "../php/createAdresses.php", false);
                xhttp.send();




Java thread to poll Database

I have a Java Web application where when users login, their email is stored in 8 different user groups based on type of user.

Now I want to show email address of all users who are login in a particular group on UI(somewhat like when a user has done login, he can see who other users of same group have login) and this should be live status, so if some other user has logged out, it should be visible to all other users in that group. Is there some easy way.




Web interface for existing database

I am in a student bioinformatics internship now and I am in the last part of it: building a mySQL database and making a web interface for some users.

I have three weeks to make the web interface. In the database, there is a lot of data (more than 100 millions), the user will have some filters to select and then, the interface should display the desired results. It should be simple, but I don't know what to use. Django ? R ? PHP ? There is no tools that pug the database in a simple interface ?

Anyone can help please ?




Fatal error: Uncaught Error: Unsupported operand types

I need your help please. I got an error about "Unsupported operand types" but i didn't know about it. i've been trying search on google but i'm still can't fix it.

this my error title :

Fatal error: Uncaught Error: Unsupported operand types in /Applications/XAMPP/xamppfiles/htdocs/aplikasi_penjualan/admin/barang.php:28 Stack trace: #0 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/aplikasi_penjualan/admin/barang.php on line 28

and this my code :

<?php include 'header.php'; ?>

<h3><span class="glyphicon glyphicon-briefcase"></span>  Data Barang</h3>
<button style="margin-bottom:20px" data-toggle="modal" data-target="#myModal" class="btn btn-info col-md-2"><span class="glyphicon glyphicon-plus"></span>Tambah Barang</button>
<br/>
<br/>

<?php 
$periksa=mysqli_query($conn, "select * from barang where jumlah <=3");
while($q=mysqli_fetch_array($periksa)){ 
        if($q['jumlah']<=3){ 
                ?>   
                <script>
                        $(document).ready(function(){
                                $('#pesan_sedia').css("color","red");
                                $('#pesan_sedia').append("<span class='glyphicon glyphicon-asterisk'></span>");
                        });
                </script>
                <?php
                echo "<div style='padding:5px' class='alert alert-warning'><span class='glyphicon glyphicon-info-sign'></span> Stok  <a style='color:red'>". $q['nama']."</a> yang tersisa sudah kurang dari 3 . silahkan pesan lagi !!</div>";     
        }
}
?>
<?php 
// $per_hal=10;
$jumlah_record=mysqli_query($conn, "SELECT COUNT(*) from barang");
$jum=mysqli_fetch_array($jumlah_record);
$halaman= ceil($jum / $per_hal);  //-----> THE ERROR IN HERE
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_hal;
?>
<div class="col-md-12">
        <table class="col-md-2">
                <tr>
                        <td>Jumlah Record</td>              
                        <td><?php echo $jum; ?></td>
                </tr>
                <tr>
                        <td>Jumlah Halaman</td>     
                        <td><?php echo $halaman; ?></td>
                </tr>
        </table>
        <a style="margin-bottom:10px" href="lap_barang.php" target="_blank" class="btn btn-default pull-right"><span class='glyphicon glyphicon-print'></span>  Cetak</a>
</div>
<form action="cari_act.php" method="get">
        <div class="input-group col-md-5 col-md-offset-7">
                <span class="input-group-addon" id="basic-addon1"><span class="glyphicon glyphicon-search"></span></span>
                <input type="text" class="form-control" placeholder="Cari barang di sini .." aria-describedby="basic-addon1" name="cari"> 
        </div>
</form>
<br/>
<table class="table table-hover">
        <tr>
                <th class="col-md-1">No</th>
                <th class="col-md-4">Nama Barang</th>
                <th class="col-md-3">Harga Jual</th>
                <th class="col-md-1">Jumlah</th>
                <!-- <th class="col-md-1">Sisa</th>               -->
                <th class="col-md-3">Opsi</th>
        </tr>
        <?php 
        if(isset($_GET['cari'])){
                $cari=mysqli_real_escape_string($_GET['cari']);
                $brg=mysqli_query($conn, "select * from barang where nama like '$cari' or jenis like '$cari'");
        }else{
                $brg=mysqli_query($conn, "select * from barang limit $start, $per_hal");
        }
        $no=1;
        while($b=mysqli_fetch_array($brg)){

                ?>
                <tr>
                        <td><?php echo $no++ ?></td>
                        <td><?php echo $b['nama'] ?></td>
                        <td>Rp.<?php echo number_format($b['harga']) ?>,-</td>
                        <td><?php echo $b['jumlah'] ?></td>
                        <td>
                                <a href="det_barang.php?id=<?php echo $b['id']; ?>" class="btn btn-info">Detail</a>
                                <a href="edit.php?id=<?php echo $b['id']; ?>" class="btn btn-warning">Edit</a>
                                <a onclick="if(confirm('Apakah anda yakin ingin menghapus data ini ??')){ location.href='hapus.php?id=<?php echo $b['id']; ?>' }" class="btn btn-danger">Hapus</a>
                        </td>
                </tr>             
                <?php 
        }
        ?>
        <tr>
                <td colspan="4">Total Modal</td>
                <td>                      
                <?php 
                
                        $x=mysqli_query($conn, "select sum(modal) as total from barang");       
                        $xx=mysqli_fetch_array($x);                     
                        echo "<b> Rp.". number_format($xx['total']).",-</b>";               
                ?>
                </td>
        </tr>
</table>
<ul class="pagination">                   
                        <?php 
                        for($x=1;$x<=$halaman;$x++){
                                ?>
                                <li><a href="?page=<?php echo $x ?>"><?php echo $x ?></a></li>
                                <?php
                        }
                        ?>                                           
                </ul>
<!-- modal input -->
<div id="myModal" class="modal fade">
        <div class="modal-dialog">
                <div class="modal-content">
                        <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title">Tambah Barang Baru</h4>
                        </div>
                        <div class="modal-body">
                                <form action="tmb_brg_act.php" method="post">
                                        <div class="form-group">
                                                <label>Nama Barang</label>
                                                <input name="nama" type="text" class="form-control" placeholder="Nama Barang ..">
                                        </div>
                                        <div class="form-group">
                                                <label>Jenis</label>
                                                <input name="jenis" type="text" class="form-control" placeholder="Jenis Barang ..">
                                        </div>
                                        <div class="form-group">
                                                <label>Suplier</label>
                                                <input name="suplier" type="text" class="form-control" placeholder="Suplier ..">
                                        </div>
                                        <div class="form-group">
                                                <label>Harga Modal</label>
                                                <input name="modal" type="text" class="form-control" placeholder="Modal per unit">
                                        </div>    
                                        <div class="form-group">
                                                <label>Harga Jual</label>
                                                <input name="harga" type="text" class="form-control" placeholder="Harga Jual per unit">
                                        </div>    
                                        <div class="form-group">
                                                <label>Jumlah</label>
                                                <input name="jumlah" type="text" class="form-control" placeholder="Jumlah">
                                        </div>                                                                                                                                    

                                </div>
                                <div class="modal-footer">
                                        <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
                                        <input type="submit" class="btn btn-primary" value="Simpan">
                                </div>
                        </form>
                </div>
        </div>
</div>



<?php 
include 'footer.php';

?>

I Hope you can help me.. Thanks a lot.




How to call token from javascript to server?

I am getting token in UI(java script) which in the WEB-INF folder ,i need to pass the token to the server side. How to send the token (its a variable) from java script to server side?

Advance thanks!!!!




jeudi 28 juin 2018

How to center those images in Bootstrap?

Hey there stackoverflow

I am trying to center those images. I tried everything I found about vertical centering in bootstrap.

http://jsfiddle.net/tLd85urn/1/

Here you can see my sourcecode. If I remove the lines on "div" and "html" in the CSS stylesheet (height: 100%;), the images seems centered, but the whole page is stacked together. How can I center those images, and keep the "fullscreen" layout?

HTML

<div class="container-fluid">
      <div class="row header text-center align-items-center align-middle">
        <div class="col-xl-2 col-lg-2 col-md-2 col-sm-3 col-3" style="background-color:lavender;">.col-lg-2</div>
        <div class="col-xl-8 col-lg-8 col-md-8 col-sm-6 col-6" style="background-color:lavenderblush;">.col-lg-8</div>
        <div class="col-xl-2 col-lg-2 col-md-2 col-sm-3 col-3" style="background-color:lavender;">.col-lg-2</div>
      </div>
      <div class="row content text-center align-items-center align-middle">
        <div class="col-xl-1 col-lg-1 col-md-1 col-sm-1 col-1" style="background-color:lavender;">.col-lg-1</div>
        <div class="align-items-center align-middle col-xl-10 col-lg-10 col-md-10 col-sm-10 col-10" style="background-color:blue;">.col-lg-10<img src="test2.png" class="align-items-center align-middle img-fluid rounded mx-auto" alt="Responsive image"><img src="test2.png" class="img-fluid mx-auto" alt="Responsive image"><img src="test2.png" class="img-fluid mx-auto" alt="Responsive image"></div>
        <div class="col-xl-1 col-lg-1 col-md-1 col-sm-1 col-1" style="background-color:lavender;">.col-lg-1</div>
      </div>
      <div class="row footer text-center">
        <div class="col-xl-2 col-lg-2 col-md-2 col-sm-3 col-3" style="background-color:lavender;">.col-lg-2</div>
        <div class="col-xl-8 col-lg-8 col-md-8 col-sm-6 col-6" style="background-color:lavenderblush;">.col-lg-8</div>
        <div class="col-xl-2 col-lg-2 col-md-2 col-sm-3 col-3" style="background-color:lavender;">.col-lg-2<img src="test3.png" class="img-fluid rounded mx-auto" alt="Responsive image"></div>
      </div>
    </div>

CSS

html,
body {
  height: 100%; /* If I remove this line, it works, but its no more fullscreen */
  width: 100%;  
  margin: 0;
}

div {
  height: 100%; /* If I remove this line, it works, but its no more fullscreen */
  /*width: 100%; */
  margin: 0;
}

.header {
  height: 10% !important;
}

.content {
  height: 80% !important;
}

.footer {
  height: 10% !important;
}

Thanks for your help and greetings,

Tine




PhpStorm rest client not sending file during multipart post submission

I am trying to test an API to accept multipart form-data. I am trying to use the PhpStorm rest client. I set the method to Post and the path to my endpoint and then under request body I checked Text, put some text in there and I also check File Upload(multipart/form-data) and put the path and filename into the File To Send text box.

When I click debug and run the request, I only receive the text. I do not get a file upload. If I uncheck text and leave File upload clicked, it properly sends the file.

I need two things. I need to be able to send text in the message body and I also need to be able to attach multiple files. In other words, I need to set up a true multipart/form-data post request.

Any suggestions would be greatly appreciated.




How to exploit XSS in Angular with $sceProvider being disabled

I am trying to implement XSS vulnerable app so that afterwards I could improve security aspects by using Domain Driven Design principles. The front-end is implemented with AngularJS for which I have disabled $sceProvider. Still, any of the XSS attack examples I tried so far didn't work.

HTML page:

<div class="row" ng-init="loadArticles()">
    <h1>Existing articles</h1>
    <table id="tabela1"  class="table table-striped table-hover">
        <thead>
        <tr>
            <th>Book title: </th>
            <th>Description: </th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="b in BOOKS track by $index" >
            <td style="padding-right: 15px"></td>
            <td style="padding-right: 15px"></td>
        </tr>
        </tbody>
    </table>
</div>
</div>

ArticleController.js

$scope.loadArticles = function () {
    console.log("loading articles");

    var url = "/api/article/getAll";
    $.ajax({
        type: 'GET',
        url : url,
        contentType: 'application/json',
        dataType: 'text',
        success:  function (data) {
            $scope.BOOKS = JSON.parse(data);
            $scope.$apply();
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            //toaster poruka
            alert('Could not load articles!');
        }
    });
};

When for example

<script>alert();</script>

is put into description, and sent to server to be saved into database, next time the page is loaded, it is printed in the same way, without the alert being shown.




sticker printing in asp.net web form

I want to print a sticker which I have generated from the database. The screen looks like the following.

WebPage Image

The print should be exactly similar to highlighted area. I am using window.print() method, but it works weird.

The resultant looks like the following image. print after clicking on print button

I want some piece of code which will print exactly what I want.

Any help will be highly appreciated. Thanks in advance




Rewrite Rule Apache web server

I want to redirect the URL like to

https://www.example.com/web/pages/home to https://www.example.com/home

https://www.example.com/web/pages/parts to https://www.example.com/parts




CMS themes comparison (Wordpress - Joomla)

can someone tell me if there is a Wordpress theme similar to Joomla JSN Decor 2 template (https://www.joomlashine.com/joomla-templates/jsn-decor.html)? Is there some web site that compare and find similar themes in different CMS?

Thank you




First Time Login Walkthrough / Guidance Helper in Web Apps?

When a user logs into an app for the first time, there are often helpers that guide the user and show him/her where everything is located in the app and walk him/her through the app real quickly. Some of them are really fancy.

I would like to know whether there is a name for these walkthrough helpers? I would like to find some npm modules that help me creating helper tools like these. Or do people usually just code them from scratch?




JTAPI Web Application

I have a Desktop Application which can configure JTAPI Call Events such Call Transfer, Call Start, Call Drop etc as SoftPhone with PBX Configuration. I want to make it as a Web Application i.e. Browser Based. Need to understand how it will be designed and Configured.




.Net Core API - File Write Issue

I am getting weird issue and not sure if I am doing wrong somewhere. describing problem in points below:

  1. Web API created in .Net core 2.0 and hosted on IIS 7.5, with separate Application Pool. i.e say "No Managed Code" and running with "Local System" service.

  2. Calling Web API service method from POSTMAN, Posting XML and receiving xml successfully.

  3. In same Web API Service, trying to create request and response log using simple System.IO.File.WriteAllText(path, content). Working fine when calling it from POSTMAN. Path Folder is of D: drive of same machine when WebAPI is hosted on IIS. Read-Write permissions given on folder to all users like EveryOne, Local System, Administrators, Network Services etc.

  4. Now, the problem here is when calling the same service from Web Application developed on .Net 4.0 then System.IO.File.WriteAllText(path, content) is not giving any error plus not creating file. Secondly, Sharing GUID folder name stored on ViewData ((Controller)filterContext.Controller).ViewData.Add("TracePath", strTracePath + strNewGuidFolder); from filter class method to Controller for writing Response file is also appears empty.

Not sure what to do here, please suggest.




How to configure and run a java web application with PostgreSql database on local machine for tests?

I have the code and need to make maintenance on it. So I need to run it on local machine for tests.

Thanks for any help.




How can I use the zalando API? Has someone experience with the api?

I tried their documentation, but I can't find how I can access the api. I would like to request some data from their service and I see that they have a public API, so i don't want to 'scrape' their site.




How Can I Check If the User Authenticated To Access Web Pages From Another Source

I am going to make web application using PHP which contains many pages, but I should check if the visitor is authenticated to view content or not by X domain.

The X domain can read the header MSISDN from the visitor (if exist) and check if he is authenticate or not.

So I am going to redirect user to X domain to allow him to read the header, and he will redirect user back to me if it can access content, what is the best way for X domain to inform me if the user is authenticated or not!

As I see:

  1. I will not use a GET parameter that its not secured anymore.

  2. I tried to check referring URL but I could not always read it!

is it good way to X site send me a POST parameter, or their are another method?

Noting that its not too important to be very secured.




Unable to add a background colour to the button in navigation

Hi i am still an extreme beginner to web development and i am trying to create this navigation bar .The issue i have come across is that the element i have floated to the right side is not on the same level as the other stuff. This is probably due to something i have done with the css and i cant pin it. Also what i actually want to do is to change the back ground of the right floated element to pink and have a padding around it to make it look like a button. I dont know if i have gone about to do so in the right way . I did try to find it out on my own but havent had any luck so far. this is my html.

<html>
    <head>
        <title>WatchIT -Your one stop destination for all your movie tickets</title>

        <link rel="stylesheet" type="text/css" href="main.css">
    </head>



            <div id="navbar" class ="navbar-collapse">

            <ul>
                <li> <a class="active" href="" title="Home">HOME </a> </li>
                <li> <a href="" title="movies">MOVIES </a> </li>
                <li> <a href="" title="theaters">THEATERS </a> </li>
                <li> <a href="" title="tickets">BUY TICKETS ONLINE </a> </li>
                <li style="float:right"><a class="btn btn-scope1 navbar-btn" href="">TEST YOUR KNOWLEDGE </a> </li>

            </ul>   

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

and this is my css.

 ul {
 list-style-type: none;
 margin: 0;
 padding: 0;
  overflow: hidden;
 background-color: #00004d;
 font-size:15px
 }

li {
float: left;
 }

li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}

li a:hover:not(.active) {
background-color: #000080;
}

a:active {
text-decoration: none;
color: #00abbd;
outline: none; 
 }
 .btn-scope1 {

 text-transform:uppercase;
 padding:4px 15px;
 font-weight:600;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
 -ms-border-radius: 3px;
border-radius: 3px;
 font-size: 12px;
 min-width: 100px;
 }
.btn-scope:hover {
 color: #fff;
 opacity: 0.9;
 background-color: rgba(238, 12, 110, 0.8); }

Please be kind enough to ignore my ignorance on certain things that i may have put on.What i honestly want is to have a padding in pink like the "Post your question button" on stackoverflow on the buytickets and test your knowledge button. Thank you in advance




Why is index.php/login.php accepted as a valid url?

I did some pentesting on a website I am helping a client with and the tools reported that there are URLs like /index.php/login.php which might be vulnerable to something. The problem is that since it is a simple php site, normally this kind of URL shouldn't be possible (there is no folder "index.php" which contains a file "login.php"). I guess I could set some filter for the URL to clean this and redirect to the first php file. The actual effect of these urls is that the browser goes in a infinite loop requesting all the files over and over ... The site is using framesets (unfortunately) and I feel like it has something to do with this, but can't find a fix for it ...

Using IIS7 with php 5.3.63




GitLab API: Get all files from each branch

Using node-gitlab I’d like to get the files of all branches for each repository via the GitLab API. So far my code in Vue.js looks like this: https://pastebin.com/8RC7sxgG. How can I accomplish this?




how much should i charge to update website using shopify

I am a graphic designer. i can design using photoshop, illustrator and know to work with html and css only.

Roughly how much should i charge to update website using shopify.

Can anybody advice me.?




mercredi 27 juin 2018

How can I create django model which implement lesson in timetable?

I'm trying to create a timetable system for classroom in Django. I have an idea which I am still wondering that i will work or not. Here is the model represent each lesson in class; lesson 1(7:00 AM - 7:50), lesson 2(7:50 - 8:40), etc.

class Lesson(models.Model):
start = models.TimeField()
end = models.TimeField()
lesson = models.PositiveSmallIntegerField(choices=[(i, i) for i in range(1, 10)], primary_key=True)

class Meta:
    verbose_name = 'lesson'
    ordering = ['lesson']

def __str__(self):
    return "{}".format(self.lesson)

What I need here is creating 10 lessons starting from 7:00 am and lasting 50 minutes each. I'd love to here your precious advises. Thank you.




Spring 4: run some initialization code before application context refresh

I am using Spring 4 (not Spring Boot) in the web application. I need to run some initialization code before any of the beans in the application context would be created. I tried to create implementation of org.springframework.context.ApplicationContextInitializer and register it in spring.factories but was not picked up for some reason. How can I do it?




which is the best option to handle views depending on the user?

I have two types of users that have almost the same view, the difference is that one of that views have a button to edit the information. Which is the best practice to manage the views? Should I create a different page for each view and redirect to the corresponding page or should I use the same page for all the profiles and handle it in the server?




I want to Automate extraction of contact list info from web pages

I am doing this data entry work. So the thing is I want to Extract Name, Company name and mobile Number from this website http://www.fpsbindia.org/scripts/CFPCertificantProfiles.aspx Which has 1828 people and 73 pages. The problem is mobile number can be extracted only when i press on "VIEW" tab next to the person. It's Just too much, going inside every Person's profile and copy their details. I need a macro to automate this process. Please help. Thank you.




Github+Heroku Configuring Sensitive Data

I want to deploy a python flask app to Heroku, but also be able to have the code on github. The problem is that my local repo contains a file with sensitive credentials. How can I deploy the repo with the credentials to heroku, and yet prevent the sensitive data from being exposed on github?




How can I move this text so there is some whitespace on the right side within the tr or td?

I need to move this over within the table row so there is some whitespace on the right of the text and padding doesn't seem to do anything.

Release of daptive Security 1.4.1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ultrices vitae auctor eu augue ut. Odio euismod lacinia at quis risus. At imperdiet dui accumsan sit amet nulla facilisi morbi. Purus sit amet volutpat consequat mauris nunc congue nisi. Adipiscing tristique risus nec feugiat. Facilisis gravida neque convallis a. Egestas dui id ornare arcu odio ut. Ac odio tempor orci dapibus ultrices in. Nibh sit amet commodo nulla facilisi nullam. Suspendisse ultrices gravida dictum fusce ut placerat orci. Gravida neque convallis a cras semper auctor neque vitae tempus. Eu tincidunt tortor aliquam nulla. Nibh tortor id aliquet lectus proin nibh nisl.

                                Dictum at tempor commodo ullamcorper. Sit amet venenatis urna cursus. Amet mattis vulputate enim nulla aliquet porttitor lacus. Lorem donec massa sapien faucibus et molestie ac feugiat. Purus sit amet volutpat consequat. Maecenas sed enim ut sem viverra aliquet. Eget arcu dictum varius duis at consectetur lorem donec. Convallis posuere morbi leo urna molestie at elementum eu facilisis. Duis convallis convallis tellus id. Morbi tempus iaculis urna id. Habitasse platea dictumst quisque sagittis purus sit. Dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras. Tellus in metus vulputate eu scelerisque felis. Sit amet aliquam id diam maecenas ultricies mi eget. Adipiscing diam donec adipiscing tristique. Molestie ac feugiat sed lectus vestibulum mattis ullamcorper velit sed. Ornare lectus sit amet est placerat in egestas. Lorem sed risus ultricies tristique nulla. Id nibh tortor id aliquet lectus proin nibh nisl. Fermentum dui faucibus in ornare quam viverra orci sagittis.

                                Posuere lorem ipsum dolor sit amet consectetur adipiscing. Mus mauris vitae ultricies leo integer malesuada nunc. Risus feugiat in ante metus dictum at tempor. Pellentesque elit eget gravida cum sociis natoque penatibus et. Rhoncus urna neque viverra justo nec ultrices. Eu mi bibendum neque egestas congue quisque egestas diam. Imperdiet proin fermentum leo vel orci. Pellentesque pulvinar pellentesque habitant morbi. A erat nam at lectus urna. Duis at tellus at urna condimentum mattis pellentesque id nibh. Sodales ut eu sem integer vitae justo eget magna fermentum. Lacus vel facilisis volutpat est velit egestas. Accumsan in nisl nisi scelerisque eu ultrices. Tellus mauris a diam maecenas sed enim. Ut placerat orci nulla pellentesque dignissim enim. Eget mauris pharetra et ultrices neque ornare. Nulla malesuada pellentesque elit eget gravida cum. Dui faucibus in ornare quam.</h3>
                        </p></h4></td>
                </tr>




web service using easyUi datagrid

I have the problem,i need to replace the .php files with my web service to bind the dategrid as in the following snippet. Maybe someone tell me exactly how the problem was solved, I just started and for me is hard to understand the explanation , please show me an example. thank you in advance

<table id="dg" title="My Users" style="width:700px;height:250px"  
            toolbar="#toolbar" pagination="true" idField="id"  
            rownumbers="true" fitColumns="true" singleSelect="true">  
        <thead>  
            <tr>  
                <th field="firstname" width="50" editor="{type:'validatebox',options:{required:true}}">First Name</th>  
                <th field="lastname" width="50" editor="{type:'validatebox',options:{required:true}}">Last Name</th>  
                <th field="phone" width="50" editor="text">Phone</th>  
                <th field="email" width="50" editor="{type:'validatebox',options:{validType:'email'}}">Email</th>  
            </tr>  
        </thead>  
    </table>  

<script type="text/javascript">  
        $(function(){  
            $('#dg').edatagrid({  
                url: 'get_users.php',  
                saveUrl: 'save_user.php',  
                updateUrl: 'update_user.php',  
                destroyUrl: 'destroy_user.php'  
            });  
        });  
    </script>  



How to call Azure Client from Node via https request?

I have VM up and running in Azure. I wanted to call Azure VM from Node. I am totally unware about the get API for Azure. So how can this be achieved?

I have tenantID, ClientID, Client Secret and subscription id.

Also is there any thing unique I can get from running VM which will be same if I create another VM on Azure?




How to remove ASP.NET MVC OKTA Forms Authentication for local test

I am working on a client solution that requires new features and functionality to be added to a cloud web application with OKTA Authentication. I've been able to create the new models, views, and controllers as per requirement, with no errors when I build the solution. When I run the application to test locally, the views load in the browser but no data and functionality, and a redirect on the URL, either running in the preconfigured DEV, STG, or PRD Azure environments.

< http://localhost:1080/AuthServices/SignIn?ReturnUrl=%2fApps%2fError >

It's not finding the authentication form, it has no user information, and the site is not loading properly. I've tried different thing, including removing the authentication all together, and setting authentication to non / in the web.config. The only thing I've not done yet is testing on the publishing side. Everything with OKTA is setup correctly as it's working fine with the last deployed version of the solution, . Non non of those configurations were changed.

How can work around or disable this entirely so that I can test the application locally?

Thanks in advance!!




Angular 6 - ProvidedIn a non root module is causing a circular dependency

I'm trying to provide a resolve service via the new "providedIn" attribute.

This is a translations resolver which i use in a protected module:

import { Injectable } from '@angular/core';

import { Observable , pipe } from 'rxjs';
import {map} from "rxjs/operators";

//This is causing: "WARNING in Circular dependency detected:"
import {ProtectedModule} from "../../../protected/protected.module";

import { HttpHandlerService } from '../../http/http-handler.service';

@Injectable({
  providedIn: ProtectedModule //Over here (I need the import for this line)
})
export class TranslationsResolverService {
  constructor(private _httpHandlerService : HttpHandlerService) { }
    resolve(): any {
      //Do Something...
    }
}

I declare the translations resolver service in the protected routing module:

import { NgModule }           from '@angular/core';
import {RouterModule, Routes} from '@angular/router';

import {AuthGuard} from "../core/resolvers/auth/auth.guard";
import {TranslationsResolverService} from "./../core/resolvers/translations/translations-resolver.service";

const routes: Routes = [
  {
    path : 'app' ,
    component: ProtectedComponent,
    resolve : {
      translations : TranslationsResolverService // <---- Over here - i can't remove that of course
    },
    canActivate: [AuthGuard],
    ]
  }
];


@NgModule({
  imports : [RouterModule.forChild(routes)],
  exports : [RouterModule]
})
export class ProtectedRoutingModule { }

Because of the fact that i import (typescript import) the protected.module in the translations-resolver.service.ts in order to use it in the providedIn attribute i get a WARNING in Circular dependency detected:

path to translations-resolver.service.ts ->

protected/protected.module.ts ->

protected/protected-routing.module.ts ->

path to translations-resolver.service.ts

The 2nd path (marked) is added due to the "providedIn attribute.

I can fix this by just providing the translationsResolver as a NgModule provider (in the providers array) but i prefer it to be an injectable provider.

Any suggestions for solving this?




How to create PHP SDK just like cloudinary php sdk

I have been going through https://github.com/cloudinary/cloudinary_php library & wish to create something similar to it,

Can you please guide me on how to create PHP SDK for clients.




Web authentication - Should I use both JWT & cookie expiry?

I am building a basic authentication back-end for a web application and I wonder if it is necessary to set an expiration time for both JWT and the cookie that stores it?

It seems unnecessary to set it separately for both when the result stays the same.

I would prefer to set just the JWT expiration because for some reason I can't access the cookie's expiration time, so I would probably have to refresh it with every request and that seems like a bad idea to me. (I am using Node.js & Express.js with the cookie-parser module.)




Make sure that the controller has a parameterless public constructor Error . CastleWindsor

Controller Installer

LicenceController




android webview logical message

xml code

<WebView
    android:id="@+id/activity_main_webview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fadingEdge="none" />


NewHomeActivity.java


public class NewHomeActivity.java extends AppCompatActivity {
    private WebView mWebView;

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

        mWebView = (WebView) findViewById(R.id.activity_main_webview);

        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);

        mWebView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });

        mWebView.loadUrl("https://www.google.com");
    }
}


Logcat Message


06-27 18:27:39.887 22256-22256/com.test I/art:    Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.eb>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/RenderProcessGoneDetail;
06-27 18:27:39.887 22256-22256/com.test I/art:     at com.android.webview.chromium.Ap com.android.webview.chromium.WebViewChromiumFactoryProvider.G(android.webkit.WebView, android.content.Context) (WebViewChromiumFactoryProvider.java:325)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:42)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.webkit.WebView.<init>(android.content.Context, android.util.AttributeSet, int, int, java.util.Map, boolean) (WebView.java:636)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.webkit.WebView.<init>(android.content.Context, android.util.AttributeSet, int, int) (WebView.java:572)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.webkit.WebView.<init>(android.content.Context, android.util.AttributeSet, int) (WebView.java:555)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.webkit.WebView.<init>(android.content.Context, android.util.AttributeSet) (WebView.java:542)
06-27 18:27:39.887 22256-22256/com.test I/art:     at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
06-27 18:27:39.887 22256-22256/com.test I/art:     at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
06-27 18:27:39.887 22256-22256/com.test I/art:     at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:645)
06-27 18:27:39.887 22256-22256/com.test I/art:     at android.view.View com.android.internal.policy.PhoneLayoutInflater.onCreateView(java.lang.String, android.util.AttributeSet) (PhoneLayoutInflater.java:58)
06-27 18:27:39.887 22256-22256/com.test I/art:     at android.view.View android.view.LayoutInflater.onCreateView(android.view.View, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:717)
06-27 18:27:39.887 22256-22256/com.test I/art:     at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:785)
06-27 18:27:39.887 22256-22256/com.test I/art:     at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:727)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:858)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:821)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.view.LayoutInflater.parseInclude(org.xmlpull.v1.XmlPullParser, android.content.Context, android.view.View, android.util.AttributeSet) (LayoutInflater.java:994)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:854)
06-27 18:27:39.887 22256-22256/com.test I/art:     at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:821)
06-27 18:27:39.887 22256-22256/com.test I/art:     at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:518)
06-27 18:27:39.888 22256-22256/com.test I/art:     at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:426)
06-27 18:27:39.888 22256-22256/com.test I/art:     at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:377)
06-27 18:27:39.888 22256-22256/com.test I/art:     at void android.support.v7.app.AppCompatDelegateImplV9.setContentView(int) (AppCompatDelegateImplV9.java:287)
06-27 18:27:39.888 22256-22256/com.test I/art:     at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:139)
06-27 18:27:39.888 22256-22256/com.test I/art:     at void com.test.home.NewHomeActivity.onCreate(android.os.Bundle) (NewHomeActivity.java:55)





Why adding a class for "select-option" field makes "disabled" function not working?

I am working on a php project. After adding class "chosen-select" for the field. The disable function does not working. If it is without the "chosen-select" class, it performed disabled function very well but there is no css style for the field anymore. Is there any expert who is willing to give some valuable comment to me? Please!!

Here is my code:

            <div class="col-lg-6 col-md-6 col-sm-5 col-xs-12">
                <div class="field-holder">
                    <input type="text" placeholder="<?php _e( 'Restaurant Name', 'foodbakery' ) ?>" name="search_title" id="search_rest" onkeyup="disableDropDown()" value="<?php echo esc_html( $search_title ) ?>">
                </div>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-5 col-xs-12">
                <div class="field-holder">
                    <div class="select-holder">
                        <select data-placeholder="" class="chosen-select" id="search_cusine" name="search_cusine" onchange="disableTextField()">
                            <?php
                            global $foodbakery_plugin_options;
                            $selected_fileds = isset( $foodbakery_plugin_options['default_cousins_list'] ) ? $foodbakery_plugin_options['default_cousins_list'] : '';
                            foreach ( $selected_fileds as $val ) {
                                $restaurant_type_cate = get_term_by( 'slug', $val, 'restaurant-category' );
                                echo '<option value='. esc_html( $restaurant_type_cate->name ) .'>' . esc_html( $restaurant_type_cate->name ) . '</option>';
                            }
                            ?>
                        </select>

                        <script>
                            function disableDropDown() {
                                var x = document.getElementById("search_rest").value;
                                if (x != ''){
                                    document.getElementById("search_cusine").disabled= true;

                                }
                                else{
                                    document.getElementById("search_cusine").disabled = false;
                                }
                            }
                        </script>
                    </div>
                </div>
            </div>




mardi 26 juin 2018

Execute Code after firestore get method is finished

I know that using java (android) you can execute code after the get method is finished, is that also possible when using javascript?

Here is my code:

      mColRef.get().then(function(querySnapshot){
          querySnapshot.forEach(function(doc) {
              console.log(doc.id);
          });
      });

Can I do something like this? Or how would you code something like this for web (javascript)?

     mColRef.get().then(function(querySnapshot){
          querySnapshot.forEach(function(doc) {
              console.log(doc.id);
          });
      }).OnCompleteListener(new OncompleteListener ....

Thanks for your help!




Can I deploy a game writen in python into a website? [on hold]

I've been programming on pyhton and java for a while (Almost 2 years, studing CS currently) and now that I have some free time on summer and a website domain + it's hosting that I gotten a year for free I thought about making a game ( Let's say tetris) to deploy on the website (Which I'll code, maybe with Django).

Can I code in python and deploy the game like that? If so how?

I guess it's not possible so..Could I have some guidance as for where to start guiven what I already 'know'?

Any help is appreciated! Thanks in advance!




Downloading/uploading a file/folder directly from/to a docker container running on a web host to/from a local machine using SCP

So far, I have always copied files from the docker container to my VM first (web host), and later, run scp command line from my local machine to download it from the VM. Similar scenario happening for uploading files/folders. Is there a way to direct way to do that using scp?




Angular 5 - ag-grid 18.0.1 - edge crash

I've been searching everywhere and was unable to find any information related to this- most likely because ag-grid update 18.x is new. Anyhow: It appears that after updating ag-grid from 17.1.1 to 18.0.1, any page with the ag-grid on it ends up crashing EDGE and IE. Chrome works fine. (There have always been performance issues with EDGE and IE but now ag-grid fails to even load). My current project is using: Angular 5 in VSCode, AG-GRID, etc. An error I was able to view in the console was "onGridResize" no longer exists; However I am not calling this event what-so-ever. So this appears to be something that has fallen off internally? Any help would be appreciated. Thanks!




Custom JS Keyboard

I'm trying to add my own keyboard to my website. So far, I have the keyboard, but the problem is with the input field. At first the system keyboard would show up and override mine. So I added readonly to the code, but that seems to disable the field completely. Is there any way to oppress the system keyboard while keeping the input field alive?




goNative - are external links being cached somewhere?

We've been using goNative to wrap our mobile website in a mobile app (android & IOS). some of our links need to be opened in native browser (using window.open()). since we do not want our users to login again in the mobile browser (they're logged-in in our app) we're sending a uuid in the url query params to identify those users. so the URL will look like this:

https://ift.tt/2tvIdX0

our problem: it seems like when we have higher traffic, a user will request page

https://ift.tt/2tvIdX0

but this page will open:

https://ift.tt/2yJIjj3

did anybody encountered this problem? or might have an idea about a solution?




I have a project which i dont know what it is made from

Picture of the project I received

So I received this project from another company, which we are not in contact with now I would just like to know what kind of project this is so that I can try to find out it's working, from the looks of it it seems to be a web app but I would like to know the exact IDE used to make this. any help would be appreciated thanks.




Chromium - "Failed because the user didn't interact with the document first" in chrome?

Ok, autoplay on visit used to work on our site. However now, we are getting:

play() failed because the user didn't interact with the document first

How come autoplay works on Youtube though? For instance on open video in new tab.

Using HLS.js it no longer work.

What is Youtube doing that we could do here?




TCPDF is not downloading

I use TCPDF for generate some PDF files and save it on PC. But it's save on server where is my website folder.
I need to save files to PC. when i work on local server (OpenServer), its works ok. The path is set in $_POST, becouse i use AJAX for generete pdf How to fix it?

Code:

require_once('tcpdf/tcpdf.php');


$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);


$pdf->SetCreator('God');
$pdf->SetAuthor('God');
$pdf->SetTitle('Contract');
$pdf->SetSubject('Contract');

$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);


$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);

$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);


$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
    require_once(dirname(__FILE__).'/lang/eng.php');
    $pdf->setLanguageArray($l);
}

$pdf->setFontSubsetting(true);

$pdf->SetFont('dejavusans', '', 14, '', true);

$pdf->AddPage();

$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));

 ob_start();
        include "page1.php";
        $content = ob_get_clean();
$html = $content;

$pdf->writeHTML($html, true, false, true, false, '');
$pdf->AddPage();

 ob_start();
        include "page2.php";
        $content = ob_get_clean();
$html = $content;

$pdf->writeHTML($html, true, false, true, false, '');
$pdf->AddPage();

 ob_start();
        include "page3.php";
        $content = ob_get_clean();
$html = $content;


$pdf->writeHTML($html, true, false, true, false, '');
$pdf->AddPage();

$dirname = $_POST['dirname'];
$path = $_POST['path'] . $dirname . '\ ';
mkdir($path, 0700);

$filename = $_POST['filename'] . '.pdf';

$pdf->Output($path . $filename, 'F');




fichiers MS Word dans le web J2EE **Spring/JSF

comment je peux développer un module permettant la manipulation des données d'une base de données MySQL avec des fichiers MS Word dans le web J2EE Spring/JSF"? ?

need help plz




Using StencilJS components with another StencilJS component

my general question is, how can i use a stencil built component within another stencil component. Not in the PWA toolkit but in another Component.

More specifically the component i want to use is not on npm, but on a private bitbucket repo. In its package.json there is prepare script ("prepare":"stencil build"). i then add the component to the parent component in the package.json with a git link. when i run npm install child-component, it fetches the component from bitbucket and builds it with the prepare script. this is working fine. but how do i add a component to be loaded? someone in the slack channel told me i have to copy the built component from node_modules to the build directoy myself and add an import statement to the root parent component. this is also kind of working. i can see that the child-component.js is fetched when the webapp starts, but it doesn't get rendered.

does anyone have a clue what the problem could be? i also wasn't able to add any component from https://stencilcomponents.com. if someone can tell me how to do that, i can probably figure out how to do it with my private bitbucket repo.

thanks in advance and i appreciate any input you might have!




php $_Get ["variable"] isn't set even though it should be [on hold]

in my php file I have this:

<script>var editMode = 
<?php if(isset($_Get["e"])){
        if($_Get["e"]){
            echo "true";
        }else{
            echo "false";
        }
    }else{
        echo "0";
    }
?>;</script>

but when I visit the page with (my domain name)/EditMap.php?e=true the php code executed the echo "0" line which means for some reason it isnt getting the value of e from the url.




lundi 25 juin 2018

How to arrange correctly?

My code: https://codepen.io/Jeerjmin/pen/VdBVKL

<div class="container">

</div>

Problem 1:

I'm trying to crop the top left corner of banner's did, but they moving.

Problem 2:

span with class="dot" should form a colored circle, but should not.




Use sweetalert javascript function in jsp

I am working on a login page that needs to show an alert of successful login before redirecting to another html page. I have written my code using jsp. I want to use sweet alert for the same but doesn't seem to be working.

<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
     <script
        src="https://code.jquery.com/jquery-3.3.1.js"
        integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
        crossorigin="anonymous"></script>
     <script src="sweetalert2.all.min.js"></script>
        <!-- Optional: include a polyfill for ES6 Promises for IE11 and Android browser -->
        <script src="https://unpkg.com/promise-polyfill"></script>
        <link rel="stylesheet" href="sweetalert2.min.css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
 <%
     String account_no="1";
     int old_balance=0;
     int new_balance=0;
     Connection con = null;
     PreparedStatement pst=null;
     ResultSet rs = null;
     int amount=Integer.parseInt(request.getParameter("deposit_amount"));

     try {


             Class.forName("oracle.jdbc.driver.OracleDriver");
             con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/XE", "HR", "HR");


             pst=con.prepareStatement("SELECT * FROM CUSTOMER WHERE ACCOUNT_NO=?");
             pst.setString(1,account_no);
             rs=pst.executeQuery();

             while(rs.next())
             {
             old_balance=Integer.parseInt(rs.getString(3));
             out.println(old_balance);
             }

            new_balance=old_balance+amount; 
            out.println(new_balance);
            pst=con.prepareStatement("UPDATE CUSTOMER SET BALANCE=? WHERE ACCOUNT_NO=?");
            pst.setInt(1,new_balance);
            pst.setString(2,account_no);
            pst.executeUpdate();

 %>
            <script>
                $(document).ready(function(){
                    swal(
                        'The Internet?',
                        'That thing is still around?',
                        'question'
                        );
                });
            </script>
            <jsp:forward page="home2.html"></jsp:forward>
            <%

            }


            catch (Exception e) {
                out.println(e.getMessage());
           }


        %>
    </body>
</html>

In the script i have tried to use sweetalert but am unable to execute the same. The database part works fine but this jsp shows blank on webpage and even the forward doesnt work




The reason why webGL produces so many minor page faults?

I'm studying linux kernel, but I don't know much about web.
I saw some WebGL samples on browser(http://webglsamples.org/), and I tested it with perf, which is performance analysis tool of linux.
What I saw was excessive number of minor page faults(about 10000~100000).
I traced these minor page faults and found that these faults occurs when accessing the allocated memory space for the first time.
This means WebGL applications repeatedly do following process.
1. Allocate memory space
2. Do computation
3. Free memory space

I'm trying to analyze the reason of these phenomenon.
But I know nothing about web environment, java script, and something like that... Anyone can give some hints about this?
Why does WebGL application excessively repeat allocate/free memory space?




Chatbot development technology without AI

I need to develop a chatbot, many frameworks exist, but according to what I’ve found all technologies suppose some machine learning. My chatbot is supposed to be stupid, fully programmed, meaning, it should have a closed list of trigger phrases and pre-defined responses to those phrases. Another addition, it should have some sort of an inner memory to store the data received from the human chat participants. Do you know of any existing framework based on Facebook or Google Hangouts? Or any other platform? Python, Ruby, Perl, C#, Angular... My backup plan is to develop a web chat from scratch, but I decided to ask you guys first.




Fetch multiple images from the server using Django

I am trying to download multiple image files from the server. I am using Django for my backend. Question related to single image has already been answered and I tried the code and it works on single image. In my application, I want to download multiple images in a single HTTP connection.

        from PIL import Image

        img = Image.open('test.jpg')
        img2 = Image.open('test2.png')

        response = HttpResponse(content_type = 'image/jpeg')
        response2 = HttpResponse(content_type = 'image/png')

        img.save(response, 'JPEG')
        img2.save(response2, 'PNG')

        return response #SINGLE

How can I fetch both img and img2 at once. One way I was thinking is to zip both images and unzip it on client size but I dont think that is good solution. Is there a way to handle this?




Dynamically Create Select Input Field

I am having an issue while trying to create a Materialize select input field dynamically using jQuery. My goal is to append a div with a select field when a button is clicked. Here is my current code:

$(document).ready(function(){
  $('select').formSelect();
});

$("#addSelect").click(function(){
   $("#addSelect").addClass("disabled");
   $("#addSelect").hide();    
   $("#newContent").append("<div class='row'><div class='input-field col s12'><select> <option value='' disabled selected>Choose your option</option><option value='1'>Option 1</option><option value='2'>Option 2</option><option value='3'>Option 3</option> </select><label>Materialize Select</label><label>Materialize Select</label></div></div><button class='waves-effect waves-light bg-blue btn right' type='button'>Go</button>");  
});
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<div class="container">
<div id='newContent'></div>
<br>
<button class="waves-effect waves-light bg-blue btn right" id="addSelect">Add Select</button>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js"></script> 

It adds all the html for the select when I inspect the element, however the select doesn't work. Maybe it's a css issue?

Thanks for any help!




how to make a json web api secure

I am trying to make an app with react-native that displays data from a excel database. So far I have converted the data from excel to JSON and created a JSON web api to access the data from a URL using myjson.com. It works great to retrieve and filter the data but my only worry is that the data is not secure at all. Anyone can see the JSON array if they type in the URL. I am definitely not going to stick with myjson.com to store my data. I am probably going to host it using some service. My concern is that even hosting the data myself, the website will not be secure. How can I add some sort of authentication security to the website so that only people that use my app can view the data?




Guess password databases MYSQL

Ill Trying to password guessing it is true the password is nakama. But important to use the apps for pentesting the web pages. I'm wrong in the username the username is boo_nakama_kijen. For support them I request the tools for doing am I to cracking this. Thanks




TypeError: 'method' object is not iterable in python3.6 flask framework

Hi i'm a student and learning python :) currently i was practicing flask for web api's . when ever i post request for form data using "postman". i got the following exception i have searched for possiblities for TypeError but those could not help me

  • Running on http://127.0.0.1:5959/ (Press CTRL+C to quit)
  • Restarting with stat
  • Debugger is active!
  • Debugger PIN: 241-358-774 127.0.0.1 - - [25/Jun/2018 18:06:38] "POST /users/register HTTP/1.1" 500 - Traceback (most recent call last): File "/usr/bin/python3./lib/python3.6/site-packages/flask/app.py", line 2309, in call return self.wsgi_app(environ, start_response) File "/usr/bin/python3./lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app response = self.handle_exception(e) File "/usr/bin/python3./lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/bin/python3./lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/bin/python3./lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/bin/python3./lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/bin/python3./lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/bin/python3./lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/bin/python3./lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/bin/python3./lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "/root/Desktop/python_practice_price_alert/src/models/users/views.py", line 35, in register_user if User.register_user(email, password): File "/root/Desktop/python_practice_price_alert/src/models/users/user.py", line 49, in register_user User(email, Utils.hashed_password(password)).save_to_db() File "/root/Desktop/python_practice_price_alert/src/models/users/user.py", line 63, in save_to_db Database.insert("users", self.json) File "/root/Desktop/python_practice_price_alert/src/common/database.py", line 15, in insert Database.DATABASE[collection].insert(data) File "/usr/bin/python3./lib/python3.6/site-packages/pymongo/collection.py", line 2941, in insert check_keys, manipulate, write_concern) File "/usr/bin/python3./lib/python3.6/site-packages/pymongo/collection.py", line 631, in _insert blk.ops = [(message._INSERT, doc) for doc in gen()] File "/usr/bin/python3./lib/python3.6/site-packages/pymongo/collection.py", line 631, in blk.ops = [(message._INSERT, doc) for doc in gen()] File "/usr/bin/python3./lib/python3.6/site-packages/pymongo/collection.py", line 609, in gen for doc in docs: TypeError: 'method' object is not iterable



Distinguish between a first GET and repeated GET after Back Button press

I'm working with an e-commerce website with configurable items. When a user arrives at the first step of an item configurator (with a GET request), it is assumed he is starting to configure a new item (instead of editing a previously configured item), unless the URL query string contains edit=1.

However, when the user is at step 2 and presses the browser Back Button, I also want the user to continue editing the configurable item instead of configuring a new item.

This is not an issue for step 3 and up, because when a user arrived at these steps, the requests are POSTs, and not GET.

How can I distinguish (server-side) between a user GET-requesting the first step for the first time, and when the browser Back Button has been pressed?

There seems to be a difference between the two GET requests when it comes to having Cache-control headers, but I haven't been able to reliably distinguish between the two based on that alone.

Note that the described behavior differs somewhat between browsers: Chrome and IE repeat the first GET request when the back button is pressed; Firefox seems to retrieve everything from cache without a request.