text:
package ru.rulex.conclusion.dagger;

import dagger.ObjectGraph;

import static com.google.common.base.Preconditions.checkNotNull;
import ru.rulex.conclusion.dagger.DaggerObjectGraphBuilders.DaggerImmutablePhraseModule;
import ru.rulex.conclusion.dagger.DaggerObjectGraphBuilders.DaggerMutablePhraseModule;

public class ExpressionBuilders
{

  public interface ObjectGraphBuilder<T>
  {
    ObjectGraph eq(T value);
  }

  public interface DigitObjectGraphBuilder<T extends Comparable<? super T>> extends ObjectGraphBuilder<T>
  {
    ObjectGraph less( final T argument );
    ObjectGraph more( final T argument );
    ObjectGraph lessOrEquals ( T argument );
    ObjectGraph moreOrEquals ( T argument );
  }

  public static final class StringObjectGraphBuilder implements ObjectGraphBuilder<String>
  {
    private final String value;

    StringObjectGraphBuilder( final String values )
    {
      this.value = values;
    }

    @Override
    public ObjectGraph eq( String argument )
    {
      return DaggerImmutablePhraseModule.$eq( value, argument );
    }
  }

  public static final class StringsObjectGraphBuilder implements ObjectGraphBuilder<String>
  {
    private final String[] values;

    StringsObjectGraphBuilder( final String[] values )
    {
      this.values = values;
    }

    @Override
    public ObjectGraph eq( String argument )
    {
      return DaggerImmutablePhraseModule.$eq( values, argument );
    }

    public ObjectGraph equalsAnyOff( String argument )
    {
      return DaggerImmutablePhraseModule.$equalsAnyOff( values, argument );
    }

    public ObjectGraph matchesExp( String argument )
    {
      return DaggerImmutablePhraseModule.$matchesExp( values, argument );
    }
  }

  public static final class NumberObjectGraphBuilder<T extends Number & Comparable<? super T>>
          implements DigitObjectGraphBuilder<T>
  {
    private final T value;
    private ObjectGraph objectGraph;

    public T getArgumentClazz()
    {
      return value;
    }

    private NumberObjectGraphBuilder( T value )
    {
      this.value = checkNotNull( value );
    }

    @Override
    public ObjectGraph less( final T argument )
    {
      return DaggerImmutablePhraseModule.$less( value, argument );
    }

    @Override
    public ObjectGraph more( final T argument )
    {
      return DaggerImmutablePhraseModule.$more( value, argument );
    }

    @Override
    public ObjectGraph lessOrEquals( T argument )
    {
      return DaggerImmutablePhraseModule.$moreOrEquals( value, argument );
    }

    @Override
    public ObjectGraph moreOrEquals( T argument )
    {
      return DaggerImmutablePhraseModule.$lessOrEquals( value, argument );
    }

    @Override
    public ObjectGraph eq( final T argument )
    {
      return DaggerImmutablePhraseModule.$eq( value, argument );
    }
  }

  public static final class VariableObjectGraphBuilder<T extends Comparable<? super T>> implements DigitObjectGraphBuilder<T>
  {
    private final String varName;

    public VariableObjectGraphBuilder( String varName )
    {
      this.varName = varName;
    }

    @Override
    public ObjectGraph eq( T argument )
    {
      return DaggerMutablePhraseModule.$eq( argument, varName );
    }

    @Override
    public ObjectGraph less( T argument )
    {
      return DaggerMutablePhraseModule.$less( argument, varName );
    }

    @Override
    public ObjectGraph more( T argument )
    {
      return DaggerMutablePhraseModule.$more( argument, varName );
    }

    @Override
    public ObjectGraph lessOrEquals ( T argument )
    {
      return DaggerMutablePhraseModule.$lessOrEquals( argument, varName );
    }

    @Override
    public ObjectGraph moreOrEquals( T argument )
    {
      return DaggerMutablePhraseModule.$moreOrEquals( argument, varName );
    }
  }

  public static <T extends Number & Comparable<? super T>> NumberObjectGraphBuilder<T> val( final T arg )
  {
    return new NumberObjectGraphBuilder<T>( arg );
  }

  public static StringObjectGraphBuilder val( final String arg )
  {
    return new StringObjectGraphBuilder( arg );
  }

  public static StringsObjectGraphBuilder val( final String... args )
  {
    return new StringsObjectGraphBuilder( args );
  }

  public static VariableObjectGraphBuilder<Integer> varInt( final String varName )
  {
    return new VariableObjectGraphBuilder<Integer>( varName );
  }

  public static VariableObjectGraphBuilder<Float> varFloat( final String varName )
  {
    return new VariableObjectGraphBuilder<Float>( varName );
  }

  public static VariableObjectGraphBuilder<String> varString( final String varName )
  {
    return new VariableObjectGraphBuilder<String>( varName );
  }
}


text:
using LogicalShift.Reason.Api;
using System.Collections.Generic;

namespace LogicalShift.Reason.Unification
{
    /// <summary>
    /// Provides support for unifying reference literals
    /// </summary>
    public static class UnifyReferences
    {

