lundi 31 juillet 2017

Free Subdomains with https

Is there any web hosting company, who have a totally free hosting plans and free https subdomains? I want a service with free Subdomains (with https), free cpanel and an ftp service.




How to get region Format in javascript

I am looking for a way to get the region format of user machine from pure js. This is not the current language (I can get it from navigator.language) but the format user using.

Eg: User machine language : English ("en-us") User machine region format : Norwegian Bokmal (Norway) So machine use English and use bokmal for formatting.

enter image description here

I need to get this User machine format

Please help me.




What is an acceptable website request duration per page?

I'm building a site in Laravel, and I just started using the debug bar, which gives you some info regarding your request duration and memory usage. I'm curious what the best practices for target request duration? What is realistic? What is too high? Right now, most of my requests have a duration of somewhere in between 150-250ms. I can't seem to find any info anywhere as to what is acceptable.




How can I position elements in a parallax webpage in the different viewports?

This project is a fork of the Persona 5 Fusion Calculator by Chinhododo on GitHub. Its purpose is to help me practice my web UI development skills.

The current project has two background images. The first image is city.png and is the first thing that is seen when the page is loaded.

When the user scrolls down the second image will appear in the viewport. This image is Akira.png.

Also when the user scrolls there is a div with the text "Test Text". I am trying to position this div to the right side of the page. This is the black side of the background. Currently the div appears in the top left and ends up in the navigation bar of the webpage.

To draw attention to this element I am using the AOS Javascript Library.

I tried to follow the instructions in this answer but the result ended up ruining the parallax effect.

I followed the tutorial on how to create Parallax webpages on w3schools.

Here is my project on GitHub

CSS

    .testDiv{
     width: 5%;
     height: 5%;
     left: 50%; //Notice how this does not move the div left 50%
     background-color: white;
}

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Guillotine</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <script src="http://ift.tt/2nYZfvi"></script>
    <script src="http://ift.tt/2rRxI0L"></script>
    <link href="http://ift.tt/2qyqevs" rel="stylesheet">
    <link rel="stylesheet" href="earwig_factory.css" type="text/css" charset="utf-8">
    <link rel="stylesheet" href="arrowBounce.css" type="text/css">
    <link rel="stylesheet" type="text/css" href="GuillotineStyle.css">
    <script>
        $(document).ready(function () {
            AOS.init();
            AOS.refreshHard();  //optional
        });
        $(window).scroll(function(){
            if($(document).scrollTop() > 25){
                $('.arrow').fadeOut("fast");
            }
            if($(document).scrollTop() < 25){
                $('.arrow').fadeIn("fast");
            }
        });
    </script>
</head>
<body class="scrollbar-6">
<div>
    <nav class="header-nav">
        <ul class="inline-list">
            <a href="GuillotineIndex.html" title="Persona" style=" font-size: 24px; font-family: earwig_factoryletters;">Persona</a>
            %nbsp
            <a href="GuillotineIndex.html" title="Skills" style=" font-size: 24px;font-family: earwig_factoryletters">Skills </a>
            %nbsp
            <a href="GuillotineIndex.html" title="Settings" style=" font-size: 24px;font-family: earwig_factoryletters">Settings</a>
        </ul>
    </nav>
</div>

<div class="parallax">
</div>
<div class="caption">
<span class="border">Scroll Down</span>
 <div class="arrow bounce"></div>
</div>
<div class="parallax bgimg">
    <div class="testDiv" data-aos="fade-right">
        <p style="font-family: earwig_factoryregular; color: black">Test Text</p>
    </div>
</div>
</body>
</html>




How can Firebase database rules avoid overwriting of whole nodes?

Let's say I have a simple landing page with a form asking for an email. In order to allow unauthenticated users, the write rule cannot be only on for authenticated users.

However, I realised that using the console on any browser and calling something like the following will eventually delete the whole users node.

var updates = {};
updates['/users'] = "";
firebase.database().ref().update(updates);

Can any security rules prevent whole nodes from simply being overwritten like this?




Why C# doesn't download whole source code from webpage?

I am writing a simple program which shows me station name and song title. Also my program will look for stream link. Everything works except looking for stream link. In browser there id word like "preload" but in C# no. What can I fix?

using System;
using System.Net;

namespace Web    
{
  class Program
  {
    static void Main(string[] args)
    {
        string rock = "http://ift.tt/2udlcFQ";

        string r;
        WebClient web = new WebClient();
        string html = web.DownloadString(rock);

        int radio = html.IndexOf("default__titleOffset___yb9ja guide-item__guideItemListTitle" +
            "___2oNg0 guide-item__guideItemTitle___VBHQg guide-item__truncate___2jSzt") + 152;

        html = html.Remove(0, radio);

        int title = html.IndexOf("default__titleOffset___yb9ja guide-item__guideItemListSubtitle" +
            "___3Hczj guide-item__guideItemSubtitle___2hQxF guide-item__truncate___2jSzt") + 158;

        radio = html.IndexOf("</div>");

        r = html.Remove(radio);

        Console.WriteLine(r);

        html = html.Remove(0, title);

        title = html.IndexOf("</p>");

        html = html.Remove(title);

        Console.WriteLine(html);
        Console.WriteLine("-------------------------------------------------------------");

        string coppy = web.DownloadString(rock);

        int k = coppy.IndexOf("preload");

        Console.WriteLine(k); //it outputs -1 
    }
 }
}

There is my problem on photo




How to put shorten link when claiming

Hello everyone how can i put a shorten link on a claim button for my faucet can any one help

so far got this but its not working

$msg = "ua=$addy&s=t&a=$amount&o=fh"; 
header('Location: http://adf_dot_ly/YOUR_ID/YOUR_SITE?'.$msg.'');




Listing a ChoiceField in django

Is there a way for me to change the way ChoiceFields are represented in django from a drop down list to something like buttons with each having a different choice ?




Tomcat Interceptor to forward soap messages

I have two CXF web services: Old Web Service A and New Web Service B. I am wondering if it is possible to use "org.apache.tomcat.core.BaseInterceptor" or another interceptor method to forward soap messages to B before they reach A. I don't want to change the configuration/code of A or B. I just want to redirect soap messages without consuming them. Thank you in advance.




Error "Object doesn't support 'addEventListener" when trying to import data from Web

So I'm trying to link my Excel file to an external database - a Google Spreadsheet.

In the Google Spreadsheet I copied the link after clicking on "Publish to the Web" and when I pasted it in the Excel file data-->From Web I got an error saying "Object doesn't support 'addEventListener".

I don't know what I'm missing here but after I clicked "yes", when refreshing all, the data isn't updated and it works (sometimes) only if I re-enter the link like I'm doing it in the first time...

Any advice? I'm really stuck here

Thanks!




Popup Window interaction - Selenium Python

I am trying to interact with a popup window[1] using selenium and python but I haven't figured out how to do it !

For some reason i can't access it through the css or Xpath selector and can't find the way to switch to that window..

Thanks

http://ift.tt/2vlMa35

http://ift.tt/2we6akP




POM failure application resources

Even with an src/main/resources and the requisite ApplicationResource.properties, ApplicationResource_default.properties and the "en_US" designation, the pom second below is unable to find the first used message key. The error is below. Can someone clarify?

javax.servlet.jsp.JspException: Missing message for key "label.common.title" in bundle "(default bundle)" for locale en_US

<?xml version="1.0" encoding="UTF-8"?>

http://ift.tt/VE5zRx"> 4.0.0

<groupId>com.mycompany</groupId>
<artifactId>WebApplication3_WIP_maven</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>WebApplication3_WIP_maven</name>

<properties>
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>7.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts-core</artifactId>
        <version>1.3.10</version>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts-taglib</artifactId>
        <version>1.3.10</version>
    </dependency>
    <dependency>
        <groupId>org.ostermiller</groupId>
        <artifactId>utils</artifactId>
        <version>1.07.00</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.3.11.Final</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.16</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.12</version>
    </dependency>
    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>3.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-csv</artifactId>
        <version>1.4</version>
    </dependency>

    <dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <version>2.4</version>
        <classifier>jdk15</classifier>
    </dependency>

    <dependency>
        <groupId>org.apache.openjpa</groupId>
        <artifactId>openjpa-all</artifactId>
        <version>2.4.2</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
                <compilerArguments>
                    <endorseddirs>${endorsed.dir}</endorseddirs>
                </compilerArguments>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apach e.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${endorsed.dir}</outputDirectory>
                        <silent>true</silent>
                        <artifactItems>
                            <artifactItem>
                                <groupId>javax</groupId>
                                <artifactId>javaee-endorsed-api</artifactId>
                                <version>7.0</version>
                                <type>jar</type>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>




Chrome web manifest not detected on page reload

My webpage detects the web manifest when I first build it enter image description here

But when I reload the page, Chrome says it cannot detect it. Is this a known issue? what could lead to this problem? enter image description here manifest.json:

{
  "name": "BARCly",
  "short_name": "BARCly",
  "display": "standalone",
  "start_url":".",
  "background_color": "#8221e5",
  "icons": [{
    "src": "images/BARC_logo_48px.png",
    "sizes": "48x48",
    "type": "image/png"
  }, {
    "src": "images/BARC_logo_72px.png",
    "sizes": "72x72",
    "type": "image/png"
  }, {
    "src": "images/BARC_logo_96px.png",
    "sizes": "96x96",
    "type": "image/png"
  }, {
    "src": "images/BARC_logo_144px.png",
    "sizes": "144x144",
    "type": "image/png"
  }, {
    "src": "images/BARC_logo_168px.png",
    "sizes": "168x168",
    "type": "image/png"
  }, {
    "src": "images/BARC_logo_192px.png",
    "sizes": "192x192",
    "type": "image/png"
  }],
  "related_applications": [{
        "platform": "web"
    }],
  "related_applications": [],
  "prefer_related_applications": false
}

