text:
module.exports = {
  "tags": [
    {
      "type": "example",
      "string": "// Create a View from a Single Collection\ndb.createView(\n \"managementFeedback\",\n \"survey\",\n [ { $project: { \"management\": \"$feedback.management\", department: 1 } } ]\n)\n\n// Query a View\ndb.managementFeedback.find()\n\n// Perform Aggregation Pipeline on a View\ndb.managementFeedback.aggregate([ { $sortByCount: \"$department\" } ] )\n\n// Create a View from Multiple Collections\ndb.createView(\n  \"orderDetails\",\n  \"orders\",\n  [\n    { $lookup: { from: \"inventory\", localField: \"item\", foreignField: \"sku\", as: \"inventory_docs\" } },\n    { $project: { \"inventory_docs._id\": 0, \"inventory_docs.sku\": 0 } }\n  ]\n)\n\n// Perform Aggregation Pipeline on a View\ndb.orderDetails.aggregate( [ { $sortByCount: \"$item\" } ] )\n\n// Create a View with Default Collation\ndb.createView(\n \"placesView\",\n \"places\",\n [ { $project: { category: 1 } } ],\n { collation: { locale: \"fr\", strength: 1 } }\n)"
    },
    {
      "type": "param",
      "string": "{string} view The name of the view to create.",
      "name": "view",
      "description": "The name of the view to create.",
      "types": [
        "string"
      ],
      "typesDescription": "string",
      "optional": false,
      "nullable": false,
      "nonNullable": false,
      "variable": false
    },
    {
      "type": "param",
      "string": "{string} source The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view; i.e. does not include the database name and implies the same database as the view to create.",
      "name": "source",
      "description": "The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view; i.e. does not include the database name and implies the same database as the view to create.",
      "types": [
        "string"
      ],
      "typesDescription": "string",
      "optional": false,
      "nullable": false,
      "nonNullable": false,
      "variable": false
    },
    {
      "type": "param",
      "string": "{array} pipeline An array that consists of the :ref:`aggregation pipeline stage <aggregation-pipeline>`.  {{op}} creates the view by applying the specified ``pipeline`` to the {{source}}.  .. include:: /includes/extracts/views-public-definition.rst",
      "name": "pipeline",
      "description": "An array that consists of the :ref:`aggregation pipeline stage <aggregation-pipeline>`. {{op}} creates the view by applying the specified ``pipeline`` to the {{source}}. .. include:: /includes/extracts/views-public-definition.rst",
      "types": [
        "array"
      ],
      "typesDescription": "array",
      "optional": false,
      "nullable": false,
      "nonNullable": false,
      "variable": false
    },
    {
      "type": "param",
      "string": "{object} [options] Additional options for the method.",
      "name": "[options]",
      "description": "Additional options for the method.",
      "types": [
        "object"
      ],
      "typesDescription": "object",
      "optional": true,
      "nullable": false,
      "nonNullable": false,
      "variable": false
    },
    {
      "type": "return",
      "string": "{Promise}",
      "types": [
        "Promise"
      ],
      "typesDescription": "Promise",
      "optional": false,
      "nullable": false,
      "nonNullable": false,
      "variable": false,
      "description": ""
    }
  ],
  "description": {
    "full": "Creates a view </core/views> as the result of the applying the specified aggregation pipeline <aggregation-pipeline> to the source collection or view. Views act as read-only collections, and are computed on demand during read operations. MongoDB executes read operations on views as part of the underlying aggregation pipeline.",
    "summary": "Creates a view </core/views> as the result of the applying the specified aggregation pipeline <aggregation-pipeline> to the source collection or view. Views act as read-only collections, and are computed on demand during read operations. MongoDB executes read operations on views as part of the underlying aggregation pipeline.",
    "body": ""
  },
  "isPrivate": false,
  "isConstructor": false,
  "isClass": false,
  "isEvent": false,
  "ignore": false,
  "line": 369,
  "codeStart": 411,
  "code": "createView(view, source, pipeline, options) {\n  if (source === undefined || source === null) {\n    throw Error('Must specify a backing view or collection');\n  }\n\n  options = options || {};\n  options.viewOn = source;\n\n  // Since we allow a single stage pipeline to be specified as an object\n  // in aggregation, we need to account for that here for consistency.\n  if (pipeline) {\n    if (!Array.isArray(pipeline)) pipeline = [ pipeline ];\n  }\n  options.pipeline = pipeline;\n\n  let cmd = Object.assign({ create: view }, options);\n  return this.runCommand(cmd);\n}",
  "ctx": {
    "type": "method",
    "name": "createView",
    "string": "createView()"
  }
}


text:
#include "FLAME.h"

extern fla_trinv_t* flash_trinv_cntl;

FLA_Error FLASH_Trinv( FLA_Uplo uplo, FLA_Diag diag, FLA_Obj A )
{
  FLA_Error r_val;

  // Check parameters.
  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
    FLA_Trinv_check( uplo, diag, A );

  // Begin a parallel region.
  FLASH_Queue_begin();

  // Enqueue tasks via a SuperMatrix-aware control tree.
  r_val = FLA_Trinv_internal( uplo, diag, A, flash_trinv_cntl );

  // End the parallel region.
  FLASH_Queue_end();

  return r_val;
}

redpajama_set_name: RedPajamaGithub


text:
import java.util.ArrayList;

public class Node extends Root{
	Node parent;
	Root parent_root;

	public Node(Node parent) {
		this.parent = parent;
	}

	public Node(Root parent_root) {
		this.parent_root = parent_root;
	}

	public void setData(ArrayList<Integer> list_signs) {
		this.list_signs.addAll(list_signs);
		this.index = this.list_signs.remove(0);
		this.data.add(this.index);

		if(this.list_signs.size() > 0) {
			//if children doesn't exist create child
			if(!this.children.containsKey(this.index)) {
				this.CreateChild(this.index);
			}
			//save the data in node child
			this.children.get(this.index).setData(this.list_signs);
		}
		this.list_signs.clear();
	}
}


text:
<?php

namespace App\Admin;

use App\Entity\Event;
use App\Entity\EventGroup;
use App\Repository\EventRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;

/**
 * Class EventGroupAdmin.
 */
final class EventGroupAdmin extends AbstractAdmin
{
    /** @var ArrayCollection|null */
    private $prevEvents = null;

    /** @var EventRepository */
    private $eventRepository;

    /**
     * @param string          $code
     * @param class-string    $class
     * @param string          $baseControllerName
     * @param EventRepository $eventRepository
     */
    public function __construct($code, $class, $baseControllerName, EventRepository $eventRepository)
    {
        parent::__construct($code, $class, $baseControllerName);
        $this->eventRepository = $eventRepository;
    }

    /**
     * @param EventGroup $object
     */
    public function preUpdate($object): void
    {
        /** @var Event $event */
        foreach ($this->prevEvents as $event) {
            /** @var EventGroup $object */
            if (!$object->getEvents()->contains($event)) {
                $event->setGroup(null);
            }
        }
        /** @var Event $event */
        foreach ($object->getEvents() as $event) {
            $event->setGroup($object);
        }
    }

    /**
     * @param EventGroup $object
     */
    public function preRemove($object): void
    {
        foreach ($object->getEvents() as $event) {
            $object->removeEvent($event);
        }
    }

    /**
     * Allows you to customize batch actions.
     *
     * @param array $actions List of actions
     *
     * @return array
     */
    protected function configureBatchActions($actions): array
    {
        unset($actions['delete']);

        return $actions;
    }

    /**
     * @param FormMapper $formMapper
     */
    protected function configureFormFields(FormMapper $formMapper): void
    {
        /** @var EventGroup $group */
        $group = $this->getSubject();
        if ($group->getId()) {
            $this->prevEvents = clone $group->getEvents();
        }

        $formMapper
            ->add('name', null, ['label' => 'Название'])
            ->add(
                'events',
                null,
                [
                    'disabled' => null === $group->getId(),
                    'help' => null === $group->getId() ? 'добавление событий возможно только после создания группы' : 'добавьте событие в группу',
                    'label' => 'События',
                ]
            );
    }

    /**
     * @param DatagridMapper $datagridMapper
     */
    protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
    {
        $datagridMapper
            ->add('name')
            ->add(
                'events',
                null,
                [],
                EntityType::class,
                ['choices' => $this->getEvents()]
            );
    }

    /**
     * @param ListMapper $listMapper
     */
    protected function configureListFields(ListMapper $listMapper): void
    {
        $listMapper
            ->addIdentifier('name')
            ->add('events');
    }

    /**
     * @return array
     */
    private function getEvents(): array
    {
        return $this->eventRepository->findBy([], ['id' => Criteria::DESC]);
    }
}


text:
class Solution:
    # @param s, a string
    # @return a string
    def reverseWords(self, s):
        return ' '.join(s.split()[::-1])


text:
<?xml version="1.0"?>
<?xml-model
  href="http://download.ros.org/schema/package_format3.xsd"
  schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>four_wheel_steering_controller</name>
  <version>0.21.0</version>
  <description>Controller for a four wheel steering mobile base.</description>

  <maintainer email="vincent.rousseau@irstea.fr">Vincent Rousseau</maintainer>

  <license>BSD</license>

  <url type="website">http://ros.org/wiki/four_wheel_steering_controller</url>
  <url type="bugtracker">https://github.com/ros-controls/ros_controllers/issues</url>
  <url type="repository">https://github.com/ros-controls/ros_controllers</url>

  <author email="vincent.rousseau@irstea.fr">Vincent Rousseau</author>

  <buildtool_depend>catkin</buildtool_depend>

  <depend>controller_interface</depend>
  <depend>realtime_tools</depend>
  <depend>roscpp</depend>
  <depend>tf</depend>

  <build_depend>four_wheel_steering_msgs</build_depend>
  <build_depend>hardware_interface</build_depend>
  <build_depend>libboost-dev</build_depend>
  <build_depend>nav_msgs</build_depend>
  <build_depend>pluginlib</build_depend>
  <build_depend>urdf_geometry_parser</build_depend>

  <build_export_depend>four_wheel_steering_msgs</build_export_depend>
  <build_export_depend>hardware_interface</build_export_depend>
  <build_export_depend>libboost-dev</build_export_depend>
  <build_export_depend>nav_msgs</build_export_depend>

  <test_depend>controller_manager</test_depend>
  <test_depend>geometry_msgs</test_depend>
  <test_depend>std_msgs</test_depend>
  <test_depend>std_srvs</test_depend>
  <test_depend>rosgraph_msgs</test_depend>
  <test_depend>rostest</test_depend>
  <test_depend>xacro</test_depend>

  <export>
    <controller_interface plugin="${prefix}/four_wheel_steering_controller_plugins.xml"/>
  </export>
</package>


text:
Template._renderedInstances = [];

Template.onRendered(function onRendered() {
  Template._renderedInstances.push(this);
});

Template.onDestroyed(function onDestroyed() {
  var i = Template._renderedInstances.indexOf(this);
  if (i > -1) Template._renderedInstances.splice(i, 1);
});

Template.forEachCurrentlyRenderedInstance = (func) => {
  Template._renderedInstances.forEach(func);
};


text:
package io.github.hidroh.materialistic.accounts;

import android.accounts.AccountAuthenticatorResponse;
import android.accounts.AccountManager;
import android.accounts.NetworkErrorException;
import android.content.Intent;
import android.os.Bundle;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import io.github.hidroh.materialistic.test.TestRunner;
import org.robolectric.RuntimeEnvironment;

import io.github.hidroh.materialistic.BuildConfig;
import io.github.hidroh.materialistic.LoginActivity;

import static org.assertj.android.api.Assertions.assertThat;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;

