mercredi 31 octobre 2018

Why does Retailmenot open a new tab when you clicked on a coupon? [on hold]

I have a question about promo code sites like Retailmenot.

When you click on the coupon button, it doesn't redirect you to the store page, but the thing they do is that they open a page in their site (like https://ift.tt/2JudAYW) and then it goes to the store page.

We have a promo code site and we want to know why these sites do this work and what is the purpose of this action?




Passing File Path throught URI Protocol launch appilcation

I have URI Protocol like this

Key Name: HKEY_CLASSES_ROOT\testap Class Name: Last Write Time: 31/10/2018 - 11:32 AM Value 0 Name: URL protocol Type: REG_SZ Data:

Key Name: HKEY_CLASSES_ROOT\testap\shell Class Name: Last Write Time: 31/10/2018 - 11:27 AM

Key Name: HKEY_CLASSES_ROOT\testap\shell\open Class Name: Last Write Time: 31/10/2018 - 11:27 AM

Key Name: HKEY_CLASSES_ROOT\testap\shell\open\command Class Name: Last Write Time: 31/10/2018 - 11:37 AM Value 0 Name: Type: REG_SZ Data: "E:\MyApp.exe" "%1"

I Want pass file path like this "E:\ShortHelp_English.pdf"

when I run testap:E:/ShortHelp_English.pdf My application return an Error like this

Error application not found path Any one Can show me right way to passing my file path throught application ?




Creating multiple tables in ReactJS

I'm in the process of learning ReactJS. Right now I'm learning how tables work. Right now, I have a single working table that is loaded with JSON data, but I want to create a second table. Right now I keep running into this error:

Module build failed: D:/Documents/Web Programming/React/my-app/src/App.js: Duplicate declaration "Table"

I've tried to rename the Table class, but that throws additional errors. What would be the best way to handle multiple tables using this approach?

import React, { Component } from "react";
import "./CSS/App.css";
import Table1 from "./Table1";
import Axios from 'axios';
import CoinTable from './components/coin-table'
import coinData from './data/coins.json'
//import DBConfig from "./API/DBConfig"; // can't do because you need to have the api 

// creates a "template" of the components that will be used
// Header and Content need to be capitalized in order to work
class App extends Component
{
  render()
  {
    return( // left paren has to go there otherwise it'll fail out
      <div>
        <Header/>
        <Content/> 
        <Table/>
        <Table/>
      </div>
    );
  }
}

class Header extends Component
{
  render()
  {
    return(
      <div>
        <center><h1>Learning React</h1></center>
      </div>
    );
  }
}

class Content extends Component {
  render() 
  {
    return (
        <div>
           <h2>Content</h2>
           <p>The content text!!</p>
        </div>
     );
  };
};

// coin information table
class Table extends Component {
  render() {
    return (
      <div className="App">
        <p className="Table-header">Coin Information</p>
        <Table1 data={coinData}/>
      </div>
    );
  };
}; 

// Actor information table
class Table extends Component {
  render() {
    return (
      <div className="App2">
        <p className="Table-header">Actor Table</p>
      </div>
    );
  };
};

export default App;




Icon inside on focus

I have input and on focus I show omg before placeholder and text, but now displays from top to down and I need from left to right and best used transforms, and it would be from left to right just as it is now text. Can someone help me?

Thank you.

input[type="text"] {
  width: 100%;
  height: 25px;
  padding: 1rem;
  font-size: 14px;
  border: 1px solid #e6e6e6;
  outline: none;
  transition: all .2s linear;
}
input[type="text"]:focus {
  background: url("https://svgshare.com/i/97k.svg") no-repeat;
  background-size: 27px 27px;
  background-position: 5px center;
  background-color: white;
  padding-left: 35px;
  border-color: #cccccc;
  color: black;
  transform-origin: 50% 50%;
}
<input type="text" placeholder="Text">



How to transform text in the picture of captcha?

I have a task to make something like captcha in my ASP.NET web-site. I have to choose some text and transform it to a picture. It is not said to make it crooked like in an ordinary captcha but I'm really interested if there are any tools or methods in web to make it curved.




Reset DefaultAppPool and Default website on IIS 8.5

When I open the URL from any other system the IIS default page was loading perfectly. Then I tried to add my web app in the application pool, which messed up lots of settings but it did not work and i removed it from the pool.

Now, when I open the URL it shows this error error instead of displaying the default IIS page and defaultAppPool is stopped.

I want to reset IIS to its default settings. Please help!




Lighthouse - robots.txt error Syntax not understood

When I test my website with Lighthouse it gives me that it found 50 errors with robots.txt, and I don't know what are the problems and how to solve them. It shows the content of my index.html file with error for each line. What is the problem? And how to solve it??




iView - How to use in RTL layout?

I'm creating an Arabic website with 'Vue.js', and I use iView for UI components, but the problem is that it's designed for LTR layouts while Arabic is RTL. How can I convert iView components to RTL??




java swagger example String post body

I'm documenting a project through of swagger and I have a problem. I have many methods that uses "@RequestBody String json", that is I receive the body of post though a String. I would like to show a "example" of the String that I'm waiting to recived.

@ApiOperation(value = "Lista os riscos de um paciente.")
@RequestMapping(value = "/pacienteRiscoFiltro/{token}", method = RequestMethod.POST, consumes = { "text/plain" })
public RetornoPaginadoDTO postPacienteRiscoFiltro(
        @ApiParam("Body of post") @RequestBody String json) {
    //... code of method
}

Image example

I would to change of "String" to any other text.

Someone have any ideia how can I do this?




How to add mov file animations to website?

I am working on a website in angular, and the designer has sent me alpha channel MOV files with animations that he wants me to use. How do I insert these animations into the site? Do I need to somehow convert them into JSON files? I also will need to have a setting where it only begins the animation once the user scrolls down to that part of the page. Any help for better understanding of including animations would be super helpful. Thanks!




How do I make a 2x2 grid with images in bootstrap?

I want to make a grid like this image and when it changes the resolution it stays with the same shape

grid 2x2




What is the difference between Linux and Windows architecture from a programmer’s point of view?

Recently, I was asked a question at a web-developer interview:

What is the difference between Linux and Windows architecture from a programmer’s point of view?

How would you answer the question?




TypeError: Invalid select () argument. Must be string or object" error

I'm stuck here. I keep getting "TypeError: Invalid select () argument. Must be string or object" error.

The objective is to prevent users not logged in from making comments using middleware

I passed in the middleware function into the comment route already. But once I try adding a new comment, it brings this error.

What could be causing it? Please help. I'm using colt web developer bootcamp to learn.

Please help, I'm stuck.

User Schema

Passing Middleware function into comment route

Middleware function




Enable gzip compression isn't work for some files

I did test the site on https://checkgzipcompression.com/. It said that the site has been enabled Gzip. And I did check on Website Inspect, to see the Response Header. Some of them appear Content-Encoding: gzip. Does that mean the Gzip is already there?

And back to the Gtmatrix report:

A number of cached CSS and JS files (most of them in wp-content/cache) don’t appear to be gzipped. Is it anything I can do about this situation?




Is it fine to use sessionStorage instead of shared service

I would just like to know if it is bad to use sessionStorage instead of a sharedservice in Angular. The reason why is just because sessionStorage is so easy:

  • I can easily access it from anywhere in my app
  • I don't need to worry about importing it everywhere
  • I don't need to worry about circular injection issues

sessionStorage is just so easy to use that I would love to use it to store stuff like the current logged in user, user access, base URL for calls...everything I would put in a sharedservice




Java run event at certain time in future

I am designing a java web app using jersey in which i having a date time field, "future_time" in mysql db. I am also a having a status field in the same table set to pending. I want to update the status field to completed in db if the current time >= future_time. It is like I want to schedule a event.

Secondly if current_ time < future_time and if i updated the future_time value, i would i like to reschedule the previous event.

Currently, whenever i fetch status field i check if it is pending, if it is pending then i check if future_time<= current_time, if so then i update the status field in db to completed. But there is a problem in this. This will only update the status field when i fetch it. So if i fetch the status field after a long time(after future_time) , then it will be update at that instant, saving incorrect records in db.

Can anyone suggest me a better way to achieve this?




Wordpress plugin or any free tool to scan full website for improvements

Wordpress plugin or any free tool to scan full website for improvements like -Missing html/xml sitemaps -broken link -missing images -missing blog section -social share buttons -copyright date -page speed -html errors -live support and any other things for improvement




Can't Find Other Web Pages, Except Index - Where Are They?

I need help with a bootstrap website; my father's website developed by other people. So obviously, I'm a newbie. :)

Inside the file manager, I can't find other web pages such as: About page, Events page, Gallery, etc. Where are they? Are they being hidden purposely?

Screenshot 1

Screenshot 2

Please help me find them.

Thank you for your time.




How do i change the Name of Application in Bowser Tab and in Header?

I am using one Software Product. In this product i want to change the name in tab which is showing when we open this in browser. I will change the name of this by finding out the code (path of the file is: C:.........\product\Header.ascx) and change the name in all Properties file but this is not working. I also restarted the machine and and services of product but no change occur. can anyone help me in this matter.

I am also attaching the screen shot of this.enter image description here




issue during commenting on wordpress pages

i am owner of website my comments on posts not working it will redacting you to white page you can see the samples on my website, how can i fix it ? [blog]:https://codepaz.com/1397/08/03/%d8%ac%d9%84%d8%b3%d9%87-%d8%b3%d9%88%d9%85-php/ "click here for more information on my web page"

i make it and soddenly with out any changes it happen




Hugo color theme not changing [params.palette]

I want to switch the theme color to blue, red or yellow, but it just doesn't work. the default is green color theme.

[params.palette]
    primary = "red" //I do change this to blue, yellow or green.
    accent  = "teal"

https://github.com/digitalcraftsman/hugo-material-docs/blob/master/exampleSite/config.toml

what could be the issue?




mardi 30 octobre 2018

can we containerize the asp.net website?But there is no option in vs 2017 for that

Customer wants to containerize the website.But I didnot find any options available to add docker support over there in vs2017.Is there any way available?




Fieldset Top Border breaks after Changing background of input field present in it: Only in IE11

I am facing an issue with fieldset top border in IE 11.

Description: I am having a fieldset in my web page. Its legend tag contains a checkbox. And its sub elements are input text fields. I have a JS which changes background color of input fields on checking/Unchecking checkbox present in legend.

Problem: When background color of input field changes, Fieldset's top border breaks

Can anyone tell me why this is happening?

Sample Code:

css:

table .td-left
{
    width: 60%;
    text-align:left; 
}


table .td-right
{
    width: 40%;
    text-align:right; 
}

JS:

function changeBackground()
{ document.getElementById("changeit").style.backgroundCol 

or = "red"; } html:

<fieldset>
    <legend>
        <input type = "checkbox" onclick = 
"changeBackground()">
        <label>Hello</label>
    </legend>
   <table>
        <tr>
            <td class = "td-right">
                <label>Enter Text Here:</label>
            </td>
            <td class = "td-left">
                <input type = "text" id = "changeit">
            </td>
        </tr>
    </table>
