Gtalk auto responder - google-talk

Lifemojo.com has introduced a new feature through which you can access the calorie content of any food item or the calorie burnt by any activity, by sending the name of the food item or activity as a chat message to calories#lifemojo.com (You would have to add calories#lifemojo.com to your friend list first)
http://blog.lifemojo.com/2009/01/03/calorie-search-now-on-gtalk/
Any idea how they made it?
Im an asp.net programmer.

XMPP bots (GTalk is an XMPP-based service) aren't all that hard to write.
Here's an example - http://www.dotnetcurry.com/ShowArticle.aspx?ID=346

Related

How to perform non-idempotent actions (send email) in a Actor model framework (e.g., akka.net)?

I am looking into using an actor model framework (akka.net with akka.net persistence, but I am looking for a general case answer) to build an 'widget order processing workflow'.
Pretty standard:
Customer orders widget
Payment is processed
Email confirmation sent to customer
Send picklist message to warehouse
Warehouse sends a 'widget has been shipped' message back
Send a 'your item has shipped' email to customer
Now let's say between 4 and 5 a server deployment/restart happens. This would cause a actor(s) rehydration (let's assume there is no snapshot yet). That means we would process the payment again, and resend the order placed email. However it turns out our customers don't like this 'feature'!
How to I prevent non-idempotent actions from re-occurring when using an actor model framework?
I have thought about having a separate store of 'payment processed for order db table'; but this feels like I am fighting the framework/paradigm and I wonder if there is a 'proper' way of doing this kind of thing!
Ok so it turns out it is pretty simple.
With akka.net persistence, after a system restore, messages are replayed. The correct state can be recreated by (re) processing these messages.
There is however a IsRestoring property, which can be checked to see if this is the first or a subsequent processing. Presumably other actor model framework have something similar.
So you do something like:
private void ProcessPayment (Order message)
{
if(!this.IsRestoring){
//Perform non-idempotent payment process
}
}
To make a robust workflow processor, you have to store ALL data of a workflow process in a permanent storage.
You can employ a database, a messaging system like Kafka, or use ready-made workflow management software.
Since you already use Akka, Akka Persistence also can be an option.
UPDATE
Building a system which continue to work correctly in presence of system failures and restarts is a considerable task, far more complex than developing an actor framework. That is, you cannot just take any actor framework and add fault tolerance to it.

Django Priority Queue

I want to build a delivery app in Django, wherein I will create delivery objects to be delivered according to priority(attribute of the object) by a delivery person. I will login and create the tasks and there can be many delivery persons to login and accept task asynchronously.
Objects(tasks) will be popped out as a delivery person logs in and accepts the task, and the next logged in delivery person would see the next priority task.
How can this be implemented in Django? Any references and implementation links are welcomed. Thanks in advance!

Building Alexa Skill that pushes an alarm

I'm trying to build an alexa skill that fires a custom alarm every set number of times per day (30 min intervals for example). I'm reading through their docs and not fulling understanding where to go to next.
Does anyone have some good Alexa skill apps that I can reference or an article? I couldn't find much online and it looks like it hasn't been an accessible feature for too long.
You cannot trigger Alexa to speak without user interaction. That means, the user has to say something to trigger your skill, which will in turn create a request to you skill's backend, and you can only respond (be it audio or speech) back to that request.
However, you can send Push Notifications.
Notification indicators inform end users that new content is available
from Alexa skills and domains. When a notification is delivered,
depending on what the product is capable of, the user is notified by
visual and audio indicators.
More on Push Notification here

Can i check in-App purchase in the ios simulator?

can i check in-App purchase in the simulator ? because i don’t have iPhone real device so,i couldn’t able to create provisioning profile certificate so what is the way to check in-App purchase in the simulator
with Xcode 9.1 now and previous, I can't really finalize transaction, but made that
id <SKPaymentTransactionObserver> observer = self;
[[SKPaymentQueue defaultQueue] addTransactionObserver:observer];
in the appDelegate falls into SKPaymentTransactionStateFailed. That's still nice.
Using #if TARGET_IPHONE_SIMULATOR(from TargetConditionals.h) here and there you can implement a very lot of code and check it, of course your UIs, including sending payment requests to Apple. At the last time you must have a Device. By the way it's an error to publish anything on the App Store without having success in tests on at least one Device.

How to re-request room roster and history from a muc in ejabberd

When a user joins an ejabberd MUC, the server will send a full room roster and chat history to the user.
In my web based client I need to persist the room over page reloads. My problem is that I loose al the initial information when the page is unloaded.
ATM I'm working around this by serialising the roster and room history to json and storing it in a cookie. However, this is a really bad idea (tm) as I can very quickly exceed the 4k general cookie limit for rooms with alot of users.
So the question: How can I re-request the information the server sends a user on join, without actually rejoining a MUC?
One approach for rosters would be to send a query iq with a namespace of "http://jabber.org/protocol/disco#items" but this is incomplete as it doesn't provide presence information or any extended info (such as real jids for non-anonymous rooms)
On page unload you need send "presence unavailable"
On page load (rejoin to room) send "presence available" plus "history" request. For example,
<history maxstanzas=20 />
Reference to XEP-0045 scheme
Hmm. I don't have a solution for Roster, but on the history one, have you tried this?
<iq to="room#conference.xmpp.org" type="get">
<history xmlns="http://www.jabber.com/protocol/muc#history" start="1970-01-01T00:00:00Z" direction="forward" count="100" />
</iq>
Try leaving the muc room when page unload and re-send presence to the muc when page re-load.