jeudi 30 juin 2016

How can I develope on remote server with netbeans

I am developing a java web application with netbeans. The application has to run on a "strong" server and cant run on my computer for testing.

Today I develope and load the *.war file with the Tomcat Web Application Manager. This takes a long long time - 10 minutes. I assume that the time is needed to load all files (also libs) to the server each time.

Is there a way to develope with netbeans remote on the server or uplod only the edited files?

Thank you!




Edit and Save in Lotus Notes web form

We have a web form built on Lotus Notes. In this form we want a button Save which on click will save the form and not close the form. So that the users must be able to edit and save without closing the form. How can this be done?




ActiveMQ Web Console for Topics

For any ActiveMQ expert out there, Does anyone know why the messages enqueued is always increasing and the messages dequeued is always zero within the Topics.jsp web page of ActiveMQ web console?

Do they actually occupy some percentage of the available storage? If they do, how can we keep the numbers down or even clean them up regularly?

We regularly getting problem with full store usage after running for a while and was wondering if this is one of the causes.

If someone can shed some light on this, that would be great.

Thanks.

activemq topics web console




redirect to other page when I download via download link

For example, I can only download thr srt file on mouse click in this page: http://ift.tt/299vHph

When I type the download link http://ift.tt/29kccag in browser or try to get it via python, I finally get a new page.




something wrong with flask-login and flask-openid when i follow miguel's tutorial

this is the views.py

from flask import flash, redirect, render_template, session, url_for, request, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from app import app, db, lm, oid
from .forms import LoginForm
from .models import User

@lm.user_loader
def load_user(id):
    return User.query.get(int(id))

@app.before_request
def before_request():
    g.user = current_user


@app.route('/')
@app.route('/index')
@login_required
def index():
#user = {'nickname': 'Miguel'} #fake user
    user = g.user
    posts = [ # fake array of posts
    {
        'author': { 'nickname': 'John' },
        'body': 'Beautiful day in portland!'        

    },
    {
        'author': { 'nickname': 'Susan'},
        'body': 'The Avengers movie was so cool!'
    }
    ]
    return render_template("index.html",
                        title = 'Home',
                        user = user,
                        posts = posts)


@app.route('/login', methods = ['GET', 'POST'])
@oid.loginhandler
def login():
    if g.user is not None and g.user.is_authenticated:
        return redirect(url_for('index'))
    form = LoginForm()
    if form.validate_on_submit():
        session['remember_me'] = form.remember_me.data
        return oid.try_login(form.openid.data, ask_for=['nickname', 'email'])
        #flash('Login requested for OpenID="' + form.openid.data + '", remember_me=' + str(form.remember_me.data))
        #return redirect('/index')
    return render_template('login.html',
                        title = 'Sign In',
                        form = form,
                        providers = app.config['OPENID_PROVIDERS'])

@app.route('/logout')
def logout():
    logout_user()
    return redirect(url_for('index'))


@app.route('/user/<nickname>')
@login_required
def user(nickname):
    user = User.query.filter_by(nickname = nickname).first()
    if user == None:
        flash('User' + nickname + ' not found.')
        return redirect(url_for('index'))
    posts = [
        {'author': user, 'body': 'Test post #1'},
        {'author': user, 'body': 'Test post #2'}
        ]
    return render_template('user.html',
                        user = user,
                        posts = posts)


@oid.after_login
def after_login(resp):
    if resp.email is None or resp.email == "":
        flash('Invalid login. Please try again.')
        return redirect(url_for('login'))
    user = User.query.filter_by(email=resp.email).first()
    if user is None:
        nickname = resp.nickname
        if nickname is None or nickname == "":
            nickname = resp.email.split('@')[0]
        user = User(nickname=nickname, email=resp.email)
        db.session.add(user)
        db.session.commit()
    remember_me = False
    if 'remember_me' in session:
        remember_me = session['remember_me']
        session.pop('remember_me', None)
    login_user(user, remember = remember_me)
    return redirect(request.args.get('next') or url_for('index'))

===========================================

and this the link to tutorial : http://ift.tt/1hqqzq3

I used yahoo openid forr the test. but i was redirected to login page all the time,even i had signed in. output from the terminal




How to test if a web browser is on a URL c#

So I'm trying to use if (webBrowser1.Url == google.com) But that doesn't work. So how can I successfully do this?




Can not access images after convert their address from host to ip address

Here is the situation. On the iOS, I used NSURLProtocol to intercept every single request from the webview. I was trying to intercept requests from a H5 page, so I can get requests of elements in the page, like images, js or css. Then I need to manipulate those links, the purpose is to avoid DNS spoofing.

To do so, I convert image request url format to IP address format. Take Google as example, The logo has address: http://ift.tt/29cApQN. After conversion, I got address start with Google's IP address, http://ift.tt/294oyk3 In the Google's case, it is fine. I can load the image to the browser, however, It doesn't work in some other cases.

Here is another example, http://ift.tt/1VBLwW8. The converted URL is http://ift.tt/294oXTD. Then this I got Direct IP access not allowed. I really think there are so many situations, like whether ports are open or not. Is a way to solve this?




How to simulate a page opened in Wechat?

I am working on a webpage and it works fine on Safari on iPhone. However, when the page is opened in WeChat (opened by clicking a link in chat), it has some problems.

Because the problems only exist in WeChat, I was wondering is there a way to simulate the WeChat so that I can debug it?

Otherwise I can only make some changes in code, then deploy, then view it in WeChat, which is very inefficient.

Thank you!




Trying to align all the content within my navigation bar

I've been stuck with the problem of trying to align all the content (logos, links and facebook icon) on my navigation bar to all be vertically centered. I've done some research and a good topic from StackOverflow came up, which can be found here: How to vertically center text with CSS?

I've tried the suggested ideas all to no avail. I'm really at a loss with this one and would appreciate any help in making my navigation look good across multiple browsers (mobile devices also).

Another issue I've come up with is being able to add content in the main body of the webpage. As you can see in the codepen below, some of the content written in the body is hidden by the header. I can add line breaks to fix this but I'm 90% sure the way I've laid out my content (header, main, footer all enclosed in body tags) is incorrect.

http://ift.tt/295VuZZ

Here is what I've done to try and fix the problem: headerLeft refers to the logo to the left of the links, and headerRight is vice versa. The header tag had a class of verticalAlignHelper but it seemed to do nothing so verticalAlignHelper isn't really being used now.

.headerLeft {
    margin-left: 30px;
    margin-right: 40px;
    float: left;
    height: 100%;
    margin-bottom: 0.25em;
    vertical-align: middle;
}


.headerRight {
    margin-left: 30px;
    margin-right: 40px;
    float: right;
    height: 100%;
    margin-bottom: 0.25em;
    vertical-align: middle;
}


verticalAlignHelper {
    vertical-align: middle;
    line-height: 150px;
    height: 150px;
}

Any advice is much appreciated. This is my first website so I'd appreciate if the advice was as basic as can be. Cheers.




Can't get the "First Name" and "Last Name" textfields adjacent

  1. Below, I've a web form which has all the text-fields stacked vertical upon each other, and I want the FirstName and LastName text-field inputs adjacent to each other.

  2. Also, I can't get to animate the same hovering effects on these two fields, as that in the last two input text-fields.

HTML:

<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="http://ift.tt/1iJFeCG">
    <link rel="stylesheet" type="text/css" href="http://ift.tt/1v04N4O Two">
    <link rel="stylesheet" type="text/css" href="http://ift.tt/1r5wBQo">
    <link rel="stylesheet" type="text/css" href="http://ift.tt/1xg2FV4">
    <title>FLUX - A Cloud Based Service</title>
</head>

<body>

    <hgroup>
        <h1>Flux</h1>
        <i class="fa fa-cloud fa-4x"></i>
        <h2>A Cloud Based Service</h2>
    </hgroup>

    <form action="index.html">

        <div class="section-1">
            <div>
                <!--  <i class="fa fa-user fa-2x"></i>  -->
                <input type="text" class="text" value="First Name" onfocus="this.value = '';" onblur="if(this.value=='') {this.value = 'First Name';}" id="active">
            </div>

            <div>
                <input type="text" class="text" value="Last Name" onfocus="this.value = '';" onblur="if(this.value=='') {this.value = 'Last Name';}" id="active">
            </div>

            <div class="clear"></div>
        </div>

        <div class="section-2">
            <!-- <i class="fa fa-envelope fa-2x"></i> -->
            <input type="text" class="text" value="user@email.com" onfocus="this.value = '';" onblur="if(this.value=='') {this.value = 'user@email.com';}">

            <!--    <i class="fa fa-key fa-2x"></i>  -->
            <input type="password" class="text" value="password" onfocus="this.value = '';" onblur="if(this.value=='') {this.value = 'password';}">
        </div>
        <h3>By creating an account, you agree to our <span class="term"><a href="#">Terms & Conditions</a></span></h3>

        <div class="submit">
            <input type="submit" value="Sign Up">
        </div>
        <h3 id="second-h3">Already a member? Click <a href="#">Here</a></h3>

    </form>

    <script type="text/javascript" src="/js/retina.min.js"></script>
</body>

</html>

