text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ParticleSystem
{
    public class ParticleAtractor : Particle
    {
        public int Attraction { get; private set; }

        public ParticleAtractor(MatrixCoords position, MatrixCoords speed, int attraction)
            :base(position,speed)
        {
            this.Attraction = attraction;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.druid.sql.calcite.expression;

import org.apache.calcite.rex.RexNode;
import org.apache.calcite.sql.SqlOperator;
import org.apache.druid.query.aggregation.PostAggregator;
import org.apache.druid.query.filter.DimFilter;
import org.apache.druid.segment.column.RowSignature;
import org.apache.druid.sql.calcite.planner.PlannerContext;
import org.apache.druid.sql.calcite.rel.VirtualColumnRegistry;

import javax.annotation.Nullable;

public interface SqlOperatorConversion
{
  /**
   * Returns the SQL operator corresponding to this function. Should be a singleton.
   *
   * @return operator
   */
  SqlOperator calciteOperator();

  /**
   * Translate a Calcite {@code RexNode} to a Druid expression.
   *
   * @param plannerContext SQL planner context
   * @param rowSignature   signature of the rows to be extracted from
   * @param rexNode        expression meant to be applied on top of the rows
   *
   * @return Druid expression, or null if translation is not possible
   *
   * @see Expressions#toDruidExpression(PlannerContext, RowSignature, RexNode)
   */
  @Nullable
  DruidExpression toDruidExpression(
      PlannerContext plannerContext,
      RowSignature rowSignature,
      RexNode rexNode
  );

  /**
   * Translate a Calcite {@code RexNode} to a Druid expression, with the possibility of having postagg operands.
   *
   * @param plannerContext SQL planner context
   * @param rowSignature   signature of the rows to be extracted from
   * @param rexNode        expression meant to be applied on top of the rows
   * @param postAggregatorVisitor visitor that manages postagg names and tracks postaggs that were created as
   *                              by the translation
   *
   * @return Druid expression, or null if translation is not possible
   *
   * @see Expressions#toDruidExpression(PlannerContext, RowSignature, RexNode)
   */
  @Nullable
  default DruidExpression toDruidExpressionWithPostAggOperands(
      PlannerContext plannerContext,
      RowSignature rowSignature,
      RexNode rexNode,
      PostAggregatorVisitor postAggregatorVisitor
  )
  {
    return toDruidExpression(plannerContext, rowSignature, rexNode);
  }

  /**
   * Returns a Druid filter corresponding to a Calcite {@code RexNode} used as a filter condition.
   *
   * @param plannerContext        SQL planner context
   * @param rowSignature          input row signature
   * @param virtualColumnRegistry re-usable virtual column references
   * @param rexNode               filter expression rex node
   *
   * @return filter, or null if the call cannot be translated to a filter
   */
  @Nullable
  default DimFilter toDruidFilter(
      PlannerContext plannerContext,
      RowSignature rowSignature,
      @Nullable VirtualColumnRegistry virtualColumnRegistry,
      RexNode rexNode
  )
  {
    return null;
  }

  /**
   * Returns a Druid PostAggregator corresponding to a Calcite {@link RexNode} used to transform a row after
   * aggregation has occurred.
   *
   * @param plannerContext   SQL planner context
   * @param querySignature   signature of the rows to be extracted from
   * @param rexNode          expression meant to be applied on top of the rows
   *
   * @param postAggregatorVisitor visitor that manages postagg names and tracks postaggs that were created
   *                              by the translation
   * @return filter, or null if the call cannot be translated
   */
  @Nullable
  default PostAggregator toPostAggregator(
      PlannerContext plannerContext,
      RowSignature querySignature,
      RexNode rexNode,
      PostAggregatorVisitor postAggregatorVisitor
  )
  {
    return null;
  }
}


text:
package org.apache.syncope.client.ui.commons.wizards.any;

import java.io.Serializable;
import org.apache.syncope.common.lib.to.AnyTO;

public class AnyWrapper<T extends AnyTO> implements Serializable {

    private static final long serialVersionUID = 8058288034211558375L;

    protected final T anyTO;

    public AnyWrapper(final T anyTO) {
        this.anyTO = anyTO;
    }

    public T getInnerObject() {
        return anyTO;
    }
}


text:
<menu string="Support">
    <item string="Dashboard" action="support_board"/>
    <item string="Issues" action="issue"/>
    <item string="Settings">
        <item string="Issue Types" action="issue_type"/>
    </item>
    <item string="Reports">
        <item string="Issue Analysis" action="issue_analysis"/>
    </item>
</menu>


text:
<?php
$this->breadcrumbs = [
    Yii::t('PaymentModule.payment', 'Payment methods') => ['/payment/paymentBackend/index'],
    Yii::t('PaymentModule.payment', 'Creating')
];

$this->pageTitle = Yii::t('PaymentModule.payment', 'Payment methods - creating');

$this->menu = [
    ['icon' => 'fa fa-fw fa-list-alt', 'label' => Yii::t('PaymentModule.payment', 'Manage payment methods'), 'url' => ['/payment/paymentBackend/index']],
    ['icon' => 'fa fa-fw fa-plus-square', 'label' => Yii::t('PaymentModule.payment', 'Create payment'), 'url' => ['/payment/paymentBackend/create']]
];
?>

        <?php echo Yii::t('PaymentModule.payment', 'Payment method'); ?>
        <?php echo Yii::t('PaymentModule.payment', 'creating'); ?>

<?php echo $this->renderPartial('_form', ['model' => $model]); ?>


text:
enum
{
    MAX_COUNT = 5,
    LINE_SPACE = 40,
    kItemTagBasic = 1000,
};

const std::string testsName[MAX_COUNT] =
{
    "PerformanceNodeChildrenTest",
    "PerformanceParticleTest",
    "PerformanceSpriteTest",
    "PerformanceTextureTest",
    "PerformanceTouchesTest"
};

////////////////////////////////////////////////////////
//
// PerformanceMainLayer
//
////////////////////////////////////////////////////////
void PerformanceMainLayer::onEnter()
{
    CCLayer::onEnter();

    CCSize s = CCDirector::sharedDirector()->getWinSize();

    CCMenu* pMenu = CCMenu::create();
    pMenu->setPosition( CCPointZero );
    CCMenuItemFont::setFontName("Arial");
    CCMenuItemFont::setFontSize(24);
    for (int i = 0; i < MAX_COUNT; ++i)
    {
        CCMenuItemFont* pItem = CCMenuItemFont::create(testsName[i].c_str(), this,
                                                    menu_selector(PerformanceMainLayer::menuCallback));
        pItem->setPosition(ccp(s.width / 2, s.height - (i + 1) * LINE_SPACE));
        pMenu->addChild(pItem, kItemTagBasic + i);
    }

    addChild(pMenu);
}

void PerformanceMainLayer::menuCallback(CCObject* pSender)
{
    CCMenuItemFont* pItem = (CCMenuItemFont*)pSender;
    int nIndex = pItem->getZOrder() - kItemTagBasic;

    switch (nIndex)
    {
    case 0:
        runNodeChildrenTest();
        break;
    case 1:
        runParticleTest();
        break;
    case 2:
        runSpriteTest();
        break;
    case 3:
        runTextureTest();
        break;
    case 4:
        runTouchesTest();
        break;
    default:
        break;
    }
}

////////////////////////////////////////////////////////
//
// PerformBasicLayer
//
////////////////////////////////////////////////////////
PerformBasicLayer::PerformBasicLayer(bool bControlMenuVisible, int nMaxCases, int nCurCase)
: m_bControlMenuVisible(bControlMenuVisible)
, m_nMaxCases(nMaxCases)
, m_nCurCase(nCurCase)
{

}

void PerformBasicLayer::onEnter()
{
    CCLayer::onEnter();

    CCSize s = CCDirector::sharedDirector()->getWinSize();

    CCMenuItemFont::setFontName("Arial");
    CCMenuItemFont::setFontSize(24);
    CCMenuItemFont* pMainItem = CCMenuItemFont::create("Back", this,
                                                    menu_selector(PerformBasicLayer::toMainLayer));
    pMainItem->setPosition(ccp(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25));
    CCMenu* pMenu = CCMenu::create(pMainItem, NULL);
    pMenu->setPosition( CCPointZero );

    if (m_bControlMenuVisible)
    {
        CCMenuItemImage *item1 = CCMenuItemImage::create(s_pPathB1, s_pPathB2, this, menu_selector(PerformBasicLayer::backCallback) );
        CCMenuItemImage *item2 = CCMenuItemImage::create(s_pPathR1, s_pPathR2, this, menu_selector(PerformBasicLayer::restartCallback) );
        CCMenuItemImage *item3 = CCMenuItemImage::create(s_pPathF1, s_pPathF2, this, menu_selector(PerformBasicLayer::nextCallback) );
        item1->setPosition(ccp(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2));
        item2->setPosition(ccp(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2));
        item3->setPosition(ccp(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2));

        pMenu->addChild(item1, kItemTagBasic);
        pMenu->addChild(item2, kItemTagBasic);
        pMenu->addChild(item3, kItemTagBasic);
    }
    addChild(pMenu);
}

void PerformBasicLayer::toMainLayer(CCObject* pSender)
{
    PerformanceTestScene* pScene = new PerformanceTestScene();
    pScene->runThisTest();

    pScene->release();
}

void PerformBasicLayer::restartCallback(CCObject* pSender)
{
    showCurrentTest();
}

void PerformBasicLayer::nextCallback(CCObject* pSender)
{
    m_nCurCase++;
    m_nCurCase = m_nCurCase % m_nMaxCases;

    showCurrentTest();
}

void PerformBasicLayer::backCallback(CCObject* pSender)
{
    m_nCurCase--;
    if( m_nCurCase < 0 )
        m_nCurCase += m_nMaxCases;

    showCurrentTest();
}

////////////////////////////////////////////////////////
//
// PerformanceTestScene
//
////////////////////////////////////////////////////////

void PerformanceTestScene::runThisTest()
{
    CCLayer* pLayer = new PerformanceMainLayer();
    addChild(pLayer);
    pLayer->release();

    CCDirector::sharedDirector()->replaceScene(this);
}


text:
// Copyright 2020 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.syntax;

import com.google.devtools.build.lib.syntax.util.EvaluationTestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Tests for StringModule. */
// TODO(bazel-team): Migrate these test cases back to string_misc.sky, once either
// 1) --incompatible_string_replace_count has been flipped (#11244) and deleted, or 2) the
// standalone Starlark interpreter and tests gain the ability to run with semantics flags.
@RunWith(JUnit4.class)
public class StringModuleTest extends EvaluationTestCase {

  private void runReplaceTest(String flag) throws Exception {
    new Scenario(flag)
        .testEval("'banana'.replace('a', 'o')", "'bonono'")
        .testEval("'banana'.replace('a', 'o', 2)", "'bonona'")
        .testEval("'banana'.replace('a', 'o', 0)", "'banana'")
        .testEval("'banana'.replace('a', 'e')", "'benene'")
        .testEval("'banana'.replace('a', '$()')", "'b$()n$()n$()'")
        .testEval("'banana'.replace('a', '$')", "'b$n$n$'")
        .testEval("'b$()n$()n$()'.replace('$()', '$($())')", "'b$($())n$($())n$($())'")
        .testEval("'banana'.replace('a', 'e', 2)", "'benena'")
        .testEval("'banana'.replace('a', 'e', 0)", "'banana'")
        .testEval("'banana'.replace('', '-')", "'-b-a-n-a-n-a-'")
        .testEval("'banana'.replace('', '-', 2)", "'-b-anana'")
        .testEval("'banana'.replace('', '-', 0)", "'banana'")
        .testEval("'banana'.replace('', '')", "'banana'")
        .testEval("'banana'.replace('a', '')", "'bnn'")
        .testEval("'banana'.replace('a', '', 2)", "'bnna'");
  }

  @Test
  public void testReplaceWithAndWithoutFlag() throws Exception {
    runReplaceTest("--incompatible_string_replace_count=false");
    runReplaceTest("--incompatible_string_replace_count=true");
  }

  @Test
  public void testReplaceIncompatibleFlag() throws Exception {
    // Test the scenario that changes with the incompatible flag
    new Scenario("--incompatible_string_replace_count=false")
        .testEval("'banana'.replace('a', 'o', -2)", "'banana'")
        .testEval("'banana'.replace('a', 'e', -1)", "'banana'")
        .testEval("'banana'.replace('a', 'e', -10)", "'banana'")
        .testEval("'banana'.replace('', '-', -2)", "'banana'");

    new Scenario("--incompatible_string_replace_count=true")
        .testEval("'banana'.replace('a', 'o', -2)", "'bonono'")
        .testEval("'banana'.replace('a', 'e', -1)", "'benene'")
        .testEval("'banana'.replace('a', 'e', -10)", "'benene'")
        .testEval("'banana'.replace('', '-', -2)", "'-b-a-n-a-n-a-'");
  }

  @Test
  public void testReplaceNoneCount() throws Exception {
    // Passing None as the max number of replacements is disallowed with the incompatible flag.
    new Scenario("--incompatible_string_replace_count=false")
        .testEval("'banana'.replace('a', 'e', None)", "'benene'");
    new Scenario("--incompatible_string_replace_count=true")
        .testIfErrorContains("Cannot pass a None count", "'banana'.replace('a', 'e', None)");
  }
}


text:
"use strict";
var $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__,
    $___46__46__47_syntax_47_trees_47_ParseTreeType_46_js__,
    $___46__46__47_syntax_47_ParseTreeVisitor_46_js__,
    $__ScopeTransformer_46_js__,
    $__ParseTreeFactory_46_js__,
    $__ModuleTransformer_46_js__,
    $___46__46__47_syntax_47_TokenType_46_js__,
    $__PlaceholderParser_46_js__,
    $__HoistVariablesTransformer_46_js__;
var $__0 = ($___46__46__47_syntax_47_trees_47_ParseTrees_46_js__ = require("../syntax/trees/ParseTrees.js"), $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__ && $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__.__esModule && $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__ || {default: $___46__46__47_syntax_47_trees_47_ParseTrees_46_js__}),
    AnonBlock = $__0.AnonBlock,
    ArrayLiteralExpression = $__0.ArrayLiteralExpression,
    ClassExpression = $__0.ClassExpression,
    CommaExpression = $__0.CommaExpression,
    ExpressionStatement = $__0.ExpressionStatement,
    VariableDeclaration = $__0.VariableDeclaration;
var $__1 = ($___46__46__47_syntax_47_trees_47_ParseTreeType_46_js__ = require("../syntax/trees/ParseTreeType.js"), $___46__46__47_syntax_47_trees_47_ParseTreeType_46_js__ && $___46__46__47_syntax_47_trees_47_ParseTreeType_46_js__.__esModule && $___46__46__47_syntax_47_trees_47_ParseTreeType_46_js__ || {default: $___46__46__47_syntax_47_trees_47_ParseTreeType_46_js__}),
    CLASS_DECLARATION = $__1.CLASS_DECLARATION,
    FUNCTION_DECLARATION = $__1.FUNCTION_DECLARATION,
    IDENTIFIER_EXPRESSION = $__1.IDENTIFIER_EXPRESSION,
    IMPORT_SPECIFIER_SET = $__1.IMPORT_SPECIFIER_SET,
    NAME_SPACE_IMPORT = $__1.NAME_SPACE_IMPORT;
var ParseTreeVisitor = ($___46__46__47_syntax_47_ParseTreeVisitor_46_js__ = require("../syntax/ParseTreeVisitor.js"), $___46__46__47_syntax_47_ParseTreeVisitor_46_js__ && $___46__46__47_syntax_47_ParseTreeVisitor_46_js__.__esModule && $___46__46__47_syntax_47_ParseTreeVisitor_46_js__ || {default: $___46__46__47_syntax_47_ParseTreeVisitor_46_js__}).ParseTreeVisitor;
var ScopeTransformer = ($__ScopeTransformer_46_js__ = require("./ScopeTransformer.js"), $__ScopeTransformer_46_js__ && $__ScopeTransformer_46_js__.__esModule && $__ScopeTransformer_46_js__ || {default: $__ScopeTransformer_46_js__}).ScopeTransformer;
var $__4 = ($__ParseTreeFactory_46_js__ = require("./ParseTreeFactory.js"), $__ParseTreeFactory_46_js__ && $__ParseTreeFactory_46_js__.__esModule && $__ParseTreeFactory_46_js__ || {default: $__ParseTreeFactory_46_js__}),
    createEmptyParameterList = $__4.createEmptyParameterList,
    createFunctionBody = $__4.createFunctionBody,
    createFunctionExpression = $__4.createFunctionExpression,
    id = $__4.createIdentifierExpression,
    createObjectLiteral = $__4.createObjectLiteral,
    createVariableDeclarationList = $__4.createVariableDeclarationList,
    createVariableStatement = $__4.createVariableStatement;
var ModuleTransformer = ($__ModuleTransformer_46_js__ = require("./ModuleTransformer.js"), $__ModuleTransformer_46_js__ && $__ModuleTransformer_46_js__.__esModule && $__ModuleTransformer_46_js__ || {default: $__ModuleTransformer_46_js__}).ModuleTransformer;
var $__6 = ($___46__46__47_syntax_47_TokenType_46_js__ = require("../syntax/TokenType.js"), $___46__46__47_syntax_47_TokenType_46_js__ && $___46__46__47_syntax_47_TokenType_46_js__.__esModule && $___46__46__47_syntax_47_TokenType_46_js__ || {default: $___46__46__47_syntax_47_TokenType_46_js__}),
    MINUS_MINUS = $__6.MINUS_MINUS,
    PLUS_PLUS = $__6.PLUS_PLUS,
    VAR = $__6.VAR;
var $__7 = ($__PlaceholderParser_46_js__ = require("./PlaceholderParser.js"), $__PlaceholderParser_46_js__ && $__PlaceholderParser_46_js__.__esModule && $__PlaceholderParser_46_js__ || {default: $__PlaceholderParser_46_js__}),
    parseExpression = $__7.parseExpression,
    parseStatement = $__7.parseStatement,
    parseStatements = $__7.parseStatements;
var HoistVariablesTransformer = ($__HoistVariablesTransformer_46_js__ = require("./HoistVariablesTransformer.js"), $__HoistVariablesTransformer_46_js__ && $__HoistVariablesTransformer_46_js__.__esModule && $__HoistVariablesTransformer_46_js__ || {default: $__HoistVariablesTransformer_46_js__}).default;
var ExportBindingsVisitor = function($__super) {
  function ExportBindingsVisitor() {
    $traceurRuntime.superConstructor(ExportBindingsVisitor).call(this);
    this.bindings = [];
  }
  return ($traceurRuntime.createClass)(ExportBindingsVisitor, {
    visitVariableDeclaration: function(tree) {
      this.visitAny(tree.lvalue);
    },
    visitBindingIdentifier: function(tree) {
      this.bindings.push(tree);
    },
    visitBindingElement: function(tree) {
      this.visitAny(tree.binding);
    }
  }, {}, $__super);
}(ParseTreeVisitor);
var DeclarationExtractionTransformer = function($__super) {
  function DeclarationExtractionTransformer() {
    $traceurRuntime.superConstructor(DeclarationExtractionTransformer).call(this);
    this.declarations_ = [];
  }
  return ($traceurRuntime.createClass)(DeclarationExtractionTransformer, {
    getDeclarationStatements: function() {
      return $traceurRuntime.spread([this.getVariableStatement()], this.declarations_);
    },
    addDeclaration: function(tree) {
      this.declarations_.push(tree);
    },
    transformFunctionDeclaration: function(tree) {
      this.addDeclaration(tree);
      return new AnonBlock(null, []);
    },
    transformClassDeclaration: function(tree) {
      this.addVariable(tree.name.identifierToken.value);
      tree = new ClassExpression(tree.location, tree.name, tree.superClass, tree.elements, tree.annotations, tree.typeParameters);
      return parseStatement($traceurRuntime.getTemplateObject(["", " = ", ""]), tree.name.identifierToken, tree);
    }
  }, {}, $__super);
}(HoistVariablesTransformer);
var InsertBindingAssignmentTransformer = function($__super) {
  function InsertBindingAssignmentTransformer(exportName, bindingName) {
    $traceurRuntime.superConstructor(InsertBindingAssignmentTransformer).call(this, bindingName);
    this.bindingName_ = bindingName;
    this.exportName_ = exportName;
  }
  return ($traceurRuntime.createClass)(InsertBindingAssignmentTransformer, {
    matchesBindingName_: function(binding) {
      return binding.type === IDENTIFIER_EXPRESSION && binding.identifierToken.value === this.bindingName_;
    },
    transformUnaryExpression: function(tree) {
      if (!this.matchesBindingName_(tree.operand))
        return $traceurRuntime.superGet(this, InsertBindingAssignmentTransformer.prototype, "transformUnaryExpression").call(this, tree);
      var operatorType = tree.operator.type;
      if (operatorType !== PLUS_PLUS && operatorType !== MINUS_MINUS)
        return $traceurRuntime.superGet(this, InsertBindingAssignmentTransformer.prototype, "transformUnaryExpression").call(this, tree);
      var operand = this.transformAny(tree.operand);
      if (operand !== tree.operand)
        tree = new UnaryExpression(tree.location, tree.operator, operand);
      return parseExpression($traceurRuntime.getTemplateObject(["$__export(", ", ", ")"]), this.exportName_, tree);
    },
    transformPostfixExpression: function(tree) {
      tree = $traceurRuntime.superGet(this, InsertBindingAssignmentTransformer.prototype, "transformPostfixExpression").call(this, tree);
      if (!this.matchesBindingName_(tree.operand))
        return tree;
      switch (tree.operator.type) {
        case PLUS_PLUS:
          return parseExpression($traceurRuntime.getTemplateObject(["($__export(", ", ", " + 1), ", ")"]), this.exportName_, tree.operand, tree);
        case MINUS_MINUS:
          return parseExpression($traceurRuntime.getTemplateObject(["($__export(", ", ", " - 1), ", ")"]), this.exportName_, tree.operand, tree);
      }
      return tree;
    },
    transformBinaryExpression: function(tree) {
      tree = $traceurRuntime.superGet(this, InsertBindingAssignmentTransformer.prototype, "transformBinaryExpression").call(this, tree);
      if (!tree.operator.isAssignmentOperator())
        return tree;
      if (!this.matchesBindingName_(tree.left))
        return tree;
      return parseExpression($traceurRuntime.getTemplateObject(["$__export(", ", ", ")}"]), this.exportName_, tree);
    }
  }, {}, $__super);
}(ScopeTransformer);
var InstantiateModuleTransformer = function($__super) {
  function InstantiateModuleTransformer(identifierGenerator, reporter) {
    var options = arguments[2];
    $traceurRuntime.superConstructor(InstantiateModuleTransformer).call(this, identifierGenerator, reporter, options);
    this.anonymousModule = options && !options.bundle && options.moduleName !== true;
    this.inExport_ = false;
    this.curDepIndex_ = null;
    this.dependencies = [];
    this.externalExportBindings = [];
    this.importBindings = [];
    this.localExportBindings = [];
    this.functionDeclarations = [];
    this.moduleBindings = [];
    this.exportStarBindings = [];
  }
  return ($traceurRuntime.createClass)(InstantiateModuleTransformer, {
    getModuleName: function(tree) {
      if (this.anonymousModule)
        return null;
      return tree.moduleName;
    },
    moduleProlog: function() {
      return [];
    },
    wrapModule: function(statements) {
      var prolog = $traceurRuntime.superGet(this, InstantiateModuleTransformer.prototype, "moduleProlog").call(this);
      statements = prolog.concat(statements);
      if (this.moduleName) {
        return parseStatements($traceurRuntime.getTemplateObject(["System.register(", ",\n          ", ", function($__export) {\n            ", "\n          });"]), this.moduleName, this.dependencies, statements);
      } else {
        return parseStatements($traceurRuntime.getTemplateObject(["System.register(", ", function($__export) {\n          ", "\n        });"]), this.dependencies, statements);
      }
    },
    appendExportStatement: function(statements) {
      var $__9 = this;
      var declarationExtractionTransformer = new DeclarationExtractionTransformer();
      this.localExportBindings.forEach(function(binding) {
        statements = new InsertBindingAssignmentTransformer(binding.exportName, binding.localName).transformList(statements);
      });
      var executionStatements = statements.map(function(statement) {
        return declarationExtractionTransformer.transformAny(statement);
      });
      var executionFunction = createFunctionExpression(createEmptyParameterList(), createFunctionBody(executionStatements));
      var declarationStatements = declarationExtractionTransformer.getDeclarationStatements();
      var setterFunctions = this.dependencies.map(function(dep, index) {
        var importBindings = $__9.importBindings[index];
        var externalExportBindings = $__9.externalExportBindings[index];
        var exportStarBinding = $__9.exportStarBindings[index];
        var moduleBinding = $__9.moduleBindings[index];
        var setterStatements = [];
        if (importBindings) {
          importBindings.forEach(function(binding) {
            setterStatements.push(parseStatement($traceurRuntime.getTemplateObject(["", " = $__m.", ";"]), id(binding.variableName), binding.exportName));
          });
        }
        if (externalExportBindings) {
          externalExportBindings.forEach(function($__11) {
            var $__12 = $__11,
                exportName = $__12.exportName,
                importName = $__12.importName;
            var statement = importName === null ? parseStatement($traceurRuntime.getTemplateObject(["$__export(", ", $__m);"]), exportName) : parseStatement($traceurRuntime.getTemplateObject(["$__export(", ", $__m.", ");"]), exportName, importName);
            setterStatements.push(statement);
          });
        }
        if (moduleBinding) {
          setterStatements.push(parseStatement($traceurRuntime.getTemplateObject(["", " = $__m;"]), id(moduleBinding)));
        }
        if (exportStarBinding) {
          setterStatements = setterStatements.concat(parseStatements($traceurRuntime.getTemplateObject(["\n          Object.keys($__m).forEach(function(p) {\n            if (p !== 'default' && !$__exportNames[p])\n              $__export(p, $__m[p]);\n          });\n        "])));
          var exportNames = {};
          $__9.localExportBindings.concat($__9.externalExportBindings).forEach(function(binding) {
            exportNames[binding.exportName] = true;
          });
          declarationStatements.push(parseStatement($traceurRuntime.getTemplateObject(["\n          var $__exportNames = ", ";\n        "]), createObjectLiteral(exportNames)));
        }
        if (setterStatements.length) {
          return parseExpression($traceurRuntime.getTemplateObject(["function($__m) {\n          ", "\n        }"]), setterStatements);
        }
        return parseExpression($traceurRuntime.getTemplateObject(["function($__m) {}"]));
      });
      declarationStatements = declarationStatements.concat(this.functionDeclarations.map(function(binding) {
        return parseStatement($traceurRuntime.getTemplateObject(["$__export(", ", ", ")"]), binding.exportName, id(binding.functionName));
      }));
      declarationStatements.push(parseStatement($traceurRuntime.getTemplateObject(["return {\n      setters: ", ",\n      execute: ", "\n    }"]), new ArrayLiteralExpression(null, setterFunctions), executionFunction));
      return declarationStatements;
    },
    addLocalExportBinding: function(exportName) {
      var localName = arguments[1] !== (void 0) ? arguments[1] : exportName;
      this.localExportBindings.push({
        exportName: exportName,
        localName: localName
      });
    },
    addImportBinding: function(depIndex, variableName, exportName) {
      this.importBindings[depIndex] = this.importBindings[depIndex] || [];
      this.importBindings[depIndex].push({
        variableName: variableName,
        exportName: exportName
      });
    },
    addExternalExportBinding: function(depIndex, exportName, importName) {
      this.externalExportBindings[depIndex] = this.externalExportBindings[depIndex] || [];
      this.externalExportBindings[depIndex].push({
        exportName: exportName,
        importName: importName
      });
    },
    addExportStarBinding: function(depIndex) {
      this.exportStarBindings[depIndex] = true;
    },
    addModuleBinding: function(depIndex, variableName) {
      this.moduleBindings[depIndex] = variableName;
    },
    addExportFunction: function(exportName) {
      var functionName = arguments[1] !== (void 0) ? arguments[1] : exportName;
      this.functionDeclarations.push({
        exportName: exportName,
        functionName: functionName
      });
    },
    getOrCreateDependencyIndex: function(moduleSpecifier) {
      var name = moduleSpecifier.token.processedValue;
      var depIndex = this.dependencies.indexOf(name);
      if (depIndex === -1) {
        depIndex = this.dependencies.length;
        this.dependencies.push(name);
      }
      return depIndex;
    },
    transformExportDeclaration: function(tree) {
      this.inExport_ = true;
      if (tree.declaration.moduleSpecifier) {
        this.curDepIndex_ = this.getOrCreateDependencyIndex(tree.declaration.moduleSpecifier);
      } else {
        this.curDepIndex_ = null;
      }
      var transformed = this.transformAny(tree.declaration);
      this.inExport_ = false;
      return transformed;
    },
    transformVariableStatement: function(tree) {
      if (!this.inExport_)
        return $traceurRuntime.superGet(this, InstantiateModuleTransformer.prototype, "transformVariableStatement").call(this, tree);
      this.inExport_ = false;
      var bindingVisitor = new ExportBindingsVisitor();
      bindingVisitor.visitAny(tree);
      var statements = [];
      for (var i = 0; i < bindingVisitor.bindings.length; i++) {
        var identifierToken = bindingVisitor.bindings[i].identifierToken;
        var name = identifierToken.value;
        this.addLocalExportBinding(name);
        statements.push(parseStatement($traceurRuntime.getTemplateObject(["$__export(", ", ", ")"]), name, id(identifierToken)));
      }
      statements.unshift($traceurRuntime.superGet(this, InstantiateModuleTransformer.prototype, "transformAny").call(this, tree));
      return new AnonBlock(null, statements);
    },
    transformExportStar: function(tree) {
      this.inExport_ = false;
      this.addExportStarBinding(this.curDepIndex_);
      return new AnonBlock(null, []);
    },
    transformClassDeclaration: function(tree) {
      if (!this.inExport_)
        return $traceurRuntime.superGet(this, InstantiateModuleTransformer.prototype, "transformClassDeclaration").call(this, tree);
      this.inExport_ = false;
      var identifierToken = tree.name.identifierToken;
      var name = identifierToken.value;
      this.addLocalExportBinding(name);
      var statements = [$traceurRuntime.superGet(this, InstantiateModuleTransformer.prototype, "transformClassDeclaration").call(this, tree), parseStatement($traceurRuntime.getTemplateObject(["$__export(", ", ", ")"]), name, id(identifierToken))];
      return new AnonBlock(null, statements);
    },
    transformFunctionDeclaration: function(tree) {
      if (this.inExport_) {
        var name = tree.name.getStringValue();
        this.addLocalExportBinding(name);
        this.addExportFunction(name);
        this.inExport_ = false;
      }
      return $traceurRuntime.superGet(this, InstantiateModuleTransformer.prototype, "transformFunctionDeclaration").call(this, tree);
    },
    transformNamedExport: function(tree) {
      this.transformAny(tree.moduleSpecifier);
      var exportClause = this.transformAny(tree.exportClause);
      if (this.curDepIndex_ === null) {
        return exportClause;
      }
      return new AnonBlock(null, []);
    },
    transformImportDeclaration: function(tree) {
      this.curDepIndex_ = this.getOrCreateDependencyIndex(tree.moduleSpecifier);
      var initializer = this.transformAny(tree.moduleSpecifier);
      if (!tree.importClause) {
        return new AnonBlock(null, []);
      }
      var importClause = this.transformAny(tree.importClause);
      if (tree.importClause.type === NAME_SPACE_IMPORT) {
        var bindingIdentifier = tree.importClause.binding.binding;
        var name = bindingIdentifier.getStringValue();
        this.addModuleBinding(this.curDepIndex_, name);
        return parseStatement($traceurRuntime.getTemplateObject(["var ", ";"]), bindingIdentifier);
      }
      if (tree.importClause.type === IMPORT_SPECIFIER_SET) {
        return importClause;
      }
      var bindingName = tree.importClause.binding.getStringValue();
      this.addImportBinding(this.curDepIndex_, bindingName, 'default');
      return parseStatement($traceurRuntime.getTemplateObject(["var ", ";"]), bindingName);
    },
    transformImportSpecifierSet: function(tree) {
      return createVariableStatement(createVariableDeclarationList(VAR, this.transformList(tree.specifiers)));
    },
    transformExportDefault: function(tree) {
      this.inExport_ = false;
      var expression = this.transformAny(tree.expression);
      this.addLocalExportBinding('default');
      if (expression.type === CLASS_DECLARATION) {
        expression = new ClassExpression(expression.location, expression.name, expression.superClass, expression.elements, expression.annotations, expression.typeParameters);
      }
      if (expression.type === FUNCTION_DECLARATION) {
        this.addExportFunction('default', expression.name.identifierToken.value);
        return expression;
      } else {
        return parseStatement($traceurRuntime.getTemplateObject(["$__export('default', ", ");"]), expression);
      }
    },
    transformExportSpecifier: function(tree) {
      var exportName;
      var bindingName;
      if (tree.rhs) {
        exportName = tree.rhs.value;
        bindingName = tree.lhs.value;
      } else {
        exportName = tree.lhs.value;
        bindingName = exportName;
      }
      if (this.curDepIndex_ !== null) {
        this.addExternalExportBinding(this.curDepIndex_, exportName, bindingName);
      } else {
        this.addLocalExportBinding(exportName, bindingName);
        return parseExpression($traceurRuntime.getTemplateObject(["$__export(", ", ", ");"]), exportName, id(bindingName));
      }
    },
    transformExportSpecifierSet: function(tree) {
      var specifiers = this.transformList(tree.specifiers);
      return new ExpressionStatement(tree.location, new CommaExpression(tree.location, specifiers.filter(function(specifier) {
        return specifier;
      })));
    },
    transformNameSpaceExport: function(tree) {
      this.addExternalExportBinding(this.curDepIndex_, tree.name.value, null);
      return tree;
    },
    transformForwardDefaultExport: function(tree) {
      this.addExternalExportBinding(this.curDepIndex_, tree.name.value, 'default');
      return tree;
    },
    transformImportSpecifier: function(tree) {
      var localBinding = tree.binding.binding;
      var localBindingToken = localBinding.identifierToken;
      var importName = (tree.name || localBindingToken).value;
      this.addImportBinding(this.curDepIndex_, localBindingToken.value, importName);
      return new VariableDeclaration(tree.location, localBinding, null, null);
    },
    transformModuleSpecifier: function(tree) {
      this.curDepIndex_ = this.getOrCreateDependencyIndex(tree);
      return tree;
    }
  }, {}, $__super);
}(ModuleTransformer);
Object.defineProperties(module.exports, {
  InstantiateModuleTransformer: {get: function() {
      return InstantiateModuleTransformer;
    }},
  __esModule: {value: true}
});


text:
package com.android.server.lights;

public abstract class Light {
    public static final int LIGHT_FLASH_NONE = 0;
    public static final int LIGHT_FLASH_TIMED = 1;
    public static final int LIGHT_FLASH_HARDWARE = 2;

    /**
     * Light brightness is managed by a user setting.
     */
    public static final int BRIGHTNESS_MODE_USER = 0;

    /**
     * Light brightness is managed by a light sensor.
     */
    public static final int BRIGHTNESS_MODE_SENSOR = 1;

    /**
     * Low-persistence light mode.
     */
    public static final int BRIGHTNESS_MODE_LOW_PERSISTENCE = 2;

    public abstract void setBrightness(int brightness);
    public abstract void setBrightness(int brightness, int brightnessMode);
    public abstract void setColor(int color);
    public abstract void setFlashing(int color, int mode, int onMS, int offMS);
    public abstract void pulse();
    public abstract void pulse(int color, int onMS);
    public abstract void turnOff();
}


text:
{% extends '../layouts/default.html' %}

{% block content %}

Login

    <form action="/login" method="post">

                Email
                <input id="username" type="text" name="un" value="{{ username }}" >

                Password
                <input id="password" type="password" name="pw" >

                <button type="submit">Go</button>

    </form>

Register

{% endblock %}


text:
/*jslint browser: true */
/*global jQuery */
if (jQuery) {
    (function ($) {
        "use strict";
        $(document).ready(function () {
            // initialize the megamenu
            $('.megamenu').accessibleMegaMenu();

            // hack so that the megamenu doesn't show flash of css animation after the page loads.
            setTimeout(function () {
                $('body').removeClass('init');
            }, 500);
        });
    }(jQuery));
}

var jsonCategories = "/scripts/jsons/market-categories.json";


text:
<?php

namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\Type;

use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\Options\Type\DropDown as AbstractOptions;

/**
 * Class RadioButtons
 * Form "Option radio button" on tab product "Custom options"
 */
class RadioButtons extends AbstractOptions
{
    // Parent behavior
}


text:
class Backer < ActiveRecord::Base
  include ActionView::Helpers::NumberHelper
  include ActionView::Helpers::DateHelper
  belongs_to :project
  belongs_to :user
  belongs_to :reward
  has_many :payment_notifications
  validates_presence_of :project, :user, :value
  validates_numericality_of :value, :greater_than_or_equal_to => 5.00
  validate :reward_must_be_from_project
  scope :anonymous, where(:anonymous => true)
  scope :not_anonymous, where(:anonymous => false)
  scope :confirmed, where(:confirmed => true)
  scope :not_confirmed, where(:confirmed => false)
  scope :pending, where(:confirmed => false)
  # Backers already refunded or with requested_refund should appear so that the user can see their status on the refunds list
  scope :can_refund, ->{ where("confirmed AND EXISTS(SELECT true FROM projects p WHERE p.id = backers.project_id AND finished AND NOT successful) AND date(current_timestamp) <= date(created_at + interval '180 days')") }
  attr_protected :confirmed

  def price_in_cents
    (self.value * 100).round
  end
  def refund!
    self.refunded = true
    self.save
  end
  def confirm!
    self.confirmed = true
    self.save
  end

  def can_refund?
    confirmed? && created_at >= (Date.today - 180.days) && project.finished? && !project.successful?
  end

  def reward_must_be_from_project
    return unless reward
    errors.add(:reward, I18n.t('backer.reward_must_be_from_project')) unless reward.project == project
  end

  validate :value_must_be_at_least_rewards_value

  def value_must_be_at_least_rewards_value
    return unless reward
    errors.add(:value, I18n.t('backer.value_must_be_at_least_rewards_value', :minimum_value => reward.display_minimum)) unless value >= reward.minimum_value
  end

  validate :should_not_back_if_maximum_backers_been_reached, :on => :create

  def should_not_back_if_maximum_backers_been_reached
    return unless reward and reward.maximum_backers and reward.maximum_backers > 0
    errors.add(:reward, I18n.t('backer.should_not_back_if_maximum_backers_been_reached')) unless reward.backers.confirmed.count < reward.maximum_backers
  end

  def display_value
    number_to_currency value, :unit => "$", :precision => 0, :delimiter => ','
  end

  def display_confirmed_at
    I18n.l(confirmed_at.to_date) if confirmed_at
  end

  def platform_fee(fee=7.5)
    (value.to_f * fee)/100
  end

  def display_platform_fee(fee=7.5)
    number_to_currency platform_fee(fee), :unit => "$", :precision => 2, :delimiter => ','
  end
  def moip_value
    "%0.0f" % (value * 100)
  end

  def cancel_refund_request!
    raise I18n.t('credits.cannot_cancel_refund_reques') unless self.requested_refund
    raise I18n.t('credits.refund.refunded') if self.refunded
    raise I18n.t('credits.refund.no_credits') unless self.user.credits >= self.value
    self.update_attributes({ requested_refund: false })
    self.user.update_attributes({ credits: (self.user.credits + self.value) })
  end

  def as_json(options={})
    json_attributes = {
      :id => id,
      :anonymous => anonymous,
      :confirmed => confirmed,
      :confirmed_at => display_confirmed_at,
      :value => display_value,
      :user => user.as_json(options.merge(:anonymous => anonymous)),
      :display_value => nil,
      :reward => nil
    }
    if options and options[:can_manage]
      json_attributes.merge!({
        :display_value => display_value,
        :reward => reward
      })
    end
    if options and options[:include_project]
      json_attributes.merge!({:project => project})
    end
    if options and options[:include_reward]
      json_attributes.merge!({:reward => reward})
    end
    json_attributes
  end

  #==== Used on before and after callbacks

  def define_key
    self.update_attributes({ key: Digest::MD5.new.update("#{self.id}###{self.created_at}###{Kernel.rand}").to_s })
  end

  def define_payment_method
    self.update_attributes({ payment_method: 'MoIP' })
  end
end


text:
#import "CountryCell.h"

#import "MDFInternationalization.h"

@implementation CountryCell

// Mirroring images could take a non-trivial amount of time to create, so we cache the images.
static UIImage *sSpeakingIcon;
static UIImage *sNonspeakingIcon;

- (void)awakeFromNib {
  [super awakeFromNib];

  // A flag imageview should not be mirrored in Right-to-Left so we force the view to Left-to-Right.
  self.flagView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

  // The speech indicator icon can be mirrored, so we keep the default of
  // UISemanticContentAttributeUnspecified.
  //  self.speechIcon.semanticContentAttribute = UISemanticContentAttributeUnspecified;

  // Our country name label takes up the middle of our cell, but will automatically align the
  // text based on it's default textAlignment of NSTextAlignmentNatural.  So we leave its
  // semanticContentAttribute value as the default UISemanticContentAttributeUnspecified.
  //  self.nameLabel.semanticContentAttribute = UISemanticContentAttributeUnspecified;

  // Mirroring images could take a non-trivial amount of time, so we cache the resulting images.
  static dispatch_once_t onceToken;
  dispatch_once(&onceToken, ^{
    sSpeakingIcon = [UIImage imageNamed:@"Speaking"];
    sNonspeakingIcon = [UIImage imageNamed:@"Nonspeaking"];
    if (self.speechIcon.mdf_effectiveUserInterfaceLayoutDirection !=
        UIUserInterfaceLayoutDirectionLeftToRight) {
      sSpeakingIcon = [sSpeakingIcon mdf_imageWithHorizontallyFlippedOrientation];
      sNonspeakingIcon = [sNonspeakingIcon mdf_imageWithHorizontallyFlippedOrientation];
    }
  });
}

- (void)layoutSubviews {
  // We manually calculate the frames for the views in our country cell
  CGFloat flagWidth = ceil(CGRectGetWidth(self.bounds) * 0.25);
  CGFloat flagHeight = CGRectGetHeight(self.bounds);
  CGRect flagFrame = CGRectMake(0.0, 0.0, flagWidth, flagHeight);
  flagFrame = CGRectInset(flagFrame, 4.0, 4.0);

  CGFloat speakIconWidth = ceil(CGRectGetWidth(self.bounds) * 0.15);
  CGFloat speakIconHeight = CGRectGetHeight(self.bounds);
  CGRect speechIconFrame = CGRectMake(0.0, 0.0, speakIconWidth, speakIconHeight);
  speechIconFrame.origin.x = CGRectGetWidth(self.bounds) - CGRectGetWidth(speechIconFrame);

  CGFloat nameWidth =
      CGRectGetWidth(self.bounds) - CGRectGetWidth(flagFrame) - CGRectGetWidth(speechIconFrame);
  CGFloat nameHeight = CGRectGetHeight(self.bounds);
  CGRect nameFrame = CGRectMake(0.0, 0.0, nameWidth, nameHeight);
  nameFrame.origin.x = CGRectGetMaxX(flagFrame);
  nameFrame = CGRectInset(nameFrame, 4.0, 0.0);

  // Mirror the framges if we are in RightToLeft mode.
  if (self.mdf_effectiveUserInterfaceLayoutDirection != UIUserInterfaceLayoutDirectionLeftToRight) {
    flagFrame = MDFRectFlippedHorizontally(flagFrame, CGRectGetWidth(self.bounds));
    nameFrame = MDFRectFlippedHorizontally(nameFrame, CGRectGetWidth(self.bounds));
    speechIconFrame = MDFRectFlippedHorizontally(speechIconFrame, CGRectGetWidth(self.bounds));
  }

  // Set the view frames
  self.flagView.frame = flagFrame;
  self.nameLabel.frame = nameFrame;
  self.speechIcon.frame = speechIconFrame;
}

// Adjust our speech indicator if we are actively speaking the name of the country.
- (void)setSpeakingName:(BOOL)speakingName {
  if (speakingName) {
    self.speechIcon.image = sSpeakingIcon;
  } else {
    self.speechIcon.image = sNonspeakingIcon;
  }
}

@end


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.7
 *
 * This file is not intended to be easily readable and contains a number of
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG
 * interface file instead.
 * ----------------------------------------------------------------------------- */

#ifndef SWIG_SimFlowEnergyTransfer_ConvectiveHeater_Water_WRAP_H_
#define SWIG_SimFlowEnergyTransfer_ConvectiveHeater_Water_WRAP_H_

#include <map>
#include <string>

#endif


text:
package com.quakearts.webtools.test.helpers;

import com.quakearts.rest.client.HttpClientBuilder;

public class TestClientBuilder extends HttpClientBuilder<TestClient>{

	public TestClientBuilder() {
		httpClient = new TestClient();
	}

	@Override
	public TestClient thenBuild() {
		return httpClient;
	}

}


text:
/*Colors android*/
/* line 7, ../scss/animate.scss */
.view-animate.ng-enter, .view-animate.ng-leave {
  -moz-transition: all 0.3s ease 0s;
  -o-transition: all 0.3s ease 0s;
  -webkit-transition: all 0.3s ease;
  -webkit-transition-delay: 0s;
  transition: all 0.3s ease 0s;
  display: block;
  width: 100%;
  border-left: 1px solid black;
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px;
}

/* line 22, ../scss/animate.scss */
.rtl .view-animate.ng-enter {
  -moz-transform: translateX(100%);
  -ms-transform: translateX(100%);
  -o-transform: translateX(100%);
  -webkit-transform: translateX(100%);
  transform: translateX(100%);
}

/* line 25, ../scss/animate.scss */
.rtl .view-animate.ng-enter.ng-enter-active {
  -moz-transform: translateX(0);
  -ms-transform: translateX(0);
  -o-transform: translateX(0);
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

/* line 28, ../scss/animate.scss */
.rtl .view-animate.ng-leave.ng-leave-active {
  -moz-transform: translateX(-100%);
  -ms-transform: translateX(-100%);
  -o-transform: translateX(-100%);
  -webkit-transform: translateX(-100%);
  transform: translateX(-100%);
}

/* line 32, ../scss/animate.scss */
.ltr .view-animate.ng-enter {
  -moz-transform: translateX(-100%);
  -ms-transform: translateX(-100%);
  -o-transform: translateX(-100%);
  -webkit-transform: translateX(-100%);
  transform: translateX(-100%);
}

/* line 35, ../scss/animate.scss */
.ltr .view-animate.ng-enter.ng-enter-active {
  -moz-transform: translateX(0);
  -ms-transform: translateX(0);
  -o-transform: translateX(0);
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

/* line 38, ../scss/animate.scss */
.ltr .view-animate.ng-leave.ng-leave-active {
  -moz-transform: translateX(100%);
  -ms-transform: translateX(100%);
  -o-transform: translateX(100%);
  -webkit-transform: translateX(100%);
  transform: translateX(100%);
}


text:
@interface FBSDKShareUtilityTests : XCTestCase
@end

@implementation FBSDKShareUtilityTests

- (NSURL *)fileURL
{
  return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}

- (void)testShareLinkContentValidationWithNilValues
{
  FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
  XCTAssertNotNil(content);
  NSError *error;
  XCTAssertTrue([FBSDKShareUtility validateShareLinkContent:content error:&error]);
  XCTAssertNil(error);
}

- (void)testShareLinkContentValidationWithValidValues
{
  FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
  content.contentURL = [FBSDKShareModelTestUtility contentURL];
  content.peopleIDs = [FBSDKShareModelTestUtility peopleIDs];
  content.placeID = [FBSDKShareModelTestUtility placeID];
  content.ref = [FBSDKShareModelTestUtility ref];
  XCTAssertNotNil(content);
  NSError *error;
  XCTAssertTrue([FBSDKShareUtility validateShareLinkContent:content error:&error]);
  XCTAssertNil(error);
}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- FileSystemUtil -->
    <string name="tattobr_utils_text_external_storage">Stocare externă</string>
    <string name="tattobr_utils_text_internal_storage">Stocare internă</string>
    <string name="tattobr_utils_yesterday">ieri</string>
</resources>


text:
layout: post
title:  "Getting familier with Linux find command"
date: 2016-10-07
desc: "Search and locate files/directories using find command"
keywords: "linux,find,search,command,ubuntu"
categories: [Linux]
tags: [Linux,find,search,command,ubuntu]
icon: icon-shell
---

The `find` command is one of the most important and much used command in Linux systems. `find` command is used to search and locate list of files and directories based on conditions you specify for files that match the arguments. In this article we will get familier with linux `find` command.

First things first, to get more knowledge on any linux command we can use linux manual page using `man <command_name>`. For more information about find you can use `man find` and you'll get in depth description on how we can use linux command.

Basic use of find looks somewhat like below

```bash
find .
```

Let's get familier which the syntax of `find`. In above example we have two parts

1. `find` : find is the command itself
2. `.` : `.` (dot) represents the path from where we want to search. We can pass any path here and find will start to look from the path what was provided.

If you run the command, you will get list of all the files and directories that is inside the path that was given as argument.

But I assume you don't want to search for all files. You may want to search for file from `/` directories that has specific name. To seach for specific file `/` directories we can use `-name option`. Here's an example of `find` which search for the file `/` directories with the name `.gitignore`

```bash
find . -name '.gitignore'

# OUTPUT

./.gitignore
```

You can see that we are using `.` here. If you wanted to start search from root you are free to pass `/` as you seach directory.

Did you notice that I kept on saying search for file or directories. By default `find` will try to match the option of `-name` on both directories and files. If you want to limit your search for file or directories you can use `-type` option.

```bash
find . -type d -name 'img'

# OUTPUT

./_site/img
./img
```

If you pass `d` argument on `-type` option your search will limit to directories only.

```bash
find . -type f -name '.gitignore'

# OUTPUT

./.gitignore
```

If you pass `f` argument on `-type` option your search will limit to files.

Linux system are case sensitive. What if you want to seach file ignoring the case. `-iname` can be use to do just that.

```bash
find . -iname '.gitignore'
```

You can also search file with certain extention. Let's search file with `.css` extention

```bash
find . -type f -name '*.css'

# OUTPUT
./css/bootstrap-theme.css
./css/pygment_highlights.css
./css/main-minimal.css
./css/bootstrap.css
./css/bootstrap.min.css
./css/normalize.css
./css/bootstrap-theme.min.css
./css/main.css
```

We can use `*` to indicate any character. We can also search files with multiple extention. Suppose you want to search file with `.css` and `.html`. You can do that with

```bash
find . -name '*.css' -or -name '*.html'

# OUTPUT

./_layouts/post.html
./_layouts/default.html
./_layouts/page.html
./_layouts/base.html
./index.html
./css/bootstrap-theme.css
./css/pygment_highlights.css
./css/main-minimal.css
./css/bootstrap.css
./css/bootstrap.min.css
./css/normalize.css
./css/bootstrap-theme.min.css
./css/main.css
```

Notice how we are joining the option `-name` in above syntax using `-or`. `-or` can be used with its alias `-o` You may have guessed that we can use `-and` too. Here's an example of `find` using `-and`.

```bash
# find . -name 'm*' -name '*.css'
find . -name 'm*' -and -name '*.css'

# OUTPUT
./_site/css/main-minimal.css
./_site/css/main.css
./css/main-minimal.css
./css/main.css
```

Now that you know about `-or` and `-and`, you may have imagined endless possibilities of search patterns. Just a quick note, if you use two `-name` without `-and` on above example it would act as `-and`. Quick hint !! you have `-not` option too. `-not` can be used with its alias `!`. `-or` , `-and` and `-not` can be used with other option too.

You can also control how deep you want to search usign `-maxdepth`

```bash
find . -maxdepth 1 -name '*.html'

# OUTPUT
./index.html
```

You can use `find` to search the files / directories based on modified, changed or accessed days and minutes.

For days you have `-mtime`, `-atime`, `-ctime` and for minutes you have `-mmin`, `-amin`, `-cmin`. Option prefixed with `m` denotes modified, `a` denotes accessed and `c` denotes changed.

```bash
find . -mtime 20
find . -atime 20
find . -ctime 20
find . -mmin 20
find . -amin 20
find . -cmin 20
```
We can also use `+` and `-` symbol number provied. For example

```bash
find . -mtime +5
```
Above command  find the file which was not modified in last 5 days.

```bash
find . -mtime -5
```

Above command  find the file which was modified within last 5 days.

You can also go for range of days and minutes. Here's an example

```bash
find . -mtime +5 -mtime -10
```
Above command finds the files / directories that are modifined between 5 to 10 days

```bash
find . -mmin +5 -mtime -10
```

Above command finds the files / directories that are modifined between 5 to 10 minutes.

To search the file that has specific size you can use `-size` option

```bash
find . -type f -size 2M
```
Above command search file that has exactly 50M. We can also use `+` and `-` symbol on the number here. For example

```bash
find . -type f -size -2M
```
This command will find the files that has size of 2MB and less

For range you can do

```bash
find . -type f -size +2M -size -10M
```

To find empty file or directory you can use `-empty` option

```bash
find . -empty
```

`find` also has option `-user`, `-group` and `-perm` which lets you search the file that is associated with specific user, group or if the file has certain permission.

You can also perform certain operation on the files / directories that are searched and found using `-exec` option.

For this example here is the list of files and dir that I have

```
-rw-rw-r--  1 aman aman    0 Oct  7 10:30 four.html
-rw-rw-r--  1 aman aman    0 Oct  7 10:30 one.txt
drwxrwxr-x  2 aman aman 4096 Oct  7 10:31 somedir
-rw-rw-r--  1 aman aman    0 Oct  7 10:30 three.txt
-rw-rw-r--  1 aman aman    0 Oct  7 10:30 two.php
```

To rename the two.php to two.html you can issue following command

```bash
find . -type f -name 'two.php' -exec mv -f {} two.html \;

# ls -l

-rw-rw-r--  1 aman aman    0 Oct  7 10:30 four.html
-rw-rw-r--  1 aman aman    0 Oct  7 10:30 one.txt
drwxrwxr-x  2 aman aman 4096 Oct  7 10:31 somedir
-rw-rw-r--  1 aman aman    0 Oct  7 10:30 three.txt
-rw-rw-r--  1 aman aman    0 Oct  7 10:30 two.html
```

Let's explain what `-exec` is performing. After `-exec` we are writing the command that we want to execute. In our example we wanted to change `two.php` to `two.html`. Notice we are using `{}` placeholder in **source** section. To end the `-exec` command we are using `\;`.

I know on destination we used static text. What if we want to use change all `html` files to `php` now. Here's the command

```bash
find . -type f -name '*.html' -exec bash -c 'mv "$1" "${1%.html}".php' - {} \;
```
Now that's a complex command. Let's me explain what's happening.

First we are passing `bash -c '<command_to_execute_inside_bash>' - <param_to_send>` on `-exec`. The command will execute for each entry that is found by `find` command. If find finds 5 files with `*.html` it will run the command 5 times.

Lets look at the command that we passed for execution i.e `mv "$1" "${1%.html}".php`.

`$1` is the first argument that was passed to command. For example if we have 2 file with html extention. It will send 1st file found to command as its 1st argument and command execution will take place. Then, it goes for 2nd find found and will again pass the file name as its 1st argument.So if we have two file `one.html` and `two.html` our `find` command will find the `one.html` first and it will execute our command which argument `one.html`. So on first execution `$1` value will be `one.html` and on second execution `$1` will be `two.html`

Next we have `"${1%.html}".php`. In a simple term if `$1` represents `one.html` then `"${1%.html}"` will represent `one`. So `"${1%.html}".php` will represent `one.php`. Visit [Bash Referrence Manural](http://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion) for more detail.

If we have two file `one.html` and `two.html`. When our command execute the first time ti will look like `bash -c 'mv one.html one.php'` and second time `bash -c 'mv two.html two.php'`.

Here's the output

```bash
-rw-rw-r-- 1 aman aman    0 Oct  7 10:30 four.php
-rw-rw-r-- 1 aman aman    0 Oct  7 10:30 one.txt
drwxrwxr-x 2 aman aman 4.0K Oct  7 10:31 somedir
-rw-rw-r-- 1 aman aman    0 Oct  7 10:30 three.txt
-rw-rw-r-- 1 aman aman    0 Oct  7 10:30 two.php
```

`find` is very handy command and I hope this article helped you get an insight on how you can use `find` to search files and directories you need.


text:
function parameters= cFUMI_parameters()

% This function generates the parameters structure for cFUMI

% REFERENCE :
% C. Jiao, A. Zare,
% Functions of Multiple Instances for Learning Target Signatures,?
% IEEE transactions on Geoscience and Remote Sensing, Vol. 53, No. 8, Aug. 2015, DOI: 10.1109/TGRS.2015.2406334
%
% SYNTAX: parameters= EF_parameters()

% Inputs:
%    None
%
% Outputs:
%    parameters.u:  Weight used to trade off between residual error, volume and sparsity promoting terms, smaller = more weight on error
%    parameters.changeThresh: Stopping criterion, When change drops below this threshold the algorithm stops
%    parameters.iterationCap: Iteration cap, used to stop the algorithm
%    parameters.Eps: Parameter used to diagonally load some matrices in the code
%    parameters.M: denotes how many background endmembers there are
%    parameters.alpha: coefficient of weight for points from positive bag
%    parameters.gammaconst: Larger weight should mean fewer endmembers
%    parameters.endmemberPruneThreshold: Prune E(:, i) when max(P(i, :))<this threshold
%    parameters.flag_E: 0, don't normalize E; 2,normalize esch endmember has unit norm after each iteration

% Author: Changzhe Jiao, Alina Zare
% University of Missouri, Department of Electrical and Computer Engineering
% Email Address: cjr25@mail.missouri.edu; zarea@missouri.edu
% Created: October, 2013
% Latest Revision: January, 2015
%
% This product is Copyright (c) 2015 University of Missouri
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions
% are met:
%
%   1. Redistributions of source code must retain the above copyright
%      notice, this list of conditions and the following disclaimer.
%   2. Redistributions in binary form must reproduce the above copyright
%      notice, this list of conditions and the following disclaimer in the
%      documentation and/or other materials provided with the distribution.
%   3. Neither the name of the University nor the names of its contributors
%      may be used to endorse or promote products derived from this software
%      without specific prior written permission.
%
% THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF MISSOURI AND
% CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
% DISCLAIMED.  IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS
% BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
% EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
% LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
% HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
% OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    parameters.u = 0.05;
    parameters.changeThresh = 1e-6;
    parameters.iterationCap = 100;
    parameters.Eps=1e-9;
    parameters.M=3;
    parameters.alpha=2;
    parameters.gammaconst=10;
    parameters.endmemberPruneThreshold=1e-6;
    parameters.flag_E=0;

end


text:
<group>

Index

Prev

Next

INTHIST = VL_INTHIST(LABELS) computes the integral histogram for
the label map(s) LABELS.

LABELS is a [M,N,L] UINT32 array containing L label maps (one for
each MxN layer). Each label map associates to each of the MxN
pixels one of K labels (a value of 0 denotes no association) with
unitary mass.

INTHIST is the [M,N,K] integral histogram obtained by integrating
the label maps (an integral histogram is just an array of K
integral images, one for each of the K labels). All layers of
labels are accumulated to the same integral histogram.

The total number of labels K is obtained as the maximum value of
LABELS. VL_INTHIST(..., 'NUMLABELS', K) specifies the number of
labels explicitly.

VL_INTHIST(..., 'MASS', MASSES) specifies a mass MASSES for each
entry of LABELS. MASSES can be either of class UINT32 or DOUBLE,
and the class of INTHIST varies accordingly.

See also: VL_IMINTEGRAL(), VL_SAMPLEINTHIST(), VL_HELP().

</group>


text:
class UserMailer < ApplicationMailer
    default from: 'no-reply@itph.com'

    def welcome_email(user)
        @user = user
        @url  = root_url
        mail(to: @user.email, subject: 'Welcome to the ITPH Community!')
    end

    def unapproved_email(user)
        @user = user
        mail(to: @user.email, subject: 'An ITPH admin has revoked your access.')
    end

    def user_created_email(user)
        @admin = user
        @url = root_url
        mail(to: @admin.email, subject: 'A New Member Has Signed Up')
    end
end


text:
//
//  Bridging-Header.h
//  Guitar_Design
//
//  Created by Mark Jajeh on 4/18/16.
//  Copyright © 2016 Mark Jajeh. All rights reserved.
//

#ifndef Bridging_Header_h
#define Bridging_Header_h

#endif /* Bridging_Header_h */


text:
"""
Parsing Figura config files.
"""

import inspect

from .misc import merge_dicts
from .errors import ConfigParsingError
from .container import ConfigContainer
from .override import ConfigOverrideSet, normalize_override_key
from .importutils import import_figura_file

################################################################################
# Constants and definitions

VALID_ATOMIC_VALUE_TYPES = set([type(None), type(''), type(u''), type(True), type(0), type(0.0)])
VALID_SEQUENCE_VALUE_TYPES = set([type(()), type([]), type({})])

META_MAP = {
    '__override__': 'is_override_set',
    '__opaque__': 'is_opaque',
    '__opaque_override__': 'is_opaque_override',
    '__doc__': 'doc',
}

################################################################################
# The parser

class ConfigParser:
    """
    A python-config parser.

    Should not be used directly, use ``read_config`` instead.  If used directly,
    the ``parse`` method should be called from within a ``FiguraImportContext`` context.

    Use like::

        parser = ConfigParser()
        with FiguraImportContext():
            config = parser.parse('figura.tests.config.basic1')

    """

    VALID_ATOMIC_VALUE_TYPES = VALID_ATOMIC_VALUE_TYPES
    """ A list of atomic types allowed as config values """

    VALID_SEQUENCE_VALUE_TYPES = VALID_SEQUENCE_VALUE_TYPES
    """ A list of sequence types allowed as config values """

    META_MAP = META_MAP
    """
    A conversion map from config-metadata-directives (e.g. __opaque__),
    to their metadata attribute (e.g., is_opaque)
    """

    # ============================================================================================
    # main parsing methods
    # ============================================================================================

    def parse(self, path):
        """
        Parse a figura config file, identified by its import path, E.g.
        ``figura.tests.config.basic1``.

        :return: a `ConfigContainer <#figura.container.ConfigContainer>`_ object.
        :raise ConfigParsingError: if parsing fails.
        """

        # load it using python's import mechanism:
        module = self.get_module(path)
        # post-import processing:
        conf = self._python_to_conf(module)
        # post-parsing:
        self._finalize_config_container(conf, module)
        return conf

    def get_module(self, path):
        return self._import_python_module(path)

    # ============================================================================================
    # python-import harnessing
    # ============================================================================================

    def _import_python_module(self, path):
        """
        parse the python-config files into an intermediate representation.
        """
        return import_figura_file(path)

    # ============================================================================================
    # post-import processing of python constructs
    # ============================================================================================

    def _python_to_conf(self, x, name='', nesting_context=None, **metadata):
        """
        convert the intermediate config representation into a ConfigContainer.
        """

        # If this is an atomic type, no parsing is required
        if type(x) in self.VALID_ATOMIC_VALUE_TYPES:
            return x
        elif type(x) in self.VALID_SEQUENCE_VALUE_TYPES:
            # a sequence. apply to elements recursively
            if hasattr(x, 'items'):
                return type(x)((k, self._python_to_conf(v)) for k, v in x.items())
            else:
                return type(x)(self._python_to_conf(elem) for elem in x)

        if type(x) == type(inspect):

            # the top-level module object --> a ConfigContainer
            raw_attrs = self._get_dunder_dict(x)

            # handle the __entry_point___ directive:
            new_x = self._find_entry_point(raw_attrs)
            if new_x is not None:
                # return the result of the recursive call on the new entry point
                return self._python_to_conf(new_x)

        elif _is_raw_container(x):
            # a class --> a ConfigContainer
            raw_attrs = self._get_dunder_dict(x)

            # handle auto-overlay magic
            if nesting_context is None:
                nesting_context = []
            nesting_context = nesting_context + [(name, x)]  # don't use append
            for overlayee in self._gen_overlayees(nesting_context):
                for k, v in self._get_dunder_dict(overlayee).items():
                    if k not in raw_attrs:
                        raw_attrs[k] = v
        else:
            # type misunderstood
            raise ConfigParsingError('Config construct of unsupported type %r: %s' % (type(x), x))

        # Separate raw_attrs to their types. See _prepare_attrs for more details.
        real_attrs, meta_attrs = self._prepare_attrs(raw_attrs)

        # if this is an overridet-set, all nested containers are also override sets automatically.
        # we propagate this metadata attribute using the metadata dict:
        if meta_attrs.get('is_override_set', False):
            metadata['is_override_set'] = meta_attrs['is_override_set']

        # convert real attr recursively
        attrs = {
            k: self._python_to_conf(v, name=k, nesting_context=nesting_context, **metadata)
            for k, v in real_attrs.items()
        }

        # create the container
        metadata_to_apply = merge_dicts(metadata, meta_attrs)
        if metadata_to_apply.get('is_override_set', False):
            container_cls = ConfigOverrideSet
        else:
            container_cls = ConfigContainer
        container = container_cls(attrs)

        # set metadata attributes on the container
        container.get_metadata().update(metadata_to_apply)

        return container

    def _get_dunder_dict(self, x, deep=True):
        if x == object:
            # result of the mro call:
            return {}
        if not deep:
            return dict(x.__dict__)
        objs = [x]
        try:
            objs.extend(inspect.getmro(x)[1:])
        except AttributeError:
            pass
        dicts = [self._get_dunder_dict(obj, deep=False) for obj in objs]
        d = merge_dicts(*reversed(dicts))
        return d

    def _prepare_attrs(self, raw_attrs):
        """
        There are four types of attributes:

        1. real config attrs, e.g., a=1
        #. private config attrs, e.g., _a=1 -- we drop them
        #. metadata attrs, e.g., __opaque__=True
        #. python internal attrs, e.g., __module__=xxx -- we drop them

        :return: a 2-tuple: (real_attrs, meta_attrs)
        """
        real_attrs = {}
        meta_attrs = {}
        for k, v in raw_attrs.items():
            # try meta:
            try:
                meta_attrs[self.META_MAP[k]] = v
                continue
            except KeyError:
                pass  # not meta
            # filter out private attrs and python internals
            if k.startswith('_'):
                continue
            # the rest are real
            k = normalize_override_key(k)
            real_attrs[k] = v
        return real_attrs, meta_attrs

    def _finalize_config_container(self, conf, module):
        conf._add_module_metadata(module)

    # ============================================================================================
    # overlay support
    # ============================================================================================

    def _gen_overlayees(self, nesting_context):
        nesting_path = [x[0] for x in nesting_context]
        nesting_containers = [x[1] for x in nesting_context]
        rel_path = []
        while nesting_containers:
            nester = nesting_containers[-1]
            # discontinue overlay chain if __opaque__ is set in nester
            if _is_marked_opaque(nester):
                break
            if rel_path:
                for nester_base in inspect.getmro(nester)[1:]:
                    try:
                        attr_path = '.'.join(rel_path)
                        overlayee, opaque = \
                            self._deep_getattr_with_opaqueness_check(nester_base, attr_path)
                        # make sure the overlayee is a raw container, because it should
                        # be possible to override any (primitive) value with a container,
                        # in which case, no overlaying takes place.
                        if _is_raw_container(overlayee):
                            yield overlayee
                        # discontinue overlay chain if __opaque__ is set somehere
                        # in nester_base's path
                        if opaque:
                            break
                    except AttributeError:
                        pass
            rel_path = nesting_path[-1:] + rel_path
            nesting_path = nesting_path[:-1]
            nesting_containers = nesting_containers[:-1]

    def _deep_getattr_with_opaqueness_check(self, x, attr_path, *args):
        opaque = _is_marked_opaque(x)
        while True:
            attr, delim, rest = attr_path.partition('.')
            if delim:
                # go one level deeper:
                x = getattr(x, attr)
                attr_path = rest
                opaque = opaque or _is_marked_opaque(x)
            else:
                # deepest level
                x = getattr(x, attr_path, *args)
                opaque = opaque or _is_marked_opaque(x)
                return x, opaque

    # ============================================================================================
    # __entry_point___ support
    # ============================================================================================

    def _find_entry_point(self, attrs):
        entry_point = attrs.get('__entry_point__')
        if entry_point is not None:
            if isinstance(entry_point, str):
                # entry_point is given by name
                try:
                    entry_point = attrs[entry_point]
                except KeyError:
                    raise ConfigParsingError(
                        'entry-point not found: %s' % (entry_point, )) from None
            else:
                # entry_point is given by pointing to to a container
                pass
        return entry_point

################################################################################

def _is_raw_container(x):
    # a raw container is the 'class x: ...' container as appears in the figura file, before
    # converting it to a ConfigContainer
    return inspect.isclass(x)

def _is_marked_opaque(x):
    return getattr(x, '__opaque__', False)

################################################################################


text:
#import <ScreenReaderCore/SCRCMathExpression.h>

// Not exported
@interface SCRCMathFractionExpression : SCRCMathExpression
{
    SCRCMathExpression *_numerator;
    SCRCMathExpression *_denominator;
    SCRCMathExpression *_operator;
    double _lineThickness;
}

@property(nonatomic) double lineThickness; // @synthesize lineThickness=_lineThickness;
@property(retain, nonatomic) SCRCMathExpression *operator; // @synthesize operator=_operator;
@property(retain, nonatomic) SCRCMathExpression *denominator; // @synthesize denominator=_denominator;
@property(retain, nonatomic) SCRCMathExpression *numerator; // @synthesize numerator=_numerator;
- (id)latexMathModeDescription;
- (id)mathMLString;
- (id)_dollarCodeDescriptionAsBinomialCoefficient:(_Bool)arg1 orMixedNumberFraction:(_Bool)arg2 withNumberOfOuterRadicals:(unsigned long long)arg3 treePosition:(id)arg4;
- (id)dollarCodeDescriptionAsBinomialCoefficientWithTreePosition:(id)arg1 numberOfOuterRadicals:(unsigned long long)arg2;
- (id)dollarCodeDescriptionAsMixedNumberFractionWithTreePosition:(id)arg1;
- (id)dollarCodeDescriptionWithNumberOfOuterRadicals:(unsigned long long)arg1 treePosition:(id)arg2;
- (id)speakableSegmentsAsBinomialCoefficientWithSpeakingStyle:(int)arg1 upToDepth:(unsigned long long)arg2 treePosition:(id)arg3;
- (id)speakableSegmentsWithSpeakingStyle:(int)arg1 upToDepth:(unsigned long long)arg2 treePosition:(id)arg3;
- (id)_speakableSegmentsWithSpeakingStyle:(int)arg1 upToDepth:(unsigned long long)arg2 treePosition:(id)arg3 asBinomialCoefficient:(_Bool)arg4;
- (id)speakableDescriptionAsBinomialCoefficientWithSpeakingStyle:(int)arg1;
- (id)speakableDescriptionWithSpeakingStyle:(int)arg1 arePausesAllowed:(_Bool)arg2;
- (id)_speakableDescriptionWithSpeakingStyle:(int)arg1 arePausesAllowed:(_Bool)arg2 asBinomialCoefficient:(_Bool)arg3;
- (_Bool)isSimpleNumericalFraction;
- (unsigned long long)fractionLevel;
- (_Bool)isUnlinedFraction;
- (id)subExpressions;
- (id)description;
- (void)dealloc;
- (id)initWithDictionary:(id)arg1;

@end


text:
using System.Collections.Generic;
namespace Infestation
{
    public class Marine : Human
    {
        public Marine(string id)
            :base(id)
        {
            this.AddSupplement(new WeaponrySkill());
        }

        protected override UnitInfo GetOptimalAttackableUnit(IEnumerable<UnitInfo> attackableUnits)
        {
            //This method finds the unit with the highest health and attacks it
            UnitInfo optimalAttackableUnit = new UnitInfo(null, UnitClassification.Unknown, int.MinValue, 0, 0);

            foreach (var unit in attackableUnits)
            {
                if (unit.Health > optimalAttackableUnit.Health)
                {
                    optimalAttackableUnit = unit;
                }
            }

            return optimalAttackableUnit;
        }
    }
}


text:
if Rails.env.development?
  require 'webrick'

  module WEBrick
    class HTTPServer
      def access_log(a, b, c)
        nil
      end
    end
  end
end


text:
<?php

namespace PhpInk\Nami\CoreBundle\Repository\Orm\Image;

use PhpInk\Nami\CoreBundle\Repository\Orm\AbstractRepository as OrmRepository;

class UserImageRepository extends OrmRepository {}


text:
namespace {

// Global bool to ensure we only update the parameters from variations once.
bool g_updated_from_variations = false;

// Keys used in the variations params.
const char kMaxPointsPerDayParam[] = "max_points_per_day";
const char kNavigationPointsParam[] = "navigation_points";
const char kUserInputPointsParam[] = "user_input_points";
const char kVisibleMediaPlayingPointsParam[] = "visible_media_playing_points";
const char kHiddenMediaPlayingPointsParam[] = "hidden_media_playing_points";
const char kDecayPeriodInDaysParam[] = "decay_period_in_days";
const char kDecayPointsParam[] = "decay_points";

// Length of time between metrics logging.
const base::TimeDelta metrics_interval = base::TimeDelta::FromMinutes(60);

// Delta within which to consider scores equal.
const double kScoreDelta = 0.001;

// Delta within which to consider internal time values equal. Internal time
// values are in microseconds, so this delta comes out at one second.
const double kTimeDelta = 1000000;

scoped_ptr<ContentSettingsForOneType> GetEngagementContentSettings(
    HostContentSettingsMap* settings_map) {
  scoped_ptr<ContentSettingsForOneType> engagement_settings(
      new ContentSettingsForOneType);
  settings_map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT,
                                      std::string(), engagement_settings.get());
  return engagement_settings.Pass();
}

bool DoublesConsideredDifferent(double value1, double value2, double delta) {
  double abs_difference = fabs(value1 - value2);
  return abs_difference > delta;
}

// Only accept a navigation event for engagement if it is one of:
//  a. direct typed navigation
//  b. clicking on an omnibox suggestion brought up by typing a keyword
//  c. clicking on a bookmark or opening a bookmark app
//  d. a custom search engine keyword search (e.g. Wikipedia search box added as
//  search engine).
bool IsEngagementNavigation(ui::PageTransition transition) {
  return ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED) ||
         ui::PageTransitionCoreTypeIs(transition,
                                      ui::PAGE_TRANSITION_GENERATED) ||
         ui::PageTransitionCoreTypeIs(transition,
                                      ui::PAGE_TRANSITION_AUTO_BOOKMARK) ||
         ui::PageTransitionCoreTypeIs(transition,
                                      ui::PAGE_TRANSITION_KEYWORD_GENERATED);
}

scoped_ptr<base::DictionaryValue> GetScoreDictForOrigin(
    HostContentSettingsMap* settings,
    const GURL& origin_url) {
  if (!settings)
    return scoped_ptr<base::DictionaryValue>();

  scoped_ptr<base::Value> value = settings->GetWebsiteSetting(
      origin_url, origin_url, CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT,
      std::string(), NULL);
  if (!value.get())
    return make_scoped_ptr(new base::DictionaryValue());

  if (!value->IsType(base::Value::TYPE_DICTIONARY))
    return make_scoped_ptr(new base::DictionaryValue());

  return make_scoped_ptr(static_cast<base::DictionaryValue*>(value.release()));
}

}  // namespace

const double SiteEngagementScore::kMaxPoints = 100;
double SiteEngagementScore::g_max_points_per_day = 5;
double SiteEngagementScore::g_navigation_points = 0.5;
double SiteEngagementScore::g_user_input_points = 0.05;
double SiteEngagementScore::g_visible_media_playing_points = 0.02;
double SiteEngagementScore::g_hidden_media_playing_points = 0.01;
int SiteEngagementScore::g_decay_period_in_days = 7;
double SiteEngagementScore::g_decay_points = 5;

const char* SiteEngagementScore::kRawScoreKey = "rawScore";
const char* SiteEngagementScore::kPointsAddedTodayKey = "pointsAddedToday";
const char* SiteEngagementScore::kLastEngagementTimeKey = "lastEngagementTime";

void SiteEngagementScore::UpdateFromVariations() {
  std::string max_points_per_day_param = variations::GetVariationParamValue(
      SiteEngagementService::kEngagementParams, kMaxPointsPerDayParam);
  std::string navigation_points_param = variations::GetVariationParamValue(
      SiteEngagementService::kEngagementParams, kNavigationPointsParam);
  std::string user_input_points_param = variations::GetVariationParamValue(
      SiteEngagementService::kEngagementParams, kUserInputPointsParam);
  std::string visible_media_playing_points_param =
      variations::GetVariationParamValue(
          SiteEngagementService::kEngagementParams,
          kVisibleMediaPlayingPointsParam);
  std::string hidden_media_playing_points_param =
      variations::GetVariationParamValue(
          SiteEngagementService::kEngagementParams,
          kHiddenMediaPlayingPointsParam);
  std::string decay_period_in_days_param = variations::GetVariationParamValue(
      SiteEngagementService::kEngagementParams, kDecayPeriodInDaysParam);
  std::string decay_points_param = variations::GetVariationParamValue(
      SiteEngagementService::kEngagementParams, kDecayPointsParam);

  if (!max_points_per_day_param.empty() && !navigation_points_param.empty() &&
      !user_input_points_param.empty() &&
      !visible_media_playing_points_param.empty() &&
      !hidden_media_playing_points_param.empty() &&
      !decay_period_in_days_param.empty() && !decay_points_param.empty()) {
    double max_points_per_day = 0;
    double navigation_points = 0;
    double user_input_points = 0;
    double visible_media_playing_points = 0;
    double hidden_media_playing_points = 0;
    int decay_period_in_days = 0;
    double decay_points = 0;

    if (base::StringToDouble(max_points_per_day_param, &max_points_per_day) &&
        base::StringToDouble(navigation_points_param, &navigation_points) &&
        base::StringToDouble(user_input_points_param, &user_input_points) &&
        base::StringToDouble(visible_media_playing_points_param,
                             &visible_media_playing_points) &&
        base::StringToDouble(hidden_media_playing_points_param,
                             &hidden_media_playing_points) &&
        base::StringToInt(decay_period_in_days_param, &decay_period_in_days) &&
        base::StringToDouble(decay_points_param, &decay_points) &&
        max_points_per_day >= navigation_points &&
        max_points_per_day >= user_input_points && navigation_points >= 0 &&
        user_input_points >= 0 && decay_period_in_days > 0 &&
        decay_points >= 0) {
      g_max_points_per_day = max_points_per_day;
      g_navigation_points = navigation_points;
      g_user_input_points = user_input_points;
      g_visible_media_playing_points = visible_media_playing_points;
      g_hidden_media_playing_points = hidden_media_playing_points;
      g_decay_period_in_days = decay_period_in_days;
      g_decay_points = decay_points;
    }
  }
}

SiteEngagementScore::SiteEngagementScore(
    base::Clock* clock,
    const base::DictionaryValue& score_dict)
    : SiteEngagementScore(clock) {
  score_dict.GetDouble(kRawScoreKey, &raw_score_);
  score_dict.GetDouble(kPointsAddedTodayKey, &points_added_today_);
  double internal_time;
  if (score_dict.GetDouble(kLastEngagementTimeKey, &internal_time))
    last_engagement_time_ = base::Time::FromInternalValue(internal_time);
}

SiteEngagementScore::~SiteEngagementScore() {
}

double SiteEngagementScore::Score() const {
  return DecayedScore();
}

void SiteEngagementScore::AddPoints(double points) {
  // As the score is about to be updated, commit any decay that has happened
  // since the last update.
  raw_score_ = DecayedScore();

  base::Time now = clock_->Now();
  if (!last_engagement_time_.is_null() &&
      now.LocalMidnight() != last_engagement_time_.LocalMidnight()) {
    points_added_today_ = 0;
  }

  double to_add = std::min(kMaxPoints - raw_score_,
                           g_max_points_per_day - points_added_today_);
  to_add = std::min(to_add, points);

  points_added_today_ += to_add;
  raw_score_ += to_add;

  last_engagement_time_ = now;
}

bool SiteEngagementScore::MaxPointsPerDayAdded() {
  if (!last_engagement_time_.is_null() &&
      clock_->Now().LocalMidnight() != last_engagement_time_.LocalMidnight()) {
    return false;
  }

  return points_added_today_ == g_max_points_per_day;
}

bool SiteEngagementScore::UpdateScoreDict(base::DictionaryValue* score_dict) {
  double raw_score_orig = 0;
  double points_added_today_orig = 0;
  double last_engagement_time_internal_orig = 0;

  score_dict->GetDouble(kRawScoreKey, &raw_score_orig);
  score_dict->GetDouble(kPointsAddedTodayKey, &points_added_today_orig);
  score_dict->GetDouble(kLastEngagementTimeKey,
                      &last_engagement_time_internal_orig);
  bool changed =
      DoublesConsideredDifferent(raw_score_orig, raw_score_, kScoreDelta) ||
      DoublesConsideredDifferent(points_added_today_orig, points_added_today_,
                                 kScoreDelta) ||
      DoublesConsideredDifferent(last_engagement_time_internal_orig,
                                 last_engagement_time_.ToInternalValue(),
                                 kTimeDelta);

  if (!changed)
    return false;

  score_dict->SetDouble(kRawScoreKey, raw_score_);
  score_dict->SetDouble(kPointsAddedTodayKey, points_added_today_);
  score_dict->SetDouble(kLastEngagementTimeKey,
                      last_engagement_time_.ToInternalValue());

  return true;
}

SiteEngagementScore::SiteEngagementScore(base::Clock* clock)
    : clock_(clock),
      raw_score_(0),
      points_added_today_(0),
      last_engagement_time_() {}

double SiteEngagementScore::DecayedScore() const {
  // Note that users can change their clock, so from this system's perspective
  // time can go backwards. If that does happen and the system detects that the
  // current day is earlier than the last engagement, no decay (or growth) is
  // applied.
  int days_since_engagement = (clock_->Now() - last_engagement_time_).InDays();
  if (days_since_engagement < 0)
    return raw_score_;

  int periods = days_since_engagement / g_decay_period_in_days;
  double decayed_score = raw_score_ - periods * g_decay_points;
  return std::max(0.0, decayed_score);
}

const char SiteEngagementService::kEngagementParams[] = "SiteEngagement";

// static
SiteEngagementService* SiteEngagementService::Get(Profile* profile) {
  return SiteEngagementServiceFactory::GetForProfile(profile);
}

// static
bool SiteEngagementService::IsEnabled() {
  // If the engagement service or any of its dependencies are force-enabled,
  // return true immediately.
  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
          switches::kEnableSiteEngagementService) ||
      SiteEngagementEvictionPolicy::IsEnabled()) {
    return true;
  }

  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
          switches::kDisableSiteEngagementService)) {
    return false;
  }
  const std::string group_name =
      base::FieldTrialList::FindFullName(kEngagementParams);
  return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE);
}

