text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2010 ZXing authors

 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.
 -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.zxing</groupId>
  <artifactId>zxingorg</artifactId>
  <packaging>war</packaging>
  <name>ZXing zxing.org web app</name>
  <version>2.3-SNAPSHOT</version>
  <description>The web application behind zxing.org</description>

  <inceptionYear>2007</inceptionYear>
  <issueManagement>
    <system>Google Code</system>
    <url>http://code.google.com/p/zxing/issues/list</url>
  </issueManagement>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:svn:http://zxing.googlecode.com/svn/trunk/zxingorg</connection>
    <developerConnection>scm:svn:https://zxing.googlecode.com/svn/trunk/zxingorg</developerConnection>
    <url>http://zxing.googlecode.com/svn/trunk/zxingorg</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <prerequisites>
    <maven>3.0</maven>
  </prerequisites>

  <dependencies>
    <dependency>
      <groupId>com.google.zxing</groupId>
      <artifactId>core</artifactId>
      <version>2.3-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>com.google.zxing</groupId>
      <artifactId>javase</artifactId>
      <version>2.3-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>javax</groupId>
      <artifactId>javaee-web-api</artifactId>
      <version>6.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3</version>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <outputDirectory>build</outputDirectory>
    <resources>
      <resource>
        <directory>resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.3</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>7</source>
          <target>7</target>
          <compilerArgs>
            <arg>-Xlint:all</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9.1</version>
        <configuration>
          <javadocVersion>1.7</javadocVersion>
          <header><![CDATA[
            <script type="text/javascript">
               var _gaq = _gaq || [];
               _gaq.push(['_setAccount', 'UA-788492-5']);
               _gaq.push(['_trackPageview']);
               (function() {
                 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
               })();
            </script>
          ]]></header>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.5</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.4</version>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.4.1</version>
      </plugin>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.3</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.15</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
         <executions>
           <execution>
             <id>unpack</id>
             <phase>generate-resources</phase>
             <goals>
               <goal>unpack</goal>
             </goals>
             <configuration>
               <artifactItems>
                 <artifactItem>
                   <groupId>com.google.zxing</groupId>
                   <artifactId>core</artifactId>
                   <version>2.3-SNAPSHOT</version>
                   <type>javadoc</type>
                 </artifactItem>
               </artifactItems>
               <outputDirectory>web/w/docs/javadoc</outputDirectory>
               <overWriteIfNewer>true</overWriteIfNewer>
             </configuration>
           </execution>
         </executions>
       </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <warSourceDirectory>web</warSourceDirectory>
          <warName>w</warName>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus Staging</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>http://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <keyname>Sean Owen (ZXing) <srowen@gmail.com></keyname>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>


text:
from construct import Construct, UBInt8

class VarInt(Construct):

    def _parse(self, stream, ctx):
        val = 0
        base = 1
        exit = False
        while exit is False:
            b = UBInt8('b')._parse(stream, ctx)
            if b < 128:
                exit = True
            else:
                b -= 128
            val += b * base
            base *= 128
        return val

    def _build(self, obj, stream=None, ctx=None):
        number = obj
        data = ''
        exit = False
        while exit is False:
            digit = number % 128
            if digit == number:
                exit = True
            else:
                number /= 128
                digit += 128
            data += chr(digit)
        if stream is not None:
            stream.write(data)
        else:
            return data

    def _sizeof(self, ctx):
        pass

if __name__ == '__main__':
    testvals = (("\x01", 1), ("\xac\x02", 300))
    for testval in testvals:
        testvarint, testnumber = testval
        checkvarint = VarInt('test').build(testnumber)
        if checkvarint == testvarint:
            print 'success with %d' % testnumber
        else:
            print 'failure: %s %s' % (checkvarint, testvarint)
        checknumber = VarInt('test').parse(testvarint)
        if checknumber == testnumber:
            print 'success with %d' % testnumber
        else:
            print 'failure: %d %d' % (checknumber, testnumber)

redpajama_set_name: RedPajamaGithub


text:
using namespace BWAPI;
using namespace std;

#define _OK_DISTANCE_ 32.0 // should perhaps be (WALKTILE/2)^2 = 16.0

FormationSubgoal::FormationSubgoal(SubgoalLogic l, UnitsGroup* ug, pFormation f)
: Subgoal(l, ug)
, formation(f)
{
}

FormationSubgoal::FormationSubgoal(const FormationSubgoal& fsg)
: Subgoal(fsg)
, formation(fsg.formation)
{
}

bool FormationSubgoal::isRealized()
{
    if (!_unitsGroup->isFighting
		&& distanceToRealize() <= sqrt(_unitsGroup->size() * _unitsGroup->size() * _OK_DISTANCE_))
        return true;
    return false;
}

void FormationSubgoal::tryToRealize()
{
    _unitsGroup->formation(formation);
}

double FormationSubgoal::distanceToRealize()
{
	if (!_unitsGroup)
		return -1.0;
	if (_unitsGroup->distToTarget > 0.0) // _unitsGroup not in the same region as its target and distToTarget has been initialized
		return _unitsGroup->distToTarget;
	// else
    Position p = Position((int)formation->mean.x, (int)formation->mean.y);
	return _unitsGroup->getDistance(p);
}


text:
<?php

namespace Magento\Backend\Block\System\Store\Delete;

/**
 * Adminhtml cms block edit form
 *
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Form extends \Magento\Backend\Block\Widget\Form\Generic
{
    /**
     * Init form
     *
     * @return void
     */
    protected function _construct()
    {
        parent::_construct();
        $this->setId('store_delete_form');
        $this->setTitle(__('Block Information'));
    }

    /**
     * {@inheritdoc}
     */
    protected function _prepareForm()
    {
        $dataObject = $this->getDataObject();

        /** @var \Magento\Framework\Data\Form $form */
        $form = $this->_formFactory->create(
            ['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]
        );

        $form->setHtmlIdPrefix('store_');

        $fieldset = $form->addFieldset(
            'base_fieldset',
            ['legend' => __('Backup Options'), 'class' => 'fieldset-wide']
        );

        $fieldset->addField('item_id', 'hidden', ['name' => 'item_id', 'value' => $dataObject->getId()]);

        $fieldset->addField(
            'create_backup',
            'select',
            [
                'label' => __('Create DB Backup'),
                'title' => __('Create DB Backup'),
                'name' => 'create_backup',
                'options' => ['1' => __('Yes'), '0' => __('No')],
                'value' => '1'
            ]
        );

        $form->setUseContainer(true);
        $this->setForm($form);

        return parent::_prepareForm();
    }
}


text:
<?php
$id = $_GET['id'];
$link = mysqli_connect("localhost",
    "root",
    "tumpa24",
    "crud01");
$query = "select * from students WHERE id = $id";
$result = mysqli_query($link, $query);
$row = mysqli_fetch_assoc($result);
?>
<form action="update.php" method="post">
    <input type="text" name="id" value="<?php echo $row['id'];?>" />
    <label> Name:</label>
    <input type="text" name="name1" value="<?php echo $row['name'];?>" />

    <button type="submit">Submit</button>
</form>


text:
<?php

/**
 * @namespace
 */
namespace Application\Categories;

use Bluz\Validator\Traits\Validator;
use Bluz\Validator\Validator as v;

/**
 * Class Row
 * @package Application\Categories
 *
 * @property integer $id
 * @property integer $rootId
 * @property integer $parentId
 * @property string $name
 * @property string $alias
 * @property string $created
 * @property string $updated
 */
class Row extends \Bluz\Db\Row
{
    use Validator;

    /**
     * @var Row[]
     */
    protected $children;

    /**
     * @return void
     */
    public function beforeSave()
    {
        $this->addValidator(
            'name',
            v::required(),
            v::length(2, 128)
        );

        $this->addValidator(
            'alias',
            v::required(),
            v::length(2, 64),
            v::slug(),
            v::callback(function ($input) {
                $select = $this->getTable()->select()
                    ->where('alias = ?', $input);

                if ($this->id) {
                    $select->andWhere('id != ?', $this->id);
                }

                if ($this->parentId) {
                    $select->andWhere('parentId = ?', $this->parentId);
                } else {
                    $select->andWhere('parentId IS NULL');
                }

                return !sizeof($select->execute());
            })->setError('Category with alias "{{input}}" already exists')
        );
    }

    /**
     * @return void
     */
    public function beforeInsert()
    {
        $this->created = gmdate('Y-m-d H:i:s');
        if ($this->parentId == '') {
            $this->parentId = null;
        }
    }

    /**
     * @return void
     */
    public function beforeUpdate()
    {
        $this->updated = gmdate('Y-m-d H:i:s');
    }

    /**
     * Add child
     *
     * @param Row $row
     */
    public function addChild(Row $row)
    {
        $this->children[$row->id] = $row;
    }

    /**
     * Get children directories
     *
     * @return array
     */
    public function getChildren()
    {
        return $this->children;
    }
}


text:
require 'jobvite/version'
require 'jobvite/job'
require 'jobvite/client'

module Jobvite

  # Public: Helper method to return an instance of a Jobvite::Client
  def self.new(company_id)
    Client.new(company_id)
  end

end


text:
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'