</fieldset>




Gettting error " Parse error: syntax error, unexpected ''../app/views/home'' (T_CONSTANT_ENCAPSED_STRING) in ......."

I think that the parameter "view" doesn't linked each other I don't know why it's happen, please help me to fix it,thanks :)

public function view ($view, $data = []){

    required_once '../app/views/' . $view . '.php';

}

note: Sorry for my bad english




How to create a very dynamic website design like rpcs3.net?

The website rpcs3.net is very good to look and have a very fluent design. So, how can we create such websites? Which Programming Languages Are Used and what are such websites called ?




WebSite Some time Block By Network Provider

Like

How To Fix Err_Connection_Refused Error On Google Chrome

How to Fix ERR_EMPTY_RESPONSE Error on Google Chrome




User is active throughout the session in my web application

I have a web application whee login user attention is required.

Now my scenario is if UserA is login through chrome browser and open 5 tab in that same session for UserA. I might check active tab must have at least mouse activity.

I manage it through javascript. But when I'm on tab2 and actively working on that tab2, my tab1 expired the session after amount of time I decided.

I need if user active on any of the tab, it considered as attended and active.

Ex. 1.UserABC login via chrome tab1 2.Javascript started on that tab1 and count for 20 min. If no activity found session time out. And UserABC must relogin.

Scenario 1.UserABC login via chrome tab1 2.Javascript started on that tab1 and count for 20 min. 3.UserABC session open tab2 for same website page. And work on tab2 for next 20 min. 4.When 20 min. reached tab1 expire the session because no activity done on tab1.

I tried to store this on server side for another work-around but in that website performance is down(obviously).




Hosting website using Azure Storage with CDN

I host simple website on Azure StorageV2 using Static Website option. I have own domain so i want to transfer my users by this domain using CDN Endpoint, so i've created CDN and mapped endpoint to reach 'custom origin' with link to my static website but it prompts 404 to me with "Invalid URI" description.




buttons not showing in chrome but do in safari

I have several buttons in the head section of the html page however, they don't seem to display on chrome whereas they do on safari.

<!DOCTYPE html>
<html>
<style>


 body{
        background-image: url("background_index.jpg");
     }
</style>

<head>

    <button style='font-family:Tahoma,Geneva,sans-serif;'><a href=""> Resume </a></button>
    <button style='font-family:Tahoma,Geneva,sans-serif;'><a href=""> Projects </a></button>
    <button style='font-family:Tahoma,Geneva,sans-serif;'><a href=""> Blogs </a></button>
    <button style='font-family:Tahoma,Geneva,sans-serif;'><a href=""> Contact info  </a></button>



    <h1 style='font-family:Impact, Charcoal,sans-serif;font-size:25px; text-align: center; position:relative; top:50px'> Welcome to my website. </h1>

</head>
<body>

<p1 style='position: absolute; top:200px; padding-left:100px'> Hello there </br> </p1>
<img src="self_pic.jpg" style="height:450px;width:30%; position:absolute; top:300px; padding-left:450px;"></img>

</body>

</html>




Web hooks receive a web requests

I am trying to wonder and see if I can declare an action if I enter a website like lets say, if I am in google.com then, Console application print "You are in google.com!". I have trouble time doing researches.

How can I make that work using either c# or VB? Like using http listener? Or?




Can't open a specific website running on localhost on my iphone

I have two websites, both made in vue, running on vue dev server on my mac. One is running on localhost:8080 and one on localhost:8081. My ip address is 192.168.0.168. On my iPhone, I can open the website on localhost:8080 but not the one on localhost:8081.

I have tried to switch ports so I put the website that I can't open (the one that was on 8081) on 8080 instead, but I still can't open it, and I can still open the other website when it is on 8081 instead.

Basically, I can open one but not the other. Both work perfectly on my mac btw, accessing them on localhost:8080 and localhost:8081 on my browser (chrome or safari).

When I try to open the buggy website, I instantly get the message

Safari cannot open the page because it could not connect to the server.

What could be the issue here? Could the website be too large (too much data)?




How to create a custom user login account page where user can upload papers that stores in mysql database?

Suppose i've already made a Dynamic page using sessions in servlet that generates a user login page and in that account if User has uploaded paper in his own account, after he logs in again , that should be there already.

How can we stored image in database, and how can we transfer image to another account also known to be reviewer that gets to be review the paper uploaded by user in his account.

How can this be possible, Anyone please help me, Because i have no idea, i am studying Servlets right now. Please Help. Thanks




How to Protect "User Uploads" Folder

I'm creating a files sharing service that runs through a mobile app, there's a folder in the server that hosts users uploads, I know usually in these scenarios the uploads folder must be put outside the public http directory, but I'm hosting the code on an online hosting service which doesn't allow doing that

So far here are the security measures that I've done:

  • Files inside the folder are named with randomly generated IDs while all the file information (Name,type..etc) are stored in the database
  • The Folder itself is protected using htaccess (Order Deny All) so nobody can access any data inside except scripts hosted on the server

When a user wants to download a file, my idea is to make a script that would copy the required file to a temporary folder, while adding a record in the database to delete the temp file after 2 hours of the request (Cron Job)

How efficient is my method? Can a PHP file handle cloning large number of files without putting too much pressure on the server? And what alternative ways are there to protect the folder data

Thanks for your time reading this




show last modified date on google search under the webpage link

What to do so that the google shows the last modified date of the web page instead of the published date on search in google.




AD user cannot loging to Flask app - ldap3

Using flask-ldap3-login to query AD for my web app logins. Works for everyone; but one user. User is authenticated, is part of the required AD group but app returns "malformed filter" error. Other users are not having the issue.

[Tue Oct 30 08:47:00.459215 2018] [wsgi:error] [pid 11006] [remote 172.17.0.4:56871] ERROR:flask_ldap3_login:malformed filter

The AD logs says "An account was successfully logged on"; however, the user does not log in to the app. The user has no issues login in with the AD credentials anywhere else.

What might be the issue?




Warning: Each child in an array or iterator should have a unique "key" prop. React two button function conflict

React, I have two button function both of the button conflict. Please help me T_T

I got one error: Warning: Each child in an array or iterator should have a unique "key" prop.

import React, { Component } from 'react';
import Content from './HomeItem';
import { Container, Row } from 'reactstrap';

import 'bootstrap/dist/css/bootstrap.min.css';

const HomePage = props => {
  const tvshow = props.item;
  let res;

  if (tvshow.length > 0) {
    res = tvshow.map(res => (
      <Content item={res} onClick={props.onClick} onClick={props.onClick} />
    ));
  }

  return (
    <div>
      <Container>
        <Row>{res}</Row>
      </Container>
    </div>
  );
};

export default HomePage;




Display interactive map( which is generated in jupyter notebook ) in my private website

I have generated interactive google map with hotspots in Jupyter notebook. Since, notebook file contains the commands and programming in it, so I want to display the Map in another Webpage. The Webpage is a private Webpage present in my file explorer.




How do I route the HTTP requests to HTTPS when the request method is not POST

I want to route all the HTTP requests on my Alibaba cloud instance to HTTPS requests when the request method is not POST.

Here is my current configuration:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https:// %{SERVER_NAME}/$1 [R,L]

How can I change this configuration so that it only redirects when the request is not a POST?




Commons parseRequest can not returns file

i have an multiple file input. In event onclick choose file, i created many new input, assign attribute file of newinputs equal attribute file of multiple file input at an index, but when submit, request havent file source

html code

<form action="/adv/img/upload" method="POST" enctype="multipart/form-data">
    <input type="file" name="multiplefileInput" value="" multiple="multiple" onclick="createAndAssign(this.form)">
    <button type="submit">Send</button>
    </form>

js code

for(i=0;i<fn.multiplefileInput.files[i].length;i++){
//created new inputs file
//created img view 
//created icon close image onlick close img, remove input by index
   input.file = fn.multiplefileInput.files[i];
   input.file.name = filename;
   alert(input.file.name);
}

i use alert method to check input file, it is working

java code

 try {
  // parses the request's content to extract file data
  List<FileItem> formItems = upload.parseRequest(request);
  if (formItems != null && formItems.size()>0) {
    // iterates over form's fields
    if (formItems != null && formItems.size() > 0) {
          // iterates over form's fields
          for (FileItem item : formItems) {
              // processes only fields that are not form fields
              if (!item.isFormField()) {
                  String fileName = new File(item.getName()).getName();
                  String filePath = uploadPath + File.separator + fileName;
                  File storeFile = new File(filePath);

                  System.out.println(fileName);

                  // saves the file on disk
                  item.write(storeFile);
                  request.setAttribute("message",
                      "Upload has been done successfully!");
              } else{
                String fieldValue = item.getString();
                //do somethings
              }
      }

result : null




Understanding IIS settings of my published LOCAL website

I'm experiment at home, I have 2 computers, and on one of them I published website, which I would like to access from another computer, And I've did next:

1.) Added new website on IIS 2.) Browsed to my website files 3.) Wrote on system32/drivers/etc/hosts 127.0.0.1 and added my hostname

And with this settings everything worked on computer that used as server

But when I tried to access it from my client computer it did not worked, so I had to change bindings of my website I entered IP address of my machine in bindings like this:

enter image description here

And after I did this I was able to access from another computer but I had to edit hosts file and change 127.0.0.1 to 192.168.1.201, but because in my hosts file (on hoster - server machine) stayed 127.0.0.1 even if I am hoster I couldn't access my website and my client ( another computer ) could because on client I wrote in hosts 192.168.1.201, and I'm wondering why it didn't worked when I'm hoster, 127.0.0.1 represent my localhost?

*

Why do I need to write my own IP (192.168.1.201) in my own hosts file to open a website on my own machine, I understand doing this on a client machine and that is ok, but I don't understand why I had to do this on machine where app is published.. I thought I can leave 127.0.0.1 and everything would work..

*

This is how it looked :

enter image description here

Thanks a lot Cheers




how to entirely empty browser cache using keyboards shortcuts?

The ctrl+f5 do not entirely empty the cache on both chrome and firefox.

After code modification , the effect is only visible when going to preferences/empty cache data.




'tiny-server' command not being recognized

I don't know if TinyServer is that well known, but it's used to open a localhost where you can locally host files on a certain folder. TinyServer is downloaded from Node(npm). To start TinyServer on a certain folder, you just cd to that folder in your cmd, and then type tiny-server. This always worked, but recently it started saying that tiny-server isn't a command. I've tried reinstalling TinyServer, and rebooting my pc, yet nothing works.




Is there layout viewport in android chrome?

in my chrome 65.0.3325 on android 8.10,

I set css on a element:

position: fixed;
bottom: 0;

when I start input something in a input element, the keyboard popup, the element that positioned by fixed, will also "popup up", seem to position by visual viewport

as I remembered, the position:fixed, will position the element by the layout viewport;

why does it failure?




How to make image move in a frame infinitely?