@RunWith(TestRunner.class)
public class AccountAuthenticatorTest {
    private AccountAuthenticator authenticator;

    @Before
    public void setUp() {
        authenticator = new AccountAuthenticator(RuntimeEnvironment.application);
    }

    @Test
    public void testAddAccount() throws NetworkErrorException {
        Bundle actual = authenticator.addAccount(mock(AccountAuthenticatorResponse.class),
                BuildConfig.APPLICATION_ID, null, null, null);
        assertThat(actual).hasKey(AccountManager.KEY_INTENT);
        Intent actualIntent = actual.getParcelable(AccountManager.KEY_INTENT);
        assertThat(actualIntent)
                .hasComponent(RuntimeEnvironment.application, LoginActivity.class)
                .hasExtra(LoginActivity.EXTRA_ADD_ACCOUNT, true);
    }

    @Test
    public void testUnimplemented() throws NetworkErrorException {
        assertNull(authenticator.editProperties(null, null));
        assertNull(authenticator.confirmCredentials(null, null, null));
        assertNull(authenticator.getAuthToken(null, null, null, null));
        assertNull(authenticator.getAuthTokenLabel(null));
        assertNull(authenticator.updateCredentials(null, null, null, null));
        assertNull(authenticator.hasFeatures(null, null, null));
    }
}


text:
require 'rails_helper'

RSpec.describe Page do
  it_behaves_like 'model with versioning'

  describe 'acts_as_list' do
    let(:site1) { FactoryBot.create(:site) }
    let(:site2) { FactoryBot.create(:site) }

    it 'is not added to list by default' do
      expect(FactoryBot.create(:page)).not_to be_in_list
    end

    it 'is scoped by site' do
      page1 = FactoryBot.create(:page, site: site1)
      page2 = FactoryBot.create(:page, site: site2)
      page1.insert_at(1)
      page2.insert_at(1)

      expect(page1.reload.main_menu_position).to eq 1
    end
  end

  describe 'relations' do
    it { is_expected.to belong_to(:site) }
    it { is_expected.to have_one(:privacy_policy_site).dependent(:nullify) }
  end

  describe 'scopes' do
    describe '.non_private' do
      it 'returns non private pages' do
        page1 = FactoryBot.create(:page)
        page2 = FactoryBot.create(:page)
        FactoryBot.create(:page, private: true)

        expect(described_class.non_private).to contain_exactly(page1, page2)
      end
    end

    describe '.ordered' do
      it 'returns ordered by name' do
        page_c = FactoryBot.create(:page, name: 'Page C')
        page_a = FactoryBot.create(:page, name: 'Page A')
        page_b = FactoryBot.create(:page, name: 'Page B')

        expect(described_class.ordered).to eq [page_a, page_b, page_c]
      end
    end
  end

  describe 'before validations' do
    subject(:page) { described_class.new }

    it { is_expected.to strip_attribute(:name).collapse_spaces }
    it { is_expected.to strip_attribute(:html_content) }
    it { is_expected.to strip_attribute(:custom_html) }

    it 'strips html tags' do
      page.html_content = 'a link<bad>tag</bad>'
      page.valid?
      expect(page.html_content).to eq 'a linktag'
    end
  end

  describe 'validations' do
    subject { FactoryBot.build :page }

    it { is_expected.to validate_presence_of(:site) }

    it { is_expected.not_to allow_value('login').for(:url) }
    it { is_expected.to validate_length_of(:url).is_at_most(64) }
    it { is_expected.to validate_presence_of(:url) }
    it { is_expected.to validate_uniqueness_of(:url).scoped_to(:site_id) }

    it { is_expected.to validate_length_of(:name).is_at_most(64) }
    it { is_expected.to validate_presence_of(:name) }
  end

  describe '#name=' do
    subject(:page) { described_class.new }

    it 'sets url as downcases name' do
      page.name = 'Name'
      expect(page.url).to eq 'name'
    end

    it 'sets url spaces with _' do
      page.name = 'new name'
      expect(page.url).to eq 'new_name'
    end

    it 'works when name is nil' do
      page.name = nil
      expect(page.url).to be_nil
    end
  end

  describe '#to_param' do
    subject(:page) { FactoryBot.create(:page, name: 'Test Page') }

    it 'uses url' do
      expect(page.to_param).to eq 'test_page'
    end

    it 'uses unchanged url' do
      page.url = 'new_page'
      expect(page.to_param).to eq 'test_page'
    end
  end
end


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

namespace ServiceBelt
{
    public class ListResponse<T>
    {
        public int Count { get; set; }
        public int Offset { get; set; }
        public int Limit { get; set; }
        public string DbQuery { get; set; }
        public List<T> Items { get; set; }
    }
}


text:
if(!dojo._hasResource["tests._base.json"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["tests._base.json"] = true;
dojo.provide("tests._base.json");

tests.register("tests._base.json",
	[
		//Not testing dojo.toJson() on its own since Rhino will output the object properties in a different order.
		//Still valid json, but just in a different order than the source string.

		// take a json-compatible object, convert it to a json string, then put it back into json.
		function toAndFromJson(t){
			var testObj = {a:"a", b:1, c:"c", d:"d", e:{e1:"e1", e2:2}, f:[1,2,3], g:"g",h:{h1:{h2:{h3:"h3"}}}};

			var mirrorObj = dojo.fromJson(dojo.toJson(testObj));
			t.assertEqual("a", mirrorObj.a);
			t.assertEqual(1, mirrorObj.b);
			t.assertEqual("c", mirrorObj.c);
			t.assertEqual("d", mirrorObj.d);
			t.assertEqual("e1", mirrorObj.e.e1);
			t.assertEqual(2, mirrorObj.e.e2);
			t.assertEqual(1, mirrorObj.f[0]);
			t.assertEqual(2, mirrorObj.f[1]);
			t.assertEqual(3, mirrorObj.f[2]);
			t.assertEqual("g", mirrorObj.g);
			t.assertEqual("h3", mirrorObj.h.h1.h2.h3);
			var badJson;
			try{
				badJson = dojo.fromJson("bad json"); // this should throw an exception, and not set badJson
			}catch(e){
			}
			t.assertEqual(undefined,badJson);
		}
	]
);

}


text:
<?php
require('_header.php');

if (!isUserAtLeastAdmin())
{
	include('_footer.php');
	exit();
}

$dbh = DBCXn::get();

function getVersion( $dbh )
{
  $st = $dbh->query('SELECT version FROM t_web_app;');
  $row = $st->fetch(PDO::FETCH_ASSOC);
  $ver = htmlenc($row['version']);
  print "
Webite Version is $ver
";
  print 'Change to: <input class="edmedia" type="text" size="10" maxlength="10" name="ver" value="'.$ver.'" />	';
  print '<input type="submit" accesskey="R" value="Set version" name="Save" />';
}

?>

Manage versions

<?php
if  (isset($_POST['ver']))
{
    $ver = $_POST['ver'];

	$query = "UPDATE t_web_app SET version = ?";
    $st = $dbh->prepare($query);
    $st->execute(array($ver));
    $st->closeCursor();
    print 'Version set to '.htmlenc($ver)."
\n";
    redirectTo(htmlenc(substr($_SERVER['PHP_SELF'], 1))); //refresh version in menu bar
}
else
{
    print  '<form name="theform" id="theform" method="post" action="' . htmlenc($_SERVER['PHP_SELF']) . '">'."\n";
    print getVersion($dbh);
    print '</form>';
}

?>

<?
include('_footer.php');
?>


text:
const gulp = require('gulp');
const imagemin = require('gulp-imagemin');
const rename = require('gulp-rename');
const replace = require('gulp-replace');
const pngquant = require('imagemin-pngquant');
const svgstore = require('gulp-svgstore');

const conf = require('../gulpconfig');

//*------------------------------------*\
//     $SVG INLINE ICONS
//*------------------------------------*/
const imagesMinifyInlineSvgIcons = gulp.task(
  'images:minify:inlinesvgicons',
  done => {
    gulp
      .src(`${conf.path.dev.img}/raw/svg/inline-icons/*.svg`)
      .pipe(rename({prefix: 'icon-'}))
      .pipe(
        imagemin([
          imagemin.svgo({
            plugins: [{removeViewBox: false}],
          }),
        ]),
      )
      .pipe(svgstore({inlineSvg: true}))
      .pipe(rename({extname: '.svg.php'}))
      .pipe(gulp.dest(`${conf.path.dev.views}/partials/svg`));

    return done();
  },
);

//*------------------------------------*\
//     $MINIFY IMAGES
//*------------------------------------*/
const imagesMinify = gulp.task('images:minify', done => {
  gulp
    .src(`${conf.path.dev.img}/raw/**/*.{jpg,jpeg,png,svg}`)
    .pipe(
      imagemin([
        imagemin.gifsicle({interlaced: true}),
        imagemin.mozjpeg({progressive: true}),
        imagemin.optipng({optimizationLevel: 3}),
        imagemin.svgo({
          plugins: [{removeViewBox: false}, {cleanupIDs: false}],
        }),
      ]),
    )
    .pipe(gulp.dest(conf.path.dev.img));

  return done();
});

//*------------------------------------*\
//     $OPTIMISE SVG PARTIALS
//*------------------------------------*/
const imagesMinifySvgPartials = gulp.task('images:minify:svgpartials', done => {
  gulp
    .src(`./${conf.path.dev.views}/partials/svg/raw/**/*.svg`)
    .pipe(replace('<g id=', '<g class='))
    .pipe(
      imagemin([
        imagemin.svgo({
          plugins: [{removeViewBox: false}, {cleanupIDs: {prefix: 'svgo-'}}],
        }),
      ]),
    )
    .pipe(rename({extname: '.svg.php'}))
    .pipe(gulp.dest(`${conf.path.dev.views}/partials/svg`));

  return done();
});

//*------------------------------------*\
//     $IMAGES WATCH
//*------------------------------------*/
const imagesWatch = gulp.task(
  'images:watch',
  gulp.series('images:minify', done => done()),
);
gulp.task(
  'images:watch:svgpartials',
  gulp.series('images:minify:svgpartials', done => done()),
);
gulp.task(
  'images:watch:inlinesvgicons',
  gulp.series('images:minify:inlinesvgicons', done => done()),
);

module.exports = {
  imagesMinifyInlineSvgIcons,
  imagesMinifySvgPartials,
  imagesWatch,
};


text:
<Alloy>
	<NavigationWindow platform="ios" id="navWin">
		<Window title="Pando" color="#ffffff" id="win">
			<View layout="vertical" id="loadingBar" height="0" width="120" borderRadius="15" backgroundColor="#2E2E2E" >
		        <ActivityIndicator id="activityIndicator" />
		    	<Label top="5" text="Loading" color="#ffffff" />
			</View>
			<View class="wfill hfill vert"  backgroundImage="/images/home_background.jpg">
				<ImageView image="/images/full_logo.png"  top="10" width="50%" />
				<TextField id="username" hintText="Username"></TextField>
				<TextField id="password" hintText="Password" passwordMask="true"></TextField>
				<Button onClick="do_login" class="button" title="Login"></Button>
				<Button onClick="do_signup" class="button" backgroundColor="#5375BD" title="Register"></Button>
			</View>
		</Window>
	</NavigationWindow>
</Alloy>


text:
package org.atlasapi.messaging;

import org.atlasapi.entity.ResourceRef;

import com.metabroadcast.common.time.Timestamp;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

@JsonDeserialize(builder = EquivalenceAssertionMessage.Builder.class)
public class EquivalenceAssertionMessageConfiguration {

    public static class Builder {

        @JsonCreator
        public Builder(
                @JsonProperty("messageId") String messageId,
                @JsonProperty("timestamp") Timestamp timestamp,
                @JsonProperty("subject") ResourceRef subject) {
        }

    }

}


text:
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.Azure.Management.TrafficManager;

namespace Microsoft.Azure.Management.TrafficManager
{
    /// <summary>
    /// Client for creating, updating, listing and deleting Azure Traffic
    /// Manager profiles  (see
    /// http://azure.microsoft.com/en-gb/documentation/articles/traffic-manager-overview/
    /// for more information)
    /// </summary>
    public partial interface ITrafficManagerManagementClient : IDisposable
    {
        /// <summary>
        /// Gets the API version.
        /// </summary>
        string ApiVersion
        {
            get;
        }

        /// <summary>
        /// Gets the URI used as the base for all cloud service requests.
        /// </summary>
        Uri BaseUri
        {
            get;
        }

        /// <summary>
        /// Gets subscription credentials which uniquely identify Microsoft
        /// Azure subscription. The subscription ID forms part of the URI for
        /// every service call.
        /// </summary>
        SubscriptionCloudCredentials Credentials
        {
            get;
        }

        /// <summary>
        /// Gets or sets the initial timeout for Long Running Operations.
        /// </summary>
        int LongRunningOperationInitialTimeout
        {
            get; set;
        }

        /// <summary>
        /// Gets or sets the retry timeout for Long Running Operations.
        /// </summary>
        int LongRunningOperationRetryTimeout
        {
            get; set;
        }

        /// <summary>
        /// Operations for managing Traffic Manager endpoints.
        /// </summary>
        IEndpointOperations Endpoints
        {
            get;
        }

        /// <summary>
        /// Operations for managing Traffic Manager profiles.
        /// </summary>
        IProfileOperations Profiles
        {
            get;
        }
    }
}


text:
<?php
use yii\helpers\Html;
use yii\grid\GridView as Gridview2;
use kartik\grid\GridView;
use yii\helpers\Url;
use yii\helpers\Inflector;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\pusdiklat\planning\models\TrainerSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$controller = $this->context;
$menus = $controller->module->getMenuItems();
$this->params['sideMenu'][$controller->module->uniqueId]=$menus;

$this->title = Yii::t('app', 'Choose Student');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Training Activities'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', ''.Inflector::camel2words($model->training->activity->name)), 'url' => ['student','id'=>$model->id]];
/* $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Trainer Recommendation : '.$program_subject->name), 'url' => ['subject-trainer','id' => $model->id, 'subject_id' => $program_subject->id]];  */
$this->params['breadcrumbs'][] = $this->title;
?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'kartik\grid\SerialColumn'],

			[
				'attribute' => 'name',
				'header' => '
Name
',
				'vAlign'=>'middle',
				'headerOptions'=>['class'=>'kv-sticky-column'],
				'contentOptions'=>['class'=>'kv-sticky-column'],
				'format' => 'raw',
				'value' => function ($data){
					return Html::a($data->person->front_title.' '.$data->person->name.' '.$data->person->back_title,['./person/view','id'=>$data->person_id],
						['class'=>'modal-heart','title'=>$data->person->name,'source'=>'div.panel-body','data-toggle'=>'tooltip']);
				}
			],
			[
				'attribute' => 'phone',
				'vAlign'=>'middle',
				'hAlign'=>'center',
				'headerOptions'=>['class'=>'kv-sticky-column'],
				'contentOptions'=>['class'=>'kv-sticky-column'],
				'format' => 'raw',
				'value' => function ($data){
					return Html::a($data->person->phone,['./person/view','id'=>$data->person_id],
						['class'=>'modal-heart badge','title'=>$data->person->phone,'source'=>'div.panel-body','data-toggle'=>'tooltip']);
				}
			],

			[
				'attribute' => 'nid',
				'vAlign'=>'middle',
				'hAlign'=>'center',
				'width'=>'150px',
				'headerOptions'=>['class'=>'kv-sticky-column'],
				'contentOptions'=>['class'=>'kv-sticky-column'],
				'format' => 'raw',
				'value' => function ($data){
					return Html::tag('span',$data->person->nid,['class'=>'label label-default']);
				}
			],

			[
				'attribute' => 'nip',
				'vAlign'=>'middle',
				'hAlign'=>'center',
				'width'=>'150px',
				'headerOptions'=>['class'=>'kv-sticky-column'],
				'contentOptions'=>['class'=>'kv-sticky-column'],
				'format' => 'raw',
				'value' => function ($data){
					return Html::tag('span',$data->person->nip,['class'=>'label label-default']);
				}
			],
            [
				'label' => 'Action',
				'vAlign'=>'middle',
				'hAlign'=>'center',
				'width'=>'100px',
				'headerOptions'=>['class'=>'kv-sticky-column'],
				'contentOptions'=>['class'=>'kv-sticky-column'],
				'format'=>'raw',
				'value' => function ($data) use ($model){
					$trainingStudentCount = \backend\models\TrainingStudent::find()
						->where([
							'training_id' => $model->id,
							'student_id' => $data->person_id,
						])
						->count();
					if($trainingStudentCount>0){
						return Html::tag('span', '', [
							'class'=>'label label-success',
							'title'=>'Peserta Diklat',
							'data-toggle'=>'tooltip',
						]);
					}
					$icon = '';
					return Html::a($icon,
						['set-student','id'=>$model->id,'student_id'=>$data->person_id],
						[
							'class'=>'label label-warning modal-heart',
							'data-toggle'=>'tooltip',
							'data-pjax'=>'0',
							'data-html'=>'true',
							'title'=>'Daftarkan',
							'modal-title'=>'',
							'modal-size'=>'modal-lg'
						]);
				},
			],
        ],
		'panel' => [
			'heading'=>'
 '.Html::encode($this->title).'
',
			'before'=>
				Html::a(' Back ', ['student','id'=>$model->id], ['class' => 'btn btn-warning']).' ',
			 'after'=>Html::a(' Reset Grid', Url::to(''), ['class' => 'btn btn-info']),
			'showFooter'=>false
		],
		'responsive'=>true,
		'hover'=>true,
    ]); ?>

	<?= \hscstudio\heart\widgets\Modal::widget() ?>

	Jika data peserta tidak ditemukan, maka Anda di perkenankan untuk memasukkan data peserta baru.

	<?php
	echo Html::a(' Tambah Data Peserta Baru ', ['activity/create-person'], [
		'class' => 'btn btn-success',
		'data-confirm' => 'Apakah Anda yakin akan menambah data peserta baru! pastikan tidak terjadi duplikasi data!',
	]);
	?>