module Google
  module Apis
    module AssuredworkloadsV1

      # Request for acknowledging the violation Next Id: 4
      class GoogleCloudAssuredworkloadsV1AcknowledgeViolationRequest
        include Google::Apis::Core::Hashable

        # Required. Business justification explaining the need for violation
        # acknowledgement
        # Corresponds to the JSON property `comment`
        # @return [String]
        attr_accessor :comment

        # Optional. This field is deprecated and will be removed in future version of
        # the API. Name of the OrgPolicy which was modified with non-compliant change
        # and resulted in this violation. Format: projects/`project_number`/policies/`
        # constraint_name` folders/`folder_id`/policies/`constraint_name` organizations/`
        # organization_id`/policies/`constraint_name`
        # Corresponds to the JSON property `nonCompliantOrgPolicy`
        # @return [String]
        attr_accessor :non_compliant_org_policy

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @comment = args[:comment] if args.key?(:comment)
          @non_compliant_org_policy = args[:non_compliant_org_policy] if args.key?(:non_compliant_org_policy)
        end
      end

      # Response for violation acknowledgement
      class GoogleCloudAssuredworkloadsV1AcknowledgeViolationResponse
        include Google::Apis::Core::Hashable

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
        end
      end

      # Operation metadata to give request details of CreateWorkload.
      class GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata
        include Google::Apis::Core::Hashable

        # Optional. Compliance controls that should be applied to the resources managed
        # by the workload.
        # Corresponds to the JSON property `complianceRegime`
        # @return [String]
        attr_accessor :compliance_regime

        # Optional. Time when the operation was created.
        # Corresponds to the JSON property `createTime`
        # @return [String]
        attr_accessor :create_time

        # Optional. The display name of the workload.
        # Corresponds to the JSON property `displayName`
        # @return [String]
        attr_accessor :display_name

        # Optional. The parent of the workload.
        # Corresponds to the JSON property `parent`
        # @return [String]
        attr_accessor :parent

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @compliance_regime = args[:compliance_regime] if args.key?(:compliance_regime)
          @create_time = args[:create_time] if args.key?(:create_time)
          @display_name = args[:display_name] if args.key?(:display_name)
          @parent = args[:parent] if args.key?(:parent)
        end
      end

      # Response of ListViolations endpoint.
      class GoogleCloudAssuredworkloadsV1ListViolationsResponse
        include Google::Apis::Core::Hashable

        # The next page token. Returns empty if reached the last page.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token

        # List of Violations under a Workload.
        # Corresponds to the JSON property `violations`
        # @return [Array<Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Violation>]
        attr_accessor :violations

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
          @violations = args[:violations] if args.key?(:violations)
        end
      end

      # Response of ListWorkloads endpoint.
      class GoogleCloudAssuredworkloadsV1ListWorkloadsResponse
        include Google::Apis::Core::Hashable

        # The next page token. Return empty if reached the last page.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token

        # List of Workloads under a given parent.
        # Corresponds to the JSON property `workloads`
        # @return [Array<Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1Workload>]
        attr_accessor :workloads

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
          @workloads = args[:workloads] if args.key?(:workloads)
        end
      end

      # Request for restricting list of available resources in Workload environment.
      class GoogleCloudAssuredworkloadsV1RestrictAllowedResourcesRequest
        include Google::Apis::Core::Hashable

        # Required. The type of restriction for using gcp products in the Workload
        # environment.
        # Corresponds to the JSON property `restrictionType`
        # @return [String]
        attr_accessor :restriction_type

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @restriction_type = args[:restriction_type] if args.key?(:restriction_type)
        end
      end

      # Response for restricting the list of allowed resources.
      class GoogleCloudAssuredworkloadsV1RestrictAllowedResourcesResponse
        include Google::Apis::Core::Hashable

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
        end
      end

      # Workload monitoring Violation.
      class GoogleCloudAssuredworkloadsV1Violation
        include Google::Apis::Core::Hashable

        # A boolean that indicates if the violation is acknowledged
        # Corresponds to the JSON property `acknowledged`
        # @return [Boolean]
        attr_accessor :acknowledged
        alias_method :acknowledged?, :acknowledged

        # Optional. Timestamp when this violation was acknowledged last. This will be
        # absent when acknowledged field is marked as false.
        # Corresponds to the JSON property `acknowledgementTime`
        # @return [String]
        attr_accessor :acknowledgement_time

        # Output only. Immutable. Audit Log Link for violated resource Format: https://
        # console.cloud.google.com/logs/query;query=`logName``protoPayload.resourceName``
        # timeRange``folder`
        # Corresponds to the JSON property `auditLogLink`
        # @return [String]
        attr_accessor :audit_log_link

        # Output only. Time of the event which triggered the Violation.
        # Corresponds to the JSON property `beginTime`
        # @return [String]
        attr_accessor :begin_time

        # Output only. Category under which this violation is mapped. e.g. Location,
        # Service Usage, Access, Encryption, etc.
        # Corresponds to the JSON property `category`
        # @return [String]
        attr_accessor :category

        # Output only. Description for the Violation. e.g. OrgPolicy gcp.
        # resourceLocations has non compliant value.
        # Corresponds to the JSON property `description`
        # @return [String]
        attr_accessor :description

        # Output only. Immutable. Audit Log link to find business justification provided
        # for violation exception. Format: https://console.cloud.google.com/logs/query;
        # query=`logName``protoPayload.resourceName``protoPayload.methodName``timeRange``
        # organization`
        # Corresponds to the JSON property `exceptionAuditLogLink`
        # @return [String]
        attr_accessor :exception_audit_log_link

        # Output only. Immutable. Name of the Violation. Format: organizations/`
        # organization`/locations/`location`/workloads/`workload_id`/violations/`
        # violations_id`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name

        # Output only. Immutable. Name of the OrgPolicy which was modified with non-
        # compliant change and resulted this violation. Format: projects/`project_number`
        # /policies/`constraint_name` folders/`folder_id`/policies/`constraint_name`
        # organizations/`organization_id`/policies/`constraint_name`
        # Corresponds to the JSON property `nonCompliantOrgPolicy`
        # @return [String]
        attr_accessor :non_compliant_org_policy

        # Output only. Immutable. The org-policy-constraint that was incorrectly changed,
        # which resulted in this violation.
        # Corresponds to the JSON property `orgPolicyConstraint`
        # @return [String]
        attr_accessor :org_policy_constraint

        # Represents remediation guidance to resolve compliance violation for
        # AssuredWorkload
        # Corresponds to the JSON property `remediation`
        # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1ViolationRemediation]
        attr_accessor :remediation

        # Output only. Time of the event which fixed the Violation. If the violation is
        # ACTIVE this will be empty.
        # Corresponds to the JSON property `resolveTime`
        # @return [String]
        attr_accessor :resolve_time

        # Output only. State of the violation
        # Corresponds to the JSON property `state`
        # @return [String]
        attr_accessor :state

        # Output only. The last time when the Violation record was updated.
        # Corresponds to the JSON property `updateTime`
        # @return [String]
        attr_accessor :update_time

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @acknowledged = args[:acknowledged] if args.key?(:acknowledged)
          @acknowledgement_time = args[:acknowledgement_time] if args.key?(:acknowledgement_time)
          @audit_log_link = args[:audit_log_link] if args.key?(:audit_log_link)
          @begin_time = args[:begin_time] if args.key?(:begin_time)
          @category = args[:category] if args.key?(:category)
          @description = args[:description] if args.key?(:description)
          @exception_audit_log_link = args[:exception_audit_log_link] if args.key?(:exception_audit_log_link)
          @name = args[:name] if args.key?(:name)
          @non_compliant_org_policy = args[:non_compliant_org_policy] if args.key?(:non_compliant_org_policy)
          @org_policy_constraint = args[:org_policy_constraint] if args.key?(:org_policy_constraint)
          @remediation = args[:remediation] if args.key?(:remediation)
          @resolve_time = args[:resolve_time] if args.key?(:resolve_time)
          @state = args[:state] if args.key?(:state)
          @update_time = args[:update_time] if args.key?(:update_time)
        end
      end

      # Represents remediation guidance to resolve compliance violation for
      # AssuredWorkload
      class GoogleCloudAssuredworkloadsV1ViolationRemediation
        include Google::Apis::Core::Hashable

        # Values that can resolve the violation For example: for list org policy
        # violations, this will either be the list of allowed or denied values
        # Corresponds to the JSON property `compliantValues`
        # @return [Array<String>]
        attr_accessor :compliant_values

        # Instructions to remediate violation
        # Corresponds to the JSON property `instructions`
        # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1ViolationRemediationInstructions]
        attr_accessor :instructions

        # Output only. Reemediation type based on the type of org policy values violated
        # Corresponds to the JSON property `remediationType`
        # @return [String]
        attr_accessor :remediation_type

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @compliant_values = args[:compliant_values] if args.key?(:compliant_values)
          @instructions = args[:instructions] if args.key?(:instructions)
          @remediation_type = args[:remediation_type] if args.key?(:remediation_type)
        end
      end

      # Instructions to remediate violation
      class GoogleCloudAssuredworkloadsV1ViolationRemediationInstructions
        include Google::Apis::Core::Hashable

        # Remediation instructions to resolve violation via cloud console
        # Corresponds to the JSON property `consoleInstructions`
        # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1ViolationRemediationInstructionsConsole]
        attr_accessor :console_instructions

        # Remediation instructions to resolve violation via gcloud cli
        # Corresponds to the JSON property `gcloudInstructions`
        # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1ViolationRemediationInstructionsGcloud]
        attr_accessor :gcloud_instructions

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @console_instructions = args[:console_instructions] if args.key?(:console_instructions)
          @gcloud_instructions = args[:gcloud_instructions] if args.key?(:gcloud_instructions)
        end
      end

      # Remediation instructions to resolve violation via cloud console
      class GoogleCloudAssuredworkloadsV1ViolationRemediationInstructionsConsole
        include Google::Apis::Core::Hashable

        # Additional urls for more information about steps
        # Corresponds to the JSON property `additionalLinks`
        # @return [Array<String>]
        attr_accessor :additional_links

        # Link to console page where violations can be resolved
        # Corresponds to the JSON property `consoleUris`
        # @return [Array<String>]
        attr_accessor :console_uris

        # Steps to resolve violation via cloud console
        # Corresponds to the JSON property `steps`
        # @return [Array<String>]
        attr_accessor :steps

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @additional_links = args[:additional_links] if args.key?(:additional_links)
          @console_uris = args[:console_uris] if args.key?(:console_uris)
          @steps = args[:steps] if args.key?(:steps)
        end
      end

      # Remediation instructions to resolve violation via gcloud cli
      class GoogleCloudAssuredworkloadsV1ViolationRemediationInstructionsGcloud
        include Google::Apis::Core::Hashable

        # Additional urls for more information about steps
        # Corresponds to the JSON property `additionalLinks`
        # @return [Array<String>]
        attr_accessor :additional_links

        # Gcloud command to resolve violation
        # Corresponds to the JSON property `gcloudCommands`
        # @return [Array<String>]
        attr_accessor :gcloud_commands

        # Steps to resolve violation via gcloud cli
        # Corresponds to the JSON property `steps`
        # @return [Array<String>]
        attr_accessor :steps

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @additional_links = args[:additional_links] if args.key?(:additional_links)
          @gcloud_commands = args[:gcloud_commands] if args.key?(:gcloud_commands)
          @steps = args[:steps] if args.key?(:steps)
        end
      end

      # A Workload object for managing highly regulated workloads of cloud customers.
      class GoogleCloudAssuredworkloadsV1Workload
        include Google::Apis::Core::Hashable

        # Optional. The billing account used for the resources which are direct children
        # of workload. This billing account is initially associated with the resources
        # created as part of Workload creation. After the initial creation of these
        # resources, the customer can change the assigned billing account. The resource
        # name has the form `billingAccounts/`billing_account_id``. For example, `
        # billingAccounts/012345-567890-ABCDEF`.
        # Corresponds to the JSON property `billingAccount`
        # @return [String]
        attr_accessor :billing_account

        # Required. Immutable. Compliance Regime associated with this workload.
        # Corresponds to the JSON property `complianceRegime`
        # @return [String]
        attr_accessor :compliance_regime

        # Represents the Compliance Status of this workload
        # Corresponds to the JSON property `complianceStatus`
        # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadComplianceStatus]
        attr_accessor :compliance_status

        # Output only. Urls for services which are compliant for this Assured Workload,
        # but which are currently disallowed by the ResourceUsageRestriction org policy.
        # Invoke RestrictAllowedResources endpoint to allow your project developers to
        # use these services in their environment."
        # Corresponds to the JSON property `compliantButDisallowedServices`
        # @return [Array<String>]
        attr_accessor :compliant_but_disallowed_services

        # Output only. Immutable. The Workload creation timestamp.
        # Corresponds to the JSON property `createTime`
        # @return [String]
        attr_accessor :create_time

        # Required. The user-assigned display name of the Workload. When present it must
        # be between 4 to 30 characters. Allowed characters are: lowercase and uppercase
        # letters, numbers, hyphen, and spaces. Example: My Workload
        # Corresponds to the JSON property `displayName`
        # @return [String]
        attr_accessor :display_name

        # Optional. Indicates the sovereignty status of the given workload. Currently
        # meant to be used by Europe/Canada customers.
        # Corresponds to the JSON property `enableSovereignControls`
        # @return [Boolean]
        attr_accessor :enable_sovereign_controls
        alias_method :enable_sovereign_controls?, :enable_sovereign_controls

        # Optional. ETag of the workload, it is calculated on the basis of the Workload
        # contents. It will be used in Update & Delete operations.
        # Corresponds to the JSON property `etag`
        # @return [String]
        attr_accessor :etag

        # Output only. Represents the KAJ enrollment state of the given workload.
        # Corresponds to the JSON property `kajEnrollmentState`
        # @return [String]
        attr_accessor :kaj_enrollment_state

        # Settings specific to the Key Management Service. This message is deprecated.
        # In order to create a Keyring, callers should specify, ENCRYPTION_KEYS_PROJECT
        # or KEYRING in ResourceSettings.resource_type field.
        # Corresponds to the JSON property `kmsSettings`
        # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadKmsSettings]
        attr_accessor :kms_settings

        # Optional. Labels applied to the workload.
        # Corresponds to the JSON property `labels`
        # @return [Hash<String,String>]
        attr_accessor :labels

        # Optional. The resource name of the workload. Format: organizations/`
        # organization`/locations/`location`/workloads/`workload` Read-only.
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name

        # Optional. Partner regime associated with this workload.
        # Corresponds to the JSON property `partner`
        # @return [String]
        attr_accessor :partner

        # Input only. The parent resource for the resources managed by this Assured
        # Workload. May be either empty or a folder resource which is a child of the
        # Workload parent. If not specified all resources are created under the parent
        # organization. Format: folders/`folder_id`
        # Corresponds to the JSON property `provisionedResourcesParent`
        # @return [String]
        attr_accessor :provisioned_resources_parent

        # Input only. Resource properties that are used to customize workload resources.
        # These properties (such as custom project id) will be used to create workload
        # resources if possible. This field is optional.
        # Corresponds to the JSON property `resourceSettings`
        # @return [Array<Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadResourceSettings>]
        attr_accessor :resource_settings

        # Output only. The resources associated with this workload. These resources will
        # be created when creating the workload. If any of the projects already exist,
        # the workload creation will fail. Always read only.
        # Corresponds to the JSON property `resources`
        # @return [Array<Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadResourceInfo>]
        attr_accessor :resources

        # Signed Access Approvals (SAA) enrollment response.
        # Corresponds to the JSON property `saaEnrollmentResponse`
        # @return [Google::Apis::AssuredworkloadsV1::GoogleCloudAssuredworkloadsV1WorkloadSaaEnrollmentResponse]
        attr_accessor :saa_enrollment_response

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @billing_account = args[:billing_account] if args.key?(:billing_account)
          @compliance_regime = args[:compliance_regime] if args.key?(:compliance_regime)
          @compliance_status = args[:compliance_status] if args.key?(:compliance_status)
          @compliant_but_disallowed_services = args[:compliant_but_disallowed_services] if args.key?(:compliant_but_disallowed_services)
          @create_time = args[:create_time] if args.key?(:create_time)
          @display_name = args[:display_name] if args.key?(:display_name)
          @enable_sovereign_controls = args[:enable_sovereign_controls] if args.key?(:enable_sovereign_controls)
          @etag = args[:etag] if args.key?(:etag)
          @kaj_enrollment_state = args[:kaj_enrollment_state] if args.key?(:kaj_enrollment_state)
          @kms_settings = args[:kms_settings] if args.key?(:kms_settings)
          @labels = args[:labels] if args.key?(:labels)
          @name = args[:name] if args.key?(:name)
          @partner = args[:partner] if args.key?(:partner)
          @provisioned_resources_parent = args[:provisioned_resources_parent] if args.key?(:provisioned_resources_parent)
          @resource_settings = args[:resource_settings] if args.key?(:resource_settings)
          @resources = args[:resources] if args.key?(:resources)
          @saa_enrollment_response = args[:saa_enrollment_response] if args.key?(:saa_enrollment_response)
        end
      end

      # Represents the Compliance Status of this workload
      class GoogleCloudAssuredworkloadsV1WorkloadComplianceStatus
        include Google::Apis::Core::Hashable

        # Count of active Violations which are acknowledged in the Workload.
        # Corresponds to the JSON property `acknowledgedViolationCount`
        # @return [Fixnum]
        attr_accessor :acknowledged_violation_count

        # Count of active Violations which haven't been acknowledged.
        # Corresponds to the JSON property `activeViolationCount`
        # @return [Fixnum]
        attr_accessor :active_violation_count

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @acknowledged_violation_count = args[:acknowledged_violation_count] if args.key?(:acknowledged_violation_count)
          @active_violation_count = args[:active_violation_count] if args.key?(:active_violation_count)
        end
      end

      # Settings specific to the Key Management Service. This message is deprecated.
      # In order to create a Keyring, callers should specify, ENCRYPTION_KEYS_PROJECT
      # or KEYRING in ResourceSettings.resource_type field.
      class GoogleCloudAssuredworkloadsV1WorkloadKmsSettings
        include Google::Apis::Core::Hashable

        # Required. Input only. Immutable. The time at which the Key Management Service
        # will automatically create a new version of the crypto key and mark it as the
        # primary.
        # Corresponds to the JSON property `nextRotationTime`
        # @return [String]
        attr_accessor :next_rotation_time

        # Required. Input only. Immutable. [next_rotation_time] will be advanced by this
        # period when the Key Management Service automatically rotates a key. Must be at
        # least 24 hours and at most 876,000 hours.
        # Corresponds to the JSON property `rotationPeriod`
        # @return [String]
        attr_accessor :rotation_period

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @next_rotation_time = args[:next_rotation_time] if args.key?(:next_rotation_time)
          @rotation_period = args[:rotation_period] if args.key?(:rotation_period)
        end
      end

      # Represent the resources that are children of this Workload.
      class GoogleCloudAssuredworkloadsV1WorkloadResourceInfo
        include Google::Apis::Core::Hashable

        # Resource identifier. For a project this represents project_number.
        # Corresponds to the JSON property `resourceId`
        # @return [Fixnum]
        attr_accessor :resource_id

        # Indicates the type of resource.
        # Corresponds to the JSON property `resourceType`
        # @return [String]
        attr_accessor :resource_type

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @resource_id = args[:resource_id] if args.key?(:resource_id)
          @resource_type = args[:resource_type] if args.key?(:resource_type)
        end
      end

      # Represent the custom settings for the resources to be created.
      class GoogleCloudAssuredworkloadsV1WorkloadResourceSettings
        include Google::Apis::Core::Hashable

        # User-assigned resource display name. If not empty it will be used to create a
        # resource with the specified name.
        # Corresponds to the JSON property `displayName`
        # @return [String]
        attr_accessor :display_name

        # Resource identifier. For a project this represents project_id. If the project
        # is already taken, the workload creation will fail. For KeyRing, this
        # represents the keyring_id. For a folder, don't set this value as folder_id is
        # assigned by Google.
        # Corresponds to the JSON property `resourceId`
        # @return [String]
        attr_accessor :resource_id

        # Indicates the type of resource. This field should be specified to correspond
        # the id to the right resource type (CONSUMER_FOLDER or ENCRYPTION_KEYS_PROJECT)
        # Corresponds to the JSON property `resourceType`
        # @return [String]
        attr_accessor :resource_type

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @display_name = args[:display_name] if args.key?(:display_name)
          @resource_id = args[:resource_id] if args.key?(:resource_id)
          @resource_type = args[:resource_type] if args.key?(:resource_type)
        end
      end

      # Signed Access Approvals (SAA) enrollment response.
      class GoogleCloudAssuredworkloadsV1WorkloadSaaEnrollmentResponse
        include Google::Apis::Core::Hashable

        # Indicates SAA enrollment setup error if any.
        # Corresponds to the JSON property `setupErrors`
        # @return [Array<String>]
        attr_accessor :setup_errors

        # Indicates SAA enrollment status of a given workload.
        # Corresponds to the JSON property `setupStatus`
        # @return [String]
        attr_accessor :setup_status

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @setup_errors = args[:setup_errors] if args.key?(:setup_errors)
          @setup_status = args[:setup_status] if args.key?(:setup_status)
        end
      end

      # The response message for Operations.ListOperations.
      class GoogleLongrunningListOperationsResponse
        include Google::Apis::Core::Hashable

        # The standard List next-page token.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token

        # A list of operations that matches the specified filter in the request.
        # Corresponds to the JSON property `operations`
        # @return [Array<Google::Apis::AssuredworkloadsV1::GoogleLongrunningOperation>]
        attr_accessor :operations

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
          @operations = args[:operations] if args.key?(:operations)
        end
      end

      # This resource represents a long-running operation that is the result of a
      # network API call.
      class GoogleLongrunningOperation
        include Google::Apis::Core::Hashable

        # If the value is `false`, it means the operation is still in progress. If `true`
        # , the operation is completed, and either `error` or `response` is available.
        # Corresponds to the JSON property `done`
        # @return [Boolean]
        attr_accessor :done
        alias_method :done?, :done

        # The `Status` type defines a logical error model that is suitable for different
        # programming environments, including REST APIs and RPC APIs. It is used by [
        # gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
        # data: error code, error message, and error details. You can find out more
        # about this error model and how to work with it in the [API Design Guide](https:
        # //cloud.google.com/apis/design/errors).
        # Corresponds to the JSON property `error`
        # @return [Google::Apis::AssuredworkloadsV1::GoogleRpcStatus]
        attr_accessor :error

        # Service-specific metadata associated with the operation. It typically contains
        # progress information and common metadata such as create time. Some services
        # might not provide such metadata. Any method that returns a long-running
        # operation should document the metadata type, if any.
        # Corresponds to the JSON property `metadata`
        # @return [Hash<String,Object>]
        attr_accessor :metadata

        # The server-assigned name, which is only unique within the same service that
        # originally returns it. If you use the default HTTP mapping, the `name` should
        # be a resource name ending with `operations/`unique_id``.
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name

        # The normal response of the operation in case of success. If the original
        # method returns no data on success, such as `Delete`, the response is `google.
        # protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`,
        # the response should be the resource. For other methods, the response should
        # have the type `XxxResponse`, where `Xxx` is the original method name. For
        # example, if the original method name is `TakeSnapshot()`, the inferred
        # response type is `TakeSnapshotResponse`.
        # Corresponds to the JSON property `response`
        # @return [Hash<String,Object>]
        attr_accessor :response

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @done = args[:done] if args.key?(:done)
          @error = args[:error] if args.key?(:error)
          @metadata = args[:metadata] if args.key?(:metadata)
          @name = args[:name] if args.key?(:name)
          @response = args[:response] if args.key?(:response)
        end
      end

      # A generic empty message that you can re-use to avoid defining duplicated empty
      # messages in your APIs. A typical example is to use it as the request or the
      # response type of an API method. For instance: service Foo ` rpc Bar(google.
      # protobuf.Empty) returns (google.protobuf.Empty); `
      class GoogleProtobufEmpty
        include Google::Apis::Core::Hashable

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
        end
      end

      # The `Status` type defines a logical error model that is suitable for different
      # programming environments, including REST APIs and RPC APIs. It is used by [
      # gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
      # data: error code, error message, and error details. You can find out more
      # about this error model and how to work with it in the [API Design Guide](https:
      # //cloud.google.com/apis/design/errors).
      class GoogleRpcStatus
        include Google::Apis::Core::Hashable

        # The status code, which should be an enum value of google.rpc.Code.
        # Corresponds to the JSON property `code`
        # @return [Fixnum]
        attr_accessor :code

        # A list of messages that carry the error details. There is a common set of
        # message types for APIs to use.
        # Corresponds to the JSON property `details`
        # @return [Array<Hash<String,Object>>]
        attr_accessor :details

        # A developer-facing error message, which should be in English. Any user-facing
        # error message should be localized and sent in the google.rpc.Status.details
        # field, or localized by the client.
        # Corresponds to the JSON property `message`
        # @return [String]
        attr_accessor :message

        def initialize(**args)
           update!(**args)
        end

        # Update properties of this object
        def update!(**args)
          @code = args[:code] if args.key?(:code)
          @details = args[:details] if args.key?(:details)
          @message = args[:message] if args.key?(:message)
        end
      end
    end
  end
