jeudi 31 août 2017

How to check if a touch is valid or not

I encounted the isvalidtouch() function in js section of this (code)[http://ift.tt/2vwyZN6] . I couldn't understand how this function works.can anyone please explain what makes the function actually do what it is meant for.Thanks.




why is nth-of-type not being recognized by sublime text?

The nth-of-type just appears to be in white as opposed to other elements. Sublime text doesn't seem to recognize it.

enter image description here




useragent string is java version format. Is it a bot or crawler?

I looked at the access log in my web server and noticed that the requested client useragent string the Java version format(ex. Java/1.7.0_45).

Is it a bot or crawler?

Thankyou.




Simulate typing code with syntax highlight

I need to simulate somebody typing code with syntax highlight to record a video. At first I was trying the web approach.

Prism works great for syntax highlight and combined with CodeFlask you can use it as a simple code editor for websites. Automating the typing with TypedJS does not work because of some limitations of CodeFlask and TypedJS as well. I would have to re-render all the data on every letter typed or directly inject the code on some textarea like component but I have two problems:

  1. TypedJS does not seem to have a trigger for each letter typed;
  2. CodeFlask also does not seem to have a place to type and dynamically change the code, like an input field or textarea.

Solutions for macOS are welcome too. I'm just trying to save some time recording the code I typed in the past.




HTML / Webpage debate

The Following code is provided:

<!DOCTYPE html>
<html>
<head>
<title>This is the title</title>
</head>

<body>
This is content
</body>
</html>

What would you say would be outputted to the Webpage?

1) First Answer with just the content
2) Second Answer with the title of the webpage in the browser and the content on the page

My Com Sci Teacher tells us that the title is included in the output of the webpage, even though the title is in the browser and it is considered meta data.




How to restrict IP addresses with an Azure App Service / Web App

Does the ipSecurity section in web.config works with Azure App Services?

What are the steps to get a simple IP address blocking (black list) set up with a web app hosted on Azure?




How to add new quotes to a quote generator website?

I have made a random quote generator website that upon pressing a button will present a quote on command. I also added a text box and button that allows visitors to add their own favorite quotes to show on the website. However I don't know how to exactly enact this feature. The quotes are stored in a Javascript array. So what I'm technically asking is how do I allow website visitors to add in thier quotes to the array via Javascript, and maintain this feature if I were to publish my website online.

var quotes = ["Imagination is more important than knowledge. - Albert Einstein",
"The path towards a free society has not been simple. - Vladimir Putin", 
"Most folks are about as happy as they make up their minds to be. - Abraham Lincoln", 
"Where there is matter, there is geometry. - Johannes Kepler"]




mercredi 30 août 2017

Suppress updating of a child components that are connected to redux state

I am making an app using react and redux. I want to stop child components from updating in the parent component, even though they are connected to state independently. shouldComponentUpdate does not prevent this. Is there some way this is possible? Maybe like caching a pre-rendered version of the children? I don't need it to be interactive at all, not even scrolling is required. I just need it to be visually the same.

Code example:

class SomeComponent extends Component {
  constructor() {
    super()
    this.state = { dontReload: false }
  }

  render() {
    return (
      <div>
        <SomeStateConnectedComponent />
      </div>
    )
  }
}

How could I make it so the state connected component does not update if dontReload is true?




What's the best direction for starting career? [on hold]

I'm having a hard time to choose between languages which should i learn.

I know HTML+CSS+JS a bit, planning to start messing with node.js soon, and I also start playing with Python.

That's just the beginning of my adventure with programming ...

I want to start working as a Junior Developer as soon as possible, but i don't know which direction might be "easier/more possible" or just simply requires less time to get a job.

My question is should I go with HTML+CSS+JS and became a Web Developer (maybe also a Mobile App) or should I go with Python?

I want to add one thing, in the future - I would like to work remotely.




Notify page from background

BACKGROUND:

I have an ASP.MVC application. When user pay for his shopping cart (integration with external payment system) then he is redirected to "payment awaiting" page.

This page should "await" for information from server (payment system) that transaction is finished and than redirect to another page.

Worflow: Submit cart => Redirect to bank & pay => Redirect to "awaiting" page => await => redirect to final page

at the same time: Notification from Payment System (via POST on controller) => ??? (how to notify awaiting page) ???

PROBLEM:

How to achieve the "awaiting" proces? I think I could use SignalR (never used before). But if external system executes POST request from payment system than in my opinion there is no "recipient" context I could send message for.

CODE:

I tried something like this:

Hub code:

public class PaymentHub : Hub
{
    public void Send(string paymentNumber, string basketId)
    {
        Clients.All.notifyPaymentSuccess(paymentNumber, basketId);
    }
}

View Script:

@Scripts.Render("~/bundles/jQuerySignalR")
<script src="~/signalr/hubs"></script>

<script>
        $(function () {
            var paymentHub = $.connection.paymentHub;

            paymentHub.client.notifyPaymentSuccess = function (paymentNumber, basketId) {
                $('#tempContent').append('<li><strong>' + paymentNumber + '</strong>: ' + basketId + '</li>');
            };

            $.connection.hub.start();
        });
</script>

Payment system enpoint action:

public ActionResult PaymentStatus(PaymentStatusViewModel model)
{
    var paymentHub = GlobalHost.ConnectionManager.GetHubContext<PaymentHub>();
    paymentHub.Clients.All.Send(model.tr_id, model.tr_id);

    //...
}

But when I test it, nothing happens... Could You help me with it? Or maybe You have a better way to achieve this awaiting proces?




iOS xamarin web view not playing sound stream from website

screenshot of code

lines of code for the web view to display webpage on iOS app application runs but failed to produce the sound on the website play button stream




How did Epic Games achieve this 3D effect on their Fortnite site?

Link to Fortnites Website

Hi, everyone :) I have been looking at Epic Games' Fortnite website. And I am trying to figure out how they achieved the 3D effect on the page. It does not seem like it is a real 3D environment, but at the same time, the light setup is great! Take a look here:

Epic Games' Fortnite website - scrolled down to 3rd slide

Does any one have any idea how to do it? I would really like something similar to a project I'm working on. But All I find is Three.js, but I am quite sure that is not the solution they went with. Please help me become smarter :D




How to correctly render multiple apps on the main page

So I'm currently learning to use Django, and I'm wondering how to correctly split up parts of the functionality while still displaying it on the main page.

For example, I want the header + navigation, a calendar and recent blog articles on the main index page.
On the view article page I'd for example have the header + nav, the calendar and a single article with a comment section.

Now reading the tutorials, if I understand them correctly, I'd split the functionality in a header app, a calendar app and the blog app itself while glueing it together with a core app.

But what I don't understand is how to render apps/other views in the main app. All the ways I found only specify templates itself or look very hacky, so apparently that doesn't seem to be the common way to go.




How to store a constant value I might want to change

I'm trying to log in to an online server.
This server keeps changing the API version, which I have to specify as one of the header parameters.
Currently I save it as a constant value and change it manually when they change it, but I think that's not a good way of doing things so I'm trying to make it happen programmatically.

This is the function that attempts to connect and catches the change of API version:

API_VERSION = 78   

def connect_to_server(self, session, url, headers, data):
    r = session.post(url, headers=headers, json=data)
    if r.status_code != 200:
        if r.status_code == 449:
            api_num_new = [int(s) for s in r.content.split() if s.isdigit()]
            print "Failed because of api version - Change API_VERSION to: {}".format(api_num_new[0])
            headers.update({"LKQD-Api-Version": api_num_new[0]})
            self.update_api_version(api_num_new[0])
            return self.connect_to_server(session, url, headers, data)

        raise IOError("Connecting failed! Status code: {}. Message: {}").format(str(r.status_code),str(r.content))
    response = r.json()
    if response[API_STATUS_KEY] != API_SUCCESS_VALUE:
        raise IOError(
            "Connecting to the server failed! Error: " + str(response[API_ERROR_KEY]))
    return session

def update_api_version(api_num_new):
    raise Exception("Not implemented")

My question is what would be the best method for dealing with this problem?
I've considered using a YAML file but was wondering if a more suitable solution exists.




Web server virtual filenames

I am not sure whether this is possible. I need to upload 1 file to web server. Then download this file as multiple parts/chunks with fixed size. In other words, after request for download of http://ift.tt/2x4Ue8n, the web server has to run some script and give it the URL or only 123 as parameter. The same is possible with: http://ift.tt/2vEMlD0 - then index.php or index.aspx will return chunk #123. Can the same be done with dir/file123.bin syntax?




Google Web Designer Red Zone

Can someone please explain to me, what is the red zone that shows \around the picture. I get inside a grouenter image description herep and I'm trying to align something.




Default HTML document in directory