index.html

<link rel="manifest" href="manifest.json">




How to change xml attributes with PHP using input from forms?

How to change xml tag attribute taken from an input with PHP? I have an xml phonebook and i want to make a web app that users would be able to change xml attributes with input from html forms. What kind of functions or methods should i use? I cant figure out a way for this to work by myself. Thank you for help in advance.

<PhoneBook>
<Title>TRSA</Title>
<Menu Name="Informational">
<Unit Name="Name Surname" Phone1="476" Phone2="8 888 88 888" Phone3="62811" default_photo="Resource:"/>
<Unit Name="John Johnson" Phone1="412" Phone2="" Phone3="62812" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="481" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="481" Phone2="" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="427" Phone2="" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="414" Phone2="" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="414" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="410" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
</Menu>
<Menu Name="Administration">
<Unit Name="Carl Johnson" Phone1="413" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="450" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="344" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="484" Phone2="" Phone3="52110" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="465" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson " Phone1="522" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
</Menu>
<Menu Name="Control">
<Unit Name="Carl Johnson" Phone1="475" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="525" Phone2="" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="448" Phone2="" Phone3="22222" default_photo="Resource:"/>
</Menu>
<Menu Name="Quality">
<Unit Name="Carl Johnson" Phone1="415" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="524" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="404" Phone2="8 888 88 888" Phone3="22222" default_photo="Resource:"/>
<Unit Name="Carl Johnson" Phone1="416" Phone2="" Phone3="22222" default_photo="Resource:"/>
</Menu>
</PhoneBook>




How to Ctrl + C text from Blinkist? [on hold]

Blinkist doesn't let me copy text from their website, is there anyway to get over the restriction and copy it? Thanks




Firebase: How to structure for Multiple WHERE IN Query

I am using Firebase in my small, side projects for almost a year and totally love it. But couldn't use it for large projects that require complex queries, because of single orderByChild() limitation.

Still thinking of ways to make use of Firebase for the multi where clause scenarios. In one my main project that we developed in PHP, we have a query as below:

SELECT * 
FROM  `masterEvents` 
WHERE causeId IN ( 1, 2, 3, 4, 5, 6, 7, 8 ) 
AND timeId IN (1, 2, 3, 4)
AND localityID IN (1, 2, 3, 4, 5)

Above query. filters event that happens in certain localities, happens in specific time blocks and covered under given causes.

  • Localities can be 40 in number
  • Causes will be around 20
  • Time will be 21

Solution 1: All 3 filter keys as children

{
    "eventIndex": {
        "ev1": {
            "name": "Event 1",
            "location": 2,
            "cause": 3,
            "time": 5,
        },
        "ev2": {
            "name": "Event 2",
            "location": 5,
            "cause": 2,
            "time": 1,
        },
        "ev3": {
            "name": "Event 3",
            "location": 26,
            "cause": 12,
            "time": 18,
        }
    }
}

forEach(location in selectedLocationArray) {
    firebase.database().ref("eventIndex").orderByChild("location").equalTo(location).on("value", snap => {
        // loop through all events and filter them based on selectedCauseArray and selectedTimeArray
    });
}

Solution 2: 1 Filter key in node path and 2 filter keys as children

{
    "eventIndex": {
        "location1": {
            "ev1": {
                "name": "Event 1",
                "cause": 2,
                "time": 1,
            },
            "ev2": {
                "name": "Event 2",
                "cause": 12,
                "time": 18,
            }
        },
        "location2": {
            "ev4": {
                "name": "Event 4",
                "cause": 2,
                "time": 1,
            }
        },
        "location3": {
            "ev8": {
                "name": "Event 9",
                "cause": 2,
                "time": 1,
            },
            "ev9": {
                "name": "Event 9",
                "cause": 12,
                "time": 18,
            }
        }
    }
}

forEach(location in selectedLocationArray) {
    forEach(cause in selectedCauseArray) {
        firebase.database().ref("eventIndex/location" + location).orderByChild("cause").equalTo(cause).on("value", snap => {
            // loop through all events and filter them based on selectedTimeArray
        });
    }
}

Solution 3: 2 Filter key in node path and 1 filter keys as children

Which of the above will be good efficient solution that I could take? Thanks :-)

PS: Code can be treated as Pseudo code to give an idea of the logic, rather than actual code.




How can I embed R console in a web page?

I am planning to create interactive R tutorials for my students like Datacamp or Codecademy. (Actually Datacamp is very good but some of my students' English level is not enough so I want to write tutorials in my own language.)

How can I create interactive R tutorials like the ones in Datacamp? i.e. embed an R console to the webpage, where students can answer questions, do the exercises and follow up their progresses.

ps. There is the R package learnr by RStudio but I need to subscribe to R Connect, shinyapps etc. and that exceeds my budget.




How to float pictures with text side by side

I am trying to do two things: 1) Make the three pictures float side by side 2) Create a border filled with the text in the p element below each picture.

Here is an idea of what I am trying to achieve.enter image description here

Here is what I've done so far...

<div class="fitness-section">
                <h1>Get fit</h1>
                <img src="images/EssentialWorkouts.png" alt="essentialworkouts" class="essential">
                <h5>Essential Workouts</h5>
                <p>Going to a gym is definitely the best way to transform and build your body.
                   However, It is common for many people especially new-gymmers to feel nervous,
                   intimidated and lost in the gym. There are many effective and essential
                   workouts that are bound to get you ripped and buff in no time!</p>
                <a href="" class="button">Find out more</a>
        
        </div>
        
        <div class="fitness-section">
                
                <img src="images/Motivation.png" alt="motivation" class="motivation">
                <p>Have you ever felt unmotivated and lost your will to gym? Fret not, there are 
           many inspirational quotes and articles here that will help you generate and 
           maintain a flow of positive attitude to keep you motivated to achieve your
           fitness and goals in life!</p>
        <a href="" class="button">Find out more</a>
        </div>
        
        <div class="fitness-section">
                <h1>Get fit</h1>
                <img src="images/Shoe.png" alt="shoe" class="shoe">
                <p>Working out in the gym with a proper attire is an absolute neccessity to achieve
                   the best workout possible. Wearing attire that is too tight or too loose will 
                   definitely affect your workouts. Discover and find out what you should and 
                   should not be wearing in the gym.</p>
                <a href="" class="button">Find out more</a>
        </div>



Get daily stock data from google or some other sites

Is there any sites to get the NASDAQ and NYSE stock price data by day?

I could find the historical prices by stock from google finance (csv)

http://ift.tt/2vluIMe

However I want to get prices by day not by stock.

If I could get from google finance, it's great but I couldn't find.




Connection time out error using java webservices

I am getting connection time out error and some time javax.ws.rs.ProcessingException: Unable to invoke request while sending data to the server database using web services. How could i solve this error, bellow is the my code please help me solve this issue..Thanks & appreciated in advanced...

inputStream = Olis.class.getClassLoader().getResourceAsStream(propFileName);
         try {
              prop.load(inputStream);
          } catch (IOException e) {
              e.printStackTrace();
          }
        String docitURL = prop.getProperty("docit.url");
        String docitAuthToken = prop.getProperty("docit.authToken");
        if (extracted(inputStream) != null) {
            prop.load(extracted(inputStream));
        } else {
            throw new FileNotFoundException("property file '" + propFileName + "' not found in the classpath");
        }

        String tempURL = docitURL + "token=" + docitAuthToken;


        System.out.println("url: "+tempURL);
        Client client = ClientBuilder.newClient();
        Response response = client.target(tempURL).request(MediaType.APPLICATION_JSON)
                .post(Entity.entity(lr, MediaType.APPLICATION_JSON), Response.class);

        if (response.getStatus() == Status.CREATED.getStatusCode() || response.getStatus() == Status.NO_CONTENT.getStatusCode())
            return true;
        else
            return false;




Catch the 400 Bad request before stopping the script

I downloaded files like this and it sometimes returns 400 request.

f = urllib.request.urlretrieve(url,"filename")

So I would like to check if it returns 400 error ,skip and continue to the next procedure.

However if it returns 400 , the program stops with this error.

urllib.error.HTTPError: HTTP Error 400: Bad Request

How can I don't let 400 error stop the program?




develop an analytics dashboard

Starting from an advanced knowledge of python for data analysis, I'm trying to think about developing a custom frontend (to be run in local for now), to be used as an interactive dashboard. What technologies should I use?

To be more clear, what I currently do, is to elaborate data in py and write csv, than use QlikSense Desktop for data visualization, but it is very limited for many reasons and is not an open and stable technology (it seems to be a beta version and they force all to upgrade it monthly); a quick solution could be to develop custom extensions in Qlik, in particular in javascript, but I would like to try to develop all by myself.

Note that a dashboard in QlikSense can elaborate and cross-filter up to 50M records in near real time, in a simple laptop.

What could be the best stack of (open) technologies to reproduce a dashboard like QlikSense, with custom charts, maybe starting from a "backend" knowledge of Python?




Real time chart in javascript

I have a problem with my real time chart, I need to update my xaxis every 3 seconds. It works most of the time but it doesn't always update it every 3 seconds!

The loadInitalData function works great but when it calls initChart it takes about 18 seconds then it starts to duplicate some values and update the time after more than 3 seconds.

That's what I mean by duplication: enter image description here

and this is my code:

<script>

var num = 0;
var chart = null;