text:
FBAGameInputConfigStore::FBAGameInputConfigStore()
{

}

FBAGameInputConfigStore::FBAGameInputConfigStore(QString filePath)
{
    this->filePath = filePath;
}

FBAGameInputConfigStore::~FBAGameInputConfigStore()
{

}

void FBAGameInputConfigStore::setFilePath(QString filePath)
{
    this->filePath = filePath;
}

int FBAGameInputConfigStore::parseInputConfig()
{
    return 0;
}

bool FBAGameInputConfigStore::setMapping(VKey p1k, VKey p2k)
{
    if (this->playerMapping.contains(p1k)) {
        this->playerMapping[p1k] = p2k;
        return false;
    } else {
        this->playerMapping.insert(p1k, p2k);
        return true;
    }
}

VKey FBAGameInputConfigStore::operator[](const VKey p1k)
{
    if (this->playerMapping.contains(p1k)) return this->playerMapping[p1k];
    else return 0x0;
}

VKey FBAGameInputConfigStore::operator()(const VKey p2k)
{
    if (this->playerMapping.values().contains(p2k)) return this->playerMapping.key(p2k);
    else return 0x0;
}


text:
// Generated by CoffeeScript 1.7.1
(function() {
  var beginHtml, child_process, colors, convert, debounce, endHtml, ensureValidJson, extend, fse, isString, path, spawnMocha, _ref;

  child_process = require('child_process');

  path = require('path');

  colors = require('colors');

  _ref = require('lodash'), extend = _ref.extend, debounce = _ref.debounce, isString = _ref.isString;

  fse = require('fs-extra');

  convert = new (require('ansi-to-html'))();

  beginHtml = function(writeStream, title) {
    return writeStream.write('\n' + '<title>' + title + '</title>' + '\n' + '<meta charset="UTF-8" />\n' + '\n');
  };

  endHtml = function(writeStream) {
    return writeStream.end('\n\n');
  };

  ensureValidJson = function(jsonPath, seedJson) {
    var e, unknownJson;
    if (seedJson == null) {
      seedJson = {};
    }
    try {
      return unknownJson = fse.readJsonSync(jsonPath);
    } catch (_error) {
      e = _error;
      return fse.outputJsonSync(jsonPath, seedJson);
    }
  };

  /*
    Spawn an individual mocha process.
    @options:
      @mochaPath[String] - Absolute path to the mocha binary. Generally found at `./node_modules/mocha/bin/mocha`
      @mochaArgs[Array] - Command line arguments to pass to mocha. DO NOT INCLUDE TEST FILES HERE!
      @testFileDisplay[String] - The display name of your test file to be used in logging
      @basePath[String] - Absolute path to root directory of your application
      @reportsDir[String, optional, default="test-results/reports"] - Folder where HTML
                  versions of test outputs will be stored
      @reportsBaseUrl[String, optional] - URL base path where HTML test output will be hosted.
                  HTML report path structure should mimic the `reportsDir` structure
      @childEnv[Object, optional] - Environment variables you wish to pass to the mocha process
      @liveOutput[Bool, optional, default=false] - Flag to enable the live test output for this mocha spawn
      @singleRun[Bool, optional, default=false] - Flag to enable the live test output for this mocha spawn
      @afterSpawnFn[Function, optional] - Function that will run immediately after mocha is spawned. It will
                  be passed the PID for the mocha process, and if the return value is a string it will be
                  logged otherwise the output is ignored
      @heartbeatPulseTime[Number, optional, default=5000] - Number of milliseconds to wait before logging
                  output of current test's uptime
      @customLogOpts[Object, optional, default=false] - Options for enabling an additional custom html report
        @reportTitle[String, optional, default='Custom Report'] - Used for title of custom report
        @reportType[String, optional, default='html'] - Determines output of custom report. Either 'html' or 'json'. If 'json'
          the logged output between the prefix & suffix must be valid JSON or it wont work.
          Pro tip for json logs: Use `JSON.stringify(logObj, null, '\t');`
        @matchPrefix[String, required] - Used as part of a regex to denote the opening annotation to look for within the logs
        @matchSuffix[String, required] - Used as part of a regex to denote the closing annotation to look for within the logs
    @done[Function] - Callback to be run after the mocha process exits. Will be passed `error` and `testStats`
   */

  module.exports = spawnMocha = function(options, done) {
    var afterSpawnFn, args_and_files, basePath, base_report_path, childEnv, customLogEnabled, customLogOpts, customLogRegex, customLogTitle, custom_log, custom_log_path, custom_report_path, errStr, heartbeatLog, heartbeatPulseTime, liveOutput, matchCustomData, matchPrefix, matchSuffix, mochaArgs, mochaPath, mocha_and_args, reportTitle, reportType, reportsBaseUrl, reportsDir, singleRun, startTime, testFileDisplay, testWrapper, test_heartbeat, test_log, test_log_path, test_run, usefulSpawnInfo, _ref1;
    mochaPath = options.mochaPath, mochaArgs = options.mochaArgs, basePath = options.basePath, reportsDir = options.reportsDir, reportsBaseUrl = options.reportsBaseUrl, liveOutput = options.liveOutput, singleRun = options.singleRun, afterSpawnFn = options.afterSpawnFn, heartbeatPulseTime = options.heartbeatPulseTime, childEnv = options.childEnv, customLogOpts = options.customLogOpts, testFileDisplay = options.testFileDisplay;
    if (customLogEnabled = !!customLogOpts) {
      reportTitle = customLogOpts.reportTitle, reportType = customLogOpts.reportType, matchPrefix = customLogOpts.matchPrefix, matchSuffix = customLogOpts.matchSuffix;
      if (reportType == null) {
        reportType = 'html';
      }
      matchCustomData = '([^]+)';
      customLogRegex = RegExp("" + matchPrefix + matchCustomData + matchSuffix);
      console.log("Custom " + reportType + " report enabled! Looking for logs which match:", customLogRegex);
    }
    testWrapper = require.resolve('./test-wrapper');
    args_and_files = mochaArgs.concat(testWrapper);
    mocha_and_args = [mochaPath].concat(args_and_files);
    test_heartbeat = null;
    heartbeatLog = debounce(function() {
      var t;
      t = Date.now() - startTime;
      return process.stdout.write(("Test run " + testFileDisplay + " is still pending. Uptime thus far: " + (t / 1000) + "s\n").grey);
    }, 1000);
    errStr = '';
    base_report_path = "/" + reportsDir + "/" + testFileDisplay + ".report.html";
    test_log_path = path.resolve("" + basePath + base_report_path);
    customLogTitle = "" + (reportTitle != null ? reportTitle : 'Custom Report') + " -- " + testFileDisplay;
    if (reportsBaseUrl != null) {
      childEnv.TEST_RESULTS_URL = "" + reportsBaseUrl + base_report_path;
    }
    fse.outputFileSync(test_log_path, '');
    test_log = fse.createWriteStream(test_log_path, {
      encoding: 'utf8'
    });
    beginHtml(test_log, testFileDisplay);
    if (customLogEnabled) {
      custom_report_path = "/" + reportsDir + "/" + testFileDisplay + "." + ((_ref1 = reportTitle != null ? reportTitle.replace(/\s/g, '.') : void 0) != null ? _ref1 : 'custom') + ".report." + reportType;
      custom_log_path = path.resolve("" + basePath + custom_report_path);
      fse.outputFileSync(custom_log_path, '');
    }
    if (customLogEnabled && reportType === 'html') {
      custom_log = fse.createWriteStream(custom_log_path, {
        encoding: 'utf8'
      });
      beginHtml(custom_log, customLogTitle);
    }
    if (customLogEnabled && reportType === 'json') {
      ensureValidJson(custom_log_path, []);
    }
    console.info("Trying to spawn...".green);
    startTime = Date.now();
    test_run = child_process.spawn('node', mocha_and_args, {
      env: childEnv,
      cwd: basePath
    });
    usefulSpawnInfo = typeof afterSpawnFn === "function" ? afterSpawnFn(test_run.pid) : void 0;
    if (!isString(usefulSpawnInfo)) {
      usefulSpawnInfo = "Spawned Mocha test " + testFileDisplay + ". Mocha pid: " + test_run.pid + ".";
    }
    test_log.write(usefulSpawnInfo.magenta);
    console.log(usefulSpawnInfo.magenta);
    test_run.stderr.on('data', function(data) {
      if (/^execvp\(\)/.test(data)) {
        console.log(("Failed to start test " + testFileDisplay).yellow);
      }
      process.stdout.write(("error from run " + testFileDisplay + ":\n" + (data.toString())).red);
      errStr += "" + (data.toString());
      data = convert.toHtml(data.toString());
      return test_log.write(data);
    });
    test_run.stdout.on('data', function(data) {
      var customJsonLog, custom_data, custom_matches, dataStr, e, err, errLog, ignore, include_in_custom_log, _e, _i, _len, _ref2, _ref3;
      dataStr = data.toString();
      if (singleRun || liveOutput) {
        process.stdout.write("" + dataStr);
      } else {
        heartbeatLog();
      }
      if (test_heartbeat != null) {
        clearTimeout(test_heartbeat);
      }
      test_heartbeat = setTimeout(heartbeatLog, heartbeatPulseTime);
      try {
        data = convert.toHtml("" + dataStr + "
");
        test_log.write(data);
      } catch (_error) {
        e = _error;
        errLog = ['Error while trying to write HTML log'.red, e ? JSON.stringify(e, null, '  ') : void 0, (_ref2 = (_ref3 = e.stack) != null ? _ref3 : '[no stack]') != null ? _ref2.red : void 0];
        for (_i = 0, _len = errLog.length; _i < _len; _i++) {
          _e = errLog[_i];
          console.log(_e);
          try {
            test_log.write(convert.toHtml(_e));
          } catch (_error) {}
        }
      }
      if (customLogEnabled) {
        include_in_custom_log = !!(custom_matches = customLogRegex.exec(dataStr));
        if (include_in_custom_log) {
          ignore = custom_matches[0], custom_data = custom_matches[1];
          if (reportType === 'html') {
            custom_data = convert.toHtml(custom_data);
            custom_log.write("" + custom_data + "

");
          }
          if (reportType === 'json') {
            try {
              customJsonLog = fse.readJsonSync(custom_log_path);
              custom_data = JSON.parse(custom_data);
            } catch (_error) {
              err = _error;
              console.log('~~~custom_matches', custom_matches);
              console.log('~~~wrong!!', err);
              return;
            }
            customJsonLog.push(custom_data);
            return fse.writeJsonSync(custom_log_path, customJsonLog);
          }
        }
      }
    });
    return test_run.on('exit', function(code) {
      var endTime, returnObj, totalTime;
      endTime = Date.now();
      clearTimeout(test_heartbeat);
      endHtml(test_log);
      if (customLogEnabled && reportType === 'html') {
        endHtml(custom_log);
      }
      totalTime = endTime - startTime;
      console.log(("Mocha test " + testFileDisplay + " has exited (code: " + code + "). Process uptime: " + (totalTime / 1000) + "s").yellow);
      returnObj = {
        testName: testFileDisplay,
        child_pid: test_run.pid,
        child_uptime: totalTime,
        test_errors: errStr != null ? errStr : null,
        errorMsg: null
      };
      if (code !== 0) {
        returnObj.errorMsg = "Mocha test (" + testFileDisplay + ") exited with " + code + " failed tests";
      }
      return typeof done === "function" ? done(null, returnObj) : void 0;
    });
  };

}).call(this);


text:
var fs = require('fs');
var irc = require('irc');

var config = require('./config' + (process.env.NODE_ENV === 'production' ? '.production' : ''));
var plugins = fs.readdirSync('./plugins');

var client = new irc.Client(
    process.env.IRCBOT_SERVER || config.irc.server,
    process.env.IRCBOT_NICKNAME || config.irc.nickname,
    config.irc.options
);

client.addListener('error', function (error) {
    console.error('error: ', error);
});

client.addListener('registered', function (raw) {
    !!process.env.IRCBOT_DEBUG && console.log('REGISTERED: ', raw);

    process.env.IRCBOT_NICKSERV ?
        client.say('NickServ', 'identify ' + process.env.IRCBOT_NICKSERV) :
        console.error('WARNING: IRCBOT NICKSERV PASSWORD missing - set env IRCBOT_NICKSERV');
});

// load plugins
plugins.forEach(function (plugin) {

    if (config.plugins[plugin] !== false) {
        require('./plugins/' + plugin + '/').init(client, config);
    }

});
console.log("PLUGINS: loaded");


text:
title: Grammaire N2, langage soutenu.
layout: post
date: 2014-07-18
img: gramn2.jpg
category: langue-japonaise
description: Les huit points suivants sont principalement utilisés à l'écrit.
permalink: /langue-japonaise/langage-soutenu/
tags:
- Grammaire
- JLPT2
- Langue-japonaise
- avancé

---

# につき

Terme utilisé pour définir une raison dans une annonce écrite et assimilé, comme par exemple 雨天につき中止。

Au niveau du sens, につき peut être considéré comme l'équivalent de ので ou だから.
- A utiliser après un nom : N+につき

quelques exemples :

<ruby><rb>清掃</rb><rt>せいそう</rt></ruby>中につき、お足元にご注意ください。

- -traduction grammaticale: Parce que c'est en cours de nettoyage, faites attention au sol glissant.

- traduction de sens: Attention! sol glissant.

会場内は<ruby><rb>禁煙</rb><rt>きんえん</rt></ruby>につき、おタバコご<ruby><rb>遠慮</rb><rt>えんりょ</rt></ruby>ください。

- traduction grammaticale: Ce lieu étant non fumeur, merci de vous retenir de fumer.

- traduction de sens: Prière de ne pas fumer.

4月15日(水):<ruby><rb>佐藤医師</rb><rt>さとういし</rt></ruby>、学会主席につき<ruby><rb>休診</rb><rt>きゅうしん</rt></ruby>。
- En raison de sa participation à une conférence scientifique, le docteur Satou sera absent le mercredi 15 avril.

# を<ruby><rb>問</rb><rt>と</rt></ruby>わず

Ce terme signifie:  indépendamment, quel que soit, ou que ce soit, qui que ce soit.

Au niveau du sens, を問わず peut être considéré comme l'équivalent de <ruby><rb>関</rb><rt>かん</rt></ruby><ruby><rb>係</rb><rt>けい</rt></ruby>なく.

* A utiliser après un nom: N+を問わず

quelques exemples :

このスポーツセンターは、年齢を問わず、どなたでも利用出来ます。

* Quel que soit votre age, nous vous souhaitons la bienvenue dans ce centre sportif.

このスーパーは<ruby><rb>昼夜</rb><rt>ちゅうや</rt></ruby>を問わず、営業しているので、<ruby><rb>深夜</rb><rt>しんや</rt></ruby>も働く人にとってありがたい。

*  Quel que soit l'heure du jour ou de la nuit, ce super-marché est toujours ouvert, nous pensons également aux personnes qui finissent tard.

経験の有無を問わず、やる気のある社員を<ruby><rb>募集</rb><rt>ぼしゅう</rt></ruby>します。

*  Indépendamment de l'expérience professionnelle, nous recrutons des employés ayant l'envie de s'impliquer.

# に<ruby><rb>限</rb><rt>かぎ</rt></ruby>り

Ce terme signifie: juste, seulement, uniquement, dans le cadre de.

Au niveau du sens, に限り peut être considéré comme l'équivalent de だけ.

*  A utiliser après un nom: N+にかぎり

quelques exemples:

このコーナーのバッグに限り、全品3000円。
* Tous les articles sont à 3000 yens uniquement dans ce rayon de sacs.

<ruby><rb>工場</rb><rt>こうじょう</rt></ruby>の見学は予約された方に限ります。

*  La visite de l'usine est seulement accessible sous réservation.

初めてのお客様に限り、無料お試しセットをお申し込みいただけます。

*  Seul les premiers clients pourront bénéficier d'un menu gratuit.

# に<ruby><rb>応</rb><rt>おう</rt></ruby>じ(て)

Ce terme signifie: en fonction de, ne peut être utilisé qu'après ces contextes : l'envie, l'âge, une location, une requête, un budget, de l'argent, des capacités ou de l'expérience.

Au niveau du sens, に応じて peut être considéré comme l'équivalent de によって.

*  A utiliser après un nom: N+ に応じ(て)

quelques exemples:

給料は能力や経験に応じ、決めさせていただきます。
* Le salaire sera définie en fonction de l'expériences et des capacités.

新年会はご<ruby><rb>予算</rb><rt>よさん</rt></ruby>に応じて、色々なコースがございます。
- Pour la fête du nouvel an,  nous avons plusieurs formules en fonction des budgets de chacun.

会社は社員の<ruby><rb>要望</rb><rt>ようぼう</rt></ruby>に応じて社員<ruby><rb>食堂</rb><rt>しょくどう</rt></ruby>のメニューを増やした。

* La société a augmenté la variété des plats de la cantine en conformité avec les besoins des employés.

# にかかわらず

Ce terme signifie: peu importe, ne peut être utilisé qu'après ces contextes : Le temps (météo), des préférences, positions sociales, une action faite ou pas, une chose présente ou non.

Au niveau du sens, にかかわらず peut être considéré comme l'équivalent de <ruby><rb>関</rb><rt>かん</rt></ruby><ruby><rb>係</rb><rt>けい</rt></ruby>なく.

* A utiliser après un nom ou un verbe:
N+にかかわらず
V - る ou V - ない+ にかかわらず

quelques exemples:

今回の旅行<ruby><rb>星雲</rb><rt>せいう</rt></ruby>にかかわらず、<ruby><rb>実施</rb><rt>じっし</rt></ruby>します。

* Peu importe qu'il neige ou qu'il vente, je pars en voyage.

セール品のため理由のいかんにかかわらず、<ruby><rb>返品</rb><rt>へんぴん</rt></ruby>はお受けできません。
*  Une fois le produit acheté les retours ne sont pas acceptés, peu importe la raison.

# において

Ce terme signifie: en, dans, Est très rarement utilisé à l'oral, il me semble l'avoir entendu quelques fois aux infos, gardez en tête que c'est un terme écrit.

Au niveau du sens, において peut être considéré comme l'équivalent des particules de liaison に ou で.
- A utiliser après un nom : N+において

quelques exemples :

入学式は、3<ruby><rb>階</rb><rt>かい</rt></ruby>のホールにおいて行われます。
* La cérémonie d'accueil des nouveaux étudiants aura lieu dans la salle située au troisième étage.

日本だけではなく、ほかの国においても、<ruby><rb>環境汚染</rb><rt>かんきょうおせん</rt></ruby>は<ruby><rb>深刻</rb><rt>しんこく</rt></ruby>な問題だ。

- Pas seulement au japon mais également dans les autres pays, la pollution de l'environnement est un sérieux problème .

# <ruby><rb>際</rb><rt>さい</rt></ruby>

Ce terme signifie: pour , si, dans ce cas, en ce qui concerne, sert à définir un cas précis.

Au niveau du sens, 際 peut être considéré comme l'équivalent de のとき ou の場合.

* A utiliser après un nom ou un verbe:
N + の 際
V - る ou V- た + 際

quelques exemples:

カードを<ruby><rb>紛失</rb><rt>ふんしつ</rt></ruby>した際はサービスセンターにご連絡ください。
- En cas de perte de votre carte, merci de contacter le service client.

入学手続きの際に必要なものは<ruby><rb>下記</rb><rt>かき</rt></ruby>の通り。

* Pour la procédure d'inscription en tant que nouvel étudiant, les éléments nécessaires figurent dans les lignes suivantes

# こと

Ce terme signifie: prière de, merci de .  Est utiliser pour définir une règle ou un avertissement.

Au niveau du sens, こと peut être considéré comme l'équivalent de べき.

* A utiliser après un nom ou un verbe:
N + の こと
V - る ou V- ない + こと

quelques exemples:

<ruby><rb>寮</rb><rt>りょう</rt></ruby>の<ruby><rb>台所</rb><rt>だいどころ</rt></ruby>はきれいに使用すること。
* Prière d'utiliser proprement la cuisine du dortoir.

<ruby><rb>願書</rb><rt>がんしょ</rt></ruby>は1月28日<ruby><rb>必着</rb><rt>ひっちゃく</rt></ruby>のこと。

- Merci d'adresser vos demandes avant le 28 janvier au plus tard.


text:
<?php
/**
 * This file is part of BraincraftedBootstrapBundle.
 * (c) 2012-2013 by Florian Eckerstorfer
 */

namespace Saxulum\SaxulumBootstrapProvider\Form\Type;

use Symfony\Component\Form\Extension\Core\Type\MoneyType as BaseMoneyType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;

/**
 * MoneyType
 *
 * @package    BraincraftedBootstrapBundle
 * @subpackage Form
 * @author     Florian Eckerstorfer <florian@eckerstorfer.co>
 * @copyright  2012-2013 Florian Eckerstorfer
 * @license    http://opensource.org/licenses/MIT The MIT License
 * @link       http://bootstrap.braincrafted.com Bootstrap for Symfony2
 */
class MoneyType extends BaseMoneyType
{
    /**
     * {@inheritdoc}
     */
    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $view->vars['money_pattern'] = self::getPattern($options['currency']);
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'money';
    }

    /**
     * Returns the pattern for this locale
     *
     * The pattern contains the placeholder "{{ widget }}" where the HTML tag should
     * be inserted
     *
     * @param string $currency
     *
     * @return string Returns the pattern
     */
    protected static function getPattern($currency)
    {
        if (!$currency) {
            return '{{ widget }}';
        }

        $locale = \Locale::getDefault();

        if (!isset(self::$patterns[$locale])) {
            self::$patterns[$locale] = array();
        }

        if (!isset(self::$patterns[$locale][$currency])) {
            $format = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
            $pattern = $format->formatCurrency('123', $currency);

            // the spacings between currency symbol and number are ignored, because
            // a single space leads to better readability in combination with input
            // fields
            // the regex also considers non-break spaces (0xC2 or 0xA0 in UTF-8)

            preg_match(
                '/^([^\s\xc2\xa0]*)[\s\xc2\xa0]*123(?:[,.]0+)?[\s\xc2\xa0]*([^\s\xc2\xa0]*)$/u',
                $pattern,
                $matches
            );

            self::$patterns[$locale][$currency] = self::parsePatternMatches($matches);
        }

        return self::$patterns[$locale][$currency];
    }

    /**
     * Parses the given pattern matches array and returns the pattern string.
     *
     * @param array $matches Pattern matches
     *
     * @return string Pattern
     */
    protected static function parsePatternMatches(array $matches)
    {
        if (!empty($matches[1])) {
            return '{{ tag_start }}'.$matches[1].'{{ tag_end }} {{ widget }}';
        }

        if (!empty($matches[2])) {
            return '{{ widget }} {{ tag_start }}'.$matches[2].'{{ tag_end }}';
        }

        // @codeCoverageIgnoreStart
        return '{{ widget }}';
        // @codeCoverageIgnoreEnd
    }
}


text:
<?php

namespace Commun\Grid;

use \Zend\ServiceManager\ServiceLocatorInterface;
use \Zend\Mvc\Controller\PluginManager;
use \Zend\Mvc\Controller\Plugin\Url;

/**
 * @author Antarus
 * @project Raid-TracKer
 */
class ItemsGrid extends \ZfTable\AbstractTable {

    /**
     * @var ServiceLocatorInterface
     */
    private $_serviceLocator = null;

    /**
     * @var \Zend\Mvc\Controller\PluginManager
     */
    private $_pluginManager = null;

    /**
     * @var \Zend\Mvc\Controller\Plugin\Url
     */
    private $_url = null;

    /**
     * @var \Zend\I18n\Translator\Translator
     */
    private $_servTranslator = null;
    protected $config = array(
        'name' => 'List',
        'showPagination' => true,
        'showQuickSearch' => false,
        'showItemPerPage' => true,
        'itemCountPerPage' => 20,
        'showColumnFilters' => true,
    );
    protected $headers = array(
        'idItem' => array(
            'title' => 'IdItem',
            'width' => '100',
            'filters' => 'text',
        ),
        'nom' => array(
            'title' => 'Nom',
            'width' => '100',
            'filters' => 'text',
        ),
        'ajouterPar' => array(
            'title' => 'AjouterPar',
            'width' => '100',
            'filters' => 'text',
        ),
        'majPar' => array(
            'title' => 'MajPar',
            'width' => '100',
            'filters' => 'text',
        ),
        'idBnet' => array(
            'title' => 'idBnet',
            'width' => '100',
            'filters' => 'text',
        ),
        'couleur' => array(
            'title' => 'Couleur',
            'width' => '100',
            'filters' => 'text',
        ),
        'edit' => array(
            'title' => 'Modifier',
            'width' => '100',
        ),
        'delete' => array(
            'title' => 'Supprimer',
            'width' => '100',
        ),
    );

    /**
     * Constructeur du tableau.
     *
     * @param ServiceLocatorInterface
     * @param PluginManager
     */
    public function __construct(ServiceLocatorInterface $oServiceLocator, PluginManager $oPluginManager) {
        $this->_serviceLocator = $oServiceLocator;
        $this->_pluginManager = $oPluginManager;
    }

    /**
     * Retourne le plugin url.
     *
     * @var \Zend\Mvc\Controller\PluginManager
     */
    public function url() {
        if (!$this->_url) {
            $this->_url = $this->_pluginManager->get('url');
        }
        return $this->_url;
    }

    /**
     * Retourne le translator.
     *
     * @var \Zend\I18n\Translator\Translator
     */
    public function _getServTranslator() {
        if (!$this->_servTranslator) {
            $this->_servTranslator = $this->_serviceLocator->get('translator');
        }
        return $this->_servTranslator;
    }

    public function init() {
        $this->getHeader("edit")->getCell()->addDecorator("callable", array(
            "callable" => function($context, $record) {
                return sprintf("url()->fromRoute('backend-items-update', array('id' => $record["idItem"])) . "\"> " . $this->_getServTranslator()->translate("Modifier") . "", $record["idItem"]);
            }
                ));

                $this->getHeader("delete")->getCell()->addDecorator("callable", array(
                    "callable" => function($context, $record) {
                        return sprintf("url()->fromRoute('backend-items-delete', array('id' => $record["idItem"])) . "\" onclick=\"if (confirm('" . $this->_getServTranslator()->translate("Etes vous sur?") . "')) {document.location = this.href;} return false;\"> " . $this->_getServTranslator()->translate("Supprimer") . "", $record["idItem"]);
                    }
                        ));
                    }

                    /**
                     *
                     * @param \Zend\Db\Sql\Select $query
                     */
                    protected function initFilters($query) {
                        $value = $this->getParamAdapter()->getValueOfFilter('idItem');
                        if ($value != null) {
                            $query->where("idItem = '" . $value . "' ");
                        }

                        $value = $this->getParamAdapter()->getValueOfFilter('nom');
                        if ($value != null) {
                            $query->where("nom like '%" . $value . "%' ");
                        }

                        $value = $this->getParamAdapter()->getValueOfFilter('ajouterPar');
                        if ($value != null) {
                            $query->where("ajouterPar like '%" . $value . "%' ");
                        }

                        $value = $this->getParamAdapter()->getValueOfFilter('majPar');
                        if ($value != null) {
                            $query->where("majPar like '%" . $value . "%' ");
                        }

                        $value = $this->getParamAdapter()->getValueOfFilter('idItemJeu');
                        if ($value != null) {
                            $query->where("idIBnet like '%" . $value . "%' ");
                        }

                        $value = $this->getParamAdapter()->getValueOfFilter('couleur');
                        if ($value != null) {
                            $query->where("couleur like '%" . $value . "%' ");
                        }
                    }

                }


text:
#pragma once

#include "ref.h"
#include "inode.h"
#include "notify.h"

//this is the interface ID for the Mergeable interface
#define MERGEABLE_INTERFACE 0x00010c9b

/*!
Description:  This class allows referenceTargets that are not INodes to be mergeable through the File->Merge command.
The referenceTarget that you want to be mergeable must derive from Mergeable.  You just then need to override GetMergeableRef,
GetMergeableRefName, and PostMerge.

Code Example to make the Brightness/Contrast effect mergeable.

You would derive your class from the Mergeable

\code
class BriteConEffect: public Effect, public Mergeable {
\endcode

Then make sure you return the Mergeable Interface from GetInterface when it is asked

\code
void* BriteConEffect::GetInterface(ULONG id)
{
	switch(id)
	{
		case MERGEABLE_INTERFACE : return (Mergeable *) this;
			break;
		default: return Effect::GetInterface(id);
			break;
	}
}
\endcode

Next just need to implement GetMergeableRef and GetMergeableRefName which return the data needed to do the merge

\code
ReferenceTarget* BriteConEffect::GetMergeableRef()
{
	return this;
}
TSTR BriteConEffect::GetMergeableRefName()
{
	return GetName();
}
\endcode

Finally you just need to implement PostMerge where you do your work to hook back up
your reference after the merge

\code
void BriteConEffect::PostMerge()
{
	GetCOREInterface()->AddEffect(this);
}
\endcode

*/
class Mergeable : public MaxHeapOperators
{
public:
	CoreExport Mergeable();
	CoreExport virtual ~Mergeable();

	/*! This needs to be implemented to return the ReferenceTarget that will be mergeable.  This is the ReferenceTarget that is
	derived from Mergeable.  If it does not derive from Mergeable, PostMerge will not be called on it after merging.
	*/
	CoreExport virtual ReferenceTarget* GetMergeableRef() = 0;

	/*! This returns the name that you want to appear in the merge list box
	*/
	CoreExport virtual TSTR GetMergeableRefName() = 0;

	/*! This is called after the reference has been merged.  At this point it needs to be attached to something
	otherwise it will be lost.  For instance if this was an effect it would have to be attached to scene graphs effects list.
	*/
	CoreExport virtual void PostMerge() = 0;

	/*! This is called before saving.  If you are in a state where you don't need to be saved, then return false.
	Otherwise by default this returns true.
	*/
	CoreExport virtual bool SaveForMerge() {return true;}

	/*! The name returned from GetMergeableRefName() will be made unique in the merge list box, unless this is implemented to return false.
	*/
	CoreExport virtual bool MakeMergeNameUnique() {return true;}

protected:

private:

	static void Notify(void *param, NotifyInfo *info);

	void PreSaveInternal();
	void PostSaveInternal();
	void PreMergeInternal();
	void PostMergeInternal();

	bool mSkipMerge;				//this is a bool used to track which refTargs are already in the scene and which ones are to be
									//merged so we don't accidently duplicate something that was already there.
	INode *mTempNode;				//pointer to the temporary node we create so it will show up in the merge list

};


text:
<?php

namespace MobileCart\SubscriptionBundle\EventListener\Admin;

use MobileCart\CoreBundle\Event\CoreEvent;

/**
 * Class AdminNavigation
 * @package MobileCart\SubscriptionBundle\EventListener\Admin
 */
class AdminNavigation
{
    /**
     * @var \Symfony\Component\Routing\RouterInterface
     */
    protected $router;

    /**
     * @param \Symfony\Component\Routing\RouterInterface $router
     * @return $this
     */
    public function setRouter(\Symfony\Component\Routing\RouterInterface $router)
    {
        $this->router = $router;
        return $this;
    }

    /**
     * @return \Symfony\Component\Routing\RouterInterface
     */
    public function getRouter()
    {
        return $this->router;
    }

    /**
     * @param CoreEvent $event
     */
    public function onAdminNavigation(CoreEvent $event)
    {
        $event->get('menu')->addChild('Subscriptions', [
            'route' => 'cart_admin_subscription',
            'uri'   => $this->getRouter()->generate('cart_admin_subscription', []),
            'extras' => [
                'safe_label' => true,
            ]
        ]);

        $event->get('menu')->addChild('Subscribers', [
            'route' => 'cart_admin_subscription_customer',
            'uri'   => $this->getRouter()->generate('cart_admin_subscription_customer', []),
            'extras' => [
                'safe_label' => true,
            ]
        ]);
    }
}


text:
.class public Lcom/j256/ormlite/stmt/query/SetExpression;
.super Lcom/j256/ormlite/stmt/query/BaseComparison;
.source ""

# direct methods
.method public constructor <init>(Ljava/lang/String;Lcom/j256/ormlite/field/FieldType;Ljava/lang/String;)V
    .locals 1

    .line 24
    const/4 v0, 0x1

    invoke-direct {p0, p1, p2, p3, v0}, Lcom/j256/ormlite/stmt/query/BaseComparison;-><init>(Ljava/lang/String;Lcom/j256/ormlite/field/FieldType;Ljava/lang/Object;Z)V

    .line 25
    return-void
.end method

# virtual methods
.method protected appendArgOrValue(Lcom/j256/ormlite/db/DatabaseType;Lcom/j256/ormlite/field/FieldType;Ljava/lang/StringBuilder;Ljava/util/List;Ljava/lang/Object;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Lcom/j256/ormlite/db/DatabaseType;Lcom/j256/ormlite/field/FieldType;Ljava/lang/StringBuilder;Ljava/util/List<Lcom/j256/ormlite/stmt/ArgumentHolder;>;Ljava/lang/Object;)V"
        }
    .end annotation

    .line 36
    invoke-virtual {p3, p5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const/16 v1, 0x20

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    .line 37
    return-void
.end method

.method public appendOperation(Ljava/lang/StringBuilder;)V
    .locals 1

    .line 29
    const-string v0, "= "

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 30
    return-void
.end method

.method public bridge synthetic appendSql(Lcom/j256/ormlite/db/DatabaseType;Ljava/lang/String;Ljava/lang/StringBuilder;Ljava/util/List;)V
    .locals 0

    .line 21
    invoke-super {p0, p1, p2, p3, p4}, Lcom/j256/ormlite/stmt/query/BaseComparison;->appendSql(Lcom/j256/ormlite/db/DatabaseType;Ljava/lang/String;Ljava/lang/StringBuilder;Ljava/util/List;)V

    return-void
.end method

.method public bridge synthetic appendValue(Lcom/j256/ormlite/db/DatabaseType;Ljava/lang/StringBuilder;Ljava/util/List;)V
    .locals 0

    .line 21
    invoke-super {p0, p1, p2, p3}, Lcom/j256/ormlite/stmt/query/BaseComparison;->appendValue(Lcom/j256/ormlite/db/DatabaseType;Ljava/lang/StringBuilder;Ljava/util/List;)V

    return-void
.end method

.method public bridge synthetic getColumnName()Ljava/lang/String;
    .locals 1

    .line 21
    invoke-super {p0}, Lcom/j256/ormlite/stmt/query/BaseComparison;->getColumnName()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public bridge synthetic toString()Ljava/lang/String;
    .locals 1

    .line 21
    invoke-super {p0}, Lcom/j256/ormlite/stmt/query/BaseComparison;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method


text:
<?xml version="1.0" encoding="UTF-8"?>
    <!--
        Copyright 2005-2006 Open Source Applications Foundation Licensed under
        the Apache License, Version 2.0 (the "License"); you may not use this
        file except in compliance with the License. You may obtain a copy of
        the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
        required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
        implied. See the License for the specific language governing
        permissions and limitations under the License.
    -->

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

    <bean id="cosmoEntityFactory" class="org.unitedinternet.cosmo.model.hibernate.HibEntityFactory" />

    <bean id="idGenerator" class="org.unitedinternet.cosmo.util.VersionFourGenerator" />

    <bean id="secureRandom" class="java.security.SecureRandom" factory-bean="secureRandomFactoryBean"/>

    <bean id="secureRandomFactoryBean" class="org.springframework.security.core.token.SecureRandomFactoryBean"/>

    <bean id="tokenGenerator"
          class="org.springframework.security.core.token.KeyBasedPersistenceTokenService" >
        <property name="serverSecret" value="${cosmo.tikets.serverSecret}"/>
        <property name="serverInteger" value="${cosmo.tikets.serverInteger}"/>
        <property name="pseudoRandomNumberBits" value="16"/>
        <property name="secureRandom" ref="secureRandom"/>
    </bean>

    <bean id="abstractDao" class="org.unitedinternet.cosmo.dao.hibernate.AbstractDaoImpl" abstract="true">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

    <bean id="contentDao" parent="abstractDao" class="org.unitedinternet.cosmo.dao.hibernate.ContentDaoImpl"
        init-method="init" destroy-method="destroy">
        <property name="itemPathTranslator" ref="itemPathTranslator" />
        <property name="idGenerator">
            <ref bean="idGenerator" />
        </property>
        <property name="ticketKeyGenerator">
            <ref bean="tokenGenerator" />
        </property>
        <property name="itemFilterProcessor">
            <ref bean="itemFilterProcessor" />
        </property>
    </bean>

    <bean id="itemFilterProcessor" parent="abstractDao" class="org.unitedinternet.cosmo.dao.query.hibernate.StandardItemFilterProcessor" />

    <bean id="itemPathTranslator" parent="abstractDao" class="org.unitedinternet.cosmo.dao.query.hibernate.DefaultItemPathTranslator" />

    <bean id="eventLogDao" parent="abstractDao" class="org.unitedinternet.cosmo.dao.hibernate.EventLogDaoImpl" init-method="init" destroy-method="destroy"/>

    <bean id="serverPropertyDao" parent="abstractDao" class="org.unitedinternet.cosmo.dao.hibernate.ServerPropertyDaoImpl" init-method="init" destroy-method="destroy"/>

    <bean id="userDao" parent="abstractDao" class="org.unitedinternet.cosmo.dao.hibernate.UserDaoImpl" init-method="init" destroy-method="destroy">
        <property name="idGenerator">
            <ref bean="idGenerator" />
        </property>
    </bean>

    <bean id="calendarDao" parent="abstractDao" class="org.unitedinternet.cosmo.dao.hibernate.CalendarDaoImpl" init-method="init">
        <property name="itemFilterProcessor">
            <ref bean="itemFilterProcessor" />
        </property>
        <property name="entityFactory" ref="cosmoEntityFactory" />
    </bean>
    <!--  Transaction Definitions -->

</beans>


text:
package com.intellij.indentation;

import com.intellij.core.CoreBundle;
import com.intellij.lang.ASTNode;
import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiParser;
import com.intellij.openapi.util.NlsContexts;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public abstract class AbstractIndentParser implements PsiParser {
  protected IndentPsiBuilder myBuilder;

  @Override
  @NotNull
  public ASTNode parse(@NotNull IElementType root, @NotNull PsiBuilder builder) {
    myBuilder = createPsiBuilder(builder);
    parseRoot(root);
    return myBuilder.getTreeBuilt();
  }

  @NotNull
  protected IndentPsiBuilder createPsiBuilder(@NotNull PsiBuilder builder) {
    return new IndentPsiBuilder(builder);
  }

  protected abstract void parseRoot(IElementType root);

  public PsiBuilder.Marker mark(boolean couldBeRolledBack) {
    if (couldBeRolledBack) {
      return myBuilder.markWithRollbackPossibility();
    }
    return myBuilder.mark();
  }

  public PsiBuilder.Marker mark() {
    return mark(false);
  }

  public void done(@NotNull final PsiBuilder.Marker marker, @NotNull final IElementType elementType) {
    marker.done(elementType);
  }

  public static void collapse(@NotNull final PsiBuilder.Marker marker, @NotNull final IElementType elementType) {
    marker.collapse(elementType);
  }

  protected static void drop(@NotNull final PsiBuilder.Marker marker) {
    marker.drop();
  }

  protected void rollbackTo(@NotNull final PsiBuilder.Marker marker) {
    marker.rollbackTo();
  }

  protected boolean eof() {
    return myBuilder.eof();
  }

  protected int getCurrentOffset() {
    return myBuilder.getCurrentOffset();
  }

  public int getCurrentIndent() {
    return myBuilder.getCurrentIndent();
  }

  protected void error(@NotNull @NlsContexts.ParsingError String message) {
    myBuilder.error(message);
  }

  @Nullable
  public IElementType getTokenType() {
    return myBuilder.getTokenType();
  }

  protected static boolean tokenIn(@Nullable final IElementType elementType, IElementType... tokens) {
    for (IElementType token : tokens) {
      if (elementType == token) {
        return true;
      }
    }
    return false;
  }

  protected boolean currentTokenIn(IElementType... tokens) {
    return tokenIn(getTokenType(), tokens);
  }

  protected boolean currentTokenIn(@NotNull final TokenSet tokenSet) {
    return tokenSet.contains(getTokenType());
  }

  @NotNull
  protected String getTokenText() {
    String result = myBuilder.getTokenText();
    if (result == null) {
      result = "";
    }
    return result;
  }

  protected boolean expect(@NotNull final IElementType elementType) {
    return expect(elementType, CoreBundle.message("parsing.error.expected.element", elementType));
  }

  protected boolean expect(@NotNull final IElementType elementType, @NotNull @NlsContexts.ParsingError String expectedMessage) {
    if (getTokenType() == elementType) {
      advance();
      return true;
    }
    error(expectedMessage);
    return false;
  }

  @Nullable
  public IElementType lookAhead(int step) {
    return myBuilder.lookAhead(step);
  }

  @Nullable
  public IElementType rawLookup(int step) {
    return myBuilder.rawLookup(step);
  }

  public boolean isNewLine() {
    return myBuilder.isNewLine();
  }

  public void advance() {
    myBuilder.advanceLexer();
  }

  public void recalculateCurrentIndent() {
   myBuilder.recalculateCurrentIndent(getEolElementType(), getIndentElementType());
  }

  protected void advanceUntil(TokenSet tokenSet) {
    while (getTokenType() != null && !isNewLine() && !tokenSet.contains(getTokenType())) {
      advance();
    }
  }

  protected void advanceUntilEol() {
    advanceUntil(TokenSet.EMPTY);
  }

  protected void errorUntil(TokenSet tokenSet, @NotNull @NlsContexts.ParsingError String message) {
    PsiBuilder.Marker errorMarker = mark();
    advanceUntil(tokenSet);
    errorMarker.error(message);
  }

  protected void errorUntilEol(@NotNull @NlsContexts.ParsingError String message) {
    PsiBuilder.Marker errorMarker = mark();
    advanceUntilEol();
    errorMarker.error(message);
  }

  protected void errorUntilEof() {
    PsiBuilder.Marker errorMarker = mark();
    while (!eof()) {
      advance();
    }
    errorMarker.error(CoreBundle.message("parsing.error.unexpected.token"));
  }

  protected void expectEolOrEof() {
    if (!isNewLine() && !eof()) {
      errorUntilEol(CoreBundle.message("parsing.error.end.of.line.expected"));
    }
  }

  protected abstract IElementType getIndentElementType();
  protected abstract IElementType getEolElementType();
}


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<title>Polyfill for calc() test case</title>

		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width">

		<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

		<link rel="stylesheet" href="styles.css">

Polyfill for calc() test case

Element with only px values in calc for width

Element with px and percent values in calc for width

Element with px and em values in calc for width

Element with px and rem values in calc for width

Element with only px values in calc for width, but a selector which IE8 does not understand.

Element with px and percent values in calc for width in media query

Element with decimal percentages and multiplication and division

Element with px and em values in calc for width. Inline style


text:
function [powMT freqs_FFT t_sec phsMT] = eeg_mtwelch2(eegTrialsxTime,Fs,T,overlap,TW,mtFreqOut,varargin)
%
%eeg_mtwelch
%Written by: Julio I. Chapeton
%
%Calculates the spectrum and t-f representation of a signal using a short time fourier transform (STFT).
%These can be calculated with multitapers, no tapers, or a Hann taper. The spectrum is produced by averaging the STFTs.
%The t-f representation is calculated using multitapers at each STDFT. The amplitdues and power are scaled correctly for all cases except for multitapers
%
%Usage:
%eeg_mtwelch(eeg,Fs,T,overlap,TW,varargin)
%
%Inputs:
%    Required:
%        eeg      = matrix (trials x time)
%        Fs       = scalar (sampling frequency in Hz)
%        T        = scalar (size of the time window in seconds)
%        overlap  = scalar (size of overlap for adjacent windows, as a fraction of T)
%        TW       = scalar (time-bandwidth product, 2*TW-1 will be the number of tapers)
%        freqOut  = vector (range of output frequencies), pass in empty matrix [] for full freqs_FFT output
%   Optional:
%        method   = string ('no tapers' uses rectangular windows,'eigen' will average the...
%                          power over tapers using the eigenvalues as weights,'Hann' uses a Hann window, may change this to be the default)
%
%Outputs:
%        powMT    = matrix (trial x freq x timestep, power has been normalized to conserve the energy in the signal)
%        phsMT    = matrix (trial x freq x timestep, phase from first taper)
%        freqs_FFT= vector (vector of frequencies in Hz where the power was calculated)
%        t_sec    = matrix (window start/stop times)
%  --following are no longer output now that eeg is trials x time--
%        fx       = array  (contains the power of the windowed data, of the form (freq x window x taper) i.e. not averaged over tapers yet)
%        SP       = vector (spectrum up to Fnyquist, these are normalized to give the correct amplitudes in Volts)
%        all_phase=        (Not set yet)
%
%
% JW 2015-- tweaked the comments a bit and added a detrending step before windowing (as is done by Fries)
%          version eeg_mtwelch2 --> takes in eegTrialxTime
%

%- eegTrialxTime should have rows=trials, columns=time
%-  But for backwards compatability allow user to pass in a single trial time series as row or column
NeegSample = size(eegTrialsxTime,2);
if NeegSample==1, eegTrialsxTime = eegTrialsxTime'; end
NeegTrials = size(eegTrialsxTime,1);
NeegSample = size(eegTrialsxTime,2);

%- FFT setup
Nsamples      = round(T*Fs); % if odd, Nyquist component is not evaluated
ovrlp_samples = round(overlap*Nsamples);
freqs_FFT     = linspace(0,Fs/2,Nsamples/2+1);

if isempty(TW)
    TW=1;
end
no_tapers = 2*TW-1; % TW must be multiple of 1/2
if no_tapers<1 || no_tapers>Nsamples
    error('\n there are m DPSSs of length Nsamples, so require the number of tapers <= to the number of samples per window',[])
end

taper_ind=1;
V_weights=1;
if ~isempty(varargin) && ~strcmp(varargin{1},'tapers')
    if strcmp(varargin{1},'eigen')
        %[E V]=dpss(Nsamples,no_tapers/2); % divide by 2 since dpss calculates 2*(x) tapers
        [E V]=dpss(Nsamples,TW,no_tapers); % JHW divide by 2 since dpss calculates 2*(x) tapers
        V_weights=ones(1,ovrlp_samples>0,length(V));
        V_weights(1,1,:)=V/sum(V);
    elseif strcmp(varargin{1},'no tapers')
        no_tapers=1;
        E=ones(Nsamples,1);
        taper_ind=0;
        % reduces to welch's method --- rectangle window
    elseif strcmp(varargin{1},'Hann')
        no_tapers=1;
        E=hann(Nsamples);
        % welch's with Hann window --- smooths to zero at the edges (first taper of multipaer is more like a Hamm then a Hann window)
    else
        fprintf('\n ERROR: method not correctly specified'); keyboard;
    end
else
    %[E V]=dpss(Nsamples,no_tapers/2); % divide by 2 since dpss calculates 2*(x) tapers
    [E V]=dpss(Nsamples,TW,no_tapers); % JHW divide by 2 since dpss calculates 2*(x) tapers
    %E=dpss(N,bandwidth,K,'calc');
end

% coherent gain factors for amplitude and energy
taper_amp_norm=(1-(taper_ind && no_tapers==1))+(taper_ind && no_tapers==1)/mean(E(:));
taper_pow_norm=(1-(taper_ind && no_tapers==1))+(taper_ind && no_tapers==1)/rms(E(:));

% tic
% [Pxx F]=pmtm(eeg,3,[],Fs);
% toc

% pmtm is too slow

%- Loop over trials and compute the spectra
for iTrial=1:NeegTrials,

    eeg = eegTrialsxTime(iTrial,:)'; %- create column vector of this trial's time series

    %% split signal into windows and apply tapers to each one
    %eeg_windowed = buffer(eeg,Nsamples,ovrlp_samples,'nodelay');
    [eeg_windowed, rem] = buffer(eeg,Nsamples,ovrlp_samples,'nodelay'); %- starts at first sample (nodelay option), and tosses out samples at end if final window is not filled (rem output contains partial)

    eeg_windowed = repmat(detrend(eeg_windowed),[1,1,no_tapers]); %this should be changed to use bsxfun instead  %- JHW added detrend based on Fries methods... no obvious effect
    windows    = size(eeg_windowed,2);
    E_windowed = permute(repmat(E,[1,1,windows]),[1 3 2]);

    %- only need to compute t_sec once
    if iTrial==1,
        t_sec    = nan(windows,2);
        t_sec(:) = [((1:windows)-1)*(Nsamples-ovrlp_samples),((1:windows)*(Nsamples-ovrlp_samples)+ovrlp_samples)]/Fs;
    end

    %% get coefficients, power and phases
    % freq x window x taper
    fx = fft(E_windowed.*eeg_windowed);
    fx = fx(1:length(freqs_FFT),:,:)/sqrt(Nsamples); %%% unitary scaling, this is the fft (freqs x windows x tapers). Can use this as an output instead of all_pow

    all_pow   = (fx.*conj(fx));%*(dt.^2);
    all_pow   = [all_pow(1,:,:);2*all_pow(2:Nsamples/2,:,:);all_pow(end,:,:)];
    all_phase = angle(fx); % not correct (says julio... jw think's its ok)

    %figure(1); clf;
    %subplot(211); semilogy(squeeze(all_pow(:,1,:))); hold on; loglog(mean(squeeze(all_pow(:,1,:)),2),'k','linewidth',4);
    %subplot(212); plot(squeeze(all_phase(:,1,:))); hold on;
    %meanPhase = squeeze(angle(mean(exp(1i*all_phase(:,1,1)).*conj(exp(1i*all_phase(:,1,2))))));
    %meanPhase = squeeze(angle(sum(exp(1i*all_phase(:,1,:)),3)/size(all_phase,3)));
    %meanPhaseAve = squeeze(angle(mean(exp(1i*all_phase(:,1,1)),3)));
    %plot(meanPhaseAve,'k','linewidth',4)
    %meanPhaseSum = squeeze(angle(sum(exp(1i*all_phase(:,1,:)),3)/size(all_phase,3)));
    %plot(meanPhaseSum,'r','linewidth',4)

    %% mean phase (in rad), amplitude (in Volts) and power (in Volts^2)
    % The energy and amplitudes are properly scaled in the case of one taper, for multitapers the scale is somewhat arbitrary

    % average over tapers, weighted by eigen values if varargin{1}='eigen'.
    tf = mean(bsxfun(@times,all_pow,V_weights),3); % will average only if there is a third dim, i.e tapers. This line may not work if there data is not windowed.

    % average over windows and scale amplitude
    SP = mean(tf,2);
    SP = [sqrt(SP(1));sqrt(2*SP(2:Nsamples/2));sqrt(SP(end))]/sqrt(Nsamples)*(taper_amp_norm);

    % the division by (Nsamples*windows/N) in tf is there to account for
    % windowing, it is not used in SP since SP is an average over all windows,
    % i.e amplitudes for windows aren't added. This is an approximation and may
    % not be useful
    tf = (tf*taper_pow_norm.^2);%/(Nsamples*windows/N);

    %- only save trial-by-trial: time x frequency data
    %[fx SP tf freqs_FFT t_sec all_phase]
    %fx_out(iTrial,:,:,:)=fx;  % freq x window x taper
    %SP_out(iTrial,:)=SP;  % vector (spectrum up to Fnyquist
    powMT(iTrial,:,:)=tf; % freq x time
    %all_phase(iTrial,:,:

    phsMT(iTrial,:,:)=all_phase(:,:,1); % freq x time x tapers time x freq (only use the first taper... or perhaps use complex average?)
    %phsMT(iTrial,:,:)=squeeze(angle(mean(exp(1i*all_phase(:,:,:)),3))); % mean phase of all tapers in the complex plane; freq x time output
end

if length(mtFreqOut)>0,

    if length(setdiff(mtFreqOut,freqs_FFT))>0, fprintf('\n Error: requesting a multitaper frequency that isnt computed'); keyboard; end

    [~,~,iFout] = intersect(mtFreqOut,freqs_FFT);
    powMT       = powMT(:,iFout,:); %- trial x freq x time
    phsMT       = phsMT(:,iFout,:); %- trial x freq x time
    freqs_FFT   = freqs_FFT(iFout);  %- freqs
end

%fx = fx_out;
%SP = SP_out;
%powMT = tf_out;
%all_phase -- not set yet anyway


text:
//  (C) Copyright Edward Diener 2011
//  Use, modification and distribution are subject to the Boost Software License,
//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt).

#include "test_has_type.hpp"
#include <boost/mpl/assert.hpp>

int main()
  {

  // You can always instantiate without compiler errors

  BOOST_TTI_HAS_TYPE_GEN(AnIntType)<AnotherType> aVar1;
  BOOST_TTI_HAS_TYPE_GEN(NoOtherType)<AType> aVar2;

  // Compile time asserts

  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntType)<AType>));
  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnIntTypeReference)<AType>));
  BOOST_MPL_ASSERT((NameStruct<AType>));
  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(BType)<AType>));
  BOOST_MPL_ASSERT((TheInteger<AType::BType>));
  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(CType)<AType::BType>));
  BOOST_MPL_ASSERT((BOOST_TTI_HAS_TYPE_GEN(AnotherIntegerType)<AType::BType::CType>));
  BOOST_MPL_ASSERT((SomethingElse<AnotherType>));

  return 0;

  }


text:
const crypto = require('crypto');
const Promise = require('bluebird');
const Sequelize = require('sequelize');
const VError = require('verror');

const Checks = require('@datenwelt/cargo-api').Checks;

class UserModel {

	static define(schema) {
		return schema.define('User', {
			Username: {
				type: Sequelize.STRING,
				primaryKey: true,
				allowNull: false
			},
			Password: {
				type: Sequelize.STRING,
				allowNull: false,
				comment: 'Hash of the login password of the user preprended by {MD5|SHA1|SHA256}.'
			},
			Email: {
				type: Sequelize.STRING,
				allowNull: false,
				comment: 'Email address of the user for password recovery.'
			},
			Active: {
				type: Sequelize.BOOLEAN,
				allowNull: false,
				defaultValue: true,
				comment: 'True if user can login, false if user login is temporarily deactivated.'
			}
		}, {
			classMethods: {
				createPassword: UserModel.createPassword,
				checkUsername: UserModel.checkUsername,
				checkPassword: UserModel.checkPassword,
				checkEmail: UserModel.checkEmail,
				checkActive: UserModel.checkActive,
			},
			instanceMethods: {
				permissions: async function () {
					const username = this.get('Username');
					let userGroups = await this.sequelize.model('UserGroup').findAll({
						where: {UserUsername: username},
						order: [['Prio', 'ASC']]
					});
					let groups = await Promise.map(userGroups, async function (userGroup) {
						let groupId = userGroup.get('GroupId');
						let group = await this.sequelize.model('Group').findById(groupId);
						return group;
					}.bind(this));
					let permissions = await Promise.reduce(groups, function (memo, group) {
						return group.permissions(memo);
					}, []);
					let userRoles = await this.sequelize.model('UserRole').findAll({
						where: {UserUsername: username},
						order: [['Prio', 'ASC']]
					});
					let roles = await Promise.map(userRoles, function (userRole) {
						let roleId = userRole.get('RoleName');
						return this.sequelize.model('Role').findById(roleId);
					}.bind(this));
					permissions = await Promise.reduce(roles, function (memo, role) {
						return role.permissions(memo);
					}, permissions);
					const permissionModel = this.sequelize.model('Permission');
					let userPermissions = await this.sequelize.model('UserPermission').findAll({
						where: {UserUsername: username},
						order: [['Prio', 'ASC']]
					});
					permissions = await Promise.reduce(userPermissions, function (memo, modifier) {
						return permissionModel.applyPermissions(modifier, memo);
					}, permissions);
					return permissions;
				},
				roles: async function () {
					const username = this.get('Username');
					let groups = await Promise.map(this.sequelize.model('UserGroup').findAll({
						where: {'UserUsername': username}, order: [['Prio', 'ASC']]
					}), function (userGroup) {
						return this.sequelize.model('Group').findById(userGroup.get('GroupId'));
					}.bind(this));
					let roles = await Promise.reduce(groups, async function (memo, group) {
						return memo.concat(await group.roles());
					}, []);

					let p = this.sequelize.model('UserRole').findAll({
						where: {'UserUsername': username}, order: [['Prio', 'ASC']]
					});
					let userRoles = await Promise.map(p, (userRole) => userRole.get('RoleName'));
					roles = roles.concat(userRoles);
					return roles;
				}
			}
		});
	}

	static checkUsername(value) {
		value = Checks.type('string', value).trim();
		value = Checks.notBlank(value);
		value = Checks.minLength(3, value);
		value = Checks.maxLength(255, value);
		return value;
	}

	static checkPassword(value, req) {
		let blacklist = [];
		if ( req && req.body && req.body.username ) blacklist.push(req.body.username);

		function complexity(value) {
			let score = 0;
			if (value.match(/[a-z]/)) score++;
			if (value.match(/[A-Z]/)) score++;
			if (value.match(/[0-9]/)) score++;
			if (value.match(/[^0-9a-zA-Z]/)) score++;
			if (score < 3) throw new VError({name: 'Complexity'});
			return value;
		}

		function forbidden(value) {
			if (blacklist.includes(value)) throw new VError({name: 'Forbidden'});
			return value;
		}

		value = Checks.type('string', value);
		value = Checks.notBlank(value);
		if (value.startsWith('{SHA1}')) return value;

		value = Checks.minLength(6, value);
		value = Checks.maxLength(40, value);
		try {
			complexity(value);
		} catch (err) {
			if (err.name === 'Complexity')    throw new VError({name: 'CargoCheckError'}, 'TOOWEAK');
			throw new VError(err);
		}
		try {
			forbidden(value);
		} catch (err) {
			if (err.name === 'Forbidden') throw new VError({name: 'CargoCheckError'}, 'FORBIDDEN');
			throw new VError(err);
		}
		return UserModel.createPassword(value);
	}