okay so I have this right here:

html:

<div class="object">
        <img src="https://www.direktorenhaus.com/wp-content/uploads/2018/03/Kabali-After-Puja-6-1-800x533.jpg" alt="pic">
      </div>

css:

.object {
  animation: MoveLeftRight 10s linear infinite;
  position: absolute;
  top: 0;
  right: 0;
}

@keyframes MoveLeftRight {
  0%, 100% {
    right: 0;
  }
  50% {
    right: 300px;
  }
}

demo: https://jsfiddle.net/kte1ar3p/

but instead of it moving left and right, right to left all the time, i want to to like go through... i.e when it goes from e.g right to left, it will come out again from right to left. i dont know if this makes sense as I am explaining...

example of how i want it:

https://www.designmuseumgent.be/en/

the first moving picture on the left.

like moving a big picture into a small frame.




Interactive orthographic corrector in a chat

I would like to add an interactive orthographic corrector on my website, but I don't know if it's possible.. I have a chat in my website, and I would like that when the user is typing on the chat, an interactive corrector is enable like on mobile phones. And it will propose and automatically replace the correct word, if the word that the user put is a misspell.

Do you think it's possible ?

Thanks a lot :)




How can I access files of a website running in google console and created using J2EE?

I got a website created in J2EE and running from google developer console compute engine. I searched for buckets, there is no. I tried to connect FTP but failed. I can establish SSH connection though but I don't know where the files are stored. I just got a ubuntu command console. Can anybody help me to find out how can I get my files and how to edit them?




best package for given website functionality

I aim to build a website with the following functionality:

  • The site should allow users to post to it with other users having the ability to comment on their posts.
  • each user should have a username and password
  • each post should be listed under certain criteria (as in song genres etc.)
  • the content of the site should be accessible by one or more given classifications.

I guess for the last point, the use of keywords or tags in posts would allow for this feature. But what about the case where the user does not provide any keywords or tags? The site should have the ability to classify content or extract keywords and tags automatically.

What is the most appropriate tool or software to incorporate this functionality?

I have been exposed to the Mojo marketplace packages which can be deployed free of charge. Can any of these packages serve this purpose?

Some of these packages can incorporate forum functionality while others are CMS systems like Wordpress and Joomla.




