text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="a4682652-8337-42a3-a89f-3435862fd95f" name="Default" comment="">
      <change afterPath="$PROJECT_DIR$/_posts/test.md" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/_site/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/_site/index.html" afterDir="false" />
    </list>
    <ignored path="$PROJECT_DIR$/.tmp/" />
    <ignored path="$PROJECT_DIR$/temp/" />
    <ignored path="$PROJECT_DIR$/tmp/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
      <file leaf-file-name="2018-02-28-first-posting.md" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/_posts/2018-02-28-first-posting.md">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="225">
              <caret line="15" column="14" selection-end-line="15" selection-end-column="14" />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/_site/index.html">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="132">
              <caret line="35" column="29" selection-start-line="35" selection-start-column="29" selection-end-line="35" selection-end-column="29" />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/index.html">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="45">
              <caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="tags.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/tags.html">
          <provider selected="true" editor-type-id="text-editor" />
        </entry>
      </file>
      <file leaf-file-name="tags.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/_layouts/tags.html">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="180">
              <caret line="12" column="22" lean-forward="true" selection-start-line="12" selection-start-column="22" selection-end-line="12" selection-end-column="22" />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="test.md" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/_posts/test.md">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="75">
              <caret line="5" column="4" selection-start-line="5" selection-start-column="4" selection-end-line="5" selection-end-column="4" />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="default.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/_layouts/default.html">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="150">
              <caret line="10" column="7" lean-forward="true" selection-start-line="10" selection-start-column="7" selection-end-line="10" selection-end-column="7" />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="header.html" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/_includes/header.html">
          <provider selected="true" editor-type-id="text-editor" />
        </entry>
      </file>
    </leaf>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/_posts/testposting.md" />
        <option value="$PROJECT_DIR$/_site/index.html" />
        <option value="$PROJECT_DIR$/_posts/test.md" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="ProjectFrameBounds" extendedState="6">
    <option name="width" value="1440" />
    <option name="height" value="900" />
  </component>
  <component name="ProjectView">
    <navigator proportions="" version="1">
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <expand>
            <path>
              <item name="MingyuJeon.github.io" type="b2602c69:ProjectViewProjectNode" />
              <item name="MingyuJeon.github.io" type="462c0819:PsiDirectoryNode" />
            </path>
            <path>
              <item name="MingyuJeon.github.io" type="b2602c69:ProjectViewProjectNode" />
              <item name="MingyuJeon.github.io" type="462c0819:PsiDirectoryNode" />
              <item name="_layouts" type="462c0819:PsiDirectoryNode" />
            </path>
            <path>
              <item name="MingyuJeon.github.io" type="b2602c69:ProjectViewProjectNode" />
              <item name="MingyuJeon.github.io" type="462c0819:PsiDirectoryNode" />
              <item name="_posts" type="462c0819:PsiDirectoryNode" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
      <pane id="Scope" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
    <property name="node.js.detected.package.prettier" value="true" />
    <property name="node.js.path.for.package.prettier" value="project" />
    <property name="node.js.selected.package.prettier" value="" />
    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="a4682652-8337-42a3-a89f-3435862fd95f" name="Default" comment="" />
      <created>1527209772594</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1527209772594</updated>
      <workItem from="1527209775036" duration="969000" />
      <workItem from="1527217217688" duration="2238000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="3207000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="0" width="1440" height="900" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24947146" />
      <window_info anchor="bottom" id="TODO" order="6" />
      <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
      <window_info anchor="bottom" id="Run" order="2" />
      <window_info anchor="bottom" id="Version Control" order="7" />
      <window_info anchor="bottom" id="Quokka" order="7" />
      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
      <window_info anchor="bottom" id="Terminal" order="7" visible="true" weight="0.32948717" />
      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
      <window_info id="Favorites" order="2" side_tool="true" />
      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
      <window_info anchor="right" id="Commander" order="0" weight="0.4" />
      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
      <window_info anchor="bottom" id="Message" order="0" />
      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
      <window_info anchor="bottom" id="Find" order="1" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/_posts/2018-02-28-first-posting.md">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="165">
          <caret line="11" column="92" lean-forward="true" selection-start-line="11" selection-start-column="92" selection-end-line="11" selection-end-column="92" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/_site/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1545">
          <caret line="103" column="24" lean-forward="true" selection-start-line="103" selection-start-column="24" selection-end-line="103" selection-end-column="24" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/_layouts/post.html">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/_site/assets/js/katex_init.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="180">
          <caret line="12" column="37" selection-start-line="12" selection-start-column="37" selection-end-line="12" selection-end-column="37" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/_layouts/page.html">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/_posts/2018-05-24-testposting.md">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="135">
          <caret line="9" column="18" lean-forward="true" selection-start-line="9" selection-start-column="18" selection-end-line="9" selection-end-column="18" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/_layouts/default.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="150">
          <caret line="10" column="7" lean-forward="true" selection-start-line="10" selection-start-column="7" selection-end-line="10" selection-end-column="7" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/_includes/header.html">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/_site/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="132">
          <caret line="35" column="29" selection-start-line="35" selection-start-column="29" selection-end-line="35" selection-end-column="29" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="45">
          <caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/tags.html">
      <provider selected="true" editor-type-id="text-editor" />
    </entry>
    <entry file="file://$PROJECT_DIR$/_layouts/tags.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="180">
          <caret line="12" column="22" lean-forward="true" selection-start-line="12" selection-start-column="22" selection-end-line="12" selection-end-column="22" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/_posts/2018-02-28-first-posting.md">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="225">
          <caret line="15" column="14" selection-end-line="15" selection-end-column="14" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/_posts/test.md">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="75">
          <caret line="5" column="4" selection-start-line="5" selection-start-column="4" selection-end-line="5" selection-end-column="4" />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
@interface ViewController : UITableViewController

-(id)initWithViewControllers:(NSArray *)vcs;

@end

redpajama_set_name: RedPajamaGithub


text:
/**
 * Module that defines everything related to building Columns.
 * It is a container which has column element which is a RoundedRectangle.
 */
import { __extends } from "tslib";
/**
 * ============================================================================
 * IMPORTS
 * ============================================================================
 * @hidden
 */
import { Container } from "../../core/Container";
import { RoundedRectangle } from "../../core/elements/RoundedRectangle";
import { registry } from "../../core/Registry";
import { percent } from "../../core/utils/Percent";
import * as $math from "../../core/utils/Math";
/**
 * ============================================================================
 * MAIN CLASS
 * ============================================================================
 * @hidden
 */
/**
 * Class used to creates Columns.
 *
 * @see {@link IColumnEvents} for a list of available events
 * @see {@link IColumnAdapters} for a list of available Adapters
 * @todo Usage example
 * @important
 */
var Column = /** @class */ (function (_super) {
    __extends(Column, _super);
    /**
     * Constructor
     */
    function Column() {
        var _this = _super.call(this) || this;
        _this.className = "Column";
        _this.width = percent(80);
        _this.height = percent(80);
        //this.isMeasured = true; // for correct position of the tooltip
        _this.events.disableType("transformed"); // not to bug parent
        _this.applyOnClones = true;
        _this.strokeOpacity = 1;
        _this.layout = "none";
        _this.createAssets();
        // otherwise users will have to set layout themselves if they'll want to align, scale etc children
        _this.events.on("childadded", _this.handleKidAdded, _this, false);
        return _this;
    }
    /**
     * @ignore
     */
    Column.prototype.handleKidAdded = function () {
        if (this.layout == "none") {
            this.layout = "absolute";
        }
    };
    /**
     * @ignore
     */
    Column.prototype.createAssets = function () {
        this.column = this.createChild(RoundedRectangle);
        this.column.shouldClone = false;
        this.column.isMeasured = false;
        this.column.cornerRadius(0, 0, 0, 0);
        this._disposers.push(this.column);
    };
    /**
     * @ignore Exclude from docs
     */
    Column.prototype.validate = function () {
        _super.prototype.validate.call(this);
        var column = this.column;
        if (column) {
            column.width = $math.min(this.pixelWidth, this.maxWidth);
            column.height = $math.min(this.pixelHeight, this.maxHeight);
            if (column.invalid) {
                column.validate(); // important!
            }
        }
    };
    /**
     * Copies all parameters from another [[Column]].
     *
     * @param source Source Column
     */
    Column.prototype.copyFrom = function (source) {
        _super.prototype.copyFrom.call(this, source);
        if (this.column) {
            this.column.copyFrom(source.column);
        }
    };
    Object.defineProperty(Column.prototype, "bbox", {
        /**
         * Returns bounding box (square) for this element.
         *
         * @ignore Exclude from docs
         */
        get: function () {
            if (this.definedBBox) {
                return this.definedBBox;
            }
            if (this.column) {
                return { x: 0, y: 0, width: this.column.measuredWidth, height: this.column.measuredHeight };
            }
            else {
                return { x: 0, y: 0, width: $math.min(this.pixelWidth, this.maxWidth), height: $math.min(this.pixelHeight, this.maxHeight) };
            }
        },
        enumerable: true,
        configurable: true
    });
    return Column;
}(Container));
export { Column };
/**
 * Register class in system, so that it can be instantiated using its name from
 * anywhere.
 *
 * @ignore
 */
registry.registeredClasses["Column"] = Column;
//# sourceMappingURL=Column.js.map


text:
@interface DataEntry()

@property UILabel *placeHolderLabel;

@end

@implementation DataEntry

-(instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];

    self.backgroundColor = [UIColor whiteColor];

    [self becomeFirstResponder];

    self.returnKeyType = UIReturnKeyDone;

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChanged:) name:UITextViewTextDidChangeNotification object:nil];

    return self;

}

-(void)layoutSubviews{

    self.layer.cornerRadius = self.frame.size.height/10;

}

- (void)drawRect:(CGRect)rect
{

        if (self.placeHolderLabel == nil ){

            self.placeHolderLabel = [[UILabel alloc] initWithFrame:CGRectMake(5,8,self.bounds.size.width - 16,0)];

            self.placeHolderLabel.lineBreakMode = NSLineBreakByWordWrapping;

            self.placeHolderLabel.numberOfLines = 0;

            self.placeHolderLabel.font = [UIFont systemFontOfSize:12];

            self.placeHolderLabel.backgroundColor = [UIColor clearColor];

            self.placeHolderLabel.textColor = [UIColor lightGrayColor];

            self.placeHolderLabel.alpha = 0;

            [self addSubview: self.placeHolderLabel];

        }

        self.placeHolderLabel.text = @"Leave a new memo...";

        [self. placeHolderLabel sizeToFit];

        [self sendSubviewToBack: self.placeHolderLabel];

    if([[self text] length] == 0) [self.placeHolderLabel setAlpha:1];

    [super drawRect:rect];

}

- (void)setText:(NSString *)text {

    NSLog(@"text is %@", text);

    [super setText:text];

    [self textChanged:nil];

}

- (void)textChanged:(NSNotification *)notification{

    if([self.text containsString:@"\n"]){

        [self resignFirstResponder];

        if(![self.text isEqualToString:@"\n"]){

            [self.dataEntryDelegate textWasAccepted:[self.text stringByReplacingOccurrencesOfString:@"\n" withString:@""]];

        }else{

            [self.dataEntryDelegate dataEntryWasExited];

        }

        return;

    }

    [UIView animateWithDuration:0.25 animations:^{

        if([[self text] length] == 0){

            [self.placeHolderLabel setAlpha:1];

        }else{

            [self.placeHolderLabel setAlpha:0];

        }

    }];

}

@end


text:
/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: Apache Tomcat/7.0.62
 * Generated at: 2017-05-14 06:46:44 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class success_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
  }

  public void _jspDestroy() {
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
      out.write("<LINK href=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("/css/Style.css\" type=text/css rel=stylesheet>\r\n");
      out.write("<LINK href=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
      out.write("/css/Manage.css\" type=text/css\r\n");
      out.write("\trel=stylesheet>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<META content=\"MSHTML 6.00.2900.3492\" name=GENERATOR>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\t\r\n");
      out.write("\r\n");
      out.write("\t\t
\r\n");
      out.write("\t\t\t
\r\n");
      out.write("\t\t\t\t
\r\n");
      out.write("\t\t\t\t\t	\r\n");
      out.write("\t\t\t\t\t	\r\n");
      out.write("\t\t\t\t\t	\r\n");
      out.write("\t\t\t\t
\r\n");
      out.write("\t\t\t
\r\n");
      out.write("\t\t
\r\n");
      out.write("\t
\r\n");
      out.write("\t\t
\r\n");
      out.write("\t\t\t
\r\n");
      out.write("\t\t\t\t	\r\n");
      out.write("\t\t\t\t\r\n");
      out.write("\t\t\t\t\t
\r\n");
      out.write("\t\t\t\t\t\t
\r\n");
      out.write("\t\t\t\t\t\t\t\r\n");
      out.write("\t\t\t\t\t\t\t    您的操作成功!\t\r\n");
      out.write("\t\t\t\t\t\t\t	\r\n");
      out.write("\t\t\t\t\t\t
\r\n");
      out.write("\t\t\t\t\t
\r\n");
      out.write("\t\t\t\t	\r\n");
      out.write("\t\t\t\t	\r\n");
      out.write("\t\t\t
\r\n");
      out.write("\t\t
\r\n");
      out.write("\t
\r\n");
      out.write("\t
\r\n");
      out.write("\t\t\t
\r\n");
      out.write("\t\t\t\t
\r\n");
      out.write("\t\t\t\t\t	\r\n");
      out.write("\t\t\t\t\t	\r\n");
      out.write("\t\t\t\t\t	\r\n");
      out.write("\t\t\t\t
\r\n");
      out.write("\t\t\t
\r\n");
      out.write("\t\t
\r\n");
      out.write("\r\n");
      out.write("\r\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}


text:
using System;

namespace ImplicitNullability.Plugin.Configuration
{
    /// <summary>
    /// A flags enum representing the selected / configured code elements where Implicit Nullability should apply to.
    /// </summary>
    [Flags]
    public enum ImplicitNullabilityAppliesTo
    {
        None = 0,
        InputParameters = 1,
        RefParameters = 2,
        OutParametersAndResult = 4,
        Fields = 8,
        Properties = 16,
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.github.nukc.sample">

    <application
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".OutsideActivity"
            android:label="@string/outside" />
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".InsideActivity"
            android:label="@string/inside" />
    </application>

</manifest>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2012 SURFnet bv, The Netherlands

  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.
  -->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">

  <context:component-scan base-package="nl.surfnet.mujina.controllers"/>

  <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp"/>
  </bean>

  <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
    <property name="mediaTypes">
      <map>
        <entry key="atom" value="application/atom+xml"/>
        <entry key="html" value="text/html"/>
        <entry key="json" value="application/json"/>
      </map>
    </property>
    <property name="viewResolvers">
      <list>
        <bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/>
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
          <property name="prefix" value="/WEB-INF/jsp/"/>
          <property name="suffix" value=".jsp"/>
        </bean>
      </list>
    </property>
    <property name="defaultViews">
      <list>
        <bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView"/>
      </list>
    </property>
  </bean>

  <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
    <property name="messageConverters">
      <util:list id="beanList">
        <ref bean="stringHttpMessageConverter"/>
        <ref bean="mappingJacksonHttpMessageConverter"/>
      </util:list>
    </property>
  </bean>

  <bean id="stringHttpMessageConverter"
        class="org.springframework.http.converter.StringHttpMessageConverter"/>

  <bean id="mappingJacksonHttpMessageConverter"
        class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"/>

</beans>


text:
Creating a new input adapter
==============================

You can write your own storage adapters by creating a new class that
inherits from :code:`InputAdapter` and overrides the overrides necessary
methods established in the base :code:`InputAdapter` class.

.. autofunction:: chatterbot.input.InputAdapter

To create your own input adapter you must override the :code:`process_input`
method to return a :ref:`Statement <conversation_statements>` object.

Note that you may need to extend the :code:`__init__` method of your custom input
adapter if you intend to save a kwarg parameter that was passed into
the chat bot's constructor.
(An API key might be an example of a parameter you would want to access here.)

.. literalinclude:: ../../chatterbot/input/input_adapter.py
   :language: python


text:
import re

from mock import Mock

from trove.common import exception
from trove.common import template
from trove.common import utils
from trove.datastore.models import DatastoreVersion
from trove.tests.unittests import trove_testtools
from trove.tests.unittests.util import util

class TemplateTest(trove_testtools.TestCase):
    def setUp(self):
        super(TemplateTest, self).setUp()
        util.init_db()
        self.env = template.ENV
        self.template = self.env.get_template("mysql/config.template")
        self.flavor_dict = {'ram': 1024, 'name': 'small', 'id': '55'}
        self.server_id = "180b5ed1-3e57-4459-b7a3-2aeee4ac012a"

    def tearDown(self):
        super(TemplateTest, self).tearDown()

    def _find_in_template(self, contents, teststr):
        found_group = None
        for line in contents.split('\n'):
            m = re.search('^%s.*' % teststr, line)
            if m:
                found_group = m.group(0)
        return found_group

    def validate_template(self, contents, teststr, test_flavor, server_id):
        # expected query_cache_size = {{ 8 * flavor_multiplier }}M
        flavor_multiplier = test_flavor['ram'] // 512
        found_group = self._find_in_template(contents, teststr)
        if not found_group:
            raise "Could not find text in template"
        # Check that the last group has been rendered
        memsize = found_group.split(" ")[2]
        self.assertEqual("%sM" % (8 * flavor_multiplier), memsize)
        self.assertIsNotNone(server_id)
        self.assertGreater(len(server_id), 1)

    def test_rendering(self):
        rendered = self.template.render(flavor=self.flavor_dict,
                                        server_id=self.server_id)
        self.validate_template(rendered,
                               "query_cache_size",
                               self.flavor_dict,
                               self.server_id)

    def test_single_instance_config_rendering(self):
        datastore = Mock(spec=DatastoreVersion)
        datastore.datastore_name = 'MySql'
        datastore.name = 'mysql-5.6'
        datastore.manager = 'mysql'
        config = template.SingleInstanceConfigTemplate(datastore,
                                                       self.flavor_dict,
                                                       self.server_id)
        self.validate_template(config.render(), "query_cache_size",
                               self.flavor_dict, self.server_id)

    def test_renderer_discovers_special_config(self):
        """Finds our special config file for the version 'mysql-test'."""
        datastore = Mock(spec=DatastoreVersion)
        datastore.datastore_name = 'mysql'
        datastore.name = 'mysql-test'
        datastore.manager = 'mysql'
        config = template.SingleInstanceConfigTemplate(datastore,
                                                       self.flavor_dict,
                                                       self.server_id)
        self.validate_template(config.render(), "hyper",
                               {'ram': 0}, self.server_id)

    def test_replica_source_config_rendering(self):
        datastore = Mock(spec=DatastoreVersion)
        datastore.datastore_name = 'MySql'
        datastore.name = 'mysql-5.6'
        datastore.manager = 'mysql'
        config = template.ReplicaSourceConfigTemplate(datastore,
                                                      self.flavor_dict,
                                                      self.server_id)
        self.assertTrue(self._find_in_template(config.render(), "log_bin"))

    def test_replica_config_rendering(self):
        datastore = Mock(spec=DatastoreVersion)
        datastore.datastore_name = 'MySql'
        datastore.name = 'mysql-5.6'
        datastore.manager = 'mysql'
        config = template.ReplicaConfigTemplate(datastore,
                                                self.flavor_dict,
                                                self.server_id)
        self.assertTrue(self._find_in_template(config.render(), "relay_log"))

class HeatTemplateLoadTest(trove_testtools.TestCase):

    class FakeTemplate(object):
        def __init__(self):
            self.name = 'mysql/heat.template'

    def setUp(self):
        self.default = 'default.heat.template'
        self.orig_1 = utils.ENV.list_templates
        self.orig_2 = utils.ENV.get_template
        super(HeatTemplateLoadTest, self).setUp()

    def tearDown(self):
        utils.ENV.list_templates = self.orig_1
        utils.ENV.get_template = self.orig_2
        super(HeatTemplateLoadTest, self).tearDown()

    def test_heat_template_load_with_invalid_datastore(self):
        invalid_datastore = 'mysql-blah'
        self.assertRaises(exception.InvalidDatastoreManager,
                          template.load_heat_template,
                          invalid_datastore)

    def test_heat_template_load_non_default(self):
        orig = utils.ENV._load_template
        utils.ENV._load_template = Mock(return_value=self.FakeTemplate())
        mysql_tmpl = template.load_heat_template('mysql')
        self.assertNotEqual(mysql_tmpl.name, self.default)
        utils.ENV._load_template = orig

    def test_heat_template_load_success(self):
        mysql_tmpl = template.load_heat_template('mysql')
        redis_tmpl = template.load_heat_template('redis')
        cassandra_tmpl = template.load_heat_template('cassandra')
        mongo_tmpl = template.load_heat_template('mongodb')
        percona_tmpl = template.load_heat_template('percona')
        couchbase_tmpl = template.load_heat_template('couchbase')
        self.assertIsNotNone(mysql_tmpl)
        self.assertIsNotNone(redis_tmpl)
        self.assertIsNotNone(cassandra_tmpl)
        self.assertIsNotNone(mongo_tmpl)
        self.assertIsNotNone(percona_tmpl)
        self.assertIsNotNone(couchbase_tmpl)
        self.assertEqual(self.default, mysql_tmpl.name)
        self.assertEqual(self.default, redis_tmpl.name)
        self.assertEqual(self.default, cassandra_tmpl.name)
        self.assertEqual(self.default, mongo_tmpl.name)
        self.assertEqual(self.default, percona_tmpl.name)
        self.assertEqual(self.default, couchbase_tmpl.name)

    def test_render_templates_with_ports_from_config(self):
        mysql_tmpl = template.load_heat_template('mysql')
        tcp_rules = [{'cidr': "0.0.0.0/0",
                      'from_': 3306,
                      'to_': 3309},
                     {'cidr': "0.0.0.0/0",
                      'from_': 3320,
                      'to_': 33022}]
        output = mysql_tmpl.render(
            volume_support=True,
            ifaces=[], ports=[],
            tcp_rules=tcp_rules,
            udp_rules=[],
            files={})
        self.assertIsNotNone(output)
        self.assertIn('FromPort: "3306"', output)
        self.assertIn('ToPort: "3309"', output)
        self.assertIn('CidrIp: "0.0.0.0/0"', output)
        self.assertIn('FromPort: "3320"', output)
        self.assertIn('ToPort: "33022"', output)

    def test_no_rules_if_no_ports(self):
        mysql_tmpl = template.load_heat_template('mysql')
        output = mysql_tmpl.render(
            volume_support=True,
            ifaces=[], ports=[],
            tcp_rules=[],
            udp_rules=[],
            files={})
        self.assertIsNotNone(output)
        self.assertNotIn('- IpProtocol: "tcp"', output)
        self.assertNotIn('- IpProtocol: "udp"', output)


text:
layout: default
---

    {{ content }}

        {% for post in site.posts %}

            {% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}

            {% if post.custom_main_image %}

            {% endif %}

                {{ post.title | escape }}

            {{ post.date | date: date_format }}

            {{ post.custom_excerpt }}

            Continuar lendo ...

        {% endfor %}


text:
SETUP NEW INSTANCE:
===================
sudo yum -y update
sudo yum install -y gcc make gcc-c++
sudo yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24

//sudo yum install php-mysql php php-xml php-mcrypt php-mbstring php-cli mysql httpd

SETUP AUTOSTART SERVICE:
========================
sudo chkconfig httpd on
sudo chkconfig mysqld on

sudo service httpd start
sudo service mysqld start

sudo chown apache:apache /var/www/html

# change permission to write for group (as ec2-user)

sudo chgrp -R wheel /var/www/html
sudo chmod g+w /var/www/html

SET time zone to SQL:

[mysqld]
default_time_zone='+08:00'

INSTALL PMA:
============
http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/

wget https://github.com/phpmyadmin/phpmyadmin/archive/STABLE.tar.gz

tar zxvf STABLE.tar.gz

mv phpMyAdmin-4.5.0.2-all-languages phpmyadmin

rm -rf phpMyAdmin-4.5.0.2-all-languages.tar.bz2

SHOW FREE SPACE DISK:
df -h

SHOW FREE MEMORY:
free -m

AWS setup[http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html]

CHANGE PERMISSION
==========================================
sudo chmod -R 755 /var/www/html

CHANGE OWNERSHIP
==========================================
sudo chown -R ec2-user /var/www/html

MAKE PRIVATE KEY NOT ACCESSIBLE TO OTHERS:
==========================================
sudo chmod 400 fuse-sg.pem


text:
<component name="libraryTable">
  <library name="animated-vector-drawable-25.3.1">
    <CLASSES>
      <root url="jar://$USER_HOME$/.android/build-cache/055d071be0dcabd6060f0ec6f3450d690925728e/output/jars/classes.jar!/" />
      <root url="file://$USER_HOME$/.android/build-cache/055d071be0dcabd6060f0ec6f3450d690925728e/output/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/AppData/Local/sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/25.3.1/animated-vector-drawable-25.3.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
<?php
namespace PhpUnitsOfMeasure;

/**
 * Classes that implement this interface represent
 * units of measure of physical quantities.  In addition
 * to handling their names and various aliases, these
 * objects are capable of converting values to and
 * from an externally-agreed-upon native unit of measure.
 *
 * The native unit of measure can be any arbitrary
 * unit compatible wit the physical quantity to which
 * this unit of measure belongs, however all the units of measure
 * for a particular physical quantity must agree on the same
 * native unit.
 *
 * For instance, all units of measure for Length must agree
 * that the meter is the native unit to and from which all values are
 * converted.
 */
interface UnitOfMeasureInterface
{
    /**
     * Add a new alias for this unit of measure
     *
     * @param string $alias The new alias
     *
     * @return void
     */
    public function addAlias($alias);

    /**
     * Get the canonical name of this unit of measure.
     *
     * @return string The canonical naoe of this unit of measure.
     */
    public function getName();

    /**
     * Is the given unit an alias of this unit of measure?
     *
     * @param  string $unit A string representation of a potential alias of this unit of measure
     *
     * @return boolean
     */
    public function isAliasOf($unit);

    /**
     * Convert the given value from the native unit of measure to
     * this unit of measure.
     *
     * The native unit of measure can be anything, but all the
     * units of measure for a given PhysicalQuantity must agree
     * on what that unit is.
     *
     * @param  float $value The quantity to convert from this unit of measure
     *
     * @return float the new value in the native unit
     */
    public function convertValueFromNativeUnitOfMeasure($value);

    /**
     * Convert the given value from this unit of measure into the
     * native unit of measure.
     *
     * The native unit of measure can be anything, but all the
     * units of measure for a given PhysicalQuantity must agree
     * on what that unit is.
     *
     * @param  float $value The quantity to convert from the native unit of measure
     *
     * @return float the new value in this unit of measure
     */
    public function convertValueToNativeUnitOfMeasure($value);
}


text:
<?php

namespace JK\SamBundle;

use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class JKSamBundle extends Bundle
{
    /**
     * @return bool|ExtensionInterface
     */
    public function getContainerExtension()
    {
        if (null === $this->extension) {
            $class = $this->getContainerExtensionClass();

            if (class_exists($class)) {
                $extension = new $class();

                if (!$extension instanceof ExtensionInterface) {
                    throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.', $class));
                }
                $this->extension = $extension;
            } else {
                $this->extension = false;
            }
        }
        if ($this->extension) {
            return $this->extension;
        }

        return null;
    }
}


text:
process.env.NODE_ENV = 'test';
process.env.NODE_PATH = __dirname + '/..';
require('module')._initPaths();
require('babel/register');

var conf = require('conf');
conf.ignoreScreenOutput = true;


text:
package server

import (
	"context"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
	cloudfunctionspb "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/cloudfunctions/cloudfunctions_go_proto"
	emptypb "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/empty_go_proto"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/cloudfunctions"
)

// FunctionServer implements the gRPC interface for Function.
type FunctionServer struct{}

// ProtoToFunctionHttpsTriggerSecurityLevelEnum converts a FunctionHttpsTriggerSecurityLevelEnum enum from its proto representation.
func ProtoToCloudfunctionsFunctionHttpsTriggerSecurityLevelEnum(e cloudfunctionspb.CloudfunctionsFunctionHttpsTriggerSecurityLevelEnum) *cloudfunctions.FunctionHttpsTriggerSecurityLevelEnum {
	if e == 0 {
		return nil
	}
	if n, ok := cloudfunctionspb.CloudfunctionsFunctionHttpsTriggerSecurityLevelEnum_name[int32(e)]; ok {
		e := cloudfunctions.FunctionHttpsTriggerSecurityLevelEnum(n[len("CloudfunctionsFunctionHttpsTriggerSecurityLevelEnum"):])
		return &e
	}
	return nil
}

// ProtoToFunctionStatusEnum converts a FunctionStatusEnum enum from its proto representation.
func ProtoToCloudfunctionsFunctionStatusEnum(e cloudfunctionspb.CloudfunctionsFunctionStatusEnum) *cloudfunctions.FunctionStatusEnum {
	if e == 0 {
		return nil
	}
	if n, ok := cloudfunctionspb.CloudfunctionsFunctionStatusEnum_name[int32(e)]; ok {
		e := cloudfunctions.FunctionStatusEnum(n[len("CloudfunctionsFunctionStatusEnum"):])
		return &e
	}
	return nil
}

// ProtoToFunctionVPCConnectorEgressSettingsEnum converts a FunctionVPCConnectorEgressSettingsEnum enum from its proto representation.
func ProtoToCloudfunctionsFunctionVPCConnectorEgressSettingsEnum(e cloudfunctionspb.CloudfunctionsFunctionVPCConnectorEgressSettingsEnum) *cloudfunctions.FunctionVPCConnectorEgressSettingsEnum {
	if e == 0 {
		return nil
	}
	if n, ok := cloudfunctionspb.CloudfunctionsFunctionVPCConnectorEgressSettingsEnum_name[int32(e)]; ok {
		e := cloudfunctions.FunctionVPCConnectorEgressSettingsEnum(n[len("CloudfunctionsFunctionVPCConnectorEgressSettingsEnum"):])
		return &e
	}
	return nil
}

// ProtoToFunctionIngressSettingsEnum converts a FunctionIngressSettingsEnum enum from its proto representation.
func ProtoToCloudfunctionsFunctionIngressSettingsEnum(e cloudfunctionspb.CloudfunctionsFunctionIngressSettingsEnum) *cloudfunctions.FunctionIngressSettingsEnum {
	if e == 0 {
		return nil
	}
	if n, ok := cloudfunctionspb.CloudfunctionsFunctionIngressSettingsEnum_name[int32(e)]; ok {
		e := cloudfunctions.FunctionIngressSettingsEnum(n[len("CloudfunctionsFunctionIngressSettingsEnum"):])
		return &e
	}
	return nil
}

// ProtoToFunctionSourceRepository converts a FunctionSourceRepository object from its proto representation.
func ProtoToCloudfunctionsFunctionSourceRepository(p *cloudfunctionspb.CloudfunctionsFunctionSourceRepository) *cloudfunctions.FunctionSourceRepository {
	if p == nil {
		return nil
	}
	obj := &cloudfunctions.FunctionSourceRepository{
		Url:         dcl.StringOrNil(p.GetUrl()),
		DeployedUrl: dcl.StringOrNil(p.GetDeployedUrl()),
	}
	return obj
}

// ProtoToFunctionHttpsTrigger converts a FunctionHttpsTrigger object from its proto representation.
func ProtoToCloudfunctionsFunctionHttpsTrigger(p *cloudfunctionspb.CloudfunctionsFunctionHttpsTrigger) *cloudfunctions.FunctionHttpsTrigger {
	if p == nil {
		return nil
	}
	obj := &cloudfunctions.FunctionHttpsTrigger{
		Url:           dcl.StringOrNil(p.GetUrl()),
		SecurityLevel: ProtoToCloudfunctionsFunctionHttpsTriggerSecurityLevelEnum(p.GetSecurityLevel()),
	}
	return obj
}

// ProtoToFunctionEventTrigger converts a FunctionEventTrigger object from its proto representation.
func ProtoToCloudfunctionsFunctionEventTrigger(p *cloudfunctionspb.CloudfunctionsFunctionEventTrigger) *cloudfunctions.FunctionEventTrigger {
	if p == nil {
		return nil
	}
	obj := &cloudfunctions.FunctionEventTrigger{
		EventType:     dcl.StringOrNil(p.GetEventType()),
		Resource:      dcl.StringOrNil(p.GetResource()),
		Service:       dcl.StringOrNil(p.GetService()),
		FailurePolicy: dcl.Bool(p.GetFailurePolicy()),
	}
	return obj
}

// ProtoToFunction converts a Function resource from its proto representation.
func ProtoToFunction(p *cloudfunctionspb.CloudfunctionsFunction) *cloudfunctions.Function {
	obj := &cloudfunctions.Function{
		Name:                       dcl.StringOrNil(p.GetName()),
		Description:                dcl.StringOrNil(p.GetDescription()),
		SourceArchiveUrl:           dcl.StringOrNil(p.GetSourceArchiveUrl()),
		SourceRepository:           ProtoToCloudfunctionsFunctionSourceRepository(p.GetSourceRepository()),
		HttpsTrigger:               ProtoToCloudfunctionsFunctionHttpsTrigger(p.GetHttpsTrigger()),
		EventTrigger:               ProtoToCloudfunctionsFunctionEventTrigger(p.GetEventTrigger()),
		Status:                     ProtoToCloudfunctionsFunctionStatusEnum(p.GetStatus()),
		EntryPoint:                 dcl.StringOrNil(p.GetEntryPoint()),
		Runtime:                    dcl.StringOrNil(p.GetRuntime()),
		Timeout:                    dcl.StringOrNil(p.GetTimeout()),
		AvailableMemoryMb:          dcl.Int64OrNil(p.GetAvailableMemoryMb()),
		ServiceAccountEmail:        dcl.StringOrNil(p.GetServiceAccountEmail()),
		UpdateTime:                 dcl.StringOrNil(p.GetUpdateTime()),
		VersionId:                  dcl.Int64OrNil(p.GetVersionId()),
		MaxInstances:               dcl.Int64OrNil(p.GetMaxInstances()),
		VPCConnector:               dcl.StringOrNil(p.GetVpcConnector()),
		VPCConnectorEgressSettings: ProtoToCloudfunctionsFunctionVPCConnectorEgressSettingsEnum(p.GetVpcConnectorEgressSettings()),
		IngressSettings:            ProtoToCloudfunctionsFunctionIngressSettingsEnum(p.GetIngressSettings()),
		Region:                     dcl.StringOrNil(p.GetRegion()),
		Project:                    dcl.StringOrNil(p.GetProject()),
	}
	return obj
}

// FunctionHttpsTriggerSecurityLevelEnumToProto converts a FunctionHttpsTriggerSecurityLevelEnum enum to its proto representation.
func CloudfunctionsFunctionHttpsTriggerSecurityLevelEnumToProto(e *cloudfunctions.FunctionHttpsTriggerSecurityLevelEnum) cloudfunctionspb.CloudfunctionsFunctionHttpsTriggerSecurityLevelEnum {
	if e == nil {
		return cloudfunctionspb.CloudfunctionsFunctionHttpsTriggerSecurityLevelEnum(0)
	}
	if v, ok := cloudfunctionspb.CloudfunctionsFunctionHttpsTriggerSecurityLevelEnum_value["FunctionHttpsTriggerSecurityLevelEnum"+string(*e)]; ok {
		return cloudfunctionspb.CloudfunctionsFunctionHttpsTriggerSecurityLevelEnum(v)
	}
	return cloudfunctionspb.CloudfunctionsFunctionHttpsTriggerSecurityLevelEnum(0)
}

// FunctionStatusEnumToProto converts a FunctionStatusEnum enum to its proto representation.
func CloudfunctionsFunctionStatusEnumToProto(e *cloudfunctions.FunctionStatusEnum) cloudfunctionspb.CloudfunctionsFunctionStatusEnum {
	if e == nil {
		return cloudfunctionspb.CloudfunctionsFunctionStatusEnum(0)
	}
	if v, ok := cloudfunctionspb.CloudfunctionsFunctionStatusEnum_value["FunctionStatusEnum"+string(*e)]; ok {
		return cloudfunctionspb.CloudfunctionsFunctionStatusEnum(v)
	}
	return cloudfunctionspb.CloudfunctionsFunctionStatusEnum(0)
}

// FunctionVPCConnectorEgressSettingsEnumToProto converts a FunctionVPCConnectorEgressSettingsEnum enum to its proto representation.
func CloudfunctionsFunctionVPCConnectorEgressSettingsEnumToProto(e *cloudfunctions.FunctionVPCConnectorEgressSettingsEnum) cloudfunctionspb.CloudfunctionsFunctionVPCConnectorEgressSettingsEnum {
	if e == nil {
		return cloudfunctionspb.CloudfunctionsFunctionVPCConnectorEgressSettingsEnum(0)
	}
	if v, ok := cloudfunctionspb.CloudfunctionsFunctionVPCConnectorEgressSettingsEnum_value["FunctionVPCConnectorEgressSettingsEnum"+string(*e)]; ok {
		return cloudfunctionspb.CloudfunctionsFunctionVPCConnectorEgressSettingsEnum(v)
	}
	return cloudfunctionspb.CloudfunctionsFunctionVPCConnectorEgressSettingsEnum(0)
}

// FunctionIngressSettingsEnumToProto converts a FunctionIngressSettingsEnum enum to its proto representation.
func CloudfunctionsFunctionIngressSettingsEnumToProto(e *cloudfunctions.FunctionIngressSettingsEnum) cloudfunctionspb.CloudfunctionsFunctionIngressSettingsEnum {
	if e == nil {
		return cloudfunctionspb.CloudfunctionsFunctionIngressSettingsEnum(0)
	}
	if v, ok := cloudfunctionspb.CloudfunctionsFunctionIngressSettingsEnum_value["FunctionIngressSettingsEnum"+string(*e)]; ok {
		return cloudfunctionspb.CloudfunctionsFunctionIngressSettingsEnum(v)
	}
	return cloudfunctionspb.CloudfunctionsFunctionIngressSettingsEnum(0)
}

// FunctionSourceRepositoryToProto converts a FunctionSourceRepository object to its proto representation.
func CloudfunctionsFunctionSourceRepositoryToProto(o *cloudfunctions.FunctionSourceRepository) *cloudfunctionspb.CloudfunctionsFunctionSourceRepository {
	if o == nil {
		return nil
	}
	p := &cloudfunctionspb.CloudfunctionsFunctionSourceRepository{}
	p.SetUrl(dcl.ValueOrEmptyString(o.Url))
	p.SetDeployedUrl(dcl.ValueOrEmptyString(o.DeployedUrl))
	return p
}

// FunctionHttpsTriggerToProto converts a FunctionHttpsTrigger object to its proto representation.
func CloudfunctionsFunctionHttpsTriggerToProto(o *cloudfunctions.FunctionHttpsTrigger) *cloudfunctionspb.CloudfunctionsFunctionHttpsTrigger {
	if o == nil {
		return nil
	}
	p := &cloudfunctionspb.CloudfunctionsFunctionHttpsTrigger{}
	p.SetUrl(dcl.ValueOrEmptyString(o.Url))
	p.SetSecurityLevel(CloudfunctionsFunctionHttpsTriggerSecurityLevelEnumToProto(o.SecurityLevel))
	return p
}

// FunctionEventTriggerToProto converts a FunctionEventTrigger object to its proto representation.
func CloudfunctionsFunctionEventTriggerToProto(o *cloudfunctions.FunctionEventTrigger) *cloudfunctionspb.CloudfunctionsFunctionEventTrigger {
	if o == nil {
		return nil
	}
	p := &cloudfunctionspb.CloudfunctionsFunctionEventTrigger{}
	p.SetEventType(dcl.ValueOrEmptyString(o.EventType))
	p.SetResource(dcl.ValueOrEmptyString(o.Resource))
	p.SetService(dcl.ValueOrEmptyString(o.Service))
	p.SetFailurePolicy(dcl.ValueOrEmptyBool(o.FailurePolicy))
	return p
}

// FunctionToProto converts a Function resource to its proto representation.
func FunctionToProto(resource *cloudfunctions.Function) *cloudfunctionspb.CloudfunctionsFunction {
	p := &cloudfunctionspb.CloudfunctionsFunction{}
	p.SetName(dcl.ValueOrEmptyString(resource.Name))
	p.SetDescription(dcl.ValueOrEmptyString(resource.Description))
	p.SetSourceArchiveUrl(dcl.ValueOrEmptyString(resource.SourceArchiveUrl))
	p.SetSourceRepository(CloudfunctionsFunctionSourceRepositoryToProto(resource.SourceRepository))
	p.SetHttpsTrigger(CloudfunctionsFunctionHttpsTriggerToProto(resource.HttpsTrigger))
	p.SetEventTrigger(CloudfunctionsFunctionEventTriggerToProto(resource.EventTrigger))
	p.SetStatus(CloudfunctionsFunctionStatusEnumToProto(resource.Status))
	p.SetEntryPoint(dcl.ValueOrEmptyString(resource.EntryPoint))
	p.SetRuntime(dcl.ValueOrEmptyString(resource.Runtime))
	p.SetTimeout(dcl.ValueOrEmptyString(resource.Timeout))
	p.SetAvailableMemoryMb(dcl.ValueOrEmptyInt64(resource.AvailableMemoryMb))
	p.SetServiceAccountEmail(dcl.ValueOrEmptyString(resource.ServiceAccountEmail))
	p.SetUpdateTime(dcl.ValueOrEmptyString(resource.UpdateTime))
	p.SetVersionId(dcl.ValueOrEmptyInt64(resource.VersionId))
	p.SetMaxInstances(dcl.ValueOrEmptyInt64(resource.MaxInstances))
	p.SetVpcConnector(dcl.ValueOrEmptyString(resource.VPCConnector))
	p.SetVpcConnectorEgressSettings(CloudfunctionsFunctionVPCConnectorEgressSettingsEnumToProto(resource.VPCConnectorEgressSettings))
	p.SetIngressSettings(CloudfunctionsFunctionIngressSettingsEnumToProto(resource.IngressSettings))
	p.SetRegion(dcl.ValueOrEmptyString(resource.Region))
	p.SetProject(dcl.ValueOrEmptyString(resource.Project))
	mLabels := make(map[string]string, len(resource.Labels))
	for k, r := range resource.Labels {
		mLabels[k] = r
	}
	p.SetLabels(mLabels)
	mEnvironmentVariables := make(map[string]string, len(resource.EnvironmentVariables))
	for k, r := range resource.EnvironmentVariables {
		mEnvironmentVariables[k] = r
	}
	p.SetEnvironmentVariables(mEnvironmentVariables)

	return p
}

// applyFunction handles the gRPC request by passing it to the underlying Function Apply() method.
func (s *FunctionServer) applyFunction(ctx context.Context, c *cloudfunctions.Client, request *cloudfunctionspb.ApplyCloudfunctionsFunctionRequest) (*cloudfunctionspb.CloudfunctionsFunction, error) {
	p := ProtoToFunction(request.GetResource())
	res, err := c.ApplyFunction(ctx, p)
	if err != nil {
		return nil, err
	}
	r := FunctionToProto(res)
	return r, nil
}

// applyCloudfunctionsFunction handles the gRPC request by passing it to the underlying Function Apply() method.
func (s *FunctionServer) ApplyCloudfunctionsFunction(ctx context.Context, request *cloudfunctionspb.ApplyCloudfunctionsFunctionRequest) (*cloudfunctionspb.CloudfunctionsFunction, error) {
	cl, err := createConfigFunction(ctx, request.GetServiceAccountFile())
	if err != nil {
		return nil, err
	}
	return s.applyFunction(ctx, cl, request)
}

// DeleteFunction handles the gRPC request by passing it to the underlying Function Delete() method.
func (s *FunctionServer) DeleteCloudfunctionsFunction(ctx context.Context, request *cloudfunctionspb.DeleteCloudfunctionsFunctionRequest) (*emptypb.Empty, error) {

	cl, err := createConfigFunction(ctx, request.GetServiceAccountFile())
	if err != nil {
		return nil, err
	}
	return &emptypb.Empty{}, cl.DeleteFunction(ctx, ProtoToFunction(request.GetResource()))

}

// ListCloudfunctionsFunction handles the gRPC request by passing it to the underlying FunctionList() method.
func (s *FunctionServer) ListCloudfunctionsFunction(ctx context.Context, request *cloudfunctionspb.ListCloudfunctionsFunctionRequest) (*cloudfunctionspb.ListCloudfunctionsFunctionResponse, error) {
	cl, err := createConfigFunction(ctx, request.GetServiceAccountFile())
	if err != nil {
		return nil, err
	}

	resources, err := cl.ListFunction(ctx, request.GetProject(), request.GetRegion())
	if err != nil {
		return nil, err
	}
	var protos []*cloudfunctionspb.CloudfunctionsFunction
	for _, r := range resources.Items {
		rp := FunctionToProto(r)
		protos = append(protos, rp)
	}
	p := &cloudfunctionspb.ListCloudfunctionsFunctionResponse{}
	p.SetItems(protos)
	return p, nil
}

func createConfigFunction(ctx context.Context, service_account_file string) (*cloudfunctions.Client, error) {

	conf := dcl.NewConfig(dcl.WithUserAgent("dcl-test"), dcl.WithCredentialsFile(service_account_file))
	return cloudfunctions.NewClient(conf), nil
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>UIView(Additions) Category Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">

				qudianDoc

				qudian

Index

Hierarchy

							On This Page

							<select id="jump-to">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<optgroup label="Properties">

		<option value="//api/name/keyboardDistanceFromTextField">keyboardDistanceFromTextField</option>

	</optgroup>

</select>

UIView(Additions) Category Reference

	Declared in
	IQUITextFieldView+Additions.h
IQUITextFieldView+Additions.m

Overview

UIView category for managing UITextField/UITextView

  keyboardDistanceFromTextField

To set customized distance from keyboard for textField/textView. Can’t be less than zero

@property (nonatomic, assign) CGFloat keyboardDistanceFromTextField

Discussion

To set customized distance from keyboard for textField/textView. Can’t be less than zero

Declared In

IQUITextFieldView+Additions.h

Copyright © 2016 qudian. All rights reserved. Updated: 2016-11-29

Generated by appledoc 2.2.1 (build 1334).


text:
<resources>

    <string-array name="ExplicitIntents">
        <item>Call Activity Two</item>
        <item>Call Activity Two with data</item>
        <item>Call Activity Two as SubActivity</item>
    </string-array>
    <string-array name="ImplicitIntents">
        <item>Open Browser</item>
        <item>Call Someone</item>
        <item>Dial</item>
        <item>Show Map</item>
        <item>Search on Map</item>
        <item>Take picture</item>
        <item>Show contacts</item>
        <item>Edit first contact</item>
    </string-array>
    <string-array name="Other">
        <item>LinearLayout</item>
        <item>GridLayout</item>
        <item>RelativeLayout</item>
        <item>ListView</item>
        <item>GridView</item>
        <item>Events</item>
        <item>Dialogs</item>
        <item>Threads</item>
        <item>Services</item>
        <item>Fragments</item>
        <item>Storage</item>
        <item>Notification</item>
        <item>Location</item>
        <item>Contextual Action Mode</item>
        <item>Sql Lite</item>
        <item>Broadcast 1</item>
        <item>Camera</item>
        <item>Single Touch</item>
        <item>Location</item>
        <item>Wifi</item>
        <item>Services</item>
    </string-array>
    <string-array name="explicit">
        <item>AAAA</item>
    </string-array>

</resources>


text:
import { Lexer as ExpressionLexer } from '../expression_parser/lexer';
import { Parser as ExpressionParser } from '../expression_parser/parser';
import * as html from '../ml_parser/ast';
import { getHtmlTagDefinition } from '../ml_parser/html_tags';
import * as i18n from './i18n_ast';
import { PlaceholderRegistry } from './serializers/placeholder';
var /** @type {?} */ _expParser = new ExpressionParser(new ExpressionLexer());
/**
 * Returns a function converting html nodes to an i18n Message given an interpolationConfig
 * @param {?} interpolationConfig
 * @return {?}
 */
export function createI18nMessageFactory(interpolationConfig) {
    var /** @type {?} */ visitor = new _I18nVisitor(_expParser, interpolationConfig);
    return function (nodes, meaning, description) {
        return visitor.toI18nMessage(nodes, meaning, description);
    };
}
var _I18nVisitor = (function () {
    /**
     * @param {?} _expressionParser
     * @param {?} _interpolationConfig
     */
    function _I18nVisitor(_expressionParser, _interpolationConfig) {
        this._expressionParser = _expressionParser;
        this._interpolationConfig = _interpolationConfig;
    }
    /**
     * @param {?} nodes
     * @param {?} meaning
     * @param {?} description
     * @return {?}
     */
    _I18nVisitor.prototype.toI18nMessage = function (nodes, meaning, description) {
        this._isIcu = nodes.length == 1 && nodes[0] instanceof html.Expansion;
        this._icuDepth = 0;
        this._placeholderRegistry = new PlaceholderRegistry();
        this._placeholderToContent = {};
        this._placeholderToMessage = {};
        var /** @type {?} */ i18nodes = html.visitAll(this, nodes, {});
        return new i18n.Message(i18nodes, this._placeholderToContent, this._placeholderToMessage, meaning, description);
    };
    /**
     * @param {?} el
     * @param {?} context
     * @return {?}
     */
    _I18nVisitor.prototype.visitElement = function (el, context) {
        var /** @type {?} */ children = html.visitAll(this, el.children);
        var /** @type {?} */ attrs = {};
        el.attrs.forEach(function (attr) {
            // Do not visit the attributes, translatable ones are top-level ASTs
            attrs[attr.name] = attr.value;
        });
        var /** @type {?} */ isVoid = getHtmlTagDefinition(el.name).isVoid;
        var /** @type {?} */ startPhName = this._placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);
        this._placeholderToContent[startPhName] = el.sourceSpan.toString();
        var /** @type {?} */ closePhName = '';
        if (!isVoid) {
            closePhName = this._placeholderRegistry.getCloseTagPlaceholderName(el.name);
            this._placeholderToContent[closePhName] = "</" + el.name + ">";
        }
        return new i18n.TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, el.sourceSpan);
    };
    /**
     * @param {?} attribute
     * @param {?} context
     * @return {?}
     */
    _I18nVisitor.prototype.visitAttribute = function (attribute, context) {
        return this._visitTextWithInterpolation(attribute.value, attribute.sourceSpan);
    };
    /**
     * @param {?} text
     * @param {?} context
     * @return {?}
     */
    _I18nVisitor.prototype.visitText = function (text, context) {
        return this._visitTextWithInterpolation(text.value, text.sourceSpan);
    };
    /**
     * @param {?} comment
     * @param {?} context
     * @return {?}
     */
    _I18nVisitor.prototype.visitComment = function (comment, context) { return null; };
    /**
     * @param {?} icu
     * @param {?} context
     * @return {?}
     */
    _I18nVisitor.prototype.visitExpansion = function (icu, context) {
        var _this = this;
        this._icuDepth++;
        var /** @type {?} */ i18nIcuCases = {};
        var /** @type {?} */ i18nIcu = new i18n.Icu(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);
        icu.cases.forEach(function (caze) {
            i18nIcuCases[caze.value] = new i18n.Container(caze.expression.map(function (node) { return node.visit(_this, {}); }), caze.expSourceSpan);
        });
        this._icuDepth--;
        if (this._isIcu || this._icuDepth > 0) {
            // Returns an ICU node when:
            // - the message (vs a part of the message) is an ICU message, or
            // - the ICU message is nested.
            var /** @type {?} */ expPh = this._placeholderRegistry.getUniquePlaceholder("VAR_" + icu.type);
            i18nIcu.expressionPlaceholder = expPh;
            this._placeholderToContent[expPh] = icu.switchValue;
            return i18nIcu;
        }
        // Else returns a placeholder
        // ICU placeholders should not be replaced with their original content but with the their
        // translations. We need to create a new visitor (they are not re-entrant) to compute the
        // message id.
        // TODO(vicb): add a html.Node -> i18n.Message cache to avoid having to re-create the msg
        var /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString());
        var /** @type {?} */ visitor = new _I18nVisitor(this._expressionParser, this._interpolationConfig);
        this._placeholderToMessage[phName] = visitor.toI18nMessage([icu], '', '');
        return new i18n.IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);
    };
    /**
     * @param {?} icuCase
     * @param {?} context
     * @return {?}
     */
    _I18nVisitor.prototype.visitExpansionCase = function (icuCase, context) {
        throw new Error('Unreachable code');
    };
    /**
     * @param {?} text
     * @param {?} sourceSpan
     * @return {?}
     */
    _I18nVisitor.prototype._visitTextWithInterpolation = function (text, sourceSpan) {
        var /** @type {?} */ splitInterpolation = this._expressionParser.splitInterpolation(text, sourceSpan.start.toString(), this._interpolationConfig);
        if (!splitInterpolation) {
            // No expression, return a single text
            return new i18n.Text(text, sourceSpan);
        }
        // Return a group of text + expressions
        var /** @type {?} */ nodes = [];
        var /** @type {?} */ container = new i18n.Container(nodes, sourceSpan);
        var _a = this._interpolationConfig, sDelimiter = _a.start, eDelimiter = _a.end;
        for (var /** @type {?} */ i = 0; i < splitInterpolation.strings.length - 1; i++) {
            var /** @type {?} */ expression = splitInterpolation.expressions[i];
            var /** @type {?} */ baseName = _extractPlaceholderName(expression) || 'INTERPOLATION';
            var /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName(baseName, expression);
            if (splitInterpolation.strings[i].length) {
                // No need to add empty strings
                nodes.push(new i18n.Text(splitInterpolation.strings[i], sourceSpan));
            }
            nodes.push(new i18n.Placeholder(expression, phName, sourceSpan));
            this._placeholderToContent[phName] = sDelimiter + expression + eDelimiter;
        }
        // The last index contains no expression
        var /** @type {?} */ lastStringIdx = splitInterpolation.strings.length - 1;
        if (splitInterpolation.strings[lastStringIdx].length) {
            nodes.push(new i18n.Text(splitInterpolation.strings[lastStringIdx], sourceSpan));
        }
        return container;
    };
    return _I18nVisitor;
}());
function _I18nVisitor_tsickle_Closure_declarations() {
    /** @type {?} */
    _I18nVisitor.prototype._isIcu;
    /** @type {?} */
    _I18nVisitor.prototype._icuDepth;
    /** @type {?} */
    _I18nVisitor.prototype._placeholderRegistry;
    /** @type {?} */
    _I18nVisitor.prototype._placeholderToContent;
    /** @type {?} */
    _I18nVisitor.prototype._placeholderToMessage;
    /** @type {?} */
    _I18nVisitor.prototype._expressionParser;
    /** @type {?} */
    _I18nVisitor.prototype._interpolationConfig;
}
var /** @type {?} */ _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*"([\s\S]*?)"[\s\S]*\)/g;
/**
 * @param {?} input
 * @return {?}
 */
function _extractPlaceholderName(input) {
    return input.split(_CUSTOM_PH_EXP)[1];
}
//# sourceMappingURL=i18n_parser.js.map


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using GlyssenCharacters;
using GlyssenEngine.Casting;
using GlyssenEngine.Character;
using GlyssenEngine.Rules;
using GlyssenEngine.UndoActions;
using SIL;
using SIL.Extensions;
using SIL.Reporting;
using CharacterGroup = GlyssenEngine.Character.CharacterGroup;

namespace GlyssenEngine.ViewModels
{
	#region SortBy enumeration
	public enum SortedBy
	{
		Name,
		Attributes,
		EstimatedTime,
		Actor,
	}
	#endregion

	public class VoiceActorAssignmentViewModel
	{
		private const int kAscending = 1;
		private const int kDescending = -1;

		private readonly Project m_project;

		public delegate void SavedEventHandler(VoiceActorAssignmentViewModel sender, IEnumerable<CharacterGroup> groupsAffected, bool requiresActorListRefresh);
		public event SavedEventHandler Saved;
		private readonly UndoStack<ICharacterGroupsUndoAction> m_undoStack = new UndoStack<ICharacterGroupsUndoAction>();
		private readonly Dictionary<string, HashSet<string>> m_findTextToMatchingCharacterIds = new Dictionary<string, HashSet<string>>();

		private Proximity ProjectProximity { get; }

		public VoiceActorAssignmentViewModel(Project project)
		{
			m_project = project;
			ProjectProximity = new Proximity(m_project, false);

			CharacterGroupAttribute<CharacterGender>.GetUiStringForValue = GetUiStringForCharacterGender;
			CharacterGroupAttribute<CharacterAge>.GetUiStringForValue = GetUiStringForCharacterAge;

			LogAndOutputToDebugConsole("Group".PadRight(7) + ": " + MinimumProximity.ReportHeader + Environment.NewLine +
				"-".PadRight(100, '-'));
			foreach (var group in CharacterGroups.OrderBy(g => g.GroupIdForUiDisplay))
				LogAndOutputToDebugConsole(group.GroupIdForUiDisplay.PadRight(7) + ": " + ProjectProximity.CalculateMinimumProximity(group.CharacterIds));
		}

		private static void LogAndOutputToDebugConsole(string message)
		{
			Debug.WriteLine(message);
			Logger.WriteEvent(message);
		}

		private static string GetUiStringForCharacterGender(CharacterGender characterGender)
		{
			switch (characterGender)
			{
				case CharacterGender.Male: return Localizer.GetString("DialogBoxes.VoiceActorAssignmentDlg.CharacterGender.Male", "Male");
				case CharacterGender.Female: return Localizer.GetString("DialogBoxes.VoiceActorAssignmentDlg.CharacterGender.Female", "Female");
				case CharacterGender.PreferMale: return Localizer.GetString("DialogBoxes.VoiceActorAssignmentDlg.CharacterGender.PreferMale", "Pref: Male");
				case CharacterGender.PreferFemale: return Localizer.GetString("DialogBoxes.VoiceActorAssignmentDlg.CharacterGender.PreferFemale", "Pref: Female");
// Probably don't want to show this anyway, and definitely not for narrators				case CharacterGender.Neuter: return Localizer.GetString("DialogBoxes.VoiceActorAssignmentDlg.CharacterGender.Neuter", "Neuter");
				default: return string.Empty;
			}
		}

		private static string GetUiStringForCharacterAge(CharacterAge characterAge)
		{
			switch (characterAge)
			{
				case CharacterAge.Child: return Localizer.GetString("DialogBoxes.VoiceActorAssignmentDlg.CharacterAge.Child", "Child");
				case CharacterAge.Elder: return Localizer.GetString("DialogBoxes.VoiceActorAssignmentDlg.CharacterAge.Elder", "Elder");
				case CharacterAge.YoungAdult: return Localizer.GetString("DialogBoxes.VoiceActorAssignmentDlg.CharacterAge.YoungAdult", "Young Adult");
				default: return string.Empty;
			}
		}

		public string GetUiStringForCharacterGender(string localizedCharacterId)
		{
			CharacterDetail detail;
			var characterId = CharacterVerseData.SingletonLocalizedCharacterIdToCharacterIdDictionary[localizedCharacterId];

			return m_project.AllCharacterDetailDictionary.TryGetValue(characterId, out detail) ?
				GetUiStringForCharacterGender(detail.Gender) : string.Empty;
		}

		public string GetUiStringForCharacterAge(string localizedCharacterId)
		{
			CharacterDetail detail;
			var characterId = CharacterVerseData.SingletonLocalizedCharacterIdToCharacterIdDictionary[localizedCharacterId];

			return m_project.AllCharacterDetailDictionary.TryGetValue(characterId, out detail) ?
				GetUiStringForCharacterAge(detail.Age) : string.Empty;
		}

		public double GetEstimatedHoursForCharacter(string localizedCharacterId)
		{
			var characterId = CharacterVerseData.SingletonLocalizedCharacterIdToCharacterIdDictionary[localizedCharacterId];
			return m_project.KeyStrokesByCharacterId[characterId] / Project.kKeyStrokesPerHour;
		}

		public IList<CharacterGroup> CharacterGroups { get { return m_project.CharacterGroupList.CharacterGroups; } }

		public List<String> UndoActions { get { return m_undoStack.UndoDescriptions; } }
		public List<String> RedoActions { get { return m_undoStack.RedoDescriptions; } }

		public Project Project
		{
			get { return m_project; }
		}

		public void RegenerateGroups(Action generate)
		{
			// TODO (PG-437): Create Undo action to store state before calling generate.
			generate();

			Save();
		}

		private void Save(ICharacterGroupsUndoAction actionToSave = null)
		{
			m_project.SaveCharacterGroupData();

			if (Saved != null)
			{
				if (actionToSave == null)
					actionToSave = m_undoStack.Peek();
				Saved(this, actionToSave == null ? null : actionToSave.GroupsAffectedByLastOperation, actionToSave is VoiceActorEditingUndoAction);
			}
		}

		public void AssignActorToGroup(int actorId, CharacterGroup group)
		{
			if (group.VoiceActorId != actorId)
			{
				RemoveVoiceActorAssignmentsUndoAction undoActionForRemovingPreviousAssignments = null;
				if (actorId == CharacterGroup.kNoActorAssigned)
				{
					m_undoStack.Push(new RemoveVoiceActorAssignmentsUndoAction(m_project, group));
				}
				else
				{
					var groups = m_project.CharacterGroupList.GetGroupsAssignedToActor(actorId).ToList();
					if (groups.Any())
					{
						undoActionForRemovingPreviousAssignments = new RemoveVoiceActorAssignmentsUndoAction(m_project, groups);
					}

					// Note: Creating the undo action actually does the assignment.
					var undoActionForNewAssignment = new VoiceActorAssignmentUndoAction(m_project, group, actorId);
					if (undoActionForRemovingPreviousAssignments == null)
						m_undoStack.Push(undoActionForNewAssignment);
					else
					{
						m_undoStack.Push(new CharacterGroupUndoActionSequence(undoActionForRemovingPreviousAssignments, undoActionForNewAssignment));
					}
				}
				Save();
			}
		}

		public bool CanRemoveAssignment(CharacterGroup group)
		{
			return (group.IsVoiceActorAssigned && !group.AssignedToCameoActor);
		}

		public void UnAssignActorFromGroups(IEnumerable<CharacterGroup> groups)
		{
			m_undoStack.Push(new RemoveVoiceActorAssignmentsUndoAction(m_project, groups));
			Save();
		}

		private CharacterGroup GetSourceGroupForMove(IReadOnlyList<string> characterIds, CharacterGroup destGroup)
		{
			if (characterIds.Count == 0)
				throw new ArgumentException(@"At least one characterId must be provided", "characterIds");

			// Currently, we assume all characterIds are coming from the same source group
			CharacterGroup sourceGroup = CharacterGroups.FirstOrDefault(t => t.CharacterIds.Contains(characterIds[0]));

			// REVIEW: The second part of this condition used to be done in the following "if" statement, but I can't
			// think of any reason why moving a character to the group it's already in should result in any unused groups.
			if (sourceGroup == null || sourceGroup == destGroup)
				return null;

			if (destGroup == null && !sourceGroup.IsVoiceActorAssigned && sourceGroup.CharacterIds.SetEquals(characterIds))
			{
				return null; // Moving all characters from an unassigned group to a new group would accomplish nothing.
			}
			return sourceGroup;
		}

		public bool CanMoveCharactersToGroup(IReadOnlyList<string> characterIds, CharacterGroup destGroup)
		{
			return GetSourceGroupForMove(characterIds, destGroup) != null;
		}

		public bool MoveCharactersToGroup(IReadOnlyList<string> characterIds, CharacterGroup destGroup,
			Func<int, string, string, string, string, string, IReadOnlyList<string>, bool> confirmCriticalProximityDegradation = null)
		{
			CharacterGroup sourceGroup = GetSourceGroupForMove(characterIds, destGroup);

			if (sourceGroup == null)
				return false;

			if (destGroup != null && confirmCriticalProximityDegradation != null && destGroup.CharacterIds.Count > 0)
			{
				var testGroup = new CharacterIdHashSet(destGroup.CharacterIds);
				var resultsBefore = ProjectProximity.CalculateMinimumProximity(testGroup);

				testGroup.AddRange(characterIds);
				var resultsAfter = ProjectProximity.CalculateMinimumProximity(testGroup);

				if (resultsBefore.IsBetterThan(resultsAfter) && !resultsAfter.IsAcceptable())
				{
					if (!confirmCriticalProximityDegradation(resultsAfter.NumberOfBlocks,
						CharacterVerseData.GetCharacterNameForUi(resultsAfter.FirstCharacterId),
						CharacterVerseData.GetCharacterNameForUi(resultsAfter.SecondCharacterId),
						resultsAfter.FirstReference, resultsAfter.SecondReference, destGroup.GroupId, characterIds))
					{
						return false;
					}
				}
				else
				{
					LogAndOutputToDebugConsole($"Moving {characterIds.Count} character(s) to group {destGroup.GroupId} changed the " +
						$"proximity from {resultsBefore.NumberOfBlocks} to {resultsAfter.NumberOfBlocks}.");
				}
			}

			m_undoStack.Push(new MoveCharactersToGroupUndoAction(m_project, sourceGroup, destGroup, characterIds));

			Save();

			return true;
		}

		public CharacterGroup SplitGroup(List<string> charactersToMove)
		{
			var returnValue = MoveCharactersToGroup(charactersToMove, null);
			if (returnValue)
			{
				((MoveCharactersToGroupUndoAction) m_undoStack.Peek()).IsSplit = true;
				return m_project.CharacterGroupList.CharacterGroups.Single(g => g.CharacterIds.Contains(charactersToMove[0]));
			}
			return null;
		}

		public IEnumerable<Tuple<VoiceActor, bool>> GetActorsSortedByAvailabilityAndName(CharacterGroup group)
		{
			bool includeCameos = !(group != null && !group.AssignedToCameoActor);

			//TODO put the best matches first
			foreach (var actor in m_project.VoiceActorList.ActiveActors.Where(a => (!m_project.CharacterGroupList.HasVoiceActorAssigned(a.Id) && (includeCameos || !a.IsCameo))).OrderBy(a => a.Name))
			{
				yield return new Tuple<VoiceActor, bool>(actor, true);
			}

			foreach (var actor in m_project.VoiceActorList.ActiveActors.Where(a => (m_project.CharacterGroupList.HasVoiceActorAssigned(a.Id) && (includeCameos || !a.IsCameo))).OrderBy(a => a.Name))
			{
				yield return new Tuple<VoiceActor, bool>(actor, false);
			}
		}

		public void Sort(SortedBy by, bool sortAscending)
		{
			Comparison<CharacterGroup> how;
			int direction = sortAscending ? kAscending : kDescending;
			switch (by)
			{
				case SortedBy.Name:
					how = (a, b) => CompareGroupNames(a, b) * direction;
					break;
				case SortedBy.Attributes:
					how = (a, b) => String.Compare(a.AttributesDisplay, b.AttributesDisplay, StringComparison.CurrentCulture) * direction;
					break;
				case SortedBy.Actor:
					how = (a, b) =>
					{
						var actorA = m_project.VoiceActorList.GetVoiceActorById(a.VoiceActorId);
						var nameA = actorA == null ? String.Empty : actorA.Name;
						var actorB = m_project.VoiceActorList.GetVoiceActorById(b.VoiceActorId);
						var nameB = actorB == null ? String.Empty : actorB.Name;
						return String.Compare(nameA, nameB, StringComparison.CurrentCulture) * direction;
					};
					break;
				case SortedBy.EstimatedTime:
					how = (a, b) => a.EstimatedHours.CompareTo(b.EstimatedHours) * direction;
					break;
				default:
					throw new ArgumentException(@"Unexpected sorting method", "by");
			}
			CharacterGroups.Sort(how);
		}

		public bool Undo()
		{
			var action = m_undoStack.Peek();
			if (action != null && m_undoStack.Undo())
			{
				Save(action);
				return true;
			}
			return false;
		}

		public bool Redo()
		{
			if (m_undoStack.CanRedo && m_undoStack.Redo())
			{
				Save();
				return true;
			}
			return false;
		}

		public void NoteActorChanges(IEnumerable<IVoiceActorUndoAction> changes)
		{
			if (changes.Any())
			{
				m_undoStack.Push(new VoiceActorEditingUndoAction(m_project, changes));
				Save();
			}
		}

		public Tuple<int, int> FindNextMatchingCharacter(string textToFind, int startingGroupIndex, int startingCharacterIndex)
		{
			if (textToFind == null)
				throw new ArgumentNullException("textToFind");
			textToFind = textToFind.Trim();
			if (textToFind.Length < 2)
				throw new ArgumentException(@"Value must contain at least two non-whitespace characters.", "textToFind");
			if (startingGroupIndex < 0 || startingGroupIndex >= CharacterGroups.Count)
				startingGroupIndex = 0;
			if (startingCharacterIndex < 0 || startingCharacterIndex >= CharacterGroups[startingGroupIndex].CharacterIds.Count)
				startingCharacterIndex = 0;

			var matchingCharacterIds = GetMatchingCharacterIds(textToFind);

			bool wrapped = false;
			for (int iGroup = startingGroupIndex; iGroup <= (wrapped ? startingGroupIndex : CharacterGroups.Count - 1); iGroup++)
			{
				// TODO: Instead of alphabetical list, we need the list as currently sorted in UI.
				var characterIdsInGroup = CharacterGroups[iGroup].CharacterIds.ToList();

				for (int iCharacter = (wrapped || iGroup > startingGroupIndex ? 0 : startingCharacterIndex + 1);
					iCharacter <= (wrapped && iGroup ==startingGroupIndex ? startingCharacterIndex : CharacterGroups[iGroup].CharacterIds.Count - 1);
					iCharacter++)
				{
					if (matchingCharacterIds.Contains(characterIdsInGroup[iCharacter], StringComparison.Ordinal))
						return new Tuple<int, int>(iGroup, iCharacter);
				}

				if (!wrapped && iGroup == CharacterGroups.Count - 1)
				{
					wrapped = true;
					iGroup = -1;
				}
			}
			return new Tuple<int, int>(-1, -1);
		}

		private HashSet<string> GetMatchingCharacterIds(string textToFind)
		{
			HashSet<string> matchingCharacterIds;
			if (!m_findTextToMatchingCharacterIds.TryGetValue(textToFind, out matchingCharacterIds))
			{
				if (CharacterDetailData.Singleton.GetAll().Count() !=
					CharacterVerseData.SingletonLocalizedCharacterIdToCharacterIdDictionary.Count)
				{
					// First time getting UI versions of character IDs (typically when running tests), so we need to force
					// population of CharacterVerseData.SingletonLocalizedCharacterIdToCharacterIdDictionary.
					foreach (var characterId in CharacterGroups.SelectMany(characterGroup => characterGroup.CharacterIds))
						CharacterVerseData.GetCharacterNameForUi(characterId);
				}
				matchingCharacterIds = new HashSet<string>();
				m_findTextToMatchingCharacterIds.Add(textToFind, matchingCharacterIds);
				foreach (var kvp in CharacterVerseData.SingletonLocalizedCharacterIdToCharacterIdDictionary)
				{
					if (kvp.Value.IndexOf(textToFind, StringComparison.OrdinalIgnoreCase) >= 0)
						matchingCharacterIds.Add(kvp.Key);
				}
			}
			return matchingCharacterIds;
		}

		public void CreateNewActorAndAssignToGroup(string voiceActorName, CharacterGroup group)
		{
			var actor = new VoiceActor { Id = 99, Name = voiceActorName };
			m_project.VoiceActorList.AllActors.Add(actor);
			AssignActorToGroup(actor.Id, group);
		}

		public VoiceActor AddNewActorToGroup(string actorName, CharacterGroup group)
		{
			Debug.Assert(!group.AssignedToCameoActor);

			var actorViewModel = new VoiceActorInformationViewModel(m_project);

			if (actorViewModel.IsDuplicateActorName(null, actorName) || actorName == "Remove Voice Actor Assignment")
				throw new InvalidOperationException("Attempting to add existing actor!");

			var newActor = actorViewModel.AddNewActor();
			newActor.Name = actorName;
			switch (group.GroupIdLabel)
			{
				case CharacterGroup.Label.Female:
					newActor.Gender = ActorGender.Female;
					break;
				case CharacterGroup.Label.Child:
					newActor.Age = ActorAge.Child;
					break;
			}
			AssignActorToGroup(newActor.Id, group);
			actorViewModel.SaveVoiceActorInformation();
			return newActor;
		}

		private static int CompareGroupNames(CharacterGroup x, CharacterGroup y)
		{
			var s1 = x.GroupIdForUiDisplay ?? string.Empty;
			var s2 = y.GroupIdForUiDisplay ?? string.Empty;

			// check for identical strings
			if (s1 == s2)
				return 0;

			// check for an empty string
			if (string.IsNullOrEmpty(s1))
				return -1;

			if (string.IsNullOrEmpty(s2))
				return 1;

			var len1 = s1.Length;
			var len2 = s2.Length;
			var currentIdx = 0;
			var d1 = '.';
			var d2 = '.';

			while ((currentIdx < len1) && (currentIdx < len2))
			{
				// compare once character from each string
				var result = string.Compare(s1, currentIdx, s2, currentIdx, 1);

				// if both characters are not the same, check for digits
				if (result != 0)
				{
					d1 = s1[currentIdx];
					d2 = s2[currentIdx];
					if (!char.IsDigit(d1) || !char.IsDigit(d2)) return result;

					// both characters are digits, compare the full numbers
					var val1 = int.Parse(Regex.Match(s1, @"\d+").Value);
					var val2 = int.Parse(Regex.Match(s2, @"\d+").Value);
					return (val1 < val2) ? -1 : 1;
				}

				currentIdx++;
			}

			// if you are here, one string starts with the other
			// the shorter string comes before the longer one
			if (!char.IsDigit(d1) || !char.IsDigit(d2)) return (len1 < len2) ? -1 : 1;

			// both ended with digits, so compare the full numbers
			var num1 = int.Parse(Regex.Match(s1, @"\d+").Value);
			var num2 = int.Parse(Regex.Match(s2, @"\d+").Value);
			return (num1 < num2) ? -1 : 1;
		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<CodeSystem xmlns="http://hl7.org/fhir">
	<id value="CareConnect-EthnicCategory-1"/>
	<extension url="http://hl7.org/fhir/StructureDefinition/codesystem-sourceReference">
		<valueUri value="http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pds/pds_ethnic_category_code_de.asp?shownav=0"/>
	</extension>
	<url value="https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-EthnicCategory-1"/>
	<version value="1.0.0"/>
	<name value="Care Connect Ethnic Category"/>
	<status value="draft"/>
	<date value="2017-08-01T00:00:00+00:00"/>
	<publisher value="HL7 UK"/>
	<description value="A CodeSystem to identify the ethnicity of a Person, as specified by the Person. This vocabulary describes a persons ethnic category, it is an extension of the Ethnic Category Code described in the NHS Data Model and Dictionary."/>
	<caseSensitive value="true"/>
	<content value="complete"/>
	<concept>

		<display value="British, Mixed British"/>
	</concept>
	<concept>

		<display value="Irish"/>
	</concept>
	<concept>

		<display value="Any other White background"/>
	</concept>
	<concept>

		<display value="Northern Irish"/>
	</concept>
	<concept>

		<display value="Other white, white unspecified"/>
	</concept>
	<concept>

		<display value="English"/>
	</concept>
	<concept>

		<display value="Scottish"/>
	</concept>
	<concept>

		<display value="Welsh"/>
	</concept>
	<concept>

		<display value="Cornish"/>
	</concept>
	<concept>

		<display value="Cypriot (part not stated)"/>
	</concept>
	<concept>

		<display value="Greek"/>
	</concept>
	<concept>

		<display value="Greek Cypriot"/>
	</concept>
	<concept>

		<display value="Turkish"/>
	</concept>
	<concept>

		<display value="Turkish Cypriot"/>
	</concept>
	<concept>

		<display value="Italian"/>
	</concept>
	<concept>

		<display value="Irish Traveller"/>
	</concept>
	<concept>

		<display value="Traveller"/>
	</concept>
	<concept>

		<display value="Gypsy/Romany"/>
	</concept>
	<concept>

		<display value="Polish"/>
	</concept>
	<concept>

		<display value="All republics which made up the former USSR"/>
	</concept>
	<concept>

		<display value="Kosovan"/>
	</concept>
	<concept>

		<display value="Albanian"/>
	</concept>
	<concept>

		<display value="Bosnian"/>
	</concept>
	<concept>

		<display value="Croatian"/>
	</concept>
	<concept>

		<display value="Serbian"/>
	</concept>
	<concept>

		<display value="Other republics which made up the former Yugoslavia"/>
	</concept>
	<concept>

		<display value="Mixed white"/>
	</concept>
	<concept>

		<display value="Other white European, European unspecified, European mixed"/>
	</concept>
	<concept>

		<display value="White and Black Caribbean"/>
	</concept>
	<concept>

		<display value="White and Black African"/>
	</concept>
	<concept>

		<display value="White and Asian"/>
	</concept>
	<concept>

		<display value="Any other mixed background"/>
	</concept>
	<concept>

		<display value="Black and Asian"/>
	</concept>
	<concept>

		<display value="Black and Chinese"/>
	</concept>
	<concept>

		<display value="Black and White"/>
	</concept>
	<concept>

		<display value="Chinese and White"/>
	</concept>
	<concept>

		<display value="Asian and Chinese"/>
	</concept>
	<concept>

		<display value="Other Mixed, Mixed Unspecified"/>
	</concept>
	<concept>

		<display value="Indian or British Indian"/>
	</concept>
	<concept>

		<display value="Pakistani or British Pakistani"/>
	</concept>
	<concept>

		<display value="Bangladeshi or British Bangladeshi"/>
	</concept>
	<concept>

		<display value="Any other Asian background"/>
	</concept>
	<concept>

		<display value="Mixed Asian"/>
	</concept>
	<concept>

		<display value="Punjabi"/>
	</concept>
	<concept>

		<display value="Kashmiri"/>
	</concept>
	<concept>

		<display value="East African Asian"/>
	</concept>
	<concept>

		<display value="Sri Lanka"/>
	</concept>
	<concept>

		<display value="Tamil"/>
	</concept>
	<concept>

		<display value="Sinhalese"/>
	</concept>
	<concept>

		<display value="British Asian"/>
	</concept>
	<concept>

		<display value="Caribbean Asian"/>
	</concept>
	<concept>

		<display value="Other Asian, Asian unspecified"/>
	</concept>
	<concept>

		<display value="Caribbean"/>
	</concept>
	<concept>

		<display value="African"/>
	</concept>
	<concept>

		<display value="Any other Black background"/>
	</concept>
	<concept>

		<display value="Somali"/>
	</concept>
	<concept>

		<display value="Mixed Black"/>
	</concept>
	<concept>

		<display value="Nigerian"/>
	</concept>
	<concept>

		<display value="Black British"/>
	</concept>
	<concept>

		<display value="Other Black, Black unspecified"/>
	</concept>
	<concept>

		<display value="Chinese"/>
	</concept>
	<concept>

		<display value="Any other ethnic group"/>
	</concept>
	<concept>

		<display value="Vietnamese"/>
	</concept>
	<concept>

		<display value="Japanese"/>
	</concept>
	<concept>

		<display value="Filipino"/>
	</concept>
	<concept>

		<display value="Malaysian"/>
	</concept>
	<concept>

		<display value="Any Other Group"/>
	</concept>
	<concept>

		<display value="Not stated"/>
	</concept>
</CodeSystem>


text:
"use strict";

var Victor = require('victor');

module.exports = {
    x: 0,
    y: 0,
    speed: 250,
    initialize: function (element) {
        if (!element.direction) {
            element.direction = new Victor(0, 0);
        }

        if (!element.directionIntent) {
            element.directionIntent = new Victor(0, 0);
        }
    },
    update: function (element, dt) {
        var multiplier = 1000 / element.speed;

        element.x += element.directionIntent.x * dt / multiplier;
        element.y += element.directionIntent.y * dt / multiplier;
    }
};