text:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var forms_1 = require('@angular/forms');
var ionic_angular_1 = require('ionic-angular');
var date_picker_1 = require('../../components/date-picker/date-picker');
var client_1 = require('../../providers/client');
var analyticsService = require('../../providers/analytics');
var contestsService = require('../../providers/contests');
var paymentService = require('../../providers/payments');
var alertService = require('../../providers/alert');
var objects_1 = require('../../objects/objects');
var SetContestPage = (function () {
    function SetContestPage(params) {
        var _this = this;
        this.client = client_1.Client.getInstance();
        this.params = params;
        this.endOptionKeys = Object.keys(this.client.settings.newContest.endOptions);
        //Start date is today, end date is by default as set by the server
        var nowWithTime = new Date();
        var nowWithoutTime = new Date();
        nowWithoutTime.clearTime();
        this.currentTimeOnlyInMilliseconds = nowWithTime.getTime() - nowWithoutTime.getTime();
        this.nowWithoutTimeEpoch = nowWithoutTime.getTime();
        var endOption = '';
        if (this.params.data.mode === 'edit') {
            this.contestLocalCopy = contestsService.cloneForEdit(this.params.data.contest);
            if (this.contestLocalCopy.type.id === 'userTrivia') {
                this.retrieveUserQuestions();
            }
        }
        else if (this.params.data.mode === 'add') {
            for (var i = 0; i < this.endOptionKeys.length; i++) {
                if (this.client.settings.newContest.endOptions[this.endOptionKeys[i]].isDefault) {
                    endOption = this.endOptionKeys[i];
                    break;
                }
            }
            if (!endOption) {
                //If no default - set the last as default
                endOption = this.endOptionKeys[this.endOptionKeys.length - 1];
            }
            this.contestLocalCopy = new objects_1.Contest(this.params.data.typeId, this.nowWithoutTimeEpoch + this.currentTimeOnlyInMilliseconds, null, endOption);
            //Set contest subject
            this.contestLocalCopy.subject = this.client.translate(this.client.settings.newContest.contestTypes[this.contestLocalCopy.type.id].text.name, { 'name': this.client.session.name });
            //Set user questions
            if (this.contestLocalCopy.type.id === 'userTrivia') {
                this.contestLocalCopy.type.questions = new objects_1.Questions();
            }
        }
        //Init form
        this.contestForm = new forms_1.FormGroup({
            teams: new forms_1.FormGroup({
                team0: new forms_1.FormControl('', [forms_1.Validators.required, forms_1.Validators.maxLength(this.client.settings.newContest.inputs.team.maxLength)]),
                team1: new forms_1.FormControl('', [forms_1.Validators.required, forms_1.Validators.maxLength(this.client.settings.newContest.inputs.team.maxLength)]),
            }, null, this.matchingTeamsValidator),
            subject: new forms_1.FormControl('', [forms_1.Validators.required, forms_1.Validators.maxLength(this.client.settings.newContest.inputs.subject.maxLength)]),
            endOption: new forms_1.FormControl(endOption),
            randomOrder: new forms_1.FormControl(false)
        });
        this.client.session.features['newContest'].purchaseData.retrieved = false;
        //-------------------------------------------------------------------------------------------------------------
        //Android Billing
        //-------------------------------------------------------------------------------------------------------------
        if (this.client.user.clientInfo.platform === 'android' && this.client.session.features['newContest'].locked) {
            if (!this.client.session.features['newContest'].purchaseData.retrieved) {
                //-------------------------------------------------------------------------------------------------------------
                //pricing - replace cost/currency with the google store pricing (local currency, etc.)
                //-------------------------------------------------------------------------------------------------------------
                window.inappbilling.getProductDetails(function (products) {
                    //In android - the price already contains the symbol
                    _this.client.session.features['newContest'].purchaseData.formattedCost = products[0].price;
                    _this.client.session.features['newContest'].purchaseData.cost = products[0].price_amount_micros / 1000000;
                    _this.client.session.features['newContest'].purchaseData.currency = products[0].price_currency_code;
                    _this.client.session.features['newContest'].purchaseData.retrieved = true;
                    //-------------------------------------------------------------------------------------------------------------
                    //Retrieve unconsumed items - and checking if user has an unconsumed 'new contest unlock key'
                    //-------------------------------------------------------------------------------------------------------------
                    window.inappbilling.getPurchases(function (unconsumedItems) {
                        if (unconsumedItems && unconsumedItems.length > 0) {
                            for (var i = 0; i < unconsumedItems.length; i++) {
                                if (unconsumedItems[i].productId === _this.client.session.features['newContest'].purchaseData.productId) {
                                    _this.processAndroidPurchase(unconsumedItems[i]);
                                    break;
                                }
                            }
                        }
                    }, function (error) {
                        analyticsService.logError('AndroidBillingRetrieveUnconsumedItems', error);
                    });
                }, function (msg) {
                    analyticsService.logError('AndroidBillingProductDetailsError', msg);
                }, this.client.session.features['newContest'].purchaseData.productId);
            }
        }
        else {
            this.client.session.features['newContest'].purchaseData.retrieved = true;
        }
    }
    SetContestPage.prototype.ngAfterViewInit = function () {
        this.team0Input['_native']._elementRef.nativeElement.maxLength = this.client.settings.newContest.inputs.team.maxLength;
        this.team1Input['_native']._elementRef.nativeElement.maxLength = this.client.settings.newContest.inputs.team.maxLength;
        this.subjectInput['_native']._elementRef.nativeElement.maxLength = this.client.settings.newContest.inputs.subject.maxLength;
        if (this.contestLocalCopy.type.id === 'systemTrivia' && !this.client.session.isAdmin) {
            this.subjectInput['_native']._elementRef.nativeElement.readOnly = true;
        }
    };
    SetContestPage.prototype.ionViewWillEnter = function () {
        var eventData = { 'mode': this.params.data.mode };
        if (this.params.data.mode === 'edit') {
            eventData['contestId'] = this.params.data.contest._id;
        }
        analyticsService.track('page/setContest', eventData);
        this.submitted = false;
    };
    SetContestPage.prototype.retrieveUserQuestions = function () {
        var _this = this;
        contestsService.getQuestions(this.contestLocalCopy.type.userQuestions).then(function (questions) {
            _this.contestLocalCopy.type.questions = { 'visibleCount': questions.length, 'list': questions };
        }, function () {
        });
    };
    SetContestPage.prototype.processAndroidPurchase = function (purchaseData) {
        var _this = this;
        return new Promise(function (resolve, reject) {
            var extraPurchaseData = {
                'actualCost': _this.client.session.features['newContest'].purchaseData.cost,
                'actualCurrency': _this.client.session.features['newContest'].purchaseData.currency,
                'featurePurchased': _this.client.session.features['newContest'].name
            };
            paymentService.processPayment('android', purchaseData, extraPurchaseData).then(function (serverPurchaseData) {
                _this.client.showLoader();
                window.inappbilling.consumePurchase(function (purchaseData) {
                    _this.client.hideLoader();
                    if (resolve) {
                        resolve(purchaseData);
                    }
                    paymentService.showPurchaseSuccess(serverPurchaseData);
                }, function (error) {
                    _this.client.hideLoader();
                    analyticsService.logError('AndroidBillingConsumeProductError', error);
                    if (reject) {
                        reject();
                    }
                }, purchaseData.productId);
            }, function () {
            });
        });
    };
    SetContestPage.prototype.buyNewContestUnlockKey = function (isMobile) {
        var _this = this;
        debugger;
        this.buyInProgress = true;
        paymentService.buy(this.client.session.features['newContest'], isMobile).then(function (result) {
            switch (result.method) {
                case 'paypal':
                    location.replace(result.data.url);
                    break;
                case 'facebook':
                    if (result.data.status === 'completed') {
                        paymentService.processPayment(result.method, result.data, null).then(function (serverPurchaseData) {
                            //Update local assets
                            _this.buyInProgress = false;
                            paymentService.showPurchaseSuccess(serverPurchaseData);
                        }, function () {
                            _this.buyInProgress = false;
                        });
                    }
                    else if (result.data.status === 'initiated') {
                        //Payment might come later from server
                        alertService.alert({ 'type': 'SERVER_ERROR_PURCHASE_IN_PROGRESS' });
                    }
                    else {
                        //Probably user canceled
                        _this.buyInProgress = false;
                    }
                    break;
                case 'android':
                    _this.processAndroidPurchase(result.data).then(function () {
                        _this.buyInProgress = false;
                    }, function () {
                        _this.buyInProgress = false;
                    });
                    break;
            }
        }, function () {
            _this.buyInProgress = false;
        });
    };
    SetContestPage.prototype.userQuestionsMinimumError = function () {
        if (this.userQuestionsInvalid) {
            return true;
        }
        else {
            return false;
        }
    };
    SetContestPage.prototype.maxQuestionsReached = function () {
        return (this.contestLocalCopy.type.questions && this.contestLocalCopy.type.questions.visibleCount === this.client.settings['newContest'].privateQuestions.max);
    };
    SetContestPage.prototype.openQuestionEditor = function (mode, question) {
        var _this = this;
        if (mode === 'add') {
            if (this.maxQuestionsReached()) {
                alertService.alert(this.client.translate('MAX_USER_QUESTIONS_REACHED', { max: this.client.settings['newContest'].privateQuestions.max }));
                return;
            }
        }
        var modal = this.client.createModalPage('QuestionEditorPage', {
            'question': question,
            'mode': mode,
            'currentQuestions': this.contestLocalCopy.type.questions
        });
        modal.onDidDismiss(function (result) {
            if (!result) {
                return;
            }
            _this.userQuestionsInvalid = null;
            if (!result.question._id) {
                //New questions
                result.question._id = 'new';
                _this.contestLocalCopy.type.questions.list.push(result.question);
                _this.contestLocalCopy.type.questions.visibleCount++;
            }
            else if (result.question._id !== 'new') {
                //Set dirty flag for the question - so server will update it in the db
                result.question.isDirty = true;
            }
        });
        modal.present();
    };
    SetContestPage.prototype.openSearchQuestions = function () {
        if (this.maxQuestionsReached()) {
            alertService.alert(this.client.translate('MAX_USER_QUESTIONS_REACHED', { max: this.client.settings['newContest'].privateQuestions.max }));
            return;
        }
        this.client.showModalPage('SearchQuestionsPage', { 'currentQuestions': this.contestLocalCopy.type.questions });
    };
    SetContestPage.prototype.removeQuestion = function (index) {
        var _this = this;
        alertService.confirm('REMOVE_QUESTION', 'CONFIRM_REMOVE_QUESTION').then(function () {
            if (_this.contestLocalCopy.type.questions.list && index < _this.contestLocalCopy.type.questions.list.length) {
                if (_this.contestLocalCopy.type.questions.list[index]._id && _this.contestLocalCopy.type.questions.list[index]._id !== 'new') {
                    //Question has an id in the database - logically remove
                    _this.contestLocalCopy.type.questions.list[index].deleted = true;
                }
                else {
                    //Question does not have an actual id in the database - physically remove
                    _this.contestLocalCopy.type.questions.list.splice(index, 1);
                }
                _this.contestLocalCopy.type.questions.visibleCount--;
            }
        }, function () {
            //do nothing on cancel
        });
    };
    SetContestPage.prototype.setContest = function () {
        var _this = this;
        analyticsService.track('contest/set');
        this.submitted = true;
        if (!this.contestForm.valid) {
            return;
        }
        //Check min questions in user Trivia
        if (this.contestLocalCopy.type.id === 'userTrivia') {
            if (!this.contestLocalCopy.type.questions || this.contestLocalCopy.type.questions.visibleCount < this.client.settings['newContest'].privateQuestions.min) {
                if (this.client.settings['newContest'].privateQuestions.min === 1) {
                    this.userQuestionsInvalid = this.client.translate('SERVER_ERROR_MINIMUM_USER_QUESTIONS_SINGLE_MESSAGE', { minimum: this.client.settings['newContest'].privateQuestions.min });
                }
                else {
                    this.userQuestionsInvalid = this.client.translate('SERVER_ERROR_MINIMUM_USER_QUESTIONS_SINGLE_MESSAGE', { minimum: this.client.settings['newContest'].privateQuestions.min });
                }
                return;
            }
        }
        var isDirty = false;
        if (this.params.data.mode === 'add') {
            isDirty = true;
        }
        else {
            //edit mode
            if (this.contestLocalCopy.teams[0].name !== this.params.data.contest.teams[0].name ||
                this.contestLocalCopy.teams[1].name !== this.params.data.contest.teams[1].name ||
                this.contestLocalCopy.subject !== this.params.data.contest.subject) {
                isDirty = true;
            }
            if (!isDirty &&
                (this.contestLocalCopy.startDate !== this.params.data.contest.startDate ||
                    this.contestLocalCopy.endDate !== this.params.data.contest.endDate ||
                    (this.contestLocalCopy.teams[0].score !== undefined && this.params.data.contest.teams[0].score !== undefined && this.contestLocalCopy.teams[0].score !== this.params.data.contest.teams[0].score) ||
                    (this.contestLocalCopy.teams[1].score !== undefined && this.params.data.contest.teams[1].score !== undefined && this.contestLocalCopy.teams[1].score !== this.params.data.contest.teams[1].score) ||
                    (this.contestLocalCopy.systemParticipants !== undefined && this.params.data.contest.systemParticipants !== undefined && this.contestLocalCopy.systemParticipants !== this.params.data.contest.systemParticipants) ||
                    (this.contestLocalCopy.rating !== undefined && this.params.data.contest.rating !== undefined && this.contestLocalCopy.rating !== this.params.data.contest.rating))) {
                isDirty = true;
            }
            if (!isDirty && this.contestLocalCopy.type.id === 'userTrivia' && JSON.stringify(this.contestLocalCopy.type) !== JSON.stringify(this.params.data.contest.type)) {
                isDirty = true;
            }
        }
        if (isDirty) {
            if (this.client.session.isAdmin) {
                //Check if scores have changed and update the deltas
                if (this.contestLocalCopy.teams[0].score !== undefined) {
                    if (this.params.data.mode === 'edit' && this.contestLocalCopy.teams[0].score !== this.params.data.contest.teams[0].score) {
                        this.contestLocalCopy.teams[0].adminScoreAddition = this.contestLocalCopy.teams[0].score - this.params.data.contest.teams[0].score;
                    }
                    else if (this.params.data.mode === 'add') {
                        this.contestLocalCopy.teams[0].adminScoreAddition = this.contestLocalCopy.teams[0].score;
                    }
                    delete this.contestLocalCopy.teams[0].score;
                }
                if (this.contestLocalCopy.teams[1].score !== undefined) {
                    if (this.params.data.mode === 'edit' && this.contestLocalCopy.teams[1].score !== this.params.data.contest.teams[1].score) {
                        this.contestLocalCopy.teams[1].adminScoreAddition = this.contestLocalCopy.teams[1].score - this.params.data.contest.teams[1].score;
                    }
                    else if (this.params.data.mode === 'add') {
                        this.contestLocalCopy.teams[1].adminScoreAddition = this.contestLocalCopy.teams[1].score;
                    }
                    delete this.contestLocalCopy.teams[1].score;
                }
            }
            contestsService.setContest(this.contestLocalCopy, this.params.data.mode).then(function (contest) {
                //Report to Analytics
                var contestParams = {
                    'team0': _this.contestLocalCopy.teams[0].name,
                    'team1': _this.contestLocalCopy.teams[1].name,
                    'duration': _this.contestLocalCopy.endOption,
                    'typeId': _this.contestLocalCopy.type.id
                };
                if (_this.params.data.mode === 'add') {
                    analyticsService.track('contest/created', contestParams);
                    _this.client.events.publish('app:contestCreated', contest);
                    _this.client.nav.pop({ animate: false }).then(function () {
                        var appPages = new Array();
                        appPages.push(new objects_1.AppPage('ContestPage', { 'contest': contest }));
                        appPages.push(new objects_1.AppPage('SharePage', { 'contest': contest, 'source': 'newContest' }));
                        _this.client.insertPages(appPages);
                    }, function () {
                    });
                }
                else {
                    analyticsService.track('contest/updated', contestParams);
                    var now = (new Date).getTime();
                    var currentStatus = contestsService.getContestStatus(_this.contestLocalCopy);
                    var previousStatus = contestsService.getContestStatus(_this.params.data.contest);
                    _this.client.events.publish('app:contestUpdated', contest, previousStatus, currentStatus);
                    _this.client.nav.pop();
                }
            }, function () {
            });
        }
        else {
            this.client.nav.pop();
        }
    };
    SetContestPage.prototype.matchingTeamsValidator = function (group) {
        var value;
        var valid = true;
        for (name in group.controls) {
            //Empty value in one of the teams will be caught in the required validator
            if (!group.controls[name].value) {
                return null;
            }
            if (value === undefined) {
                value = group.controls[name].value;
            }
            else {
                if (value && group.controls[name].value && value.trim() === group.controls[name].value.trim()) {
                    valid = false;
                    break;
                }
            }
        }
        if (valid) {
            return null;
        }
        return { matchingTeams: true };
    };
    SetContestPage.prototype.setEndsIn = function () {
        this.contestLocalCopy.endDate = this.getEndDateAccordingToEndsIn(this.contestLocalCopy.endOption);
        analyticsService.track('newContest/endsIn/click', { 'endsIn': this.contestLocalCopy.endOption });
    };
    SetContestPage.prototype.getEndDateAccordingToEndsIn = function (endsIn) {
        var endOption = this.client.settings['newContest'].endOptions[endsIn];
        var endDate = this.nowWithoutTimeEpoch + this.currentTimeOnlyInMilliseconds + (endOption.number * endOption.msecMultiplier);
        return endDate;
    };
    SetContestPage.prototype.setAdminInfo = function () {
        if (!this.contestLocalCopy.systemParticipants) {
            this.contestLocalCopy.systemParticipants = 0;
        }
        if (!this.contestLocalCopy.rating) {
            this.contestLocalCopy.rating = 0;
        }
        if (!this.contestLocalCopy.teams[0].score && this.contestLocalCopy.teams[0].score !== 0) {
            if (this.params.data.mode === 'edit') {
                this.contestLocalCopy.teams[0].score = this.params.data.contest.teams[0].score;
            }
            else {
                this.contestLocalCopy.teams[0].score = 0;
            }
            this.contestLocalCopy.teams[0].adminScoreAddition = 0;
        }
        if (!this.contestLocalCopy.teams[1].score && this.contestLocalCopy.teams[1].score !== 0) {
            if (this.params.data.mode === 'edit') {
                this.contestLocalCopy.teams[1].score = this.params.data.contest.teams[1].score;
            }
            else {
                this.contestLocalCopy.teams[1].score = 0;
            }
            this.contestLocalCopy.teams[1].adminScoreAddition = 0;
        }
        var contestName;
        if (this.params.data.mode === 'edit') {
            contestName = this.params.data.contest.name.long;
        }
        else {
            contestName = this.client.translate('CONTEST_NAME_LONG', {
                'team0': this.contestLocalCopy.teams[0].name,
                'team1': this.contestLocalCopy.teams[1].name,
                'subject': this.contestLocalCopy.subject
            });
        }
        this.client.openPage('SetContestAdminPage', {
            'contestLocalCopy': this.contestLocalCopy,
            'mode': this.params.data.mode,
            'title': this.title,
            'contestName': contestName
        });
    };
    SetContestPage.prototype.endDateSelected = function (dateSelection) {
        //Set the end date at the end of this day (e.g. 23:59:59.999)
        this.contestLocalCopy.endDate = dateSelection.epochLocal + this.currentTimeOnlyInMilliseconds;
        if (this.contestLocalCopy.endDate < this.contestLocalCopy.startDate) {
            var startDate = new Date(this.contestLocalCopy.startDate);
            startDate.clearTime(); //Start of the day
            this.contestLocalCopy.endDate = startDate.getTime() + 24 * 60 * 60 * 1000 - 1; //The end of the day of the start date (e.g. 23:59:59.999)
        }
    };
    SetContestPage.prototype.getMaxEndDate = function () {
        if (!this.client.session.isAdmin) {
            //Allow extending by the maximum end date option in the list
            var endOption = this.client.settings['newContest'].endOptions[this.endOptionKeys[this.endOptionKeys.length - 1]];
            return this.nowWithoutTimeEpoch + this.currentTimeOnlyInMilliseconds + (endOption.number * endOption.msecMultiplier);
        }
        else {
            //Unlimited
            return null;
        }
    };
    SetContestPage.prototype.subjectFocus = function () {
        if (!this.readOnlySubjectAlerted && this.contestLocalCopy.type.id === 'systemTrivia' && !this.client.session.isAdmin) {
            this.readOnlySubjectAlerted = true;
            alertService.alert({
                'type': 'SERVER_ERROR_SUBJECT_DISABLED_IN_SYSTEM_TRIVIA'
            });
        }
    };
    __decorate([
        core_1.ViewChild('team0Input'),
        __metadata('design:type', core_1.ElementRef)
    ], SetContestPage.prototype, "team0Input", void 0);
    __decorate([
        core_1.ViewChild('team1Input'),
        __metadata('design:type', core_1.ElementRef)
    ], SetContestPage.prototype, "team1Input", void 0);
    __decorate([
        core_1.ViewChild('subjectInput'),
        __metadata('design:type', core_1.ElementRef)
    ], SetContestPage.prototype, "subjectInput", void 0);
    SetContestPage = __decorate([
        core_1.Component({
            templateUrl: 'build/pages/set-contest/set-contest.html',
            directives: [forms_1.REACTIVE_FORM_DIRECTIVES, date_picker_1.DatePickerComponent]
        }),
        __metadata('design:paramtypes', [ionic_angular_1.NavParams])
    ], SetContestPage);
    return SetContestPage;
})();
exports.SetContestPage = SetContestPage;
//# sourceMappingURL=set-contest.js.map