        /// <summary>
        /// Unifies a value on the heap
        /// </summary>
        public static bool Unify(this IReferenceLiteral address1, IReferenceLiteral address2, ITrail trail)
        {
            var unifyStack = new Stack<IReferenceLiteral>();

            // Push the addresses that we're going to unify
            unifyStack.Push(address1);
            unifyStack.Push(address2);

            // Iterate until the stack is empty
            while (unifyStack.Count > 0)
            {
                // Deref the values on the stack
                var value1 = unifyStack.Pop().Dereference();
                var value2 = unifyStack.Pop().Dereference();

                if (!ReferenceEquals(value1, value2))
                {
                    if (value1.IsReference())
                    {
                        // Bind references
                        trail.Record(value1);
                        value1.SetTo(value2);
                    }
                    else if (value2.IsReference())
                    {
                        trail.Record(value2);
                        value2.SetTo(value1);
                    }
                    else
                    {
                        if (Equals(value1.Term, value2.Term))
                        {
                            // Process the rest of the structure
                            var structurePos1 = value1.Reference;
                            var structurePos2 = value2.Reference;

                            while (structurePos1 != null)
                            {
                                unifyStack.Push(structurePos1);
                                unifyStack.Push(structurePos2);

                                structurePos1 = structurePos1.NextArgument;
                                structurePos2 = structurePos2.NextArgument;
                            }
                        }
                        else
                        {
                            // Structures do not match: fail
                            return false;
                        }
                    }
                }
            }

            return true;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
import * as React from 'react';
import { css, CssProps } from '@jdl2/css-util';

export interface InputTextProps extends CssProps {
    onChange?: (value: string) => void;
}

export function InputText(props: InputTextProps) {
    const { onChange } = props;
    return (
        <input
            className={css(props, 'InputText')}
            type="text"
            onChange={e => {
                if (onChange) {
                    onChange(e.target.value);
                }
            }}
        />
    );
}


text:
using MbUnit.Framework;
using RhinoMocksCPPInterfaces;

namespace Rhino.Mocks.Tests.FieldsProblem
{
	[TestFixture]
	public class FieldProblem_Shanon
	{
		[Test]
		[Ignore(@"Updating the Castle and NH assmeblies causes this to fail.

		Message:Method 'StartLiveOnSlot' in type 'IHaveMethodWithModOptsProxye59cf24cdfbc4797af58984e3c4fdf3f' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a621a9e7e5c32e69' does not have an implementation.
Source:mscorlib
TypeName:IHaveMethodWithModOptsProxye59cf24cdfbc4797af58984e3c4fdf3f
TargetSite:System.Type _TermCreateClass(Int32, System.Reflection.Module)
HelpLink:null
StackTrace:

   at System.Reflection.Emit.TypeBuilder._TermCreateClass(Int32 handle, Module module)
   at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
   at System.Reflection.Emit.TypeBuilder.CreateType()
   at Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType()
   at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCode(Type proxyTargetType, Type[] interfaces, ProxyGenerationOptions options)
   at Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(Type theInterface, Type[] interfaces, ProxyGenerationOptions options)
   at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithoutTarget(Type theInterface, Type[] interfaces, ProxyGenerationOptions options)
   at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type theInterface, Type[] interfaces, ProxyGenerationOptions options, IInterceptor[] interceptors)
   at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type theInterface, Type[] interfaces, IInterceptor[] interceptors)
   at Rhino.Mocks.MockRepository.MockInterface(CreateMockState mockStateFactory, Type type, Type[] extras)
   at Rhino.Mocks.MockRepository.CreateMockObject(Type type, CreateMockState factory, Type[] extras, Object[] argumentsForConstructor)
   at Rhino.Mocks.MockRepository.StrictMock[T](Object[] argumentsForConstructor)
   at Rhino.Mocks.Tests.FieldsProblem.FieldProblem_Shanon.CanMockInterfaceWithMethodsHavingModOpt() in c:\Documents and Settings\jmeckley\My Documents\Visual Studio 2005\Projects\Rhino-Tools\trunk\rhino-mocks\Rhino.Mocks.Tests\FieldsProblem\FieldProblem_Shanon.cs:line 13")]
		public void CanMockInterfaceWithMethodsHavingModOpt()
		{
			MockRepository mocks = new MockRepository();
			IHaveMethodWithModOpts mock = mocks.StrictMock<IHaveMethodWithModOpts>();
			Assert.IsNotNull(mock);
		}
	}
}


text:
package eu.hyvar.dataValues.resource.hydatavalue.debug;

public class HydatavalueSourcePathComputerDelegate {
	// The generator for this class is currently disabled by option
	// 'disableDebugSupport' in the .cs file.
}


text:
'''
    :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
    :copyright: © 2014 by the SaltStack Team, see AUTHORS for more details.
    :license: Apache 2.0, see LICENSE for more details.

    pylint_helpers
    ~~~~~~~~~~~~~~

    Help PyLint understand some of this projects parts
'''

from astroid import MANAGER
from astroid import nodes
from astroid.builder import AstroidBuilder

def flask_sqlalchemy_transform(module):
    if module.name != 'flask_sqlalchemy':
        return

    import flask_sqlalchemy
    flask_sqlalchemy._include_sqlalchemy(flask_sqlalchemy.SQLAlchemy)

    fake = AstroidBuilder(MANAGER).inspect_build(flask_sqlalchemy)

    for func_name, func in fake.locals.items():
        if func_name == 'SQLAlchemy':
            func[0].Model = fake.locals['Model'][0]
        module.locals[func_name] = func

def register(linter):
    '''
    Allow this to be setup when loading the plugins
    '''
    MANAGER.register_transform(nodes.Module, flask_sqlalchemy_transform)


text:
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Main theme colors -->
        <!--   your app branding color for the app bar -->
        <item name="android:colorPrimary">@color/primary</item>
        <!--   darker variant for the status bar and contextual app bars -->
        <item name="android:colorPrimaryDark">@color/primary_dark</item>
    </style>

</resources>


text:
<?php

Sencha_RequestHandler::$appAccountLevels['AfterSchoolWidget'] = false;


text:
package com.intellij.execution.ui;

import java.util.EventListener;

public interface RunContentListener extends EventListener{
  void contentSelected(RunContentDescriptor descriptor);
  void contentRemoved (RunContentDescriptor descriptor);
}


text:
package com.farmerbb.taskbar.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import com.farmerbb.taskbar.service.DashboardService;
import com.farmerbb.taskbar.service.NotificationService;
import com.farmerbb.taskbar.service.StartMenuService;
import com.farmerbb.taskbar.service.TaskbarService;
import com.farmerbb.taskbar.helper.LauncherHelper;
import com.farmerbb.taskbar.util.U;

import static com.farmerbb.taskbar.util.Constants.*;

public class QuitReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent == null || !ACTION_QUIT.equals(intent.getAction())) {
            return;
        }
        SharedPreferences pref = U.getSharedPreferences(context);
        if(!pref.getBoolean(PREF_SKIP_QUIT_RECEIVER, false)) {
            Intent taskbarIntent = new Intent(context, TaskbarService.class);
            Intent startMenuIntent = new Intent(context, StartMenuService.class);
            Intent dashboardIntent = new Intent(context, DashboardService.class);
            Intent notificationIntent = new Intent(context, NotificationService.class);

            pref.edit().putBoolean(PREF_TASKBAR_ACTIVE, false).apply();

            if(!LauncherHelper.getInstance().isOnHomeScreen(context)) {
                context.stopService(taskbarIntent);
                context.stopService(startMenuIntent);
                context.stopService(dashboardIntent);

                U.clearCaches(context);
                U.sendBroadcast(context, ACTION_START_MENU_DISAPPEARING);
            }

            context.stopService(notificationIntent);
        } else
            pref.edit().remove(PREF_SKIP_QUIT_RECEIVER).apply();
    }
}


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