end


text:
package org.test.shop.model.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.test.shop.controller.data.types.ScrollableSettings;
import org.test.shop.model.dao.PaymentDetailsDao;
import org.test.shop.model.domain.entity.PaymentDetails;
import org.test.shop.util.data.types.DateCompare;

@Service
@Transactional
public class PaymentDetailsService {

	@Autowired
	private PaymentDetailsDao paymentdetailsDao;

	@Transactional
	public PaymentDetails create(PaymentDetails data) {
		return paymentdetailsDao.create(data);
	}

	@Transactional
	public PaymentDetails update(PaymentDetails data) {
		return paymentdetailsDao.update(data);
	}

	@Transactional
	public Boolean delete(Object id) {
		return paymentdetailsDao.delete(id);
	}

	@Transactional
	public void popularity(PaymentDetails data) {
		paymentdetailsDao.popularity(data);
	}

	@Transactional
	public void popularityByKey(Object data) {
		paymentdetailsDao.popularityByKey(data);
	}

	@Transactional(readOnly = true)
	public Integer todayNumber(ScrollableSettings settings) throws Exception {
		return paymentdetailsDao.todayNumber(settings);
	}

	@Transactional(readOnly = true)
	public Integer total(ScrollableSettings settings) throws Exception {
		return paymentdetailsDao.total(settings);
	}

