text:
namespace scv {

const int MenuBar::s_menuHeight   = 22;
const int MenuBar::s_menuSpacing  = 18;
const int MenuBar::s_borderWidth  = 8;
const int MenuBar::s_borderHeight = 5;

MenuBar::MenuBar(int width) : Panel(Point(0, 0), Point(width, s_menuHeight)) {
   _isVResizable = false;
   _active = false;
   _index.push_back(s_borderWidth);
   _currSelectedMenu = -1;
   _currecOverMenu = -1;
   _type = MENUBAR;

   setMinimumSize(Point(15, s_menuHeight));
   setMaximumSize(Point(-1, s_menuHeight));

   createTexture();
}

int MenuBar::getNumberOfMenus() {
   return _menus.size();
}

void MenuBar::processMouse(const scv::MouseEvent &evt) {
   static Kernel *kernel = Kernel::getInstance();
   static MenuHolder *menu = MenuHolder::getInstance();

   Panel::processMouse(evt);

   if(!getCallbacksStatus() || isResizing()) return;

   Point currPosition = getAbsolutePosition();
   Point relativeMouse = evt.getPosition();

   // open menu
   if (isInside(evt.getPosition())) {
      if (kernel->requestMouseUse(this)) {
         if (isFocused()) {
            if (evt.getState() == MouseEvent::CLICK && evt.getButton() == MouseEvent::LEFT) {
               for (int i = 0; i < _menus.size(); i++) {
                  if (relativeMouse.x > _index[i] + currPosition.x && relativeMouse.x < _index[i+1] + currPosition.x
                        && relativeMouse.y > s_borderHeight/2-1 + currPosition.y && relativeMouse.y < currPosition.y + getHeight() - 2) {
                     menu->closeAllMenus();
                     _active = !_active;
                     _menus[i]->setStatus(!_menus[i]->getStatus());
                     if (_active) {
                        _currSelectedMenu = i;
                        return;
                     } else {
                        _currSelectedMenu = -1;
                        menu->closeAllMenus();
                        _active = false;
                        return;
                     }
                  }
               }
            }
         }

         // select menu ifActive
         if (_active) {
            for (int i = 0; i < _menus.size(); i++) {
               if (relativeMouse.x > _index[i] + currPosition.x && relativeMouse.x < _index[i+1] + currPosition.x
                     && relativeMouse.y > s_borderHeight/2-1 + currPosition.y && relativeMouse.y < currPosition.y + getHeight() - 2) {
                  menu->closeAllMenus();
                  _currSelectedMenu = i;
                  _menus[i]->setStatus(true);
                  break;
               }
            }
         }

         // over menu
         _currecOverMenu = -1;
         for (int i = 0; i < _menus.size(); i++) {
            if (relativeMouse.x > _index[i] + currPosition.x && relativeMouse.x < _index[i+1] + currPosition.x
                  && relativeMouse.y > s_borderHeight/2-1 + currPosition.y && relativeMouse.y < currPosition.y + getHeight() - 2) {
               _currecOverMenu = i;
               break;
            }
         }
      }
   } else {
      _currecOverMenu = -1;
   }

   for (int i = 0; i < _menus.size() ; i++) {
   	if (_menus[i]->getStatus()) return;
   }
   _active = false;
   _currSelectedMenu = -1;
}

void MenuBar::processKey(const scv::KeyEvent &evt) {
   static MenuHolder *menu = MenuHolder::getInstance();

   Panel::processKey(evt);

   if(!getCallbacksStatus() || isResizing()) return;

   if (evt.state == KeyEvent::UP || _currSelectedMenu == -1) return;

   ContextMenu * cMenu = _menus[_currSelectedMenu];

   while (cMenu->hasSubMenuActive())
      cMenu = cMenu->_list[cMenu->_currSelectedMenu];

   if (evt.getKeyString() == "Left" && !cMenu->_recentlyChange) {
      if (_currSelectedMenu == 0) _currSelectedMenu = _menus.size() - 1;
      else _currSelectedMenu--;
      menu->closeAllMenus();
      _menus[_currSelectedMenu]->setStatus(true);
      _menus[_currSelectedMenu]->_currSelectedMenu = 0;
   } else if (evt.getKeyString() == "Right" && ((cMenu->_currSelectedMenu != -1 && !cMenu->_list[cMenu->_currSelectedMenu]->hasSubMenus() && !cMenu->_recentlyChange) ||
         cMenu->_currSelectedMenu == -1)) {
      _currSelectedMenu = (_currSelectedMenu + 1) % _menus.size();
      menu->closeAllMenus();
      _menus[_currSelectedMenu]->setStatus(true);
      _menus[_currSelectedMenu]->_currSelectedMenu = 0;
   }
}

void MenuBar::display(void) {
   static Kernel *kernel = Kernel::getInstance();
   static Scissor *scissor = Scissor::getInstance();
   static FontTahoma *font = FontTahoma::getInstance();
   static ColorScheme *scheme = ColorScheme::getInstance();

   if (_cTexture == NULL || _isVisible == false) return;

   Point currPosition = getAbsolutePosition();

   Scissor::Info scissorInfo(currPosition.x, kernel->getHeight() - (getHeight() + currPosition.y), getWidth(), getHeight());
   scissor->pushScissor(scissorInfo);

   _cTexture->enable();

   // background
   scheme->applyColor(ColorScheme::MENUBAR);
   _cTexture->display(currPosition.x, currPosition.y , 0, getWidth(), getHeight());

   // line bottom
   glColor3f(0.f,0.f,0.f);
   _cTexture->display(currPosition.x, currPosition.y + getHeight() - 1, 4, getWidth(), 1);

   if (_currecOverMenu != -1 && _currSelectedMenu == -1) {

      int size = _index[_currecOverMenu+1]-_index[_currecOverMenu];

      scheme->applyColor(ColorScheme::OVERCOMPONENTS);

      //vertical
      _cTexture->display(currPosition.x + _index[_currecOverMenu] + size - 1, currPosition.y + s_borderHeight/2 + 2, 2, 1, s_menuSpacing - 4);
      _cTexture->display(currPosition.x + _index[_currecOverMenu]           , currPosition.y + s_borderHeight/2 + 2, 2, 1, s_menuSpacing - 4);
      //horizontal
      _cTexture->display(currPosition.x + _index[_currecOverMenu] + 2       , currPosition.y + s_borderHeight/2, 2, size - 4, 1);
      _cTexture->display(currPosition.x + _index[_currecOverMenu] + 2       , currPosition.y + s_menuHeight - 3, 2, size - 4, 1);

      // pixel border
      _cTexture->display(currPosition.x + _index[_currecOverMenu]           , currPosition.y + s_borderHeight / 2       , 3, 2, 2);
      _cTexture->display(currPosition.x + _index[_currecOverMenu]           , currPosition.y + s_menuHeight -2        , 3, 2, -2);
      _cTexture->display(currPosition.x + _index[_currecOverMenu] + size    , currPosition.y + s_borderHeight / 2, 3,-2,  2);
      _cTexture->display(currPosition.x + _index[_currecOverMenu] + size    , currPosition.y + s_menuHeight - 2, 3,-2, -2);

      // center select
      _cTexture->display(currPosition.x + _index[_currecOverMenu] + 2       , currPosition.y + s_borderHeight/2 + 2, 1, size - 4, s_menuSpacing - 4);
      scheme->applyDefaultModulate();
   } else if (_currSelectedMenu != -1) {
      int size = _index[_currSelectedMenu + 1] - _index[_currSelectedMenu];

      scheme->applyColor(ColorScheme::CONTEXTMENU);

      _cTexture->display(currPosition.x + _index[_currSelectedMenu] + 2, currPosition.y + s_borderHeight/2, 4, size - 4, 1);
      _cTexture->display(currPosition.x + _index[_currSelectedMenu] + 1, currPosition.y + s_borderHeight/2 + 1, 4, size - 2, 1);
      _cTexture->display(currPosition.x + _index[_currSelectedMenu]    , currPosition.y + s_borderHeight/2 + 2, 4, size, s_menuSpacing);

      scheme->applyDefaultModulate();
   }

   _cTexture->disable();

   for (int i = 0; i < _menus.size(); i++) {
      if (i == _currSelectedMenu) {
         StaticLabel::display(currPosition.x + s_borderWidth + _index[i], currPosition.y + s_borderHeight, _menus[i]->_label, scheme->getColor(ColorScheme::CONTEXTMENUFONT));
      } else {
         StaticLabel::display(currPosition.x + s_borderWidth + _index[i], currPosition.y + s_borderHeight, _menus[i]->_label);
      }
      _menus[i]->setPosition(Point(currPosition.x + _index[i], currPosition.y + getHeight() + 1));
      _menus[i]->display();
   }

   scissor->popScissor();
}

void MenuBar::createTexture(void) {
   Kernel *kernel = Kernel::getInstance();
   if ((_cTexture = kernel->getWidgetTexture(MENUBAR)) != NULL) return;

   _cTexture = new ComponentTexture(5, 2);
   kernel->setWidgetTexture(MENUBAR, _cTexture);

   _cTexture->setTextureEnvMode(GL_MODULATE);

   // background
   MatrixTemplate<ColorRGBA> middle(1, 1, ColorRGBA(200,200,200,255));
   _cTexture->addTexture(Point(0,0), middle); // 0

   // over
   MatrixTemplate<ColorRGBA> overCenter(1,1, ColorRGBA(240,240,240,50));
   _cTexture->addTexture(Point(1,0), overCenter); // 1

   MatrixTemplate<ColorRGBA> overBorder(1,1, ColorRGBA(210,210,210,150));
   _cTexture->addTexture(Point(0,1), overBorder); // 2

   MatrixTemplate<ColorRGBA> pixelBorder(2,2, ColorRGBA(220,220,220,100));
   Texture2D::drawPoint(pixelBorder, Point(0, 0),ColorRGBA(0,0,0,0));
   _cTexture->addTexture(Point(2,0), pixelBorder); // 3

   // selected
   MatrixTemplate<ColorRGBA> selected(1,1, ColorRGBA(240,240,240,255));
   _cTexture->addTexture(Point(4,0), selected); // 4

   _cTexture->createTexture();
}

void MenuBar::addMenu(ContextMenu *menu) {
   static FontTahoma *font = FontTahoma::getInstance();
   static MenuHolder *menuH = MenuHolder::getInstance();
   menuH->registerMenu(menu);

   int position = (_index.back() + (s_borderWidth * 2) + font->getStringLength(menu->getString()));
   _index.push_back(position);
   _menus.push_back(menu);
}

} // namespace scv


text:
*Note: These issues are for bugs and feature requests for the helper libraries.
If you need help or support, please email help@twilio.com and one of our experts
will assist you!*

**Version:**

### Code Snippet
```ruby
# paste code here
```

### Exception/Log
```
<place exception/log here>
```

### Steps to Reproduce
1.
2.
3.

### Feature Request
_If this is a feature request, make sure you search Issues for an existing
request before creating a new one!_

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace Azure.Search.Documents.Indexes.Models
{
    /// <summary> A filter that stems words using a Snowball-generated stemmer. This token filter is implemented using Apache Lucene. </summary>
    public partial class SnowballTokenFilter : TokenFilter
    {
        /// <summary> Initializes a new instance of SnowballTokenFilter. </summary>
        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. </param>
        /// <param name="language"> The language to use. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
        public SnowballTokenFilter(string name, SnowballTokenFilterLanguage language) : base(name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            Language = language;
            ODataType = "#Microsoft.Azure.Search.SnowballTokenFilter";
        }

        /// <summary> Initializes a new instance of SnowballTokenFilter. </summary>
        /// <param name="oDataType"> Identifies the concrete type of the token filter. </param>
        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. </param>
        /// <param name="language"> The language to use. </param>
        internal SnowballTokenFilter(string oDataType, string name, SnowballTokenFilterLanguage language) : base(oDataType, name)
        {
            Language = language;
            ODataType = oDataType ?? "#Microsoft.Azure.Search.SnowballTokenFilter";
        }

        /// <summary> The language to use. </summary>
        public SnowballTokenFilterLanguage Language { get; set; }
    }
}


text:
<?php

namespace Mleczek\CBuilder\Dependency;

use Mleczek\CBuilder\Dependency\Entities\Factory;
use Mleczek\CBuilder\Package\Package;
use Mleczek\CBuilder\Package\Remote;
use Mleczek\CBuilder\Repository\Collection;
use Mleczek\CBuilder\Repository\Exceptions\PackageNotFoundException;
use Mleczek\CBuilder\Repository\Factory as RepositoriesFactory;
use Mleczek\CBuilder\Dependency\Entities\Factory as TreeNodeFactory;

/**
 * Resolve dependencies tree from cbuilder.json file
 * (include nested dependencies with loops detection).
 *
 * Repositories defined in the cbuilder.json file are skipped for the dependencies.
 * This prevents packages names conflicts, realize the situation when A has 2 dependencies:
 * B and C, the B also has the C dependency (but due to the specific repositories definition
 * the C package is resolved from the other repository).
 *
 * There are 2 major use cases of the repositories:
 * - to register private repository shared between all company packages,
 * - and to improve development process experience.
 */
class Resolver
{
    /**
     * Dependencies tree.
     *
     * @var object[] Each object contains remote, constraints and dependencies key.
     */
    private $tree = [];

    /**
     * Dependencies list.
     *
     * @var object[] Package name (key) with object (value) containing remote and constraints key.
     */
    private $list = [];

    /**
     * @var RepositoriesFactory
     */
    private $repositoriesFactory;

    /**
     * @var TreeNodeFactory
     */
    private $treeNodeFactory;

    /**
     * Repositories for the latest resolved package.
     *
     * @var Collection
     */
    private $repositories;

    /**
     * Resolver constructor.
     *
     * @param RepositoriesFactory $repositoriesFactory
     * @param TreeNodeFactory $treeNodeFactory
     */
    public function __construct(RepositoriesFactory $repositoriesFactory, TreeNodeFactory $treeNodeFactory)
    {
        $this->repositoriesFactory = $repositoriesFactory;
        $this->treeNodeFactory = $treeNodeFactory;
    }

    /**
     * Get dependencies tree.
     *
     * @return object[] Each object contains remote, constraints and dependencies key.
     */
    public function getTree()
    {
        return $this->tree;
    }

    /**
     * Get dependencies list.
     *
     * @return object[] Each object contains remote and constraints key.
     */
    public function getList()
    {
        return $this->list;
    }

    /**
     * @param Package $package
     * @return $this
     * @throws PackageNotFoundException
     */
    public function resolve(Package $package)
    {
        // Get repositories only for this package
        // in which dependencies will be searched.
        $plainRepositories = $package->getRepositories();
        $this->repositories = $this->repositoriesFactory->hydrate($plainRepositories);

        // For root package always get all
        // dependencies including dev ones.
        $dependencies = array_merge(
            $package->getDependencies(),
            $package->getDevDependencies()
        );

        // Register each dependency in tree and list.
        foreach ($dependencies as $dependency) {
            $remote = $this->repositories->find($dependency->name);

            $this->registerTree($remote, $dependency->version);
            $this->registerList($remote, $dependency->version);
        }

        return $this;
    }

    /**
     * @param Remote $dependency
     * @param string $constraint
     * @see $list
     */
    private function registerList(Remote $dependency, $constraint)
    {
        $packageName = $dependency->getPackage()->getName();

        // Initialize new dependency in the list.
        if (!isset($this->list[$packageName])) {
            $this->list[$packageName] = (object)[
                'remote' => $dependency,
                'constraints' => [],
            ];
        }

        // Add new constraints.
        $entry = $this->list[$packageName];
        $entry->constraints[] = $constraint;

        // Register nested dependencies.
        $dependencies = $dependency->getPackage()->getDependencies();
        foreach ($dependencies as $dependency) {
            $remote = $this->repositories->find($dependency->name);

            $this->registerList($remote, $dependency->version);
        }
    }

    /**
     * @param Remote $dependency
     * @param string $constraint
     * @see $tree
     */
    private function registerTree(Remote $dependency, $constraint)
    {
        $this->tree[] = $this->treeNodeFactory->makeTreeNode($this->repositories, null, $dependency, $constraint);
    }
}


text:
<?php
class Client extends DataObject {

	static $db = array(
	   'ClientNumber' => 'Int',
	   'FirstName' => 'Text',
	   'LastName' => 'Text',
	   'Birthday' => 'Date',
	);

	static $has_one = array(
	   'ClientCategory' => 'ClientCategory'
	);

}
?>


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.DocAsCode.Plugins
{
    public interface ISubCommandController
    {
        bool TryGetCommandCreator(string name, out ISubCommandCreator creator);
        string GetHelpText();
    }
}


text:
require 'spec_helper'

describe Komagire::ActiveRecordExtension do
  create_temp_table :tags do |t|
    t.string :name
  end

  class Tag < ActiveRecord::Base
  end

  describe '#composed_of_komagire_key_list' do
    create_temp_table :post_names do |t|
      t.string :tag_names
    end

    class PostName < ActiveRecord::Base
      composed_of_komagire_key_list :tags, :tag_names, 'Tag', :name, komagire: {delimiter: '|', sort: true}
    end

    let!(:ruby) { Tag.create(id: 1, name: 'ruby') }
    let!(:perl) { Tag.create(id: 2, name: 'perl') }
    let!(:java) { Tag.create(id: 3, name: 'java') }

    let(:post) { PostName.new }

    it 'should be empty without query' do
      expect(Tag).not_to receive(:where)

      post.tags = ''
      expect(post.tag_names).to eq '|'
      post.save!
      expect(post.tag_names).to eq '|'
    end

    it 'should ignore not exist key' do
      post.tags = 'python|perl'
      expect(post.tag_names).to eq '|perl|'
      post.save!
      expect(post.tag_names).to eq '|perl|'
    end

    it 'should ignore duplicate key' do
      post.tags = 'ruby|perl|ruby'
      expect(post.tag_names).to eq '|perl|ruby|'
      post.save!
      expect(post.tag_names).to eq '|perl|ruby|'
    end

    it 'should convert from string' do
      post.tags = 'ruby|perl|java'
      expect(post.tag_names).to eq '|java|perl|ruby|'
      post.save!
      expect(post.tag_names).to eq '|java|perl|ruby|'
    end

    it 'should convert from Komagire::KeyList' do
      list = Komagire::KeyList.new('Tag', :name, 'ruby|java', delimiter: '|', sort: true)
      post.tags = list
      expect(post.tag_names).to eq '|java|ruby|'
      post.save!
      expect(post.tag_names).to eq '|java|ruby|'
    end

    it 'should convert from Array of String' do
      post.tags = ['java', 'perl']
      expect(post.tag_names).to eq '|java|perl|'
      post.save!
      expect(post.tag_names).to eq '|java|perl|'
    end

    it 'should convert from Array of Tag' do
      post.tags = [ruby, perl]
      expect(post.tag_names).to eq '|perl|ruby|'
      post.save!
      expect(post.tag_names).to eq '|perl|ruby|'
    end

    it 'should convert from ActiveRecord::Relation' do
      post.tags = Tag.where(id: [1])
      expect(post.tag_names).to eq '|ruby|'
      post.save!
      expect(post.tag_names).to eq '|ruby|'
    end

    context 'not sorted' do
      class PostNameNotSorted < ActiveRecord::Base
        def self.table_name; 'post_names'; end
        composed_of_komagire_key_list :tags, :tag_names, 'Tag', :name, komagire: {delimiter: '|', sort: false}
      end

      let(:not_sorted_post) { PostNameNotSorted.new }

      it 'should convert from Array of String' do
        not_sorted_post.tags = ['ruby', 'java']
        expect(not_sorted_post.tag_names).to eq '|ruby|java|'
        not_sorted_post.save!
        expect(not_sorted_post.tag_names).to eq '|ruby|java|'
      end
    end
  end

  describe '#composed_of_komagire_id_list' do
    create_temp_table :post_ids do |t|
      t.string :tag_ids
    end

    class PostId < ActiveRecord::Base
      composed_of_komagire_id_list :tags, :tag_ids, 'Tag', komagire: {sort: true}
    end

    let!(:ruby) { Tag.create(id: 1, name: 'ruby') }
    let!(:perl) { Tag.create(id: 2, name: 'perl') }
    let!(:java) { Tag.create(id: 3, name: 'java') }

    let(:post) { PostId.new }

    it 'should be empty without query' do
      expect(Tag).not_to receive(:where)

      post.tags = ''
      expect(post.tag_ids).to eq ','
      post.save!
      expect(post.tag_ids).to eq ','
    end

    it 'should ignore not exist id' do
      post.tags = '100,1'
      expect(post.tag_ids).to eq ',1,'
      post.save!
      expect(post.tag_ids).to eq ',1,'
    end

    it 'should ignore duplicate id' do
      post.tags = '1,2,1'
      expect(post.tag_ids).to eq ',1,2,'
      post.save!
      expect(post.tag_ids).to eq ',1,2,'
    end

    it 'should convert from string' do
      post.tags = '1,2,3'
      expect(post.tag_ids).to eq ',1,2,3,'
      post.save!
      expect(post.tag_ids).to eq ',1,2,3,'
    end

    it 'should convert from Komagire::IdList' do
      list = Komagire::IdList.new('Tag', '1,3', delimiter: ',', sort: true)
      post.tags = list
      expect(post.tag_ids).to eq ',1,3,'
      post.save!
      expect(post.tag_ids).to eq ',1,3,'
    end

    it 'should convert from Array of String' do
      post.tags = ['3', '2']
      expect(post.tag_ids).to eq ',2,3,'
      post.save!
      expect(post.tag_ids).to eq ',2,3,'
    end

    it 'should convert from Array of Integer' do
      post.tags = [3, 2]
      expect(post.tag_ids).to eq ',2,3,'
      post.save!
      expect(post.tag_ids).to eq ',2,3,'
    end

    it 'should convert from Array of Tag' do
      post.tags = [ruby, perl]
      expect(post.tag_ids).to eq ',1,2,'
      post.save!
      expect(post.tag_ids).to eq ',1,2,'
    end

    it 'should convert from ActiveRecord::Relation' do
      post.tags = Tag.where(id: [1])
      expect(post.tag_ids).to eq ',1,'
      post.save!
      expect(post.tag_ids).to eq ',1,'
    end
  end

  describe '#composed_of_komagire_id_list with ActiveHash' do
    context "when Id type is integer" do
      class AhTag < ActiveHash::Base
        self.data = [
          {id: 1, name: 'ruby'},
          {id: 2, name: 'perl'},
          {id: 3, name: 'java'},
        ]
      end

      create_temp_table :post_ahs do |t|
        t.string :tag_ids
      end

      class PostAh < ActiveRecord::Base
        composed_of_komagire_id_list :tags, :tag_ids, 'AhTag', komagire: {delimiter: ':', sort: true}
      end

      let(:post) { PostAh.new }

      it 'should be empty' do
        post.tags = ''
        expect(post.tag_ids).to eq ':'
        post.save!
        expect(post.tag_ids).to eq ':'
      end

      it 'should ignore not exist id ' do
        post.tags = '100:1'
        expect(post.tag_ids).to eq ':1:'
        post.save!
        expect(post.tag_ids).to eq ':1:'
      end

      it 'should ignore duplicate id' do
        post.tags = '1:2:1'
        expect(post.tag_ids).to eq ':1:2:'
        post.save!
        expect(post.tag_ids).to eq ':1:2:'
      end

      it 'should convert from string' do
        post.tags = '1:2:3'
        expect(post.tag_ids).to eq ':1:2:3:'
        post.save!
        expect(post.tag_ids).to eq ':1:2:3:'
      end

      it 'should convert from Komagire::IdList' do
        list = Komagire::IdList.new('AhTag', '1:3', delimiter: ':', sort: true)
        post.tags = list
        expect(post.tag_ids).to eq ':1:3:'
        post.save!
        expect(post.tag_ids).to eq ':1:3:'
      end

      it 'should convert from Array of String' do
        post.tags = ['3', '2']
        expect(post.tag_ids).to eq ':2:3:'
        post.save!
        expect(post.tag_ids).to eq ':2:3:'
      end

      it 'should convert from Array of Integer' do
        post.tags = [3, 2]
        expect(post.tag_ids).to eq ':2:3:'
        post.save!
        expect(post.tag_ids).to eq ':2:3:'
      end

      it 'should convert from Array of Tag' do
        post.tags = [AhTag.find(1)]
        expect(post.tag_ids).to eq ':1:'
        post.save!
        expect(post.tag_ids).to eq ':1:'
      end
    end

    context 'when Id type is string' do
      class ProductType < ActiveHash::Base
        include ActiveHash::Enum
        self.data = [
          {id: 'bacon', name: 'Bacon'},
          {id: 'lettuce', name: 'Lettuce'},
          {id: 'tomato', name: 'Tomato'},
        ]
        enum_accessor :id
      end

      create_temp_table :products do |t|
        t.string :product_type_ids
      end

      class Product < ActiveRecord::Base
        composed_of_komagire_id_list :product_types, :product_type_ids, 'ProductType', komagire: {sort: true}
      end

      let(:product) { Product.new }

      it 'should be ignore not exist key' do
        product.product_types = "peamon"
        expect(product.product_type_ids).to eq ','
        product.save!
        expect(product.product_type_ids).to eq ','
      end

      it 'should be convertible from string' do
        product.product_types = "bacon,tomato"
        expect(product.product_type_ids).to eq ',bacon,tomato,'
        product.save!
        expect(product.product_type_ids).to eq ',bacon,tomato,'
      end

      it 'should be convertible from Array of Strings' do
        product.product_types = ['bacon', 'tomato']
        expect(product.product_type_ids).to eq ',bacon,tomato,'
        product.save!
        expect(product.product_type_ids).to eq ',bacon,tomato,'
      end

      it 'should be convertible from Array of ProductType' do
        product.product_types = [ProductType::BACON, ProductType::TOMATO]
        expect(product.product_type_ids).to eq ',bacon,tomato,'
        product.save!
        expect(product.product_type_ids).to eq ',bacon,tomato,'
      end
    end
  end
end


text:
@interface TLYDelegateProxy ()

@property (nonatomic, weak) id middleMan;

@end

@implementation TLYDelegateProxy

- (instancetype)initWithMiddleMan:(id)middleMan
{
    if (self)
    {
        self.middleMan = middleMan;
    }
    return self;
}

- (id)forwardingTargetForSelector:(SEL)sel
{
    BOOL originalDelegateResponds = [self.originalDelegate respondsToSelector:sel];
    BOOL middleManResponds = [self.middleMan respondsToSelector:sel];
    if (originalDelegateResponds && !middleManResponds) {
        return self.originalDelegate;
    } else if (!originalDelegateResponds && middleManResponds) {
        return self.middleMan;
    } else {
        // continue with "slow" forwarding
        return self;
    }
}

- (NSInvocation *)_copyInvocation:(NSInvocation *)invocation
{
    NSInvocation *copy = [NSInvocation invocationWithMethodSignature:[invocation methodSignature]];
    NSUInteger argCount = [[invocation methodSignature] numberOfArguments];

    for (int i = 0; i < argCount; i++)
    {
        char buffer[sizeof(intmax_t)];
        [invocation getArgument:(void *)&buffer atIndex:i];
        [copy setArgument:(void *)&buffer atIndex:i];
    }

    return copy;
}

- (void)forwardInvocation:(NSInvocation *)invocation
{
    if ([self.middleMan respondsToSelector:invocation.selector])
    {
        NSInvocation *invocationCopy = [self _copyInvocation:invocation];
        [invocationCopy invokeWithTarget:self.middleMan];
    }

    if ([self.originalDelegate respondsToSelector:invocation.selector])
    {
        [invocation invokeWithTarget:self.originalDelegate];
    }
}

- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel
{
    id result = [self.originalDelegate methodSignatureForSelector:sel];
    if (!result) {
        result = [self.middleMan methodSignatureForSelector:sel];
    }

    return result;
}

- (BOOL)respondsToSelector:(SEL)aSelector
{
    return ([self.originalDelegate respondsToSelector:aSelector]
            || [self.middleMan respondsToSelector:aSelector]);
}

@end


text:
package miniconf.server

import akka.actor.{ActorRef, ActorSystem}

/**
 * Created by wenzhi.bwz on 14-7-18.
 */
object MainApp {
  def main(args : Array[String]) : Unit = {
    start()
  }

  def start() {
    try {
      val system = ActorSystem("miniconf-system")
      val miniconfConf = system.settings.config.getConfig("miniconf")
      val interface: String = miniconfConf.getString("httpService.interface")
      val port: Int = miniconfConf.getInt("httpService.port")

      system.actorOf(MainHttpService.props(interface, port), "mainHttpService")
    } catch {
      case e:Throwable => e.printStackTrace()
    }
  }
}


text:
<?php

namespace PhpHungary\MainBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class DefaultController extends Controller
{
    /**
     * @Route("/", name="main_home")
     * @Template
     */
    public function indexAction()
    {
        return array();
    }

    /**
     * @Route("/about", name="main_about")
     * @Template
     */
    public function aboutAction()
    {
        return array();
    }

    /**
     * @Route("/leadership", name="main_leadership")
     * @Template
     */
    public function leadershipAction()
    {
        return array();
    }

    /**
     * @Route("/contact", name="main_contact")
     * @Template
     */
    public function contactAction()
    {
        return array();
    }

    /**
     * @Route("/search", name="main_search")
     * @Template
     */
    public function searchAction()
    {
        return array('search_string' => 'asd');
    }

}


text:
<?php
get_header();
global $mk_options;
$page_layout = !empty($mk_options['notfound_layout']) ? $mk_options['notfound_layout'] : 'full';

 ?>

		<div class="theme-page-wrapper <?php echo $page_layout; ?>-layout  mk-grid row-fluid">

					<?php _e('WHOOPS!', 'mk_framework'); ?>
					<?php _e('404', 'mk_framework'); ?>

<?php _e('It looks like you are lost! Try searching here', 'mk_framework'); ?>

					<form class="mk-searchform" method="get" id="searchform" action="<?php echo home_url(); ?>">
					<input type="text" class="text-input" placeholder="<?php _e('Search site', 'mk_framework'); ?>" value="" name="s" id="s" />
					<input value="" type="submit" class="search-button" type="submit" />
					</form>

			<?php if ( $page_layout != 'full' ) get_sidebar(); ?>

<?php get_footer(); ?>


text:
import mjml2html = require('mjml');

const simple_test = mjml2html("<mjml>");
const html = simple_test.html;
const errors = simple_test.errors;
let formattedMessage = errors[0].formattedMessage;
formattedMessage = "force string test";

const minimal_opts_test = mjml2html("<mjml>", {beautify: true});
const validation_level_test = mjml2html("<mjml>", {validationLevel: "strict"});
const filePath_test = mjml2html("<mjml>", {filePath: "."});


text:
module Main where

-- import HEP.Parser.StdHep.StdHep.Internal
import HEP.Parser.StdHep

import Control.Applicative
import Data.IORef
import Foreign.Storable

import HEP.Util.Functions
import Data.Maybe

import HROOT

main :: IO ()
main = do
  tcanvas <- newTCanvas "Test" "Test" 640 480
  h2 <- newTH2F "test" "test" 100 (-2.0) 2.0 100 (-pi) pi

  mcfioInit
  r <- stdHepXdrReadOpen "testevents.hep" 500 0
  lbl <- newIORef (0 :: Int)
  r <- stdHepXdrRead lbl 0
  stdHepXdrRead lbl 0
  stdHepXdrRead lbl 0
  h <- getHEPEVT
  -- print (nevhep h, nhep h, map ((,) <$> fst <*> idhep.snd) (particles h))

  histfill h2

  draw h2 "lego"

  saveAs tcanvas "testtest.pdf" ""

  print r

getFinalStatePtEtaPhi ::  (Int,HEPEVT_Particle) -> Maybe (Double,Double,Double)
getFinalStatePtEtaPhi (_,p) =
  if isthep p == 1
    then let (p1,p2,p3,p0,_)  = phep p
             (pt,eta,phi) = mom_2_pt_eta_phi (p0,p1,p2,p3)
         in  Just (pt,eta,phi)
    else Nothing

histfill :: TH2F -> IO ()
histfill hist = do
  ev <- getHEPEVT
  --   mapM_ (fill1 hist . abs . fromIntegral . idhep . snd) (particles ev)
  let ptetaphilst = mapMaybe getFinalStatePtEtaPhi (particles ev)
  mapM_ (\x->fill2w hist (snd3 x) (trd3 x) (fst3 x)) ptetaphilst


text:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ThriftS.Service
{
    /// <summary>
    /// ThriftS配置节
    /// </summary>
    internal class HostConfigurationSetion : ConfigurationSection
    {
        /// <summary>
        /// 默认Host
        /// </summary>
        [ConfigurationProperty("defaultHost")]
        public string DefaultHost
        {
            get { return (string)this["defaultHost"]; }
            set { this["defaultHost"] = value; }
        }

        /// <summary>
        /// 日志级别
        /// </summary>
        [ConfigurationProperty("logLevel")]
        public string LogLevel
        {
            get { return (string)this["logLevel"]; }
            set { this["logLevel"] = value; }
        }

        /// <summary>
        /// Hosts
        /// </summary>
        [ConfigurationProperty("hosts")]
        public HostConfigurationElements Hosts
        {
            get { return (HostConfigurationElements)this["hosts"]; }
            set { this["hosts"] = value; }
        }
    }
}


text:
external help file: DSCPullServerAdmin-help.xml
Module Name: DSCPullServerAdmin
online version:
schema: 2.0.0
---

# Remove-DSCPullServerAdminRegistration

## SYNOPSIS
Removes node registration entries (LCMv2) from a Pull Server Database.

## SYNTAX

