text:
package br.com.six2six.fixturefactory.function;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.regex.Pattern;

import org.junit.Test;

import br.com.six2six.fixturefactory.function.impl.CpfFunction;

public class CpfFunctionTest {

	@Test
	public void randomCpf() {
		String value = new CpfFunction().generateValue();
		assertNotNull("Generated CPF can not be null", value);
		assertTrue("Invalid match for CPF", Pattern.matches("\\d{11}", value));
	}

	@Test
	public void randomFormattedCpf() {
		String value = new CpfFunction(true).generateValue();
		assertNotNull("Generated formatted CPF can not be null", value);
		assertTrue("Invalid match for CPF", Pattern.matches("\\d{3}.\\d{3}.\\d{3}-\\d{2}", value));
	}

}


text:
import { Component, Input, Output, EventEmitter } from '@angular/core';

@Component({
    selector: 'ok-cancel-buttons',
    template: `
        <button type="button" class="btn btn-primary" [disabled]="okDisabled" (click)="okClick.emit()">{{okTitle}}</button>
        <button type="button" class="btn btn-default" (click)="cancelClick.emit()">{{cancelTitle}}</button>
    `
})
export class OkCancelEditButtonsComponent {
    @Input() okTitle:string = "ОК";
    @Input() cancelTitle:string = "Отмена";
    @Input() okDisabled: boolean = false;

