text:
package org.jabref.gui.openoffice;

class BibEntryNotFoundException extends Exception {

    private final String bibtexKey;

    public BibEntryNotFoundException(String bibtexKey, String message) {
        super(message);

        this.bibtexKey = bibtexKey;
    }

    public String getBibtexKey() {
        return bibtexKey;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * Subclass for representing a row from the 'option_value' table.
 *
 *
 *
 * @package plugins.sfsProductPlugin.lib.model
 */
class OptionValue extends BaseOptionValue
{
    public function __toString()
    {
        return $this->getTitle();
    }
}


text:
package com.snobot2016.autonomous;

import com.snobot2016.drivetrain.IDriveTrain;
import com.snobot2016.positioner.IPositioner;

import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.CommandGroup;

/**
 * Directs the robot towards the given X/Y-coordinate.
 *
 * @author Alec/Andrew
 *
 */
public class GoToXY extends Command
{
    private IDriveTrain mDriveTrain;
    private IPositioner mPositioner;
    private double mFinalXCoor;
    private double mFinalYCoor;
    private double mCurrentX;
    private double mCurrentY;
    private double mTurnDegrees;
    private double mDriveDistance;
    private double mSpeed;
    private Command mTurnWithDegrees;
    private Command mDriveStraightADistance;
    private CommandGroup mCommandGroup;

    /**
     * Creates a GoToXY Command.
     *
     * @param aDriveTrain
     *            The robot's DriveTrain.
     * @param aPositioner
     *            The robot's Positioner.
     * @param aXCoor
     *            The desired final X-coordinate.
     * @param aYCoor
     *            The desired final Y-coordinate.
     * @param aSpeed
     *            The desired speed (-1 - 1).
     */
    public GoToXY(IDriveTrain aDriveTrain, IPositioner aPositioner, double aXCoor, double aYCoor, double aSpeed)
    {
        mDriveTrain = aDriveTrain;
        mPositioner = aPositioner;
        mFinalXCoor = aXCoor;
        mFinalYCoor = aYCoor;
        mSpeed = aSpeed;

    }

    /**
     * Calculates distance to travel and proper orientation then creates
     * DriveStraightADistance and TurnWithDegrees Commands, adds them to a
     * CommandGroup, then starts the CommandGroup.
     */
    @Override
    protected void initialize()
    {

        mCommandGroup = new CommandGroup();
        mCurrentX = mPositioner.getXPosition();
        mCurrentY = mPositioner.getYPosition();
        mDriveDistance = Math.sqrt((Math.pow((mFinalXCoor - mCurrentX), 2)) + (Math.pow((mFinalYCoor - mCurrentY), 2)));
        mTurnDegrees = Math.toDegrees(Math.atan2((mFinalXCoor - mCurrentX), (mFinalYCoor - mCurrentY)));
        mTurnWithDegrees = new TurnWithDegrees(mDriveTrain, mPositioner, mTurnDegrees, mSpeed);
        System.out.println(mTurnDegrees);
        mDriveStraightADistance = new DriveStraightADistance(mDriveTrain, mPositioner, mDriveDistance, mSpeed);
        mCommandGroup.addSequential(mTurnWithDegrees);
        mCommandGroup.addSequential(mDriveStraightADistance);
        mCommandGroup.start();

    }

    @Override
    protected void execute()
    {

    }

    /**
     * Checks if the CommandGroup is finished running.
     */
    @Override
    protected boolean isFinished()
    {
        if (!mCommandGroup.isRunning())
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    /**
     * Stops the CommandGroup and the robot.
     */
    @Override
    protected void end()
    {
        mCommandGroup.cancel();
        mDriveTrain.setLeftRightSpeed(0, 0);
    }

    @Override
    protected void interrupted()
    {

    }

}


text:
<?php

error_reporting(E_STRICT | E_ALL);

// You can set the include path to src directory or reference
// DfpUser.php directly via require_once.
// $path = '/path/to/dfp_api_php_lib/src';
$path = dirname(__FILE__) . '/../../../../src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

require_once 'Google/Api/Ads/Dfp/Lib/DfpUser.php';
require_once 'Google/Api/Ads/Dfp/Util/v201702/StatementBuilder.php';
require_once dirname(__FILE__) . '/../../../Common/ExampleUtils.php';

try {
  // Get DfpUser from credentials in "../auth.ini"
  // relative to the DfpUser.php file's directory.
  $user = new DfpUser();

  // Log SOAP XML request and response.
  $user->LogDefaults();

  // Get the ExchangeRateService.
  $exchangeRateService = $user->GetService('ExchangeRateService', 'v201702');

  // Create a statement to select all exchange rates.
  $statementBuilder = new StatementBuilder();
  $statementBuilder->OrderBy('id ASC')
      ->Limit(StatementBuilder::SUGGESTED_PAGE_LIMIT);

  // Default for total result set size.
  $totalResultSetSize = 0;

  do {
    // Get exchange rates by statement.
    $page = $exchangeRateService->getExchangeRatesByStatement(
        $statementBuilder->ToStatement());

    // Display results.
    if (isset($page->results)) {
      $totalResultSetSize = $page->totalResultSetSize;
      $i = $page->startIndex;
      foreach ($page->results as $exchangeRate) {
        printf("%d) Exchange rate with ID %d, currency code '%s', direction "
            . "'%s', and exchange rate %.2f was found.\n",
            $i++,
            $exchangeRate->id,
            $exchangeRate->currencyCode,
            $exchangeRate->direction,
            $exchangeRate->exchangeRate / 10000000000
        );
      }
    }

    $statementBuilder->IncreaseOffsetBy(StatementBuilder::SUGGESTED_PAGE_LIMIT);
  } while ($statementBuilder->GetOffset() < $totalResultSetSize);

  printf("Number of results found: %d\n", $totalResultSetSize);
} catch (OAuth2Exception $e) {
  ExampleUtils::CheckForOAuth2Errors($e);
} catch (ValidationException $e) {
  ExampleUtils::CheckForOAuth2Errors($e);
} catch (Exception $e) {
  printf("%s\n", $e->getMessage());
}


text:
import { Component } from '@angular/core';

import { HeroButtonComponent } from './heroes';

@Component({
  moduleId: module.id,
  selector: 'sg-app',
  templateUrl: 'app.component.html',
  directives: [HeroButtonComponent]
})
export class AppComponent { }


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>TheDisappointedProgrammer.com</groupId>
    <artifactId>NuteMcCanceParser</artifactId>
    <version>0.1.0</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.5.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jpa</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <version>7.1.4.jre11-preview</version>
            <!--<scope>test</scope>-->
        </dependency>
    </dependencies>

    <properties>
        <java.version>11</java.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>


text:
function bubbleSort(array) {
  let temp; // used to temporarily hold a variable's value
  let swap; // variable(boolean) used to keep track if we have made a swap this iteration
  const sortArray = array.slice();

  do {
    swap = false; // each iteration we set swap to false

    // while continue to make swaps, we iterate through array and see if any values are out of order
    for (let i = 0; i < sortArray.length; i++) {
      // if 2 numbers are out of order, we swap those values,
      // and set swap to true
      if (sortArray[i] > sortArray[i + 1]) {
        temp = sortArray[i];
        sortArray[i] = sortArray[i + 1];
        sortArray[i + 1] = temp;
        swap = true;
      }
    }
  } while (swap === true);
  return sortArray; // return the sorted array
}

bubbleSort([3, 1, 9, 5, 7, 2, 4, 8, 6]);


text:
@interface UserReceivedEventRepoModel : NSObject
@property(nonatomic,strong)NSString *name;
@property(nonatomic,strong)NSString *userReceivedEventRepoID;
@property(nonatomic,strong)NSString *url;
+ (UserReceivedEventRepoModel *)modelWithDict:(NSDictionary *)dict;
@end


text:
// [START earthengine__apidocs__ee_geometry_polygon_area]
// Define a Polygon object.
var polygon = ee.Geometry.Polygon(
    [[[-122.092, 37.424],
      [-122.086, 37.418],
      [-122.079, 37.425],
      [-122.085, 37.423]]]);

// Apply the area method to the Polygon object.
var polygonArea = polygon.area({'maxError': 1});

// Print the result to the console.
print('polygon.area(...) =', polygonArea);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(polygon,
             {'color': 'black'},
             'Geometry [black]: polygon');
// [END earthengine__apidocs__ee_geometry_polygon_area]


text:
Bootstrap starter template

Use this document as a way to quickly start any new project.
 All you get is this text and a
        mostly barebones HTML document.

Welcome to <?php echo CHtml::encode(Yii::app()->name); ?>

You may change the content of this page by modifying the following two files:

Views file: <?php echo __FILE__; ?>

Layout file: <?php echo $this->getLayoutFile('starter'); ?>

For more details on how to further develop this application, please read
        the documentation.
        Feel free to ask in the forum


text:
package com.android.settings;

import android.content.Context;
import android.preference.PreferenceCategory;
import android.util.AttributeSet;

public abstract class ProgressCategoryBase extends PreferenceCategory {
    public ProgressCategoryBase(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    /**
     * Turn on/off the progress indicator and text on the right.
     * @param progressOn whether or not the progress should be displayed
     */
    public abstract void setProgress(boolean progressOn);
}


text:
<?php

declare(strict_types=1);

namespace WoohooLabs\Yin\Tests\JsonApi\Exception;

use PHPUnit\Framework\TestCase;
use WoohooLabs\Yin\JsonApi\Exception\ResourceIdentifierIdMissing;

class ResourceIdentifierIdMissingTest extends TestCase
{
    /**
     * @test
     */
    public function getErrors(): void
    {
        $exception = $this->createException();

        $errors = $exception->getErrorDocument()->getErrors();

        $this->assertCount(1, $errors);
        $this->assertEquals("400", $errors[0]->getStatus());
    }

    /**
     * @test
     */
    public function getResourceIdentifier(): void
    {
        $exception = $this->createException(["type" => "abc"]);

        $resourceIdentifier = $exception->getResourceIdentifier();

        $this->assertEquals(["type" => "abc"], $resourceIdentifier);
    }

    private function createException(array $resourceIdentifier = []): ResourceIdentifierIdMissing
    {
        return new ResourceIdentifierIdMissing($resourceIdentifier);
    }
}


text:
import fhir.client.primitive
import fhir.client.complex

class Contact:
    """
    All kinds of technology-mediated contact details for a person or organization, including telephone, email, etc.
    """

    def __init__(self):

        # Telecommunications form for contact - what communications system is required to make use of the contact.
        self.__system = fhir.client.primitive.Code('home')

        # The actual contact details, in a form that is meaningful to the designated communication
        # system (i.e. phone number or email address).
        self.value = ' '

        # Identifies the purpose for the address.
        self.__use = fhir.client.primitive.Code('home')

        # Time period when the contact was/is in use.
        self.__period = fhir.client.complex.Period('', '')

    @property
    def system(self):
        return self.__system

    @system.setter
    def system(self, system):
        if not isinstance(system, fhir.client.primitive.Code) and not isinstance(system, str):
            raise TypeError('A code value must be of type Code or str.')
        string_use = system
        if isinstance(system, fhir.client.primitive.Code):
            string_use = system.__str__()
        if string_use != 'phone' and string_use != 'fax' and string_use != 'email' \
                and string_use != 'url':
            raise ValueError('A Code value must be phone, fax, email, or url.')
        self.__use = fhir.client.primitive.Code(string_use)

    @property
    def value(self):
        return self.value

    @value.setter
    def value(self, value):
        if not isinstance(value, str):
            raise TypeError('A value value must be of type str.')
        self.value = value

    @property
    def use(self):
        return self.__use

    @use.setter
    def use(self, use):
        if not isinstance(use, fhir.client.primitive.Code) and not isinstance(use, str):
            raise TypeError('A code value must be of type Code or str.')
        string_use = use
        if isinstance(use, fhir.client.primitive.Code):
            string_use = use.__str__()
        if string_use != 'home' and string_use != 'work' and string_use != 'temp' \
                and string_use != 'old' and string_use != 'mobile':
            raise ValueError('A Code value must be home, work, temp, old or mobile.')
        self.__use = fhir.client.primitive.Code(string_use)

    @property
    def period(self):
        return self.__period

    @period.setter
    def period(self, period):
        if not isinstance(period, fhir.client.complex.Period):
            raise TypeError('A period value must be of type Period.')

    def str(self):
        return 'text representation'


text:
<?php
class Hh_admin__ extends CI_Controller {
  public function __construct()
  {
          parent::__construct();
          $this->load->model('herb_model');
          $this->load->model('farm_model');
          $this->load->model('user_model');
          $this->load->model('admin_model');
          $this->load->helper('url_helper');
  }

  public function index() {
    $this->load->view('admin/header');
    // $logged_in = $this->checkLogin();
    // if ($logged_in == true) {
    //
    // }
  }

  public function herb() {
    $lang = $this->session->userdata('site_lang');
    $data['lang'] = $lang;

    load_language('account',$lang);

    $this->load->library('ajax_pagination');
    $rows = $this->admin_model->recent_herb_history(array('limit'=>COUNT_PGN_HISTORY),$lang);

    $config['target'] = '#herb-history-list';
    $config['base_url'] = ci_admin_url().'recent_herb_history_ajax_pgn';
    $config['total_rows'] = $rows;
    $config['per_page'] = COUNT_PGN_HISTORY;

    $this->ajax_pagination->initialize($config);

    $data['herb_history_list'] = $this->user_model->get_user_herb_history($account_id,array('limit'=>COUNT_PGN_HISTORY),$lang);

    $this->load->view('admin/header');
    $this->load->view('admin/herb',$data);
  }

//////////////////////////////////////////////////////////////////////////////
//////////////////////////    AUTHENTICATION    //////////////////////////////
//////////////////////////////////////////////////////////////////////////////

  public function checkLogin() {
    $is_admin = $this->session->userdata['is_admin'];
    $adm_userkey = $this->session->userdata['adm_userkey'];
    $adm_username = $this->session->userdata['adm_username'];

    if  (!(isset($username) && !empty($username))||!(isset($userkey)&&!empty($userkey))||!(isset($is_admin)&&!empty($is_admin))) {
      redirect(ci_admin_url().'signin');
    } else {
      if ($is_admin=='true') {
        $check = $this->admin_model->checkUser($userkey,$username);
        if ($check==true) {
          return true;
        } else {
          redirect(ci_admin_url().'signin');
        }
      } else {
        redirect(ci_admin_url().'signin');
      }
    }

    return false;
  }

  public function signin() {
    if (isset($this->session->userdata('username'))) {
      redirect(base_url());
    }
    $lang = $this->session->userdata('site_lang');
    load_language('signin',$lang);

    $data['signin_err'] = false;
    $redirect = $this->input->get('redirect');
    $data['redirect'] = $redirect;

    //Before trying
    if (empty($_POST)) {
      $this->load->view('admin/header',$data);
      $this->load->view('admin/signin',$data);

      return;
    }

    $username = trim($this->input->post('username',TRUE));
    $password = $this->input->post('password',TRUE);

    $auth = $this->admin_model->signin_auth($username,$password);

    //Login Success
    if (!empty($auth)) {
      $this->session->set_userdata('username',$auth['username']);
      $this->session->set_userdata('userkey',$auth['id']);
      $this->session->set_userdata('usertype',$auth['user_type']);

      $redirect = $this->input->get('redirect');
      if (!empty($redirect)) {
        redirect(ci_admin_url().$redirect);
      } else {
        redirect(ci_admin_url());
      }

    //Login Fail
    } else {
      $data['signin_err'] = true;
      $data['username'] = $username;
      $data['password'] = $password;

      $this->load->view('admin/header',$data);
      $this->load->view('user/signin',$data);
    }
  }

  //////////////////////////////////////////////////////////////////////////////
  //////////////////////////         AJAX         //////////////////////////////
  //////////////////////////////////////////////////////////////////////////////

    function recent_herb_history_ajax_pgn() {
      $lang = $this->session->userdata('site_lang');
      $account_id = $this->session->userdata('userkey');
      $data['lang'] = $lang;

      load_language('account',$lang);

      $page = $this->input->post('page');
      if (!$page){
          $offset = 0;
      } else{
          $offset = $page;
      }

      $this->load->library('ajax_pagination');
      $rows = $this->admin_model->recent_herb_history(array('limit'=>COUNT_PGN_HISTORY),$lang);

      $config['target'] = '#herb-history-list';
      $config['base_url'] = ci_admin_url().'recent_herb_history_ajax_pgn';
      $config['total_rows'] = $rows;
      $config['per_page'] = COUNT_PGN_HISTORY;

      $this->ajax_pagination->initialize($config);

      $data['herb_history_list'] = $this->user_model->get_user_herb_history($account_id,array('start'=>$offset,'limit'=>COUNT_PGN_HISTORY),$lang);

      //load the view
      $this->load->view('admin/ajax/recent_herb_history_pgn', $data, false);
    }

}
?>


text:
layout: post
title: Specialist Officer vacancy in Maharashtra State Co-operative Bank last date 23rd March-2016
date: 2016-03-14 09:34
comments: true
tags:  Bank CA-ICWA-Finance Co-Operative Engineer IT(Computer) Legal Maharashtra Manager MCA Officer Online Specialist
archive: false
---
The Maharashtra State Co-operative Bank Ltd.  (MSCB) intends to recruit specialized   Officers in various grades :

- Manager - Legal Recovery : 01 post
- Assistant Manager - Legal Recovery : 02 posts
- Manager - Accounting and Financial Management : 01 post
- Assistant Manager - Accounting and Financial Management : 01 post
- Manager - Information Technology  : 01 post
- Officer Grade-II - Information Technology : 03 posts
- Manager - Banking  : 01 post
- Officer Grade-II - Banking : 10 posts (UR-5, OBC-3, SC-1, ST-1)

Application Fee : Rs.1000/- (Rs.500/- for SC/ST/OBC  candidates)  to be paid online

**How to Apply** :  Apply online at Maharashtra State Co-operative Bank website from 14/03/2016 to 23/03/2016 only.

Please visit <http://www.mscbank.com/Careers.aspx>   for all the details, instructions and online application format.


text:
"""Init"""
from .doctest_unittest_runner import *
from .suppress_stdout_stderr import *


text:
class Admin::PostsController < Admin::ApplicationController
  before_action :find_post, only: [:show, :update, :trash, :restore]

  def index
    @posts = Post.includes(:user).order(id: :desc).page(params[:page])
  end

  def trashed
    @posts = Post.trashed.includes(:user).order(id: :desc).page(params[:page])
    render :index
  end

  def show
  end

  def update
    if @post.update_attributes params.require(:post).permit(:title, :category_id, :body)
      flash[:success] = I18n.t('admin.posts.flashes.successfully_updated')
      redirect_to admin_post_url(@post)
    else
      render :show
    end
  end

  def trash
    @post.trash
    flash[:success] = I18n.t('admin.posts.flashes.successfully_trashed')
    redirect_to admin_post_path(@post)
  end

  def restore
    @post.restore
    flash[:success] = I18n.t('admin.posts.flashes.successfully_restored')
    redirect_to admin_post_path(@post)
  end

  private

  def find_post
    @post = Post.with_trashed.find params[:id]
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="99163883-deb4-4581-b51e-9af01587b689" name="Default" comment="">
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/README.md" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/index.php" afterPath="$PROJECT_DIR$/public/index.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
    </list>
    <ignored path="RandomUsers.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path=".idea/dataSources.local.xml" />
    <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="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="RandomUsers" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="index.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/public/index.php">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-6.25">
              <caret line="10" column="48" selection-start-line="10" selection-start-column="48" selection-end-line="10" selection-end-column="48" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name=".gitignore" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/.gitignore">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0">
              <caret line="7" column="0" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="README.md" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/README.md">
          <provider editor-type-id="MarkdownPreviewEditor">
            <state />
          </provider>
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.041436464">
              <caret line="2" column="55" selection-start-line="2" selection-start-column="55" selection-end-line="2" selection-end-column="55" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="RandomUsersTest.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/test/RandomUsersTest.php">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-7.5">
              <caret line="12" column="32" selection-start-line="12" selection-start-column="32" selection-end-line="12" selection-end-column="32" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="Generator.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/RandomUsers/Generator.php">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="11.875">
              <caret line="53" column="9" selection-start-line="53" selection-start-column="9" selection-end-line="53" selection-end-column="9" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="User.php" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/RandomUsers/User.php">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="-5.1764708">
              <caret line="44" column="0" selection-start-line="44" selection-start-column="0" selection-end-line="44" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </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$/composer.json" />
        <option value="$PROJECT_DIR$/src/RandomUsers/User.php" />
        <option value="$PROJECT_DIR$/test/RandomUsersTest.php" />
        <option value="$PROJECT_DIR$/src/RandomUsers/Generator.php" />
        <option value="$PROJECT_DIR$/.gitignore" />
        <option value="$PROJECT_DIR$/public/index.php" />
        <option value="$PROJECT_DIR$/README.md" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
  </component>
  <component name="NamedScopeManager">
    <order />
  </component>
  <component name="PhpServers">
    <servers />
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  <component name="ProjectFrameBounds">
    <option name="y" value="23" />
    <option name="width" value="1440" />
    <option name="height" value="873" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="vendor" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="vendor" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="guzzlehttp" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="test" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="RandomUsers" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="public" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="Scope" />
      <pane id="Scratches" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../../Engrade" />
    <property name="options.lastSelected" value="Errors" />
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="WebServerToolWindowFactoryState" value="true" />
    <property name="FullScreen" value="false" />
  </component>
  <component name="RecentsManager">
    <key name="MoveFile.RECENT_KEYS">
      <recent name="$PROJECT_DIR$/src/RandomUsers" />
      <recent name="$PROJECT_DIR$/src/RandomUsers/Generator" />
    </key>
  </component>
  <component name="RunManager">
    <configuration default="true" type="BashConfigurationType" factoryName="Bash">
      <option name="INTERPRETER_OPTIONS" value="" />
      <option name="INTERPRETER_PATH" value="/bin/bash" />
      <option name="WORKING_DIRECTORY" value="" />
      <option name="PARENT_ENVS" value="true" />
      <option name="SCRIPT_NAME" value="" />
      <option name="PARAMETERS" value="" />
      <module name="" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
      <TestRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpBehatConfigurationType" factoryName="Behat">
      <BehatRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
      <method />
    </configuration>
    <configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server" server_id="185123eb-beb2-4187-abe0-82e0a5a507a9" server_name="localhost">
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-options />
      <gulpfile />
      <tasks />
      <arguments />
      <pass-parent-envs>true</pass-parent-envs>
      <envs />
      <method />
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="99163883-deb4-4581-b51e-9af01587b689" name="Default" comment="" />
      <created>1439589673806</created>
      <option name="number" value="Default" />
      <updated>1439589673806</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="23" width="1440" height="873" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Atlassian " active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Code Review" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="PlantUML" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2532189" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="atlassian-ide-plugin-workspace-issues">
    <option name="view">
      <JiraViewConfigurationBean>
        <option name="viewFilterId" value="" />
      </JiraViewConfigurationBean>
    </option>
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/public/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="4" column="29" selection-start-line="4" selection-start-column="29" selection-end-line="4" selection-end-column="29" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/test/RandomUsersTest.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="45" column="0" selection-start-line="45" selection-start-column="0" selection-end-line="45" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/RandomUsers/Generator.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="96" column="35" selection-start-line="96" selection-start-column="35" selection-end-line="96" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/RandomUsers/User.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/composer.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-4.4117646">
          <caret line="15" column="25" selection-start-line="15" selection-start-column="25" selection-end-line="15" selection-end-column="25" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/RandomUsers/User.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-5.1764708">
          <caret line="44" column="0" selection-start-line="44" selection-start-column="0" selection-end-line="44" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/test/RandomUsersTest.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-7.5">
          <caret line="12" column="32" selection-start-line="12" selection-start-column="32" selection-end-line="12" selection-end-column="32" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/RandomUsers/Generator.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="11.875">
          <caret line="53" column="9" selection-start-line="53" selection-start-column="9" selection-end-line="53" selection-end-column="9" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.gitignore">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0">
          <caret line="7" column="0" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/public/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-6.25">
          <caret line="10" column="48" selection-start-line="10" selection-start-column="48" selection-end-line="10" selection-end-column="48" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/README.md">
      <provider editor-type-id="MarkdownPreviewEditor">
        <state />
      </provider>
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.041436464">
          <caret line="2" column="55" selection-start-line="2" selection-start-column="55" selection-end-line="2" selection-end-column="55" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Provider;

namespace NoTPK.Owin.Security.ObsidianPortal.Providers
{
	public class ObsidianPortalApplyRedirectContext : BaseContext<ObsidianPortalAuthenticationOptions>
	{
		public ObsidianPortalApplyRedirectContext(IOwinContext context, ObsidianPortalAuthenticationOptions options, AuthenticationProperties properties, string redirectUri) : base(context, options)
		{
			RedirectUri = redirectUri;
			Properties = properties;
		}

		public string RedirectUri { get; set; }

		public AuthenticationProperties Properties { get; set; }
	}
}


text:
Edit Category

    <form name="articleForm" class="form-horizontal" data-ng-submit="update()" novalidate>
      <fieldset>

          Title

            <input name="title" type="text" data-ng-model="category.title" id="title" class="form-control" placeholder="Title">

          Url

            <input name="link" type="url" data-ng-model="category.link" id="link" class="form-control" placeholder="http://www.example.com">

          Source Name

            <input name="sourceName" type="text" data-ng-model="category.sourceName" id="sourceName" class="form-control" placeholder="Source Name">

          Source Icon

            <input name="image" type="file" file-model="category.sourceImage" id="image" class="form-control">

          <input type="submit" value="Update" class="btn btn-default">

      </fieldset>
    </form>


text:
/**
 * Created by Administrator on 2017/9/28 0028.
 */
(function(doc, win) {
    let docEl = doc.documentElement,
        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
        recalc = function() {
            let clientWidth = docEl.clientWidth;
            let rem = clientWidth / 750;
            if (!clientWidth) return;
            docEl.style.fontSize = rem * 100 + 'px';
        };
    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);


text:
/***********************************************************************************************************************
* File Name    : r_private.h
* Description  : Definitions internal to byte queue module
************************************************************************************************************************
* History : DD.MM.YYYY Version Description
*           24.07.2013 1.0     Initial Release
***********************************************************************************************************************/

#ifndef BYTEQ_PRIVATE_H
#define BYTEQ_PRIVATE_H

/***********************************************************************************************************************
Includes   <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Fixed width integer support. */
#include <stdint.h>

/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/

/*****************************************************************************
Typedef definitions
******************************************************************************/

/* QUEUE CONTROL BLOCK */

typedef struct st_byteq_ctrl    // Byte Queue Control Block (for handle)
{
    uint8_t     *buffer;        // pointer to buffer
    uint16_t    size;           // buffer size
    uint16_t    count;          // number data bytes in queue
    uint16_t    in_index;       // index used by Put function to add data
    uint16_t    out_index;      // index used by Get function to remove data
} byteq_ctrl_t;

#endif /* BYTEQ_PRIVATE_H */


text:
using System;
using System.Windows.Forms;
using NewRelic.AgentConfiguration.Core;
using NewRelic.AgentConfiguration.Core.Singletons;
using NewRelic.AgentConfiguration.Core.Parts;
using FormElements = NewRelic.AgentConfiguration.Core.FormElements;
using Attribute = NewRelic.AgentConfiguration.Core.Parts.Attribute;

namespace NewRelic.AgentConfiguration.UserInterface
{

    /// <summary>
    /// Builds the UI objects and places them in their FlwoLayoutPanels
    /// </summary>
    public class UIBuilder
    {
        public FlowLayoutPanel ConfigPanel;
        private ToolTip _toolTipObj;
        private bool _showAdvanced;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="flow">The main FlowLayoutPanel to house the selections.</param>
        /// <param name="tooltip">The tooltip to attach to each FormElement.</param>
        public UIBuilder(FlowLayoutPanel flow, ToolTip tooltip)
        {
            ConfigPanel = flow;
            _toolTipObj = tooltip;
            _showAdvanced = false;
        }

        /// <summary>
        /// Starts the build process. Calls the recursive methods. Adds the header item. Finally, validates the form items.
        /// </summary>
        /// <param name="showAdvanced">Controls whether or not to show Advanced items.</param>
        public void Build(bool showAdvanced)
        {
            _showAdvanced = showAdvanced;

            ConfigPanel.SuspendLayout();

            var label = new Element();
            label.Name = "HeaderLabel";
            label.Documentation ="Please select a section at the right to begin.";
            label.Parent = null;
            ConfigPanel.Controls.Add(FormElements.Controls.Label(label));

            var flow = FormElements.Flows.Section(DataFile.Instance.MergedFile, _toolTipObj);

            BuildAttributes(DataFile.Instance.MergedFile, flow);
            ConfigPanel.Controls.Add(flow);

            BuildElement(DataFile.Instance.MergedFile, ConfigPanel);
            ConfigPanel.ResumeLayout();

            //run validation after form is ready via a recursive function
            RunValidation(ConfigPanel);
        }

        /// <summary>
        /// Recursive method that confirms the contents of the textboxes and marks them as bad if needed.
        /// </summary>
        /// <param name="control"></param>
        private void RunValidation(Control control)
        {
            var textBox = control as TextBox;
            if (textBox != null && textBox.Multiline)
            {
                textBox.CausesValidation = false;
                textBox.CausesValidation = true;
            }
            else
            {
                foreach(Control child in control.Controls)
                {
                    RunValidation(child);
                }
            }
        }

        /// <summary>
        /// Recursuve method that takes the Element parts and builds them into sections, textboxes, or multiline textboxes.
        /// </summary>
        /// <param name="element">Element to build out.</param>
        /// <param name="parentFlow">FlowLayoutPanel to place the resulting form control into.</param>
        private void BuildElement(Element element, FlowLayoutPanel parentFlow)
        {
            foreach (var elementItem in element.Elements)
            {
                //if(elementItem.IsAdvanced && !_showAdvanced)
                //{
                //    continue;
                //}

                if (elementItem.Name == "labels")
                {
                    int sdfs = 0;
                }

                if (elementItem.MaxOccurs <= 1)
                {
                    var flow = FormElements.Flows.Section(elementItem, _toolTipObj);

                    //deal with elements that have text, will error and return null if no text.  This is good.

                    flow.Controls.Add(FormElements.Controls.TextBox(elementItem, _toolTipObj));
                    BuildAttributes(elementItem, flow);
                    BuildElement(elementItem, flow);

                    //works barely, but need MUCH polish...
                    //_toolTipObj.SetToolTip(flow, elementItem.Documentation);

                    parentFlow.Controls.Add(flow);
                }

                if (elementItem.MaxOccurs > 1)
                {
                    if(MultiLineCollection.Instance.Exists(QualifiedName(elementItem)))
                    {
                        if (elementItem.Attributes.Count > 0)
                        {
                            MultiLineCollection.Instance.GetTextBox(QualifiedName(elementItem)).Text += Environment.NewLine + elementItem.Attributes[0].Value;
                        }
                        else
                        {
                            MultiLineCollection.Instance.GetTextBox(QualifiedName(elementItem)).Text += Environment.NewLine + elementItem.Value;
                        }
                    }
                    else
                    {
                        if (elementItem.Attributes.Count > 0)
                        {
                            parentFlow.Controls.Add(FormElements.Flows.MultiLineTextBoxFlow(elementItem, _toolTipObj));
                            MultiLineCollection.Instance.Add(QualifiedName(elementItem), "mlt" + elementItem.Name, parentFlow);
                            MultiLineCollection.Instance.GetTextBox(QualifiedName(elementItem)).Text += elementItem.Attributes[0].Value;
                        }
                        else
                        {
                            parentFlow.Controls.Add(FormElements.Flows.MultiLineTextBoxFlow(elementItem, _toolTipObj));
                            MultiLineCollection.Instance.Add(QualifiedName(elementItem), "mlt" + elementItem.Name, parentFlow);
                        }
                    }
                }
            }
        }

        /// <summary>
        /// Builds the qualified name for an element.
        /// </summary>
        /// <param name="elementItem">Element to work from.</param>
        /// <returns>Qualified name as a string.</returns>
        private static string QualifiedName(Element elementItem)
        {
            return elementItem.Name + "." + elementItem.Parent.Name + "." + elementItem.Parent.Parent.Name;
        }

        /// <summary>
        /// Methods to build out the attributes into form controls./
        /// </summary>
        /// <param name="element">Element to work from.</param>
        /// <param name="flow">FlowLayoutPanel to place the resulting form control into.</param>
        private void BuildAttributes(Element element, FlowLayoutPanel flow)
        {
            foreach (Attribute attribute in element.Attributes)
            {
                if (attribute.IsAdvanced && !_showAdvanced)
                {
                    continue;
                }

                switch (attribute.Type)
                {
                    case "boolean":
                        flow.Controls.Add(FormElements.Flows.RadioButtonFlow(attribute, attribute.Default, _toolTipObj));
                        break;
                    case "unsignedInt":
                    case "float":
                    case "int":
                        flow.Controls.Add(FormElements.Flows.NumericFlow(attribute, _toolTipObj));
                        break;
                    case "string":
                        flow.Controls.Add(FormElements.Flows.TextBoxFlow(attribute, _toolTipObj));
                        break;
                    case "":
                        string[] array = attribute.Restriction.Enumerations.ToArray();
                        flow.Controls.Add(FormElements.Flows.ComboBoxFlow(attribute, array, _toolTipObj));
                        break;
                    case "hidden":
                        break;
                    default:
                        throw new ArgumentException();
                }

                //SetToolTip(flow, element.Documentation, attribute.Documentation);
            }
        }

        //also sorta works.  format is good but not hitting the flow's children
        /// <summary>
        /// Sets the tooltip for tooltip for a form control.
        /// </summary>
        /// <param name="flow"></param>
        /// <param name="element"></param>
        /// <param name="attribute"></param>
        private void SetToolTip(FlowLayoutPanel flow, string element = "", string attribute = "")
        {
            string tip = "";

            if(!String.IsNullOrWhiteSpace(element))
            {
                tip = element;
            }

            if (!String.IsNullOrWhiteSpace(attribute))
            {
                if(!String.IsNullOrWhiteSpace(tip))
                {
                    tip += Environment.NewLine + Environment.NewLine + attribute;
                }
                else
                {
                    tip = attribute;
                }
            }

            _toolTipObj.SetToolTip(flow, tip);
        }
    }
}


text:
package org.mifos.accounts.fees.struts.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.mifos.accounts.fees.servicefacade.FeeCreateRequest;
import org.mifos.accounts.fees.servicefacade.FeeDto;
import org.mifos.accounts.fees.servicefacade.FeeUpdateRequest;
import org.mifos.accounts.fees.struts.actionforms.FeeActionForm;
import org.mifos.accounts.fees.util.helpers.FeeConstants;
import org.mifos.application.servicefacade.FeeDetailsForLoadDto;
import org.mifos.application.servicefacade.FeeDetailsForManageDto;
import org.mifos.application.servicefacade.FeeDetailsForPreviewDto;
import org.mifos.application.util.helpers.ActionForwards;
import org.mifos.application.util.helpers.Methods;
import org.mifos.framework.struts.action.BaseAction;
import org.mifos.framework.util.helpers.SessionUtils;
import org.mifos.framework.util.helpers.TransactionDemarcate;
import org.mifos.security.util.ActionSecurity;
import org.mifos.security.util.SecurityConstants;
import org.mifos.security.util.UserContext;

public class FeeAction extends BaseAction {

    public FeeAction() throws Exception {
    }

    public static ActionSecurity getSecurity() {
        ActionSecurity security = new ActionSecurity("feeaction");
        security.allow("search", SecurityConstants.VIEW);
        security.allow("load", SecurityConstants.FEES_CREATE_FEES);
        security.allow("preview", SecurityConstants.VIEW);
        security.allow("editPreview", SecurityConstants.VIEW);
        security.allow("create", SecurityConstants.FEES_CREATE_FEES);
        security.allow("get", SecurityConstants.VIEW);
        security.allow("manage", SecurityConstants.FEES_EDIT_FEES);
        security.allow("update", SecurityConstants.FEES_EDIT_FEES);
        security.allow("previous", SecurityConstants.VIEW);
        security.allow("editPrevious", SecurityConstants.VIEW);
        security.allow("viewAll", SecurityConstants.VIEW);
        security.allow("cancelCreate", SecurityConstants.VIEW);
        security.allow("cancelEdit", SecurityConstants.VIEW);
        return security;
    }

    @TransactionDemarcate(saveToken = true)
    public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        form.reset(mapping, request);
        ((FeeActionForm) form).clear();
        FeeDetailsForLoadDto feeDetailsForLoad = this.feeServiceFacade.retrieveDetailsForFeeLoad(getUserContext(request).getLocaleId());
        request.getSession().setAttribute("isMultiCurrencyEnabled", feeDetailsForLoad.isMultiCurrencyEnabled());
        request.getSession().setAttribute("currencies", feeDetailsForLoad.getCurrencies());
        request.getSession().setAttribute(FeeParameters.class.getSimpleName(), feeDetailsForLoad.getFeeParameters());
        return mapping.findForward(ActionForwards.load_success.toString());
    }

    @TransactionDemarcate(joinToken = true)
    public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {

        FeeActionForm feeActionForm = (FeeActionForm) form;
        Short currencyId = feeActionForm.getCurrencyId();

        FeeDetailsForPreviewDto feeDetailsForPreview = this.feeServiceFacade.retrieveDetailsforFeePreview(currencyId);

        SessionUtils.setAttribute("isMultiCurrencyEnabled", feeDetailsForPreview.isMultiCurrencyEnabled(), request);
        if (feeDetailsForPreview.isMultiCurrencyEnabled()) {
            request.getSession().setAttribute("currencyCode", feeDetailsForPreview.getCurrencyCode());
        }

        return mapping.findForward(ActionForwards.preview_success.toString());
    }

    @TransactionDemarcate(joinToken = true)
    public ActionForward previous(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, @SuppressWarnings("unused") HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {

        return mapping.findForward(ActionForwards.previous_success.toString());
    }

    @TransactionDemarcate(validateAndResetToken = true)
    public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        FeeActionForm actionForm = (FeeActionForm) form;
        UserContext userContext = getUserContext(request);
        FeeCreateRequest feeCreateRequest = new FeeCreateRequest(actionForm.getCategoryTypeValue(), actionForm
                .getFeeFrequencyTypeValue(), actionForm.getGlCodeValue(), actionForm.getFeePaymentTypeValue(),
                actionForm.getFeeFormulaValue(), actionForm.getFeeName(), actionForm.isRateFee(), actionForm
                        .isCustomerDefaultFee(), actionForm.getRateValue(), actionForm.getCurrencyId(), actionForm
                        .getAmount(), actionForm.getFeeRecurrenceTypeValue(), actionForm.getMonthRecurAfterValue(),
                actionForm.getWeekRecurAfterValue());

        FeeDto feeDto = this.feeServiceFacade.createFee(feeCreateRequest, userContext);
        actionForm.setFeeId(feeDto.getId().toString());
        return mapping.findForward(ActionForwards.create_success.toString());
    }

    @TransactionDemarcate(joinToken = true)
    public ActionForward validate(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        String forward = null;
        String method = (String) request.getAttribute("methodCalled");
        if (method != null) {
            if (method.equals(Methods.previous.toString()) || method.equals(Methods.create.toString())) {
                forward = ActionForwards.previous_failure.toString();
            } else if (method.equals(Methods.editPrevious.toString()) || method.equals(Methods.update.toString())) {
                forward = ActionForwards.editprevious_failure.toString();
            } else {
                forward = method + "_failure";
            }
        }
        return mapping.findForward(forward.toString());
    }

    @TransactionDemarcate(saveToken = true)
    public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        FeeDto feeDto = this.feeServiceFacade.getFeeDetails(((FeeActionForm) form).getFeeIdValue());
        request.setAttribute("model", feeDto);
        return mapping.findForward(ActionForwards.get_success.toString());
    }

    @TransactionDemarcate(joinToken = true)
    public ActionForward manage(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        FeeActionForm feeActionForm = (FeeActionForm) form;

        Short feeId = Short.valueOf(feeActionForm.getFeeId());
        FeeDetailsForManageDto feeDetailsForManage = feeServiceFacade.retrieveDetailsForFeeManage(feeId);

        SessionUtils.setCollectionAttribute(FeeConstants.STATUSLIST, feeDetailsForManage.getFeeStatuses(), request);
        feeActionForm.updateWithFee(feeDetailsForManage.getFee());
        request.getSession().setAttribute("model", feeDetailsForManage.getFee());
        return mapping.findForward(ActionForwards.manage_success.toString());
    }

    @TransactionDemarcate(joinToken = true)
    public ActionForward editPreview(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        FeeDto feeDto = this.feeServiceFacade.getFeeDetails(((FeeActionForm) form).getFeeIdValue());
        request.getSession().setAttribute("model", feeDto);
        return mapping.findForward(ActionForwards.editPreview_success.toString());
    }

    @TransactionDemarcate(joinToken = true)
    public ActionForward editPrevious(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        FeeDto feeDto = this.feeServiceFacade.getFeeDetails(((FeeActionForm) form).getFeeIdValue());
        request.setAttribute("model", feeDto);
        return mapping.findForward(ActionForwards.editprevious_success.toString());
    }

    @TransactionDemarcate(validateAndResetToken = true)
    public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        FeeActionForm feeActionForm = (FeeActionForm) form;

        FeeUpdateRequest feeUpdateRequest = new FeeUpdateRequest(Short.valueOf(feeActionForm.getFeeId()), feeActionForm.getCurrencyId(),
                feeActionForm.getAmount(), feeActionForm.getFeeStatusValue(), feeActionForm.getRateValue());

        this.feeServiceFacade.updateFee(feeUpdateRequest, getUserContext(request));
        return mapping.findForward(ActionForwards.update_success.toString());
    }

    @TransactionDemarcate(saveToken = true)
    public ActionForward viewAll(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        List<FeeDto> customerFees = feeServiceFacade.getCustomerFees();
        List<FeeDto> productFees = feeServiceFacade.getProductFees();

        SessionUtils.setCollectionAttribute(FeeConstants.CUSTOMER_FEES, customerFees, request);
        SessionUtils.setCollectionAttribute(FeeConstants.PRODUCT_FEES, productFees, request);
        return mapping.findForward(ActionForwards.viewAll_success.toString());
    }

    @TransactionDemarcate(validateAndResetToken = true)
    public ActionForward cancelCreate(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, @SuppressWarnings("unused") HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        return mapping.findForward(ActionForwards.cancelCreate_success.toString());
    }

    @TransactionDemarcate(validateAndResetToken = true)
    public ActionForward cancelEdit(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, @SuppressWarnings("unused") HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
        return mapping.findForward(ActionForwards.cancelEdit_success.toString());
    }
}


text:
layout: post
date: '2016-01-09'
title: "Long Alfred Angelo Bridesmaid Dress 7274L"
category: Long
tags: [Long]
---
### Long Alfred Angelo Bridesmaid Dress 7274L
Just **$220.99**
###

Buy it: [https://www.eudances.com/en/long/1871-alfred-angelo-long-bridesmaid-dress-7274l.html](https://www.eudances.com/en/long/1871-alfred-angelo-long-bridesmaid-dress-7274l.html)


text:
class ListNode:
    def __init__(self, data, next=None):
        self.data = data
        self.next = next

def has_cycle(self, root: ListNode) -> bool:
    slow = root
    fast = root
    s_flag = False # whether advance the slow pointer
    while fast:
        s_flag = not s_flag # advance slow pointer on every other loop
        fast = fast.next
        if fast is slow: return True
        if s_flag: slow = slow.next
    return False

'''
Consider the following linked list, where E is the cylce entry and X, the crossing point of fast and slow.
H: distance from head to cycle entry E
D: distance from E to X
L: cycle length
                  _____
                 /     \
head_____H______E       \
                \       /
                 X_____/

If fast and slow both start at head, when fast catches slow, slow has traveled H+D and fast 2(H+D).
Assume fast has traveled n loops in the cycle, we have:
2(H + D) = H + D + nL =>  H + D = nL => H = nL - D
Thus if two pointers start from head and X, respectively, one first reaches E, the other also reaches E.
In my solution, since fast starts at head.next, we need to move slow one step forward in the beginning of part 2
'''
def cycle_entry(self, root: ListNode) -> bool:
    slow = root
    fast = root
    while fast and fast.next:
        slow = slow.next
        fast = fast.next.next
        if fast is slow: # has_cycle
            slow = root
            while fast is not slow:
                slow = slow.next
                fast = fast.next
            return slow
    return None


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/headerNotification"
    android:layout_alignParentRight="true">

    <ImageView
        android:id="@+id/headerNotificationBackground"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <Button
        android:id="@+id/headerNotificationButton"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:background="@null" />

    <TextView
        android:id="@+id/headerNotificationCount"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="-1dp"
        android:layout_marginRight="10dp"
        android:layout_alignTop="@id/headerNotificationButton"
        android:layout_alignRight="@id/headerNotificationButton"
        android:textColor="@color/blue"
        android:textSize="12dp" />

</RelativeLayout>


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

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape>
            <gradient android:angle="270"
                android:startColor="#0099CC"
                android:endColor="#FFFFFF"/>
        </shape>
    </item>
</selector>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="JavaScriptLibraryMappings">
    <file url="file://$PROJECT_DIR$/config-util.js" libraries="{Node.js Globals}" />
    <file url="file://$PROJECT_DIR$/index.js" libraries="{Node.js Globals}" />
    <file url="file://$PROJECT_DIR$/test/config-util-test.js" libraries="{Node.js Globals}" />
    <file url="file://$PROJECT_DIR$/test/index-test.js" libraries="{Node.js Globals}" />
    <includedPredefinedLibrary name="Node.js Globals" />
  </component>
</project>


text:
<?php

declare(strict_types=1);

namespace Palmtree\Csv;

/**
 * Writes an array to a CSV file.
 */
class Writer extends AbstractCsvDocument
{
    private array $headers = [];

    public static function write(string $filePath, array $data): void
    {
        $writer = new self($filePath);
        $writer->setData($data);
        $writer->closeDocument();
    }

    /**
     * Sets headers and all rows on the CSV file and
     * then closes the file handle.
     *
     * Uses the first row's keys as headers.
     */
    public function setData(array $data): self
    {
        if ($this->hasHeaders) {
            $this->setHeaders(array_keys(reset($data)));
        }

        $this->addRows($data);

        return $this;
    }

    public function setHeaders(array $headers): self
    {
        $this->headers = $headers;

        $this->addRow($this->headers);

        return $this;
    }

    public function addHeader(string $header): self
    {
        $headers = $this->headers;

        $headers[] = $header;

        $this->setHeaders($headers);

        return $this;
    }

    /**
     * Adds multiple rows of data to the CSV file.
     */
    public function addRows(array $rows): void
    {
        foreach ($rows as $row) {
            $this->addRow($row);
        }
    }

    /**
     * Adds a row of data to the CSV file.
     *
     * @param array $row Row of data to add to the file.
     *
     * @return bool Whether the row was written to the file.
     */
    public function addRow(array $row): bool
    {
        if ($this->hasHeaders && empty($this->headers)) {
            $this->setHeaders(array_keys($row));
        }

        $result = $this->getDocument()->fwriteCsv($row);

        if ($result === 0) {
            // @todo: handle error
            return false;
        }

        return true;
    }

    public function getContents(): string
    {
        $this->getDocument()->trimFinalLineEnding();

        if (($size = $this->getDocument()->getSize()) === 0) {
            return '';
        }

        $this->getDocument()->fseek(0);

        if (($data = $this->getDocument()->fread($size)) === false) {
            return '';
        }

        return $data;
    }

    protected function getOpenMode(): string
    {
        return 'w+';
    }
}


text:
package com.qq.weixin.chat.api.protocol;

public class BaseRequest {
    public final String Uin;
    public final String Sid;
    public final String Skey;
    public final String DeviceID;

    public BaseRequest(String uin, String sid, String skey) {
        this(uin, sid, skey, deviceId());
    }

    public BaseRequest(String uin, String sid, String skey, String deviceID) {
        this.Uin = uin;
        this.Sid = sid;
        this.Skey = skey;
        this.DeviceID = deviceID;
    }

    public static String deviceId() {
        StringBuilder sb = new StringBuilder("e");
        for (int i = 0; i < 15; i++) {
            sb.append((int) (Math.random() * 10));
        }
        return sb.toString();
    }
}


text:
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Xml;
using TUM.CMS.VplControl.Annotations;

namespace TUM.CMS.VplControl.Core
{
    public class Connector : INotifyPropertyChanged
    {
        public readonly ConnectorPort endEllipse;
        public readonly ConnectorPort srtEllipse;
        private int counter = 0;

        public Connector(VplControl hostCanvas, Port startPort, Port endPort)
        {
            HostCanvas = hostCanvas;

            Path = new Path();

            srtEllipse = new ConnectorPort(hostCanvas);
            endEllipse = new ConnectorPort(hostCanvas);

            Panel.SetZIndex(Path, 2);

            if (startPort.ParentNode != null)
            {
                Panel.SetZIndex(srtEllipse, startPort.ParentNode.Id + 1);
            }

            if (endPort.ParentNode != null)
            {
                Panel.SetZIndex(endEllipse, endPort.ParentNode.Id + 1);
            }

            Path.Style = HostCanvas.FindResource("VplConnectorStyle") as Style;

            StartPort = startPort;
            EndPort = endPort;

            Canvas.SetLeft(srtEllipse, StartPort.Origin.X - srtEllipse.ActualWidth/2);
            Canvas.SetTop(srtEllipse, StartPort.Origin.Y - srtEllipse.ActualHeight/2);

            Canvas.SetLeft(endEllipse, EndPort.Origin.X - endEllipse.ActualWidth/2);
            Canvas.SetTop(endEllipse, EndPort.Origin.Y - endEllipse.ActualHeight/2);

            StartBezierPoint = new BindingPoint(StartPort.Origin.X, StartPort.Origin.Y);
            EndBezierPoint = new BindingPoint(EndPort.Origin.X, EndPort.Origin.Y);

            startPort.DataChanged += endPort.StartPort_DataChanged;

            StartPort.Origin.PropertyChanged += Origin_PropertyChanged;
            EndPort.Origin.PropertyChanged += Origin_PropertyChanged;

            if (startPort.ParentNode != null)
            {
                StartPort.ParentNode.PropertyChanged += Origin_PropertyChanged;
                ObserveNode(StartPort.ParentNode);
            }

            if (endPort.ParentNode != null)
            {
                EndPort.ParentNode.PropertyChanged += Origin_PropertyChanged;
                ObserveNode(EndPort.ParentNode);
            }

            startPort.ConnectedConnectors.Add(this);
            endPort.ConnectedConnectors.Add(this);

            endPort.CalculateData(startPort.Data);

            DefinePath();
            HostCanvas.Children.Add(Path);

            Path.MouseDown += Path_MouseDown;
            Path.MouseUp += PathOnMouseUp;
        }

        private void PathOnMouseUp(object sender, MouseButtonEventArgs mouseButtonEventArgs)
        {
            mouseButtonEventArgs.Handled = true;
        }

        private void Path_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            IsSelected = !IsSelected;
        }

        public Port StartPort { get; }
        public Port EndPort { get; }
        public VplControl HostCanvas { get; set; }
        public Path Path { get; set; }
        public BindingPoint StartBezierPoint { get; set; }
        public BindingPoint EndBezierPoint { get; set; }

        private bool isSelected;

        public bool IsSelected
        {
            get { return isSelected; }
            set
            {
                if (value != isSelected)
                {
                    if (value)
                    {
                        Path.Style = HostCanvas.FindResource("VplSelectedConnectorStyle") as Style;
                        HostCanvas.SelectedConnectors.Add(this);
                    }
                    else
                    {
                        Path.Style = HostCanvas.FindResource("VplConnectorStyle") as Style;
                        HostCanvas.SelectedConnectors.Remove(this);
                    }
                }

                isSelected=value;

            }
        }

        public void SynchroniseAfterZoom()
        {
            Origin_PropertyChanged(null, null);
        }

        private void Origin_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            Point startBezierPoint, endBezierPoint;

            if (HostCanvas.GraphFlowDirection == GraphFlowDirections.Horizontal)
            {
                startBezierPoint = StartPort.Origin.Point +
                                   new Vector((StartPort.Origin.Point - EndPort.Origin.Point).Length/2, 0);
                endBezierPoint = EndPort.Origin.Point +
                                 new Vector(-(StartPort.Origin.Point - EndPort.Origin.Point).Length/2, 0);
            }
            else
            {
                startBezierPoint = StartPort.Origin.Point +
                                   new Vector(0, (StartPort.Origin.Point - EndPort.Origin.Point).Length/2);
                endBezierPoint = EndPort.Origin.Point +
                                 new Vector(0, -(StartPort.Origin.Point - EndPort.Origin.Point).Length/2);
            }

            StartBezierPoint.X = startBezierPoint.X;
            StartBezierPoint.Y = startBezierPoint.Y;

            EndBezierPoint.X = endBezierPoint.X;
            EndBezierPoint.Y = endBezierPoint.Y;

            srtEllipse.UpdateLayout();

            Canvas.SetLeft(srtEllipse, StartPort.Origin.X - srtEllipse.ActualWidth/2);
            Canvas.SetTop(srtEllipse, StartPort.Origin.Y - srtEllipse.ActualHeight/2);

            Canvas.SetLeft(endEllipse, EndPort.Origin.X - endEllipse.ActualWidth/2);
            Canvas.SetTop(endEllipse, EndPort.Origin.Y - endEllipse.ActualHeight/2);
        }

        private void DefinePath()
        {
            if (StartPort.Origin == null || EndPort.Origin == null) return;

            var spline = new BezierSegment {IsStroked = true};

            var b = new Binding("Point")
            {
                Source = StartBezierPoint,
                Mode = BindingMode.OneWay
            };
            BindingOperations.SetBinding(spline, BezierSegment.Point1Property, b);

            b = new Binding("Point")
            {
                Source = EndBezierPoint,
                Mode = BindingMode.OneWay
            };
            BindingOperations.SetBinding(spline, BezierSegment.Point2Property, b);

            b = new Binding("Point")
            {
                Source = EndPort.Origin,
                Mode = BindingMode.OneWay
            };
            BindingOperations.SetBinding(spline, BezierSegment.Point3Property, b);

            var pColl = new PathSegmentCollection {spline};

            var pFig = new PathFigure(StartPort.Origin.Point, pColl, false);

            b = new Binding("Point")
            {
                Source = StartPort.Origin,
                Mode = BindingMode.OneWay
            };
            BindingOperations.SetBinding(pFig, PathFigure.StartPointProperty, b);

            var pfColl = new PathFigureCollection {pFig};

            Path.Data = new PathGeometry(pfColl);
        }

        public void Delete()
        {
            RemoveFromCanvas();

            StartPort.ConnectedConnectors.Remove(this);
            EndPort.ConnectedConnectors.Remove(this);

            EndPort.CalculateData();
        }

        public void RemoveFromCanvas()
        {
            HostCanvas.Children.Remove(Path);
            HostCanvas.Children.Remove(srtEllipse);
            HostCanvas.Children.Remove(endEllipse);
            HostCanvas.ConnectorCollection.Remove(this);

            StartPort.DataChanged -= EndPort.StartPort_DataChanged;
        }

        private void ObserveNode(Node node)
        {
            node.DeletedInNodeCollection += node_DeletedInNodeCollection;
        }

        private void node_DeletedInNodeCollection(object sender, EventArgs e)
        {
            Delete();
        }

        public void SerializeNetwork(XmlWriter xmlWriter)
        {
            xmlWriter.WriteStartAttribute("StartNode");
            xmlWriter.WriteValue(StartPort.ParentNode.Guid.ToString());
            xmlWriter.WriteEndAttribute();

            xmlWriter.WriteStartAttribute("StartIndex");
            xmlWriter.WriteValue(StartPort.ParentNode.OutputPorts.IndexOf(StartPort));
            xmlWriter.WriteEndAttribute();

            xmlWriter.WriteStartAttribute("EndNode");
            xmlWriter.WriteValue(EndPort.ParentNode.Guid.ToString());
            xmlWriter.WriteEndAttribute();

            xmlWriter.WriteStartAttribute("EndIndex");
            xmlWriter.WriteValue(EndPort.ParentNode.InputPorts.IndexOf(EndPort));
            xmlWriter.WriteEndAttribute();
        }

        public virtual void DeserializeNetwork(XmlReader xmlReader)
        {
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}


text:
from frappe.model.document import Document

class AutoRepeatDay(Document):
	pass


text:
#ifndef FUNCTIONSH
#define FUNCTIONSH

#include "trec_eval.h"
/* Utility functions */
void * te_chk_and_malloc (void *ptr, long *current_bound,
			  const long needed, const size_t size);
void * te_chk_and_realloc (void *ptr, long *current_bound,
			   const long needed, const int size);
/* Functions for dealing with zscores */
int te_get_zscores (const EPI *epi, const char *zscores_file,
		    ALL_ZSCORES *zscores);
int te_get_zscores_cleanup ();
int te_convert_to_zscore (const ALL_ZSCORES *all_zscores, TREC_EVAL *q_eval);

/* ------------------- Generic Routines for Measures ------------------------ */

/* -------- Initialize measure -------- */
/* Code is in meas_init.c */
/* Measure does not require initialization or storage */
int te_init_meas_empty (EPI *epi, TREC_MEAS *tm, TREC_EVAL *eval);
/* Measure is a single float measure, no parameters */
int te_init_meas_s_float (EPI *epi, TREC_MEAS *tm, TREC_EVAL *eval);
/* Measure is a single long measure, no parameters. */
int te_init_meas_s_long (EPI *epi, TREC_MEAS *tm, TREC_EVAL *eval);
/* Measure is a float array with long cutoffs */
int te_init_meas_a_float_cut_long (EPI *epi, TREC_MEAS *tm, TREC_EVAL *eval);
/* Measure is a float array with float cutoffs */
int te_init_meas_a_float_cut_float (EPI *epi, TREC_MEAS *tm, TREC_EVAL *eval);
/* Measure is a single float with float params */
int te_init_meas_s_float_p_float (EPI *epi, TREC_MEAS *tm, TREC_EVAL *eval);
/* Measure is a single float with paired name=float params */
int te_init_meas_s_float_p_pair (EPI *epi, TREC_MEAS *tm, TREC_EVAL *eval);

/* -------- Accumulate Measure -------- */
/* Code is in meas_acc.c */
/* Measure does not require accumulation */
int te_acc_meas_empty (const EPI *epi, const TREC_MEAS *tm,
		       const TREC_EVAL *q_eval, TREC_EVAL *accum_eval);
/* Accumulate a single value */
int te_acc_meas_s (const EPI *epi, const TREC_MEAS *tm,
		   const TREC_EVAL *q_eval, TREC_EVAL *accum_eval);
/* Accumulate an array of values (one per cutoff) */
int te_acc_meas_a_cut (const EPI *epi, const TREC_MEAS *tm,
		       const TREC_EVAL *q_eval, TREC_EVAL *accum_eval);

/* ----- Calculate Average measure ---- */
/* Code is in meas_calc_avg.c */
/* Measure does not require final averaging */
int te_calc_avg_meas_empty (const EPI *epi, const TREC_MEAS *tm,
			    TREC_EVAL *eval);
/* Measure is a single value with averaging */
int te_calc_avg_meas_s (const EPI *epi, const TREC_MEAS *tm,
			TREC_EVAL *accum_eval);
/* Measure is an array of values (one per cutoff) with averaging */
int te_calc_avg_meas_a_cut (const EPI *epi, const TREC_MEAS *tm,
			    TREC_EVAL *accum_eval);
/* Measure is a single value using geometric mean */
int te_calc_avg_meas_s_gm (const EPI *epi, const TREC_MEAS *tm,
			   TREC_EVAL *accum_eval);

/* ----- Print single query for measure ---- */
/* Code is in meas_print_single.c */
/* Measure does not require printing */
int te_print_single_meas_empty (const EPI *epi, const TREC_MEAS *tm,
				const TREC_EVAL *eval);
/* Measure is a single float measure with no parameters, */
int te_print_single_meas_s_float (const EPI *epi, const TREC_MEAS *tm,
				  const TREC_EVAL *eval);
/* Measure is a single long measure with no parameters. */
int te_print_single_meas_s_long (const EPI *epi, const TREC_MEAS *tm,
				 const TREC_EVAL *eval);
/* Measure is a float array with cutoffs */
int te_print_single_meas_a_cut (const EPI *epi, const TREC_MEAS *tm,
				      const TREC_EVAL *eval);

/* ----- Print final query for measure ---- */
/* Code is in meas_print_final.c */
/* Measure does not require printing or storage */
int te_print_final_meas_empty (const EPI *epi, TREC_MEAS *tm,
			       TREC_EVAL *eval);
/* Measure is a single float measure with no parameters */
int te_print_final_meas_s_float (const EPI *epi, TREC_MEAS *tm,
				 TREC_EVAL *eval);
/* Measure is a single long measure with no parameters. */
int te_print_final_meas_s_long (const EPI *epi, TREC_MEAS *tm,
				TREC_EVAL *eval);
/* Measure is a float array with cutoffs */
int te_print_final_meas_a_cut (const EPI *epi, TREC_MEAS *tm,
			       TREC_EVAL *eval);
/* Measure is a single float with float params */
int te_print_final_meas_s_float_p (const EPI *epi, TREC_MEAS *tm,
				   TREC_EVAL *eval);

#endif /* FUNCTIONSH */


text:
#ifndef __HITIMES_STATS_H__
#define __HITIMES_STATS_H__

#include <ruby.h>
#include <math.h>

/* classes and modules defined elswhere */
extern VALUE mH;        /* Hitimes */
extern VALUE eH_Error;  /* Hitimes::Error */
extern VALUE cH_Stats;  /* Hitimes::Stats */

typedef struct hitimes_stats {
    long double min;
    long double max;
    long double sum;
    long double sumsq;
    long long   count;
} hitimes_stats_t;

#endif


text:
from gratipay.wireup import db, env
from gratipay.models.team.mixins.tip_migration import migrate_all_tips

db = db(env())

if __name__ == '__main__':
    migrate_all_tips(db)


text:
class Main {
	private:
	QGuiApplication *app;
	QQuickView *view;

	public:
	Main(int &argc, char* argv[]) {
		app = SailfishApp::application(argc, argv);
		view = SailfishApp::createView();
		view->setSource(QUrl("qrc:///qml/Sailfish.qml"));
		QObject::connect(view->engine(), SIGNAL(quit()), app, SLOT(quit()));
	}
	Main() {}
	~Main() {}

	int Launch() {
		view->show();
		return app->exec();
	}
};

Q_DECL_EXPORT int main(int argc, char* argv[])
{
	qmlRegisterType<DBMeter>("harbour.saildbmeter.dbmeter", 1, 0, "DBMeter");
	Main *appli = new Main(argc, argv);
	return appli->Launch();
}


text:
package org.finos.waltz.model.change_set;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.finos.waltz.model.*;
import org.immutables.value.Value;

import java.time.LocalDateTime;
import java.util.Optional;

@Value.Immutable
@JsonSerialize(as = ImmutableChangeSet.class)
@JsonDeserialize(as = ImmutableChangeSet.class)
public abstract class ChangeSet implements
        IdProvider,
        EntityKindProvider,
        EntityLifecycleStatusProvider,
        NameProvider,
        DescriptionProvider,
        LastUpdatedProvider,
        ExternalIdProvider,
        ProvenanceProvider,
        WaltzEntity {

    public abstract Optional<EntityReference> parentEntity();

    public abstract Optional<LocalDateTime> plannedDate();

    @Value.Default
    public EntityKind kind() { return EntityKind.CHANGE_SET; }

    public EntityReference entityReference() {
        return ImmutableEntityReference.builder()
                .kind(EntityKind.CHANGE_SET)
                .id(id().get())
                .name(name())
                .description(description())
                .entityLifecycleStatus(entityLifecycleStatus())
                .build();
    }
}


text:
using NDatabase.Api;
using NDatabase.Tool.Wrappers;

namespace NDatabase.Core
{
    /// <summary>
    ///   The interface used to implement the classes that are called by the generic query executor when an object matches the query
    /// </summary>
    internal interface IMatchingObjectAction
    {
        /// <summary>
        ///   Called at the beginning of the query execution - used to prepare result object
        /// </summary>
        void Start();

        /// <summary>
        ///   Called (by the GenericQueryExecutor) when an object matches with lazy loading, only stores the OID
        /// </summary>
        void ObjectMatch(OID oid, IOdbComparable orderByKey);

        /// <summary>
        ///   Called (by the GenericQueryExecutor) when an object matches the query
        /// </summary>
        void ObjectMatch(OID oid, object @object, IOdbComparable orderByKey);

        /// <summary>
        ///   Called at the end of the query execution - used to clean or finish some task
        /// </summary>
        void End();

        /// <summary>
        ///   Returns the resulting objects
        /// </summary>
        IInternalObjectSet<T> GetObjects<T>();
    }
}


text:
[*back to contents*](https://github.com/gyuho/learn#contents)

# Python: class, object

- [Object Oriented Programming](#object-oriented-programming)
- [class](#class)

[↑ top](#python-class-object)

### Object Oriented Programming

*Steve Jobs* explains [here](http://www.edibleapple.com/2011/10/29/steve-jobs-explains-object-oriented-programming/):

> **_Objects_** are like people. They're living, breathing
> things that have knowledge inside them about
> **how to do things** and **have memory** inside them
> so they can remember things.

An object can contains:

- how the object does things - `method`
- memory to store things

[↑ top](#python-class-object)

#### class

```python
#!/usr/bin/python -u

class Mail:

    def __init__(self):
        self.html_list = []
        self.attachments = []

    def html(self, h):
        self.html_list.append(h)

    def attach(self, t):
        self.attachments.append(t)

    def h3(self, t):
        self.html("<h3>%s</h3>" % t)

    def p(self, t):
        self.html("<p>%s</p>" % t)

    def describe(self):
        print "To:", self.to
        print "Subject:", self.subject
        print "Body:", "\n".join([str(c) for c in self.html_list])
        print "Attach:", self.attachments

if __name__ == "__main__":
    m = Mail()
    m.to = "mail@mail.com"
    m.subject = "Hello"
    m.h3("Hello this is Python!")
    m.p("Thanks for your visit.")
    m.p("See you again!")
    m.attach("test.txt")

    m.describe()

    """
    To: mail@mail.com
    Subject: Hello
    Body: <h3>Hello this is Python!</h3>
    <p>Thanks for your visit.</p>
    <p>See you again!</p>
    Attach: ['test.txt']
    """

```

[↑ top](#python-class-object)


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using SdkCore;

namespace ChilliConnect
{
	/// <summary>
	/// <para>A container for all information that will be sent to the server during a
 	/// Log In Using Facebook api call.</para>
	///
	/// <para>This is immutable after construction and is therefore thread safe.</para>
	/// </summary>
	public sealed class LogInUsingFacebookRequest : IImmediateServerRequest
	{
		/// <summary>
		/// The url the request will be sent to.
		/// </summary>
		public string Url { get; private set; }

		/// <summary>
		/// The HTTP request method that should be used.
		/// </summary>
		public HttpRequestMethod HttpRequestMethod { get; private set; }

		/// <summary>
		/// The Game to log in to.
		/// </summary>
        public string GameToken { get; private set; }

		/// <summary>
		/// Access Token provided from the Facebook API.
		/// </summary>
        public string FacebookAccessToken { get; private set; }

		/// <summary>
		/// Initialises a new instance of the request with the given properties.
		/// </summary>
		///
		/// <param name="facebookAccessToken">Access Token provided from the Facebook API.</param>
		/// <param name="gameToken">The Game to log in to.</param>
		public LogInUsingFacebookRequest(string facebookAccessToken, string gameToken)
		{
			ReleaseAssert.IsNotNull(facebookAccessToken, "Facebook Access Token cannot be null.");

			ReleaseAssert.IsNotNull(gameToken, "Game Token cannot be null.");

            FacebookAccessToken = facebookAccessToken;
            GameToken = gameToken;

			Url = "https://connect.chilliconnect.com/1.0/player/login/facebook";
			HttpRequestMethod = HttpRequestMethod.Post;
		}

		/// <summary>
		/// Serialises all header properties. The output will be a dictionary containing
		/// the extra header key-value pairs in addition the standard headers sent with
		/// all server requests. Will return an empty dictionary if there are no headers.
		/// </summary>
		///
		/// <returns>The header key-value pairs.</returns>
		public IDictionary<string, string> SerialiseHeaders()
		{
			var dictionary = new Dictionary<string, string>();

			// Game Token
			dictionary.Add("Game-Token", GameToken.ToString());

			return dictionary;
		}

		/// <summary>
		/// Serialises all body properties. The output will be a dictionary containing the
		/// body of the request in a form that can easily be converted to Json. Will return
		/// an empty dictionary if there is no body.
		/// </summary>
		///
		/// <returns>The body Json in dictionary form.</returns>
		public IDictionary<string, object> SerialiseBody()
		{
            var dictionary = new Dictionary<string, object>();

			// Facebook Access Token
			dictionary.Add("FacebookAccessToken", FacebookAccessToken);

			return dictionary;
		}
	}
}


text:
require "pathname"
require "cucumber/core"
require "treetop"
require "ripper"
require "yajl"
require "erubis"

require_relative "foodcritic/chef"
require_relative "foodcritic/command_line"
require_relative "foodcritic/domain"
require_relative "foodcritic/error_checker"
require_relative "foodcritic/notifications"
require_relative "foodcritic/ast"
require_relative "foodcritic/xml"
require_relative "foodcritic/api"
require_relative "foodcritic/dsl"
require_relative "foodcritic/linter"
require_relative "foodcritic/output"
require_relative "foodcritic/rake_task"
require_relative "foodcritic/template"
require_relative "foodcritic/version"


text:
<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="YESButton" parent="Theme.AppCompat.Light">
        <item name="colorButtonNormal">@color/colorGreen</item>
    </style>

    <style name="NOButton" parent="Theme.AppCompat.Light">
        <item name="colorButtonNormal">@color/colorRed</item>
    </style>

    <!--<style name="MyButton" parent="Theme.AppCompat.Light">-->
        <!--<item name="colorControlHighlight">#00ff00</item>-->
        <!--<item name="colorButtonNormal">#0000ff</item>-->
    <!--</style>-->

</resources>