	@Transactional(readOnly = true)
	public List<PaymentDetails> namedFilter(ScrollableSettings settings) {
		return paymentdetailsDao.namedFilter(settings);
	}

	@Transactional(readOnly = true)
	public List<PaymentDetails> search(ScrollableSettings settings){
		return  paymentdetailsDao.search(settings);
	}

	@Transactional(readOnly = true)
	public List<PaymentDetails> findByExample(PaymentDetails example, String delimitter, ScrollableSettings settings) {
		return paymentdetailsDao.findByExample(example, delimitter, settings);
	}

	@Transactional(readOnly = true)
	public List<PaymentDetails> findByExample2(PaymentDetails example, DateCompare type) {
		return paymentdetailsDao.findByExample2(example, type);
	}

	@Transactional(readOnly = true)
	public List<PaymentDetails> findAll() {
		return paymentdetailsDao.findAll(new ScrollableSettings());
	}

	@Transactional(readOnly = true)
	public List<PaymentDetails> findAll(ScrollableSettings settings) {
		return paymentdetailsDao.findAll(settings);
	}

	@Transactional(readOnly = true)
	public List<PaymentDetails> findAllScrollable(ScrollableSettings settings) {
		return paymentdetailsDao.findAllScrollable(settings);
	}

	@Transactional(readOnly = true)
	public PaymentDetails findById(ScrollableSettings scrollableSettings) {
		return paymentdetailsDao.findById(scrollableSettings);
	}

	@Transactional(readOnly = true)
	public PaymentDetails findById(Object key, Boolean initAll) {
		return paymentdetailsDao.findById(key, initAll);
	}

}


text:
namespace rst {

// The class for sinking to a file by its filename.
class FileNameSink final : public Sink {
 public:
  using Ptr = NotNull<std::unique_ptr<FileNameSink>>;

  // Opens a |filename| for writing. Returns LogError on error.
  static StatusOr<Ptr> Create(NotNull<const char*> filename);

  ~FileNameSink() override;

  // Sink:
  // Thread safe logging function.
  void Log(std::string_view message) override;

 private:
  FileNameSink();

  // Mutex for thread-safe Log() function.
  std::mutex mutex_;

  // A RAII-wrapper around std::FILE.
  std::unique_ptr<std::FILE, void (*)(std::FILE*)> log_file_
      RST_PT_GUARDED_BY(mutex_){nullptr, [](std::FILE* f) {
                                  if (f != nullptr)
                                    (void)std::fclose(f);
                                }};

  RST_DISALLOW_COPY_AND_ASSIGN(FileNameSink);
};

}  // namespace rst