I've got a simple website and I've got a directory with GM scripts there (but that's not important).
The only thing I can do there is to access it using FTP and make directories and create files and folders.
Now I've got this structure:

/
here are normal website files
gmscripts/
    index.html (?)
    script.js
    script2.js

and I'd like to achieve that if I go to http://ift.tt/2xMoQIR it shows me the index.html file (or any other specific file). How can I do this?

Thank you for answer!

P.S.: I can also use php, but I'd like to avoid this!




IOS webwiev not playing sound on website

Hi guys please assist on possible solutions

Ios webview not playing sound on website




How to add attachments from within a hybrid app using mailto: scheme

I am trying send pictures and audio from my cordova app as attachments in the mail using mailto: uri. For this, I use URI similar to:

mailto:some.one@somewhere.co.il?subject=my%20report&body=see%20attachment&attachment=file:///var/mobile/Containers/Data/Application/041193A7-DA1B-4B10-94B5-321FF380C85C/tmp/cdv_photo_003.jpg

The image uri is the path of the image I took using Cordova camera plugin in the same app that was saved in documents directory.

But i do not see any attachments in the mail client. Is it because of sandboxing and restrictions. Is it even possible to send attachments from app directories?




Web Api which enables Access-Control-Allow-Origin to *

I could not find many open web api which allows CORS.

For example, http://ift.tt/2whpOz3 does but most web api prohibits resource sharing over cross domains. Some Web api support jsonp and rarely allows CORS. I don't want to set up proxy server just to avoid CORS limitation.

Can anyone suggest list of available web api where CORS from any domains is allowed?

I think such api should be useful to learn new web app technologies and help web developers try them on it.




Https access authentication workd but not normal

I tried to use a simply link to login in the basic access auth: http://ift.tt/2vrENYx. In Forefox it's working really good. But in other browsers like Chrome it loggs in but first the browser displays only the website structure. When I load the one more (STRG + F5) all is displayed as wanted...

Does anybody know why and how to solve this problem?

Sorry for my bad english...

Thank you very much!




Facebook can't parse image from my post is SMF

I was going to start my forum using Simple Machines Forum SMF, but the problem is No one can share post or article to Facebook by URL, because Facebook is not parsing the image of the content, this is the forum post that I want share,and this is what Facebook is doing when I try to share it by URL. Please HELP!.




Legality of moving Google logo in map

So I'm currently developing a web-application that relies heavily on the Google maps API, and as part of the design, I need to have a button in a fixed position in the bottom-left corner of the screen. My issue is that the Google logo is directly where I need my overlay.

My solution to this was to relocate the Google logo to the top-right corner of the map view, as pictured below:


  • Notice that the google logo has been moved to the top-right.

image


So my question is, what is the legality of this modification? The app is intended for a public usage, and I don't want to hide the Google logo behind my stuff. (The project would be impossible without them)

Reading from the Google API terms-of-service , it looks like as long as the logo itself is not modified, and is still clearly visible, it is NOT against the TOS.

Am I right in this assumption?




mardi 29 août 2017

How to pass url parameters using nghttp library?

In nghttp library using nghttp 2_submit_request we can submit the http headers like scheme, path etc.

However if we need to send a query in url E.g https:/test server.com/author? user=ABC&token=xyz

Is there a way to do this?




how to save the download file locally from a asp.net form using goutte

I am trying to create a PHP script using goutte to

  • Login
  • Click on submit button.
  • Save the csv file locally which gets downloaded(if done manually).

This app(http://ift.tt/2iHI6Vq) is built on asp.net

I am able to log in successfully and hit the submit button too on the form through the code but it currently returns only this result:

Symfony\Component\DomCrawler\Crawler Object
(
    [uri:protected] => http://ift.tt/2gpUd8H
    [defaultNamespacePrefix:Symfony\Component\DomCrawler\Crawler:private] => default
    [namespaces:Symfony\Component\DomCrawler\Crawler:private] => Array
        (
        )

    [baseHref:Symfony\Component\DomCrawler\Crawler:private] => http://ift.tt/2gpUd8H
    [document:Symfony\Component\DomCrawler\Crawler:private] => 
    [nodes:Symfony\Component\DomCrawler\Crawler:private] => Array
        (
        )

    [isHtml:Symfony\Component\DomCrawler\Crawler:private] => 1
)

This is the php code:

require 'vendor/autoload.php';
use Goutte\Client;

$client = new Client();
echo '<pre>';
$crawler = $client->request('GET', 'http://ift.tt/2iHI7Zu');
$form = $crawler->selectButton('ctl00$MainContent$btnLogin')->form();

$crawler = $client->submit($form, array('ctl00$MainContent$txtUsername' => 'XXXX', 'ctl00$MainContent$txtPassword' => 'XXXXX'));
  
$id = $crawler->filter("#ctl00_mnuMainn26 a")->link();
$exportPage = $client->click($id);
$downloadBut = $exportPage->selectButton('ctl00$MainContent$btnDownload')->form();
$file = $client->submit($downloadBut);
print_r($file);

My question is how I can save a file locally after clicking the submit button using goutte.




Client side printing without using applets in java web applications?

Im printing password in my java web application using Java applets.

But as browsers are started not supporting java, so my application is not able to do printing on latest versions of browsers.

The target printer can be local to client machine or shared printer to client machine. The information which is going to print is confidential so I don’t want to print through JavaScript/hidden variables.

Can anyone help?




jQuery onclick event for tag to change 'active' class

I've seen a few posts about this but none have worked for me. Also, I think my problem has to do with the way I'm adding an html 'template' with jQuery. I think this might have to do with the scope but I'm not sure. I'm still a rookie in Web Design.

I'm using the '.active' class from bootstrap and I want to switch that class between the navigation buttons. First I tried to do it following the instructions on these videos and finally from a few different SO posts.

jQuery Tutorial: Add Active Class to Navigation Menu Item Based on URL

Nav Menu Active Click Item with jQuery

This is the code I currently have.

index.html

<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">

      <link rel="stylesheet" href="http://ift.tt/2wUF5nG">
      <link rel="stylesheet" href="../stylesheets/header.css">
      <script src="http://ift.tt/2nYZfvi"></script>
      <script src="http://ift.tt/2fzsgLv"></script>
      <script src="http://ift.tt/2hT5Mpw"></script>
      <script type="text/javascript" src="/javascript/header.js"></script>

      <title>MNRentals | Dashboard</title>
   </head>

   <body>
      <div id="header"></div>
   </body>
</html>

reservations.html

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">

        <link rel="stylesheet" href="http://ift.tt/2wUF5nG">
        <link rel="stylesheet" href="../stylesheets/header.css">
        <script src="http://ift.tt/2nYZfvi"></script>
        <script src="http://ift.tt/2fzsgLv"></script>
        <script src="http://ift.tt/2hT5Mpw"></script>
        <script type="text/javascript" src="/javascript/header.js"></script>
        <title> MNRentals | Reservations</title>
    </head>

    <body>
        <div id="header"></div>
    </body>
</html>

header.html

<!-- HEADER -->
<header class="main-header">
    <div class="row">
        <div class="col-md-6">
            <div class="logo">
                <span class="logo-lg"><b>MN</b>Rentals</span>
            </div>
        </div>
        <div class="col-md-6">
            <div class="float-right">
                <ul class="nav nav-pills card-header-pills">
                    <li class="nav-item">
                        <a class="nav-link active" href="index.html">Dashboard</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="reservations.html">Reservations</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Pagos</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Propiedades</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<header>

header.js

(function ($) {
    $(document);
}(jQuery));

$(function () {
    $('#header').load('/pages/header.html');
});

$(document).ready(function() {
    $('.nav li').click(function () {
        $('.nav li.active').removeClass('active');
        $(this).addClass('active');
    });
});




Script on scroll down javascript issue

I have a script in javascript that load more information on page scroll down. The problem is that when I scroll down the script is executed twice and I have the same result twice or even more.


I want to execute the script once each time I scroll down and not execute it twice or even more each time.

This is the script:

$(window).scroll(function(){
                        
        var lastID = $('.load-more').attr('lastid');
        if ($(window).scrollTop() == $(document).height() - $(window).height() && lastID != 0){
            $.ajax({
                type:'POST',
                url:'getdata.php',
                data:'id='+lastID,
                beforeSend:function(html){
                    $('.load-more').show();
                },
                success:function(html){
                    $('.load-more').remove();
                    $('#list').append(html);
                }
            });
        }
    });
                



How to store API Key's/Secrets on the web

I've been building a number of web applications and SPA's over the last few weeks that use API secrets and keys that I don't want available to the public:

  • Fire base Authentication Key/Secret
  • Paid Algolia search account API Key/Secret

Up to this point I've always used a .env file to store these and a npm module to read through the variables.

That said, I've heard a few times now that this isnt the best way to do this and it's actually quite unsafe to store variables this way. Is there a better way to do this that I'm not aware of?

Thanks in advance.

Server is running Debian 9.xx and apache2




I am a beginner ? i want some projects in asp.net

I am a beginner in studying asp.net ,, I want to study asp.net projects I have already tried some courses but I cant able to make a project what should I do ?




Ajax Toolkit Calendar Extender Error

I have an asp.net website deployed to a staging server and a production server. On my staging server the calendar extender works fine. However, it comes up a blank calendar and I get a java script error on my production server. Both have the same exact code deployed (minus connection strings in web config), the same versions of .NET, and the same versions of the AjaxControlToolkit dll.

Production Server: enter image description here

Error:

ScriptResource.axd?d=NISXSzp87hD3qcCkP6NEPuF9CcnK5I-ufPjsh34laJN_X0aVHxlrSCRTcuVNdBlHJPhDZIUvEREh5VBuThlsgo_BghBpg0ddHeQysAHm-fvIzsJbjZge0NiahMLqHuR00&t=ffffffff949e5296:1 Uncaught TypeError: Cannot read property 'getFullYear' of null at Sys.Extended.UI.CalendarBehavior._parseTextValue (ScriptResource.axd?d=NISXSzp87hD3qcCkP6NEPuF9CcnK5I-ufPjsh34laJN_X0aVHxlrSCRTcuVNdBlHJPhDZIUvEREh5VBuThlsgo_BghBpg0ddHeQysAHm-fvIzsJbjZge0NiahMLqHuR00&t=ffffffff949e5296:1) at Sys.Extended.UI.CalendarBehavior.get_selectedDate (ScriptResource.axd?d=NISXSzp87hD3qcCkP6NEPuF9CcnK5I-ufPjsh34laJN_X0aVHxlrSCRTcuVNdBlHJPhDZIUvEREh5VBuThlsgo_BghBpg0ddHeQysAHm-fvIzsJbjZge0NiahMLqHuR00&t=ffffffff949e5296:1) at Sys.Extended.UI.CalendarBehavior._getEffectiveVisibleDate (ScriptResource.axd?d=NISXSzp87hD3qcCkP6NEPuF9CcnK5I-ufPjsh34laJN_X0aVHxlrSCRTcuVNdBlHJPhDZIUvEREh5VBuThlsgo_BghBpg0ddHeQysAHm-fvIzsJbjZge0NiahMLqHuR00&t=ffffffff949e5296:1) at Sys.Extended.UI.CalendarBehavior._switchView (ScriptResource.axd?d=NISXSzp87hD3qcCkP6NEPuF9CcnK5I-ufPjsh34laJN_X0aVHxlrSCRTcuVNdBlHJPhDZIUvEREh5VBuThlsgo_BghBpg0ddHeQysAHm-fvIzsJbjZge0NiahMLqHuR00&t=ffffffff949e5296:1) at Sys.Extended.UI.CalendarBehavior.show (ScriptResource.axd?d=NISXSzp87hD3qcCkP6NEPuF9CcnK5I-ufPjsh34laJN_X0aVHxlrSCRTcuVNdBlHJPhDZIUvEREh5VBuThlsgo_BghBpg0ddHeQysAHm-fvIzsJbjZge0NiahMLqHuR00&t=ffffffff949e5296:1) at Sys.Extended.UI.CalendarBehavior._element_onfocus (ScriptResource.axd?d=NISXSzp87hD3qcCkP6NEPuF9CcnK5I-ufPjsh34laJN_X0aVHxlrSCRTcuVNdBlHJPhDZIUvEREh5VBuThlsgo_BghBpg0ddHeQysAHm-fvIzsJbjZge0NiahMLqHuR00&t=ffffffff949e5296:1) at HTMLInputElement. (MicrosoftAjax.js:6) at HTMLInputElement.b (MicrosoftAjax.js:6)

Staging: enter image description here

Any ideas what may cause this? My guess would be some type of version mismatch somewhere, but I can't seem to find one. Let me know if additional information is required.




Origin 'http://localhost:3000' is therefore not allowed access Twitter API

I'm developing a web application that uses the Twitter API REST. I have a page with Twitter accounts and a button for adding a new account. When the button is pressed, the function in the Angular controller is executed:

// Calls token to add a new Twitter user
    $scope.callToken = function () {
        $http.get('/token')
            .then(function (response) {
                console.log(response);
            });
    };

This is the code in the backend to serve de request. It simply redirects to Twitter to add a new user.

// routes.js
var token = express.Router();

        token.route('/token')
                .get(cuentasCtrl.getToken);
    
// Account file

exports.getToken = function(req, res) {

        twitter.getRequestToken(function(err, requestToken, requestSecret) {
        if (err)
            res.status(500).send(err);
        else {
            _requestSecret = requestSecret;
            res.setHeader('Access-Control-Allow-Origin', '*');
            res.redirect("https://api.twitter.com/oauth/authenticate?oauth_token=" + requestToken);
        }
    });
};

But I get the next error:

Origin 'http://localhost:3000' is therefore not allowed access Twitter API

My server is running on localhost:3000 and If I put localhost:3000/token in my browser there is no problem. I have read the solutions for using CORS and tested other browsers but it hasn't worked for me. What have i done wrong?




Getting into web development

I would like to get into web development. But I´m not sure where to start. I had Node.js and Python in mind. I already know Python. Due to this rising popularity of Javascript and it´s use in Front-End Development, I though Javascript would be a good Option. If there are better options well free to suggest. If not what would be the better option.




Redirecting in PHP and JS without refreshing the page

I am trying to make a web fileserver (a cloud). I decided to put a basic form password auth on index.php. When user enters the password and clicks the button, JS sends that password to index.php and it decides if it correct.

If it is, then index.php redirects the user to files.php. If not, then refreshes the page. I know that redirecting and refreshing is done through header();, but when I use this and watch the "Network" tab in my browser, it receives the files.php but doesn't load it (stays on index.php). I am sure the reason is header sent after some text (well, it is header).

How do I redirect user's browser to some page after current page been sent? Should I ask JS to do it? Then how?




One page scrolling working on desktop browser but not on mobile browser

I am new to web development and recently I am developing an one page scrolling site which is working fine in desktop browse but not on mobile browser ,it is almost like that i can't even scroll. Link of the code i am using to achieve one page scrolling has been provided.

I took the code from the ans of this guy have a look and please let me know




I cannot move REPORT.IPM.Note.NDR using Exchange Web Services API

I am using Exchange Web Services API to move messages from an Inbox to a public folder. The operation works when the Inbox item is an IPM.Note but the undeliverable messages, REPORT.IPM.Note.NDR, fail with "The move or copy operation failed."

Do I need to do something special to get the REPORT.IPM.Note.NDR items to move?

The logic is simple, Bind and then Move: tMessage = EmailMessage.Bind(service, myMessage.Id, PropertySet.FirstClassProperties) tMessage.Move({public folder}.Id)




Cookie not found when opened with a link

so somehow I ran into an issue no one else has.

I have two PHP documents, one that sets a cookie when a link is clicked and one that is opened by the link and is supposed to display the cookie.

The odd problem is that the page opened by the link will display this error about the cookie - "Notice: Undefined index: imgPath in /home/sitespage.php on line 19"

(imgPath is the cookie name) However, there is no issue when the page is opened from the browser and not through the link and the cookie is displayed normaly and I have no clue why this is happening.

Here is the code for the page hosting the link -

<a href="http://link.php" target="_blank" onclick="document.write('<?php setcookie("imgPath","56",time() + 60 * 60 * 24); ob_end_flush(); ?>');">
    <?php
      echo $post1;
    ?>
</a>

($post1 is an image)

and this is the code for the link page

echo $_COOKIE["imgPath"];

thank you for any and all help




How would one connect an SQL db securely to an external client?

I'm attempting to connect a database, located on a web server, to a robot but I do not know how to connect the database to the robot. I would like the robot to run SELECT and UPDATE queries from the robot. The other issue is that I do not intend on using C-languages or Java; I plan on using python in the main control system.

I do know: PHP VBScript Batch Python

If anyone knows how to connect the DB to a bot it would be a great help.




Embed a Firebase Console within an iFrame on a webpage

I'm wanting to view the Firebase Console within a webpage on my web portal, I've tried other web links within the iFrame which work but when I try putting the Firebase Console link it doesn't seem to load, can anyone do this or let me know why its not working?

<!DOCTYPE html>
<html>
<body>

<h1>Firebase Console</h1>
<iframe src="http://ift.tt/1OK0qH9"></iframe>

</body>
</html>




abbreviating if statement in PHP

I'm creating dropdowns in php for my website and I'm trying to add a check box that matches it's value based on the selection of the three dropdowns. So far, I got everything working perfectly; however,in order to make the check box working right I have to add every possible combination of each dropdown to the code using if statements. I generated a list of all possible combinations and the list is like 2400 combination which will take me a long time to add each one of them as an if statement to the code. So my question is that is it possible to find a shortcut coding all these combinations instead of writing 2400 if statement to cover all combinations?




How to transfer files between two computers through a server which is running on the Internet

The problem is I have two computers , sometimes I need to transfer some files between those two computers. I also have a server I bought on the internet, the server only runs a web application in tomcat and no other use.

In order to make things much easier, I wonder if there is a way I can just upload my file by dragging it into chrome on one computer and download it by dragging out on another computer.

Can I just build a ftp service on the server so that the things can work as I described above. Or any other ideas I can achieve this ?




Calculator height width

I have a table with measurement - width and height (attached image). The red row is the width and the yellow column is the height. For width 400 and height 700 the price is 1025. The max width is 600, and the max height is 900. I did it with selects, but I have a problem to create calculation of the prices with inputs and if the user can write values between this numbers - for example if a customer writes 750 * 450mm the price should be 1325 becuase have to round off to the higher price after 700x400.

http://ift.tt/2wFWZxj 
http://ift.tt/2wl7IKO




Implementing Java Web Service with xfc

I'm a newbie developing Web Services. I've created java classes from XSD using xjc command (command line "xjc ....\MySchema.xsd").

<?xml version="1.0" encoding="UTF-8"?>
<!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. -->
<s:schema elementFormDefault="qualified" targetNamespace="http://SAS.Servicios/" xmlns:s="http://ift.tt/tphNwY">
    <s:element name="S014">
        <s:complexType>
            <s:sequence>
                <s:element name="MensEntrada">
                    <s:complexType mixed="true">
                        <s:choice maxOccurs="unbounded" minOccurs="0">
                            <s:any processContents="lax"/>
                        </s:choice>
                    </s:complexType>
                </s:element>
            </s:sequence>
        </s:complexType>
    </s:element>
    <s:element name="S014Response">
        <s:complexType>
            <s:sequence>
                <s:element name="MensSalida">
                    <s:complexType mixed="true">
                        <s:choice maxOccurs="unbounded" minOccurs="0">
                            <s:any processContents="lax"/>
                        </s:choice>
                    </s:complexType>
                </s:element>
            </s:sequence>
        </s:complexType>
    </s:element>
</s:schema>

xsd app generates some classes,

S014.java

...
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "mensEntrada"
})
@XmlRootElement(name = "S014")
public class S014 {