    @Output() okClick = new EventEmitter();
    @Output() cancelClick = new EventEmitter();
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * The examples provided by Facebook are for non-commercial testing and
 * evaluation purposes only.
 *
 * Facebook reserves all rights not expressly granted.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
 * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * @flow
 */
'use strict';

const React = require('react-native');
const StyleSheet = require('StyleSheet');
const UIExplorerBlock = require('UIExplorerBlock');
const UIExplorerPage = require('UIExplorerPage');

const {
  Picker,
  Text,
  TouchableWithoutFeedback,
} = React;
const Item = Picker.Item;

const PickerExample = React.createClass({

  statics: {
    title: '<Picker>',
    description: 'Provides multiple options to choose from, using either a dropdown menu or a dialog.',
  },

  getInitialState: function() {
    return {
      selected1: 'key1',
      selected2: 'key1',
      selected3: 'key1',
      color: 'red',
      mode: Picker.MODE_DIALOG,
    };
  },

  render: function() {
    return (
      <UIExplorerPage title="<Picker>">
        <UIExplorerBlock title="Basic Picker">
          <Picker
            style={styles.picker}
            selectedValue={this.state.selected1}
            onValueChange={this.onValueChange.bind(this, 'selected1')}>
            <Item label="hello" value="key0" />
            <Item label="world" value="key1" />
          </Picker>
        </UIExplorerBlock>
        <UIExplorerBlock title="Disabled picker">
          <Picker style={styles.picker} enabled={false} selectedValue={this.state.selected1}>
            <Item label="hello" value="key0" />
            <Item label="world" value="key1" />
          </Picker>
        </UIExplorerBlock>
        <UIExplorerBlock title="Dropdown Picker">
          <Picker
            style={styles.picker}
            selectedValue={this.state.selected2}
            onValueChange={this.onValueChange.bind(this, 'selected2')}
            mode="dropdown">
            <Item label="hello" value="key0" />
            <Item label="world" value="key1" />
          </Picker>
        </UIExplorerBlock>
        <UIExplorerBlock title="Picker with prompt message">
          <Picker
            style={styles.picker}
            selectedValue={this.state.selected3}
            onValueChange={this.onValueChange.bind(this, 'selected3')}
            prompt="Pick one, just one">
            <Item label="hello" value="key0" />
            <Item label="world" value="key1" />
          </Picker>
        </UIExplorerBlock>
        <UIExplorerBlock title="Picker with no listener">
          <Picker style={styles.picker}>
            <Item label="hello" value="key0" />
            <Item label="world" value="key1" />
          </Picker>
          <Text>
            Cannot change the value of this picker because it doesn't update selectedValue.
          </Text>
        </UIExplorerBlock>
        <UIExplorerBlock title="Colorful pickers">
          <Picker
            style={[styles.picker, {color: 'white', backgroundColor: '#333'}]}
            selectedValue={this.state.color}
            onValueChange={this.onValueChange.bind(this, 'color')}
            mode="dropdown">
            <Item label="red" color="red" value="red" />
            <Item label="green" color="green" value="green" />
            <Item label="blue" color="blue" value="blue" />
          </Picker>
          <Picker
            style={styles.picker}
            selectedValue={this.state.color}
            onValueChange={this.onValueChange.bind(this, 'color')}
            mode="dialog">
            <Item label="red" color="red" value="red" />
            <Item label="green" color="green" value="green" />
            <Item label="blue" color="blue" value="blue" />
          </Picker>
        </UIExplorerBlock>
      </UIExplorerPage>
    );
  },

  changeMode: function() {
    const newMode = this.state.mode === Picker.MODE_DIALOG
        ? Picker.MODE_DROPDOWN
        : Picker.MODE_DIALOG;
    this.setState({mode: newMode});
  },

  onValueChange: function(key: string, value: string) {
    const newState = {};
    newState[key] = value;
    this.setState(newState);
  },
});

var styles = StyleSheet.create({
  picker: {
    width: 100,
  },
});

module.exports = PickerExample;


text:
layout: post
title: CoderDojo 9 - 25th June 2017
categories: session
cover: /assets/images/session-10/IMG_4778.jpg
---

> York CoderDojo 9 took place at 25th June 2017 10-12 at Clifton Green Primary, York

This session Emily & Onett got a robot to travel around in a square using Arduino!

Worksheets that we used this session:

- The Arduino group wrote the [Arduino code to control a robot's wheel motors](/worksheets/arduino/robot-motors/)
- And Arran made a [Scratch chat bot](/assets/worksheets/scratch/chatbot.pdf)

A big thank-you to all that came!

### Robot videos!

Right turns (kind of)

<video alt="Arduino robot doing right turns, kind of" width="99%" height="470" controls muted>
  <source src="/assets/videos/session-10/right-turns.mp4" type="video/mp4">
</video>

Trying to go in a square

<video alt="Squarish travelling robots" width="99%" height="470" controls muted>
  <source src="/assets/videos/session-10/round-and-round.mp4" type="video/mp4">
</video>

WHEY! A square!

<video alt="Arduino robot travelling in a square" width="99%" height="470" controls muted>
  <source src="/assets/videos/session-10/squares.mp4" type="video/mp4">
</video>

### Photos

![image one]({{ '/assets/images/session-10/IMG_4778.jpg' }})
![image one]({{ '/assets/images/session-10/IMG_4779.jpg' }})
![image one]({{ '/assets/images/session-10/IMG_4780.jpg' }})

### Worksheets this month

#### Scratch

- [Chat bot](/assets/worksheets/scratch/chatbot.pdf)

#### Arduino
- [Robot: Motors](/worksheets/arduino/robot-motors/)


text:
'use strict';

function SqlWrapMapConfigAdapter () {
}

module.exports = SqlWrapMapConfigAdapter;

SqlWrapMapConfigAdapter.prototype.getMapConfig = function (user, requestMapConfig, params, context, callback) {
    if (requestMapConfig && Array.isArray(requestMapConfig.layers)) {
        requestMapConfig.layers = requestMapConfig.layers.map(function (layer) {
            if (layer.options) {
                var sqlQueryWrap = layer.options.sql_wrap;
                if (sqlQueryWrap) {
                    var layerSql = layer.options.sql;
                    if (layerSql) {
                        layer.options.sql_raw = layerSql;
                        layer.options.sql = sqlQueryWrap.replace(/<%=\s*sql\s*%>/g, layerSql);
                    }
                }
            }
            return layer;
        });
    }

    return callback(null, requestMapConfig);
};


text:
from django.conf.urls.defaults import include, patterns
from smart.views import *
from smart.models.ontology_url_patterns import OntologyURLMapper
from smart.models.record_object import RecordObject

urlpatterns = patterns('')

"""
Remaining API calls are dealt with individually, below.
"""
urlpatterns += patterns(
    '',
    # Homepage
    (r'^$', home),

    # OAuth
    (r'^oauth/debug', debug_oauth),
    (r'^oauth/', include('smart.urls.oauth')),

    # Record
    (r'^record_by_token/$', record_by_token),
    (r'^records/search/xml$', record_search_xml),
    (r'^records/search$', record_search),
    (r'^records/(?P<record_id>[^/]+)$', record_info),

    (r'^accounts/(?P<account_id>[^/]+)/apps/(?P<app_email>[^/]+)$', MethodDispatcher({
                'PUT': add_app,
                'DELETE': remove_app})),

    (r'^accounts/(?P<account_id>[^/]+)/apps/(?P<pha_email>[^/]+)/launch', launch_app),

    (r'^users/$', MethodDispatcher({ 'POST': user_create,'OPTIONS' : allow_options})),
    (r'^users/reset_password_request$', MethodDispatcher({'POST': user_reset_password_request})),
    (r'^users/reset_password$', MethodDispatcher({'POST': user_reset_password})),

    # PHAs
    (r'^apps/$', all_phas),
    (r'^apps/accounts/(?P<account_id>[^/]+)/$', apps_for_account),
    (r'^apps/manifests/?$', all_manifests),
    (r'^apps/(?P<app_id>.+)/manifest$', MethodDispatcher({
                                       'GET': resolve_manifest,
                                       'PUT': manifest_put,
                                       'DELETE': manifest_delete,
                                       'OPTIONS' : allow_options})),
    (r'^apps/(?P<app_id>[^/]+)/credentials', app_oauth_credentials),

    # static
    (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'static'}),

    # SMART API
    (r'^users/(?P<user_id>[^/]+)/apps/(?P<pha_email>[^/]+)/preferences', MethodDispatcher({
                                       'GET': preferences_get,
                                       'PUT': preferences_put,
                                       'DELETE': preferences_delete,
                                       'OPTIONS' : allow_options})),

    (r'^records/(?P<record_id>[^/]+)/apps/(?P<pha_email>[^/]+)/scratchpad', MethodDispatcher({
                                       'GET': scratchpad_get,
                                       'PUT': scratchpad_put,
                                       'DELETE': scratchpad_delete,
                                       'OPTIONS' : allow_options})),

    (r'^apps/(?P<app_email>[^/]+)/tokens/records/first$', get_first_record_tokens),
    (r'^apps/(?P<app_email>[^/]+)/tokens/records/(?P<record_id>[^/]+)/next$', get_next_record_tokens),
    (r'^apps/(?P<app_email>[^/]+)/tokens/records/(?P<record_id>[^/]+)$', get_record_tokens),

    (r'^accounts/(?P<account_email>[^/]+)/alerts/(?P<alert_id>[^/]+)/acknowledge', account_acknowledge_alert),
    (r'^records/(?P<record_id>[^/]+)/alerts/all', record_get_alerts),

    (r'^accounts/search$', account_search),
    (r'^accounts/(?P<account_email>[^/]+)$', account_info),
    (r'^accounts/(?P<account_email>[^/]+)/recent_records/$', account_recent_records),
    (r'^accounts/(?P<account_email>[^/]+)/', include('smart.urls.account')),

    (r'^records/create/proxied', MethodDispatcher({ 'POST': create_proxied_record})),
    (r'^records/(?P<record_id>[^/]+)/generate_direct_url', MethodDispatcher({ 'GET': generate_direct_url })),
    (r'^session/from_direct_url', MethodDispatcher({ 'GET': session_from_direct_url }))
  )

"""
Record objects (meds, fills, notes, problems, etc.) are handled (when possible)
in an ontology-driven way:  rdfobjects loads the ontology, registers
handlers for all the relevant paths (e.g. /records/{record_id}/medications/)
and specified methods (GET, POST, PUT, DELETE).
"""
from smart.plugins import *

OntologyURLMapper(urlpatterns)


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nativelibs4java.opencl.blas;

import com.nativelibs4java.opencl.CLEvent;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author ochafik
 */
public class CLEvents {
    CLEvent lastWriteEvent;
    List<CLEvent> readEvents = new ArrayList<CLEvent>();