CSS:

 body {
    background-image: url(../images/VBKHtidQKL.jpg);
    -moz-background-size: cover;
    -webkit-background-size: cover;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
hgroup {
    color: #fff;
    text-align: center;
    font-family: Lobster Two;
    font-size: 36px;
    font-stretch: extra-expanded;
}
form {
    margin: auto;
    height: 500px;
    width: 300px;
    padding: 10px;
    align-content: center;
    max-width: 1366px;
    max-height: 768px;
}
h3 {
    color: #fff;
    font-family: Raleway;
}
#second-h3 {
    text-align: right;
    color: #ffffff;
    font-family: Raleway;
}
.section-1 input[type="text"] {
    padding: 15px;
    font-size: 1.1em;
    margin: 20px 0px;
    color: #666666;
    width: 87%;
    cursor: pointer;
    font-family: Raleway;
    outline: none;
    font-weight: 500;
    background: #ffffff;
    -webkit-transition: all 0.4s ease-out;
    border-top: none;
    border-bottom: none;
    border-right: none;
    border-left: 8px solid #fff;
}
.section-2 input[type="text"], input[type="password"] {
    padding: 16px;
    width: 92%;
    font-size: 1em;
    margin: 20px 0px;
    color: #666666;
    cursor: pointer;
    outline: none;
    font-weight: 700;
    font-family: Raleway;
    background: #ffffff;
    -webkit-transition: all 0.4s ease-out;
    border-top: none;
    border-bottom: none;
    border-right: none;
    border-left: 8px solid #fff;
    float: left;
}
.section-1 input[type="text"]:hover, .section-2 input[type="text"]:hover, input[type="password"]:hover, #active {
    color: rgb(220, 220, 220);
    border-left: 8px solid rgb(64, 164, 111);
}
.submit {
    padding: 6px 4px;
    text-align: center;
}
input[type="submit"] {
    padding: 18px 30px;
    color: #fff;
    float: right;
    font-family: Raleway;
    background: rgb(64, 164, 111);
    border: 1px solid rgb(64, 164, 111);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.5s ease-out;
    -webkit-transition: all 0.5s ease-out;
    outline: none;
    width: 100%;
}
.submit[type="submit"]:hover {
    background: rgb(7, 121, 61);
    border: 1px solid rgb(7, 121, 61);
}




REST Web services with Python

I have to develop an application with these specifications, so I'm asking your advice:

  1. It runs and waits requests from the web.
  2. When a request of type A arrives, it asynchronously launches a Python script. This Python script (already existing) processes some data and writes the results in a table.
  3. When a request of type B arrives, the application responds with the status and eventually the result of the elaboration of the asynchronous script.

I thought to do this with Python, providing a sort of REST service. Is it a good idea according to you? At the moment, which is the best Python tool to do this program? Thank you very much

Claudio




Change the date of second dropdown based on first datetime picker

I have been trying to solve this puzzle for last 2 days,but could not know where am i doing wrong. Problem : I have two dropdowns of jquery calendar where first input has the default date set for today. when selecting a date from this input the second input should select its date as the minimum allowed date.

I have achieved so far with the below code.

$.datetimepicker.setLocale('en');
var currentdate = new Date();
var datetime = currentdate.getDate() + "/"
                + (currentdate.getFullYear())  + "/"
                + (currentdate.getMonth()+1) + "  "
                + currentdate.getHours() + ":"
                + currentdate.getMinutes();


    function getCurrentDate(){

    var currentdate = new Date();
    var datetime1 = (currentdate.getDate()+1) + "/"
                + (currentdate.getMonth()+1) + "/"
                + (currentdate.getFullYear())  + " "
                + (currentdate.getHours()+3) + ":"
                + currentdate.getMinutes();

    var datetime2 = (currentdate.getDate()+1) + "/"
                + (currentdate.getMonth()+1) + "/"
                + (currentdate.getFullYear())  + " "
                 + "11:59 PM";

            $('#datetimepicker,#datetimepicker1,#datetimepicker2,#datetimepicker3').datetimepicker({step:30});
            $('#datetimepicker').datetimepicker({

            onClose: function(selectedDate) {
             $( "#datetimepicker1" ).datetimepicker({minDate:selectedDate,startDate:selectedDate} );
             }

            });

    //document.getElementById('datetimepicker').value=datetime1
    //document.getElementById('datetimepicker1').value=datetime2
    //document.getElementById('datetimepicker2').value=datetime1
    //document.getElementById('datetimepicker3').value=datetime1

    }
$('#datetimepicker').datetimepicker({

 dayOfWeekStart : 1,
lang:'en',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
startDate:  datetime,
minDate : datetime
});
$('#datetimepickerr1').datetimepicker({

 dayOfWeekStart : 1,
lang:'en',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
startDate:  datetime,
minDate : datetime
});

$('#datetimepicker1').datetimepicker({

 dayOfWeekStart : 1,
lang:'en',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
});



$('#datetimepicker2,#datetimepicker3').datetimepicker({
dayOfWeekStart : 1,
lang:'en',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
startDate:  datetime,
minDate : datetime
});

$('#datetimepicker,#datetimepicker1,#datetimepicker2,#datetimepicker3').datetimepicker({step:30});
$('#datetimepicker').datetimepicker({

onClose: function(selectedDate) {
  $( "#datetimepicker1" ).datetimepicker({minDate:selectedDate,startDate:selectedDate} );
  }

});

Issue :: When I select a date from second dropdown,it changes the min allowed date for the first input.

It can be seen live at http://ift.tt/298XK6O




Subordinate reference books in web dev

A web application needs subordinate reference books.

Example: 1) a customer 2) his/her bank accounts.

This is my first project. Pardon me if this is all clumsy.

In pseudocode:

Models

class Customer:
    id
    name

class BankAccount:
    customer = ForeignKey(Customer)
    account

For example, this is a completely new customer. S/he doesn't have an id yet.

Well, I don't know how to cope with this problem in web applications.

I'm going to use such url:

http://counterparts/4/accounts/create

Where 4 is counterpart's id. It is important for the user not to interfere with this id. I thought about several variants with signing the id:

  1. http://counterparts/4:dWvne64Iu-6mIdc7T6LRHE173AY/accounts/create Looks ugly.

  2. input type=hidden. But this will ruin the cache.

  3. http://counterparts/4/accounts/create + 4:dWvne64Iu-6mIdc7T6LRHE173AY in cookies. In this case 4 in the url is a bit redundant. I'm in favour of this variant and am going to return the user back to where he was if he interferes with this url.

The problem with all these methods is that I myself invented them. Well, I think this is a typical situation. Why should I reinvent the wheel if I'm that clumsy here.

Could you give me some piece of advice: what is the best practice of coping with such problems.




passing value to a different webpage form

I'm trying to learn to make a webapp using JavaScript along side with nodejs. I'm all out of ideas and have no clue if im doing this correctly. So what im trying to do is when a user clicks on a row of a the dynamically created table it opens up a new html page with a bunch of form inputs already filled in with the values in a json. Right now I have it that when I click on the table row I can get the Id chosen and as a test i want to load it in to a input field but im getting it as undefined

a good portion of the table creating function with the fillform function

    for (i = 0; i < attendee.length; i++) {
        var tr = document.createElement('TR');
        if(i % 2 == 0)
        {
            tr.bgColor = '#E9F2F5';
        }
        for (var j = 0; j < attendee[i].length; j++) {
            var td = document.createElement('TD');

           /* if (j != 0) {
                td.setAttribute('contenteditable', 'true');
            }*/
            td.appendChild(document.createTextNode(attendee[i][j]));
            tr.appendChild(td);

            var currentRow = table.rows[i];
            var createClickHandler =
                function(tr)
                {
                    return function() {
                        var cell = tr.getElementsByTagName("td")[0];
                        var id = cell.innerHTML;
                        fillForm(id);
                    };
                };
            currentRow.onclick = createClickHandler(currentRow);
        }
        tableBody.appendChild(tr);
    }
    myTableDiv.innerHTML = "";
    myTableDiv.appendChild(table);
}

// this function is included in the html page as a onload function
function fillForm(id) 
{
    window.open("/populatedForm.html");
    document.getElementById("id").value = id;
    console.log(id);
} 

Part of the html input I want to fill out.

<div class=container2>
    <form method="PUT" action="/process-form" enctype="multipart/form-data" autocomplete="off">
        <fieldset>
            <label>
                ID<br/>
                <input id="id" name="id" type="text" value=" " required/>
            </label>
            <br/>

This is how my table looks like enter image description here

And this is how the input looks like when I click on a row in the table. It opens the new html page but the input is set to undefined. I havent done the rest since I cant get id to work. enter image description here

Any advice would be great! Thank you!




How to download a file from server using AJAX? [on hold]

                function downloadFinalFunc(){
                    var project_id = 3;
                    var xhttp = new XMLHttpRequest();
                    xhttp.onreadystatechange = function () {
                        if (xhttp.readyState == 4 && xhttp.status == 200) {
                            
                            if(xhttp.response)
                            window.location.href=xhttp.response;

                        }
                    };
                    xhttp.open("GET", "http://localhost:8080/downloadFinal.php?PID=" + project_id, true);
                    xhttp.send();
                }
<input type="button" onclick="downloadFinalFunc()">

I am working on a Portal in which user can upload files and admin can download those submissions. The files are uploaded on server correctly in upload folder. Now admin wanted to download it. I have written php script and it downloads file by using request parameter in url.

But by ajax it is not working. Please tell the problem and solution.




How do search engines do exact phrase matches on millions (or billions of documents)?

It would seem to be impossible to do an exact phrase match on billions of documents, how do search engines do it?