#endif  // RST_LOGGER_FILE_NAME_SINK_H_


text:
package org.colorcoding.ibas.initialfantasy.logic;

import org.colorcoding.ibas.bobas.bo.IBusinessObject;
import org.colorcoding.ibas.bobas.common.ConditionOperation;
import org.colorcoding.ibas.bobas.common.Criteria;
import org.colorcoding.ibas.bobas.common.ICondition;
import org.colorcoding.ibas.bobas.common.ICriteria;
import org.colorcoding.ibas.bobas.common.IOperationResult;
import org.colorcoding.ibas.bobas.i18n.I18N;
import org.colorcoding.ibas.bobas.logic.BusinessLogic;
import org.colorcoding.ibas.bobas.logic.BusinessLogicException;
import org.colorcoding.ibas.bobas.mapping.LogicContract;
import org.colorcoding.ibas.initialfantasy.bo.organization.IUser;
import org.colorcoding.ibas.initialfantasy.bo.organization.User;
import org.colorcoding.ibas.initialfantasy.repository.BORepositoryInitialFantasy;

@LogicContract(IUserMailCheckContract.class)
public class UserMailCheckBusinessLogic extends BusinessLogic<IUserMailCheckContract, IBusinessObject> {

	@Override
	protected IBusinessObject fetchBeAffected(IUserMailCheckContract contract) {
		return new IBusinessObject() {
			private static final long serialVersionUID = 1L;

			@Override
			public boolean isValid() {
				return true;
			}

			@Override
			public boolean isSavable() {
				return false;
			}

			@Override
			public boolean isNew() {
				return false;
			}

			@Override
			public boolean isLoading() {
				return false;
			}

			@Override
			public boolean isDirty() {
				return false;
			}

			@Override
			public boolean isDeleted() {
				return false;
			}

			@Override
			public boolean isBusy() {
				return false;
			}

			@Override
			public String toString(String type) {
				return this.getIdentifiers();
			}

			@Override
			public ICriteria getCriteria() {
				return new Criteria();
			}

			@Override
			public void undelete() {
			}

			@Override
			public String getIdentifiers() {
				return "{business object: proxy}";
			}

			@Override
			public void delete() {
			}
		};
	}

	@Override
	protected void impact(IUserMailCheckContract contract) {
		if (contract.getMail() == null || contract.getMail().isEmpty()) {
			return;
		}
		ICriteria criteria = new Criteria();
		ICondition condition = criteria.getConditions().create();
		condition.setAlias(User.PROPERTY_MAIL.getName());
		condition.setValue(contract.getMail());
		condition.setOperation(ConditionOperation.EQUAL);
		BORepositoryInitialFantasy boRepository = new BORepositoryInitialFantasy();
		boRepository.setRepository(super.getRepository());
		IOperationResult<IUser> operationResult = boRepository.fetchUser(criteria);
		if (operationResult.getError() != null) {
			throw new BusinessLogicException(operationResult.getError());
		}
		for (IUser user : operationResult.getResultObjects()) {
			if (!user.getCode().equalsIgnoreCase(contract.getCode())) {
				throw new BusinessLogicException(I18N.prop("msg_if_mail_has_been_used", contract.getMail()));
			}
		}

	}

	@Override
	protected void revoke(IUserMailCheckContract contract) {
	}

}


text:
namespace Stripe
{
    using Newtonsoft.Json;
    using Stripe.Infrastructure;

    public class QuoteFromQuote : StripeEntity<QuoteFromQuote>
    {
        ///
        /// Whether this quote is a revision of a different quote.
        ///
        [JsonProperty("is_revision")]
        public bool IsRevision { get; set; }

        #region Expandable Quote

        ///
        /// (ID of the Quote)
        /// The quote that was cloned.
        ///
        [JsonIgnore]
        public string QuoteId
        {
            get => this.InternalQuote?.Id;
            set => this.InternalQuote = SetExpandableFieldId(value, this.InternalQuote);
        }

        ///
        /// (Expanded)
        /// The quote that was cloned.
        ///
        /// For more information, see the expand documentation.
        ///
        [JsonIgnore]
        public Quote Quote
        {
            get => this.InternalQuote?.ExpandedObject;
            set => this.InternalQuote = SetExpandableFieldObject(value, this.InternalQuote);
        }

        [JsonProperty("quote")]
        [JsonConverter(typeof(ExpandableFieldConverter<Quote>))]
        internal ExpandableField<Quote> InternalQuote { get; set; }
        #endregion
    }
}


text:
package com.google.android.testing.mocking;

import junit.framework.TestCase;

import java.io.File;
import java.util.Vector;

/**
 * @author swoodward@google.com (Stephen Woodward)
 */
public class FileUtilsTest extends TestCase {
  public void testGetFilenameForClass() {
    assertEquals(convertPathToNative("java/lang/Object.class"),
        FileUtils.getFilenameFor(Object.class.getName()));
    assertEquals(convertPathToNative(
            "com/google/android/testing/mocking/FileUtilsTest$InnerClass.class"),
        FileUtils.getFilenameFor(InnerClass.class.getName()));
  }

  public void testGetClassNameFor() {
    assertEquals(convertPathToNative("java/lang/Object.class"),
        FileUtils.getFilenameFor(Object.class.getName()));
    assertEquals(convertPathToNative(
            "com/google/android/testing/mocking/FileUtilsTest$InnerClass.class"),
        FileUtils.getFilenameFor(InnerClass.class.getName()));
  }

  public void testGetInterfaceNameFor() {
    assertEquals("v15.genmocks.java.util.VectorDelegateInterface",
        FileUtils.getInterfaceNameFor(Vector.class, SdkVersion.CUPCAKE));
    assertEquals("v16.genmocks.java.util.VectorDelegateInterface",
        FileUtils.getInterfaceNameFor(Vector.class, SdkVersion.DONUT));
    assertEquals("v201.genmocks.java.util.VectorDelegateInterface",
        FileUtils.getInterfaceNameFor(Vector.class, SdkVersion.ECLAIR_0_1));
    assertEquals("v21.genmocks.java.util.VectorDelegateInterface",
        FileUtils.getInterfaceNameFor(Vector.class, SdkVersion.ECLAIR_MR1));
    assertEquals("v22.genmocks.java.util.VectorDelegateInterface",
        FileUtils.getInterfaceNameFor(Vector.class, SdkVersion.FROYO));
    assertEquals("genmocks.java.util.VectorDelegateInterface",
        FileUtils.getInterfaceNameFor(Vector.class, SdkVersion.UNKNOWN));
  }

  public void testGetSubclassNameFor() {
    assertEquals("v15.genmocks.java.util.VectorDelegateSubclass",
        FileUtils.getSubclassNameFor(Vector.class, SdkVersion.CUPCAKE));
    assertEquals("v16.genmocks.java.util.VectorDelegateSubclass",
        FileUtils.getSubclassNameFor(Vector.class, SdkVersion.DONUT));
    assertEquals("v201.genmocks.java.util.VectorDelegateSubclass",
        FileUtils.getSubclassNameFor(Vector.class, SdkVersion.ECLAIR_0_1));
    assertEquals("v21.genmocks.java.util.VectorDelegateSubclass",
        FileUtils.getSubclassNameFor(Vector.class, SdkVersion.ECLAIR_MR1));
    assertEquals("v22.genmocks.java.util.VectorDelegateSubclass",
        FileUtils.getSubclassNameFor(Vector.class, SdkVersion.FROYO));
    assertEquals("genmocks.java.util.VectorDelegateSubclass",
        FileUtils.getSubclassNameFor(Vector.class, SdkVersion.UNKNOWN));
  }

  private String convertPathToNative(String path) {
    return path.replace('/', File.separatorChar).replace('\\', File.separatorChar);
  }

  class InnerClass {
  }
}


text:
jQuery.extend({
    getScript: function(url, callback) {
        var head	= document.getElementsByTagName("head")[0];
        var script	= document.createElement("script");
        var done = false; // Handle Script loading
        script.src	= url;
        script.onload = script.onreadystatechange = function() { // Attach handlers for all browsers
            if ( !done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) {
                done = true;
                if (callback) { callback(); }
                script.onload = script.onreadystatechange = null; // Handle memory leak in IE
            }
        };

        head.appendChild(script);
        return undefined; // We handle everything using the script element injection
    }
});


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { VotetakerComponent } from './votetaker.component';

describe('VotetakerComponent', () => {
  let component: VotetakerComponent;
  let fixture: ComponentFixture<VotetakerComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ VotetakerComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(VotetakerComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});


text:
package com.djsoft.hrmapp.controller;

import java.io.File;

import javax.servlet.http.HttpSession;

import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.djsoft.hrmapp.domain.Document;
import com.djsoft.hrmapp.domain.User;
import com.djsoft.hrmapp.service.HrmService;

@Controller
public class DocumentController {
	@Autowired
	private HrmService hrmService;
	@RequestMapping(value="/document/adddocument")
	public String addDocument(@ModelAttribute Document document,HttpSession session) throws Exception{
		// 上传文件路径
		String path = session.getServletContext().getRealPath("/upload/");
		// 上传文件名
		String fileName = document.getFile().getOriginalFilename();
		// 将上传文件保存到一个目标文件当中
		document.getFile().transferTo(new File(path+fileName));
		// 设置fileName
		document.setFileName(fileName);
		// 设置关联的User对象
		User user = hrmService.findUserById(1);
		document.setUser(user);
		hrmService.addDocument(document);
		return "redirect:/document/selectdocument";
	}
	@RequestMapping(value="/document/selectdocument")
	public String selectDocument(Model model){
		model.addAttribute("documents", hrmService.findDocument());
		return "document/document";
	}
	/**
	 * 处理文档下载请求
	 * @param String flag 标记, 1表示跳转到修改页面,2表示执行修改操作
	 * @param Document document 要修改文档的对象
	 * @param ModelAndView mv
	 * */
	@RequestMapping(value="/document/download/{id}")
	 public ResponseEntity<byte[]>  download(
			 @PathVariable("id") Integer id,
			 HttpSession session) throws Exception{
		// 根据id查询文档
		Document document = hrmService.findDocumentById(id);
		String fileName = document.getFileName();
		// 上传文件路径
		String path = session.getServletContext().getRealPath("/upload/");
		// 获得要下载文件的File对象
		File file = new File(path+fileName);
		// 创建springframework的HttpHeaders对象
		HttpHeaders headers = new HttpHeaders();
        // 下载显示的文件名,解决中文名称乱码问题
        String downloadFielName = new String(fileName.getBytes("UTF-8"),"iso-8859-1");
        // 通知浏览器以attachment(下载方式)打开图片
        headers.setContentDispositionFormData("attachment", downloadFielName);
        // application/octet-stream : 二进制流数据(最常见的文件下载)。
        headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
        // 201 HttpStatus.CREATED
        return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file), headers, HttpStatus.CREATED);
	}
}


