Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Asynchronous alert

Reply
Thread Tools

Asynchronous alert

 
 
* Tong *
Guest
Posts: n/a
 
      01-14-2007
Hi,

I'm trying to write an alert detection script.

Generally, the script loops to detect if the alert criteria is met,
and if so, alert the user. Somewhat like this:

for(;{
my $alerted;
my $flag=detect_flag
if($flag){
alert_user unless $alerted;
$alerted=1
}
}

The 'alert_user' can be as simple as a pop up window via Xdialog. Once the
alert goes off, it might take some time to resolve, but I don't want to
alert user again and again, hence the '$alerted' var. The problem is that
I need a way to clear the '$alerted' var. I think, to make it simple, the
best time is when the user confirm the alert pop up window.

Now, what's the easiest way to do it? The reason I wanted to use Xdialog is
because it's extreme easy to code, but I can't think of a way to clear the
'$alerted' var.

please help

thanks a lot

--
Tong (remove underscore(s) to reply)
http://xpt.sf.net/techdocs/
http://xpt.sf.net/tools/

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
 
 
 
* Tong *
Guest
Posts: n/a
 
      01-14-2007
On Sun, 14 Jan 2007 15:23:56 -0600, Mumia W. (NOSPAM) wrote:

>> I'm trying to write an alert detection script.
>>
>> Generally, the script loops to detect if the alert criteria is met,
>> and if so, alert the user. Somewhat like this:


my $alerted;
for(;{
my $flag=detect_flag
if($flag){
alert_user unless $alerted;
$alerted=1
}
}

>> The 'alert_user' can be as simple as a pop up window via Xdialog. Once the
>> alert goes off, it might take some time to resolve, but I don't want to
>> alert user again and again, hence the '$alerted' var. The problem is that
>> I need a way to clear the '$alerted' var. I think, to make it simple, the
>> best time is when the user confirm the alert pop up window.
>>
>> Now, what's the easiest way to do it? The reason I wanted to use Xdialog is
>> because it's extreme easy to code, but I can't think of a way to clear the
>> '$alerted' var.
>>
>> please help
>>
>> thanks a lot
>>

>
> Most probably, making $alerted a package variable will do it. You might
> also be able to solve the problem by putting "my $alerted" above the for
> loop.


thanks for the suggestion. please see above. Please note that, what I need
is the simplest solution.

> Since the program you posted is not complete, it's hard to comment
> further.


IMHO, as a *general purpose* *high-level* code snip, it is complete. What
only lacks is the way/mechanism to reset $alerted asynchronous, which I
don't know and is asking -- how to reset it determines how the alert_user()
is coded, and there is no need to dive into the detect_flag() at all.

thanks

--
Tong (remove underscore(s) to reply)
http://xpt.sf.net/techdocs/
http://xpt.sf.net/tools/

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
 
 
 
Mumia W. (NOSPAM)
Guest
Posts: n/a
 
      01-14-2007
On 01/14/2007 02:05 PM, * Tong * wrote:
> Hi,
>
> I'm trying to write an alert detection script.
>
> Generally, the script loops to detect if the alert criteria is met,
> and if so, alert the user. Somewhat like this:
>
> for(;{
> my $alerted;
> my $flag=detect_flag
> if($flag){
> alert_user unless $alerted;
> $alerted=1
> }
> }
>
> The 'alert_user' can be as simple as a pop up window via Xdialog. Once the
> alert goes off, it might take some time to resolve, but I don't want to
> alert user again and again, hence the '$alerted' var. The problem is that
> I need a way to clear the '$alerted' var. I think, to make it simple, the
> best time is when the user confirm the alert pop up window.
>
> Now, what's the easiest way to do it? The reason I wanted to use Xdialog is
> because it's extreme easy to code, but I can't think of a way to clear the
> '$alerted' var.
>
> please help
>
> thanks a lot
>


Most probably, making $alerted a package variable will do it. You might
also be able to solve the problem by putting "my $alerted" above the for
loop.

Since the program you posted is not complete, it's hard to comment further.

Posting Guidelines for comp.lang.perl.misc:
http://www.augustmail.com/~tadmc/clp...uidelines.html

--
Windows Vista and your freedom in conflict:
http://www.securityfocus.com/columnists/420/2
 
Reply With Quote
 
Mumia W. (NOSPAM)
Guest
Posts: n/a
 
      01-15-2007
On 01/14/2007 02:59 PM, * Tong * wrote:
> On Sun, 14 Jan 2007 15:23:56 -0600, Mumia W. (NOSPAM) wrote:
>
>>> I'm trying to write an alert detection script.
>>>
>>> Generally, the script loops to detect if the alert criteria is met,
>>> and if so, alert the user. Somewhat like this:

>
> my $alerted;


Doh! How did I miss that?

> for(;{
> my $flag=detect_flag
> if($flag){
> alert_user unless $alerted;
> $alerted=1
> }
> }
>
>>> The 'alert_user' can be as simple as a pop up window via Xdialog. Once the
>>> alert goes off, it might take some time to resolve, but I don't want to
>>> alert user again and again, hence the '$alerted' var. The problem is that
>>> I need a way to clear the '$alerted' var. I think, to make it simple, the
>>> best time is when the user confirm the alert pop up window.
>>>
>>> Now, what's the easiest way to do it? The reason I wanted to use Xdialog is
>>> because it's extreme easy to code, but I can't think of a way to clear the
>>> '$alerted' var.
>>>
>>> please help
>>>
>>> thanks a lot
>>>

>> Most probably, making $alerted a package variable will do it. You might
>> also be able to solve the problem by putting "my $alerted" above the for
>> loop.

>
> thanks for the suggestion. please see above. Please note that, what I need
> is the simplest solution.
>
>> Since the program you posted is not complete, it's hard to comment
>> further.

>
> IMHO, as a *general purpose* *high-level* code snip, it is complete. What
> only lacks is the way/mechanism to reset $alerted asynchronous, which I
> don't know and is asking -- how to reset it determines how the alert_user()
> is coded, and there is no need to dive into the detect_flag() at all.
>
> thanks
>


Under what conditions do you want to clear the $alerted flag?


--
Windows Vista and your freedom in conflict:
http://techdirt.com/articles/20061019/102225.shtml
 
Reply With Quote
 
* Tong *
Guest
Posts: n/a
 
      01-15-2007
On Mon, 15 Jan 2007 01:39:30 -0600, Mumia W. (NOSPAM) wrote:

>>>> I'm trying to write an alert detection script.
>>>>
>>>> Generally, the script loops to detect if the alert criteria is met,
>>>> and if so, alert the user. Somewhat like this:

>>
>> my $alerted;
>> for(;{
>> my $flag=detect_flag
>> if($flag){
>> alert_user unless $alerted;
>> $alerted=1
>> }
>> }
>>
>>>> The 'alert_user' can be as simple as a pop up window via Xdialog. Once the
>>>> alert goes off, it might take some time to resolve, but I don't want to
>>>> alert user again and again, hence the '$alerted' var. The problem is that
>>>> I need a way to clear the '$alerted' var. I think, to make it simple, the
>>>> best time is when the user confirm the alert pop up window.
>>>>
>>>> Now, what's the easiest way to do it? The reason I wanted to use Xdialog is
>>>> because it's extreme easy to code, but I can't think of a way to clear the
>>>> '$alerted' var.

>>
>> IMHO, as a *general purpose* *high-level* code snip, it is complete. What
>> only lacks is the way/mechanism to reset $alerted asynchronous, which I
>> don't know and is asking -- how to reset it determines how the alert_user()
>> is coded, and there is no need to dive into the detect_flag() at all.

>
> Under what conditions do you want to clear the $alerted flag?


I think, to make it simple, the best time is when the user confirm the
alert pop up window -- i.e., user click, pop up gone, $alerted cleared.

how is that?

--
Tong (remove underscore(s) to reply)
http://xpt.sf.net/techdocs/
http://xpt.sf.net/tools/

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Mumia W. (NOSPAM)
Guest
Posts: n/a
 
      01-16-2007
On 01/15/2007 03:42 PM, * Tong * wrote:
> On Mon, 15 Jan 2007 01:39:30 -0600, Mumia W. (NOSPAM) wrote:
>
>>>>> I'm trying to write an alert detection script.
>>>>>
>>>>> Generally, the script loops to detect if the alert criteria is met,
>>>>> and if so, alert the user. Somewhat like this:
>>> my $alerted;
>>> for(;{
>>> my $flag=detect_flag
>>> if($flag){
>>> alert_user unless $alerted;
>>> $alerted=1
>>> }
>>> }
>>>
>>>>> The 'alert_user' can be as simple as a pop up window via Xdialog. Once the
>>>>> alert goes off, it might take some time to resolve, but I don't want to
>>>>> alert user again and again, hence the '$alerted' var. The problem is that
>>>>> I need a way to clear the '$alerted' var. I think, to make it simple, the
>>>>> best time is when the user confirm the alert pop up window.
>>>>>
>>>>> Now, what's the easiest way to do it? The reason I wanted to use Xdialog is
>>>>> because it's extreme easy to code, but I can't think of a way to clear the
>>>>> '$alerted' var.
>>> IMHO, as a *general purpose* *high-level* code snip, it is complete. What
>>> only lacks is the way/mechanism to reset $alerted asynchronous, which I
>>> don't know and is asking -- how to reset it determines how the alert_user()
>>> is coded, and there is no need to dive into the detect_flag() at all.

>> Under what conditions do you want to clear the $alerted flag?

>
> I think, to make it simple, the best time is when the user confirm the
> alert pop up window -- i.e., user click, pop up gone, $alerted cleared.
>
> how is that?
>


You need to post an actual (short) program. The solution is not simply
conceptual.

Posting Guidelines for comp.lang.perl.misc:
http://www.augustmail.com/~tadmc/clp...uidelines.html


--
Windows Vista and your freedom in conflict:
http://www.badvista.org/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alert..General Alert?..New Discovery?. =?Utf-8?B?U3BhbW1lcipLaWxsZXI=?= Wireless Networking 0 07-24-2007 03:36 PM
on click in popup window throws alert : need to avoid alert of postdata Ganesh ASP .Net 0 06-29-2007 06:51 AM
How to create a form Alert - Not using Alert Boxes Mersh Java 0 03-13-2007 04:14 PM
ALERT: Virus Scam Alert! Toronto Garage Door Company Computer Support 1 11-18-2003 04:16 PM
asynchronous design Amir VHDL 3 10-10-2003 02:10 PM



Advertisments