Why is 27 special?

2002-10-10 Thread _brian_d_foy

i'm back to fooling around with Mac::iTunes again.  i took a week off after
the Mac OS X Conference because i had been thinking about it too much. [
side note:  never trust an audience.  i let them access (through Apache::iTunes)
my iTunes (on the G3 projecting the fancy powerpoint on the screen and hooked
up to the house sound).  i asked them to take turns, but alas.  ]

tonight i want to get a Perl version of iTunes Publisher off my to-do list,
so i start mucking with the parsing bits again.  some of the MP3s now live 
on another partition, and that partition name is a different length than
the old one.

this means that the 20 fixed bytes between the volume name and the date,
which are \000 in every case i looked at, is really 27 - (length of volume
name).  i can name partitions with names up to 27 characters, but if i go past
that it look like it initially works but then gives a warning.  what's the deal?
what is magic about 27?  why not 31?  i assume that these are C strings somewhere
so the null bytes makes them a nice, even number.

i took me quite a while to actually find this problem.  Perl is not the best language
for bytewise manipulation of binary data.  all of that auto-stringy stuff gets in
the way.  however, C doesn't have hashes out of the box.  i'm stuck somewhere in
the middle of two equally annoying solutions.  :)



What up with the mac

2002-10-10 Thread Brigham Mecham

Hello

Perhaps someone can fill me in on this one.  I am comparing the run time 
of a perl program I wrote.  Using my Mac G4 which has a 1.5 ghz 
processor and a 1.3 ghz PC computer (processor chip type I don't know 
but could find out) I am seeing that the Mac takes 14 seconds to 
complete what the PC does in 6!  What's up with that?




Re: What up with the mac

2002-10-10 Thread Ask Solem Hoel

Quoting Brigham Mecham [EMAIL PROTECTED]:

 Hello
 
 Perhaps someone can fill me in on this one.  I am comparing the run time 
 of a perl program I wrote.  Using my Mac G4 which has a 1.5 ghz 
 processor and a 1.3 ghz PC computer (processor chip type I don't know 
 but could find out) I am seeing that the Mac takes 14 seconds to 
 complete what the PC does in 6!  What's up with that?
 

That could be hard to guess without the detailt of your
program.

Remember There could be other things than the CPU slowing it down.

o The operating system (differences in implementation of systemcalls etc)
o The amount of memory, the bus speed of the memory.
o The file system (if the program finds files i.e)

Without knowing anything about the program, it's
impossible to tell.

-- 
[EMAIL PROTECTED]



Re: Why is 27 special?

2002-10-10 Thread Peter N Lewis

At 3:09 -0500 10/10/02, _brian_d_foy wrote:

this means that the 20 fixed bytes between the volume name and the date,
which are \000 in every case i looked at, is really 27 - (length of volume
name).  i can name partitions with names up to 27 characters, but if i go past
that it look like it initially works but then gives a warning. 
what's the deal?
what is magic about 27?  why not 31?  i assume that these are C 
strings somewhere
so the null bytes makes them a nice, even number.

Mac volume names are limited to 27 characters.  See

http://developer.apple.com/techpubs/mac/Files/Files-102.html

for a description for the Master Directory Blocks (aka volume 
information block).  If I had to guess, I'd say that the volume name 
was intended to be 31 characters, and then at the last minute the 
volume backup date field was added in at the end of the name which 
reduced the length of the volume name from 31 to 27 characters.

Enjoy,
Peter.

-- 
I was away for two months and have just returned, and now have
4600 messages to wade through, so sorry for any delays.
http://www.interarchy.com/  http://download.interarchy.com/



Re: What up with the mac

2002-10-10 Thread Ward W. Vuillemot
What is the script?  If you truly think you have an optimization 
problem on the Mac, then send us the script -- assuming it is of 
reasonable size.

