text:
from oslo_serialization import jsonutils as json

from tempest.lib.common import rest_client
from tempest.lib import exceptions as lib_exc

class EncryptionTypesClient(rest_client.RestClient):

    def is_resource_deleted(self, id):
        try:
            body = self.show_encryption_type(id)
            if not body:
                return True
        except lib_exc.NotFound:
            return True
        return False

    @property
    def resource_type(self):
        """Returns the primary type of resource this client works with."""
        return 'encryption-type'

    def show_encryption_type(self, volume_type_id):
        """Get the volume encryption type for the specified volume type.

        :param volume_type_id: Id of volume type.
        """
        url = "/types/%s/encryption" % volume_type_id
        resp, body = self.get(url)
        body = json.loads(body)
        self.expected_success(200, resp.status)
        return rest_client.ResponseBody(resp, body)

    def create_encryption_type(self, volume_type_id, **kwargs):
        """Create encryption type.

        For a full list of available parameters, please refer to the official
        API reference:
        https://docs.openstack.org/api-ref/block-storage/v2/#create-an-encryption-type-for-v2
        """
        url = "/types/%s/encryption" % volume_type_id
        post_body = json.dumps({'encryption': kwargs})
        resp, body = self.post(url, post_body)
        body = json.loads(body)
        self.expected_success(200, resp.status)
        return rest_client.ResponseBody(resp, body)

    def delete_encryption_type(self, volume_type_id):
        """Delete the encryption type for the specified volume type."""
        resp, body = self.delete(
            "/types/%s/encryption/provider" % volume_type_id)
        self.expected_success(202, resp.status)
        return rest_client.ResponseBody(resp, body)


text:
  Villaines-la-Juhel est
      une commune géographiquement positionnée dans le département de Mayenne en Pays de la Loire. On dénombrait 3 106 habitants en 2008.

La commune est équipée s'agissant de l'enseignement de deux collèges.
Pour les très jeunes, la commune est pourvue de une maternelle et deux écoles primaires.
Villaines-la-Juhel propose les équipements éducatifs facilitant une éducation de qualité.
Lors d'un projet de transaction immobilière à Villaines-la-Juhel, vous devrez impérativement regarder la qualité des équipements éducatifs

À proximité de Villaines-la-Juhel sont situées les communes de
Trans localisée à 8 km, 244 habitants,
Champgenéteux à 8 km, 574 habitants,
Crennes-sur-Fraubée localisée à 3 km, 186 habitants,
Averton localisée à 4 km, 648 habitants,
Javron-les-Chapelles localisée à 9 km, 1 473 habitants,
Villepail située à 5 km, 192 habitants,
 entre autres. De plus, Villaines-la-Juhel est située à seulement 28 km de Alençon.

À Villaines-la-Juhel, la valorisation moyenne à l'achat d'un appartement se situe à 940 € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 716 € du m². À la location la valorisation moyenne se situe à 6,38 € du m² mensuel.

Le nombre d'habitations, à Villaines-la-Juhel, était réparti en 2011 en 309 appartements et 1 296 maisons soit
 un marché relativement équilibré.

La commune offre de nombreux  équipements sportifs, elle propose entre autres un bassin de natation, un terrain de tennis, un terrain de sport et un équipement de roller/skate.

À Villaines-la-Juhel le salaire médian par mois par individu est situé à approximativement 1 690 €  net. C'est inférieur à la moyenne du pays.

redpajama_set_name: RedPajamaGithub


text:
var babelPresetEs2017 = require('../index.js');
require('babel-register')(babelPresetEs2017);


text:
'use strict';

const path = require('path');

module.exports = function getRunCmdEnv() {
  const env = {};
  Object.keys(process.env).forEach((key) => {
    env[key] = process.env[key];
  });
  // make sure `antd-tools/node_modules/.bin` in the PATH env
  const nodeModulesBinDir = path.join(__dirname, '../../node_modules/.bin');
  env.PATH = env.PATH ? `${nodeModulesBinDir}:${env.PATH}` : nodeModulesBinDir;
  return env;
};


text:
class TaskImport

  require 'ostruct'
  require 'rexml/document'

  attr_reader( :project_id, :collapse )
  attr_reader( :tasks, :parent_uids, :parent_titles, :project_id, :collapse )
  attr_reader( :filtered_tasks, :filtered_parent_uids, :filtered_parent_titles )

  attr_accessor( :new_project_title, :new_project_customer_id )

  # Create a new Import object, optionally from form submission parameters.
  #
  def initialize( params = nil )
    @project_id             = nil

    @tasks                  = []
    @parent_uids            = nil
    @parent_titles          = nil

    @filtered_tasks         = []
    @filtered_parent_uids   = nil
    @filtered_parent_titles = nil
    @collapse               = nil

    @max_level              = nil

    unless ( params.nil? )

      # Adapted from ActiveRecord::Base "attributes=", Rails 2.1.0
      # on 29-Jun-2008.

      attributes = params.dup
      attributes.stringify_keys!
      attributes.each do | key, value |
        if ( key.include?( '(' ) )
          raise( "Multi-parameter attributes are not supported." )
        else
          send( key + "=", value )
        end
      end
    end
  end

  # Coerce strings to integers for certain properties.
  #
  def project_id=( val )
    @project_id = val.to_i
  end
  def collapse=( val )
    @collapse = val.to_i
  end

  # Due to the way the forms are constructed, arrays will usually be encoded
  # as a HashWithIndifferentAccess set up with keys containing a string
  # version of the index at which we should store the entry and the second
  # element with the hash describing the object to store there.
  #
  def tasks=( tasks )
    @max_level = nil
    @tasks     = to_task_array( tasks )
  end
  def parent_uids=( uids )
    @parent_uids = to_nested_array( uids )
  end
  def parent_titles=( titles )
    @parent_titles = to_nested_array( titles )
  end
  def filtered_tasks=( tasks )
    @filtered_tasks = to_task_array( tasks )
  end
  def filtered_parent_uids=( uids )
    @filtered_parent_uids = to_nested_array( uids )
  end
  def filtered_parent_titles=( titles )
    @filtered_parent_titles = to_nested_array( titles )
  end

  # Read the maximum level stored in the 'tasks' array. Generated on the fly
  # and cached until 'tasks' gets reset.
  #
  def max_level
    if ( @max_level.nil? )
      @max_level = @tasks.collect { | t | t.level }.max
    end

    return @max_level
  end

  # Take this object's (fully set up) task array along with the associated
  # parent title and UID arrays; then collapse these using this object's
  # 'collapse' value and update the internal filtered task, parent title and
  # parent UID arrays ("filtered_tasks", "filtered_parent_uids" and
  # "filtered_parent_titles").
  #
  def generate_filtered_task_list
    collapse_level         = self.collapse.to_i
    collapsed_tasks        = {}
    collapsed_uid          = nil

    filtered_tasks         = []
    filtered_parent_uids   = []
    filtered_parent_titles = []

    self.tasks.each_index do | index |

      task          = self.tasks[ index ]
      collapsed_uid = self.parent_uids[ index ][ 0..collapse_level ].join( ',' )

      if ( task.level <= collapse_level )

        # If this real task is already at the collapsing level, then just copy
        # it into the collapsed task hash.

        collapsed_task              = task.dup
        collapsed_tasks[ task.uid ] = collapsed_task

        # We rely on Ruby storing a reference to the same task structure here,
        # else later changes to the 'duration' field via the "collapsed_tasks"
        # hash won't be reflected in the "filtered_tasks" array.

        filtered_tasks         << collapsed_task
        filtered_parent_uids   << self.parent_uids[   index ].dup
        filtered_parent_titles << self.parent_titles[ index ].dup

      elsif ( collapsed_tasks.has_key?( collapsed_uid ) )

        # Have we generated this collapsed task UID before? Yes - just add
        # the current child task's duration to it.

        collapsed_tasks[ collapsed_uid ].duration += task.duration

      else

        # Generate a new collapsed task. Use the last two entries in the
        # titles array (noting Ruby array reference syntax meaning we have to
        # be careful of negative indices) for the new collapsed task's title.

        previous_level = collapse_level - 1
        previous_level = 0 if ( previous_level < 0 )

        collapsed_task = OpenStruct.new( {
          :level    => collapse_level,
          :uid      => collapsed_uid, # NB: See above - this is a string of one or more integers joined with a comma
          :tid      => task.tid,
          :title    => self.parent_titles[ index ][ previous_level..collapse_level ].join( ': ' ),
          :code     => Task.generate_xml_code( task.tid ),
          :duration => task.duration
        } )

        collapsed_tasks[ collapsed_uid ] = collapsed_task

        filtered_tasks         << collapsed_task
        filtered_parent_uids   << self.parent_uids[   index ][ 0..previous_level ]
        filtered_parent_titles << self.parent_titles[ index ][ 0..previous_level ]

      end
    end

    self.filtered_tasks         = filtered_tasks
    self.filtered_parent_uids   = filtered_parent_uids
    self.filtered_parent_titles = filtered_parent_titles
  end

  # Obtain a task list from the given parsed XML data (a REXML document).
  # Returns a hash with key :tasks, containing an array of task objects with
  # titles, codes and durations set up; :parent_uids, containing an array of
  # arrays of UIDs of the parent tasks (if any) for each entry in the :tasks
  # array; and :parent_titles, the same thing but holding parent strings for
  # display purposes.
  #
  # All strings are HTML-safe because they come from XML, so must use
  # character entities for sensitive characters just as in HTML. Views
  # should *not* further escape them with ERB::Util.h().
  #
  def self.get_tasks_from_xml( doc )

    # Extract details of every task into a flat array

    tasks = []

    doc.each_element( 'Project/Tasks/Task' ) do | task |
      begin
        tasks << OpenStruct.new( {
          :level => task.get_elements( 'OutlineLevel' )[ 0 ].text.to_i,
          :tid   => task.get_elements( 'ID'           )[ 0 ].text,
          :uid   => task.get_elements( 'UID'          )[ 0 ].text,
          :title => task.get_elements( 'Name'         )[ 0 ].text
        } )
      rescue
        # Ignore errors; they tend to indicate malformed tasks, or at least,
        # XML file task entries that we do not understand.
      end
    end

    # Step through the sorted tasks. Each time we find one where the
    # *next* task has an outline level greater than the current task,
    # then the current task MUST be a summary. Record its name and
    # blank out the task from the array. Otherwise, use whatever
    # summary name was most recently found (if any) as a name prefix.
    #
    # At each step, we keep a note of the titles and UIDs in the branch
    # leading up to a given task and push this "history" into a parent
    # title and UID array so that we can implement the 'collapse to level'
    # function later on, without having to refer back to the original
    # file (which is temporary and will have been deleted by then).

    prefix        = ''
    branch_uids   = []
    branch_titles = []
    parent_uids   = []
    parent_titles = []
    filled_to     = 0

    tasks.each_index do | index |
      task      = tasks[ index     ]
      next_task = tasks[ index + 1 ]

      branch_uids[   task.level ] = task.uid
      branch_titles[ task.level ] = task.title

      # Some XML files only contain tasks at strange levels with gaps -
      # particularly with nothing at level 0. Make sure we always fill these
      # in, else the parent title and collapse/filtering code will generate
      # strange task titles due to nil parent title entries.

      if ( task.level > filled_to )
        filled_to = task.level

        branch_titles.each_index do | level |
          title = branch_titles[ level ]
          if ( title.blank? )
            branch_titles[ level ] = "Untitled task at level #{ level }"
          end
        end
      end

      if ( next_task and next_task.level > task.level )
        prefix         = task.title
        tasks[ index ] = nil
      else
        top_level = task.level - 1
        top_level = 0 if ( top_level < 0 )

        parent_uids[   index ] = branch_uids[   0..top_level ]
        parent_titles[ index ] = branch_titles[ 0..top_level ]

        task.title = "#{ branch_titles[ top_level ] }: #{ task.title }" unless ( task.level.zero? )
      end
    end

    # Remove any 'nil' items we ended up with above.

    tasks.compact!
    parent_uids.compact!
    parent_titles.compact!

    # Now create a secondary array, where the UID of any given task is
    # the array index at which it can be found. This is just to make
    # looking up tasks by UID really easy, rather than faffing around
    # with "tasks.find { | task | task.uid = <whatever> }".
    #
    # By keeping track of the index in the original array too, we can
    # make sure the ordering (which has relevance in terms of input file
    # structure and the parent UID and title arrays) is maintained later.

    uid_tasks = {} # Using a hash means UIDs don't have to be numeric.

    tasks.each_index do | index |
      task = tasks[ index ]
      uid_tasks[ task.uid ] = { :task => task, :index => index }
    end

    # OK, now it's time to parse the assignments into some meaningful
    # array. These will become our timesheet system tasks. Assignments
    # which relate to empty elements in "uid_tasks" or which have zero
    # work are associated with tasks which are either summaries or
    # milestones. Ignore both types.

    real_tasks         = []
    real_parent_uids   = []
    real_parent_titles = []

    doc.each_element( 'Project/Assignments/Assignment' ) do | assignment |
      task_uid = assignment.get_elements( 'TaskUID' )[ 0 ].text
      data     = uid_tasks[ task_uid ]

      next if ( data.nil? )

      task     = data[ :task  ]
      index    = data[ :index ]
      work     = assignment.get_elements( 'Work' )[ 0 ].text

      # Parse the "Work" string: "PT<num>H<num>M<num>S", but with some
      # leniency to allow any data before or after the H/M/S stuff.

      strs = work.scan(/.*?(\d+)H(\d+)M(\d+)S.*?/).flatten
      hours, mins, secs = strs.map { | str | str.to_i }

      next if ( hours == 0 and mins == 0 and secs == 0 )

      # Woohoo, real task! Store it in 'real_tasks' at the same array index
      # as the item used to hold in the raw 'tasks' array.
      #
      # The divide by 3600.0 is VITAL to perform a floating point calculation
      # rather than rounding everything with integer maths.

      task.code     = Task.generate_xml_code( task.tid )
      task.duration = ( ( ( hours * 3600 ) + ( mins * 60 ) + secs ) / 3600.0 ).precision( 2 )

      real_tasks[         index ] = task
      real_parent_uids[   index ] = parent_uids[   index ]
      real_parent_titles[ index ] = parent_titles[ index ]
    end

    # Remove "nil" entries which exist beacuse of any tasks in the original
    # 'tasks' array which were discarded for some reason (e.g. no duration).

    real_tasks.compact!
    real_parent_uids.compact!
    real_parent_titles.compact!

    return {
      :tasks         => real_tasks,
      :parent_uids   => real_parent_uids,
      :parent_titles => real_parent_titles
    }
  end

