Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| // Store ad tags in localStorage to enable reporting bad ads | |
| // TODO: This doesn't work if multiple ads are shown in one placement with googletag.pubads().refresh() | |
| googletag.pubads().addEventListener('slotRenderEnded', function (event) { | |
| if (typeof(localStorage) !== 'object') console.log('fail'); | |
| if (event.slot.getResponseInformation() === null) return; | |
| var slotAdUnitPath = event.slot.getAdUnitPath(); | |
| gpt_placements[slotAdUnitPath] = {}; | |
| gpt_placements[slotAdUnitPath]['dfp'] = event.slot.getResponseInformation(); | |
| gpt_placements[slotAdUnitPath]['dfp']['contentUrl'] = event.slot.getContentUrl(); |
| class UnionFind: | |
| """Weighted quick-union with path compression and connected components. | |
| The original Java implementation is introduced at | |
| https://www.cs.princeton.edu/~rs/AlgsDS07/01UnionFind.pdf | |
| >>> uf = UnionFind(10) | |
| >>> for (p, q) in [(3, 4), (4, 9), (8, 0), (2, 3), (5, 6), (5, 9), | |
| ... (7, 3), (4, 8), (6, 1)]: | |
| ... uf.union(p, q) |