text:
var path = require('path');
var fs = require('fs');
var request = require('request');
var calais = require('calais-entity-extractor');
;
/** Options */
var NewsSourceOptions = (function () {
    function NewsSourceOptions() {
        /** If true, set headers to enable CORRS. */
        this.corrs = true;
        /** source folder. If not set, uses ./newsfeatures */
        this.newsFolder = path.join(__dirname, 'newsfeatures');
        this.calaisApi = '';
        this.alchemyApi = '';
        this.keywords = [];
        this.ignorewords = [];
        this.searchurls = [];
        this.ignoreurls = [];
        this.updateInterval = 3600;
    }
    return NewsSourceOptions;
})();
exports.NewsSourceOptions = NewsSourceOptions;
;
var NewsSource = (function () {
    function NewsSource(app, options) {
        var _this = this;
        var defaultOptions = new NewsSourceOptions();
        if (!options)
            options = defaultOptions;
        this.options = options;
        if (!this.options.updateInterval || this.options.updateInterval < 2)
            this.options.updateInterval = 600;
        // enable corrs
        if ((options && typeof options.corrs !== 'undefined' && options.corrs) || defaultOptions.corrs) {
            app.use(function (req, res, next) {
                res.header('Access-Control-Allow-Origin', '*');
                res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
                next();
            });
        }
        this.alchemyFeed = new AlchemyFeed(app, options.alchemyApi);
        this.calaisSource = new CalaisSource(app, options.calaisApi, { minConfidence: 0.3, parseData: false });
        // Update on api call
        app.get('/api/newsfeatures', function (req, res) {
            _this.alchemyFeed.getNewsText(options, 3, function (data) { _this.processNews(data); });
            res.statusCode = 200;
            res.end();
        });
        // Update on api call with nr of items specified
        app.get('/api/newsfeatures/:numberofitems', function (req, res) {
            var n = req.params.numberofitems;
            if (n <= 0) {
                n = 1;
            }
            else if (n > 100) {
                n = 100;
            }
            n = Math.round(n);
            _this.alchemyFeed.getNewsText(options, n, function (data) { _this.processNews(data); });
            res.statusCode = 200;
            res.end();
        });
        // Update manually once on startup.
        this.alchemyFeed.getNewsText(options, 2, function (data) { _this.processNews(data); });
        // Update with interval
        setInterval(function () {
            _this.alchemyFeed.getNewsText(options, 2, function (data) { _this.processNews(data); });
        }, this.options.updateInterval * 1000);
    }
    /** Processes a data object containing news items */
    NewsSource.prototype.processNews = function (data) {
        var _this = this;
        console.log('Processing news...');
        var items = [];
        if (data && data.hasOwnProperty('docs')) {
            data['docs'].forEach(function (item) {
                // Skip items that already exist
                if (fs.existsSync(path.join(_this.options.newsFolder, item.id + '.json')))
                    return;
                items.push(item);
            });
            // Throttle the OpenCalais calls to <1Hz to prevent exceeding the limit
            setTimeout(function () { return _this.contactCalais(items); }, 1100);
        }
        else {
            console.log('No docs found in result');
        }
    };
    /** Adds (geographic) information to news items using the OpenCalais source*/
    NewsSource.prototype.contactCalais = function (items) {
        var _this = this;
        console.log('Contacting calais...');
        var item = items.shift();
        if (item && item.source && item.source.enriched && item.source.enriched.url) {
            this.calaisSource.getNewsFeatures(item.source.enriched.url.title + ' \n ' + item.source.enriched.url.text, (function (fts) {
                console.log('Nr. items: ' + fts.length);
                fts = fts.sort(function (a, b) {
                    if (!a.properties.hasOwnProperty('relevance'))
                        return -1;
                    if (!b.properties.hasOwnProperty('relevance'))
                        return 1;
                    return (a.properties.relevance - b.properties.relevance);
                });
                if (fts.length === 0)
                    fs.writeFileSync(path.join(_this.options.newsFolder, item.id + '.json'), null);
                fts.some(function (f) {
                    if (f.geometry.coordinates.length > 0) {
                        f.properties['news_title'] = item.source.enriched.url.title;
                        f.properties['news_text'] = item.source.enriched.url.text;
                        f.properties['news_date'] = item.timestamp * 1000; //Timestamp is in seconds, convert to ms
                        f.properties['news_url'] = '[url=' + item.source.enriched.url.url + ']Source[/url]';
                        f.properties['news_author'] = item.source.enriched.url.author;
                        f.id = item.id;
                        f.type = 'Feature';
                        fs.writeFileSync(path.join(_this.options.newsFolder, item.id + '.json'), JSON.stringify(f));
                        return true;
                    }
                    return false;
                });
            }));
        }
        if (items.length === 0) {
            console.log('Calais queue empty');
            return;
        }
        setTimeout(function () { return _this.contactCalais(items); }, 1000);
    };
    return NewsSource;
})();
exports.NewsSource = NewsSource;
// export class NYTimesFeed {
//     private apiKey;
//     private keywords: string[];
//     constructor(app: express.Express, apiKey: string) {
//         if (!apiKey || apiKey === '') {
//             console.log('Error: no api-key found for NYTimesFeed. Exiting...');
//             return;
//         }
//         this.apiKey = apiKey;
//         app.use(function(req, res, next) {
//             res.header('Access-Control-Allow-Origin', '*');
//             res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
//             next();
//         });
//     }
//     public getNewsText(keywords: string | string[], clbk: Function): void {
//         var keys: string[];
//         if (typeof keywords === 'string') {
//             keys = [keywords];
//         } else if (Array.isArray(keywords)) {
//             keys = keywords;
//         } else {
//             console.log('Warning: no valid keyword(s)');
//             clbk(null, 'No valid keyword(s)');
//             return;
//         }
//         var url = ['http://api.nytimes.com/svc/search/v2/articlesearch.json?api-key=' + this.apiKey];
//         url.push('fq=headline:("' + keys.join('" "') + '") AND type_of_material:("News")');
//         url.push('begin_date=20140101');
//         url.push('sort=newest');
//         var urlString = url.join('&');
//         this.performRequest(urlString, (data, errText) => {
//             console.log('News request status: ' + urlString);
//             clbk(data, errText);
//         });
//     }
//     private performRequest(url: string, cb: Function) {
//         var options = {
//             uri: url,
//             method: 'GET',
//             body: null,
//             headers: {}
//         };
//         //Send the response
//         request(options, function(error, response, data) {
//             if (error) {
//                 return cb({}, error);
//             }
//             if (response === undefined) {
//                 return cb({}, 'Undefined NYtimes response');
//             } else if (response.statusCode === 200) {
//                 if (!data) {
//                     return cb({}, 'No data received');
//                 } else {
//                     try {
//                         var parsed = JSON.parse(data);
//                         if (parsed.hasOwnProperty('response')) {
//                             cb(parsed['response'], 'OK');
//                         } else {
//                             console.log(parsed);
//                             cb({}, 'No result received');
//                         }
//                     } catch (error) {
//                         cb({}, 'JSON parsing error');
//                     }
//                 }
//             } else {
//                 cb({}, 'Undefined response: ' + response.statusCode);
//             }
//         });
//     }
// }
var AlchemyFeed = (function () {
    function AlchemyFeed(app, apiKey) {
        if (!apiKey || apiKey === '') {
            console.log('Error: no api-key found for AlchemyFeed. Exiting...');
            return;
        }
        this.apiKey = apiKey;
        app.use(function (req, res, next) {
            res.header('Access-Control-Allow-Origin', '*');
            res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
            next();
        });
    }
    AlchemyFeed.prototype.stringToStringArray = function (arr) {
        var input = arr;
        var result;
        if (typeof input === 'string') {
            result = [input];
        }
        else if (Array.isArray(input)) {
            result = input;
        }
        else {
            console.log('Warning: no valid string(array)');
            result = null;
        }
        return result;
    };
    AlchemyFeed.prototype.getNewsText = function (options, count, clbk) {
        var ignoreKeys = this.stringToStringArray(options.ignorewords) || [];
        var ignoreUrls = this.stringToStringArray(options.ignoreurls) || [];
        var searchUrls = this.stringToStringArray(options.searchurls) || [];
        var keys = this.stringToStringArray(options.keywords);
        if (!keys) {
            clbk(null, 'No valid keyword(s)');
            return;
        }
        if (typeof count !== 'number')
            count = 5;
        var url = ['https://gateway-a.watsonplatform.net/calls/data/GetNews?apikey=' + this.apiKey];
        url.push('outputMode=json');
        url.push('start=now-14d');
        url.push('end=now');
        url.push('count=' + count);
        url.push('q.enriched.url.enrichedTitle.keywords.keyword.text=O[' + keys.join('^') + ']');
        url.push('q.enriched.url.text=-[' + ignoreKeys.join('^') + ']');
        // if (searchUrls && searchUrls.length > 0) {
        //     url.push('q.enriched.url.url=O+[' + searchUrls.join('^') + ']');
        // } else
        if (ignoreUrls && ignoreUrls.length > 0) {
            url.push('q.enriched.url.url=A-[' + ignoreUrls.join('^') + ']');
        }
        url.push('return=enriched.url.url,enriched.url.title,enriched.url.text,enriched.url.author');
        var urlString = url.join('&');
        this.performRequest(urlString, function (data, errText) {
            console.log('News request status: ' + errText);
            clbk(data, errText);
        });
    };
    AlchemyFeed.prototype.performRequest = function (url, cb) {
        var options = {
            uri: url,
            method: 'GET',
            body: null,
            headers: {}
        };
        //Send the response
        request(options, function (error, response, data) {
            if (error) {
                return cb({}, error);
            }
            if (response === undefined) {
                return cb({}, 'Undefined Alchemy response');
            }
            else if (response.statusCode === 200) {
                if (!data) {
                    return cb({}, 'No data received');
                }
                else {
                    try {
                        var parsed = JSON.parse(data);
                        if (parsed.hasOwnProperty('result')) {
                            cb(parsed['result'], 'OK');
                        }
                        else {
                            console.log(parsed);
                            cb({}, 'No result received');
                        }
                    }
                    catch (error) {
                        cb({}, 'JSON parsing error');
                    }
                }
            }
            else {
                cb({}, 'Undefined response: ' + response.statusCode);
            }
        });
    };
    return AlchemyFeed;
})();
exports.AlchemyFeed = AlchemyFeed;
var CalaisSource = (function () {
    function CalaisSource(app, apiKey, options) {
        if (!apiKey || apiKey === '') {
            console.log('Error: no api-key found for OpenCalais. Exiting...');
            return;
        }
        app.use(function (req, res, next) {
            res.header('Access-Control-Allow-Origin', '*');
            res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
            next();
        });
        this.oc = new calais.Calais(apiKey, options);
        this.oc.set('content', '');
    }
    CalaisSource.prototype.getNewsFeatures = function (content, cb) {
        var _this = this;
        if (!content || content === '') {
            console.log('Error: no valid content.');
            cb([]);
        }
        this.oc.set('content', content);
        this.oc.extractFromText(function (result, err) {
            if (err) {
                console.log('OpenCalais returned an error! : ' + err);
                cb([]);
            }
            var features = _this.parseResult(result);
            cb(features);
        });
    };
    CalaisSource.prototype.parseResult = function (res) {
        var features = [];
        var json = {};
        if (typeof res === 'string') {
            try {
                console.log('Parsing...');
                json = JSON.parse(res);
            }
            catch (error) {
                console.log('Error parsing string: ' + res);
                return;
            }
        }
        else if (typeof res !== 'object') {
            console.log('Unknown type: ' + typeof res);
            return;
        }
        else {
            json = res;
        }
        for (var key in json) {
            if (!json.hasOwnProperty(key))
                continue;
            var item = json[key];
            if (!item.hasOwnProperty('_typeGroup') || !item.hasOwnProperty('name'))
                continue;
            var f;
            switch ((item['_typeGroup'])) {
                case 'entities':
                    f = this.parseEntity(item);
                    break;
                case 'relations':
                    f = this.parseRelation(item);
                    break;
                default:
                    break;
            }
            if (f) {
                features.push(f);
            }
        }
        return features;
    };
    CalaisSource.prototype.parseEntity = function (item) {
        var f = { properties: {}, geometry: { type: 'Point', coordinates: [] }, sensors: null, id: item.id };
        if (item.hasOwnProperty('resolutions')) {
            var r = item['resolutions'].pop();
            if (r.hasOwnProperty('latitude') && r.hasOwnProperty('longitude')) {
                f.geometry.coordinates = [parseFloat(r['longitude']), parseFloat(r['latitude'])];
            }
            f.properties = r;
        }
        if (item.hasOwnProperty('name'))
            f.properties['Name'] = item['name'];
        if (item.hasOwnProperty('_type'))
            f.properties['Type'] = item['_type'];
        if (item.hasOwnProperty('relevance'))
            f.properties['Relevance'] = item['relevance'];
        return f;
    };
    CalaisSource.prototype.parseRelation = function (item) {
        var f = {};
        f.properties = {};
        f.properties['Name'] = item['name'];
        return f;
    };
    return CalaisSource;
})();
exports.CalaisSource = CalaisSource;
//# sourceMappingURL=index.js.map