My only guess is that they do not actually do a real exact phrase match. They have a word index that returns every document that contains a particular word and then they cherry pick words out of the "exact phrase" and intersect the word lists. For example, when I search for "cut down tree" on Google one page I get is How to Cut Down a Tree on Instructables, but nowhere on this page is there the exact phrase "cut down tree". The closest thing is "Cut Down a Tree" which is a different phrase. So, apparently Google is not really doing an exact phrase match, just a pseudo-match.

So, is doing a real exact match impossible with a large corpus?




Can we scrub HTML from user requests and yet deal with special characters like &?

We use BeautifulSoup to scrub HTML from our requests. Assume scrub is a configurable option with varying degree of security to remove HTML or remove dangerous elements. The code is something like:

for k,v in request.form.iteritems():
    soup = BeautifulSoup(value)
    soup.scrub()
    request[k] = str(soup)

It usually works fine for HTML and Text input both. However if the input was simply plain text which has & it breaks.

BeautifulSoup('H&W Insurance') = 'H&W; Insurance'

Ofcourse I can fix it by HTML escaping my input. But it won't work if input really was HTML. And if I do nothing, & is not going to work. Both ways something is going to break. Is there a way I can both scrub the HTML and yet make my & work?

I think the only way this can be solved it to have some conventions in the request to specify the exact type of the request, but the paradox is I am trying to handle an unexpected input, so I can't really specify something. Is this really a solvable problem?




Recommend a good resource for learning in depth about parallel processing in php?

I've found several options through googling:

  • php7 pthreads
  • something like exec(), proc_open(), pcntl_fork() to start multiple scripts in the background
  • making multiple ajax requests from browser to an api to kick off several processes at once
  • gearman?

I'm just looking for a very in depth background on everything parallel processing in php. maybe a textbook, or online class?

P.S. here are a few examples of some of the types of questions I have right now:

  • how many tasks can I run in parallel using the exec() and similar methods? hardware requirements?
  • how does the performance compare when running in parallel using these methods vs sequential
  • even basic questions like difference between multithread, multiprocess?
  • maybe examples of situations when each option makes the most sense/limitations of each method.
  • plenty of coding examples!



Can´t run an jnlp file. Shows message "Cannot run application"

so i'm recently starting to work with Java Web Start, everything was ok untill i tried to run my .jnlp file and it showed the message "Cannot run application" giving me only two options "Ok" & "Details". I selected details and this is what it showed:

java.util.zip.ZipException: duplicate entry: org/apache/xmlbeans/xml/stream/Location.class
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:232)
at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
at com.sun.deploy.net.HttpDownloadHelper.decompressWrite(Unknown Source)
at com.sun.deploy.net.HttpDownloadHelper.download(Unknown Source)
at com.sun.deploy.cache.Cache.downloadResourceToTempFile(Unknown Source)
at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

I tried searching a solution for this problem, but i didnt have any luck. Thanks! Apologies for my english!




How to get photo files in original size from Instagram?

Dear fellow community!

Does anyone know how to get the photo files in original size from Instagram? They surely store original files in full size, since you can upload a photo via app to your IG profile, delete it from the phone, and it still syncs your IG with phone library to get this photo back in full resolution.

Their API supports fetching up to 1080x1080px, plus I found this method via Chrome developer tools: http://ift.tt/293j8pc. Script that could do it doesn't seem reliable on large scale, so I'm still looking for a automated better solution.

Please share any experience that could help.




If the database is down how to preserve the form data and save it to some other place?Also what can this other place potentially be ?

I have been given a task of saving web-form data to another place when the database is down. Although, by the sound of it I find it a little beyond possible. Is there any way I can achieve this? If not, what is the alternative way by which I can help the user preserve form data even when the database is down. The PHP version I am using is PHP 7




Can you repeat objects on a Access web app view

I am using Access 2013 to create an Access web app in SharePoint. I am trying to figure out if its possible to repeat say a combo box dynamically on a page based on a query. And then have the combo boxes that have been repeated populate with data from tables. The idea is that the system dynamically creates a page of different combo boxes based on a combo box table. I think I may have reached the capabilities of Access web apps. Any direction appreciated?




Hiding Javascript for puzzle game

For a fun project I wanted to make a puzzle game that is a series of riddles with the answers being a link to the next level, a la Notpron. I've been working on this in Javascript so it can have more interactive elements. However, anyone can look at the JS source and immediately figure out the link to the next puzzle. Especially if I have something like:

 window.location.href = "levels/1.html"

It would be nice if I could hide this somehow, but most obfuscation tools I've looked at seem like it would be very easy to identify where a link string is and decode it. Notpron gets around this by only having clues that lead to the user manually typing in the URL to the next level, but I would like to stay away from that.

Like I said, this is just for fun. But my question is if there is any way to accomplish hiding code on the web. I'm open to using different tools as well.




How to set-up a complex back-end server for different front end platforms?

What/how best to set-up back-end server, for front end: website, android app, ios app and uwp windows app?

The application will be for content and communication purposes.




Browser alert over screen locked

I was wandering if it is possible a browser webpage communicate through any (iphone, wp, android, etc) mobile phone (having screen locked) with simple task like alert();

Ex.: I access a timer webpage and locked my phone and in right time the phone show the alert.

Ps. This is only an example, let's be grown up here.




get log message of a live stream from VLC web Plugin embed in web application C#

I'm trying to get the state of a live stream in VLC Web plugin using vlc.playlist.isPlaying. But, it is always returning true even if I stopped the live stream. How could I get the real state of the live stream?

Beside, I want to get the number of displayed frames when stream is playing. How could I do that?

Thanks.




How to automatically update online content?

This my first question here and I have searched for an answer thoroughly.

Search engines all offer mostly the same results and I have found out that they accomplish that by something called web indexing or web scraping.

I want to use the same principle on another type of website. So auomatically indexing results or content. Ofcourse with the original author mentioned.

Question is, how can this be done?

(I am not a programmer and English is not my native language so I hope I have explained this well)

Thank you!




Is it possible to run JUnit Tests for classes such as Controllers, Models in a Java WEB application?

Recently, I have been attempting to run JUnit tests on my controllers that I have wrote in my Java Web Application. The controller methods are simple and are running methods such as 'Login', 'Logout', etc.

However, when I attempted to run the JUnit tests, it constantly fails to start. But if I were to extract solely the classes to a separate Java Application, I would have no issues running the tests.

Does anybody know if there are special configuration required for Java Web Application JUnit Testing?

Thank you! :)




Do we have any alternative option of application cache?

Alternative of this. As this links shows this functionality is deprecated.




Having trouble with cropper.js

I am using cropper.js on something I am working on, but having a little trouble getting it to work properly, is it possible to see what I might be doing wrong.

The image "duplicates" on the web page. (using a random image for example here)

My Html, Image:

<img id="ImageFrame" src="http://ift.tt/297i7Tl" style="max-width:100%" />

My javascript:

$(function () {
                var image = $('#ImageFrame');
                var cropImage = new Cropper(image[0], {
                    preview: 'div#CropPreview',
                    built: function () {},
                    crop: function (e) {
                        $("#cropX").val(Math.round(e.detail.x).toString());
                        $("#cropY").val(Math.round(e.detail.y).toString());
                        $("#cropH").val(Math.round(e.detail.height).toString());
                        $("#cropW").val(Math.round(e.detail.width).toString());
                    }
                });
            });

Then the result: Image is duplicating when the cropper renders

Any help would be welcome.




Azure service fabric Instance count

I am working on a POC with azure service fabric. Deployed my service in a local cluster and it's working fine with default settings in Local.xml.

The moment I change the instance count it's throwing following exception. Where is the option to change the instance count? Basically i am trying to run my service on two nodes now. It's working fine when it is the default value that is 1.

InnerException: HResult=-2146233088 Message=Error -4091 EADDRINUSE address already in use Source=Microsoft.AspNetCore.Server.Kestrel StatusCode=-4091

My local.xml is copied here

  <Parameters>
    <Parameter Name="Product_InstanceCount" Value="2" />
  </Parameters>

Any help really appreciated.

Thanks




The website does not load when just HTTP is used in the URL

The webpage I have hosted loads fine when I use www.XYZ.com but does not load when I use http . How do I configure the site so that both http:// and www. URLs load fine? Is this because I do not use index.html as the landing page?




crawling web data using python html error

i want to crawling data using python i tried tried again but it didn't work i can not found code's error i wrote code like this:

import re
import requests
from bs4 import BeautifulSoup

url='http://ift.tt/296uSKT'
html=requests.get(url)
#print(html.text)
a=html.text
bs=BeautifulSoup(a,'html.parser')
print(bs)
print(bs.find('span',attrs={"class" : "u_cbox_contents"}))

i want to crawl reply data in news

enter image description here

as you can see, i tried to searing this:

span, class="u_cbox_contents" in bs

but python only say "None"

None

so i check bs using function print(bs)

and i check up bs variable's contents

but there is no span, class="u_cbox_contents"

why this happing?

i really don't know why

please help me

thanks for reading.




Can't get all the source code from a web page

I'm trying to build a simple web crawler in Python that saves all my previous Facebook profile photos.

As part of my early attempts, I'm trying to get all the source code from the url of my Profile Pictures, and then to filter it just to get all the anchor elements that has a class "uiMediaThumb _6i9 uiMediaThumbMedium" (I checked and all the href of the photos I want has this class).

I'm doing this as according to what I have learned from Bucky (https://www.youtube.com/watch?v=XjNm9bazxn8).

import random
import urllib.request
import requests
from bs4 import BeautifulSoup