#ifndef DESOLA_TG_PAIRWISE_HPP
#define DESOLA_TG_PAIRWISE_HPP

#include <desola/tg/Desola_tg_fwd.hpp>
#include <map>

namespace desola
{

namespace detail
{

template<typename exprType, typename T_element>
class TGPairwise : public TGBinOp<exprType, exprType, exprType, T_element>
{
private:
  const TGPairwiseOp op;

public:
  TGPairwise(typename TGInternalType<exprType, T_element>::type* internal,
		  const TGPairwiseOp o,
		  const TGOutputReference<exprType, T_element>& l,
		  const TGOutputReference<exprType, T_element>& r) : TGBinOp<exprType, exprType, exprType, T_element>(internal, l, r), op(o)
  {
  }

  virtual void accept(TGExpressionNodeVisitor<T_element>& v)
  {
    v.visit(*this);
  }

  bool isEqual(const TGPairwise& node, const std::map<const TGExpressionNode<T_element>*, const TGExpressionNode<T_element>*>& mappings) const
  {
    return  TGBinOp<exprType, exprType, exprType, T_element>::isEqual(node, mappings) &&
	    op == node.op;
  }

  const TGPairwiseOp getOperation() const
  {
    return op;
  }
};

}

}
#endif


text:
// Copyright (c) 2010 Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// range_map-inl.h: Range map implementation.
//
// See range_map.h for documentation.
//
// Author: Mark Mentovai

#ifndef PROCESSOR_RANGE_MAP_INL_H__
#define PROCESSOR_RANGE_MAP_INL_H__

#include <assert.h>

#include "processor/range_map.h"
#include "processor/linked_ptr.h"
#include "processor/logging.h"

namespace google_breakpad {

template<typename AddressType, typename EntryType>
void RangeMap<AddressType, EntryType>::SetEnableShrinkDown(
    bool enable_shrink_down) {
  enable_shrink_down_ = enable_shrink_down;
}

template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::IsShrinkDownEnabled() const {
  return enable_shrink_down_;
}

template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType &base,
                                                  const AddressType &size,
                                                  const EntryType &entry) {
  return StoreRangeInternal(base, 0 /* delta */, size, entry);
}

template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::StoreRangeInternal(
    const AddressType &base, const AddressType &delta,
    const AddressType &size, const EntryType &entry) {
  AddressType high = base + (size - 1);

  // Check for undersize or overflow.
  if (size <= 0 || high < base) {
    // The processor will hit this case too frequently with common symbol
    // files in the size == 0 case, which is more suited to a DEBUG channel.
    // Filter those out since there's no DEBUG channel at the moment.
    BPLOG_IF(INFO, size != 0) << "StoreRangeInternal failed, "
                              << HexString(base) << "+" << HexString(size)
                              << ", " << HexString(high)
                              << ", delta: " << HexString(delta);
    return false;
  }

  // Ensure that this range does not overlap with another one already in the
  // map.
  MapConstIterator iterator_base = map_.lower_bound(base);
  MapConstIterator iterator_high = map_.lower_bound(high);

  if (iterator_base != iterator_high) {
    // Some other range begins in the space used by this range.  It may be
    // contained within the space used by this range, or it may extend lower.
    // If enable_shrink_down_ is true, shrink the current range down, otherwise
    // this is an error.
    if (enable_shrink_down_) {
      AddressType additional_delta = iterator_base->first - base + 1;
      return StoreRangeInternal(base + additional_delta,
                                delta + additional_delta,
                                size - additional_delta, entry);
    } else {
      // The processor hits this case too frequently with common symbol files.
      // This is most appropriate for a DEBUG channel, but since none exists
      // now simply comment out this logging.
      // AddressType other_base = iterator_base->second.base();
      // AddressType other_size = iterator_base->first - other_base + 1;
      // BPLOG(INFO) << "StoreRangeInternal failed, an existing range is "
      //             << "overlapping with the new range: new "
      //             << HexString(base) << "+" << HexString(size)
      //             << ", existing " << HexString(other_base) << "+"
      //             << HexString(other_size);
      return false;
    }
  }

  if (iterator_high != map_.end()) {
    if (iterator_high->second.base() <= high) {
      // The range above this one overlaps with this one.  It may fully
      // contain this range, or it may begin within this range and extend
      // higher.  If enable_shrink_down_ is true, shrink the other range down,
      // otherwise this is an error.
      if (enable_shrink_down_ && iterator_high->first > high) {
        // Shrink the other range down.
        AddressType other_high = iterator_high->first;
        AddressType additional_delta =
            high - iterator_high->second.base() + 1;
        EntryType other_entry;
        AddressType other_base = AddressType();
        AddressType other_size = AddressType();
        AddressType other_delta = AddressType();
        RetrieveRange(other_high, &other_entry, &other_base, &other_delta,
                      &other_size);
        map_.erase(iterator_high);
        map_.insert(MapValue(other_high,
                             Range(other_base + additional_delta,
                                   other_delta + additional_delta,
                                   other_entry)));
        // Retry to store this range.
        return StoreRangeInternal(base, delta, size, entry);
      } else {
        // The processor hits this case too frequently with common symbol files.
        // This is most appropriate for a DEBUG channel, but since none exists
        // now simply comment out this logging.
        //
        // AddressType other_base = iterator_high->second.base();
        // AddressType other_size = iterator_high->first - other_base + 1;
        // BPLOG(INFO) << "StoreRangeInternal failed, an existing range "
        //             << "contains or extends higher than the new range: new "
        //             << HexString(base) << "+" << HexString(size)
        //             << ", existing " << HexString(other_base) << "+"
        //             << HexString(other_size);
        return false;
      }
    }
  }

  // Store the range in the map by its high address, so that lower_bound can
  // be used to quickly locate a range by address.
  map_.insert(MapValue(high, Range(base, delta, entry)));
  return true;
}

