Native Balloon help

2004-11-11 Thread gerhard . petrowitsch




Hi all,

is there a way to use the nice balloon or bubble shaped windows
(e.g. used by the office assistant - see attached image)
on WinXP in a GUI (Perl/Tk), perhaps using some Win32::API call
or so?

Thanks for any hints!
Regards,
Gerhard

(See attached file: bubble.gif)<>___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: A regular expression question

2004-11-11 Thread $Bill Luebkert
Ted Schuerzinger wrote:

> Cai, Lixin (L.) graced perl with these words of wisdom:
> 
> 
>>My $string = "sct-1.62-1";
>>
>>I have 2 regular expression question here,
>>
>>A. I want to check whether the format is "XXX-XXX-XXX", how can I do it?

This format doesn't actually match the example given.  Maybe he
meant 'AAA-N.NN-N[NN]' or something similar (where [] means optional).

>>B. I want to get 1.62 from the string, how can I do it?
> 
> 
> Nobody seems to have answered part B. 

Actually they did.  Sam's for one :

$string = "sct-1.62-1";
print "$1\n" if ($string =~ /^.+-(.+)-.+$/);

> So, assuming you want the middle
> part (ie, the section between the two dashes), use something like the 
> following (untested):
> 
> 
> 
> my ($string, @line);
> 
> $string = "sct-1.62-1";
> @line = split /-/, $string;
> print $line[1];
> 
> 
> 


-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: threads::shared

2004-11-11 Thread $Bill Luebkert
Paul Sobey wrote:

> I'm using XML::Simple to read in two files, and generate two hashrefs. I
> want to combine these two into a big hashref, like this:
>  
> my $combined = { %{$a}, %{$b} };
>  
> This works fine, until I want to share the $combined hash to make it
> visible across several threads.
>  
> As an example, consider the following:
>  
> use threads;
> use threads::shared;
>  
> 
> my $TestHash = {
>  bla => "bla",
>  wibble => [ "wibble", "wibble" ],
>  blargh => {
>   I => "Really",
>   Wish => "This",
>   Would => "Work"
>  }
> };
>  
> my $TestHash2 : shared;
>  
> $TestHash2 = $TestHash;

I tried reading the docs for shared and they are cryptic at best - try :

my $TestHash2 = &share({});
$TestHash2 = $TestHash;

in place of the above two lines.  I don't understand the syntax at all.

> This fails in my system with the error "Invalid value for shared scalar
> at D:\scripts\thread2.pl line 17.". I can understand why this should
> cause problems, since none of the nested references are themselves
> marked as shared. How can I generate a shared version of the hashes that
> I can pass around between the threads? I was considering some sort of
> recursion through the structure, creating new :shared copies of each value?

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: A regular expression question

2004-11-11 Thread Ted Schuerzinger
Cai, Lixin (L.) graced perl with these words of wisdom:

> My $string = "sct-1.62-1";
> 
> I have 2 regular expression question here,
> 
> A. I want to check whether the format is "XXX-XXX-XXX", how can I do it?
> B. I want to get 1.62 from the string, how can I do it?

Nobody seems to have answered part B.  So, assuming you want the middle 
part (ie, the section between the two dashes), use something like the 
following (untested):



my ($string, @line);

$string = "sct-1.62-1";
@line = split /-/, $string;
print $line[1];



-- 
Ted 
Barney: Hey, Homer, you're late for English.
Homer: Who needs English?  I'm never going to England.  

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Controlling fonts in Tk

2004-11-11 Thread Maurice Height
Hi all,

My setup is Activeperl v5.8.4 build 810, Tk v804.026 running on Win2K.
I wrote a little test program that uses Tk to display a window with
a menubar along the top.  I have tried to adjust fonts globally for the Menu
but the code at lines 15 and 19 has had no effect, see:
# HAS NO EFFECT!
The code on line 24 works OK but I want to change the font for the entire
menu including the label 'File'.
Can anybody point me in the right direction?

# Menu.pl
use strict;
use warnings;
use Tk;

my $mw  = MainWindow->new(-title  => 'Testing Tk::Menu',
  -width  => 500,
  -height => 300,
  -background => 'yellow',
  -name   => 'Demo',
 );
$mw->minsize(500,300);