text:
<?xml version="1.0" encoding="utf-8"?>

<function>
    <description>
Downloads the file identified by `url` to local file `filename`. Any missing folders are created automatically. To download from an existing web context, provide the optional `webcontext` parameter, a Page variable, to reuse its (authentication)-headers and cookies for the download. The default `timeout` if not provided is 5000 ms.

It supports the HTTP and HTTPS protocols and automatically bypasses all invalid or not trusted SSL certificates in case of HTTPS.

| Parameter            | Description |
|----------------------|-------------|
|url                   | The URL of the source |
|fileName              | Filename where the source content will be saved |
|webContext            | Optional `PAGE variable` holding the page context |
|timeout               | Download timeout in milliseconds |
|`return`              | HTTP response code |
    </description>
    <examples>
        <example title="Usage">
            Download a pdf document

                use Web;
                Web.download("http://www.something.com/archive/document.pdf", "c:/tmp/doc.pdf", null, 60000);

        </example>

        <example title="Usage">
            Download a pdf document with context

                use Web, System;
                var page = Web.loadPage("http://www.something.com/archive/login.php", {"user" : "Joe", "pass" : "Password123"});
                var httpCode = Web.download("http://www.something.com/archive/document.pdf", "c:/tmp/doc.pdf", page, 60000);
                if (httpCode != 200) {
                  System.print("Download failed!", "error");
                }

        </example>
    </examples>
    <references>
        <reference>loadPage</reference>
    </references>
    <tags>
        download, page, web, url, file
    </tags>