template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::RetrieveRange(
    const AddressType &address, EntryType *entry, AddressType *entry_base,
    AddressType *entry_delta, AddressType *entry_size) const {
  BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveRange requires |entry|";
  assert(entry);

  MapConstIterator iterator = map_.lower_bound(address);
  if (iterator == map_.end())
    return false;

  // The map is keyed by the high address of each range, so |address| is
  // guaranteed to be lower than the range's high address.  If |range| is
  // not directly preceded by another range, it's possible for address to
  // be below the range's low address, though.  When that happens, address
  // references something not within any range, so return false.
  if (address < iterator->second.base())
    return false;

  *entry = iterator->second.entry();
  if (entry_base)
    *entry_base = iterator->second.base();
  if (entry_delta)
    *entry_delta = iterator->second.delta();
  if (entry_size)
    *entry_size = iterator->first - iterator->second.base() + 1;

  return true;
}

template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::RetrieveNearestRange(
    const AddressType &address, EntryType *entry, AddressType *entry_base,
    AddressType *entry_delta, AddressType *entry_size) const {
  BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveNearestRange requires |entry|";
  assert(entry);

  // If address is within a range, RetrieveRange can handle it.
  if (RetrieveRange(address, entry, entry_base, entry_delta, entry_size))
    return true;

  // upper_bound gives the first element whose key is greater than address,
  // but we want the first element whose key is less than or equal to address.
  // Decrement the iterator to get there, but not if the upper_bound already
  // points to the beginning of the map - in that case, address is lower than
  // the lowest stored key, so return false.
  MapConstIterator iterator = map_.upper_bound(address);
  if (iterator == map_.begin())
    return false;
  --iterator;

  *entry = iterator->second.entry();
  if (entry_base)
    *entry_base = iterator->second.base();
  if (entry_delta)
    *entry_delta = iterator->second.delta();
  if (entry_size)
    *entry_size = iterator->first - iterator->second.base() + 1;

  return true;
}

template<typename AddressType, typename EntryType>
bool RangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
    int index, EntryType *entry, AddressType *entry_base,
    AddressType *entry_delta, AddressType *entry_size) const {
  BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveRangeAtIndex requires |entry|";
  assert(entry);

  if (index >= GetCount()) {
    BPLOG(ERROR) << "Index out of range: " << index << "/" << GetCount();
    return false;
  }

  // Walk through the map.  Although it's ordered, it's not a vector, so it
  // can't be addressed directly by index.
  MapConstIterator iterator = map_.begin();
  for (int this_index = 0; this_index < index; ++this_index)
    ++iterator;

  *entry = iterator->second.entry();
  if (entry_base)
    *entry_base = iterator->second.base();
  if (entry_delta)
    *entry_delta = iterator->second.delta();
  if (entry_size)
    *entry_size = iterator->first - iterator->second.base() + 1;

  return true;
}

template<typename AddressType, typename EntryType>
int RangeMap<AddressType, EntryType>::GetCount() const {
  return map_.size();
}

template<typename AddressType, typename EntryType>
void RangeMap<AddressType, EntryType>::Clear() {
  map_.clear();
}

}  // namespace google_breakpad

#endif  // PROCESSOR_RANGE_MAP_INL_H__


text:
package org.oep.core.dossiermgt.service.persistence;

/**
 * @author trungdk
 */
public interface EbPartnerShipFinder {
	public java.util.List<org.oep.core.dossiermgt.model.EbPartnerShip> findByLikeName(
		java.lang.String name, int startIndex, int endIndex,
		com.liferay.portal.service.ServiceContext serviceContext);

	public int countByLikeName(java.lang.String name,
		com.liferay.portal.service.ServiceContext serviceContext);

	public java.util.List<org.oep.core.dossiermgt.model.EbPartnerShip> findByGroupLikeName(
		java.lang.String name, int startIndex, int endIndex,
		com.liferay.portal.service.ServiceContext serviceContext);

	public int countByGroupLikeName(java.lang.String name,
		com.liferay.portal.service.ServiceContext serviceContext);
}


text:
namespace strap {
namespace mckp {

template<typename PType, typename WType>
Problem<PType, WType>::Problem()
{
}

template<typename PType, typename WType>
Index Problem<PType, WType>::index() const
{
  return Index(k_.begin(), k_.end());
}

template class Problem<int, int>;
template class Problem<int, double>;
template class Problem<double, int>;
template class Problem<double, double>;

} // namespace mckp
} // namespace strap


text:
package com.projeto_es.caroneiros.fragments;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.projeto_es.caroneiros.adapters.CardAdapter;
import com.projeto_es.caroneiros.classes.CaroneirosController;
import com.projeto_es.caroneiros.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class HomeFragment extends Fragment {

    CaroneirosController cc;
    RecyclerView myRecView;

    public HomeFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        cc = CaroneirosController.getInstance();
        View myView;
        myView = inflater.inflate(R.layout.home_layout, container, false);

        fillListeners(myView);

        myRecView = (RecyclerView) myView.findViewById(R.id.caronaRecycler);
        myRecView.setHasFixedSize(true);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this.getContext());
        myRecView.setLayoutManager(layoutManager);
        myRecView.setItemAnimator(new DefaultItemAnimator());
        showData();
        return myView;
    }

    private void showData(){
        CardAdapter adapter = new CardAdapter(cc.getSysCaronas(), getFragmentManager());
        myRecView.setAdapter(adapter);
    }

    private void fillListeners(View myView) {
        final FragmentManager fragmentManager = getFragmentManager();

        FloatingActionButton criarCarona = (FloatingActionButton) myView.findViewById(R.id.novaCaronaBtn);
        if (criarCarona != null){
            criarCarona.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    fragmentManager.beginTransaction().replace(R.id.content_frame, new CreateRideFragment()).addToBackStack(null).commit();
                }
            });
        }
    }

}


text:
<?php
/**
 * Interface to provide enough information about a record to make it previewable
 * through the CMS. It uses the record database ID, its "frontend" and "backend"
 * links to link up the edit form with its preview.
 *
 * Also used by {@link SilverStripeNavigator} to generate links -  both within
 * the CMS preview, and as a frontend utility for logged-in CMS authors in
 * custom themes (with the $SilverStripeNavigator template marker).
 *
 * @package framework
 * @subpackage admin
 */
interface CMSPreviewable {

	/**
	 * @return String Absolute URL to the end-user view for this record.
	 * Example: http://mysite.com/my-record
	 */
	public function Link();

	/**
	 * @return String Absolute URL to the CMS-author view. Should point to a
	 * controller subclassing {@link LeftAndMain}. Example:
	 * http://mysite.com/admin/edit/6
	 */
	public function CMSEditLink();

}


text:
//
//  UIViewController+UIViewController_Indicator.m
//  xianchangjia
//
//  Created by apple on 13-12-9.
//  Copyright (c) 2013年 jijia. All rights reserved.
//

#import "UIViewController+Indicator.h"
#import "UIView+Additon.h"
#import "XCJErrorView.h"
typedef enum {
    kTagIndicatorView = 2900,
    kTaglabelView = 2901,
    kTagErrorView = 2902,
    kTagErrorViewText = 2903,
}kUIViewIndicatorTags;

@implementation UIViewController (Indicator)

- (void)showIndicatorView
{
    [self showIndicatorViewAtpoint:CGPointMake((self.view.width-20)/2, (self.view.height-100)/2)];
}

- (void)showIndicatorViewAtpoint:(CGPoint)point{
    UIActivityIndicatorViewStyle style = UIActivityIndicatorViewStyleGray;
    [self showIndicatorViewAtpoint:point indicatorStyle:style];
}

- (void)showIndicatorViewWithStyle:(UIActivityIndicatorViewStyle)style{
    [self showIndicatorViewAtpoint:CGPointMake((self.view.width-20)/2, (self.view.height-20)/2) indicatorStyle:style];
}

- (void)showIndicatorViewAtpoint:(CGPoint)point indicatorStyle:(UIActivityIndicatorViewStyle)style{
    UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)[self.view subviewWithTag:kTagIndicatorView];

    if (!indicator) {
        indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:style];
        indicator.frame = CGRectMake(point.x, point.y, 20, 20);
        indicator.tag = kTagIndicatorView;
        indicator.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin;
        [self.view addSubview:indicator];
        [indicator startAnimating];
    }

    UILabel *textLabel = (UILabel *)[self.view subviewWithTag:kTaglabelView];
    if ([textLabel isMemberOfClass:[UILabel class]]) {
        textLabel.text = @"";
    }

    [indicator startAnimating];
}

- (void)hideIndicatorView{
    UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)[self.view subviewWithTag:kTagIndicatorView];
    if(indicator){
        if ([indicator isMemberOfClass:[UIActivityIndicatorView class]]) {
            [indicator stopAnimating];
            [indicator removeFromSuperview]; indicator = nil;
            return;
        }
        NSAssert([indicator isMemberOfClass:[UIActivityIndicatorView class]], @"indicator view错误,重复tag");
    }

    UILabel * textLabel = (UILabel *)[self.view subviewWithTag:kTaglabelView];
    if (textLabel) {
      if ([textLabel isMemberOfClass:[UILabel class]]) {
          textLabel.text = @"";
          [textLabel removeFromSuperview];
          textLabel = nil;
      }
    }

}
/**
 *  处理隐藏失败后然后显示回调处理函数
 *
 *  @param statusContent 文本状态信息
 *  @param voidFun       错误block回调
 */