Are you doing something in Perl that is really a Windows-specific 
task...are you running Perl within Mac OS X or through Fink 
packages...do you have the same versions of Perl...are you running Perl 
on OS X or OS 9...do the computers have the same amount of RAM, similar 
HDs, running one locally vs off a networked HD???  Also, 1.5 GHz 
Apple?!?  Do you mean dual-1.25 GHz Apple?  it is difficult to even 
comment with so little information to go by.

On 2002.10.9, at 12:31 午後, Brigham Mecham wrote:

 Hello

 Perhaps someone can fill me in on this one.  I am comparing the run 
 time of a perl program I wrote.  Using my Mac G4 which has a 1.5 ghz 
 processor and a 1.3 ghz PC computer (processor chip type I don't know 
 but could find out) I am seeing that the Mac takes 14 seconds to 
 complete what the PC does in 6!  What's up with that?



Re: What up with the mac

2002-10-10 Thread James Stepanek


--- Brigham Mecham [EMAIL PROTECTED]
wrote:
 Hello
 
 Perhaps someone can fill me in on this one.  I am
 comparing the run time 
 of a perl program I wrote.  Using my Mac G4 which
 has a 1.5 ghz 
 processor and a 1.3 ghz PC computer (processor chip
 type I don't know 
 but could find out) I am seeing that the Mac takes
 14 seconds to 
 complete what the PC does in 6!  What's up with
 that?
 

My question is where did you get a 1.5 GHz mac
considering 1.25 Dual is top of the line?

James

__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos  More
http://faith.yahoo.com



Re: Why is 27 special?

2002-10-10 Thread Gregory Cranz

Just a note:

I don't know if this is related or not, but recently I had a situation 
where I was attempting to back up OS/X borne files to an OS/9 server.  
They had lengthy filenames.  Every time I tried doing a 'drag-copy' I 
received an error -35 message.

After breaking the sub-folders down  finding the culprits it was indeed 
that the filenames were too long.  Upon shortening them I was able to 
copy them without incident.

Unfortunately I didn't count the number of characters involved.  I can 
only assume that OS/9 has a shorter filename limit than OS/X.

Oh and BTW - it is a coincidence that in your conversation: 27 is 31 
minus the dot-3 extension?



On Thursday, October 10, 2002, at 06:05 AM, Peter N Lewis wrote:



 --
 From:Peter N Lewis[SMTP:[EMAIL PROTECTED]]
 Sent:Thursday, October 10, 2002 6:05:35 AM
 To:  [EMAIL PROTECTED]
 Subject: Re: Why is 27 special?
 Auto forwarded by a Rule
 At 3:09 -0500 10/10/02, _brian_d_foy wrote:

 this means that the 20 fixed bytes between the volume name and the 
 date,
 which are \000 in every case i looked at, is really 27 - (length of 
 volume
 name).  i can name partitions with names up to 27 characters, but if i 
 go past
 that it look like it initially works but then gives a warning. what's 
 the deal?
 what is magic about 27?  why not 31?  i assume that these are C 
 strings somewhere
 so the null bytes makes them a nice, even number.

 Mac volume names are limited to 27 characters.  See

 http://developer.apple.com/techpubs/mac/Files/Files-102.html

 for a description for the Master Directory Blocks (aka volume 
 information block).  If I had to guess, I'd say that the volume name 
 was intended to be 31 characters, and then at the last minute the 
 volume backup date field was added in at the end of the name which 
 reduced the length of the volume name from 31 to 27 characters.

 Enjoy,
Peter.

 -- I was away for two months and have just returned, and now have
 4600 messages to wade through, so sorry for any delays.
 http://www.interarchy.com/  http://download.interarchy.com/




Re: What up with the mac

2002-10-10 Thread ellem

On Wednesday, October 9, 2002, at 03:31 PM, Brigham Mecham wrote:

 Hello

 Perhaps someone can fill me in on this one.  I am comparing the run 
 time of a perl program I wrote.  Using my Mac G4 which has a 1.5 ghz 
 processor and a 1.3 ghz PC computer (processor chip type I don't know 
 but could find out) I am seeing that the Mac takes 14 seconds to 
 complete what the PC does in 6!  What's up with that?



