TV Show monitoring.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

TV Show monitoring.

ricks03

Hi!

I'm using MH to list the current shows on the air (in the ia5
interface) and except for some quirkyness of late (as previously
discussed on this list) it's been pretty good.

However, I just received the "Favorite show starting now"
announcement, for a show that isn't listed in the ia5 interface on
that channel. Shouldn't they both be the same information?

Rick



Rick Steeves
[hidden email]                               http://www.sinister.net



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

NWE
Reply | Threaded
Open this post in threaded view
|

Perl coding problem

NWE
Perl coding problem

Hi All,

After a bit of help please.
I have a modem that I use for caller id and I also have a OSD (On Screen Display).
The bottom 3 lines of the OSD display the last three incoming calls (Names and phone numbers).
Basically the OSD acts like a 3 line FIFO. As each call comes in, the current lines are shuffled down with the bottom one falling off and the new number is placed at the top.

The problem is that sometimes the OSD is not getting updated.

I'm very new to Perl so this is know doubt where the problem lies.

I have the following code I have written in a callerid file to save the last callerid info.

#=========================================================================
    if ($Time - $Save{phone_callerid_Time} < 3) {
            $Save{phone_callerid_data} = sprintf("%02d:%02d %s\n%s", $Hour, $Minute, $p_setby->cid_name(),$p_setby-> cid_number());

            $Save{phone_callerid_Time} = $Time;
            $Save{phone_callerid} = sprintf("%02d:%02d %s", $Hour, $Minute, $p_setby->cid_name());
            #print_log "cid test";
    }
            $Save{phone_callerid_data} = sprintf("%02d:%02d %s\n%s", $Hour, $Minute, $p_setby->cid_name(),$p_setby->cid_number());

            $Save{phone_callerid} = sprintf("%02d:%02d %s %s", $Hour, $Minute, $p_setby->cid_name(),$p_setby->cid_number());

            $Save{phone_callerid_Time} = $Time;
            $Save{zebra} = "cows";
}
#=========================================================================

It then generates the entries in the following state file
#=========================================================================
%Persistent = (
                'timers' => []
              );
%Save = (
          'line6' => '19:20 Forresters 02xxxxxxxx',
          'phone_callerid' => '19:20 Forresters 02xxxxxxxx',
          'mode' => 'normal',
          'web_count_default' => 1505,
          'sleeping_kids' => 0,
          'photo_index' => 3,
          'phone_callerid_data' => '19:20 Forresters
02xxxxxxxx',
          'phone_callerid_data_prev' => '19:20 Forresters
02xxxxxxxx',
          'line7' => '14:52 Eevy Preegal 02xxxxxx',
          'phone_callerid_Time' => 1137745216,
          'Time_Saved' => '22/01/06 20:42:00 ',
          'photo_index_time' => 1137914482,
          'email_flag' => '',
          'zebra' => 'cows',
          'line8' => '13:05  0249217399          ',
          'mh_exit' => 'abend',
          'sleeping_parents' => 0
        );
#=========================================================================

I beleive the problem is related to the incoming calls from the Forresters. These have CR,LF's (#13,#10) in them ??
Yet the entry in the "phone.caller_id.list" does not have CR,LF's mid line
I.e.
02xxxxxxxx      Forresters              *               friend


When everything is operating correctly the state file does not have any CR's part way through the line.
Lines with "Line8" and "Line7" are the normal format.
The lines following lines I believe to be corrupt. These are the last number called lines.
          'phone_callerid_data' => '19:20 Forresters
02xxxxxxxx',
          'phone_callerid_data_prev' => '19:20 Forresters
02xxxxxxxx',



This is my OSD code

#=========================================================================
if (new_second 1 and inactive $lcd1) {
my ($line1, $line2, $line3, $line4, $line5, $line6, $line7, $line8, $line9, $line10, $line11);
  $line1 = &time_date_stamp(14, $Time);
  $line1 = right_pad_str($line1,26," ");
  $line2 = right_pad_str("Current Temperature:$Weather{TempInternet}",27," ");
  $line3 = right_pad_str("Forecast:$Weather{Forecast}",27," ");
  $line4 = right_pad_str("Forecast Max Temp:$Weather{ForecastMaxTemp}",27," ");
  $line5 = fill_str(27,"-");
  if ((substr($Save{phone_callerid},0,8)) ne (substr($Save{line6},0,8))) { # New number, move every thing down 1 line.
    $line8 = $line7;
    $line7 = $line6;
    $line6 = substr($Save{phone_callerid}.fill_str(27," "),0,27);
    #print_log "same";
  }
  else {
    $line6 = right_pad_str($Save{phone_callerid},27," ");
    $line7 = $Save{line7};
    $line8 = $Save{line8};
  }

  $line9 = fill_str(27,"-");
  $line10 = substr("MP3 Player Status - $mp3playing".'                              ',0,27);
  $line11 = "$Save{NowPlaying}";
  #$line9 = "$Save{NowPlaying}";
 
  set $lcd1 $line1, $line2, $line3, $line4, $line5, $line6, $line7, $line8, $line9, $line10, $line11;
  $Save{line6} = $line6;
  $Save{line7} = $line7;
  $Save{line8} = $line8;

}
#=========================================================================


This is the culprit compare in the above
  if ((substr($Save{phone_callerid},0,8)) ne (substr($Save{line6},0,8))) { # New number, move every thing down 1 line.

It does not appear to be related to any specific number/name combination, after fixing the state file the Forresters could ring again and all would be fine??

Can I somehow strip out the CR,LF's prior to saving the state?



Regards,

Neil Wrightson.


Reply | Threaded
Open this post in threaded view
|

RE: Perl coding problem

Clive Freedman
>  Can I somehow strip out the CR,LF's prior to saving the state?

This will remove CRs (= \r) and LFs (= \n) from $string:

$string =~ s/[\r\n]//gs;

I hope this helps.

Clive




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365