byobu-enable-prompt
Disable prompt
byobu-disable-prompt
sub handler {
my ($i_request_rec) = @_;
@{$i_request_rec->pnotes}{'err_txt', 'err_content_type'} = ('appid=45465&status=-42', 'application/x-www-form-urlencoded; charset=utf-8');
$i_request_rec->custom_response(Apache2::Const::SERVER_ERROR, '/error_vas/');
return Apache2::Const::SERVER_ERROR;
}
Apache conf.:
<Location /error_vas/>
SetHandler perl-script
PerlResponseHandler Toto::ErrorVas
</Location>
ErrorVas.pm:
package Toto::ErrorVas;
use strict;
use warnings;
use Apache2::Const -compile => qw(:common :log);
sub handler {
my ($i_request_rec) = @_;
return Apache2::Const::NOT_FOUND unless $i_request_rec->prev;
$i_request_rec->content_type($i_request_rec->prev->pnotes->{err_content_type});
$i_request_rec->print($i_request_rec->prev->pnotes->{err_txt});
return Apache2::Const::OK;
}
source: http://foertsch.name/ModPerl-Tricks/custom-content_type-with-custom_response.shtml
perl -MData::Dumper -e '@{$h}{qw/toto tata/} = (34, 56); print Dumper $h;'
$VAR1 = {
'tata' => 56,
'toto' => 34
};
local @LWP::Protocol::http::EXTRA_SOCK_OPTS = (
PeerAddr => $my_hostname,
MultiHomed => 1,
);
my $ua = LWP::UserAgent->new;
my $response = $ua->post("https://$my_hostname/action",
Content_Type => 'application/x-www-form-urlencoded; charset=utf-8',
Content => {
param1 => 'value1',
param2 => 'value2',
});
$a = '.63';
echo (float) $a;
source: http://stackoverflow.com/questions/4284571/php-oci-oracle-and-default-number-format
REGEXP_REPLACE(TO_CHAR(x), '^\.', '0.')or if we handle negative numbers
REGEXP_REPLACE(TO_CHAR(x), '(-?)^\.', '\10.')
<td> <input type="checkbox" name="cb[]"/> <input type="checkbox" name="cb[]"/> </td>
<td> <input type="hidden" name="cb[0]" value=""/> <input type="checkbox" name="cb[0]"/> <input type="hidden" name="cb[1]" value=""/> <input type="checkbox" name="cb[1]"/> </td>
<td> <input type="checkbox" name="cb[0]"/> <input type="checkbox" name="cb[1]"/> </td>
$post_array = $_POST['cb'];
$defaults = array_fill(0, 2, '0');
$post_array = $post_array + $defaults;