jeudi 31 mai 2018

Image mosaic with html/css fill the space

I'm trying to make an "image mosaic" that consists mostly of images of the same size, and some of them the double height.

They all should align neatly like this:

enter image description here

But still like this: enter image description here

I know is more "easy" do this with divs and "float:left" but i have to do with list.

Someone had i idea how can i fix this?!




How to place advertisements on each side of a button

I've been trying to find out how to do this for ages and tried a couple of methods but it's never worked.

I'm looking to do this: https://www.load.pics/5b1037a99c2a6/

So Google Ads can be placed on each side of the button (left) and (right)

Kind Regards, Ben




Revealing text on a dotted navigation slide

I have created a website here: http://www.jeffwong.ca/jeffs/animate.html My question is, when you click the second dot, I want to scroll the mouse wheel down and have each of the "Text Reveal 1, Text Reveal 2, Text Reveal 3" to show up while staying on the SAME DOT. Then after scrolling the mouse wheel for the fourth time, I want the slide to move to the next dot.

How do I do this with javascript or any plugins? I am new to this community so please don't burn me! Thanks




Lazy loading with DOM preview

Last years have been emerging websites such as youtube and twitch, with an interesting loading that appears to be lazy loading.

How is this "feature" called and how can we achieve such smooth loading ?

enter image description here




How to download hidden site source?

I want download the html of this site: https://launchpad.animaapp.com/preview/2Fp6yhg/dreamsharedesktop

how can I do? I tried with httrack but the html isn't returned




Ghost theme static webpage

Right now im starting with my own personal blog, im doing this with Ghost, im developing my own theme based on casper, the blog is also my personal site, so i want to have a static page were i can upload all the reveal.js presentations that i've done (myblog.com/talks), like a list of presentations, right now i have my page-talks.hbs on my theme folder, but i wanna know of how can i upload all the static content from reveal.js, is there any way for doing this? i've tried putting the html files directly inside the themes folder but i get 404 error when trying to access the url.




The security token cannot be authenticated or authorized in WSE2 web services

Security token error

Please check on this issue. Application is running in dot net version 4.5. The web service is working fine on dot net version 1.1 and when migrated I am facing this issue. Request you to help on this. Please find the error screenshot above.




Database Connection with PHP

I am creating a website app. I am trying to send data to the database, but I got the error This page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500

After a long time trying to find the error I wasn't able to fix it and I was wondering if you could help me.

Here you have the code.

reportcreated.php

<?php
if (isset($_POST[`name`])) {
  $name = $_POST[`name`];
}
if (isset($_POST[`last_name`])) {
  $last_name = $_POST[`last_name`];
}
if (isset($_POST[`email`])) {
  $email = $_POST[`email`];
}
if (isset($_POST[`issue`])) {
  $issue = $_POST[`issue`];
}
if (isset($_POST[`imageReport`])) {
  $imageReport = $_POST[`imageReport`];
}
if (isset($_POST[`date`])) {
  $date = $_POST[`date`];
}
if (isset($_POST[`location_lat`])) {
  $location_lat = $_POST[`location_lat`];
}
if (isset($_POST[`location_lon`])) {
  $location_lon = $_POST[`location_lon`];
}
if (isset($_POST[`address`])) {
  $address = $_POST[`address`];
}
  try {
    require_once('../functions/db-conection.php');
    $sql = "INSERT INTO `reporte` (`issue_id`,`name`, `last_name`, `email`,`issue`, `imageReport`, `date`,`location_lat`, `location_lon`,`address`)";
    $sql .= "VALUES (NULL,'{$name}','{$last_name}','{$email}','{$issue}','{$imageReport}','{$date}','{$location_lat}',{$location_lon},{$address}); ";
    $result = $conn->query($sql);

  } catch (Exception $e) {
    $error = $e->getMessage();
  }
  ?>
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">


    <header>

    <h2>CityLife</h2>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8">
    <style>
        #map {
           height: 100%;
         }
         /* Optional: Makes the sample page fill the window. */
         html, body {
           height: 100%;
           margin: 0;
           padding: 0;
         }
       </style>
    </header>

    <style>
    body {margin:0;}

    h2 {
      background-color: #000033;
      color: white;
      width: 100%;
      height: 33%;
      margin: auto;
      align-content: center;

    }


    .addReport {
      overflow: hidden;
      background-color:     #000033;
      position: fixed;
      bottom: 0;
      width: 100%;
      align-content: center;
    }

    .addReport a {
      float: left;
      display: block;
      color: #ffffff;
      text-align: center;
      padding: 30px 72px;
      text-decoration: none;
      font-size: 17px;
      width: 100%;
    }

    .addReport a:hover {
      background: #cccccc;
      color: white;
    }

    .addReport a.active:hover {
      background-color:     #ffffff;
      background: #cccccc;
      color: white;
    }

    .main {
      padding: auto;
      margin-bottom: 30px;
    }
.form {
  margin: 16px;
  width: 100%;

}
.input {
  margin-left: 16px;
  border-style: black;
  width: 100%;
}


    </style>

  </head>
  <body>

  <form action="reportcreated.php" style="margin: 16px" method="post">
    First name:<br>
    <input style="border-color:gray" type="text" id="nameid" name="firstname" value="" placeholder="First Name" for="name">
    <br>
    Last name:<br>
    <input style="border-color:gray" type="text" id="last_nameid" name="firstname" value="" placeholder="Last Name" for=last_name>
    <br>
    Email Address:<br>
    <input style="border-color:gray" type="text" id="emailid" name="email" value="" placeholder="Email Address" for="email">
    <br>
    Issue:
    <br>
    <select id="issue" name="issues" for="issue">
   <option value="#"></option>
   <option value="#"></option>
   <option value="#"></option>
   <option value="#"></option>
 </select>
    <br><br>
    <input style="border-color:black" type="button" onclick="window.history.go(-1); return false;" value="Cancel">  <input style="border-color:black" type="submit" value="Submit" value="Geocode">

  </form>

  </body>
  <script src="../JS/reportscript.js"></script>
  </script>
  <script async defer
  src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBFGBXCr32GmNkG_TAo76JWn4b0nprnukY&callback=">
  </script>
</html>

report.php

<?php
if(isset($_POST[`name`])) {
  $name = $_POST[`name`];
}
if(isset($_POST[`last_name`])) {
  $last_name = $_POST[`last_name`];
}
if(isset($_POST[`email`])) {
  $email = $_POST[`email`];
}
if(isset($_POST[`issue`])) {
  $issue = $_POST[`issue`];
}
if(isset($_POST[`imageReport`])) {
  $imageReport = $_POST[`imageReport`];
}
if(isset($_POST[`date`])) {
  $date = $_POST[`date`];
}
if(isset($_POST[`location_lat`])) {
  $location_lat = $_POST[`location_lat`];
}
if(isset($_POST[`location_lon`])) {
  $location_lon = $_POST[`location_lon`];
}
if(isset($_POST[`address`])) {
  $address = $_POST[`address`];
}
if(isset($_POST[`report_type`])) {
  $report_type = $_POST[`report_type`]
}
  try {
    require_once('../functions/db-conection.php');
    $sql = "INSERT INTO `users` (`user_id`, `name`, `last_name`, `email`) ";
    $sql .= "VALUES (NULL, '{$name}, '$last_name', '$email'); ";
    $result = $conn->query($sql);

  } catch (Exception $e) {
    $error = $e->getMessage();
  }
  ?>
<!DOCTYPE html>
<html>
  <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">


    <header>

    <h2>CityLife</h2>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8">
    <style>
        #map {
           height: 100%;
         }
         /* Optional: Makes the sample page fill the window. */
         html, body {
           height: 100%;
           margin: 0;
           padding: 0;
         }
       </style>
    </header>

    <style>
    body {margin:0;}

    h2 {
      background-color: #000033;
      color: white;
      width: 100%;
      height: 33%;
      margin: auto;
      align-content: center;

    }


    .addReport {
      overflow: hidden;
      background-color:     #000033;
      position: fixed;
      bottom: 0;
      width: 100%;
      align-content: center;
    }

    .addReport a {
      float: left;
      display: block;
      color: #ffffff;
      text-align: center;
      padding: 30px 72px;
      text-decoration: none;
      font-size: 17px;
      width: 100%;
    }

    .addReport a:hover {
      background: #cccccc;
      color: white;
    }

    .addReport a.active:hover {
      background-color:     #ffffff;
      background: #cccccc;
      color: white;
    }

    .main {
      padding: auto;
      margin-bottom: 30px;
    }
.form {
  margin: 16px;
  width: 100%;

}
.input {
  margin-left: 16px;
  border-style: black;
  width: 100%;
}


    </style>

  </head>
  <body>

<div class="reportCreated">
  <h1>Report Created</h1>

  <div class="content">
  <?php
    echo $sql;
   ?>
 </div>

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

db-conection.php

<?php
  $conn = new mysqli('localhost', 'root', 'root', 'RoystonApp');

  if ($conn->connect_error) {
    echo $error = $conn->connect_error;
  }

 ?>

Thank you!




Looking for a Web based reporting engine that also has web based designer that will work in asp .net

We have an asp.net application that is currently using RDLC reports and providing them to the users as pdf's. It works fine but the ability to modify/customize the reports for our clients is quite time consuming.

Can anyone recommend a tool that we could implement (paid or free) that would allow for pdf report generation with a web based report design tool that would allow our clients to customize (or maybe even setup) their own reports in the browser?

We have found Stimulsoft and DevExpress have tools that look like they meet the requirements but I wanted to put it out to the community here to see what you recommend / have experience with.




Host mail server and website on different machines under one domain

Is there a way to host mail server for certain domain on different machine.

For example: If I own website.com and it is hosted on PC1 what are the requirements to make mail.website.com and host it on PC2.

I am planning to use Linux Ubuntu-postfix-squirrel mail...




How do I write a uwsgi config.ini to serve a simple python script

I am using nginx + uwsgi to serve a python script. I have successfully served the python by by configuring uwsgi through command line using the following command:

uwsgi --plugins syslog,python  --socket 127.0.0.1:3031 --logger syslog:configApi --wsgi-file foobar.py &

How do I achieve the same using a config.ini file?