export default {
  name: 'dashboard',
  data () {
  return{
        limit: 1,
        startLive: true,
      }
  },
  methods:{
    initChart(dataProvieded){
        chart = AmCharts.makeChart("chart"+num, {
              "type": "serial",
              "theme": "light",
              "synchronizeGrid":true,
              "marginTop":0,
              "marginRight": 80,
               "autoMarginOffset": 60,
              "dataProvider": dataProvieded,
              "zoomOutButton": {
                "backgroundColor": '#000000',
                "backgroundAlpha": 0.15
              },
              "valueAxes": [{ 
                  "axisAlpha": 1,
                  "position": "left"
              }],
              "graphs": [{
                  "id":"g1",
                  "balloonText": "[[category]]<br><b><span style='font-size:14px;'>[[value]]</span></b>",
                  "bullet": "round",
                  "bulletSize": 8,
                  "lineColor": "#d1655d",
                  "lineThickness": 2,
                  "negativeLineColor": "#637bb6",
                  "type": "smoothedLine",
                   "valueField": "value"

              }],
              "chartScrollbar": {
                  "graph":"g1",
                  "gridAlpha":0,
                  "color":"#888888",
                  "scrollbarHeight":55,
                  "backgroundAlpha":0,
                  "selectedBackgroundAlpha":0.1,
                  "selectedBackgroundColor":"#888888",
                  "graphFillAlpha":0,
                  "autoGridCount":true,
                  "selectedGraphFillAlpha":0,
                  "graphLineAlpha":0.2,
                  "graphLineColor":"#c2c2c2",
                  "selectedGraphLineColor":"#888888",
                  "selectedGraphLineAlpha":1

              },
              "categoryField": "date",
          })
                setInterval( function(){
                axios.get('/feeder/91/1').then(function(response){
                    chart.dataProvider.shift();
                    var date0 = new Date(response.data[7]);
                    var hours = date0.getHours();
                    var minutes = "0" + date0.getMinutes();
                    var seconds = "0" + date0.getSeconds();
                    var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
                    console.log(formattedTime);
                    chart.dataProvider.push( {
                        date: formattedTime,
                        value: response.data[0]
                    } );
                    chart.validateData();
                    }); } , 3000);

        },

        fetchDatafromServer(limit = 1){
            return axios.get('/feeder/91/'+limit);
        },

        loadInitalData(limit){
            var data = [];
            this.fetchDatafromServer(limit).then((response)=>{
                console.log('load initial data from server total: ' + response.data.length );
                response.data.forEach(function(rawData){
                 var date0 = new Date(rawData[7]);
                var h = date0.getHours();
                var m = "0" + date0.getMinutes();
                var s = "0" + date0.getSeconds();
                var ff = h + ':' + m.substr(-2) + ':' + s.substr(-2);
                    console.log(ff);

                    data.push({date: ff, value: rawData[0] });
                });

                this.initChart(data);
            });
        }
    },

    created(){  
        console.log('loaded Dashboard');
        this.loadInitalData(50);
    }
}



</script>

Thank you!




Dot Matrix Shrunk after print using the latest chrome 60.0.3112.78

I've been using chrome as my main browser for my web application, lately i decided to update my chrome but suddenly my printout got an issue.

Upon using a Dot Matrix the text got shrunk, why is that? I already explore its settings.

Btw, im using PDFJS, as my viewer.

-Ricky




How to make correctly downloading in browser from local network?

I want to make a link, that will download file from my local network. But when i press, i get a message: Not allowed to load local resource

<a href="file://192.168.30.51/MyProgram.exe" target="_blank" class="k-button">My app</a>

and

function downloadOfflineInstallerFromLocal() {
         window.open("file://192.168.30.51/MyProgram.exe",'_blank');
}

doesn't work.

How to fix it, not using --allow-file-access-from-files flag?




UserScript, how to call event submit to start js function from sources

Looked for many questions but didn't find answer. Have a js function in sources that creates listener for submit $('.subForm').submit(function(e) { e.preventDefault(); //more code } Basically, event is called by pressing a button with type="submit" When i try to submit button by calling click event or .submit function its ignore js listener and goes to other url. How to call this listener function?




Looking for projects in Laravel

I am learning Laravel 5 and looking for some projects in Laravel. Till now, I have learned how to create basic website using Youtube link: https://www.youtube.com/watch?v=jnvu1GpylP0&t=41s. I need some more sites where I can learn more about Laravel.




web service client response null

I have created a web service client using wsimport. for some reason its not creating jaxbelement method's in object factory class. that's why I have created the method by myself. When I am trying to get the response I can see the response inside console but my response object is returning null.

@CustomExceptionTransformer @LogAction public SearchByVolumeFolioResponse findByVolumeFolio(EIRServicesWebAmendmentsCriteria criteria) {

    ObjectFactory objectFactory = new ObjectFactory();
    SearchByVolumeFolio request = objectFactory.createSearchByVolumeFolio();        

    request.setTokenId(criteria.getTokenId());
    request.setVolumeFolio(criteria.getVolumeFolio());


    return (SearchByVolumeFolioResponse) ((JAXBElement<?>) this.eirSearchTemplate.marshalSendAndReceive(objectFactory.createSearchByVolumeFolio(request))).getValue();


}

what might be the problem?Thanks in advance.




dimanche 30 juillet 2017

Web Crawler to detect design issues

So I was sending a proposal for a research project and wanted to do something related to web design but couldn't find good topics.
So my question is can a web crawler be made that can detect design issues like weather the font is maintaining a good contrast on the page or not or checking for the web accessibility guidelines(design related).I know that design is a subjective term but can it be detected to collect data that can be analysed as to this much websites are designed well or not(something like this). Any help would be greatly appreciated.
Also if there is any other research topic related to web design/dev, Share please.




A more beginner friendly Zend framework 3 documentation

I'm in a bit of a pickle. Can't find a beginner friendly for the latest ZF3 OOP php framework, Is there a video tutorial or documentation to make one.




free cloud to store files and run encryption/decryption scripts

As part of my final year project, i thought of building a website to upload and download files [cloud]. As the files are uploaded and downloaded, some encryption and decryption codes are to be run.

Any suggestions for some free cloud to store and run these scripts?




JavaScript setTimeout loop appears to skip conditional testing

I have a block that reuses a getTime() function which gives me a string of only hours and minutes with no seconds, i.e. hh:mm. Parameters startTime and endTime are passed from another function that gets them from a form using input type=time. The issue I'm having that despite the function being on a timeout every second, the conditions currentTime === startTime and currentTime === endTime don't automatically run unless I forcefully press submit on my form. For example I set startTime to 9:30 and endTime to 9:35 and hit submit, the else condition will correctly process and start the setTimeout loop. However as the loop progresses once the currentTime (i.e. real/actual time) matches the startTime or endTime, nothing actually happens unless I press submit on my form again and only then it correctly runs the conditions.

//timeout
var minuteRefresh;
//looping function
function runSchedule(startTime, endTime){ 
    var currentTime = checkTime(getTime().getHours()) + ':' + 
                      checkTime(getTime().getMinutes());
    if((currentTime === startTime)){ 
        On(); }
    else if((currentTime === endTime)){ 
        Off(); 
        stopTimeout();
        }
    else{ minuteRefresh = setTimeout(runSchedule, 500);}    
}
function stopTimeout(){
    clearTimeout(minuteRefresh);
} 




How do I programmatically detect what browser is opened using Python

I need to check what browser is currently opened. I use webdriver to open it, but cannot find out a way to my question




What is the best for a simple k/v cache in terms of read performance and memory usage?

In our web app, we need a simple k/v cache, the read performance is most important, followed by memory usage, memcache or redis, which is better for that?

I googled a little bit, seems redis is better than memcache in general, and redis has more functionalities.

But in my case, I don't need those advanced features.




Python replace javascript double quotes in javascript code

I am trying to get selenium webdriver to execute the following javascript

document.querySelector('#location > input[type="text"]').value="10001"

but when I use the

execute_script("document.querySelector('#location > input[type="text"]').value="10001"")

Because of the quotes, it fails to run, how to escape the quotes?




Creating a folder when user clicks on button on web page

I want to create folder when a user enters a text and click on a button. The questions are:

1- Should I use php, html or javascript? I don't know if all of them are capable of that or not. If yes, what is the difference and which one is easier to use?

2- I want to append a predefined path prior to the user's text.

3- Obviously, windows differs from linux. So I need both for test.

The HTML code simply looks like

<body>
  <input type="text" id="pname" name="pname" placeholder="Enter the name">
  <input type="button" class="button" value="Next">
</body>

I also have defined some css codes in .




Django or Flask or possibly none!, for an API based Website for object detection in images?

as a self learned programmer who is fairly familiar with python, I'm trying to develop a website which has an API for object detection in an image, i was wondering should I use Django or Flask or they are a bit overkill for this task, what do you suggest for front end development, can i do it also in these frameworks. I'm trying to keep whole project in python as far as possible. so what so you guys think, any suggestions?




Get the limitation of google access (not API)

I access google finance url like this.

http://ift.tt/2uKmxr6

(stock chart historical data)

However , if call many times at the same time, it returns 400 bad Request error.

I think it is of course though, I would like to know the limitation or current number I can call (per hour or something)

I don't use API, so I an not sure how to know the access limitation.

(They abandoned google finance API already)

Is there any way to know the limitation of google accesss??




How to get cid from market and symbol from google finance

I would like to fetch the historical data from google finance.

Url should be like this, this is the link for Apple.

http://ift.tt/2v8XUWi

It requires cid

I have symbol name AAAPL and market name NASDAQ though, I couldn't find how to get the cid 22144 from symbol and market name.

Google finance API is already closed.

How can I get cid number ???




Hello, im thinking about web with multi-language database

I saw a lot types of DB and tables, but ill have web where people insert data in different languages (some people in english, some in spanish etc.). Website can be open in these languages and which language someone choose, see web just in this language. The point is, that english people see data, what english data was inserted. Should i have tables for all languages (when "maybe" the same information will not have the same id) ?

Thanks guys.




ng-formly When there is an error in the cell, the cell is not marked as invalid (red border)

i am trying to convert using of angular-formly (angulr1) to ng-formly(angulr2).

i am using bootstrap css.