private

  # Convert a hash from a forms submission, attempting to convey an array,
  # into an array. Returns the input item directly if given an array to start
  # with. Otherwise the hash's keys are treated as array indices and its
  # values as array entries.
  #
  def to_array( hash_or_array )
    return hash_or_array if ( hash_or_array.is_a? Array )

    array = []
    hash_or_array.each_pair do | key, value |
      array[ key.to_i ] = value
    end

    return array
  end

  # Take a hash as for "to_array", but where each array entry itself contains
  # another array similarly represented as a hash. Returns the nested array
  # result.
  #
  def to_nested_array( hash_or_array )
    hash_or_array = to_array( hash_or_array )
    hash_or_array.each_index do | index |
      hash_or_array[ index ] = to_array( hash_or_array[ index ] )
    end

    return hash_or_array
  end

  # Take a hash or array describing tasks and turn it into a true array of
  # Task-like objects (via OpenStruct representations). Return the result.
  #
  def to_task_array( hash_or_array )
    new_tasks = []
    tasks     = to_array( hash_or_array )

    # Make an OpenStruct representation of the entry at each array index so
    # that access later on is easier (via "task.property"). If a task entry is
    # already an OpenStruct it is just accepted as-is.

    tasks.each do | task |
      if ( task.is_a? OpenStruct )

        new_tasks << task

      else

        # Note how this code allows the structure to pick up anything in the
        # "task" data; that's important, since special additional flags can be
        # carried by the task data this way - e.g. an "import" flag. Callers
        # may rely on this (at the time of writing, the task import controller
        # does exactly that).

        struct          = OpenStruct.new( task )
        struct.level    = struct.level.to_i
        struct.duration = struct.duration.to_f
        struct.billable = ( struct.billable.to_i == 1 )
        new_tasks << struct

      end
    end

    return new_tasks
  end
end


text:
select {
	/* For some reason, the styling wont take unless you specify a border */
    border: 1px solid black;
    width: 200px;
    font-size:14pt;
}

select#cycle {
    width:400px;
}

input[type=file] {
	/* For some reason, the styling wont take unless you specify a border */
    border: 1px solid black;
    width: 400px;
    font-size:14pt;
}

label {
	font-size:14pt;
	color: green;
}

div#usageHeader {
    font-size:18pt;
    padding:15px;
    background-color: #999999;
    color: black;
    border-radius: 15px;
}

div#usageEntryDetails {
    height: 350px;
    overflow-y: scroll;
    background-color: darkred;
    color: white;
    border-radius: 15px;
}


text:
export default {
  queryURL: 'http://graphdb.linked-open-statistics.org/repositories/models'
}


text:
package com.ae.apps.lib.permissions;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;

public class RuntimePermissionsCheckerTest {

    @Mock
    private PermissionsAwareComponent component;

    private final String[] singlePermission = {"PERMISSION ONE"};
    private final String[] multiplePermissions = {"PERMISSION ONE", "PERMISSION TWO", "PERMISSION THREE"};

    @Before
    public void setup() {
        component = Mockito.mock(MockPermissionsAwareActivity.class);
    }

    @Test
    public void shouldCreateObject_withSinglePermission(){
        Mockito.when(component.requiredPermissions()).thenReturn(singlePermission);
        RuntimePermissionChecker permissionChecker = RuntimePermissionChecker.newInstance(component);
        Assert.assertNotNull(permissionChecker);
    }

    @Test
    public void shouldCreateObject_withMultiplePermission(){
        Mockito.when(component.requiredPermissions()).thenReturn(multiplePermissions);
        RuntimePermissionChecker permissionChecker = RuntimePermissionChecker.newInstance(component);
        Assert.assertNotNull(permissionChecker);
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldThrowIllegalArgumentException_forNullParameter() {
        RuntimePermissionChecker.newInstance(null);
    }

    @Test(expected = IllegalStateException.class)
    public void shouldThrowIllegalStateException_forNullPermissions() {
        Mockito.when(component.requiredPermissions()).thenReturn(null);
        RuntimePermissionChecker.newInstance(component);
    }

    @Test(expected = IllegalStateException.class)
    public void shouldThrowIllegalStateException_forEmptyPermissions() {
        String[] empty = {};
        Mockito.when(component.requiredPermissions()).thenReturn(empty);
        RuntimePermissionChecker.newInstance(component);
    }

}


text:
package org.apache.storm.security.auth.kerberos;

import org.apache.storm.thrift.transport.TSaslServerTransport;
import org.apache.storm.thrift.transport.TTransport;
import org.apache.storm.thrift.transport.TTransportException;

public class NoOpTTrasport extends TSaslServerTransport {

    public NoOpTTrasport(TTransport transport) {
        super(transport);
    }

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

    @Override
    public void open() throws TTransportException {

    }

    @Override
    public void close() {

    }

    @Override
    public int read(byte[] bytes, int i, int i1) throws TTransportException {
        return 0;
    }

    @Override
    public void write(byte[] bytes, int i, int i1) throws TTransportException {

    }
}


text:
package eu.stosdev.theresistance.model.game;

import com.google.common.base.Optional;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import eu.stosdev.theresistance.model.messages.VoteFinishedMessage;
import lombok.Getter;

import static com.google.common.base.Preconditions.checkArgument;

public abstract class Vote {
    final List<String> voters = new ArrayList<>();
    @Getter private final boolean secret;
    final Map<String, Boolean> votes = new HashMap<>();
    final Optional<OnVoteCompleted> callback;

    Vote(List<String> voters, OnVoteCompleted callback) {
        this.voters.addAll(voters);
        this.secret = true;
        this.callback = Optional.fromNullable(callback);
    }

    public void vote(String voter, Boolean vote) {
        checkArgument(voters.contains(voter), "Provided player is not a voter");
        if (votes.get(voter) == null) {
            votes.put(voter, vote);
            onVoteCompleted();
        }
    }

    protected abstract void onVoteCompleted();

    public List<String> getVoters() {
        return Collections.unmodifiableList(voters);
    }

    public Map<String, Boolean> getAllVotes() {
        return Collections.unmodifiableMap(votes);
    }

    public boolean isCompleted() {
        return votes.size() == voters.size() && !votes.values().contains(null);
    }