The content of my python script is just simply printing out "Hello World"

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return ["Hello World"]

Please share some insights if you know how to do this. Million thanks in advance.




How can the standard address fields in the contacts section be shown?

How can the standard fields for address in the contacts' table be shown in ForceManager?

In the past they used to be active, but they are hidden now.




Manual slider : each slide displays different data from MYSQL database

I am new in web developpement and I want to build a small website which is a manual slider that each time, is going to display different data from a table when a slide is swiped left or right, using php I made the queries and I can only display one result for the moment as I don't know what to do next.

I can't seem to get how to do this part. I have already done the HTML & CSS too. Let me know if you need anything else.

PS: i didn't find a related topic, reason why I am posting...

Thanks in advance




How to block IP address for certain period of time (24 hours)

I have a website page that will, on visit, redirect you to random picture from my website using this script:

    <script type="text/javascript">
var urls = new Array();
urls[0] = "http://localhost/dir/wp-content/uploads/2018/05/logo.png";
urls[1] = "http://localhost/dir/wp-content/uploads/2018/05/logo2.png";
urls[2] = "http://localhost/dir/wp-content/uploads/2018/05/logo3.png";
var random = Math.floor(Math.random()*urls.length);

window.location = urls[random];

</script>

But, before that I want to limit users so that they can visit my page only once per day (24h) by blocking their IP address.

Is that doable or there is a better way?




Jquery Array.find() not working

I am using ASP.NET MVC 5 and Jquery 3.3.1. I have the following code:

var r =   $("#MultiSelectDialog_List").attr("data-object");

where r is an array of objects. I am trying to find and object by ID so I wrote:

r.find(x => x.ID == "5").ID;

but when debugging in the browser,an error is thrown (find is not a function) also the intellisense does not show the find() but shows all other JQuery functions




php web application not responding

so i have a problem with my php application. i have an inventory management system and i hosted this on my shared hosting environment, but at times the application crashes

Error message thats the error message i get from chrome.

how i get this error is when i add data to the database, but it doesn't happen always. so i really cant find out the error. or is it the way i have written the code. i am a software engineering student so i am still learning. any advice would be great

Thank you in advance.

And this is the code that i use to enter the stock to database.

                   if(isset($_POST['Submit'])){
                   $ProductName = $_POST['ProductName'];
                   $Quantity = $_POST['Quantity'];

                    $datetime = date('D Y-m-d h:i:s A');

                    $sql = "select * from products WHERE PRODUCT_DESC = '".$ProductName."'";
                    $data = mysqli_query($dbCon,$sql);

                      while($record = mysqli_fetch_array($data)){

                        $sqlGetStock = "select PRODUCT_STOCK from stock WHERE PRODUCT_DESC = '".$record['PRODUCT_DESC']."'";
                        $dataGetStock = mysqli_query($dbCon,$sqlGetStock);

                        while($recordGetStock = mysqli_fetch_array($dataGetStock)){
                          $addStock = $Quantity + $recordGetStock['PRODUCT_STOCK'];

                          $sqladdStock = "UPDATE stock SET PRODUCT_STOCK='".$addStock."' WHERE PRODUCT_DESC = '".$ProductName."'";
                          $dbCon->query($sqladdStock);



                          }

                        }


                   header('location: ../add-stock.php');


                      }




EF 6.2 - table with 2 navigation properties referencing to 1 table

I use EF 6.2 Database first. I have table dbo.Users and table dbo.Friends.

dbo.User:
ID (PK)
FirstName
LastName


dbo.Friends
FriendshipID (PK)
UserId
FriendID

both of UserID and FriendID are references as ForeignKey to dbo.User - ID. Then I have 2 virtual properties on Class Friends

public virtual User User_FriendID { get; set; }
public virtual User User_UserID { get; set; }

Selecting data and navigation properties works well. When I add a new record to table dbo.Friends

Friends fs = new Friends { UserId = 1, FriendId = 2};
entities.Friends.Add(fs);
entities.SaveChanges();

Code entities.Friends.Add(fs) creates a new record and fill only public virtual User User_UserID { get; set; } and that is the problem because I need both virtual properties filled.

proof of problem

Can anyone solve it?




how i can start modify Web application

What is the way to download and upload a Web application on my computer, where I started doing this and I got the problem when i g this http://localhost/CI/ show white screen




Make new friends by searching location of fixed radius around you

I want to build a application in which user can see his/her friend's location. Also user can search,find and make new friends by fixing some radius in Km (the user is at the center of the circle). So that user can see new friends available around him and shows this on sceen. How to do that, thanks in advance.




prevent overlaps between draggables div that have the same class

i have a schedule web , i have week table and some draggable div that have a class name is "Block" so when i drag and drop this block , when i drop a block over another block in the week table , these 2 block are overlapping how do i prevent this overlapping ? [this is the overlapping of my dragging any idea to prevent this cinflict? thank you `

                <tr class="table-info">

                    <%    for (int j = 0; j < 6; j++) {
                    %>
                    <td id="cell<%=i%><%=j%>" class="cell" style="width: 150px; height: 20px;"></td>
                    <%}  %>
                </tr>
                <%}%>
            </table>`][1]




how to connect to a server running on computer using computer's IP address?

I am working on IOT project in which I have to change some variables(fans speed, lights, etc). So just as a starter, I created a node.js server and tried to send requests to the server through a local network using local IP as

http://localhost:7000/users=mandar?lights=OFF

or

http://192.168.43.248:7000/users=mandar?lights=OFF

and it works fine.

Now I want to do the same over the internet. So I got Computer's IP address from https://www.google.co.in/search?q=myip and tried to send a request to the following URL:

http://(IP_address):7000/users=mandar?lights=OFF

This time it keeps on loading and finally shows this site can't be loaded. So what is the right way to connect to the server through the internet? Thank you.




How to scrape the website using requests?

I was trying to scrape the data from this website I am not able to scrape the website because username input does not have a name attribute.

My code is : import requests session = requests.Session() params = {'username': '<my_username>', 'password': '<my_password>'} s = session.post("https://bpofulfillment.com/Content/BpoLogin/Login.html#/Default", params) in this code username and password are the values of name attribute of input tag. But the problem is there is no name attribute. what should I do now to login




How to make a "Staggered Grid" in Semantic UI

I am using Semantic UI for the CSS styling and couldn't find any documentation regarding a staggered grid view. Has anyone implemented it yet or any ideas how to? Thanks!




C# code Trying to get response from server, response.header[location]

I am executing a link in the browser and after entering the credentials i get a response from the server in URL. I can see the response in developer tools in browser, but not able to fetch in my code. The response is coming under response.header[location], but it throws an exception. I am not able to read response. Can anybody help me in getting response using HTTP Listeners.




How to make a custom URL

Suppose my URL like "http://localhost/news/Slavo/virsion/sitefinity-sdk-was-released".

i want to display this url like "http://localhost/news/Slavo/006".

How can i do this..?

actually i want to use this solution when i setect a option to goto a new page.

<script type="text/javascript">

    function changeFunc() {
        var selectBox = document.getElementById("selectBox");
        var selectedValue = selectBox.options[selectBox.selectedIndex].value;
        // alert(selectedValue);
        if( selectedValue =="Others"){
            alert(selectedValue);
            // goto a new page;
            $url  = "http://localhost/new/select_university.php";
            $replace = array("http://localhost/new/", ".php");
            $by   = array("http://localhost/new/NewPage", ".php");


            $newurl = str_replace($replace, $by, $url);
            window.location.href = $newurl;
        }
    }



<select id="selectBox" onchange="changeFunc();">
    <option value="001">001</option>
    <option value="002">002</option>    
    <option value="Others">Others</option>
</select>




real-time web application development - suggestions

I know this is going to be a very broad question. I have seen similar questions but the answers are too old when compared to current technologies.

I need to find the best technology stack to develop a highly scalable,real-time web application similar to twitter engine. main functionalities are:

  1. Site pushes posts like news contents (with infinity scrolling in mind).
  2. millions of concurrent viewers can browse and post their comments,images and videos too.
  3. should be fully responsive on all devices.

I know node.js can handle millions of requests per minute. This project would also expects around "100 million user requests per Month". Please help me to find the best technology stack from node, angular, react, express with mongoDB, etc.. except Python and PHP (we are into Java).

Thank you very much.




Laravel Video Tag only get Auio not show picture

