matrix writing

2006-02-08 Thread Ed Chester
you may be interested in pdl, see pdl.perl.org. it might make your whole matrix life easier. ed c ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

(Was Re: comparing floating point numbers) now [OT]: catastrophic cancellation

2005-07-25 Thread Ed Chester
Mike wrote: [snipped] > items that specifically referred to the floating point Error in the first batch of Pentium chips Sorry, I should have narrowed the search then. This is not specific to that error, it is a consequence of the FP number system representation. It arises in certain circumstance

re: comparing floating point numbers

2005-07-25 Thread Ed Chester
this is top-posted because it doesn't follow from any one of the previous posts. just a warning to be careful of subtracting or dividing similar numbers in floating point and what your expectations are for the results. google for 'catastrophic loss of precision' or similar, or check out the floa

re: comparing floating point numbers

2005-07-24 Thread Ed Chester
John Deighan:: > Is there a safe way to compare 2 floating point numbers in Perl? [snip] > My debugger says that they're both '630.24' [snip] > However, the == test fails and the != test succeeds can you post code with the comparison == that fails ? if the debugger says they're the same, they're

RE: assigned array to keys of hash?

2005-06-04 Thread Ed Chester
Chris Wagner wrote: > I think this will do what u want. > foreach $i ( grep($something, $maybeBiggerOriginalArray) ) { $hash{$i} = 1 } thanks - it does, its what i posted compacted a little :) see eric's post about a hash slice, its neat.

assigned array to keys of hash?

2005-06-04 Thread Ed Chester
tly? once again i'm sure i'm missing something. thanks a lot, have a good weekend wherever you are. ed chester ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: perl/mysql issue...

2005-05-03 Thread Ed Chester
bruce wrote a cross-post with: > i can access the mysql db/livejournal from the mysql client/command line. > mysql -ulj -host192.168.1.55 -p what happens when you try this with the user/host you specified for the database? i.e. mysql -u lj -host localhost -p or omit the host altogether. see

perl i/f MS-Project ?

2005-05-03 Thread Ed Chester
ated, i'll post back whatever half-baked solution i come up with meanwhile... ed chester ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: unpack returning an array?

2005-03-07 Thread Ed Chester
ce out of @MyArray. $buffer = pack('C*',0x7c,0x45,0x3e,0x02); $MyArray[0] = [ unpack('C*',$buffer) ]; print $MyArray[0]; print join " ", @{$MyArray[0]}; ARRAY(0x1555220) 124 69 62 2 At 06:39 AM 3/7/05 -0800, Ed Chester wrote: >Thanks for the suggestion - you&

RE: unpack returning an array?

2005-03-07 Thread Ed Chester
> How about: > my @array = unpack ("H8", $buffer); > $MyArray[$i] = [EMAIL PROTECTED]; > Or even: > $MyArray[$i] = [ unpack ("H8", $buffer) ]; Thanks for the suggestion - you're right, unpack is seeing scalar context. Your two ideas are the same, they do indeed assign the output of pack to a (1

unpack returning an array?

2005-03-07 Thread Ed Chester
Hello all - I posted sometime last week about ways of parsing image file data and doing image processing 'raw' without external software/libraries. I'm working on this at byte level now and will post the basic code to populate an array with pixel values when its cleaned up. Meanwhile, I have

RE: parse gif/bmp w/out modules

2005-02-28 Thread Ed Chester
thanks for the tip - that may well help. the biggest problem i've found is the dependency of the relevant modules upon things like imagemagick/gd (this is a windows problem)... thanks again though - i'll look at that. ed c -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECT

parse gif/bmp w/out modules

2005-02-28 Thread Ed Chester
Hallo All - I am faced with the prospect of wanting to parse a greyscale image in either GIF or BMP format, in order to do some stats on pixel values. After being read, the image is not altered, and no image is output. Off I went on a CPAN quest. I quickly learn all about PerlMagick, Prima::

Re: perl program

2005-01-25 Thread Ed Chester
one way: use the windows scheduler service. see docs for the 'AT' command. consider using your perl program to add the time of its next execution to the schedule. its then easy to control if you mean 5 minutes between program start of execution, or 5 minutes between end of execution and start of ne

RE: java equivalent!!

2004-12-20 Thread Ed Chester
> Is there a java equivalent for Digest::HMAC_SHA1 package? is there a java mailing list equivalent to perl-win32-users? if so, find it, because that's the place to ask the question! ;-) ed c -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Krishna, Ha