### InputObject_Connection (Default)
```
Remove-DSCPullServerAdminRegistration -InputObject <DSCNodeRegistration>
 [-Connection <DSCPullServerConnection>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### InputObject_MDB
```
Remove-DSCPullServerAdminRegistration -InputObject <DSCNodeRegistration> -MDBFilePath <FileInfo> [-WhatIf]
 [-Confirm] [<CommonParameters>]
```

### InputObject_ESE
```
Remove-DSCPullServerAdminRegistration -InputObject <DSCNodeRegistration> -ESEFilePath <FileInfo> [-WhatIf]
 [-Confirm] [<CommonParameters>]
```

### InputObject_SQL
```
Remove-DSCPullServerAdminRegistration -InputObject <DSCNodeRegistration> -SQLServer <String>
 [-Credential <PSCredential>] [-Database <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### Manual_MDB
```
Remove-DSCPullServerAdminRegistration -AgentId <Guid> -MDBFilePath <FileInfo> [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

### Manual_ESE
```
Remove-DSCPullServerAdminRegistration -AgentId <Guid> -ESEFilePath <FileInfo> [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

### Manual_SQL
```
Remove-DSCPullServerAdminRegistration -AgentId <Guid> -SQLServer <String> [-Credential <PSCredential>]
 [-Database <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### Manual_Connection
```
Remove-DSCPullServerAdminRegistration -AgentId <Guid> [-Connection <DSCPullServerConnection>] [-WhatIf]
 [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
LCMv2 (WMF5+ / PowerShell 5+) pull clients send information
to the Pull Server which stores their data in the registrationdata table.
This function will remove node registrations from the registrationdata table.

## EXAMPLES

### EXAMPLE 1
```
Remove-DSCPullServerAdminRegistration -AgentId '80ee20f9-78df-480d-8175-9dd6cb09607a'
```

### EXAMPLE 2
```
Get-DSCPullServerAdminRegistration -TargetName '80ee20f9-78df-480d-8175-9dd6cb09607a' | Remove-DSCPullServerAdminRegistration
```

## PARAMETERS

### -InputObject
Pass in the registration object to be removed from the database.

```yaml
Type: DSCNodeRegistration
Parameter Sets: InputObject_Connection, InputObject_MDB, InputObject_ESE, InputObject_SQL
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -AgentId
Define the AgentId of the registration to be removed from the database.

```yaml
Type: Guid
Parameter Sets: Manual_MDB, Manual_ESE, Manual_SQL, Manual_Connection
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Connection
Accepts a specific Connection to be passed to target a specific database.
When not specified, the currently Active Connection from memory will be used
unless one off the parameters for ad-hoc connections (ESEFilePath, SQLServer)
is used in which case, an ad-hoc connection is created.

```yaml
Type: DSCPullServerConnection
Parameter Sets: InputObject_Connection, Manual_Connection
Aliases:

Required: False
Position: Named
Default value: (Get-DSCPullServerAdminConnection -OnlyShowActive)
Accept pipeline input: False
Accept wildcard characters: False
```

### -ESEFilePath
Define the EDB file path to use an ad-hoc ESE connection.

```yaml
Type: FileInfo
Parameter Sets: InputObject_ESE, Manual_ESE
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -MDBFilePath
Define the MDB file path to use an ad-hoc MDB connection.

```yaml
Type: FileInfo
Parameter Sets: InputObject_MDB, Manual_MDB
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -SQLServer
Define the SQL Instance to use in an ad-hoc SQL connection.

```yaml
Type: String
Parameter Sets: InputObject_SQL, Manual_SQL
Aliases: SQLInstance

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Credential
Define the Credentials to use with an ad-hoc SQL connection.

```yaml
Type: PSCredential
Parameter Sets: InputObject_SQL, Manual_SQL
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Database
Define the database to use with an ad-hoc SQL connection.

```yaml
Type: String
Parameter Sets: InputObject_SQL, Manual_SQL
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS


text:
/**
 * Driver-Side representations of Evaluators.
 */
@DriverSide
@Private package org.apache.reef.runtime.common.driver.evaluator;

import org.apache.reef.annotations.audience.DriverSide;
import org.apache.reef.annotations.audience.Private;


text:
/*
 *	Page fault handling module.
 */

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/resourcevar.h>
#include <sys/vmmeter.h>

#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_prot.h>
#include <sys/lock.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>
#include <vm/vm_kern.h>
#include <vm/vm_pager.h>
#include <vm/vnode_pager.h>
#include <vm/vm_extern.h>

static int vm_fault_additional_pages __P((vm_page_t, int,
					  int, vm_page_t *, int *));

#define VM_FAULT_READ_AHEAD 8
#define VM_FAULT_READ_BEHIND 7
#define VM_FAULT_READ (VM_FAULT_READ_AHEAD+VM_FAULT_READ_BEHIND+1)

struct faultstate {
	vm_page_t m;
	vm_object_t object;
	vm_pindex_t pindex;
	vm_page_t first_m;
	vm_object_t	first_object;
	vm_pindex_t first_pindex;
	vm_map_t map;
	vm_map_entry_t entry;
	int lookup_still_valid;
	struct vnode *vp;
};

static void
release_page(struct faultstate *fs)
{
	vm_page_wakeup(fs->m);
	vm_page_deactivate(fs->m);
	fs->m = NULL;
}

static void
unlock_map(struct faultstate *fs)
{
	if (fs->lookup_still_valid) {
		vm_map_lookup_done(fs->map, fs->entry);
		fs->lookup_still_valid = FALSE;
	}
}

static void
_unlock_things(struct faultstate *fs, int dealloc)
{
	vm_object_pip_wakeup(fs->object);
	if (fs->object != fs->first_object) {
		vm_page_free(fs->first_m);
		vm_object_pip_wakeup(fs->first_object);
		fs->first_m = NULL;
	}
	if (dealloc) {
		vm_object_deallocate(fs->first_object);
	}
	unlock_map(fs);
	if (fs->vp != NULL) {
		vput(fs->vp);
		fs->vp = NULL;
	}
}

#define unlock_things(fs) _unlock_things(fs, 0)
#define unlock_and_deallocate(fs) _unlock_things(fs, 1)

/*
 *	vm_fault:
 *
 *	Handle a page fault occuring at the given address,
 *	requiring the given permissions, in the map specified.
 *	If successful, the page is inserted into the
 *	associated physical map.
 *
 *	NOTE: the given address should be truncated to the
 *	proper page address.
 *
 *	KERN_SUCCESS is returned if the page fault is handled; otherwise,
 *	a standard error specifying why the fault is fatal is returned.
 *
 *
 *	The map in question must be referenced, and remains so.
 *	Caller may hold no locks.
 */
int
vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, int fault_flags)
{
	vm_prot_t prot;
	int result;
	boolean_t wired;
	int map_generation;
	vm_page_t old_m;
	vm_object_t next_object;
	vm_page_t marray[VM_FAULT_READ];
	int hardfault;
	int faultcount;
	struct faultstate fs;

	cnt.v_vm_faults++;	/* needs lock XXX */
	hardfault = 0;

RetryFault:;
	fs.map = map;

	/*
	 * Find the backing store object and offset into it to begin the
	 * search.
	 */
	if ((result = vm_map_lookup(&fs.map, vaddr,
		fault_type, &fs.entry, &fs.first_object,
		&fs.first_pindex, &prot, &wired)) != KERN_SUCCESS) {
		if ((result != KERN_PROTECTION_FAILURE) ||
			((fault_flags & VM_FAULT_WIRE_MASK) != VM_FAULT_USER_WIRE)) {
			return result;
		}

		/*
   		 * If we are user-wiring a r/w segment, and it is COW, then
   		 * we need to do the COW operation.  Note that we don't COW
   		 * currently RO sections now, because it is NOT desirable
   		 * to COW .text.  We simply keep .text from ever being COW'ed
   		 * and take the heat that one cannot debug wired .text sections.
   		 */
		result = vm_map_lookup(&fs.map, vaddr,
			VM_PROT_READ|VM_PROT_WRITE|VM_PROT_OVERRIDE_WRITE,
			&fs.entry, &fs.first_object, &fs.first_pindex, &prot, &wired);
		if (result != KERN_SUCCESS) {
			return result;
		}

		/*
		 * If we don't COW now, on a user wire, the user will never
		 * be able to write to the mapping.  If we don't make this
		 * restriction, the bookkeeping would be nearly impossible.
		 */
		if ((fs.entry->protection & VM_PROT_WRITE) == 0)
			fs.entry->max_protection &= ~VM_PROT_WRITE;
	}

	map_generation = fs.map->timestamp;

	if (fs.entry->eflags & MAP_ENTRY_NOFAULT) {
		panic("vm_fault: fault on nofault entry, addr: %lx",
		    (u_long)vaddr);
	}

	/*
	 * Make a reference to this object to prevent its disposal while we
	 * are messing with it.  Once we have the reference, the map is free
	 * to be diddled.  Since objects reference their shadows (and copies),
	 * they will stay around as well.
	 */
	vm_object_reference(fs.first_object);
	vm_object_pip_add(fs.first_object, 1);

	fs.vp = vnode_pager_lock(fs.first_object);
	if ((fault_type & VM_PROT_WRITE) &&
		(fs.first_object->type == OBJT_VNODE)) {
		vm_freeze_copyopts(fs.first_object,
			fs.first_pindex, fs.first_pindex + 1);
	}

	fs.lookup_still_valid = TRUE;

	if (wired)
		fault_type = prot;

	fs.first_m = NULL;

	/*
	 * Search for the page at object/offset.
	 */

	fs.object = fs.first_object;
	fs.pindex = fs.first_pindex;

	/*
	 * See whether this page is resident
	 */
	while (TRUE) {
		/*
		 * If the object is dead, we stop here
		 */

		if (fs.object->flags & OBJ_DEAD) {
			unlock_and_deallocate(&fs);
			return (KERN_PROTECTION_FAILURE);
		}

		/*
		 * See if page is resident
		 */

		fs.m = vm_page_lookup(fs.object, fs.pindex);
		if (fs.m != NULL) {
			int queue, s;
			/*
			 * Wait/Retry if the page is busy.  We have to do this
			 * if the page is busy via either PG_BUSY or
			 * vm_page_t->busy because the vm_pager may be using
			 * vm_page_t->busy for pageouts ( and even pageins if
			 * it is the vnode pager ), and we could end up trying
			 * to pagein and pageout the same page simultaniously.
			 *
			 * We can theoretically allow the busy case on a read
			 * fault if the page is marked valid, but since such
			 * pages are typically already pmap'd, putting that
			 * special case in might be more effort then it is
			 * worth.  We cannot under any circumstances mess
			 * around with a vm_page_t->busy page except, perhaps,
			 * to pmap it.
			 */
			if ((fs.m->flags & PG_BUSY) || fs.m->busy) {
				unlock_things(&fs);
				s = splvm();
				if ((fs.m->flags & PG_BUSY) || fs.m->busy) {
					vm_page_flag_set(fs.m, PG_WANTED | PG_REFERENCED);
					cnt.v_intrans++;
					tsleep(fs.m, PSWP, "vmpfw", 0);
				}
				splx(s);
				vm_object_deallocate(fs.first_object);
				goto RetryFault;
			}

			queue = fs.m->queue;
			s = splvm();
			vm_page_unqueue_nowakeup(fs.m);
			splx(s);

			/*
			 * Mark page busy for other processes, and the pagedaemon.
			 */
			if (((queue - fs.m->pc) == PQ_CACHE) &&
			    (cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) {
				vm_page_activate(fs.m);
				unlock_and_deallocate(&fs);
				VM_WAIT;
				goto RetryFault;
			}

			vm_page_busy(fs.m);
			if (((fs.m->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) &&
				fs.m->object != kernel_object && fs.m->object != kmem_object) {
				goto readrest;
			}

			break;
		}
		if (((fs.object->type != OBJT_DEFAULT) &&
				(((fault_flags & VM_FAULT_WIRE_MASK) == 0) || wired))
		    || (fs.object == fs.first_object)) {

			if (fs.pindex >= fs.object->size) {
				unlock_and_deallocate(&fs);
				return (KERN_PROTECTION_FAILURE);
			}

			/*
			 * Allocate a new page for this object/offset pair.
			 */
			fs.m = vm_page_alloc(fs.object, fs.pindex,
				(fs.vp || fs.object->backing_object)? VM_ALLOC_NORMAL: VM_ALLOC_ZERO);

			if (fs.m == NULL) {
				unlock_and_deallocate(&fs);
				VM_WAIT;
				goto RetryFault;
			}
		}

readrest:
		if (fs.object->type != OBJT_DEFAULT &&
			(((fault_flags & VM_FAULT_WIRE_MASK) == 0) || wired)) {
			int rv;
			int reqpage;
			int ahead, behind;

			if (fs.first_object->behavior == OBJ_RANDOM) {
				ahead = 0;
				behind = 0;
			} else {
				behind = (vaddr - fs.entry->start) >> PAGE_SHIFT;
				if (behind > VM_FAULT_READ_BEHIND)
					behind = VM_FAULT_READ_BEHIND;

				ahead = ((fs.entry->end - vaddr) >> PAGE_SHIFT) - 1;
				if (ahead > VM_FAULT_READ_AHEAD)
					ahead = VM_FAULT_READ_AHEAD;
			}

			if ((fs.first_object->type != OBJT_DEVICE) &&
				(fs.first_object->behavior == OBJ_SEQUENTIAL)) {
				vm_pindex_t firstpindex, tmppindex;
				if (fs.first_pindex <
					2*(VM_FAULT_READ_BEHIND + VM_FAULT_READ_AHEAD + 1))
					firstpindex = 0;
				else
					firstpindex = fs.first_pindex -
						2*(VM_FAULT_READ_BEHIND + VM_FAULT_READ_AHEAD + 1);

				for(tmppindex = fs.first_pindex - 1;
					tmppindex >= firstpindex;
					--tmppindex) {
					vm_page_t mt;
					mt = vm_page_lookup( fs.first_object, tmppindex);
					if (mt == NULL || (mt->valid != VM_PAGE_BITS_ALL))
						break;
					if (mt->busy ||
						(mt->flags & (PG_BUSY | PG_FICTITIOUS)) ||
						mt->hold_count ||
						mt->wire_count)
						continue;
					if (mt->dirty == 0)
						vm_page_test_dirty(mt);
					if (mt->dirty) {
						vm_page_protect(mt, VM_PROT_NONE);
						vm_page_deactivate(mt);
					} else {
						vm_page_cache(mt);
					}
				}

				ahead += behind;
				behind = 0;
			}

			/*
			 * now we find out if any other pages should be paged
			 * in at this time this routine checks to see if the
			 * pages surrounding this fault reside in the same
			 * object as the page for this fault.  If they do,
			 * then they are faulted in also into the object.  The
			 * array "marray" returned contains an array of
			 * vm_page_t structs where one of them is the
			 * vm_page_t passed to the routine.  The reqpage
			 * return value is the index into the marray for the
			 * vm_page_t passed to the routine.
			 */
			faultcount = vm_fault_additional_pages(
			    fs.m, behind, ahead, marray, &reqpage);

			/*
			 * Call the pager to retrieve the data, if any, after
			 * releasing the lock on the map.
			 */
			unlock_map(&fs);

			rv = faultcount ?
			    vm_pager_get_pages(fs.object, marray, faultcount,
				reqpage) : VM_PAGER_FAIL;

			if (rv == VM_PAGER_OK) {
				/*
				 * Found the page. Leave it busy while we play
				 * with it.
				 */

				/*
				 * Relookup in case pager changed page. Pager
				 * is responsible for disposition of old page
				 * if moved.
				 */
				fs.m = vm_page_lookup(fs.object, fs.pindex);
				if(!fs.m) {
					unlock_and_deallocate(&fs);
					goto RetryFault;
				}

				hardfault++;
				break;
			}
			/*
			 * Remove the bogus page (which does not exist at this
			 * object/offset); before doing so, we must get back
			 * our object lock to preserve our invariant.
			 *
			 * Also wake up any other process that may want to bring
			 * in this page.
			 *
			 * If this is the top-level object, we must leave the
			 * busy page to prevent another process from rushing
			 * past us, and inserting the page in that object at
			 * the same time that we are.
			 */

			if (rv == VM_PAGER_ERROR)
				printf("vm_fault: pager read error, pid %d (%s)\n",
				    curproc->p_pid, curproc->p_comm);
			/*
			 * Data outside the range of the pager or an I/O error
			 */
			/*
			 * XXX - the check for kernel_map is a kludge to work
			 * around having the machine panic on a kernel space
			 * fault w/ I/O error.
			 */
			if (((fs.map != kernel_map) && (rv == VM_PAGER_ERROR)) ||
				(rv == VM_PAGER_BAD)) {
				vm_page_free(fs.m);
				fs.m = NULL;
				unlock_and_deallocate(&fs);
				return ((rv == VM_PAGER_ERROR) ? KERN_FAILURE : KERN_PROTECTION_FAILURE);
			}
			if (fs.object != fs.first_object) {
				vm_page_free(fs.m);
				fs.m = NULL;
				/*
				 * XXX - we cannot just fall out at this
				 * point, m has been freed and is invalid!
				 */
			}
		}
		/*
		 * We get here if the object has default pager (or unwiring) or the
		 * pager doesn't have the page.
		 */
		if (fs.object == fs.first_object)
			fs.first_m = fs.m;

		/*
		 * Move on to the next object.  Lock the next object before
		 * unlocking the current one.
		 */

		fs.pindex += OFF_TO_IDX(fs.object->backing_object_offset);
		next_object = fs.object->backing_object;
		if (next_object == NULL) {
			/*
			 * If there's no object left, fill the page in the top
			 * object with zeros.
			 */
			if (fs.object != fs.first_object) {
				vm_object_pip_wakeup(fs.object);

				fs.object = fs.first_object;
				fs.pindex = fs.first_pindex;
				fs.m = fs.first_m;
			}
			fs.first_m = NULL;

			if ((fs.m->flags & PG_ZERO) == 0) {
				vm_page_zero_fill(fs.m);
			}
			else
				cnt.v_ozfod++;
			cnt.v_zfod++;
			break;
		} else {
			if (fs.object != fs.first_object) {
				vm_object_pip_wakeup(fs.object);
			}
			fs.object = next_object;
			vm_object_pip_add(fs.object, 1);
		}
	}
	KASSERT((fs.m->flags & PG_BUSY) != 0,
	    ("vm_fault: not busy after main loop"));

	/*
	 * PAGE HAS BEEN FOUND. [Loop invariant still holds -- the object lock
	 * is held.]
	 */

	old_m = fs.m;	/* save page that would be copied */

	/*
	 * If the page is being written, but isn't already owned by the
	 * top-level object, we have to copy it into a new page owned by the
	 * top-level object.
	 */

	if (fs.object != fs.first_object) {
		/*
		 * We only really need to copy if we want to write it.
		 */

		if (fault_type & VM_PROT_WRITE) {

			/*
			 * This allows pages to be virtually copied from a backing_object
			 * into the first_object, where the backing object has no other
			 * refs to it, and cannot gain any more refs.  Instead of a
			 * bcopy, we just move the page from the backing object to the
			 * first object.  Note that we must mark the page dirty in the
			 * first object so that it will go out to swap when needed.
			 */
			if (map_generation == fs.map->timestamp &&
				/*
				 * Only one shadow object
				 */
				(fs.object->shadow_count == 1) &&
				/*
				 * No COW refs, except us
				 */
				(fs.object->ref_count == 1) &&
				/*
				 * Noone else can look this object up
				 */
				(fs.object->handle == NULL) &&
				/*
				 * No other ways to look the object up
				 */
				((fs.object->type == OBJT_DEFAULT) ||
				 (fs.object->type == OBJT_SWAP)) &&
				/*
				 * We don't chase down the shadow chain
				 */
				(fs.object == fs.first_object->backing_object) &&

				/*
				 * grab the lock if we need to
				 */
				(fs.lookup_still_valid ||
						(((fs.entry->eflags & MAP_ENTRY_IS_A_MAP) == 0) &&
						 lockmgr(&fs.map->lock,
							LK_EXCLUSIVE|LK_NOWAIT, (void *)0, curproc) == 0))) {

				fs.lookup_still_valid = 1;
				/*
				 * get rid of the unnecessary page
				 */
				vm_page_protect(fs.first_m, VM_PROT_NONE);
				vm_page_free(fs.first_m);
				fs.first_m = NULL;

				/*
				 * grab the page and put it into the process'es object
				 */
				vm_page_rename(fs.m, fs.first_object, fs.first_pindex);
				fs.first_m = fs.m;
				fs.first_m->dirty = VM_PAGE_BITS_ALL;
				vm_page_busy(fs.first_m);
				fs.m = NULL;
				cnt.v_cow_optim++;
			} else {
				/*
				 * Oh, well, lets copy it.
				 */
				vm_page_copy(fs.m, fs.first_m);
			}

			if (fs.m) {
				/*
				 * We no longer need the old page or object.
				 */
				release_page(&fs);
			}

			vm_object_pip_wakeup(fs.object);
			/*
			 * Only use the new page below...
			 */

			cnt.v_cow_faults++;
			fs.m = fs.first_m;
			fs.object = fs.first_object;
			fs.pindex = fs.first_pindex;

		} else {
			prot &= ~VM_PROT_WRITE;
		}
	}

	/*
	 * We must verify that the maps have not changed since our last
	 * lookup.
	 */

	if (!fs.lookup_still_valid &&
		(fs.map->timestamp != map_generation)) {
		vm_object_t retry_object;
		vm_pindex_t retry_pindex;
		vm_prot_t retry_prot;

		/*
		 * Since map entries may be pageable, make sure we can take a
		 * page fault on them.
		 */

		/*
		 * Unlock vnode before the lookup to avoid deadlock.   E.G.
		 * avoid a deadlock between the inode and exec_map that can
		 * occur due to locks being obtained in different orders.
		 */

		if (fs.vp != NULL) {
			vput(fs.vp);
			fs.vp = NULL;
		}

		/*
		 * To avoid trying to write_lock the map while another process
		 * has it read_locked (in vm_map_pageable), we do not try for
		 * write permission.  If the page is still writable, we will
		 * get write permission.  If it is not, or has been marked
		 * needs_copy, we enter the mapping without write permission,
		 * and will merely take another fault.
		 */
		result = vm_map_lookup(&fs.map, vaddr, fault_type & ~VM_PROT_WRITE,
		    &fs.entry, &retry_object, &retry_pindex, &retry_prot, &wired);
		map_generation = fs.map->timestamp;

		/*
		 * If we don't need the page any longer, put it on the active
		 * list (the easiest thing to do here).  If no one needs it,
		 * pageout will grab it eventually.
		 */

		if (result != KERN_SUCCESS) {
			release_page(&fs);
			unlock_and_deallocate(&fs);
			return (result);
		}
		fs.lookup_still_valid = TRUE;

		if ((retry_object != fs.first_object) ||
		    (retry_pindex != fs.first_pindex)) {
			release_page(&fs);
			unlock_and_deallocate(&fs);
			goto RetryFault;
		}
		/*
		 * Check whether the protection has changed or the object has
		 * been copied while we left the map unlocked. Changing from
		 * read to write permission is OK - we leave the page
		 * write-protected, and catch the write fault. Changing from
		 * write to read permission means that we can't mark the page
		 * write-enabled after all.
		 */
		prot &= retry_prot;
	}

	/*
	 * Put this page into the physical map. We had to do the unlock above
	 * because pmap_enter may cause other faults.   We don't put the page
	 * back on the active queue until later so that the page-out daemon
	 * won't find us (yet).
	 */

	if (prot & VM_PROT_WRITE) {
		vm_page_flag_set(fs.m, PG_WRITEABLE);
		vm_object_set_flag(fs.m->object,
				   OBJ_WRITEABLE|OBJ_MIGHTBEDIRTY);
		/*
		 * If the fault is a write, we know that this page is being
		 * written NOW. This will save on the pmap_is_modified() calls
		 * later.
		 */
		if (fault_flags & VM_FAULT_DIRTY) {
			fs.m->dirty = VM_PAGE_BITS_ALL;
		}
	}

	unlock_things(&fs);
	fs.m->valid = VM_PAGE_BITS_ALL;
	vm_page_flag_clear(fs.m, PG_ZERO);

	pmap_enter(fs.map->pmap, vaddr, VM_PAGE_TO_PHYS(fs.m), prot, wired);
	if (((fault_flags & VM_FAULT_WIRE_MASK) == 0) && (wired == 0)) {
		pmap_prefault(fs.map->pmap, vaddr, fs.entry);
	}

	vm_page_flag_set(fs.m, PG_MAPPED|PG_REFERENCED);
	if (fault_flags & VM_FAULT_HOLD)
		vm_page_hold(fs.m);

	/*
	 * If the page is not wired down, then put it where the pageout daemon
	 * can find it.
	 */
	if (fault_flags & VM_FAULT_WIRE_MASK) {
		if (wired)
			vm_page_wire(fs.m);
		else
			vm_page_unwire(fs.m, 1);
	} else {
		vm_page_activate(fs.m);
	}

	if (curproc && (curproc->p_flag & P_INMEM) && curproc->p_stats) {
		if (hardfault) {
			curproc->p_stats->p_ru.ru_majflt++;
		} else {
			curproc->p_stats->p_ru.ru_minflt++;
		}
	}

	/*
	 * Unlock everything, and return
	 */

	vm_page_wakeup(fs.m);
	vm_object_deallocate(fs.first_object);

	return (KERN_SUCCESS);

}

/*
 *	vm_fault_wire:
 *
 *	Wire down a range of virtual addresses in a map.
 */
int
vm_fault_wire(map, start, end)
	vm_map_t map;
	vm_offset_t start, end;
{

	register vm_offset_t va;
	register pmap_t pmap;
	int rv;

	pmap = vm_map_pmap(map);

	/*
	 * Inform the physical mapping system that the range of addresses may
	 * not fault, so that page tables and such can be locked down as well.
	 */

	pmap_pageable(pmap, start, end, FALSE);

	/*
	 * We simulate a fault to get the page and enter it in the physical
	 * map.
	 */

	for (va = start; va < end; va += PAGE_SIZE) {
		rv = vm_fault(map, va, VM_PROT_READ|VM_PROT_WRITE,
			VM_FAULT_CHANGE_WIRING);
		if (rv) {
			if (va != start)
				vm_fault_unwire(map, start, va);
			return (rv);
		}
	}
	return (KERN_SUCCESS);
}

/*
 *	vm_fault_user_wire:
 *
 *	Wire down a range of virtual addresses in a map.  This
 *	is for user mode though, so we only ask for read access
 *	on currently read only sections.
 */
int
vm_fault_user_wire(map, start, end)
	vm_map_t map;
	vm_offset_t start, end;
{

	register vm_offset_t va;
	register pmap_t pmap;
	int rv;

	pmap = vm_map_pmap(map);

	/*
	 * Inform the physical mapping system that the range of addresses may
	 * not fault, so that page tables and such can be locked down as well.
	 */

	pmap_pageable(pmap, start, end, FALSE);

	/*
	 * We simulate a fault to get the page and enter it in the physical
	 * map.
	 */
	for (va = start; va < end; va += PAGE_SIZE) {
		rv = vm_fault(map, va, VM_PROT_READ, VM_FAULT_USER_WIRE);
		if (rv) {
			if (va != start)
				vm_fault_unwire(map, start, va);
			return (rv);
		}
	}
	return (KERN_SUCCESS);
}

/*
 *	vm_fault_unwire:
 *
 *	Unwire a range of virtual addresses in a map.
 */
void
vm_fault_unwire(map, start, end)
	vm_map_t map;
	vm_offset_t start, end;
{

	register vm_offset_t va, pa;
	register pmap_t pmap;

	pmap = vm_map_pmap(map);

	/*
	 * Since the pages are wired down, we must be able to get their
	 * mappings from the physical map system.
	 */

	for (va = start; va < end; va += PAGE_SIZE) {
		pa = pmap_extract(pmap, va);
		if (pa != (vm_offset_t) 0) {
			pmap_change_wiring(pmap, va, FALSE);
			vm_page_unwire(PHYS_TO_VM_PAGE(pa), 1);
		}
	}

	/*
	 * Inform the physical mapping system that the range of addresses may
	 * fault, so that page tables and such may be unwired themselves.
	 */

	pmap_pageable(pmap, start, end, TRUE);

}

/*
 *	Routine:
 *		vm_fault_copy_entry
 *	Function:
 *		Copy all of the pages from a wired-down map entry to another.
 *
 *	In/out conditions:
 *		The source and destination maps must be locked for write.
 *		The source map entry must be wired down (or be a sharing map
 *		entry corresponding to a main map entry that is wired down).
 */

void
vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry)
	vm_map_t dst_map;
	vm_map_t src_map;
	vm_map_entry_t dst_entry;
	vm_map_entry_t src_entry;
{
	vm_object_t dst_object;
	vm_object_t src_object;
	vm_ooffset_t dst_offset;
	vm_ooffset_t src_offset;
	vm_prot_t prot;
	vm_offset_t vaddr;
	vm_page_t dst_m;
	vm_page_t src_m;

#ifdef	lint
	src_map++;
#endif	/* lint */

	src_object = src_entry->object.vm_object;
	src_offset = src_entry->offset;

	/*
	 * Create the top-level object for the destination entry. (Doesn't
	 * actually shadow anything - we copy the pages directly.)
	 */
	dst_object = vm_object_allocate(OBJT_DEFAULT,
	    (vm_size_t) OFF_TO_IDX(dst_entry->end - dst_entry->start));

	dst_entry->object.vm_object = dst_object;
	dst_entry->offset = 0;

	prot = dst_entry->max_protection;

	/*
	 * Loop through all of the pages in the entry's range, copying each
	 * one from the source object (it should be there) to the destination
	 * object.
	 */
	for (vaddr = dst_entry->start, dst_offset = 0;
	    vaddr < dst_entry->end;
	    vaddr += PAGE_SIZE, dst_offset += PAGE_SIZE) {

		/*
		 * Allocate a page in the destination object
		 */
		do {
			dst_m = vm_page_alloc(dst_object,
				OFF_TO_IDX(dst_offset), VM_ALLOC_NORMAL);
			if (dst_m == NULL) {
				VM_WAIT;
			}
		} while (dst_m == NULL);

		/*
		 * Find the page in the source object, and copy it in.
		 * (Because the source is wired down, the page will be in
		 * memory.)
		 */
		src_m = vm_page_lookup(src_object,
			OFF_TO_IDX(dst_offset + src_offset));
		if (src_m == NULL)
			panic("vm_fault_copy_wired: page missing");

		vm_page_copy(src_m, dst_m);

		/*
		 * Enter it in the pmap...
		 */

		vm_page_flag_clear(dst_m, PG_ZERO);
		pmap_enter(dst_map->pmap, vaddr, VM_PAGE_TO_PHYS(dst_m),
		    prot, FALSE);
		vm_page_flag_set(dst_m, PG_WRITEABLE|PG_MAPPED);

		/*
		 * Mark it no longer busy, and put it on the active list.
		 */
		vm_page_activate(dst_m);
		vm_page_wakeup(dst_m);
	}
}

/*
 * This routine checks around the requested page for other pages that
 * might be able to be faulted in.  This routine brackets the viable
 * pages for the pages to be paged in.
 *
 * Inputs:
 *	m, rbehind, rahead
 *
 * Outputs:
 *  marray (array of vm_page_t), reqpage (index of requested page)
 *
 * Return value:
 *  number of pages in marray
 */
static int
vm_fault_additional_pages(m, rbehind, rahead, marray, reqpage)
	vm_page_t m;
	int rbehind;
	int rahead;
	vm_page_t *marray;
	int *reqpage;
{
	int i,j;
	vm_object_t object;
	vm_pindex_t pindex, startpindex, endpindex, tpindex;
	vm_page_t rtm;
	int cbehind, cahead;

	object = m->object;
	pindex = m->pindex;

	/*
	 * we don't fault-ahead for device pager
	 */
	if (object->type == OBJT_DEVICE) {
		*reqpage = 0;
		marray[0] = m;
		return 1;
	}

	/*
	 * if the requested page is not available, then give up now
	 */

	if (!vm_pager_has_page(object,
		OFF_TO_IDX(object->paging_offset) + pindex, &cbehind, &cahead)) {
		return 0;
	}

	if ((cbehind == 0) && (cahead == 0)) {
		*reqpage = 0;
		marray[0] = m;
		return 1;
	}

	if (rahead > cahead) {
		rahead = cahead;
	}

	if (rbehind > cbehind) {
		rbehind = cbehind;
	}

	/*
	 * try to do any readahead that we might have free pages for.
	 */
	if ((rahead + rbehind) >
		((cnt.v_free_count + cnt.v_cache_count) - cnt.v_free_reserved)) {
		pagedaemon_wakeup();
		marray[0] = m;
		*reqpage = 0;
		return 1;
	}

	/*
	 * scan backward for the read behind pages -- in memory
	 */
	if (pindex > 0) {
		if (rbehind > pindex) {
			rbehind = pindex;
			startpindex = 0;
		} else {
			startpindex = pindex - rbehind;
		}

		for ( tpindex = pindex - 1; tpindex >= startpindex; tpindex -= 1) {
			if (vm_page_lookup( object, tpindex)) {
				startpindex = tpindex + 1;
				break;
			}
			if (tpindex == 0)
				break;
		}

		for(i = 0, tpindex = startpindex; tpindex < pindex; i++, tpindex++) {

			rtm = vm_page_alloc(object, tpindex, VM_ALLOC_NORMAL);
			if (rtm == NULL) {
				for (j = 0; j < i; j++) {
					vm_page_free(marray[j]);
				}
				marray[0] = m;
				*reqpage = 0;
				return 1;
			}

			marray[i] = rtm;
		}
	} else {
		startpindex = 0;
		i = 0;
	}

	marray[i] = m;
	/* page offset of the required page */
	*reqpage = i;

	tpindex = pindex + 1;
	i++;

	/*
	 * scan forward for the read ahead pages
	 */
	endpindex = tpindex + rahead;
	if (endpindex > object->size)
		endpindex = object->size;

	for( ; tpindex < endpindex; i++, tpindex++) {

		if (vm_page_lookup(object, tpindex)) {
			break;
		}

		rtm = vm_page_alloc(object, tpindex, VM_ALLOC_NORMAL);
		if (rtm == NULL) {
			break;
		}

		marray[i] = rtm;
	}

	/* return number of bytes of pages */
	return i;
}


text:
package ddf.minim.analysis;

/**
 * A Triangular window function.
 *
 * @author Damien Di Fede
 * @author Corban Brook
 * @see   The Triangular Window
 *
 * @invisible
 */
public class TriangularWindow extends WindowFunction
{
  /** Constructs a Triangular window. */
  public TriangularWindow()
  {
  }

  protected float value(int length, int index)
  {
     return 2f / length * (length / 2f - Math.abs(index - (length - 1) / 2f));
  }

  public String toString()
  {
	  return "Triangular Window";
  }
}


text:
#ifndef SPI_TEST_ARITHMETIC_CONSTANTS_H
# define SPI_TEST_ARITHMETIC_CONSTANTS_H

# define MEM_SIZE 0xFFFF

#endif //SPI_TEST_ARITHMETIC_CONSTANTS_H


text:
#ifndef RenderTheme_h
#define RenderTheme_h

#if USE(NEW_THEME)
#include "platform/Theme.h"
#else
#include "platform/ThemeTypes.h"
#endif
#include "core/rendering/RenderObject.h"
#include "core/rendering/style/CachedUAStyle.h"
#include "platform/scroll/ScrollTypes.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/text/WTFString.h"

namespace blink {

class Element;
class FileList;
class HTMLInputElement;
class RenderMeter;
class RenderProgress;

class RenderTheme : public RefCounted<RenderTheme> {
protected:
    RenderTheme();

public:
    virtual ~RenderTheme() { }

    // This function is to be implemented in your platform-specific theme implementation to hand back the
    // appropriate platform theme.
    static RenderTheme& theme();

    static void setSizeIfAuto(RenderStyle*, const IntSize&);

    // This method is called whenever style has been computed for an element and the appearance
    // property has been set to a value other than "none".  The theme should map in all of the appropriate
    // metrics and defaults given the contents of the style.  This includes sophisticated operations like
    // selection of control size based off the font, the disabling of appearance when certain other properties like
    // "border" are set, or if the appearance is not supported by the theme.
    void adjustStyle(RenderStyle*, Element*, const CachedUAStyle*);

    // This method is called to paint the widget as a background of the RenderObject.  A widget's foreground, e.g., the
    // text of a button, is always rendered by the engine itself.  The boolean return value indicates
    // whether the CSS border/background should also be painted.
    bool paint(RenderObject*, const PaintInfo&, const IntRect&);
    bool paintBorderOnly(RenderObject*, const PaintInfo&, const IntRect&);
    bool paintDecorations(RenderObject*, const PaintInfo&, const IntRect&);

    // The remaining methods should be implemented by the platform-specific portion of the theme, e.g.,
    // RenderThemeMac.cpp for Mac OS X.

    // These methods return the theme's extra style sheets rules, to let each platform
    // adjust the default CSS rules in html.css, quirks.css or mediaControls.css.
    virtual String extraDefaultStyleSheet();
    virtual String extraQuirksStyleSheet() { return String(); }
    virtual String extraMediaControlsStyleSheet() { return String(); }
    virtual String extraFullScreenStyleSheet() { return String(); }

    // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    // controls that need to do this.
    virtual int baselinePosition(const RenderObject*) const;

    // A method for asking if a control is a container or not.  Leaf controls have to have some special behavior (like
    // the baseline position API above).
    bool isControlContainer(ControlPart) const;

    // Whether or not the control has been styled enough by the author to disable the native appearance.
    virtual bool isControlStyled(const RenderStyle*, const CachedUAStyle*) const;

    // Some controls may spill out of their containers (e.g., the check on an OS X checkbox). When these controls issues paint invalidations,
    // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
    virtual void adjustPaintInvalidationRect(const RenderObject*, IntRect&);

    // This method is called whenever a relevant state changes on a particular themed object, e.g., the mouse becomes pressed
    // or a control becomes disabled.
    virtual bool stateChanged(RenderObject*, ControlState) const;

    bool shouldDrawDefaultFocusRing(RenderObject*) const;

    // A method asking if the theme's controls actually care about redrawing when hovered.
    virtual bool supportsHover(const RenderStyle*) const { return false; }

#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
    // A method asking if the platform is able to show a calendar picker for a given input type.
    virtual bool supportsCalendarPicker(const AtomicString&) const;
#endif

    // Text selection colors.
    Color activeSelectionBackgroundColor() const;
    Color inactiveSelectionBackgroundColor() const;
    Color activeSelectionForegroundColor() const;
    Color inactiveSelectionForegroundColor() const;

    // List box selection colors
    Color activeListBoxSelectionBackgroundColor() const;
    Color activeListBoxSelectionForegroundColor() const;
    Color inactiveListBoxSelectionBackgroundColor() const;
    Color inactiveListBoxSelectionForegroundColor() const;

    // Highlighting colors for TextMatches.
    virtual Color platformActiveTextSearchHighlightColor() const;
    virtual Color platformInactiveTextSearchHighlightColor() const;

    Color focusRingColor() const;
    virtual Color platformFocusRingColor() const { return Color(0, 0, 0); }
    void setCustomFocusRingColor(const Color&);
    static Color tapHighlightColor();
    virtual Color platformTapHighlightColor() const { return RenderTheme::defaultTapHighlightColor; }
    virtual Color platformDefaultCompositionBackgroundColor() const { return defaultCompositionBackgroundColor; }
    virtual void platformColorsDidChange();

    virtual double caretBlinkInterval() const { return 0.5; }

    // System fonts and colors for CSS.
    virtual void systemFont(CSSValueID, FontDescription&) const = 0;
    virtual Color systemColor(CSSValueID) const;

    virtual int minimumMenuListSize(RenderStyle*) const { return 0; }

    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const;

    virtual int popupInternalPaddingLeft(RenderStyle*) const { return 0; }
    virtual int popupInternalPaddingRight(RenderStyle*) const { return 0; }
    virtual int popupInternalPaddingTop(RenderStyle*) const { return 0; }
    virtual int popupInternalPaddingBottom(RenderStyle*) const { return 0; }
    virtual bool popupOptionSupportsTextIndent() const { return false; }

    virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return RegularScrollbar; }

    // Method for painting the caps lock indicator
    virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&) { return 0; };

    // Returns the repeat interval of the animation for the progress bar.
    virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const;
    // Returns the duration of the animation for the progress bar.
    virtual double animationDurationForProgressBar(RenderProgress*) const;

    // Media controls
    virtual String formatMediaControlsTime(float time) const;
    virtual String formatMediaControlsCurrentTime(float currentTime, float duration) const;

    virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;
    virtual bool supportsMeter(ControlPart) const;

    // Returns size of one slider tick mark for a horizontal track.
    // For vertical tracks we rotate it and use it. i.e. Width is always length along the track.
    virtual IntSize sliderTickSize() const = 0;
    // Returns the distance of slider tick origin from the slider track center.
    virtual int sliderTickOffsetFromTrackCenter() const = 0;
    void paintSliderTicks(RenderObject*, const PaintInfo&, const IntRect&);

    virtual bool shouldShowPlaceholderWhenFocused() const { return false; }
    virtual bool shouldHaveSpinButton(HTMLInputElement*) const;

    // Functions for <select> elements.
    virtual bool delegatesMenuListRendering() const { return false; }
    virtual bool popsMenuByArrowKeys() const { return false; }
    virtual bool popsMenuBySpaceKey() const { return false; }
    virtual bool popsMenuByReturnKey() const { return false; }
    virtual bool popsMenuByAltDownUpOrF4Key() const { return false; }

    virtual String fileListNameForWidth(Locale&, const FileList*, const Font&, int width) const;

    virtual bool shouldOpenPickerWithF4Key() const;

    virtual bool supportsSelectionForegroundColors() const { return true; }

protected:
    // The platform selection color.
    virtual Color platformActiveSelectionBackgroundColor() const;
    virtual Color platformInactiveSelectionBackgroundColor() const;
    virtual Color platformActiveSelectionForegroundColor() const;
    virtual Color platformInactiveSelectionForegroundColor() const;

    virtual Color platformActiveListBoxSelectionBackgroundColor() const;
    virtual Color platformInactiveListBoxSelectionBackgroundColor() const;
    virtual Color platformActiveListBoxSelectionForegroundColor() const;
    virtual Color platformInactiveListBoxSelectionForegroundColor() const;

    // A method asking if the theme is able to draw the focus ring.
    virtual bool supportsFocusRing(const RenderStyle*) const;

#if !USE(NEW_THEME)
    // Methods for each appearance value.
    virtual void adjustCheckboxStyle(RenderStyle*, Element*) const;
    virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual void setCheckboxSize(RenderStyle*) const { }

    virtual void adjustRadioStyle(RenderStyle*, Element*) const;
    virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual void setRadioSize(RenderStyle*) const { }

    virtual void adjustButtonStyle(RenderStyle*, Element*) const;
    virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual void adjustInnerSpinButtonStyle(RenderStyle*, Element*) const;
    virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
#endif

    virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual void adjustMenuListStyle(RenderStyle*, Element*) const;
    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual void adjustMenuListButtonStyle(RenderStyle*, Element*) const;
    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&);

    virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual void adjustSliderThumbStyle(RenderStyle*, Element*) const;
    virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual void adjustSearchFieldStyle(RenderStyle*, Element*) const;
    virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual void adjustSearchFieldCancelButtonStyle(RenderStyle*, Element*) const;
    virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual void adjustSearchFieldDecorationStyle(RenderStyle*, Element*) const;
    virtual bool paintSearchFieldDecoration(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle*, Element*) const;
    virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaOverlayPlayButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaTimeRemaining(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaFullScreenVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    virtual bool paintMediaFullScreenVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) { return true; }

    virtual bool shouldUseFallbackTheme(RenderStyle*) const;
    void adjustStyleUsingFallbackTheme(RenderStyle*, Element*);
    bool paintUsingFallbackTheme(RenderObject*, const PaintInfo&, const IntRect&);
    void adjustCheckboxStyleUsingFallbackTheme(RenderStyle*, Element*) const;
    bool paintCheckboxUsingFallbackTheme(RenderObject*, const PaintInfo&, const IntRect&);
    void adjustRadioStyleUsingFallbackTheme(RenderStyle*, Element*) const;
    bool paintRadioUsingFallbackTheme(RenderObject*, const PaintInfo&, const IntRect&);

public:
    // Methods for state querying
    ControlStates controlStatesForRenderer(const RenderObject* o) const;
    bool isActive(const RenderObject*) const;
    bool isChecked(const RenderObject*) const;
    bool isIndeterminate(const RenderObject*) const;
    bool isEnabled(const RenderObject*) const;
    bool isFocused(const RenderObject*) const;
    bool isPressed(const RenderObject*) const;
    bool isSpinUpButtonPartPressed(const RenderObject*) const;
    bool isHovered(const RenderObject*) const;
    bool isSpinUpButtonPartHovered(const RenderObject*) const;
    bool isReadOnlyControl(const RenderObject*) const;

private:
    Color m_customFocusRingColor;
    bool m_hasCustomFocusRingColor;

    // This color is expected to be drawn on a semi-transparent overlay,
    // making it more transparent than its alpha value indicates.
    static const RGBA32 defaultTapHighlightColor = 0x66000000;

    static const RGBA32 defaultCompositionBackgroundColor = 0xFFFFDD55;

#if USE(NEW_THEME)
    Theme* m_platformTheme; // The platform-specific theme.
#endif
};

} // namespace blink

#endif // RenderTheme_h


text:
package testPullUpGen.test36.test;

public abstract class S{

}


text:
package model;

import java.io.*;

import utility.StringUtil;

public class LinebasedMetricModel {
	private static final String[] predefinedMetricNames = new String[] {
		"LOC", "SLOC", "CLOC", "CVRL"
	};

	public static String fieldIDToName(int field) throws IndexOutOfBoundsException {
		return predefinedMetricNames[field];
	}

	public static int fieldNameToID(String name) throws IndexOutOfBoundsException {
		int field = java.util.Arrays.binarySearch(predefinedMetricNames, name);
		if (field >= 0) {
			return field;
		} else {
			throw new IndexOutOfBoundsException();
		}
	}

	public static String[] getFieldNames() {
		return predefinedMetricNames.clone();
	}

	private int maxFileID;
	private String[] metricNames;
	private double[] values;
	private boolean[] isValidValue;
	private boolean[] isFloatingPoints;
	private int fields;
	private MetricsSummaryData summaryData;

	public void readLinebasedMetricFile(String path, int maxFileID) throws DataFileReadError, IOException {
		this.maxFileID = maxFileID;
		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF8")); //$NON-NLS-1$
		String line;
		line = reader.readLine();
		String supposedTitleLine = "FID" + "\t" + StringUtil.join(LinebasedMetricModel.getFieldNames(), "\t");
		if (! line.equals(supposedTitleLine)) { //$NON-NLS-1$
			throw new DataFileReadError("invalid file metric file"); //$NON-NLS-1$
		}

		String[] ss = StringUtil.split(line, '\t');
		fields = ss.length - 1;
		metricNames = new String[fields];
		for (int i = 0; i < fields; ++i) {
			metricNames[i] = ss[i + 1];
		}

		values = new double[(maxFileID + 1) * fields];
		isValidValue = new boolean[maxFileID + 1];
		isFloatingPoints = new boolean[fields];
		for (int i = 0; i < fields; ++i) {
			isFloatingPoints[i] = false;
		}
		while (true) {
			line = reader.readLine();
			if (line == null) {
				throw new DataFileReadError("Invalid line-based metric file");
			}
			String[] subs = StringUtil.split(line, '\t');
			String subs0 = subs[0];
			if (subs0.equals("ave.") || subs0.equals("total")) { //$NON-NLS-1$
				break; // while
			}
			if (subs.length != fields + 1) {
				throw new DataFileReadError("invalid file metric file"); //$NON-NLS-1$
			}
			int id = Integer.parseInt(subs[0]);
			if (! (0 <= id && id <= maxFileID)) {
				throw new DataFileReadError("Invalid File ID"); //$NON-NLS-1$
			}
			isValidValue[id] = true;
			int valuePos = id * fields;
			for (int i = 0; i < fields; ++i) {
				double v = Double.parseDouble(subs[i + 1]);
				if (Math.floor(v) != v) {
					isFloatingPoints[i] = true;
				}
				values[valuePos + i] = v;
			}
		}

		summaryData = new MetricsSummaryData();
		summaryData.read(fields, reader, line);

		reader.close();
	}

	public double[] getMetricDataOfFile(int fileID) throws IndexOutOfBoundsException {
		if (! (0 <= fileID && fileID < maxFileID) && ! isValidValue[fileID]) {
			throw new IndexOutOfBoundsException();
		}
		return utility.ArrayUtil.slice(values, fileID * fields, fileID * fields + fields).clone();
	}

	public double getNthMetricDataOfFile(int fileID, int fieldIndex) throws IndexOutOfBoundsException {
		if (! (0 <= fileID && fileID < maxFileID) && ! isValidValue[fileID]) {
			throw new IndexOutOfBoundsException();
		}
		if (! (0 <= fieldIndex && fieldIndex < fields)) {
			throw new IndexOutOfBoundsException();
		}
		return values[fileID * fields + fieldIndex];
	}

	public int getFieldCount() {
		return fields;
	}

	public boolean isFlotingPoint(int metricIndex) {
		assert 0 <= metricIndex && metricIndex < isFloatingPoints.length;
		return isFloatingPoints[metricIndex];
	}

	public boolean[] getFlotingPointValueMap() {
		return isFloatingPoints.clone();
	}

	public String getMetricName(int metricIndex) {
		assert 0 <= metricIndex && metricIndex < metricNames.length;
		return metricNames[metricIndex];
	}

	public String[] getMetricNames() {
		return metricNames.clone();
	}

	public MetricsSummaryData getSummaryData() {
		return summaryData.clone();
	}

	public double[] getRelativeMetricDataOfFile(int fileID) throws IndexOutOfBoundsException {
		if (! (0 <= fileID && fileID < maxFileID) && ! isValidValue[fileID]) {
			throw new IndexOutOfBoundsException();
		}
		double[] vs = new double[fields];
		for (int i = 0; i < fields; ++i) {
			vs[i] = summaryData.toRelativeValue(i, values[fileID * fields + i]);
		}
		return vs;
	}

	public double getNthRelativeMetricDataOfFile(int fileID, int fieldIndex) throws IndexOutOfBoundsException {
		if (! (0 <= fileID && fileID < maxFileID) && ! isValidValue[fileID]) {
			throw new IndexOutOfBoundsException();
		}
		if (! (0 <= fieldIndex && fieldIndex < fields)) {
			throw new IndexOutOfBoundsException();
		}
		return summaryData.toRelativeValue(fieldIndex, values[fileID * fields + fieldIndex]);
	}
}


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

    <item
        android:id="@+id/newLanguageOption"
        android:orderInCategory="1"
        app:showAsAction="never"
        android:title="@string/newLanguageOption"/>
</menu>


text:
package testutil

import (
	"github.com/hyperledger/fabric-protos-go/peer"
	"github.com/hyperledger/fabric/core/ledger/pvtdatapolicy"
	"github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/mock"
)

// SampleBTLPolicy helps tests create a sample BTLPolicy
// The example input entry is [2]string{ns, coll}:btl
func SampleBTLPolicy(m map[[2]string]uint64) pvtdatapolicy.BTLPolicy {
	ccInfoRetriever := &mock.CollectionInfoProvider{}
	ccInfoRetriever.CollectionInfoStub = func(ccName, collName string) (*peer.StaticCollectionConfig, error) {
		btl := m[[2]string{ccName, collName}]
		return &peer.StaticCollectionConfig{BlockToLive: btl}, nil
	}
	return pvtdatapolicy.ConstructBTLPolicy(ccInfoRetriever)
}


text:
layout: post
title: "Parsnip, garlic and blue cheese"
excerpt: "Autumn arrived, but don't run. This is really good."
modified:
author: antonio_domingues
share: true
categories: blog
tags:
    - Vegetarian
    - Soup
    - Starter
image:
  feature:
date: 2016-09-20 21:00:02.000000000 +02:00
---

When I first saw this recipe I was a little suspicious: blue cheese? Parsnip? But we took a gamble because there were a lot of parsnips in the market and sometimes it is nice to get out of one's comfort zone, and this time it was well worth it. This recipe makes for a very creamy and soup, without being too intense. Served very hot its wonderful for the cold Autumn evenings that are starting to appear. So don't be afraid of stepping out of your comfort zone and try this.

#### Variations

- The original recipe call for two garlic bulbs, but I thought that is a bit much and do it with only one. If you are a garlic lover, go for it.
- I usually do 100g of cheese because the packages are... 100g.

#### Inspiration

This is a recipe from my favorite cookbook: [Three Good Things (... on a plate)](https://www.amazon.com/Hughs-Three-Good-Things-Fearnley-Whittingstall/dp/1408828588) by Hugh Fearnley-Whittingstall. The book is excellent in that most recipes require easy to source ingredients, the cooking techniques are pretty easy, and so far all those that I have tried were very tasty. Not all recipes are For The People, but the ratio of useful recipes and "look at me I know fancy ingredients" is in favor of the thrifty chap in me.

If you don't fancy getting the book, some of the recipes are available in [The Guardian](https://www.theguardian.com/lifeandstyle/series/hugh-s-three-good-things-on-a-plate).

---

* Servings: 4 as starter or 2 as main course.
* Prep Time:  10 mins
* Cook Time:  50 mins
* Total Time: 60 mins

---

#### Ingredients

* Parsnip: 500 grams, roughly cubbed 1-2 cm pieces
* Blue cheese: 50 grams
* Vegetable stock: 600mL, hot
* Onion: 1, sliced
* Garlic bulb: 1
* Olive oil: 3 tablespoons
* Sea salt: to taste
* Black Pepper: to taste

#### Directions

1. Preheat oven to 190ºc. Cut the top and bottom of the parsnips, peel and cut in chunks. Put them in an baking tray with the onions, add 2 tablespoons of olive oil, salt and pepper. Toss to mix.
2. Cut the top of the garlic bulb to expose the garlic cloves. Put on top of a piece of aluminum foil, drizzle with the a tablespoon of olive oil, add salt and pepper and make a rough wrap with the aluminum foil and nest it in the middle of the parsnips. Pop in the oven for 40-50 min, until the parsnips are golden and cooked. You can poke the garlic with a tip of a knife to check if they are soft inside the skin. If not, cook for a little longer.
3. Time for a blender. Transfer the parsnips and onions to it, and squeeze the soft garlic from their skin. Transfer also the olive oil still in the wrap (it will be very fragrant), and add the vegetable stock and blue cheese. Blend it until smooth. If needed, add some hot water until it acquires the desired consistency. Serve and add salt and pepper to taste.
4. Enjoy.


text:
class CLogBar : public CSizingControlBarCF
{
// Construction
public:
	CLogBar();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CLogBar)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CLogBar();
	CEdit	m_wndChild;

protected:
	CFont	m_font;

	// Generated message map functions
protected:
	//{{AFX_MSG(CLogBar)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(__LOGBAR_H__)


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sila | Admin Login</title>

<link href="<?=base_url();?>assets/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="<?=base_url();?>assets/css/custom_admin.css" rel="stylesheet" type="text/css">

        <a href="<?php echo base_url().'admin/index'; ?>"><img src="<?php echo base_url()?>/assets/image/logo_grey.png" class="center-image">

Login Admin

        <?php
                if (isset($pesan)) {
                    if ($pesan == "gagal")
                {
                   echo '

                          ×
                          Maaf! Username atau password yang anda masukkan salah.

';
                }
                }

        ?>
          <form role="form" method="post" action="<?php echo base_url().'admin/login'; ?>">

              <input type="text" class="form-control custom-text-form" id="username" placeholder="Username" name="username">

              <input type="password" class="form-control custom-text-form" id="pwd" placeholder="Password" name="pwd">

            <button type="submit" class="btn btn-primary">Login</button>
          </form>

copyrights©kelompok 6