def put_source_in_file(str):
fw = open('temp_source.txt', 'w', encoding='utf-8')
fw.write(str)
fw.close()

def trade_spider():
    url = r'http://ift.tt/29spa4E' #url of my profile photos
    source_code = requests.get(url)
    put_source_in_file(source_code.content)
    plain_text = source_code.text
    soup = BeautifulSoup(plain_text, "html.parser")

    for link in soup.findAll('a', {'class': 'uiMediaThumb _6i9 uiMediaThumbMedium'}):
        print(link.get('href'))

trade_spider()

The problem is that although these anchor elements appears in the original source page, they don't exist in the Respond object of the Request I'm using. I have even copied all the source code to a file and double checked it - still not there.

Can anyone help?

Thanks =)




I have been having an issue with this post [on hold]

Can anyone explain why 1kb chess is such an impressive thing? I don't understand why it is seen as being good, any comparison or explanation would be great.

**http://ift.tt/29eQpDL




overlay image with shape css

How can I mask an image with a css shape ? ( image attached )

reference Image

enter image description here

I already made a shape with css border style but not able to overlay an image.

CSS

#triangle-topleft {
  width: 0;
  height: 0; 
  border-top: 100px solid red;
  border-right: 100px solid transparent; 
}




mercredi 29 juin 2016

Microsoft Navision web service missing Create method in WSDL

I am working with MS Navision web services, but my WSDL is missing Create methods. Can anyone help me with this? I can use other methods suck as Read or ReadMultiplne, but Create is missing. Another problem is, that if I add property to Page, I can see the property in WSDL but cannot use it in code even when I updated the web reference and built the solution. Thank you.




Web Notifications not appearing in Safari

I am trying to display notifications with jQuery locally on page load. The notification is showing correctly in Firefox, Firefox Developer, and Chrome. The notification is not appearing in Safari despite allowed in notification preference settings.

Similar code is working from MDN site http://ift.tt/1jRJLOv.

Snippet is below.

// Display a sample notification
  if (window.Notification) {
    return $(".au-notifications-page").show(function() {
      var notification;
      notification = new Notification(
        'Success Text', {
        //tag: $("[name=tag]").val(),
        body: 'Success Message',
        iconUrl: 'img/avatar-male.png',
        icon: 'img/avatar-male.png'
      });
      return notification.onclick = function() {
        notification.close();
        window.open().close();
        return window.focus();
      };
    });
  };

Complete code is below.

$(document).ready(function () {

  // Request permission on site load
  Notification.requestPermission().then(function(result) {
    if (result === 'denied') {
      //alert('denied');
      $(".au-notif-disabled-header").removeClass('hide');
      $(".au-notif-disabled-header .btn").addClass('hide');
      return;
    }
    if (result === 'default') {
      //alert('ignored');
      $(".au-notif-disabled-header").removeClass('hide');
      return;
    }
    //alert('granted');
    $(".au-notif-disabled-header").addClass('hide');
  });

  // Request permission with button
  $('.au-notif-disabled-header .btn').click(function () {
    Notification.requestPermission().then(function(result) {
      if (result === 'denied') {
        $(".au-notif-disabled-header").removeClass('hide');
        $(".au-notif-disabled-header .btn").addClass('hide');
        return;
      }
      if (result === 'default') {
        $(".au-notif-disabled-header").removeClass('hide');
        return;
      }
      $(".au-notif-disabled-header").addClass('hide');
    });
  });

  $( ".au-notification-icon" ).hover(
    function() {
      $(".au-notifications-menu .au-notif-msg-realtime").slideDown();
      $('.au-notification-icon .badge').html("2");
    }, function() {
      $(".au-notifications-menu .au-notif-msg-realtime").slideUp();
      $('.au-notification-icon .badge').html("1");
    }
  );

  //To show notification received while on notifications page
  $(".au-notif-msg-realtime").hide();
  //$(".au-notifications-page .au-notif-msg-realtime").slideDown();

  $(".au-notifications-page .au-notif-msg-realtime").slideDown({
    complete: function(){
      $('.au-notification-icon .badge').html("2");
      $('head title').html("(2) Notifications");
    }
  });


  // Display a sample notification
  if (window.Notification) {
    return $(".au-notifications-page").show(function() {
      var notification;
      notification = new Notification(
        'Success Heading', {
          body: 'Success Text',
          iconUrl: 'img/avatar-male.png',
          icon: 'img/avatar-male.png'
      });
      return notification.onclick = function() {
        notification.close();
        window.open().close();
        return window.focus();
      };
    });
  };
});




Restoring website on 000webhost

I use 000webhost.com for my web hosting. I had a site called ansi-vt100.tk that I worked really hard on. But no one visited it and it was cancelled for inactivity. I know there's probably no solution, but is there any way to get my old data back?




How do you have an image cover half a section and a text container in the other half?

I'm currently making a simple website, but I have to have an image covering one half of a section and text on the other side. How do I do that? Any help would be appreciated. Thanks




Adding number values in one column to show total in another column

I am currently designing a web page template to create "personas" of clients and their monthly billing charges. What I would like to do is have the charges listed in their own boxes/columns (Circle #1) and then those charges added to the total on the right hand column(Circle #2) I've been searching around the web but can't seem to find any answers.

http://ift.tt/293OJaG

Thank you




Is an aspiring android developer expected to know webframeworks to get a job

I am learning to be an android developer. Soon should be applying for jobs after I complete few projects on my own including one or two android native app using some public websites api (just enough to get the json data, parse it and use it in my app). I have some theoretical knowledge of spring mvc and struts frameworks and some hibernate but now worked on them practically.

  1. Am I expected to know any webframeworks to be able to get a job?
  2. If yes, how much?

Thank you for your help in advance!




Unity: POST request to RESTful APIs using WWW class using JSON

enter image description here

I am trying to make a POST request in Unity script. The header should contain the key 'Content-Type' that is set to 'application/json'. The input key is "email".

So here's my script:

private static readonly string POSTWishlistGetURL = "http://ift.tt/296Kz3D";
public WWW POST()
{
 WWWForm form = new WWWForm();
 form.AddField("email",  "abcdd@gmail.com");
 Dictionary<string, string> postHeader = form.headers;
 if (postHeader.ContainsKey("Content-Type"))
     postHeader["Content-Type"] = "application/json";
 else
     postHeader.Add("Content-Type", "application/json");
 WWW www = new WWW(POSTWishlistGetURL, form.data, postHeader);
 StartCoroutine(WaitForRequest(www));
 return www;
}

IEnumerator WaitForRequest(WWW data)
{
 yield return data; // Wait until the download is done
 if (data.error != null)
 {
     MainUI.ShowDebug("There was an error sending request: " + data.error);
 }
 else
 {
     MainUI.ShowDebug("WWW Request: " + data.text);
 }
}

I keep getting data.error = 400: Bad Request. How do you properly create a POST request?




How to manage a domain name bought from Azure?

I bought a domain directly from Microsoft Azure. I'm getting an error when I go to my Web App>Settings>Custom domains and SSL>Click my domain>Advance man...

Error page

What I want to do is manage my domain name outside of Azure to be able to connect it to Firebase Hosting. Any idea on how to achieve this? Thanks.




How can my web site make many concurrent HTTP requests?

I have a site that loads many individual pieces of data from a remote server - that is, a public API server separate from my webserver. The number of concurrent requests the site makes goes way beyond browser limits, so using direct Ajax calls causes severe performance problems.

The site currently uses a PHP script to act as an Ajax middleman: the client sends the server a list of URLs, the webserver (which has no such concurrent HTTP request limit) makes the requests on the client's behalf, and the webserver forwards the API server's responses to the client.

One big issue I have with this workaround is that the client has to wait for the webserver to receive every HTTP response before it can see any of the data. I know I can fix this issue by using something like Socket.io, but that seems like overkill.

If this is a common issue, what solutions exist to deal with it?

If it's not, how do sites that rely heavily on data from APIs avoid or mitigate this issue?




Registered a domain, grabbed some hosting, coded a website. Wont render properly

http://ift.tt/293FxHP ------my files are all hosted here. lastcanti.github.io -----should redirect you to my website.

Thank you!

I recently coded a website from scratch... Sort of. I used some templates from Pure.css because I really like the look and feel of their mobile stuff.

My website is not displaying properly. I've spent a few hours trying to figure this out and I am at a loss. The css doesn't seem to be displaying properly. I've uploaded all of my files for my website to the cPanel but can't get anything going!

My website looks beautiful in brackets, which is the program I use to design.

Thank you so much for your help, Andy




How do I fix a pagination issue with Cake PHP where clicking "next page" displays the same news articles?

This webpage I've been working on (BMAMedia.com/news) displays 20 articles at a time. When "Next Page" is clicked, the site continues to display the same articles every time. My guess would be the issue lies in one of these three functions:

function index() {
    $this->News->recursive = 0;
    $this->set('news', $this->paginate());
}

function editlist() {   
    $this->layout = 'adminlayout';
    $this->News->recursive = 0;
    $this->set('news', $this->paginate());
}

function headlines() {
    $news = $this->paginate();
    if(isset($this->params['requested'])) {
        return $news;
    }
    $this->News->recursive = 0;
    $this->set('news', $news);
}

If someone could please help me with this that would be great because I'm not sure where to go from here and I've researched for hours with no luck.




How to launch python on the web

I'm looking to create a basic game (with python). I know CMD cannot display images, though. Is there any way to upload it somewhere, where I can embed it on my own website, or a way to put the python script on my website without using this Python-HTML language?




browser waits for web worker to finish before redirecting

I am working on a dashboard web page, it has 5 different square boxes showing the results of heavy queries, usually querying months of data at a time.

Each query could take from 3 to 7 seconds to execute and return data.

What I am trying to achieve from the UI perspective is running those queries in the background and let the UI free to redirect to another page.

My first atempt was a Jquery.ajax() call and the problem there is the following: Let's say that I have 5 queries to run I make the 5 ajax calls and in this example the browser is waiting for query #3 which takes 5 sec the user clicks a and my expectation is for the browser to redirect right away to google, instead it is waiting for task 3 to finish, then ignoring queries 4 and 5 (which is good) and going to google. But since taks 3 takes 5 sec, the user needed to wait 5 extra seconds for a piece of data that he didn't use.

I changed my implementation to web workers and the result is the same.

I am posting a simplified version of the code to express my point. I executed this code in Chrome and the result I am getting is the redirect doesn't happen until the sleep(10) seconds finishes. I want to redirect as soon the user clicks the link.

webWorkerTest.html

<script>
    if(window.Worker){

        var myWorker = new Worker("worker.js");
        var message = { goToTheServer: true };

        myWorker.postMessage(message);

        myWorker.onmessage = function(e){
            console.log(e.data.result);
        };
    }

</script>

<a href="http://www.google.com">Google</a>

worker.js

this.onmessage = function(e){

    if(e.data.goToTheServer != undefined){

        var ajaxResult = goToTheServer(
            function (resultado){
                this.postMessage({result: resultado});
            }           
        );
    }
};


function goToTheServer(callback) {

    var xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == XMLHttpRequest.DONE ) {
           if (xmlhttp.status == 200) {

               callback(xmlhttp.responseText);                     
           }           
        }
    };

    xmlhttp.open("GET", "ajax.php", true);
    xmlhttp.send(); 
}