I got this error by this code.I think code is ok ,what wrong in video. Only hear audio ,not see picture. Please suggest me. [https://i.stack.imgur.com/pMJvR.png]

    <video width="450" height="300"  controls >

     <source src="" type="video/mp4">
     <source src="" type="video/ogg">
        Your browser does not support the video tag.

   </video>




mercredi 30 mai 2018

How to write a general height-altering javascript function

You can write something like

function changeHeight() {
    document.getElementById('chartdiv').style.height = "200px"
}
<button type="button" onClick="changeHeight();"> Click Me!</button>

But if you would have a second div with the same id and a button it would still alter the height of the first element when pressing the second button. Is it possible to write a more general method that you can apply on all elements?




How to access files over htdocs with javascript


I'm actually coding a website to access my data stored on my NAS.
This NAS is also the host.

So my folders seems like:

/data/music  
/data/images   
/www/index.php  
/www/script.js

I made a file explorer with ajax requests and php,
and I want to create a mp3 player which play when we click on a mp3 file, in the file explorer.

So my question is,

How to accede the mp3 file stored outside the www folder, with a client side language ?




Does in-browser routing is safe?

There are multiple ways for routing and redirection, but considering between two below:

  1. In-browsing routing via js (some frameworks like react-router). It requires some code, that will parse server response and make redirection based on status code.
  2. Automated redirection from server based on 302 status code. No need to manually redirect clients url.

The second one is hard to achieve if client is on the another domain (CORS).

The question: does it safe to use first approach in comparison to second one (because first approach stores redirection urls and logic on the client side)?




Is it possible to set a cookie for static resources like css and js files? If yes, how?

I wanted to do this because as what Google PageSpeed Performance Tester suggested to improve my website's performance more, I should "Serve static content from a cookieless domain" and it lists out my css and js files. If it is possible, how am I able to implement this especially that I am using a JQuery and CodeIgniter framework?




JQGrid custom formatter edit link/button to show a cancel button

I am currently working with asp.net to develop a page where the user will interact with a jqgrid. I have a custom formatter in place which has displayed an edit/save link.

I currently have this

return "<a href='javascript:void(0)' class='anchor usergroup_name link' onclick=\"editRow('" + rowobject.id + "')\">" + 'edit' + "</a>" +" | "
              +"<a href='javascript:void(0)' class='anchor usergroup_name link' onClick=\"saveRow('" + rowobject.id + "')\">" + 'save' + "</a>";

How would I make it so when the user clicks the edit hyperlink, it would disappear, and a cancel one would appear?

Thank you for any help!!




Notification alerts based on the state of a webpage

My background is mostly game programming with Swift and Sprite Kit. But, I haven't done any Mac programming only iOS.

However, I was wondering if there was a simple way I could do the following with Xcode and Swift.

Here's my issue.

I belong to a survey website. They pay you fairly well for each survey. However, the issue is the surveys appear very infrequently and randomly. So I find myself refreshing the page all day.

I want to automate the process.

  1. So I want to check the page every maybe 10 mins via safari.

  2. If the page contains the special image or a certain string saying new surveys are availiable. I want the page to stop refreshing (otherwise it can make the survey link disappear). I then want a notification on my Mac and all my devices if possible.

Can I accomplish this using Swift? Otherwise what route should I take?




Easiest way to create local website on Raspberry Pi?

I've been tasked with creating the local website for my senior capstone design project. I'm familiar with Web Development, enough to apply HTML/CSS and fairly straight forward JS. I know there's so many tools out there that aid in creating website and I'd rather not spend months only to be able to create something that I can do in a couple weeks using one of these tools (such as dreamweaver or squarespace). At the moment, I'm watching this Udemy course. My problems are:

1: It's a local website, so I can't utilize anything that will need internet access to function on a daily basis.

2: This will be deployed on a Raspberry Pi. If the Raspberry Pi prevents me from utilizing a great tool, then it can be scrapped.

Knowing this, I'm not really sure what will and won't cause me problems further down the road. Does anyone have any ideas?

Thanks




Webpack-dev-server not reload .html

Try to roll into the webpack. Using official docs. index.js reloads but index.html does not. Command for build: webpack-dev-server --mode development --open

explorer project in vs code

wp config:

const path = require('path');

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'index.js',
    path: path.resolve(__dirname, './dist'),
  },
  devServer: {    
  }
};

package.json scripts:

"scripts": {
    "build": "webpack --mode production",
    "dev": "webpack-dev-server --mode development --open"
 },

Webpack ver:

"devDependencies": {
    "webpack": "^4.10.2",
    "webpack-cli": "^2.1.4",
    "webpack-dev-server": "^3.1.4"
 }

*Do not ask HtmlWebpackPlugin, I think without this hack should work.




h2o web server shows "too many internal delegations"

help me

I want

  • use Laravel(php)
  • use php-fpm with fastcgi

env

  • Ubuntu 16
  • h2o version 2.3.0-DEV@5597dbe
  • OpenSSL: OpenSSL 1.1.0h 27 Mar 2018
  • mruby: YES

config

h2o.cfg

file.index: [ 'index.html', 'index.htm', 'index.txt', 'index.php' ]

file.custom-handler:
  extension: .php
  fastcgi.connect:
    port: /run/php/php7.2-fpm.sock
    type: unix



  "aaaa.com:443":
     listen:
       port: 443
       ssl:
         certificate-file: /etc/letsencrypt/live/aaaa.com/fullchain.pem
         key-file: /etc/letsencrypt/live/aaaa.com/privkey.pem
         cipher-suite: "EECDH+AESGCM:AES256+EECDH:AES128+EECDH"
         minimum-version: TLSv1.2
     paths:
       "/":
          file.dir: /path/to/public
          redirect:
             url: /index.php/
             internal: YES
#             internal: NO 
             status: 307

status

  • GET / -> run /index.php -> OK
  • GET /index.php/somefunc -> run index.php with somefunc -> OK
  • GET /somefunc -> browser shows error -> NG
  • set config to internal:NO and GET /somefunc -> 307 to /index.php/somefunc -> OK

error

browser shows

too many internal delegations

I did

I can't read/write c lang. but I did grep this error string,I fond it in lib/core/request.c.

    if (req->num_delegated == req->conn->ctx->globalconf->max_delegations) {
        /* TODO log */
        h2o_send_error_502(req, "Gateway Error", "too many internal delegations", 0);
        return;
    }

I add config

max-delegations: 10000000

and change source and make

    if (req->num_delegated == req->conn->ctx->globalconf->max_delegations) {
        /* TODO log */
         char buf[128];
         snprintf(buf, 128, "too many internal delegations %d", req->num_delegated);
        h2o_send_error_502(req, "Gateway Error", buf, 0);
        return;
    }

after this, browser shows

too many internal delegations 10000000

loop????

I want to know how to fix this situation...

please help me.




Website keeps blocking my requests

This website keeps blocking me after 3 requests. How can i bypass this block?

Site: https://www.empresascnpj.com

Ps: I really think the website is very obcessive, when it comes to block 3+ request, and it isn't a minute or 2 minute block, it is days.




Enable or disable toggle option for FCM push notification for web

I have completed Firebase cloud Messaging push notification on web based but i need to control the notification on web through toggle based like enable or disable.




How to change https://ift.tt/2Jb8yTx to be user location rather than mine

Hi there I want to put a link to a simple google search in my app. So if I search myself this is the link...

https://www.google.co.uk/maps/search/dog+groomer+near+me/@53.0725236,0.0423795,11.44z

It obviously has my co-ordinates in it. Is there a way for me to change it to a generic link so it automatically uses the users location.




How to use position in dropdown

Class Dropdown menu use position : relative

https://www.w3schools.com/css/tryit.asp?filename=trycss_dropdown_button

So in code below when i try add position : relative ; to dropdown class then dropdown menu not working. please explain for me

https://www.w3schools.com/css/tryit.asp?filename=trycss_dropdown_navbar

please see on link.




AOS scroll effect not working

I am not able to include a page effect when the page appears on scroll in a web page ? Where should the code be included? Visit https://michalsnik.github.io/aos/ for reference. I tried including the link tag in the beginning and adding the code but I am not able to figure out the problem? The effect just doesn't work on scrolling.




What is required to make sites like Quora

Hey guys I want to ask you what tools and programming language is used to make the sites and Mobile app quora. And give me details where i can find info like this. Tnxs




Bootstrap search box click

I added the following HTML using Bootstrap 4

    <div class="col-sm-3 col-md-3 search-header">
    <form class="navbar-form" role="search">
        <div class="input-group">
            <input type="text" class="form-control search-box " placeholder="Search" name="srch-term" id="srch-term">
            <div class="input-group-btn">
                <button class="btn btn-default btn-search" onclick="ss()"><i class="glyphicon glyphicon-search"></i></button>
            </div>
        </div>
    </form>
</div>

When the search button is clicked, the whole page refreshes, I added the OnClick() event and bind it to ss() (a custom function that only alerts) but the form still refreshing.

I need to bind the search button to some JavaScript function. How to?




Expose endpoint from WinForm app

I have a formless winforms app. This has very little logic, it just acts as an agent to tell a web app (on separate server) hey, I'm here. How can I expose an endpoint in my Winforms app that my web app can connect to. The machine where the winforms app is running doesn't have IIS so I can't use a web service to expose the endpoint. Any ideas?




node.js - Loading html in a similar way to PHP

I am learning Node.js for website development.
Previously I could use PHP to include something like a navigation bar on every page, using <?php include('blah.php') ?>. This works in the same way of me just using the actual code on the page.
My question is: is there any way to import HTML elements / pages from one page to another with JS / Node.js?
Bearing in mind, PHP integrates directly with HTML in the same file, and Node.js does not integrate so seamlessly, so what I'm asking might be impossible.




Get friendly URL and query database

I need to know what web server and server side framework will let me achieve the following:

I don't know is there is a technical name for this technique. So basically want to get any url in my domain and use it to query a database.

So for example, if I navigate to http://example.com/jack.htm, I want to do "select * from users where name like %jack%"

and then I want to return in the web page something like:

Our user's named Jack:

  • Jack Martins age 26
  • Jack Johnson age 32 etc..

Obviously we have a sql database with all user's names and age. Also jack.htm does not exist as a htm document in my web server, I need to generate it on the fly but not actually keep it forever.




Ways to deploy Web/Database servers at one Hardware

What I have

I need to release some Inner Service in one organization:

  • backend: Python

  • database: MS SQL Server (or maybe Postgres)

In this task I'm restricting with one server having 16 cpu, and 16 Gb ram.

In my plan here would be:

  1. Web-server: Web-application on it should handle about 30 users at one time

  2. Database-server: Should contain multiple databases that would be used by described Web-application

Surely it's not advisable to have the database- and web-server on the same machine as it can leads to security, scalability and performance problems.

What I need

I need to partition server's performance. So:

  1. Do I need to use virtualization and is it only one approach to this problem?

  2. If I would apply virtualization, what OS should be better for having such hardware configuration (should it be Hypervisor on Windows or VMWare/VirtualBox on Ubuntu)?

  3. What is percentage ratio that I should to part my hardware for Web/Database?




Cannot read property 'code' of undefined

I try to test my web api via Postman sandbox. I send simple post request and must get 400 or 200 status code in response. pre-request script :

var req_header = {
    "Content-Type":"application/x-www-form-urlencoded"
};   
var req_body = {
      mode: 'urlencoded',
      urlencoded: [
            {key: "client_id", value : "----", disabled: false},
            {key: "grant_type", value: "---", disabled: false},
            {key: "username", value: "---", disabled: false}, 
            {key: "password", value : "---", disabled: false},
            ] };

function StartBrutt (){
for (i=0;i < 100; i++){
      pm.sendRequest({url:"https://...", method:'Post', header:req_header, body : req_body}, 
  function (err, res) {
  if (err) { console.log(err); } 
  pm.test(
      'Get Response Code ',
  function () {
    pm.expect(pm.response.code).to.be.oneOf([200, 400]) //not worked
    //pm.expect(pm.res!=null)  worked good
        });
    });
}
}
StartBrutt();