SiteEngagementService::SiteEngagementService(Profile* profile)
    : SiteEngagementService(profile, make_scoped_ptr(new base::DefaultClock)) {
  content::BrowserThread::PostAfterStartupTask(
      FROM_HERE, content::BrowserThread::GetMessageLoopProxyForThread(
                     content::BrowserThread::UI),
      base::Bind(&SiteEngagementService::AfterStartupTask,
                 weak_factory_.GetWeakPtr()));

  if (!g_updated_from_variations) {
    SiteEngagementScore::UpdateFromVariations();
    g_updated_from_variations = true;
  }
}

SiteEngagementService::~SiteEngagementService() {
  history::HistoryService* history = HistoryServiceFactory::GetForProfile(
      profile_, ServiceAccessType::IMPLICIT_ACCESS);
  if (history)
    history->RemoveObserver(this);
}

void SiteEngagementService::HandleNavigation(const GURL& url,
                                             ui::PageTransition transition) {
  if (IsEngagementNavigation(transition)) {
    SiteEngagementMetrics::RecordEngagement(
        SiteEngagementMetrics::ENGAGEMENT_NAVIGATION);
    AddPoints(url, SiteEngagementScore::g_navigation_points);
    RecordMetrics();
  }
}

void SiteEngagementService::HandleUserInput(
    const GURL& url,
    SiteEngagementMetrics::EngagementType type) {
  SiteEngagementMetrics::RecordEngagement(type);
  AddPoints(url, SiteEngagementScore::g_user_input_points);
  RecordMetrics();
}

void SiteEngagementService::HandleMediaPlaying(const GURL& url,
                                               bool is_hidden) {
  SiteEngagementMetrics::RecordEngagement(
      is_hidden ? SiteEngagementMetrics::ENGAGEMENT_MEDIA_HIDDEN
                : SiteEngagementMetrics::ENGAGEMENT_MEDIA_VISIBLE);
  AddPoints(url, is_hidden
                     ? SiteEngagementScore::g_hidden_media_playing_points
                     : SiteEngagementScore::g_visible_media_playing_points);
  RecordMetrics();
}

void SiteEngagementService::OnURLsDeleted(
    history::HistoryService* history_service,
    bool all_history,
    bool expired,
    const history::URLRows& deleted_rows,
    const std::set<GURL>& favicon_urls) {
  std::set<GURL> origins;
  for (const history::URLRow& row : deleted_rows)
    origins.insert(row.url().GetOrigin());

  history::HistoryService* hs = HistoryServiceFactory::GetForProfile(
      profile_, ServiceAccessType::EXPLICIT_ACCESS);
  hs->GetCountsForOrigins(
      origins, base::Bind(&SiteEngagementService::GetCountsForOriginsComplete,
                          weak_factory_.GetWeakPtr()));
}

double SiteEngagementService::GetScore(const GURL& url) {
  HostContentSettingsMap* settings_map =
    HostContentSettingsMapFactory::GetForProfile(profile_);
  scoped_ptr<base::DictionaryValue> score_dict =
      GetScoreDictForOrigin(settings_map, url);
  SiteEngagementScore score(clock_.get(), *score_dict);

  return score.Score();
}

double SiteEngagementService::GetTotalEngagementPoints() {
  std::map<GURL, double> score_map = GetScoreMap();

  double total_score = 0;
  for (const auto& value : score_map)
    total_score += value.second;

  return total_score;
}

std::map<GURL, double> SiteEngagementService::GetScoreMap() {
  HostContentSettingsMap* settings_map =
      HostContentSettingsMapFactory::GetForProfile(profile_);
  scoped_ptr<ContentSettingsForOneType> engagement_settings =
      GetEngagementContentSettings(settings_map);

  std::map<GURL, double> score_map;
  for (const auto& site : *engagement_settings) {
    GURL origin(site.primary_pattern.ToString());
    if (!origin.is_valid())
      continue;

    scoped_ptr<base::DictionaryValue> score_dict =
        GetScoreDictForOrigin(settings_map, origin);
    SiteEngagementScore score(clock_.get(), *score_dict);
    score_map[origin] = score.Score();
  }

  return score_map;
}

SiteEngagementService::SiteEngagementService(Profile* profile,
                                             scoped_ptr<base::Clock> clock)
    : profile_(profile), clock_(clock.Pass()), weak_factory_(this) {
  // May be null in tests.
  history::HistoryService* history = HistoryServiceFactory::GetForProfile(
      profile, ServiceAccessType::IMPLICIT_ACCESS);
  if (history)
    history->AddObserver(this);
}

void SiteEngagementService::AddPoints(const GURL& url, double points) {
  HostContentSettingsMap* settings_map =
    HostContentSettingsMapFactory::GetForProfile(profile_);
  scoped_ptr<base::DictionaryValue> score_dict =
      GetScoreDictForOrigin(settings_map, url);
  SiteEngagementScore score(clock_.get(), *score_dict);

  score.AddPoints(points);
  if (score.UpdateScoreDict(score_dict.get())) {
    settings_map->SetWebsiteSettingDefaultScope(
        url, GURL(), CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(),
        score_dict.release());
  }
}

void SiteEngagementService::AfterStartupTask() {
  CleanupEngagementScores();
  RecordMetrics();
}

void SiteEngagementService::CleanupEngagementScores() {
  HostContentSettingsMap* settings_map =
    HostContentSettingsMapFactory::GetForProfile(profile_);
  scoped_ptr<ContentSettingsForOneType> engagement_settings =
      GetEngagementContentSettings(settings_map);

  for (const auto& site : *engagement_settings) {
    GURL origin(site.primary_pattern.ToString());
    if (origin.is_valid()) {
      scoped_ptr<base::DictionaryValue> score_dict =
          GetScoreDictForOrigin(settings_map, origin);
      SiteEngagementScore score(clock_.get(), *score_dict);
      if (score.Score() != 0)
        continue;
    }

    settings_map->SetWebsiteSettingDefaultScope(
        origin, GURL(), CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(),
        nullptr);
  }
}

void SiteEngagementService::RecordMetrics() {
  base::Time now = clock_->Now();
  if (last_metrics_time_.is_null() ||
      now - last_metrics_time_ >= metrics_interval) {
    last_metrics_time_ = now;
    std::map<GURL, double> score_map = GetScoreMap();

    int origins_with_max_engagement = OriginsWithMaxEngagement(score_map);
    int total_origins = score_map.size();
    int percent_origins_with_max_engagement =
        (total_origins == 0 ? 0 : (origins_with_max_engagement * 100) /
                                      total_origins);

    double total_engagement = GetTotalEngagementPoints();
    double mean_engagement =
        (total_origins == 0 ? 0 : total_engagement / total_origins);

    SiteEngagementMetrics::RecordTotalOriginsEngaged(total_origins);
    SiteEngagementMetrics::RecordTotalSiteEngagement(total_engagement);
    SiteEngagementMetrics::RecordMeanEngagement(mean_engagement);
    SiteEngagementMetrics::RecordMedianEngagement(
        GetMedianEngagement(score_map));
    SiteEngagementMetrics::RecordEngagementScores(score_map);

    SiteEngagementMetrics::RecordOriginsWithMaxDailyEngagement(
        OriginsWithMaxDailyEngagement());
    SiteEngagementMetrics::RecordOriginsWithMaxEngagement(
        origins_with_max_engagement);
    SiteEngagementMetrics::RecordPercentOriginsWithMaxEngagement(
        percent_origins_with_max_engagement);
  }
}

