Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

March 10 2010

rogeriopvl

Answer by rogeriopvl for Delete empty values from form's params before submitting it

The inputs with attribute disabled set to true won't be submitted with the form. So in one jQuery line:

$(':input[value=""]').attr('disabled', true);

March 08 2010

rogeriopvl

Answer by rogeriopvl for How to create expandable FAQ page in HTML?

Simple example using jQuery:

CSS

.content {
    display: hidden;
}

HTML

<h2>My FAQ</h2>
<a class="faqlink" href="#">Link 1</a>
<div class="content">lorem ipsum</div>
<a class="faqlink" href="#">Link 2</a>
<div class="content">lorem ipsum</div>
<a class="faqlink" href="#">Link 3</a>
<div class="content">lorem ipsum</div>

Javascript/jQuery

$(document).ready(function(){
    $('.faqlink').click(function(){
        $('.content').hide();
        $(this).next('.content').show();
    });
});
rogeriopvl

Answer by rogeriopvl for In Python, can I single line a for loop over iterator with an IF filter?

Using list comprehension (only if airports is a list of objects):

for airport in [a for a in airports if a.is_important]:
rogeriopvl

Answer by rogeriopvl for Where to sanitize PHP $_POST[] input ?

The controller is like the application gatekeeper, so it should be where you validate all inputs.

rogeriopvl

Answer by rogeriopvl for Display processing page then redirect when complete

That sounds like a Javascript/Ajax task.

Ajax calls are asynchronous, and this makes them ideal for what you are trying to achieve.

You send the form content through an ajax request and then manipulate the DOM of the page to show something like a loading bar while the request is taking place. When the request finishes you can then manipulate the DOM again to show the result of the form processing, or redirect to a new page with that info.

March 07 2010

rogeriopvl

March 05 2010

rogeriopvl

Answer by rogeriopvl for reading logs in google app engine

The logs are not meant to control site visits. For that you should use google analytics.

rogeriopvl

Answer by rogeriopvl for How to run a PHP script continuously on webhost?

Most of the hosting companies have a time limit for scripts to run. So an infinite loop will not work, or will get your account suspended.

cronjobs are the best way to do it. Just set the script to run in a time interval of your choice and make sure that it doesn't take too long finish execution.

March 04 2010

rogeriopvl

March 03 2010

rogeriopvl

Answer by rogeriopvl for Java playing sounds. Is there a default system sound?

You can:

Print the ASCII bell character to the console (will emit a beep sound):

public class DoBeep {
    public static main(String args[]) {
        System.out.print("\007"); // bell ASCII char
        System.out.flush();
    }
}

Use the beep() method that will use the buzzer on the motherboard:

import java.awt.*;

public class DoBeep {
    public static void main(String args[]) {
        Toolkit.getDefaultToolkit().beep();     
    }
}

March 02 2010

rogeriopvl

Answer by rogeriopvl for How check if an email address is fake ?

There's no way to know if an email address is fake.

But you can:

  • Check if the address domain exists
  • Send an email to the address with a confirmation key to be returned

March 01 2010

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.