The present invention permits a JavaScript-based Remote Procedure Call (RPC) to be executed from a Web page displayed in a Web browser window, without utilizing browser plug-in, Java Applet, or ActiveX technology. Traditionally, clunky downloads and Web browser plug-ins has been required to enable Web page interactivity, which greatly compromises the performance and reach of the Web page. Based purely on HTML and JavaScript, the present invention utilizes the HTML <script> element to pass data to the server and execute a remote procedure, receiving the resulting output to the same displayed Web page. The present invention can be used to build a lightweight Web page that offers real-time data and interactivity.
The Script Tag Hack is a great hack and my hats are off they found the hack in 2001. But a patent? Now it's my jaw's turn to drop. That's a hack. No more, no less. Neither invension nor innovation that deserves a patent.
If any given creative use of un(known|documented) features can be patented, why not JAPH?
Dan the Just Another Patent Violator(?)
I had a chance to benchmark various PerlIO layers. The result was striking.
Benchmarking code:
use strict;
use warnings;
use Benchmark qw(timethese cmpthese);
our $test_file = 'test.txt';
# 64 chars including LF;
my $test_line = join '', ( '0'.. '9', 'A' .. 'Z', 'a' .. 'z', '_', "\n" );
sub make_test_file {
my $kb = shift; # size in KB
my $block = $test_line x 16; # 1024 bytes;
my $fh;
open $fh, ">:raw", $test_file or die "$test_file:$!";
print {$fh} $block for ( 1.. $kb );
close $fh;
# slurp once to make sure the file buffer is in effect;
open $fh, "<:raw", $test_file or die "$test_file:$!";
my $content = do { local $/; <$fh> };
close $fh;
}
sub make_tester {
my $layer = shift;
my $openarg = $layer ? "<:$layer" : "<";
sub {
open my $fh, $openarg, $test_file or die "$test_file:$!";
$_ ne $test_line and die while (<$fh>);
close $fh;
}
}
my %these = map { $_ => make_tester($_) } qw( raw perlio mmap );
$these{nolayer} = make_tester(q());
for my $filesize ( map { 4**$_ } ( 0.. 4 ) ) {
make_test_file($filesize);
print "#### Testing for $filesize KB Read\n";
cmpthese( timethese( 0, \%these ) );
}
delete $these{raw}; # because this guy is too slow on large files!
for my $filesize ( map { 4**$_ } ( 5.. 8 ) ) {
make_test_file($filesize);
print "#### Testing for $filesize KB Read\n";
cmpthese( timethese( 0, \%these ) );
}
__END__
The result on my MacBook Pro:
#### Testing for 1 KB Read
Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...
Rate raw mmap perlio nolayer
raw 213/s -- -95% -98% -98%
mmap 4492/s 2007% -- -55% -64%
perlio 10088/s 4632% 125% -- -19%
nolayer 12488/s 5758% 178% 24% --
#### Testing for 4 KB Read
Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...
Rate raw mmap perlio nolayer
raw 55.7/s -- -99% -99% -99%
mmap 3722/s 6578% -- -42% -49%
perlio 6375/s 11338% 71% -- -13%
nolayer 7305/s 13008% 96% 15% --
#### Testing for 16 KB Read
Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...
Rate raw mmap perlio nolayer
raw 13.5/s -- -99% -99% -99%
mmap 1849/s 13550% -- -25% -30%
perlio 2469/s 18123% 34% -- -7%
nolayer 2649/s 19455% 43% 7% --
#### Testing for 64 KB Read
Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...
Rate raw mmap perlio nolayer
raw 3.53/s -- -99% -100% -100%
mmap 693/s 19567% -- -10% -14%
perlio 767/s 21651% 11% -- -5%
nolayer 810/s 22872% 17% 6% --
#### Testing for 256 KB Read
Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...
Rate raw perlio nolayer mmap
raw 0.937/s -- -99% -100% -100%
perlio 187/s 19804% -- -4% -6%
nolayer 194/s 20582% 4% -- -2%
mmap 198/s 21062% 6% 2% --
#### Testing for 1024 KB Read
Benchmark: running mmap, nolayer, perlio for at least 3 CPU seconds...
Rate perlio nolayer mmap
perlio 46.8/s -- -5% -11%
nolayer 49.2/s 5% -- -7%
mmap 52.8/s 13% 7% --
#### Testing for 4096 KB Read
Benchmark: running mmap, nolayer, perlio for at least 3 CPU seconds...
Rate perlio nolayer mmap
perlio 12.4/s -- -4% -4%
nolayer 12.9/s 4% -- -1%
mmap 13.0/s 4% 1% --
#### Testing for 16384 KB Read
Benchmark: running mmap, nolayer, perlio for at least 3 CPU seconds...
Rate perlio nolayer mmap
perlio 2.96/s -- -5% -6%
nolayer 3.11/s 5% -- -1%
mmap 3.14/s 6% 1% --
#### Testing for 65536 KB Read
Benchmark: running mmap, nolayer, perlio for at least 3 CPU seconds...
s/iter perlio mmap nolayer
perlio 1.35 -- -8% -8%
mmap 1.25 8% -- -0%
nolayer 1.24 9% 0% --
no layer being the fastest is no surprise for me. It's synonym for
Dan the Just Another Perl Benchmarker
Sometimes rant is good. Things started moving at last.
Both Encode and Jcode is now officially registered. And MERCEL finally responded.
This time I fell victim but I know only too well I am the one who victimize my fellows by neglecting them. If that happens to you, plese don't hesitate to yell at me.
After all we are all busy and no one can respond to every single message received. And sometimes thoese messages are not received by network errors, spam filters, and such. As a matter of fact my mail server receives 120-150 thousand SMTP connections, mostly from infected PCs. My mail filters (yes, plural) are pretty good but they are not perfect.
Thank you for your patience and thank you too for your impatience. We definitely need both.
Dan the Responded CPAN Author
CPAN Authors and Perl Porters,
I recently came across two cases of namespace squatting.
Case: Attribute::Memoize
That was taken by MARCEL but the module is missing. I guess MARCEL deleted Attribute::Memoize in favor of Attribute::Util which has the same functionality. But I don't like the idea of grab-bagging of multiple Attribute handlers in a single module so I mailed him what he wants to do with it. The mail was sent on April 8th and I got no reponse since then.
Case: Crypt::Camellia
That module does Camellia cipher for Crypt::CBC. The algorithm became open source only recently (April 13th) so it is almost impossible that the name space be registered by someone else. But it is registered by JCDUQUE. It is registered as RcdOg but once again the module itself is missing (naturally). Since JCDUQUE has registered Many Crypt:: modules, he did so assuming it will soon be available.
I now have a very strong doubt of module registration system. Do we really need that? And who and how the registration be processed is in the haze. I have requested to register Encode and Jcode before. Encode is even in core but those requests were simply ignored.
http://search.cpan.org/ seems to be taking more practical approach. Just index whatever does REALLY exist. So Attribute::Memoize and Crypt::Camellia belongs to me from its point of view. But once you fire up CPAN shell, it's registration that has te precedence.
I want some action be taken.
Dan the Foresaken by CPAN
To punish me for my contempt of Google, Fate has made me a Summer of Code Mentor myself.
For those who are not subscribed to p6l or p5p.
[April 1st, 2006, 00:00 GMT+9]
Larry Wall and Audrey Tang jointly announced that Parrot, Pugs, and all language-related projects be dysintegrated to Bugs. Bugs have ruled this planet for half a billion years and they shall do so for for years to come. Beats heck out of avians, mammals, reptiles or gems.
Their Manifesto is now available at
http://blog.livedoor.jp/dankogai/mov/lamdaorz.mov
Stay tuned!
Dan the Deranged, Infested, and Undefined, Reporting Live from Triassic
Not only perl hackers but also the rest of hackers seem to make too much fun of PHP. That was so true that in YAPC::Asia even Matz and Larry was making fun of that (well, Larry made fun of every computer languages including perl but PHP part was the most horrendous).
I felt sorry for PHP folks so I came up with this. Ingy's Module::Compile made it so spiffy.
#!/usr/local/bin/perl
use strict;
use warnings;
use Inline::PHP;
<?php echo "Hello, PHP\n" ?>
no Inline::PHP;
print "Hello, rest of the world!\n";
prints
Hello, PHP!
Hello, rest of the world!
And here is the module.
package Inline::PHP;
use 5.008001;
use strict;
use warnings;
our $VERSION = '0.01';
use Module::Compile -base;
sub pmc_compile {
my ($class, $html) = @_;
$html =~ s/no\s+$class\s*.*;\n//o;
open my $php, "|-" or exec 'php' or die $!;
print {$php} $html;
close $html;
return q();
}
1;
__END__
<?php echo "Enjoy!" ?>
Dan the Lambdaorz
My friend Takesako-san has come up with a wonderful hack called ppencode at LLDN2005.
In response to that, a ruby hacker came up with rrencode which turns a given data into a ruby script that consists entirely of symbols -- no alphabet whatsoever.
Now I wonder if we could do that in perl. But perl does not have ruby's $><< which does print. Even Acme::EyeDrops makes use of eval. The best approximation I came up with was build the string and feed it to s//$_/e but even that contains an 's' and 'e'. Any idea?
Dan the Code Obfuscunator