text:
package fast_exponentiation

func FastPower(base,exponent int64) int64 {
	if exponent == 0 {
		return 1
	}

	if exponent == 1 {
		return base
	}

	if exponent % 2 == 0 {
		return FastPower(base*base, exponent/2)
	} else {
		return base * FastPower(base*base, (exponent-1)/2)
	}
}

redpajama_set_name: RedPajamaGithub


text:
import {takeEvery, takeLatest, call, put} from "redux-saga/effects";

import uuid from "node-uuid";

import Bitrix from "common/scripts/lib/Bitrix";
import {replace, reduce} from "common/scripts/common";
// import {enableToolPanel} from "./common";
import store from "../store";

import * as actions from "../actions";
import * as php from "../php";
import {saveBitrixOptions} from "../php/index";

function processJsonBody(body, defaultValue = {}) {
    let jsonObject = defaultValue;

    try {
        jsonObject = JSON.parse(body || defaultValue);
    } catch (e) {
        // Не делаем ничего
    }

    return jsonObject;
}

export function* phpBeginRequest(action) {
    const {input, target, prepend, append} = action.payload;

    const {sessId, origin, language} = store.getState().site.data;
    let response;

    try {
        const bitrix = new Bitrix(sessId, origin, language);
        response = yield call([bitrix, bitrix.execute], input, prepend, append);

        if (!response) {
            throw new Exception();
        }
    } catch (e) {
        response = {
            status: "error",
            body: "",
        };
    }

    yield put(actions.phpEndRequest());

    const {status, body} = response;
    const date = Date.now();

    switch (target.type) {
        case "console-exec": {
            yield put(actions.consoleResultUpdate(body, status, target.index));
            break;
        }
        case "info-server": {
            yield put(actions.infoServerUpdate(uuid.v4(), processJsonBody(body), status));
            break;
        }
        case "info-session": {
            yield put(actions.infoSessionUpdate(uuid.v4(), processJsonBody(body), status));
            break;
        }
        case "inspector-query": {
            const items = processJsonBody(body, []).map(item => ({
                // uuid: uuid.v4(),
                uuid: item.ID,
                value: item,
                date,
            }));

            yield put(actions.inspectorSetItems(target.subtype, items, status, date));
            break;
        }
        case "inspector-save": {
            const response = processJsonBody(body);

            if (response && (typeof response === "object") && (typeof response.RESULT === "object")) {
                const itemsToUpdate = response.RESULT::reduce([], (acc, k, result) => (
                    result.SUCCESS
                        ? acc.concat({
                            uuid: result.VALUE.ID,
                            value: result.VALUE,
                            date,
                        })
                        : acc
                ), []);

                yield put(actions.inspectorSaveItems(target.subtype, itemsToUpdate, date));
            }

            break;
        }
        case "helper-property-enum-query": {
            const items = processJsonBody(body, []).map(item => ({
                // uuid: uuid.v4(),
                uuid: item.ID,
                value: item,
                date,
            }));

            yield put(actions.helperPropertyEnumSetItems(items));

            break;
        }
        case "info-php": {
            const items = processJsonBody(body);
            const itemsAry = Object.keys(items).map(option => ({
                uuid: uuid.v4(),
                value: {
                    name: option,
                    globalValue: items[option].global_value,
                    localValue: items[option].local_value,
                    access: items[option].access,
                },
            }));

            yield put(actions.infoPHPUpdate(itemsAry, status, date));
            break;
        }
        case "info-bitrix-query":
        case "info-bitrix-save": {
            const items = processJsonBody(body).map(option => ({
                uuid: uuid.v4(),
                value: option,
            }));

            yield put(actions.infoBitrixUpdate(items, status, date));
            break;
        }
        default: {
            break;
        }
    }
}

export function storeUpdateSiteState(action) {
    const {data: {sessId}} = action.payload.newState;

    // enableToolPanel(sessId);
}

export function pageNavigationStart() {
    // enableToolPanel(false);
}

export function* requestConsoleExec(action) {
    const {payload: {index, input, viewState}} = action;

    yield put(actions.consoleEditorSetState({
        [index]: {
            contents: input,
            viewState,
        }
    }));

    yield put(actions.phpBeginRequest(input, {
        type: "console-exec",
        index,
        viewState,
    },
        store.getState().settings.phpConsole.prologue.contents,
        store.getState().settings.phpConsole.epilogue.contents,
    ));
}

export function* requestInfoServerUpdate() {
    yield put(actions.phpBeginRequest(php.getServer, {
        type: "info-server",
    }));
}

export function* requestInfoSessionUpdate() {
    yield put(actions.phpBeginRequest(php.getSession, {
        type: "info-session",
    }));
}

export function* requestInfoSessionSave(action) {
    const {payload: {session}} = action;

    // noinspection JSUnresolvedVariable
    yield put(actions.phpBeginRequest(php.putSession::replace({
        json: JSON.stringify(session),
    }), {
        type: "info-session",
    }));
}

export function* requestInfoPHPUpdate() {
    yield put(actions.phpBeginRequest(php.getPhpOptions, {
        type: "info-php",
    }));
}

export function* requestInfoBitrixUpdate() {
    yield put(actions.phpBeginRequest(php.getBitrixOptions, {
        type: "info-bitrix-query",
    }));
}

export function* requestInfoBitrixSave(action) {
    const {items} = action.payload;

    // noinspection JSUnresolvedVariable
    yield put(actions.phpBeginRequest(php.saveBitrixOptions::replace({
        items: JSON.stringify(items),
    }), {
        type: "info-bitrix-save",
    }));
}

export function* requestInspectorQueryItems(action) {
    const {payload: {target, filter, filterExtended, sortExtended}} = action;

    // noinspection JSUnresolvedVariable
    yield put(actions.phpBeginRequest(php[`${target}Query`]::replace({
        filter: JSON.stringify(filter),
        filterExtended: JSON.stringify(filterExtended),
        sortExtended: JSON.stringify(sortExtended),
    }), {
        type: "inspector-query",
        subtype: target,
    }));
}

export function* requestInspectorSaveItems(action) {
    const {payload: {target, delta}} = action;

    // noinspection JSUnresolvedVariable
    yield put(actions.phpBeginRequest(php[`${target}Save`]::replace({
        delta: JSON.stringify(delta),
    }), {
        type: "inspector-save",
        subtype: target,
    }));
}

export function* requestHelperPropertyEnumQueryItems(action) {
    const {payload: {propertyId, iblockId}} = action;

    // noinspection JSUnresolvedVariable
    yield put(actions.phpBeginRequest(php.getHelperPropertyEnum::replace({
        propertyId: JSON.stringify(propertyId),
        iblockId: JSON.stringify(iblockId),
    }), {
        type: "helper-property-enum-query",
    }));
}

export default function*() {
    // yield takeLatest(actions.PHP_BEGIN_REQUEST, phpBeginRequest);
    yield takeEvery(actions.PHP_BEGIN_REQUEST, phpBeginRequest);

    yield takeEvery(actions.REQUEST_CONSOLE_EXEC, requestConsoleExec);

    yield takeEvery(actions.REQUEST_INFO_SERVER_UPDATE, requestInfoServerUpdate);
    yield takeEvery(actions.REQUEST_INFO_SESSION_UPDATE, requestInfoSessionUpdate);
    yield takeEvery(actions.REQUEST_INFO_SESSION_SAVE, requestInfoSessionSave);
    yield takeEvery(actions.REQUEST_INFO_PHP_UPDATE, requestInfoPHPUpdate);
    yield takeEvery(actions.REQUEST_INFO_BITRIX_UPDATE, requestInfoBitrixUpdate);
    yield takeEvery(actions.REQUEST_INFO_BITRIX_SAVE, requestInfoBitrixSave);

    yield takeEvery(actions.REQUEST_INSPECTOR_QUERY_ITEMS, requestInspectorQueryItems);
    yield takeEvery(actions.REQUEST_INSPECTOR_SAVE_ITEMS, requestInspectorSaveItems);

    yield takeEvery(actions.REQUEST_HELPER_PROPERTY_ENUM_QUERY_ITEMS, requestHelperPropertyEnumQueryItems);

    yield takeEvery(actions.STORE_UPDATE_SITE_STATE, storeUpdateSiteState);
    yield takeEvery(actions.PAGE_NAVIGATION_START, pageNavigationStart);
}