    @XmlElement(name = "MensEntrada", required = true)
    protected S014 .MensEntrada mensEntrada;

    public S014 .MensEntrada getMensEntrada() {
        return mensEntrada;
    }

    public void setMensEntrada(S014 .MensEntrada value) {
        this.mensEntrada = value;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "content"
    })
    public static class MensEntrada {
        @XmlMixed
        @XmlAnyElement(lax = true)
        protected List<Object> content;
        public List<Object> getContent() {
            if (content == null) {
                content = new ArrayList<Object>();
            }
            return this.content;
        }
    }
}

S014Response.java

...
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "mensSalida"
})
@XmlRootElement(name = "S014Response")
public class S014Response {

    @XmlElement(name = "MensSalida", required = true)
    protected S014Response.MensSalida mensSalida;

    public S014Response.MensSalida getMensSalida() {
        return mensSalida;
    }

    public void setMensSalida(S014Response.MensSalida value) {
        this.mensSalida = value;
    }


    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "content"
    })
    public static class MensSalida {
        @XmlMixed
        @XmlAnyElement(lax = true)
        protected List<Object> content;
        public List<Object> getContent() {
            if (content == null) {
                content = new ArrayList<Object>();
            }
            return this.content;
        }
    }
}

ObjectFactory.java

...
@XmlRegistry
public class ObjectFactory {