- (void)hideIndicatorView:(NSString*)statusContent block:(SLBlockBlock) voidFun
{
    [self hideIndicatorView];
    // add text.view to self.view(parent)
    UILabel * textContent = (UILabel *)[self.view subviewWithTag:kTaglabelView];
    if (textContent == nil) {
        CGPoint point = CGPointMake(0, (self.view.height-100)/2);
        textContent = [[UILabel alloc] init];
        textContent.frame = CGRectMake(point.x, point.y, 320, 20);
        textContent.tag = kTaglabelView;
        textContent.textColor = [UIColor grayColor];
        textContent.font = [UIFont systemFontOfSize:14.0f];
        textContent.textAlignment = NSTextAlignmentCenter;
    }
    textContent.text = statusContent;
    [self.view addSubview:textContent];
    /**
     *  show indicator and hide text

    SLBlock voidblock =
    ^{

        UILabel *textLabel = (UILabel *)[self.view subviewWithTag:kTaglabelView];
        if ([textLabel isMemberOfClass:[UILabel class]]) {
            textLabel.text = @"";
            [textLabel removeFromSuperview];
            textLabel = nil;
        }
        [self showIndicatorView];

    };
    voidFun(voidblock);
    */
}

- (void) showErrorInfoWithRetry
{
    XCJErrorView * errorView = [[NSBundle mainBundle] loadNibNamed:@"XCJErrorView" owner:self options:nil][0];
    errorView.tag  = kTagErrorView;
    [self.view addSubview:errorView];
}

- (void) hiddeErrorInfoWithRetry
{
    UIView *textLabel = (UIView *)[self.view subviewWithTag:kTagErrorView];
    if (textLabel) {
        [textLabel removeFromSuperview];
        textLabel = nil;
    }
}

- (void) showErrorText:(NSString * ) message
{
    UILabel * textContent = (UILabel *)[self.view subviewWithTag:kTaglabelView];
    if (textContent == nil) {
        CGPoint point = CGPointMake(0, (self.view.height-100)/2);
        textContent = [[UILabel alloc] init];
        textContent.frame = CGRectMake(point.x, point.y, 320, 20);
        textContent.tag = kTagErrorViewText;
        textContent.textColor = [UIColor grayColor];
        textContent.font = [UIFont systemFontOfSize:14.0f];
        textContent.textAlignment = NSTextAlignmentCenter;
    }
    textContent.text = message;
    [self.view addSubview:textContent];
}

- (void) hiddeErrorText
{
    UIView *textLabel = (UIView *)[self.view subviewWithTag:kTagErrorViewText];
    if (textLabel) {
        [textLabel removeFromSuperview];
        textLabel = nil;
    }
}

@end


text:
import sys
from common import context_exec
from os import path as ppath

def examples():
    """Prints examples of using the script to the console using colored output.
    """
    script = "Continuous Integration Scripts Unit Testing"
    explain = ("Since scripts behave differently based on the arguments and combinations "
               "of arguments you pass them, they can't be tested nicely without "
               "duplicating code. This script provides a framework for testing the scripts "
               "that ship with the CI server and the various combinations of arguments "
               "that can be passed to them.")
    contents = [(("Run all the tests for script arguments and combinations of script arguments "
                  "for the ci server."), "scripts.py ci",
                 ("You can also show the examples and help information for the ci.py script "
                  "by passing the '-texamples' and '-thelp' arguments."))]
    required = ("REQUIRED: a working installation of the code.")
    output = ("RETURNS: prints status information to stdout.")
    details = ""
    outputfmt = ""
    from pyci.msg import example
    example(script, explain, contents, required, output, outputfmt, details)

def _parser_options():
    """Parses the options and arguments from the command line."""
    from os import getcwd
    sys.path.insert(0, getcwd())

    import argparse
    bparser = argparse.ArgumentParser(add_help=False)
    bparser.add_argument("-examples", action="store_true",
                        help="See detailed help and examples for this script.")
    args = vars(bparser.parse_known_args()[0])
    if args["examples"]:
        examples()
        exit(0)

    parser = argparse.ArgumentParser(parents=[bparser],
                                     description="CI Server Script Testing Utility")
    parser.add_argument("scripts", nargs="+",
                        choices=["ci"],
                        help="Specify a list of scripts that you want to unit test.")
    parser.add_argument("-pypath",
                        help="Specify an additional path to add to sys.path.")
    parser.add_argument("-texamples", action="store_true",
                        help="Execute the scripts being unit tested with -examples")
    parser.add_argument("-thelp", action="store_true",
                        help="Show help/usage information for scripts being tested.")
    parser.add_argument("-all", action="store_true",
                        help="Run all the unit tests for CI server scripts.")
    parser.add_argument("-tverbose", action="store_true",
                        help="Run the unit tested scripts in verbose mode.")

    args.update(vars(parser.parse_known_args()[0]))

    #We use the pypath argument so that we can test the package without needing to
    #keep re-installing it after each change.
    if args["pypath"]:
        abspath = ppath.abspath(ppath.expanduser(args["pypath"]))
        sys.path.insert(0, abspath)
    else:
        args["pypath"] = getcwd()

    return args

def _test_generic(args, script, sargs=[]):
    """Executes the specified scripts and argument for a unit test.

    :arg script: the full path to the script to execute.
    :arg args: a list of arguments to pass to the script when it execs.
    :arg examples: when true, the script is run with only the '-examples'
      argument and 'args' is ignored.
    """
    gargs = ["python", script]
    if not args["texamples"]:
        gargs.extend(sargs)
    else:
        gargs.append("-examples")

    if args["tverbose"]:
        gargs.append("--verbose")
    if args["thelp"]:
        gargs.append("-h")

    context_exec(gargs, pypath=args["pypath"])