text:
namespace AVRDisassembler.InstructionSet.OpCodes.Branch
{
    public class EIJMP : OpCode
    {
        public override string Comment => "Extended Indirect Jump";
    }
}


text:
package compute_test

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	"google.golang.org/api/iterator"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func ExampleNewSnapshotsRESTClient() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func ExampleSnapshotsClient_Delete() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteSnapshotRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteSnapshotRequest.
	}
	op, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}

func ExampleSnapshotsClient_Get() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetSnapshotRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetSnapshotRequest.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleSnapshotsClient_GetIamPolicy() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetIamPolicySnapshotRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetIamPolicySnapshotRequest.
	}
	resp, err := c.GetIamPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleSnapshotsClient_Insert() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.InsertSnapshotRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertSnapshotRequest.
	}
	op, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}

func ExampleSnapshotsClient_List() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListSnapshotsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListSnapshotsRequest.
	}
	it := c.List(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func ExampleSnapshotsClient_SetIamPolicy() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.SetIamPolicySnapshotRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetIamPolicySnapshotRequest.
	}
	resp, err := c.SetIamPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func ExampleSnapshotsClient_SetLabels() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.SetLabelsSnapshotRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsSnapshotRequest.
	}
	op, err := c.SetLabels(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}

func ExampleSnapshotsClient_TestIamPermissions() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := compute.NewSnapshotsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.TestIamPermissionsSnapshotRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#TestIamPermissionsSnapshotRequest.
	}
	resp, err := c.TestIamPermissions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}


text:
package demo.meetup.web;

import demo.meetup.client.HelloClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private HelloClient helloClient;

    @RequestMapping(path = "/hello", method = RequestMethod.GET)
    public String sayHelloToMyLittleFriends() {
        return helloClient.hello();
    }

}


text:
layout: default
title: "Lord Hutton of Furness"
house: lords

---

        {% include members/lord-hutton-of-furness.html %}

What is Lord Hutton of Furness interested in?

Lord Hutton of Furness hasn't said he is interested in anything! Why not write to them and ask?

Party

Lord Hutton of Furness is part of the Labour party.

What is a party?


text:
<?php

final class NuanceItem
  extends NuanceDAO
  implements
    PhabricatorPolicyInterface,
    PhabricatorApplicationTransactionInterface {

  const STATUS_OPEN     = 0;
  const STATUS_ASSIGNED = 10;
  const STATUS_CLOSED   = 20;

  protected $status;
  protected $ownerPHID;
  protected $requestorPHID;
  protected $sourcePHID;
  protected $sourceLabel;
  protected $data = array();
  protected $mailKey;
  protected $dateNuanced;

  public static function initializeNewItem() {
    return id(new NuanceItem())
      ->setDateNuanced(time())
      ->setStatus(self::STATUS_OPEN);
  }

  protected function getConfiguration() {
    return array(
      self::CONFIG_AUX_PHID => true,
      self::CONFIG_SERIALIZATION => array(
        'data' => self::SERIALIZATION_JSON,
      ),
      self::CONFIG_COLUMN_SCHEMA => array(
        'ownerPHID' => 'phid?',
        'sourceLabel' => 'text255?',
        'status' => 'uint32',
        'mailKey' => 'bytes20',
        'dateNuanced' => 'epoch',
      ),
      self::CONFIG_KEY_SCHEMA => array(
        'key_source' => array(
          'columns' => array('sourcePHID', 'status', 'dateNuanced', 'id'),
        ),
        'key_owner' => array(
          'columns' => array('ownerPHID', 'status', 'dateNuanced', 'id'),
        ),
        'key_contacter' => array(
          'columns' => array('requestorPHID', 'status', 'dateNuanced', 'id'),
        ),
      ),
    ) + parent::getConfiguration();
  }

  public function generatePHID() {
    return PhabricatorPHID::generateNewPHID(
      NuanceItemPHIDType::TYPECONST);
  }

  public function save() {
    if (!$this->getMailKey()) {
      $this->setMailKey(Filesystem::readRandomCharacters(20));
    }
    return parent::save();
  }

  public function getURI() {
    return '/nuance/item/view/'.$this->getID().'/';
  }

  public function getLabel(PhabricatorUser $viewer) {
    // this is generated at the time the item is created based on
    // the configuration from the item source. It is typically
    // something like 'Twitter'.
    $source_label = $this->getSourceLabel();

    return pht(
      'Item via %s @ %s.',
      $source_label,
      phabricator_datetime($this->getDateCreated(), $viewer));
  }

  public function getRequestor() {
    return $this->assertAttached($this->requestor);
  }

  public function attachRequestor(NuanceRequestor $requestor) {
    return $this->requestor = $requestor;
  }

  public function getSource() {
    return $this->assertAttached($this->source);
  }

  public function attachSource(NuanceSource $source) {
    $this->source = $source;
  }

  public function getNuanceProperty($key, $default = null) {
    return idx($this->data, $key, $default);
  }

  public function setNuanceProperty($key, $value) {
    $this->data[$key] = $value;
    return $this;
  }

  public function getCapabilities() {
    return array(
      PhabricatorPolicyCapability::CAN_VIEW,
      PhabricatorPolicyCapability::CAN_EDIT,
    );
  }

  public function getPolicy($capability) {
    // TODO - this should be based on the queues the item currently resides in
    return PhabricatorPolicies::POLICY_USER;
  }

  public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
    // TODO - requestors should get auto access too!
    return $viewer->getPHID() == $this->ownerPHID;
  }

  public function describeAutomaticCapability($capability) {
    switch ($capability) {
      case PhabricatorPolicyCapability::CAN_VIEW:
        return pht('Owners of an item can always view it.');
      case PhabricatorPolicyCapability::CAN_EDIT:
        return pht('Owners of an item can always edit it.');
    }
    return null;
  }

  public function toDictionary() {
    return array(
      'id' => $this->getID(),
      'phid' => $this->getPHID(),
      'ownerPHID' => $this->getOwnerPHID(),
      'requestorPHID' => $this->getRequestorPHID(),
      'sourcePHID' => $this->getSourcePHID(),
      'sourceLabel' => $this->getSourceLabel(),
      'dateCreated' => $this->getDateCreated(),
      'dateModified' => $this->getDateModified(),
      'dateNuanced' => $this->getDateNuanced(),
    );
  }

/* -(  PhabricatorApplicationTransactionInterface  )------------------------- */

  public function getApplicationTransactionEditor() {
    return new NuanceItemEditor();
  }

  public function getApplicationTransactionObject() {
    return $this;
  }

  public function getApplicationTransactionTemplate() {
    return new NuanceItemTransaction();
  }

  public function willRenderTimeline(
    PhabricatorApplicationTransactionView $timeline,
    AphrontRequest $request) {
    return $timeline;
  }

}


text:
(function(gc_payment, $, undefined ) {

  var buttons;

  //Public Methods
  gc_payment.init = function() {
      $('.gc-control-label > label').addClass('control-label');
      $('#login').click(function() {
          $.post(Routing.generate('fos_user_security_check', {
        '_username': $('#payment_email').val(),
        '_password': $('#payment_plain_password').val(),
        '_csrf_token': $('#_csrf_token').val() }
      ),
            function(data) {
        if (data.success === true) {
          loginView();
        } else {
          loginFailed();
        }
            },
      'json'
          );
      return false;
      });
  };

  function loginView() {
    console.log('Login view init...');
  }

  function loginFailed() {
    $('#login-error').css('visibility', 'visible');

  }

}(window.gc_payment = window.gc_payment || {}, jQuery));

$(document).ready(function() {

  gc_payment.init();
});


text:
import { forwardRef } from "react";

import { FontIcon, FontIconProps } from "@react-md/icon";

export const MoreHorizFontIcon = forwardRef<HTMLElement, FontIconProps>(
  function MoreHorizFontIcon(props, ref) {
    return (
      <FontIcon {...props} ref={ref}>
        more_horiz
      </FontIcon>
    );
  }
);