</function>

redpajama_set_name: RedPajamaGithub


text:
#include "stp/Sat/SimplifyingMinisat.h"
#include "minisat/simp/SimpSolver.h"
//#include "utils/System.h"

namespace BEEV
{
using std::cout;

SimplifyingMinisat::SimplifyingMinisat(volatile bool& timeout)
{
  s = new Minisat::SimpSolver(timeout);
}

SimplifyingMinisat::~SimplifyingMinisat()
{
  delete s;
}

bool SimplifyingMinisat::addClause(
    const vec_literals& ps) // Add a clause to the solver.
{
  return s->addClause(ps);
}

bool
SimplifyingMinisat::okay() const // FALSE means solver is in a conflicting state
{
  return s->okay();
}

bool SimplifyingMinisat::solve() // Search without assumptions.
{
  if (!s->simplify())
    return false;

  return s->solve();
}

bool SimplifyingMinisat::simplify() // Removes already satisfied clauses.
{
  return s->simplify();
}

uint8_t SimplifyingMinisat::modelValue(uint32_t x) const
{
  return Minisat::toInt(s->modelValue(x));
}

void SimplifyingMinisat::setVerbosity(int v)
{
  s->verbosity = v;
}

void SimplifyingMinisat::setSeed(int i)
{
  s->random_seed = i;
}

uint32_t SimplifyingMinisat::newVar()
{
  return s->newVar();
}

unsigned long SimplifyingMinisat::nVars()
{
  return s->nVars();
}

void SimplifyingMinisat::printStats()
{
  s->printStats();
}

void SimplifyingMinisat::setFrozen(uint32_t x)
{
  s->setFrozen(x, true);
}
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Hildewintera colademononis Diers & Krahn

### Remarks
null


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Parakeet.View.PrimaryWindow
{
    /// <summary>
    /// Logique d'interaction pour RemoveFilesView.xaml
    /// </summary>
    public partial class RemoveFilesView : UserControl
    {
        public RemoveFilesView()
        {
            InitializeComponent();
        }
    }
}


text:
* [About this Documentation](docs/about-this-documentation.md)
* [Installation](docs/installation.md)
  * [Pick your Flavour](#)
    * [Ruby](docs/installation.md#ruby)
    * [Java](docs/installation.md#java)
    * [Javascript](docs/installation.md#javascript)
    * [Unofficial Cucumbers](#)
* [10 minute tutorial](docs/10-minute-tutorial.md)

### Behaviour-Driven Development

* [Introduction to BDD](#)
* [Roles](#)
  * [Domain Expert](#)
  * [Developer](#)
  * [Tester](#)
  * [Designer/UX](#)
* [Artefacts](#)
  * [Automated Tests](#)
  * [Specifications](#)
  * [Documentation](#)
* [Communication](#)

* [Techniques](docs/techniques.md)
  * [Analysis](#)
    * [Example Mapping](#)
      * [Three Amigos](docs/techniques.md#three-amigos)
      * [Discovery Workshop](#)
      * [Deliberate Discovery](#)
    * [Event Storming](#)
  * [Cucumber](docs/cucumber.md)
    * [Living Documentation](docs/living-documentation.md)
      * [Incidental Details](#)
      * [Example Mapping Output](#)
    * [Organising Gherkin](#)
    * [Organising Step Definitions](#)
  * [Programming](#)
    * [Modelling by Example](#)
    * [Test-Driven Development](#)
      * [Outer Cycle](#)
      * [Inner Cycle](#)
    * [Ports and Adapters](#)
  * [Testing](#)
    * [Test Pyramid](#)
    * [Shallow Tests](#)
    * [Narrow Tests](#)
    * [UI Testing](#)
      * [Selenium WebDriver](#)
    * [Databases](#)
    * [Web Services](#)
    * [Domain Layer](#)
    * [Fixtures](#)
    * [Test Doubles](#)
    * [Contract Testing](#)
    * [Legacy Systems](#)
  * [Continuous Integration](#)

### Cucumber Reference

* [How Cucumber Works](#)
  * High-level diagram
  * Independent scenarios with *initial* state
  * Passing/Failing scenarios and steps
  * Step (definitions) are global
* [Gherkin](docs/gherkin.md)
  * [Feature](docs/gherkin.md#feature)
  * [Scenario](docs/gherkin.md#feature)
  * [Given/When/Then (Steps)](docs/gherkin.md#steps)
  * [Tags](docs/tags.md)
  * [Tag Expressions](tag-expressions/README.md)
  * [Background](docs/gherkin.md#background)
  * [Scenario Outline](docs/gherkin.md#scenario-outline)
  * [Background](gdocs/herkin.md#background)
  * [Data Tables](docs/gherkin.md#background)
  * [Doc Strings](docs/gherkin.md#background)
  * [Comments](#)
  * [Internationalisation](#)
* [Step Definitions](docs/step-definitions.md)
  * [Regular Expressions](#)
  * [Cucumber Expressions](cucumber-expressions/README.md)
    * [Cucumber Expressions and Java](cucumber-expressions/java/heuristics.adoc)
  * [Passing & Failing Steps](#)
  * [Type Transformation](#)
  * [World](#)
  * [Reuse](#)
* [Hooks](docs/hooks.md)
   * [Tagged Hooks](docs/hooks.md#tagged-hooks)
* [Configuration](docs/configuration.md)
* [Command Line](#)
  * [Colours](#)
* [Reporting](#)
  * [Formatters](#)
    * [HTML Formatter](html-formatter/README.md)
  * [Screenshots](#)
  * [Attachments](#)
* [Extending Cucumber](#)

### Cucumber Extensions

* [Official Extensions](#)
  * [CLI automation - Aruba](#)
  * [Ruby on Rails](#)
  * [Spring Framework](#)
  * [PicoContainer](#)
* [3rd Party Extensions](#)
  * [IDEs/Text Editors](#)
  * [Watir](#)
  * [Selenium WebDriver](#)
  * [Serenity](#)

### Common Anti-Patterns

* [Gherkin](#)
  * [Conjunction](#)
  * [Feature Coupled Step Definitions](#)

### Contributing

* [Overview](CONTRIBUTING.md)
* [Contributing to Documentation](docs/contributing-to-documentation.md)
* [Contributing to Code](docs/contributing-to-code.md)
* [Standard Library](docs/standard-library.adoc)
  * [Event Protocol](docs/architecture/event-protocol.md)
* [Team](#)


text:
package com.giit.www.college.dao;

import com.giit.www.entity.Timetable;

/**
 * Created by c0de8ug on 16-2-13.
 */
public interface TimetableDao {
    public void add(Timetable timetable);

    public void delete(int secId);
}


text:
<?php

namespace Kunstmaan\PagePartBundle\Entity;

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping as ORM;

/**
 * Reference between a page and a pagepart
 *
 * @ORM\Entity(repositoryClass="Kunstmaan\PagePartBundle\Repository\PagePartRefRepository")
 * @ORM\Table(name="kuma_page_part_refs", indexes={@ORM\Index(name="idx_page_part_search", columns={"pageId", "pageEntityname", "context"})})
 * @ORM\HasLifecycleCallbacks()
 */
class PagePartRef
{
    /**
     * @ORM\Id
     * @ORM\Column(type="bigint")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(name="pageId", type="bigint")
     */
    protected $pageId;

    /**
     * @ORM\Column(name="pageEntityname", type="string")
     */
    protected $pageEntityname;

    /**
     * @ORM\Column(type="string")
     */
    protected $context;

    /**
     * @ORM\Column(type="integer")
     */
    protected $sequencenumber;

    /**
     * @ORM\Column(type="bigint")
     */
    protected $pagePartId;

    /**
     * @ORM\Column(type="string")
     */
    protected $pagePartEntityname;

    /**
     * @ORM\Column(type="datetime")
     */
    protected $created;

    /**
     * @ORM\Column(type="datetime")
     */
    protected $updated;

    /**
     * The constructor
     */
    public function __construct()
    {
        $this->setCreated(new \DateTime());
        $this->setUpdated(new \DateTime());
    }

    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param int $num
     */
    public function setId($num)
    {
        $this->id = $num;
    }

    /**
     * Get pageId
     *
     * @return int
     */
    public function getPageId()
    {
        return $this->pageId;
    }

    /**
     * @param int $id
     */
    public function setPageId($id)
    {
        $this->pageId = $id;
    }

    /**
     * Get pageEntityname
     *
     * @return string
     */
    public function getPageEntityname()
    {
        return $this->pageEntityname;
    }

    /**
     * Set pageEntityname
     *
     * @param string $pageEntityname
     */
    public function setPageEntityname($pageEntityname)
    {
        $this->pageEntityname = $pageEntityname;
    }

    /**
     * get context
     *
     * @return string
     */
    public function getContext()
    {
        return $this->context;
    }

    /**
     * Set context
     *
     * @param string $context
     */
    public function setContext($context)
    {
        $this->context = $context;
    }

    /**
     * Get sequencenumber
     *
     * @return int
     */
    public function getSequencenumber()
    {
        return $this->sequencenumber;
    }

    /**
     * Set sequencenumber
     *
     * @param int $sequencenumber
     */
    public function setSequencenumber($sequencenumber)
    {
        $this->sequencenumber = $sequencenumber;
    }

    /**
     * Get pagePartId
     *
     * @return int
     */
    public function getPagePartId()
    {
        return $this->pagePartId;
    }

    /**
     * Set pagePartId
     *
     * @param string $pagePartId
     */
    public function setPagePartId($pagePartId)
    {
        $this->pagePartId = $pagePartId;
    }

    /**
     * Get pagePartEntityname
     *
     * @return string
     */
    public function getPagePartEntityname()
    {
        return $this->pagePartEntityname;
    }

    /**
     * Set pagePartEntityname
     *
     * @param string $pagePartEntityname
     */
    public function setPagePartEntityname($pagePartEntityname)
    {
        $this->pagePartEntityname = $pagePartEntityname;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     */
    public function setCreated(\DateTime $created)
    {
        $this->created = $created;
    }

    /**
     * Get updated
     *
     * @return \DateTime
     */
    public function getUpdated()
    {
        return $this->updated;
    }

    /**
     * Set updated
     *
     * @param \DateTime $updated
     */
    public function setUpdated(\DateTime $updated)
    {
        $this->updated = $updated;
    }

    /**
     * @ORM\PreUpdate
     */
    public function setUpdatedValue()
    {
        $this->setUpdated(new \DateTime());
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return 'pagepartref in context ' . $this->getContext();
    }

    /**
     * @param \Doctrine\ORM\EntityManager $em
     *
     * @return \Kunstmaan\PagePartBundle\Helper\PagePartInterface
     */
    public function getPagePart(EntityManager $em)
    {
        return $em->getRepository($this->getPagePartEntityname())->find($this->getPagePartId());
    }
}


text:
// Thanks to Romain from Dviance.
#ifndef DIALOG_H
#define DIALOG_H

#include <QtCore/QObject>
#include <QtWidgets/QDialog>
#include <QtCore/QPoint>
#include <QMouseEvent>

namespace Ui {
class Dialog;
}

class Dialog : public QDialog
{
    Q_OBJECT

public:
    enum Type
    {
        Information,
        Error,
        Warning,
        Success
    };

    enum Role
    {
        Accept,
        Reject,
        Hide
    };

    enum ButtonChoice
    {
        Left,
        Right
    };

    explicit Dialog(QWidget *parent = 0);
    ~Dialog();

    void setButton(Dialog::ButtonChoice choice, Dialog::Role role, const QString & t, bool def);

    int show(Dialog::Type type, const QString & title, const QString & message);

protected:
    void mousePressEvent(QMouseEvent * event);
    void mouseMoveEvent(QMouseEvent * event);
    void mouseReleaseEvent(QMouseEvent * event);

private:
    Ui::Dialog *ui;

    QPoint      mOrigin;
    QPoint      mAnchor;
    bool        mMoveAllowed;

    static QPixmap * mInfos;
    static QPixmap * mTick;
    static QPixmap * mCross;
    static QPixmap * mWarn;
};

#endif // DIALOG_H


text:
import firebase from 'firebase/app';
import { FirebaseProviderError } from './errors';
import { ensureAuth } from './helpers';

export default function deleteUser() {
  return ensureAuth().then(() => {
    const user = firebase.auth().currentUser;

    return user.getIdToken().catch(error => {
      throw new FirebaseProviderError(error);
    });
  });
}


text:
namespace TellagoStudios.Hermes.Client.Util
{
    public class Header
    {
        public Header()
        {
        }

        public Header(string name, string value)
        {
            Name = name;
            Value = value;
        }

        public string Name { get; set; }
        public string Value { get; set; }

        public override string ToString()
        {
            return Name + ": " + Value;
        }
    }
}


text:
import isNumber from "lodash/lang/isNumber";
import * as util from  "../../../util";
import * as t from "../../../types";

export var shouldVisit = t.isRestElement;

var memberExpressionOptimisationVisitor = {
  enter(node, parent, scope, state) {
    // check if this scope has a local binding that will shadow the rest parameter
    if (this.isScope() && !scope.bindingIdentifierEquals(state.name, state.outerBinding)) {
      return this.skip();
    }

    // skip over functions as whatever `arguments` we reference inside will refer
    // to the wrong function
    if (this.isFunctionDeclaration() || this.isFunctionExpression()) {
      state.noOptimise = true;
      this.traverse(memberExpressionOptimisationVisitor, state);
      state.noOptimise = false;
      return this.skip();
    }

    // is this a referenced identifier and is it referencing the rest parameter?
    if (!this.isReferencedIdentifier({ name: state.name })) return;

    if (!state.noOptimise && t.isMemberExpression(parent) && parent.computed) {
      // if we know that this member expression is referencing a number then we can safely
      // optimise it
      var prop = parent.property;
      if (isNumber(prop.value) || t.isUnaryExpression(prop) || t.isBinaryExpression(prop)) {
        state.candidates.push(this);
        return;
      }
    }

    state.canOptimise = false;
    this.stop();
  }
};

function optimizeMemberExpression(parent, offset) {
  var newExpr;
  var prop = parent.property;

  if (t.isLiteral(prop)) {
    prop.value += offset;
    prop.raw = String(prop.value);
  } else { // // UnaryExpression, BinaryExpression
    newExpr = t.binaryExpression("+", prop, t.literal(offset));
    parent.property = newExpr;
  }
}

var hasRest = function (node) {
  return t.isRestElement(node.params[node.params.length - 1]);
};

exports.Function = function (node, parent, scope, file) {
  if (!hasRest(node)) return;

  var rest = node.params.pop().argument;

  var argsId = t.identifier("arguments");

  // otherwise `arguments` will be remapped in arrow functions
  argsId._shadowedFunctionLiteral = true;

  // support patterns
  if (t.isPattern(rest)) {
    var pattern = rest;
    rest = scope.generateUidIdentifier("ref");

    var declar = t.variableDeclaration("let", pattern.elements.map(function (elem, index) {
      var accessExpr = t.memberExpression(rest, t.literal(index), true);
      return t.variableDeclarator(elem, accessExpr);
    }));
    node.body.body.unshift(declar);
  }

  // check if rest is used in member expressions and optimise for those cases

  var state = {
    outerBinding: scope.getBindingIdentifier(rest.name),
    canOptimise:  true,
    candidates:   [],
    method:       node,
    name:         rest.name
  };

  this.traverse(memberExpressionOptimisationVisitor, state);

  // we only have shorthands and there's no other references
  if (state.canOptimise && state.candidates.length) {
    for (var i = 0; i < state.candidates.length; i++) {
      var candidate = state.candidates[i];
      candidate.replaceWith(argsId);
      optimizeMemberExpression(candidate.parent, node.params.length);
    }
    this.checkSelf();
    return;
  }

  //

  var start = t.literal(node.params.length);
  var key = scope.generateUidIdentifier("key");
  var len = scope.generateUidIdentifier("len");

  var arrKey = key;
  var arrLen = len;
  if (node.params.length) {
    // this method has additional params, so we need to subtract
    // the index of the current argument position from the
    // position in the array that we want to populate
    arrKey = t.binaryExpression("-", key, start);

    // we need to work out the size of the array that we're
    // going to store all the rest parameters
    //
    // we need to add a check to avoid constructing the array
    // with <0 if there are less arguments than params as it'll
    // cause an error
    arrLen = t.conditionalExpression(
      t.binaryExpression(">", len, start),
      t.binaryExpression("-", len, start),
      t.literal(0)
    );
  }

  var loop = util.template("rest", {
    ARGUMENTS: argsId,
    ARRAY_KEY: arrKey,
    ARRAY_LEN: arrLen,
    START:     start,
    ARRAY:     rest,
    KEY:       key,
    LEN:       len
  });
  loop._blockHoist = node.params.length + 1;
  node.body.body.unshift(loop);
  this.checkSelf();
};


text:
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {assertEquals, assertFalse} from 'chrome://webui-test/chromeos/chai_assert.js';

import {installMockChrome} from '../../common/js/mock_chrome.js';
import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js';
import {EntryLocation} from '../../externs/entry_location.js';
import {VolumeInfo} from '../../externs/volume_info.js';
import {VolumeManager} from '../../externs/volume_manager.js';

import {FileFilter, RecentContentScanner} from './directory_contents.js';

/**
 * Mock chrome APIs.
 * @type {!Object}
 */
const mockChrome = {
  fileManagerPrivate: {
    getRecentFiles:
        (sourceRestriction, fileType, invalidateCache, callback) => {
          /** @type {!Array<!FileEntry>} */
          const entries = [
            /** @type {!FileEntry} */ ({name: '1.txt'}),
            /** @type {!FileEntry} */ ({name: '2.txt'}),
            /** @type {!FileEntry} */ ({name: '3.png'}),
          ];
          callback(entries);
        },
  },
};

/**
 * Initializes the test environment.
 */
export function setUp() {
  // Install mock chrome APIs.
  installMockChrome(mockChrome);
}

/**
 * Check that files are shown or hidden correctly.
 */
export function testHiddenFiles() {
  let volumeManagerRootType = VolumeManagerCommon.RootType.DOWNLOADS;
  // Create a fake volume manager that provides entry location info.
  const volumeManager = /** @type {!VolumeManager} */ ({
    getLocationInfo: (entry) => {
      return /** @type {!EntryLocation} */ ({
        rootType: volumeManagerRootType,
      });
    },
  });

  const entry = (fullPath) =>
      /** @type {!Entry} */ (
          {name: fullPath.split('/').pop(), fullPath, filesystem: 'test'});

  // Create a set of entries in root dir, and in /PvmDefault dir.
  const entries = [];
  for (const e of ['.test', 'test', '$RECYCLE.BIN', '$okForNow', '~okForNow']) {
    entries.push(entry('/' + e));
    entries.push(entry('/PvmDefault/' + e));
  }

  const filter = new FileFilter(volumeManager);

  // .test should be hidden in any dir.
  // $RECYCLE.BIN is hidden in downloads:/PvmDefault only.
  assertFalse(filter.isHiddenFilesVisible());
  let hidden = entries.filter(entry => !filter.filter(entry));
  assertEquals(3, hidden.length);
  assertEquals('/.test', hidden[0].fullPath);
  assertEquals('/PvmDefault/.test', hidden[1].fullPath);
  assertEquals('/PvmDefault/$RECYCLE.BIN', hidden[2].fullPath);

  // No files hidden when we show hidden files.
  filter.setHiddenFilesVisible(true);
  hidden = entries.filter(entry => !filter.filter(entry));
  assertEquals(0, hidden.length);

  // $RECYCLE.BIN is not hidden in other volumes.
  volumeManagerRootType = 'testroot';
  filter.setHiddenFilesVisible(false);
  hidden = entries.filter(entry => !filter.filter(entry));
  assertEquals(2, hidden.length);
  assertEquals('/.test', hidden[0].fullPath);
  assertEquals('/PvmDefault/.test', hidden[1].fullPath);

  // Still no files hidden when we show hidden files.
  filter.setHiddenFilesVisible(true);
  hidden = entries.filter(entry => !filter.filter(entry));
  assertEquals(0, hidden.length);
}

/**
 * Check the recent entries which doesn't match the query or whose volume is
 * disallowed will be filtered out.
 */
export async function testRecentScannerFilter() {
  // Mock volume manager
  const volumeManager = /** @type {!VolumeManager} */ ({
    getVolumeInfo: (entry) => {
      if (entry.name === '1.txt') {
        return null;
      }
      return /** @type {!VolumeInfo} */ ({
        volumeId: 'fakeId',
      });
    },
  });
  const scanner = new RecentContentScanner('txt', volumeManager);
  /** @type {!Array<!FileEntry>} */
  let entriesCallbackResult = [];
  function entriesCallback(entries) {
    entriesCallbackResult = entries;
  }
  function otherCallback() {}
  await scanner.scan(entriesCallback, otherCallback, otherCallback);
  // 1.txt: volume is not allowed; 3.png: query is not matched.
  assertEquals(1, entriesCallbackResult.length);
  assertEquals('2.txt', entriesCallbackResult[0].name);
}


text:
layout: default
class: blog
title: Blog tags
---

{% for category in site.categories %}

{{ category[0] }}

{% endfor %}


text:
@class CRHTTPServerConfiguration;

@interface CRHTTPServer : CRServer

@property (nonatomic) BOOL isSecure;

@property (nonatomic, strong, nullable) NSString *identityPath;
@property (nonatomic, strong, nullable) NSString *password;
@property (nonatomic, strong, nullable) NSString *certificatePath;
@property (nonatomic, strong, nullable) NSString *privateKeyPath;

@end


text:
#include <aws/mediaconvert/model/JobTemplate.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace MediaConvert
{
namespace Model
{

JobTemplate::JobTemplate() :
    m_arnHasBeenSet(false),
    m_categoryHasBeenSet(false),
    m_createdAtHasBeenSet(false),
    m_descriptionHasBeenSet(false),
    m_lastUpdatedHasBeenSet(false),
    m_nameHasBeenSet(false),
    m_queueHasBeenSet(false),
    m_settingsHasBeenSet(false),
    m_type(Type::NOT_SET),
    m_typeHasBeenSet(false)
{
}

JobTemplate::JobTemplate(JsonView jsonValue) :
    m_arnHasBeenSet(false),
    m_categoryHasBeenSet(false),
    m_createdAtHasBeenSet(false),
    m_descriptionHasBeenSet(false),
    m_lastUpdatedHasBeenSet(false),
    m_nameHasBeenSet(false),
    m_queueHasBeenSet(false),
    m_settingsHasBeenSet(false),
    m_type(Type::NOT_SET),
    m_typeHasBeenSet(false)
{
  *this = jsonValue;
}

JobTemplate& JobTemplate::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("arn"))
  {
    m_arn = jsonValue.GetString("arn");

    m_arnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("category"))
  {
    m_category = jsonValue.GetString("category");

    m_categoryHasBeenSet = true;
  }

  if(jsonValue.ValueExists("createdAt"))
  {
    m_createdAt = jsonValue.GetDouble("createdAt");

    m_createdAtHasBeenSet = true;
  }

  if(jsonValue.ValueExists("description"))
  {
    m_description = jsonValue.GetString("description");

    m_descriptionHasBeenSet = true;
  }

  if(jsonValue.ValueExists("lastUpdated"))
  {
    m_lastUpdated = jsonValue.GetDouble("lastUpdated");

    m_lastUpdatedHasBeenSet = true;
  }

  if(jsonValue.ValueExists("name"))
  {
    m_name = jsonValue.GetString("name");

    m_nameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("queue"))
  {
    m_queue = jsonValue.GetString("queue");

    m_queueHasBeenSet = true;
  }

  if(jsonValue.ValueExists("settings"))
  {
    m_settings = jsonValue.GetObject("settings");

    m_settingsHasBeenSet = true;
  }

  if(jsonValue.ValueExists("type"))
  {
    m_type = TypeMapper::GetTypeForName(jsonValue.GetString("type"));

    m_typeHasBeenSet = true;
  }

  return *this;
}

JsonValue JobTemplate::Jsonize() const
{
  JsonValue payload;

  if(m_arnHasBeenSet)
  {
   payload.WithString("arn", m_arn);

  }

  if(m_categoryHasBeenSet)
  {
   payload.WithString("category", m_category);

  }

  if(m_createdAtHasBeenSet)
  {
   payload.WithDouble("createdAt", m_createdAt.SecondsWithMSPrecision());
  }

  if(m_descriptionHasBeenSet)
  {
   payload.WithString("description", m_description);

  }

  if(m_lastUpdatedHasBeenSet)
  {
   payload.WithDouble("lastUpdated", m_lastUpdated.SecondsWithMSPrecision());
  }

  if(m_nameHasBeenSet)
  {
   payload.WithString("name", m_name);

  }

  if(m_queueHasBeenSet)
  {
   payload.WithString("queue", m_queue);

  }

  if(m_settingsHasBeenSet)
  {
   payload.WithObject("settings", m_settings.Jsonize());

  }

  if(m_typeHasBeenSet)
  {
   payload.WithString("type", TypeMapper::GetNameForType(m_type));
  }

  return payload;
}

} // namespace Model
} // namespace MediaConvert
} // namespace Aws


text:
package com.google.idea.blaze.java.run;

import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.base.model.primitives.Kind;
import com.google.idea.blaze.base.run.BlazeCommandRunConfiguration;
import com.google.idea.blaze.base.run.confighandler.BlazeCommandRunConfigurationHandler;
import com.google.idea.blaze.base.run.confighandler.BlazeCommandRunConfigurationHandlerProvider;
import com.google.idea.blaze.java.sync.source.JavaLikeLanguage;
import javax.annotation.Nullable;

/** Java-specific handler provider for {@link BlazeCommandRunConfiguration}s. */
public class BlazeJavaRunConfigurationHandlerProvider
    implements BlazeCommandRunConfigurationHandlerProvider {

  private static final ImmutableSet<Kind> RELEVANT_RULE_KINDS =
      JavaLikeLanguage.getAllDebuggableKinds();

  static boolean supportsKind(@Nullable Kind kind) {
    return RELEVANT_RULE_KINDS.contains(kind);
  }

  @Override
  public boolean canHandleKind(TargetState state, @Nullable Kind kind) {
    return supportsKind(kind);
  }

  @Override
  public BlazeCommandRunConfigurationHandler createHandler(BlazeCommandRunConfiguration config) {
    return new BlazeJavaRunConfigurationHandler(config);
  }

  @Override
  public String getId() {
    return "BlazeJavaRunConfigurationHandlerProvider";
  }
}


text:
namespace Capture3
{

	ThumbnailsPanel::ThumbnailsPanel() :
		PanelComponent(),
		tabs(),
		thumbnails()
	{
		// Add items
		tabs.addTab(&thumbnails);
		addTabs(&tabs);
	}

	ThumbnailsPanel::~ThumbnailsPanel()
	{
		thumbnails.deleteLater();
		tabs.deleteLater();
	}

	ThumbnailsComponent &ThumbnailsPanel::getThumbnails()
	{
		return thumbnails;
	}
}


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CertificateRepository")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CertificateRepository")]
[assembly: AssemblyCopyright("Copyright ©  2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6c5f5064-374b-4eb1-bf5c-7ca5bb215cd5")]

// Setting InternalVisibleTo Test Assembly so as to allow testing of Validators.Core
[assembly: InternalsVisibleTo("CertificateRepository.UnitTests")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


text:
(function () {
  'use strict';

  angular
    .module('pathfinder.services')
    .factory('AbilityScorePoint', AbilityScorePoint);

  AbilityScorePoint.$inject = ['$resource'];

  function AbilityScorePoint($resource) {
    var AbilityPoint = $resource('api/pathfinder/abilityScorePoint/:abilityScorePointId', {
      abilityPointId: '@_id'
    }, {
      update: {
        method: 'PUT'
      }
    });

    return AbilityPoint;
  }
}());


text:
FROM sherl0cks/docker-eap:latest

####### MAINTAINER ############
MAINTAINER "Justin Holmes" "jholmes@redhat.com"

####### INSTALL PACKAGES #######
USER root
RUN yum install -y git && yum clean all
USER jboss

####### BPMS ARTIFACT #######
ENV ARTIFACT_REPOSITORY http://files.justinholmes.co
ENV BPMS_VERSION 6.4.0.GA

ADD jboss-bpmsuite-$BPMS_VERSION-deployable-eap6.x.zip /opt/jboss/

RUN cd /opt/jboss/ \
# && curl -O $ARTIFACT_REPOSITORY/jboss-bpmsuite-$BPMS_VERSION-deployable-eap6.x.zip \
 && unzip -q -o jboss-bpmsuite-$BPMS_VERSION-deployable-eap6.x.zip -d .  \
 &&	rm jboss-bpmsuite-$BPMS_VERSION-deployable-eap6.x.zip

####### EAP CONFIG #######
RUN curl https://raw.githubusercontent.com/sherl0cks/ansible-openstack-etc/53e733739dece3223ecaa6554dea62e5b68d1609/ansible/files/application-roles.properties > $JBOSS_HOME/standalone/configuration/application-roles.properties \
 &&	curl https://raw.githubusercontent.com/sherl0cks/ansible-openstack-etc/cb56b5eb0b23520960671d818ab94af82f0dece7/ansible/files/application-users.properties > $JBOSS_HOME/standalone/configuration/application-users.properties \
 &&	curl https://raw.githubusercontent.com/sherl0cks/ansible-openstack-etc/master/ansible/files/mgmt-groups.properties > $JBOSS_HOME/standalone/configuration/mgmt-groups.properties \
 &&	curl https://raw.githubusercontent.com/sherl0cks/ansible-openstack-etc/master/ansible/files/mgmt-users.properties > $JBOSS_HOME/standalone/configuration/mgmt-users.properties

####### MAVEN CONFIG #######
RUN mkdir -p /opt/jboss/.m2 \
 && curl https://raw.githubusercontent.com/sherl0cks/ansible-openstack-etc/852ff4a423b147eab7d2025e51e0294214676c20/ansible/files/settings.xml > /opt/jboss/.m2/settings.xml

####### SSH GITHOOK CONFIG #######
RUN mkdir -p /opt/jboss/.ssh \
 && chmod 755 /opt/jboss/.ssh

####### FILE PERMISSIONS #######
RUN mkdir /opt/jboss/.niogit \
 && chmod -R a+rw /opt/jboss/.niogit \
 && mkdir /opt/jboss/repositories \
 && chmod -R a+rw /opt/jboss/repositories \
 && mkdir /opt/jboss/.index \
 && chmod -R a+rw /opt/jboss/.index

####### JAVA_OPTS #######
ENV JAVA_OPTS -Dkie.maven.settings.custom=/opt/jboss/.m2/settings.xml \
	-Djboss.bind.address=0.0.0.0 \
	-Djboss.bind.address.management=0.0.0.0 \
    -Dorg.uberfire.nio.git.daemon.host=0.0.0.0 \
	-Dorg.uberfire.nio.git.ssh.host=0.0.0.0 \
	-Djava.security.egd=file:/dev/./urandom \
	-Dorg.uberfire.nio.git.ssh.cert.dir=/opt/jboss/.ssh

####### PORTS #######
EXPOSE 8080 9990 9418 8001

COPY startJBossWithOptions.sh /opt/jboss/jboss-eap-6.4/bin/

CMD ["/opt/jboss/jboss-eap-6.4/bin/startJBossWithOptions.sh"]


text:
package sttp.client3.httpclient.cats

import cats.effect.kernel.{Async, Resource, Sync}
import cats.effect.std.{Dispatcher, Queue}
import cats.implicits.toFunctorOps
import sttp.capabilities.WebSockets
import sttp.client3.HttpClientBackend.EncodingHandler
import sttp.client3.impl.cats.CatsMonadAsyncError
import sttp.client3.internal.httpclient._
import sttp.client3.internal.ws.SimpleQueue
import sttp.client3.internal.{NoStreams, emptyInputStream}
import sttp.client3.testing.SttpBackendStub
import sttp.client3.{FollowRedirectsBackend, HttpClientAsyncBackend, HttpClientBackend, SttpBackend, SttpBackendOptions}
import sttp.monad.MonadError
import sttp.ws.{WebSocket, WebSocketFrame}

import java.io.{InputStream, UnsupportedEncodingException}
import java.net.http.HttpRequest.BodyPublisher
import java.net.http.{HttpClient, HttpRequest}
import java.nio.ByteBuffer
import java.util
import java.util.concurrent.Flow.Publisher
import java.util.zip.{GZIPInputStream, InflaterInputStream}

class HttpClientCatsBackend[F[_]: Async] private (
    client: HttpClient,
    closeClient: Boolean,
    customizeRequest: HttpRequest => HttpRequest,
    customEncodingHandler: EncodingHandler[InputStream],
    dispatcher: Dispatcher[F]
) extends HttpClientAsyncBackend[
      F,
      Nothing,
      WebSockets,
      InputStream
    ](
      client,
      new CatsMonadAsyncError[F],
      closeClient,
      customizeRequest,
      customEncodingHandler
    ) {
  override protected def createSimpleQueue[T]: F[SimpleQueue[F, T]] =
    Queue.unbounded[F, T].map(new CatsSimpleQueue(_, None, dispatcher))

  override protected def createSequencer: F[Sequencer[F]] = CatsSequencer.create

  override protected val bodyToHttpClient: BodyToHttpClient[F, Nothing] = new BodyToHttpClient[F, Nothing] {
    override val streams: NoStreams = NoStreams
    override implicit val monad: MonadError[F] = responseMonad

    override def streamToPublisher(stream: Nothing): F[BodyPublisher] = stream // nothing is everything
  }

  override protected def bodyFromHttpClient: BodyFromHttpClient[F, Nothing, InputStream] =
    new InputStreamBodyFromHttpClient[F, Nothing] {
      override def inputStreamToStream(is: InputStream): F[(streams.BinaryStream, () => F[Unit])] =
        monad.error(new IllegalStateException("Streaming is not supported"))

      override val streams: NoStreams = NoStreams

      override implicit def monad: MonadError[F] = responseMonad

      override def compileWebSocketPipe(
          ws: WebSocket[F],
          pipe: streams.Pipe[WebSocketFrame.Data[_], WebSocketFrame]
      ): F[Unit] = pipe
    }

  override protected def standardEncoding: (InputStream, String) => InputStream = {
    case (body, "gzip")    => new GZIPInputStream(body)
    case (body, "deflate") => new InflaterInputStream(body)
    case (_, ce)           => throw new UnsupportedEncodingException(s"Unsupported encoding: $ce")
  }

  override protected def emptyBody(): InputStream = emptyInputStream()

  override protected def publisherToBody(p: Publisher[util.List[ByteBuffer]]): InputStream = {
    val subscriber = new InputStreamSubscriber
    p.subscribe(subscriber)
    subscriber.inputStream
  }

  override val streams: NoStreams = NoStreams
}

object HttpClientCatsBackend {

  private def apply[F[_]: Async](
      client: HttpClient,
      closeClient: Boolean,
      customizeRequest: HttpRequest => HttpRequest,
      customEncodingHandler: EncodingHandler[InputStream],
      dispatcher: Dispatcher[F]
  ): SttpBackend[F, WebSockets] =
    new FollowRedirectsBackend(
      new HttpClientCatsBackend(client, closeClient, customizeRequest, customEncodingHandler, dispatcher)
    )

  def apply[F[_]: Async](
      dispatcher: Dispatcher[F],
      options: SttpBackendOptions = SttpBackendOptions.Default,
      customizeRequest: HttpRequest => HttpRequest = identity,
      customEncodingHandler: EncodingHandler[InputStream] = PartialFunction.empty
  ): F[SttpBackend[F, WebSockets]] =
    Sync[F].delay(
      HttpClientCatsBackend(
        HttpClientBackend.defaultClient(options),
        closeClient = true,
        customizeRequest,
        customEncodingHandler,
        dispatcher
      )
    )

  def resource[F[_]: Async](
      options: SttpBackendOptions = SttpBackendOptions.Default,
      customizeRequest: HttpRequest => HttpRequest = identity,
      customEncodingHandler: EncodingHandler[InputStream] = PartialFunction.empty
  ): Resource[F, SttpBackend[F, WebSockets]] =
    Dispatcher[F].flatMap(dispatcher =>
      Resource.make(apply(dispatcher, options, customizeRequest, customEncodingHandler))(_.close())
    )

  def usingClient[F[_]: Async](
      client: HttpClient,
      dispatcher: Dispatcher[F],
      customizeRequest: HttpRequest => HttpRequest = identity,
      customEncodingHandler: EncodingHandler[InputStream] = PartialFunction.empty
  ): SttpBackend[F, WebSockets] =
    HttpClientCatsBackend(client, closeClient = false, customizeRequest, customEncodingHandler, dispatcher)

  /** Create a stub backend for testing, which uses the [[F]] response wrapper.
    *
    * See [[SttpBackendStub]] for details on how to configure stub responses.
    */
  def stub[F[_]: Async]: SttpBackendStub[F, NoStreams] = SttpBackendStub(new CatsMonadAsyncError[F])
}


text:
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "file:///C:/Program%20Files%20(x86)/Publican/DocBook_DTD/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>
<authorgroup>
	<author>
		<firstname>Apache CloudStack Project</firstname>
		<surname></surname>
		<affiliation>
			<orgname></orgname>
			<orgdiv></orgdiv>
		</affiliation>
		<email>cloudstack-docs@incubator.apache.org</email>
	</author>
	<author>
		<firstname>Jessica</firstname>
		<surname>Tomechak</surname>
		<affiliation>
			<orgname>Citrix</orgname>
			<orgdiv>Cloud Platform Group</orgdiv>
		</affiliation>
		<email>jessica.tomechak@cirix.com</email>
	</author>
	<author>
		<firstname>Radhika</firstname>
		<surname>PC</surname>
		<affiliation>
			<orgname>Citrix</orgname>
			<orgdiv>Cloud Platform Group</orgdiv>
		</affiliation>
		<email>radhika.puthiyetath@citrix.com</email>
	</author>
</authorgroup>


text:
use crate::memory::Memory;
use cranelift_codegen::binemit::{Addend, CodeOffset, NullTrapSink, Reloc, RelocSink};
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::{self, ir, settings};
use cranelift_module::{
    Backend, DataContext, DataDescription, Init, Linkage, ModuleNamespace, ModuleResult,
};
use cranelift_native;
use libc;
use std::collections::HashMap;
use std::ffi::CString;
use std::io::Write;
use std::ptr;
use target_lexicon::PointerWidth;
#[cfg(windows)]
use winapi;

/// A builder for `SimpleJITBackend`.
pub struct SimpleJITBuilder {
    isa: Box<TargetIsa>,
    symbols: HashMap<String, *const u8>,
}

impl SimpleJITBuilder {
    /// Create a new `SimpleJITBuilder`.
    pub fn new() -> Self {
        let flag_builder = settings::builder();
        let isa_builder = cranelift_native::builder().unwrap_or_else(|msg| {
            panic!("host machine is not supported: {}", msg);
        });
        let isa = isa_builder.finish(settings::Flags::new(flag_builder));
        Self::with_isa(isa)
    }

    /// Create a new `SimpleJITBuilder` with an arbitrary target. This is mainly
    /// useful for testing.
    ///
    /// SimpleJIT requires a `TargetIsa` configured for non-PIC.
    ///
    /// To create a `SimpleJITBuilder` for native use, use the `new` constructor
    /// instead.
    pub fn with_isa(isa: Box<TargetIsa>) -> Self {
        debug_assert!(!isa.flags().is_pic(), "SimpleJIT requires non-PIC code");
        let symbols = HashMap::new();
        Self { isa, symbols }
    }

    /// Define a symbol in the internal symbol table.
    ///
    /// The JIT will use the symbol table to resolve names that are declared,
    /// but not defined, in the module being compiled.  A common example is
    /// external functions.  With this method, functions and data can be exposed
    /// to the code being compiled which are defined by the host.
    ///
    /// If a symbol is defined more than once, the most recent definition will
    /// be retained.
    ///
    /// If the JIT fails to find a symbol in its internal table, it will fall
    /// back to a platform-specific search (this typically involves searching
    /// the current process for public symbols, followed by searching the
    /// platform's C runtime).
    pub fn symbol<K>(&mut self, name: K, ptr: *const u8) -> &Self
    where
        K: Into<String>,
    {
        self.symbols.insert(name.into(), ptr);
        self
    }

    /// Define multiple symbols in the internal symbol table.
    ///
    /// Using this is equivalent to calling `symbol` on each element.
    pub fn symbols<It, K>(&mut self, symbols: It) -> &Self
    where
        It: IntoIterator<Item = (K, *const u8)>,
        K: Into<String>,
    {
        for (name, ptr) in symbols {
            self.symbols.insert(name.into(), ptr);
        }
        self
    }
}

/// A `SimpleJITBackend` implements `Backend` and emits code and data into memory where it can be
/// directly called and accessed.
///
/// See the `SimpleJITBuilder` for a convenient way to construct `SimpleJITBackend` instances.
pub struct SimpleJITBackend {
    isa: Box<TargetIsa>,
    symbols: HashMap<String, *const u8>,
    code_memory: Memory,
    readonly_memory: Memory,
    writable_memory: Memory,
}

/// A record of a relocation to perform.
struct RelocRecord {
    offset: CodeOffset,
    reloc: Reloc,
    name: ir::ExternalName,
    addend: Addend,
}

pub struct SimpleJITCompiledFunction {
    code: *mut u8,
    size: usize,
    relocs: Vec<RelocRecord>,
}

pub struct SimpleJITCompiledData {
    storage: *mut u8,
    size: usize,
    relocs: Vec<RelocRecord>,
}

impl SimpleJITBackend {
    fn lookup_symbol(&self, name: &str) -> *const u8 {
        match self.symbols.get(name) {
            Some(&ptr) => ptr,
            None => lookup_with_dlsym(name),
        }
    }
}

impl<'simple_jit_backend> Backend for SimpleJITBackend {
    type Builder = SimpleJITBuilder;

    /// SimpleJIT compiled function and data objects may have outstanding
    /// relocations that need to be performed before the memory can be used.
    /// These relocations are performed within `finalize_function` and
    /// `finalize_data`.
    type CompiledFunction = SimpleJITCompiledFunction;
    type CompiledData = SimpleJITCompiledData;

    /// SimpleJIT emits code and data into memory, and provides raw pointers
    /// to them.
    type FinalizedFunction = *const u8;
    type FinalizedData = (*mut u8, usize);

    /// SimpleJIT emits code and data into memory as it processes them, so it
    /// doesn't need to provide anything after the `Module` is complete.
    type Product = ();

    /// Create a new `SimpleJITBackend`.
    fn new(builder: SimpleJITBuilder) -> Self {
        Self {
            isa: builder.isa,
            symbols: builder.symbols,
            code_memory: Memory::new(),
            readonly_memory: Memory::new(),
            writable_memory: Memory::new(),
        }
    }

    fn isa(&self) -> &TargetIsa {
        &*self.isa
    }

    fn declare_function(&mut self, _name: &str, _linkage: Linkage) {
        // Nothing to do.
    }

    fn declare_data(&mut self, _name: &str, _linkage: Linkage, _writable: bool) {
        // Nothing to do.
    }

    fn define_function(
        &mut self,
        name: &str,
        ctx: &cranelift_codegen::Context,
        _namespace: &ModuleNamespace<Self>,
        code_size: u32,
    ) -> ModuleResult<Self::CompiledFunction> {
        let size = code_size as usize;
        let ptr = self
            .code_memory
            .allocate(size)
            .expect("TODO: handle OOM etc.");

        if cfg!(target_os = "linux") && ::std::env::var_os("PERF_BUILDID_DIR").is_some() {
            let mut map_file = ::std::fs::OpenOptions::new()
                .create(true)
                .append(true)
                .open(format!("/tmp/perf-{}.map", ::std::process::id()))
                .unwrap();

            let _ = writeln!(map_file, "{:x} {:x} {}", ptr as usize, code_size, name);
        }

        let mut reloc_sink = SimpleJITRelocSink::new();
        // Ignore traps for now. For now, frontends should just avoid generating code
        // that traps.
        let mut trap_sink = NullTrapSink {};
        unsafe { ctx.emit_to_memory(&*self.isa, ptr, &mut reloc_sink, &mut trap_sink) };

        Ok(Self::CompiledFunction {
            code: ptr,
            size,
            relocs: reloc_sink.relocs,
        })
    }

    fn define_data(
        &mut self,
        _name: &str,
        writable: bool,
        data: &DataContext,
        _namespace: &ModuleNamespace<Self>,
    ) -> ModuleResult<Self::CompiledData> {
        let &DataDescription {
            ref init,
            ref function_decls,
            ref data_decls,
            ref function_relocs,
            ref data_relocs,
        } = data.description();

        let size = init.size();
        let storage = if writable {
            self.writable_memory
                .allocate(size)
                .expect("TODO: handle OOM etc.")
        } else {
            self.readonly_memory
                .allocate(size)
                .expect("TODO: handle OOM etc.")
        };

        match *init {
            Init::Uninitialized => {
                panic!("data is not initialized yet");
            }
            Init::Zeros { .. } => {
                unsafe { ptr::write_bytes(storage, 0, size) };
            }
            Init::Bytes { ref contents } => {
                let src = contents.as_ptr();
                unsafe { ptr::copy_nonoverlapping(src, storage, size) };
            }
        }

        let reloc = match self.isa.triple().pointer_width().unwrap() {
            PointerWidth::U16 => panic!(),
            PointerWidth::U32 => Reloc::Abs4,
            PointerWidth::U64 => Reloc::Abs8,
        };
        let mut relocs = Vec::new();
        for &(offset, id) in function_relocs {
            relocs.push(RelocRecord {
                reloc,
                offset,
                name: function_decls[id].clone(),
                addend: 0,
            });
        }
        for &(offset, id, addend) in data_relocs {
            relocs.push(RelocRecord {
                reloc,
                offset,
                name: data_decls[id].clone(),
                addend,
            });
        }

        Ok(Self::CompiledData {
            storage,
            size,
            relocs,
        })
    }

    fn write_data_funcaddr(
        &mut self,
        _data: &mut Self::CompiledData,
        _offset: usize,
        _what: ir::FuncRef,
    ) {
        unimplemented!();
    }

    fn write_data_dataaddr(
        &mut self,
        _data: &mut Self::CompiledData,
        _offset: usize,
        _what: ir::GlobalValue,
        _usize: Addend,
    ) {
        unimplemented!();
    }

    fn finalize_function(
        &mut self,
        func: &Self::CompiledFunction,
        namespace: &ModuleNamespace<Self>,
    ) -> Self::FinalizedFunction {
        use std::ptr::write_unaligned;

        for &RelocRecord {
            reloc,
            offset,
            ref name,
            addend,
        } in &func.relocs
        {
            let ptr = func.code;
            debug_assert!((offset as usize) < func.size);
            let at = unsafe { ptr.offset(offset as isize) };
            let base = if namespace.is_function(name) {
                let (def, name_str, _signature) = namespace.get_function_definition(&name);
                match def {
                    Some(compiled) => compiled.code,
                    None => self.lookup_symbol(name_str),
                }
            } else {
                let (def, name_str, _writable) = namespace.get_data_definition(&name);
                match def {
                    Some(compiled) => compiled.storage,
                    None => self.lookup_symbol(name_str),
                }
            };
            // TODO: Handle overflow.
            let what = unsafe { base.offset(addend as isize) };
            match reloc {
                Reloc::Abs4 => {
                    // TODO: Handle overflow.
                    #[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
                    unsafe {
                        write_unaligned(at as *mut u32, what as u32)
                    };
                }
                Reloc::Abs8 => {
                    #[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
                    unsafe {
                        write_unaligned(at as *mut u64, what as u64)
                    };
                }
                Reloc::X86PCRel4 | Reloc::X86CallPCRel4 => {
                    // TODO: Handle overflow.
                    let pcrel = ((what as isize) - (at as isize)) as i32;
                    #[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
                    unsafe {
                        write_unaligned(at as *mut i32, pcrel)
                    };
                }
                Reloc::X86GOTPCRel4 | Reloc::X86CallPLTRel4 => panic!("unexpected PIC relocation"),
                _ => unimplemented!(),
            }
        }
        func.code
    }

    fn get_finalized_function(&self, func: &Self::CompiledFunction) -> Self::FinalizedFunction {
        func.code
    }

    fn finalize_data(
        &mut self,
        data: &Self::CompiledData,
        namespace: &ModuleNamespace<Self>,
    ) -> Self::FinalizedData {
        use std::ptr::write_unaligned;

        for &RelocRecord {
            reloc,
            offset,
            ref name,
            addend,
        } in &data.relocs
        {
            let ptr = data.storage;
            debug_assert!((offset as usize) < data.size);
            let at = unsafe { ptr.offset(offset as isize) };
            let base = if namespace.is_function(name) {
                let (def, name_str, _signature) = namespace.get_function_definition(&name);
                match def {
                    Some(compiled) => compiled.code,
                    None => self.lookup_symbol(name_str),
                }
            } else {
                let (def, name_str, _writable) = namespace.get_data_definition(&name);
                match def {
                    Some(compiled) => compiled.storage,
                    None => self.lookup_symbol(name_str),
                }
            };
            // TODO: Handle overflow.
            let what = unsafe { base.offset(addend as isize) };
            match reloc {
                Reloc::Abs4 => {
                    // TODO: Handle overflow.
                    #[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
                    unsafe {
                        write_unaligned(at as *mut u32, what as u32)
                    };
                }
                Reloc::Abs8 => {
                    #[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
                    unsafe {
                        write_unaligned(at as *mut u64, what as u64)
                    };
                }
                Reloc::X86PCRel4
                | Reloc::X86CallPCRel4
                | Reloc::X86GOTPCRel4
                | Reloc::X86CallPLTRel4 => panic!("unexpected text relocation in data"),
                _ => unimplemented!(),
            }
        }
        (data.storage, data.size)
    }

    fn get_finalized_data(&self, data: &Self::CompiledData) -> Self::FinalizedData {
        (data.storage, data.size)
    }

    fn publish(&mut self) {
        // Now that we're done patching, prepare the memory for execution!
        self.readonly_memory.set_readonly();
        self.code_memory.set_readable_and_executable();
    }

    /// SimpleJIT emits code and data into memory as it processes them, so it
    /// doesn't need to provide anything after the `Module` is complete.
    fn finish(self) {}
}

#[cfg(not(windows))]
fn lookup_with_dlsym(name: &str) -> *const u8 {
    let c_str = CString::new(name).unwrap();
    let c_str_ptr = c_str.as_ptr();
    let sym = unsafe { libc::dlsym(libc::RTLD_DEFAULT, c_str_ptr) };
    if sym.is_null() {
        panic!("can't resolve symbol {}", name);
    }
    sym as *const u8
}

#[cfg(windows)]
fn lookup_with_dlsym(name: &str) -> *const u8 {
    const MSVCRT_DLL: &[u8] = b"msvcrt.dll\0";

    let c_str = CString::new(name).unwrap();
    let c_str_ptr = c_str.as_ptr();

    unsafe {
        let handles = [
            // try to find the searched symbol in the currently running executable
            ptr::null_mut(),
            // try to find the searched symbol in local c runtime
            winapi::um::libloaderapi::GetModuleHandleA(MSVCRT_DLL.as_ptr() as *const i8),
        ];

        for handle in &handles {
            let addr = winapi::um::libloaderapi::GetProcAddress(*handle, c_str_ptr);
            if addr.is_null() {
                continue;
            }
            return addr as *const u8;
        }

        let msg = if handles[1].is_null() {
            "(msvcrt not loaded)"
        } else {
            ""
        };
        panic!("cannot resolve address of symbol {} {}", name, msg);
    }
}

struct SimpleJITRelocSink {
    pub relocs: Vec<RelocRecord>,
}

impl SimpleJITRelocSink {
    pub fn new() -> Self {
        Self { relocs: Vec::new() }
    }
}

impl RelocSink for SimpleJITRelocSink {
    fn reloc_ebb(&mut self, _offset: CodeOffset, _reloc: Reloc, _ebb_offset: CodeOffset) {
        unimplemented!();
    }

    fn reloc_external(
        &mut self,
        offset: CodeOffset,
        reloc: Reloc,
        name: &ir::ExternalName,
        addend: Addend,
    ) {
        self.relocs.push(RelocRecord {
            offset,
            reloc,
            name: name.clone(),
            addend,
        });
    }

    fn reloc_jt(&mut self, _offset: CodeOffset, _reloc: Reloc, _jt: ir::JumpTable) {
        unimplemented!();
    }
}


text:
'''
In the classic problem of the Towers of Hanoi, you have 3 rods and N disks of different
sizes which can slide onto any tower. The puzzle starts with disks sorted in ascending
order of size from top to bottom (e.g., each disk sits on top of an even larger one).
You have the following constraints:
(A) Only one disk can be moved at a time.
(B) A disk is slid off the top of one rod onto the next rod.
(C) A disk can only be placed on top of a larger disk.
Write a program to move the disks from the first rod to the last using Stacks.
'''

# In PROGRESS
pass


text:
<?xml version="1.0" encoding="UTF-8"?>
<feature
      id="cucumber.eclipse.feature"
      label="Cucumber Eclipse Feature"
      version="0.0.11.qualifier">

   <description>
      Eclipse plugin for Cucumber
   </description>

   <copyright>
      Copyright (c) 2012,2013 Aslak Hellesøy and contributors
   </copyright>

   <license url="">
      The MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   </license>

   <plugin
         id="cucumber.eclipse.editor"
         download-size="0"
         install-size="0"
         version="0.0.0"
         unpack="false"/>

   <plugin
         id="cucumber.eclipse.steps.integration"
         download-size="0"
         install-size="0"
         version="0.0.0"
         unpack="false"/>

   <plugin
         id="cucumber.eclipse.steps.jdt"
         download-size="0"
         install-size="0"
         version="0.0.0"
         unpack="false"/>

</feature>


text:
package org.jenkinsci.plugins.phpwebserver.buildwrappers;

import hudson.Extension;
import hudson.Launcher;
import hudson.model.Build;
import hudson.model.BuildListener;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.tasks.BuildWrapper;
import hudson.tasks.BuildWrapperDescriptor;
import hudson.util.FormValidation;

import java.io.File;
import java.io.IOException;

import org.jenkinsci.plugins.phpwebserver.beans.PhpWebserver;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;

/**
 * Build wrapper to run a PHP built-in web server.
 *
 * @author Fengtan https://github.com/fengtan/
 *
 */
public class PhpWebserverBuildWrapper extends BuildWrapper {

	private final int port;
	private final String host;
	private final String root;

	@DataBoundConstructor
	public PhpWebserverBuildWrapper(int port, String host, String root) {
		this.port = port;
		this.host = host;
		this.root = root;
	}

	public int getPort() {
		return port;
	}

	public String getHost() {
		return host;
	}

	public String getRoot() {
		return root;
	}

	@Override
	public Environment setUp(AbstractBuild build, final Launcher launcher, BuildListener listener) {
		File rootDir = new File(build.getWorkspace().getRemote(), root);
		try {
			listener.getLogger().println("[PHP WEB SERVER] Starting server " + host+":"+port+" with document root "+rootDir.getAbsolutePath()+"...");
			final PhpWebserver server = new PhpWebserver(port, host, rootDir);
			return new Environment() {
				@Override
				public boolean tearDown(AbstractBuild build, BuildListener listener) throws IOException, InterruptedException {
					listener.getLogger().println("[PHP WEB SERVER] Stopping server...");
					server.stop();
					return true;
				}
			};
		} catch(IllegalStateException e) {
			listener.getLogger().println("[PHP WEB SERVER] Could not start server: "+e.getMessage());
			return null;
		} catch (IOException e) {
			listener.getLogger().println("[PHP WEB SERVER] Could not start server: "+e.getMessage());
			return null;
		}
	}

    @Override
    public Environment setUp(Build build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
        return setUp(build, launcher, listener);
    }

    @Extension
    public static class DescriptorImpl extends BuildWrapperDescriptor {

        public DescriptorImpl() {
            super(PhpWebserverBuildWrapper.class);
        }

        @Override
        public boolean isApplicable(AbstractProject<?, ?> item) {
            return true;
        }

        @Override
        public String getDisplayName() {
            return "Run a PHP built-in web server";
        }

        /**
         * Field 'port' should not be empty.
         * Field 'port' should be a valid port.
         * Field 'port' should not be a well-known port.
         */
        public FormValidation doCheckPort(@AncestorInPath AbstractProject project, @QueryParameter String value) throws IOException {
            if (0 == value.length()) {
            	return FormValidation.error("Please set a port number");
            }
            try {
            	int port = Integer.parseInt(value);
            	if (port < 1024 || port > 65535) {
            		return FormValidation.error("Should be 1024 <= port <= 65535");
            	}
            }
            catch (NumberFormatException e) {
            	return FormValidation.error("Should be a numerical value");
			}
        	return FormValidation.ok();
        }

        /**
         * Field 'host' should not be empty.
         */
        public FormValidation doCheckHost(@AncestorInPath AbstractProject project, @QueryParameter String value) throws IOException {
            if (0 == value.length()) {
            	return FormValidation.error("Please set a host");
            }
        	return FormValidation.ok();
        }

        /**
         * Field 'root' should not be empty.
         */
        public FormValidation doCheckRoot(@AncestorInPath AbstractProject project, @QueryParameter String value) throws IOException {
            if (0 == value.length()) {
            	return FormValidation.warning("Workspace root will be used as document root");
            }
        	return FormValidation.ok();
        }

    }
}


text:
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler

__all__ = [
    'Handler'
]

class HandlerStream(object):

    __slots__ = ('handler', 'read', 'write')

    def __init__(self, handler):
        self.handler = handler

        socket = handler.socket
        rfile = handler.rfile

        if not rfile:
            rfile = socket.makefile('rb', -1)

        self.read = rfile.read
        self.write = socket.sendall

class Handler(WebSocketHandler):

    stream = None

    def run_application(self):
        self.stream = self.make_stream()
        super().run_application()

    def make_stream(self):
        return HandlerStream(self)


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package servlets;

import java.io.IOException;
import javax.servlet.AsyncContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import service.Handler;

/**
 *
 * @author Simon
 */
@WebServlet(name="Update", urlPatterns={"/update"}, asyncSupported = true)
public class Update extends HttpServlet {
    private static Handler handler = Handler.getHandler();
    @Override
    public void destroy() {
        handler.stop();
        handler = null;
    }

    /**
     * Processes requests for both HTTP GET and POST methods.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        // Can't process this now, pass it off to the handler
        AsyncContext ac = request.startAsync();
        handler.addJob(ac);
        System.out.println("Foreground servlet completing");
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP GET method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Handles the HTTP POST method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}


text:
package org.zstack.tool.doclet;

import java.util.Map;

/**
 */
public interface RestructuredTextWriter {
    void writeInventory(String outputPath, Map<String, InventoryDoc> docs);

    void writeApiMessage(String outputPath, Map<String, APIMessageDoc> docs);

    void writeApiEvent(String outputPath, Map<String, APIEventDoc> docs);
}