ajax.php

<?php

sleep(10); //heavy query
echo 1984;




Nearby Places, Distance and Route between two places using Google Maps API for Web

I am developing a website which uses Google Maps place API to get area from user and need to show nearest Restaurants, Hotels,... and also I need to show distance and route between those places from user selected area.

I am new to Google Map API.

Can anyone help me to give some suggestion,links,tutorial to do that?

Thank you.




CSS override Windows scaling (items smaller or larger)

In windows you can change how big or small the icons and text looks. I recently found out that this affects CSS code too and sites look different in the same resolution!!

(as if CTRL + is pressed)

Is there a way to override this and have your site look the same?




How to code basic search in my website in php

I want to code a basic search box in my php based online shopping website. the problem is the data is in 50 tables categorised based on product type. ie table 1 - Mobile Phones table 2 - Laptops table 50 - Air Conditioners

i can code it using query like select * from table 1 if 0 rows returned select * from table 2 if 0 rows returned next till table 50

but this code can slow down the website as each keypress will lead into 100 queries execution is there anything else i can do about it ?




JS Multitouch not working

I am a german guy, 15 years old, and I have a problem. The problem is called multitouch in JS:

The method setparameters() will be called when the game starts and the methods update() and draw() will be called 60 times in a second.

When i put my finger down on the left side and i move it, a kind of circle pad will appear on the position i placed my finger. That works fine. BUT when i touch the right side while i am moving my left finger, the circle pad will disappear for a frame and appear again on an other position after i moved my left finger.

Hope you can help me!

Here the url to the website: http::/http://ift.tt/292Jc4I

And here the code:

    var canvas;
    var ctx;

    var touchdownX = 0;
    var touchdownY = 0;
    var touchX = 0;
    var touchY = 0;

    var difX = 0;
    var difY = 0;

    var touchRight = false;
    var touchLeft = false;
    var halfScreenWith = window.innerWidth/2;

    var playerX = 200;
    var playerY = 200;

    //Die Parameter werden nach dem Laden gesetzt und steuerungslistener hinzugefügt
    function setupParams(){
      canvas = document.getElementById('canvas');
      ctx = canvas.getContext("2d");

      canvas.addEventListener('touchstart', function(e) {
        for (var i = 0; i < event.touches.length; i++) {
          var touch = event.touches[i];
          var tempTouchX = touch.clientX;
          if(tempTouchX>halfScreenWith){
            //Rechtsclick
            touchRight=true;
          }else{
            touchLeft = true;
            touchdownX = touch.clientX;
            touchdownY = touch.clientY;
            touchX = touch.clientX;
            touchY = touch.clientY;
          }
        }

      }, false);

      canvas.addEventListener('touchmove', function(e) {
        for (var i = 0; i < event.touches.length; i++) {
          var touch = event.touches[i];
          if(touch.clientX<halfScreenWith){
            var tempTouchX = touch.clientX;
            if(tempTouchX<halfScreenWith){
              touchLeft = true;
              touchX = touch.clientX;
              touchY = touch.clientY;
            }
          }

        }

      }, false);

      canvas.addEventListener('touchend', function(e) {
        touchLeft = false;
      }, false);
    }

    //Die Werte neu berechenen
    function updateGame(){
      if(touchRight){

        //touchRight = false;
      }

      if(touchLeft){
        difX = touchX - touchdownX;
        difY = touchY - touchdownY;

        if(difX>0 && difX>10){
          difX = 1.5;
        }else if(difX<-10){
          difX = -1.5;
        }else{
          difX = 0;
        }

        if(difY>0 && difY>10){
          difY = 1.5;
        }else if(difY<-10){
          difY = -1.5;
        }else{
          difY = 0;
        }

      }else{
        difX = 0;
        difY = 0;
      }
    }

    //Die Grfaiken neu anzeigen
    function drawGame(){
      playerX = playerX + difX;
      playerY = playerY + difY;

      ctx.clearRect(0, 0, canvas.width, canvas.height);

      ctx.beginPath();
      ctx.rect(playerX,playerY,32,32);
      ctx.stroke();

      if(touchLeft){
        ctx.beginPath();
        ctx.arc(touchdownX-16,touchdownY-16,32,0,2*Math.PI);
        ctx.stroke();

        ctx.beginPath();
        ctx.arc(touchX-12,touchY-12,24,0,2*Math.PI);
        ctx.stroke();
      }


      if(touchRight){
        ctx.beginPath();
        ctx.rect(200,200,32,32);
        ctx.stroke();
        touchRight = false;
      }
    }




Anyone knows if vibe.d supports Byte Range for serveStaticFiles()?

I was looking in the source code of vibe-d-0.7.28 but fileserver.d doesn't show any light about this. Actually, the sendFileImpl() function is the main implementation for that job and doesn't have any reference to byte-range header.

Do you know if that is supported or how works?




dynamic url parameters when first ones are null

I have a page with 5 filters on it, I use GET method so I receive url like candidates/filter?gender=M&country=USA&language=english. My boss wants me to do url like candidates/male/USA/english, ok, I know how to do it, but when only language is set I receive url like candidates/any/any/english. my boss wants me to remove 'any' from url and gives me as a example this filter. As you can see when you select only Subject the url became search/subject, when you select Term and Subject it became search/term/subject, when you select all three filter url contains all three search/country/term/subject. How do they do that?

The only one I can guess for now: they takes first parameter for query string, ex 'business', and search it in countries list, if found then first parameter is country, not found -> search business in terms list, found then first parameter is term, not found -> search in Subjects, found -> first parameter is Subject. not found -> then no results. But what if we have two equal list in filters, ex for passport country and residence?

so, the questions is:
1. maybe I missed something and now there is a way to make dynamic url like search/english and we know that english is language, not gender and residence?
2. how mentioned above site do that?




how to improve drpradeepjain.org website?

Please review website http://ift.tt/294MiKL

& please clarify how it can be improved ?




Casting HtmlString to T

I have inherited code which I have had to decompile,

From the code I am getting one problem which I can not solve, Casting a object to HtmlString to T

if (typeof(T) == typeof(IHtmlString))
{
  return (T)(new HtmlString(value.ToString()));
}

The errors on build as a invalid cast expression, I have tried to use Convert.ChangeType but that also doesn't work.

return (T)Convert.ChangeType(new HtmlString(value.ToString()), typeof(T));

Starting to run out of idea's, anyone have any solution?




Need to connect my web app to Google Cloud Storage?

I searched for Google Cloud Storage API but no where found a way to connect my web app with Google Cloud Storage as I required. My scenario is I want to download and access files from Google Cloud Storage using my web app as my data is available on Google Cloud Storage.




Website layout distorted on Uc mini

We're trying to test our website for compatibility on different browsers.

So, we are facing problems while testing with UC mini browser. The website looks fine when the speed mode is off. But with speed mode on, the website is really distorted. The alignment of different elements is not correct and are distorted (you can check screenshots for more details).

We've checked that the html code is same for both speed mode on and off.

So, how can we fix this issue?

Is there a way to correct this from our end?

Speed mode off

Speed mode off

Speed mode on

Speed mode on




Blank web server response in multiple type data submission

When I attach image resources to web service api call, its giving me blank server side response as well nothing submitted to server as well.

I was using following code for this purpose:

