restfb: Facebook payment subscriptions - java

As far as I've heard this feature is brand new, and it's still under testing phase. Anyway, reading the docs in developers.facebook I was not able to find out if it was possible or not to make subscriptions on a year basis payment.

Well, you can state a period of a 12 months. I mean, the only time unit you have available are weeks or years. So, the answer to your question is "yes", but the way you have to do it is on a 12-monthly basis.

Related

How to get Twilio Usages data every few minutes?

Requirement: I need to monitor the Twilio account and subaccount usages in near real-time.
Any solution in java, php, python or even curl will do for me.
Twilio provides Usage Records API and allows some subresources which contains Today but that returns all data from the start of that day till the nearest current time. I am unable to find anything in the documents that would retrieve only usages of the last minute or last 10 minutes or even between two time constants. The Usage API accepts two dates but not time.
Hoping someone out there has a solution to offer.

How to send a local repeating notification in certain days?

I have a reminders app, I made a UI that looks like this where the user can pick multiple days and the hour that he wants to be reminded on. For example, I can select Monday and Tuesday at 15:00 and I should be reminded those days at that given hour. But I can´t figure out how to make this work (mainly, the mutiple days thing). Any ideas?
You can send a local repeating notification with the help of AlarmManager. setRepeating() function can be used to schedule notifications.
similar question, Check this link for better understanding.

How to clear unwanted records in Kinvey Database

I am having an Android app and I am planning to use Kinvey Database to store some data.
One of the record in the entry would be having the last used time period.
The last used time period will be set by my app when ever the app is opened.
What basically I am trying to achieve is to run a code at the end of each month and clear all the record whos value of the last used period is more than 10 days.
Can any one please tell me whether it is possible to do this?
The reason for doing this is to use the least Server storage space as they provide only 1 GB/Monthly in the free plan.
What I understand from this...
What basically I am trying to achieve is to run a code at the end of each month and clear all the record whos value of the last used period is more than 10 days.
Can any one please tell me whether it is possible to do this?
... is that you would like to have scheduled code, which will be executed once a month. Please take a further look at the Scheduled Code feature of Kinvey.
https://devcenter.kinvey.com/html5/tutorials/scheduled-code-getting-started
Edit: more information on the topic...
Kinvey Scheduled code allows you to execute one of your custom endpoints on a specific date in the future. It is commonly used to
Aggregate, archive, and cleanup data.
Pull data from a third-party API into Kinvey.
Send out a batch of e-mails or push notifications.
I would not bother describing step-by-step initializing of Scheduled Code, since those steps may change in the future. Please follow the steps from the link above, those should be fine to get you further.

Is there a way to sign my code or secure it?

I am a java beginner anyway, I have written this program that formats Military time that java returns to normal time, for example 1:01 PM instead of 13:01:00. To get to the point I ust created a blog a tumblr and I want to share this code and I know it sounds silly and sellfish but I want to learn to secure my code or stamp it somehow so people dont steal it?
Big question. It depends from the legal framework of your country.
Generally speaking you can start the long process to patent your system, but the simple code has not change (work around excluded) and it is quite expensive (for my patent we spent 12K€ more or less).
In Italy we have SIAE: we pay 120€ and we send a CD to an authority; the code will be protected for 5 years, but if a guy change the 20% of the original code .. it is another code.

A scheduling algorithm

I am looking for help in designing a scheduling algorithm for a medical review board:
Everyday hundreds of customers are scheduled starting 14 days later to specialized doctors.
Each patient may need to visit more than one doctor, in extreme cases could be up to 5 visits.
There are a fixed number of rooms, some of them with specialized equipment. For some of the meetings only specific rooms can be used.
Each doctor has a specific schedule, but usually between 14:00 and 19:00.
The main requirement is to try to have each patient come only once.
Many contraints including second visit with same doctor, avoid conflicts of interest (patient and doctor know each other) among others. Hospital/residents problem not suitable, mainly because of constraints. We are trying a solution using a prioritizing scheme and then trying to reschedule exceptions.
At this moment we are trying to define the algorithm, this is part of a whole system to manage the medical review board.
The sytem is based on Java with dojo for FE and EJB for BE.
This is a question that may be closed because it is too localized. It won't be much help to someone else. But it's a fun problem so I thought I'd throw out some ideas.
You are going to need to find matches for the most complex cases first.
Look for "best-fit" solutions. Don't take time on an empty day if you can fill up another day.
You're going to have to figure out a way to iterate through the matching so you try a wide range of possibilities. Some way to pull back, make a different choice, and then continue without getting into an infinite loop.
You might do the fitting up to (let's say) 80% and then swap around people. Swap a 3 hour appointment with a 2 and a 1 or something. The goal is to leave the schedule with the most "flexibility".
You're going to need to determine your swapping rules. What makes a schedule better?
Here's a bunch of SO questions for you to read:
Worker Scheduling Algorithm
Best Fit Scheduling Algorithm
Is there a scheduling algorithm that optimizes for "maker's schedules"?
Hope some of this helps.

Categories