Laravel Connection could not be established with host mail.veebimajutus.ee [Operation not permitted #1]

When i am testing on localhost, it works, but on live server it won't.

MAIL_DRIVER=smtp
MAIL_HOST=mail.veebimajutus.ee
MAIL_PORT=465
MAIL_USERNAME=password-recovery@domain.ee
MAIL_PASSWORD=pass123
MAIL_ENCRYPTION=ssl

It says this:

Swift_TransportException
Connection could not be established with host mail.veebimajutus.ee [Operation not permitted #1]

How do i fix this?




Change the background color on the button

i've trouble. I don't know how make event handler for button, which will change background color. This my code Html

 <!DOCTYPE html>
    <html lang="en" dir="ltr">
      <head>
        <meta charset="utf-8">
        <title>Flask Tutorial</title>
      </head>
      <body>
        <h1> My First Try Using Flask </h1>
        <p> Flask is Fun </p>
         <form method="post">
        <input  type="submit" name="red" value ="red" >
         </form>
      </body>
    </html>

and i try wrote it, used flask

from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def home():
    red  = request.form("background-color:red;")
    return render_template("home.html")

if __name__ == "__main__":
    app.run(debug=True)

If u know how make event handler on django - write here, pls.




How to know whether a website using Client Side Rendering or Server Side Rendering?

I have a doubt that where client side and server side rendering differs exactly in simple terms.




retrieve child of child in firebase - javascript

I am new in firebase, could anyone tell me how can I retrieve the values if there are two children under the child "status" , this is my code

function tampil(){

        ordersRef.on("value", function(snapshot)
        {
                var data = snapshot.val();
                var files ="";
                for(var key in data)
                {
                        files += "<tr>"+
                                                           "<td>" + data[key].name + "</td>"+ 
                                                           "<td>" + data[key].order_date + "</td>"+
                                                           "<td>" + data[key].alamat + "</td>"+
                                                           "<td>" + data[key].status + "</td>"+
                                                           '<td>'+'<button class="btn btn-primary edit" data-validasi="'+key+'">Edit</button>'+'</td>' +
                                                           '<td>'+'<button class="btn btn-danger hapus" data-validasi="'+key+'">Hapus</button>'+'</td>' +
                                                          "<tr>";
                        

                }
                tableValidasi.innerHTML= files;
                if (files !="") {       

                        var elementEditTabel = document.getElementsByClassName("edit");
                        for (var i =0; i<elementEditTabel.length; i++) {
                                elementEditTabel[i].addEventListener("click",editaFirebase,false);                      }


                        var elementHapusTable = document.getElementsByClassName("hapus");
                        for (var i =0; i<elementHapusTable.length; i++) {
                                elementHapusTable[i].addEventListener("click",hapusFirebase,false);                     }
                }
        });
}



Get user control was loaded dynamically keep null

the problem is : i loaded a user control in to a PlaceHolder and appear to the front-end successfully with binded data as i need , i am trying to get it to access method but PlaceHolder controls count is equals 0

Exception : plhUserControl.Controls[0]

Question Page :

 <div class="container">
        <div class="content2">
            <div class="content3">
                <asp:PlaceHolder runat="server" ID="plhUserControl" />
                <asp:Button ID="btnNext" Text="Next" CssClass="btn btn-primary nextquestionbutton" runat="server" OnClick="btnNext_Click"  />

            </div>
        </div>
    </div>



private void vFillPage()
{
    OperationsQuestion oOperationsQuestion = new OperationsQuestion();
    var Question = oOperationsQuestion.GetQuestionById(Convert.ToInt32(Request.QueryString["Qid"]));
    //this.QuestionTypeViewState = (int)Question.QuestionType;
    if ((EnumQuestionTypes)Question.QuestionType == EnumQuestionTypes.RadioButtonQuestion)
    {
        plhUserControl.Controls.Add((RadioButtonQuestion)Page.LoadControl("~/UserControls/RadioButtonQuestion.ascx"));
    }
}

protected void btnNext_Click(object sender, EventArgs e)
{

    OperationsQuestion oOperationsQuestion = new OperationsQuestion();
    var UserControl = plhUserControl.Controls[0];

    if (UserControl.GetType()==typeof(RadioButtonQuestion))
    {
        var RadioUserControl = (RadioButtonQuestion)UserControl;
        var list = RadioUserControl.Selected();
        oOperationsQuestion.AddOrUpdateAnswerRadioOrCheckBox(list,
            Convert.ToInt32(Request.QueryString["Qid"]),
            Convert.ToInt32(Request.QueryString["UserId"])
            );
    }
}


protected override void OnInit(EventArgs e)
{
    if (!IsPostBack)
    {
        vFillPage();
    }

    base.OnInit(e);



}

User Control :

<asp:ListView ID="lvRadioButton" runat="server" DataKeyNames="QuestionAnswerId">
    <ItemTemplate>
        <asp:RadioButton ID="rd" CssClass="CheckBoxRadioButton form-control" GroupName="RadioButtonQuestionGroup" onclick="SetUniqueRadioButton('RadioButtonQuestionGroup',this)" Text='<%# Request.QueryString["lang"]=="en"? Eval("QuestionAnswerTextEn"):Eval("QuestionAnswerTextAr") %>' runat="server" />
    </ItemTemplate>
</asp:ListView>




Facebook authentication issues in creating application

I have created an app in fb developer. I have provided email, URL, connected with FireBase, given the correct App ID & App secret key. The app is live. But still I am getting this error.

Am i missing something?




lundi 29 octobre 2018

Is there a npm module or js library like to scan symbols like qr codes?

I'm working on a web app that is supposed to use the phone's camera to recognize a shape or image (Like vuforia on UNITY) and then redirect to a path inside the application. Does any of you know a library or module that i can use?




How do blog developers handle adding new posts or article?

Do they just simply edit the html/css code? OR Do they use JavaScript to create a way to dynamically add a post to the website? If that is the case, how does it save to the website. Does it alter the html or do the articles get pulled in from a database when the web page is loaded?




Javascript left key released

I have some code that when a canvas is clicked, it sends the key event to a function and then uses:

if (e.buttons==1) { //code  here }

This detects if the left button has been clicked. How would i detect if the left button has been released?




Reading content from a file and storing it to String in C

I've written a simple http server in C and am now trying to implement HTML files. For this I need send a response, containing the content of the HTML file. How do I do that best? Do I read the file line by line, and if so how do I store them in a single string? Thanks already!




How to configure Payu's RESPONSE and CONFIRMATION routes to update a database with PHP - LARAVEL?

I am integrating the payment gateway PAYU webcheckout.

I can now send the purchase data to the payu platform through the form provided by payu webcheckout in the documentation. It's the next ...

<form method="post" action="https://sandbox.checkout.payulatam.com/ppp-web-gateway-payu/">
    <input name="merchantId"    type="hidden"  value="">
    <input name="accountId"     type="hidden"  value="" >
    <input name="description"   type="hidden"  value="">
    <input name="referenceCode" type="hidden"  value="" >
    <input name="amount"        type="hidden"  value=""   >
    <input name="tax"           type="hidden"  value=""  >
    <input name="taxReturnBase" type="hidden"  value="" >
    <input name="currency"      type="hidden"  value="" >
    <input name="signature"     type="hidden"  value=""  >
    <input name="test"          type="hidden"  value="" >
    <input name="buyerFullName" type="hidden"  value="" >
    <input name="buyerEmail"    type="hidden"  value="" >
    <input name="telephone"    type="hidden"  value="" >
    <input name="shippingAddress" type="hidden"  value="" >
    <input name="shippingCity"  type="hidden"  value="" >
    <input name="shippingCountry" type="hidden"  value="" >
    <input name="responseUrl"   type="hidden"  value="" >
    <input name="confirmationUrl" type="hidden"  value="" >

    <section class="payment_proceso_tarjeta tarjeta_form_btn_payu">
        <button type="submit" class="btn_datos_envio">
            Pagar con 
            <img class="logo_payu" src="">
        </button>
    </section>

These are my routes in Laravel.

Route::get('/response', 'ConfirmationController@response');

Route::post('/confirmation', 'ConfirmationController@confirmation');

Once the payu platform makes the payment verification, it sends me the data of the reply to the RESPONSE and CONFIRMATION routes, the user will be able to return to my store from a button that facilitates PAYU. The data that is sent to CONFIRMATION is sent with the POST method, with this data I can update my database. I get these data in the following way ...

public function confirmation(Request $request) {

    $reference_sale = $request['reference_sale'];
    $reference_pol = $request['reference_pol'];
    $transaction_id = $request['transaction_id'];
    $state_pol = $request['state_pol'];


    if($state_pol == 4) {
        App\Pedido::create([ 
          'id_user' => Auth::user()->id,
          'comprador' => $nickname_buyer,
          'ref_venta' => $reference_sale,
          'direccion_envio' => $shipping_city,
          'modo_pago' => $payment_method_name,
          'codigo_descuento' => session('codigos_usados'),
          'modo_envio' => session('entrega_pedido'),
          'estado_pedido' => $state_pol,
          'fecha_pedido' => date('Y-n-j H:i:s')
        ]);

    }
}

It is supposed that with that I should update the database, it also tells me that this URL must be PUBLIC, I have the store in Heroku. Then I do not know why it does not work.




org.openqa.selenium.WebDriverException in Java

I am new to Automation and trying to learn Automation as a manual tester. I am trying to execute a simple java code to open a Chrome browser using Selenium Webdrivers and get the below exception. Tried all possible ways to resolve the same and still nothing works. Any help would really help. Thanks.

Starting ChromeDriver 2.28.455520 (cc17746adff54984afff480136733114c6b3704b) on port 3527
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 4.67 seconds
Build info: version: '2.51.0', revision: '1af067d', time: '2016-02-05 19:11:55'
System info: host: 'BTP196816', ip: '10.241.51.20', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.7.0_99'
Driver info: org.openqa.selenium.chrome.ChromeDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
    at OpenAdf.LaunchAdf.main(LaunchAdf.java:11)




PHP enable xmlreader when it was compiled with the --disable--xmlreader flag

I need a help about php configurations. How do I "--enable-xmlreader" ?

Thanks!




How two java client-server applications running in different servers talk with each other without webservices?

I got this question in one interview.

Please help me with an answer. Since I was in a notion that without web services two applications cannot talk, I could not answer.




How to determine if an Array is subset of another in ANGULAR (typescript)? [on hold]

I need an efficent code to compare if a1[1,2,3,4,5,6] contains a2[2,5,6] (that is just an example).

Methods like .contains .duplicate equals? doesn't exist.

Thanks




Drawing a SVG with d3.js while tab is in background

Context: I am working on a webapp that has to display some fairly complicated and constantly updating (multiple times per second) SVG images. The webapp is written in Scala.js and the image is created using the d3js library (see also: scala-js-d3). We currently only support Google Chrome.

Problem: Once the webapp has been in a background tab for a while, the whole site gets unresponsive once navigated to again. Depending on how long the app was in the background, it sometimes takes up to 20 seconds for the application to be responsive again. Is there any way I can solve this?




Bubble Picker for Web?

Is there any bubble picker plugin for angular/web applications? I want to achieve this type of bubble picker Bubble Picker for Android - Hantrungkien




Best practise when making post request in JAX-RS

I have seen some different conventions regarding the response status code, when making a post request using JAX-RS.

I have seen this:

  Response.ok(//content or object).build();

My initial thought would be that this is wrong, since status code 200, just means ok, which is a broad term, but since we have 'Posted', I think 201 would be better since it also returns the URI of the element inside the header

 Response.created(//content or object).build();




Increasing the value printed

i wrote this code and I want to increase the printed value but the next value is increasing one. For example program choosed value "Anıl Efe Çoban" and it should increase one to "Anıl Efe Çoban" ' s value. But it increasing next rand's value. I can not find the error, Where is the problem? Im waiting your answers.

$deger = 0;
echo "<div align= 'center'>";
echo "<h2> Birini Seçmek Zorundasın </h2>";
echo "</div>";
$kisiler= Array("Anıl Efe Çoban", "Mert Yüksel", "Emre Çelik", "Eren 
Şimşek", "Yiğit Gölebatmaz");
$kisiler_rand= $kisiler[array_rand($kisiler)]; # random chosing
$kisiler_randd= $kisiler_rand;
echo "<div id= 'karsilastirma1'>";
echo "</div>";
echo "<br>";
echo "<div align= 'center'>";
echo $kisiler_randd;
echo "<form method= 'POST'>";
echo "<br>";
echo "<input type= 'submit' name= 'cekici' value= 'Çekici'>". " ";
echo "<input type= 'submit' name= 'zeki' value= 'Zeki'>". " ";
echo "<input type= 'submit' name= 'dedikoducu' value= 'Dedikoducu'>". " ";
echo "<input type= 'submit' name= 'neseli' value= 'Neşeli'>". " ";


if($kisiler_randd== "Anıl Efe Çoban"){ # What is the randd
        if(isset($_POST['cekici'])){
            $sql= "SELECT * FROM benalmash WHERE isim= 'Anil_cekicilik';"; 
            $result= mysqli_query($baglan, $sql);
            $resultCheck= mysqli_num_rows($result);
            if($resultCheck > 0){
                $row= mysqli_fetch_assoc($result);
                $deger= $row["deger"];
                $deger++;
                $sqll= "UPDATE benalmash SET deger= $deger WHERE isim= 
     'Anil_cekicilik';";
                $istek= mysqli_query($baglan, $sqll);
        }
    }
}


    if($kisiler_randd== "Emre Çelik"){
       if(isset($_POST['cekici'])){
        $sql= "SELECT * FROM benalmash WHERE isim= 'Emre_cekicilik';"; 
        $result= mysqli_query($baglan, $sql);
        $resultCheck= mysqli_num_rows($result);
        if($resultCheck > 0){
        $row= mysqli_fetch_assoc($result);
        $deger= $row["deger"];
        $deger++;
        $sqll= "UPDATE benalmash SET deger= $deger WHERE isim= 
      'Emre_cekicilik';";
        $istek= mysqli_query($baglan, $sqll);
        }
    }
}


if($kisiler_randd== "Eren Şimşek"){
    if(isset($_POST['cekici'])){
        $sql= "SELECT * FROM benalmash WHERE isim= 'Eren_cekicilik';"; 
        $result= mysqli_query($baglan, $sql);
        $resultCheck= mysqli_num_rows($result);
        if($resultCheck > 0){
            $row= mysqli_fetch_assoc($result);
            $deger= $row["deger"];
            $deger++;
            $sqll= "UPDATE benalmash SET deger= $deger WHERE isim= 
    'Eren_cekicilik';";
            $istek= mysqli_query($baglan, $sqll);
        }
    }
}


if($kisiler_randd== "Yiğit Gölebatmaz"){
    if(isset($_POST['cekici'])){
        $sql= "SELECT * FROM benalmash WHERE isim= 'Yigit_cekicilik';"; 
        $result= mysqli_query($baglan, $sql);
        $resultCheck= mysqli_num_rows($result);
        if($resultCheck > 0){
            $row= mysqli_fetch_assoc($result);
            $deger= $row["deger"];
            $deger++;
            $sqll= "UPDATE benalmash SET deger= $deger WHERE isim= 
     'Yigit_cekicilik';";
            $istek= mysqli_query($baglan, $sqll);
        }
    }
}




dimanche 28 octobre 2018

How to block subdomain?

I have a project recently I hosted the same on digital ocean but the websites is serving following domains

www.example.com,
host.example.com,
mail.example.com,
webdisk.example.com,
webmail.example.com 

All these sub domains are serving the same content My guess is that serving same content through different domains are not good so I want to block them.

1)How can i block sub domains instead of mail.example.com which is used by postfix.

2)Why there are different sub domains?




How to implement TOP-SEARCH as in Google trends?

So I have a website and the users use search box to get thier data ,now i want to print the top searches that were done in that day. What are the ways i can implement this?




IIS Applicaiton auto logout

In Windows Server 2012, I have IIS 8 installed. For one IIS application, I am using an application pool. I try to increase the Maximum Worker Processes to 10, however, when I open the website in a browser, it will auto log out when I click any link. When I change back the Maximum Worker Processes to 1. The log out will not happen. But in another server, the same website with Maximum Worker Processes 16, the auto log out will not happen. Why the maximum worker processes will cause the website to auto log out? How can I solve it?




Dialog action before leaving a page

I have found lots of solutions but none of them really solve my problem. I have to perform certain actions on a page if the user decides to leave without saving his changes (ask him if he really wants to leave without saving, or let him save them, and some bookkeeping ). Most answers mention the onbeforeunload event.

Something like

$(window).on('beforeunload ',function() { return 'Are you sure ?'; });

But this is not exactly what I need. First, it doesn't let me do a dialog as the user requested. The ideal for me is using a jQuery.UI modal dialog or something similar, with custom messages and two clear buttons: "Leave the page without saving" and "Save and leave" Also, this only control if I could leave or not the page, but I need to do other operations (for example, there are some pages in which the user is allowed to silently save the info and leave... don't ask me, the Business Analyst decided that) So, it is possible to do something like this pseudocode?

$(window).on('some event when I leave the page ',
     function() { 
        destiny = DetectDestinyPage();
        if (destiny in list of PagesToAsk and FormHasNotSavedInfo()){
           answer = modalDialogAskingTheClientIfHeWantToSave()
           if(answer == "yes"){
               ajaxCallToServerToSave()
            }
        }
        GoToDestiny(destiny)
      }
  }




Vanilla JS Form Generator

Coming off a long hiatus from web development and am working on a small project to get back into the swing of things. The idea is to build a quiz with different types of questions that have different inputs for each of those types. At the end I'd like to generate a JSON object of the entire quiz.

Right now, I'm having trouble thinking of how to not display the question forms until I click the "Add Question" button. Do I make the form itself a string variable and create the elements using JS that way or is there a better approach?

Also, how would I use the "Delete Question" buttons to delete the form it is contained within. Obviously, I'll have to change it to not use the same ID. Should I create an iterator variable and append that to the ID name?

Lastly, what's a good approach to looping through forms that may have different numbers/types of inputs. Should I use switch/case statements like I did before or is there a more generic approach?

Not looking for whole answers just trying to dust off the cobwebs and get the wheels turning again! Thanks!

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=0, shrink-to-fit=no">

    <title>Quiz Generator</title>

    <style>
        .container { margin: 0 auto; width: 80%; }
    </style>
</head>

<body>
    <header>
        <div class="container">
            <h1>Quiz Generator</h1>
        </div>
    </header>

    <main>
        <div class="container">
            <div id="quiz">
                <form name="addQuestionForm" id="addQuestionForm">
                        <label for="type">Question Type:</label>
                        <select name="type" id="type">
                            <option value="A">Type A</option>
                            <option value="B">Tybe B</option>
                            <option value="C">Type C</option>
                        </select>
                        <button name="addBtn" id="addBtn">Add Question</button>
                    </form>

                    <form name="typeAForm" id="typeAForm">
                        <label for="title">Question Title:</label>
                        <input type="text" name="title" id="title">

                        <label for="inputA">Input A:</label>
                        <input type="text" name="inputA" id="inputA">

                        <button name="deleteBtn" id="deleteBtn">Delete Question</button>
                    </form>

                    <form name="typeBForm" id="typeBForm">
                        <label for="title">Question Title:</label>
                        <input type="text" name="title" id="title">

                        <label for="inputB">Input B:</label>
                        <input type="text" name="inputB" id="inputB">

                        <button name="deleteBtn" id="deleteBtn">Delete Question</button>
                    </form>

                    <form name="typeCForm" id="typeCForm">
                        <label for="title">Question Title:</label>
                        <input type="text" name="title" id="title">

                        <label for="inputC">Input C:</label>
                        <input type="text" name="inputC" id="inputC">

                        <button name="deleteBtn" id="deleteBtn">Delete Question</button>
                    </form>
            </div>
            <button name="generateBtn" id="generateBtn">Generate JSON</button>
        </div> 
    </main>

    <script>
        'use strict';

        (function () {
            let quiz = document.getElementById("quiz");
            let addBtn = document.getElementById("addBtn");
            let deleteBtn = document.getElementById("deleteBtn");
            let generateBtn = document.getElementById("geneateBtn");

            addBtn.addEventListener("click", function(e) {
                e.preventDefault();
                let type = document.getElementById("type").value;
                let typeAForm = document.getElementById("typeAForm");
                let typeBForm = document.getElementById("typeBForm");
                let typeCForm = document.getElementById("typeCForm");

                let newQuestion = null;

                switch(type) {
                    case "A":
                        newQuestion = typeAForm.cloneNode(true);
                        quiz.appendChild(newQuestion);
                        break;
                    case "B":
                        newQuestion = typeBForm.cloneNode(true);
                        quiz.appendChild(newQuestion);
                        break;
                    case "C":
                        newQuestion = typeCForm.cloneNode(true);
                        quiz.appendChild(newQuestion);
                        break;
                }
            });

            deleteBtn.addEventListener("click", function(e) {
                e.preventDefault();
                // Delete parent node
            });

            generateBtn.addEventListener("click", function(e) {
                e.preventDefault();
                // Loop through questions and generate JSON object
            });
        })();
    </script>
</body>




WebGL 2.0 Questions - about rotation and transformation

I still have some things I do not understand as I study WebGL. While studying at WebGL Fundamentals site, I looked at the contents of Translation and looked at Rotation. But what do you do not know that the figure moves according to the keyboard input but does not move at the same time as it rotates diagonally? Do I have to look at the Matrix?

// Vertex shader.
var _vertexShader = `
    attribute vec2 _position;
    uniform vec2 _translation;
    uniform vec2 _rotation;
    void main() {
        // Rotate the position.
        vec2 _rotatedPosition = vec2(_position.x * _rotation.y + _position.y * _rotation.x,
            _position.y * _rotation.y - _position.x * _rotation.x);
        gl_Position = vec4(_translation + _rotatedPosition, 0, 1);
    }
`

// Fragment shader.
var _fragmentShader = `
    precision mediump float;
    uniform vec4 _color;
    void main() {
        gl_FragColor = _color;
    }
`

// Create shader
function createShader(gl, type, source) {
    var shader = gl.createShader(type)
    gl.shaderSource(shader, source)
    gl.compileShader(shader)
    var success = gl.getShaderParameter(shader, gl.COMPILE_STATUS)
    if (success) {
        return shader
    } else {
        console.log(gl.getShaderInfoLog(shader))
        gl.deleteShader(shader)
        // return false
    }
}

// Linking shader by program
function createProgram(gl, vertexShader, fragmentShader) {
    var program = gl.createProgram()
    gl.attachShader(program, vertexShader)
    gl.attachShader(program, fragmentShader)
    gl.linkProgram(program)
    var success = gl.getProgramParameter(program, gl.LINK_STATUS)
    if (success) {
        return program
    } else {
        console.log(gl.getProgramInfoLog(program))
        gl.deleteProgram(program)
        // return false
    }
}

function main() {
    // Get a WebGL context.
    var canvas = document.getElementById('canvas')
    var gl = canvas.getContext('webgl2')
    if (!gl) {
        alert('Not support WebGL.')
        return false
    }

    // Get the strings for our GLSL shaders.
    var vertexShader = createShader(gl, gl.VERTEX_SHADER, _vertexShader)
    var fragmentShader = createShader(gl, gl.FRAGMENT_SHADER, _fragmentShader)
    // Link the two shaders into a program.
    var program = createProgram(gl, vertexShader, fragmentShader)
    // Look up where the vertex data need to go.
    var positionLoc = gl.getAttribLocation(program, '_position')
    // Look up uniform locations.
    var uniformColorPositionLoc = gl.getUniformLocation(program, '_color')
    var uniformTranslationPositionLoc = gl.getUniformLocation(program, '_translation')
    var uniformLocationPositionLoc = gl.getUniformLocation(program, '_rotation')
    var body_positions = new Float32Array([
        // Body triangle (Left)
        -0.25,  0,
        0.25,  0,
        0, 0.35,
        // Body square
        -0.1, 0,
        0.1, 0,
        0.1, -0.25,
        // Body square
        -0.1, 0,
        -0.1, -0.25,
        0.1, -0.25,
    ])

    var roter_positions = new Float32Array([
        0, 0,
        0.3, 0,
        0, -0.1,

        0, 0,
        0, 0.1,
        -0.3, 0,
    ])

    // Create a buffer and put the three 2d clip space points in it.
    var body_positionBuf = gl.createBuffer()
    // Bind it to ARRAY_BUFFER (think of it as ARRAY_BUFFER = body_positionBuf).
    gl.bindBuffer(gl.ARRAY_BUFFER, body_positionBuf)
    gl.bufferData(gl.ARRAY_BUFFER, body_positions, gl.STATIC_DRAW)
    
    // Create a buffer and put the three 2d clip space points in it.
    var roter_positionBuf = gl.createBuffer()
    // Bind it to ARRAY_BUFFER (think of it as ARRAY_BUFFER = roter_positionBuf).
    gl.bindBuffer(gl.ARRAY_BUFFER, roter_positionBuf)
    gl.bufferData(gl.ARRAY_BUFFER, roter_positions, gl.STATIC_DRAW)
    
    // Translation variable
    var translation = [0, 0]
    // Rotation variable
    var rotation = [0, 1]
    // Angle variable for rotation
    var angle = 0

    // Code above this line is initialization code.
    // Code below this line is rendering code.

    drawScene()

    function drawScene() {
        // webglUtils.resizeCanvasToDisplaySize(gl.canvas)
        // Tell WebGL how to convert from clip space to pixels.
        gl.viewport(0, 0, gl.canvas.width, gl.canvas.height)

        // Clear the canvas.
        gl.clearColor(0, 0, 0, 0)
        gl.clear(gl.COLOR_BUFFER_BIT)
        
        // Tell it to use our program (pair of shaders).
        gl.useProgram(program)
        // Turn on the attribute.
        gl.enableVertexAttribArray(positionLoc)
        // Set random color for body shape.
        gl.uniform4f(uniformColorPositionLoc, Math.random(), Math.random(), Math.random(), 1)
        // Bind the position buffer.
        gl.bindBuffer(gl.ARRAY_BUFFER, body_positionBuf)
        gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0)
        // Set the Translation.
        gl.uniform2fv(uniformTranslationPositionLoc, translation)
        // Set the Rotation.
        gl.uniform2fv(uniformLocationPositionLoc, rotation)
        // Draw.
        gl.drawArrays(gl.TRIANGLES, 0, body_positions.length / 2)

        roterDraw()

        function roterDraw() {
            // Set random color for roter shape.
            gl.uniform4f(uniformColorPositionLoc, Math.random(), Math.random(), Math.random(), 1)
            // Bind the position buffer.
            gl.bindBuffer(gl.ARRAY_BUFFER, roter_positionBuf)
            gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0)
            // Set the Translation.
            gl.uniform2fv(uniformTranslationPositionLoc, translation)
            // Set the Rotation.
            gl.uniform2fv(uniformLocationPositionLoc, rotation)
            // Draw.
            gl.drawArrays(gl.TRIANGLES, 0, roter_positions.length / 2)
        }
        // var size = 2
        // var type = gl.FLOAT
        // var normalize = false
        // var stride = 0
        // var offset = 0 
    }

    // Event listener
    window.addEventListener('keypress', checkKeyPressed, false)

    function checkKeyPressed(event) {
        if (event.charCode == '119') {
            translation[0] = 0
            translation[1] += 0.05
            console.log('Translation X: ' + translation[0].toFixed(2) + ' Translation Y: ' + translation[1].toFixed(2))
            document.getElementById('yAxis').innerText = translation[1].toFixed(2)
            drawScene()
        }
        if (event.charCode == '115') {
            translation[0] = 0
            translation[1] -= 0.05
            console.log('Translation X: ' + translation[0].toFixed(2) + ' Translation Y: ' + translation[1].toFixed(2))
            document.getElementById('yAxis').innerText = translation[1].toFixed(2)
            drawScene()
        }
        if (event.charCode == '97') {
            angle -= 10
            var angleInRadians = angle * Math.PI / 180.0
            rotation[0] = Math.sin(angleInRadians)
            rotation[1] = Math.cos(angleInRadians)
            drawScene()
        }
        if (event.charCode == '100') {
            angle += 10
            var angleInRadians = angle * Math.PI / 180.0
            rotation[0] = Math.sin(angleInRadians)
            rotation[1] = Math.cos(angleInRadians)
            drawScene()
        }
    }
}

I would really appreciate it if you could give me a simple sample code to help you understand. For reference, there is a propeller made of two triangles as shown in the figure below. What happens when requestAnimationFrame () does not auto-rotate normally?

Reference image

I'm sorry to ask you a question that might seem too theoretical and easy. But I really want to learn, but it is too hard to understand.




Call Azure API from WebJob

I have a web api in an ASE and an associated web job. I am trying to call this web api from the web job but it always fails with winhttpexception: a security error has occurred. I have put in all the tls related settings but still getting the error. Any suggestions on the error? Also is there a way to share code between WebJob and web api?




Manually add Web Reference

I have a website that is attached to a web reference, eg ServiceReference1.

Now, I want to create a new website with using ServiceReference1 without using any GUI(VS or whatsoever). I just want to copy the files(xsd and svcinfo files) of ServiceReference1 from the App_WebReferences folder to the new website folder.

The thing is, how do I find out which DLL file is the ServiceReference1 referring to by using the xsd and svcinfo files?




WebGL 2.0 Question - How can I rotation and translations?

I'm trying to use WebGL for the first time and try to draw a helicopter. I have come across a few errors and I understand the principles little by little to find a solution to the error here.

I want the propeller of the helicopter to rotate itself and apply the rotation and movement of the body when typing on the keyboard. I've searched a lot of information in Google but I do not know how to apply it to my code below.

// Vertex shader
var _vertexShader = `
    attribute vec4 _position;
    uniform vec4 _translation;
    void main() {
        gl_Position = _position + _translation;
    }
`

// Fragment shader
var _fragmentShader = `
    precision mediump float;
    uniform vec4 _color;
    void main() {
        gl_FragColor = _color;
    }
`

// Create shader
function createShader(gl, type, source) {
    var shader = gl.createShader(type)
    gl.shaderSource(shader, source)
    gl.compileShader(shader)
    var success = gl.getShaderParameter(shader, gl.COMPILE_STATUS)
    if (success) {
        return shader
    } else {
        console.log(gl.getShaderInfoLog(shader))
        gl.deleteShader(shader)
        // return false
    }
}

// Linking shader by program
function createProgram(gl, vertexShader, fragmentShader) {
    var program = gl.createProgram()
    gl.attachShader(program, vertexShader)
    gl.attachShader(program, fragmentShader)
    gl.linkProgram(program)
    var success = gl.getProgramParameter(program, gl.LINK_STATUS)
    if (success) {
        return program
    } else {
        console.log(gl.getProgramInfoLog(program))
        gl.deleteProgram(program)
        // return false
    }
}

function main() {
    // Get a WebGL context.
    var canvas = document.getElementById('canvas')
    var gl = canvas.getContext('webgl2')
    if (!gl) {
        alert('Not support WebGL.')
        return false
    }

    // Get the strings for our GLSL shaders.
    var vertexShader = createShader(gl, gl.VERTEX_SHADER, _vertexShader)
    var fragmentShader = createShader(gl, gl.FRAGMENT_SHADER, _fragmentShader)
    // Link the two shaders into a program.
    var program = createProgram(gl, vertexShader, fragmentShader)
    // Look up where the vertex data need to go.
    var positionLoc = gl.getAttribLocation(program, '_position')
    // Look up uniform locations.
    var uniformColorPositionLoc = gl.getUniformLocation(program, '_color')
    var uniformTranslationPositionLoc = gl.getUniformLocation(program, '_translation')
    var body_positions = new Float32Array([
        // Body triangle (Right)
        -0.25,  0,
        0.25,  0,
        0, 0.5,
        // Body triangle (Left) 
        -0.15, 0,
        0.15, 0,
        0.15, -0.25,
        // Body square
        -0.15, 0,
        -0.15, -0.25,
        0.15, -0.25,
    ])

    var roter_positions = new Float32Array([
        0, 0,
        0.3, 0,
        0, -0.1,

        0, 0,
        0, 0.1,
        -0.3, 0,
    ])

    // Create a buffer and put the three 2d clip space points in it.
    var body_positionBuf = gl.createBuffer()
    // Bind it to ARRAY_BUFFER (think of it as ARRAY_BUFFER = body_positionBuf).
    gl.bindBuffer(gl.ARRAY_BUFFER, body_positionBuf)
    gl.bufferData(gl.ARRAY_BUFFER, body_positions, gl.STATIC_DRAW)
    
    // Create a buffer and put the three 2d clip space points in it.
    var roter_positionBuf = gl.createBuffer()
    // Bind it to ARRAY_BUFFER (think of it as ARRAY_BUFFER = roter_positionBuf).
    gl.bindBuffer(gl.ARRAY_BUFFER, roter_positionBuf)
    gl.bufferData(gl.ARRAY_BUFFER, roter_positions, gl.STATIC_DRAW)

    // Code above this line is initialization code.
    // Code below this line is rendering code.
    function drawScene() {
        // webglUtils.resizeCanvasToDisplaySize(gl.canvas)
        // Tell WebGL how to convert from clip space to pixels.
        gl.viewport(0, 0, gl.canvas.width, gl.canvas.height)

        // Clear the canvas.
        gl.clearColor(0, 0, 0, 0)
        gl.clear(gl.COLOR_BUFFER_BIT)
        
        // Tell it to use our program (pair of shaders).
        gl.useProgram(program)
        // Turn on the attribute.
        gl.enableVertexAttribArray(positionLoc)
        // Set random color for body shape.
        gl.uniform4f(uniformColorPositionLoc, Math.random(), Math.random(), Math.random(), 1)
        // Bind the position buffer.
        gl.bindBuffer(gl.ARRAY_BUFFER, body_positionBuf)
        gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0)
        // Draw.
        gl.drawArrays(gl.TRIANGLES, 0, body_positions.length / 2)
        // Set random color for roter shape.
        gl.uniform4f(uniformColorPositionLoc, Math.random(), Math.random(), Math.random(), 1)
        // Bind the position buffer.
        gl.bindBuffer(gl.ARRAY_BUFFER, roter_positionBuf)
        gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0)
        // Draw.
        gl.drawArrays(gl.TRIANGLES, 0, roter_positions.length / 2)

        // var size = 2
        // var type = gl.FLOAT
        // var normalize = false
        // var stride = 0
        // var offset = 0 
    }

    drawScene()

    // Event listener
    window.addEventListener('keypress', checkKeyPressed, false)

    function checkKeyPressed(event) {
        if (event.charCode == '119') {

        }
        if (event.charCode == '115') {
            alert('S')
        }
        if (event.charCode == '97') {

        }
        if (event.charCode == '100') {
            
        }
    }
}

Is there any advice I can give you? Also my program is show below.

My program




How to download file that is not resumable?

I am trying to download a specific file (url below) and have tried every possible solution I can find on google (using download managers, replacing .part file in Firefox).

I am out of solutions. I usually reach 700MB of the 1000MB file and my download errors (times) out.

It is required to sign up on the form first before the file can be accessed (it seems like submitting any info will do.)

https://cms.unov.org/UNCorpus/en/Download?file=UNv1.0.en-zh.tar.gz.00




How to receive data from SQLServer

i have a powerfull server , now i installed Microsoft SQLServer on My Server , however , i want to receive data from my SQLServer like online program, What is next my step? Would i change the ConnectingString and this will be ok? or it need more something ? if it is, tell me Youtube links or some answers with description . someone tell me the best way is making "API" , would someone tell me whats the best start step ? You Know ? this program is working on local database , i want to make that online and i need some description to start. if there is any way with API and ConnectingString or something , just tell the key word with some description , or links , videos...

my program developed by C# .

i can also use MYsql . but my best choice is MSserver for now.

thaks for help .




Office Powerpoint Web Add-In Save State

I am trying to develop a Powerpoint Add-In. Therefore I created a Web Add-In, added functionality etc. Last problem remaining is the saving of the current state of the different instances. It should be possible to create various instances of the Add-In on different slides, but I want the state to be reloaded when the document is reloaded. Until now I was not able to find any property which identifies an instance of the Add-In. (Saving could then be implemented easily using the Office.context.document.settings)