    public boolean getVerdict() {
        int approved = 0, against = 0;
        for (Boolean aBoolean : votes.values()) {
            if (aBoolean != null) {
                if (aBoolean) {
                    approved++;
                } else {
                    against++;
                }
            }
        }
        return getVerdict(approved, against);
    }

    protected abstract boolean getVerdict(int approved, int against);

    public void parseFinishedMessage(VoteFinishedMessage.Event vfe) {
        if (vfe.isUsed()){
            return;
        }
        for (Map.Entry<String, Boolean> entry : vfe.getVotes().entrySet()) {
            if (isCompleted()) {
                break;
            }
            vote(entry.getKey(), entry.getValue());
        }
    }

    public interface OnVoteCompleted {
        void onVoteCompleted(boolean result);
    }

}


text:
layout: data_model
title: PDFXRefTableType
this_version: 1.0
---

  Heads up! These docs are for STIX 1.0, which is not the latest version (1.2). View the latest!

PDFXRefTableTypePDF File Object Schema

The PDFXRefTableType captures the details of a PDF cross-reference table, which provides a capability for the random access of indirect objects contained in the file.

      <form id="nav-version">
        <select>

            <option value="1.2" >STIX 1.2</option>

            <option value="1.1.1" >STIX 1.1.1</option>

            <option value="1.1" >STIX 1.1</option>

            <option value="1.0.1" >STIX 1.0.1</option>

            <option value="1.0" selected="selected">STIX 1.0</option>

        </select>
      </form>

Fields

      Field Name
      Type
      Description

      Subsections0..1

          PDFXrefTableSubsectionListType

The Subsections field captures the subsections contained in the cross-reference table.

      Offset0..1

          PositiveIntegerObjectPropertyType

The Offset field specifies the offset of the cross-reference from the beginning of the file, in bytes.

      Hashes0..1

          HashListType

The Hashes field captures any hashes that were computed for the cross-reference table.


text:
import {BaseIfc} from "./BaseIfc"
import {IfcGloballyUniqueId} from "./IfcGloballyUniqueId.g"
import {IfcOwnerHistory} from "./IfcOwnerHistory.g"
import {IfcLabel} from "./IfcLabel.g"
import {IfcText} from "./IfcText.g"
import {IfcRelAssigns} from "./IfcRelAssigns.g"
import {IfcRelNests} from "./IfcRelNests.g"
import {IfcRelDeclares} from "./IfcRelDeclares.g"
import {IfcRelAggregates} from "./IfcRelAggregates.g"
import {IfcRelAssociates} from "./IfcRelAssociates.g"
import {IfcRelDefinesByObject} from "./IfcRelDefinesByObject.g"
import {IfcRelDefinesByType} from "./IfcRelDefinesByType.g"
import {IfcRelDefinesByProperties} from "./IfcRelDefinesByProperties.g"
import {IfcObjectPlacement} from "./IfcObjectPlacement.g"
import {IfcProductRepresentation} from "./IfcProductRepresentation.g"
import {IfcRelAssignsToProduct} from "./IfcRelAssignsToProduct.g"
import {IfcIdentifier} from "./IfcIdentifier.g"
import {IfcRelFillsElement} from "./IfcRelFillsElement.g"
import {IfcRelConnectsElements} from "./IfcRelConnectsElements.g"
import {IfcRelInterferesElements} from "./IfcRelInterferesElements.g"
import {IfcRelProjectsElement} from "./IfcRelProjectsElement.g"
import {IfcRelReferencedInSpatialStructure} from "./IfcRelReferencedInSpatialStructure.g"
import {IfcRelVoidsElement} from "./IfcRelVoidsElement.g"
import {IfcRelConnectsWithRealizingElements} from "./IfcRelConnectsWithRealizingElements.g"
import {IfcRelSpaceBoundary} from "./IfcRelSpaceBoundary.g"
import {IfcRelContainedInSpatialStructure} from "./IfcRelContainedInSpatialStructure.g"
import {IfcRelCoversBldgElements} from "./IfcRelCoversBldgElements.g"
import {IfcInteger} from "./IfcInteger.g"
import {IfcPositiveLengthMeasure} from "./IfcPositiveLengthMeasure.g"
import {IfcStairFlightTypeEnum} from "./IfcStairFlightTypeEnum.g"
import {IfcBuildingElement} from "./IfcBuildingElement.g"

/**
 * http://www.buildingsmart-tech.org/ifc/IFC4/final/html/link/ifcstairflight.htm
 */
export class IfcStairFlight extends IfcBuildingElement {
	NumberOfRisers : IfcInteger // optional
	NumberOfTreads : IfcInteger // optional
	RiserHeight : IfcPositiveLengthMeasure // optional
	TreadLength : IfcPositiveLengthMeasure // optional
	PredefinedType : IfcStairFlightTypeEnum // optional

    constructor(globalId : IfcGloballyUniqueId) {
        super(globalId)
    }
    getStepParameters() : string {
        var parameters = new Array<string>();
		parameters.push(BaseIfc.toStepValue(this.GlobalId))
		parameters.push(BaseIfc.toStepValue(this.OwnerHistory))
		parameters.push(BaseIfc.toStepValue(this.Name))
		parameters.push(BaseIfc.toStepValue(this.Description))
		parameters.push(BaseIfc.toStepValue(this.ObjectType))
		parameters.push(BaseIfc.toStepValue(this.ObjectPlacement))
		parameters.push(BaseIfc.toStepValue(this.Representation))
		parameters.push(BaseIfc.toStepValue(this.Tag))
		parameters.push(BaseIfc.toStepValue(this.NumberOfRisers))
		parameters.push(BaseIfc.toStepValue(this.NumberOfTreads))
		parameters.push(BaseIfc.toStepValue(this.RiserHeight))
		parameters.push(BaseIfc.toStepValue(this.TreadLength))
		parameters.push(BaseIfc.toStepValue(this.PredefinedType))

        return parameters.join();
    }
}


text:
import styled from 'styled-components';
import { pxToRem } from '../../../../helpers/utils/typography';
import COLORS from '../../../../constants/colors-config';
import TYPOGRAPHY from '../../../../constants/typography-config';
import { ScreenConfig } from '../../../../constants/screen-config';
const ICON_SIZE = pxToRem(50);
export const Icon = styled.span.withConfig({
  displayName: "icon__Icon",
  componentId: "sc-2j6a2t-0"
})(["flex-shrink:0;display:flex;align-items:center;justify-content:center;width:", ";height:", ";border-radius:var(--border-radius-rounded);box-sizing:border-box;margin-right:", ";@media (min-width:", "px){margin-right:", ";}background-color:", ";border:2px solid ", ";", ";font-size:", ";img{width:100%;height:100%;min-width:0;}"], ICON_SIZE, ICON_SIZE, pxToRem(20), ScreenConfig.S.min, pxToRem(40), COLORS.background1, COLORS.line1, TYPOGRAPHY.fontStyles['500'], pxToRem(14));


text:
package com.thoughtworks.go.plugin.access.scm;

import com.thoughtworks.go.plugin.api.config.Property;
import org.junit.jupiter.api.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

public class SCMPropertyTest {
    @Test
    public void validateSCMPropertyDefaults() throws Exception {
        SCMProperty scmProperty = new SCMProperty("Test-Property");

        assertThat(scmProperty.getOptions().size(), is(5));
        assertThat(scmProperty.getOption(Property.REQUIRED), is(true));
        assertThat(scmProperty.getOption(Property.PART_OF_IDENTITY), is(true));
        assertThat(scmProperty.getOption(Property.SECURE), is(false));
        assertThat(scmProperty.getOption(Property.DISPLAY_NAME), is(""));
        assertThat(scmProperty.getOption(Property.DISPLAY_ORDER), is(0));

        scmProperty = new SCMProperty("Test-Property", "Dummy Value");

        assertThat(scmProperty.getOptions().size(), is(5));
        assertThat(scmProperty.getOption(Property.REQUIRED), is(true));
        assertThat(scmProperty.getOption(Property.PART_OF_IDENTITY), is(true));
        assertThat(scmProperty.getOption(Property.SECURE), is(false));
        assertThat(scmProperty.getOption(Property.DISPLAY_NAME), is(""));
        assertThat(scmProperty.getOption(Property.DISPLAY_ORDER), is(0));
    }
}


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class at.irian.ankorsamples.statelesstodo.domain.Filter (Ankor - Project 0.4-SNAPSHOT API)</title>
<meta name="date" content="2014-09-25">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
at.irian.ankorsamples.statelesstodo.domain.Filter

Packages that use Filter

Package
Description

at.irian.ankorsamples.statelesstodo.domain

Uses of Filter in at.irian.ankorsamples.statelesstodo.domain

Methods in at.irian.ankorsamples.statelesstodo.domain that return Filter

Modifier and Type
Method and Description

static Filter
Filter.valueOf(String name)

Returns the enum constant of this type with the specified name.

static Filter[]
Filter.values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Methods in at.irian.ankorsamples.statelesstodo.domain with parameters of type Filter

Modifier and Type
Method and Description

int
TaskRepository.countTasks(Filter filter)

List<Task>
TaskRepository.queryTasks(Filter filter)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014 Ankor Developers Team. All rights reserved.


text:
import csv
import re
import sys

import csv_fix
import smart_csv

ITEM_REX = re.compile("\(\'(.*?)\', (\d+)\)")

def find_outliers(txtfile, limit):
    with open(txtfile) as f:
        for i, row in enumerate(f):
            if i == 0:
                continue
            field = row.split(',')[0].strip()
            try:
                cat = csv_fix.CATEGORY_REX.findall(row)[0]
            except IndexError:
                continue

            cats = ITEM_REX.findall(cat)
            if len(cats) >= 10:
                continue
            for name, val in cats:
                if int(val) <= limit:
                    print field, i, name, val
                    yield i, name

def has_outliers(outliers, row):
    for i, name in outliers:
        if i >= len(row):
            print len(row), i, row
        if row[i].strip() == name:
            print i, name
            return True
    return False

def kill_outliers(incsv_name, outcsv_name, outliers):
    skipped = 0
    kept = 0
    with open(incsv_name) as inf:
        inc, _, _ = smart_csv.csv_open(inf)
        with open(outcsv_name, 'wt') as outf:
            outc = csv.writer(outf)
            outc.writerow(inc.next())

            for row in inc:
                if has_outliers(outliers, row):
                    skipped += 1
                    print row
                else:
                    outc.writerow(row)
                    kept += 1
    print 'kept', kept, 'skipped', skipped

if __name__ == '__main__':
    # txt-file, limit, incsv, outcsv
    kill_outliers(sys.argv[3], sys.argv[4], list(find_outliers(sys.argv[1], int(sys.argv[2]))))


text:
package com.notnoop.apns.internal;

import org.junit.Assert;
import org.junit.Test;

public class UtilitiesTest {

