The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
| /** @jsx React.DOM */ | |
| var AppRouteTarget = { | |
| setupLayout: function () { | |
| React.renderComponent({ | |
| <App className='page-content'>, | |
| document.querySelector('body') | |
| }); | |
| } | |
| }; |
| package; | |
| import flash.display.Graphics; | |
| import flash.display.Sprite; | |
| import flash.events.Event; | |
| import flash.events.KeyboardEvent; | |
| import flash.Lib; | |
| import flash.ui.Keyboard; | |
| import flash.Vector; |
| import Aviator from 'vendor/aviator'; | |
| import ServerRouteTarget from 'route_targets/server_route_target'; | |
| let Routes = { | |
| /** | |
| Call this method `Routes.dispatch` to start routing. | |
| @method dispatch | |
| @param {Object} targets | |
| @example { 'nameOfMyRouteTarget': instanceOfMyRouteTarget } |
| [supervisord] | |
| nodaemon=true | |
| loglevel=debug | |
| [program:amon] | |
| command=gunicorn -c gunicorn.conf.py wsgi | |
| directory=/amon | |
| autostart=true | |
| autorestart=true | |
| redirect_stderr=true |
| import tweepy | |
| import pymongo | |
| # Tweepy API doc here: http://pythonhosted.org/tweepy/html/api.html | |
| # PyMongo API doc here: https://pypi.python.org/pypi/pymongo/ | |
| # Keys | |
| consumer_key = '' | |
| consumer_secret = '' | |
| access_token = '' |
| // Convert Javascript date to Pg YYYY MM DD HH MI SS | |
| function pgFormatDate(date) { | |
| /* Via http://stackoverflow.com/questions/3605214/javascript-add-leading-zeroes-to-date */ | |
| function zeroPad(d) { | |
| return ("0" + d).slice(-2) | |
| } | |
| var parsed = new Date(date) |
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
| //<string name="can_try_again">Press [img src=ok16/] to accept or [img src=retry16/] to retry</string> | |
| //http://stackoverflow.com/questions/15352496/how-to-add-image-in-a-textview-text | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| import android.content.Context; | |
| import android.text.Spannable; | |
| import android.text.style.ImageSpan; | |
| import android.util.AttributeSet; | |
| import android.util.Log; |