    public ObjectFactory() {
    }

    public S014Response createS014Response() {
        return new S014Response();
    }

    public S014 createS014() {
        return new S014();
    }

    public S014Response.MensSalida createS014ResponseMensSalida() {
        return new S014Response.MensSalida();
    }

    public S014 .MensEntrada createS014MensEntrada() {
        return new S014 .MensEntrada();
    }
}

I need to create a Web Service to read an incoming message "MensEntrada" and returns "MensSalida".

I was trying this:

...
@WebService (serviceName = "S014Service", portName="S014ServiceSoap", targetNamespace = "http://SAS.Servicios/")
public class S014Service extends AcceptMessage {

    public S014Service(WebServiceReceiver webServiceReceiver) {
        super(webServiceReceiver);
    }

    @WebMethod(action = "S014")
    public S014Response S014(@WebParam(name = "MensEntrada") S014 param) {
        String response = param.getMensEntrada().toString();
        response = response + "!!!";
        S014Response ms = new S014Response();
        return ms;
    }    
 }

But it doesn't work. How can I read MensEntrada? How can I write MensSalida?

Thanks in advance!!




Web design - different color pallet for different sections of portal

We have a middle sized portal with many sections inside.
Each section provides various type of feature / service for registered users.

Do you recommend to use more color pallets to differentiate each section, where user is currently browsing?
I mean for better orientation, especially if user skips from one to another.

Thanx for opinions.




Is there any way in the console of seeing where data is going when you click submit on a form on a website?

Is there any way in the console of seeing where data is going when you click submit on a form on a website?




how to make website, use distributed file system- hadoop for data management

I am naive in big data technology, and have curiosity to relate it with the conventional application development.

The conventional way to develop any web application is to have a hosting server (or application server) and a database to manage the data. But lets say, I have a huge data set which is generated by the website, (i.e. GBs per second), then the website will fall into the category of managing big data.

lets suppose, I have a cluster of 20 computers, with 200GB of hard drives and core i3 processor. So now I will have enough processing and storage power for the website. (of-course hadoop is scalable too, if I need more resources). how to setup application server, to host the website in this cluster ? will I need load balancers for my application server since there is higher velocity, of http request to the application server? can anyone please guide ! thanks in advance.




Backend for Angular 2 suggestions?

I would like to know the best/ideal backend/server side programs while using Angular 2 as the front end. Nodes Js, Ruby are the ones I read which are good enough. But can we use Java as well? Is that a good practice? Also please do suggest the in demand technologies for the same.




Web Api not filtering for XSS request for invalida URI

I am doing GET request from Postman as http://localhost:52858/Api/users/Get?alert('hi');

now it is getting below response

Response :

{ "Message": "No HTTP resource was found that matches the request URI 'http://localhost:52858/Api/users/Get?alert('hi');'.", "MessageDetail": "No action was found on the controller 'OrderHistoryDetails' that matches the name 'Gsdfdsfsdfdst'." }

Note: alter('Hi') is encoded in script tags a codeproject is removing that for getting rid of vulnerability. so i am sending script tag and in response also i am getting script tag back

Now many tools are showing this as XSS vulnerability... I tried several solutions but no luck. Please help




Android & iOS application stats in Express.js (Node.js) app

I'm building a web panel/dashboard for my mobile application that is available on Apple & Play Store. I have to show various statistics about the application, most importantly "number of installs" & "uninstalls". I've tried already available npm packages like play store scraper, appflyer etc., but none addresses the concern as it should. Is there another way to achieve this with my node.js application?




GRUNT: How do I update an electron page?

We use the electron and grunt.

What's the easiest way to update a page when changing files?

Here is our config.




lundi 28 août 2017

WebView is not able to open one Specific https URL. Showing blank white screen

I have tested with many https URLs, almost all are working fine but not the one I want. 1. Already handling SSL Error 2. Override shouldOverrideUrlLoading too. I want to know whether it's the problem in the URL or from Android. URL is ok and working fine with all the browsers except Internet Explorer.




Staticly hoasted single-page web-app using Meteor or Angular 2?

I don't have a VPS. I don't have S3. I have basic static hosting package through my site provider.

How can I build a static single-page web-app using Meteor or Angular 2?

I've read a great deal about SSR, SEO, and a lot of other acronyms that haven't answered my question. I'm looking for a client only responsive web framework for typescript / javascript based applications.

I used to use Angular 1 and could do an npm build and crunch it into a single html/js file. I haven't seen anything like that since I picked up the modern fads....




Move block higher when the error is occured with HTML/CSS

So, this picture shows what I want, and below I will describe it more detailed

Link to the picture (I am not allowd to paste them here)

So, I will explain what is going on. You have three main elements

1) the highest text "Bla bla bla bla"

2) the button "Click me"

3) and the lowest text

When you click button, the error will be occured, and it will be appeared, as you can see. I want to move two first elements higher, and I don't want the lowest text be touched. So, it should stay on the same position as written.

My question is - How can I do it with HTML/CSS code (I don't ask about the JS code for text appearance). I need HTML/CSS will be in response of moving two first elements higher.




Managing Arbitrary Uploads

I am working on a web project which manages collections of arbitrary things. Collections are made up of arbitrary, user-defined fields and each field is of a given type. The type of the field affects how the data is stored and interpreted. For instance, a field of type "text" would be stored in a database as TEXT or VARCHAR and would be rendered to the user as a text input or text area.

I want to add support for more complicated field types that represent files. For instance, I want an "image" type which stores/displays an image file. The system I have developed uses "plugins" to handle each field type which are in charge of how data is represented in the database and how this data is displayed to the user (e.g. a field of type "color" is stored in a database VARCHAR column as hex and displayed to the user in a DOM element with the background color set to that hex value). I want the design to work (as closely as possible) as follows:

  • The user should be able to upload a new file to a given field in a collection item and have that upload confirmed (success/failure).
  • The upload is not "applied" until the user saves the changes to the item, once applied those uploads will now be associated to the fields of the item
  • If the user uploads new files and doesn't save changes, these newly uploaded files are deleted from the server
  • Once a new upload has been saved, the previous file (the one that this upload replaced) should be deleted from the server
  • File uploads need to be of any type and the plugin for each type handles what types are allowed for it and how the file is displayed
  • Some reference to the physical file needs to be stored in the database

I have spent a ton of time thinking through many different ways of implementing something like this but have not been able to settle on anything that seems robust, extensible, reliable, and manageable. I would greatly appreciate suggestions based upon best design practices and experience. Please let me know if I need to clarify anything.

Thanks, Patrick




Possibility of programming in Content Management System (CMS)

If we use a CMS(Content Management System) for web development of a website or web pages can we integrate additional necessary programming(like form processing/user validation/database programming) with these web pages?. I'm asking this because CMS give static web pages. Are there any option given for these programming inside the web pages?




Highlight xml code in textarea on my html website using JavaScript

I'm building a website which has a textarea where it displays a chunk of XML code and allows user to edit it. It will be like below:

<textarea>
  <person>
    <name>AAA</name>
    <position>Manager</position>
    <age>40</age>
  </person>
  <person>
    <name>BBB</name>
    <position>CEO</position>
    <age>50</age>
  </person>
</textarea>

So basically the user will see a text box with the below XML code that he can edit:

  <person>
    <name>AAA</name>
    <position>Manager</position>
    <age>40</age>
  </person>
  <person>
    <name>BBB</name>
    <position>CEO</position>
    <age>50</age>
  </person>

Of course by default they will show as plain, black text. My goal is to

1) Highlight the xml tags (same as what StackOverflow shows) so that it's easier for the user to read the xml content

2) When the user edits the xml content, the content is dynamically highlighted again

Is there any JavaScript that's ready out there and will help me do this?

Thanks a lot!




GET request with JSON data

Need to do GET request with JSON parameters (web application needs it for some reason)

HttpClient

Does not have method for creating such requests. It only has GetAsync

How can i do it with C#?




oEmbed discovery not working

I have a personal website for image hosting amoung other things and I'm trying to implement oEmbed for discord (discord.gg) but it's not displaying in discord and this oEmbed discovery tester that I've seen a few people recommend http://ift.tt/2wcRN2M says that the url doesn't support recovery.

Here's the link to a page and the html.

http://ift.tt/2gjJU6a

<html>