IEnumerator RegisterVoterProfile ()
 {
     WWW localFile = new WWW ("file:///Users/gaminguruz/Desktop/messi.jpg");
     yield return localFile;

     if (localFile.error == null)
         Debug.Log ("Loaded file successfully");
     else {
         Debug.Log ("Open file error: " + localFile.error);
         yield break; // stop the coroutine here
     }

     Dictionary<string,string> headerDisc = new Dictionary<string, string> ();
//        headerDisc.Add ("Content-Type", "multipart/form-data");
     headerDisc.Add ("Api-Key", "Api-Key Paste Here");

     WWWForm form = new WWWForm ();
     form.AddField (GameConstants.REGISTRATION_USERNAME_ARG, userNameInput.text);
     form.AddField (GameConstants.REGISTRATION_PASSWORD_ARG, passwordInput.text);
     form.AddField (GameConstants.REGISTRATION_EMAIL_ARG, emailInput.text);
     form.AddBinaryData (GameConstants.REGISTRATION_PROFILE_PIC_ARG, localFile.bytes);
     form.AddField (GameConstants.REGISTRATION_USERTYPE_ARG, GameConstants.VOTER_USER_TYPE);
     byte[] rawData = form.data;

     WWW www = new WWW (GameConstants.REGISTRATION_BASE_URL, rawData, headerDisc);
     yield return www;

     if (www.error == null) 
         Debug.Log ("Data: " + www.text);    
     else 
         Debug.Log ("Error: " + www.error);
 }

Attaching output image too: enter image description here

If I remove following line from source code then data get submitted over and get proper response as well. Even if I just upload image only then also task completed successfully.

form.AddBinaryData (GameConstants.REGISTRATION_PROFILE_PIC_ARG, localFile.bytes);

Even in PostMan and DHC all things working perfectly.

enter image description here

Now at which place, I was doing mistake that I can't able to find so please help me in this.




How to compare the multiple dropdown box values using Javascript/jQuery?

I am having 3 dropdown list which contains the expressions for filtering the datatables based on their selection, for example,

    <select class="AssetSearch" title="ASSET_TYPE">
       <option value="0">--Select Asset Type--</option>
       <option value="PC">PC</option>                            
       <option value="Workstation">Workstation</option>                            
    </select>

    <select class="AssetSearch" title="Location_code">
       <option value="0">--Select Location--</option>
       <option value="Bldg 1">Bldg 1</option>
       <option value="Bldg A1">Bldg A1</option>
    </select>

    <select class="AssetSearch" title="FLOOR_NO">
        <option value="0">--Select Floor No--</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
    </select>
<button class="btnSearchAsset" value="search">Search
</button> 

<table id="dataTable">
  <thead>
    <tr>
      <th>Asset Type</th>
      <th>Location</th>
      <th>Floor No</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Printer</td>
      <td>Bldg 1</td>
      <td>2</td>
    </tr>
    <tr>
      <td>Telephone</td>
      <td>Bldg A1</td>
      <td>1</td>
    </tr>
    <tr>
      <td>Telephone</td>
      <td>Bldg A1</td>
      <td>2</td>
    </tr>
    <tr>
      <td>Telephone</td>
      <td>Bldg A1</td>
      <td>3</td>
    </tr>
    <tr>
      <td>Printer</td>
      <td>Bldg A1</td>
      <td>3</td>
    </tr>
  </tbody>
</table>

Now, the user can select the values from the dropdown in any type of combinations, like, dropbox1 - selected value + dropbox2 - selected value or dropbox 1 - selected value only or all 3 dropboxes selected etc, etc.... then the #dataTable should only show the elements as per the selected values in the dropdown.

Can any one please tell me some effective way to compare all these possible combinations using jQuery or Javascript and pass the query string based on given filter condition to the server and change the datatable accordingly.

JsFiddle link: https://jsfiddle.net/




Edge isn't checking if HTML document has been changed

I got the problem that edge isn't checking if a html document has changed. Firefox and Chrome do check this. Because when I update a html document the page is correctly shown in Firefox and Chrome, but Edge does still show the old page.

Does anyone got the same problem, or does anyone have a workaround for this?

Already a big thanks.




Web Development Monitoring Plugin

So basically what I am building is a monitoring system. This system will monitor a number of applications and the user, with one look, should be able to see how all the applications are performing.

What I am looking for is a plugin (ideally JavaScript based) that changes colour for each application depending on the state that that application is in.

Example: Running normally - Green Experiencing high volume - Yellow Down/Maxed out - Red No data received - White

Does anybody have any suggestions on a plugin that would be good for this?

Thanks :)




mardi 28 juin 2016

How are Programming tutorial websites built? [on hold]

How are the big chunk of written paragraph data shown on the website? Is it done through html only? And what all are the programming languages that are needed to be learned to build such a website? How are websites like codeacademy,tutorialpoint etc. built through programming? What all technologies do I need to know to build these type of websites?




Tracking hits to my website with millisecond accuracy

I am conducting a user study in which users will be visiting a website that I manage and I need to record exactly when they visited the website. Tools like Google Analytics only give a general picture of traffic, but for this study I need to know exact times for hits.

Ideally the website would be hosted on GitHub pages, but if I need to do something like run a script to watch the site and keep a timestamp log then I could run it on a Linux server as well.




Where can I find some good ruby programming projects that I can try?

I recently tried Lynda’s Ruby Essential Training and had finish the project there at the end of the course which is called “Ruby Project: Creating the Food Finder”. Before migrating to Ruby on Rails Essential training, wondering if there is any source on the ruby web project that I can try.

NOTE: I know this is not a specific coding session but I just want to ask your idea guys.




How to model a wizard-like sequential process in REST?

How to model a wizard-like sequential process in REST?

Each step is long and async, each step needs new client input based on results from previous step. Most of the samples I found only involves adding a new element to a collection and then modifying the element so I don't know how to apply to my case.

If I try to make an analogy to the process, it will be like this:

Client submit mystery package

Server slowly unpacks it

 It's cake! Client input how many slices to cut

  Server cut cake slowly

   Client get sliced cake

 It's bomb! Client input whether to cut green line or red line

  Server disarm bomb slowly

   Client get disarmed bomb

Unpacking, cutting, disarming are async sequential singular action with singular output, the samples apply to multiple elements in a collection so it feels weird when I try to model these singular actions...

Thanks.




w3af can not work after all dependencies demanded being installed

After I installed all the dependencies in demand, I tried to run

./w3af_gui

but this error message appeared:

The GTK package requirements are not met, please make sure your system meets these requirements:
- PyGTK >= 2.12
- GTK >= 2.12
The required "dot" binary is missing, please install the "graphviz" package in your operating system.

For now, I don't know how to proceed. Is there anyone can help, appreciate much.




How do I move Laravel remember token into a separate table?

I'm pretty much a beginner in both Laravel and PHP. I used make:auth to create a simple website that I can log in and out of, and I'm trying to move the remember token of the application out of the users table and into another table called remember_tokens. The latter has user_id as a foreign key. I was hoping to expand on this idea in the future in order to remember multiple devices for the same account, but I was also thinking that it doesn't make sense to store the remember token in the users table since it's just some transient state information separate from what defines the account.

I'm really not sure what needs to be modified and in what respect. I created another model along the following lines:

class RememberToken extends Model
{
    public function user() {
        return $this->belongsToOne('App\User');
    }
}

I then added the following to my User model:

public function rememberToken() {
    return $this->hasOne('App\RememberToken');
}

public function getRememberToken() {
    return $this->rememberToken;
}

public function setRememberToken($value) {
    return $this->rememberToken = $value;
}

public function getRememberTokenName() {
    return 'remember_tokens.remember_token';    
}

I know there are several errors here but I can't find any examples or documentation that might tell me what should really be in these functions in my situation, or what else might need to be added. I came across another StackOverflow question similar to this one, and an answer to that question put me on this track, but it didn't include any code.

Is there a way to do what I want to do? And if so, can it be done without unreasonable performance penalties?

Thanks for your help.




Authorisation code error?

I'm in a bit of a tight spot, and hoping I can get some headway on this. Usually I just lurk but I finally decideeddd to register.

I've been trying, very unsuccessfully to transfer a domain to a host in mainland China (faisco.cn). The site is currently hosted and registered with bluehost. I followed all of the steps for domain transfer that bluehost has provided and gave this info to the gaining host.

Unfortunately, the new host has told me that the authinfo (EPP) code that I have is incorrect. However i've confimed with bluehsot maybe 20 tiems now that the EPP code is the right one and even sent a new one. When I gave that code to the new host I get the same result, thats' it's incorrect and they can't do anything.

