Pusher.com : Is there a way to use channel.bind_all() where I only get my pushed events? - pusher

I have a channel that publishes thermostat events. The events are grouped by temperature changes and thermostat control changes. I have 3 listeners (web pages): summary, temperature changes and thermostat changes.
I'm thinking I set up a channel 't1' (thermostat 1) and have events such as tc (temp change), tm (thermostat mode change), tsh (temperature set heat), etc.
The temperature change page is easy to set up: subscribe to 't1', bind to 'tc'.
But the thermostat control page is harder. Can I do something like: subscribe to 't1', bind to NOT 'tc'? This page wants to receive events on everything except 'tc'.
What I've done is a loop in the webpage javascript to generate multiple 't1'.bind() calls for each event (tm, tsh, tsc, etc.). t1.bind(tm), t1.bind(tsh), t1.bind(tsc), etc.
And the summary page needs to see all events. So I wondered about using bind_all().
But if I use bind_all I get a lot of pusher events also. I guess I can figure out how to filter those out but wondered if you guys have any better ideas.
Thanks for any suggestions!

I figured this out by using multiple channels (which is a feature), with specific events.

Related

How to let flutter apps support TV device?

TV device does not support touch operation, users have to use Remote Control. We need to move focus by press left, top, right, bottom direction key, and when the target widget get focus, we will press OK button to response kinds of key event. But I cannot find any flutter interface to solve this interaction, anyone who can help me?
There are SystemChannels for this.
I haven't tried it myself, but it looks like this should do what you need:
DartDocs - SystemChannels.keyEvent
A JSON BasicMessageChannel for keyboard events.
[DartDocs - SystemChannels.textInput[(https://www.dartdocs.org/documentation/flutter/0.0.41-dev/services/SystemChannels/textInput-constant.html)
A JSON MethodChannel for handling text input.
This channel exposes a system text input control for interacting with
IMEs (input method editors, for example on-screen keyboards). There is
one control, and at any time it can have one active transaction.
Transactions are represented by an integer. New Transactions are
started by TextInput.setClient. Messages that are sent are assumed to
be for the current transaction (the last "client" set by
TextInput.setClient). Messages received from the shell side specify
the transaction to which they apply, so that stale messages
referencing past transactions can be ignored.
The later is used in https://github.com/flutter/flutter/blob/4389f07024a4c69f7223401abd4d0ab3ecc45698/packages/flutter/lib/src/services/text_input.dart
There are known issues with physical keyboards thought that might cause this use case not to work
https://github.com/flutter/flutter/issues/11177
https://github.com/flutter/flutter/issues/7943
https://github.com/flutter/flutter/issues/9347
Yep,Flutter doesn't support D-pad navigation yet.But,I have an Android Smart TV and if I connect a Bluetooth mouse,I am able to navigate,swipes,click,etc my Flutter app on the TV.

Is there IndexChanged event for grid in Acumatica

Acumatica has plenty of events for views like Row_Updated, Field_Updated. I search for something like Index_Changed event but for now I can't find. Does it have some other name or exists at all?
There's no row selected index changed event that will bubble up to the graph. Instead there's a bunch of mechanisms designed to solve a narrow problem that would have required that missing event, these are the likes of DependOnGrid, StateColumn, AutoCallback/Refresh, Sync Position etc.
The reasoning behind this design could be to reduce the number of callbacks from the webpage to the server. From the user point of view, changing row selection is not a transactional operation. Having the webpage wait for the server at that time would make the webpage appear sluggish.

Using GA to retrieve metrics from API

I am trying to use Google Analytics to retrieve metrics from an API.
The thing is, I am not sure to understand how the whole analytics tracking works. I tried to understand how to implement custom metrics and dimensions from this : https://developers.google.com/analytics/devguides/collection/analyticsjs/events but I am still not very sure on how to proceed.
Let us say for instance that I want to send a custom event to Analytics when a client clicks on a button to create a PDF.
Should I write something like :
ga('send', {
hitType: 'event',
eventCategory: 'Project',
eventAction: 'pdf_export',
eventLabel: 'StartOfProject'
});
And put it in the handler of the endpoint route corresponding to the page launched when the button is clicked?
Or do I have to create an event with EventEmitter? I must confess I am quite lost here...
[EDIT] Victor Leontyev showed a very easy way to of it (thank you!), however it was here a rather simple use case. I was also wondering :
If I want to send a custom metric (a ratio...), should I put it in the optional eventValue?
If I want to have the number of PDF (to keep with the same example) per day, how can I do? It would mean I guess that I should launch an event every 24H on a precise hour, and have kept somewhere (in a DB?) the data for the day so I can send it? Can this easily be done?
The other kind of metrics I need would be periods between two actions, lie let us say between the click on the 'Create a new PDF' button and a 'Print the PDF' one. Can it be done with launching a tier on the first button press, then stopping it and the second one and sending the time as the eventValue ? Or is it more complicated?
I warmly thank you once again for any lead/form of hep and support!
Have a nice day,
-- smgr
If you have a button, where users can download your PDF. For example:
Download PDF
And if you want to send event to GA with this data:
eventCategory: 'Project'
eventAction: 'pdf_export'
eventLabel: 'StartOfProject'
All that you need is to change HTML of your button into:
Download PDF
Then you will be able to see how many users click to your Download PDF button in GA (Behavior -> Events or Realtime -> Events)

Breaking down 1 calendar event into smaller events in SharePoint

I'm trying to create some sort of reservation system in SharePoint using a calendar list. It's been recommend to me to create events and add a column which allows a user to claim it. From there, claimed events would change color and only those who've claimed the event would have permission to unclaim the event.
This is what it would look like (see alternative option):
What I'd like to be able to do though, is instead of having to create three events like shown in the alternative option, creating 1 event (see original) and have that be broken down into 3 events or more, maybe using some form of drop down asking for intervals (ie. 15m, 30m, 1h). Based on the selected interval, it'd break the event accordingly.
A possible solution is in your main event you add another field named Interval.
The you design a workflow when you create the event that creates new events according to the interval specified using a while loop while incrementing the start time with your interval.
Those new events have a content type with a field named UserClaimed. you then associate another workflow to those new events that checks for that field and changes permissions on the event to only allow modifications of that event to the user specified.
This is the general idea, the implementation should not be that hard
just a thought -
I mean, the reason i think you want the events to pre-exist is so that users can easily create them in the correct time slot (rather than clicking the new item menu, which throws them away from the calendar view/context). Is that right?
If so, allow me to offer you this scenario:
If you are using KWizCom's Calendar Plus web part (yeah, I work for KWizCom...) it allows you to type in the event in the calendar itself directly.
Something simple like: "1pm-2:30pm Training meeting with Josh"
check the demo video here: http://www.kwizcom.com/sharepoint-add-ons/sharepoint-calendar-plus-web-part/overview/
Also, drag and drop events in the calendar to move them easily, and it also supports color coding events based on categories (meta data, views, sources, etc.).
The one thing you will need to develop is the unique meeting logic, and owner permissions.
meaning, an event handler that does not accept 2 meetings at the same time for the same room (define the unique resource field, if any), and the logic that allows only the person who created an event to edit or delete it.
ping me, I can help with the event handler - perhaps we can add this to our product, this is actually a cool idea. my work mail is shai at kwizcom dot com

How should an IPhone notification-type application show user there is a notification unobtrusively

I have a program that basically just queries a webservice, and if any data is returned it will show that information to the user, but if there is nothing to display it will just wait until the next scheduled time and run.
Right now it just puts a table in front of the user, there is nothing in the status bar that they can then select and see the actual information.
So, I have two questions.
Is there a better way to show
notification information to a user
that is less intrusive?
Should the View, with a UITable,
have a button to dismiss the view
when they are finished?
UPDATE:
It seems my question isn't clear enough, so I have the data showing up in the table properly.
My problem is before I display the data.
Currently, periodically the timer will fire off my method, and if there is any events pending for the user the table will show up right in front of them.
That is bad design, IMO, so what I would like is some simple way to let them know that there is something pending and they can look at it when they get a moment.
Ideally I would have something in the status bar to show that they have some events, but it appears that isn't an option that I can see.
One option is to see if I can have the table come up minimized and have some sound or vibration go off, but again that can be bothersome to the user, as it may interrupt what they are doing.
The proper solution appears to be that while in the background just put up a notification if there is any new information, so the user can close the notification or switch to view the details.
This isn't the ideal solution, but appears to be the best choice on the iPhone.

Resources