    @Test
    public void testEncodeAndDecode() {
        String encodedHex = "a1b2d4";

        byte[] decoded = Utilities.decodeHex(encodedHex);
        String encoded = Utilities.encodeHex(decoded);

        Assert.assertEquals(encodedHex.toLowerCase(), encoded.toLowerCase());
    }

    @Test
    public void testParsingBytes() {
        Assert.assertEquals(0xFF00FF00, Utilities.parseBytes(0xFF, 0, 0xFF, 0));
        Assert.assertEquals(0x00FF00FF, Utilities.parseBytes(0, 0xFF, 0, 0xFF));
        Assert.assertEquals(0xDEADBEEF, Utilities.parseBytes(0xDE, 0xAD, 0xBE, 0xEF));
        Assert.assertEquals(0x0EADBEEF, Utilities.parseBytes(0x0E, 0xAD, 0xBE, 0xEF));

        Assert.assertTrue(Utilities.parseBytes(0xF0, 0,0,0) < 0);
        Assert.assertTrue(Utilities.parseBytes(0x80, 0,0,0) < 0);
        Assert.assertTrue(Utilities.parseBytes(0x70, 0,0,0) > 0);
    }

    @Test
    public void testEncodingUTF8() {
        String m = "esemŽny";

        byte[] expected = {
                'e', 's', 'e', 'm', (byte)0x00C3, (byte)0x00A9, 'n', 'y'
        };

        Assert.assertArrayEquals(expected, Utilities.toUTF8Bytes(m));

    }
}


text:
package org.jetbrains.plugins.groovy.lang.resolve;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.AbstractElementManipulator;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral;
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.literals.GrLiteralImpl;
import org.jetbrains.plugins.groovy.lang.psi.util.GrStringUtil;

public class GroovyStringLiteralManipulator extends AbstractElementManipulator<GrLiteral> {
  private static final Logger LOG = Logger.getInstance(GroovyStringLiteralManipulator.class);

  public GrLiteralImpl handleContentChange(GrLiteral expr, TextRange range, String newContent) throws IncorrectOperationException {
    if (!(expr.getValue() instanceof String)) {
      throw new IncorrectOperationException("cannot handle content change, expr.getValue()=" + expr.getValue());
    }

    LOG.assertTrue(expr instanceof GrLiteralImpl);

    String oldText = expr.getText();
    final String quote = GrStringUtil.getStartQuote(oldText);

    if (StringUtil.startsWithChar(quote, '\'')) {
      newContent = GrStringUtil.escapeSymbolsForString(newContent, !quote.equals("'''"), true);
    }
    else if (StringUtil.startsWithChar(quote, '\"')) {
      newContent = GrStringUtil.escapeSymbolsForGString(newContent, !quote.equals("\"\"\""), true);
    }
    else if ("/".equals(quote)) {
      newContent = GrStringUtil.escapeSymbolsForSlashyStrings(newContent);
    }
    else if ("$/".equals(quote)) {
      newContent = GrStringUtil.escapeSymbolsForDollarSlashyStrings(newContent);
    }

    String newText = oldText.substring(0, range.getStartOffset()) + newContent + oldText.substring(range.getEndOffset());
    return ((GrLiteralImpl)expr).updateText(newText);
  }

  public TextRange getRangeInElement(final GrLiteral element) {
    final String text = element.getText();
    if (!(element.getValue() instanceof String)) {
      return super.getRangeInElement(element);
    }
    return getLiteralRange(text);
  }

  public static TextRange getLiteralRange(String text) {
    int start = 1;
    int fin = text.length();

    String begin = text.substring(0, 1);
    if (text.startsWith("$/")) {
      start = 2;
      if (text.endsWith("/$")) {
        return new TextRange(start, Math.max(1, fin - 2));
      }
      else {
        return new TextRange(start, fin);
      }
    }

    if (text.startsWith("\"\"\"") || text.startsWith("'''")) {
      start += 2;
      begin = text.substring(0, 3);
    }

    if (text.length() >= begin.length() * 2 && text.endsWith(begin)) {
      fin -= begin.length();
    }
    return new TextRange(start, Math.max(1, fin));
  }
}


text:
/* @test
   @summary Test ModelByteBuffer.RandomFileInputStream read(byte[], int, int) method */

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.sound.sampled.*;

import com.sun.media.sound.*;

public class ReadByteIntInt {

    static float[] testarray;
    static byte[] test_byte_array;
    static File test_file;
    static AudioFormat format = new AudioFormat(44100, 16, 1, true, false);

    static void setUp() throws Exception {
        testarray = new float[1024];
        for (int i = 0; i < 1024; i++) {
            double ii = i / 1024.0;
            ii = ii * ii;
            testarray[i] = (float)Math.sin(10*ii*2*Math.PI);
            testarray[i] += (float)Math.sin(1.731 + 2*ii*2*Math.PI);
            testarray[i] += (float)Math.sin(0.231 + 6.3*ii*2*Math.PI);
            testarray[i] *= 0.3;
        }
        test_byte_array = new byte[testarray.length*2];
        AudioFloatConverter.getConverter(format).toByteArray(testarray, test_byte_array);
        test_file = File.createTempFile("test", ".raw");
        FileOutputStream fos = new FileOutputStream(test_file);
        fos.write(test_byte_array);
    }

    static void tearDown() throws Exception {
        if(!test_file.delete())
            test_file.deleteOnExit();
    }

    public static void main(String[] args) throws Exception {
        try
        {
            setUp();

            for (int i = 0; i < 8; i++) {
                ModelByteBuffer buff;
                if(i % 2 == 0)
                    buff = new ModelByteBuffer(test_file);
                else
                    buff = new ModelByteBuffer(test_byte_array);
                if((i / 2) == 1)
                    buff.subbuffer(5);
                if((i / 2) == 2)
                    buff.subbuffer(5,500);
                if((i / 2) == 3)
                    buff.subbuffer(5,600,true);

                long capacity = buff.capacity();
                InputStream is = buff.getInputStream();
                try
                {
                    byte[] b = new byte[100];
                    int ret = is.available();
                    int n = is.read(b, 7, 50);
                    if(n == -1)
                        throw new RuntimeException("is.read shouldn't return -1!");
                    if(is.available() != ret - n)
                        throw new RuntimeException(
                                "is.available() returns incorrect value ("
                                + is.available() + "!="+(ret - n)+") !");
                    is.skip(5000);
                    if(is.read(b, 7, 50) != -1)
                        throw new RuntimeException(
                                "is.read() doesn't return -1!");

                }
                finally
                {
                    is.close();
                }
                if(buff.capacity() != capacity)
                    throw new RuntimeException("Capacity variable should not change!");
            }
        }
        finally
        {
            tearDown();
        }
    }

}


text:
class QSplitter;
class QStackedWidget;
class QWebEngineView;
class QActionGroup;
class QTimer;

namespace vte
{
    class MarkdownEditorConfig;
    struct TextEditorParameters;
}

namespace vnotex
{
    class MarkdownEditor;
    class MarkdownViewer;
    class EditorMarkdownViewerAdapter;
    class PreviewHelper;
    struct Outline;
    class EditorConfig;
    class ImageHost;
    class SearchToken;

    class MarkdownViewWindow : public ViewWindow
    {
        Q_OBJECT
    public:
        friend class TextViewWindowHelper;

        MarkdownViewWindow(QWidget *p_parent = nullptr);

        ~MarkdownViewWindow();

        QString getLatestContent() const Q_DECL_OVERRIDE;

        QString selectedText() const Q_DECL_OVERRIDE;

        void setMode(ViewWindowMode p_mode) Q_DECL_OVERRIDE;

        QSharedPointer<OutlineProvider> getOutlineProvider() Q_DECL_OVERRIDE;

        void openTwice(const QSharedPointer<FileOpenParameters> &p_paras) Q_DECL_OVERRIDE;

        ViewWindowSession saveSession() const Q_DECL_OVERRIDE;

        void applySnippet(const QString &p_name) Q_DECL_OVERRIDE;

        void applySnippet() Q_DECL_OVERRIDE;

    public slots:
        void handleEditorConfigChange() Q_DECL_OVERRIDE;

    protected slots:
        void setModified(bool p_modified) Q_DECL_OVERRIDE;

        void handleBufferChangedInternal(const QSharedPointer<FileOpenParameters> &p_paras) Q_DECL_OVERRIDE;

        void handleTypeAction(TypeAction p_action) Q_DECL_OVERRIDE;

        void handleSectionNumberOverride(OverrideState p_state) Q_DECL_OVERRIDE;

        void handleImageHostChanged(const QString &p_hostName) Q_DECL_OVERRIDE;

        void handleFindTextChanged(const QString &p_text, FindOptions p_options) Q_DECL_OVERRIDE;

        void handleFindNext(const QStringList &p_texts, FindOptions p_options) Q_DECL_OVERRIDE;

        void handleReplace(const QString &p_text, FindOptions p_options, const QString &p_replaceText) Q_DECL_OVERRIDE;

        void handleReplaceAll(const QString &p_text, FindOptions p_options, const QString &p_replaceText) Q_DECL_OVERRIDE;

        void handleFindAndReplaceWidgetClosed() Q_DECL_OVERRIDE;

        void handleFindAndReplaceWidgetOpened() Q_DECL_OVERRIDE;

        void toggleDebug() Q_DECL_OVERRIDE;

        void print() Q_DECL_OVERRIDE;

        void clearHighlights() Q_DECL_OVERRIDE;

    protected:
        void syncEditorFromBuffer() Q_DECL_OVERRIDE;

        void syncEditorFromBufferContent() Q_DECL_OVERRIDE;

        bool eventFilter(QObject *p_obj, QEvent *p_event) Q_DECL_OVERRIDE;

        void detachFromBufferInternal() Q_DECL_OVERRIDE;

        void scrollUp() Q_DECL_OVERRIDE;

        void scrollDown() Q_DECL_OVERRIDE;

        void zoom(bool p_zoomIn) Q_DECL_OVERRIDE;

        QPoint getFloatingWidgetPosition() Q_DECL_OVERRIDE;

        void updateViewModeMenu(QMenu *p_menu) Q_DECL_OVERRIDE;

    private:
        void setupUI();

        void setupToolBar();

        void setupTextEditor();

        QStackedWidget *getMainStatusWidget() const;