<head>
  <link rel="alternate" type="application/json+oembed" href="http://ift.tt/2wcOYyN">
  <link rel="alternate" type="text/xml+oembed" href="http://ift.tt/2giVdf0">

  <style>
    body {
      background-color: #232323;
      margin: 5px;
    }
    
    img {
      background-color: #272727;
      vertical-align: middle;
      text-align: center;
      position: absolute;
      display: block;
      margin: auto;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
    }
    
    @keyframes loading-spinner {
      0%,
      10% {
        left: 0;
        width: 0;
      }
      50% {
        left: 25%;
        width: 50%;
      }
      90%,
      100% {
        left: 100%;
        width: 0;
      }
    }
    
    #loading-bar-outer {
      top: 0;
      z-index: 1;
      width: 100%;
      height: 10px;
      position: fixed;
      overflow-x: hidden;
    }
    
    #loading-bar {
      top: 0;
      opacity: 1;
      height: 4px;
      position: absolute;
      background-color: #2098f4;
      animation-play-state: running;
      transition: opacity 1s ease-in-out;
      animation: 2s ease-in-out 0s infinite alternate loading-spinner;
    }
    
    #loading-bar.done {
      opacity: 0;
    }
    
    #loading-bar.completely-done {
      animation-play-state: paused;
      display: none;
    }
  </style>
</head>

<body>
  <div id="loading-bar-outer">
    <div id="loading-bar" class="done completely-done"></div>
  </div>
  <img id="image" src="http://ift.tt/2wcskGG">

  <script>
    window.onload = function() {
      window.scrollTo(0, 0);
      var lb = document.getElementById('loading-bar');
      lb.classList.add('done');
      setTimeout(function() {
        lb.classList.add('completely-done');
      }, 1500);
    }
  </script>
</body>

</html>

According to the oEmbed website, the <link> tags in the head are properly formatted to support discovery

Json response from http://ift.tt/2wcOYyN

{
    "version": "1.0",
    "type": "rich",
    "width": 512,
    "height": 512,
    "html": "<style>body{font-family:Roboto,Calibri,Arial,sans-serif;max-width: 1024px;}</style><img src='.raw' style='width: 100%; height: auto;'></img><div style='background-color: #212121; padding: 3px; border: 2px 2px 7px 7px;font-weight:600;display:none;'><span style='color: #2098f4'>tacticalpha</span><span style='color: #CCCCCC'>.</span><span style='color: #EEEEEE'>xyz</span></div>"
}




convert value int decimal

Hi I really need your help.

currently i used this code to do auto calculate.

But then I got 8.749999999999998 as an answer.(prefer to be 8.75) I tried to use fixed to two and still got the same answer.

<span name="epr_fctot"  id="epr_fctot" class="medium" size="15">
<script  type="text/javascript">
function fcFunction() {

var fc_airticket =parseFloat(document.getElementById("fc_airticket").value)
var fc_accomodation =parseFloat(document.getElementById("fc_accomodation").value)
var fc_allowance = parseFloat(document.getElementById("fc_allowance").value)
var fc_transport = parseFloat(document.getElementById("fc_transport").value)
var fc_entertainment =parseFloat(document.getElementById("fc_entertainment").value)
var fc_other = parseFloat(document.getElementById("fc_other").value)

var x = parseFloat(fc_airticket) + parseFloat(fc_accomodation)+parseFloat(fc_allowance)+ parseFloat(fc_transport)+parseFloat(fc_entertainment)+ parseFloat(fc_other);

document.getElementById("epr_fctot").innerHTML = x


}
</script>

</span></label></td>




Decode hex code to js

Please decode this code, until get a real script

enter link description here

i spent my time for this one

thanks,




Looking for solution for cross platform development windows application and web application

I got project that will run on windows and web. I wonder if there is a solution to create that as a cross platform application . If you have any experience or any solution please let me know.




Query Result in Html Form

How do I get my results to display in a html form? Some fields I don't want my end users to be able to edit. Others I do. Is there a way to specify what can be edited and not.

 $queryOrders = "select ponum, [name], addr1, addr2, city, [state], zip, 
 country, shipvia
 from twhapps.dbo.dsi_$shortname   
 where id = $id";

 $resultItemData = sqlsrv_query($con, $queryOrders);

 $result=sqlsrv_fetch_array($resultItemData);
 var_dump($result);

 <form>
 Ponum:<br>
 <input type="text" Ponum = "ponum"> <br>
 Name: <br>
 <input type="text" Name  = "name"




How to use backend permissions in frontend

I have a web application using Rails as backend and AngularJS as frontend and it has a rather complicated permission system that must hide/show buttons in the frontend accordingly.

For example, imagine something like ebay, if I created a product, I can edit, delete, etc.. but somebody can share a product with me and I can also edit, but not delete. So the permission is calculated by resource, and not using roles.

I thought adding a "permissions" attribute to each json object, something like:

[{
    id: 1,
    name: "product 1",
    permissions: {
        canEdit: true,
        canDelete: false
    }
},
{
    id: 2,
    name: "product 2",
    permissions: {
        canEdit: true,
        canDelete: true
    }
}]

Is there any best practice to send each resource permissions to the frontend?




It is possible send cors request with client IP address on web

I need to make CORS request with client IP.

It is possible?

Not with: proxy IP or server IP.

Thank you for any help.

My web is react application.




Execute a function when pressing a button in jQuery

I am quite new to programming, and have met a problem.

I really want to run this function, when I press a button. Here is the function that I want to run:

function generateTip() {
var tip = tipsList[generateNumber()];
var tipElement = document.querySelector('.js-tip');

tipElement.innerHTML = tip;

}

Alright, I want to run this function, when pressing a button, and here is the code for my jQuery button:

$(document).ready(function(){
$('button').click(function() {
  //run function here 

}); });

It doesn't have to be jQuery, I just thought that would be easier. I would be very grateful if somebody would help and explain.

Thanks in advance.




How can I combine split screens?

I used the frame tag to divide the screen into menu and main when programming the web. However, I want to show main only when I press a button in the menu and rejoin. How do I do this?

 1 <html>
  2 <head>
  3 <title>Example</title>
  4 </head>
  5 <frameset cols="20,90">
  6 <frame name="menu" src="menu.php">
  7 <frame name="main" src="about:blank">
  8 <noframes>
  9
 10 </noframes>
 11 </frameset>
 12 </html>



Dexie: How do I add a tab to the beginning?

We make an open source browser.

Please correct the add-on of the tabs. It is necessary that the tab is added to the beginning. Now the tab is added to the end:

var newTab = tabs.add({}, tabs.getIndex(tabs.getSelected()) + 1)

link to the GitHub repository

Tried these options:

tabs.add({}, 0)
tabs.add({})
tabs.put({})

How do I add a tab to the beginning?




Limit GET/POST not working in .htaccess

i have some files as shown below

  |.htaccess
  |-index.php
  |-subfolder
       |--.htaccess

one .htaccess file is in root folder,another .htaccess file is in one subfolder

The root's .htaccess have this below code

<If "%{HTTP_HOST} == 'abc.web.com'">
php_value auto_prepend_file "/var/www/vhosts/http://ift.tt/2xGt453"
</If>
<Else>
php_value auto_prepend_file "/var/www/vhosts/http://ift.tt/2wM9uYw"    
</Else>

and subfolder's .htaccess file having the below code

AuthUserFile /var/www/vhosts/http://ift.tt/2xFQhUS
AuthGroupFile /dev/null 
AuthName "Password Protected Area"
AuthType Basic
<Limit GET>
 require valid-user
</Limit>

Now the problem is <Limit GET> block is working only after commenting out the If else block in the root's .htaccess file.

if the if else code block is present in the root's .htaccess file then the Limit get code block in the subfolder's .htaccess file is not working.

Any idea why its behaving like this !




Property 'prototype' is missing in type 'MyObject'

I want to write a web-application on Webstorm with Angular2. I am very new on do this. I am trying the tutorial on the angular website Angular.IO.

When I try to make a list of Person clickable, it is not working.

export class PersonComponent {
 persons = MYPERSONS;
 selectedPersons = Person;

 onSelect(person: Person): void {
  this.selectedPerson = person;   // here is the error on "this.selectedPerson"
 }
}

const MYPERSONS: Person[] = [
 {id:0, firstName: 'First', lastName: 'Firstly', creationData: 1},
 {id:1, firstName: 'Second', lastName: 'Test', creationData:10},
 {id:2, firstName: 'Third', lastName: 'Candidate', creationData:5}
];

export class Person {
 id: number;
 firstName: string;
 lastName: string;
 creationData: any;
}

I get the following error:

Type 'Person' is not assignable to type 'typeof Person'. Property 'prototype' is missing in type 'Person'.

What does it mean? I can't find this error on the internet. It is probably anything what I'm not seeing on the code because of my few experience




RESTful API Multiple Query Strings over multiple Resources for Filtering

Let´s assume there is an entity companies and an entity nations. A company can belong to many nations and a nation can have multiple companies. So there is a intermediate table memberships with different roles for the companies e.g. a company is a manufacturer in a nation and another company is for example a supplier in a nation. A nation can have multiple status like is_active etc.

Now we want to fetch all nations from a specific company where the role is manufacturer and the state of the nation is is_active = false.

How could a RESTful API endpoint look for this use case? Is it allowed to filter over multiple resources? Some ideas:

GET /companies/{id}/nations?role=manufacturer&is_active=false

GET /memberships/{id}/nations?role=manufacturer&is_active=false




Can't get all data-type

function displayType() {
  const li = document.querySelector('li');
  const liType = li.getAttribute('data-type');
  alert(liType);
}
<ul>
  <li onclick="displayType()" data-type="Anime">Naruto</li>
  <li onclick="displayType()" data-type="Movie">Inception</li>
  <li onclick="displayType()" data-type="TV-Series">Game of Thrones</li>