    List<Listener> listeners = new ArrayList<Listener>();

    public interface Listener {
        void writing(CLEvents evts);
        void reading(CLEvents evts);
    }
    public interface Action {
        CLEvent perform(CLEvent[] events);
    }

    public synchronized void addListener(Listener l) {
        listeners.add(l);
    }
    public synchronized void removeListener(Listener l) {
        listeners.remove(l);
    }
    static final CLEvent[] EMPTY_EVENTS = new CLEvent[0];
    protected synchronized CLEvent clearEvents(Action action) {
        int nReads = readEvents.size();
        boolean hasWrite = lastWriteEvent != null;
        int n = nReads + (hasWrite ? 1 : 0);
        CLEvent[] evts = n == 0 ? EMPTY_EVENTS : readEvents.toArray(new CLEvent[n]);
        if (hasWrite)
            evts[nReads] = lastWriteEvent;
        CLEvent evt = action.perform(evts);
        lastWriteEvent = null;
        readEvents.clear();
        return evt;
    }
    public synchronized CLEvent performRead(Action action) {
        for (Listener listener : listeners)
            listener.writing(this);
        CLEvent evt = action.perform(lastWriteEvent == null ? EMPTY_EVENTS : new CLEvent[] { lastWriteEvent });
        if (evt != null) {
            readEvents.add(evt);
            lastWriteEvent = null; // read completed only if the optional write also completed
        }
        return evt;
    }