There are so many things wrong with this question that I would normally 
not respond to it but I think buried under the mess you wrote is a legit 
question.

Since 1.25 Ghz is as fast as Macs are currently going I wonder if you 
are on 25 Mhz machine.

What does the script do?
Memory?
HD?
What else is running when you are doing this?

Many questions to answer


--
Lou Moran
http://ellem.dyn.dhs.org:5281/resume/lmoran2002.html





Re: What up with the mac

2002-10-10 Thread Bill Stephenson

Has anyone ran a Benchmark test on their OS X Mac? I'm a bit curious to see
how Perl on OS X stacks up against other systems.

I can try to run it on my iBook 366 ;)
-- 

Bill Stephenson


 From: Gregory Cranz [EMAIL PROTECTED]
 Date: Thu, 10 Oct 2002 09:54:42 -0400
 To: Brigham Mecham [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: What up with the mac
 
 Comparing an arbitrary script is not necessarily a 'fair' or 'clean'
 test from one system to another.  I would suggest working with the
 Benchmark module available from CPAN.  This is designed to function in
 this capacity and is more appropriate for performance testing.  As has
 been noted previously in responses to this query, there are a lot of
 things that a script might do, without divulging your script, this would
 probably be your best course of action.
 
 
 
 On Wednesday, October 9, 2002, at 03:31 PM, Brigham Mecham wrote:
 
 
 
 --
 From:  Brigham Mecham[SMTP:[EMAIL PROTECTED]]
 Sent:  Wednesday, October 09, 2002 3:31:50 PM
 To:  [EMAIL PROTECTED]
 Subject:  What up with the mac
 Auto forwarded by a Rule
 Hello
 
 Perhaps someone can fill me in on this one.  I am comparing the run
 time of a perl program I wrote.  Using my Mac G4 which has a 1.5 ghz
 processor and a 1.3 ghz PC computer (processor chip type I don't know
 but could find out) I am seeing that the Mac takes 14 seconds to
 complete what the PC does in 6!  What's up with that?
 
 




Re: What up with the mac

2002-10-10 Thread Chris Devers

On Thu, 10 Oct 2002, Bill Stephenson wrote:

 Has anyone ran a Benchmark test on their OS X Mac? I'm a bit curious to
 see how Perl on OS X stacks up against other systems.

Particularly interesting would be a cross comparison among, say, OSX, pure
Darwin, a PPC version of Linux, and maybe PPC BSD. For comparison, these
can be tried against x86 versions of the same systems. The ultimate idea
being to get an idea of how OSX compares to other systems that use this
hardware, and how this hardware compares to it's big brother alternative.


-- 
Chris Devers[EMAIL PROTECTED]

I had pancake makeup for brunch!





Re: What up with the mac

2002-10-10 Thread Andrew Brosnan

I didn't write to scripts below, but they are fun to play with.

Obviously some adjustment would be needed to compare across systems.

 

#
#!/usr/bin/perl Benchmark_demo1
#Measure CPU usage of a some portion of a program


use Benchmark;


# generate list of all text files in /etc
text_files = grep { -f and -T } glob('/etc/*');


timethis(100, 'sort_by_size(text_files)');


# sort the files names according to file sizes
sub sort_by_size {
my files = _;
files = sort { -s $a = -s $b } files;
return files;
}
#



#
#!/usr/bin/perl Benchmark_demo2
#Can confirm that one technique is faster than another


use Benchmark;


# generate list of all text files in /etc
text_files = grep { -f and -T } glob('/etc/*');


timethis(100, 'faster_sort_by_size(text_files)');


# sort the files names according to file sizes,
# stat'ing each file just once
sub faster_sort_by_size {
my files = _;
files = map { $_-[1] }
sort { $a-[0] = $b-[0] }
map { [ -s $_, $_ ] } files;
return files;
}
#



gd croaking

2002-10-10 Thread Puneet Kishor

Folks,

I haven't messed with the OS at all. Perl 5.6.0 that comes with OS X 
10.2.

I built gd 1.8.4 using Scott Anguish's directions on stepwise (as I 
have done before), and that worked just as expected. Then I built a 
specific perl module that helps makes maps (used to work fine on 
10.1.whatever.

I run my scripts unchanged, and I get the following in the apache 
error_log. Seems like gd is not happy.

Without any further info to share (I really don't know what else to 
offer), can anyone shed some light on the following, or guide me to 
someplace I can find answers?

Many thanks.

Puneet.

% tail -f /var/log/httpd/error_log
dyld: perl Undefined symbols:
_gdFontGiant
_gdFontLarge
_gdFontMediumBold
_gdFontSmall
_gdFontTiny
_gdImageArc
_gdImageColorAllocate
_gdImageColorTransparent
_gdImageCopy
_gdImageCopyMerge
_gdImageCopyResized
_gdImageCreate
_gdImageCreateFromJpeg
_gdImageCreateFromPng
_gdImageDestroy
_gdImageFillToBorder
_gdImageFilledPolygon
_gdImageFilledRectangle
_gdImageInterlace
_gdImageJpeg
_gdImageJpegPtr
_gdImageLine
_gdImagePng
_gdImagePngPtr
_gdImagePolygon
_gdImageRectangle
_gdImageSetBrush
_gdImageSetPixel
_gdImageSetStyle
_gdImageSetTile
_gdImageString
_gdImageStringFT
_gdImageWBMP
_gdImageWBMPPtr
[Thu Oct 10 11:00:46 2002] [error] [client 127.0.0.1] Premature end of 
script headers: /Users/pkishor/Sites/bims/index.pl




Re: Installation of LWP fails

2002-10-10 Thread David Wheeler

On Wednesday, October 9, 2002, at 11:38  PM, Adam Fishman wrote:

 (You get this message, because MakeMaker could not find
 /System/Library/Perl/darwin/CORE/perl.h)

Well, do you have this file?

David

-- 
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]