But I always to get an error :

TypeError: Cannot read property 'code' of undefined

I use 6.1.3 version of desktop app.

enter image description here

Where is my Error ?




How to work with files in JSP

I need to make a counter of visits in JSP, so i just read the number of visits from a file and then write to it the new value. But the following code doesn't work. Though it shows the date and time correctly.
What's the problem? Or maybe there is a better solution to make a counter?

<div style="width: auto; height: 60px; clear: both; margin-top: 15px; color: white; ">
    <span style="display: inline-block; border: 1px solid white;  padding: 15px; float: left; ">
        Current date and time: <%= new java.util.Date()%>       
    </span>
    <span style="display: inline-block; border: 1px solid white;  padding: 15px; float: right; color: white;">
    <%
        try {

            DataInputStream reader = new DataInputStream(new FileInputStream("data.bin"));
            int counter = reader.readInt();
            counter++;
            out.println("Visits: " + counter);
            reader.close();

            DataOutputStream writer = new DataOutputStream( new FileOutputStream("data.bin"));
            writer.writeInt(counter);
            writer.close();

        } catch (Exception e) { System.out.println("Error!"); }
    %>
    </span>
</div>




Processing large data from an API to visualise

Let's say I have an API that gives me the values of stock for the last month. The data is sampled every hour.

Now I want to make a web app that would visualize this data on a line chart. I don't need all the hourly samples, so my question is how should I make this work?

My idea is that there would be a backend app (i.e. in Java Spring) that would GET the data from the API and calculate the average for each day (using a stream, maybe parallel stream?) and then put that in a new collection and pass it on to the front end to put in a chart.




mardi 29 mai 2018

How to keep Text data consistent in IOS app and website ?

Its known fact that we can use Json/XML parsing or Database to maintain a limited amount of data consistent on a given application and Website at any given time.

However, the dilemma is a project having few display textlines 3k-4k that are supposed to be consistent on both(App and website)on a selected UI, these text files may change at any given point of time. What will be the optimized method or steps of implementation for this technique?




Getting text from a checked checkbox

I have a collection of checkboxes within a bunch of elements:

<label class="control-label">Items</label>
<div class="controls">
    <div id="13" class="checkboxes columns-container columns-count-two">
        <div class="column-item">
            <label class="checkbox">
                <input name="13[]" value="Item 1" type="checkbox">Item 1
            </label>
        </div>
        <div class="column-item">
            <label class="checkbox">
                <input name="13[]" value="Item 2" type="checkbox">Item 2
            </label>
        </div>
        <div class="column-item">
            <label class="checkbox">
                <input name="13[]" value="Item 3" type="checkbox">Item 3
            </label>
        </div>
    </div>
</div>

I'm using the following JavaScript code to try and get the text of the checked item, but it doesn't seem to be working. I'm not sure what I'm missing, some assistance will be greatly appreciated

var checktext = $('#13 input:checkbox:checked').map(function() {
return $(this).next("label").text().split(' ').join('%20');
}).get();




How to Extract local Events from web

I am wondering if you know any API that can be used to extract local events (like touristic, music, film, etc..) by location? I saw eventful API. But I am looking for another one with better results Thanks




Website Folding/Overlapping-Effect with Scrolling

I've recently noticed that the website building tools provider wix.com uses a great folding-effect for their homepage. When you scroll down, the hero-image moves up and the section below appears to be static, but once the hero image moved all the way up you can just start to scroll the usual way. I tried quite a lot but couldn't find a proper way to get the same result. How can this be done? How do the elements need to be positioned and how can you manage to scroll one section and only afterwards start to scroll the rest of the page? Thanks!




java - Tomcat resource pool not giving connection in websocket server endpoint

I'm using Tomcat 8 as a server with my java web application, it's a tic tac toe online game.

I have a server endpoint configured using javax.websocket.Server.ServerEndpoint class but when I try to import the resource in it it gives me NullPointerException when I try to get connection. It works fine when i get that connection from my servlets but only in server endpoint gives me null.The line with error is commented bellow:

Also here is the repository with all the file if it helps: https://github.com/EduardValentin/TicTacToe-WebApp---Java-Servlets/tree/master/Web%20Client/src/java

@ApplicationScoped
@ServerEndpoint("/websocketendpoint")
public class MatchMaker {
private final SessionHandler sessionHandler = SessionHandler.getInstance();

    @Resource(name = "jdbc/TicTacToeDb")
    private DataSource dbResource;

@OnOpen
public void onOpen(Session session,EndpointConfig config) throws IOException{
        System.out.println("Open Connection ...");

}

@OnClose
public void onClose(){
        System.out.println("Close Connection ...");
}

@OnMessage
public void onMessage(String message,Session session) throws IOException, SQLException{
        System.out.println("Message from the client: " + message);
        String[] parts = message.split("\\|");
        String typeOfOperation = parts[0];
        String from = null;
        System.out.println(typeOfOperation);
        switch(typeOfOperation) {
            case "JOIN":
                String playerUsername = parts[1];
                System.out.println(playerUsername + " yayaya");
                PlayerModel newPlayer = new PlayerModel(playerUsername,session);
                if(sessionHandler.playersInQueue() == false){
                    // Nu sunt jucatori care asteapta in coada ,deci nu are cu cine sa joace
                    sessionHandler.addInQueue(newPlayer);
                } else {
                    PlayerModel opponent = sessionHandler.removeFromQueue();    // Ia cel mai vechi jucator ce asteapta la coada
                    opponent.setOpponent(playerUsername);
                    newPlayer.setOpponent(opponent.getUsername());
                    sessionHandler.addPlaying(newPlayer, opponent);
                    String first;
                    if(Math.random() >= 0.5) {
                        first = newPlayer.getUsername();
                    } else {
                        first = opponent.getUsername();
                    }


                    sessionHandler.sendMessageTo(playerUsername,"PLAYING|"+opponent.getUsername()+"|"+first);
                    sessionHandler.sendMessageTo(opponent.getUsername(),"PLAYING|"+newPlayer.getUsername()+"|"+first);
                }
                break;
            case "MOVE" :
               from = parts[1];
               String to = parts[2];
               String squareNr = parts[3];
               System.out.println("From:" + from + " | To: " + to + " | Move: " + squareNr); 
               sessionHandler.sendMessageTo(to, "MOVE|"+squareNr);
               break;
            case "WON" :
               from = parts[1];
               to = parts[2];
               System.out.println(from + " won the game.");                 
               // we need to save the game to database
               String insertQuery = "INSERT INTO games(won,lost,game_date) VALUES (?,?,TO_DATE(?,'day-mon-yyyy hh24:mi:ss'))";
               try(Connection con = (Connection) dbResource.getConnection()){   // HERE I GET NULL POINTER EXCEPTION WHEN I TRY TO GET CONNECTION
                   PreparedStatement ps = con.prepareStatement(insertQuery);

                   ps.setString(1, from);
                   ps.setString(2, to);
                   DateFormat dateFormat = new SimpleDateFormat("dd-mm-yyyy HH:mm:ss");
                   Date date = new Date();
                   System.out.println(dateFormat.format(date)); //2016/11/16 12:08:43


                   ps.setString(3,dateFormat.format(date));
                   ps.executeUpdate();
                   ps.close();
               }

               sessionHandler.removeFromPlaying(to);
               sessionHandler.removeFromPlaying(from);
               break;
            default :
               System.out.println("Invalid message");
         }
}

@OnError
public void onError(Throwable e){
    e.printStackTrace();
}

}

And here is my context.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/TicTacToeWeb">

<Resource name="jdbc/TicTacToeDb" auth="Container" 
type="javax.sql.DataSource"
username="admin" password="superduperpwd" 
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/tictactoedb" maxActive="15" maxIdle="3" />




Development a encrypted subsystem [on hold]

In the near future, I have an assignment to do a diploma work. My topic: "DEVELOPMENT A ENCRYPTED FILE TRANSMISSION SUBSYSTEM THROUGH OPEN CHANNELS WITH CONFIRMATION OF THE RECEIVED DATA". This subsystem can be implemented as a module or something similar. What advise, experienced developers, with the help of which technologies is it better to do this by spending as little time as possible?




What does each of these codes do? [on hold]

I am new to web design and development in PHP. I know how some code works and other codes I have no idea about. I was just wondering if anyone could explain to me in a general or board term, what each of the below codes do so I can get an understanding of them. A simple and clear explanation is fine I am not looking for detailed definitions or examples. Thank you.

$result = mysqli_query($connection,$query);

$num_rows = mysqli_num_rows($result);

$row[]=mysqli_fetch_array($result);