    public synchronized void performRead(Runnable action) {
        for (Listener listener : listeners)
            listener.reading(this);
        waitForRead();
        action.run();
    }

    public synchronized CLEvent performWrite(Action action) {
        return lastWriteEvent = clearEvents(action);
    }

    /**
     * Wait until all write operations are completed so that the data is readable.
     */
    public synchronized void waitForRead() {
        CLEvent.waitFor(lastWriteEvent);
        lastWriteEvent = null;
    }
    /**
     * Wait for all associated operations to complete (read or write).
     */
    public synchronized void waitFor() {
        clearEvents(new Action() {
            public CLEvent perform(CLEvent[] evts) {
                CLEvent.waitFor(evts);
                return null;
            }
        });
    }
}


text:
@interface NSArray(F)
    - (void) each:(VoidIteratorArrayBlock) block;
    - (void) eachWithIndex:(VoidIteratorArrayWithIndexBlock) block;
    - (NSArray *) map:(MapArrayBlock) block;
    - (id) reduce:(ReduceArrayBlock) block withInitialMemo:(id) memo;
    - (NSArray *) filter:(BoolArrayBlock) block;
    - (NSArray *) reject:(BoolArrayBlock) block;
    - (BOOL) isValidForAll:(BoolArrayBlock) block;
    - (BOOL) isValidForAny:(BoolArrayBlock) block;
    - (NSNumber *) countValidEntries:(BoolArrayBlock) block;

    - (id) max:(CompareArrayBlock) block;
    - (id) min:(CompareArrayBlock) block;
    - (NSArray *) sort:(NSComparator) block;
    - (NSDictionary *) group:(MapArrayBlock) block;

    - (NSArray *) dropWhile:(BoolArrayBlock) block;

    - (id) first;
    - (NSArray *) reverse;

    - (NSArray *) arrayUntilIndex:(NSInteger) idx;
    - (NSArray *) arrayFromIndexOn:(NSInteger) idx;

    + (NSArray *) arrayFrom:(NSInteger) from To:(NSInteger) to;
@end


text:
package edu.isi.pegasus.planner.catalog.transformation.impl;

import edu.isi.pegasus.common.util.PegasusURL;
import edu.isi.pegasus.planner.catalog.TransformationCatalog;
import edu.isi.pegasus.planner.catalog.transformation.TransformationCatalogEntry;
import edu.isi.pegasus.planner.catalog.transformation.classes.TCType;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * An abstract base class that provides useful methods for all the TransformationCatalog
 * Implementations to use.
 *
 * @author Karan Vahi
 * @version $Revision$
 */
public abstract class Abstract implements TransformationCatalog {

    /**
     * Modifies a Transformation Catalog Entry to handle file URL's. A file URL if specified for the
     * physical path is converted to an absolute path if the type of entry is set to INSTALLED.
     *
     *
Alternately it modifies the TC to handle absolute file paths by converting them to file
     * URL if the type of entry is set to STAGEABLE.
     *
     * @param entry the transformation catalog entry object.
     * @return the TransformationCatalogEntry object.
     */
    public static TransformationCatalogEntry modifyForFileURLS(TransformationCatalogEntry entry) {
        // sanity checks
        if (entry == null || entry.getPhysicalTransformation() == null) {
            // return without modifying
            return entry;
        }

        String url = entry.getPhysicalTransformation();
        // convert file url appropriately for installed executables
        if (entry.getType().equals(TCType.INSTALLED)
                && url.startsWith(PegasusURL.FILE_URL_SCHEME)) {
            try {
                url = new URL(url).getFile();
                entry.setPhysicalTransformation(url);
            } catch (MalformedURLException ex) {
                throw new RuntimeException("Error while converting file url ", ex);
            }
        } else if (entry.getType().equals(TCType.STAGEABLE) && url.startsWith("/")) {
            url = PegasusURL.FILE_URL_SCHEME + "//" + url;
            entry.setPhysicalTransformation(url);
        }

        return entry;
    }