my $menubar = $mw->Menu(-type => 'menubar',
-font => "Verdana 14 bold",  # HAS NO EFFECT!
   );

$mw->configure(-menu => $menubar);
$menubar->configure(-font => "Verdana 14 bold"); # HAS NO EFFECT!

my $m1 = $menubar->cascade
 (  -label => 'File',
-tearoff   => 0,
-menuitems => [[Button => 'New',  -font=> "Verdana 16 bold",
  -command =>
\&create_new_file ],
   [Button => 'Open', -command =>
_file   ],
   [Button => 'Exit', -command => sub
   ],
  ]
 );

MainLoop;

sub create_new_file { print "create_new_file...\n"; }

sub open_file   { print "open_file...\n"; }

__END__



Thanks in advance
Maurice


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: A regular expression question

2004-11-11 Thread Gardner, Sam
Title: Message



or 
even. . .
 
$string = "sct-1.62-1";print 
"$1\n" if ($string =~ /^.+-(.+)-.+$/);
 
(no 
need to use the backslash escape for the dashes; they're not part of a character 
class. . .
 
 


  
  

  Sam 
  Gardner
  

  GTO Application Development
  

  Keefe, Bruyette & Woods, Inc.
  

  212-887-6753

  
  -Original Message-From: Peter Eisengrein 
  [mailto:[EMAIL PROTECTED] Sent: Thursday, November 11, 2004 
  2:52 PMTo: 'Cai, Lixin (L.)'; 
  [EMAIL PROTECTED]Subject: RE: A regular 
  _expression_ question
  Your format does not match XXX-XXX-XXX so I'll guess you mean three 
  fields delimited by a dash.
   
   here's one way to do it
   
  $string = "sct-1.62-1"; 
  print "$1\n" if ($string =~ /^.+\-(.+)\-.+$/)
   
   
   
   
   
  
-Original Message-From: Cai, Lixin (L.) 
[mailto:[EMAIL PROTECTED]Sent: Thursday, November 11, 2004 2:37 
PMTo: 
[EMAIL PROTECTED]Subject: A regular 
_expression_ question
 Now I have a string like 
My $string = "sct-1.62-1"; 
I have 2 regular _expression_ question here, 

A. I want to check whether the format is 
"XXX-XXX-XXX", how can I do it? B. I want 
to get 1.62 from the string, how can I do it? 
Thanks a lot in advance! 
Lixin 
Lixin Cai Security 
Compliance Tools(SCT) Location: ITek 2WC135 Phone:313-317-4906 email: [EMAIL PROTECTED] 

 



Message transport security by 
GatewayDefender2:40:28 PM ET - 
11/11/2004
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: A regular expression question

2004-11-11 Thread Peter Eisengrein
Title: A regular expression question



Your format does not match XXX-XXX-XXX so I'll guess you mean three 
fields delimited by a dash.
 
 here's one way to do it
 
$string = "sct-1.62-1"; 
print "$1\n" if ($string =~ /^.+\-(.+)\-.+$/)
 
 
 
 
 

  -Original Message-From: Cai, Lixin (L.) 
  [mailto:[EMAIL PROTECTED]Sent: Thursday, November 11, 2004 2:37 
  PMTo: [EMAIL PROTECTED]Subject: 
  A regular _expression_ question
   Now I have a string like 
  My $string = "sct-1.62-1"; 
  I have 2 regular _expression_ question here, 
  
  A. I want to check whether the format is 
  "XXX-XXX-XXX", how can I do it? B. I want 
  to get 1.62 from the string, how can I do it? 
  Thanks a lot in advance! 
  Lixin 
  Lixin Cai Security Compliance 
  Tools(SCT) Location: ITek 
  2WC135 Phone:313-317-4906 email: [EMAIL PROTECTED] 
  
   
  
  
  
  Message transport security by 
  GatewayDefender2:40:28 PM ET - 
11/11/2004
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


A regular expression question

2004-11-11 Thread Cai, Lixin \(L.\)
Title: A regular expression question






 Now I have a string like 


My $string = "sct-1.62-1";


I have 2 regular _expression_ question here,


A. I want to check whether the format is "XXX-XXX-XXX", how can I do it?

B. I want to get 1.62 from the string, how can I do it?


Thanks a lot in advance!


Lixin



Lixin Cai

Security Compliance Tools(SCT)

Location: ITek 2WC135

Phone:313-317-4906

email: [EMAIL PROTECTED]



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::OLE - Threadsafe?

2004-11-11 Thread Jan Dubois
On Thu, 11 Nov 2004, Jeff Griffiths wrote:
> Paul Sobey wrote:
>> Just realised if you turn that use into a require Win32::OLE after
>> the threads have been spawned, it works ok. Anyone know why this
>> should be so? I thought I read somewhere that Win32::OLE was
>> threadsafe but it seems not!
>
> Seeing as Jan occasionally mentions that he wuld like to make it
> thread-safe, I doubt somehow that it currently is.

You are right, it is not yet thread-safe.  It is possible that it will
mostly work if it is only loaded within worker threads and no new threads
are created from these worker threads, but there may still be cleanup
issues.

It *is* still on my list, but I can't promise when I'll implement this.

Cheers,
-Jan


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32::OLE - Threadsafe?

2004-11-11 Thread Jeff Griffiths

Paul Sobey wrote:
Just realised if you turn that use into a require Win32::OLE after
the threads have been spawned, it works ok. Anyone know why this
should be so? I thought I read somewhere that Win32::OLE was
threadsafe but it seems not!
Seeing as Jan occasionally mentions that he wuld like to make it 
thread-safe, I doubt somehow that it currently is.

cheers, JeffG
P.
-Original Message- From: $Bill Luebkert
[mailto:[EMAIL PROTECTED] Sent: 11 November 2004 00:49 To: Paul
Sobey Cc: [EMAIL PROTECTED] Subject: Re:
Win32::OLE - Threadsafe?
Paul Sobey wrote:

Hi Guys,
On my machine (AP 5.8.4), the following code runs fine when the use
 Win32::OLE line is commented, but throws an exception at the end
when it is not. Anybody know why? Am I doing something silly, or is
this module known to have problems with threads?
Cheers, Paul
use threads; use threads::shared; use Thread::Semaphore; use
Thread::Queue; use Win32::OLE;
my $q = new Thread::Queue; my $s = new Thread::Semaphore;
for (1..1000) { $q->enqueue($_); }
my $threads = 4;

my @threads;

for (1..$threads) { print "Spawning thread $_\n"; push @threads,
new threads(\&testing); }
for (@threads) { my $tid = $_->tid; my $result = $_->join; print
"Got Result from $tid - $result\n"; }

sub testing { my $tid = threads->self->tid; my $val; while ($val =
$q->dequeue_nb) { print "Thread ID: $tid\tValue $val\n"; 
threads->yield(); } return "Woohoo!"; }

I got similar :
Spawning thread 1 Spawning thread 2 Spawning thread 3 Spawning thread
4 Thread ID: 1Value 1 Thread ID: 2Value 2 Thread ID: 3
Value 3 ... Thread ID: 1Value 998 Thread ID: 4Value 999 
Thread ID: 3Value 1000 Got Result from 1 - Woohoo! Got Result
from 2 - Woohoo! Got Result from 3 - Woohoo! Got Result from 4 -
Woohoo! Free to wrong pool 1a8c140 not 225f90 during global
destruction. Segmentation fault(v5.8.3 B809 on XP Pro SP2)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


threads::shared

2004-11-11 Thread Paul Sobey



I'm using XML::Simple to read in two files, and generate two hashrefs. I want to combine 
these two into a big hashref, like this:
 
my $combined = { 
%{$a}, %{$b} };
 
This works fine, 
until I want to share the $combined hash to make it visible across several threads.
 
As an example, 
consider the following:
 
use threads;use 
threads::shared;
 
my $TestHash = 
{ bla => "bla", wibble => [ "wibble", "wibble" ], blargh => {  I => "Really",  Wish 
=> "This",  Would => "Work" }};
 
my $TestHash2 : shared;
 
$TestHash2 = $TestHash;
 
This fails in my 
system with the error "Invalid value for shared scalar at D:\scripts\thread2.pl 
line 17.". I can understand why this should cause problems, since none of the 
nested references are themselves marked as shared. How can I generate a shared 
version of the hashes that I can pass around between the threads? I was 
considering some sort of recursion through the structure, creating new :shared 
copies of each value?
 
Thanks in advance,
Paul

*
Gloucester Research Limited believes the information 
provided herein is reliable. While every care has been 
taken to ensure accuracy, the information is furnished 
to the recipients with no warranty as to the completeness 
and accuracy of its contents and on condition that any 
errors or omissions shall not be made the basis for any 
claim, demand or cause for action.
*


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: sockets 101

2004-11-11 Thread Rhesa Rozendaal
Hon Shi wrote:
We have a few monitors that need to connect
to a central status controller (lights buzzers mail).
The monitors have left status files up to now, but this is mess.
I'm thinking that sockets might be a fix.
Each monitor connects to the status controller and
sends messages.  I've done Java programs with listeners
so I understand the concept.
What I need is an example suite - some examples of how
this is done.  Get me off the dime.  Thanks
Have a look at POE. In particular the POE::Component::IKC stuff is 
relevant to your situation.
See http://poe.perl.org for details and sample code.

Rhesa
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


sockets 101

2004-11-11 Thread Hon Shi
We have a few monitors that need to connect
to a central status controller (lights buzzers mail).
The monitors have left status files up to now, but this is mess.

I'm thinking that sockets might be a fix.

Each monitor connects to the status controller and
sends messages.  I've done Java programs with listeners
so I understand the concept.

What I need is an example suite - some examples of how
this is done.  Get me off the dime.  Thanks

xp/2k active 5.8





__ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32::OLE - Threadsafe?

2004-11-11 Thread Paul Sobey
Just realised if you turn that use into a require Win32::OLE after the threads 
have been spawned, it works ok. Anyone know why this should be so? I thought I 
read somewhere that Win32::OLE was threadsafe but it seems not!

P.
 

-Original Message-
From: $Bill Luebkert [mailto:[EMAIL PROTECTED] 
Sent: 11 November 2004 00:49
To: Paul Sobey
Cc: [EMAIL PROTECTED]
Subject: Re: Win32::OLE - Threadsafe?

Paul Sobey wrote:

> Hi Guys,
>  
> On my machine (AP 5.8.4), the following code runs fine when the use
> Win32::OLE line is commented, but throws an exception at the end when it
> is not. Anybody know why? Am I doing something silly, or is this module
> known to have problems with threads?
>  
> Cheers,
> Paul
>  
>  
> use threads;
> use threads::shared;
> use Thread::Semaphore;
> use Thread::Queue;
> use Win32::OLE;
>  
> my $q = new Thread::Queue;
> my $s = new Thread::Semaphore;
>  
> for (1..1000) {
>  $q->enqueue($_);
> }
>  
> my $threads = 4;

my @threads;

> for (1..$threads) {
>  print "Spawning thread $_\n";
>  push @threads, new threads(\&testing);
> }
>  
> for (@threads) {
>  my $tid = $_->tid;
>  my $result = $_->join;
>  print "Got Result from $tid - $result\n";
> }
>  
>  
>  
> sub testing {
>  my $tid = threads->self->tid;
>  my $val;
>  while ($val = $q->dequeue_nb) {
>   print "Thread ID: $tid\tValue $val\n";
>   threads->yield();
>  }
>  return "Woohoo!";
> }

I got similar :

Spawning thread 1
Spawning thread 2
Spawning thread 3
Spawning thread 4
Thread ID: 1Value 1
Thread ID: 2Value 2
Thread ID: 3Value 3
...
Thread ID: 1Value 998
Thread ID: 4Value 999
Thread ID: 3Value 1000
Got Result from 1 - Woohoo!
Got Result from 2 - Woohoo!
Got Result from 3 - Woohoo!
Got Result from 4 - Woohoo!
Free to wrong pool 1a8c140 not 225f90 during global destruction.
Segmentation fault(v5.8.3 B809 on XP Pro SP2)

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)



*
Gloucester Research Limited believes the information 
provided herein is reliable. While every care has been 
taken to ensure accuracy, the information is furnished 
to the recipients with no warranty as to the completeness 
and accuracy of its contents and on condition that any 
errors or omissions shall not be made the basis for any 
claim, demand or cause for action.
*


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: UNIX utilities in Perl

2004-11-11 Thread Richard Scott
http://unxutils.sourceforge.net/
always this sort of thing too, if that will help

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs