text:
<?php

/*
 * This file is part of Gush package.
 *
 * (c) Luis Cordova <cordoval@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Gush;

use Gush\Adapter\Adapter;
use Gush\Adapter\IssueTracker;
use Gush\Command as Cmd;
use Gush\Exception\UserException;
use Gush\Factory\AdapterFactory;
use Gush\Helper as Helpers;
use Gush\Helper\OutputAwareInterface;
use Gush\Subscriber\CommandEndSubscriber;
use Gush\Subscriber\CoreInitSubscriber;
use Gush\Subscriber\GitFolderSubscriber;
use Gush\Subscriber\GitRepoSubscriber;
use Gush\Subscriber\TableSubscriber;
use Gush\Subscriber\TemplateSubscriber;
use KevinGH\Amend\Command as UpdateCommand;
use KevinGH\Amend\Helper as UpdateHelper;
use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Component\Console\Input\InputAwareInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;

class Application extends BaseApplication
{
    const MANIFESTO_FILE_URL = 'http://gushphp.org/manifest.json';

    const GUSH_LOGO = <<<LOGO
   _____ _    _  _____ _    _
  / ____| |  | |/ ____| |  | |
 | |  __| |  | | (___ | |__| |
 | | |_ | |  | |\___ \|  __  |
 | |__| | |__| |____) | |  | |
  \_____|\____/|_____/|_|  |_|

LOGO;

    /**
     * @var Config The configuration file
     */
    protected $config;

    /**
     * @var null|Adapter
     */
    protected $adapter;

    /**
     * @var null|IssueTracker
     */
    protected $issueTracker;

    /**
     * @var EventDispatcher
     */
    protected $dispatcher;

    /**
     * @var AdapterFactory
     */
    protected $adapterFactory;

    /**
     * Constructor.
     *
     * @param AdapterFactory $adapterFactory
     * @param Config         $config
     * @param string         $version
     */
    public function __construct(AdapterFactory $adapterFactory, Config $config, $version = '@package_version@')
    {
        if ('@'.'package_version@' !== $version) {
            $version = ltrim($version, 'v');
        }

        parent::__construct('Gush', $version);

        $this->adapterFactory = $adapterFactory;
        $this->config = $config;

        // The parent dispatcher is private and has
        // no accessor, so we set it here to make it accessible.
        $this->dispatcher = new EventDispatcher();

        $this->registerSubscribers();
        $this->addCommands($this->getCommands());
    }

    protected function registerSubscribers()
    {
        $helperSet = $this->getHelperSet();

        $this->dispatcher->addSubscriber(new TableSubscriber());
        $this->dispatcher->addSubscriber(new GitFolderSubscriber($helperSet->get('git')));
        $this->dispatcher->addSubscriber(
            new GitRepoSubscriber(
                $this,
                $helperSet->get('git'),
                $helperSet->get('git_config'),
                $helperSet->get('gush_style')
            )
        );

        $this->dispatcher->addSubscriber(
            new CoreInitSubscriber(
                $this,
                $helperSet->get('git'),
                $helperSet->get('git_config'),
                $helperSet->get('gush_style')
            )
        );

        $this->dispatcher->addSubscriber(new TemplateSubscriber($helperSet->get('template')));
        $this->dispatcher->addSubscriber(
            new CommandEndSubscriber($helperSet->get('filesystem'), $helperSet->get('git'))
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function getDefaultHelperSet()
    {
        $helperSet = parent::getDefaultHelperSet();
        $helperSet->set(new Helpers\FilesystemHelper());
        $helperSet->set(new Helpers\TextHelper());
        $helperSet->set(new Helpers\GushQuestionHelper());
        $helperSet->set(new Helpers\StyleHelper($helperSet->get('gush_question')));
        $helperSet->set(new Helpers\TableHelper());
        $helperSet->set(new Helpers\ProcessHelper());
        $helperSet->set(new Helpers\EditorHelper());
        $helperSet->set(new Helpers\GitConfigHelper($helperSet->get('process'), $this));
        $helperSet->set(
            new Helpers\GitHelper(
                $helperSet->get('process'),
                $helperSet->get('git_config'),
                $helperSet->get('filesystem')
            )
        );
        $helperSet->set(new Helpers\TemplateHelper($helperSet->get('gush_style'), $this));
        $helperSet->set(new Helpers\MetaHelper($this->getSupportedMetaFiles()));
        $helperSet->set(new Helpers\DownloadHelper($helperSet->get('filesystem')));
        $helperSet->set(new Helpers\AutocompleteHelper());
        $helperSet->set(new UpdateHelper());

        return $helperSet;
    }

    /**
     * @return string
     */
    public function getHelp()
    {
        return self::GUSH_LOGO.PHP_EOL.parent::getHelp();
    }

    /**
     * Get the Repository adapter.
     *
     * @throws \RuntimeException
     *
     * @return Adapter
     */
    public function getAdapter()
    {
        if (null === $this->adapter) {
            throw new \RuntimeException(
                'No repo-adapter set, make sure the current command implements "Gush\Feature\GitRepoFeature".'
            );
        }

        return $this->adapter;
    }

    /**
     * Get the IssueTracker adapter.
     *
     * @throws \RuntimeException
     *
     * @return IssueTracker
     */
    public function getIssueTracker()
    {
        if (null === $this->issueTracker) {
            throw new \RuntimeException(
                'No issue-adapter set, make sure the current command implements "Gush\Feature\IssueTrackerRepoFeature".'
            );
        }

        return $this->issueTracker;
    }

    /**
     * Set the Repository Adapter.
     *
     * @param Adapter $adapter
     */
    public function setAdapter(Adapter $adapter)
    {
        $this->adapter = $adapter;
    }

    /**
     * Set the IssueTracker Adapter.
     *
     * @param IssueTracker $issueTracker
     */
    public function setIssueTracker(IssueTracker $issueTracker)
    {
        $this->issueTracker = $issueTracker;
    }

    /**
     * Get the application configuration.
     *
     * @return Config
     */
    public function getConfig()
    {
        return $this->config;
    }

    /**
     * @return EventDispatcher
     */
    public function getDispatcher()
    {
        return $this->dispatcher;
    }

    /**
     * @return AdapterFactory
     */
    public function getAdapterFactory()
    {
        return $this->adapterFactory;
    }

    /**
     * {@inheritdoc}
     */
    protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
    {
        $helperSet = $command->getHelperSet();

        foreach ($helperSet as $helper) {
            if ($helper instanceof OutputAwareInterface) {
                $helper->setOutput($output);
            }

            if ($helper instanceof InputAwareInterface) {
                $helper->setInput($input);
            }
        }

        $event = new ConsoleCommandEvent($command, $input, $output);
        $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event);

        try {
            $exitCode = $command->run($input, $output);
        } catch (\Exception $e) {
            $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode());
            $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);

            $event = new ConsoleExceptionEvent($command, $input, $output, $e, $event->getExitCode());
            $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event);

            if ($e instanceof UserException) {
                $this->getHelperSet()->get('gush_style')->error($e->getMessages());

                if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
                    throw $e;
                }

                return $event->getExitCode();
            } else {
                throw $event->getException();
            }
        }

        $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode);
        $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);

        return $event->getExitCode();
    }

    /**
     * @return \Symfony\Component\Console\Command\Command[]
     */
    public function getCommands()
    {
        $updateCommand = new UpdateCommand('core:update');
        $updateCommand->setManifestUri(self::MANIFESTO_FILE_URL);

        return [
            $updateCommand,
            new Cmd\HelpCommand(),
            new Cmd\PullRequest\PullRequestCreateCommand(),
            new Cmd\PullRequest\PullRequestMergeCommand(),
            new Cmd\PullRequest\PullRequestCloseCommand(),
            new Cmd\PullRequest\PullRequestPatOnTheBackCommand(),
            new Cmd\PullRequest\PullRequestAssignCommand(),
            new Cmd\PullRequest\PullRequestSwitchBaseCommand(),
            new Cmd\PullRequest\PullRequestSquashCommand(),
            new Cmd\PullRequest\PullRequestSemVerCommand(),
            new Cmd\PullRequest\PullRequestListCommand(),
            new Cmd\PullRequest\PullRequestLabelListCommand(),
            new Cmd\PullRequest\PullRequestMilestoneListCommand(),
            new Cmd\PullRequest\PullRequestFixerCommand(),
            new Cmd\PullRequest\PullRequestCheckoutCommand(),
            new Cmd\Util\DocumentationCommand(),
            new Cmd\Util\FabbotIoCommand(),
            new Cmd\Util\StyleCIPatchCommand(),
            new Cmd\Util\MetaHeaderCommand(),
            new Cmd\Util\MetaConfigureCommand(),
            new Cmd\Release\ReleaseCreateCommand(),
            new Cmd\Release\ReleaseListCommand(),
            new Cmd\Release\ReleaseRemoveCommand(),
            new Cmd\Issue\IssueTakeCommand(),
            new Cmd\Issue\IssueCreateCommand(),
            new Cmd\Issue\IssueCloseCommand(),
            new Cmd\Issue\IssueAssignCommand(),
            new Cmd\Issue\IssueLabelListCommand(),
            new Cmd\Issue\IssueMilestoneListCommand(),
            new Cmd\Issue\IssueShowCommand(),
            new Cmd\Issue\IssueCopyCommand(),
            new Cmd\Issue\IssueListCommand(),
            new Cmd\Issue\LabelIssuesCommand(),
            new Cmd\Branch\BranchPushCommand(),
            new Cmd\Branch\BranchMergeCommand(),
            new Cmd\Branch\BranchSyncCommand(),
            new Cmd\Branch\BranchDeleteCommand(),
            new Cmd\Branch\BranchForkCommand(),
            new Cmd\Branch\BranchChangelogCommand(),
            new Cmd\Branch\BranchRemoteAddCommand(),
            new Cmd\Core\CoreConfigureCommand(),
            new Cmd\Core\CoreAliasCommand(),
            new Cmd\Core\CoreClearCommand(),
            new Cmd\Core\InitCommand(),
            new Cmd\Core\AutocompleteCommand(),
            new Cmd\Repository\RepositoryCreateCommand(),
        ];
    }

    public function getSupportedMetaFiles()
    {
        return [
            'php' => new Meta\Base(),
            'js' => new Meta\Text(),
            'css' => new Meta\Text(),
            'twig' => new Meta\Twig(),
        ];
    }
}


text:
@interface TRNBooksServiceParser : NSObject <BMFParserProtocol>

@property (nonatomic, strong) BMFProgress *progress;

@end

redpajama_set_name: RedPajamaGithub


text:
from tornado.ioloop import IOLoop

ioloop = IOLoop.instance()


text:
# Translating Text

## Translations
Translations are defined in [ICU message syntax](https://formatjs.io/guides/message-syntax/) and stored in `<project_root>/translations` in either JSON and/or YAML format.  Nested directories are supported along with nested objects within your translation files.

## Translate

```hbs
<h2 id="title">{{t 'hello.world'}}</h2>
```

### HTML Element Attributes

```hbs
<input type='email' value='Some value' placeholder={{t 'hello.world'}}>
```

### Helper/Component Attributes

```hbs
{{input value=email placeholder=(t 'hello.world')}}
```

### Fallback Translations

The `t` helper, as of 3.0.0, supports a fallback lookup if the primary translation key is missing. In the below example, the translation key `"actual_key"` would be used in place of the primary key, `"missing_key"`, if translation missing for key.

```hbs
{{t 'missing_key' default='actual_key'}}
```

```js
this.intl.t('missing_key', {
  default: ['does_not_exist', 'does_exist'] /* default can also be an Array */
});
```

## Computed Property Macros

### t

`t` is a computed property macro that makes it easy to define translated
computed properties. For example:

```js
import Component from '@ember/component':
import { t } from 'ember-intl';

export default Component.extend({
  // Injecting the service is not required for `t` to work.
  // intl: service(),

  // A simple translation.
  title: t('user.edit.title'),

  followersCount: 1,

  // A translation with interpolations. This computed property
  // depends on `count` and will send `{ count: this.followersCount }`
  // in to the translation.
  followersTitle: t('user.followers.title', { count: 'followersCount' })
});
```

The first argument is the translation key. The second is a hash where the keys
are interpolations in the translation and the values are paths to the values
relative to this.

If you want to pass static values instead of paths to dynamic value, you can use
the `raw` function like in
[`ember-macro-helpers`](https://github.com/kellyselden/ember-macro-helpers#raw).

```js
import Component from '@ember/component':
import { t, raw } from 'ember-intl';

export default Component.extend({
  userName: 'Tom',

  // A translation with dynamic and static values
  title: t('user.edit.title', { name: 'userName', brand: raw('Ember') })
});
```

Note: Even though `raw` is _named_ the same as in `ember-awesome-macros` /
`ember-macro-helpers`, they _are not_ the same. Be sure to always use the
correct `raw` with `ember-intl` and `ember-awesome-macros` / `ember-macro-helpers`.

### intl

`intl` is the underlying computed property macro for `t` and you can use it
directly to access other methods from the `intl` service. It looks like this:

```js
import Component from '@ember/component':
import { intl } from 'ember-intl';

export default Component.extend({
  now: new Date(),
  dateFormat: 'hhmmss',

  nowFormatted: intl('now', 'dateFormat', function(intl /* , propertyKey, instance */) {
    return intl.formatDate(this.now, { format: this.format });
  })
});
```

`intl` expects a list of dependent keys, which may be empty, and the computed
property getter method as the last argument. The getter method receives three
arguments:

- `intl`: The `intl` service.
- `propertyKey`: The name of the computed property. In the above example it
  would be `nowFormatted`.
- `instance`: The class instance the computed property is installed on. This is
  equivalent to `this` in the above example. The reason `instance` is also
  passed to the getter method is to allow terser arrow function syntax instead
  of the `function` keyword:

  ```js
  intl('now', (intl, key, instance) => intl.formatDate(instance.now, { format: 'hhmmss' }));
  ```


text:
import {ProjectionStorage} from "./ProjectionStorage";
import {Projection} from "../Projection";
import {ProjectionNotFoundException} from "./ProjectionNotFoundException";

export class MemoryProjectionStorage<T extends Projection> implements ProjectionStorage<T> {
    private data: {[id: string]: T} = {};

    public async upsert(id: string, projection: T): Promise<void> {
        this.data[id] = projection;
    }

    public async remove(id: string): Promise<void> {
        if (!this.data[id]) {
            return;
        }

        delete this.data[id];
    }

    public async find(id: string): Promise<T> {
        if (!this.data[id]) {
            throw new ProjectionNotFoundException(id);
        }

        return this.data[id];
    }

    public async findAll(offset: number, limit: number): Promise<T[]> {
        return Object.getOwnPropertyNames(this.data).slice(offset, offset + limit).map((id) => {
            return this.data[id];
        });
    }

    public async clear(): Promise<void> {
        Object.getOwnPropertyNames(this.data).forEach((id: string) => {
            delete this.data[id];
        });
    }

    public async findBy(criteria: {[name: string]: string}, offset: number, limit: number): Promise<T[]> {
        return Object.keys(this.data).filter((id: string) => {
            return Object.keys(criteria).every((name: string) => {
                return this.data[id][name] === criteria[name];
            });
        }).map((id: string) => {
            return this.data[id];
        });
    }
}


text:
CREATE FUNCTION [dbo].[fxn_SearchXML] (@sXml ntext, @sXPath ntext)
RETURNS int
AS
BEGIN

	DECLARE @object int
	DECLARE @hr int
	DECLARE @value int
	DECLARE @src varchar(255), @desc varchar(255)

	EXEC @hr = sp_OACreate 'EonicDbTools.DbXML', @object OUT
	EXEC @hr = sp_OAMethod @object, 'QueryXmlString', @value OUT , @sXml, @sXPath
	EXEC @hr = sp_OADestroy @object
	IF @hr <> 0
	BEGIN
		EXEC sp_OAGetErrorInfo @object
	END
	RETURN @value

END


text:
const assert = require('assert');
const http = require('http');
const https = require('https');

const conf = require('../../../../../lib/Config').config;

const transport = conf.https ? https : http;
const ipAddress = process.env.IP ? process.env.IP : '127.0.0.1';
const hostname = process.env.AWS_ON_AIR ? 's3.amazonaws.com' :
    ipAddress;
const port = process.env.AWS_ON_AIR ? 80 : 8000;

const statusCode = {
    200: 200,
    301: 301, // website redirect
    403: 403, // website AccessDenied error
    404: 404, // website NoSuchBucket error
    AccessForbidden: 403,
    AccessDenied: 403,
    BadRequest: 400,
    InvalidAccessKeyId: 403,
    InvalidArgument: 400,
    NoSuchBucket: 404,
};

function methodRequest(params, callback) {
    const { method, bucket, objectKey, query, headers, code,
        headersResponse, headersOmitted, isWebsite } = params;
    const websiteHostname = `${bucket}.s3-website-us-east-1.amazonaws.com`;

    const options = {
        port,
        method,
        headers,
        rejectUnauthorized: false,
    };
    if (isWebsite) {
        options.hostname = websiteHostname;
        options.path = objectKey ? `/${objectKey}` : '/';
    } else {
        options.hostname = hostname;
        options.path = objectKey ? `/${bucket}/${objectKey}` : `/${bucket}`;
    }
    if (query) {
        options.path = `${options.path}?${query}`;
    }
    const req = transport.request(options, res => {
        const body = [];
        res.on('data', chunk => {
            body.push(chunk);
        });
        res.on('error', err => {
            process.stdout.write('err receiving response');
            return callback(err);
        });
        res.on('end', () => {
            const total = body.join('');
            if (code) {
                const message = Number.isNaN(parseInt(code, 10)) ?
                    `<Code>${code}</Code>` : '';
                assert(total.indexOf(message) > -1, `Expected ${message}`);
                assert.deepEqual(res.statusCode, statusCode[code],
                `status code expected: ${statusCode[code]}`);
            }
            if (headersResponse) {
                Object.keys(headersResponse).forEach(key => {
                    assert.deepEqual(res.headers[key], headersResponse[key],
                      `error header: ${key}`);
                });
            } else {
            // if no headersResponse provided, should not have these headers
            // in the request
                ['access-control-allow-origin',
                    'access-control-allow-methods',
                    'access-control-allow-credentials',
                    'vary'].forEach(key => {
                        assert.strictEqual(res.headers[key], undefined,
                        `Error: ${key} should not have value`);
                    });
            }
            if (headersOmitted) {
                headersOmitted.forEach(key => {
                    assert.strictEqual(res.headers[key], undefined,
                        `Error: ${key} should not have value`);
                });
            }
            return callback();
        });
    });
    req.on('error', err => {
        process.stdout.write('err sending request');
        return callback(err);
    });
    req.end();
}

// for testing needs usually only need one rule, if support for more CORS
// rules is desired, can refactor
function generateCorsParams(bucket, params) {
    const corsParams = {
        Bucket: bucket,
        CORSConfiguration: {
            CORSRules: [],
        },
    };
    const rule = {};
    Object.keys(params).forEach(key => {
        rule[`${key.charAt(0).toUpperCase()}${key.slice(1)}`] = params[key];
    });
    corsParams.CORSConfiguration.CORSRules[0] = rule;

    return corsParams;
}

module.exports = {
    methodRequest,
    generateCorsParams,
};


text:
#include "../utils.h"

namespace tvm {
namespace meta_schedule {

class AddToDatabaseNode : public MeasureCallbackNode {
 public:
  void Apply(const TaskScheduler& task_scheduler, int task_id,
             const Array<MeasureCandidate>& measure_candidates,
             const Array<BuilderResult>& builder_results,
             const Array<RunnerResult>& runner_results) final {
    TuneContext task = task_scheduler->tasks[task_id];
    Database database = task_scheduler->database;
    Workload workload = database->CommitWorkload(task->mod.value());
    Target target = task->target.value();
    ICHECK_EQ(runner_results.size(), measure_candidates.size());
    int n = runner_results.size();
    for (int i = 0; i < n; ++i) {
      RunnerResult result = runner_results[i];
      MeasureCandidate candidate = measure_candidates[i];
      if (result->error_msg.defined()) {
        continue;
      }
      database->CommitTuningRecord(TuningRecord(
          /*trace=*/candidate->sch->trace().value(),
          /*run_secs=*/result->run_secs.value(),
          /*workload=*/workload,
          /*target=*/target,
          /*args_info=*/candidate->args_info));
    }
  }

  static constexpr const char* _type_key = "meta_schedule.AddToDatabase";
  TVM_DECLARE_FINAL_OBJECT_INFO(AddToDatabaseNode, MeasureCallbackNode);
};

MeasureCallback MeasureCallback::AddToDatabase() {
  ObjectPtr<AddToDatabaseNode> n = make_object<AddToDatabaseNode>();
  return MeasureCallback(n);
}

TVM_REGISTER_NODE_TYPE(AddToDatabaseNode);
TVM_REGISTER_GLOBAL("meta_schedule.MeasureCallbackAddToDatabase")
    .set_body_typed(MeasureCallback::AddToDatabase);

}  // namespace meta_schedule
}  // namespace tvm


text:
package org.ovirt.engine.extensions.aaa.builtin.kerberosldap;

import org.ovirt.engine.core.compat.Guid;

public class DefaultIdEncoder implements LdapIdEncoder {

    @Override
    public String encodedId(Guid id) {
        return id.toString();
    }

}


text:
using System;
using System.ComponentModel.Composition;
using System.Xml.Linq;
using System.IO;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Errors = DevTreks.Exceptions.DevTreksErrors;

namespace DevTreks.Extensions
{
    ///<summary>
    ///Purpose:		economics calculators based on AAEA guidelines
    ///Author:		www.devtreks.org
    ///Date:		2015, January
    ///References:	www.devtreks.org/helptreks/linkedviews/help/linkedview/HelpFile/148
    /// </summary>
    [DoStepsAttribute(CONTRACT_TYPE = CALULATOR_CONTRACT_TYPES.defaultcalculatormanager,
        CalculatorsExtensionName = "NPVCalculators")]
    public class NPVCalculators : DoStepsHostView
    {
        public override async Task<bool> RunCalculatorStep(
            ExtensionContentURI extDocToCalcURI, ExtensionContentURI extCalcDocURI,
            string stepNumber, IList<string> urisToAnalyze,
            IDictionary<string, string> updates, CancellationToken cancellationToken)
        {
            bool bHasCalculation = false;
            CalculatorHelpers eCalcHelpers = new CalculatorHelpers();
            CalculatorParameters npvCalcParams
                = CalculatorHelpers.SetCalculatorParameters(
                extDocToCalcURI, extCalcDocURI, stepNumber, urisToAnalyze,
                updates);
            if (!CalculatorHelpers.URIAbsoluteExists(extDocToCalcURI,
                extDocToCalcURI.URIDataManager.TempDocPath))
            {
                //this calculator requires the base document to be built first
                extDocToCalcURI.ErrorMessage = Errors.MakeStandardErrorMsg("CALCULATORS_MISSINGBASEDOC");
                return false;
            }
            NPVCalculatorHelper npvBudgetHelpers = new NPVCalculatorHelper(npvCalcParams);
            ContractHelpers.EXTENSION_STEPS eStepNumber
                = ContractHelpers.GetEnumStepNumber(stepNumber);
            switch (eStepNumber)
            {
                case ContractHelpers.EXTENSION_STEPS.stepzero:
                    bHasCalculation = true;
                    break;
                case ContractHelpers.EXTENSION_STEPS.stepone:
                    bHasCalculation = true;
                    break;
                case ContractHelpers.EXTENSION_STEPS.steptwo:
                    updates.Clear();
                    if (npvCalcParams != null)
                    {
                        //set constants for this step
                        bHasCalculation = NPVCalculatorHelper.SetConstants(npvCalcParams);
                        //this step does not generate 3rd htmldocs
                        extDocToCalcURI.URIDataManager.NeedsFullView = false;
                        extDocToCalcURI.URIDataManager.NeedsSummaryView = false;
                    }
                    break;
                case ContractHelpers.EXTENSION_STEPS.stepthree:
                    //get rid of any update member that was added after running the same step 2x
                    CalculatorHelpers.RefreshUpdates(npvCalcParams, stepNumber, updates);
                    if (npvCalcParams != null)
                    {
                        if (npvCalcParams.CalculatorType == CalculatorHelpers.CALCULATOR_TYPES.operation2.ToString()
                            || npvCalcParams.CalculatorType == CalculatorHelpers.CALCULATOR_TYPES.component2.ToString())
                        {
                            //run the scheduling calculations
                            bHasCalculation = NPVCalculatorHelper.RunSchedulingCalculations(npvCalcParams);
                        }
                        else
                        {
                            //run the calculations
                            bHasCalculation = npvBudgetHelpers.RunCalculations();
                        }
                        extDocToCalcURI.ErrorMessage = npvCalcParams.ErrorMessage;
                        extDocToCalcURI.ErrorMessage += npvCalcParams.ExtensionDocToCalcURI.ErrorMessage;
                        if (!bHasCalculation)
                        {
                            extDocToCalcURI.ErrorMessage = (extDocToCalcURI.ErrorMessage == string.Empty) ?
                                Errors.MakeStandardErrorMsg("CALCULATORS_URI_MISMATCH")
                                : extDocToCalcURI.ErrorMessage;
                            return bHasCalculation;
                        }
                        if (string.IsNullOrEmpty(extDocToCalcURI.ErrorMessage))
                        {
                            //two step calculators need to be saved now
                            CheckForLastStepCalculator(npvCalcParams,
                                eStepNumber, extDocToCalcURI);
                            //replace the old calculator with the new one
                            //and save the new calculations document
                            bHasCalculation
                                = CalculatorHelpers.SaveNewCalculationsDocument(npvCalcParams);
                        }
                        else
                        {
                            bHasCalculation = false;
                        }
                    }
                    //this step needs a full 3rd htmldocs
                    extDocToCalcURI.URIDataManager.NeedsFullView = true;
                    extDocToCalcURI.URIDataManager.NeedsSummaryView = false;
                    break;
                case ContractHelpers.EXTENSION_STEPS.stepfour:
                    if (npvCalcParams.ExtensionDocToCalcURI.URIDataManager.SubAppType
                        == Constants.SUBAPPLICATION_TYPES.componentprices.ToString()
                        || npvCalcParams.ExtensionDocToCalcURI.URIDataManager.SubAppType
                        == Constants.SUBAPPLICATION_TYPES.operationprices.ToString())
                    {
                        if (npvCalcParams.CalculatorType == CalculatorHelpers.CALCULATOR_TYPES.operation2.ToString()
                            || npvCalcParams.CalculatorType == CalculatorHelpers.CALCULATOR_TYPES.component2.ToString())
                        {
                            //get rid of any update member that was added after running the same step 2x
                            CalculatorHelpers.RefreshUpdates(npvCalcParams, stepNumber, updates);
                            //run the scheduling calculations
                            bHasCalculation = npvBudgetHelpers.RunCalculations();
                            bHasCalculation = CalculatorHelpers.SaveNewCalculationsDocument(npvCalcParams);
                            //this step needs a full 3rd htmldocs
                            extDocToCalcURI.URIDataManager.NeedsFullView = true;
                            extDocToCalcURI.URIDataManager.NeedsSummaryView = false;
                        }
                        else
                        {
                            //save the calculations
                            bHasCalculation = SaveCalculations(extDocToCalcURI, extCalcDocURI,
                                npvCalcParams);
                        }
                    }
                    else
                    {
                        //save the calculations
                        bHasCalculation = SaveCalculations(extDocToCalcURI, extCalcDocURI,
                            npvCalcParams);
                    }
                    break;
                case ContractHelpers.EXTENSION_STEPS.stepfive:
                    if (npvCalcParams.ExtensionDocToCalcURI.URIDataManager.SubAppType
                        == Constants.SUBAPPLICATION_TYPES.componentprices.ToString()
                        || npvCalcParams.ExtensionDocToCalcURI.URIDataManager.SubAppType
                        == Constants.SUBAPPLICATION_TYPES.operationprices.ToString())
                    {
                        //save the calculations
                        bHasCalculation = SaveCalculations(extDocToCalcURI, extCalcDocURI,
                            npvCalcParams);
                    }
                    break;
                default:
                    //as many steps as needed can be added to this addin
                    break;
            }
            extDocToCalcURI.ErrorMessage += npvCalcParams.ErrorMessage;
            return bHasCalculation;
        }
        private static void CheckForLastStepCalculator(
            CalculatorParameters npvCalcParams,
            ContractHelpers.EXTENSION_STEPS stepNumber,
            ExtensionContentURI extDocToCalcURI)
        {
            CalculatorHelpers.CALCULATOR_TYPES eCalculatorType
                = CalculatorHelpers.GetCalculatorType(
                npvCalcParams.CalculatorType);
            //keep for code sample but Locals moved to Locals Extension
            if (eCalculatorType
                == CalculatorHelpers.CALCULATOR_TYPES.locals)
            {
                if (stepNumber == ContractHelpers.EXTENSION_STEPS.stepthree)
                {
                    //tells addinhelper to save calcs
                    CalculatorHelpers.SetTempDocSaveCalcsProperty(extDocToCalcURI);
                }
            }
        }
        private static bool SaveCalculations(
            ExtensionContentURI extDocToCalcURI, ExtensionContentURI extCalcDocURI,
            CalculatorParameters npvCalcParams)
        {
            extDocToCalcURI.URIDataManager.NeedsFullView = false;
            extDocToCalcURI.URIDataManager.NeedsSummaryView = true;
            extCalcDocURI.URIFileExtensionType = CalculatorHelpers.GetAttribute(npvCalcParams.LinkedViewElement,
                    Calculator1.cFileExtensionType);
            bool bHasCalculation = true;
            if (extDocToCalcURI.URIDataManager.TempDocSaveMethod
                == Constants.SAVECALCS_METHOD.saveastext.ToString())
            {
                //text files can be filtered by subscribers
                KeyValuePair<string, string> kvp = new KeyValuePair<string, string>(
                    extDocToCalcURI.URIPattern, extDocToCalcURI.URIDataManager.TempDocPath);
                npvCalcParams.AnalyzerParms.FileOrFolderPaths.Add(kvp);
                NPVCalcsTextSubscriber obsTextSubscriber
                    = new NPVCalcsTextSubscriber(npvCalcParams);
                bHasCalculation = obsTextSubscriber.BuildObservations();
                if (!bHasCalculation
                    || (!string.IsNullOrEmpty(obsTextSubscriber
                    .ObsCalculatorParams.ErrorMessage)))
                {
                    extDocToCalcURI.ErrorMessage = obsTextSubscriber.ObsCalculatorParams.ErrorMessage;
                    CalculatorHelpers.SetTempDocSaveNoneProperty(extDocToCalcURI);
                }
                else
                {
                    //tells addinhelper to save calcs
                    CalculatorHelpers.SetTempDocSaveCalcsProperty(extDocToCalcURI);
                }
            }
            else
            {
                //tells addinhelper to save calcs
                CalculatorHelpers.SetTempDocSaveCalcsProperty(extDocToCalcURI);
            }
            return bHasCalculation;
        }
        //implement the interface, but this is not an analyzers addin
        public override async Task<bool> RunAnalyzerStep(
            ExtensionContentURI extDocToCalcURI, ExtensionContentURI extCalcDocURI,
            string stepNumber, IList<string> urisToAnalyze,
            IDictionary<string, string> updates, CancellationToken cancellationToken)
        {
            return false;
        }
    }
}


text:
var h = CycleDOM.h;
var h1 = CycleDOM.h1;
var span = CycleDOM.span;
var makeDOMDriver = CycleDOM.makeDOMDriver;

// Logic (functional)
function main(sources) {
  const mouseover$ = sources.DOM.select('span').events('mouseover');
  const sinks = {
    DOM: mouseover$
           .startWith(null)
           .flatMapLatest(() =>
             Rx.Observable.timer(0, 1000)
               .map(i =>
                 h1({style: {background: 'red'}}, [
                     span([
                       `Seconds elapsed ${i}`
                     ])
                   ])
               )
           ),
    Log: Rx.Observable.timer(0, 2000).map(i => 2*i)
  };

  return sinks;
}

// Effects (imperative)
function consoleLogDriver(msg$) {
  msg$.subscribe(msg => console.log(msg));
}

const drivers = {
  DOM: makeDOMDriver('#app'),
  Log: consoleLogDriver
};

Cycle.run(main, drivers);


text:
require "./lib/Practica9/version"
require "./lib/Practica9/matrices.rb"
require "./lib/Practica9/matrizDensa.rb"
require "./lib/Practica9/matrizDispersa.rb"

require "./lib/Practica9/racional.rb"
require "./lib/Practica9/gcd.rb"

# Vacío
module Practica9

end


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Linq;
using System.Numerics;
using System.Drawing;
using System.Threading;
using System.ComponentModel;

namespace Datamodel
{
    [DebuggerTypeProxy(typeof(Array<>.DebugView))]
    [DebuggerDisplay("Count = {Inner.Count}")]
    public abstract class Array<T> : IList<T>, IList, INotifyCollectionChanged, INotifyPropertyChanged
    {
        internal class DebugView
        {
            public DebugView(Array<T> arr)
            {
                Arr = arr;
            }
            Array<T> Arr;

            [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
            public T[] Items { get { return Arr.Inner.ToArray(); } }
        }

        protected List<T> Inner;
        protected ReaderWriterLockSlim RWLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
        object _SyncRoot = new object();

        public virtual AttributeList Owner
        {
            get { return _Owner; }
            internal set { _Owner = value; OnPropertyChanged(); }
        }
        AttributeList _Owner;

        protected Datamodel OwnerDatamodel { get { return Owner == null ? null : Owner.Owner; } }

        internal Array()
        {
            Inner = new List<T>();
        }

        internal Array(IEnumerable<T> enumerable)
        {
            if (enumerable != null)
                Inner = new List<T>(enumerable);
            else
                Inner = new List<T>();
        }

        internal Array(int capacity)
        {
            Inner = new List<T>(capacity);
        }

        public int IndexOf(T item)
        {
            RWLock.EnterReadLock();
            try
            {
                return Inner.IndexOf(item);
            }
            finally
            {
                RWLock.ExitReadLock();
            }
        }

        public void Insert(int index, T item)
        {
            RWLock.EnterWriteLock();
            try
            {
                Insert_Internal(index, item);
            }
            finally
            {
                RWLock.ExitWriteLock();
            }
            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, (object)item, index));
        }

        protected virtual void Insert_Internal(int index, T item)
        {
            Inner.Insert(index, item);
        }

        public void RemoveAt(int index)
        {
            object item;
            RWLock.EnterWriteLock();
            try
            {
                item = Inner[index];
                Inner.RemoveAt(index);
            }
            finally
            {
                RWLock.ExitWriteLock();
            }
            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index));
        }

        public virtual T this[int index]
        {
            get
            {
                RWLock.EnterReadLock();
                try
                {
                    return Inner[index];
                }
                finally
                {
                    RWLock.ExitReadLock();
                }
            }
            set
            {
                object current;
                RWLock.EnterUpgradeableReadLock();
                try
                {
                    current = Inner[index];
                    RWLock.EnterWriteLock();
                    try
                    {
                        Inner.RemoveAt(index);
                        Insert_Internal(index, value);
                    }
                    finally
                    {
                        RWLock.ExitWriteLock();
                    }
                }
                finally
                {
                    RWLock.ExitUpgradeableReadLock();
                }
                OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, current, (object)value, index));
            }
        }

        public void Add(T item)
        {
            Insert(Inner.Count, item);
        }

        public void Clear()
        {
            RWLock.EnterWriteLock();
            try
            {
                Inner.Clear();
            }
            finally
            {
                RWLock.ExitWriteLock();
            }
            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
        }

        public bool Contains(T item)
        {
            RWLock.EnterReadLock();
            try
            {
                return Inner.Contains(item);
            }
            finally
            {
                RWLock.ExitReadLock();
            }
        }

        public void CopyTo(T[] array, int arrayIndex)
        {
            CopyTo_Internal(array, arrayIndex);
        }

        protected virtual void CopyTo_Internal(Array array, int index)
        {
            RWLock.EnterUpgradeableReadLock();
            try
            {
                foreach (var item in this.Take(Math.Min(array.Length - index, Inner.Count)).ToArray())
                {
                    array.SetValue(item, index);
                    index++;
                }
            }
            finally
            {
                RWLock.ExitUpgradeableReadLock();
            }
        }

        public int Count
        {
            get
            {
                RWLock.EnterReadLock();
                try
                {
                    return Inner.Count;
                }
                finally
                {
                    RWLock.ExitReadLock();
                }
            }
        }

        bool ICollection<T>.IsReadOnly { get { return false; } }

        public bool Remove(T item)
        {
            int index;
            RWLock.EnterUpgradeableReadLock();
            try
            {
                index = Inner.IndexOf(item);
                if (index == -1) return false;

                RWLock.EnterWriteLock();
                try
                {
                    Inner.RemoveAt(index);
                }
                finally
                {
                    RWLock.ExitWriteLock();
                }
            }
            finally
            {
                RWLock.ExitUpgradeableReadLock();
            }

            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, (object)item, index));
            return true;
        }

        public IEnumerator<T> GetEnumerator()
        {
            for (int i = 0; i < Inner.Count; i++)
                yield return this[i];
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public event NotifyCollectionChangedEventHandler CollectionChanged;
        protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
                case NotifyCollectionChangedAction.Add:
                case NotifyCollectionChangedAction.Remove:
                case NotifyCollectionChangedAction.Reset:
                    OnPropertyChanged("Count");
                    break;
            }

            if (CollectionChanged != null)
                CollectionChanged(this, e);
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName()] string property = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
        }

        #region IList

        int IList.Add(object value)
        {
            Add((T)value);
            return Count;
        }

        bool IList.Contains(object value)
        {
            return Contains((T)value);
        }

        int IList.IndexOf(object value)
        {
            return IndexOf((T)value);
        }

        void IList.Insert(int index, object value)
        {
            Insert(index, (T)value);
        }

        bool IList.IsFixedSize { get { return false; } }
        bool IList.IsReadOnly { get { return false; } }

        void IList.Remove(object value)
        {
            Remove((T)value);
        }

        object IList.this[int index]
        {
            get
            {
                return this[index];
            }
            set
            {
                this[index] = (T)value;
            }
        }

        void ICollection.CopyTo(Array array, int index)
        {
            CopyTo_Internal(array, index);
        }

        bool ICollection.IsSynchronized { get { return true; } }

        public object SyncRoot { get { return _SyncRoot; } }

        #endregion
    }

    public class ElementArray : Array<Element>
    {
        public ElementArray() { }

        public ElementArray(IEnumerable<Element> enumerable)
            : base(enumerable)
        { }

        public ElementArray(int capacity)
            : base(capacity)
        { }

        /// <summary>
        /// Gets the values in the list without attempting destubbing.
        /// </summary>
        internal IEnumerable<Element> RawList { get { foreach (var elem in Inner) yield return elem; } }

        public override AttributeList Owner
        {
            get
            {
                return base.Owner;
            }
            internal set
            {
                RWLock.EnterUpgradeableReadLock();
                try
                {
                    base.Owner = value;

                    if (OwnerDatamodel != null)
                    {
                        for (int i = 0; i < Count; i++)
                        {
                            var elem = Inner[i];

                            if (elem == null) continue;
                            if (elem.Owner == null)
                            {
                                RWLock.EnterWriteLock();
                                try
                                {
                                    Inner[i] = OwnerDatamodel.ImportElement(elem, Datamodel.ImportRecursionMode.Stubs, Datamodel.ImportOverwriteMode.Stubs);
                                }
                                finally
                                {
                                    RWLock.ExitWriteLock();
                                }
                            }
                            else if (elem.Owner != OwnerDatamodel)
                                throw new ElementOwnershipException();
                        }
                    }
                }
                finally
                {
                    RWLock.ExitUpgradeableReadLock();
                }
            }
        }

        protected override void Insert_Internal(int index, Element item)
        {
            if (item != null && OwnerDatamodel != null)
            {
                if (item.Owner == null)
                    item = OwnerDatamodel.ImportElement(item, Datamodel.ImportRecursionMode.Recursive, Datamodel.ImportOverwriteMode.Stubs);
                else if (item.Owner != OwnerDatamodel)
                    throw new ElementOwnershipException();
            }

            base.Insert_Internal(index, item);
        }

        public override Element this[int index]
        {
            get
            {
                RWLock.EnterUpgradeableReadLock();
                try
                {
                    var elem = Inner[index];
                    if (elem != null && elem.Stub && elem.Owner != null)
                    {
                        RWLock.EnterWriteLock();
                        try
                        {
                            elem = Inner[index] = elem.Owner.OnStubRequest(elem.ID);
                        }
                        catch (Exception err)
                        {
                            throw new DestubException(this, index, err);
                        }
                        finally
                        {
                            RWLock.ExitWriteLock();
                        }
                    }
                    return elem;
                }
                finally
                {
                    RWLock.ExitUpgradeableReadLock();
                }
            }
            set
            {
                base[index] = value;
            }
        }
    }

    public class IntArray : Array<int>
    {
        public IntArray() { }
        public IntArray(IEnumerable<int> enumerable)
            : base(enumerable)
        { }
        public IntArray(int capacity)
            : base(capacity)
        { }
    }

    public class FloatArray : Array<float>
    {
        public FloatArray() { }
        public FloatArray(IEnumerable<float> enumerable)
            : base(enumerable)
        { }
        public FloatArray(int capacity)
            : base(capacity)
        { }
    }

    public class BoolArray : Array<bool>
    {
        public BoolArray() { }
        public BoolArray(IEnumerable<bool> enumerable)
            : base(enumerable)
        { }
        public BoolArray(int capacity)
            : base(capacity)
        { }
    }

    public class StringArray : Array<string>
    {
        public StringArray() { }
        public StringArray(IEnumerable<string> enumerable)
            : base(enumerable)
        { }
        public StringArray(int capacity)
            : base(capacity)
        { }
    }

    public class BinaryArray : Array<byte[]>
    {
        public BinaryArray() { }
        public BinaryArray(IEnumerable<byte[]> enumerable)
            : base(enumerable)
        { }
        public BinaryArray(int capacity)
            : base(capacity)
        { }
    }

    public class TimeSpanArray : Array<TimeSpan>
    {
        public TimeSpanArray() { }
        public TimeSpanArray(IEnumerable<TimeSpan> enumerable)
            : base(enumerable)
        { }
        public TimeSpanArray(int capacity)
            : base(capacity)
        { }
    }

    public class ColorArray : Array<Color>
    {
        public ColorArray() { }
        public ColorArray(IEnumerable<Color> enumerable)
            : base(enumerable)
        { }
        public ColorArray(int capacity)
            : base(capacity)
        { }
    }

    public class Vector2Array : Array<Vector2>
    {
        public Vector2Array() { }
        public Vector2Array(IEnumerable<Vector2> enumerable)
            : base(enumerable)
        { }
        public Vector2Array(int capacity)
            : base(capacity)
        { }
    }

    public class Vector3Array : Array<Vector3>
    {
        public Vector3Array() { }
        public Vector3Array(IEnumerable<Vector3> enumerable)
            : base(enumerable)
        { }
        public Vector3Array(int capacity)
            : base(capacity)
        { }
    }

    public class Vector4Array : Array<Vector4>
    {
        public Vector4Array() { }
        public Vector4Array(IEnumerable<Vector4> enumerable)
            : base(enumerable)
        { }
        public Vector4Array(int capacity)
            : base(capacity)
        { }
    }

    public class QuaternionArray : Array<Quaternion>
    {
        public QuaternionArray() { }
        public QuaternionArray(IEnumerable<Quaternion> enumerable)
            : base(enumerable)
        { }
        public QuaternionArray(int capacity)
            : base(capacity)
        { }
    }

    public class MatrixArray : Array<Matrix4x4>
    {
        public MatrixArray() { }
        public MatrixArray(IEnumerable<Matrix4x4> enumerable)
            : base(enumerable)
        { }
        public MatrixArray(int capacity)
            : base(capacity)
        { }
    }

    public class ByteArray : Array<byte>
    {
        public ByteArray() { }
        public ByteArray(IEnumerable<byte> enumerable)
            : base(enumerable)
        { }
        public ByteArray(int capacity)
            : base(capacity)
        { }
    }

    [CLSCompliant(false)]
    public class UInt64Array : Array<UInt64>
    {
        public UInt64Array() { }
        public UInt64Array(IEnumerable<UInt64> enumerable)
            : base(enumerable)
        { }
        public UInt64Array(int capacity)
            : base(capacity)
        { }
    }
}


text:
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="All Tests" type="TestNG" factoryName="TestNG">
    <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
    <module name="tests" />
    <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
    <option name="ALTERNATIVE_JRE_PATH" value="" />
    <option name="SUITE_NAME" value="$PROJECT_DIR$/tests/src/testng-fast.xml" />
    <option name="PACKAGE_NAME" value="" />
    <option name="MAIN_CLASS_NAME" value="" />
    <option name="METHOD_NAME" value="" />
    <option name="GROUP_NAME" value="" />
    <option name="TEST_OBJECT" value="SUITE" />
    <option name="VM_PARAMETERS" value="" />
    <option name="PARAMETERS" value="" />
    <option name="WORKING_DIRECTORY" value="" />
    <option name="OUTPUT_DIRECTORY" value="" />
    <option name="ANNOTATION_TYPE" />
    <option name="ENV_VARIABLES" />
    <option name="PASS_PARENT_ENVS" value="true" />
    <option name="TEST_SEARCH_SCOPE">
      <value defaultName="moduleWithDependencies" />
    </option>
    <option name="USE_DEFAULT_REPORTERS" value="false" />
    <option name="PROPERTIES_FILE" value="" />
    <envs />
    <properties />
    <listeners />
    <RunnerSettings RunnerId="Run" />
    <ConfigurationWrapper RunnerId="Run" />
    <method />
  </configuration>
</component>


text:
layout: post
title:  "Snacky French"
author: "Me!"
date:   2017-7-1
categories: web
project: true
image: "/assets/img/snacky_french_ss.png"
excerpt: "A Bakers Website!"

---
A good friend of mine needed a web presence to show off her amazing custom cakes and baked treats, so I built her one.

In 2017, we updated to use a cleaner, responsive site that put the focus on her products.  By switching from a custom built and hosted site to Square Space she is now able to easily make changes and add new content without needing my help.

[Snacky French]({snackyfrench.com}})


text:
game.Background = me.Renderable.extend({
    init : function() {
        this._super(me.Renderable, "init", [0, 0, me.game.viewport.width, me.game.viewport.height]);
        this.z = 1;
    },
    draw : function(renderer) {
        renderer.clearSurface(renderer.getContext(), "#000");
    }
});

game.MainEntity = me.Entity.extend({
    init : function(x, y) {
        var settings = {
            image : "basicImage",
            framewidth : 32,
            frameheight : 32,
            width : 32,
            height : 32
        };
        this._super(me.Entity, "init", [x, y, settings]);
        this.z = 2;
        this.renderable.addAnimation("idle", [0], 1);
        this.renderable.setCurrentAnimation("idle");
    },

    update: function(delta) {
        this._super(me.Entity, "update", [delta]);
    }
});

game.RenderableEntity = me.Renderable.extend({
    init : function(x, y) {
        this._super(me.Renderable, "init", [x, y, 100, 100]);
        this.z = 2;
    },

    draw : function(renderer) {
        renderer.save();
        renderer.setColor("#fff");
        renderer.fillRect(this.pos.x, this.pos.y, this.width, this.height);
        renderer.restore();
    }
});


text:
static QPointer<QFile> log_file = nullptr;
QPointer<QSettings> global_settings = nullptr;

void messageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
    Q_UNUSED(type)
    Q_UNUSED(context)

    printf("%s\n", qPrintable(msg));
    fflush(stdout);

    if (log_file)
    {
        log_file->write(msg.toLatin1());
        log_file->write("\n");
        log_file->flush();
    }
}

void signalHandler(int signum)
{
    Q_UNUSED(signum)

    qApp->exit();
}

int main(int argc, char *argv[])
{
#ifdef Q_OS_WIN
    signal(SIGBREAK, signalHandler);
#else
    signal(SIGHUP, signalHandler);
#endif
    signal(SIGINT, signalHandler);

    qInstallMessageHandler(messageOutput);

    QCoreApplication a(argc, argv);

    if (!QDir("../data/").exists())
    {
        if (!QDir().mkdir("../data/"))
        {
            DEBUG_FUNCTION("Cant open data folder! Exiting...");
            return 0;
        }
    }

    QFile file("../data/log.txt");

    log_file = &file;

    if (!log_file->open(QFile::WriteOnly | QFile::Text | QFile::Append))
    {
        qInstallMessageHandler(nullptr);
        qDebug() << "Couldn't log to file!";
    }

    QSettings settings("../data/settings.ini", QSettings::IniFormat);

    global_settings = &settings;

    DEBUG_FUNCTION("Session started!");

    SslServer server;
    Q_UNUSED(server)

    return a.exec();
}


text:
package gameAuthoring.scenes.levelBuilding;

import gameAuthoring.mainclasses.Constants;
import gameEngine.MainEngineManager;
import gameEngine.actors.BaseEnemy;
import gameEngine.levels.BaseLevel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import utilities.JavaFXutilities.imageView.StringToImageViewConverter;
import utilities.JavaFXutilities.numericalTextFields.NumericalTextField;
import utilities.multilanguage.MultiLanguageUtility;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;

public class LevelDisplayCell extends HBox {

    private static final String LVL_CONTAINER_CLASS = "levelContainer";
    private static final int SPACE_BTW_LEVEL_INFO_AND_ENEMIES = 50;
    private static final int TEXT_FIELD_WIDTH = 50;
    private static final double FIT_SIZE = 80;
    private static final int GENERAL_PADDING = 10;
    private static final String PLAYLEVELBUTTON_IMG_PATH =
            "gameAuthoring/scenes/levelBuilding/PlayLevelButton.png";

    private List<BaseEnemy> myEnemies;
    private int myLevelNum;
    private Map<BaseEnemy, NumericalTextField> enemyToEnemyCountMap;
    private NumericalTextField myLevelDurationField;
    private boolean myEngineInstantiatedFlag;
    private MainEngineManager myEngineManager;