Re: Installation of LWP fails

2002-10-10 Thread Palle Bo Nielsen

I have exactly the same problem on a machine at work running Mac OS X 
Server 10.2. Don't know how to fix it. Would like to be able to run the 
LWP module too.

PowerPalle


On torsdag, okt 10, 2002, at 19:17 Europe/Copenhagen, David Wheeler 
wrote:

 On Wednesday, October 9, 2002, at 11:38  PM, Adam Fishman wrote:

 (You get this message, because MakeMaker could not find
 /System/Library/Perl/darwin/CORE/perl.h)

 Well, do you have this file?

 David

 -- 
 David Wheeler AIM: dwTheory
 [EMAIL PROTECTED] ICQ: 15726394
 http://david.wheeler.net/  Yahoo!: dew7e
Jabber: 
 [EMAIL PROTECTED]







Re: Adding path to @INC for use with web server

2002-10-10 Thread gene

 From: Adam Witney [EMAIL PROTECTED]
 Date: Thu, 10 Oct 2002 11:09:38 +0100
 To: MacOS X perl [EMAIL PROTECTED]
 Subject: Adding path to @INC for use with web server

 Hi,

 Searching the archives I have been able to find out how to get Perl to
 search other paths for modules when invoked from the terminal or from 
 GUI
 apps such as BBEdit, however I cannot get them recognised by cgi 
 scripts. I
 read somewhere to add this line to httpd.conf


You can include this code in httpd.conf:

Perl
use lib '';
/Perl

I assume that this directive requires mod_perl
Alternatively you can do
PerlRequire /../../perl_config_file.pl
and then in that perl config file, include your 'use lib' code.




Re: gd croaking

2002-10-10 Thread Puneet Kishor

Ok, here's some more info that I was able to put together.

I built gd and supporting libraries using gcc 3.1.

To build another program (that actually eventually generates a perl 
module), I had to revert to gcc 2.x.