Maybe someone has been running through a similar problem and is able to help. Thanks a lot!




When a php file is processed via nginx & php-fpm, who owns the process ? NGINX or PHP-FPM?

My PHP-FPM runs as user www-data and NGINX server runs as user nginx. I am trying to browse a file that is written in php e.g example.com/index.php.

So when php-fpm executes the index.php in server who owns the process nginx or php-fpm ?

I had read somewhere nginx passes the php file to fast-cgi server, fast-cgi server runs the php file and generates the html content and send back to NGINX and NGINX again send back to browser.

So according me as nginx is the parent process of fast-cgi process, nginx should be the owner of the process. Please correct me if I am wrong.




mysSQL on spring mvc

I am learning spring mvc in book :Spring MVC: Beginner's Guide - Second Edition by Amuthan Ganeshan. in this book chapter 2 using HyperSQL Database and create database file create-table.sql and insert-data.sql I have two question 1. how can I replay HyperSQL Database by mySQL Database 2. how to execute sql file in maven project Thank




Asp.Net Foreach does not work can someone help me?

My Foreach does not work can someone help me?

C#

foreach (var Cat in db.Categorias)
        {
            var id_Categoria = db.Categorias.Where(x => x.IdCategoria.Equals(Cat.IdCategoria)).FirstOrDefault();
            if (id_Categoria != null && !Cat.IdCategoria.Equals(Cat.IdCategoria))
            {

            Plh_email.Controls.Add(new LiteralControl("<asp:Button ID='Cat_"+ Cat.IdCategoria +"' runat='server' Text='" + Cat.NomeCategoria + "' />"));

            }
        }




What framework is recommended to retrieve information from databases?

I need to access tables from different databases, and graph the information on a management board for example.

The web application is not done from scratch since the tables and the database model already exists, I just need a web framework that allows me to access the information in those databases and use a front-end framework to show it to the user.




Please tell me why an empty array is written to the variables

$January = $articles->whereMonth('updated_at','01')
  ->whereYear('updated_at', $year)
  ->get();

$February = $articles->whereMonth('updated_at','02')
  ->whereYear('updated_at', $year)
  ->get();

If there is no data in $January, then an empty array is written to $February regardless of the data availability. Tell me how to fix it and why is this happening?




samedi 27 octobre 2018

Domain DNS Network could not be retrieved

I am trying to set up a custom domain with github pages. I've added the github IP to my dns manager on GoDaddy as well as CNAME to my ___.github.io. I've also included a CNAME in my root directory with my custom domain name "firstlastname.ca" dns manager

Under github pages in Options, I am getting the following error: Domain's DNS record could not be retrieved enter image description here

Any ideas on what's going on and how I can try and figure out why this isn't working?

Thanks




How can I open HTML, CSS, JS files on my iPhone?

I have a question about an opening website which was created on a mac in iPhone. So, I created a website(on HTML, CSS, JS) on my mac and I want to see how does it work on my phone. If you know any ways that I can see my site on my phone, could you please help me with it? Thanks:)




Enabling paytm payment gateway on kitsune websites

I am trying to enable Paytm as my payment gateway in the ecommerce website i am creating using kitsune.

When i enable the Paytm component in the IDE, i can see the following in my kitsune-settings.json file (the preview section)