        // Focus appropriate editor according to current mode.
        void focusEditor();

        void setupViewer();

        void setupPreviewHelper();

        void syncTextEditorFromBuffer(bool p_syncPositionFromReadMode);

        void syncViewerFromBuffer(bool p_syncPositionFromEditMode);

        // Non-virtual function of syncEditorFromBufferContent().
        void doSyncEditorFromBufferContent(bool p_syncPosition);

        void syncTextEditorFromBufferContent(bool p_syncPosition);

        void syncViewerFromBufferContent(bool p_syncPosition);

        // When we have new changes to the buffer content from our ViewWindow,
        // we will invalidate the contents of the buffer and the buffer will
        // call this function to tell us now the latest buffer revision.
        void setBufferRevisionAfterInvalidation(int p_bufferRevision);

        EditorMarkdownViewerAdapter *adapter() const;

        // Get the position to sync from editor.
        // Return -1 for an invalid position.
        int getEditLineNumber() const;

        // Get the position to sync from viewer.
        // Return -1 for an invalid position.
        int getReadLineNumber() const;

        void clearObsoleteImages();

        void setupOutlineProvider();

        void updateEditorFromConfig();

        void updateWebViewerConfig();

        void setModeInternal(ViewWindowMode p_mode, bool p_syncBuffer);

        void handleFileOpenParameters(const QSharedPointer<FileOpenParameters> &p_paras, bool p_twice);

        void scrollToLine(int p_lineNumber);

        void findTextBySearchToken(const QSharedPointer<SearchToken> &p_token, int p_currentMatchLine);

        bool isReadMode() const;

        void updatePreviewHelperFromConfig(const MarkdownEditorConfig &p_config);

        void removeFromImageHost(const QString &p_url);

        bool updateConfigRevision();

        void setupDebugViewer();

        void setEditViewMode(MarkdownEditorConfig::EditViewMode p_mode);

        void syncEditorContentsToPreview();

        void syncEditorPositionToPreview();

        void handleExternalCodeBlockHighlightRequest(int p_idx, quint64 p_timeStamp, const QString &p_text);

        template <class T>
        static QSharedPointer<Outline> headingsToOutline(const QVector<T> &p_headings);

        static QSharedPointer<vte::MarkdownEditorConfig> createMarkdownEditorConfig(const EditorConfig &p_editorConfig, const MarkdownEditorConfig &p_config);

        static QSharedPointer<vte::TextEditorParameters> createMarkdownEditorParameters(const EditorConfig &p_editorConfig, const MarkdownEditorConfig &p_config);

        // Splitter to hold editor and viewer.
        QSplitter *m_splitter = nullptr;

        // Managed by QObject.
        MarkdownEditor *m_editor = nullptr;

        // Managed by QObject.
        MarkdownViewer *m_viewer = nullptr;

        QSharedPointer<QWidget> m_textEditorStatusWidget;

        QSharedPointer<QWidget> m_viewerStatusWidget;

        QSharedPointer<QStackedWidget> m_mainStatusWidget;

        // Used to debug web view.
        QWebEngineView *m_debugViewer = nullptr;

        // Managed by QObject.
        PreviewHelper *m_previewHelper = nullptr;

        // Whether propogate the state from editor to buffer.
        bool m_propogateEditorToBuffer = false;

        int m_textEditorBufferRevision = 0;

        int m_viewerBufferRevision = 0;

        int m_textEditorConfigRevision = 0;

        int m_markdownEditorConfigRevision = 0;

        ViewWindowMode m_previousMode = ViewWindowMode::Invalid;

        QSharedPointer<OutlineProvider> m_outlineProvider;

        ImageHost *m_imageHost = nullptr;

        bool m_viewerReady = false;

        QActionGroup *m_viewModeActionGroup = nullptr;

        MarkdownEditorConfig::EditViewMode m_editViewMode = MarkdownEditorConfig::EditViewMode::EditOnly;

        QTimer *m_syncPreviewTimer = nullptr;
    };
}

#endif // MARKDOWNVIEWWINDOW_H


text:
using namespace native;

TEST(Semaphore_tryAcquireDoesNotBlock)
{
	Semaphore semaphore = 1;

	semaphore.acquire();	// Decrements to zero (locked).

	ASSERT(semaphore.tryAcquire() == false);
	semaphore.release();
}


text:
require 'spec_helper'

describe Puppet::Parser::Functions.function(:validate_hash) do
  let(:scope) { PuppetlabsSpec::PuppetInternals.scope }

  describe 'when calling validate_hash from puppet' do

    %w{ true false }.each do |the_string|

      it "should not compile when #{the_string} is a string" do
        Puppet[:code] = "validate_hash('#{the_string}')"
        expect { scope.compiler.compile }.should raise_error(Puppet::ParseError, /is not a Hash/)
      end

      it "should not compile when #{the_string} is a bare word" do
        Puppet[:code] = "validate_hash(#{the_string})"
        expect { scope.compiler.compile }.should raise_error(Puppet::ParseError, /is not a Hash/)
      end

    end

    it "should compile when multiple hash arguments are passed" do
      Puppet[:code] = <<-'ENDofPUPPETcode'
        $foo = {}
        $bar = { 'one' => 'two' }
        validate_hash($foo, $bar)
      ENDofPUPPETcode
      scope.compiler.compile
    end

    it "should not compile when an undef variable is passed" do
      Puppet[:code] = <<-'ENDofPUPPETcode'
        $foo = undef
        validate_hash($foo)
      ENDofPUPPETcode
      expect { scope.compiler.compile }.should raise_error(Puppet::ParseError, /is not a Hash/)
    end

  end

end


text:
name "nokogiri"
default_version "1.6.3.1"

if windows?
  dependency "ruby-windows"
  dependency "ruby-windows-devkit"
else
  dependency "ruby"
  dependency "libxml2"
  dependency "libxslt"
  dependency "libiconv"
  dependency "liblzma"
  dependency "zlib"
end

dependency "rubygems"

#
# NOTE: As of nokogiri 1.6.4 it will superficially 'work' to remove most
# of the nonsense in this file and simply gem install nokogiri on most
# platforms.  This is because nokogiri has improved its packaging so that
# all of the dynamic libraries are 'statically' compiled into nokogiri.so
# with -lz -llzma -lxslt -lxml2, etc.  What will happen in that case is
# that the nokogiri build system will pull zlib, lzma, etc out of the
# system and link it inside of nokogiri.so and ship it as one big
# dynamic library.  This will essentially defeat one aspect of our
# health_check system so that we will be shipping an embedded zlib inside
# of nokogiri.so that we do not track and will have a high likelihood that
# if there are security errata that we ship exploitable code without
# knowing it.  For all other purposes, the built executable will work,
# however, so it is likely that someone will 'discover' that 'everything
# works' and remove all the junk in this file.  That will, however, have
# unintended side effects.  We do not have a mechanism to inspect the
# nokogiri.so and determine that it is shipping with an embedded zlib that
# does not match the one that we ship in /opt/chef/embedded/lib, so there
# will be nothing that alerts or fails on this.
#
# TL;DR: do not remove --use-system-libraries even if everything appears to
# be green after you do.
#
build do
  env = with_standard_compiler_flags(with_embedded_path)

  if windows?
    # use the 'fat' precompiled binary bundled with nokogiri
    gem "install nokogiri" \
      " --version '#{version}'", env: env
  else
    # Tell nokogiri to use the system libraries instead of compiling its own
    env["NOKOGIRI_USE_SYSTEM_LIBRARIES"] = "true"

    gem "install nokogiri" \
      " --version '#{version}'" \
      " --" \
      " --use-system-libraries" \
      " --with-xml2-lib=#{install_dir}/embedded/lib" \
      " --with-xml2-include=#{install_dir}/embedded/include/libxml2" \
      " --with-xslt-lib=#{install_dir}/embedded/lib" \
      " --with-xslt-include=#{install_dir}/embedded/include/libxslt" \
      " --with-iconv-dir=#{install_dir}/embedded" \
      " --with-zlib-dir=#{install_dir}/embedded", env: env
  end
end


text:
package org.mmtk.utility.sanitychecker;

import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.Trace;
import org.mmtk.vm.VM;

import org.vmmagic.pragma.*;
import org.vmmagic.unboxed.*;

/**
 * This class implements the parallel root-gathering part of a sanity check.
 */
@Uninterruptible
public final class SanityRootTraceLocal extends TraceLocal {

  /**
   * Constructor
   */
  public SanityRootTraceLocal(Trace trace) {
    super(trace);
  }

  /****************************************************************************
   *
   * Object processing and tracing
   */

  /**
   * Copy root values across to the 'real' single-threaded trace that will do
   * the sanity checking.
   */
  @Inline
  public void copyRootValuesTo(TraceLocal trace) {
    while (!rootLocations.isEmpty()) {
      ObjectReference object = rootLocations.pop().loadObjectReference();
      if (!object.isNull()) {
        trace.traceObject(object, true);
      }
    }
    while (!values.isEmpty()) {
      trace.traceObject(values.pop(), true);
    }
  }

  /**
   * Process delayed roots. This does not make sense for SanityRootTraceLocal.
   * are empty.
   */
  @Inline
  public void processRoots() {
    VM.assertions.fail("SanityRootTraceLocal.processRoots called.");
  }

  /**
   * Finishing processing all GC work. This does not make sense for SanityRootTraceLocal.
   */
  @Inline
  public void completeTrace() {
    VM.assertions.fail("SanityRootTraceLocal.completeTrace called.");
  }

  /**
   * This method is the core method during the trace of the object graph.
   * The role of this method is to:
   *
   * @param object The object to be traced.
   * @param root Is this object a root?
   * @return The new reference to the same object instance.
   */
  @Inline
  public ObjectReference traceObject(ObjectReference object, boolean root) {
    if (!root) VM.assertions.fail("SanityRootTraceLocal.traceObject called for non-root object.");
    if (!object.isNull()) {
      values.push(object);
    }
    return object;
  }

  /**
   * Will this object move from this point on, during the current trace ?
   *
   * @param object The object to query.
   * @return True if the object will not move.
   */
  public boolean willNotMoveInCurrentCollection(ObjectReference object) {
    // We never move objects!
    return true;
  }
}


text:
class FlexibleProjectObserver < ActiveRecord::Observer
  observe :flexible_project

  def from_online_to_waiting_funds(flexible_project)
    flexible_project.notify_owner(:project_in_waiting_funds, {
      from_email: CatarseSettings[:email_projects]
    })