    /**
     * Modifies a Transformation Catalog Entry to handle file URL's. A file URL if specified for the
     * physical path is converted to an absolute path if the type of entry is set to INSTALLED.
     *
     *
Alternately it modifies the TC to handle absolute file paths by converting them to file
     * URL if the type of entry is set to STAGEABLE.
     *
     * @param pfn The PFN to modify
     * @param type The type of PFN
     * @return the Transformed PFN.
     */
    public static String modifyForFileURLS(String pfn, String type) {
        // sanity checks
        if (pfn == null) {
            // return without modifying
            return pfn;
        }

        if (TCType.valueOf(type) == TCType.INSTALLED
                && pfn.startsWith(PegasusURL.FILE_URL_SCHEME)) {
            try {
                pfn = new URL(pfn).getFile();
            } catch (MalformedURLException ex) {
                throw new RuntimeException("Error while converting file url ", ex);
            }
        } else if (TCType.valueOf(type) == TCType.STAGEABLE && pfn.startsWith("/")) {
            pfn = PegasusURL.FILE_URL_SCHEME + "//" + pfn;
        }

        return pfn;
    }
}


text:
'use strict';

var inherit = require('inherit'),
    StateError = require('./state-error');

var NoRefImageError = inherit(StateError, {
    /**
     * @constructor
     * @param {String} refImagePath
     * @param {StateResult} result
     */
    __constructor: function(refImagePath, result) {
        this.message = 'Can not find reference image at ' + refImagePath + '.\n' +
            'Run `gemini gather` command to capture all reference images.';

        this.currentPath =  result.currentPath;
        this.suite = result.suite;
        this.state = result.state;
        this.browserId = result.browserId;
    }
});

module.exports = NoRefImageError;


text:
#ifndef ScrollingTreeScrollingNode_h
#define ScrollingTreeScrollingNode_h

#if ENABLE(ASYNC_SCROLLING)

#include "IntRect.h"
#include "ScrollTypes.h"
#include "ScrollingCoordinator.h"
#include "ScrollingTreeNode.h"

namespace WebCore {

class ScrollingTree;
class ScrollingStateScrollingNode;

class ScrollingTreeScrollingNode : public ScrollingTreeNode {
public:
    virtual ~ScrollingTreeScrollingNode();

    WEBCORE_EXPORT void updateBeforeChildren(const ScrollingStateNode&) override;
    WEBCORE_EXPORT void updateAfterChildren(const ScrollingStateNode&) override;

    WEBCORE_EXPORT void updateLayersAfterAncestorChange(const ScrollingTreeNode& changedNode, const FloatRect& fixedPositionRect, const FloatSize& cumulativeDelta) override;

    virtual void handleWheelEvent(const PlatformWheelEvent&) = 0;
    WEBCORE_EXPORT virtual void setScrollPosition(const FloatPoint&);
    WEBCORE_EXPORT virtual void setScrollPositionWithoutContentEdgeConstraints(const FloatPoint&);

    virtual void updateLayersAfterViewportChange(const FloatRect& fixedPositionRect, double scale) = 0;
    virtual void updateLayersAfterDelegatedScroll(const FloatPoint&) { }

    virtual FloatPoint scrollPosition() const = 0;

#if ENABLE(CSS_SCROLL_SNAP)
    const Vector<float>& horizontalSnapOffsets() const { return m_horizontalSnapOffsets; }
    const Vector<float>& verticalSnapOffsets() const { return m_verticalSnapOffsets; }
    unsigned currentHorizontalSnapPointIndex() const { return m_currentHorizontalSnapPointIndex; }
    unsigned currentVerticalSnapPointIndex() const { return m_currentVerticalSnapPointIndex; }
    void setCurrentHorizontalSnapPointIndex(unsigned index) { m_currentHorizontalSnapPointIndex = index; }
    void setCurrentVerticalSnapPointIndex(unsigned index) { m_currentVerticalSnapPointIndex = index; }
#endif

protected:
    ScrollingTreeScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);