</ul>

When i click, only alert 'Anime' . How can i see all of them?




how to append the list using jquery

Basically, i try to append a list using jquery. Each element in this list is connected to a different link. This is what i done

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

        var a = $('<a />');
        a.attr('href','http://ift.tt/2xq6IoM' + data[i].key);
        a.text(data[i].name);


        $("#list-of-project ul").append("<li>").append(a).append("</li>");


    }

"data" here is an JSON array i get from REST having key and name attribute. However, using this , i got output like this unwanted result. The element not at the same line with the list points. I want the text to be at the same line with the list points. Any help??




dimanche 27 août 2017

How to make globalize or internationalize web application with Asp.Net MVC?

I need to develop web module for multiple countries , so i want to know, what is best practice for develop internationalize website, i refer so many articles from different different resources, but i want to need some suggestions if possible, like can i use database driven resources rather than .resx file or how to make currencies,date format change in Internationalize website?

Please help me regarding this and Thanks in advance.




what is the difference between free resources like Mozila developemtn network or w3 school vs paid one like treehouse

what is difference between free resources of learning web developemnt like Mozila development network or w3 school vs paid one like treehouse. can i learn whole of web development from these free resources and is there will be any knowledge gap if i learn from them .




Reduce the Loading time of a website

I have been creating a dynamic content management system using php, mysql, jsp technologies. But I see it loading very very slowly. The website is live at http://ift.tt/2xF22uE The login details are UserName : b14it001 Password : student

Can someone just help me out in this issue of increasing the loading speed of website and also point out the defects of website. Thanks in advance




Acumatica Web Service Endpoints - URL filter by datetime range

I just wondering if you can assist us with following issue regarding retrieving data via Web Service endpoints filtered by date time range. I created a General Inquiry that retrieves all open orders (SO) and expose it via Web Service Endpoint(6.00.001).

The issue I am facing now is that when I try to filter by datetime field (DueDate) between a date time range it does not work. I can only make it work if I filter by DueDate greater than or DueDate lower than using datetimeoffset but not between the datetime range.

Do you have any example of URL I can use to filter a Web Service Endpoint by datetime range?.

Thanks,




How to save local data in Chrome Extension

I have the following code:

chrome.storage.sync.get(function(data) {});
var addBtn = document.getElementById('addBtn');

addBtn.addEventListener('click', () => {
  document.getElementById('downloadPart').style.display = "block";
  var addCnt = 0;
  var showPart = document.getElementById('urlCover');
  var mainForm =
    '<label><input type="checkbox" class="checkBoxes" id="check' + addCnt + '"><input type="url" class="urlTitles" id="sepUrl' + addCnt + '" value="" maxlength = "40"></label>';
  var addDiv = document.createElement('div');
  addDiv.setAttribute("id", "keyForm" + addCnt);
  addDiv.innerHTML = mainForm;
  showPart.appendChild(addDiv);
  chrome.tabs.getSelected(null, function(tabs) {
    var userVal = document.getElementsByClassName('urlTitles');
    var pageUrl = tabs.url;
    var saveVal, urlCnt;
    for (urlCnt = 0; urlCnt < userVal.length; urlCnt++) {
      userVal[urlCnt].value = pageUrl;
      saveVal = userVal[urlCnt].value;
      console.log(saveVal);
      chrome.storage.sync.set({
        'saveVal': saveVal
      });
    }
  });
  addCnt++;
});

There's a default form in the HTML file.

If I click the addBtn, downloadPart's display changes from none to block, and it makes the input forms into labels which contain the recent page's URL.

It works well if I click Btn. However, if I turn it off, all the data disappears, and only the default HTML form remains (the label form and downloadBtn disappear).

I know I can use Chrome's storage, but it's really hard to understand, and it gives me errors. I don't know how to change my code to get it working correctly.

I really need your help. Please help me!




Move Navigation bar to right in bootstrap

I've been trying to move the navigation bar in bootstrap4 to the right side of the screen by using float: right; on the nav a and it just is not doing anything. I'm using a codepen app to write my code for a project I'm doing.

<div class="container-fluid">
<class="row">
<header>
<nav class="navbar navbar-fixed-top">
<a href="#" class="glyphicon glyphicon-user">About</a>
<a href="#" class="glyphicon glyphicon-th-large">Portfolio</a>
<a href="#" class="glyphicon glyphicon-envelope">Contact</a>
</div>
</nav>
</header>
</div>
</div>
</body>
</html>

    @import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css');

nav a {
  color: black;
  padding: 10px;
  font-size: 32px;
  background-color: gray;
}




Best technology for light weight web support for many wifi clients?

My application: Use (battery/solor powered) RasPi or similar hardware to provide lightweight web pages to many clients (phones or tablets). The concept is to allow users to leave or search for text messages (not actual SMS service, just short strings entered via a web form). However I'd like to support as many simultaneous clients as possible, up to 100 or 200 if possible.

I am wondering what sort of language/framework/database would support this model well. For example, one or two dynamic web pages provided by a single host application.

The web programming model I am most familiar with is a general purpose web server like Apache, running PHP connected to a relational database like MySQL; this does not seem like a good approach for this purpose - a hundred connections which happen to load the same script into 100 parallel tasks, an interpreted language, and a general purpose web server and database seem like too much overhead for limited RAM and CPU.

By contrast, I could imagine a single program handling 100 http connections using threads being much more resource efficient. A single copy of the code would be in RAM (and cache) all the time. A compiled language like C/C++ might be useful, but an efficient interpreted language which would let one code file service 100 connections would probably be OK. This would require a fast/lightweight web server or framework, and a small/efficient database (perhaps a key value store?).

Or perhaps the "program logic" could be in browser-resident javascript, accessing web services on a server, meeting the above criteria.

I don't even know what keywords to search for, for this style of web programming. I'm looking for suggestions and leads to follow up.




Send notification when new results uploaded on a website

I am looking to send a notification when a change occurs to results on a website. I am scraping a website and getting the data so I need to send the notification with the content of the change when the data changes. For example I have the data in excel and when a new line is added I send a notification telling what that data is

Any help greatly appreciated!




keeping values after redirecting in google app engine python

I have just started learning web development using GAE and I have the following question. Isn't there any way to post data to the webpage after redirecting. I want input values to be kept after redirecting.




Hortizontal table scroll with angular

I'm new with Angular and I'm developing a Twitter web application. I have in a table a set of user accounts. For each account in the first column I have the account name and a short description of it. But in the rest of the columns I need to put the account tweets, but It has to see all the tweets and the best way is making a horizontal scroll.

So, how i can do this with Angular? At the moment I have thought that a good begining is put the tweets in a new table within the second column.

<table class="table table-bordered table-hover table-striped">
                    <tr>
                        <td>
                            <b> Account 1 </b><br/>
                            Description.
                        </td>
                        <td>
                            <table class="table table-hover table-striped">
                                <td>
                                    Tweet 1
                                </td>
                                <td>
                                    Tweet 2
                                </td>
                                <td>
                                    Tweet 3
                                </td>
                                <td>
                                    Tweet 4
                                </td>
                                <td>
                                    Tweet 5
                                </td>
                            </table>
                        </td>
                    </tr>
                </table>



Any brief source to understand web related concepts?

I am a ruby on rails developer. I am good with the programming and web development on local machine. But when it comes to deployment and web servers etc, there is the problem. I am not very familiar with the concepts like ports, domain, ssl certificates, IPs .

Can you suggest any brief source from where I can grasp these concepts related to web development? Should be brief but cover all the major concepts.




Search / login bars on expressions web 4

I am stuck on a problem and am looking for help/guidance. I am taking a intro class and we were given this assignment with no text/videos and are left to figure it out on or own using any resource. in which I need to build a home page for a dummy website. I have the logo, hyperlinks and setup done. Only the homepage needs to be complete and none of the hyperlinks need to work as they are just required to be there.

I need help on putting a search bar and login/password bars onto the homepage and have no idea on how to do so. I thought google search and youtube will help but neither did.




Which is the most secure programming language for web development? [on hold]

Which is the most secure programming language for web development ? I am a java programmer. I want to start web development. Before I start, I want to know about one most secure programming language.




Angular application for Desktop/ios/android

I have to develop a responsive website in angular and server side of the REST API. I also have to deploy it on the Android and iOS stores. My question: is it possible to package my angular application with Cordova / phonegap easily?




GoLang Scraper. How to scrape dynamically generated links on a website?

I am trying to scrape product video links (which are generated dynamically by another web service. The location is under the product images on the left side). You can check following link, http://ift.tt/2gfPxCi The google chrome "inspect element" shows the div tag. But The same tag is not present in the page source. How to do it? I am looking into goQuery to implement the task but not sure will it work or not. I am not a web developer so please consider giving suggestions if my question description is not specific. Thank you.




angular2: 2 page with different routers in the same template

I have a simple template and i already created a router for the INDEX page with components that created for it . nd it works well.

But i am looking to create an other router with other component for the HOME page and i didn't found a simple solution for it .

It could be possible if i use again !! or what i can do !!

I have a simple template and i already created a router for the INDEX page with components that created for it . And it works well.

But i am looking to create an other router with other component for the HOME page and i didn't found a simple solution for it .

It could be possible if i use again !! or what i can do !!




How to use an OpenCV C++ project in the web?

I'm developing an interactive OpenCV application which involves the following: 1. User stylus input, 2. Image processing in the background to detect shapes, 3. Interactive image overlay 4. Displaying updated images using imshow I want to port this to web. I see the following options:

(i) use nodejs with cpp call but this would only work on a local server unless I choose to create an addon (this seems much harder)

