Search Results

Search found 302 results on 13 pages for 'alarm'.

Page 4/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How do you make a Factory that can return derived types?

    - by Seth Spearman
    I have created a factory class called AlarmFactory as such... 1 class AlarmFactory 2 { 3 public static Alarm GetAlarm(AlarmTypes alarmType) //factory ensures that correct alarm is returned and right func pointer for trigger creator. 4 { 5 switch (alarmType) 6 { 7 case AlarmTypes.Heartbeat: 8 HeartbeatAlarm alarm = HeartbeatAlarm.GetAlarm(); 9 alarm.CreateTriggerFunction = QuartzAlarmScheduler.CreateMinutelyTrigger; 10 return alarm; 11 12 break; 13 default: 14 15 break; 16 } 17 } 18 } Heartbeat alarm is derived from Alarm. I am getting a compile error "cannot implicitly convert type...An explicit conversion exists (are you missing a cast?)". How do I set this up to return a derived type? Seth

    Read the article

  • How can I get the output of a command terminated by a alarm() call in Perl?

    - by rockyurock
    Case 1 If I run below command i.e iperf in UL only, then i am able to capture the o/p in txt file @output = readpipe("iperf.exe -u -c 127.0.0.1 -p 5001 -b 3600k -t 10 -i 1"); open FILE, ">Misplay_DL.txt" or die $!; print FILE @output; close FILE; Case 2 When I run iperf in DL mode , as we know server will start listening in cont. mode like below even after getting data from client (Here i am using server and client on LAN) @output = system("iperf.exe -u -s -p 5001 -i 1"); on server side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -s -p 5001 ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1896] local 192.168.5.101 port 5001 connected with 192.168.5.101 port 4878 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1896] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) command prompt does not appear , process is contd... on client side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -c 192.168.5.101 -p 5001 -b 3600k -t 2 -i 1 ------------------------------------------------------------ Client connecting to 192.168.5.101, UDP port 5001 Sending 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1880] local 192.168.5.101 port 4878 connected with 192.168.5.101 port 5001 [ ID] Interval Transfer Bandwidth [1880] 0.0- 1.0 sec 441 KBytes 3.61 Mbits/sec [1880] 1.0- 2.0 sec 439 KBytes 3.60 Mbits/sec [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec [1880] Server Report: [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) [1880] Sent 614 datagrams D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITY so with this as server is cont. listening and never terminates so can't take output of server side to a txt file as it is going to the next command itself to create a txt file so i adopted the alarm() function to terminate the server side (iperf.exe -u -s -p 5001) commands after it received all data from the client. could anybody suggest me the way.. Here is my code: #! /usr/bin/perl -w my $command = "iperf.exe -u -s -p 5001"; my @output; eval { local $SIG{ALRM} = sub { die "Timeout\n" }; alarm 20; #@output = `$command`; #my @output = readpipe("iperf.exe -u -s -p 5001"); #my @output = exec("iperf.exe -u -s -p 5001"); my @output = system("iperf.exe -u -s -p 5001"); alarm 0; }; if ($@) { warn "$command timed out.\n"; } else { print "$command successful. Output was:\n", @output; } open FILE, ">display.txt" or die $!; print FILE @output_1; close FILE; i know that with system command i cannot capture the o/p to a txt file but i tried with readpipe() and exec() calls also but in vain... could some one please take a look and let me know why the iperf.exe -u -s -p 5001 is not terminating even after the alarm call and to take the out put to a txt file

    Read the article

  • How to Get The Output Of a command terminated by a alarm() call.

    - by rockyurock
    Case 1 If I run below command i.e iperf in UL only, then i am able to capture the o/p in txt file @output = readpipe("iperf.exe -u -c 127.0.0.1 -p 5001 -b 3600k -t 10 -i 1"); open FILE, ">Misplay_DL.txt" or die $!; print FILE @output; close FILE; Case 2 When I run iperf in DL mode , as we know server will start listening in cont. mode like below even after getting data from client (Here i am using server and client on LAN) @output = system("iperf.exe -u -s -p 5001 -i 1"); on server side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -s -p 5001 ------------------------------------------------------------ Server listening on UDP port 5001 Receiving 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1896] local 192.168.5.101 port 5001 connected with 192.168.5.101 port 4878 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1896] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) command prompt does not appear , process is contd... on client side: D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITYiperf.exe -u -c 192.168.5.101 -p 5001 -b 3600k -t 2 -i 1 ------------------------------------------------------------ Client connecting to 192.168.5.101, UDP port 5001 Sending 1470 byte datagrams UDP buffer size: 8.00 KByte (default) ------------------------------------------------------------ [1880] local 192.168.5.101 port 4878 connected with 192.168.5.101 port 5001 [ ID] Interval Transfer Bandwidth [1880] 0.0- 1.0 sec 441 KBytes 3.61 Mbits/sec [1880] 1.0- 2.0 sec 439 KBytes 3.60 Mbits/sec [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec [1880] Server Report: [1880] 0.0- 2.0 sec 881 KBytes 3.58 Mbits/sec 0.000 ms 0/ 614 (0%) [1880] Sent 614 datagrams D:\_IOT_SESSION_RELATED\SEEM_ELEMESNTS_AT_COMM_PORT_CONF\Tput_Related_Tools\AUTO MATION_APP_\AUTOMATION_UTILITY so with this as server is cont. listening and never terminates so can't take output of server side to a txt file as it is going to the next command itself to create a txt file so i adopted the alarm() function to terminate the server side (iperf.exe -u -s -p 5001) commands after it received all data from the client. could anybody suggest me the way.. Here is my code: #! /usr/bin/perl -w my $command = "iperf.exe -u -s -p 5001"; my @output; eval { local $SIG{ALRM} = sub { die "Timeout\n" }; alarm 20; #@output = `$command`; #my @output = readpipe("iperf.exe -u -s -p 5001"); #my @output = exec("iperf.exe -u -s -p 5001"); my @output = system("iperf.exe -u -s -p 5001"); alarm 0; }; if ($@) { warn "$command timed out.\n"; } else { print "$command successful. Output was:\n", @output; } open FILE, ">display.txt" or die $!; print FILE @output_1; close FILE; i know that with system command i cannot capture the o/p to a txt file but i tried with readpipe() and exec() calls also but in vain... could some one please take a look and let me know why the iperf.exe -u -s -p 5001 is not terminating even after the alarm call and to take the out put to a txt file

    Read the article

  • Which things instantly ring alarm bells when looking at code? [closed]

    - by FinnNk
    I attended a software craftsmanship event a couple of weeks ago and one of the comments made was "I'm sure we all recognize bad code when we see it" and everyone nodded sagely without further discussion. This sort of thing always worries me as there's that truism that everyone thinks they're an above average driver. Although I think I can recognize bad code I'd love to learn more about what other people consider to be code smells as it's rarely discussed in detail on people's blogs and only in a handful of books. In particular I think it'd be interesting to hear about anything that's a code smell in one language but not another. I'll start off with an easy one: Code in source control that has a high proportion of commented out code - why is it there? was it meant to be deleted? is it a half finished piece of work? maybe it shouldn't have been commented out and was only done when someone was testing something out? Personally I find this sort of thing really annoying even if it's just the odd line here and there, but when you see large blocks interspersed with the rest of the code it's totally unacceptable. It's also usually an indication that the rest of the code is likely to be of dubious quality as well.

    Read the article

  • Is there a way to watch EyeTV in alarm-clock style "sleep" mode on your iMac?

    - by Mark S.
    My wife likes to watch TV to go to sleep, the only trouble is that the only TV we have in our house is the iMac with the EyeTV Hybrid. I'd like to have the TV turn off after 1.5 hours of watching without changing the channels/volume--sortof like an alarm clock 'sleep' function. Do you know of a way to do this either with an EyeTV plugin or an App that might be able to try to detect such conditions and shut down the display? Right now EyeTV overrides the screensaver. The Power saver functions don't really work because she doesn't start watching at the same time every night and periodically she will want to record a 2 or 3 AM show. All I want to do is "close" (but not quit) EyeTV and shut off the display.

    Read the article

  • parse a special xml in python

    - by zhaojing
    I have s special xml file like below: <alarm-dictionary source="DDD" type="ProxyComponent"> <alarm code="402" severity="Alarm" name="DDM_Alarm_402"> <message>Database memory usage low threshold crossed</message> <description>dnKinds = database type = quality_of_service perceived_severity = minor probable_cause = thresholdCrossed additional_text = Database memory usage low threshold crossed </description> </alarm> ... </alarm-dictionary> I know in python, I can get the "alarm code", "severity" in tag alarm by: for alarm_tag in dom.getElementsByTagName('alarm'): if alarm_tag.hasAttribute('code'): alarmcode = str(alarm_tag.getAttribute('code')) And I can get the text in tag message like below: for messages_tag in dom.getElementsByTagName('message'): messages = "" for message_tag in messages_tag.childNodes: if message_tag.nodeType in (message_tag.TEXT_NODE, message_tag.CDATA_SECTION_NODE): messages += message_tag.data But I also want to get the value like dnkind(database), type(quality_of_service), perceived_severity(thresholdCrossed) and probable_cause(Database memory usage low threshold crossed ) in tag description. That is, I also want to parse the content in the tag in xml. Could anyone help me with this? Thanks a lot!

    Read the article

  • Is it possible to make an alarm using NSTimer and UIDatepicker?

    - by user557425
    I have an app which plays some ambient noises. I have fitted it with a sleep timer and a local notifier which work fine, but the notifier will only fire when the app is in the background. I would like to be able to fit a standard alarm clock that the user can set using the date picker, ie, the user picks 07:15 am on the date picker and this triggers a sound being played at this time. Can this be done?

    Read the article

  • How to schedule an alarm so that the intent is broadcast everytime the date changes?

    - by rogerstone
    I want to schedule an alarm which throws an intent when the date changes. I know that this would do this the job alarms.setRepeating(AlarmManager.RTC_WAKEUP,triggerAtTime, interval,alarmIntent); But what is confusing me is what to put in the triggerAtTime and the interval.It says System.currentTimeMillis() timebase. I might be installing the app on any day so the TriggerAtTime should be midnight of that day and the interval would be 24 hours from there on. How can I acheive this.Can someone tell me what to put in TriggerAtTime and interval in the required format. Thanks

    Read the article

  • The model to sell apps on App Store is better with a paid only version?

    - by ????
    Rob Napier, the author of iOS 5 Programming Pushing the Limits, mentioned there are several models of selling apps on the App Store: Write an app and sell it Publish a free and a full version Ad supported by third party or by iAd In App purchase Surprisingly, the author said that the most workable model is (1) in terms of sales. I would think that (2) with fairly limiting ability for the free version can bring more sales, as people without trying, might not plunge down $0.99 or $1.99 for something they haven't tried? I for one, might not have purchased Angry Birds if I didn't try their free version first. Also, I think it also depends on the situation: if the app is about alarm clock, and there are already 5 alarm clocks in App Store that are free, then your app that is $0.99 might not be that eagerly purchased. If yours is also free, and users really like it out of all the other ones, then they may think, $0.99 is nothing to get a good alarm clock, and gladly pay you the $0.99 in exchange for a full version of the alarm clock, something that they can't get with the free version. (such as the full version can let you choose a song from your Music Library for the alarm). Could (1) work only if the user definitely want it and have no substitute? How might it work the best?

    Read the article

  • Cloudwatch alarms from Amazon AWS EC2 instance are always in UT, how can I change the alarm time zone to Eastern?

    - by RightHandedMonkey
    I am running an Amazon linux AMI and the alarms that I've setup are coming in all showing UT (universal time). It is inconvenient reading these alarms and I'd like them setup to read in eastern time zone (or America/New_York). I've already set my /etc/localtime to point to - /usr/share/zoneinfo/America/New_York ln -s /usr/share/zoneinfo/America/New_York /etc/localtime But it is still sending alarms in the UT timezone. Does anyone have a solution to this?

    Read the article

  • Is AlarmManager.setRepeating idempotent?

    - by tardate
    In my android app, I'm setting an alarm that I want to occur repeatedly, hence using AlarmManager.setRepeating(). I don't want to keep track of whether the alarm is set myself (sounds like a bad idea that's prone to fail at some point), and there seems to be no API support for checking whether a particular alarm is already set for a given Intent. Hence, I am pessimistically resetting the alarm each time my app activates: alarmManager.cancel(pendingIntent); ... alarmManager.setRepeating(..., pendingIntent); Question: is calling setRepeating() idempotent i.e. do I need to explicitly cancel() any prior alarm or can I safely just call setRepeating() and be done with it?

    Read the article

  • Autoplay an Audio File on Mobile Safari

    - by phantomdata
    Hey guys, I've got a little system dashboard web app that I've written, replete with alarm notifications. I've had it working for quite some time on mobile safari, but recently wanted to add audio to the alarm notifications to allow me to easily know when there are alarms and I'm not looking directly at the display. The alarm notifications are populated through a (relatively) constantly polling ajax request that pulls in and displays an alarm banner if alarms are present. I wanted to add an auto-playing 'alarm' sound as well, but no dice for Safari Mobile. I've tried using HTML5 and embedded objects with no avail. The Apple documentation does state that you can't auto-play an audio file and it must be activated through user action to conserve bandwidth. Has anyone found a way around this in a WLAN setting?

    Read the article

  • XML parsing to plist iPhone SDK

    - by victor
    Hi, guys. Could you, please, help me with parsing of this XML code: <?xml version="1.0" encoding="utf-8"?> <stuff> <parts> <part id='327'> <name>Logitech MX500</name> <serial>618163558491989</serial> <account>ASDALSKD</account> <number>987 789 456</number> <alarm>alarm1</alarm> </part> <part id='846'> <name>Logitech MX510</name> <serial>871351434945431</serial> <account>KJSDAKLJFA</account> <number>454 564 131</number> <alarm>alarm2</alarm> </part> </parts> <info>Information</info> </stuff> And save data to plist file stuff.plist in this format: 327 NSArray Name NSString Logitech MX500 Serial NSString 618163558491989 Account NSString ASDALSKD Number NSString 987 789 456 Alarm NSString alarm1 846 NSArray Name NSString Logitech MX510 Serial NSString 871351434945431 Account NSString KJSDAKLJFA Number NSString 454 564 131 Alarm NSString alarm2

    Read the article

  • Ruby ICalendar Gem: How to get e-mail reminders working.

    - by Jenny
    I'm trying to work out how to use the icalendar ruby gem, found at: http://icalendar.rubyforge.org/ According to their tutorial, you do something like: cal.event.do # ...other event properties alarm do action "EMAIL" description "This is an event reminder" # email body (required) summary "Alarm notification" # email subject (required) attendees %w(mailto:[email protected] mailto:[email protected]) # one or more email recipients (required) add_attendee "mailto:[email protected]" remove_attendee "mailto:[email protected]" trigger "-PT15M" # 15 minutes before add_attach "ftp://host.com/novo-procs/felizano.exe", {"FMTTYPE" => "application/binary"} # email attachments (optional) end alarm do action "DISPLAY" # This line isn't necessary, it's the default summary "Alarm notification" trigger "-P1DT0H0M0S" # 1 day before end alarm do action "AUDIO" trigger "-PT15M" add_attach "Basso", {"VALUE" => ["URI"]} # only one attach allowed (optional) end So, I am doing something similar in my code. def schedule_event puts "Scheduling an event for " + self.title + " at " + self.start_time start = self.start_time endt = self.start_time title = self.title desc = self.description chan = self.channel.name # Create a calendar with an event (standard method) cal = Calendar.new cal.event do dtstart Program.convertToDate(start) dtend Program.convertToDate(endt) summary "Want to watch" + title + "on: " + chan + " at: " + start description desc klass "PRIVATE" alarm do action "EMAIL" description desc # email body (required) summary "Want to watch" + title + "on: " + chan + " at: " + start # email subject (required) attendees %w(mailto:[email protected]) # one or more email recipients (required) trigger "-PT25M" # 25 minutes before end end However, I never see any e-mail sent to my account... I have even tried hard coding the start times to be Time.now, and sending them out 0 minutes before, but no luck... Am I doing something glaringly wrong?

    Read the article

  • Stopping a SoundPlayer loop at the local level

    - by EvanRyan
    I'm working on setting up an alarm that pops up as a dialog with multiple sound file options the user can choose from. The problem I'm having is creating a sound player at the local level that I can close with a button. The problem I'm having is that the sound keeps looping when I close the form because the SoundPlayer doesn't exist within the button click event. here's what I have: void callsound() { if (SoundToggle == 0) // if sound enabled { if ((SoundFile == 0) && (File.Exists(@"attention.wav"))) { System.Media.SoundPlayer alarm = new System.Media.SoundPlayer(@"attention.wav"); alarm.PlayLooping(); } if ((SoundFile == 1) && (File.Exists(@"aahh.wav"))) { System.Media.SoundPlayer alarm = new System.Media.SoundPlayer(@"aahh.wav"); alarm.PlayLooping(); } } private void button1_Click(object sender, EventArgs e) { //alarm.Stop(); Only works if SoundPlayer declared at class level this.Close(); } Is there a way I can do what I want to do by declaring the SoundPlayer instances where I am? Or is there a way to declare it at the class level, and still be able to change the sound file based on user settings?

    Read the article

  • Applescript create event in calendar, how do I remove the default alert?

    - by zero0cool
    Running 10.8 Mountain Lion, I'm trying to create a new event with Applescript like this: set theDate to (current date) tell application "Calendar" tell calendar "Calendar" set timeString to time string of theDate set newEvent to make new event at end with properties {description:"Last Backup", summary:"Last Backup " & timeString, location:"To a local unix system", start date:theDate, end date:theDate + 15 * minutes, allday event:false, status:confirmed} tell newEvent delete every display alarm delete every sound alarm delete every mail alarm delete every open file alarm end tell end tell end tell However, this does not remove the default Calendar alert which one can set through Calendar preferences (30 minutes prior in my case). How do I create an event with no alarms at all through Applescript?

    Read the article

  • Systray Icons missing after App Crash

    - by pr0ndigy
    After installing Alarm Clock (alarm-clock) from the Software Center, the program immediately crashed and made the icons in my systray disapear except for Power, Sound, Time/Date, and the Gear. I tried logging off, rebooting, removing the program, and nothing has brought my icons back. I know they are still running up there, because i got Skype setup to autostart and it had an icon up there running before i installed the Alarm Clock program. Is there anything i can do to get my icons back, or do i need to reinstall the OS? I'm running Ubuntu 14.04.1 btw...

    Read the article

  • Regex - Ignore lines with matching text

    - by codem
    I need the RegEx command to get all the lines which DO NOT have the job name containing "filewatch". Any help will be greatly appreciated! Thanks. STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher STATUS: FAILURE JOB: i3-cur-atmrec-pd-TD_FTP_Forecast_File_Del_M_Su ALARM: JOBFAILURE JOB: i3-cur-atmrec-pd-TD_FTP_Forecast_File_Del_M_Su STATUS: FAILURE JOB: i3-sss-system-heartbeat ALARM: JOBFAILURE JOB: i3-sss-system-heartbeat STATUS: FAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-fileok STATUS: FAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-file ALARM: JOBFAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-fileok ALARM: JOBFAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-file STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-35-filewatcher STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-35-filewatcher STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher

    Read the article

  • j2me PushRegistry.RegisterAlarm and code signing

    - by Mihir
    I am developing an app on Nokia C2-00 in which I am using push registry for auto start of app on some fixed time ex. PushRegistry.registerAlarm("ClassName", alarm.getTime()); this is working perfect and it starts app on that time. But this is asking me for permissions two times. 1) when I am registering alarm using PushRegistry.registerAlarm("ClassName", alarm.getTime()); 2) when app start on that defined time. in this and this link I found that if my application is signed then it will not ask for permission when app autostart. but I am not sure about the time when my code will register alarm. Will it ask for permission or not?

    Read the article

  • Design pattern suggestion

    - by Avinash
    Following is the problem statement. There are n numbers of match strings, If event A occurs and then in certain period of time event B occurs then I do not raise alarm. but if B do not occurs then i have to raise alarm. There can be multiple chain of events which defines whether to raise alarm or not.

    Read the article

  • Monitoring almost anything with BizTalk 360

    - by Michael Stephenson
    When you work in an integration environment it is common that you will find yourself in a situation where you integrate with some unusual applications or have some unusual dependencies. That is the nature of integration. When you work with BizTalk one of the common problems is that BizTalk often is the place where problems with applications you integrate with are highlighted and these external applications may have poor monitoring solutions. Fortunately if you are a working with a customer who uses BizTalk 360 then it contains a feature called the "Web Endpoint Manager". Typically the web endpoint manager is used to monitor web services that you integrate with and will ping them at appropriate times to make sure they return the expected HTTP status code. When you have an usual situation where you want to monitor something which is key to the success to your solution but you find yourself having to consider a significant custom solution to monitor the external dependency then the Web Endpoint Manager could be your friend. The endpoint manager monitors a url and checks for a certain status code. This means that you can create your own aspx web page and then make BizTalk 360 monitor this web page. Behind the web page you could write any code you wished. An example of this is architecture is shown in the below diagram.     In the custom web page you would implement some custom code to do whatever it is that you want to monitor. In the below code snippet you can see how the Page_Load default method is doing some kind of check then depending on the result of the check it returns a certain HTTP code. protected void Page_Load(object sender, EventArgs e) { var result = CheckSomething();   if (result == "Success") Response.StatusCode = 202; else if (result == "DatabaseError") Response.StatusCode = 510; else if (result == "SystemError") Response.StatusCode = 512; else Response.StatusCode = 513;   }   In BizTalk 360 you would go into the Monitor and Notify tab and then to BizTalk Environment which gives you access to the Web Endpoint Manager. You need an alarm setup which configures how the endpoint will be checked. I'm not going to go through the details of creating the alarm as this is already documented in the BizTalk 360 documentation. One point to note is that in the example I am using I setup a threshold alarm which means that the url is checked about every minute and if there is an error that persists for a period of time then the alarm will raise the alert notification. In my example I configured the alarm to fire if the error persisted for 3 minutes. The below picture shows accessing the endpoint manager.   In the web endpoint manager you would then configure your endpoint to monitor and the HTTP response code which indicates all is working fine. The below picture shows this. I now have my endpoint monitoring setup and BizTalk 360 should be checking my custom endpoint to see that it is available. If I wanted to manually sanity check that the endpoints I have registered are working fine then clicking the Refresh button will show if they are all good or not. If my custom ASP.net page which is checking my dependency gets a problem you will see in the endpoint manager that the status code does not match the expected return code and your endpoints will display in red and you can see the problem. The below picture shows this. If I use specific HTTP response codes for the errors the custom ASP.net page might encounter I can easily interpret these to know what the problem is. Using the alarms and notifications with BizTalk 360 it means when your endpoint goes into an error state you can easily configure email or SMS notifications from BizTalk 360 to tell you that your endpoint is having problems and you can use BizTalk 360 to help correlate what the problem is to allow you to investigate further. Below you can see the email which tells me my endpoint is not working.   When everything returns to normal you will see the status is now fixed and you will see a situation like below where you can see the WebEndpoints are now green and the return code matches what is expected.   Conclusion As you can see it is really easy to plug your own custom ASP.net page into the BizTalk 360 web endpoint monitoring feature. This extension then gives you the power to really extend the monitoring to almost anything you want as long as you can write some .net code to check that the dependency is available and working. It would be interesting to hear of any ideas people have around things they would monitor with this extension. More details on the end point monitor can be found on the following link: http://www.biztalk360.com/tour/monitoring_notifications

    Read the article

  • Perl cron job stays running

    - by Dylan
    I'm currently using a cron job to have a Perl script that tells my Arduino to cycle my aquaponics system and all is well, except the Perl script doesn't die as intended. Here is my cron job: */15 * * * * /home/dburke/scripts/hal/bin/main.pl cycle And below is my Perl script: #!/usr/bin/perl -w # Sample Perl script to transmit number # to Arduino then listen for the Arduino # to echo it back use strict; use Device::SerialPort; use Switch; use Time::HiRes qw ( alarm ); $|++; # Set up the serial port # 19200, 81N on the USB ftdi driver my $device = '/dev/arduino0'; # Tomoc has to use a different tty for testing #$device = '/dev/ttyS0'; my $port = new Device::SerialPort ($device) or die('Unable to open connection to device');; $port->databits(8); $port->baudrate(19200); $port->parity("none"); $port->stopbits(1); my $lastChoice = ' '; my $pid = fork(); my $signalOut; my $args = shift(@ARGV); # Parent must wait for child to exit before exiting itself on CTRL+C $SIG{'INT'} = sub { waitpid($pid,0) if $pid != 0; exit(0); }; # What child process should do if($pid == 0) { # Poll to see if any data is coming in print "\nListening...\n\n"; while (1) { my $incmsg = $port->lookfor(9); # If we get data, then print it if ($incmsg) { print "\nFrom arduino: " . $incmsg . "\n\n"; } } } # What parent process should do else { if ($args eq "cycle") { my $stop = 0; sleep(1); $SIG{ALRM} = sub { print "Expecting plant bed to be full; please check.\n"; $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2\n"; $stop = 1; }; $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1\n"; print "Waiting for plant bed to fill...\n"; alarm (420); while ($stop == 0) { sleep(2); } die "Done."; } else { sleep(1); my $choice = ' '; print "Please pick an option you'd like to use:\n"; while(1) { print " [1] Cycle [2] Relay OFF [3] Relay ON [4] Config [$lastChoice]: "; chomp($choice = <STDIN>); switch ($choice) { case /1/ { $SIG{ALRM} = sub { print "Expecting plant bed to be full; please check.\n"; $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2\n"; }; $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1\n"; print "Waiting for plant bed to fill...\n"; alarm (420); $lastChoice = $choice; } case /2/ { $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2"; $lastChoice = $choice; } case /3/ { $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1"; $lastChoice = $choice; } case /4/ { print "There is no configuration available yet. Please stab the developer."; } else { print "Please select a valid option.\n\n"; } } } } } Why wouldn't it die from the statement die "Done.";? It runs fine from the command line and also interprets the 'cycle' argument fine. When it runs in cron it runs fine, however, the process never dies and while each process doesn't continue to cycle the system it does seem to be looping in some way due to the fact that it ups my system load very quickly. If you'd like more information, just ask. EDIT: I have changed to code to: #!/usr/bin/perl -w # Sample Perl script to transmit number # to Arduino then listen for the Arduino # to echo it back use strict; use Device::SerialPort; use Switch; use Time::HiRes qw ( alarm ); $|++; # Set up the serial port # 19200, 81N on the USB ftdi driver my $device = '/dev/arduino0'; # Tomoc has to use a different tty for testing #$device = '/dev/ttyS0'; my $port = new Device::SerialPort ($device) or die('Unable to open connection to device');; $port->databits(8); $port->baudrate(19200); $port->parity("none"); $port->stopbits(1); my $lastChoice = ' '; my $signalOut; my $args = shift(@ARGV); # Parent must wait for child to exit before exiting itself on CTRL+C if ($args eq "cycle") { open (LOG, '>>log.txt'); print LOG "Cycle started.\n"; my $stop = 0; sleep(2); $SIG{ALRM} = sub { print "Expecting plant bed to be full; please check.\n"; $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2\n"; $stop = 1; }; $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1\n"; print "Waiting for plant bed to fill...\n"; print LOG "Alarm is being set.\n"; alarm (420); print LOG "Alarm is set.\n"; while ($stop == 0) { print LOG "In while-sleep loop.\n"; sleep(2); } print LOG "The loop has been escaped.\n"; die "Done."; print LOG "No one should ever see this."; } else { my $pid = fork(); $SIG{'INT'} = sub { waitpid($pid,0) if $pid != 0; exit(0); }; # What child process should do if($pid == 0) { # Poll to see if any data is coming in print "\nListening...\n\n"; while (1) { my $incmsg = $port->lookfor(9); # If we get data, then print it if ($incmsg) { print "\nFrom arduino: " . $incmsg . "\n\n"; } } } # What parent process should do else { sleep(1); my $choice = ' '; print "Please pick an option you'd like to use:\n"; while(1) { print " [1] Cycle [2] Relay OFF [3] Relay ON [4] Config [$lastChoice]: "; chomp($choice = <STDIN>); switch ($choice) { case /1/ { $SIG{ALRM} = sub { print "Expecting plant bed to be full; please check.\n"; $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2\n"; }; $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1\n"; print "Waiting for plant bed to fill...\n"; alarm (420); $lastChoice = $choice; } case /2/ { $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2"; $lastChoice = $choice; } case /3/ { $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1"; $lastChoice = $choice; } case /4/ { print "There is no configuration available yet. Please stab the developer."; } else { print "Please select a valid option.\n\n"; } } } } }

    Read the article

  • Why doesn't Perl's Try::Tiny's try/catch give me the same results as eval?

    - by sid_com
    Why doesn't the subroutine with try/catch give me the same results as the eval-version does? #!/usr/bin/env perl use warnings; use strict; use 5.012; use Try::Tiny; sub shell_command_1 { my $command = shift; my $timeout_alarm = shift; my @array; eval { local $SIG{ALRM} = sub { die "timeout '$command'\n" }; alarm $timeout_alarm; @array = qx( $command ); alarm 0; }; die $@ if $@ && $@ ne "timeout '$command'\n"; warn $@ if $@ && $@ eq "timeout '$command'\n"; return @array; } shell_command_1( 'sleep 4', 3 ); say "Test_1"; sub shell_command_2 { my $command = shift; my $timeout_alarm = shift; my @array; try { local $SIG{ALRM} = sub { die "timeout '$command'\n" }; alarm $timeout_alarm; @array = qx( $command ); alarm 0; } catch { die $_ if $_ ne "timeout '$command'\n"; warn $_ if $_ eq "timeout '$command'\n"; } return @array; } shell_command_2( 'sleep 4', 3 ); say "Test_2"

    Read the article

  • how to know application is going to destroy/remove?

    - by Bhavesh Jethani
    My requirement is, i want to cancel my alarm manager or services when application going to destroy/closed. if i am in activity A by clicking on button started activity B suddenly user is going to press home button. ---- if application is running in background then don't cancel service. but when he going to remove from recent list of application at that time cancel service. Service/Alarm manager will work even when user has sent application in background by pressing home screen. No of way application can destroy or removed. 1) by clicking back button multiple times if stack have multiple activities. 2) by pressing home button and then remove from recent list. i am facing issue with (2)second option. in that when user press home button at that time service or alarm manager should be work. But when user will be going to remove application from recent list at that time i want to cancel service/alarm manager. Second issue. my service is called at fix interval of time. if i will write code on onCreate(), onDestroy() in each activity. then timer will start from beginning. Is there any listners who talk me application is going to closed?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >