Re: text-to-speech

2005-07-25 Thread Octavian Rasnita
From: "Chris" <[EMAIL PROTECTED]> Subject: RE: text-to-speech > > I would like to use Viavoice, because it is more clear than MS > text-to-speech, and I am blind, so I would like to use it in some > applications. > > > Teddy > > > Um Not to be insensitive. But this makes no sense at all

RE: Split function in Perl

2005-07-25 Thread robert
> -Original Message- > From: $Bill Luebkert > Sent: Monday, July 25, 2005 9:30 PM > > s/"([^"]+) ([^"]+)"/$1\000$2/g; holy cow. can you explain that substitution? my brain just about popped. > > my @a = split / +/; > > foreach (@a) { > s/\000/ /g; # restore e

RE:

2005-07-25 Thread robert
> -Original Message- > From: Rajesh Vattem > Sent: Monday, July 25, 2005 9:19 PM > > > Hi Robert, > If you open a hyper terminal and see the baud rate supported > you can see that 921600 is a supported value. If I use a USB > to serial converter to support such speed, is there any per

Re: Split function in Perl

2005-07-25 Thread $Bill Luebkert
Michael Louie Loria wrote: > Hello, > > I have a problem with the split function. > > string > - - - > one "two three" "four five" six seven > > should be split to > - - - > one > two three > four five > six > seven > > > string > - - - > one two three four five six seven > > should be split

Re: references - inject sub/params into longterm running thread

2005-07-25 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > hi there > > basically...I have instantiated long term running thread/s. > > in the main thread, i want to pass a subroutine (code ref) and its parameters > into a threads::shared variable, then execute it in a separate thread running > in a while loop. > > I want t

RE: references - inject sub/params into longterm running thread

2005-07-25 Thread John Serink
If you use shared arrays or hashes, Win32 perl will leak handles if you use threads. It will leak 2 handles per thread. If you're only starting say a couple of threads an hour, no problem. If you're starting hindreds, within a week or so, you'll run out of resource space for the process and it will

RE: Split function in Perl

2005-07-25 Thread Darrell Gammill
http://search.cpan.org/~nwclark/perl-5.8.7/lib/Text/ParseWords.pm -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Louie Loria Sent: Monday, July 25, 2005 9:57 PM To: perl-win32-users@listserv.ActiveState.com Subject: Split function in Perl -BEGI

RE: references - inject sub/params into longterm running thread

2005-07-25 Thread mailware
hi there basically...I have instantiated long term running thread/s. in the main thread, i want to pass a subroutine (code ref) and its parameters into a threads::shared variable, then execute it in a separate thread running in a while loop. I want to do this, because having a group of a coupl

Split function in Perl

2005-07-25 Thread Michael Louie Loria
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello, I have a problem with the split function. string - - - one "two three" "four five" six seven should be split to - - - one two three four five six seven string - - - one two three four five six seven should be split to - - - one two thre

RE:

2005-07-25 Thread robert
> -Original Message- > From: Rajesh Vattem > Sent: Monday, July 25, 2005 7:21 AM > > Hi, > I am using Win32 serial port APIs in Active perl 5.8.2 for > opening COM port. I am getting this error when I open the COM > port with a different baud rate > (eg: 921600). It works fine with bau

RE: comparing floating point numbers

2005-07-25 Thread robert
-Original Message- From: James Sluka Sent: Monday, July 25, 2005 9:11 AM > Robert's solution (rounding with sprintf) is pretty good, except it > requires that you know something about the numbers. you are correct about the limitations of floating point accuracy, but in this case you ar

Re: comparing floating point numbers

2005-07-25 Thread len boyle
Hello Mike I just saw this site referenced today, they have a large list of other sites: http://www-128.ibm.com/developerworks/library/pa-bigiron1/?ca=dnt-65 Also look at the web site for Mike Cowlishaw who wrote software packages to deal with Decimal Floating-Point. See also a Dr Dobbs for

RE: references of sub and params in a threads::shared variable

2005-07-25 Thread John Serink
Yup. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of [EMAIL PROTECTED] > Sent: Tuesday, July 26, 2005 6:10 AM > To: Siebe Tolsma > Cc: perl-win32-users@listserv.ActiveState.com > Subject: references of sub and params in a threads::shared variable

RE: references

2005-07-25 Thread John Serink
Why don't you pass the parameters as references. They work like pointers in C kindof. Why do you want to reference your subroutine? > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of [EMAIL PROTECTED] > Sent: Tuesday, July 26, 2005 2:19 AM > To

Re: voice

2005-07-25 Thread $Bill Luebkert
Sisyphus wrote: > speak() needs a second argument. Make it: > > $voice->speak("hello world", 0); > > With that change in place, it works ok for me on Windows 2000. Works for me with/without a second arg (using 'SAPI.SpVoice' class on XP). -- ,-/- __ _ _ $Bill LuebkertMail

Re: voice

2005-07-25 Thread Sisyphus
- Original Message - From: "Octavian Rasnita" <[EMAIL PROTECTED]> To: Sent: Monday, July 25, 2005 11:11 PM Subject: voice > Hi, > > I have tried the following script under Windows 2000 (probably SAPI 4), but > it doesn't speak anything. > > Can you give me the right code? > > Thank you

Re: references

2005-07-25 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > hello again, > > let me clarify my problem. > > I have a reference of a subroutine. > > eg. > > $sub = "test"; Better expressed like this: my $subref = \&test; > ..deref and execute > > &$sub; > > ... > > sub test { > my ($sockethandle,$blah...) = @_; > ..do so

Re: voice

2005-07-25 Thread $Bill Luebkert
Octavian Rasnita wrote: > Hi, > > I have tried the following script under Windows 2000 (probably SAPI 4), but > it doesn't speak anything. > > Can you give me the right code? This works for me and you may need to D/L the speech SDK (see notes at end): #!perl -w -- use strict; use Win32; use W

references of sub and params in a threads::shared variable

2005-07-25 Thread mailware
how do i use this hash as a shared variable to be used in threads? eg. with threads::shared -Jeremy A > Why not make it a hash? > > my $sub = { ref => \&test, params => [$sockethandle] }; > $sub->{ref}->(@{$sub->{params}}); > > sub test { > my $socket = shift; > # ... > } > > > > hello again,

RE: text-to-speech

2005-07-25 Thread Chris
> I would like to use Viavoice, because it is more clear than MS text-to-speech, and I am blind, so I would like to use it in some applications. > Teddy Um Not to be insensitive. But this makes no sense at all. If you are blind to the point that you need to have text narrated, how do y

(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

text-to-speech

2005-07-25 Thread Octavian Rasnita
Hi, I have found the following script example that can speak a text using the standard MS text-to-speech sinthesizer. It works fine. I am using Windows 2000, and I have the Narrator screen reader installed and it uses MS text-to-speech, but I have also installed IBM ViaVoice sinthesizer for Windo

Re: references

2005-07-25 Thread Siebe Tolsma
Why not make it a hash? my $sub = { ref => \&test, params => [$sockethandle] }; $sub->{ref}->(@{$sub->{params}}); sub test { my $socket = shift; # ... } - Original Message - From: <[EMAIL PROTECTED]> To: "$Bill Luebkert" <[EMAIL PROTECTED]> Cc: Sent: Monday, July 25, 2005 8:19 PM Subje

RE: comparing floating point numbers

2005-07-25 Thread Arms, Mike
Ed Chester <[EMAIL PROTECTED]> wrote: > 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 floating point > standard (IEEE #754) for

references situation

2005-07-25 Thread mailware
hello again, > > hello all, > > > > here is a ref/deref problem > > > > I need to take a socket handle, convert it to a socket ref, then a scaler > > string > > > > A bit later in the same script, I need to take that scaler string and turn > it > > back to a socket ref, and deref it back to

Re: references

2005-07-25 Thread mailware
hello again, > > hello all, > > > > here is a ref/deref problem > > > > I need to take a socket handle, convert it to a socket ref, then a scaler > > string > > > > A bit later in the same script, I need to take that scaler string and turn > it > > back to a socket ref, and deref it back to

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-25 Thread James Sluka
<>Robert's solution (rounding with sprintf) is pretty good, except it requires that you know something about the numbers. For example, they must differ by more than 0.01 to be considered different. What happens when the two numbers are;   0.101   0.100 Now you need to check fo

Re: voice

2005-07-25 Thread Reinhard Pagitsch
Hi, Octavian Rasnita wrote: Hi, I have tried the following script under Windows 2000 (probably SAPI 4), but it doesn't speak anything. Can you give me the right code? Thank you much. Teddy use strict; use Win32::OLE; my $voice = Win32::OLE->new("Speech.VoiceText"); $voice->Register('', '

RE:

2005-07-25 Thread Rajesh Vattem
Hi, I am using Win32 serial port APIs in Active perl 5.8.2 for opening COM port. I am getting this error when I open the COM port with a different baud rate (eg: 921600). It works fine with baud rate 115200. The way I open the COM port is print STDOUT "Number of testcases: $ARGV[0]\n"; $config_fi

voice

2005-07-25 Thread Octavian Rasnita
Hi, I have tried the following script under Windows 2000 (probably SAPI 4), but it doesn't speak anything. Can you give me the right code? Thank you much. Teddy use strict; use Win32::OLE; my $voice = Win32::OLE->new("Speech.VoiceText"); $voice->Register('', 'Perl'); $voice->speak("hello wor

RE: activeperl + mysql + threads = crash

2005-07-25 Thread Paul Sobey
> I thought I can hit a nice milestone today, but it seems that > I have hit > a strange obstacle instead. > In my tests, the following code will run, but when it terminates an > error message will be shown. > use strict; > use warnings; > use DBI; > use threads; > > doIt(); > doIt(); [snip]

Re: activeperl + mysql + threads = crash

2005-07-25 Thread Reinhard Pagitsch
--- Begin Message --- Hello, I made an additional test: Using the code below Perl v5.8.7 does not crash. In the Task Manager I can see that Perl uses 3 threads. With the original code he uses only one thread. --- new code -- use strict; use warnings; use DBI; use t

Re: activeperl + mysql + threads = crash

2005-07-25 Thread Foo Ji-Haw
Hello Reinhard, Thanks for confirming my concerns. So you say that on 5.6.x it is ok, but not on 5.8.x. But threading + mysql is quite a powerful combination to give up! I wonder if anybody in this mailing list has a workaround/ solution. Reinhard Pagitsch wrote: Hello, I tryed it also wi

Re: activeperl + mysql + threads = crash

2005-07-25 Thread Reinhard Pagitsch
Hello, I tryed it also with Perl v5.8.7 and had the same prroblem as you, on the 2nd doIt Perl crashes. I also found out that Perl crashes in the DBI.pm sub "disconnect_all". Removing "use threads;" it works. regards, Reinhard Foo Ji-Haw wrote: Hello Reinhard, I am using 5.8.6 of ActivePe

Re: comparing floating point numbers

2005-07-25 Thread robert
use "sprintf" to set the floating point field to 2 decimal places. (or more, if you want them...) $float1=-135.176# final values before rounding $float2=-135.184 $float1=sprintf("%.2f",$float1);# force $float1 to be rounded at 2 decimal places $float2=sprint

activeperl + mysql + threads = crash

2005-07-25 Thread Foo Ji-Haw
Hi all, I thought I can hit a nice milestone today, but it seems that I have hit a strange obstacle instead. In my tests, the following code will run, but when it terminates an error message will be shown. use strict; use warnings; use DBI; use threads; doIt(); doIt(); sub doIt { my $dbh =

RE: comparing floating point numbers

2005-07-25 Thread robert
use "sprintf" to set the floating point field to 2 decimal places. (or more, if you want them...) $float1=-135.176# final values before rounding $float2=-135.184 $float1=sprintf("%.2f",$float1);# force $float1 to be rounded at 2 decimal places $float2=sprintf

RE: comparing floating point numbers

2005-07-25 Thread robert
On Sunday, July 24, 2005 at 6:11 PM, Ken Barker wrote: > > What kind of post is this? > > I do not see that anything was added at all. Give us all a > break - don't > bother - whatever your intentions. > well, don't you feel stupid now? > > At 06:35 PM 7/24/2005, $Bill Luebkert wrote:

re: comparing floating point numbers

2005-07-25 Thread Chris Wagner
At 04:07 PM 7/24/05 -0400, John Deighan wrote: >Sorry about the lack of sample code, but I know that people who work >with floating point numbers know about this problem, and I was >wondering what the best solution was. Here is sample code with Well ur right, the easy answer is to do the $diff

Re: comparing floating point numbers

2005-07-25 Thread Chris Wagner
At 10:40 PM 7/24/05 -0400, Ted Schuerzinger wrote: >Ken Barker graced perl with these words of wisdom: >> What kind of post is this? >It was an informative help post, made especially informative and helpful >by the fact that the relevant material was included at the relevant point >in the code, a