    WEBCORE_EXPORT virtual FloatPoint minimumScrollPosition() const;
    WEBCORE_EXPORT virtual FloatPoint maximumScrollPosition() const;

    virtual void setScrollLayerPosition(const FloatPoint&) = 0;

    FloatPoint lastCommittedScrollPosition() const { return m_lastCommittedScrollPosition; }
    const FloatSize& scrollableAreaSize() const { return m_scrollableAreaSize; }
    const FloatSize& totalContentsSize() const { return m_totalContentsSize; }
    const FloatSize& reachableContentsSize() const { return m_reachableContentsSize; }
    const IntPoint& scrollOrigin() const { return m_scrollOrigin; }

    // If the totalContentsSize changes in the middle of a rubber-band, we still want to use the old totalContentsSize for the sake of
    // computing the stretchAmount(). Using the old value will keep the animation smooth. When there is no rubber-band in progress at
    // all, m_totalContentsSizeForRubberBand should be equivalent to m_totalContentsSize.
    const FloatSize& totalContentsSizeForRubberBand() const { return m_totalContentsSizeForRubberBand; }
    void setTotalContentsSizeForRubberBand(const FloatSize& totalContentsSizeForRubberBand) { m_totalContentsSizeForRubberBand = totalContentsSizeForRubberBand; }

    ScrollElasticity horizontalScrollElasticity() const { return m_scrollableAreaParameters.horizontalScrollElasticity; }
    ScrollElasticity verticalScrollElasticity() const { return m_scrollableAreaParameters.verticalScrollElasticity; }

    bool hasEnabledHorizontalScrollbar() const { return m_scrollableAreaParameters.hasEnabledHorizontalScrollbar; }
    bool hasEnabledVerticalScrollbar() const { return m_scrollableAreaParameters.hasEnabledVerticalScrollbar; }

    bool canHaveScrollbars() const { return m_scrollableAreaParameters.horizontalScrollbarMode != ScrollbarAlwaysOff || m_scrollableAreaParameters.verticalScrollbarMode != ScrollbarAlwaysOff; }

private:
    FloatSize m_scrollableAreaSize;
    FloatSize m_totalContentsSize;
    FloatSize m_totalContentsSizeForRubberBand;
    FloatSize m_reachableContentsSize;
    FloatPoint m_lastCommittedScrollPosition;
    IntPoint m_scrollOrigin;
#if ENABLE(CSS_SCROLL_SNAP)
    Vector<float> m_horizontalSnapOffsets;
    Vector<float> m_verticalSnapOffsets;
    unsigned m_currentHorizontalSnapPointIndex { 0 };
    unsigned m_currentVerticalSnapPointIndex { 0 };
#endif
    ScrollableAreaParameters m_scrollableAreaParameters;
};

} // namespace WebCore

SPECIALIZE_TYPE_TRAITS_SCROLLING_NODE(ScrollingTreeScrollingNode, isScrollingNode())

#endif // ENABLE(ASYNC_SCROLLING)

#endif // ScrollingTreeScrollingNode_h


text:
import twitter
import json
import requests
from pprint import pprint
import hackupc.settings as settings
from bestin.utils import convert_degs_to_decimal
from bestin.models import Activity
from bestin.process import content_analyzer
from instagram_scrabber import get_self_media
def analyze_feed(user):
    if user.social_auth.get().provider == 'instagram':
        process_instagram(user)
    if user.social_auth.get().provider == 'twitter':
        process_twitter(user)

def get_score(intput_text):
    return content_analyzer().process_text(intput_text)