text:
require('../node_modules/medium-editor/dist/css/medium-editor.css')
require('../css/mediumEditorTheme.css')
require('./speech.css')
module.exports = angular.module('fastflowApp.speech', ['ngRoute', 'MassAutoComplete', 'ngSanitize', 'angular-medium-editor', 'ngAnimate'])
    .config(['$routeProvider', function($routeProvider) {
        $routeProvider.when('/speech/:tag', {
            templateUrl: 'speech/speech.html',
            controller: 'speechCtrl'
        })

        $routeProvider.when('/speech', {
            templateUrl: 'speech/speech.html',
            controller: 'speechCtrl'
        })
    }])
    .controller('speechCtrl', ['$scope', '$routeParams', 'defaultNav', function($scope, $routeParams, defaultNav) {
        $scope.$on('$routeChangeStart', function(event, next, current) {
            if (next.$$route) {
                if (next.$$route.controller === "indexCtrl") {
                    $scope.transitionClass = 'exitRight'
                    console.log('exitLeft because indexCtrl')
                } else {
                    $scope.transitionClass = 'exitLeft'
                }
            }
        })
        $('#deleteConfirmation').modal()

        $scope.none = "NONE"
        $scope.aff = "AFF"
        $scope.neg = "NEG"
        $scope.titleContent = {
            title: "",
            author: "",
            side: "NONE"
        }
				$scope.preflow = {}
        $scope.preflow.data = []
				$scope.preflow.name = ""
        $scope.framework = "
Definitions:&nbsp

Framework:&nbsp

Outline:&nbsp
"
        $scope.points = [{
            tagline: "",
            content: ""
        }]

        if ($routeParams.tag) {
            console.log($routeParams)
            var decodedURI = decodeURIComponent($routeParams.tag)
            console.log('opening speech: ' + decodedURI)
            speech = ipcRenderer.sendSync('SpeechOpen', decodedURI)
            if (speech == []) console.log('error, speech not found')
            mSpeech = JSON.parse(speech)
            console.log(mSpeech.tagLine)
            $scope.titleContent = mSpeech.tagLine
            $scope.points = mSpeech.content
            $scope.framework = mSpeech.sTags
						if (mSpeech.preflow) $scope.preflow = mSpeech.preflow
            $scope.id = mSpeech.$loki
        }

        $scope.$parent.setNav({
            left: [{
                icon: 'arrow_back',
                attrs: [{
                        attr: 'href',
                        value: '#!/speechManager'
                    },
                    {
                        attr: 'class',
                        value: 'active'
                    }
                ]
            }],
            right: [{
                icon: 'delete',
                action: function() {
                    $scope.deleteFunction()
                }
            }, {
                icon: 'save',
                action: function() {
                    $scope.saveFunction()
                }
            }]
        }, $scope.titleContent.title)

        $scope.saveFunction = function() {
            if ($scope.saving) return //don't let function run twice at same time
            $scope.saving = true
            var speech = {
                tagLine: $scope.titleContent,
                sTags: $scope.framework,
                content: $scope.points,
                id: $scope.id,
								preflow: $scope.preflow
            }
            console.log(speech)
            if ($scope.titleContent.title.length > 0) {
                ipcRenderer.send('SpeechSave', speech)
                Materialize.toast('Speech Saved!', 3000) // 3000 is the duration of the toast
                window.location.replace('#!/speechManager')
            } else {
                Materialize.toast('Speech title is empty', 3000)
            }

            $scope.saving = false
        }

        $scope.deleteFunction = function() {
            $('#deleteConfirmation').modal('open')
        }

        $scope.delete = function() {
            ipcRenderer.send('SpeechRemove', $scope.id)
            window.location.replace('#!/speechManager')
            $('#deleteConfirmation').modal('close')

        }

        $scope.newPoint = function() {
            $scope.points.push({
                tagline: "",
                content: ""
            })
        }
        $scope.deletePoint = function(i) {
            console.log("deleting")
            console.log(i)
            $scope.points.splice(i, 1);
        }

    }])
    .directive('box', function() {
        return {
            restrict: 'AE',
            scope: {
                tag: '=',
                text: '=',
                type: '=',
                index: '=boxindex',
                removeBox: '&boxrm'
            },
            controller: function() {
                this.color = function(type, critical) {
                    var style = ''
                    if (type == 'extension') style = 'blue'
                    if (type == 'response') style = 'red'
                    if (type == 'arrow') style = 'green'
                    if (critical) {
                        style += ' boxCriticalBorder'
                    } else {
                        style += ' accent-1'
                    }
                    return style
                }
                this.rmbox = function() {
                    this.removeBox({
                        index: this.index
                    })
                }
                this.critical = false
                this.toggleCritical = function() {
                    this.critical = !this.critical
                }
                this.isCritical = function() {
                    if (this.critical) return 'boxCriticalBorder'
                    return ''
                }
                this.getStyle = function(type) {
                    return this.color(type, this.isCritical())
                }
            },
            controllerAs: 'b',
            bindToController: true,
            templateUrl: 'speech/templates/box.html'
        }
    })
    .directive('arguement', function() {
        return {
            restrict: 'AE',
            transclude: true,
            scope: {
                boxes: '=',
                index: '=argindex',
                removeArgument: '&argrm'
            },
            controller: function() {
                $('.tooltipped').tooltip()
                this.extend = function() {
                    this.boxes.push({
                        "type": "extension",
                        "text": ""
                    })
                }
                this.respond = function() {
                    this.boxes.push({
                        "type": "response",
                        "text": ""
                    })
                }
                this.arrow = function() {
                    this.boxes.push({
                        "type": "arrow"
                    })
                }
                this.removeBox = function(index) {
                    this.boxes.splice(index, 1)
                }
                this.rmarg = function() {
                    $('.tooltipped').tooltip('remove') //closes then reinitializes all the tooltips
                    $('.tooltipped').tooltip()
                    this.removeArgument({
                        index: this.index
                    })
                }
            },
            controllerAs: 'a',
            bindToController: true,
            templateUrl: 'speech/templates/arg.html'
        }
    })
    .directive('contention', function() {
        return {
            restrict: 'E',
            scope: {
                args: '=',
                name: '=',
                index: '=contindex',
                removeContention: '&contrm'
            },
            controller: function() {
                $('.tooltipped').tooltip()
                this.newArg = function() {
                    this.args.push([{
                        "title": "",
                        "text": "",
                        "type": "constructive"
                    }])
                }
                this.removeArgument = function(index) { //removing arguement from contention
                    this.args.splice(index, 1)
                }
                this.rmcont = function() { //remove contention called from the contention
                    $('.tooltipped').tooltip('remove')
                    $('.tooltipped').tooltip()
                    this.removeContention({
                        index: this.index
                    })
                }
            },
            controllerAs: 'c',
            bindToController: true,
            templateUrl: 'speech/templates/contention.html'
        }
    })
    .directive('flow', function() {
        return {
            restrict: 'E',
            scope: {
                data: '=',
                id: '@',
                team: '='
            },
            controller: function() {
                this.expand = false
                this.toggleExpand = function() {
                    this.expand = !this.expand
                }
                this.isExpanded = function() {
                    if (this.expand) return 'flowExpanded flow'
                    else return 'flow'
                }
                this.newContention = function() {
                    this.data.push({
                        "title": "",
                        "args": []
                    })
                }
                this.removeContention = function(index) {
                    this.data.splice(index, 1)
                }
            },
            link: function(scope, element, attr, ctrl) {
                scope.$on('toggleExpand', function(events, args) {
                    ctrl.toggleExpand()
                })
            },
            controllerAs: 'f',
            bindToController: true,
            templateUrl: 'speech/templates/flow.html'
        }
    })


text:
> *Matter.js* is a JavaScript 2D rigid body physics engine for the web