"preview": [
  {
    "domain": "example.com",
    "gateway": "paytm",
    "api_secret": "API_SECRET",
    "api_key": "API_KEY",
    "redirect_path": "/transaction_status",
    "api_url": "https://pguat.paytm.com",
    "payment_request_endpoint": "/oltp-web/processTransaction",
    "transaction_status_endpoint": "/oltp/HANDLER_INTERNAL/getTxnStatus?JsonData="
  }

Where do i find the right values for API_SECRET and API_KEY ?




How to make something like facebook text delight animations (ex: congrats) in my website

I need a way to create something like facebook text delight animations in my website.

I need when the user clicks a button the website shows balloons and other things like facebook, how can i do this?




Socket.io getting a socket every milisecond/frame

My problem started when I wanted to solve a bug of my game. I'm using socket.io, for my multiplayer game. It is a 2D shooter. It's all working fine on the client side. I'm using p5.js, and I'm just sending all the positions of all the bullets, and showing them. When I'm chaning the tab, because I'm moving the bullets in the client, all the bullets that I shot, stop. So, I want to move the bullets in the server. So, I get a socket when I shoot, with the initial position of the bullet, the direction, and the id. I want to move them by the direction, then send them to all the players, every second. But, I need to do it in the newConnection(socket) function, where all the socket.on() are located, so, it is possible to get a socket every frame, without any corelation with the client? Like, every milisecond, or something like that, to get a socket, from the server, like socket.on("something"){} then the function, and I'm getting the socket every milisecond, not from the client. It is possible? Then, how?




How to extract url from html in java

I have the following code to extract text from https://www.rvparkstore.com/rv-parks-for-sale/usa , but how can I get the url. HTML HERE

look for

import java.io.IOException;
import java.io.IOException;
import java.util.Vector;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;


public class scraper {

        public static void main(String[] args) {
                // TODO Auto-generated method stub

                try {
                        Document doc = Jsoup.connect("https://www.rvparkstore.com/rv-parks-for-sale/usa").userAgent("Mozilla17u.0").get();
                        Elements urls = doc.select("div.span-9");
                        int i =0;
                        Object temp;
                        Vector<Element> urList = new Vector<Element>();
                        Elements imports = doc.select("link[href]");
                        Elements urls0 = urls.select("link[href]");
                        
                        i=urList.size();
                        
                        for(Element urlList:urls) {//urlList.
                                i++;
                                System.out.println(i+urlList.getElementsByTag("a").text());
                        }
                        
                        
                        
                } catch(IOException e) {
                    System.out.println(e);
                }
        }
}

mmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm




GUIDANCE: Database for News Website, structure and how to connect to front end

Im a front end developer building a news website, the front end is already done with html5,css and js, I have articles which requires dates, title, content, writer and so on. Im struggling trying to come up with a good back end to my website. Any tips on which framework to use?mysql or noSQL for database? Also keep in mind I want it to have lazyloading.




Youtube Data API v3 in Cordova dosent work

i tired of trying and i've searched before that on stackoverflow & internet , but i didnt find the solution , my code below using to collect links of playlist items to inner into (a href..) tag , the code works on "browser" platform , and also works on Normal browsing mode & console.log everything fine.

thereby i trying to run it on android platform but is not working!.

my code

<!-- Google API -->
<script type="text/javascript"> 
 var allVideos = new Array(); 
 function onGoogleLoad() { 
  gapi.client.setApiKey('xxxxxxxx'); 
  gapi.client.load('youtube', 'v3', function() { 

   GatherVideos("", function() { 

    allVideos.sort(function(a, b) { 
     return Date.parse(b.snippet.publishedAt) - Date.parse(a.snippet.publishedAt); 
    }) 

    for (var i = 0; i < allVideos.length; i++) { 
        console.log(allVideos[i].snippet.title +  allVideos[i].id);
        result = allVideos[i].snippet.resourceId.videoId + ' <br>';

        h1 = allVideos[i].snippet.title;
        document.getElementById('links').innerHTML += '<a href= https://youtube.com/watch?v='+result+''+h1+'</a>';

    } 
   }); 
  }); 
 } 

 function GatherVideos(pageToken, finished) { 
  var request = gapi.client.youtube.playlistItems.list({ 
   part: 'snippet', 
   playlistId: 'PLillGF-RfqbbnEGy3ROiLWk7JMCuSyQtX', 
   maxResults: 50, 
   pageToken: pageToken 
  }); 

  request.execute(function(response) { 
   allVideos = allVideos.concat(response.items); 
   if (!response.nextPageToken) 
    finished(); 
   else 
    GatherVideos(response.nextPageToken, finished); 
  }); 
 }
</script> 
<script src="https://apis.google.com/js/client.js?onload=onGoogleLoad"></script> 




Reading Nested JSON Data With React

I am trying to read nested json that is being sent back from a places api url call and I'm having issues with it reading it all. I can't send anything to the console like its not working. I can get unested json to read with no problem. If someone can take a look at my code and my json data example I would appreciate it!

import React, { Component } from 'react';

class App extends Component {
  constructor(props){
    super(props);

    this.state = {
      results:[],
    };
  }

  componentDidMount(){
    fetch("https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=34.7448,-87.6675&radius=5000&type=restaurant&key=xxxxx")
      .then(response => response.json())
      .then(data => this.setState({results: data.results}));
  }

  render() {
    const { results } = this.state;

    return (
      <div className="App">
        <ul>
          {results.map(result =>
            <li key={result.id}>
            </li>
          )}
        </ul>
      </div>
    );
  }
}

export default App;

JSON Data:

{
html_attributions: [ ],
next_page_token: "CvQD5wEAAMlYM9qnA7dPRRpXc_romXZ0rACsqjpbHrW9Jed2iPlAPyPcyFLaj9-LN6SahnobyRY1LrKJt9ABLntmdk0_sneRnYQ15cGFp1rUJ9KyzJpFjy0s7w9EA1gQmw1RgelR1WZzD2nX2Q2SZ3YqfWvG4B6iuxPncR8MJ8lgskEcctfU2aZPdcWgF3TuxY6ig1-fBi3Ed6GE4g1UKg7rBw9VbA7PUI4aDp7wIx9nWDqCXFtkfSshm7-lUbWrdND-nWQaEUj55chIvkShUBuYyuhHxI1qbzr__LATXN-_ZhHgxU__kpj3oC8A4ueNxXB4wC5_UAKu0KeLUgmy2_1STUVKKt1hr6CcVU9__wv2q5g9u3ZzbVOqollHmAs5MZHaJOxTreHKGTqQtDOdoUX5KQaItY8El4OAUjp1Dlrhhbp8agH91OjOA9mrSPDU-YCtXFPh_z6S-I_7VDwLJ0W4uRmx1kzi-MGAlxC7RTabWES4vrURvMGOJgbdEXyQAukambnahHSGBhUpBA_nD4hwBcxYZ-OPolCimHMAK9wfEYwt8s-wSf4JWfuoCD1BaoPr2kcMRDuGpOz5u2HUoJMOyrvbo6-lB7S0fxyspswkFFvA-dnZMm60RLN2CJKq69Aw_Rg2DaSb7An5S28v40Q_xOd0Q28SEJHtvCLC3J7_Rlt4TncO88caFHFYScWvmlOcMMcVUOisca0Ne-WP",
results: [
{
geometry: {
location: {
lat: 34.74653499999999,
lng: -87.668218
},
viewport: {
northeast: {
lat: 34.7479832802915,
lng: -87.6668681697085
},
southwest: {
lat: 34.7452853197085,
lng: -87.6695661302915
}
}
},
icon: "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
id: "aeaff0d9129af889d2ce2ebad4bfc083c3d91ca0",
name: "Ruby Tuesday",
opening_hours: {
open_now: false
},
photos: [
{
height: 3024,
html_attributions: [
"<a href="https://maps.google.com/maps/contrib/117021142286141185731/photos">Marcus Kirby</a>"
],
photo_reference: "CmRaAAAAmps7PW42HZPDGKNNCJLfFCn-wY020ErmFSOnwG-FygHoT-vaIEHfIeCl4rCvwrSikuBDEOUbVH5f1f4Vg0XNQn-OJ-JgF5Z1wBxDldr2KKO7ozO6ntTdTNRLARSO7mdjEhAdEenIN2hiMQp4nRjhMooaGhTEeufW9HV9_3v5IQf0amuZaWKqcQ",
width: 4032
}
],
place_id: "ChIJ02hnAy5PfYgRrflPRNUJJ0w",
plus_code: {
compound_code: "P8WJ+JP Muscle Shoals, Alabama, United States",
global_code: "866JP8WJ+JP"
},
price_level: 2,
rating: 3.9,
reference: "ChIJ02hnAy5PfYgRrflPRNUJJ0w",
scope: "GOOGLE",
types: [
"bar",
"restaurant",
"point_of_interest",
"food",
"establishment"
],
vicinity: "1704 Woodward Avenue, Muscle Shoals"
},
{
geometry: {
location: {
lat: 34.7638758,
lng: -87.6682993
},
viewport: {
northeast: {
lat: 34.7652247802915,
lng: -87.66695031970849
},
southwest: {
lat: 34.7625268197085,
lng: -87.66964828029151
}
}
},
icon: "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
id: "2fb41b0632709f6b432883e1766d4dca9a971a43",
name: "Outback Steakhouse",
opening_hours: {
open_now: false
},
photos: [
{
height: 5312,
html_attributions: [
"<a href="https://maps.google.com/maps/contrib/101974447743919752743/photos">Massimiliano Caldi</a>"
],
photo_reference: "CmRaAAAAS-Tkrb_Pszaocvp56KaXs-RcPUPq92MgQOI8AMM5VSZdJsw4CrH2IXUc9ZdSiigA-9gKFnLDqzRSiusyAK3yRGZSH6316ju0XS-4de9LxLIZVF7Eps-Crpqpf8OabUB5EhCovCYnGErZB0QoW33SHtE_GhSRe4kAWb9HEcNSEi_xumkAqPdH1w",
width: 2988
}
],
place_id: "ChIJ3Z2X8sJIfYgRxAhj3l6uvgA",
plus_code: {
compound_code: "Q87J+HM Sheffield, Alabama, United States",
global_code: "866JQ87J+HM"
},
price_level: 2,
rating: 4.3,
reference: "ChIJ3Z2X8sJIfYgRxAhj3l6uvgA",
scope: "GOOGLE",
types: [
"bar",
"restaurant",
"point_of_interest",
"food",
"establishment"
],
vicinity: "4838 Hatch Boulevard, Sheffield"
}
],
status: "OK"
}




How to install SSL on node.js server

I bought SSL Cert from hostgator.in and they have installed it in my linux server. But how do I enable it using node.js code?




I have my apache and sql server up and running and the correct url but I'm still getting a 404

I'm using MAMP web hosting environment and I really don't understand how I'm getting a 404. I've never had this problem before, any suggestions?

Thanks




Try and catch in javascript are not working properly

Here I made a custom setInterval function but it is not working as desired.

function interval(func,ti,f){
if(f==0||f==undefined){
    try{                  //calls the function provided as argument.
        func.call();
    }
    catch(err){            //if error occurs
        alert('error occured!'); //edited       
        throw new Error("error occured!!");//edited

    }
    setTimeout(interval(func,ti,f),ti);
   }
}

the main idea behind this is that the user calls the function somewhat like this:

interval(()=>{
   console.log('hello world');
 }, 10000,0);

Since f=0 so it satisfies and enters the if statement. now when try{} calls the function, it executes.

the problem is whenever I am passing the function something like this:

    interval(()=>{
      console.log(x);
    },10000);

here x is not defined so it should go to catch and show alert and then error and at last stop execution. The problem is that it is showing error but not the one which I want to display i.e error occurred plus it is not displaying the alert. Probably it's not entering the catch(){} part of the code.

Plz, help me in figuring out the problem.




Django cached_property decorators vs core.cache

I wonder when @cached_property and django.core.cache(e.g. memcached, redis ...) of Django are used differently.

I think the roles of the two are similar. I have difficulty deciding which one to use.

  1. How do I decide which one to use ?

  2. When considering multiple processes, can '@cached_property' be shared between processes?




Idk how to edit js and css code for a sticky nav

Can someone help me? This sticky menu is in the body coded but I want it in the nav code... Only I can't code JS to CSS.

For example and editing, I provided a JSFiddle link.

http://jsfiddle.net/x8z4snt5/1/

Here a piece of css code (For the full code press the link above):

     header {
     position: fixed;
     width: 100%;
     padding-top: 50px;
     background: transparent;
     transition: 0.7s all;
     z-index: 100;
     font-family: 'Montserrat', sans-serif;
}
 body.header-fixed header {
     position: fixed;
     top: 0;
     background-color: white;
     right: 0;
     padding: 10px;
     box-shadow: 0px -14px 29px #00000059;
     width: 100%;
     z-index: 2;
}
 header .inner {
     width: 100%;
     position: relative;
     margin: 0 auto;
}
 .logo {
     float: left;
     background-image: url('../images/logo-wit.png');
     background-size: cover;
     height: 50px;
     width: 210px;
     margin-top: 10px;
     margin-left: 100px;
}
 body.header-fixed .logo {
     background-image: url('../images/logo-zwart.png');
     margin-top: 15px;
}

I hope you guys can help me!

Martijn




Html two language option with button (without having to redirect to different page )

I'm trying to make second language option to the website. Here are the details for the project :

1) I'm not trying to use Google translator system or any other auto translator service to change the entire website language.