my problem is that when the value in the cell is invalid (required or min/max...) a message error displayed under the cell but the border of the cell is still blue (valid value) instead red (invalid value) (bootstrap behavior). and the biggest problem is that the form validation is 'VALID'.

my web page this is how my web page behavior when error I attach an example that works properly based on a link http://ift.tt/2hdh0oj

my sources:

1.app.module.ts

import {NgModule,enableProdMode} from '@angular/core';
import {FormsModule, ReactiveFormsModule, Validators, FormBuilder, 
 FormGroup, FormControl} from '@angular/forms';
import {BrowserModule} from '@angular/platform-browser';
import {FormlyModule,FormlyFieldConfig, FormlyBootstrapModule} from 'ng-
 formly';
import {AppComponent} from './app.component';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';



@NgModule({
  imports: [
   BrowserModule,
   FormsModule,
   ReactiveFormsModule,
   FormlyModule.forRoot({
     types: [
    { name: 'dateFormat', defaultOptions: { templateOptions: {
      placeholder: 'dd/mm/yyyy such as 20/05/2015',
      dateFormat: 'DD, d  MM, yy',
      addonLeft: {
        class: 'fa fa-usd',
      },
    },
    validators: {
      date: control => control.value.match(/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/) 
      },
    },
  }
],
  validators: [{ name: 'required', validation: Validators.required}],
  validationMessages: [
    { name: 'required', message: (err, field) => `${field.templateOptions.label} is required.`},
    { name: 'invalidEmailAddress', message: 'Invalid Email Address' },
    { name: 'maxlength', message: 'Maximum Length Exceeded.' },
    { name: 'minlength', message: (err) => {
        return `Should have atleast ${err.requiredLength} Characters`;
      },
    }
  ]
}),
FormlyBootstrapModule,
],
 declarations: [AppComponent],
 bootstrap: [AppComponent]
})
export class AppModule {
 }

app.component.ts

import {NgModule,enableProdMode} from '@angular/core';
import {FormsModule, ReactiveFormsModule, Validators, FormBuilder, 
FormGroup, FormControl} from '@angular/forms';
import {BrowserModule} from '@angular/platform-browser';
import {FormlyModule,FormlyFieldConfig, FormlyBootstrapModule} from 'ng-            
    formly';
import {AppComponent} from './app.component';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';



@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    FormlyModule.forRoot({
      types: [
    { name: 'dateFormat', defaultOptions: { templateOptions: {
      placeholder: 'dd/mm/yyyy such as 20/05/2015',
      dateFormat: 'DD, d  MM, yy',
      addonLeft: {
        class: 'fa fa-usd',
      },
    },
    validators: {
      date: control => control.value.match(/^(0?[1-9]|[12][0-9]|3[01])[\/\-]
     (0?[1-9]|1[012])[\/\-]\d{4}$/) 
      },
    },
  }
],
  validators: [{ name: 'required', validation: Validators.required}],
  validationMessages: [
    { name: 'required', message: (err, field) => 
   `${field.templateOptions.label} is required.`},
    { name: 'invalidEmailAddress', message: 'Invalid Email Address' },
    { name: 'maxlength', message: 'Maximum Length Exceeded.' },
    { name: 'minlength', message: (err) => {
        return `Should have atleast ${err.requiredLength} Characters`;
      },
    }
  ]
 }),
FormlyBootstrapModule,
 ],
 declarations: [AppComponent],
 bootstrap: [AppComponent]
})
export class AppModule {
}




Plain text file visualization web app

I have a project which is generating a bunch of plain text files. They are made from the concatenation of several lines generated with a predictible pattern, for example:

DATE1 ; MESSAGE1 - DATABASE_NAME1 
DATE2 ; MESSAGE2 - DATABASE_NAME2 
DATE3 ; MESSAGE3 - DATABASE_NAME3
... 

On linux, I can easily navigate thanks to tools such as cat, grep, tail, less, .... If I want to filter out database 1337, I can easily use grep -E ".*;.*-.*1337", I can combine command with pipes, ..., which is very convenient.

However, this is not very user-friendly for nonprogrammers. They need to install linux, understand regular expressions, ...

So my question is: Does anyone knows a good tool to display such kind of simple textual data in a web browser, with a fancy interface. I would like to encode the structure of each line with regexes (Here, for example: (\S+) ; (.*) - (\S+)) and allow users to filter out, search and sort data based on the structure I have encoded. And, if it is possible, having the possibility to highlight patterns would be a must.

I have already looked at tools such as:

  • log.io: but it is just for displaying live data, does not work with stored files, and does not structure arbitrary data
  • elasticsearch: it seems a very powerful tool but I only want 10% of the features provided, and often works with log feeders, like logstash. Since my files are not standard Syslogs, it looks not to be the right tool.

I also already thought about implementing it myself with Django, but since good programmers are lazy (and good web application development is a hard job), it would be easier for me if someone has already answered this problem in an open source project.

Does anyone have already heard about one? Thank you very much




Update search query with Javascript

I currently have a Javascript function to update facets. See code:

function onFacetChangeApplied(){
    var url = window.location.href.split("?")[0];
    var search_query = getParameterByName('q');
    var url_with_search_query = url + '?q=' + search_query 
    $('input:checkbox.facet').each(function () {
        var sThisVal = (this.checked ? $(this).val() : null);
        var sThisName = (this.checked ? $(this).attr('name') : null);
        if(sThisVal !== null){
            url_with_search_query += '&'+encodeURIComponent(sThisName)+'='+encodeURIComponent(sThisVal);
    }
});
location.href = url_with_search_query;
return true;

Next I have some filters that sort products in A-Z and Price Low to High. How can I create an 'onchange' script to update the search query. At this moment, any new filters are overwriting to existing search query, I want it to add on to it.

HTML:

            <div class="tab-filter">
                                <select class="selectpicker" data-style="btn-select" data-width="auto" onchange="getQueryParams();">
                                <option>Sort by</option> 
                                <option value="?q=&amp;sort=0 ">Price: Low - High </option>
                                <option value="?q=&amp;sort=1 ">Price: High - Low </option>
                                <option value="?q=&amp;sort=2 ">Retailer: A-Z</option>
                                <option value="?q=&amp;sort=3 ">Retailer: Z-A</option>

                                </select>




web API- create set up to run in host

I have get WEB project & do it now how to create setup for run in host server? i do not have enough information about this section.please help me




What do i need to create a website like themoviedb.org

I want to create a website like themoviedb for my country's movies. Movie info should be community driven and the website should provide API for developer. I know its kind of a broad question, i just need to understand the bigger picture and may be suggestions for documentaion or books to read in the subject, also if there are open source projects doing same idea where i can look at the code.




Django unique combination is duplicate

django.db.utils.IntegrityError: (1062, "Duplicate entry 'Restauarant' for key 'restaurants_restaurant_name_address_id_e074fa2e_uniq'")

Above is the error. As shown in the model for a restaurant I have defined that the address and name should be unique together. Though when I create a restaurant, if the combination of name and address are unique but either of them are the same as another restaurant object then this fails. E.G. "Restaurant" at "10 Something Street" would fail if there were an existing object like "Restaurant" at "35 Something Else Street." Any suggestions would be great, thanks.

class Restaurant(models.Model):
    user = models.ForeignKey(User)
    name = models.CharField(max_length=128)
    street_number = models.CharField(max_length=10)
    route = models.CharField(max_length=128)
    locality = models.CharField(max_length=116)  # 2* 58 (longest place name)
    administrative_area_level_1 = models.CharField(max_length=116, default=None)  
    postal_code = models.CharField(max_length=12)
    country = CountryField()
    slug = models.SlugField(max_length=128)
    profile_image = models.ImageField(upload_to='profile_images', blank=True)
    menu = models.ManyToManyField(Menu)
    favourites = models.IntegerField(default=0, editable=False)
    is_active = models.BooleanField(default=True)

    class Meta:
        # ensures unique combination, prevents duplicate 'restaurants'
        unique_together = ((
            'name',
            'street_number',
            'route',
            'locality',
            'administrative_area_level_1',
            'postal_code',
            'country'
        ))



samedi 29 juillet 2017

How do you set the setting of camera to HTML?

How do you set the setting of camera to HTML?




Difference between static web page and dynamic web page?

I want to know the example describing the difference between static web page and dynamic web page??




Semantic-ui: Change card width?

Is there a way to change the width (or overall size) of semantic-ui cards?

I tried to change the @width variable in semantic/src/themes/default/views/card.variables from 290px to something else, but it does nothing.




Advice and ideas regarding the development of and editor similar the the PlayCanvas web editor?

I've been looking at the PlayCanvas web based editor. It's a obviously based on the Unity GUI but it's developed using web technology.

As a a seasoned Developer I could quite easily start coding in earnest to produce something similar. However, I was wondering if I should code a similar application from scratch or if there are any frameworks or libraries out there that people would suggest that I could use ease the burden?

I'm aware Of React and Angular although I've never used them.

Should I use these? Or any other frameworks or libraries out there?

Have any of you developed something similar and if so, how did you approach it?

Advice would be appreciated.




JSF outputlabel click event

first of all, I am very new to JSF and web development.

What I want to do is to print a message in the console if the user click an outputlabel.

{businessBean.select()} gets called only on page refresh and not when I click.

<h:outputLabel styleClass="cat" id ="businesstasks" onclick="setColor('businesstasks'); #{businessBean.select()}">
                 Business and productivity                      
            </h:outputLabel>

My test bean:

@ManagedBean(name="businessBean")
@SessionScoped
public class businessBean {
    public void select(){
        System.out.print("Test");
    }
}

I get "Test" only when I refresh the page but I want to get it on every click.

Thanks for helping!




Learning to program with F#

I'm an intermediate programmer and whenever I'm taking a video course or the like in F# I find they reference general programming concepts that I'm not familiar with and they offer no explanation, assuming that since you're learning F# you're probably already an expert programmer in another language. If I want to increase my knowledge of programming generally can I do it with F# or should I just take the more robust C# courses available? (My main resource is pluralsight and Udemy)

Specifically I'm looking to make practical applications (web apps, mobile apps etc.), but often I'm missing fundamental software engineering strategies like unit testing, continuous deployment etc. as well as working with Http GET/PUT requests (I sort of know how to do it but not really).

So what do you think, should I abandon F# and learn how to do these things with a different programming language or is there a way to learn these concepts with F#?




Gallery round navigation swapImage issue

I'm trying to make it so on default the 1st round navigation circle is orange. (as the gallery would be on that picture by default when loading/refreshing the page)

The first circle (default picture) will not turn back to grey when going to the next image.

GIF (shows issue): http://ift.tt/2v9rD0Z

My code (html): http://ift.tt/2tMBYMJ

JS:

<script>
var prevSquare;

function swapImage(thisSquare) {
    if (prevSquare && prevSquare != thisSquare) {
prevSquare.src='../Images/gallerybutton1.png';
}
    thisSquare.src = '../Images/gallerybutton2.png';
prevSquare = thisSquare;
}
</script>

Apologies, adding the code in here does not seem to work hence why i used pastebin.

Kind regards.




Best ebook for HTML5 (Both free and paid) Thank you

I'm not an expert, because I'm approaching programming for only a few months and I'm advertising graphics, so I should start at 0.

Hi guys, I would be interested in becoming a web designer and I would, if possible, recommend me an ebook to study HTML5 well. thanks a lot to everyone.




How to prevent files from being stolen by editing html code?

I have a simple Flask app that lets you download an image protected by a login. There are simply two routes:

example.com/login
http://ift.tt/2eVVxPW

You can't access "downloadpage" before you have successfully logged in. That's working fine. The folder structure looks like the following:

--flaskapp.py
----static
------images
--------background.png
--------protectedimage.png
------stylesheet.css

The login page looks like this:

< body style="background:url('../static/images/background.png');">
    <!--Login-->
</body>

If you now go to example.com/login and change the source code in the browser by clicking inspect in Chrome for example you can easily change '../static/images/background.png' to '../static/images/protectedimage.png' the protected images will be set as background and you can easily save it. How can you prevent users from being able to do that? Of course I want them to be able to download the protected image by clicking the download button on http://ift.tt/2eVVxPW.




SPA, website using oauth2 api - do I need csrf protection

My website is full SPA, and all of the authenticated user's requests are done using access token, the only form that unauthenticated users have access to is login form. So is csrf protection necessary? What potential security issues could I face if I disable csrf protection from my website? Thanks.




HTML Shows PHP file as a plain text [duplicate]

This question already has an answer here:

I learn coding in my free time and I tried creating HTML website refering to PHP file. This is my HTML code:

     <form action = "prihlaseni.php" method = "POST" >
      <input type = "text" name= "uzivatel" placeholder = "uzivatelske jmeno">
      <br>
      <input type = "password" name= "heslo" placeholder = "heslo">
      <br>
      <button type = "submit">PRIHLASIT</button>
      <br>
      </form>

I read that it should call the PHP file and execute code in it. Here is my PHP file:

    <?php
 $uzivatel  = $_POST['uzivatel'];
 $heslo  = $_POST['heslo'];
 echo $uzivatel;
 echo $heslo;
?>

I thought that the website will show the text called "uzivatel" and "heslo", but it shows the code (up here) as a plain text. I am enclosing a picture of it: Here: Would you explain me why, someone? :) Thanks a lot for helping me and sorry if its some obvious mistake, I am just a begginer, maybe I will help you once.. ;)