[brm.io/matter-js](https://brm.io/matter-js/)

[Demos](#demos) ・ [Gallery](#gallery) ・ [Features](#features) ・ [Plugins](#plugins) ・ [Install](#install) ・ [Usage](#usage) ・ [Examples](#examples) ・ [Docs](#documentation) ・ [Wiki](https://github.com/liabru/matter-js/wiki) ・ [References](#references) ・ [License](#license)

[![Build Status](https://travis-ci.org/liabru/matter-js.png?branch=master)](https://travis-ci.org/liabru/matter-js)

### Demos

Mixed Shapes

Solid Shapes

Concave SVG Paths

Concave Terrain

Concave Bodies

Compound Bodies

Newton's Cradle

Wrecking Ball

Slingshot Game

Rounded Corners

Views

Time Scaling

Body Manipulation

Composite Manipulation

Raycasting

Sprites

Pyramid

Car

Catapult

Reverse Gravity

Bridge

Avalanche

Basic Soft Bodies

Cloth

Events

Collision Filtering

Chains

Ball Pool

Stack

Circle Stack

Compound Stack

Restitution

Friction

Air Friction

Static Friction

Sleeping

Beach Balls

Stress 1

Stress 2

Sensors

### Gallery

See how others are using matter.js physics

- [Patrick Heng](https://patrickheng.com/) by Patrick Heng
- [USELESS](https://useless.london/) by Nice and Serious
- [Secret 7](https://secret-7.com/) by Goodness
- [New Company](https://www.new.company/) by New Company
- [Game of The Year](https://gameoftheyear.withgoogle.com/) by Google
- [Pablo The Flamingo](https://pablotheflamingo.com/) by Nathan Gordon
- [Les métamorphoses de Mr. Kalia](https://lab212.org/oeuvres/2:art/18/Les-metamorphoses-de-Mr-Kalia) by Lab212
- [Phaser](https://phaser.io/) by Photon Storm
- [Sorry I Have No Filter](https://sorryihavenofilter.com/pages/about/) by Jessica Walsh
- [Fuse](https://fuse.blog/) by Fuse
- [Glyphfinder](https://www.glyphfinder.com/) by überdosis
- [Isolation](https://isolation.is/postcards/my-week) by sabato studio
- [more...](https://github.com/liabru/matter-js/wiki/Gallery)

### Features

- Rigid bodies
- Compound bodies
- Composite bodies
- Concave and convex hulls
- Physical properties (mass, area, density etc.)
- Restitution (elastic and inelastic collisions)
- Collisions (broad-phase, mid-phase and narrow-phase)
- Stable stacking and resting
- Conservation of momentum
- Friction and resistance
- Events
- Constraints
- Gravity
- Sleeping and static bodies
- Plugins
- Rounded corners (chamfering)
- Views (translate, zoom)
- Collision queries (raycasting, region tests)
- Time scaling (slow-mo, speed-up)
- Canvas renderer (supports vectors and textures)
- [MatterTools](https://github.com/liabru/matter-tools) for creating, testing and debugging worlds
- World state serialisation (requires [resurrect.js](https://github.com/skeeto/resurrect-js))
- Cross-browser and Node.js support (Chrome, Firefox, Safari, IE8+)
- Mobile-compatible (touch, responsive)
- An original JavaScript physics implementation (not a port)

### Install

You can install using package managers [npm](https://www.npmjs.org/package/matter-js) and [Yarn](https://yarnpkg.com/) using:

    npm install matter-js

Alternatively you can download a [stable release](https://github.com/liabru/matter-js/tags) or try the latest experimental [alpha build](https://github.com/liabru/matter-js/tree/master/build) (master) and include the script in your web page:

### Performance with other tools (e.g. Webpack, Vue etc.)

Bundlers and frameworks may reduce real-time performance when using their default configs, especially in development modes.

When using [Webpack](https://webpack.js.org/), the default sourcemap config can have a large impact, for a solution see [issue](https://github.com/liabru/matter-js/issues/1001).

When using [Vue.js](https://vuejs.org/), watchers can have a large impact, for a solution see [issue](https://github.com/liabru/matter-js/issues/1001#issuecomment-998911435).

### Usage

Visit the [Getting started](https://github.com/liabru/matter-js/wiki/Getting-started) wiki page for a minimal usage example which should work in both browsers and Node.js.
Also see the [Running](https://github.com/liabru/matter-js/wiki/Running) and [Rendering](https://github.com/liabru/matter-js/wiki/Rendering) wiki pages, which show how to use your own game and rendering loops.

### Tutorials

See the list of [tutorials](https://github.com/liabru/matter-js/wiki/Tutorials).

### Examples

See the [examples](https://github.com/liabru/matter-js/tree/master/examples) directory which contains the source for all [demos](#demos).
There are even more examples on [codepen](https://codepen.io/collection/Fuagy/).

### Plugins

The engine can be extended through plugins, see these resources:

- [Using plugins](https://github.com/liabru/matter-js/wiki/Using-plugins)
- [Creating plugins](https://github.com/liabru/matter-js/wiki/Creating-plugins)
- [List of plugins](https://github.com/liabru/matter-js/wiki/List-of-plugins)
- [matter-plugin-boilerplate](https://github.com/liabru/matter-plugin-boilerplate)

### Documentation

See the [API Documentation](https://brm.io/matter-js/docs/) and the [wiki](https://github.com/liabru/matter-js/wiki)

### Building and Contributing

To build you must first install [node.js](https://nodejs.org/), then run

	npm install

This will install the required build dependencies, then run

	npm run dev

to spawn a development server. For information on contributing see [CONTRIBUTING.md](https://github.com/liabru/matter-js/blob/master/CONTRIBUTING.md).

### Changelog

To see what's new or changed in the latest version, see the [changelog](https://github.com/liabru/matter-js/blob/master/CHANGELOG.md).

### References

See the wiki page on [References](https://github.com/liabru/matter-js/wiki/References).

### License

Matter.js is licensed under [The MIT License (MIT)](https://opensource.org/licenses/MIT)
Copyright (c) 2014 Liam Brummitt

This license is also supplied with the release and source code.
As stated in the license, absolutely no warranty is provided.


text:
#ifndef SILC_PLUGIN_CRYPTO_H
#define SILC_PLUGIN_CRYPTO_H

int silc_plugin_get_keypair(char *basename, char *passphrase, bool allow_generate, SilcPublicKey *public_key, SilcPrivateKey *private_key);

#endif /* SILC_PLUGIN_CRYPTO_H */


text:
package org.connid.bundles.unix.utilities;

import org.identityconnectors.common.security.GuardedString;
import org.identityconnectors.framework.common.objects.ObjectClass;

public class AttributesTestValue extends SharedTestMethods {

    private static final String WRONG_USERNAME = "wronguser";
    private static final String PASSWORD = "password";
    private final GuardedString GUARDED_PASSWORD =
            new GuardedString(getPassword().toCharArray());
    private final GuardedString NEW_GUARDED_PASSWORD =
            new GuardedString(getNewPassword().toCharArray());
    private final GuardedString WRONG_GUARDED_PASSWORD =
            new GuardedString("wrongpassword".toCharArray());
    private static final String NEW_PASSWORD = "newpassword";
    private final ObjectClass WRONG_OBJECTCLASS =
            new ObjectClass("WRONG_OBJECTCLASS");
    private static final String WRONG_GROUPNAME = "wronggroup";

    public String getUsername() {
        return "createtest" + randomNumber();
    }

    public String getNewUsername() {
        return "createtest" + randomNumber();
    }

    public String getWrongUsername() {
        return WRONG_USERNAME;
    }

    public GuardedString getGuardedPassword() {
        return GUARDED_PASSWORD;
    }

    public GuardedString getNewGuardedPassword() {
        return NEW_GUARDED_PASSWORD;
    }

    public GuardedString getWrongGuardedPassword() {
        return WRONG_GUARDED_PASSWORD;
    }

    public String getPassword() {
        return PASSWORD;
    }

    public String getNewPassword() {
        return NEW_PASSWORD;
    }

    public ObjectClass getWrongObjectClass() {
        return WRONG_OBJECTCLASS;
    }

    public String getGroupName() {
        return "grouptest" + randomNumber();
    }

    public String getWrongGroupName() {
        return WRONG_GROUPNAME;
    }

    public String getNewGroupName() {
        return "grouptest" + randomNumber();
    }

    private int randomNumber() {
        return (int) (Math.random() * 100000);
    }
}


text:
/**
 * Layout component that queries for data
 * with Gatsby's useStaticQuery component
 *
 * See: https://www.gatsbyjs.org/docs/use-static-query/
 */

import React from "react"
import PropTypes from "prop-types"
import 'bulma/css/bulma.css'
import Header from "./header"
import Footer from "./footer"
import "../styles/main.scss"
// import { CSSTransition } from "react-transition-group";
const Layout = ({ navLocation, children }) => {
    return (

            <div style={{margin:`0 auto`, maxWidth: 960, padding: `0px 1.0875rem 1.45rem`, paddingTop: 0 }}>

                            {children}

    )
}
Layout.propTypes = {
    children: PropTypes.node.isRequired,
}
export default Layout


text:
<!DOCTYPE html>

  <link rel="canonical" href="http://localhost:4000/texts/2017-09-16-%E9%AD%94%E7%A6%81%E4%B9%8Bc++/" />

  <meta charset="utf-8" />

  <meta name="viewport" content="width=device-width,initial-scale=1.0,shrink-to-fit=no" />

  <title>

      魔禁之c++

  </title>

  <meta property="dc:title" content="魔禁之c++" />
  <meta property="dc:creator" content="Huxley Hu" />
  <meta property="dc:identifier" content="http://localhost:4000/texts/2017-09-16-%E9%AD%94%E7%A6%81%E4%B9%8Bc++/" />

  <meta property="dc:source" content="hblog" />

  <meta property="og:title" content="魔禁之c++" />
  <meta property="og:url" content="http://localhost:4000/texts/2017-09-16-%E9%AD%94%E7%A6%81%E4%B9%8Bc++/" />
  <meta property="og:image" content="http://localhost:4000/assets/open-graph-logo.png" />
  <meta property="og:image:width" content="200" />
  <meta property="og:image:height" content="200" />
  <meta property="fb:admins" content="elotroalex" />
  <meta property="fb:app_id" content="589495744558280" />

  <meta property="og:description" content="An Ed edition">
  <meta property="og:type" content="article" />

  <link rel="stylesheet" href="/assets/css/style.css" />

  <link rel="apple-touch-icon-precomposed" sizes="180x180" href="/assets/apple-touch-icon-precomposed.png" />
  <link rel="shortcut icon" href="/assets/favicon.ico" />

  <link rel="alternate" type="application/rss+xml" title="RSS" href="http://localhost:4000/atom.xml" />

<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox">

Ed is a Jekyll theme designed for textual editors based on minimal computing principles, and focused on legibility and flexibility.

    Home

          About

      Built with Ed. Distributed under an MIT license.

            hblog

a personal blog, written for nonsense

魔禁之c++

user space context switch

#include <ucontext.h>
#include <iostream>

int main() {
    ucontext_t ctx;
    getcontext(&ctx);
    std::cout << "Hello, World!" << std::endl;
    setcontext(&ctx);
    return 0;
}

用户态下直接切换上下文。常用来实现协程。seastar里面用这玩意结合longjmp和setjmp实现了用户态的future线程库。因为ucontext_t这个struct太大的,所以用了diverse function。
不得不承认确实惊艳。

placement new

class Object;

typename std::aligned_storage<Object>::type obj;
new(&obj)Object(); // placement new
obj.~Object(); // relative call style of destructor

这个没啥说的。代码看多的基本都应该见过,就是用来栈上分配或节约内存的。

stack unwind

TODO

__attribute__

void dump(Object* o) { std::cout << obj << " is freed." << std::endl; }
{
    // `cleanup` attribute registers a function which will be call at the
    // end of the variable's life cycle. e.g. the following code dumps
    // a message when obj is out of the scope.
    Object obj __attribute__((cleanup(dump)));

    // TODO: more attributes
}


text:
<?php

namespace app\modules\student\controllers;

use app\models\Evidence;
use app\models\Notification;
use app\models\Person;
use app\models\Project;
use app\models\ProjectManager;
use app\models\Registration;
use app\models\Student;
use app\models\StudentEvidence;
use app\models\StudentEvidenceSearch;
use app\models\User;
use kartik\mpdf\Pdf;
use Yii;
use yii\filters\VerbFilter;
use yii\helpers\Url;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\web\UploadedFile;

/**
 * StudentEvidenceController implements the CRUD actions for StudentEvidence model.
 */
class StudentEvidenceController extends Controller {
    /**
     * @return array
     */
    public function behaviors() {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all StudentEvidence models.
     * @return mixed
     */
    public function actionIndex() {
        $searchModel = new StudentEvidenceSearch();
        $dataProviderNews = $searchModel->search(Yii::$app->request->queryParams, StudentEvidence::$NEW);
        $dataProviderPending = $searchModel->search(Yii::$app->request->queryParams, StudentEvidence::$PENDING);
        $dataProviderAccepted = $searchModel->search(Yii::$app->request->queryParams, StudentEvidence::$ACCEPTED);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProviderNews' => $dataProviderNews,
            'dataProviderPending' => $dataProviderPending,
            'dataProviderAccepted' => $dataProviderAccepted,
        ]);
    }

    /**
     * Displays a single StudentEvidence model.
     * @param integer $task_id
     * @param integer $project_id
     * @param integer $student_id
     * @return mixed
     * http://localhost/RobotSS/web/student/student-evidence/view?task_id=1&project_id=1&student_id=1
     */
    public function actionView($task_id, $project_id, $student_id) {
        $session = Yii::$app->session;
        $session->set('task_id', $task_id);
        $session->set('project_id', $project_id);
        $session->set('student_id', $student_id);

        return $this->render('view', [
            'model' => $this->findModelWithoutEvidence($task_id, $project_id, $student_id),
        ]);
    }

    /**
     * Creates a new StudentEvidence model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate($task_id, $project_id, $student_id) {
        $studentEvidence = $this->findModelWithoutEvidence($task_id, $project_id, $student_id);

        $evidence = new Evidence();

        if (Yii::$app->request->post()) {
            $params = Yii::$app->request->post();
            $evidence->load($params);

            //Cambiar estado de evidencia a pendiente
            $studentEvidence->status = StudentEvidence::$PENDING;

            $evidence->file = UploadedFile::getInstance($evidence, 'file');
            if ($evidence->validate() && $evidence->save()) {

                $this->saveEvidenceFile($evidence);

                $evidence->update(false);

                $studentEvidence->evidence_id = $evidence->id;
                $studentEvidence->update();

                $notification = Yii::createObject([
                    'class' => Notification::className(),
                    'user_id' => ProjectManager::findOne([Project::findOne([$project_id])->manager_id])->user_id,
                    'description' => Notification::RECEIVED_TASK,
                    'role' => Notification::ROLE_STUDENT,
                    'created_at' => Yii::$app->formatter->asDate('now', 'yyyy-MM-dd'),
                    'viewed' => false,
                    'url' => Url::to(['/project_manager/task/show-feedback-screen',
                        'taskId' => $task_id,
                        'evidenceId' => $evidence->id
                    ])
                ]);

                $notification->save(false);

                return $this->redirect(['view', 'task_id' => $studentEvidence->task_id,
                    'project_id' => $studentEvidence->project_id, 'student_id' => $studentEvidence->student_id]);
            } else {
                Yii::$app->session->setFlash('danger', 'Ocurrió un error al guardar. Vuelve a intentar');
                echo $evidence->validate();
                return $this->render('create', [
                    'studentEvidence' => $studentEvidence,
                    'evidence' => $evidence,
                ]);
            }
        } else {
            return $this->render('create', [
                'studentEvidence' => $studentEvidence,
                'evidence' => $evidence,
            ]);
        }
    }

    /**
     * Updates an existing StudentEvidence model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $evidence_id
     * @return mixed
     */
    public function actionUpdate($evidence_id) {
        $studentEvidence = $this->findModelByEvidence($evidence_id);
        $evidence = $studentEvidence->evidence;

        if (Yii::$app->request->post()) {
            $params = Yii::$app->request->post();
            $evidence->load($params);
            $evidence->file = UploadedFile::getInstance($evidence, 'file');

            if (isset($evidence->file)) {
                if (is_file(Yii::getAlias('@webroot') . $evidence->attachment_path)) {
                    unlink(Yii::getAlias('@webroot') . $evidence->attachment_path);
                }
                $this->saveEvidenceFile($evidence);
            }
            $evidence->update(false);
            //set notification
            $notification = Yii::createObject([
                'class' => Notification::className(),
                'user_id' => ProjectManager::findOne([Project::findOne([$studentEvidence->project_id])->manager_id])
                    ->user_id,
                'description' => Notification::EDITED_RECEIVED_TASK,
                'role' => Notification::ROLE_STUDENT,
                'created_at' => Yii::$app->formatter->asDate('now', 'yyyy-MM-dd'),
                'viewed' => false,
                'url' => Url::to(['/project_manager/task/show-feedback-screen',
                    'taskId' => $studentEvidence->task_id,
                    'evidenceId' => $evidence->id
                ])
            ]);

            $notification->save(false);

            return $this->redirect(['view', 'task_id' => $studentEvidence->task_id,
                'project_id' => $studentEvidence->project_id, 'student_id' => $studentEvidence->student_id]);
        } else {
            return $this->render('update', [
                'studentEvidence' => $studentEvidence,
                'evidence' => $evidence,
            ]);
        }
    }

    /**
     * @param $evidence_id
     * @throws NotFoundHttpException
     */
    public function actionDownload($evidence_id) {
        $studentEvidence = $this->findModelByEvidence($evidence_id);
        return Yii::$app->response->sendFile(
            Yii::getAlias('@webroot') . $studentEvidence->evidence->attachment_path,
            $studentEvidence->evidence->attachment_name
        )->send();
    }

    /**
     * @return mixed|\yii\web\Response
     */
    public function actionPrintEvidenceReport() {
        $student = Student::findOne(['user_id' => Yii::$app->user->id]);
        date_default_timezone_set("America/Mexico_City");
        try {
            $searchModel = new StudentEvidenceSearch();
            $dataProviderAccepted = $searchModel->search (Yii::$app->request->queryParams, StudentEvidence::$ACCEPTED);

            $registration = Registration::findOne(['student_id' => $student->id]);
            $person = Person::findOne(User::findOne(Yii::$app->user->id)->person_id);

            $project = Project::findOne($registration->project_id);
            $projectM = ProjectManager::findOne($project->manager_id);

            // get your HTML raw content without any layouts or scripts
            $content = $this->render('studentEvidencePDF', [
                'registration' => $registration,
                'student' => $student,
                'person' => $person,
                'project' => $project,
                'projectM' => $projectM,
                'searchModel' => $searchModel,
                'dataProviderAccepted' => $dataProviderAccepted
            ]);

            $formatter = \Yii::$app->formatter;
            // setup kartik\mpdf\Pdf component
            $pdf = new Pdf([
                // set to use core fonts only
                'mode' => Pdf::MODE_UTF8,
                // A4 paper format
                'format' => Pdf::FORMAT_LETTER,
                // portrait orientation
                'orientation' => Pdf::ORIENT_PORTRAIT,
                // stream to browser inline
                'destination' => Pdf::DEST_BROWSER,
                // your html content input
                'content' => $content,
                // format content from your own css file if needed or use the
                // enhanced bootstrap css built by Krajee for mPDF formatting
                'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',
                // any css to be embedded if required
                'cssInline' => '.kv-heading-1{font-size:18px}',
                // set mPDF properties on the fly
                'options' => ['title' => 'Reporte de avances'],
                // call mPDF methods on the fly
                'methods' =>
                    [
                        'SetFooter' => ['Fecha de expedición: ' . $formatter->asDate(date('d-F-Y'))],
                    ]
            ]);

            // return the pdf output as per the destination setting
            return $pdf->render();
        } catch (InvalidConfigException $e) {
            Yii::$app->getSession()->setFlash('danger', 'No tienes proyectos asignados');
            return $this->redirect(Url::home());
        }
    }

    /**
     * Deletes an existing StudentEvidence model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $task_id
     * @param integer $project_id
     * @param integer $evidence_id
     * @param integer $student_id
     * @return mixed
     */
    public function actionDelete($task_id, $project_id, $evidence_id, $student_id) {
        $this->findModel($task_id, $project_id, $evidence_id, $student_id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the StudentEvidence model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $task_id
     * @param integer $project_id
     * @param integer $evidence_id
     * @param integer $student_id
     * @return StudentEvidence the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($task_id, $project_id, $evidence_id, $student_id) {
        if (($model = StudentEvidence::findOne(['task_id' => $task_id,
                'project_id' => $project_id, 'evidence_id' => $evidence_id,
                'student_id' => $student_id])) !== null
        ) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

    /**
     * @param $task_id
     * @param $project_id
     * @param $student_id
     * @return null|static
     * @throws NotFoundHttpException
     */
    protected function findModelWithoutEvidence($task_id, $project_id, $student_id) {
        if (($model = StudentEvidence::findOne(['task_id' => $task_id,
                'project_id' => $project_id, 'student_id' => $student_id])) !== null
        ) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

    /**
     * @param $evidence_id
     * @return null|static
     * @throws NotFoundHttpException
     */
    protected function findModelByEvidence($evidence_id) {
        if (($model = StudentEvidence::findOne(['evidence_id' => $evidence_id])) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

    /**
     * @param $evidence
     */
    private function saveEvidenceFile($evidence) {
        if (!file_exists(Yii::getAlias('@webroot') . '/uploads/evidence')) {
            mkdir(Yii::getAlias('@webroot') . '/uploads/evidence', 0777, true);
        }
        $evidence->
        file->
        saveAs(Yii::getAlias('@webroot') . '/uploads/evidence/' . $evidence->id . '.' .
            $evidence->file->extension);
        $evidence->attachment_path = '/uploads/evidence/' . $evidence->id . '.' . $evidence->file->extension;
        $evidence->attachment_name = $evidence->file->baseName . '.' . $evidence->file->getExtension();
    }

}


text:
package aQute.libg.remote;

public enum Event {
	virginal,
	started,
	restarted,
	running,
	exited,
	deleted,
	created,
	launching;
}


text:
namespace content {

class WebRtcAudioCapturer;
class WebRtcAudioRenderer;

// TODO(xians): Move the following two interfaces to webrtc so that
// libjingle can own references to the renderer and capturer.
class WebRtcAudioRendererSource {
 public:
  // Callback to get the rendered interleaved data.
  // TODO(xians): Change uint8* to int16*.
  virtual void RenderData(uint8* audio_data,
                          int number_of_channels,
                          int number_of_frames,
                          int audio_delay_milliseconds) = 0;

  // Set the format for the capture audio parameters.
  virtual void SetRenderFormat(const media::AudioParameters& params) = 0;

  // Callback to notify the client that the renderer is going away.
  virtual void RemoveRenderer(WebRtcAudioRenderer* renderer) = 0;

 protected:
  virtual ~WebRtcAudioRendererSource() {}
};

class WebRtcAudioCapturerSink {
 public:
  // Callback to deliver the captured interleaved data.
  virtual void CaptureData(const int16* audio_data,
                           int number_of_channels,
                           int number_of_frames,
                           int audio_delay_milliseconds,
                           double volume) = 0;

  // Set the format for the capture audio parameters.
  virtual void SetCaptureFormat(const media::AudioParameters& params) = 0;

 protected:
  virtual ~WebRtcAudioCapturerSink() {}
};

class CONTENT_EXPORT WebRtcAudioDeviceImpl
    : NON_EXPORTED_BASE(public webrtc::AudioDeviceModule),
      NON_EXPORTED_BASE(public WebRtcAudioCapturerSink),
      NON_EXPORTED_BASE(public WebRtcAudioRendererSource) {
 public:
  // Methods called on main render thread.
  WebRtcAudioDeviceImpl();

  // webrtc::RefCountedModule implementation.
  // The creator must call AddRef() after construction and use Release()
  // to release the reference and delete this object.
  virtual int32_t AddRef() OVERRIDE;
  virtual int32_t Release() OVERRIDE;

  // WebRtcAudioRendererSource implementation.
  virtual void RenderData(uint8* audio_data,
                          int number_of_channels,
                          int number_of_frames,
                          int audio_delay_milliseconds) OVERRIDE;
  virtual void SetRenderFormat(const media::AudioParameters& params) OVERRIDE;
  virtual void RemoveRenderer(WebRtcAudioRenderer* renderer) OVERRIDE;

  // WebRtcAudioCapturerSink implementation.
  virtual void CaptureData(const int16* audio_data,
                           int number_of_channels,
                           int number_of_frames,
                           int audio_delay_milliseconds,
                           double volume) OVERRIDE;
  virtual void SetCaptureFormat(const media::AudioParameters& params) OVERRIDE;

  // webrtc::Module implementation.
  virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
  virtual int32_t TimeUntilNextProcess() OVERRIDE;
  virtual int32_t Process() OVERRIDE;

  // webrtc::AudioDeviceModule implementation.
  virtual int32_t ActiveAudioLayer(AudioLayer* audio_layer) const OVERRIDE;
  virtual ErrorCode LastError() const OVERRIDE;

  virtual int32_t RegisterEventObserver(
      webrtc::AudioDeviceObserver* event_callback) OVERRIDE;
  virtual int32_t RegisterAudioCallback(webrtc::AudioTransport* audio_callback)
      OVERRIDE;

  virtual int32_t Init() OVERRIDE;
  virtual int32_t Terminate() OVERRIDE;
  virtual bool Initialized() const OVERRIDE;

  virtual int16_t PlayoutDevices() OVERRIDE;
  virtual int16_t RecordingDevices() OVERRIDE;
  virtual int32_t PlayoutDeviceName(uint16_t index,
                                    char name[webrtc::kAdmMaxDeviceNameSize],
                                    char guid[webrtc::kAdmMaxGuidSize])
                                    OVERRIDE;
  virtual int32_t RecordingDeviceName(uint16_t index,
                                      char name[webrtc::kAdmMaxDeviceNameSize],
                                      char guid[webrtc::kAdmMaxGuidSize])
                                      OVERRIDE;
  virtual int32_t SetPlayoutDevice(uint16_t index) OVERRIDE;
  virtual int32_t SetPlayoutDevice(WindowsDeviceType device) OVERRIDE;
  virtual int32_t SetRecordingDevice(uint16_t index) OVERRIDE;
  virtual int32_t SetRecordingDevice(WindowsDeviceType device) OVERRIDE;

  virtual int32_t PlayoutIsAvailable(bool* available) OVERRIDE;
  virtual int32_t InitPlayout() OVERRIDE;
  virtual bool PlayoutIsInitialized() const OVERRIDE;
  virtual int32_t RecordingIsAvailable(bool* available) OVERRIDE;
  virtual int32_t InitRecording() OVERRIDE;
  virtual bool RecordingIsInitialized() const OVERRIDE;

  virtual int32_t StartPlayout() OVERRIDE;
  virtual int32_t StopPlayout() OVERRIDE;
  virtual bool Playing() const OVERRIDE;
  virtual int32_t StartRecording() OVERRIDE;
  virtual int32_t StopRecording() OVERRIDE;
  virtual bool Recording() const OVERRIDE;

  virtual int32_t SetAGC(bool enable) OVERRIDE;
  virtual bool AGC() const OVERRIDE;

  virtual int32_t SetWaveOutVolume(uint16_t volume_left,
                                   uint16_t volume_right) OVERRIDE;
  virtual int32_t WaveOutVolume(uint16_t* volume_left,
                                uint16_t* volume_right) const OVERRIDE;

  virtual int32_t SpeakerIsAvailable(bool* available) OVERRIDE;
  virtual int32_t InitSpeaker() OVERRIDE;
  virtual bool SpeakerIsInitialized() const OVERRIDE;
  virtual int32_t MicrophoneIsAvailable(bool* available) OVERRIDE;
  virtual int32_t InitMicrophone() OVERRIDE;
  virtual bool MicrophoneIsInitialized() const OVERRIDE;

  virtual int32_t SpeakerVolumeIsAvailable(bool* available) OVERRIDE;
  virtual int32_t SetSpeakerVolume(uint32_t volume) OVERRIDE;
  virtual int32_t SpeakerVolume(uint32_t* volume) const OVERRIDE;
  virtual int32_t MaxSpeakerVolume(uint32_t* max_volume) const OVERRIDE;
  virtual int32_t MinSpeakerVolume(uint32_t* min_volume) const OVERRIDE;
  virtual int32_t SpeakerVolumeStepSize(uint16_t* step_size) const OVERRIDE;

  virtual int32_t MicrophoneVolumeIsAvailable(bool* available) OVERRIDE;
  virtual int32_t SetMicrophoneVolume(uint32_t volume) OVERRIDE;
  virtual int32_t MicrophoneVolume(uint32_t* volume) const OVERRIDE;
  virtual int32_t MaxMicrophoneVolume(uint32_t* max_volume) const OVERRIDE;
  virtual int32_t MinMicrophoneVolume(uint32_t* min_volume) const OVERRIDE;
  virtual int32_t MicrophoneVolumeStepSize(uint16_t* step_size) const OVERRIDE;

  virtual int32_t SpeakerMuteIsAvailable(bool* available) OVERRIDE;
  virtual int32_t SetSpeakerMute(bool enable) OVERRIDE;
  virtual int32_t SpeakerMute(bool* enabled) const OVERRIDE;

  virtual int32_t MicrophoneMuteIsAvailable(bool* available) OVERRIDE;
  virtual int32_t SetMicrophoneMute(bool enable) OVERRIDE;
  virtual int32_t MicrophoneMute(bool* enabled) const OVERRIDE;

  virtual int32_t MicrophoneBoostIsAvailable(bool* available) OVERRIDE;
  virtual int32_t SetMicrophoneBoost(bool enable) OVERRIDE;
  virtual int32_t MicrophoneBoost(bool* enabled) const OVERRIDE;

  virtual int32_t StereoPlayoutIsAvailable(bool* available) const OVERRIDE;
  virtual int32_t SetStereoPlayout(bool enable) OVERRIDE;
  virtual int32_t StereoPlayout(bool* enabled) const OVERRIDE;
  virtual int32_t StereoRecordingIsAvailable(bool* available) const OVERRIDE;
  virtual int32_t SetStereoRecording(bool enable) OVERRIDE;
  virtual int32_t StereoRecording(bool* enabled) const OVERRIDE;
  virtual int32_t SetRecordingChannel(const ChannelType channel) OVERRIDE;
  virtual int32_t RecordingChannel(ChannelType* channel) const OVERRIDE;

  virtual int32_t SetPlayoutBuffer(
      const BufferType type, uint16_t size_ms) OVERRIDE;
  virtual int32_t PlayoutBuffer(
      BufferType* type, uint16_t* size_ms) const OVERRIDE;
  virtual int32_t PlayoutDelay(uint16_t* delay_ms) const OVERRIDE;
  virtual int32_t RecordingDelay(uint16_t* delay_ms) const OVERRIDE;

  virtual int32_t CPULoad(uint16_t* load) const OVERRIDE;

  virtual int32_t StartRawOutputFileRecording(
      const char pcm_file_name_utf8[webrtc::kAdmMaxFileNameSize]) OVERRIDE;
  virtual int32_t StopRawOutputFileRecording() OVERRIDE;
  virtual int32_t StartRawInputFileRecording(
      const char pcm_file_name_utf8[webrtc::kAdmMaxFileNameSize]) OVERRIDE;
  virtual int32_t StopRawInputFileRecording() OVERRIDE;

  virtual int32_t SetRecordingSampleRate(
      const uint32_t samples_per_sec) OVERRIDE;
  virtual int32_t RecordingSampleRate(uint32_t* samples_per_sec) const OVERRIDE;
  virtual int32_t SetPlayoutSampleRate(const uint32_t samples_per_sec) OVERRIDE;
  virtual int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const OVERRIDE;

  virtual int32_t ResetAudioDevice() OVERRIDE;
  virtual int32_t SetLoudspeakerStatus(bool enable) OVERRIDE;
  virtual int32_t GetLoudspeakerStatus(bool* enabled) const OVERRIDE;

  // Sets the |renderer_|, returns false if |renderer_| has already existed.
  bool SetRenderer(WebRtcAudioRenderer* renderer);

  const scoped_refptr<WebRtcAudioCapturer>& capturer() const {
    return capturer_;
  }

  const scoped_refptr<WebRtcAudioRenderer>& renderer() const {
    return renderer_;
  }

  // Accessors.
  int input_buffer_size() const {
    return input_audio_parameters_.frames_per_buffer();
  }
  int output_buffer_size() const {
    return output_audio_parameters_.frames_per_buffer();
  }
  int input_channels() const {
    return input_audio_parameters_.channels();
  }
  int output_channels() const {
    return output_audio_parameters_.channels();
  }
  int input_sample_rate() const {
    return input_audio_parameters_.sample_rate();
  }
  int output_sample_rate() const {
    return output_audio_parameters_.sample_rate();
  }

 private:
  // Make destructor private to ensure that we can only be deleted by Release().
  virtual ~WebRtcAudioDeviceImpl();

  // Methods called on the main render thread ----------------------------------
  // The following methods are tasks posted on the render thread that needs to
  // be executed on that thread.
  void InitOnRenderThread(int32_t* error, base::WaitableEvent* event);

  int ref_count_;

  // Gives access to the message loop of the render thread on which this
  // object is created.
  scoped_refptr<base::MessageLoopProxy> render_loop_;

  // Provides access to the native audio input layer in the browser process.
  scoped_refptr<WebRtcAudioCapturer> capturer_;

  // Provides access to the audio renderer in the browser process.
  scoped_refptr<WebRtcAudioRenderer> renderer_;

  // Weak reference to the audio callback.
  // The webrtc client defines |audio_transport_callback_| by calling
  // RegisterAudioCallback().
  webrtc::AudioTransport* audio_transport_callback_;

  // Cached values of utilized audio parameters. Platform dependent.
  media::AudioParameters input_audio_parameters_;
  media::AudioParameters output_audio_parameters_;

  // Cached value of the current audio delay on the input/capture side.
  int input_delay_ms_;

  // Cached value of the current audio delay on the output/renderer side.
  int output_delay_ms_;

  webrtc::AudioDeviceModule::ErrorCode last_error_;

  base::TimeTicks last_process_time_;

  // Protects |recording_|, |output_delay_ms_|, |input_delay_ms_|, |renderer_|.
  mutable base::Lock lock_;

  bool initialized_;
  bool playing_;

  // Local copy of the current Automatic Gain Control state.
  bool agc_is_enabled_;

  // Used for histograms of total recording and playout times.
  base::Time start_capture_time_;
  base::Time start_render_time_;

  DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl);
};

}  // namespace content

#endif  // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_


text:
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>CursoAngular4</title>
    <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet" href="./assets/style.css" />

</head>

<body>
    <app-root>Loading...</app-root>
</body>

</html>


text:
@interface TWObject : JSONModel
{
    CGFloat _contentHeight;
}

- (CGFloat)contentHeight;

- (void)resetContentHeight;

- (void)calculateContentHeight;

- (NSString *)json;

- (NSDictionary *)dictionary;

- (instancetype)initWithDictionary:(NSDictionary *)dictionary;

- (instancetype)initWithJSON:(NSString *)jsonString;

+ (NSArray<NSString *> *)ignoredProperties;

+ (Class)classForArray:(NSString *)propertyName;

+ (NSDictionary *)propertyMapper;

@end


text:
USE ProdProcess_2008

SELECT ComponentID, Quantity, UserUnload FROM BindState
WHERE           OrderSetNo = 1 AND  OrderSerialNo = 3143 AND  ProductID = 'AZZURRO MD575465 PE' AND UserUnload<>'sviluppo'

SELECT ComponentID, Quantity, UserUnload FROM BindState
WHERE           OrderSetNo = 0 AND  OrderSerialNo = 780 AND  ProductID = 'ARANCIO MD542634 PE' AND UserUnload<>'sviluppo'


text:
ADD JAR ${env:BIG_BENCH_QUERIES_DIR}/Resources/bigbenchqueriesmr.jar;
CREATE TEMPORARY FUNCTION makePairs AS 'io.bigdatabenchmark.v1.queries.udf.PairwiseUDTF';
ADD FILE ${hiveconf:QUERY_DIR}/q30-sessionize.py;

-- SESSIONZIE by streaming
-- Step1: compute time difference to preceeding click_session
-- Step2: compute session id per user by defining a session as: clicks no father apppart then q30_session_timeout_inSec
-- Step3: make unique session identifier <user_sk>_<user_seesion_ID>
DROP VIEW IF EXISTS ${hiveconf:TEMP_TABLE};
CREATE VIEW ${hiveconf:TEMP_TABLE} AS
SELECT *
FROM (
  FROM (
    SELECT wcs_user_sk,
      (wcs_click_date_sk*24*60*60 + wcs_click_time_sk) AS tstamp_inSec,
      i_category_id
    FROM web_clickstreams wcs, item i
    WHERE wcs.wcs_item_sk = i.i_item_sk
    AND i.i_category_id IS NOT NULL
    AND wcs.wcs_user_sk IS NOT NULL
    DISTRIBUTE BY wcs_user_sk SORT BY wcs_user_sk, tstamp_inSec -- "sessionize" reducer script requires the cluster by uid and sort by tstamp
  ) clicksAnWebPageType
  REDUCE
    wcs_user_sk,
    tstamp_inSec,
    i_category_id
  USING 'python q30-sessionize.py ${hiveconf:q30_session_timeout_inSec}'
  AS (
    category_id BIGINT,
    sessionid STRING
  )
) q02_tmp_sessionize
--Cluster by sessionid
;

--Result -------------------------------------------------------------------------
--keep result human readable
set hive.exec.compress.output=false;
set hive.exec.compress.output;
--CREATE RESULT TABLE. Store query result externally in output_dir/qXXresult/
DROP TABLE IF EXISTS ${hiveconf:RESULT_TABLE};
CREATE TABLE ${hiveconf:RESULT_TABLE} (
  category_id_1 BIGINT,
  category_id_2 BIGINT,
  cnt BIGINT
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
STORED AS ${env:BIG_BENCH_hive_default_fileformat_result_table} LOCATION '${hiveconf:RESULT_DIR}';

-- the real query part

INSERT INTO TABLE ${hiveconf:RESULT_TABLE}
SELECT  category_id_1, category_id_2, COUNT (*) AS cnt
FROM (
  -- Make category "viewed together" pairs
  -- combining collect_set + sorting + makepairs(array, noSelfParing)
  -- ensures we get no pairs with swapped places like: (12,24),(24,12).
  -- We only produce tuples (12,24) ensuring that the smaller number is always on the left side
  SELECT makePairs(sort_array(itemArray), false) AS (category_id_1,category_id_2)
  FROM (
    SELECT collect_set(category_id) as itemArray --(_list= with duplicates, _set = distinct)
    FROM ${hiveconf:TEMP_TABLE}
    GROUP BY sessionid
  ) collectedList
) pairs
GROUP BY category_id_1, category_id_2
ORDER BY cnt DESC, category_id_1, category_id_2
LIMIT ${hiveconf:q30_limit};

-- cleanup
DROP VIEW IF EXISTS ${hiveconf:TEMP_TABLE};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CloudWars.Common;
using CloudWars.Common.Other;
using CloudWars.Common.Units;
using CloudWars.SpaceBattle.Units;
using CloudWars.DataAccess.Sql;
using CloudWars.Entities.Game;

namespace CloudWars.SpaceBattle
{
	public class SpaceBattleGame: IGame
	{
        public List<IGameUnit> Units { get; private set; }
        public Guid MatchId { get; set; }
        public Guid Player1 { get; set; }
        public Guid Player2 { get; set; }
        public Guid Turn { get; set; }
        public bool Player1Ready { get; set; }
        public bool Player2Ready { get; set; }
        bool Initialized { get; set; }
        bool MatchEnded { get; set; }
        bool PlayingNow { get; set; }
        Guid Winner { get; set; }

        public SpaceBattleGame(Guid matchId, bool loadMatchData)
        {
            //load the match
            if (loadMatchData)
            {
                var m = CloudWarsData.GetMatch(matchId);
                this.MatchId = m.Id;
                this.Player1 = m.Player1;
                this.Player2 = m.Player2;
                this.Player1Ready = m.Player1Ready;
                this.Player2Ready = m.Player2Ready;
                this.Turn = m.Turn;
                this.Initialized = m.Initialized;
                this.MatchEnded = m.MatchEnded;
                this.Winner = m.Winner;
                this.PlayingNow = m.PlayingNow;
                //Get the units
                var dbUnits = CloudWarsData.GetUnits(matchId);
                Units = new List<IGameUnit>();
                foreach (var u in dbUnits)
                {
                    Units.Add(new GameUnit(u));
                }
            }
            else
            {
                this.MatchId = matchId;
            }
        }

        public SpaceBattleGame()
        {
        }

        /// <summary>
        /// Create the match and
        /// </summary>
        public void CreateMatch(Guid player1, Guid player2)
        {
            Player1 = player1;
            Player2 = player2;
            //Create the match and set the matchid
            MatchId = CloudWarsData.CreateMatch(player1, player2);
            Turn = player1;
        }

        /// <summary>
        /// This is used when the Match is created
        /// </summary>
        /// <param name="initialState"></param>
        public void Initialize(object initialState)
        {
            Initialized = true;
            //save the match
            UpdateMatch();

        }

        public void PlayerReady(Guid playerId)
        {
            if (playerId == Player1)
                Player1Ready = true;
            else
                Player2Ready = true;
            if (Player1Ready && Player2Ready)
                Initialized = true;
            //save the match
            UpdateMatch();
        }

        public void PlayerMoveTo(Position coordinates,Guid unitId)
        {
            //does not allow moves after initialization
            if (Initialized)
                return;
            var unit = Units.FirstOrDefault(u => u.UnitId == unitId);
            if (unit != null)
            {
                UpdateUnit(columns: new { Row = coordinates.Row, Col = coordinates.Column }, where: new { MatchId = unit.MatchId, And_UnitId = unit.UnitId, And_PlayerId = unit.PlayerId } );
            }
        }

        public Message PlayerAttack(Position coordinates, Guid playerId)
        {
            //check if its player turn and that the game is active
            if (Turn != playerId || !this.PlayingNow)
                return new Message { Action = GameAction.ShotMissed, Player1 = Player1, Player2 = Player2, Command = Command.NotYourTurn, MatchId = MatchId };

            //determine if its a hit
            var unit = Units.FirstOrDefault(u => u.Row == coordinates.Row && u.Column == coordinates.Column && u.PlayerId != playerId);
            bool wasHit;
            if (unit != null && unit.Health > 0)
            {
                //update the unit status, and queue a message
                unit.TakeDamage(1);
                UpdateUnit(columns: new { Health = unit.Health }, where: new { MatchId = unit.MatchId, And_UnitId = unit.UnitId, And_PlayerId = unit.PlayerId });
                wasHit = true;
            }
            else
            {
                wasHit = false;
            }
            //queue proper message
            if (wasHit)
            {
                //check if player won the match
                if (Units.Count(u => u.Health > 0 && u.PlayerId != playerId) == 0)
                {
                    //inform players the match result
                    return MatchFinished(winner: playerId, losser: unit.PlayerId);
                }
                else
                {
                    //inform the hit
                    var msg = new Message { Action = GameAction.ShotMade,  Player1 = Player1, Player2 = Player2, Command = Command.GameAction, HealthAfterAttack = unit.Health, MatchId = MatchId, UnitId = unit.UnitId, Coordinates = coordinates };
                    return msg;
                }
            }
            else
            {
                //inform the missing
                var msg = new Message { Action = GameAction.ShotMissed, Player1 = Player1, Player2 = Player2, Command = Command.GameAction,  MatchId = MatchId, Coordinates = coordinates };

                //change the turn
                Turn = Turn == Player1 ? Player2 : Player1;
                UpdateMatch();
                return msg;
            }

        }

        public void PauseMatch()
        {
            this.PlayingNow = false;
            this.Player1Ready = false;
            this.Player2Ready = false;
            UpdateMatch();
        }

        public void RestartMatch()
        {
            UpdateMatch(new { PlayingNow = true}, new { Id = this.MatchId });
        }

        public Message MatchFinished(Guid winner, Guid losser)
        {
            //update player stats
            CloudWarsData.PlayerWin(winner);
            CloudWarsData.PlayerLose(losser);
            //delete the match
            CloudWarsData.DeleteMatch(this.MatchId);
            //return the message
            return new Message { Winner = winner, Losser = losser, Command = Command.EndGame,  MatchId = this.MatchId };
        }

        private void UpdateUnit(object columns, object where)
        {
            CloudWarsData.UpdateMatchUnit(values: columns, where: where);
        }

        private void UpdateMatch()
        {
            var cols = new { Turn = this.Turn, Player1Ready = this.Player1Ready, Player2Ready = this.Player2Ready, Initialized = this.Initialized, MatchEnded = this.MatchEnded, Winner = this.Winner, PlayingNow = this.PlayingNow };
            var where = new { Id = this.MatchId };
            CloudWarsData.UpdateMatch(values: cols, where: where);
        }

        private void UpdateMatch(object columns, object where)
        {
            CloudWarsData.UpdateMatch(values: columns, where: where);
        }

        private void UpdatePlayer(object columns, object where)
        {
            CloudWarsData.UpdatePlayer(values: columns, where: where);
        }

        public void ChallengePlayer(Guid fromId, Guid toId)
        {
            CloudWarsData.ChallengePlayer(fromId, toId);
        }

        public Tuple<Guid, Guid, Guid> AcceptChallenge(Guid challengeId)
        {
            //Get the challenge
            var c = CloudWarsData.GetChallenge (challengeId );
            //accept the challenge and create the match
            CloudWarsData.AcceptChallenge(challengeId);
            this.CreateMatch(c.Player1, c.Player2);
            return new Tuple<Guid, Guid, Guid>(this.MatchId, c.Player1, c.Player2);
        }

        public Tuple<string, string> RejectChallenge(Guid challengeId)
        {
            var c = CloudWarsData.GetChallenge(challengeId);
            var p1 = CloudWarsData.GetPlayer(c.Player1);
            var p2 = CloudWarsData.GetPlayer(c.Player2);
            CloudWarsData.RejectChallenge(challengeId);
            return new Tuple<string, string>(p1.ClientId, p2.DisplayName);

        }
    }
}


text:
package org.switchyard.common.version;

import java.net.URL;

/**
 * Project.
 *
 * @author David Ward <dward@jboss.org> (C) 2012 Red Hat Inc.
 */
public interface Project extends Comparable<Project> {

    /**
     * Gets the groupId.
     * @return the groupId
     */
    public String getGroupId();

    /**
     * Gets the artifactId.
     * @return the artifactId
     */
    public String getArtifactId();

    /**
     * Gets the packaging.
     * @return the packaging
     */
    public String getPackaging();

    /**
     * Gets the name.
     * @return the name
     */
    public String getName();

    /**
     * Gets the description.
     * @return the description
     */
    public String getDescription();

    /**
     * Gets the URL.
     * @return the URL
     */
    public URL getURL();

    /**
     * Gets the version.
     * @return the version
     */
    public String getVersion();

}