double SiteEngagementService::GetMedianEngagement(
    std::map<GURL, double>& score_map) {
  if (score_map.size() == 0)
    return 0;

  std::vector<double> scores;
  scores.reserve(score_map.size());
  for (const auto& value : score_map)
    scores.push_back(value.second);

  // Calculate the median as the middle value of the sorted engagement scores
  // if there are an odd number of scores, or the average of the two middle
  // scores otherwise.
  std::sort(scores.begin(), scores.end());
  size_t mid = scores.size() / 2;
  if (scores.size() % 2 == 1)
    return scores[mid];
  else
    return (scores[mid - 1] + scores[mid]) / 2;
}

int SiteEngagementService::OriginsWithMaxDailyEngagement() {
  HostContentSettingsMap* settings_map =
      HostContentSettingsMapFactory::GetForProfile(profile_);
  scoped_ptr<ContentSettingsForOneType> engagement_settings =
      GetEngagementContentSettings(settings_map);

  int total_origins = 0;

  // We cannot call GetScoreMap as we need the score objects, not raw scores.
  for (const auto& site : *engagement_settings) {
    GURL origin(site.primary_pattern.ToString());
    if (!origin.is_valid())
      continue;

    scoped_ptr<base::DictionaryValue> score_dict =
        GetScoreDictForOrigin(settings_map, origin);
    SiteEngagementScore score(clock_.get(), *score_dict);
    if (score.MaxPointsPerDayAdded())
      ++total_origins;
  }

  return total_origins;
}

int SiteEngagementService::OriginsWithMaxEngagement(
    std::map<GURL, double>& score_map) {
  int total_origins = 0;

  for (const auto& value : score_map)
    if (value.second == SiteEngagementScore::kMaxPoints)
      ++total_origins;

  return total_origins;
}

void SiteEngagementService::GetCountsForOriginsComplete(
    const history::OriginCountMap& origin_counts) {
  HostContentSettingsMap* settings_map =
      HostContentSettingsMapFactory::GetForProfile(profile_);
  for (const auto& origin_to_count : origin_counts) {
    if (origin_to_count.second != 0)
      continue;

    settings_map->SetWebsiteSettingDefaultScope(
        origin_to_count.first, GURL(), CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT,
        std::string(), nullptr);
  }
}


text:
layout: page
title: Hobbies
---

I enjoy being outdoors, especially running, hiking, and going on walks with my energenic lab-mix, Lily. I have completed one marathon and several half marathons. I am an avid baseball fan and have games at 18 different ballparks. I hope to eventually make it to all 30. Given my love for sports and statistics, it should come as no surprise that I enjoy simulation based sports strategy games like Strat-O-Matic and Out of the Park Baseball. I also enjoy reading mystery novels and growing fresh fruit, an interest that goes back generations in my family.

![alt text](img/race.jpg)
![alt text](img/Pikes.jpg)

![alt text](img/Lily.jpg)