(mysqli_query($connection,$query)

$row_count = mysqli_num_rows($result);
if($row_count > 0){

$count=mysqli_num_rows($result);




Invoke Skype for Business from Web Chat control

A button like below will open up a contact in Skype for Business. We have a Web Chat bot hosted on Azure bot Service. I would like to utilize the buttons present in the Web Chat control to invoke Skype for Business contacts in a similar way. But I'm not able to specify the href properly and this usually brings up the domain at the end of contact in browser instead of the pop up for SfB. Is there any smart workaround for this?

I had thought of this alternate option of redirecting the user to a web page with a button which can bring up SfB, but that's not a very good user experience.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Help Desk</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<a class="btn btn-primary" href="sip:helpdesk.im@microsoft.com" width="550">Contact Help Desk Team on Skype for Business</button>



Why do we need apache ? How does php and apache work together ?

I have just started learning PHP and one thing i am still confused about is what exactly is apache? if its a web server what does it mean that more than 60% of the web is hosted on it, and why do we need to have apache packages like xampp to test php while we can use sites with php online(web browser) without having apache installed? P.s: sorry if this is dumb question but it has frustrated me. This is also my first question on stack overflow so please excuse any mistakes i have made,any help will be greatly appreciated!




SMTP errors from web server

I am having issues with SMTP from one of my web servers. I've verified firewall connectivity over port25 to the SMTP relay and the exchange servers is good to go. I can hit the SMTP relays and exchange server from my web server via telnet. Whenever I drop a mail in Pickup it sits in the queue.

In Event Viewer I get: Message delivery to the host 'IPADDDRESS' failed while delivering to the remote domain 'MYDOMAIN' for the following reason: The connection was dropped by the remote host.

I checked SMTPDiag and it comes back: Error: Expecting "220". Server is not accepting connections. Failed to submit mail to "server.domain.com"

I checked and my connection control is set to allow and the domains are listed in SMTP.. I am losing my mind trying to figure out why mail is failing at this point..




How to use ngUpgrade when upgrading Angular 1.6 -> 6

I'm trying to upgrade 1.6 angular project to angular 6. In the guide it says

Upgrading with ngUpgrade The ngUpgrade library in Angular is a very useful tool for upgrading anything but the smallest of applications. With it you can mix and match AngularJS and Angular components in the same application and have them interoperate seamlessly. That means you don't have to do the upgrade work all at once, since there's a natural coexistence between the two frameworks during the transition period.

How do I use ngUpgrade? The

How ngUpgrade Works

doesn't tell me that in a way that I'd understand. I installed Angular 6 and tried to search for 'ngUpgrade' but nothing showed up. Also tried to search from web without success.




Cursive fonts not working or displaying properly?

just to be specific, working with Shopify product descriptions if anyone needs more info as to what I need help with.

With the HTML editor, I can set and change fonts without any issues when using serif, sans-serif fonts. However, when trying to use a cursive font, it just doesn't like to display properly. Also using Google fonts, but that shouldn't be an issue.

What my code looks like: Details:

White dress

Output: Once again, serif or sans-serif works fine, just can't seem to get cursive working...

Help is greatly appreciated, thanks!




Automatically update data on website database triggered by date and time

I have a condition that I have to update data automatically on my website, which is triggered by time that I've set before.

EXAMPLE :

i've set the update for 29-05-2018 20.20 then the website will do update in that date and that time without any trigger, and no need to open the website.




How to Inserting HTML and CSS web page in outlook email?

I want to insert my HTML and CSS web page in outlook email. I tried it as "Insert as text" option but the CSS file is not loading properly in Outlook. Anyone faced this before?

It is saying like"Missing file in c\Desktop:style.css" If I had that in desktop and when I forward the mail, Is others able to see the webpage with the CSS?




Cycle post request in postman

I need to test my Web api. I use Postman for sending requests to urls. Can I do it in Cycle ? Example : 10 times send request on url_1, if got error - stop sending, else - 10 times send request on url_2 ect. Can I do it with Postman ?




lundi 28 mai 2018

What is the best solution for checking if a logged-in user's account still matches or exists from the database?

Is it a good practice if every time when a logged-in user refreshes or re-enters the site, it will check from the database if that account still exists or matches from the database? Would that affect the performance of the site?

What I wanted to do is that for every activity that a logged-in user do (even navigating pages that has authentication), it will re-authenticate the account if the credentials (such as username and password) still matches from the database. What would be the best solution to address this kind of issue?




retrieve javascript data to java program

kindly please you for an advice.

I have a web page with javascript data. How can I retrieve such data and use it in my java project? Any technologies, examples, pseudocode, idea?

Thanks in advance for your help!




Tomcat can not find current representation of target

I have a problem with my simple web app. I have a project named books. enter image description here

It is visible in tomcat and deployed succesfuly. I have following project structure in eclipse: enter image description here

I need to use datasource, so I have books.xml in {tomcat9}/conf/Catalina/localhost/books.xml as my context file with following content:

<Context docBase="E:\eclipse_workspace\Books\WebContent\WEB-INF\classes">

  <Resource name="jdbc/dbname" auth="Container" 
            type="javax.sql.DataSource"
            description="Books Database" 
            driverClassName="org.apache.derby.jdbc.ClientDriver"
            url="jdbc:derby://localhost:1527/dbname"
            username="admin"
            password="password"
            maxActive="20" /> 
</Context>

There is content of my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
        http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    id="WebApp_ID" version="3.1">
    <display-name>Books Management</display-name>

    <servlet>
        <display-name>Books Controller</display-name>
        <servlet-name>BookServlet</servlet-name>
        <servlet-class>BookServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>BookServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>

And this is what I get trying to test my app:

enter image description here

Any ideas what may be wrong? The clue is when I had incorrect context file (db.xml instead of books.xml) I had NullPointerException when getting datasource. Now When name is correct, it doesn't even give an error.




C# How to Update Visual Studio 2107 xxx.exe.config binding at runtime?

A xxx.exe.config file is created when I compile my C# web service code. However, I want to modify one of the bindings at run time. An example of the xxx.exe.config file generated by Visual Studio is:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_ContentService"
                         messageEncoding="Mtom" />
            </basicHttpBinding>
        </bindings>
    </system.serviceModel>
</configuration>

I want to add some parameters at run time to the binding named "BasicHttpBinding_ContentService" that are equivalent to manually coding:

<binding name="BasicHttpBinding_ContentService"                             
              messageEncoding="Mtom"
              maxBufferSize="5000000"
              maxBufferPoolSize="524288"
              maxReceivedMessageSize="2147483648"
              transferMode="Streamed" />

I think the C# code to define the parameter settings looks like:

using System.ServiceModel;

BasicHttpBinding myBinding = new BasicHttpBinding("BasicHttpBinding_ContentService");
myBinding.MaxBufferSize = 5000000;
myBinding.MaxBufferPoolSize = 524288;
myBinding.MaxReceivedMessageSize = 2147483648;
myBinding.TransferMode = TransferMode.Streamed;

But I can't find a C# example (that works) that applies 'myBinding' to my Visual Studio .config file. The samples I do find reference classes like ServiceHost and ServiceClient that are undefined in my environment.

Note - I am using .NET 4.6.




Multiplayer game with java

I wrote little game like chess on Netbeans/Java with Server-Client structure. Two players are playing with each other if they are at same wifi or same lan. Now I want to make it " play with different networks ". How can I do that ? I have 2 idea but I need advice. Firstly I will write my Client-Server connection code.

Client.Start("127.0.0.1", 2000);
 public static void Start(String ip, int port) {
        try {
            // Client Socket object
            Client.socket = new Socket(ip, port);
            Client.Display("Connected to server");
            // input stream
            Client.sInput = new ObjectInputStream(Client.socket.getInputStream());
            // output stream
            Client.sOutput = new ObjectOutputStream(Client.socket.getOutputStream());
            Client.listenMe = new Listen();
            Client.listenMe.start();

            Message msg = new Message(Message.Message_Type.Name);
            msg.content = Game.ThisGame.txt_name.getText();
            Client.Send(msg);
        } catch (IOException ex) {
            Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

Main Purpose : Players on different network can play this.

my First idea is - rent a Server . and Use that server like my clients's server. But Idk , Servers can run Java code ?

Second idea is implementing my netbeans code for connect to online database and coding my moves , when client took enemy's moves on database , program will encode it and shows moves on my board. Thanks for advices,ideas




javascript passing string parameter

I need to pass a string parameter as a second parameter for my action result.

public ActionResult AvaliarPrevia(int Id, String Tipo)

but when I try this, the second parameter remains null.

let a = '<a href=AvaliarPrevia/' + row.Id + '?' + row.OrcamentoTipo + ' title="Avaliar" class ="btn btn-info btn-sm"><i class="fa fa-check-square-o"></i></a>';




Button "Apply styles" is lost in Visual studio 2017

I try to solve this issue: add button from papameters and export settings but it isn't work. Please, help me to solve this problem




what's wrong when i try to migrate?

I just start to learn laravel as an online course and do all instructions step by step behind the instructor but when I try to make migrate I get an error and doesn't migrate to database. what's wrong?




Web scraping in C

I want to create a C program to scrap data from a website (like to list the capitals of different countries). What should be the algorithm for that? I know how to access any website using system("website_name") but how can I get the HTML of the website and proceed further?




I wanna check before insert or update mysql

check before insert or update mysql my code doesn't work I have no idea why

$sql = "SELECT * FROM downloads WHERE name = '" . $details['name']."' " ;
    $result = mysql_query($sql);

if( mysql_num_rows($result) === 0) {
    $sql = "INSERT INTO downloads (name, idu) VALUES ('".$details['name']."', '".$details['idu']."')";
    $result = mysql_query($sql);
   }
else{

    $sql2 = "UPDATE downloads SET idu='".$details['idu']."' WHERE name='". $details['name'] ."'";
    $result = mysql_query($sql2);

    }




How to add a powerpoint presentation in web

I have this task to make an iframe of a presentation appear on an click. then you can control that presentation, like the page you want or go forward and backward.
The problem is I can't use the cloud solutions, because the data should be on premises.
I've thought about converting it to a video, it would be easier to control it and also to keep the animations.
I've also thought about converting it to a pdf file and then show the slides, like slideshare does in this Example.
Is there anyway I can use the ppt directly or even convert it to another format that would be optimal and user friendly, if so, how? is there any APIs or Javascript libraries? what would you recommend?




How to use clipborad.js to copy pictures?Or how to copy the picture to the clipboard?

Using clipborad.js can only copy to text, can not copy pictures to the dialog box, I hope the gods help me answer




VS2017 & Web Essentials: How to minify .js and change filetype?

In Visual Studio 2017 & Web Essentials, how to minify and change file type of minified file on build?

For example: Input: helper.js Desired output on build: helper.min.xjs (...where .xjs is some other filetype we need for specific reasons)

I have this working, except that I can't change the filetype of minified file.

Bundleconfig.json doesn't accept the non-".js" filetype, and I get the following warning: bundleconfig.json not accepting changed filetype

Any thoughts? I tried searching this but only came up with some Gulp&Node.js related answers.




HTML/CSS layout design help? How can I center this slideshow?

I need some help regarding the layout of my website. Basically, I'm trying to center the Js slideshow & "Slideshow header" that you can see in image left. Below you can see what my website looks like on the left and on the right is how I want to center my slideshow.

Website

I tried adding "text-align: center;" to my css but nothing changes. I'm clueless

Some help would be appreciated!

PS: Sorry for using screenshots instead of block codes.**Getting errors while adding my snippets

HTML

CSS CODE




How to create the soap API in thingworxs

I want to access the thing through soap API. But I don't know how to create the soap API to access the services.




Parse Array Containing Column Names and Output All Values of Table in Same Order

I have the following array:

Array ( [0] => id [1] => created_on [2] => your_name [3] => your_company [4] => your_county)

What I want to do is parse different tables which may not have all column names matching the array values.

For example:

Table 1:

id  |  your_name  |  your_company
1   |  gabriel    |  xyz_ltd
2   |  christian  |  abc_ltd

Table 2:

id  |  your_name  |  your_country
1   |  andrew     |  UK
4   |  mark       |  France

And would output all the fields with matching column names in same order as the array in one single output.

In this case something like this would be returned if in Comma Delimited:

1,,gabriel,xyz_ltd,
2,,christian,abc_ltd,
1,,andrew,,UK
4,,mark,,France

How can I achieve this?




How to solve the HTTP Error 500.19 - Internal Server Error on our college website

You can find the web.config file contents as below. I'm told that recently our hosing providers migrated their services to new server and changed all the credentials. On internet i found some solutions to change the user credentials. I really don't know where i can change and how.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <security>
        <authentication>
            <basicAuthentication enabled="false" />
            <anonymousAuthentication enabled="true" password="[enc:AesProvider:U57nH36GCR0Dt2ylJ3KOHwmpC1Y/8c9M1sNwHwbgIi4h1x6YIfsLuZL9K3eF1wXu:enc]" />
            <windowsAuthentication enabled="false" />
        </authentication>
    </security>
    <directoryBrowse enabled="false" />
    <defaultDocument>
        <files>
            <clear />
            <add value="index.htm" />
            <add value="index.html" />
            <add value="Default.htm" />
            <add value="Default.asp" />
            <add value="Default.aspx" />
        </files>
    </defaultDocument>
</system.webServer>




How to refresh a div after hiding contents

I have the following HTML code

<div id="multiSelectDialog" title="Select">
<input type="text" id="MultiSelectDialog_Search" name="MultiSelectDialog_Search" onchange="multiSelectDialog_Search_TextChanged()" />
<div id="MultiSelectDialog_List" data-value="">
        <!--The data will goes here-->
</div>
<input type="hidden" name="MultiSelectDialog_Values" id="MultiSelectDialog_Values" />
<button id="MultiSelectDialog_Submit" onclick="multiSelectDialog_SubmitButton_Click()">Submit</button>

I am filling the data of the "MultiSelectDialog_List" div using javascript like this:

   var jsonData = JSON.parse(s);
for (var i = 0; i < jsonData.length; i++) {

    // Hold the original list

    $("#MultiSelectDialog_List").append("<input type='checkbox'  id ='"+jsonData[i][idProp] +"'  value='"
             + jsonData[i][idProp] + "' data-value='" + jsonData[i][nameProp].toLowerCase() + "' > <label data-value ='"
           + jsonData[i][nameProp].toLowerCase() + "'  id ='lbl" +jsonData[i][idProp]+ "'>" + jsonData[i][nameProp] + "</label> <br/>");
}

where "s" is a JSON string.

Then I am using this script to hide some content:

    var enteredText = $("#MultiSelectDialog_Search").val();
var ary = $("input[type='checkbox']:not([data-value*='" + enteredText.toLowerCase() + "'])");

for (var i = 0; i < ary.length; i++) {
  $(  "#"+ary[i]["id"]) .hide();
}

The problem is that the content of the div are not redrawen correctly after hiding some elements. Check the image:

Before hiding elements

When hiding elements, see the gaps

How should I refresh the div? I tried to use hide() and show(), fadein(). but did not work.




Telugu text showing as square boxes in web-page. How to show original text?

I have one HTML web page where telugu text is showing as square boxes as below image (in all browser):

ఠిస్ ఐస్ ఆ తెలుగు టెక్స్ట్

Below code is already there in head tag of web page. If i place hindi text it will display on page perfectly.

<meta charset="utf-8" />

Also, on page load in chorme it ask for google translage and it translate in englist perfectly, which means google translater is able to read telugu but browser/HTML is not able to show it.

Note: Its happening only on linux based OS (ubuntu).

I am missing anything on web-page or its a default behaviour of OS?




How to create realtime bitrate graph on web?

I was struggling these days on finding solutions to create a real-time bitrate graph on my website.

The idea is to plot the realtime bitrate of a video which embedded in my website on a graph.

I know VLC or KMPlayer have these kind of functions that allow you to view the realtime bitrate of your video. Something like this: enter image description here

Is there any way I can read the realtime bitrate of a video? Thank you!




dimanche 27 mai 2018

How to provide clients with an admin portal on a custom from-scratch site?

I am in the process of becoming a self-taught web developer and working to understand the various paradigms of creating and deploying websites. As I currently understand it, there are three (VASTLY OVERSIMPLIFIED) paradigms:

  • Designed and managed through a CMS platform (simple/limited: Squarespace, Wix; complex/powerful: Wordpress, Joomla)
  • Static site created from scratch (custom HTML/CSS/Javascript or purchased/modified template)
  • Dynamic web application (including server-side logic, databases, likely front- and back-end frameworks, etc)

The way I see it, the first and last ones include easy ways to give some administrative powers to your clients, so they can add new content (as one example). CMS already includes a full admin portal, and web app frameworks like Django typically allow you to provide an administrative interface for loading new content.

How would you handle this with a custom static site? If you're typically just loading static HTML/CSS/JS files onto the client's web hosting, it seems like they would need to loop you or another developer in every time they wanted to make a change to the site. Is this true? Or is there a way of giving them some sort of interface to make changes?

Also if any of my assumptions above are wrong, I will gladly take correction!




Need some guidance about the tools to create a web application that can produce and let user download document using variables on webpage

I have some experience with c++ using windows application and unity using c# but i dont have clue about web interface backend front end configuration.

I have time so i can take time to learn a newframe work but i am not sure where to start.

What i want to do is basically 1- Users will create accounts 2- For each user there will be options to add new files with some variables, like name and id numbers. 3- Those variables will fill in the gaps in a document and this document can be downloaded or printed out.

I can try this in a non online environment but the program should be online for best efficiency andi really am not sure which frame and language i should use.




SQL Server Error 26 in Web developer 2010

enter image description here

dont know what the problem is, but it wont let me open the DataBase.




Update / Delete .JSON object c# .NET

Hi becouse im newbee with .JSON file manipulating now i need some help from stackoverflow profesionals. Ex.i have a memberlist in .json file and i need to do simple CRUD operations in that file like Delete member with id = 1 or Update member with id = 3 ..

The .json file looks as folow ...

    [{"id":1,"FirstName":"Lolla","LastName":"Lovley","Email":"a@la.com","Gender":"Female","ip_address":"42.7.2.141"},
{"id":2,"FirstName":"Ester","LastName":"Hope","Email":"fg@gh.it","Gender":"Female","ip_address":"23.5.433.09"},
{"id":3,"FirstName":"Erwin","LastName":"Höör","Email":"es2@snes.org","Gender":"Male","ip_address":"22.21.2.9"}]

This .json file is actually acts as service "Web Api" , and that im calling thru AngularJS http request ..

This is a method witch i use to call the Web api to return a .json file

  public HttpResponseMessage Get()
        {

            var json = File.ReadAllText(System.Web.HttpContext.Current.Server.MapPath(@"~/App_Data/members.json"));

            return new HttpResponseMessage()
            {
                Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json"),
                StatusCode = HttpStatusCode.OK
            };

        }

And there is no problem , data is coming back ... now as mentioned before i need to write some delete and update , but i dont know how..

Please help!

Regards

/Amra




Azure does not see Index.cshtml

I'm trying to publish my ASP.NET Core application on Azure service. I do it, but when I try to use the application functionality, I get the message "Your App Service app is up and running".

Moreover, in my wwwroot folder I don't have any .html files. I only have Index.cshtml, which is located in the Views/Home folder in my application, all another files are .css, .js, etc.

When I run the application in Visual Studio in debug mode, immediately opens the page in browser that was generated from Index.cshtml. But after the application is published in Azure, this does not happen. Why? What can I do to make Azure see Index.cshtml?




How to prevent regular users accessing other users data and allow accessing others data if logged in user is an admin?

I am developing Web APIs using ASP.net for an application. Currently working on implementing role-based user authentication. I am trying to understand how I could prevent authenticated users accessing others data. One approach I am working on is:

A unique key per record per user across all tables. So I could validate the request if it belongs to the requested user or not. But how I could allow the operation if the requested user is an admin?

I could allow this by allowing different requests in the controller based on user validation. In this, I have to pass the user role to data access function to decide if the requested operation is allowed or not.

(If a regular user -> only allowed his record updates (based on the unique key belongs to the user across all tables)) (If an admin -> all operations are allowed)

Are there are any smarter elegant methods?

Thanks, PG




Web application integration with sage 50 desktop accounting software

We have a cloud web application developed in .net MVC c#.now I'm starting​ integrate with sage 50 desktop application. Sage 50 provide an SDK for integration. We have to pass data like create invoice,from my web application. So how to do this process? Which is the best solution? Which technology we use here? Web service and things are recommend from sage support team.but how to use this?

Please advise for this,access desktop application from web.




I want to make sign in & up for my site with Django but it doesn't work

form.py

class SignUpForm(forms.Form):                               
name = forms.CharField(max_length=50, required=True)
email = forms.EmailField(max_length=100, required=True) 
password = forms.CharField(max_length=20, required=True)


class SignInForm(forms.Form):                                                             
email = forms.EmailField()                              
password = forms.CharField(max_length=20, min_length=8)

view.py

def Sign_Up(request):
if request.method == 'POST':
    form = SignUpForm(request)
    if form.is_valid():
        cd = form.cleaned_data
        name = cd['name']
        email = cd['email']
        password = cd['password']
        us = User.objects.all()
        us = User(name=name, email=email, password=password)
        us.save()
    return HttpResponseRedirect('/')
else:
    form = SignUpForm()
    return render(request,'User Login Page.html', {'form':form})


def Sign_In(request):
if request.method =='POST' :
    form = SignInForm(request)
    if form.is_valid():
        F = form.cleaned_data
        Eemail = F['email']
        Epassword = F['password']
        try:
            user = User.objects.filter(email=Eemail)
        except User.DoesNotExist:
            form = SignInForm()
            return render(request, "Admin Login Page.html", {'form': form})
        if User.password == Epassword:
            return HttpResponseRedirect("/")
form = SignInForm()
return render(request,"Admin Login Page.html",{'form':form})

I'm new in Django I want to make sign in & up for my site with Django but it doesn't work!
when i click on submit button my sign up directly go to address on HttpRsponseDirect even with empty parameters




samedi 26 mai 2018

how to create similar hovering effect as it is on Microsoft calendar when hovering on the dates?

[Notice those small boxes formed around the date 16,17,15 etc in want that effect for when someone hover over my webpage buttons]




How to find all nonlinked subsites of a web page?

Is there any way, to find all subsites of a site? Even those, which are not referenced by this site. For example: I have site www.foofoo.de, this site has 3 subsites - www.foofoo.de/horse, www.foofoo.de/dog, www.foofoo.de/mouse. Site www.foofoo.de has links to /horse and /dog but not to /mouse. However i can still visit site www.foofoo.de/mouse if I specifficaly write this adress to my web browser. Is there any way, I can find this subsite if I dont know it's complete adress, just www.foofoo.de? Thanks




Can I take screenshot of outside of web browser in Javascript or flash?

I would like to know if it is possible to capture content of outside of web browser when open web page. So for example, when use enter some website, web server can capture content of outside of web browser? If it's possible, how can I do that? Thank you




FirebaseUi-Auth mandatory login

I am looking to implement mandatory login, into my website. The problem i am having is that, i cant find a way to do so. Lets say i create a SignIn page like so

  var uiConfig = {
    signInSuccessUrl: '<url-to-redirect-to-on-success>',
    signInOptions: [

      firebase.auth.GoogleAuthProvider.PROVIDER_ID,
      firebase.auth.FacebookAuthProvider.PROVIDER_ID,
      firebase.auth.TwitterAuthProvider.PROVIDER_ID,
      firebase.auth.GithubAuthProvider.PROVIDER_ID,
      firebase.auth.EmailAuthProvider.PROVIDER_ID,
      firebase.auth.PhoneAuthProvider.PROVIDER_ID
    ],

    tosUrl: '<your-tos-url>'
  };


  var ui = new firebaseui.auth.AuthUI(firebase.auth());

  ui.start('#firebaseui-auth-container', uiConfig);
</script>

On a page called www.example.com/SignIn

If i go to www.example.com/Index

I could totally bypass all the signin.

I figured that something like this

 if ( FirebaseUser.getCurrentUser () != null ) {

redirect to sign in page }

How ?

Thanks




toggleClass() is not working in IE11 but seems to work in all other browsers

Here is my code:

Jquery:

$("#welcome-done").on("click", function(){
    $(".welcome-box").toggleClass("hide");
})

CSS:

.hide {
    display: none;
}

It works in firefox, chrome, safari but for some reason it does not work in IE11... Does anyone know how I can solve this issue?




Google Indexing Wrong Webpages

This is a bit theoretical question, how you won't mind.

I have a website on which a user can ask a question & also answer it. But if the user is not logged in & he/she try to answer question then they will be redirected to the login page.

Now, suppose there are 10 questions on website, then there will be 10 individual links where user can visit & answer every question BUT if they are not logged in then those urls will become 10 individual login urls because of redirect.

That is what happened to me, Google has indexed all the answer page urls as login urls. Please see the image.

Google search image

I don't want google to index those urls which are redirecting users to login page. How can we prevent their indexing?




how to solve error "The given key was not present in the dictionary." when using data set with MySqlDataAdapter?

I try to make connection with MySQL db using this class.

public class DataManager
{
    // Connection String
    public static string constr = ConfigurationManager.ConnectionStrings["cnn1"].ConnectionString; 

    public static DataSet GetDataSet(string stored_name, string table_name, params MySqlParameter[] prmarr)
    {
        MySqlConnection con = new MySqlConnection(constr);
        MySqlCommand cmd = new MySqlCommand(stored_name,con);
        cmd.CommandType = CommandType.StoredProcedure;

        foreach (MySqlParameter prm in prmarr)
        {
            cmd.Parameters.Add(prm);
        }
        DataSet ds = new DataSet();
        MySqlDataAdapter da = new MySqlDataAdapter(cmd);

        da.Fill(ds,table_name);
        return ds;
    } 

then I called it in load event of page that is inhered from master page

    protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {  
         // product_select is stored procedure/ routine that I made it in db
                using (DataSet ds = DataManager.GetDataSet("product_select","x")) // error is here
                {
                    DataList1.DataSource = ds.Tables["x"];   
                    DataList1.DataBind();
                }
            }
        }

when I run,I get this error.

An exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in mscorlib.dll
{"The given key was not present in the dictionary."}




Node JS Express Server - Cross Origin Request Blocked, even with all the correct headers

Despite having the correct headers in my nodejs server:

app.get('/api', function(req, res){
    res.header('Access-Control-Allow-Origin'. '*');
    res.header('Access-Control-Allow-Methods', 'GET');
    res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');

    res.status(200).send({'a':'b'});
});

When I make requests in my firefox browser, I still get the error:

"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.example.com/api/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)."

This is how I make the request on the client side:

var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
    if(this.readyState === 4 && this.status === 200){
        console.log(this.response);
    }
};
xhr.open('GET', 'http://www.example.com/api', true);
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
xhr.setRequestHeader('Access-Control-Allow-Methods', 'GET');
xhr.setRequestHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
xhr.send(null);




Scrolling in both vertical and horizontal on a website. Changing direction of a scroll. JS library

I am looking for a JS library which would allow changing the direction of a scroll from vertical/horizontal and vice versa depending on the position on the website, or at certain points to allow scrolling in both horizontal and vertical.

Something like in Device 6 app by Simogo: https://www.youtube.com/watch?v=swfsZm0uOUg




issue with choosing li elements using the arrow keys in javascript or jquery

I have been trying to do this forever now but i didnt know how. Basically i have this code below that generates li elements and append them to an already existing ul.

$(document.body).on("keyup", "", ".menuSearch", function (e) {
    if (e.keyCode != 37 && e.keyCode != 38 && e.keyCode != 39 && e.keyCode != 40) {
        $(".searchResults").html("");
        var searchField = $(".menuSearch").val();
        var expression = new RegExp(searchField, "i");
        HidingShowingUlForSearch();
        $.each(finalJsonForMenu, function (key, value) {
            if (value.title.search(expression) != -1 || value.description.search(expression) != -1) {
                $("#searchResults").append(
                    '<li class="list-group-item mickyMouseResultLi" style=" border:none; min-width: 95%;">' +
                    '<a target="_blank" href="' + value.url + '"</a>' +
                    '<p>' +
                    value.title + '</p>' + '</li>');

                //+'<p style="color: #757373">' + value.description + '</p>' 
            }
        });
    }
});

now thats great its working the way I want it too but then after the li generates i have to use the courser to point and click on them, while I need a way that i can just use the arrow keys with the enter button to access the newly generated li's. any suggestions?




vendredi 25 mai 2018

python 'NoneType' object has no attribute 'decompose'

from bs4 import BeautifulSoup
import time
#import requests
import urllib.request,re
#import pandas as pd
#import numpy as np
import csv

def crawlcontents():
    url = 'https://www.tripadvisor.com/ShowTopic-g983296-i13236-k11538516-Rent_from_LOTTE_standard_or_mystery_option-Jeju_Island.html' 

    html = urllib.request.urlopen(url).read().decode() 

#    print(html)

    soup = BeautifulSoup(html,'html.parser')
#    print(soup)
    div = soup.select_one('#SHOW_TOPIC > div.balance > div.firstPostBox > div > div > div.postRightContent > div.postcontent > div.postBody')
    div.select_one('script').decompose() 

    postcontent = div.text.strip()
    postcontent = re.sub(r'\n+', ' ',postcontent)
    print(postcontent)

crawlcontents()

This is crawling in trip site

I need script but, the error is "python 'NoneType' object has no attribute 'decompose'"

how do i change?




How to print response from HTTP request?

I am trying to print out the response that I get from my HTTP GET request.

Problem is that I get an error in my console:

ERROR TypeError: Cannot read property 'id' of undefined

REQUEST CODE:

@Effect()
  bucketsFetch = this.actions$
    .ofType(BucketActions.FETCH_BUCKETS)
    .switchMap(() => {
      console.log('Sending GET request to Server');
      return this.httpClient
        .get<Bucket[]>('/storage/buckets', {
        observe: 'body',
        responseType: 'json'
        });
    })
   .map(
      (buckets) => {
        console.log('Received bucket:' + buckets[0].id);
        return {
          type: BucketActions.SET_BUCKETS,
          payload: buckets
        };
      }
    );

The error is throwing at the part where I try to console.log my response. The Bucket Model is correct 100% and it should return an array of Buckets as per API description, but still I get this error.

So in order to investigate further, I would like to print out the JSON response from my request, to see what it returns.

How can I do that?




web servlet method for login/register/ check HttpSession valid?

I am not sure what method(doGet/doPost, or other method?) in web servlet for login/register/check HttpSession when load page again ? in LoginServelt, we have 2 methods, one is for login, the other is for check HttpSession valid when the user load the page again. Can someone answer my questions and explain why? Thanks




is it possible to authenticate from a website using the fingerprint sensor in Android?

I want to make it without building any Android App. Is possible to make it using Web only?

Thank you!




How can I limit the sitemap results?

So I am parsing XML sitemaps with a scraper, and they tend to be very long, and I want to be able to parse them as fast as possible, so I was wondering if there is a way to only load the first 10 or 50 links in a sitemap like this one: https://kith.com/sitemap_products_1.xml

Thanks for your help!




Angular Authorization with Token not working

I have an issue with my code, where browser returns Error message for Authorization.

ERROR MESSAGE: Error message text

And here is my HttpInterceptor, which should take care of Authorization with Token for each request

AUTH INTERCEPTOR:

@Injectable()
export class AuthInterceptor implements HttpInterceptor {

  constructor(private store: Store<fromApp.AppState>) {}

  intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {

   return this.store.select('bucket')
      .switchMap( () => {
          const copiedReq = req.clone({
            setHeaders: {
              Authorization: `Bearer some-valid-token-here`,
            }});
          console.log('Intercepted ' + copiedReq.headers.get('Authorization'));
          return next.handle(copiedReq);
        });
  }

}

Now obviously one would consider Token being invalid, which I validated with the API owner that it is indeed valid, so I have no clue why it is not working. You may notice my console.log in Interceptor and it is indeed logging this event on each request, but it seems to fail to authorize it.

I have to admit that I am a bit new to Angular, so I might have made a mistake somewhere - if you need additional code, please let me know.




Relative URL Paths for images

Working on a project which involves crawling some legislation sites and hit a puzzler This url https://www.legislation.gov.au/Details/F2018L00530 has a base setting of https://www.legislation.gov.au/Details/F2018L00530/Html/Text in its header but images on the page resolve to https://www.legislation.gov.au/Details/F2018L00530/Html/ and I cannot determine why. Its not a frame and I cannot see something else which would change the path.




How to identify if a page request is for a preview

When I paste my website link at a social network (Facebook or Twitter for example), the social network access my site to show a preview to the customer.

I want to separate this access from real access at my reports, but to do this, I need to identify this cases.

This kind of access send any kind of information that is default for everyone that I can identify that this access is not a real user, but a robot?




how I can protect id in the URL from end user? [on hold]

I have two page {php} the first page pass id to the second page and the second one get data from database depend on the id .. So i need to make sure the end user will not edit the url

the first page

echo "<td><a class='view-report' href='viewreport.php?id=".$row['reports_id']."'><i class='fa fa-eye'></i>  view </a> "."</td>";

the second page

   <h3 class="h4 text-center arabic-font ">   رقم البلاغ : <?=intval($_GET['id']);?> </h3> 
  <?php 
    $id = intval($_GET['id']);
    $query = $con->prepare("SELECT * FROM reports WHERE reports_id = ?");
    $query->execute(array($id));
    echo "<pre>";
    print_r($query->fetchAll());
    echo "</pre>";

  ?> 




how to store plus sign in php variable?

I want to store plus sign in php variable but it's not accepting. Suppose I want to store +92XXXXXX in variable $num. when i echo it give me the result 92XXXXXX. where the plus sign goes? How to store this number +92444444 in php variable. Thanks.




How to submit span values in a form using PHP?

I have a HTML form contains span tags, and I want to submit the form with the span values using php. How can I do this?

Thanks..




Need to know when Clock app closes or crashes

I have a VS 2017 clock app that is to run constantly, occasionally it drops. Is it possible to set up an email alert to a group to notify when the app crashes or is closed, and if so, how?




How do I hide code/files on my website?

Currently, I have a website: http://hitsujistories.com

There is some javascript running in the body of the index.html that makes a bunch of particles on the screen. I want to keep this code private, but if you got to http://hitsujistories.com/canvas.js the code is openly available for anyone to see. How can I hide this file?

I tried to put the file in a password protected folder, but it didn't work because whenever I tried to go on the website (index.html) and it called for the javascript file, it would require the password.




Possibilities of MS Outlook Web Add-ins on the header/Ribbon in web apps and Independent

I am working with outlook Web-Addins. Addin type is "ItemRead". Now I want some thing unrelated to mails as in i want to have button on header as i see the skype button on the top.

Also we can create Addin on mail compose. I am not sure if this is possible to have separate buttons on header separate from mail section

example in the image of skype button.

enter image description here

I have also tried with Outlook Add-in ModuleExtension but cannot seems to be work as expected in outlook web app.




how to create a dynamic pages in php

i have a dynamic list of events that i get from database but with short information and in the bottom of each event there is a link 'continue' that when i click on it it will redirect me to another page that contains full information about this event.

how to get the full information about this event when i click on it ? i mean how to get its id so that i can access the database and get the information?

i tried to store the list in array but still can not make the php now the id of event that i clicked on




Detecting user language in IE

I have some code that checks the user's language. If the user is German they get sent to "de.html" otherwise they're sent to "en.html". There is also a string that checks if the user is going to the editor, ('/?edit'), and if so nothing happens. This code works fine, however, it doesn't work in IE. Any ideas?

var lang = window.navigator.language;
  var userLang = window.navigator.userLanguage;
  if (!window.location.href.includes('/?edit')) {
    if (lang == "de" || userLang == "de") {
      window.location.href = window.location.href + "de";
    } else {
      window.location.href = window.location.href + "en";
    }
  }




How do you reliably wait for page idle in cypress.io test

When using cypress.io to test an angular web page, whats the best / most reliable way to detect when the page is fully loaded and idle. Not just the onload event. Needs to include all xhr requests, angular digest cycles complete and all rendering complete.

The reason is that at this point I want to test that the page does NOT contain an element and cant test that until all the above is fully complete.




$slice operator of mongoDB not working in PHP

I have got this mongoDB query db.b_activity.find({token_id:"71e32267108b163ccdd3f59ba06c66674b295499"},{activity_log:{$slice: -1}}).pretty(); .

It gets all the desired results in the mongoDB terminal. But when i write the same query in PHP , it fetches the complete array every time .

MY PHP query $get_current_activity=$this->mongo_b_employee->b_activity->findOne(array('token_id'=>$token_id),array("activity_log" => array('$slice' => -1)));..

Any suggestions where i am going wrong .

PS: i am just trying to access the last array element.




Im modifying a python scraper, and having issues with an except [duplicate]

This question already has an answer here:

In my code, there is a try except function, and im having issues with the except. The linter says 'do not use bare except'

Code in question is below.

val = val.strip()
try:
    val = int(val.replace(',', ''))
    metadata['num_'+tag] = val
except:
    metadata[tag] = val

Any help to figure this out would be great. I am trying to get this to compile for python 3




jeudi 24 mai 2018

What are the current trends in Web Development?

What are the current trends in Web Development?

I have done some courses like HTML, CSS, JS, BOOTSTRAP, GIT and some others. I have learned many things in here in Stackoverflow and also from Youtube and other places.

Now I wants to know that which are currently trending in web development that can be helpful for freelancing and remotely jobs.

Thank you for your time.




How to store and access app data across different platforms

I'm creating a cross platform desktop app. How can I store and access the user data across the other platforms which are not connected locally




how to use make part of my website to be wordpress?

I hard coded a website in html, css, javascript. But there is a blog section in the website that I need to do with Wordpress because the blog entry has to be updated in the future. Any suggestions in terms of hosting and domains..?




Uncaught SyntaxError: Unexpected end of input Happened for no reason [on hold]

Ok, I'm writing a code and I've uploaded it on my server, The styling mode is pretty much like the other pages. All the other pages work except for this one.

Here is the code:

<html>

<head>

  <style>
    .s {
      position: fixed;
      color: white;
      font-family: arial;
      top: 14%;
      left: 20%;
    }
    
    .b {
      position: relative;
      background-color: orange;
      border-color: #B43298;
      box-shadow: 10 10 10 10;
    }
    
    .txt {
      position: relative;
      display: block;
    }
  </style>

</head>

<body style="margin:0 0 0 0;">

  <img src="BG.png " width="100%" height="100%" style="z-index:-100;">

  <span class="s" style="" id="SS">THE LEGENDARY RPS</span>

  <div style="position:fixed; left:38%; top:30%;">

    <span class="g">username:</span><input type="text" id="Uname" class="txt" pattern=".{5,}" required title="5 characters minimum" />

    <span class="g">password:</span><input type="password" id="pass" class="txt" pattern=".{6,}" required title="6 characters minimum" />

    <button class="b" id="BB1" onclick="up()">Log In</button>

  </div>

  <script>
    var W = window.innerWidth;

    var H = window.innerHeight;

    var R = W / H;

    if (R > 2.2 || R < 1) { // MOBILE

      document.getElementById("SS").style = "font-size:" + 200 + "%;left:13%;";

      document.getElementById("BB1").style = "font-size:" + 80 + "%;left:68%;top:68%;";

      var x = document.getElementsByTagName("input");

      for (var i = 0; i < x.length; i++) {

        x[i].style = "font-size:" + 100 + "%;";

      }

      var y = document.getElementsByClassName("g");

      for (var i = 0; i < y.length; i++) {

        y[i].style = "font-size:" + 100 + "%;";

      }

    } else { // PC

      document.getElementById("SS").style = "font-size:" + 700 + "%;left:20%;";

      document.getElementById("BB1").style = "font-size:" + 400 + "%;left:68%;top:68%;";

      var x = document.getElementsByTagName("input");

      for (var i = 0; i < x.length; i++) {

        x[i].style = "font-size:" + 190 + "%;";

      }

      var y = document.getElementsByClassName("g");

      for (var i = 0; i < y.length; i++) {

        y[i].style = "font-size:" + 190 + "%;";

      }

    }


    function up() {

      var xhttp = new XMLHttpRequest();

      xhttp.onreadystatechange = function() {

        if (this.readyState == 4 && this.status == 200) {

          if (xhttp.responseText == "OK") { //log in

            var data = {
              Uname: document.getElementById("Uname").value
            };

            redirectPost("Lobby.php", data);

          } else if (xhttp.responseText == "E") {

            alert("Wrong Username or Password");

          } else {

            alert("There was a problem connecting to the server");

          }

        }

        xhttp.open("POST", "check.php", true);

        xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

        xhttp.send("Uname=" + document.getElementById("Uname").value + "&pass=" + document.getElementById("pass").value);

      }


      function redirectPost(url, data) {
        var form = document.createElement('form');
        document.body.appendChild(form);
        form.method = 'post';
        form.action = url;
        for (var name in

            data) {
          var input = document.createElement('input');
          input.type = 'hidden';
          input.name = name;
          input.value = data[name];
          form.appendChild(input);
        }


        form.submit();
      }
  </script>


</body>

</html>

The error occurs in this snippet too

Uncaught SyntaxError: Unexpected end of input

Exactly on the last line

I read this code over and over and it seems to have no problem at all. So anybody has any idea about how and why this is happening and is there a way to fix it?