	static checkEmail(value) {
		value = Checks.type('string', value).trim();
		value = Checks.notBlank(value);
		value = Checks.minLength(3, value);
		value = Checks.maxLength(255, value);
		return value;
	}

	static checkActive(value) {
		return Checks.cast('boolean', value);
	}

	static createPassword(plaintext) {
		const algo = 'SHA1';
		let password = "{" + algo + "}";
		password += crypto.createHash(algo).update(plaintext).digest('hex');
		return password;
	}

}

module.exports = UserModel;


text:
{% load i18n %}{% load url from future %}

{% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" name="_save" {{ onclick_attrib }}/>{% endif %}

{% if show_delete_link %}{% trans "Delete" %}{% endif %}
{% if basic_info %}{% trans "Basic Infos" %}{% endif %}
{% if advanced_settings %}{% trans "Advanced Settings" %}{% endif %}

{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{ onclick_attrib }}/>{%endif%}
{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{ onclick_attrib }} />{% endif %}
{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{ onclick_attrib }}/>{% endif %}


text:
/**
 * Created by dd on 5/22/15.
 */

Meteor.publish("patientFlags", function (patientId) {
    return getPatientFlags(patientId);
});

//Meteor.publish("patientQuestions", function (flags) {
//    return getPatientQuestions(flags);
//});

Meteor.publish("patientMeds", function (patientId) {
    return getPatientMeds(patientId);
});

Meteor.publish("patientConditions", function (patientId) {
    return getPatientConditions(patientId);
});

Meteor.publish("patientEvents", function (patientId) {
    return getPatientEvents(patientId);
});


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<servico xsi:schemaLocation="http://servicos.gov.br/v3/schema.../servico.xsd" xmlns="http://servicos.gov.br/v3/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <id>habilitar-se-para-realizar-processo-transexualizador</id>
    <dbId>1528</dbId>
    <nome>Habilitar-se para realizar processo transexualizador</nome>
    <sigla></sigla>
    <descricao>Habilitação no Processo Transexualizador</descricao>
    <contato></contato>
    <gratuito>true</gratuito>
    <porcentagem-manual>false</porcentagem-manual>
    <servico-digital>false</servico-digital>
    <link-servico-digital></link-servico-digital>
    <solicitantes>
        <solicitante id="2552">
            <tipo>Estados e municípios</tipo>
            <requisitos></requisitos>
        </solicitante>
    </solicitantes>
    <tempo-total-estimado>
        <nao-estimado-ainda/>
        <descricao></descricao>
    </tempo-total-estimado>
    <validade-documento>
        <descricao></descricao>
    </validade-documento>
    <etapas>
        <etapa id="5079">
            <titulo>Solicitar habilitação</titulo>
            <descricao></descricao>
            <documentos>
                <default/>
            </documentos>
            <custos>
                <default/>
            </custos>
            <canais-de-prestacao>
                <default>
                    <canal-de-prestacao id="4932" tipo="presencial">
                        <descricao>Ministério da Saúde</descricao>
                    </canal-de-prestacao>
                </default>
            </canais-de-prestacao>
        </etapa>
    </etapas>
    <orgao id="http://estruturaorganizacional.dados.gov.br/id/unidade-organizacional/304" dbId="37534">
        <nomeOrgao>Ministério da Saúde (MS)</nomeOrgao>
    </orgao>
    <segmentos-da-sociedade>
        <item idSegmento="2" idServicoSegmento="5091">Órgãos e entidades públicas</item>
    </segmentos-da-sociedade>
    <areas-de-interesse>
        <item>Saúde</item>
    </areas-de-interesse>
    <palavras-chave>
        <item id="9509">habilitação</item>
        <item id="9510">processo transexualizador</item>
        <item id="9511">mudança de sexo</item>
    </palavras-chave>
</servico>


text:
enum BuildingState : int {
    BS_Placed,
    BS_Construction,
    BS_Builded
};

enum BuildingType : int {
    BT_Base,
    BT_Barrack,
    BT_House
};

class Building :
        public Unit
{
public:
    Building(BuildingIdentity *m_identity, Player *m_owner);
    virtual ~Building();
    BuildingState getState(void);
    int getMetalCost(void);
    int getGazCost(void);
    int getVision(void);
    int getCurrentHealth(void);
    std::string getSpriteName(void);
    BuildingIdentity* getIdentity(void);

    int getJobEmittersCount(void);
    JobEmitter* getJobEmitter(int index);

    Job* getCurrentJob(void);

    BuildingType getBuildingType(void);

    int getPopulationCapacity(void);

protected:
    std::vector<JobEmitter*> emitters;
    std::queue<Job*> jobsQueue;

    Job *currentJob;

    BuildingState state;
    BuildingIdentity *_identity;

};

#endif // BUILDING_H


text:
<!DOCTYPE html>

one

two