I, then, reverted back to gcc 3.x and built the perl specific module. 
Running my perl scripts hence produces the errors below. The dyld: perl 
Undefined symbols: portion indicates there might be some binary 
incompatibility. Between what and what though? Is there a way I can test 
this? (I guess, in a manner of speaking, I did test it and learned it is 
incompatible :-( )



Puneet Kishor wrote:
 Folks,
 
 I haven't messed with the OS at all. I am using the Perl 5.6.0 that comes with OS X 
10.2.
 
 I built gd 1.8.4 using Scott Anguish's directions on stepwise (as I have 
 done before), and that worked just as expected. Then I built a specific 
 perl module that helps makes maps (used to work fine on 10.1.whatever.
 
 I run my scripts unchanged, and I get the following in the apache 
 error_log. Seems like gd is not happy.
 
 Without any further info to share (I really don't know what else to 
 offer), can anyone shed some light on the following, or guide me to 
 someplace I can find answers?
 
 Many thanks.
 
 Puneet.
 
 % tail -f /var/log/httpd/error_log
 dyld: perl Undefined symbols:
 _gdFontGiant
 _gdFontLarge
 _gdFontMediumBold
 _gdFontSmall
 _gdFontTiny
 _gdImageArc
 _gdImageColorAllocate
 _gdImageColorTransparent
 _gdImageCopy
 _gdImageCopyMerge
 _gdImageCopyResized
 _gdImageCreate
 _gdImageCreateFromJpeg
 _gdImageCreateFromPng
 _gdImageDestroy
 _gdImageFillToBorder
 _gdImageFilledPolygon
 _gdImageFilledRectangle
 _gdImageInterlace
 _gdImageJpeg
 _gdImageJpegPtr
 _gdImageLine
 _gdImagePng
 _gdImagePngPtr
 _gdImagePolygon
 _gdImageRectangle
 _gdImageSetBrush
 _gdImageSetPixel
 _gdImageSetStyle
 _gdImageSetTile
 _gdImageString
 _gdImageStringFT
 _gdImageWBMP
 _gdImageWBMPPtr
 [Thu Oct 10 11:00:46 2002] [error] [client 127.0.0.1] Premature end of 
 script headers: /Users/pkishor/Sites/bims/index.pl
 





Jaguar Perl 5.6.0 dyld error

2002-10-10 Thread Kelly Thomas Wood

Hoping someone has seen this.  I've read all about the dyld: perl
Undefined symbol: errors when upgrading to 5.8.0, but I'm running into
these errors while still running 5.6.0 on certain modules.  Specifically,
I'm trying to use Jeff Horwitz's Authen::Krb5 and get the following
output:

dyld: perl Undefined symbols:
_krb5_free_address
_krb5_free_enc_tkt_part
_krb5_free_krbhst
_krb5_gen_portaddr
_krb5_gen_replay_name
_krb5_get_krbhst
_krb5_init_ets
Trace/BPT trap

During the Authen::Krb5 compile i get some warnings:

Krb5.xs:317: warning: passing arg 2 of `Perl_sv_2pv' from incompatible
pointer type
Krb5.xs: In function `XS_Authen__Krb5_rd_req':

etc...

but it seems to build ok.  Anyone have an idea on this one?

Thanks,
Kelly





Re: gd croaking

2002-10-10 Thread Dave Gomez

Puneet,

Think I had same issues, and gave up and used gnuplot instead for some graph
creation, as it does put out graphs like the ones I use on my site well
(http://www.dkgomez.com/cgi-bin/housetemp.pl). Think I used fink to do the
install of gnuplot

Dave Gomez

On 10/10/02 2:27 PM, Puneet Kishor [EMAIL PROTECTED] wrote:

 Ok, here's some more info that I was able to put together.
 
 I built gd and supporting libraries using gcc 3.1.
 
 To build another program (that actually eventually generates a perl
 module), I had to revert to gcc 2.x.
 
 I, then, reverted back to gcc 3.x and built the perl specific module.
 Running my perl scripts hence produces the errors below. The dyld: perl
 Undefined symbols: portion indicates there might be some binary
 incompatibility. Between what and what though? Is there a way I can test
 this? (I guess, in a manner of speaking, I did test it and learned it is
 incompatible :-( )
 
 
 
 Puneet Kishor wrote:
 Folks,
 
 I haven't messed with the OS at all. I am using the Perl 5.6.0 that comes
 with OS X 10.2.
 
 I built gd 1.8.4 using Scott Anguish's directions on stepwise (as I have
 done before), and that worked just as expected. Then I built a specific
 perl module that helps makes maps (used to work fine on 10.1.whatever.
 
 I run my scripts unchanged, and I get the following in the apache
 error_log. Seems like gd is not happy.
 
 Without any further info to share (I really don't know what else to
 offer), can anyone shed some light on the following, or guide me to
 someplace I can find answers?
 
 Many thanks.
 
 Puneet.
 
 % tail -f /var/log/httpd/error_log
 dyld: perl Undefined symbols:
 _gdFontGiant
 _gdFontLarge
 _gdFontMediumBold
 _gdFontSmall
 _gdFontTiny
 _gdImageArc
 _gdImageColorAllocate
 _gdImageColorTransparent
 _gdImageCopy
 _gdImageCopyMerge
 _gdImageCopyResized
 _gdImageCreate
 _gdImageCreateFromJpeg
 _gdImageCreateFromPng
 _gdImageDestroy
 _gdImageFillToBorder
 _gdImageFilledPolygon
 _gdImageFilledRectangle
 _gdImageInterlace
 _gdImageJpeg
 _gdImageJpegPtr
 _gdImageLine
 _gdImagePng
 _gdImagePngPtr
 _gdImagePolygon
 _gdImageRectangle
 _gdImageSetBrush
 _gdImageSetPixel
 _gdImageSetStyle
 _gdImageSetTile
 _gdImageString
 _gdImageStringFT
 _gdImageWBMP
 _gdImageWBMPPtr
 [Thu Oct 10 11:00:46 2002] [error] [client 127.0.0.1] Premature end of
 script headers: /Users/pkishor/Sites/bims/index.pl
 
 
 
 




OT Java pseudo-benchmark (was Re: What up with the mac)

2002-10-10 Thread Joel Rees

Okay, here's the Java program I was talking about, since someone might
want it and I'm going to be off-list for a while:

-begin code
/**
 * Let's try the Factorial in BigInteger
 *
 * @author Joel Rees, Altech Corporation, Esaka, Japan
 * Copyright September 2002
 * May be copied, modified, and/or used freely.
 * No warranty. Use at your own risk.
 *
 * @version 0.1
 */


import java.lang.Class;
import java.math.BigInteger;


public class BigFactorial 
{
public static void main( String[] args )
{   if ( ( args.length  1 ) || ( args[ 0 ].charAt( 0 ) == '-' ) )
{   System.out.println( Usage:  
/* Okay, this is ridiculous. */
+ BigFactorial.class.getName() 
+  integer {, integer } );
}
else
{   for ( int i = 0; i  args.length; ++i )
{   BigInteger input = new BigInteger( args[ i ] );
System.out.println( 
(
+ input.toString() 
+ )! ==  + factorial( input ).toString() );
}
}
}


/* Let's not try to blow the stack with the old 
 * forced example of recursion, at any rate.
*/
public static BigInteger factorial( BigInteger n )
{   if ( n.compareTo( BigInteger.ZERO )  0 )
{   return new BigInteger( 0 );
}
BigInteger result = new BigInteger( 1 );
while ( n.compareTo( BigInteger.ONE )  0 )
{   result = result.multiply( n );
n = n.subtract( BigInteger.ONE );
}
return result;
}
}

--end code-

Should be easy to re-write in Perl.

-- 
Joel Rees [EMAIL PROTECTED]