Radek




How to loop whole TweenMax animation?

I have a function shutterOff, which contains another one with TweenMax animation function. I need to loop the whole TweenMax animation function, like it plays again after all timelines are played. It should work like a callback function onComplete(whole animation with all timelines), which starts play animation again. I really hope on you! Thanks!

function shutterOff () {
    var shutterWrapper = $('.shutter__wrapper');
    var ww = $(window).width();

    shutterWrapper.addClass('shutter__wrapper--off');

    function animation() {
      let tl = new TimelineMax();
      let $imgOne = $('.small_img img')[0];
      let $imgTwo = $('.small_img img')[1];
      let $imgThree = $('.small_img img')[2];
      let $imgFour = $('.small_img img')[3];

      let $rowOne = $('.row-1');
      let $rowTwo = $('.row-2');
      let $rowThree = $('.row-3');

      let $textLinesOne = $('.small_text_1 > span');
      let $textLinesTwo = $('.small_text_2 > span');
      let $textLinesThree = $('.small_text_3 > span');
      let $textLinesFour = $('.small_text_4 > span');

      let $colOne = $('.big .col-text-1')[0];
      let $colTwo = $('.big .col-text-2')[0];
      let $colThree = $('.big .col-text-3')[0];

      tl
      .addLabel('appearance')
// 0 — 1
      .to($imgOne,1.1,
      {
        x: '0',
        ease: Circ.easeOut
      },'appearance')

      .staggerTo($textLinesOne,1.1,{
        x: '0',
        ease: Circ.easeOut
      },.1,'appearance')

      .to($colOne,1.1,{
        top: '-100%',
        ease: Power1.easeOut
      },'appearance')
      .to($colTwo,1.3,{
        top: '-303%',
        ease: Power1.easeOut
      },'appearance')
      .to($colThree,1.65,{
        top: '-303%',
        ease: Power1.easeOut
      },'appearance')

      // 1 — 0(reverse)
      .addLabel('disappearance', '+=2')

      .to($imgOne,1.3,
      {
        x: '120%',
        ease: Expo.easeIn
      },'disappearance')

      .staggerTo($textLinesOne,1.3,{
        x: '-100%',
        ease: Expo.easeIn
      },.1,'disappearance')
      // 1 — 0(reverse)

      /// 1 — 2
      .addLabel('appearance1to2', '+=0')

      .to($imgTwo,1.1,{
        x: '0',
        ease: Circ.easeOut
      },'appearance1to2')

      .staggerTo($textLinesTwo,1.1,{
        x: '0',
        ease: Circ.easeOut
      },.28,'appearance1to2')

      .to($colOne,1.1,{
        top: '-302%',
        ease: Power1.easeOut
      },'appearance1to2')
      .to($colTwo,1.3,{
        top: '-711%',
        ease: Power1.easeOut
      },'appearance1to2')
      .to($colThree,1.5,{
        top: '-712%',
        ease: Power1.easeOut
      },'appearance1to2')
      /// 1 — 2

      // 2 — 0(reverse)
      .addLabel('disappearance2', '+=2')

      .to($imgTwo,1.3,
      {
        x: '120%',
        ease: Expo.easeIn
      },'disappearance2')

      .staggerTo($textLinesTwo,1.3,{
        x: '-100%',
        ease: Expo.easeIn
      },.1,'disappearance2')
      // 2 — 0(reverse)

      // 2 — 3
      .addLabel('appearance2to3', '+=0')

      .to($imgThree,1.1,{
        x: '0',
        ease: Circ.easeOut
      },'appearance2to3')

      .staggerTo($textLinesThree,1.1,{
        x: '0',
        ease: Circ.easeOut
      },.28,'appearance2to3')

      .to($colOne,1.1,{
        top: '-507%',
        ease: Power1.easeOut
      },'appearance2to3')
      .to($colTwo,1.3,{
        top: '-916%',
        ease: Power1.easeOut
      },'appearance2to3')
      .to($colThree,1.65,{
        top: '-1120%',
        ease: Power1.easeOut
      },'appearance2to3')
      // 2 — 3

      // 3 — 0(reverse)
      .addLabel('disappearance3', '+=2')

      .to($imgThree,1.3,
      {
        x: '120%',
        ease: Expo.easeIn
      },'disappearance3')

      .staggerTo($textLinesThree,1.3,{
        x: '-100%',
        ease: Expo.easeIn
      },.1,'disappearance3')
      // 3 — 0(reverse)

      // 3 — 4
      .addLabel('appearance3to4', '+=0')

      .to($imgFour,1.1,{
        x: '0',
        ease: Circ.easeOut
      },'appearance3to4')

      .staggerTo($textLinesFour,1.1,{
        x: '0',
        ease: Circ.easeOut
      },.28,'appearance3to4')

      .to($colOne,1.1,{
        top: '-712%',
        ease: Power1.easeOut
      },'appearance3to4')
      .to($colTwo,1.3,{
        top: '-1528%',
        ease: Power1.easeOut
      },'appearance3to4')
      .to($colThree,1.65,{
        top: '-1528%',
        ease: Power1.easeOut
      },'appearance3to4')


      // 4 — 0(reverse)
      .addLabel('disappearance4', '+=2')

      .to($imgFour,1.3,
      {
        x: '120%',
        ease: Expo.easeIn
      },'disappearance4')

      .staggerTo($textLinesFour,1.3,{
        x: '-100%',
        ease: Expo.easeIn
      },.1,'disappearance4')
      // 4 — 0(reverse)

      // 4 — 4.5
      .addLabel('appearance4to45', '-=.7')

      .to($colOne,.5,{
        top: '-810%',
        ease: Power3.easeIn
      },'appearance4to45')
      .to($colTwo,.5,{
        top: '-1625%',
        ease: Power3.easeIn
      },'appearance4to45')
      .to($colThree,.5,{
        top: '-1636%',
        ease: Power3.easeIn
      },'appearance4to45')
      // 4 — 4.5
    }


    videoPlay();
    setTimeout(animation,800);
  }



How to write a function for send message from web to a phone number in CodeIgniter?

How to write a function for send message from web to a phone number. please help me to write a function to send message... functions for Controller and Model. In CodeIgniter?