I've been trying to get more information out of them on what the error code is but they won't give me anything (maybe language barrier, my chinese isn't exactly fluent.)

The domain expires in about a week and i'm really not sure what to do now. Networking and webhosting is fairly new to me. Can anyone give some advice on what I should do here?

On the hosting account that I have with the new host, the website I want to transfer is listed there, and I purchased a years worth of service from them for the domain. The only issue is the authinfo code being wrong (in their words).

What happens if the domain expires on me while this is going on? Will I lose the domain completely? Or is it possible that the new host can get the website when the bluehsot registration expires? The transfer process technically has begun already.




Why are there "pre" url's for website's and whats the benefit?

I've been doing a lot of research for web development and googling, and I'm not sure how to search this question in google.

I've noticed some bigger and smaller sites have their websites "mywebsite.com" and have all their inner pages such as "mywebsite.com/about" or "mywebsite.com/videos"

Makes perfect sense to me. But then I come across some website that have a section(?) BEFORE the .com, for example "video.mywebsite.com" or "news.mywebsite.com"

I own a couple websites myself and I'm curious to why this is done, and what benefits this brings? Is it better for SEO?

If it is something that I could benefit from, how would I go about doing this if my websites are built in WordPress?




Python: Simple Web Crawler using BeautifulSoup4

I have been following TheNewBoston's Python 3.4 tutorials that use Pycharm, and am currently on the tutorial on how to create a web crawler. I Simply want to download all of XKCD's Comics. Using the archive that seemed very easy. Here is my code, followed by TheNewBoston's.
TheNewBoston's Tutorial is a little dated, and the website used for the crawl has changed domains. I will comment the part of the video that seems to matter.




Storing game state in play framework 2.5

Overview

I created a 2-player board game using Play Framework 2.5. For now, users can only play it locally against each other.

Implementation details

Whenever the users start a new game, an AJAX request is sent to the server, which in turn creates a Game object, which is a model of the game and keeps track of the state of the game.

Whenever the user interacts with the game in browser, the AJAX request is sent to the server, which in turn updates (existing) Game object, calculates some things (using Game object) and sends the response back to the client (client game state is updated).

For every user that is playing the game, I store the Game objects in memory (no database storage implementation (yet?)), more specifically, in a java HashMap.

Question

How should I go about storing the game state, in order for the game to be responsive? How people usually implement the backend/storage/models in similar games?

So far

I was thinking about implementing database and storing necessary data in there instead of explicitly creating objects, however it seems to me that it will take too long to query the data from database, format it properly and calculate new state (assuming there are a lot of players).

Another option would be to serialize the Game objects to a byte array and store in the database, then it will require querying and deserialization, therefore it also seems pretty slow (assuming there are a lot of players).




How to render a label and input box in same row React?

I'm trying to figure out how to include both a label ("Name your character") and an input text field on the same line in React.js, but can only seem to find examples using React's Bootstrap Row, which I don't want to use. Does anyone have an idea as to how I can accomplish this?




Line Feed from PDF417 barcode scan causes Chrome to open the download tab

I need to allow a user to scan their drivers license and get the information from it replacing CR and LF characters with \n and \r. The problem comes when Chrome sees the LF it opens the downloads tab. I am trying to use jQuery to see and process these control characters, so far to no avail. Anyone have any ideas?? I have tried e.preventDefault(); on the keydown event of the textbox that the information is being scanned into, but this does not work.




ClassNotFoundException in Catalina server

I am using a library "Prefuse" in my web application. On startup I am getting an error saying : java.lang.ClassNotFoundException: prefuse.data.Tree. i checked, the class is there I have also included it in the server libraries. Below is the stack trace. Please help !!1

SEVERE: Servlet.service() for servlet [com.viz.pkg.Cluster] in context with path [/DataVisualizerThesis] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: prefuse.data.Tree at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at com.viz.buss.PTree.(PTree.java:40) at com.viz.buss.HelperCluster.clustering(HelperCluster.java:51) at com.viz.pkg.Cluster.doGet(Cluster.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)




Returning data from $.post() [duplicate]

This question already has an answer here:

I have this function:

    function getNamep(id_user) {
    $.post('php/back.php', {
        id: id_user,
        f: "getName"
    }, function (data) {
        data = jQuery.parseJSON(data);
        if (data[0] == 1) {
            console.log(data)
        }
        else {
            console.log(data)
        }
    });
}

I want to get the result here:

var name = getNamep(2);

How i can do this? Returning data from $.post()

Thanks!




Auto fill in a web form

I have a third party form that we currently have to manually fill in to extract data into an xml file. It's a very simple web input form that takes a userlog on, password and extract to date. A user manually fills this in and then hits a save button to save to a local drive. I want to automate this process using c# and a service that runs nightly. What is the best way to do this?




Background image blurry on mobile ios

This is probably a rookie question however, I cannot seem to find any solution to the problem that I am having. On my website I have a background image that renders totally fine on desktop at any screen size but becomes a blurred mess when viewed on mobile. I have seen several similar questions with either no answers or a solution that did not work for me any help would greatly be appreciated.
Here is the website

Here are some screenshots of what I am experiencing. Website pic 1 enter image description here And here is my code.

<div class="jumbotron"> <h1 class="text-center" id="head">Kyle Goode</h1> <p class="text-center" id="header">Full Stack Web Developer</p> </div> </div>

  .home {
  background: url(http://mrg.bz/VN5LDd) fixed no-repeat center;
  background-attachment: fixed;
  background-size: cover !important;
  max-width: 100%;
  height: 900px;
  border-top: 1px solid black;
  border-bottom: 1px solid black;
}




How do I swap (non-background) images based on detected browser language?

I'd like to:

  1. Display one url image in a paragraph tag (French flag) that, a. hyperlinks to one url, AND b. is displayed based on the detected browser language fr_ca

AND

  1. Display a different url image in a paragraph tag (American flag) that, a. hyperlinks to a different url from above, AND b. is displayed based on the detected browser language en, AND c. hides the fr_ca paragraph tag above

I have access only to the CSS and HTML inline or via style block (not CSS file) or other server-side scripts.

Here's an example of what I'm thinking but not sure how to execute:

    <p .lang_fr_ca><a href="http://ift.tt/290Ozpc" target="_parent"><img alt="" class="flag" data-pin-nopin="true" src="http://ift.tt/291tI1b" /></a>

    <p .lang_en><a href="http://ift.tt/290OeCY" target="_parent"><img alt="" class="flag" data-pin-nopin="true" src="http://ift.tt/291tION" /></a></p>




How to redirect a URL with a token to certain page?

I have a login page that sends a verification email to users when they create an account. The email they receive will have a link with a token at the end:

http://ift.tt/291CkHs token]

I have an html page made that I would like to have opened when the user clicks the link in their email. How do I get the url with the token at the end to send the user to this specific page?




how to identify which IP access my web application? [on hold]

I want to show a captcha when a given IP access 5 times the same page of my application.

what steps to achieve this?




How to deploy Django-Oscar on Openshift

I'm new to Stakoverflow and putting my first question here,also struggling to deploy django-oscar demo from github.I've followed the instruction from the documentation(http://ift.tt/298wdDH):

$ git clone http://ift.tt/291qziO
$ cd django-oscar
$ virtualenv oscar
$ source ./oscar/bin/activate
(oscar) $ make sandbox
(oscar) $ sites/sandbox/manage.py runserver

It's OK when I test on ubuntu with python2.7 and get to the home page.However I don't know how to deploy the project to Openshit.And almost no any reference I can search and take. Someone knows that,do me a favour and that will be very appreciated.Thanks. PS:I'm able to deploy usual django apps on openshift.




Is considered a good practice handle the state with a ManagedBean?

I´m using a SessionScoped ManagedBean as a State machine (or an application singleton) in order to keep or set some values while the user browse throught the web app.

Is it a good practice? how do you guys handle state in your JSF web application?

Thanks in advance.




Add button which brings user to random page

I am building a website with information about all sorts of countries. I want to add a button that brings the user to a random country page within my website. How could I do this and what programming language(s) do I need?




How to add a menu that only displays on mobile screen sizes?

Right now I have a decent menu formatted for desktop screens on my web app. However, on smaller screen sizes the menu really doesn't appear correctly. At this point I'm wondering if I can just add a hamburger menu like this --->

http://ift.tt/1wwrlNw

    <header class="header">
  <div class="burger">
    <div class="burger__patty"></div>
    <div class="burger__patty"></div>
    <div class="burger__patty"></div>
  </div>

  <nav class="menu">
    <div class="menu__brand">
      <a href=""><div class="logo"></div></a>
    </div>
    <ul class="menu__list">
      <li class="menu__item"><a href="" class="menu__link">Work</a></li>
      <li class="menu__item"><a href="" class="menu__link">About</a></li>
      <li class="menu__item">
        <a href="https://twitter.com/ettrics" target="_blank" class="menu__link menu__link--social"><i class="fa fa-twitter"></i></a>
      </li>
      <li class="menu__item">
        <a href="http://ift.tt/28XSqi3" target="_blank" class="menu__link menu__link--social">
          <i class="fa fa-dribbble"></i></a>
      </li>
    </ul>
  </nav>
</header>

<main>
  <h1><a href="http://ettrics.com" target="_blank">Ettrics</a></h1>
  <h2>A Full-Screen Menu, showcasing your brand and website navigation.</h2>
  <p class="support">With support for IE10 & latest versions of Chrome, Safari, and Firefox.</p>
</main>

but only have it appear on mobile an tablet screen sizes. Essentially I'm asking is there a way to add this menu and hide it on desktop sized screens.




How to make CSS Reset not affect certain class?

How to make CSS Reset not affect certain class (.content)?

I have tried using

:not(.content){

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

}

but it doesn't work.

I need it in order to make tinyMCE(implemented in javascript) work. It works without the reset. How do I make the reset not affect the .content class ONLY?

Any help is appreciated.




Chrome extension for gumtree

I am interested in making a chrome extension. I am not a developer but I intend to take a fully comprehensive course from something like udemy or pluralsight, before I start taking the course I wanted to know if I would be able to create something exactly like this : http://ift.tt/29kfB83

It is an extension which makes it easy to post and manger ads on a classified ad (gumtree)

I would be grateful if anyone could let me know. How easy or difficult would it be to make something of that sort.

Thanks




bootstrap navbar dropdown menu background not working

To simplify this as much as possible, i am basically adding a bootstrap navbar to a page, one of the tabs has a dropdown menu which has a choice of 5 sub options. I have found that the background is only showing to the bottom of the first sub option. The CSS sets the height to 100% which is what i would like, if i change the CSS to say 500px; it will expand the area.

<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="collapse navbar-collapse" id="myNavbar">
            <ul class="nav navbar-nav">
                <li><a class="active" href="index.html">Home</a></li>
                <li><a class="li" href="whatido.html">What I Do</a></li>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown"    href="#">Travels<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Asia</a></li>
                        <li><a href="#">Europe</a></li>
                        <li><a href="#">Scotland</a></li>
                        <li><a href="#">Other</a></li>
                        <li><a href="#">And Another</a></li>
                    </ul>
                </li>
                <li><a class="li" href="upcomingtrips.html">Upcoming Trips</a></li>
                <li><a class="li"href="aboutme.html">About Me</a></li>
                <li><a class="li" href="gallery.html">Gallery</a></li>
                <li><a class="li" href="contactpage.html">Contact</a></li>
            </ul>
        </div>
    </div></nav>
</nav>

the css for the dropdown is simple

  .dropdown-menu {
      height:100%;
}

the result :

adjustable size however if i change the css to

  .dropdown-menu {
      height:300px;
}

i get this result

fixed size Im struggling to understand why the 100% option doesn't cover the entire area when each sub option is included in the 'dropdown-menu' ul class?




Editing the CSS File in a Start Bootstrap Theme

I recently downloaded the Creative Theme from Start Bootstrap Theme and I want to edit the creative.css file. However the changes don't show on index.html. Why?

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>Creative - Start Bootstrap Theme</title>

<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">

<!-- Custom Fonts -->
<link href='http://ift.tt/1iRqzRT' rel='stylesheet' type='text/css'>
<link href='http://ift.tt/290O90o' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">

<!-- Plugin CSS -->
<link rel="stylesheet" href="css/magnific-popup.css" type="text/css">

<!-- Custom CSS -->
<link rel="stylesheet" href="css/creative.css" type="text/css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
    <script src="http://ift.tt/1fK4qT1"></script>
    <script src="http://ift.tt/1knl5gY"></script>
<![endif]-->




How to handle .net dll event in a web page?

I have a .net dll that generates an event. The event always returns a number. I want to dynamicaly view the number on web page, updating every time the value changes. How can I acomplish that? What should I use? html, ajax, javascript?




how to get the content of an embedded browser in my web application

I have an project that an IE browser is embedded in my web page. The embedded IE is operated by someone to download a file and also display a web page. How can I get the file content & web page content automatically once the embedded IE has done its work?

Thanks & regards,
Charlie




Why do HTML elements have built-in margins and paddings

Ok... so this is a thing that has bothered me for quite a while. If you've used CSS or HTML you probably know that elements like header/body/div/p... etc have built in properties, out of which one of the most annoying ones is default margins and padding. Which in turn make us revert to things like: *{margin:0, padding:0} Which in turn leads to decreased performance and certain buttons shape breaking.

So I come here asking this question:

Is there a reason(or reasons) why normal html elements don't just come as a "clean slate" but rather have built in properties to traumatize and annoy users ?




(W10) Register application to manage phone numbers in web browsers (like skype)

I need to register my app coded in c# on (at least) Windows10, in order to make it elegible to open URLs that are phone numbers on web browsers (preferably Chrome). If i'm not wrong, skype does/did it. Anyone knows how to do it?

Best regards and thanks in advance :)




header() in php not working

I have developed a php web app which makes use of header() function of php . For instance, when a user is logged in, the website should redirect to homepage. This works perfectly while testing the site on my local computer using xampp server , but when i try to access the site using its domain name, it does not redirect to homepage . This is the code I have used :

$querry = "select * from user where email= '$email' and pass= '$pass'";
    $result = mysql_query($querry);
    if(mysql_num_rows($result)!=0){
       $row = mysql_fetch_row($result);
        $_SESSION['user'] = $row[0];
        $_SESSION['email'] = $row[1];
        $_SESSION['pass'] = $row[2];
        $_SESSION['id'] = $row[3];
        $_SESSION['last_name'] = $row[4];
        $_SESSION['dp'] = $row[5];
        header("Location: index.php");
    }else
        $wrong_cred = true;

    }
}
if($wrong_cred){
    echo("<div class='pageBegin'><p><h1>Wrong User name or Password></h1></p></div>");

}