(ii) Use a C++ web framework and write from scratch. Wt, silicon are some options. Wt is heavy seems to be the general opinion.

(iii) ... something I haven't listed above and hopefully much easier?




"Required xml:lang attribute value is missing" error

I'm new to this and stumbled upon a wall while creating an app which calls a web service. I've added the wsdl as service reference with no issues. The method I'm trying to call requires authentication through user key and login but the only thing I need to pass in a form is login (without auth it gives me failed login error). I used ClientCredentials to pass the username but then I received this:

   [CommunicationException: Server returned an invalid SOAP Fault.  Please see InnerException for more details.]

And inner exception:

   [XmlException: Required xml:lang attribute value is missing.]

I checked the log and response gave me a weird message (most of the code was provided by example in the documentation):

   Call to undefined method X::Action()

I honestly don't know how to approach this. It's doubtful that documentation is wrong so it should be on my end but can't figure out where. Plus, this app is supposed to be a widget able to be deployed on every site so it should be as simple as possible. Can you point me in the right direction on how to deal with this error? My web.config file:

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

<configuration>
  <system.diagnostics>  
  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
  <system.serviceModel>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true"
        logMessagesAtTransportLevel="true" />
    </diagnostics>
    <bindings>
      <wsHttpBinding>
        <binding name="ApiClientsBinding">
          <security mode="Transport">
            <transport clientCredentialType="Basic" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://ift.tt/2wSveRF"
        binding="wsHttpBinding" bindingConfiguration="ApiClientsBinding"
        contract="ServiceClient.ApiClientsPortType" name="ApiClientsPort" />
    </client>
  </system.serviceModel>
</configuration>

Thank you.




Online tool or platform that shows perfomance of some basic web page deployed on different Web Stack

I'm bit confused with this and taking the first effort to ask it on stack overflow.

So, My Issue is: I'm looking for some kind of tool or platform that tests performance of a same web-page that is deployed on different web stacks which is making some normal database calls and shows few html elements like images and some text content on that page, even hello world page will work as well.

Over here with web stack i mean:

  • LAMP Stack
  • MEAN Stack
  • Windows Stack Running IIS and .NET
  • Etc, there can be thousands of such combinations.

In the end result i want data such as

  • how much time does it take to respond?
  • What were the server specs used to deploy normal web based page?
  • How much resources on the server it has consumed?
  • And other such related reports.

There are thousands of web stacks out there on internet and i know it's not the game of one size fits everyone's requirements so i think this question might be too broad on stack overflow but if someone has created some automated tool that figures out the results of basic hello world app connected with database that can be cross tested with other custom built web stacks, it would be a great help for my web application that I'm building to help developers to take better decisions doing development process.

Also, if you think there is no such tool present on internet, please point me to correct direction where i can easily find such data. As i don't want to deploy each and every stack out there and then test it to fulfill my requirement.




python codes can be executed in python mutual environment but not in win7 cmd

python codes as following:

from flask import Flask
from flask import request

app = Flask(__name__)

@app.route('/', methods=['GET', 'POST'])
def home():
    return '<h1>Home</h1>'

@app.route('/signin', methods=['GET'])
def signin_form():
    return '''<form action="/signin" method="post">
              <p><input name="username"></p>
              <p><input name="password" type="password"></p>
              <p><button type="submit">Sign In</button></p>
              </form>'''

@app.route('/signin', methods=['POST'])
def signin():
    if request.form['username']=='admin' and request.form['password']=='password':
        return '<h3>Hello, admin!</h3>'
    return '<h3>Bad username or password.</h3>'

if __name__ == '__main__':
    app.run()

It can be successfully executed in python mutual environment, but failed to be executed in win7 cmd as a file app.py. example1: copy codes and paste into python interactive environment as following:

* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

example2: copy codes and make them saved as a file named "hsiehapp.py"

C:\Users\Administrator\Desktop\python file>python hsiehapp.py
Traceback (most recent call last):
  File "hsiehapp.py", line 1, in <module>
    from flask import Flask
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\sit
e-packages\flask\__init__.py", line 19, in <module>
    from jinja2 import Markup, escape
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\sit
e-packages\jinja2\__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\sit
e-packages\jinja2\environment.py", line 16, in <module>
    from jinja2.defaults import BLOCK_START_STRING, \
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\sit
e-packages\jinja2\defaults.py", line 32, in <module>
    from jinja2.tests import TESTS as DEFAULT_TESTS
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\sit
e-packages\jinja2\tests.py", line 15, in <module>
    import decimal
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\dec
imal.py", line 3, in <module>
    from _decimal import *
AttributeError: module 'numbers' has no attribute 'Number'

My python version is python 3.6.1. My operation system is windows7. I am so confused about this, and please help me. thank you...




samedi 26 août 2017

Is it possible to display embedded mp4 subtitles in an HMTL5 tag?

So far I've found that this isn't possible. For the purpose of simplifying my media library, I'm developing a locally-run site that takes media files (encoded as h.264 mp4 files) and displays them in a <video> tag.

However, some of this media is in languages other than English, and contain embedded subtitles within the file. As there are hundreds of files, I'd like to not have to go through and extract each of the subtitle tracks file by file.

Is there a way (a JS library, or a feature in HTML5) that allows embedded subtitles to be displayed in a <track> tag?




how to get the content from the screen by c#

description: I want to get the content from the address(51hupai),for example:I want to get the time of 目前最低可成交价(the lowest price):90600 as the picture showsenter image description here I want develop a software can identify all the content in the picture by c

with winform technology. How could I do. I am looking forward to your reply,thank you.

Besides,the address's content is showed by a flash not doc or picture.May be I should identify this by identify my screen.




How can I create a chat screen in my website, getting input from python script and displaying it in the chatscreen(html)?

Help me out with the easiest way to integrate python script returning Json objects and printing them out in a text format in HTML..




CMS and ASP.net for web development

I'm new to web development. My understanding is CMS and asp.net are used for web development. To create web sites and to do 'asp.net programming with some of those web pages, do I need to use CMS or asp.net?. If we use the CMS cant we use the power of asp.net?. When to use asp.net and when to use CMS while creating web sites?




Automated django scaffolding available

I am getting tired of writing boilerplate code for new models i am adding to my system. Is there any way I can just create a model, and then have some automated system create all CRUD for me automatically? views, templates etc. I know there exists cookiecutter which seems like a nice tool, but I think this is ony for project startup and not for scaffolding new models when project already exists, or am I wrong? I am interested in most elegant way to do this. Thanks




Is there any way to "pagin" html tables hiding the last elements with Angular?

I'm implementing a web application that uses Twitter.

I have one table with a single column that contains the tweets of the user. I want to limit the number of tweets of the table and hide the rest of it, and If the user wants, show more tweets. The concept similar to the official Twitter application.

I think that pagination is a wrong concept.

How Can I do this with HTML and Angular js?




Playing a sound as a value changes

I am developing a lobby for multiplayer online experiment. The lobby basically is a stage where the participants wait until we have the required number of people. I want to play a bell sound that I have in the project public directory public/newPlayerSound.mp3 .. and I have the following helper:

Template.lobby_page.helpers({
    numWaiting(){
        if (Meteor.userId()){
            let lobby = Lobbies.findOne({players:Meteor.userId()});
            if (lobby){
                //play the newPlayerSound.mp3
                return lobby.players.length
            }
        }
    },
});

I want to play the newPlayerSound.mp3 every-time the numWaiting() changes. What would be an easy way to do this?




Is there a way to implement what MacType does on a website itself?

MacType is a program for Windows that replaces Microsoft's ClearText font rendering method with Apple's Quartz. Is there a way to get a similar effect on websites? Not all Windows computers have MacType installed so I want to know if there's a way to implement the same thing but baked into the website itself?




Web portal for education non profit organisation

I'm trying to develop a web portal for intranet for a non profit education organisation. Not sure what platform will be most suitable. Shall i use wordpress or since i'm a .net developer shall i stick to it. And since it is a non profit organisation unable to spend much for buying professional edition. Need inputs.




My Caddyfile doesn't work

I deploying an web server on an embedded device. I did a web application stored in /var/www/app/assets where I have my html pages. I need to serve it to devices connected (by wifi). I installed caddy on the embedded device but I have issues with the "Caddyfile". when I try to access to the IP address of the embedded device, I get "404 not found". Here is my Caddyfile:

http://192.168.1.10 {
    root /var/www/app/assets
}

Thank you




internal server error 500 only on files transferred over ftp not on locally created files, running ubuntu server 16.04

I am running into an error with uploaded php files, they always return an http 500 error but when I write an identical file in nano on my linux machine the file works perfectly

so far I have tried changing editiors on my windows machine, uninstalling and reinstalling filezilla, I have tried vsftpd and proftpd(current is vsftpd)




Media query at max-width not activating CSS styles

This is a general rundown of the problem I'm dealing with. I have my main CSS stylesheet and two others that have media queries.

<link rel="stylesheet" href="Styles/mainStyles.css"> <link rel="stylesheet" href="Styles/smStyles.css" media="only screen and (min-width: 768px) and (max-width: 991px)"> <link rel="stylesheet" href="Styles/mdStyles.css" media="only screen and (min-width: 992px) and (max-width: 1269px)">

When the browser is at a width of 990px the smStyles stylesheet is being called. At 992px the mdStyles takes over.

But if the width is at 991px, the smStyles is no longer in effect and my webpage reverts to the mainStyles sheet (making the entire page look like a mess).

I've been going at this for hours and I can't figure out why it is happening. Please let me know if there is something I am missing here. I'm viewing the widths using the Chrome inspector.