text:
from aquilon.aqdb.model import Share
from aquilon.worker.broker import BrokerCommand, validate_basic
from aquilon.worker.dbwrappers.resources import (del_resource,
                                                 get_resource_holder)

class CommandDelShare(BrokerCommand):

    required_parameters = ["share"]

    def render(self, session, logger, share,
               hostname, resourcegroup, cluster, **arguments):

        validate_basic("share", share)
        holder = get_resource_holder(session, hostname, cluster,
               resourcegroup)
        dbshare = Share.get_unique(session, name=share, holder=holder,
                                     compel=True)
        del_resource(session, logger, dbshare)
        return


text:
/* eslint prefer-arrow-callback: "off" */
// See: https://github.com/cucumber/cucumber-js/blob/master/docs/faq.md
/* eslint func-names: "off" */

const { assert, expect } = require('chai');
const csvParser = require('csv-parse');
const { Given, Then, When } = require('cucumber');
const path = require('path');
const request = require('request');

const ROOT_URL = 'http://localhost';
const wait = ms => new Promise(r => setTimeout(r, ms));
const URIS = {
  main: '/',
  search: '/search',
  previous_searched: '/search?value=eicar&type=name&page=1&offset=25',
};

Given('I am on the {word} page', async function (pageName) {
  // Waiting for networkidle allow XHR to be resolved
  await this.page.goto(ROOT_URL + URIS[pageName], { waitUntil: 'networkidle0' });
});

Then('I take a screenshot named {string}', async function (name) {
  await this.page.screenshot({ path: name });
});

Then('The page title should be {string}', async function (text) {
  expect(await this.page.title()).to.equal(text);
});

Then('I should see a(n) {string} alert', async function (type) {
  const errors = await this.page.$x('/html/body/alerts/div/ul/li');
  expect(errors).to.have.lengthOf(1);

  const className = await (await errors[0].getProperty('className')).jsonValue();
  expect(className).to.equal(`alert-${type}`);
});

// Depending on your needs, the regexp can match `should` or `should not` statements
Then('The file {string} should ({word} )be flagged as a malware', async function (fileName, status) {
  /**
   * Removing the eslint complaint which would require that the return
   * statement should be at the end of the block scope. Having the `return`
   * statement when the filename is found in the result list is more readable.
   */
  // eslint-disable-next-line consistent-return
  const className = await this.page.evaluate(function (selector, name) {
    /**
     * Removing the eslint complaint that `document` is not defined. The
     * `evaluate` function run the code directly in the browser, and `document`
     * is a global variable available there.
     */
    // eslint-disable-next-line no-undef
    const divs = document.querySelectorAll(selector);

    for (let i = 0; i < divs.length; i += 1) {
      if (divs[i].querySelector('a').text === name) {
        return divs[i].querySelector('span').className;
      }
    }
  }, '.infos', fileName);

  expect(className).to.include((status === 'not') ? 'label-success' : 'label-danger');
});

// Depending on your needs, the regexp can match `should` or `should not` statements
Then('I should ({word} )see {string} in the search results', async function (status, fileName) {
  const linkArray = await this.page.$x(`//a[contains(text(), "${fileName}")]`);

  // eslint-disable-next-line no-unused-expressions
  (status === 'not') ? expect(linkArray).to.be.empty : expect(linkArray).to.not.be.empty;
});

// Depending on your needs, the regexp can match `should` or `should not` statements
Then('The button {string} is ({word} )enabled', async function (text, negative) {
  const links = await this.page.$x(`//a[contains(text(), "${text}")]`);
  const buttons = await this.page.$x(`//button[contains(text(), "${text}")]`);
  const submits = await this.page.$x(`//input[@type="submit" and contains(@value, "${text}")]`);
  const clickables = links.concat(buttons, submits);

  // eslint-disable-next-line no-unused-expressions
  expect(clickables).to.be.an('array').to.not.be.empty;
  let enabled = 'false';
  if (negative === 'not') {
    enabled = 'true';
  }

  const disabled = await (await clickables[0].getProperty('disabled')).jsonValue();
  // eslint-disable-next-line no-unused-expressions
  expect(disabled).to.be[enabled];
});

Then('I should be able to download the csv report', async function () {
  /**
   * See: https://github.com/GoogleChrome/puppeteer/issues/299
   *
   * For the moment, Puppeteer isn't capable of downloading a file in headless
   * mode. To check that the CSV generation is working, we first try to click
   * on the `csv` button on the scan page, that will fail if there is a 404
   * error, and then perform a request to the API to retrieve the csv file,
   * and then check its content.
   */

  // Only retrieving the part matching the scan id to be used in the http request.
  const scanId = this.page.url().match(/\/scan\/(.{36})$/)[1];

  request(`${ROOT_URL}/api/v1.1/scans/${scanId}/report`, (err, res, body) => {
    if (err) { throw err; }

    csvParser(body, { delimiter: ';' }, (parseError, output) => {
      if (parseError) { throw parseError; }

      // Length of 3 assert that there is at least the header and two results.
      expect(output).to.have.lengthOf(3);
      // Length of 12 assert that there is the common informations and an AV result.
      expect(output[0]).to.have.lengthOf(12);
    });
  });
});

When('I go back', async function () {
  await this.page.goBack({ waitUntil: 'networkidle0' });
  /** For a strange reason the networkidle0 option is not working properly, the
   * next actions are perform too fast after the back action, and not waiting
   * for the XHR requests to be done.
   * This is a hotfixe, take a look at https://github.com/GoogleChrome/puppeteer/issues/1412
   */
  await wait(500);
});

When('I wait {int} second(s)', async function (number) {
  await wait(number * 1000);
});

When('I select the file named {string}', async function (fileName) {
  assert.notInclude(fileName, '..');

  await (
    await this.page.$x('//input[@id="file-container"]')
  )[0].uploadFile(path.join(process.env.PWD, '/tests/functionals/samples', fileName));
});

When('I click to choose a file', async function () {
  await (
    await this.page.$x('//div[@class="drop-zone"]')
  )[0].click();
});

// Test the progress bar from the upload which has his property
// aria-valuenow coming to 100 when all step from the upload are done
When('I wait for the upload to finish', async function () {
  await this.page.waitFor(() => {
    // eslint-disable-next-line no-undef
    const progress = document.querySelector('div.progress-bar');
    return progress && progress.getAttribute('aria-valuenow') === '100';
  });

  // Adding a waiter because it bugs on the CI
  // May be the action is quicker than the property changes on the DOM element
  await wait(500);
});

When('I wait for the scan to finish', async function () {
  await this.page.waitForXPath('//span[text()="Finished"]');
});

When('I type {string} in the search input', async function (search) {
  /**
   * TODO: There is the presence of two `#search` id on the page_ One
   * should be rename or replace with a more specific id.
   */
  await this.page.type('input#search', search);
});

When('I click on {string}', async function (text) {
  const links = await this.page.$x(`//a[contains(text(), "${text}")]`);
  const buttons = await this.page.$x(`//button[contains(text(), "${text}")]`);
  const submits = await this.page.$x(`//input[@type="submit" and contains(@value, "${text}")]`);

  const clickables = links.concat(buttons, submits);

  if (clickables[0] != null) {
    /** For a strange reason the networkidle0 option for the waitForNavigation
     * function is not working properly, the next actions are perform too fast
     * after the back action, and not waiting for the XHR requests to be done.
     * Using the `wait` function is a hotfixe, take a look at
     * https://github.com/GoogleChrome/puppeteer/issues/1412
     */
    // const navigationPromise = this.page.waitForNavigation({ waitUntil: 'networkidle0' });
    await clickables[0].click();
    // await navigationPromise;
    await wait(500);
  } else {
    throw Error(`Link "${text}" not found on the page`);
  }
});


text:
<core-navbar-buttons slot="end" prepend>
    <ion-button *ngIf="searchEnabled" (click)="openSearch()" [attr.aria-label]="'core.courses.searchcourses' | translate">
        <ion-icon name="fas-search" slot="icon-only" aria-hidden="true"></ion-icon>
    </ion-button>
</core-navbar-buttons>
<ion-content>
    <ion-refresher slot="fixed" [disabled]="!loaded" (ionRefresh)="refreshDashboard($event.target)">
        <ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
    </ion-refresher>

    <core-loading [hideUntil]="loaded">
        <ion-list class="list-item-limited-width">
            <ng-container *ngFor="let block of blocks">
                <core-block *ngIf="block.visible" [block]="block" contextLevel="user" [instanceId]="userId"></core-block>
            </ng-container>
        </ion-list>

        <core-block-side-blocks-button slot="fixed" *ngIf="hasSideBlocks" contextLevel="user" [instanceId]="userId">
        </core-block-side-blocks-button>

        <core-empty-box *ngIf="blocks.length == 0" icon="fas-cubes" [message]="'core.course.nocontentavailable' | translate">
        </core-empty-box>
    </core-loading>
</ion-content>


text: export const SET_SESSION_TOKEN = 'session/token.set';


text:
package com.trein.gtfs.jpa.repository;

import org.springframework.data.jpa.repository.JpaRepository;

import com.trein.gtfs.jpa.entity.Agency;

public interface AgencyRepository extends JpaRepository<Agency, Long> {

    Agency findByAgencyId(String id);
}


text:
/// <reference path="../Core/DependencyObject.ts" />

interface ITimeline {
    Update(nowTime: number);
}

module Fayde {
    export class Application extends DependencyObject implements IResourcable, ITimerListener {
        static Current: Application;
        MainSurface: Surface;
        Loaded = new nullstone.Event();
        Address: Uri = null;
        AllowNavigation = true;
        private _IsRunning: boolean = false;
        private _IsLoaded = false;
        private _Storyboards: ITimeline[] = [];
        private _ClockTimer: ClockTimer = new ClockTimer();
        private _RootVisual: UIElement = null;

        static ResourcesProperty = DependencyProperty.RegisterImmutable<ResourceDictionary>("Resources", () => ResourceDictionary, Application);
        static ThemeNameProperty = DependencyProperty.Register("ThemeName", () => String, Application, "Default", (d: Application, args) => d.OnThemeNameChanged(args));
        Resources: ResourceDictionary;
        ThemeName: string;

        private OnThemeNameChanged (args: DependencyPropertyChangedEventArgs) {
            if (!this._IsLoaded)
                return;
            ThemeManager.LoadAsync(args.NewValue)
                .then(() => this._ApplyTheme(),
                    err => console.error("Could not load theme.", err));
        }

        private _ApplyTheme () {
            for (var walker = this.MainSurface.walkLayers(); walker.step();) {
                for (var subwalker = walker.current.walkDeep(); subwalker.step();) {
                    var node = subwalker.current.getAttachedValue("$node");
                    Providers.ImplicitStyleBroker.Set(<FrameworkElement>node.XObject, Providers.StyleMask.Theme);
                }
            }
        }

        Resized = new RoutedEvent<SizeChangedEventArgs>();

        OnResized (oldSize: minerva.Size, newSize: minerva.Size) {
            this.Resized.raise(this, new SizeChangedEventArgs(oldSize, newSize));
        }

        constructor () {
            super();
            this.XamlNode.NameScope = new NameScope(true);
            var rd = Application.ResourcesProperty.Initialize(this);
            this.MainSurface = new Surface(this);
            this.Address = new Uri(document.URL);
        }

        get RootVisual (): UIElement {
            for (var walker = this.MainSurface.walkLayers(); walker.step();) {
                var node = walker.current.getAttachedValue("$node");
                return node.XObject;
            }
        }

        $$SetRootVisual (value: UIElement) {
            this._RootVisual = value;
        }

        Attach (canvas: HTMLCanvasElement) {
            this.MainSurface.init(canvas);
            this.MainSurface.Attach(this._RootVisual, true);
        }

        Start () {
            this.Update();
            this.Render();
            this._ClockTimer.RegisterTimer(this);
            this._IsLoaded = true;
            this.Loaded.raiseAsync(this, null);
        }

        OnTicked (lastTime: number, nowTime: number) {
            this.ProcessStoryboards(lastTime, nowTime);
            this.Update();
            this.Render();
        }

        private StopEngine () {
            this._ClockTimer.UnregisterTimer(this);
        }

        private ProcessStoryboards (lastTime: number, nowTime: number) {
            perfex.timer.start('StoryboardsProcess', this);
            for (var i = 0, sbs = this._Storyboards; i < sbs.length; i++) {
                sbs[i].Update(nowTime);
            }
            perfex.timer.stop();
        }

        private Update () {
            if (this._IsRunning)
                return;
            this._IsRunning = true;
            perfex.timer.start('UpdateLayout', this);
            var updated = this.MainSurface.updateLayout();
            perfex.timer.stop();
            this._IsRunning = false;
        }

        private Render () {
            perfex.timer.start('Render', this);
            this.MainSurface.render();
            perfex.timer.stop();
        }

        RegisterStoryboard (storyboard: ITimeline) {
            var sbs = this._Storyboards;
            var index = sbs.indexOf(storyboard);
            if (index === -1)
                sbs.push(storyboard);
        }

        UnregisterStoryboard (storyboard: ITimeline) {
            var sbs = this._Storyboards;
            var index = sbs.indexOf(storyboard);
            if (index !== -1)
                sbs.splice(index, 1);
        }

        static GetAsync (url: string): nullstone.async.IAsyncRequest<Application> {
            return nullstone.async.create((resolve, reject) => {
                Markup.Resolve(url)
                    .then(appm => {
                        TimelineProfile.Parse(true, "App");
                        var app = Markup.Load<Application>(null, appm);
                        TimelineProfile.Parse(false, "App");
                        if (!(app instanceof Application))
                            reject("Markup must be an Application.");
                        else
                            resolve(app);
                    }, reject);
            });
        }

        Resolve (): nullstone.async.IAsyncRequest<Application> {
            return nullstone.async.create((resolve, reject) => {
                //TODO: Resolve theme
                resolve(this);
            });

            /*
             var d = defer<Application>();

             var lib = Library.Get("lib:Fayde");
             lib.Resolve({ThemeName: this.ThemeName || "Default", Resolving: []})
             .success(lib => {
             this._CoreLibrary = lib;
             d.resolve(this);
             })
             .error(d.reject);

             return d.request;
             */
        }
    }
    Fayde.CoreLibrary.add(Application);
}


text:
// Lossless conversion to int32 for compensation, needs to bail out even with aggressive int spec disabled. Incr_A is not
// type-specialized on loop second pass, because 'a' is live on the back-edge and becomes a NumberValue on merge, in turn
// because '++a' may overflow a 32-bit integer during the loop. The lossless conversion to int32 therefore must include bailout,
// to account for the overflow. Ideally, we should not do the conversion to int32 on the back-edge, and instead make the var sym
// live in the landing pad (or loop header if it's only live inside the loop).
function test0(n) {
    var k = 0x3fffffff;
    k <<= 1;
    if(n === 1)
        --k;
    var a = k;
    while(n-- !== 0)
        ++a;
    return a;
}
WScript.Echo("test0: " + test0(2));

// Array element type specialization bug (uses lossy int32 index)
function test1() {
    var a = [1];
    a.foo = 2;
    function test1a(i) {
        var j = i & 1;
        return a[i] + a[j];
    }
    return test1a("foo");
}
WScript.Echo("test1: " + test1());

// Loop prepass, upon type specialization, should keep the destination value consistent with that sym's liveness. In this case,
// 'i' is not int-specialized in the loop prepass when aggressive int type specialization is disabled, so 'i' should be given
// a number or unknown value.
function test2() {
    var i = 0;
    do {
        ++i;
    } while(i < 1);
    return i;
}
WScript.Echo("test2: " + test2());

// - Lossy conversion of 'a' to int32 due to 'a | 0' should include a bailout on implicit calls since it may have a side effect
// - The FromVar with bailout should not be dead-store-removed due to the possibility of side effects
// - When lossy int type specialization is disabled, the resulting value of '~a' should still be an int range value so that the
//   '+' can still be int-specialized
// - Errors during ToPrimitive are handled appropriately by throwing after bailing out
function test3a(a) {
    a | 0;
    return ~a + 1;
}
WScript.Echo("test3a: " + test3a(-2));
function test3b(a) {
    a | 0;
    return ~a + 1;
}
WScript.Echo(
    "test3b: " +
    test3b(
        {
            valueOf:
                function () {
                    WScript.Echo("test3b: valueOf");
                    return -2;
                }
        }));
function test3c(a) {
    a | 0;
    return a | 0;
}
WScript.Echo("test3c: " + safeCall(test3c, { valueOf: null, toString: null }));

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

function safeCall(f) {
    var args = [];
    for(var a = 1; a < arguments.length; ++a)
        args.push(arguments[a]);
    try {
        return f.apply(this, args);
    } catch(ex) {
        return ex.name;
    }
}

// Conversions from uint32 to int32 should be treated as lossy
WScript.Echo("test4");
function makeArrayLength(x) {
    print( Math.floor(x));
  }
function test4(a) {

  var func2 = function () {
  };
  func2.length = 1;
  func2.prop4 = 1;
  var __loopvar2 = 0;
  while ((func2.prop4+ 2147483650) |1) {

    if (__loopvar2) {
      break;
    }
    __loopvar2 = 2;
	   makeArrayLength(2147483650);
  }
}
test4();
test4();


