i am wondering what is the best way to do this, what i am thinking of is a Dispatcher that checks for the current time and if it equals to the user specified date time then the function gets called, is there a better way to do this?
Yes, no need to reinvent the wheel, use Quartz.NET instead (the library is under 500k)...
Do you have access to CRON? It should be built into your server and you should have access to it through your control panel. This is exactly what CRON was invented for.
Related
I want to make reminders app, and for that I will use FlutterLocalNotification because when I searched I saw that it is working in the background.
My question is should I use database for the reminders or not?
and can I use FlutterLocalNotification with a specific time? I mean let the user to pick the time
I tried flutter_local_notificaitons using it you can send the user local notifications in a specific time even when the app is closed. So I think it's the way to go. There are even some fancy ways to specify time patterns.
If you want try out this project I created it a while back to test the package. You will need to change line 80 in main.dart to use your own time zone.
You will need some local storage otherwise the user data will just not persist when she closes the app. There are many packages for this. Some are lighter then others. It depends on how big your app is so check them out and see what works.
Using the Cups c api I am able to see the state of a printer (such as paused, printing, jammed ect.) What I am trying to do now is to listen for, or lock against a change in a printer's state. Ultimately I want a live view of a printers state, but I don't want to have a delay loop spamming cups with printer attribute requests.
I have seen many functions and tags in the source code and documentation that hint towards some kind of event system, but I have been unable to figure out how to utilize it. Any help is welcome, even just pointing me towards the right function.
I used this example in my current implementation to get state information. http://cups-dev.easysw.narkive.com/9RO0OBnZ/how-to-get-printer-status-via-cups-api
It ends up this was a very complex question and involved a lot of work to figure out. The only sane way I found to listen for changes was to use the rss notification system. I would advise against attempting to make your own notification module, I wasted a week of my life trying that (I'm not even sure it is possible anymore). Use the Create-Printer-Subscription with a uri like rss://localhost:8000. You will of course need a listener waiting for the xml data.
I put up an a simple debugging tool I made with java/jna here. Select 2 to set up a subscription, you will need to listen for the data yourself though.
I prompt a user to start a phone call by calling
phoneCallTask.Show().
That brings him to a windows yes/no notification screen.
I need to know whether the user did choose to make the call or no.
How can i know it?
Thanks.
There is no way to know for certain. The SDK does not expose any APIs that will tell you this.
What you could do instead is track the amount of time between the user leaving the app and returning to see if a call was made.
If it was just a second or two then a call almost certainly wasn't made. Any other conclusion would be subjective though. What if it was engaged? Or went to answer phone? Does this count as making the call?
I am now using the framework Yii to develop a website and I need to use a timer to limit the access time of a certain page but I do not know what to do with it. Namely, when a user is filling up a form, he or she has to finish filling the form in a limitted period of time, otherwise he or she is not allowed to fill up the rest of the form. I wonder what should I do and where I can find a timer to meet my need? Thanks a lot.
No, there is no timer available in Yii. Use sessions on server side as #Imre L suggests.
If the solution is to override init() and del() from db.Model / db.Expando / db.PolyModel, then do I need to call the superclass functions?
Would be great to see some example code in the answers or on links. Thanks a lot.
I've written a couple of blog posts on this subject: One on high level pre- and post- put hooks, and one on the low level hook support. One of these is probably what you're looking for.
I think that the best way to accomplish what you want to do is to use datastore API hooks.
Using that approach will allow you to avoid messing directly with the classes and superclasses. That could get complex and messy and buggy very quickly.
If this is the java implementation, you can implement javax.jdo.listener.StoreCallback on your domain model and then define method jdoPreStore(). This method will automatically be called each time you persist to the datastore.