Is a website safe from XSS attacks if there's no user-generated content?

I am working at writing a small website that should use an authentication system that requires me to store a token. Storing it in the localStorage would be for me the most convenient option at this stage, but as I understand, this is potentially vulnerable to XSS attacks. Now, the security requirements aren't very strict (no especially sensitive data would be exposed by a successful attack, the login is just used to keep track of who does what while on site), and there should be no user-generated content on the website (no comments or such), and anyway it's all passing through Angular.js. Does that sound like it's reasonably safe to use the localStorage alone, or should I still look into using it next to cookies for added security? Thanks!




CSS changes shows up in eclipse but not on browser

I have an index.html file and index.css. The directory structure is: img of directory structure

I am linking the css to html with : link rel="stylesheet" type="text.css" href="css/index.css"

I am using tomcat v8.5 to host. When I run my project on server I see this in the window within eclipse: browser displayed within eclipse

However when I open up chrome/firefox and search, it is only pulling the index.html and the css is not being displayed :(

I read that files have to be specified with "relative path", however, the folder containing index.css is in the same directory(WebContent) as the index.html. So what is the issue with href="css/index.css" ? Can someone please help me with the path issue?

Thanks so much for your time !




vendredi 28 juillet 2017

how to add relational attributes to gridview yii2?

i have a new question yii2. how to show relational values from other tables in gridview in views/viewname/index and also add a button to that for confirm?

thank you

<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\LaptopSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Laptops';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="laptop-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Laptop', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'network',
            'technology',
            'sup_id',
            'speaker',
            // 'optical_drive',
            // 'webcam',
            // 'touchpad',
            // 'card_reader',
            // 'ethernet',
            // 'vga',
            // 'hdmi',
            // 'usb3_ports',
            // 'usb2_ports',
            // 'usb_type_c',
            // 'thunderbolt_ports',
            // 'serial_ports',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>

how to add here new attributes and also add a button?




addeventlistener function not working as expected

I am not able to see the data in firebase database after giving the input through UI. Can anyone please help.

   <body>
      <input id="username" type="text" placeholder="Name"><br/>
      <input id="text" type="text" placeholder="Message"><br/>
      <button id="post">Send</button><br/>
      <div id="results"></div>
      <script>
        var myFirebase = new Firebase('http://ift.tt/2v80BH5');
        var usernameInput = document.getElementByID("username");
        var textInput = document.getElementByID("text");
        var postButton = document.getElementByID("post");

        postButton.addEventListener("click", function() {
          myFirebase.push(usernameInput + " says: " + textInput);
          textInput.value = "";
        },false);




Recommendation for bootstrapping a simple app

I'm looking for recommendations on any free self-serve apps, or paid services that have an interface to launch a simple app. All it needs to do is allow someone to create an account with password, and six other fields. Then they need to be able to login and edit those fields.

It would be ideal if that data is stored or can be exported to JSON or CSV.

Halp!




Multiple AudioContexts?

I am trying to create a React App on MeteorJS which uses the Web Audio API. It is a multi page app where each page uses web audio. I am declaring AudioContexts in all pages. I have reached the limit of 6 audio contexts allowed in an application. How do I declare one Audio Context for the whole app?

Uncaught DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6).

I have a routes file, where I can declare common objects maybe? How would I go about exporting the declared context? I tried exporting the AudioContext from another page to the latest page I am trying to make but it does not work. audioContext.close(); also does not work when I unmount components in other pages. Please Help. Thanks.




i would like to start "hacking" and learning how to protect from hacking

I do not know where to start. I already know front end of websites. I am looking for a new programming language to learn or a course to take just to get me on the right track.




Logarithmic Representation

I have values ranging from 0 to 22050. I am plotting them linearly on an HTML canvas. While the graph is displaying correctly - I want to show them on a logarithmic scale - same values but the x axis should represent 0, 10, 100, 1000, 10000, 100000(instead of 0 - 22050 linearly). Any ideas? Thanks




How to download this video?

NOT ABLE TO DOWNLOAD THIS VIDEO PLEASE HELP :) http://ift.tt/2eUDHNi




I want to legally stream background music on my site. What should i use?

I tried youtube API and hiding the video, but found out it's against their TOS. What is the correct legal way to do this?




How to scrape for the item prices in this website using Python?

I want to retrieve only the prices of the items listed in this site. How can I do that?




A way to get source page from webpage using firefox every X minutes

My goal is to get the source code of website (from Firefox!) and save it to text file every minute and then refresh the page. What's the easiest and fastest way to do so? I tried to use greasemonkey but it's over my abilities to write a working script for that.




Can I disable drag&drop feature of Filezilla?

Drag and drop would be good feature, but I don't use it. Instead, I'm suffering pain from unwanted drag&drop. Every time my mouse slips when I'm clicking the folder, It works as I'm trying to drag and drop folder.

Can I turn off the drag and drop? or Can I get confirm message before drag and drop?




Is there a way to add badge notifications using progressive web apps (PWA)?

I'm developing a progressive web application (PWA) that will eventually send notifications to users.

I already know that I'm able to send push notifications (like in any regular app), as explained in the following blog post: http://ift.tt/2vPQJj3.

I also know that I can add a PWA to the home screen, by creating a simple manifest file (http://ift.tt/1N7Lu3N).

However, after having the app in home screen, I would like to add a "hint" to user, letting him know that he has to access the application. A great way to do that is doing something like a "badge notification" (as showed in Facebook icon on the image below).

Image showing a badge notification example on the Facebook icon

Is it possible to add this kind of behavior using progressive web applications?




How to send the value of a python variable to javascript in html

Good morning. I am using the google app engine to display a google map on a web page.

I want to bring the latitude and longitude in the database and display it on the map. To do this, I need to pass the imported latitude and longitude to javascript in html. I have tried several ways but it is useless. ( ex. is useless) help me please. High Programmers i need you!!help me help me

class Map(webapp2.RequestHandler):

    db = connect_to_cloudsql()
    cursor = db.cursor()
    cursor.execute("""select latitude,longitude from User;""")

    data=cursor.fetchone() 
    lat=data[0]
    lng=data[1]

    formstring = """
    <!DOCTYPE html> 
    <html lang="ko-KR">
    <head>
    <meta charset="utf-8"/>
        <meta name="google-site-verification" content="9EqLgIzCmwFo7XAcSe4sBNZ_t0gULadyeF9BCO0DY3k"/>
    </head>
    <body class>
    <style>
     #map {
        width: 80%;
        height: 400px;
        background-color: grey;
      }
    </style>
    <div style="position:relative;width:1080px;margin:0 auto;z-index:11">
    <div class="container" role="main">
    <h3>{lat}</h3>
    <div id="map"></div>
    <br><br>
    <script async defer
    src="http://ift.tt/2ve4vPA">
    </script>

    <script>
      $.get(getLocation,function(data){
        var location=data;
      })
      function initMap() {

        var uluru = {lat: {lat} , lng: {lng} };
        var map = new google.maps.Map(document.getElementById('map'), {
          zoom: 4,
          center: uluru
        });
        var marker = new google.maps.Marker({
          position: uluru,
          map: map
        });
      }
    </script>

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




Programming language suggestion for web development

I am trying to make a web application but since I am a beginner in programming I don't know how to achieve this.

I got a web page (freepbx ucp call history) where users see call details(see screenshot).

What I want to do is linking numbers to names on mouse over. So that a tooltip will appear showing the name linked to that number.

How can I achieve this?What programming language should I use? Server is debian wheezy

web page




How to get notified when a user cancels billing agreement?

links that might help: http://ift.tt/2h8DNl8

http://ift.tt/2eTgevS

Users will register through my website and pay for registration (subscription) of infinite time limit. after they register, they would be able to access my ios app suite by logging in. The issue basically is, i want my db to be updated when a user cancels the subscription. How would i do this?

I am using paypal (express checkout billing agreements) Thanks :)




Xampp vhost not working

Hi i have been trying to get my vhost to work for the last hour and still i get redirected to the wrong site here is my vhost

# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://ift.tt/1lTyGLB;
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
#
#
<VirtualHost *:80>
    DocumentRoot "C:\xampp\htdocs\Forum"
    ServerName www.timeprison.tk
    ServerAlias timeprison.tk
    <Directory "C:\xampp\htdocs\Forum">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "C:/xampp/htdocs/daphne"
    ServerName http://ift.tt/2uINpX1
    ServerAlias vandewielmedia.ml
    ErrorLog "logs/daphne-error.log"
</VirtualHost>

can you please help me on how to fix this i keep getting redirected to vandewielmedia.ml when i try to go to timeprison.tk and i have no idea how to fix it




How a browser is able to pesent unreadable code in right way

I met a problem when i try to get the content of following link: http://ift.tt/2vdlJwo &city=Rajkot the content is written in Gujarati ,and it can be presented rightly in browser,but when you try to copy content or see it in the source Html code,you will find that the content is actually unreadable codes. So how browser is able represent it?How a browser is able to pesent unreadable code in right way




useing two css file on one page with same class name

is there a way i could use two different css file on one html page with the two css files having same class name e.g

style1.css

container{
  background-color: #ffffff;
}

style2.css

container{
  background-color: #000000;
}

index.html

<div class="style1.css/container"></div>
<div class="style2.css/container"></div>

i have tried it using this e.g

file2.php

<style>
   container{
     background-color: #000000;
   }
</style>
<div class="container">

and in the index.php

<div class="style1.css/container"></div>
<?php 
   include 'file2.php';
?>

i hope someone get what i ama trying to do, i would really appreciate if i could get any help




how to set image using css ( background-image property)?

I need to know how to set background image in CSS using background-image property.

The image cannot show in the browser. i don not know what is the reason but my file image path is from the desktop but i should use ../ use to set but it nothing will appear .Can anyone know this please help to set this problem




jeudi 27 juillet 2017

JQuery Custom Column Sorting not working for columns that are alphanumeric

I have set up custom JQuery column sorts that work for numeric or alphabetical data types but i can't get it to work for alphanumeric. I would imagine the numbers get sorted to the top and the alphas go underneath but i cannot get it to do anything. Im using Bootstrap Data Tables and JQuery. My custom statements are below but i can't see how to allow them for alphanumeric mixed field types. Has anyone have a solution or point me in the direction of where i would find one? thanks in advance.

    /* Create an array with the values of all the input boxes in a column */
$.fn.dataTable.ext.order['dom-text'] = function(settings, col) {
    return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
        return $('input', td).val();
    });
}

/* Create an array with the values of all the input boxes in a column, parsed as numbers */
$.fn.dataTable.ext.order['dom-text-numeric'] = function(settings, col) {
    return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
        return $('input', td).val() * 1;
    });
}

/* Create an array with the values of all the select options in a column */
$.fn.dataTable.ext.order['dom-select'] = function(settings, col) {
    return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
        return $('select', td).val();
    });
}

/* Create an array with the values of all the checkboxes in a column */
$.fn.dataTable.ext.order['dom-checkbox'] = function(settings, col) {
    return this.api().column(col, { order: 'index' }).nodes().map(function(td, i) {
        return $('input', td).prop('checked') ? '1' : '0';
    });
}

/* Initialise the table with the required column ordering data types */
$(document).ready(function() {
    $('#tab_logic').DataTable({
        "columns": [
            { "orderDataType": "dom-text-numeric" },
            { "orderDataType": "dom-text" },
            { "orderDataType": "dom-select" },
            { "orderDataType": "dom-select" },
            { "orderDataType": "dom-checkbox" }
        ]
    });




Multiple pipeline extensions

Do I need to specify whole pipeline or can I only "youngest" one? Examples:

file.html.erb vs file.erb

file.html.haml vs file.haml

file.css.scss vs file.scss

file.text.erb vs file.erb




PayPal not working after clicking Buy Now

I have create PayPal buy now on PayPal but when I get the HTML code that provide by PayPal and try it, it's not working. Here is the code that provide by PayPal :

 <form action="http://ift.tt/rDmnwQ" method="post" target="_top">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="A86U9CK5PE8N8">
    <table>
        <tr>
            <td>
                <input type="hidden" name="on0" value="Annual Subscription">Annual Subscription</td>
        </tr>
        <tr>
            <td>
                <select name="os0">
                    <option value="1 Year">1 Year RM57.00 MYR</option>
                </select> 
            </td>
        </tr>
    </table>
    <input type="hidden" name="currency_code" value="MYR">
    <input type="image" src="http://ift.tt/121CPXj" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="http://ift.tt/rpOo6s" width="1" height="1">
</form>

This is the result after I click Buy Now : enter image description here

I experience this problem after PayPal change their method on 29 March this year, before this I have no problem with creating PayPal button. Could anyone tell me what causes of this error?




how to call or read jar file on the web server for my computer..?

The jar file that I have is supposed to be working with web UI properly with the port number :8080 (which I manually set for local host) when I have it in my computer. However, once it is on the server, it is not working or I don't know how to. Can anyone advise me to have it work properly? html codes for make it work or any kind of codes would be very appreciated.




Eclipse static web project HTTP Preview/Server module conflicts with relative paths

So I start a static web project on eclipse. Let's say MySite. And then I start a jetty web server on eclipse and open localhost:8080 on my browser.

This is what I'll see:

Error 404 - Not Found
No context on this server matched or handled this request.
Contexts known to this server are:

    MySite(/MySite)

So I go to localhost:8080/MySite/index.html and see my homepage... except the css/js files are not loaded and the links don't work.

That's all because of the relative paths. css/main.css directs to localhost:8080/css/main.css while it should direct to localhost:8080/MySite/main.css

How to fix this without using a workaround?




web api saving files to temporary folder but visual studio wants to compile them

We have an MVC web API in which some typescript code keeps getting placed here:

C:...\WebAPI\obj\Test\Package\PackageTmp\scripts\bowtie\bowtie.d.ts

I don't midn code being copied to a temporary folder, but Visual Studio tries to compile the code there and runs into issues. I have to go to that folder, delete the files, and the compile again.

Why do files get copied to that directory? Can I tell Visual Studio not to compile those files? Can I tell it not to copy those files to that location?




Having trouble with web security

The login web page of my website is not secure, whenever typing a username or password on the login page in firefox I get a dialog box saying this : The connection is not secure. Logins entered here could be compromised. Should I try prepared statements, or is there another issue? Sorry this is a broad question, but I'm not all too familiar with web security.

Here's my login page code:

<?php 
include("connect.php"); 
include('PHPMailer/PHPMailer-master/examples/gmail_xoauth.phps');
   if (isset($_POST['createaccount'])) {
        $username = $_POST['username'];
        $password = $_POST['password'];
        $email = $_POST['email'];
        if (!connect::query('SELECT username FROM accounts WHERE username=:username', array(':username'=>$username))) {
                if (strlen($username) >= 3 && strlen($username) <= 32) {
                        if (preg_match('/[a-zA-Z0-9_]+/', $username)) {
                                if (strlen($password) >= 6 && strlen($password) <= 60) {
                                if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
                                if (!connect::query('SELECT email FROM accounts WHERE email=:email', array(':email'=>$email))) {

                                        connect::query('INSERT INTO accounts VALUES (null, :username, :password, :email, \'0\')', array(':username'=>$username, ':password'=>password_hash($password, PASSWORD_BCRYPT), ':email'=>$email));
                                        gmail_xoauth::sendMail('Welcome to the Website!', 'Your account has been created!', $email);
                                        echo "<h3 class = 'errmessage'>Success!</h3>";


                                } else {
                                        echo '<h3 class = "errmessage">Email already in use!</h3>';
                                }
                        } else {
                                        echo '<h3 class = "errmessage">Invalid email!</h3>';
                                }
                        } else {
                                echo '<h3 class = "errmessage">Invalid password, at least 6 characters!</h3>';
                        }
                        } else {
                                echo '<h3 class = "errmessage">Invalid username, at least 3 characters</h3>';
                        }
                } else {
                        echo '<h3 class = "errmessage">Invalid username</h3>';
                }
        } else {
                echo '<h3 class = "errmessage">User already exists!</h3>';
        }
    }

    if (isset($_POST['login'])) {
        $username = $_POST['username'];
        $password = $_POST['password'];
        if (connect::query('SELECT username FROM accounts WHERE username=:username', array(':username'=>$username))) {
                if (password_verify($password, connect::query('SELECT password FROM accounts WHERE username=:username', array(':username'=>$username))[0]['password'])) {
                        $cstrong = True;
                        $token = bin2hex(openssl_random_pseudo_bytes(64, $cstrong));
                        $user_id = connect::query('SELECT id FROM accounts WHERE username=:username', array(':username'=>$username))[0]['id'];
                        connect::query('INSERT INTO users VALUES (null, :token, :user_id)', array(':token'=>sha1($token), ':user_id'=>$user_id));
                        setcookie("SNID", $token, time() + 60 * 60 * 24 * 7, '/', NULL, NULL, TRUE);
                        setcookie("SNID_", '1', time() + 60 * 60 * 24 * 3, '/', NULL, NULL, TRUE);
        setcookie("username", $username, time()+3600);
        header("Location: home.php");

                } else {
                        echo '<h3 class = "errmessage">Incorrect Password!Try again</h3><br><br><br>';
                }
        } else {
                echo '<h3 class = "errmessage">User not registered!Try again</h3><br><br><br>';
        }


    }

?> 

Here's the connect.php file:

<?php
class connect
{
    private static function db()
    {
        $pdo = new PDO('mysql:host=localhost;dbname=database_name;charset = utf8','username','password');

        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    return $pdo;
}

    public static function query($query,$params = array())
    {

        $statement = self :: db()->prepare($query);
        $statement->execute($params);
        if(explode(' ',$query)[0] == 'SELECT')
        {
            $data = $statement->fetchAll();
            return $data;
        }

    }

}

?>




Get sound frequency with web Audio API

I would like to get the real time frequency of a sound but it does not work. here is my code:

navigator.getUserMedia({audio:true,video:false}, function (stream) {
document.querySelector("#music").src = window.URL.createObjectURL(stream)
document.querySelector("#music").play()
var contexteAudio = new (window.AudioContext || window.webkitAudioContext)();
var analyseur = contexteAudio.createAnalyser();
source = contexteAudio.createMediaStreamSource(stream);
source.connect(analyseur);
var tab = new Float32Array();

for (var i=0;i<=100;i++) {
    var datas = analyseur.getFloatFrequencyData(tab);
  document.querySelector("#datas").innerHTML = tab[i];
}

}, function(error) {
console.log(error)
})

You can test it here: http://ift.tt/2w4qwgg

Why can't I get the float value of my real time frequency microphone based ? the value is undefined....




Dynamic Proxy CXF Web Service

I have two identical CXF 3.1 web services Service_A and Service_B that have the same WSDL files. Service_A is deployed on Server_X and Service_B is deployed on Service_Y. Is there a way to implement a CXF web service Service_C deployed on Server_Z that will play the role of a dynamic proxy web service. Service_C is supposed to have the same WSDL file as Service_A and Service_B but it will redirect the SOAP requests to Service_A or Service_B and send back the SOAP response to the client. Thank you in advance!




Haml produces "{}" text on webpage

I am trying to convert from application.html.erb to application.haml and I get one small annoying problem being "{}" in top left corner.

problem

My code looks like this:

  %body
    = render 'shared/header'
    .container
      = flash.each do |message_type, message|
        .alert{class: "alert-#{message_type}"}= message
        -# = content_tag :div, message, class: "alert alert-#{message_type}"
      = yield
      = render 'shared/footer'

Commented out line is a second way to create div, but it produces same error.

HTML before conversion looked like this:

  <body>
    <%= render 'shared/header' %>
    <div class="container">
      <% flash.each do |message_type, message| %>
          <%= content_tag(:div, message, class: "alert alert-#{message_type}") %>
      <% end %>
      <%= yield %>
      <%= render 'shared/footer' %>
    </div>
  </body>

What's wrong with that? How do I fix it?




Show different HTML on page depending on origin file's directory location using PHP

I am working on my employer's website and I am relatively new to PHP. I am decent at deciphering code others have written, but I can't seem to figure out how to write additional code to integrate into the current page's PHP. I'm trying to figure out a way to display an image instead of displaying the ordered list if the file is not in a directory that has pre-defined "links" on spelled out.

The site that I am working on is http://ift.tt/1KfChnZ and the following is code that uses an array to choose what links go in the rightNav bar depending on what directory the html file is located in:

(An example of a page with a rightNav with links is this page: http://ift.tt/2v1K87D

An example of a page with no links is this page: http://ift.tt/2uGJ46I)

<?PHP

/*
Array:
    0:URL (Path, or URL.  If a Path it must be an absolute link. ie: starts with a /).
    1:Text (Try to limit length).
    2:Icon (Glyph Sets:Font-Awesome).
*/






if(isset($n)){
switch($n)
{
    case "High School":
        $links = [
            ["/highschool/principal.html","Principal","<i class='fa fa-user' aria-hidden='true'></i>"],
            ["/highschool/Guidance","Guidance & Scholarships","<i class='fa fa-map' aria-hidden='true'></i>"],
            ["/highschool/lrc/index.htm","Library","<i class='fa fa-book' aria-hidden='true'></i>"],
            ["/district/athletics.html","Athletics","<i class='fa fa-futbol-o' aria-hidden='true'></i>"],
            ["/highschool/clubs/index.html","Clubs & Groups","<i class='fa fa-coffee' aria-hidden='true'></i>"],
            ["/highschool/boosterClub/","Booster Club","<i class='fa fa-arrow-circle-up' aria-hidden='true'></i>"],
            ["/highschool/chsband/index.html","Band","<i class='fa fa-music' aria-hidden='true'></i>"],
            ["/highschool/attachment/2017courseBook.pdf","2017 Course Book","<i class='fa fa-list-alt' aria-hidden='true'></i>"],
            ["http://ift.tt/2v1OeN7","Claymont On-line Learning","<i class='fa fa-globe' aria-hidden='true'></i>"],
            ["/highschool/bellschedule/bell_schedule.htm","Bell Schedule","<i class='fa fa-bell' aria-hidden='true'></i>"],
            ["/attachment/handbook/CHS_Handbook.pdf","Student Handbook","<i class='fa fa-list-ul' aria-hidden='true'></i>"],
            ["http://ift.tt/2uGODlL","Video Editing","<i class='fa fa-video-camera' aria-hidden='true'></i>"],
            ["/highschool/about-mustang/","Mustang","<i class='fa fa-paw' aria-hidden='true'></i>"]         
        ];
        break;

    case "Middle School":
        $links = [
            ["cjhslrc/index_new.html","Library","<i class='fa fa-book' aria-hidden='true'></i>"],
            ["/district/athletics.html","Athletics","<i class='fa fa-futbol-o' aria-hidden='true'></i>"],
            ["http://ift.tt/2v1OeN7","Claymont On-line Learning","<i class='fa fa-globe' aria-hidden='true'></i>"],
            ["/juniorhigh/bellschedule/bell_schedule.htm","Bell Schedule","<i class='fa fa-bell' aria-hidden='true'></i>"],
            ["/attachment/handbook/CMS_Handbook.pdf","Student Handbook","<i class='fa fa-list-ul' aria-hidden='true'></i>"],
            ["/juniorhigh/attachment/dcInfo.PDF","DC Trip","<i class='fa fa-university' aria-hidden='true'></i>"],
            ["/juniorhigh/attachment/7tripPit.PDF","Pittsburgh Trip","<i class='fa fa-map' aria-hidden='true'></i>"],
            ["http://ift.tt/2v1D6jt","Guidance","<i class='fa fa-map' aria-hidden='true'></i>"],
            ["/juniorhigh/honorroll/02-16.html","Honor Roll","<i class='fa fa-bars' aria-hidden='true'></i>"],
            ["/juniorhigh/PrincipalNewsletter.html","Principal's Newsletters","<i class='fa fa-newspaper-o' aria-hidden='true'></i>"],
            ["/attachment/supply/middleSuppyList.pdf","Supply List","<i class='fa fa-newspaper-o' aria-hidden='true'></i>"]             
        ];
        break;

    case "Intermediate":
        $links = [
            ["attachment/newsMar17.pdf","March <br>Newsletter","<i class='fa fa-newspaper-o' aria-hidden='true'></i>"],
            ["attachment/events.pdf","Events","<i class='fa fa-calendar' aria-hidden='true'></i>"],
            ["LRC/index_new.html","Library","<i class='fa fa-book' aria-hidden='true'></i>"],
            ["http://ift.tt/2uGwZyb","Guidance","<i class='fa fa-map' aria-hidden='true'></i>"],
            ["dare/darekg/index.html","D.A.R.E.","<i class='fa fa-child' aria-hidden='true'></i>"],
            ["http://ift.tt/2v1OP1n","Harcourt School","<i class='fa fa-book' aria-hidden='true'></i>"],
            ["http://ift.tt/1bHYQwp","Study Island","<i class='fa fa-tree' aria-hidden='true'></i>"],
            ["video.html","Video Gallery","<i class='fa fa-video-camera' aria-hidden='true'></i>"],
            ["/attachment/handbook/CIS_Handbook.pdf","Student Handbook","<i class='fa fa-list-ul' aria-hidden='true'></i>"],
            ["photoGallery.html","Photo Gallery","<i class='fa fa-photo' aria-hidden='true'></i>"],
            ["http://ift.tt/2v0WRI0","Renaissance <br>Parent Connection","<i class='fa fa-user' aria-hidden='true'></i>"],
            ["/attachment/supply/intermediateSuppyList.pdf","Supply List","<i class='fa fa-pencil' aria-hidden='true'></i>"]            
        ];
        break;

    case "Elementary":
        $links = [
            ["attachments/newsletter/may17.pdf","May <br>Newsletter","<i class='fa fa-newspaper-o' aria-hidden='true'></i>"],
            ["LRC/index_new.html","Library","<i class='fa fa-book' aria-hidden='true'></i>"],
            ["/attachment/handbook/Elementary_Handbook.pdf","Student Handbook","<i class='fa fa-list-ul' aria-hidden='true'></i>"],
            ["http://ift.tt/2v0WRI0","Renaissance <br>Parent Connection","<i class='fa fa-user' aria-hidden='true'></i>"],
            ["/attachment/supply/elementarySuppyList.pdf","Supply List","<i class='fa fa-pencil' aria-hidden='true'></i>"]          
        ];
        break;

    case "Primary":
        $links = [
            ["attachments/apr17.pdf","April <br>Newsletter","<i class='fa fa-newspaper-o' aria-hidden='true'></i>"],
            ["gallery/gallery.html","Photo Gallery","<i class='fa fa-photo' aria-hidden='true'></i>"],
            ["lrc/index_new.html","Library","<i class='fa fa-book' aria-hidden='true'></i>"],
            ["trentoninfo.htm","General Information","<i class='fa fa-info-circle' aria-hidden='true'></i>"],
            ["/attachment/handbook/Primary_Handbook.pdf","Student Handbook","<i class='fa fa-list-ul' aria-hidden='true'></i>"],
            ["/attachment/supply/primarySuppyList.pdf","Supply List","<i class='fa fa-pencil' aria-hidden='true'></i>"],
            ["http://ift.tt/2v0WRI0","Renaissance <br>Parent Connection","<i class='fa fa-user' aria-hidden='true'></i>"]
        ];
        break;

    case "Preschool":
        $links = [
            ["pre/pre.html","Message from the Principal","<i class='fa fa-envelope' aria-hidden='true'></i>"],
            ["FAMILY_HANDBOOK_WEB.pdf","Family Handbook","<i class='fa fa-list-ul' aria-hidden='true'></i>"],
            ["SNACK_12-13.pdf","Snack Calendar","<i class='fa fa-calendar' aria-hidden='true'></i>"],
            ["/attachment/supply/preschoolSuppyList.PDF","Supply List","<i class='fa fa-pencil' aria-hidden='true'></i>"],
            ["History.html","History","<i class='fa fa-clock-o' aria-hidden='true'></i>"],
            ["attachment/2017application.pdf","Preschool Application","<i class='fa fa-file' aria-hidden='true'></i>"],
            ["/district/Wellness/KindImmun.htm","Immunization<br> Information","<i class='fa fa-medkit' aria-hidden='true'></i>"],
            ["LRC_DISTRICT.PDF","LRC Newsletter","<i class='fa fa-book' aria-hidden='true'></i>"],
            ["http://ift.tt/2uGAtB3?","Symbaloo","<i class='fa fa-arrows' aria-hidden='true'></i>"]
        ];
        break;

    default:
        $links = [];
        break;
}
}else{
    $links = [];

}   



?>


<nav id="navRight" class="dispBox">
<h3>Links</h3>
    <ul>
    <?PHP
    if(count($links)!= 0){
        foreach($links as $link){
            $url = $link[0];
            $text = $link[1];
            $icon = $link[2];   
            echo ("<li><a href='$url'>$text$icon</a></li>");        

        //<li><a href="cjhslrc/index_new.html">Library<i class="fa fa-book" aria-hidden="true"></i></a></li>

        }}
    ?>


    </ul>
</nav>
<?PHP ?>