    public LevelDisplayCell (List<BaseEnemy> baseEnemies, int levelNum, Pane pane) {
        myEnemies = baseEnemies;
        myLevelNum = levelNum;
        enemyToEnemyCountMap = new HashMap<BaseEnemy, NumericalTextField>();
        HBox container = new HBox(SPACE_BTW_LEVEL_INFO_AND_ENEMIES);
        container.setPadding(new Insets(GENERAL_PADDING));
        container.getStyleClass().add(LVL_CONTAINER_CLASS);
        VBox levelInfoBox = createLevelInfoBox();
        HBox enemiesBox = createEnemiesBox();
        Image img = new Image(PLAYLEVELBUTTON_IMG_PATH);
        ImageView playLevelButton = new ImageView(img);

        myEngineInstantiatedFlag = false;
        playLevelButton.setOnMouseClicked(event -> {
            if (!myEngineInstantiatedFlag) {
                myEngineManager = new MainEngineManager(pane);
                myEngineInstantiatedFlag = true;
            }
            if (!myEngineManager.isRunning()) {
                myEngineManager.loadAuthoringLevel(generateLevel());
                myEngineManager.resume();
            }

        });
        container.getChildren().addAll(levelInfoBox, enemiesBox, playLevelButton);
        this.getChildren().add(container);
    }