    notify_admin_project_will_succeed(flexible_project)
  end

  def from_waiting_funds_to_successful(flexible_project)
    flexible_project.notify_owner(:project_success, {
      from_email: CatarseSettings[:email_projects]
    })

    notify_admin_that_project_is_successful(flexible_project)
    notify_users(flexible_project)
  end
  alias :from_online_to_successful :from_waiting_funds_to_successful

  def from_draft_to_online(flexible_project)
    project = flexible_project.project

    deliver_default_notification_for(flexible_project, :project_visible)

    project.update_attributes({
      online_date: DateTime.current,
      audited_user_name: project.user.name,
      audited_user_cpf: project.user.cpf,
      audited_user_phone_number: project.user.phone_number
    })
  end

  private
  def notify_admin_that_project_is_successful(flexible_project)
    redbooth_user = User.find_by(email: CatarseSettings[:email_redbooth])
    flexible_project.notify_once(:redbooth_task, redbooth_user) if redbooth_user
  end

  def notify_admin_project_will_succeed(flexible_project)
    zendesk_user = User.find_by(email: CatarseSettings[:email_contact])
    flexible_project.notify_once(:project_will_succeed, zendesk_user) if zendesk_user
  end

  def notify_users(flexible_project)
    flexible_project.payments.with_state('paid').each do |payment|
      payment.contribution.
        notify_to_contributor(:contribution_project_successful)
    end
  end

  def deliver_default_notification_for(flexible_project, notification_type)
    flexible_project.notify_owner(
      notification_type,
      {
        from_email: CatarseSettings[:email_projects],
        from_name: CatarseSettings[:company_name]
      }
    )
  end
end


text:
export * from './disciplina.model';
export * from './disciplina-popup.service';
export * from './disciplina.service';
export * from './disciplina-dialog.component';
export * from './disciplina-delete-dialog.component';
export * from './disciplina-detail.component';
export * from './disciplina.component';
export * from './disciplina.route';


text:
const dispatcher = require('../../../lib/dispatcher').dispatcher;
const Dialog     = require('../../../lib/components/Dialog').Dialog;
const Dropdown   = require('../../../lib/components/input/Dropdown').Dropdown;

const SHOW_SIGNAL = 'Dialog.DeviceCount.Show';

exports.DeviceCountDialog = class extends Dialog {
    constructor(opts) {
        super(opts);
        this._onApply = () => {};
        this.initWindow({
            showSignal: SHOW_SIGNAL,
            width:      480,
            height:     180,
            className:  'device-count-dialog',
            title:      'Number of Powered Up devices',
            help:       'Powered'
        });
    }

    initWindowContent() {
        return [
            {
                type:      Dropdown,
                ref:       this.setRef('deviceCount'),
                ui:        this._ui,
                uiId:      this._uiId,
                className: 'abs dialog-lt',
                tabIndex:  1,
                items:     []
            },
            this.initButtons([
                {
                    tabIndex: 128,
                    value:    'Set device count',
                    onClick:  this.onApply.bind(this)
                }
            ])
        ];
    }

    onApply() {
        this.hide();
        this._onApply(this._refs.deviceCount.getValue());
    }

    onShow(opts) {
        this.show();
        this._onApply = opts.onApply;
        let refs = this._refs;
        refs.deviceCount.setValue(opts.deviceCount);
        refs.title.innerHTML = opts.title;
        let items = [];
        for (let i = 0; i < opts.layerCount; i++) {
            items.push({value: i + 1, title: (i + 1) + ' Device' + (i ? 's' : '')});
        }
        refs.deviceCount
            .setItems(items)
            .setValue(opts.deviceCount);
    }
};

exports.DeviceCountDialog.SHOW_SIGNAL = SHOW_SIGNAL;


text:
"use strict";

function DismissMenu() {
	$.Schedule(0.1, function() {
		$.DispatchEvent("DismissAllContextMenus");
	});
}

function OnSell() {
	var pid = Game.GetLocalPlayerID();
	var unit = $.GetContextPanel().Unit;
	unit = Entities.IsControllableByPlayer(unit, pid) ? unit : Players.GetPlayerHeroEntityIndex(pid);
	GameEvents.SendCustomGameEventToServer("panorama_shop_sell_item", {
		"itemIndex": $.GetContextPanel().Item,
		"unit": unit,
	});
	DismissMenu();
}

function OnDisassemble() {
	if (VerifyItem())
		Items.LocalPlayerDisassembleItem($.GetContextPanel().Item);
	DismissMenu();
}

function OnShowInShop() {
	if (VerifyItem()) {
		var itemName = Abilities.GetAbilityName($.GetContextPanel().Item);
    GameEvents.SendEventClientSide('panorama_shop_show_item', { itemName });
	}
	DismissMenu();
}

function OnDropFromStash() {
	if (VerifyItem())
		Items.LocalPlayerDropItemFromStash($.GetContextPanel().Item);
	DismissMenu();
}

function OnMoveToStash() {
	if (VerifyItem())
		Items.LocalPlayerMoveItemToStash($.GetContextPanel().Item);
	DismissMenu();
}

function OnAlert() {
	if (VerifyItem())
		Items.LocalPlayerItemAlertAllies($.GetContextPanel().Item);
	DismissMenu();
}

function VerifyItem() {
	var endPoint = 11;
	for (var i = endPoint; i >= 0; i--) {
		if (Entities.GetItemInSlot($.GetContextPanel().Unit, i) == $.GetContextPanel().Item)
			return true;
	}
	return false;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<module codename="org.openide.compat">
    <module_version install_time="1358413903253" last="true" origin="installer" specification_version="6.21.1">
        <file crc="1028000658" name="config/Modules/org-openide-compat.xml"/>
        <file crc="31423376" name="modules/org-openide-compat.jar"/>
    </module_version>
</module>


text:
'use strict'
/**
 * Módulo Matemático.
 * @module matematicas
 */

// let is new var ... más o menos :-)
// tiene que declararse antes de usarse
// funciones flecha
/**
 * @param {number} x - el número.
 * @return el cuadrado del número
 */
let cuadrado = x => x * x

module.exports = {
    /** Raiz cuadrada de un número */
    raizCuadrada: raizCuadrada,
    /** Cuadrado de un número */
    cuadrado: cuadrado,
    /** Diagonal de un cuadrado conocidos sus lados */
    diagonal: diagonal,
    /** Suma dos números */
    sumar: (x, y) => obtenerNumero(x) + obtenerNumero(y),
    /** Resta dos números */
    restar: (x, y) => obtenerNumero(x) - obtenerNumero(y)
}
// let tiene ámbito de bloque y debe ser declarada antes de usarse
// var sigue siendo incontrolable
var raizCuadrada = Math.sqrt

// las funciones con nombre se siguen declarando en cualquier lugar
/**
 * @param {number} base - base del cuadrado.
 * @param {number} altura - altura del cuadrado.
 * @return la diagonal de dicho cuadrado
 */
function diagonal(base, altura) {
    return raizCuadrada(cuadrado(base) + cuadrado(altura))
}

function obtenerNumero(texto){
    return texto * 1
}


text:
.emoticon {
	width:25px;
	height:25px;
}

.title{
	font-family:Verdana;
	font-size:32px;
	text-align:center;
	color:#015666;
}
.status{
	text-align:center;
	font-family:Verdana;
	font-size:13px;
}

.message{
	font-family:Verdana;
	font-size:13px;
	text-align:left;
}

#messages{
	background-color:#FFFFFF;
	overflow-y:auto;
	font-family:Verdana;
	font-size:12px;
}
.button_small {

	background-color:#79bbff;
	-webkit-border-top-left-radius:0px;
	-moz-border-radius-topleft:0px;
	border-top-left-radius:0px;
	-webkit-border-top-right-radius:0px;
	-moz-border-radius-topright:0px;
	border-top-right-radius:0px;
	-webkit-border-bottom-right-radius:0px;
	-moz-border-radius-bottomright:0px;
	border-bottom-right-radius:0px;
	-webkit-border-bottom-left-radius:0px;
	-moz-border-radius-bottomleft:0px;
	border-bottom-left-radius:0px;
	text-indent:0;
	border:1px solid #469df5;
	display:inline-block;
	color:#ffffff;
	font-family:Verdana;
	font-size:10px;
	font-style:normal;
	height:20px;
	width:75px;
	text-decoration:none;
	text-align:center;
}
.button_small:hover {

	background-color:#79bbff;
}.button_small:active {
	position:relative;
	top:1px;
}

.button {
	background-color:#79bbff;
	-webkit-border-top-left-radius:0px;
	-moz-border-radius-topleft:0px;
	border-top-left-radius:0px;
	-webkit-border-top-right-radius:0px;
	-moz-border-radius-topright:0px;
	border-top-right-radius:0px;
	-webkit-border-bottom-right-radius:0px;
	-moz-border-radius-bottomright:0px;
	border-bottom-right-radius:0px;
	-webkit-border-bottom-left-radius:0px;
	-moz-border-radius-bottomleft:0px;
	border-bottom-left-radius:0px;
	text-indent:0;
	border:1px solid #469df5;
	display:inline-block;
	color:#ffffff;
	font-family:Verdana;
	font-size:15px;
	font-weight:normal;
	font-style:normal;
	height:40px;
	width:100px;
	text-decoration:none;
	text-align:center;
}
.button:hover {
	background-color:#79bbff;
}.button:active {
	position:relative;
	top:1px;
}

.background{
	border-width:20px;
	border-color:#FF9640;
	border-style:solid;
	border-radius:20px;
}

#page{
    position: relative;
    width: 700px;
    text-align:left;
    margin-top:4%;
    background-color:#FF9640;
}


text:
package com.guangzhou.gov.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.SoftReference;
import java.util.HashMap;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.Log;

/**
 * 图片缓存管理
 *
 * @author zhangjie
 */
public class BitmapManager {
	private static final String TAG = "BitmapManager";
	private static BitmapManager sInstance = null;
	private HashMap<String, SoftReference<Bitmap>> mBitmapCache;
	private HashMap<String, String> mBitmapToNameMap;
	protected int mImageWidth = 0;
	protected int mImageHeight = 0;

	public synchronized static BitmapManager getInstance(Context context) {
		if (sInstance == null) {
			sInstance = new BitmapManager(context);
		}
		return sInstance;
	}

	/**
	 * 释放
	 */
	private synchronized static void releaseSelfInstance() {
		sInstance = null;
	}

