Just another perl hacker somewhere near Disneyland
I have this homenode [perlmonks.org] of little consequence on Perl Monks [perlmonks.org] that you probably have no interest in whatsoever.
I also have some modules [cpan.org] on CPAN [cpan.org] some of which are marginally [cpan.org] more [cpan.org] useful [cpan.org] than others.
Update: I've decided the sub-title of this post is "I still don't want a pickle: s/motor/bi/"
It's about an 8 mile drive to work, and I decided that it was time to see about riding my bike instead. And there's all sorts of reasons for doing it, and people ask ("But what about...") about all sorts of reasons for not doing it. But the biggest reason is that instead of dreading the drive home and wondering if I should take the freeway or surface streets (and not caring much more about the trip to work), I actually look forward to the commute, each way, whether it's cold and foggy, or hot and sweltering (I'm not yet prepared for rain, so I'll drive if that's the case, 'cuz you know that in Southern California we're afraid of melting if it rains, even a little).
Once upon a time there was a marine base. And it was decommissioned. And there was some discussion over what to do with the space left by the decommissioned marine base. Some people wanted an airport, some people wanted a park. There was a vote. And the park people won.
And Arlo Guthrie played while a big orange balloon went up and down. And everyone who "thought that guy was dead"[1] got to hear Alice's Restaurant (for free!), and lots of other songs and stories, and it was funny, and entertaining, and a wonderful time was had by all. But we didn't get there early enough to get passes for the Orange Balloon
So a few weeks later, we went back earlier to get passes, rode the Orange Balloon, and listened to some more music (a "Wartime Radio Revue", which was cool, but not Arlo Guthrie...
[1] I called my wife Friday morning when I heard on the radio about the show:
The first thing he said onstage was "I bet some of you heard about this and said "I thought that guy was dead..."
Everyone I talk with says that mucking with the XML exported by Informatica's PowerCenter is not recommended, or that they tried and failed...so I had no choice but to ignore that advice when we were upgrading from version 7 to 8. I think the advice must be from people who don't quite know what they're doing, and/or "parse" with grep/awk/sed.
I've been messing with more XML in the last few weeks than I have in the last few years. I have my own (shared) opinion about Informatica/ETL (and I've taken up Aristotle's call to action), but at least it provides an opportunity to practice some XML-fu. Most transformations were simple changing of some attributes, but there was one issue where after importing into v8, if you delete a group from a Union transformation, the GUI crashes. So I created a Union transformation from scratch, exported it, and compared it to what I was importing, and hey, there was some stuff missing! So I wrote the following:
# Fix Union transformations
my $union_cnt;
for my $trans (
$root->findnodes(q[
//TRANSFORMATION[@TYPE="Custom Transformation" and @TEMPLATENAME="Union Transformation"]
])
) {
$union_cnt++;
my $name = $trans->getAttribute('NAME');
my $parent = $trans->parentNode();
print "X: Fixing Union transformation $name\n";
my @output;
for my $field (
$trans->findnodes(q[
TRANSFORMFIELD[@GROUP="OUTPUT"]/@NAME
])
) {
push @output, $field->value();
}
my %dep;
my $dep_cnt;
for my $field (
$trans->findnodes(q[
TRANSFORMFIELD[@PORTTYPE="INPUT"]
])
) {
my $name = $field->getAttribute('NAME');
my $group = $field->getAttribute('GROUP');
my $dep_group = $output[$dep{$group}++];
my $new = $trans->addNewChild( '', 'FIELDDEPENDENCY' );
$new->setAttribute( 'INPUTFIELD', $name );
$new->setAttribute( 'OUTPUTFIELD', $dep_group );
}
}
$_->unbindNode() for $root->findnodes('//text()');
Warning: this code is not endorsed or guaranteed by anyone for anything!
The removing of all text nodes was so that the result would stay pretty-printed after output (is there a better/easier way?):
eval { $doc->toFile($file, 1) } or die "Could not write to $file: $@";
And there are no text nodes with anything but whitespace anyway. XML::LibXML seemed hard to use at first, but once you get used to how the docs are arranged (and learn some XPath), it's quite easy.
Dear lazyweb,
When I rightclick on a file on my work Windows system and go to File-Properties, there's a "NetWare Version" tab which has a "View Version, Copyright, and Check Sum Info" button. When you click that, you get a 48-bit checksum of the file in hex. Does anyone know how this checksum is calculated, or even how to find an external exe to run (or a dll and how to use it) to get this value? I've tried comparing the value against as many known checksum algorithms as possible before tearing my hair out.
Update: and why I want this? We are currently required to enter this value into some document, and the only way to cut n paste it is via screen copy...you can not copy just the text.
Update: nevermind...we have switched to using Jacksum.
----------------------------------------
Notes on Building perl 5.10.0 and various
libraries on HP-UX (11.11)
All of the following was installed under
/users/foo
Adjust all prefix parameters accordingly
to install in another directory (or remove
to install in default location).
----------------------------------------
First perl itself:
> which cc
must be/opt/softbench/bin/cc compiler
(default HP/usr/bin/cc compiler will not work)
(gcc compiler can work, but everything here was done
with softbench compiler).
# Add prefix to install in non-standard path
sh Configure -Dprefix=/users/foo
keep default of building non-threaded perl, but
add '-lcl -lpthread' to beginning of libraries to include.
(So that DBD::Oracle will build dynamically later).
make
make test
make install
----------------------------------------
XML::LibXML and XML::LibXSLT:
----------------------------------------
First install shared libraries:
install binaries of zlib(libz), iconv, and gettext
libraries, unless you really feel like building them
(install in local directory if necessary..e.g./users/foo/lib
and include files in/users/foo/include).
Build source for libxml library:
Set env variables:
export CC=cc
export LDFLAGS="-L/users/foo/lib -I/users/foo/include"
./configure --prefix=/users/foo --without-threads --without-thread-alloc --with-iconv=/users/foo --with-zlib=/users/foo
make
make install
# Fix permission on config info file:
chmod +x/users/foo/bin/xml2-config
----------------------------------------
Build source for libxslt library:
Set env variables:
export CC=cc
export LDFLAGS="-L/users/foo/lib -I/users/foo/include"
./configure --prefix=/users/foo
make
make install
# Fix permission on config info file:
chmod +x/users/foo/bin/xslt-config
----------------------------------------
Build source for XML::LibXML::Common:
perl Makefile.PL
(doesn't always work first time..repeat until Makefile is created)
make
make test
make install
----------------------------------------
Build source for XML::NamespaceSupport:
perl Makefile.PL
make
make test
make install
----------------------------------------
Build source for XML::SAX:
perl Makefile.PL
make
make test
make install
----------------------------------------
Build source for XML::LibXML:
perl Makefile.PL (repeat until Makefile is created)
make
make test
make install
----------------------------------------
Build source for XML::LibXSLT:
Change the following lines (this might be fixed in a future
version):
#xsystem("$Config{make} $file test 'OTHERLDFLAGS=$opt'");
xsystem("$Config{make} $file test");
#$result = try_link(<<"SRC", $libs);
$result = try_link(<<"SRC", undef);
perl Makefile.PL LIBS=-L/users/foo/lib INC="-I/users/foo/include -I/users/foo/include/libxml2"
make
make test
(a couple of tests, e.g. exslt tests, will fail, install exslt library
if you need exslt)
make install
----------------------------------------
Build source for DBI
perl Makefile.PL
make
make test (many tests are skipped)
make install
----------------------------------------
Build source for DBD::Oracle (1.20)
perl Makefile.PL
edit Makefile:
# Look for
$(LD) -Wl,+b"$(LD_RUN_PATH)" $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \
# Remove "-Wl,"
$(LD) +b"$(LD_RUN_PATH)" $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \
make
make test
(many 'connects' fail unless you set env vars for a test db)
(many charset tests skipped on old versions of Oracle)
make install
----------------------------------------
Build source for DBD::Sybase (1.08)
Edit Sybase.pm:
# Look for:
sub dl_load_flags { if($^O eq 'aix') { 0x00 } else { 0x01 }}
# Change to:
sub dl_load_flags { if($^O eq 'aix') { 0x00 } else { 0x00 }}
update: patch to display line numbers on RaiseError:
***../DBD-Sybase-1.08/dbdimp.c Thu Apr 19 11:31:19 2007
--- dbdimp.c Thu Jun 19 14:09:45 2008
***************
*** 545,550 ****
--- 545,551 ----
else
retcode = CS_SUCCEED;
+ sv_catpv(DBIc_ERRSTR(imp_dbh), " ");
return retcode;
} else {
if(srvmsg->msgnumber) {
perl Makefile.PL (prompts for test server/db and user/passwd)
make
make test
make install
My wife just bought a Dell laptop with Windows Vista...the Desktop is Windows XP with a printer connected directly to it, and the printer was configured to be "shared". Tried to get the printer working from the laptop...click "add a printer", then "Is this a local or network printer?". Well, it's on the network, it sure doesn't seem local, but the network discovery thing doesn't find it, and you get "Access Denied" when trying to connect to it. Google, google, and low and behold, it's really a "local" printer, though you do give it the "\\systemname\printername" path in one of the entry fields.
Very intuitive. Also, the salesman who was trying to sell us another printer when buying the laptop was telling us "the old printer probably won't work...there probably no printer driver for Vista...". BS.
Of course, my wife needed something printed out right now because she was going out right now, and another option was to export the Word document to PDF, and email it to ourselves and print it out at the other computer. But Word didn't natively export to PDF, you had to install a Microsoft Plug-in for that, and you needed the "validation code" that came with word to install it, and we didn't have that handy. Eventually, I did also install PDFCreator, but that was around the same time I found out about the "Local Printer" thing.
What would we do without the internet? Spend useless hours on hold with Technical Support probably.