(Also, yes, I do have <meta name="viewport" content="width=device-width, initial-scale=1">)




.htaccess www - redirect (R301) with dynamic domainname

I want to redirect 3rd or 4th level domain to add "www.":

DirectoryIndex index.php

RewriteEngine on
RewriteRule ^$ /home/ [R=301,L]


RewriteRule ^(?!www[\.]) http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=/$1 [QSA] 

My problem is that it could be a different number of levels... www . froschkoenig84 . bplaced . net www . froschkoenig84 . de

So when it's not starting with "www." then add, else not...

RewriteRule ^(?!www[\.]) http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

But it doesn't work, ... it's adding each time... so it's ending like... add "www." each time

How can I check if it starts with "www." or not? If possible, then without a separate condition. :)

I created similar rewrite rules for .NET (web.config), too:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>
  <rewrite>
   <rules>
    <rule name="RedirectToHome" stopProcessing="true">
     <match url="^$" />
     <conditions trackAllCaptures="true">
      <add input="{CACHE_URL}" pattern="^(https?)://" />
     </conditions>
     <action type="Redirect" redirectType="Permanent" url="{ToLower:{C:1}://{HTTP_HOST}/home/}" />
    </rule>
    <rule name="RedirectToWWW" stopProcessing="true">
     <match url="(.*)" ignoreCase="false"  />
     <conditions>
      <add input="{CACHE_URL}" pattern="^(https?://)(?!www[\.])" />
     </conditions>
     <action type="Redirect" url="{ToLower:{C:1}www[\.]{R:1}}" redirectType="Permanent" />
    </rule>
    <rule name="RewriteToParams" stopProcessing="true">
     <match url="^(.*)$" ignoreCase="false" />
     <conditions>
      <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
      <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
     </conditions>
     <action type="Rewrite" url="{ToLower:index.php?p=/{R:1}}" appendQueryString="true" />
    </rule>
   </rules>
  </rewrite>
 </system.webServer>
</configuration>

:/




java script erorr with komodo edit

my komodo editor can not accept my : document . write function and the error is the document . write can be a function of eval . I didn't write any eval function , I hope you can help me I'll be very thankful




Symfony | Differences between local server and web server

I've got some problems with Symfony 2.8 project. There are differences between my project on my computer (local server) and web server.

Here is my code: TWIG:

     <div id="ContactForm" >
        
        
        
      </div>

CSS:

#ContactForm{
 display: flex;
 align-items: center;
 justify-content: center;
}

When I check effect in Chrome on my local server, eveyrthing is ok. Console shows good CSS:

#ContactForm {
display: flex;
align-items: center;
justify-content: center;
}

Unfortunately, when I transfer all my files to ftp web server, there are some differences. I don't know why by there is also an inline style and I don't know where is it come from and why there are differences between local and web server.

element.style {
width: 100%;
height: 200px;
position: absolute;
top: 200vh;
} 


#ContactForm {
  display: flex;
  align-items: center;
  justify-content: center;
 }

Any ideas? :)




Is it possible to use Spark Java for live streaming?

I want to stream the captured audio of a microphone connected with my raspberry pi over the web browser to a client. Therefore I was thinking of using Spark as Java web server. I have already noticed that it would be possible to stream an already captured audio file over Spark.

My problem is that I don't know how to stream the audio of the microphone directly to the connected client. I would have to split the audio so that there is a buffer. But how can I realize this?

I would be happy for help.




which is best way to send sms to mobile from programming langauges?

i have trying it with some of the third part services but i cant able to reach some people as they are in DND .what can i do with it? how to reach all the contacts.




How to add image download functionality in images which are displayed in an angular 4 app?

I have created an image gallery app in Angular 4.

This is my code for displaying an image from Firebase, now I basically want a button, and on clicking it, I want this image to be downloaded.

<div class=col-md-12>

    <div [ngStyle]="{'background-image':'url('+ imageUrl +')'}" 
  class="img-container">

    </div>

 </div>




vendredi 25 août 2017

how to use python to create a dynamic website without framework like django or flask?

how to use python to create a dynamic website without framework like django or flask ?

I mean here: You can work in PHP without any framework such as Codeigniter or laravel and you can work with ......... But I want to program the site from scratch without a framework and in Python language ? Do you have any suggestions for books or youtube videos




How to dispatch a message in elm (without an event)

I am trying to learn Elm, and have been trying to work out the best way to architect a scaleable application. Regarding routing, I want to have some simple logic rendering the various views depending on the current route, emphasis on simple logic. However, inside some of my views, I want to change the route depending on the model. For example, in my Players view, I only want to render it if I have received some data from the server. If the request is pending or failed, I would like to display an error page. I realize I could perform this logic inside the Players view, but I would prefer to dispatch a message to the model to change the route to a different view. I only know how to dispatch messages from events (onClick, etc...). Is this possible or am I working outside the designs of the language?

This is my current setup, but I would like to change

Nothing ->
    notFoundView

To dispatch a message that changes the route

Core View

view : Model -> Html Msg
view model =
    div []
        [ page model
        ]

page : Model -> Html Msg
page model =
    case model.route of
        PlayersRoute ->
            listView model.playersModel.players

        PlayerRoute id ->
            editView model id

        NotFoundRoute ->
            notFoundView

Players View

editView : Model -> PlayerId -> Html Msg
editView model id =
    case model.playersModel.players of
        NotAsked ->
            text ""

        Loading ->
            text "Loading ..."

        Failure err ->
            text (toString err)

        Success players ->
            let
                maybePlayer =
                    players
                        |> List.filter(\player -> player.id == id)
                        |> List.head
            in
                case maybePlayer of
                    Just player ->
                        core player

                    Nothing ->
                        notFoundView

Thank you in advance for any help!




Web development on Mobile

I want to use Samsun Dex, or any other desktop app for that matter, on my android while connecting to peripherals. I think it would be the ultimate solution for developers to be able to inspect element via chrome developer tools all within the Android platform in order to design without having to carry around a laptop or surface book.

I have been dying to find a solution but there is hardly any support for this idea. Why is that? The idea of taking only phone into work, docking it, pulling up a Shopify website and start debugging / coding would be a dream. I know I can't be the only one who desires this setup.

Other apps only view souce but why doesn't chrome,i.e. or any other platoforms support this mobily?

Thank you for the help!




What is portlet in web application ? difference between portlet and servlet

what is portlet in web application, and also difference between portlet and servlet little bit confusing. Anyone answer please.




Is there a dns-prefetching equivalent for SSL handshakes?

We load data from a few subdomains/3rd parties. This causes about 100ms of SSL handshaking for each domain. I'm wondering if there is a way to "pre-fetch-handshake" similar to how dns-prefetching works. Does dns-prefetching already do this?




Does dns-prefetching ever have negative performance implications?

Our site fetches resources from various first and third parties, like this:

<link rel="dns-prefetch" href="http://ift.tt/1fotH9P">

Some of these URLs aren't used immediately on page load. Is it worth while to not DNS prefetch ever for some reason? Is the recommendation to just prefetch everything you'd possibly use?




My website looks stretched

The problem is that today,I accidentally did something so that when I look at my website I created it looks streched and small. I am using localhost to host my website and the website is written in phpp, html,css, js. The interesting thing is that when I go to web inspector(on chrome), and input the true height and width of my screen there to simulate my screen size, the website functions perfectly. I am using Windows btw. Any help would be appreciated.




How to check existing of object? (hasChild, isExist?)

I have a code:

var ref = firebase.database().ref('names');
    
    let objs = [];
    ref.once('value').then((snap) => {

      objs.push(snap.val());

      console.log('before ', objs);
      if(snap.val() == null){

        objs = [{'111': 4444}];
        ref.set(objs[0]);
      }else if(snap.val()[0] == undefined){

        objs.push({'222': 5466});
        ref.set(objs);

      }else{

        objs[0].push({'333': 66776});
        ref.set(objs[0]);
      }
      
      console.log('after ', objs);

//at the beginning 'names' dosen't exist at all

      //before  [ null ]
      //after  [ { '111': 4444 } ]

      //before  [ { '111': 4444 } ]
      //after  [ { '111': 4444 }, { '222': 5466 } ]
      
      //before  [ [ { '111': 4444 }, { '222': 5466 } ] ]
      //after  [ [ { '111': 4444 }, { '222': 5466 }, { '333': 66776 } ] ]
      
    });

At the beginning 'names' dosen't exist, How to check properly this case? It's possable to add objects better than I prinetd. Help please, if you can, refactor please Thanks




Detect client platform with Firebase

In my project I want to let admins access data from a web page and common users access from mobile app.

I read Firebase lets create a custom token to add fields to the standard token, but the web app (which should declare the privilege of the user) achieves this through node.js, which i don't know.

Does anyone know a simple way to distinguish between users by the platform they use? Can you suggest me any different approach?

Creating a custom token only on the Android/iOS device doesn't seem to me a good approach, since permits anyone to have admin privileges simply by skipping my apps.




Any ideas how to go about making a family tree/reference?

Thanks so much for helping with my firs question. I’ve been learning a lot and I need to get better at the more technical and function stuff than the design and creative and I have an idea for a project but no clue how to go about it!

I want to make a family tree kind of thing. Like, to be exact, I’d like to be able to search or click on a name then see their kids and spouse etc, and then be able to click on a kid and carry on. Any ideas?

Like, I need to learn and test myself so I’d like just the steps and concepts as opposed to the actual code. Just tell me what to make in a way. from script to buttons and inputs and drop downs. I just wanna get it working then do the design last for once.

if anyone would be willing to this I’d be very grateful.

Al.