[30922] in Perl-Users-Digest
Perl-Users Digest, Issue: 2167 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 28 06:09:42 2009
Date: Wed, 28 Jan 2009 03:09:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 28 Jan 2009 Volume: 11 Number: 2167
Today's topics:
How to extract Arabic Text from PDF file <mirzashahidmahmood@gmail.com>
Re: How to extract Arabic Text from PDF file <RedGrittyBrick@spamweary.invalid>
Re: inputting the ephemerides <larry@example.invalid>
Re: inputting the ephemerides <larry@example.invalid>
Re: Is syswrite faster or print <xhoster@gmail.com>
Re: Is syswrite faster or print <xhoster@gmail.com>
Re: Is syswrite faster or print <saurabh.hirani@gmail.com>
Re: Is syswrite faster or print <saurabh.hirani@gmail.com>
new CPAN modules on Wed Jan 28 2009 (Randal Schwartz)
problem using memoize in folder where a module Config.p <michaelgang@gmail.com>
Re: Vista x64 + DBD::Pg driver <psynowiec@WYTNIJTOop.pl>
Re: Which is faster - hash or array lookup <xhoster@gmail.com>
Re: Which is faster - hash or array lookup <burner+usenet@imf.au.dk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 27 Jan 2009 23:11:33 -0800 (PST)
From: Shahid <mirzashahidmahmood@gmail.com>
Subject: How to extract Arabic Text from PDF file
Message-Id: <5d403257-5bc2-4da4-b972-26adef43cced@y1g2000pra.googlegroups.com>
Dear All,
Hi,
I am doing following task in PHP....
I am using pdftotext command line utility of xpdf package for Windows
and Linux. It successfully extracts English text from PDF files. Now I
need to extract Unicoded Arabic text from PDF files. For this, I
tried:
"pdftotext -enc UTF-8 arabicFile.pdf arabicFile.txt"
If I remove -enc switch/parameter, there is empty space in place of
Arabic text, but English text is extracted from PDF. With -enc UTF-8,
some Arabic characters/alphabet s are extracted from PDF, but the
complete Arabic text is not extracted. I also have downloaded and
installed the xpdf-Arabic package from internet. I couldn't get the
required result i.e. Arabic Text from PDF.
Can anyone help on urgent basis? How to configure xpdf-Arabic or some
other way???
SHAHID MAHMOOD
------------------------------
Date: Wed, 28 Jan 2009 09:57:57 +0000
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: How to extract Arabic Text from PDF file
Message-Id: <49802c28$0$30307$da0feed9@news.zen.co.uk>
Shahid wrote:
> Dear All,
> Hi,
> I am doing following task in PHP....
This is a Perl newsgroup not a PHP newsgroup.
> I am using pdftotext command line utility of xpdf package for Windows
> and Linux. It successfully extracts English text from PDF files. Now I
> need to extract Unicoded Arabic text from PDF files. For this, I
> tried:
>
> "pdftotext -enc UTF-8 arabicFile.pdf arabicFile.txt"
>
> If I remove -enc switch/parameter, there is empty space in place of
> Arabic text, but English text is extracted from PDF. With -enc UTF-8,
> some Arabic characters/alphabet s are extracted from PDF, but the
> complete Arabic text is not extracted. I also have downloaded and
> installed the xpdf-Arabic package from internet. I couldn't get the
> required result i.e. Arabic Text from PDF.
>
> Can anyone help on urgent basis?
http://www.catb.org/~esr/faqs/smart-questions.html#urgent
> How to configure xpdf-Arabic
http://www.catb.org/~esr/faqs/smart-questions.html#forum
> or some other way???
"The Java edition of Aspose.Pdf.Kit supports extracting Arabic text from
PDF file."
I've no experience of this product. I expect Google will find many others.
--
RGB
------------------------------
Date: Tue, 27 Jan 2009 22:29:54 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: inputting the ephemerides
Message-Id: <1nijuk9l7sbfd$.6xuj2vmlx9n6$.dlg@40tude.net>
On Mon, 26 Jan 2009 20:47:59 -0700, Larry Gates wrote:
> s[0] = Moon
> s[1] = 21
> s[2] = 10
> s[3] = 19
> s[4] = -15
> s[5] = 43.1
> s[6] = 62.6
> s[7] = ER
> s[8] = -3.535
> s[9] = 73.245
> s[10] = Set
I'm disappointed with the tone that this thread has assumed and believe
I've overstayed my welcome. The above shows why, in my opinion, there had
to be two stages of evaluation. This script is my solution.
#!/usr/bin/perl
# by larry gates; contributors from c.l.p.misc with gratitude
# data from http://www.fourmilab.ch/yoursky/
use strict;
use warnings;
# open input file
my $filename = 'eph9.txt';
open(my $fh, '<', $filename) or
die "cannot open $filename for reading: $!";
# open output file
my $filename2 = 'outfile12.txt';
open(my $gh, '>', $filename2) or
die "cannot open $filename2 for writing: $!";
# process all lines in input file
while( my $line = <$fh> ) {
chomp($line);
# get rid of , + and ER
$line =~ s/ER//g;
$line =~ s///g;
$line =~ s/\+//g;
my @s = split /\s+/, $line;
# modify fields
$s[1] =~ s/h//;
$s[2] =~ s/m//;
$s[3] =~ s/s//;
$s[5] =~ s/'//;
my $outline = join(' ', @s);
print $gh "$outline\n";
}
close($gh);
close($fh);
__END__
# perl reg16.pl
--
larry gates
I'm not consistent about consistency, you see, except when I am...
And I try to believe six foolish consistencies before breakfast each day.
:-)
-- Larry Wall in <20050307164019.GA14585@wall.org>
------------------------------
Date: Tue, 27 Jan 2009 22:35:46 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: inputting the ephemerides
Message-Id: <pdr878rjoqvb.l4yz65zf6u7o.dlg@40tude.net>
On Tue, 27 Jan 2009 17:07:03 -0800, Jim Gibson wrote:
[snipped and re-ordered]
> Perl is much better suited for this type of
> task than Fortran (I have coded in both). Sticking with Perl and
> learning enough Perl to do this job would make you a better programmer.
> However, they may not be your goal.
This is exactly the type of stuff that perl does better than compiled
languages. I'd continue if I weren't going to get flamed and shown the
door.
> Well in fact you didn't do it at all. I and several other people had to
> write the code for you.
Horseshit.
C:\MinGW\source>dir *.pl
Volume in drive C has no label.
Volume Serial Number is 942A-AD55
Directory of C:\MinGW\source
01/11/2009 01:35 PM 538 faulk1.pl
01/11/2009 01:33 PM 178 faulk10.pl
01/20/2009 06:02 PM 323 faulk11.pl
01/20/2009 07:06 PM 328 faulk12.pl
01/20/2009 08:31 PM 288 faulk13.pl
01/21/2009 12:17 PM 447 faulk14.pl
01/20/2009 11:12 PM 180 faulk15.pl
01/21/2009 05:25 PM 491 faulk16.pl
01/22/2009 11:16 PM 578 faulk17.pl
01/22/2009 11:35 PM 631 faulk18.pl
01/23/2009 12:01 AM 810 faulk19.pl
01/11/2009 01:38 PM 244 faulk2.pl
01/09/2009 07:49 PM 228 faulk3.pl
01/11/2009 01:43 PM 322 faulk4.pl
01/11/2009 01:24 PM 172 faulk5.pl
01/11/2009 01:23 PM 176 faulk6.pl
01/11/2009 01:26 PM 126 faulk7.pl
01/11/2009 01:29 PM 112 faulk8.pl
01/11/2009 01:30 PM 146 faulk9.pl
01/15/2009 05:19 PM 372 larry1.pl
01/15/2009 05:55 PM 409 larry2.pl
01/23/2009 09:32 PM 437 reg1.pl
01/26/2009 03:36 PM 896 reg10.pl
01/26/2009 05:11 PM 910 reg11.pl
01/26/2009 06:26 PM 917 reg12.pl
01/26/2009 07:59 PM 848 reg13.pl
01/26/2009 08:36 PM 878 reg14.pl
01/27/2009 02:04 PM 967 reg15.pl
01/27/2009 10:12 PM 841 reg16.pl
01/25/2009 04:04 PM 600 reg2.pl
01/25/2009 04:06 PM 557 reg3.pl
01/26/2009 12:42 PM 661 reg4.pl
01/25/2009 04:21 PM 579 reg5.pl
01/25/2009 04:23 PM 579 reg6.pl
01/25/2009 04:55 PM 581 reg7.pl
01/26/2009 02:36 PM 554 reg8.pl
01/26/2009 02:50 PM 696 reg9.pl
01/22/2009 08:12 PM 1,074 rgb1.pl
01/22/2009 10:55 PM 388 rgb2.pl
01/07/2009 07:27 PM 2,203 scraper1.pl
12/12/2008 07:24 PM 1,905 script1.pl
12/15/2008 11:39 PM 2,017 script2.pl
12/16/2008 08:54 PM 2,157 script3.pl
12/09/2008 03:07 AM 1,080 sln1.pl
12/12/2008 06:28 PM 954 sln2.pl
12/14/2008 06:49 PM 72 tad1.pl
01/23/2009 12:38 AM 418 tad2.pl
01/23/2009 04:08 PM 363 tad3.pl
01/23/2009 09:14 PM 398 tad4.pl
01/23/2009 09:28 PM 437 tad5.pl
01/20/2009 11:08 PM 2,436 van1.pl
01/24/2009 04:24 PM 2,498 van2.pl
66 File(s) 58,944 bytes
0 Dir(s) 68,327,882,752 bytes free
C:\MinGW\source>
--
larry gates
If this were Ada, we'd simply doc it as "erroneous".
-- Larry Wall in <199809111734.KAA28296@wall.org>
------------------------------
Date: Tue, 27 Jan 2009 18:50:28 -0800
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Is syswrite faster or print
Message-Id: <497ff137$0$31458$ed362ca5@nr5c.newsreader.com>
saurabh hirani wrote:
>
>
> I was running a VM so I know that my profiling wouldn't be so
> accurate.
If you are running on VM, then why would profiling on VM not be accurate?
> But still, I had done autoflush for both syswrite and print.
> Is print this faster than syswrite? Is my testing flawed? Am I missing
> something?
In the code you showed us, you were only autoflushing STDOUT, which
is not the filehandle that either syswrite or print were writing to.
> What would you use if you had to write a logging module in
> perl - print or syswrite? and why?
I'd probably just use of the already existing ones.
Xho
------------------------------
Date: Tue, 27 Jan 2009 21:50:50 -0800
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Is syswrite faster or print
Message-Id: <497ff296$0$31457$ed362ca5@nr5c.newsreader.com>
saurabh hirani wrote:
>> print does buffered output while syswrite is direct. That
>> is the reason for both the performance difference and the
>> non-overlapping behavior.
>
> Does print do buffered output even after autoflush is on? I have added
> $| = 1 in the beginning of my code.
$| only effects the *currently selected* file handle.
Xho
------------------------------
Date: Tue, 27 Jan 2009 23:50:53 -0800 (PST)
From: saurabh hirani <saurabh.hirani@gmail.com>
Subject: Re: Is syswrite faster or print
Message-Id: <bbf2f956-f1fe-432d-8d7f-55df7b22878b@r37g2000prr.googlegroups.com>
On Jan 28, 7:50=A0am, Xho Jingleheimerschmidt <xhos...@gmail.com> wrote:
> saurabh hirani wrote:
>
> > I was running a VM so I know that my profiling wouldn't be so
> > accurate.
>
> If you are running on VM, then why would profiling on VM not be accurate?
I wrote it the wrong way. It doesn't sound the way it should. I meant
that as I was running a VM, I may not have the right amount of fire
power to verify my tests and due to load on my host the VM might run
slow at times and degrade to the speed of the program.
>
> I'd probably just use of the already existing ones.
>
I didn't understand that.
------------------------------
Date: Tue, 27 Jan 2009 23:53:26 -0800 (PST)
From: saurabh hirani <saurabh.hirani@gmail.com>
Subject: Re: Is syswrite faster or print
Message-Id: <cc9c0e2c-3021-4d70-91ed-1c74e802dd23@v39g2000pro.googlegroups.com>
> $| only effects the *currently selected* file handle.
Thanks for pointing that out. I made a similar post on perlmonks and
got this reply from the user ikegami:
$| = 1; only affects STDOUT, not FILE. That accounts for the speed
difference and the clobbering.
Add FILE->autoflush(1); after the open statement. (Don't forget to use
use IO::Handle;) to bring print inline with syswrite.
------------------------------
Date: Wed, 28 Jan 2009 05:42:25 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Jan 28 2009
Message-Id: <KE62Ip.1FBF@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Apache2-WURFLFilter-1.4
http://search.cpan.org/~ifuschini/Apache2-WURFLFilter-1.4/
is a Apache Mobile Filter that manage content (text & image) to the correct mobile device
----
App-Sequence-0.01_02
http://search.cpan.org/~kimoto/App-Sequence-0.01_02/
useful plaggable subroutine engine.
----
App-Sequence-0.01_03
http://search.cpan.org/~kimoto/App-Sequence-0.01_03/
useful plaggable subroutine engine.
----
App-Sequence-0.01_04
http://search.cpan.org/~kimoto/App-Sequence-0.01_04/
useful plaggable subroutine engine.
----
App-Textcast-0.01_01
http://search.cpan.org/~nkh/App-Textcast-0.01_01/
Light weight text casting
----
Biblio-COUNTER-0.09
http://search.cpan.org/~nkuitse/Biblio-COUNTER-0.09/
COUNTER Codes of Practice report processing
----
Bio-Graphics-1.84
http://search.cpan.org/~lds/Bio-Graphics-1.84/
Generate GD images of Bio::Seq objects
----
CatalystX-CRUD-YUI-0.015
http://search.cpan.org/~karman/CatalystX-CRUD-YUI-0.015/
YUI for your CatalystX::CRUD view
----
Class-Attribute-0.02
http://search.cpan.org/~deepfryed/Class-Attribute-0.02/
Another way to define class attributes!!!
----
Class-Attribute-0.021
http://search.cpan.org/~deepfryed/Class-Attribute-0.021/
Another way to define class attributes!!!
----
Class-LazyFactory-0.01
http://search.cpan.org/~dtady/Class-LazyFactory-0.01/
Base class factory for lazy-loaded concrete classes
----
Class-OWL-0.0.6
http://search.cpan.org/~leifj/Class-OWL-0.0.6/
Generate perl classes from OWL schema
----
Config-Model-Backend-Augeas-0.104
http://search.cpan.org/~ddumont/Config-Model-Backend-Augeas-0.104/
Read and write config data through Augeas
----
Dotiac-0.6
http://search.cpan.org/~maluku/Dotiac-0.6/
----
Dotiac-addon-json-0.1.1
http://search.cpan.org/~maluku/Dotiac-addon-json-0.1.1/
----
EekBoek-1.04.02
http://search.cpan.org/~jv/EekBoek-1.04.02/
Bookkeeping software for small and medium-size businesses
----
Finance-Bank-IE-PermanentTSB-0.08
http://search.cpan.org/~pallotron/Finance-Bank-IE-PermanentTSB-0.08/
Perl Interface to the PermanentTSB Open24 homebanking on <http://www.open24.ie>
----
Finance-Bank-IE-PermanentTSB-0.09
http://search.cpan.org/~pallotron/Finance-Bank-IE-PermanentTSB-0.09/
Perl Interface to the PermanentTSB Open24 homebanking on <http://www.open24.ie>
----
GO-TermFinder-0.83
http://search.cpan.org/~sherlock/GO-TermFinder-0.83/
identify GO nodes that annotate a group of genes with a significant p-value
----
Geo-Format-Landsat-0.01
http://search.cpan.org/~markov/Geo-Format-Landsat-0.01/
----
Geo-Format-Landsat-0.02
http://search.cpan.org/~markov/Geo-Format-Landsat-0.02/
----
Geo-Point-0.90
http://search.cpan.org/~markov/Geo-Point-0.90/
a point on the globe
----
Geo-Proj4-1.01
http://search.cpan.org/~markov/Geo-Proj4-1.01/
PROJ.4 cartographic projections library
----
Glib-Ex-ConnectProperties-4
http://search.cpan.org/~kryde/Glib-Ex-ConnectProperties-4/
link properties between objects
----
HTML-TurboForm-0.33
http://search.cpan.org/~camelcase/HTML-TurboForm-0.33/
----
IWL-0.61
http://search.cpan.org/~viktork/IWL-0.61/
A widget library for the web
----
Lingua-EN-Phoneme-0.01
http://search.cpan.org/~marnanel/Lingua-EN-Phoneme-0.01/
Simple and fast access to cmudict English pronunciation data
----
Modern-Perl-1.02
http://search.cpan.org/~chromatic/Modern-Perl-1.02/
enable all of the features of Modern Perl with one command
----
Module-Build-0.31_02
http://search.cpan.org/~ewilhelm/Module-Build-0.31_02/
Build and install Perl modules
----
MojoX-Session-0.07
http://search.cpan.org/~vti/MojoX-Session-0.07/
Session management for Mojo
----
Net-BitTorrent-0.049_003
http://search.cpan.org/~sanko/Net-BitTorrent-0.049_003/
BitTorrent peer-to-peer protocol class
----
Net-BitTorrent-0.049_004
http://search.cpan.org/~sanko/Net-BitTorrent-0.049_004/
BitTorrent peer-to-peer protocol class
----
Net-LDAP-Class-0.18_02
http://search.cpan.org/~karman/Net-LDAP-Class-0.18_02/
object-relational mapper for Net::LDAP
----
NetHack-Menu-0.06
http://search.cpan.org/~sorear/NetHack-Menu-0.06/
interact with NetHack's menus
----
Osgood-Client-2.0.0
http://search.cpan.org/~gphat/Osgood-Client-2.0.0/
Client for the Osgood Passive, Persistent Event Queue
----
Osgood-Server-2.0.0
http://search.cpan.org/~gphat/Osgood-Server-2.0.0/
Event Repository
----
POE-Component-IRC-5.92
http://search.cpan.org/~bingos/POE-Component-IRC-5.92/
A fully event-driven IRC client module
----
POE-Component-IRC-5.94
http://search.cpan.org/~bingos/POE-Component-IRC-5.94/
A fully event-driven IRC client module
----
POE-Component-Server-IRC-1.38
http://search.cpan.org/~bingos/POE-Component-Server-IRC-1.38/
A fully event-driven networkable IRC server daemon module.
----
POE-Component-SimpleDBI-1.25
http://search.cpan.org/~apocal/POE-Component-SimpleDBI-1.25/
Asynchronous non-blocking DBI calls in POE made simple
----
POE-Component-SmokeBox-Recent-1.06
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Recent-1.06/
A POE component to retrieve recent CPAN uploads.
----
POE-Devel-Benchmarker-0.05
http://search.cpan.org/~apocal/POE-Devel-Benchmarker-0.05/
Benchmarking POE's performance ( acts more like a smoker )
----
POE-Filter-HTTP-Parser-0.06
http://search.cpan.org/~bingos/POE-Filter-HTTP-Parser-0.06/
A HTTP POE filter for HTTP clients or servers
----
RMI-0.03
http://search.cpan.org/~sakoht/RMI-0.03/
Remote Method Invocation with transparent proxies
----
RMI-0.04
http://search.cpan.org/~sakoht/RMI-0.04/
Remote Method Invocation with transparent proxies
----
Roguelike-Utils-0.4.230
http://search.cpan.org/~earonesty/Roguelike-Utils-0.4.230/
----
Roguelike-Utils-0.4.235
http://search.cpan.org/~earonesty/Roguelike-Utils-0.4.235/
----
Scalar-Induce-0.01
http://search.cpan.org/~leont/Scalar-Induce-0.01/
Unfolding scalars
----
Scalar-Induce-0.02
http://search.cpan.org/~leont/Scalar-Induce-0.02/
Unfolding scalars
----
Set-Relation-0.0.2
http://search.cpan.org/~duncand/Set-Relation-0.0.2/
Relation data type for Perl
----
Spreadsheet-Read-0.34
http://search.cpan.org/~hmbrand/Spreadsheet-Read-0.34/
Read the data from a spreadsheet
----
Storable-AMF-0.45
http://search.cpan.org/~grian/Storable-AMF-0.45/
Perl extension for serialize/deserialize AMF0/AMF3 data
----
Syntax-Highlight-Perl6-0.036
http://search.cpan.org/~azawawi/Syntax-Highlight-Perl6-0.036/
Perl 6 Syntax Highlighter
----
Task-POE-All-1.01
http://search.cpan.org/~apocal/Task-POE-All-1.01/
Installs all the modules in the POE::* namespace ( latest version )
----
Term-TermKey-Async-0.02
http://search.cpan.org/~pevans/Term-TermKey-Async-0.02/
perl wrapper around libtermkey for IO::Async
----
Text-CSV_XS-0.60
http://search.cpan.org/~hmbrand/Text-CSV_XS-0.60/
comma-separated values manipulation routines
----
Tie-Array-AsHash-0.11
http://search.cpan.org/~rehsack/Tie-Array-AsHash-0.11/
Like Tie::File::AsHash (now: groundwork for it) but allows any array being source, not just files.
----
Tie-Discovery-1.11
http://search.cpan.org/~audreyt/Tie-Discovery-1.11/
Lazily evaluated "discovery" hashes
----
Unix-Uptime-0.30_01
http://search.cpan.org/~pioto/Unix-Uptime-0.30_01/
Determine the current uptime, in seconds, across different *NIX architectures
----
XML-TinyXML-0.09
http://search.cpan.org/~xant/XML-TinyXML-0.09/
Little and efficient Perl module to manage xml data.
----
ZConf-Cron-0.0.1
http://search.cpan.org/~vvelox/ZConf-Cron-0.0.1/
Handles storing cron tabs in ZConf.
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Wed, 28 Jan 2009 00:06:36 -0800 (PST)
From: david <michaelgang@gmail.com>
Subject: problem using memoize in folder where a module Config.pm is
Message-Id: <ca6acc8e-1063-4b70-b5d8-0abe1d269d2d@q36g2000vbn.googlegroups.com>
HI all,
I've encountered a strange thing.
I want to use Memoize from a module in a folder where a Module
Config.pm is and it tells me the following error Global symbol
"%Config" requires explicit package name at /exlibris/sfx_ver/
sfx_version_3/app/perl-5.10.0/lib/5.10.0/Memoize.pm line 74.
I see that Memoize also uses the Config module. When using Memoize
from any other folder it works perfect.
I can not change the name of the Config module since it is used in
many places.
How can i solve the problem ?
Thanks,
David
------------------------------
Date: Wed, 28 Jan 2009 09:20:51 +0100
From: mysiar <psynowiec@WYTNIJTOop.pl>
Subject: Re: Vista x64 + DBD::Pg driver
Message-Id: <glp4h3$stb$1@news.onet.pl>
Tim Greer wrote:
> mysiar wrote:
>
>> Tim Greer wrote:
>>> mysiar wrote:
>>>
>>>> Hi
>>>> does anybody have this driver working ?
>>>> If so could share "prescription" how to run it ?
>>>>
>>>> Regards
>>>> Piotr
>>> Are you having issues installing it, running it, or? If it's
>>> installed without errors, what relevant portions of code can you post
>>> and detail the issue (any errors, etc.)
>> Sorry false alarm.
>> After I reboot my laptop it works great before I had a problem with
>> msvcr80.dll
>> To be honest I do not have any idea what was wrong and why it is OK
>> now.
>>
>> Regards
>> Piotr
>
> A reboot after an install, or that if it stops working that a reboot
> fixes the problem again?
I install PG driver and my script didn't work.
I tried reinstall driver and still no luck so basically I gave up.
Yesterday after I read your post I wanted to run my scripts again with
Pg driver and it worked.
It was a big surprise for me.
I do not shutdown my Vista just hibernate.
Regards
Piotr
------------------------------
Date: Tue, 27 Jan 2009 21:13:31 -0800
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: Which is faster - hash or array lookup
Message-Id: <497ff139$0$31457$ed362ca5@nr5c.newsreader.com>
Rasmus Villemoes wrote:
> xhoster@gmail.com writes:
>
>> Your scheme allows impossible boards, because some combinations of
>> the two players combinations (or one of them and the common piece)
>> will be incompatible. Couldn't you canonicalize at entire-board
>> level, rather than at each player individually?
>
> Of course, there are only C(25,5) * C(20,5) * 15 * 2 different
> possible states of the game (C(n,k) = binomial n,k), but this number
> is greater then 2**32, so in order to distinguish all states one
> needs at least five bytes.
You probably don't need to multiply by 2, as game
(12345, 34567, 12, 1's move) is the same as game
(34567, 12345, 12, 2's move)
Also, if the rules of your games are invariant to flipping or rotating
the board, you can reduce the number of boards to 6/25ths by forcing,
for example, the common piece to be in one of 6 squares, for example the
upper right triangle of the upper left quadrant. That would put the
number below 2**32. Shaving one byte off the 5-byte representation
probably isn't all that important, but shaving the number of
representations to be memorized might be.
>>> For any given state, a move from that state can be described by 3
>>> bytes (encoding the new positions of the player's pieces and the
>>> common piece).
>> Why would you want to scrimp on space here? Are you planning on
>> storing all possible moves from all possible boards in memory
>> simultaneously?
>
> Not all, but a lot. Most of the possible configurations of the board
> will never be reached in a real game, so I plan on making the program
> play against itself starting from the starting position, and marking
> winning/losing positions as it goes. In the next game, if a player
> reaches a position where he can make a move to a losing position for
> the other player, the current position can be marked as winning for
> him (along with the "proof" in the form of the winning move). This
> way, I hope only to build a small fraction of the graph.
I don't think this will work the way you want it to. If the computer
plays itself, rather than a strategic human, and the computer has no
strategy other than brute force memorization of previous plays, then the
computer will probably end up sampling all game-space which is
obtainable via a sequence of legal moves, not just the much smaller
game-space which is likely to be reached through playing against a
strategic human. Given that, I'd probably just start with the have-won
boards and work backwards, making a exhaustive record of all boards and
what a winning move, if any, there is from that board.
>
>> I'd probably just plan on recomputing possible moves on the fly,
>> rather than storing, and so wouldn't care about storage space for
>> this.
>
> I do not plan on making this program run only once, so I will store
> whatever I have found out on disk so that I can resume.
Ah, I see. So you have basically a 5-byte hash key (current board) with
a 3-byte value (winning move), from which you compute the next 5-byte
key (next board). I was thinking of just storing the 5 byte next board
as the value, and computing the move from the two boards. Your way is
definitely better than that. If you come up with a perfect hashing
algorithm where there cannot be collisions, you don't even need to store
the board bytes as you know what you searched for, so it takes only 3
"move" bytes per possible board. Of course at this point we are no
longer talking about Perl's hash tables, but some custom implementation.
> Also, this
> has the advantage that I can delete moves which are known to lead to
> a winning position for the other player; if a (known) position then
> at some point has no possible moves, it is effectively the same as if
> the player has lost at that time.
This can lead to unintuitive, but interesting, play. Once the computer
realizes that it has "inevitably" lost (to a perfect opponent), what
does it do? Just make completely random moves? Try to come up with a
"bluffing" recovery strategy that is most likely to result in a real
(imperfect) opponent failing to realize the existence of the winning
end-game?
The possibilities are endless and fascinating. Much more interesting
than the relative speed of hash lookups versus array lookups. ;)
Xho
------------------------------
Date: Wed, 28 Jan 2009 11:04:28 +0100
From: Rasmus Villemoes <burner+usenet@imf.au.dk>
Subject: Re: Which is faster - hash or array lookup
Message-Id: <u0lskn37nmb.fsf@orc04.imf.au.dk>
Xho Jingleheimerschmidt <xhoster@gmail.com> writes:
> You probably don't need to multiply by 2, as game
> (12345, 34567, 12, 1's move) is the same as game
> (34567, 12345, 12, 2's move)
No, not necessarily...
> Also, if the rules of your games are invariant to flipping or
> rotating the board,
because the game is not invariant under rotations or flipping. In
fact, one goal of the game is to make the common piece end on the
opponent's back row (the five squares closest to him). So if the
squares occupied by (34567,12345) (in either order) would allow the
common piece to be moved to 1's back row, 2 would be winning, whereas
if it was 1's turn, he would have a chance to avoid losing.
> Shaving one byte off the 5-byte representation probably isn't all
> that important, but shaving the number of representations to be
> memorized might be.
There is one symmetry that might be exploited; the game is mirror
symmetric around the axis joining (1,3)--(5,3). So one might at any
time assume that the common piece is in one of the 9 squares spanned
by (2,1),(2,3),(4,3),(4,1) (no need to memorize positions where the
common piece is at either back row, because those are game over
positions).
>> Not all, but a lot. Most of the possible configurations of the board
>> will never be reached in a real game, so I plan on making the program
>> play against itself starting from the starting position,...
> I don't think this will work the way you want it to. If the computer
> plays itself, rather than a strategic human, and the computer has no
> strategy other than brute force memorization of previous plays, then the
> computer will probably end up sampling all game-space which is
> obtainable via a sequence of legal moves, not just the much smaller
> game-space which is likely to be reached through playing against a
> strategic human.
From my experience of playing this game in real life, I have
discovered some heuristics that I plan to implement. It is almost
always a good idea to make a move so that the opponent has as few
places to move the common piece, so that would be one way to avoid
completely random play. There are a few others. If I restart the game
often enough (say, the first 10 million games are declared a draw if
no winner is found within 10 moves), many of the positions one would
need to go through to reach the unrealistic ones will have been marked
as winning, and so will be avoided in any subsequent games.
> Given that, I'd probably just start with the have-won boards and
> work backwards, making a exhaustive record of all boards and what a
> winning move, if any, there is from that board.
I have thought about doing it that way, but the number of have-won
boards is rather huge (by the above, at least any board where the
common piece is at one of the 10 back row squares, which makes 2e7;
there are other ways to win, also). The problem of determining if
there is a winning strategy (nothing in the rules prevents the players
from entering a cycle which can only be broken if one of the players
resign) is "just" a question of coloring a huge graph by some
recursive algorithm.
> This can lead to unintuitive, but interesting, play. Once the
> computer realizes that it has "inevitably" lost (to a perfect
> opponent), what
> does it do? Just make completely random moves? Try to come up with a
> "bluffing" recovery strategy that is most likely to result in a real
> (imperfect) opponent failing to realize the existence of the winning
> end-game?
We are quite OT. If you like I'd gladly tell you the exact rules of
the game, but then I think we should continue by private email or find
a more suitable group.
--
Rasmus Villemoes
<http://rasmusvillemoes.dk/>
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 2167
***************************************