RE: black box

2004-12-15 Thread Ed Chester
> #!wperl the shebang ('sharp, bang') line should have the full path... ? #!/c:/perl/bin/wperl -w ed c -Original Message- From: Lasher, Brian [mailto:[EMAIL PROTECTED] Sent: 15 December 2004 21:02 To: Ed Chester; [EMAIL PROTECTED] Subject: RE: black box Have got se

RE: black box

2004-12-15 Thread Ed Chester
Title: Message use wperl instead of perl they will behave the same on win32, except that wperl won't support any options that require a console window to be there...   ed c -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lasher, BrianSe

RE: Internal (bit) representation of floating point numbers

2004-11-28 Thread Ed Chester
> 1100 > If the approach is correct, then what are the rules for setting the bits > in floating point numbers ? IEEE standard 754. there's a sign bit, an offset exponent (11 bits) and the rest is the mantissa (without the implicit lea

RE: comparing floting point numbers

2004-11-19 Thread Ed Chester
> I thought its just the same comparison as we normally do for numbers. so did i, so did the perldocs, so did the people who are quite happily comparing values like this. perhaps if you post your code people can have a stab at finding the problem? sorry thats not more useful. you're right. it s

RE: what does the '?" and ':" do?

2004-11-19 Thread Ed Chester
> I have the following code fragment, and i can't work out how the "?", > "<=>" and ":" operators in the 'foreach' line work. Any help would be > most appreciated. ? : are part of one operator ... eg. a ? b : c; evaluates a, and if true returns b otherwise returns c. of course, nested y

Re: How to insert picture(.jpe) into mysql database?

2004-11-03 Thread Ed Chester
In my opinion you have two choices: i) store the image in a binary BLOB field ii) store a reference to a filename in a sensible text field, and actually store the image in your normal filesystem Of these, I absolutely recommend (ii) and think that (i) is a disastrous thing to do. It will lead

RE: foreach ( hash element that maybe scalar, maybe array)

2004-11-02 Thread Ed Chester
Thanks for that Charles - > foreach my $bit ( values %bits ) { >if ( ref $bit eq 'ARRAY' ) { yep, that helps a lot. I didn't know ref existed, very useful. I am still a bit surprised there isn't a way that perl can just infer what to do from context like it usually does. Still, this opens u

foreach ( hash element that maybe scalar, maybe array)

2004-11-01 Thread Ed Chester
$thing\n"; } } Needless to say this didn't do what I wanted. Any tips very welcome, I know several of you who understand these things better than I do. I am once again happy to make myself look silly in the interests of educating the masses :) ed chester

RE: Command line Args

2004-10-31 Thread Ed Chester
> What is the best way to parse command line arguments so I can avoid > Use of uninitialized value in string eq at program.pl at line xx > There may be 0, 1 ,2 use GetOpt::Std; # for single-char options e.g. -s, -o=4 # or use GetOpt::Long;# for POSIX-like options, e.g. --verbose 5, --noQu

RE: question of regular expression

2004-10-28 Thread Ed Chester
i wrote, obviously with my eyes closed: > s/-x/''/; which of course should be s/-x//; - sorry! ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: question of regular expression

2004-10-28 Thread Ed Chester
> Could anyone let me know by using regular expression, how can I get rid of "-x"? If that's all you really want, and you know that's the only place it can occur, then its no problem to use just s/-x/''/; (substitute '-x' by '') ed c ___ Perl-Win32-U

RE: list of random integers

2004-10-26 Thread Ed Chester
Thanks to Bill and Charles for their input (output?) on the random list routine: both ideas have some useful stuff in. I'm still interested in rounding in general - what other functions/mods are out there? ed c ___ Perl-Win32-Users mailing list [EMA

list of random integers

2004-10-25 Thread Ed Chester
I can never get a random number in the list which is actually equal to the maximum value, $x. Ideally, I'd like the rounding direction to be random as well I guess, at the minute the distribution will be skewed towards 0. Any tips? Thanks, happy cod

perl / win32 / network setttings

2004-01-27 Thread Ed Chester
the actual _work_ - changing the network settings - I can't solve. any pointers much appreciated, ed chester national space centre, uk ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Perl editors

2003-09-22 Thread Ed Chester
> What's the best text editor for perl? what's your favourite editor for anything? use that. I find that anything that properly supports regular expression matching / replacing / etc. is good. on solaris/linux I tend to use nedit, on windoesnt either komodo (see below) or PFE. if on the othe