2) I only trying to translate the main description part in the website.

3) I already have written and saved translated version of the description text.

4)I also made a dropdown language option button in a separate file but under same template for both language.

So, to make it clear, my question is :

How can I use language option button to switch the language between English and Korean (from English to Korean, and from Korean to English depending on what user select) with the translated description text I have?

----- code below is the dropdown language option button ----------------

<!DOCTYPE html>
<html>
<head>
    <title></title>

    <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>

<body>

<div class="container">            
   <div class="dropdown">
    <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">Language Option
    <span class="caret"></span></button>
    <ul class="dropdown-menu">
      <li><a href="#">English</a></li>
      <li><a href="#">Korean</a></li>
    </ul>
  </div>
</div>

</body>
</html>




Redirect from server side vs client side set location

Some online advertising agent site like Outbrain and Taboola, instead redirect to advertiser site(target site) from server side return simple HTML to the browser and by script change location, Why do this, What pros this vs redirect from the server?

<html>
    <body onload="document.location.replace('http://blog.allstate.com')">
        <form method="get" action="http://blog.allstate.com">
            <input id="cid" name="cid" type="hidden" value="c"/>
        </form>
    </body>
</html>

I get this html via fiddler!




I want to fetch a JSON from a website, but keep getting the 401 error

https://trello.com/1/boards/7AmLPD2t/cards?pluginData=true

I want to fetch the JSON in this URL, but I can't. Any help? I've tried most of the methods available on Stack Overflow already.




vendredi 26 octobre 2018

Restrictions to all users into web login expect project owner

I am developing an admin website. To login into website I am only providing firebase login with email and password, no registration for new users. But the problem is every person in authentication are able to login into my website. I want to restrict all users except the firebase project owner. How can I handle that. For this I need to write code in Node.js(cloud functions) or I can write itself in web javascript and how?

Thanks in Advance.




Creating a multipage website without loading

So i am trying to create a website with multiple different pages. I was originally going to just take the traditional route but this website caught my eye: https://anyoneworldwide.com/

Everything aside from the "Choose your location" screen has no loading whatsoever. The URL changes but there is no loading indicator on my tab or "X" on the refresh button (I am using chrome btw)

So my question is; how am I able to use this kind loading technique in a website of my own?




Print with laravel with specific measurements

I would like to know if someone knows how to print text on an invoice, I have an invoice with a specific format, which can not be printed, they give it to you, then I need the system to print on said invoice with the data related to the sale. The problem is that the measures that I put do not coincide at all. I am using DOMPDF in LARAVEL, but if you know of another better methodology

Thank you for your cooperation




Java Web Injection (Vraptor) + Websphere 8.5: javax.enterprise.inject.AmbiguousResolutionException

I am trying to deploy a .war that was running on Tomcat 8 Container to an Application Server Websphere 8.5.

Im using a mvc framework Vraptor 4, that uses dependency injection.

and getting this execption when start the aplication.

Any ideas please? Is there any steps that i need to do on the server configuration, or the problem is just in the aplication? libs or dependencies...

         javax.enterprise.inject.AmbiguousResolutionException: There is more than one api type with : br.com.caelum.vraptor.Result with qualifiers : Qualifiers: [@javax.enterprise.inject.Default()]
    for injection into 
     Method Injection Point, method :  public void br.com.caelum.vraptor.observer.download.DownloadObserver.download(br.com.caelum.vraptor.events.MethodExecuted,br.com.caelum.vraptor.Result) throws java.io.IOException, Bean Owner : [-1470479322,Name:null,WebBeans Type:MANAGED,API Types:[br.com.caelum.vraptor.observer.download.DownloadObserver,java.lang.Object],Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
         InjectionType   :  [interface br.com.caelum.vraptor.Result]
         Annotated       :  [Annotated Parameter,Base Type : interface br.com.caelum.vraptor.Result,Type Closures : [class java.lang.Object, interface br.com.caelum.vraptor.Result],Annotations : [],Position : 1]
         Qualifiers      :  [[@javax.enterprise.inject.Default()]]
    found beans: 
    344531471,Name:null,WebBeans Type:MANAGED,API Types:[br.com.caelum.vraptor.util.test.MockResult,br.com.caelum.vraptor.core.AbstractResult,java.lang.Object,br.com.caelum.vraptor.Result,br.com.caelum.vraptor.util.test.MockSerializationResult],Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]
    1922347074,Name:null,WebBeans Type:MANAGED,API Types:[br.com.caelum.vraptor.util.test.MockResult,br.com.caelum.vraptor.core.AbstractResult,java.lang.Object,br.com.caelum.vraptor.Result],Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]
    -1060459643,Name:null,WebBeans Type:MANAGED,API Types:[br.com.caelum.vraptor.util.test.MockResult,br.com.caelum.vraptor.core.AbstractResult,java.lang.Object,br.com.caelum.vraptor.util.test.MockHttpResult,br.com.caelum.vraptor.Result],Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]
    -155872150,Name:null,WebBeans Type:MANAGED,API Types:[br.com.caelum.vraptor.core.DefaultResult,br.com.caelum.vraptor.core.AbstractResult,java.lang.Object,br.com.caelum.vraptor.Result],Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]
        at org.apache.webbeans.util.InjectionExceptionUtils.throwAmbiguousResolutionExceptionForBeans(InjectionExceptionUtils.java:136)
        at org.apache.webbeans.util.InjectionExceptionUtils.throwAmbiguousResolutionException(InjectionExceptionUtils.java:126)
        at org.apache.webbeans.container.ResolutionUtil.checkResolvedBeans(ResolutionUtil.java:101)
        at org.apache.webbeans.container.InjectionResolver.checkInjectionPoints(InjectionResolver.java:197)
        at org.apache.webbeans.container.BeanManagerImpl.validate(BeanManagerImpl.java:1169)
        at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:394)
        at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:332)
        at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:183)
        at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124)
        at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:77)
        at com.ibm.ws.webbeans.common.CommonLifeCycle.startApplication(CommonLifeCycle.java:106)
        at com.ibm.ws.webbeans.services.JCDIServletContainerInitializer.onStartup(JCDIServletContainerInitializer.java:85)
        at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:620)
        at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
        at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
        at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
        at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:901)
        at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)
        at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)
        at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1211)
        at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1450)
        at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
        at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:1032)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:795)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1413)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2273)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436)
        at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:127)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:654)
        at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5572)
        at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5698)
        at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:668)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:612)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1303)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
        at java.lang.reflect.Method.invoke(Method.java:508)
        at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:83)
        at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
        at java.lang.reflect.Method.invoke(Method.java:508)
        at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:287)
        at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1263)
        at java.security.AccessController.doPrivileged(AccessController.java:666)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:91)
        at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1257)
        at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1096)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:831)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:813)
        at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1350)
        at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
        at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1243)
        at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
        at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:246)
        at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:628)
        at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source)
        at org.apache.struts.action.RequestProcessor.process(Unknown Source)
        at org.apache.struts.action.ActionServlet.process(Unknown Source)
        at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1233)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:782)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
        at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1404)
        at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:196)
        at org.apache.struts.action.RequestProcessor.doForward(Unknown Source)
        at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source)
        at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source)
        at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source)
        at org.apache.struts.action.RequestProcessor.process(Unknown Source)
        at org.apache.struts.action.ActionServlet.process(Unknown Source)
        at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1233)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:782)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
        at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistance(WSCUrlFilter.java:968)
        at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:515)
        at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:336)
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
        at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107)
        at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:949)
        at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:213)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
        at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1187)
        at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.readyInboundPostHandshake(SSLConnectionLink.java:768)
        at com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyHandshakeCompletedCallback.complete(SSLConnectionLink.java:464)
        at com.ibm.ws.ssl.channel.impl.SSLUtils.handleHandshake(SSLUtils.java:1137)
        at com.ibm.ws.ssl.channel.impl.SSLHandshakeIOCallback.complete(SSLHandshakeIOCallback.java:87)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)

my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>bradesco.solucaoaqui</groupId>
<artifactId>solucaoaquiv2</artifactId>
<version>0.0.1-SNAPSHOT</version>

<packaging>war</packaging>

<properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.target>1.7</maven.compiler.target>
</properties>

<build>
    <finalName>
        ${project.artifactId}
    </finalName>
    <plugins>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
    </dependency>

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.weld</groupId>
        <artifactId>weld-core</artifactId>
        <version>2.1.2.Final</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.weld.servlet</groupId>
        <artifactId>weld-servlet</artifactId>
        <version>2.1.2.Final</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>br.com.caelum</groupId>
        <artifactId>vraptor</artifactId>
        <version>4.2.0-RC3</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>15.0</version>
      <classifier>cdi1.0</classifier>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>5.2.2.Final</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator-cdi</artifactId>
        <version>5.0.1.Final</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.3.8.Final</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-c3p0</artifactId>
        <version>4.3.8.Final</version>
        <scope>compile</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.persistence/javax.persistence-api -->
    <dependency>
        <groupId>javax.persistence</groupId>
        <artifactId>javax.persistence-api</artifactId>
        <version>2.2</version>
    </dependency>

    <dependency>
        <groupId>br.com.caelum.vraptor</groupId>
        <artifactId>vraptor-jpa</artifactId>
        <version>4.0.2</version>
        <scope>compile</scope>
    </dependency>


    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.34</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.2</version>
    </dependency>

    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-s3</artifactId>
        <version>1.11.269</version>
    </dependency>

    <dependency>
    <!--    INTEGRACAO SOAP IMATEC -->
        <groupId>org.apache.axis</groupId>
        <artifactId>axis</artifactId>
        <version>1.4</version>
    </dependency>

    <dependency>
        <groupId>javax.xml</groupId>
        <artifactId>jaxrpc-api</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>wsdl4j</groupId>
        <artifactId>wsdl4j</artifactId>
        <version>1.6.3</version>
    </dependency>

    <dependency>
        <groupId>commons-discovery</groupId>
        <artifactId>commons-discovery</artifactId>
        <version>0.2</version>
    </dependency>

    <dependency>
        <groupId>org.owasp.encoder</groupId>
        <artifactId>encoder</artifactId>
        <version>1.2.1</version>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>

</dependencies>