    private HBox createEnemiesBox () {
        HBox enemiesBox = new HBox(GENERAL_PADDING);
        for (BaseEnemy enemy : myEnemies) {
            VBox enemyBox = new VBox(Constants.SMALLEST_PADDING);
            enemyBox.setAlignment(Pos.CENTER);
            Label enemyNameLabel = new Label(enemy.toString());
            ImageView enemyImg =
                    StringToImageViewConverter.getImageView(FIT_SIZE,
                                                            FIT_SIZE,
                                                            enemy.getImagePath());
            enemyImg.setFitHeight(FIT_SIZE);
            enemyImg.setFitWidth(FIT_SIZE);
            NumericalTextField enemiesCountField = new NumericalTextField(TEXT_FIELD_WIDTH);
            enemyToEnemyCountMap.put(enemy, enemiesCountField);
            enemyBox.getChildren().addAll(enemyNameLabel, enemyImg,
                                          enemiesCountField);
            enemiesBox.getChildren().add(enemyBox);
        }
        return enemiesBox;
    }

    private VBox createLevelInfoBox () {
        VBox levelInfoBox = new VBox(Constants.SM_PADDING);
        levelInfoBox.setPadding(new Insets(Constants.MED_PADDING));
        HBox timeAndSeconds = new HBox(Constants.SM_PADDING);
        myLevelDurationField = new NumericalTextField(TEXT_FIELD_WIDTH);
        Label secondsLabel = new Label();
        secondsLabel.textProperty().bind(MultiLanguageUtility.getInstance()
                .getStringProperty(Constants.SECONDS));
        timeAndSeconds.getChildren().addAll(myLevelDurationField, secondsLabel);
        Label levelLabel = new Label("Level " + (myLevelNum + 1));
        levelLabel.getStyleClass().add("levelLabel");
        levelInfoBox.getChildren().addAll(levelLabel,
                                          timeAndSeconds);
        return levelInfoBox;
    }

    public BaseLevel generateLevel () {
        BaseLevel level = new BaseLevel();
        for (BaseEnemy enemy : myEnemies) {
            level.addEnemyCountPair(new EnemyCountPair(enemyToEnemyCountMap.get(enemy).getNumber(),
                                                       enemy));
        }
        level.setDuration(myLevelDurationField.getNumber());
        return level;
    }

    public boolean isUserInputValid () {
        return isAllEnemyFieldsValid() && myLevelDurationField.isValueEntered() &&
               myLevelDurationField.getNumber() > 0;
    }

    private boolean isAllEnemyFieldsValid () {
        return enemyToEnemyCountMap.values()
                .stream()
                .filter(field -> !(field.isValueEntered() && field.getNumber() >= 0))
                .count() == 0;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="article"
            type="com.hkurokawa.qiitandroid.domain.article.AnonymousArticle" />
    </data>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/list_item_height"
            android:paddingTop="8dp">

            <ImageView
                android:id="@+id/user_icon"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:layout_marginRight="16dp"
                app:error="@{@drawable/ic_error_outline_black_24dp}"
                app:imageUrl="@{article.author.profileImageUrl}"
                tools:src="@drawable/ic_error_outline_black_24dp" />

            <TextView
                android:id="@+id/title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_toRightOf="@id/user_icon"
                android:ellipsize="end"
                android:maxLines="2"
                android:text="@{article.title}"
                android:textSize="17sp"
                tools:text="perlのコマンドでファイル内の文字列を一括置換しました。" />

            <TextView
                android:id="@+id/info"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/title"
                android:layout_toRightOf="@id/user_icon"
                android:ellipsize="end"
                android:lines="1"
                android:text='@{article.author.name + " が" + article.createdAtInWords + "前に投稿しました"}'
                android:textSize="13sp"
                tools:text="pugiemonn が3分前に投稿しました" />
        </RelativeLayout>
    </FrameLayout>
</layout>


text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.google.android.gms.common.SignInButton
        android:id="@+id/sign_in_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_gravity="center"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:visibility="visible"
        app:layout_constraintEnd_toStartOf="@+id/sign_out_button"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/sign_out_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:text="sign out"
        app:layout_constraintBottom_toBottomOf="@+id/sign_in_button"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toEndOf="@+id/sign_in_button"
        app:layout_constraintTop_toTopOf="@+id/sign_in_button" />

    <Button
        android:id="@+id/getdata"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:text="List Data"
        app:layout_constraintBottom_toBottomOf="@+id/add_data"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toEndOf="@+id/add_data"
        app:layout_constraintTop_toTopOf="@+id/add_data" />

    <Button
        android:id="@+id/add_data"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:text="Add Data"
        app:layout_constraintEnd_toStartOf="@+id/getdata"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/sign_in_button" />

    <ScrollView
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginBottom="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/add_data"
        app:layout_constraintVertical_bias="0.0">

        <TextView
            android:id="@+id/logger"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="Logger\n" />

    </ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>


text:
using System.Collections.Generic;

namespace dexih.functions.Query
{
 public class Joins: List<Join>
    {
        public Joins() {}

        public Joins(IEnumerable<Join> joins)
        {
            if (joins == null) return;

            AddRange(joins);
        }

        public Joins(EJoinType joinType, Table table, Filters joinFilters)
        {
            Add(new Join(joinType, table, joinFilters));
        }

        public Joins(EJoinType joinType, Table table, string alias, Filters joinFilters)
        {
            Add(new Join(joinType, table, alias, joinFilters));
        }
    }
}


text:
package org.kuali.kpme.tklm.time.rules.shiftdifferential.ruletype.web;

import org.kuali.kpme.core.bo.HrBusinessObject;
import org.kuali.kpme.core.bo.HrDataObjectMaintainableImpl;
import org.kuali.kpme.tklm.time.service.TkServiceLocator;

public class ShiftDifferentialRuleTypeMaintenableImpl extends HrDataObjectMaintainableImpl {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public HrBusinessObject getObjectById(String id) {
		return TkServiceLocator.getShiftDifferentialRuleTypeService().getShiftDifferentialRuleType(id);
	}

}