def _test_ci(args):
    """Tests the interaction of the ci.py script with the main library.
    """
    from pyci.msg import info
    spath = ppath.expanduser("~/codes/ci/pyci/scripts/ci.py")
    #This dictionary has a list of the script arguments that can test the various
    #functionality in the ci.py script.
    sargs = {
        "install": ["-install", "~/codes/ci/tests/repo.xml", "-nolive"],
        "uninstall": ["-uninstall", "~/codes/ci/tests/repo.xml", "-nolive"],
        "disable": ["-disable"],
        "enable": ["-enable"],
        "setup": ["-setup", "-nolive", "-cronfreq", "5"],
        "rollback": ["-rollback", "-nolive"],
        "cron": ["-cron", "-nolive"],
        "list": ["-list", "-nolive"]
    }
    order = ["enable", "install", "list", "uninstall", "disable", "cron",
             "enable", "install", "cron", "setup", "rollback"]
    for key in order:
        _test_generic(args, spath, sargs[key])

if __name__ == '__main__':
    args = _parser_options()
    testdict = {
        "ci": _test_ci
    }

    if args["all"]:
        for testkey in testdict:
            if testdict[testkey] is not None:
                testdict[testkey](args)
    else:
        #Check whether we have a function defined for the unit test to perform and
        #then run it.
        for script in args["scripts"]:
            if script in testdict and testdict[script] is not None:
                testdict[script](args)


text:
<!DOCTYPE HTML>

        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1; url=./HUEMediate/index.html">

        <title>Page Redirection</title>

        If you are not redirected automatically, follow the link to ./HUEMediate/index.html


text:
/*
 * MinIO Java SDK for Amazon S3 Compatible Cloud Storage, (C) 2020 MinIO, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.minio;

import java.util.Objects;

/** Argument class of {@link MinioAsyncClient#removeObject} and {@link MinioClient#removeObject}. */
public class RemoveObjectArgs extends ObjectVersionArgs {
  private boolean bypassGovernanceMode;

  public boolean bypassGovernanceMode() {
    return bypassGovernanceMode;
  }

  public static Builder builder() {
    return new Builder();
  }

  /** Argument builder of {@link RemoveObjectArgs}. */
  public static final class Builder extends ObjectVersionArgs.Builder<Builder, RemoveObjectArgs> {
    public Builder bypassGovernanceMode(boolean flag) {
      operations.add(args -> args.bypassGovernanceMode = flag);
      return this;
    }
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof RemoveObjectArgs)) return false;
    if (!super.equals(o)) return false;
    RemoveObjectArgs that = (RemoveObjectArgs) o;
    return bypassGovernanceMode == that.bypassGovernanceMode;
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), bypassGovernanceMode);
  }
}


text:
<!DOCTYPE html>

<?php
	if (isset($_GET['logout']) && $_GET['logout'] == 1) {
		$message = "
You have successfully logged out.
";
	}