	private BitmapManager(Context context) {
		mBitmapCache = new HashMap<String, SoftReference<Bitmap>>(50);
		mBitmapToNameMap = new HashMap<String, String>(50);
	}

	/**
	 * 设置目标图片的最大宽高
	 *
	 * @param width
	 *            宽的最大值
	 * @param height
	 *            高的最大值
	 */
	public void setImageSize(int width, int height) {
		mImageWidth = width;
		mImageHeight = height;
	}

	/**
	 * 设置目标图片的最大宽高
	 *
	 * @param size
	 *            宽和高的最大值
	 */
	public void setImageSize(int size) {
		setImageSize(size, size);
	}

	/**
	 * 根据文件路径获取Bitmap
	 *
	 * @param path
	 * @return
	 */
	public Bitmap getBitmapByFilePathNoCache(String path) {
		Bitmap tmpBitmap = null;
		try {
			tmpBitmap = decodeSampledBitmapFromFile(path, mImageWidth,
					mImageHeight);
		} catch (OutOfMemoryError e) {
			Log.e(TAG, "OutOfMemoryError, path:" + path);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		return tmpBitmap;
	}

	/**
	 * 根据文件路径获取Bitmap
	 *
	 * @param path
	 * @return
	 */
	public Bitmap getBitmapByFilePath(String path) {
		return getBitmapByFilePath(path, mImageWidth, mImageHeight);
	}

	/**
	 * 根据文件路径获取Bitmap
	 *
	 * @param path
	 * @return
	 */
	public Bitmap getBitmapByFilePath(String path, int reqWidth, int reqHeight) {
		Bitmap tmpBitmap = null;
		if (path == null) {
			return null;
		}
		tmpBitmap = getBitmapFormCache(path);
		if (null != tmpBitmap) {
			return tmpBitmap;
		}
		try {
			tmpBitmap = decodeSampledBitmapFromFile(path, reqWidth,
					reqHeight);
		} catch (OutOfMemoryError e) {
			Log.e(TAG, "OutOfMemoryError, path:" + path);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		return tmpBitmap;
	}

	/**
	 * 根据资源ID获取Bitmap
	 * @param resId
	 * @return
	 */
	public Bitmap getBitmapByResid(Resources res, int resId)
	{
		if (res == null) {
			return null;
		}
		return getBitmapByResid(res, resId, mImageWidth, mImageHeight);
	}

	/**
	 * 根据资源ID获取Bitmap
	 * @param resId
	 * @return
	 */
	public Bitmap getBitmapByResid(Resources res, int resId, int reqWidth, int reqHeight)
	{
		if (res == null) {
			return null;
		}
		Bitmap tmpBitmap = null;
		tmpBitmap = getBitmapFormCache(String.valueOf(resId));
		if (null != tmpBitmap) {
			return tmpBitmap;
		}
		try {
			tmpBitmap = decodeSampledBitmapFromResource(res, resId, reqWidth, reqHeight);
		} catch (OutOfMemoryError e) {
			Log.e(TAG, "OutOfMemoryError, resId:" + resId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return tmpBitmap;
	}

	public static Bitmap getBitmap(Resources res, int resId, int width) {
		return getBitmap(res, resId, width, width);
	}
	public static Bitmap getBitmap(Resources res, int resId, int width, int height) {
		return Bitmap.createScaledBitmap(BitmapFactory.decodeResource(res, resId), width, height, true);
	}

	/**
	 * 从内存取
	 *
	 * @param name
	 * @return
	 */
	public Bitmap getBitmapFormCache(String name) {
		if (null == name) {
			return null;
		}
		Bitmap bitmap = null;
		SoftReference<Bitmap> bitmapReference = mBitmapCache.get(name);
		if (bitmapReference != null) {
			bitmap = bitmapReference.get();
			if (bitmap != null) {
				return bitmap;
			}
		}
		return null;
	}

	/**
	 * Decode and sample down a bitmap from resources to the requested width and
	 * height.
	 *
	 * @param res
	 *            The resources object containing the image data
	 * @param resId
	 *            The resource id of the image data
	 * @param reqWidth
	 *            The requested width of the resulting bitmap
	 * @param reqHeight
	 *            The requested height of the resulting bitmap
	 * @return A bitmap sampled down from the original with the same aspect
	 *         ratio and dimensions that are equal to or greater than the
	 *         requested width and height
	 */
	public Bitmap decodeSampledBitmapFromResource(Resources res, int resId,
			int reqWidth, int reqHeight) {
		if (res == null) {
			return null;
		}
		// First decode with inJustDecodeBounds=true to check dimensions
		final Options options = new Options();
		options.inJustDecodeBounds = true;
		BitmapFactory.decodeResource(res, resId, options);

		// Calculate inSampleSize
		options.inSampleSize = calculateInSampleSize(options, reqWidth,
				reqHeight);

		// Decode bitmap with inSampleSize set
		options.inJustDecodeBounds = false;
		Bitmap bitmap = BitmapFactory.decodeResource(res, resId, options);
		if (bitmap != null) {
			saveBitmapToCache(String.valueOf(resId), bitmap);
		}
		return bitmap;
	}

	/**
	 * Decode and sample down a bitmap from a file to the requested width and
	 * height.
	 *
	 * @param filename
	 *            The full path of the file to decode
	 * @param reqWidth
	 *            The requested width of the resulting bitmap
	 * @param reqHeight
	 *            The requested height of the resulting bitmap
	 * @return A bitmap sampled down from the original with the same aspect
	 *         ratio and dimensions that are equal to or greater than the
	 *         requested width and height
	 * @throws java.io.FileNotFoundException
	 */
	public Bitmap decodeSampledBitmapFromFile(String filename, int reqWidth,
			int reqHeight) throws FileNotFoundException {

		if (filename == null || filename.equals("") || filename == "") {
			return null;
		}
		// First decode with inJustDecodeBounds=true to check dimensions
		final Options options = new Options();
		options.inJustDecodeBounds = true;
		BitmapFactory.decodeFile(filename, options);

		// Calculate inSampleSize
		options.inSampleSize = calculateInSampleSize(options, reqWidth,
				reqHeight);

		// Decode bitmap with inSampleSize set
		options.inJustDecodeBounds = false;
		FileInputStream stream = null;
		Bitmap bitmap = null;
		try {
			stream = new FileInputStream(filename);
			bitmap = BitmapFactory.decodeStream(stream, null, options);
			// Bitmap bitmap = BitmapFactory.decodeFile(filename, options);
			if (bitmap != null) {
				saveBitmapToCache(filename, bitmap);
			}
		} catch (Exception e) {
			// TODO: handle exception
		} finally {
			if (stream != null) {
				try {
					stream.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
		return bitmap;
	}

	/**
	 * Calculate an inSampleSize for use in a
	 * {@link android.graphics.BitmapFactory.Options} object when decoding
	 * bitmaps using the decode* methods from
	 * {@link android.graphics.BitmapFactory}. This implementation calculates
	 * the closest inSampleSize that will result in the final decoded bitmap
	 * having a width and height equal to or larger than the requested width and
	 * height. This implementation does not ensure a power of 2 is returned for
	 * inSampleSize which can be faster when decoding but results in a larger
	 * bitmap which isn't as useful for caching purposes.
	 *
	 * @param options
	 *            An options object with out* params already populated (run
	 *            through a decode* method with inJustDecodeBounds==true
	 * @param reqWidth
	 *            The requested width of the resulting bitmap
	 * @param reqHeight
	 *            The requested height of the resulting bitmap
	 * @return The value to be used for inSampleSize
	 */
	public static int calculateInSampleSize(Options options, int reqWidth,
			int reqHeight) {
		// Raw height and width of image
		final int height = options.outHeight;
		final int width = options.outWidth;
		int inSampleSize = 1;
		if (reqHeight <= 0 || reqWidth <= 0) {
			return inSampleSize;
		}
		if (height > reqHeight || width > reqWidth) {

			// Calculate ratios of height and width to requested height and
			// width
			final int heightRatio = Math.round((float) height
					/ (float) reqHeight);
			final int widthRatio = Math.round((float) width / (float) reqWidth);

			// Choose the smallest ratio as inSampleSize value, this will
			// guarantee a final image
			// with both dimensions larger than or equal to the requested height
			// and width.
			inSampleSize = heightRatio < widthRatio ? heightRatio : widthRatio;

			// This offers some additional logic in case the image has a strange
			// aspect ratio. For example, a panorama may have a much larger
			// width than height. In these cases the total pixels might still
			// end up being too large to fit comfortably in memory, so we should
			// be more aggressive with sample down the image (=larger
			// inSampleSize).

			final float totalPixels = width * height;

			// Anything more than 2x the requested pixels we'll sample down
			// further
			final float totalReqPixelsCap = reqWidth * reqHeight * 2;

			while (totalPixels / (inSampleSize * inSampleSize) > totalReqPixelsCap) {
				inSampleSize++;
			}
		}
		return inSampleSize;
	}
	/**
	 * 从raw目录取bitmap
	 * @param context
	 * @param resName
	 * @param packageName
	 * @return
	 */
	public Bitmap decodeNormalBitmap(Context context, String resName, String packageName) {
		if (context == null) {
			return null;
		} else {
			return decodeNormalBitmap(context, packageName, resName, mImageWidth, mImageHeight);
		}
	}

	/**
	 *

	 *  从raw目录取bitmap
	 *
	 * @param context
	 * @param packageName
	 * @param resName
	 * @return
	 */
	public Bitmap decodeNormalBitmap(Context context, String packageName,
			String resName, int reqWidth, int reqHeight) {
		if (resName == null || context == null || packageName == null) {
			return null;

		}
		Bitmap bitmap = getBitmapFormCache(resName);
		if (bitmap != null) {
			return bitmap;
		}
		InputStream is = null;
		try {
			Resources res = context.getResources();
			int resId = res.getIdentifier(resName, "raw", packageName);
			is = res.openRawResource(resId);
			final Options options = new Options();
			options.inJustDecodeBounds = true;
			BitmapFactory.decodeStream(is, null, options);
			// Calculate inSampleSize
			options.inSampleSize = calculateInSampleSize(options, reqWidth,
					reqHeight);
			// Decode bitmap with inSampleSize set
			options.inJustDecodeBounds = false;
			bitmap = BitmapFactory.decodeStream(is, null, options);
			if (bitmap != null) {
				saveBitmapToCache(resName, bitmap);
			}
		} catch (NotFoundException e) {
		} catch (OutOfMemoryError e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (is != null) {
				try {
					is.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
		return bitmap;
	}
	/**
	 * 保存图片至缓存
	 * @param name
	 * @param bitmap
	 */
	public void saveBitmapToCache(String name, Bitmap bitmap)
	{
		if (mBitmapCache != null) {
			mBitmapCache.put(name, new SoftReference<Bitmap>(bitmap));
		}
		if (mBitmapToNameMap != null) {
			mBitmapToNameMap.put(bitmap.toString(), name);
		}
	}

	public boolean isContain(String name)
	{
		if (mBitmapCache != null) {
			return mBitmapCache.containsKey(name);
		}
		return false;
	}

	/**
	 *

	 * 功能简述:销毁所有bitmap
	 */
	public void recyleAllBitmap() {
		releaseSelfInstance();
		if (mBitmapCache != null) {
			for (SoftReference<Bitmap> reference : mBitmapCache.values()) {
				if (reference != null) {
					Bitmap bitmap = reference.get();
					if (bitmap != null && !bitmap.isRecycled()) {
						bitmap.recycle();
						bitmap = null;
					}
				}
			}
			mBitmapCache.clear();
		}
		if (mBitmapToNameMap != null) {
			mBitmapToNameMap.clear();
		}
	}

	/**
	 *

	 * 功能简述:销毁单个Bitmap的地方

	 * 功能详细描述:

	 * 注意:
	 *
	 * @param bitmap
	 */
	public void recyleBitmap(Bitmap bitmap) {
		if (bitmap != null) {
			String drawableName = mBitmapToNameMap.get(bitmap.toString());
			if (drawableName != null) {
				mBitmapCache.remove(drawableName);
				mBitmapToNameMap.remove(bitmap.toString());
				if (!bitmap.isRecycled()) {
					bitmap.recycle();
					bitmap = null;
				}
			}
		}
	}

	/**
	 * 获取圆角位图的方法
	 * @param bitmap 需要转化成圆角的位图
	 * @param pixels 圆角的度数,数值越大,圆角越大
	 * @return 处理后的圆角位图
	 */
	public static Bitmap toRoundCorner(Bitmap bitmap, int pixels) {
		Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
				bitmap.getHeight(), Config.ARGB_8888);
		Canvas canvas = new Canvas(output);
		final int color = 0xff424242;
		final Paint paint = new Paint();
		final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
		final RectF rectF = new RectF(rect);
		final float roundPx = pixels;
		paint.setAntiAlias(true);
		canvas.drawARGB(0, 0, 0, 0);
		paint.setColor(color);
		canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
		paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
		canvas.drawBitmap(bitmap, rect, rect, paint);
		return output;
	}

	public static Bitmap getGaussina(Context context, Bitmap sentBitmap, int radius) {
		Bitmap bitmap = null;
		try {
			/*if (VERSION.SDK_INT >= 17) {
				if (radius > 25) {
					radius = 25;
				}
				bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);

				RenderScript rs = RenderScript.create(context);
				Allocation input = Allocation.createFromBitmap(rs, sentBitmap, Allocation.MipmapControl.MIPMAP_NONE,
						Allocation.USAGE_SCRIPT);
				Allocation output = Allocation.createTyped(rs, input.getType());
				ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
				script.setRadius(radius  e.g. 3.f );
				script.setInput(input);
				script.forEach(output);
				output.copyTo(bitmap);
				if (rs != null) {
					rs.finish();
					rs.destroy();
					rs = null;
				}
				if (input != null) {
					input.destroy();
					input = null;
				}
				if (output != null) {
					output.destroy();
					output = null;
				}
				if (script != null) {
					script.destroy();
					script = null;
				}
				return bitmap;
			}*/
			bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);

			if (radius < 1) {
				return null;
			}

			int w = bitmap.getWidth();
			int h = bitmap.getHeight();

			int[] pix = new int[w * h];
			bitmap.getPixels(pix, 0, w, 0, 0, w, h);

			int wm = w - 1;
			int hm = h - 1;
			int wh = w * h;
			int div = radius + radius + 1;

			int r[] = new int[wh];
			int g[] = new int[wh];
			int b[] = new int[wh];
			int rsum, gsum, bsum, x, y, i, p, yp, yi, yw;

			int vmin[] = new int[Math.max(w, h)];

			int divsum = (div + 1) >> 1;
			divsum *= divsum;
			int dv[] = new int[256 * divsum];
			for (i = 0; i < 256 * divsum; i++) {
				dv[i] = i / divsum;
			}

			yw = yi = 0;

			int[][] stack = new int[div][3];
			int stackpointer;
			int stackstart;
			int[] sir;
			int rbs;
			int r1 = radius + 1;
			int routsum, goutsum, boutsum;
			int rinsum, ginsum, binsum;

			for (y = 0; y < h; y++) {
				rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
				for (i = -radius; i <= radius; i++) {
					p = pix[yi + Math.min(wm, Math.max(i, 0))];
					sir = stack[i + radius];
					sir[0] = (p & 0xff0000) >> 16;
				sir[1] = (p & 0x00ff00) >> 8;
			sir[2] = p & 0x0000ff;
			rbs = r1 - Math.abs(i);
			rsum += sir[0] * rbs;
			gsum += sir[1] * rbs;
			bsum += sir[2] * rbs;
			if (i > 0) {
				rinsum += sir[0];
				ginsum += sir[1];
				binsum += sir[2];
			} else {
				routsum += sir[0];
				goutsum += sir[1];
				boutsum += sir[2];
			}
				}
				stackpointer = radius;

				for (x = 0; x < w; x++) {

					r[yi] = dv[rsum];
					g[yi] = dv[gsum];
					b[yi] = dv[bsum];

					rsum -= routsum;
					gsum -= goutsum;
					bsum -= boutsum;

					stackstart = stackpointer - radius + div;
					sir = stack[stackstart % div];

					routsum -= sir[0];
					goutsum -= sir[1];
					boutsum -= sir[2];

					if (y == 0) {
						vmin[x] = Math.min(x + radius + 1, wm);
					}
					p = pix[yw + vmin[x]];

					sir[0] = (p & 0xff0000) >> 16;
				sir[1] = (p & 0x00ff00) >> 8;
				sir[2] = p & 0x0000ff;

				rinsum += sir[0];
				ginsum += sir[1];
				binsum += sir[2];

				rsum += rinsum;
				gsum += ginsum;
				bsum += binsum;

				stackpointer = (stackpointer + 1) % div;
				sir = stack[stackpointer % div];

				routsum += sir[0];
				goutsum += sir[1];
				boutsum += sir[2];

				rinsum -= sir[0];
				ginsum -= sir[1];
				binsum -= sir[2];

				yi++;
				}
				yw += w;
			}
			for (x = 0; x < w; x++) {
				rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
				yp = -radius * w;
				for (i = -radius; i <= radius; i++) {
					yi = Math.max(0, yp) + x;

					sir = stack[i + radius];

					sir[0] = r[yi];
					sir[1] = g[yi];
					sir[2] = b[yi];

					rbs = r1 - Math.abs(i);

					rsum += r[yi] * rbs;
					gsum += g[yi] * rbs;
					bsum += b[yi] * rbs;

					if (i > 0) {
						rinsum += sir[0];
						ginsum += sir[1];
						binsum += sir[2];
					} else {
						routsum += sir[0];
						goutsum += sir[1];
						boutsum += sir[2];
					}

					if (i < hm) {
						yp += w;
					}
				}
				yi = x;
				stackpointer = radius;
				for (y = 0; y < h; y++) {
					// Preserve alpha channel: ( 0xff000000 & pix[yi] )
					pix[yi] = (0xff000000 & pix[yi]) | (dv[rsum] << 16)
							| (dv[gsum] << 8) | dv[bsum];

					rsum -= routsum;
					gsum -= goutsum;
					bsum -= boutsum;

					stackstart = stackpointer - radius + div;
					sir = stack[stackstart % div];

					routsum -= sir[0];
					goutsum -= sir[1];
					boutsum -= sir[2];

					if (x == 0) {
						vmin[y] = Math.min(y + r1, hm) * w;
					}
					p = x + vmin[y];

					sir[0] = r[p];
					sir[1] = g[p];
					sir[2] = b[p];

					rinsum += sir[0];
					ginsum += sir[1];
					binsum += sir[2];

					rsum += rinsum;
					gsum += ginsum;
					bsum += binsum;

					stackpointer = (stackpointer + 1) % div;
					sir = stack[stackpointer];

					routsum += sir[0];
					goutsum += sir[1];
					boutsum += sir[2];

					rinsum -= sir[0];
					ginsum -= sir[1];
					binsum -= sir[2];

					yi += w;
				}
			}
			bitmap.setPixels(pix, 0, w, 0, 0, w, h);
			pix = null;
		} catch (OutOfMemoryError e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
		}
		return bitmap;
	}
}


text:
using System.Xml;

namespace FatturaElettronica.Semplificata.FatturaElettronicaHeader.CessionarioCommittente
{
  public class SedeCessionarioCommittente : Common.Località
    {
        public SedeCessionarioCommittente() { }

        public SedeCessionarioCommittente(XmlReader r) : base(r) { }
    }
}


text:
package org.n52.iceland.exception.ows.concrete;

import org.n52.shetland.ogc.ows.OWSConstants.RequestParams;
import org.n52.shetland.ogc.ows.exception.InvalidParameterValueException;

/**
 * @author Christian Autermann
 *
 * @since 1.0.0
 */
public class InvalidServiceOrVersionException extends InvalidParameterValueException {
    private static final long serialVersionUID = 6678340028297145825L;

    public InvalidServiceOrVersionException(String service, String version) {
        at(RequestParams.service);
        withMessage("The requested service (%s) and/or version (%s) is not supported by this server!", service,
                version);
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<manifest xmlns="http://www.ibm.com/xmlns/prod/cics/bundle" id="catalog.example.service" bundleMajorVer="1" bundleMinorVer="0" bundleMicroVer="0" bundleVersion="1" bundleRelease="0" build="IntB-201511072132">
    <meta_directives>
        <timestamp>2016-01-18T14:58:31.832Z</timestamp>
    </meta_directives>
    <define name="EXINQCSW" type="http://www.ibm.com/xmlns/prod/cics/bundle/WEBSERVICE" path="EXINQCSW.webservice"/>
    <define name="EXINQCS" type="http://www.ibm.com/xmlns/prod/cics/bundle/URIMAP" path="EXINQCS.urimap"/>
    <define name="EXINQCSW" type="http://www.ibm.com/xmlns/prod/cics/bundle/URIMAP" path="EXINQCSW.urimap"/>
</manifest>