def process_instagram(user):
    token = user.social_auth.get().extra_data["access_token"]
    posts = get_self_media(token)
    charity_twitts = []
    geo_tagged = []
    for post in posts:
        score = get_score(post["text"])
        print(score)
        if score > 0:
            geo = [post["lng"], post["lat"]]
            post_id =int(post["id"].split('_')[0])%1000000
            if geo[0] is not None:
                print(geo)
                geo_str = str(geo)
            try:
                activity = Activity.objects.get(social_status_id=post_id)
            except Activity.DoesNotExist:
                charity_twitts.append(Activity.create(social_status_id=post_id, user_id=user, source=post["text"],
                                score=score, geodata=geo_str))
                if geo is not None:
                    geo_tagged.append({"UserID": user.id, "text": post["text"].replace('#', ' '),
                    "score": score, "lat": geo[1], "lon": geo[0]})
    Activity.objects.bulk_create(charity_twitts)
    adds = []
    print(geo_tagged)
    for tagged in geo_tagged:
        adds.append({"geometry": {"x": 1.1*tagged["lon"]*10**5, "y": 1.2225*tagged["lat"]*10**5}, "attributes": tagged})
    print(adds)
    print(requests.post('https://services7.arcgis.com/0MAMn0h8N3f8X276/arcgis/rest/services/Social_Activity/FeatureServer/applyEdits?f=pjson&edits='+json.dumps([{"id": 0, "adds": adds}]),
            headers={'Content-type': 'application/json', 'Accept': 'text/plain'}).text)

def process_twitter(user):
    tokens = user.social_auth.get().extra_data["access_token"]
    oauth_key = tokens["oauth_token"]
    oauth_secret = tokens["oauth_token_secret"]
    api = twitter.Api(consumer_key=settings.SOCIAL_AUTH_TWITTER_KEY,
                        consumer_secret=settings.SOCIAL_AUTH_TWITTER_SECRET,
                        access_token_key=oauth_key,
                        access_token_secret=oauth_secret)
    statuses = api.GetUserTimeline(include_rts=False, count=20)
    charity_twitts = []
    geo_tagged = []
    for status in statuses:
        score = get_score(status.text)
        if score > 0:
            geo = status.coordinates
            place = status.place
            if geo is not None:
                geo = geo["coordinates"]
            elif place is not None:
                place = place["full_name"]
                responce = requests.get('http://maps.google.com/maps/api/geocode/json?address='+place)
                location = json.loads(responce.text)["results"][0]["geometry"]["location"]
                geo = [location["lng"], location["lat"]]
            geo_str = str(geo)
            status_id = status.id % 1000000
            try:
                activity = Activity.objects.get(social_status_id=status_id)
            except Activity.DoesNotExist:
                charity_twitts.append(Activity.create(social_status_id=status_id, user_id=user, source=status.text,
                                score=score, geodata=geo_str))
                if geo is not None:
                    geo_tagged.append({"UserID": user.id, "text": status.text.replace('#', ' '),
                    "score": score, "lat": geo[1], "lon": geo[0]})

    Activity.objects.bulk_create(charity_twitts)
    adds = []
    print(geo_tagged)
    for tagged in geo_tagged:
        adds.append({"geometry": {"x": 1.1*tagged["lon"]*10**5, "y": 1.2225*tagged["lat"]*10**5}, "attributes": tagged})
    print(adds)
    print(requests.post('https://services7.arcgis.com/0MAMn0h8N3f8X276/arcgis/rest/services/Social_Activity/FeatureServer/applyEdits?f=pjson&edits='+json.dumps([{"id": 0, "adds": adds}]),
            headers={'Content-type': 'application/json', 'Accept': 'text/plain'}).text)

    #print(api.GetStatus(status_id='837968179766886401'))


text:
package magick

// #include <magick/api.h>
import "C"

// Backend returns the name of the library backend
// which was selected at build time. It must be
// either "ImageMagick" or "GraphicsMagick".
func Backend() string {
	return backend
}

// Supported formats returns a list with the names
// of all supported image formats. This varies depending
// on the backend and the compile options that have been
// used while building IM or GM.
func SupportedFormats() ([]string, error) {
	var ex C.ExceptionInfo
	C.GetExceptionInfo(&ex)
	defer C.DestroyExceptionInfo(&ex)
	infos, p := supportedFormats(&ex)
	if infos == nil {
		return nil, exError(&ex, "getting supported formats")
	}
	var formats []string
	for _, v := range infos {
		if v == nil {
			break
		}
		formats = append(formats, C.GoString(v.name))
	}
	freeMagickMemory(p)
	return formats, nil
}


text:
namespace AngleSharp.Dom.Svg
{
    using AngleSharp.Attributes;

    /// <summary>
    /// Serves as an entry point to the content of an SVG document.
    /// </summary>
    [DomName("SVGDocument")]
    public interface ISvgDocument : IDocument
    {
        /// <summary>
        /// Gets the root svg element in the document hierachy.
        /// </summary>
        [DomName("rootElement")]
        ISvgSvgElement RootElement { get; }
    }
}