?>
<?php require_once("includes/connection.php") ?>
<?php require_once("includes/functions.php") ?>
<?php require_once("includes/form_functions.php") ?>
<?php require_once("includes/session.php") ?>
<?php
	function log_in(){
		return isset($_SESSION['username']);
	}
	function confirm_log_in(){
		if(log_in()){
		redirect_to("home.php");
    }
}
?>
<?php confirm_log_in(); ?>

    <meta charset="utf-8">
    <title>NIMS-Main</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="assets/css/bootstrap.css" rel="stylesheet">

    <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">

    <link rel="shortcut icon" href="images/favicon.ico">
    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
    <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">

       <?php
		$fp= fopen("xml/test.txt", "w");
	    $query="SELECT * from socialmap";
        $result=mysql_query($query, $connection);
        confirm_query($result);
		while($row=mysql_fetch_array($result)){
			$lat=$row['latitude'];
			$lon=$row['longitude'];
			$typ=$row['type'];
			$nam=$row['Name'];
			$vil=$row['village'];
			$a=$lat . "\n" . $lon . "\n" . $typ . "\n" . $nam . "\n" . $vil . "\n";
			fwrite($fp,$a);
		}
	?>
	<?php if (!empty($message)) {echo "
"  . $message  . "
";} ?>

Select the district

        <select id="jump" onchange="jump();">
            <option value="72.628112793,23.1886348724,7">=== Select district ===</option>
            <option value="70.7800,22.3000,11">Rajkot</option>
			<option value="72.3918352,23.5976589,11">Mahesana</option>
			<option value="72.1191325,23.8507063,11">Patan</option>
			<option value="72.13717,24.3964887,10">Banaskantha</option>
			<option value="73.2633572,23.9772603,11">Sabarkantha</option>
            <option value="72.6800,23.2200,12">gandhinagar</option>
            <option value="72.6167,23.0333,11">Ahmedabad</option>
        </select>

          NGO INFORMATION MANAGEMENT SUITE

			  Log In

Code licensed under Apache License 2.0

Powered by NIMS 1.0


text:
import BlockHeader from './BlockHeader';

export * from './BlockHeader';

export default BlockHeader;


text:
<?php

require_once 'Auth/Yadis/Misc.php';
require_once 'Auth/Yadis/Yadis.php';
require_once 'Auth/OpenID.php';

function Auth_Yadis_getDefaultProxy()
{
    return 'http://xri.net/';
}

function Auth_Yadis_getXRIAuthorities()
{
    return array('!', '=', '@', '+', '$', '(');
}

function Auth_Yadis_getEscapeRE()
{
    $parts = array();
    foreach (array_merge(Auth_Yadis_getUCSChars(),
                         Auth_Yadis_getIPrivateChars()) as $pair) {
        list($m, $n) = $pair;
        $parts[] = sprintf("%s-%s", chr($m), chr($n));
    }

    return sprintf('/[%s]/', implode('', $parts));
}

function Auth_Yadis_getXrefRE()
{
    return '/\((.*?)\)/';
}

function Auth_Yadis_identifierScheme($identifier)
{
    if (Auth_Yadis_startswith($identifier, 'xri://') ||
        ($identifier &&
          in_array($identifier[0], Auth_Yadis_getXRIAuthorities()))) {
        return "XRI";
    } else {
        return "URI";
    }
}

function Auth_Yadis_toIRINormal($xri)
{
    if (!Auth_Yadis_startswith($xri, 'xri://')) {
        $xri = 'xri://' . $xri;
    }

    return Auth_Yadis_escapeForIRI($xri);
}

function _escape_xref($xref_match)
{
    $xref = $xref_match[0];
    $xref = str_replace('/', '%2F', $xref);
    $xref = str_replace('?', '%3F', $xref);
    $xref = str_replace('#', '%23', $xref);
    return $xref;
}

function Auth_Yadis_escapeForIRI($xri)
{
    $xri = str_replace('%', '%25', $xri);
    $xri = preg_replace_callback(Auth_Yadis_getXrefRE(),
                                 '_escape_xref', $xri);
    return $xri;
}

function Auth_Yadis_toURINormal($xri)
{
    return Auth_Yadis_iriToURI(Auth_Yadis_toIRINormal($xri));
}

function Auth_Yadis_iriToURI($iri)
{
    if (1) {
        return $iri;
    } else {
        // According to RFC 3987, section 3.1, "Mapping of IRIs to URIs"
        return preg_replace_callback(Auth_Yadis_getEscapeRE(),
                                     'Auth_Yadis_pct_escape_unicode', $iri);
    }
}

function Auth_Yadis_XRIAppendArgs($url, $args)
{
    // Append some arguments to an HTTP query.  Yes, this is just like
    // OpenID's appendArgs, but with special seasoning for XRI
    // queries.

    if (count($args) == 0) {
        return $url;
    }

    // Non-empty array; if it is an array of arrays, use multisort;
    // otherwise use sort.
    if (array_key_exists(0, $args) &&
        is_array($args[0])) {
        // Do nothing here.
    } else {
        $keys = array_keys($args);
        sort($keys);
        $new_args = array();
        foreach ($keys as $key) {
            $new_args[] = array($key, $args[$key]);
        }
        $args = $new_args;
    }

    // According to XRI Resolution section "QXRI query parameters":
    //
    // "If the original QXRI had a null query component (only a
    //  leading question mark), or a query component consisting of
    //  only question marks, one additional leading question mark MUST
    //  be added when adding any XRI resolution parameters."
    if (strpos(rtrim($url, '?'), '?') !== false) {
        $sep = '&';
    } else {
        $sep = '?';
    }

    return $url . $sep . Auth_OpenID::httpBuildQuery($args);
}

function Auth_Yadis_providerIsAuthoritative($providerID, $canonicalID)
{
    $lastbang = strrpos($canonicalID, '!');
    $p = substr($canonicalID, 0, $lastbang);
    return $p == $providerID;
}

function Auth_Yadis_rootAuthority($xri)
{
    // Return the root authority for an XRI.

    $root = null;

    if (Auth_Yadis_startswith($xri, 'xri://')) {
        $xri = substr($xri, 6);
    }

    $authority = explode('/', $xri, 2);
    $authority = $authority[0];
    if ($authority[0] == '(') {
        // Cross-reference.
        // XXX: This is incorrect if someone nests cross-references so
        //   there is another close-paren in there.  Hopefully nobody
        //   does that before we have a real xriparse function.
        //   Hopefully nobody does that *ever*.
        $root = substr($authority, 0, strpos($authority, ')') + 1);
    } else if (in_array($authority[0], Auth_Yadis_getXRIAuthorities())) {
        // Other XRI reference.
        $root = $authority[0];
    } else {
        // IRI reference.
        $_segments = explode("!", $authority);
        $segments = array();
        foreach ($_segments as $s) {
            $segments = array_merge($segments, explode("*", $s));
        }
        $root = $segments[0];
    }

    return Auth_Yadis_XRI($root);
}

function Auth_Yadis_XRI($xri)
{
    if (!Auth_Yadis_startswith($xri, 'xri://')) {
        $xri = 'xri://' . $xri;
    }
    return $xri;
}

function Auth_Yadis_getCanonicalID($iname, $xrds)
{
    // Returns false or a canonical ID value.

    // Now nodes are in reverse order.
    $xrd_list = array_reverse($xrds->allXrdNodes);
    $parser =& $xrds->parser;
    $node = $xrd_list[0];

    $canonicalID_nodes = $parser->evalXPath('xrd:CanonicalID', $node);

    if (!$canonicalID_nodes) {
        return false;
    }

    $canonicalID = $canonicalID_nodes[0];
    $canonicalID = Auth_Yadis_XRI($parser->content($canonicalID));

    $childID = $canonicalID;

    for ($i = 1; $i < count($xrd_list); $i++) {
        $xrd = $xrd_list[$i];

        $parent_sought = substr($childID, 0, strrpos($childID, '!'));
        $parentCID = $parser->evalXPath('xrd:CanonicalID', $xrd);
        if (!$parentCID) {
            return false;
        }
        $parentCID = Auth_Yadis_XRI($parser->content($parentCID[0]));

        if (strcasecmp($parent_sought, $parentCID)) {
            // raise XRDSFraud.
            return false;
        }

        $childID = $parent_sought;
    }

    $root = Auth_Yadis_rootAuthority($iname);
    if (!Auth_Yadis_providerIsAuthoritative($root, $childID)) {
        // raise XRDSFraud.
        return false;
    }

    return $canonicalID;
}

?>


text:
package org.carlspring.strongbox.validation.configuration.routing;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {})
public @interface RoutingRuleRepositoryFormValid
{
    String message() default "Either storageId or repositoryId must not be blank!";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}