text:
#include <aws/greengrass/model/DeploymentType.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Greengrass
  {
    namespace Model
    {
      namespace DeploymentTypeMapper
      {

        static const int NewDeployment_HASH = HashingUtils::HashString("NewDeployment");
        static const int Redeployment_HASH = HashingUtils::HashString("Redeployment");
        static const int ResetDeployment_HASH = HashingUtils::HashString("ResetDeployment");
        static const int ForceResetDeployment_HASH = HashingUtils::HashString("ForceResetDeployment");

        DeploymentType GetDeploymentTypeForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == NewDeployment_HASH)
          {
            return DeploymentType::NewDeployment;
          }
          else if (hashCode == Redeployment_HASH)
          {
            return DeploymentType::Redeployment;
          }
          else if (hashCode == ResetDeployment_HASH)
          {
            return DeploymentType::ResetDeployment;
          }
          else if (hashCode == ForceResetDeployment_HASH)
          {
            return DeploymentType::ForceResetDeployment;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<DeploymentType>(hashCode);
          }

          return DeploymentType::NOT_SET;
        }

        Aws::String GetNameForDeploymentType(DeploymentType enumValue)
        {
          switch(enumValue)
          {
          case DeploymentType::NewDeployment:
            return "NewDeployment";
          case DeploymentType::Redeployment:
            return "Redeployment";
          case DeploymentType::ResetDeployment:
            return "ResetDeployment";
          case DeploymentType::ForceResetDeployment:
            return "ForceResetDeployment";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace DeploymentTypeMapper
    } // namespace Model
  } // namespace Greengrass
} // namespace Aws


text:
if [ ! -d "/data/downloads" ];then
 mkdir /data/downloads
fi
echo '[start install g++!]'
yum install gcc-c++.x86_64

yum install gcc
yum install gcc-c++
yum install openssl-devel
yum install readline-devel
yum install mysql-devel

echo '[start install pcre!]'
cd /data/downloads/
wget -O pcre-8.32.tar.gz http://sourceforge.net/projects/pcre/files/pcre/8.32/pcre-8.32.tar.gz/download
tar zxvf pcre-8.32.tar.gz
cd pcre-8.32
./configure
make
make install

cd /lib64/
ln -s libpcre.so.0.0.1 libpcre.so.1
ldconfig

echo '[start install zlib!]'
cd /data/downloads/
wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.7.tar.gz?download
tar zxvf zlib-1.2.7.tar.gz?download
cd  zlib-1.2.7
./configure --prefix=/usr/local
make
make install

cd /data/downloads/
wget http://www.lua.org/ftp/lua-5.1.2.tar.gz
tar zxvf lua-5.1.2.tar.gz
cd lua-5.1.2
make linux
make install

cd /data/downloads/
wget http://luajit.org/download/LuaJIT-2.0.0.tar.gz
tar zxvf LuaJIT-2.0.0.tar.gz
cd LuaJIT-2.0.0
make
make install

cd /data/downloads/
wget https://codeload.github.com/simpl/ngx_devel_kit/tar.gz/v0.2.17rc2
tar zxvf v0.2.17rc2

cd /data/downloads/
wget https://codeload.github.com/openresty/lua-nginx-module/tar.gz/v0.7.8
tar zxvf v0.7.8

export LUAJIT_LIB=/usr/local/lib
export LUAJIT_INC=/usr/local/include/luajit-2.0

#vim .bash_profile
#lua问题
#http://blog.sina.com.cn/u/1155571747

num=$( cat /root/.bash_profile|grep -c LUAJIT_LIB )
if [ $num = 0 ];then
   echo "OK-O-O-O write hosts"
   read i
   echo 'export LUAJIT_LIB=/usr/local/lib'>> /root/.bash_profile
   echo 'export LUAJIT_INC=/usr/local/include/luajit-2.0'>> /root/.bash_profile
fi

echo '[start install nginx-1.0.4!]'
cd /data/downloads/
wget http://nginx.org/download/nginx-1.0.4.tar.gz
tar zxvf nginx-1.0.4.tar.gz
cd nginx-1.0.4
./configure --prefix=/data/nginx --add-module=/data/downloads/ngx_devel_kit-0.2.17rc2 --add-module=/data/downloads/lua-nginx-module-0.7.8   --with-pcre=/data/downloads/pcre-8.32  --with-http_stub_status_module --with-http_ssl_module --with-cc-opt="-Wno-unused-but-set-variable"
make
make install

echo "make logs dir"
mkdir -p /data/logs/nginx/access
mkdir -p /data/logs/nginx/error
mkdir -p /data/logs/nginx/statis
mkdir -p /data/logs/tornado
mkdir -p /data/run

echo "start nginx"
ldconfig
/data/nginx/sbin/nginx -c /data/nginx/conf/nginx.conf


text:
class NilClass
  def try_dup
    self
  end
end


text:
<?php

class Session{

	public static $_sessionId = NULL;
	public static $session = array();

	/**
	* Start session
	*/
	public static function startSession()
	{
		self::$_sessionId = (isset($_COOKIE['session_id']) ? $_COOKIE['session_id'] : NULL);
		if ((!self::$_sessionId)||(!(self::$session=Doo::cache(Doo::conf()->sessionCacheType)->get('session_'.self::$_sessionId)))) {
			// Create new session
			self::$_sessionId = md5($_SERVER['REMOTE_ADDR'] . time() . rand(0,128));
			self::$session['ip'] = $_SERVER['REMOTE_ADDR'];
			self::$session['created'] = time();
		}
		setcookie('session_id', self::$_sessionId, (time()+3600*24*90), '/');
	}

	 /**
	 * End session
	 */
	public static function endSession() {
		$sessionStored = Doo::cache(Doo::conf()->sessionCacheType)->set('session_'.self::$_sessionId, self::$session);
	}

 }


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="PtrClassicHeader"><attr format="integer" name="ptr_rotate_ani_time"/></declare-styleable>
    <declare-styleable name="PtrFrameLayout"><attr format="reference" name="ptr_header"/><attr format="reference" name="ptr_content"/><attr format="float" name="ptr_resistance"/><attr format="float" name="ptr_ratio_of_header_height_to_refresh"/><attr format="integer" name="ptr_duration_to_close"/><attr format="integer" name="ptr_duration_to_close_header"/><attr format="boolean" name="ptr_pull_to_fresh"/><attr format="boolean" name="ptr_keep_header_when_refresh"/></declare-styleable>
    <!-- From: file:/E:/github_rep/PfSwipeRefreshLayout/ptr-lib/build/intermediates/bundles/debug/res/values/values.xml -->
    <eat-comment/>
    <string name="cube_ptr_hours_ago"> hours ago</string>
    <string name="cube_ptr_last_update">last update: </string>
    <string name="cube_ptr_minutes_ago"> minutes ago</string>
    <string name="cube_ptr_pull_down">Pull Down</string>
    <string name="cube_ptr_pull_down_to_refresh">Pull Down to Refresh</string>
    <string name="cube_ptr_refresh_complete">Updated.</string>
    <string name="cube_ptr_refreshing">Updating...</string>
    <string name="cube_ptr_release_to_refresh">Release To Refresh</string>
    <string name="cube_ptr_seconds_ago"> seconds ago</string>
</resources>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>installer</title>
<meta name="date" content="2014-05-20">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

installer

Classes

Configuration

Creator

Execution

Installer

Parameters

Test


text:
package com.mapswithme.maps.location;

import android.app.IntentService;
import android.content.Intent;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.util.Log;

import com.mapswithme.maps.MwmApplication;
import com.mapswithme.util.CrashlyticsUtils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public class TrackRecorderWakeService extends IntentService
{
  private static final String TAG = TrackRecorderWakeService.class.getSimpleName();
  private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.TRACK_RECORDER);
  private static final Object sLock = new Object();
  private static TrackRecorderWakeService sService;
  private final CountDownLatch mWaitMonitor = new CountDownLatch(1);

  public TrackRecorderWakeService()
  {
    super("TrackRecorderWakeService");
  }

  @Override
  protected final void onHandleIntent(Intent intent)
  {
    String msg = "onHandleIntent: " + intent + " app in background = "
                 + !MwmApplication.backgroundTracker().isForeground();
    LOGGER.i(TAG, msg);
    CrashlyticsUtils.log(Log.INFO, TAG, msg);

    synchronized (sLock)
    {
      sService = this;
    }
    TrackRecorder.onServiceStarted();

    try
    {
      long timeout = TrackRecorder.getAwaitTimeout();
      LOGGER.d(TAG, "Timeout: " + timeout);

      if (!mWaitMonitor.await(timeout, TimeUnit.MILLISECONDS))
      {
        LOGGER.d(TAG, "TIMEOUT awaiting coordinates");
        TrackRecorder.incrementAwaitTimeout();
      }
    } catch (InterruptedException ignored) {}

    synchronized (sLock)
    {
      sService = null;
    }

    TrackRecorder.onServiceStopped();
    WakefulBroadcastReceiver.completeWakefulIntent(intent);
  }

  public static void start()
  {
    LOGGER.d(TAG, "SVC.start()");

    synchronized (sLock)
    {
      if (sService == null)
        WakefulBroadcastReceiver.startWakefulService(MwmApplication.get(), new Intent(MwmApplication.get(), TrackRecorderWakeService.class));
      else
        LOGGER.d(TAG, "SVC.start() SKIPPED because (sService != null)");
    }
  }

  public static void stop()
  {
    LOGGER.d(TAG, "SVC.stop()");

    synchronized (sLock)
    {
      if (sService != null)
        sService.mWaitMonitor.countDown();
      else
        LOGGER.d(TAG, "SVC.stop() SKIPPED because (sService == null)");
    }
  }
}


text:
var mongoose = require('mongoose');

var teachingSetSchema = mongoose.Schema({
    type: String, //should be same as the HIT types
    tasks: [
        {
            item: String, //Item id
            correct: String,
            valid: mongoose.Schema.Types.Mixed
        }
        ]
});
// TODO this needs more thought how to create a general purpose validator

var TeachingSet = mongoose.connection.model('teachingset', teachingSetSchema);

module.exports = TeachingSet;


text:
<?php

class Users_model extends CI_Model {

	public function __construct()
	{
		$this->load->database();
	}

	public function login($username, $password)
	{
		$query = $this->db->get_where('credit_users', array('username' => $username, 'password' => $password));

		return $query->row_array();
	}
}