lundi 27 juin 2016

.toDataURL() is saving transparent image instead of actual image

toDataURL() is saving the black overlay/background, that is drawn on canvas; but not the image drawn on the same canvas through a link. If I only draw an image and try to save it as an image, the transparent image is saved...

I have researched many thing but nothing worked in my case. Please help!

Image link: http://ift.tt/294ua2S;gda=1477014978_08b04c9b05ec32ad5122bf747e5ef066

I have attached an image for better understanding... enter image description here

Here is the code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ift.tt/kkyg93">
    <html xmlns="http://ift.tt/lH0Osb">
     <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        <style>
        </style>
    </head>
    <body>

    <?php
    $user=$_POST['h'];
    ?>

    <canvas id="can" width=250 height=250 ></canvas>

     <script type="text/javascript">

        //first canvas
        var c = document.getElementById('can');
         c.setAttribute('crossOrigin','anonymous');
        var ctx = c.getContext("2d",{preserveDrawingBuffer: true});

        var img = new Image();
         img.addEventListener("load", function() {
            ctx.drawImage(img, 0, 0);
        }, false);
        img.src = '<?php echo $user ?>';

        ctx.globalCompositeOperation = "source-over";

        ctx.fillStyle = "rgba(0,0,0,0.5)";
        ctx.fillRect(0,0,c.width,c.height);

        var sent = convertToImg(c);
        document.body.appendChild(sent);
        console.log(sent);

        function convertToImg(imgc) {

            var img = new Image;
            img.src = imgc.toDataURL("image/png");
            return img;

        }


    </script>
    </body>
    </html>




Why does youtube hash or encode its video ids in the url?

-Why one should do that? is it for faster search? -what is the database design for storing hashed video ids (making index and set them as primary key?)




How can I run a simple app on my localhost with database integration?

For some context, I'm having a party and it needs a scoring system for teams. So I've got a database and running which can store the score and the team ID, but I want to host a little app so that people (from their phones) can go to 127.0.0.1 in their browser and it will show up. Do I need a server to do this? If so, can someone point me in the right direction? Thanks.

I can write the HTML/CSS/JS app myself, but it's the access I need help with.




Third Party PDF/TIFF Edit Control to go on Webpage

Greetings fellow Stack Overflow Contributors.

Client is asking for something very specific. They want their field engineers to be able to upload PDF files or TIFF images into a web page that we are putting together for them.

Subsequently, they would their field engineers to be able to perform some edit operations on the PDF/TIFF within the webpage.

I am seeking your input in case you are aware of such a third party control and provide an estimate on the price. I made my client aware that the ability to modify PDF such as PDF Distiller product is generally not free so they have a budget in for this control. Below is a summary of the capabilities they would like:

  1. Tool bar contains icons and functionality for

    1. Single page view / thumbnail view
    2. Paging
    3. Zooming
  2. Rotating Pages & Scale

    1. Can pan/rotate/resize/move an image that is not aligned correctly within the margins
    2. Format of tiff files stays the same
    3. Save changes
  3. Applying Border Overlay

    1. Image will be displayed to the submitter with a border around it based on accurate border requirements for the state/county the image will be recorded in based on the margin requirements stored in the database
    2. A ruler representing inches is available and can be turned on/off
  4. Erase Blemishes

    1. Able to erase blemishes
    2. Eraser tool is able to be sized to cover larger or smaller corrections
    3. Able to undo last step
    4. Able to cancel all work
    5. Able to save all work
  5. Deskew

    1. Ability to correct a skewed image and save. Needs to work on both page and document level.
  6. Undo/Reset

    1. Undo a change
    2. Reset all changes ->reload original image

I look forward to receiving all your feedback and anticipate that there are multiple controls that do the job here so what I have to do is research all and present my research as to pros/cons of each and of course cost which is always a factor.




Position div off screen to the top and only show specific height of bottom portion of the div

Is there any CSS only solution to position a dynamic height div off the screen to the top and only show a fixed height bottom portion of it on the screen?

See image for a clear explanation: enter image description here

I know this can be done using javascript by simply getting the height of the div and then setting the "top" property to negative height of the div + the height of the portion to be visible, but I am looking for a non JS solution.




Web: How to play audio files one after the other without a delay ?

I have urls of several audio files like this:

http://ift.tt/293u36f

And I would like to play them one after the other without a delay between them.

I tried having two audio elements with preload=true and switching between them, but I still have a delay.

Any ideas ?




Web: How to play audio files one after the other without a delay ?

I have urls of several audio files like this:

http://ift.tt/293u36f

And I would like to play them one after the other without a delay between them.

I tried having two audio elements with preload=true and switching between them, but I still have a delay.

Any ideas ?




Web Development receiving user data

I would like to create a form using HTML and once the user presses a "submit" button on the web, I can somehow view their results? how would I do that in java. I understand that I would need HTML and CSS to create the front end, but how would I deal with the backend? Thank you all so much




When is HTTPS not sufficient for securing SOAP Web service traffic?

Got this question today and spent all day searching any information on it. No luck. Maybe some of you can explain to me when it's not sufficient?




Recommendation Technology Stack for my Project

I am trying to make a crowd funding platform that include every basic operations from signups,security to transactions and product review. Can someone please tell what technology should i use,which are the latest trends going on in terms of robust and easy code usability. I have around 1 month learning curve before i actually start working on it. I am newbie to software development. All advises are highly Appreciated. Regards.