text:
import {
  Component,
  EventEmitter,
  HostBinding,
  Input,
  OnInit,
  Output
} from '@angular/core';
import { Flow } from '../entities/flow.model';

@Component({
  selector: 'app-harmonize-flow-options',
  templateUrl: './harmonize-flow-options.component.html',
  styleUrls: ['./harmonize-flow-options.component.scss']
})
export class HarmonizeFlowOptionsComponent implements OnInit {

  @Input() flow: Flow;

  @Output() onRun: EventEmitter<any> = new EventEmitter();;

  _isVisible: boolean = false;

  settings: any = {
    batchSize: 100,
    threadCount: 4
  };

  constructor() {}

  ngOnInit() {}

  runHarmonize(): void {
    this.onRun.emit(this.settings);
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<!--

-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Some_For_Name" type="Some_Type_Name" />
    <virtualType name="" type="" shared="true">
        <arguments>
            <argument name="object" xsi:type="object" shared="true">Object</argument>
            <argument name="init_parameter" xsi:type="init_parameter">INIT_PARAMETER</argument>
            <argument name="const" xsi:type="const">CONST</argument>
            <argument name="single_array" xsi:type="array">
                <item name="key1 unique for single array" xsi:type="string">value</item>
                <item name="Different symbols 1~!@#$%^&*()_+-=`[]\{}|;':,./<>?" xsi:type="string">2</item>
            </argument>
            <argument name="nested_array" xsi:type="array">
                <item name="key1 unique for single array" xsi:type="array">
                    <item name="key1 unique for single array" xsi:type="string">value</item>
                    <item name="Different symbols 1~!@#$%^&*()_+-=`[]\{}|;':,./<>?" xsi:type="string">2</item>
                </item>
                <item name="backend2" xsi:type="array">
                    <item name="key1 unique for single array" xsi:type="string">value</item>
                    <item name="Different symbols 1~!@#$%^&*()_+-=`[]\{}|;':,./<>?" xsi:type="array">
                        <item name="key1 unique for single array" xsi:type="string">value</item>
                        <item name="Different symbols 1~!@#$%^&*()_+-=`[]\{}|;':,./<>?" xsi:type="string">2</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </virtualType>
    <type name="Some_Type_name">
        <plugin name="plugin_name" type="Type_Test_Value"/>
        <arguments>
            <argument name="object" xsi:type="object">Object</argument>
            <argument name="object_shared" xsi:type="object" shared="true">Object</argument>
            <argument name="object_shared_false" xsi:type="object" shared="false">Object</argument>
            <argument name="init_parameter" xsi:type="init_parameter">INIT_PARAMETER</argument>
            <argument name="const" xsi:type="const">CONST</argument>
            <argument name="single_array" xsi:type="array">
                <item name="key1 unique for single array" xsi:type="string">value</item>
                <item name="Different symbols 1~!@#$%^&*()_+-=`[]\{}|;':,./<>?" xsi:type="object">Instance_test_name</item>
            </argument>
            <argument name="nested_array" xsi:type="array">
                <item name="key1 unique for single array" xsi:type="array">
                    <item name="key1 unique for single array" xsi:type="string">value</item>
                    <item name="Different symbols 1~!@#$%^&*()_+-=`[]\{}|;':,./<>?" xsi:type="object">Instance_test_name</item>
                </item>
                <item name="backend2" xsi:type="array">
                    <item name="key1 unique for single array" xsi:type="string">value</item>
                    <item name="Different symbols 1~!@#$%^&*()_+-=`[]\{}|;':,./<>?" xsi:type="array">
                        <item name="key1 unique for single array" xsi:type="string">value</item>
                        <item name="Different symbols 1~!@#$%^&*()_+-=`[]\{}|;':,./<>?" xsi:type="object">Instance_test_name</item>
                    </item>
                </item>
            </argument>
            <argument name="baseController" xsi:type="string">some_value</argument>
        </arguments>
    </type>
</config>


text:
layout: post
title: 18 years old teen blonde
titleinfo: pornvd
desc: Watch 18 years old teen blonde. Pornhub is the ultimate xxx porn and sex site.
---

18 years old teen blonde

Watch 18 years old teen blonde. Pornhub is the ultimate xxx porn and sex site.


text:
package lila.blog

import io.prismic._
import lila.memo.AsyncCache
import play.api.mvc.RequestHeader
import scala.concurrent.duration._

final class BlogApi(prismicUrl: String, collection: String) {

  def recent(api: Api, ref: Option[String], nb: Int): Fu[Option[Response]] =
    api.forms(collection).ref(ref | api.master.ref)
      .orderings(s"[my.$collection.date desc]")
      .pageSize(nb).page(1).submit().fold(_ => none, some _)

  def one(api: Api, ref: Option[String], id: String) =
    api.forms(collection)
      .query(s"""[[:d = at(document.id, "$id")]]""")
      .ref(ref | api.master.ref).submit() map (_.results.headOption)

  // -- Build a Prismic context
  def context(ref: Option[String])(implicit linkResolver: (Api, Option[String]) => DocumentLinkResolver) =
    prismicApi map { api =>
      BlogApi.Context(
        api,
        ref.map(_.trim).filterNot(_.isEmpty).getOrElse(api.master.ref),
        linkResolver(api, ref))
    }

  private val cache = BuiltInCache(200)
  private val logger = (level: Symbol, message: String) => level match {
    case 'DEBUG => play.api.Logger("prismic") debug message
    case 'ERROR => play.api.Logger("prismic") error message
    case _      => play.api.Logger("prismic") info message
  }

  private val fetchPrismicApi = AsyncCache.single[Api](
    f = Api.get(prismicUrl, cache = cache, logger = logger),
    timeToLive = 1 minute)

  def prismicApi = fetchPrismicApi(true)
}

object BlogApi {

  def extract(body: Fragment.StructuredText): String =
    body.blocks
      .takeWhile(_.isInstanceOf[Fragment.StructuredText.Block.Paragraph])
      .take(2).map {
        case Fragment.StructuredText.Block.Paragraph(text, _, _) => s"<p>$text</p>"
        case _ => ""
      }.mkString

  case class Context(api: Api, ref: String, linkResolver: DocumentLinkResolver) {
    def maybeRef = Option(ref).filterNot(_ == api.master.ref)
  }
}


text:
project(GpioSlaveDemo CXX)

# Disable unused features
set(KAA_WITHOUT_CONFIGURATION 1)
set(KAA_WITHOUT_NOTIFICATIONS 1)
set(KAA_WITHOUT_EVENTS 1)

add_executable(demo_client src/KaaDemo.cpp)

target_compile_definitions(demo_client PRIVATE
    -DDEMO_ACCESS_TOKEN="${DEMO_ACCESS_TOKEN}")

target_link_libraries(demo_client kaacpp)


text:
#ifndef BOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP
#define BOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP

#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/algo_type.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <cstddef>

#if defined(BOOST_HAS_PRAGMA_ONCE)
#  pragma once
#endif

namespace boost {
namespace intrusive {

//! circular_list_algorithms provides basic algorithms to manipulate nodes
//! forming a circular doubly linked list. An empty circular list is formed by a node
//! whose pointers point to itself.
//!
//! circular_list_algorithms is configured with a NodeTraits class, which encapsulates the
//! information about the node to be manipulated. NodeTraits must support the
//! following interface:
//!
//! Typedefs:
//!
//! <tt>node</tt>: The type of the node that forms the circular list
//!
//! <tt>node_ptr</tt>: A pointer to a node
//!
//! <tt>const_node_ptr</tt>: A pointer to a const node
//!
//! Static functions:
//!
//! <tt>static node_ptr get_previous(const_node_ptr n);</tt>
//!
//! <tt>static void set_previous(node_ptr n, node_ptr prev);</tt>
//!
//! <tt>static node_ptr get_next(const_node_ptr n);</tt>
//!
//! <tt>static void set_next(node_ptr n, node_ptr next);</tt>
template<class NodeTraits>
class circular_list_algorithms
{
   public:
   typedef typename NodeTraits::node            node;
   typedef typename NodeTraits::node_ptr        node_ptr;
   typedef typename NodeTraits::const_node_ptr  const_node_ptr;
   typedef NodeTraits                           node_traits;

   //! Effects: Constructs an non-used list element, so that
   //! inited(this_node) == true
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static void init(const node_ptr &this_node)
   {
      const node_ptr null_node((node_ptr()));
      NodeTraits::set_next(this_node, null_node);
      NodeTraits::set_previous(this_node, null_node);
   }

   //! Effects: Returns true is "this_node" is in a non-used state
   //! as if it was initialized by the "init" function.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static bool inited(const const_node_ptr &this_node)
   {  return !NodeTraits::get_next(this_node); }

   //! Effects: Constructs an empty list, making this_node the only
   //!   node of the circular list:
   //!  <tt>NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node)
   //!  == this_node</tt>.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static void init_header(const node_ptr &this_node)
   {
      NodeTraits::set_next(this_node, this_node);
      NodeTraits::set_previous(this_node, this_node);
   }

   //! Requires: this_node must be in a circular list or be an empty circular list.
   //!
   //! Effects: Returns true is "this_node" is the only node of a circular list:
   //!  <tt>return NodeTraits::get_next(this_node) == this_node</tt>
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static bool unique(const const_node_ptr &this_node)
   {
      node_ptr next = NodeTraits::get_next(this_node);
      return !next || next == this_node;
   }

   //! Requires: this_node must be in a circular list or be an empty circular list.
   //!
   //! Effects: Returns the number of nodes in a circular list. If the circular list
   //!  is empty, returns 1.
   //!
   //! Complexity: Linear
   //!
   //! Throws: Nothing.
   static std::size_t count(const const_node_ptr &this_node)
   {
      std::size_t result = 0;
      const_node_ptr p = this_node;
      do{
         p = NodeTraits::get_next(p);
         ++result;
      }while (p != this_node);
      return result;
   }

   //! Requires: this_node must be in a circular list or be an empty circular list.
   //!
   //! Effects: Unlinks the node from the circular list.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static node_ptr unlink(const node_ptr &this_node)
   {
      node_ptr next(NodeTraits::get_next(this_node));
      node_ptr prev(NodeTraits::get_previous(this_node));
      NodeTraits::set_next(prev, next);
      NodeTraits::set_previous(next, prev);
      return next;
   }

   //! Requires: b and e must be nodes of the same circular list or an empty range.
   //!
   //! Effects: Unlinks the node [b, e) from the circular list.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static void unlink(const node_ptr &b, const node_ptr &e)
   {
      if (b != e) {
         node_ptr prevb(NodeTraits::get_previous(b));
         NodeTraits::set_previous(e, prevb);
         NodeTraits::set_next(prevb, e);
      }
   }

   //! Requires: nxt_node must be a node of a circular list.
   //!
   //! Effects: Links this_node before nxt_node in the circular list.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static void link_before(const node_ptr &nxt_node, const node_ptr &this_node)
   {
      node_ptr prev(NodeTraits::get_previous(nxt_node));
      NodeTraits::set_previous(this_node, prev);
      NodeTraits::set_next(this_node, nxt_node);
      //nxt_node might be an alias for prev->next_
      //so use it before NodeTraits::set_next(prev, ...)
      //is called and the reference changes it's value
      NodeTraits::set_previous(nxt_node, this_node);
      NodeTraits::set_next(prev, this_node);
   }

   //! Requires: prev_node must be a node of a circular list.
   //!
   //! Effects: Links this_node after prev_node in the circular list.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static void link_after(const node_ptr &prev_node, const node_ptr &this_node)
   {
      node_ptr next(NodeTraits::get_next(prev_node));
      NodeTraits::set_previous(this_node, prev_node);
      NodeTraits::set_next(this_node, next);
      //prev_node might be an alias for next->next_
      //so use it before update it before NodeTraits::set_previous(next, ...)
      //is called and the reference changes it's value
      NodeTraits::set_next(prev_node, this_node);
      NodeTraits::set_previous(next, this_node);
   }

   //! Requires: this_node and other_node must be nodes inserted
   //!  in circular lists or be empty circular lists.
   //!
   //! Effects: Swaps the position of the nodes: this_node is inserted in
   //!   other_nodes position in the second circular list and the other_node is inserted
   //!   in this_node's position in the first circular list.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static void swap_nodes(const node_ptr &this_node, const node_ptr &other_node)
   {
      if (other_node == this_node)
         return;
      bool this_inited  = inited(this_node);
      bool other_inited = inited(other_node);
      if(this_inited){
         init_header(this_node);
      }
      if(other_inited){
         init_header(other_node);
      }

      node_ptr next_this(NodeTraits::get_next(this_node));
      node_ptr prev_this(NodeTraits::get_previous(this_node));
      node_ptr next_other(NodeTraits::get_next(other_node));
      node_ptr prev_other(NodeTraits::get_previous(other_node));
      //these first two swaps must happen before the other two
      swap_prev(next_this, next_other);
      swap_next(prev_this, prev_other);
      swap_next(this_node, other_node);
      swap_prev(this_node, other_node);

      if(this_inited){
         init(other_node);
      }
      if(other_inited){
         init(this_node);
      }
   }

   //! Requires: b and e must be nodes of the same circular list or an empty range.
   //!   and p must be a node of a different circular list or may not be an iterator in
   //    [b, e).
   //!
   //! Effects: Removes the nodes from [b, e) range from their circular list and inserts
   //!   them before p in p's circular list.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static void transfer(const node_ptr &p, const node_ptr &b, const node_ptr &e)
   {
      if (b != e) {
         node_ptr prev_p(NodeTraits::get_previous(p));
         node_ptr prev_b(NodeTraits::get_previous(b));
         node_ptr prev_e(NodeTraits::get_previous(e));
         NodeTraits::set_next(prev_e, p);
         NodeTraits::set_previous(p, prev_e);
         NodeTraits::set_next(prev_b, e);
         NodeTraits::set_previous(e, prev_b);
         NodeTraits::set_next(prev_p, b);
         NodeTraits::set_previous(b, prev_p);
      }
   }

   //! Requires: i must a node of a circular list
   //!   and p must be a node of a different circular list.
   //!
   //! Effects: Removes the node i from its circular list and inserts
   //!   it before p in p's circular list.
   //!   If p == i or p == NodeTraits::get_next(i), this function is a null operation.
   //!
   //! Complexity: Constant
   //!
   //! Throws: Nothing.
   static void transfer(const node_ptr &p, const node_ptr &i)
   {
      node_ptr n(NodeTraits::get_next(i));
      if(n != p && i != p){
         node_ptr prev_p(NodeTraits::get_previous(p));
         node_ptr prev_i(NodeTraits::get_previous(i));
         NodeTraits::set_next(prev_p, i);
         NodeTraits::set_previous(i, prev_p);
         NodeTraits::set_next(i, p);
         NodeTraits::set_previous(p, i);
         NodeTraits::set_previous(n, prev_i);
         NodeTraits::set_next(prev_i, n);

      }
   }

   //! Effects: Reverses the order of elements in the list.
   //!
   //! Throws: Nothing.
   //!
   //! Complexity: This function is linear time.
   static void reverse(const node_ptr &p)
   {
      node_ptr f(NodeTraits::get_next(p));
      node_ptr i(NodeTraits::get_next(f)), e(p);

      while(i != e) {
         node_ptr n = i;
         i = NodeTraits::get_next(i);
         transfer(f, n, i);
         f = n;
      }
   }

   //! Effects: Moves the node p n positions towards the end of the list.
   //!
   //! Throws: Nothing.
   //!
   //! Complexity: Linear to the number of moved positions.
   static void move_backwards(const node_ptr &p, std::size_t n)
   {
      //Null shift, nothing to do
      if(!n) return;
      node_ptr first  = NodeTraits::get_next(p);
      //size() == 0 or 1, nothing to do
      if(first == NodeTraits::get_previous(p)) return;
      unlink(p);
      //Now get the new first node
      while(n--){
         first = NodeTraits::get_next(first);
      }
      link_before(first, p);
   }

   //! Effects: Moves the node p n positions towards the beginning of the list.
   //!
   //! Throws: Nothing.
   //!
   //! Complexity: Linear to the number of moved positions.
   static void move_forward(const node_ptr &p, std::size_t n)
   {
      //Null shift, nothing to do
      if(!n)   return;
      node_ptr last  = NodeTraits::get_previous(p);
      //size() == 0 or 1, nothing to do
      if(last == NodeTraits::get_next(p))   return;

      unlink(p);
      //Now get the new last node
      while(n--){
         last = NodeTraits::get_previous(last);
      }
      link_after(last, p);
   }

   //! Requires: f and l must be in a circular list.
   //!
   //! Effects: Returns the number of nodes in the range [f, l).
   //!
   //! Complexity: Linear
   //!
   //! Throws: Nothing.
   static std::size_t distance(const const_node_ptr &f, const const_node_ptr &l)
   {
      const_node_ptr i(f);
      std::size_t result = 0;
      while(i != l){
         i = NodeTraits::get_next(i);
         ++result;
      }
      return result;
   }

   struct stable_partition_info
   {
      std::size_t num_1st_partition;
      std::size_t num_2nd_partition;
      node_ptr    beg_2st_partition;
   };

   template<class Pred>
   static void stable_partition(node_ptr beg, const node_ptr &end, Pred pred, stable_partition_info &info)
   {
      node_ptr bcur = node_traits::get_previous(beg);
      node_ptr cur  = beg;
      node_ptr new_f = end;

      std::size_t num1 = 0, num2 = 0;
      while(cur != end){
         if(pred(cur)){
            ++num1;
            bcur = cur;
            cur  = node_traits::get_next(cur);
         }
         else{
            ++num2;
            node_ptr last_to_remove = bcur;
            new_f = cur;
            bcur = cur;
            cur  = node_traits::get_next(cur);
            BOOST_TRY{
               //Main loop
               while(cur != end){
                  if(pred(cur)){ //Might throw
                     ++num1;
                     //Process current node
                     node_traits::set_next    (last_to_remove, cur);
                     node_traits::set_previous(cur, last_to_remove);
                     last_to_remove = cur;
                     node_ptr nxt = node_traits::get_next(cur);
                     node_traits::set_next    (bcur, nxt);
                     node_traits::set_previous(nxt, bcur);
                     cur = nxt;
                  }
                  else{
                     ++num2;
                     bcur = cur;
                     cur  = node_traits::get_next(cur);
                  }
               }
            }
            BOOST_CATCH(...){
               node_traits::set_next    (last_to_remove, new_f);
               node_traits::set_previous(new_f, last_to_remove);
               BOOST_RETHROW;
            }
            BOOST_CATCH_END
            node_traits::set_next(last_to_remove, new_f);
            node_traits::set_previous(new_f, last_to_remove);
            break;
         }
      }
      info.num_1st_partition = num1;
      info.num_2nd_partition = num2;
      info.beg_2st_partition = new_f;
   }

   private:
   static void swap_prev(const node_ptr &this_node, const node_ptr &other_node)
   {
      node_ptr temp(NodeTraits::get_previous(this_node));
      NodeTraits::set_previous(this_node, NodeTraits::get_previous(other_node));
      NodeTraits::set_previous(other_node, temp);
   }

   static void swap_next(const node_ptr &this_node, const node_ptr &other_node)
   {
      node_ptr temp(NodeTraits::get_next(this_node));
      NodeTraits::set_next(this_node, NodeTraits::get_next(other_node));
      NodeTraits::set_next(other_node, temp);
   }
};

/// @cond

template<class NodeTraits>
struct get_algo<CircularListAlgorithms, NodeTraits>
{
   typedef circular_list_algorithms<NodeTraits> type;
};

/// @endcond

} //namespace intrusive
} //namespace boost

#include <boost/intrusive/detail/config_end.hpp>

#endif //BOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP


text:
<?php
/* @var $this yii\web\View */
$this->title = 'Федерация хоккея с шайбой ХМАО-Югры, официальный сайт';
?>

<?= frontend\widgets\NewsBlock::widget() ?>
<?= frontend\widgets\PlayerBlock::widget() ?>
<?= frontend\widgets\PhotoVideoBlock::widget() ?>


text:
@interface NotSameWrapper ()

// Private interface goes here.

@end

@implementation NotSameWrapper

// Custom logic goes here.

@end


text:
package org.pentaho.big.data.kettle.plugins.sqoop.util;

import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

import java.lang.reflect.Method;

/**
 * @author nhudak
 */
public class MockitoAutoBean<T> implements Answer<T> {
  private T value;

  public MockitoAutoBean() {
  }

  public MockitoAutoBean( T value ) {
    this();
    this.value = value;
  }

  @SuppressWarnings( "unchecked" )
  @Override public T answer( InvocationOnMock invocation ) throws Throwable {
    Method method = invocation.getMethod();
    if ( method.getParameterTypes().length == 1 ) {
      value = (T) invocation.getArguments()[0];
    }
    return value;
  }

  public T getValue() {
    return value;
  }

  public void setValue( T value ) {
    this.value = value;
  }
}


text:
package com.orientechnologies.orient.core.db.tool;

import static com.orientechnologies.orient.core.record.impl.ODocumentHelper.makeDbCall;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import com.orientechnologies.orient.core.Orient;
import com.orientechnologies.orient.core.command.OCommandOutputListener;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.id.ORecordId;
import com.orientechnologies.orient.core.index.OIndex;
import com.orientechnologies.orient.core.index.OIndexManager;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.record.impl.ODocumentHelper;
import com.orientechnologies.orient.core.record.impl.ODocumentHelper.ODbRelatedCall;
import com.orientechnologies.orient.core.record.impl.ORecordFlat;
import com.orientechnologies.orient.core.storage.ORawBuffer;
import com.orientechnologies.orient.core.storage.OStorage;

public class ODatabaseCompare extends ODatabaseImpExpAbstract {
  private OStorage            storage1;
  private OStorage            storage2;

  private ODatabaseDocumentTx databaseDocumentTxOne;
  private ODatabaseDocumentTx databaseDocumentTxTwo;

  private boolean             compareEntriesForAutomaticIndexes = false;

  private int                 differences                       = 0;

  public ODatabaseCompare(String iDb1URL, String iDb2URL, final OCommandOutputListener iListener) throws IOException {
    super(null, null, iListener);

    listener.onMessage("\nComparing two local databases:\n1) " + iDb1URL + "\n2) " + iDb2URL + "\n");

    storage1 = Orient.instance().loadStorage(iDb1URL);
    storage1.open(null, null, null);

    storage2 = Orient.instance().loadStorage(iDb2URL);
    storage2.open(null, null, null);
  }

  public ODatabaseCompare(String iDb1URL, String iDb2URL, final String userName, final String userPassword,
      final OCommandOutputListener iListener) throws IOException {
    super(null, null, iListener);

    listener.onMessage("\nComparing two local databases:\n1) " + iDb1URL + "\n2) " + iDb2URL + "\n");

    databaseDocumentTxOne = new ODatabaseDocumentTx(iDb1URL);
    databaseDocumentTxOne.open(userName, userPassword);

    databaseDocumentTxTwo = new ODatabaseDocumentTx(iDb2URL);
    databaseDocumentTxTwo.open(userName, userPassword);

    storage1 = databaseDocumentTxOne.getStorage();

    storage2 = databaseDocumentTxTwo.getStorage();

    // exclude automatically generated clusters
    excludeClusters.add("orids");
    excludeClusters.add("index");
    excludeClusters.add("manindex");
  }

  public boolean isCompareEntriesForAutomaticIndexes() {
    return compareEntriesForAutomaticIndexes;
  }

  public void setCompareEntriesForAutomaticIndexes(boolean compareEntriesForAutomaticIndexes) {
    this.compareEntriesForAutomaticIndexes = compareEntriesForAutomaticIndexes;
  }

  public boolean compare() {
    if (isDocumentDatabases() && (databaseDocumentTxOne == null || databaseDocumentTxTwo == null)) {
      listener.onMessage("\nPassed in URLs are related to document databases but credentials "
          + "were not provided to open them. Please provide user name + password for databases to compare");
      return false;
    }

    if (!isDocumentDatabases() && (databaseDocumentTxOne != null || databaseDocumentTxTwo != null)) {
      listener.onMessage("\nPassed in URLs are not related to document databases but credentials "
          + "were provided to open them. Please do not provide user name + password for databases to compare");
      return false;
    }

    try {
      compareClusters();
      compareRecords();

      if (isDocumentDatabases())
        compareIndexes();

      if (differences == 0) {
        listener.onMessage("\n\nDatabases match.");
        return true;
      } else {
        listener.onMessage("\n\nDatabases do not match. Found " + differences + " difference(s).");
        return false;
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new ODatabaseExportException("Error on compare of database '" + storage1.getName() + "' against '" + storage2.getName()
          + "'", e);
    } finally {
      storage1.close();
      storage2.close();
    }
  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private void compareIndexes() {
    listener.onMessage("\nStarting index comparison:");

    boolean ok = true;

    final OIndexManager indexManagerOne = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<OIndexManager>() {
      public OIndexManager call() {
        return databaseDocumentTxOne.getMetadata().getIndexManager();
      }
    });

    final OIndexManager indexManagerTwo = makeDbCall(databaseDocumentTxTwo, new ODbRelatedCall<OIndexManager>() {
      public OIndexManager call() {
        return databaseDocumentTxTwo.getMetadata().getIndexManager();
      }
    });

    final Collection<? extends OIndex<?>> indexesOne = makeDbCall(databaseDocumentTxOne,
        new ODbRelatedCall<Collection<? extends OIndex<?>>>() {
          public Collection<? extends OIndex<?>> call() {
            return indexManagerOne.getIndexes();
          }
        });

    final int indexesSizeOne = makeDbCall(databaseDocumentTxTwo, new ODbRelatedCall<Integer>() {
      public Integer call() {
        return indexesOne.size();
      }
    });

    final int indexesSizeTwo = makeDbCall(databaseDocumentTxTwo, new ODbRelatedCall<Integer>() {
      public Integer call() {
        return indexManagerTwo.getIndexes().size();
      }
    });

    if (indexesSizeOne != indexesSizeTwo) {
      ok = false;
      listener.onMessage("\n- ERR: Amount of indexes are different.");
      listener.onMessage("\n--- DB1: " + indexesSizeOne);
      listener.onMessage("\n--- DB2: " + indexesSizeTwo);
      listener.onMessage("\n");
      ++differences;
    }

    final Iterator<? extends OIndex<?>> iteratorOne = makeDbCall(databaseDocumentTxOne,
        new ODbRelatedCall<Iterator<? extends OIndex<?>>>() {
          public Iterator<? extends OIndex<?>> call() {
            return indexesOne.iterator();
          }
        });

    while (makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Boolean>() {
      public Boolean call() {
        return iteratorOne.hasNext();
      }
    })) {
      final OIndex indexOne = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<OIndex<?>>() {
        public OIndex<?> call() {
          return iteratorOne.next();
        }
      });

      final OIndex<?> indexTwo = makeDbCall(databaseDocumentTxTwo, new ODbRelatedCall<OIndex<?>>() {
        public OIndex<?> call() {
          return indexManagerTwo.getIndex(indexOne.getName());
        }
      });

      if (indexTwo == null) {
        ok = false;
        listener.onMessage("\n- ERR: Index " + indexOne.getName() + " is absent in DB2.");
        ++differences;
        continue;
      }

      if (!indexOne.getType().equals(indexTwo.getType())) {
        ok = false;
        listener.onMessage("\n- ERR: Index types for index " + indexOne.getName() + " are different.");
        listener.onMessage("\n--- DB1: " + indexOne.getType());
        listener.onMessage("\n--- DB2: " + indexTwo.getType());
        listener.onMessage("\n");
        ++differences;
        continue;
      }

      if (!indexOne.getClusters().equals(indexTwo.getClusters())) {
        ok = false;
        listener.onMessage("\n- ERR: Clusters to index for index " + indexOne.getName() + " are different.");
        listener.onMessage("\n--- DB1: " + indexOne.getClusters());
        listener.onMessage("\n--- DB2: " + indexTwo.getClusters());
        listener.onMessage("\n");
        ++differences;
        continue;
      }

      if (indexOne.getDefinition() == null && indexTwo.getDefinition() != null) {
        ok = false;
        listener.onMessage("\n- ERR: Index definition for index " + indexOne.getName() + " for DB2 is not null.");
        ++differences;
        continue;
      } else if (indexOne.getDefinition() != null && indexTwo.getDefinition() == null) {
        ok = false;
        listener.onMessage("\n- ERR: Index definition for index " + indexOne.getName() + " for DB2 is null.");
        ++differences;
        continue;
      } else if (indexOne.getDefinition() != null && !indexOne.getDefinition().equals(indexTwo.getDefinition())) {
        ok = false;
        listener.onMessage("\n- ERR: Index definitions for index " + indexOne.getName() + " are different.");
        listener.onMessage("\n--- DB1: " + indexOne.getDefinition());
        listener.onMessage("\n--- DB2: " + indexTwo.getDefinition());
        listener.onMessage("\n");
        ++differences;
        continue;
      }

      final long indexOneSize = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Long>() {
        public Long call() {
          return indexOne.getSize();
        }
      });

      final long indexTwoSize = makeDbCall(databaseDocumentTxTwo, new ODbRelatedCall<Long>() {
        public Long call() {
          return indexTwo.getSize();
        }
      });

      if (indexOneSize != indexTwoSize) {
        ok = false;
        listener.onMessage("\n- ERR: Amount of entries for index " + indexOne.getName() + " are different.");
        listener.onMessage("\n--- DB1: " + indexOneSize);
        listener.onMessage("\n--- DB2: " + indexTwoSize);
        listener.onMessage("\n");
        ++differences;
      }

      if (((compareEntriesForAutomaticIndexes && !indexOne.getType().equals("DICTIONARY")) || !indexOne.isAutomatic())) {
        final Iterator<Map.Entry<Object, Object>> indexIteratorOne = makeDbCall(databaseDocumentTxOne,
            new ODbRelatedCall<Iterator<Map.Entry<Object, Object>>>() {
              public Iterator<Map.Entry<Object, Object>> call() {
                return indexOne.iterator();
              }
            });

        while (makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Boolean>() {
          public Boolean call() {
            return indexIteratorOne.hasNext();
          }
        })) {
          final Map.Entry<Object, Object> indexOneEntry = makeDbCall(databaseDocumentTxOne,
              new ODbRelatedCall<Map.Entry<Object, Object>>() {
                public Map.Entry<Object, Object> call() {
                  return indexIteratorOne.next();
                }
              });

          final Object key = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Object>() {
            public Object call() {
              return indexOneEntry.getKey();
            }
          });

          final Object indexOneValue = makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<Object>() {
            public Object call() {
              return indexOneEntry.getValue();
            }
          });

          final Object indexTwoValue = makeDbCall(databaseDocumentTxTwo, new ODbRelatedCall<Object>() {
            public Object call() {
              return indexTwo.get(key);
            }
          });

          if (indexTwoValue == null) {
            ok = false;
            listener.onMessage("\n- ERR: Entry with key " + key + " is absent in index " + indexOne.getName() + " for DB2.");
            ++differences;
            continue;
          }

          if (indexOneValue instanceof Set && indexTwoValue instanceof Set) {
            final Set<Object> indexOneValueSet = (Set<Object>) indexOneValue;
            final Set<Object> indexTwoValueSet = (Set<Object>) indexTwoValue;

            if (!ODocumentHelper.compareSets(databaseDocumentTxOne, indexOneValueSet, databaseDocumentTxTwo, indexTwoValueSet)) {
              ok = false;
              reportIndexDiff(indexOne, key, indexOneValue, indexTwoValue);
            }
          } else if (!indexOneValue.equals(indexTwoValue)) {
            ok = false;
            reportIndexDiff(indexOne, key, indexOneValue, indexTwoValue);
          }
        }
      }
    }

    if (ok)
      listener.onMessage("OK");
  }

  private boolean compareClusters() {
    listener.onMessage("\nStarting shallow comparison of clusters:");

    listener.onMessage("\nChecking the number of clusters...");

    if (storage1.getClusterNames().size() != storage1.getClusterNames().size()) {
      listener.onMessage("ERR: cluster sizes are different: " + storage1.getClusterNames().size() + " <-> "
          + storage1.getClusterNames().size());
      ++differences;
    }

    int cluster2Id;
    boolean ok;

    for (String clusterName : storage1.getClusterNames()) {
      // CHECK IF THE CLUSTER IS INCLUDED
      if (includeClusters != null) {
        if (!includeClusters.contains(clusterName))
          continue;
      } else if (excludeClusters != null) {
        if (excludeClusters.contains(clusterName))
          continue;
      }

      ok = true;
      cluster2Id = storage2.getClusterIdByName(clusterName);

      listener.onMessage("\n- Checking cluster " + String.format("%-25s: ", "'" + clusterName + "'"));

      if (cluster2Id == -1) {
        listener.onMessage("ERR: cluster name " + clusterName + " was not found on database " + storage2);
        ++differences;
        ok = false;
      }

      if (cluster2Id != storage1.getClusterIdByName(clusterName)) {
        listener.onMessage("ERR: cluster id is different for cluster " + clusterName + ": "
            + storage1.getClusterIdByName(clusterName) + " <-> " + cluster2Id);
        ++differences;
        ok = false;
      }

      if (storage1.count(cluster2Id) != storage2.count(cluster2Id)) {
        listener.onMessage("ERR: number of records different in cluster '" + clusterName + "' (id=" + cluster2Id + "): "
            + storage1.count(cluster2Id) + " <-> " + storage2.count(cluster2Id));
        ++differences;
        ok = false;
      }

      if (ok)
        listener.onMessage("OK");
    }

    listener.onMessage("\n\nShallow analysis done.");
    return true;
  }

  private boolean compareRecords() {
    listener.onMessage("\nStarting deep comparison record by record. This may take a few minutes. Wait please...");

    int clusterId;

    for (String clusterName : storage1.getClusterNames()) {
      // CHECK IF THE CLUSTER IS INCLUDED
      if (includeClusters != null) {
        if (!includeClusters.contains(clusterName))
          continue;
      } else if (excludeClusters != null) {
        if (excludeClusters.contains(clusterName))
          continue;
      }

      clusterId = storage1.getClusterIdByName(clusterName);

      final long db1Max = storage1.getClusterDataRange(clusterId)[1];
      final long db2Max = storage2.getClusterDataRange(clusterId)[1];

      final ODocument doc1 = new ODocument();
      final ODocument doc2 = new ODocument();

      final ORecordId rid = new ORecordId(clusterId);

      final long clusterMax = Math.max(db1Max, db2Max);
      final OStorage storage;

      if (clusterMax == db1Max)
        storage = storage1;
      else
        storage = storage2;

      for (int i = 0; i <= clusterMax; ++i) {
        final long[] positions = storage.getClusterPositionsForEntry(clusterId, i);

        for (long position : positions) {
          rid.clusterPosition = position;

          if (isDocumentDatabases() && rid.equals(new ORecordId(storage1.getConfiguration().indexMgrRecordId))
              && rid.equals(new ORecordId(storage2.getConfiguration().indexMgrRecordId)))
            continue;

          final ORawBuffer buffer1 = storage1.readRecord(rid, null, true, null);
          final ORawBuffer buffer2 = storage2.readRecord(rid, null, true, null);

          if (buffer1 == null && buffer2 == null)
            // BOTH RECORD NULL, OK
            continue;
          else if (buffer1 == null && buffer2 != null) {
            // REC1 NULL
            listener.onMessage("\n- ERR: RID=" + clusterId + ":" + position + " is null in DB1");
            ++differences;
          } else if (buffer1 != null && buffer2 == null) {
            // REC2 NULL
            listener.onMessage("\n- ERR: RID=" + clusterId + ":" + position + " is null in DB2");
            ++differences;
          } else {
            if (buffer1.recordType != buffer2.recordType) {
              listener.onMessage("\n- ERR: RID=" + clusterId + ":" + position + " recordType is different: "
                  + (char) buffer1.recordType + " <-> " + (char) buffer2.recordType);
              ++differences;
            }

            if (buffer1.buffer == null && buffer2.buffer == null) {
            } else if (buffer1.buffer == null && buffer2.buffer != null) {
              listener.onMessage("\n- ERR: RID=" + clusterId + ":" + position + " content is different: null <-> "
											+ buffer2.buffer.length);
              ++differences;

            } else if (buffer1.buffer != null && buffer2.buffer == null) {
              listener.onMessage("\n- ERR: RID=" + clusterId + ":" + position + " content is different: " + buffer1.buffer.length
                  + " <-> null");
              ++differences;

            } else {
              if (buffer1.recordType == ODocument.RECORD_TYPE) {
                // DOCUMENT: TRY TO INSTANTIATE AND COMPARE

                makeDbCall(databaseDocumentTxOne, new ODocumentHelper.ODbRelatedCall<Object>() {
                  public Object call() {
                    doc1.reset();
                    doc1.fromStream(buffer1.buffer);
                    return null;
                  }
                });

                makeDbCall(databaseDocumentTxTwo, new ODocumentHelper.ODbRelatedCall<Object>() {
                  public Object call() {
                    doc2.reset();
                    doc2.fromStream(buffer2.buffer);
                    return null;
                  }
                });

                if (rid.toString().equals(storage1.getConfiguration().schemaRecordId)
                    && rid.toString().equals(storage2.getConfiguration().schemaRecordId)) {
                  makeDbCall(databaseDocumentTxOne, new ODocumentHelper.ODbRelatedCall<java.lang.Object>() {
                    public Object call() {
                      convertSchemaDoc(doc1);
                      return null;
                    }
                  });

                  makeDbCall(databaseDocumentTxTwo, new ODocumentHelper.ODbRelatedCall<java.lang.Object>() {
                    public Object call() {
                      convertSchemaDoc(doc2);
                      return null;
                    }
                  });
                }

                if (!ODocumentHelper.hasSameContentOf(doc1, databaseDocumentTxOne, doc2, databaseDocumentTxTwo)) {
                  listener.onMessage("\n- ERR: RID=" + clusterId + ":" + position + " document content is different");
                  listener.onMessage("\n--- REC1: " + new String(buffer1.buffer));
                  listener.onMessage("\n--- REC2: " + new String(buffer2.buffer));
                  listener.onMessage("\n");
                  ++differences;
                }
              } else {
                if (buffer1.buffer.length != buffer2.buffer.length) {
                  // CHECK IF THE TRIMMED SIZE IS THE SAME
                  final String rec1 = new String(buffer1.buffer).trim();
                  final String rec2 = new String(buffer2.buffer).trim();

                  if (rec1.length() != rec2.length()) {
                    listener.onMessage("\n- ERR: RID=" + clusterId + ":" + position + " content length is different: "
                        + buffer1.buffer.length + " <-> " + buffer2.buffer.length);

                    if (buffer1.recordType == ODocument.RECORD_TYPE || buffer1.recordType == ORecordFlat.RECORD_TYPE)
                      listener.onMessage("\n--- REC1: " + rec1);
                    if (buffer2.recordType == ODocument.RECORD_TYPE || buffer2.recordType == ORecordFlat.RECORD_TYPE)
                      listener.onMessage("\n--- REC2: " + rec2);
                    listener.onMessage("\n");

                    ++differences;
                  }
                } else {
                  // CHECK BYTE PER BYTE
                  for (int b = 0; b < buffer1.buffer.length; ++b) {
                    if (buffer1.buffer[b] != buffer2.buffer[b]) {
                      listener.onMessage("\n- ERR: RID=" + clusterId + ":" + position + " content is different at byte #" + b
                          + ": " + buffer1.buffer[b] + " <-> " + buffer2.buffer[b]);
                      listener.onMessage("\n--- REC1: " + new String(buffer1.buffer));
                      listener.onMessage("\n--- REC2: " + new String(buffer2.buffer));
                      listener.onMessage("\n");
                      ++differences;
                      break;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }

    return true;
  }

  private void convertSchemaDoc(final ODocument document) {
    if (document.field("classes") != null) {
      document.setFieldType("classes", OType.EMBEDDEDSET);
      for (ODocument classDoc : document.<Set<ODocument>> field("classes")) {
        classDoc.setFieldType("properties", OType.EMBEDDEDSET);
      }
    }
  }

  private boolean isDocumentDatabases() {
    return storage1.getConfiguration().schemaRecordId != null && storage2.getConfiguration().schemaRecordId != null;
  }

  private void reportIndexDiff(OIndex<?> indexOne, Object key, final Object indexOneValue, final Object indexTwoValue) {
    listener.onMessage("\n- ERR: Entry values for key '" + key + "' are different for index " + indexOne.getName());
    listener.onMessage("\n--- DB1: " + makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<String>() {
      public String call() {
        return indexOneValue.toString();
      }
    }));
    listener.onMessage("\n--- DB2: " + makeDbCall(databaseDocumentTxOne, new ODbRelatedCall<String>() {
      public String call() {
        return indexTwoValue.toString();
      }
    }));
    listener.onMessage("\n");
    ++differences;
  }
}


text:
package org.embulk.filter.timestamp_format.cast;

import org.embulk.filter.timestamp_format.TimestampFormatter;
import org.embulk.filter.timestamp_format.TimestampUnit;
import org.embulk.spi.DataException;
import org.embulk.spi.time.Timestamp;

public class DoubleCast
{
    private DoubleCast() {}

    public static String asString(double value, TimestampUnit fromUnit, TimestampFormatter formatter) throws DataException
    {
        Timestamp timestamp = TimestampUnit.toTimestamp(value, fromUnit);
        return formatter.format(timestamp);
    }

    public static Timestamp asTimestamp(double value, TimestampUnit fromUnit) throws DataException
    {
        return TimestampUnit.toTimestamp(value, fromUnit);
    }

    public static long asLong(double value, TimestampUnit fromUnit, TimestampUnit toUnit) throws DataException
    {
        return (long) TimestampUnit.changeUnit(value, fromUnit, toUnit);
    }

    public static double asDouble(double value, TimestampUnit fromUnit, TimestampUnit toUnit) throws DataException
    {
        return TimestampUnit.changeUnit(value, fromUnit, toUnit);
    }
}


text:
namespace FurryRun.Core.Enums
{
    public enum Platform
    {
        Mobile,
        PC
    }
}


text:
<?php

Route::group(['prefix' => config('cms.uri')], function() {

    Route::resource('users', 'Admin\IndexController');
});

/*Auth route*/
Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('user.register')->middleware(['breadcrumbs','page']);
Route::post('register', 'Auth\RegisterController@register')->name('user.register.post');
Route::get('register/confirm/{token}', 'Auth\RegisterController@confirmEmail')->name('user.confirm')->middleware(['breadcrumbs','page']);

Route::get('login', 'Auth\LoginController@showLoginForm')->name('user.login')->middleware(['breadcrumbs','page']);
Route::post('login', 'Auth\LoginController@login');
Route::get('logout', 'Auth\LoginController@logout')->name('user.logout');

Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('user.reset')->middleware(['breadcrumbs','page']);
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('user.sendPassword');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->middleware(['breadcrumbs','page']);
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');


text:
#region Copyright Notice
/*
 * AlphaVSS Sample Code
 * Written by Jay Miller
 *
 * This code is hereby released into the public domain, This applies
 * worldwide.
 */
#endregion

using System;
using System.Diagnostics;
using System.Collections.Generic;
using Alphaleonis.Win32.Vss;
using Alphaleonis.Win32.Filesystem;

namespace VssSample
{
   ///
   /// This class encapsulates some simple VSS logic.  Its goal is to allow
   /// a user to backup a single file from a shadow copy (presumably because
   /// that file is otherwise unavailable on its home volume).
   ///
   /// <example>
   /// This code creates a shadow copy and copies a single file from
   /// the new snapshot to a location on the D drive.  Here we're
   /// using the AlphaFS library to make a full-file copy of the file.
   ///
   /// string source_file = @"C:\Windows\system32\config\sam";
   /// string backup_root = @"D:\Backups";
   /// string backup_path = Path.Combine(backup_root,
   ///       Path.GetFilename(source_file));
   ///
   /// // Initialize the shadow copy subsystem.
   /// using (VssBackup vss = new VssBackup())
   /// {
   ///    vss.Setup(Path.GetPathRoot(source_file));
   ///    string snap_path = vss.GetSnapshotPath(source_file);
   ///
   ///    // Here we use the AlphaFS library to make the copy.
   ///    Alphaleonis.Win32.Filesystem.File.Copy(snap_path, backup_path);
   /// }
   ///
   /// This code creates a shadow copy and opens a stream over a file
   /// on the new snapshot volume.
   ///
   /// string source_file = @"C:\Windows\system32\config\sam";
   ///
   /// // Initialize the shadow copy subsystem.
   /// using (VssBackup vss = new VssBackup())
   /// {
   ///    vss.Setup(Path.GetPathRoot(filename));
   ///
   ///    // We can now access the shadow copy by either retrieving a stream:
   ///    using (Stream s = vss.GetStream(filename))
   ///    {
   ///       Debug.Assert(s.CanRead == true);
   ///       Debug.Assert(s.CanWrite == false);
   ///    }
   /// }
   ///
   /// </example>
   public class VssBackup : IDisposable
   {
      ///
      /// Setting this flag to true will enable 'component mode', which
      /// does not, in this example, do much of any substance.
      ///
      /// <remarks>
      /// VSS has the ability to selectively disable VSS-compatible
      /// components according to the specifics of the current backup.  One
      /// might, for example, only quiesce Outlook if only the Outlook PST
      /// file is intended to be backed up.  The ExamineComponents() method
      /// provides a framework for this sort of mode if you're interested.
      /// Otherwise, this example code quiesces all VSS-compatible components
      /// before making its shadow copy.
      /// </remarks>
      bool ComponentMode = false;

      /// A reference to the VSS context.
      IVssBackupComponents _backup;

      /// Some persistent context for the current snapshot.
      Snapshot _snap;

      ///
      /// Constructs a VssBackup object and initializes some of the necessary
      /// VSS structures.
      ///
      public VssBackup()
      {
         InitializeBackup();
      }

      ///
      /// Sets up a shadow copy against the specified volume.
      ///
      /// <remarks>
      /// This methods is separated out from the constructor because if it
      /// throws, we still want the Dispose() method to be called.
      /// </remarks>
      /// <param name="volumeName">Name of the volume to copy.</param>
      public void Setup(string volumeName)
      {
         Discovery(volumeName);
         PreBackup();
      }

      ///
      /// The disposal of this object involves sending completion notices
      /// to the writers, removing the shadow copies from the system and
      /// finally releasing the BackupComponents object.  This method must
      /// be called when this class is no longer used.
      ///
      public void Dispose()
      {
         try { Complete(true); } catch { }

         if (_snap != null)
         {
            _snap.Dispose();
            _snap = null;
         }

         if (_backup != null)
         {
            _backup.Dispose();
            _backup = null;
         }
      }

      ///
      /// This stage initializes both the requester (this program) and
      /// any writers on the system in preparation for a backup and sets
      /// up a communcation channel between the two.
      ///
      void InitializeBackup()
      {
         // Here we are retrieving an OS-dependent object that encapsulates
         // all of the VSS functionality.  The OS indepdence that this single
         // factory method provides is one of AlphaVSS's major strengths!
         IVssImplementation vss = VssUtils.LoadImplementation();

         // Now we create a BackupComponents object to manage the backup.
         // This object will have a one-to-one relationship with its backup
         // and must be cleaned up when the backup finishes (ie. it cannot
         // be reused).
         //
         // Note that this object is a member of our class, as it needs to
         // stick around for the full backup.
         _backup = vss.CreateVssBackupComponents();

         // Now we must initialize the components.  We can either start a
         // fresh backup by passing null here, or we could resume a previous
         // backup operation through an earlier use of the SaveXML method.
         _backup.InitializeForBackup(null);

         // At this point, we're supposed to establish communication with
         // the writers on the system.  It is possible before this step to
         // enable or disable specific writers via the BackupComponents'
         // Enable* and Disable* methods.
         //
         // Note the 'using' construct here to dispose of the asynchronous
         // comm link once we no longer need it.
         using (IVssAsync async = _backup.GatherWriterMetadata())
         {
            // Because allowing writers to prepare their metadata can take
            // a while, we are given a VssAsync object that gives us some
            // status on the background operation.  In this case, we just
            // wait for it to finish.
            async.Wait();
         }
      }

      ///
      /// This stage involes the requester (us, again) processing the
      /// information it received from writers on the system to find out
      /// which volumes - if any - must be shadow copied to perform a full
      /// backup.
      ///
      void Discovery(string fullPath)
      {
         if (ComponentMode)
            // In component mode, we would need to enumerate through each
            // component and decide whether it should be added to our
            // backup document.
            ExamineComponents(fullPath);
         else
            // Once we are finished with the writer metadata, we can dispose
            // of it.  If we were in component mode, we would want to keep it
            // around so that we could notify the writers of our success or
            // failure when we finish the backup.
            _backup.FreeWriterMetadata();

         // Now we use our helper class to add the appropriate volume to the
         // shadow copy set.
         _snap = new Snapshot(_backup);
         _snap.AddVolume(Path.GetPathRoot(fullPath));
      }

      ///
      /// This method is optional in this implementation, and in fact does
      /// nothing of substance.  It does demonstrate how one might parse
      /// through the various writers on the system and add them to the
      /// backup document if necessary.
      ///
      /// <param name="fullPath">The full path of the file to back up.</param>
      void ExamineComponents(string fullPath)
      {
         // At this point it is the requester's duty to examine what the
         // writers have prepared for us.  The WriterMetadata property
         // (in place of the C API's 'GetWriterMetadata' function) collects
         // metadata from each writer behind a list interface.
         IList<IVssExamineWriterMetadata> writer_mds = _backup.WriterMetadata;

         // If you receive a "bad state" error when enumerating, you might
         // have a registry inconsistency from a program that improperly
         // uninstalled itself.  If your event log is showing an error like,
         // "ContentIndexingService called routine RegQueryValueExW which
         // failed," you'll want to read Microsoft's KB article #907574.
         foreach (IVssExamineWriterMetadata metadata in writer_mds)
         {
            // We can see the name of the writer, if we like.
            Trace.WriteLine("Examining metadata for " + metadata.WriterName);

            // The important bit of the writers' metadata is the list of
            // components each writer is broken into.  These components are
            // responsible for some number of files, so going through this
            // data allows us to construct an initial list of files for our
            // shadow copies.
            foreach (IVssWMComponent cmp in metadata.Components)
            {
               // Print out some info for each component.
               Trace.WriteLine("  Component: " + cmp.ComponentName);
               Trace.WriteLine("  Component info: " + cmp.Caption);

               // If a component is available for backup, it's then up to us to
               // decide whether it is relevant to the current backup.  To do
               // this, we may examine the files each component manages.
               foreach (VssWMFileDescription file in cmp.Files)
               {
                  // The idea here is to find out whether these files are
                  // relevant to whatever purpose your application holds.  If
                  // they are, you should a) add this component to your backup
                  // set so VSS involves it in the shadow copy operation, and
                  // b) record the files' volume names so you know later which
                  // volumes need to be shadow copied.

                  // I'm not worried about that stuff for this example, though,
                  // so instead I'm printing out the stuff you might need to
                  // examine if you have requirements of that sort.
                  Trace.WriteLine("    Path: " + file.Path);
                  Trace.WriteLine("       Spec: " + file.FileSpecification);

                  // Here we might insert some logic to:
                  //
                  //  1. Check whether the AlternateLocation property is valid.
                  //  2. Expand environment vairables in either Path.or
                  //     AlternateLocation, as appropriate.
                  //  3. Considering the FileSpecification and the IsRecursive
                  //     properties, decide whether this component manages
                  //     the file(s) you wish to backup (in this case, the
                  //     fullPath argument).
                  //
                  // If this component is relevant, add it with AddComponent().

                  // (The FileToPathSpecification method below might help with
                  // some of these steps.)
               }
            }
         }
      }

      ///
      /// This phase of the backup is focused around creating the shadow copy.
      /// We will notify writers of the impending snapshot, after which they
      /// have a short period of time to get their on-disk data in order and
      /// then quiesce writing.
      ///
      void PreBackup()
      {
         Debug.Assert(_snap != null);

         // This next bit is a way to tell writers just what sort of backup
         // they should be preparing for.  The important parts for us now
         // are the first and third arguments: we want to do a full,
         // backup and, depending on whether we are in component mode, either
         // a full-volume backup or a backup that only requires specific
         // components.
         _backup.SetBackupState(ComponentMode,
               true, VssBackupType.Full, false);

         // From here we just need to send messages to each writer that our
         // snapshot is imminent,
         using (IVssAsync async = _backup.PrepareForBackup())
         {
            // As before, the 'using' statement automatically disposes of
            // our comm link.  Also as before, we simply block while the
            // writers to complete their background preparations.
            async.Wait();
         }

         // It's now time to create the snapshot.  Each writer will have to
         // freeze its I/O to the selected volumes for up to 10 seconds
         // while this process takes place.
         _snap.Copy();
      }

      ///
      /// This simple method uses a bit of string manipulation to turn a
      /// full, local path into its corresponding snapshot path.  This
      /// method may help users perform full file copies from the snapsnot.
      ///
      /// <remarks>
      /// Note that the System.IO methods are not able to access files on
      /// the snapshot.  Instead, you will need to use the AlphaFS library
      /// as shown in the example.
      /// </remarks>
      /// <example>
      /// This code creates a shadow copy and copies a single file from
      /// the new snapshot to a location on the D drive.  Here we're
      /// using the AlphaFS library to make a full-file copy of the file.
      ///
      /// string source_file = @"C:\Windows\system32\config\sam";
      /// string backup_root = @"D:\Backups";
      /// string backup_path = Path.Combine(backup_root,
      ///       Path.GetFilename(source_file));
      ///
      /// // Initialize the shadow copy subsystem.
      /// using (VssBackup vss = new VssBackup())
      /// {
      ///    vss.Setup(Path.GetPathRoot(source_file));
      ///    string snap_path = vss.GetSnapshotPath(source_file);
      ///
      ///    // Here we use the AlphaFS library to make the copy.
      ///    Alphaleonis.Win32.Filesystem.File.Copy(snap_path, backup_path);
      /// }
      ///
      /// </example>
      /// <seealso cref="GetStream"/>
      /// <param name="localPath">The full path of the original file.</param>
      /// <returns>A full path to the same file on the snapshot.</returns>
      public string GetSnapshotPath(string localPath)
      {
         Trace.WriteLine("New volume: " + _snap.Root);

         // This bit replaces the file's normal root information with root
         // info from our new shadow copy.
         if (Path.IsPathRooted(localPath))
         {
            string root = Path.GetPathRoot(localPath);
            localPath = localPath.Replace(root, String.Empty);
         }
         string slash = Path.DirectorySeparatorChar.ToString();
         if (!_snap.Root.EndsWith(slash) && !localPath.StartsWith(slash))
            localPath = localPath.Insert(0, slash);
         localPath = localPath.Insert(0, _snap.Root);

         Trace.WriteLine("Converted path: " + localPath);

         return localPath;
      }

      ///
      /// This method opens a stream over the shadow copy of the specified
      /// file.
      ///
      /// <example>
      /// This code creates a shadow copy and opens a stream over a file
      /// on the new snapshot volume.
      ///
      /// string source_file = @"C:\Windows\system32\config\sam";
      ///
      /// // Initialize the shadow copy subsystem.
      /// using (VssBackup vss = new VssBackup())
      /// {
      ///    vss.Setup(Path.GetPathRoot(filename));
      ///
      ///    // We can now access the shadow copy by either retrieving a stream:
      ///    using (Stream s = vss.GetStream(filename))
      ///    {
      ///       Debug.Assert(s.CanRead == true);
      ///       Debug.Assert(s.CanWrite == false);
      ///    }
      /// }
      ///
      /// </example>
      public System.IO.Stream GetStream(string localPath)
      {
         // GetSnapshotPath() returns a very funky-looking path.  The
         // System.IO methods can't handle these sorts of paths, so instead
         // we're using AlphaFS, another excellent library by Alpha Leonis.
         // Note that we have no 'using System.IO' at the top of the file.
         // (The Stream it returns, however, is just a System.IO stream.)
         return File.OpenRead(GetSnapshotPath(localPath));
      }

      ///
      /// The final phase of the backup involves some cleanup steps.
      /// If we're in component mode, we're supposed to notify each of the
      /// writers of the outcome of the backup.  Once that's done, or if
      /// we're not in component mode, we send the BackupComplete event to
      /// all of the writers.
      ///
      /// <param name="succeeded">Success value for all of the writers.</param>
      void Complete(bool succeeded)
      {
         if (ComponentMode)
         {
            // As before, we iterate through all of the writers on the system.
            // A more efficient method might only iterate through those writers
            // that were actually involved in this backup.
            IList<IVssExamineWriterMetadata> writers = _backup.WriterMetadata;
            foreach (IVssExamineWriterMetadata metadata in writers)
            {
               foreach (IVssWMComponent component in metadata.Components)
               {
                  // The BackupSucceeded call should mirror the AddComponent
                  // call that was called during the discovery phase.
                  _backup.SetBackupSucceeded(
                        metadata.InstanceId, metadata.WriterId,
                        component.Type, component.LogicalPath,
                        component.ComponentName, succeeded);
               }
            }

            // Finally, we can dispose of the writer metadata.
            _backup.FreeWriterMetadata();
         }

         try
         {
            // The BackupComplete event must be sent to all of the writers.
            using (IVssAsync async = _backup.BackupComplete())
               async.Wait();
         }
         // Not sure why, but this throws a VSS_BAD_STATE on XP and W2K3.
         // Per some forum posts about this, I'm just ignoring it.
         catch (VssBadStateException) { }
      }

      ///
      /// This method takes the information in a file description and
      /// converts it to a full path specification - with wildcards.
      ///
      /// <remarks>
      /// Using the wildcard-to-regex library found at
      /// http://www.codeproject.com/KB/string/wildcmp.aspx on the
      /// output of this method might be very helpful.
      /// </remarks>
      /// <param name="file">Object describing a component's file.</param>
      /// <returns>
      /// Returns a full path, potentially including DOS wildcards.  Eg.
      /// 'c:\windows\config\*'.
      /// </returns>
      string FileToPathSpecification(VssWMFileDescription file)
      {
         // Environment variables (eg. "%windir%") are common.
         string path = Environment.ExpandEnvironmentVariables(file.Path);

         // Use the alternate location if it's present.
         if (!String.IsNullOrEmpty(file.AlternateLocation))
            path = Environment.ExpandEnvironmentVariables(
                  file.AlternateLocation);

         // Normalize wildcard usage.
         string spec = file.FileSpecification.Replace("*.*", "*");

         // Combine the file specification and the directory name.
         return Path.Combine(path, file.FileSpecification);
      }
   }
}


text:
package com.jaxio.celerio.model.support.jpa;

import com.jaxio.celerio.configuration.TrueFalse;
import com.jaxio.celerio.configuration.database.Table;
import com.jaxio.celerio.configuration.entity.CacheConfig;
import com.jaxio.celerio.configuration.entity.CacheConfigGetter;
import com.jaxio.celerio.configuration.entity.ColumnConfig;
import com.jaxio.celerio.model.Attribute;
import com.jaxio.celerio.model.Unique;
import com.jaxio.celerio.model.unique.CompositeUnique;
import com.jaxio.celerio.spi.support.AbstractEntitySpi;
import com.jaxio.celerio.util.AnnotationBuilder;
import com.jaxio.celerio.util.AttributeBuilder;
import org.springframework.util.Assert;

import java.util.List;
import java.util.Set;

import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Sets.newHashSet;
import static com.jaxio.celerio.configuration.database.support.SqlUtil.escapeSql;
import static javax.persistence.InheritanceType.JOINED;
import static javax.persistence.InheritanceType.SINGLE_TABLE;
import static org.apache.commons.lang.StringUtils.isNotBlank;

/**
 * Helper to write non trivial JPA annotations that may be applied to the generated entity class.
 * An annotation is considered non trivial when generating it would require an unreasonable
 * amount of velocity code in the template.
 */
public class JpaEntity extends AbstractEntitySpi {
    @Override
    public String velocityVar() {
        return "jpa";
    }

    @Override
    public Object getTarget() {
        return this;
    }

    public List<String> getAnnotations() {
        AnnotationBuilder ab = new AnnotationBuilder();
        ab.add(getEntityAnnotation());
        ab.add(getHibernateCacheAnnotation()); // TODO: move to cache entity spi ?
        ab.add(getTableAnnotation());
        ab.add(getInheritanceAnnotations());
        ab.add(getDiscriminatorColumnAnnotation());
        ab.add(getDiscriminatorValueAnnotation());
        ab.add(getSecondaryTableAnnotations());
        ab.add(getPrimaryKeyJoinColumnAnnotation());
        ab.add(getAttributeOverrideAnnotation());
        return ab.getAnnotations();
    }

    public String getAttributeOverrideAnnotation() {
        if (entity.isRoot() || !entity.hasParent() || !entity.getParent().is(JOINED)) {
            return "";
        }

        List<String> attributesOverrides = newArrayList();
        AttributeBuilder attributeBuilder = new AttributeBuilder();
        for (Attribute attribute : entity.getAttributes().getList()) {
            for (Attribute upAttribute : entity.getAttributes().getFlatAbove().getList()) {
                if (attribute.getColumnName().equalsIgnoreCase(upAttribute.getColumnName())) {
                    addImport("javax.persistence.AttributeOverride");
                    String attributeOverride = "@AttributeOverride(name = \"" + attribute.getVar() + "\", column = @Column(name=\""
                            + attribute.getColumnNameEscaped() + "\"))";
                    attributesOverrides.add(attributeOverride);
                    attributeBuilder.add(attributeOverride);
                }
            }
        }
        if (attributesOverrides.size() == 0) {
            return "";
        } else if (attributesOverrides.size() == 1) {
            return appendComment(attributesOverrides.iterator().next());
        } else {
            addImport("javax.persistence.AttributeOverrides");
            return appendComment("@AttributeOverrides({" + attributeBuilder.getAttributes() + "})");
        }
    }

    public String getPrimaryKeyJoinColumnAnnotation() {
        if (entity.isRoot() || !entity.hasInheritance() || !entity.getParent().is(JOINED)) {
            return "";
        }

        Table rootTable = entity.getRoot().getTable();
        Table entityTable = entity.getTable();

        Assert.isTrue(rootTable.getPrimaryKeys().size() == 1, "Composite PK are not supported with JOIN inheritance strategy");
        Assert.isTrue(entityTable.getPrimaryKeys().size() == 1, "Composite PK are not supported with JOIN inheritance strategy");

        String rootPkColumnName = rootTable.getPrimaryKeys().iterator().next();
        String entityPkColumnName = entityTable.getPrimaryKeys().iterator().next();

        if (!entityPkColumnName.equalsIgnoreCase(rootPkColumnName)) {
            return appendComment(getPrimaryKeyJoinColumnAnnotation(entityPkColumnName));
        }

        return "";
    }

    public String getSecondaryTableAnnotations() {
        Set<Table> secondaryTables = getSecondaryTables();
        if (secondaryTables.size() == 0) {
            return "";
        } else if (secondaryTables.size() == 1) {
            return appendComment(getSecondaryTableAnnotation(secondaryTables.iterator().next()));
        } else {
            addImport("javax.persistence.SecondaryTables");
            StringBuilder sb = new StringBuilder("@SecondaryTables({");
            boolean first = true;
            for (Table secondaryTable : secondaryTables) {
                if (first) {
                    first = false;
                } else {
                    sb.append(", ");
                }
                sb.append(getSecondaryTableAnnotation(secondaryTable));
            }
            sb.append("})");
            return appendComment(sb.toString());
        }
    }

    public String getDiscriminatorValueAnnotation() {
        if (!(entity.hasInheritance() && entity.getInheritance().hasDiscriminatorValue() && entity.is(SINGLE_TABLE))) {
            return "";
        }
        addImport("javax.persistence.DiscriminatorValue");
        return appendComment("@DiscriminatorValue(\"" + entity.getInheritance().getDiscriminatorValue() + "\")");
    }

    public String getInheritanceAnnotations() {
        if (!(entity.hasInheritance() && entity.isRoot())) {
            return "";
        }

        addImport("javax.persistence.Inheritance");
        if (entity.is(SINGLE_TABLE)) {
            return appendComment("@Inheritance");
        } else {
            addImport("javax.persistence.InheritanceType");
            return appendComment("@Inheritance(strategy = InheritanceType." + entity.getInheritance().getStrategy() + ")");
        }
    }

    public String getDiscriminatorColumnAnnotation() {
        if (!(entity.hasInheritance() && entity.isRoot())) {
            return "";
        }

        if (entity.getInheritance().hasDiscriminatorColumn()) {
            addImport("javax.persistence.DiscriminatorColumn");
            return appendComment("@DiscriminatorColumn(name = \"" + entity.getInheritance().getDiscriminatorColumn() + "\")");
        }

        return "";
    }

    private Set<Table> getSecondaryTables() {
        Set<Table> result = newHashSet();
        for (ColumnConfig cc : entity.getEntityConfig().getColumnConfigs()) {
            // skip ignored attributes
            if (cc.hasTrueIgnore()) {
                continue;
            }

            // skip same table
            if (entity.getTableName().equalsIgnoreCase(cc.getTableName())) {
                continue;
            }

            // keep different ones
            Table secondaryTable = entity.getConfig().getMetadata().getTableByName(cc.getTableName());
            result.add(secondaryTable);
        }

        return result;
    }

    private String getSecondaryTableAnnotation(Table secondaryTable) {
        Table table = entity.getTable();

        Assert.isTrue(table.getPrimaryKeys().size() == 1, "The table '" + table.getName() + "' is expected to have a one-column primary key. "
                + "It has instead " + table.getPrimaryKeys().size());

        Assert.isTrue(secondaryTable.getPrimaryKeys().size() == 1, "The secondary table '" + secondaryTable.getName()
                + "' is expected to have a one-column primary key. " + "It has instead " + secondaryTable.getPrimaryKeys().size());

        String pkColumnName = table.getPrimaryKeys().iterator().next();
        String secondaryPkColumnName = secondaryTable.getPrimaryKeys().iterator().next();

        addImport("javax.persistence.SecondaryTable");
        if (pkColumnName.equalsIgnoreCase(secondaryPkColumnName)) {
            return "@SecondaryTable(name = \"" + secondaryTable.getNameEscaped() + "\")";
        } else {
            return "@SecondaryTable(name = \"" + secondaryTable.getNameEscaped() + "\", " + "pkJoinColumns = "
                    + getPrimaryKeyJoinColumnAnnotation(secondaryPkColumnName) + ")";
        }
    }

    private String getPrimaryKeyJoinColumnAnnotation(String pkColumnName) {
        addImport("javax.persistence.PrimaryKeyJoinColumn");
        return "@PrimaryKeyJoinColumn(name = \"" + escapeSql(pkColumnName) + "\")";
    }

    public String getSelectAllNamedQuery() {
        return entity.getModel().getType() + ".selectAll";
    }

    public String getSelectAllNativeNamedQuery() {
        return entity.getModel().getType() + ".selectAll.native";
    }

    public String getHibernateCacheAnnotation() {
        if (!entity.isRoot()) {
            return "";
        }

        String cacheAnnotation = JpaConfigHelper.getCacheAnnotation(this, //
                entity.getEntityConfig(), //
                new CacheConfigGetter() {
                    @Override
                    public CacheConfig getCacheConfig() {
                        return entity.getConfig().getCelerio().getConfiguration().getDefaultEntityCacheConfig();
                    }
                });
        return appendComment(cacheAnnotation);
    }

    public String getEntityAnnotation() {
        addImport("javax.persistence.Entity");
        return appendComment("@Entity");
    }

    public String getTableAnnotation() {
        if (entity.isRoot() || (entity.hasInheritance() && entity.getParent().is(JOINED))) {
            StringBuffer annotation = new StringBuffer("");
            appendAttribute(annotation, getCatalog());
            appendAttribute(annotation, getSchema());
            appendAttribute(annotation, getName());
            appendAttribute(annotation, getUniqueConstraints());
            addImport("javax.persistence.Table");
            return appendComment("@Table(" + annotation + ")");
        }
        return "";
    }

    private String getCatalog() {
        if (entity.getConfig().getCelerio().getConfiguration().getJpaUseCatalog() == TrueFalse.TRUE) {
            String catalog = entity.getEntityConfig().getCatalog();
            return isNotBlank(catalog) ? "catalog = \"" + catalog + "\"" : "";
        }
        return "";
    }

    private String getSchema() {
        if (entity.getConfig().getCelerio().getConfiguration().getJpaUseSchema() == TrueFalse.TRUE) {
            String schema = entity.getEntityConfig().getSchemaName();
            return isNotBlank(schema) && !schema.contains("%") ? "schema = \"" + schema + "\"" : "";
        }
        return "";
    }

    private String getName() {
        return "name = \"" + escapeSql(entity.getTableName()) + "\"";
    }

    private String getUniqueConstraints() {
        List<String> constraints = getTableUniqueConstraints();

        if (constraints.isEmpty()) {
            return "";
        } else {
            String constraintsAsString = "uniqueConstraints = {";
            boolean first = true;
            for (String constraint : constraints) {
                if (!first) {
                    constraintsAsString += ", ";
                } else {
                    first = false;
                }
                constraintsAsString += constraint;
            }
            constraintsAsString += "}";
            return constraintsAsString;
        }
    }

    private List<String> getTableUniqueConstraints() {
        List<String> result = newArrayList();
        for (Unique unique : entity.getCompositeUniques().getList()) {
            result.add(buildConstraint((CompositeUnique) unique));
        }
        return result;
    }

    private String buildConstraint(CompositeUnique compositeUnique) {
        addImport("javax.persistence.UniqueConstraint");
        String ret = "@UniqueConstraint(";
        if (isNotBlank(compositeUnique.getName())) {
            ret += "name=\"" + compositeUnique.getName() + "\", ";
        }
        ret += "columnNames = {";
        boolean first = true;
        for (Attribute uniqueAttribute : compositeUnique.getAttributes()) {
            if (!first) {
                ret += ", ";
            } else {
                first = false;
            }
            ret += "\"" + escapeSql(uniqueAttribute.getColumnName()) + "\"";
        }
        ret += "})";
        return ret;
    }

    private void appendAttribute(StringBuffer ret, String attribute) {
        if (isNotBlank(attribute)) {
            if (ret.length() > 0) {
                ret.append(", ");
            }
            ret.append(attribute);
        }
    }
}


text:
Testing validators compatibility with JSON-Schema standard

## Results summary

The table shows the number of failing tests in different groups:

- spec - tests from the "official" [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) (`format` and other optional tests are excluded)
- schemas - [tests with schemas](https://github.com/epoberezkin/ajv/tree/master/spec/tests/schemas) from different validators test-suites
- keywords - [additional tests for standard keywords](https://github.com/epoberezkin/ajv/tree/master/spec/tests/rules) used by Ajv (`format` tests are excluded)
- issues - [Ajv tests for various issues](https://github.com/epoberezkin/ajv/tree/master/spec/tests/issues), primarily $ref resolution

The table header shows the total number of tests is each group.

|validator|spec
(272)|schemas
(32)|keywords
(33)|issues
(103)|**total**
(443)|
|---|:-:|:-:|:-:|:-:|:-:|
|[ajv](https://github.com/epoberezkin/ajv)|-|-|-|-|-|
|[jayschema](https://github.com/natesilva/jayschema)|5|-|-|6|**11**|
|[jsonschema](https://github.com/tdegrunt/jsonschema)|2|2|-|10|**14**|
|[tv4](https://github.com/geraintluff/tv4)|2|1|-|11|**14**|
|[z-schema](https://github.com/zaggino/z-schema)|-|1|-|17|**18**|
|[is-my-json-valid](https://github.com/mafintosh/is-my-json-valid)|7|-|-|13|**20**|
|[jjv](https://github.com/acornejo/jjv)|9|2|1|12|**24**|
|[skeemas](https://github.com/Prestaul/skeemas)|2|4|1|23|**30**|
|[jsen](https://github.com/bugventure/jsen)|-|-|-|44|**44**|
|[djv](https://github.com/korzio/djv)|4|9|2|49|**64**|
|[themis](https://github.com/playlyfe/themis)|13|-|4|55|**72**|
|[jsck](https://github.com/pandastrike/jsck)|17|15|-|49|**81**|
|[schemasaurus](https://github.com/AlexeyGrishin/schemasaurus)|19|19|2|71|**111**|

## Most failed tests related to $ref

`x` marks the validators that failed the test.

|Test file|[ajv](https://github.com/epoberezkin/ajv)|[djv](https://github.com/korzio/djv)|[imjv](https://github.com/mafintosh/is-my-json-valid)1|[jay](https://github.com/natesilva/jayschema)2|[jjv](https://github.com/acornejo/jjv)|[jsck](https://github.com/pandastrike/jsck)|[jsen](https://github.com/bugventure/jsen)|[js](https://github.com/tdegrunt/jsonschema)3|[ss](https://github.com/AlexeyGrishin/schemasaurus)4|[sk](https://github.com/Prestaul/skeemas)5|[th](https://github.com/playlyfe/themis)6|[tv4](https://github.com/geraintluff/tv4)|[zs](https://github.com/zaggino/z-schema)7|
|---|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|[base URI change](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/62_resolution_scope_change.json)||x|x|x|x|x|x|x|x|x|x|x|x|
|[mutually recursive ref](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/5_recursive_references.json)||x|x||x|x|x||x|x|x||x|
|[ref in remote ref with id](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/14_ref_in_remote_ref_with_id.json)||x|x||x|x|x||x|x|x|||
|[id in ref without root id](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/1_ids_in_refs.json)||x|||x|x||x|x|x||x|x|
|[root ref in remote ref](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/13_root_ref_in_ref_in_remote_ref.json)||x|x||x|x|x||x|x|x|||
|[recursive refs](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/27_recursive_reference.json)||x|||x|x|x||x|x||x|x|
|[swagger schema](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/70_swagger_schema.json)||x||x||x|x|x|x||x|x||
|[spec/refRemote](https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/master/tests/draft4/refRemote.json)|||x|x|x|x|||x||x|||
|[ref when sibling property has id](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/170_ref_and_id_in_sibling.json)||||||x|||x||x|x|x|
|[recursive hash in remote hash](https://github.com/epoberezkin/ajv/blob/master/spec/tests/issues/70_1_recursive_hash_ref_in_remote_ref.json)|||x|||x|x||x||x|||
|[spec/ref](https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/master/tests/draft4/ref.json)|||x|x|x||||x||x|||
|Total failing|-|**7**|**7**|**4**|**8**|**10**|**7**|**3**|**11**|**6**|**9**|**5**|**5**|

1 [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid)

2 [jayschema](https://github.com/natesilva/jayschema)

3 [jsonschema](https://github.com/tdegrunt/jsonschema)

4 [schemasaurus](https://github.com/AlexeyGrishin/schemasaurus)

5 [skeemas](https://github.com/Prestaul/skeemas)

6 [themis](https://github.com/playlyfe/themis)

7 [z-schema](https://github.com/zaggino/z-schema)

## Running tests

Tests require node v6 to run.

```bash
npm install
git submodule update --init

# all tests with all validators
npm test

# one group of tests for all validators
# groups: spec, schemas, keywords, issues
npm test spec

# all tests for one validator
mocha test/ajv
```


text:
package com.google.cloud.spring.data.datastore.core;

import com.google.cloud.datastore.Cursor;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class DatastoreResultsIterable<T> implements Iterable<T> {
  private final Iterator<T> iterator;
  private final Cursor cursor;
  private Iterable<T> iterable;

  public DatastoreResultsIterable(Iterable<T> iterable, Cursor cursor) {
    this(iterable.iterator(), cursor);
    this.iterable = iterable;
  }

  public DatastoreResultsIterable(Iterator<T> iterator, Cursor cursor) {
    this.iterator = iterator;
    this.cursor = cursor;
  }

  @Override
  public Iterator<T> iterator() {
    return this.iterator;
  }

  public Cursor getCursor() {
    return this.cursor;
  }

  public Iterable<T> getIterable() {
    return this.iterable;
  }

  public List<T> toList() {
    List<T> results = new ArrayList<>();
    while (iterator().hasNext()) {
      results.add(iterator().next());
    }
    return results;
  }
}


text:
@class MPRemoteCommand;

MP_EXTERN_CLASS_AVAILABLE(7_1)
@interface MPRemoteCommandEvent : NSObject

/// The command that sent the event.
@property (nonatomic, readonly) MPRemoteCommand *command;

/// The time when the event occurred.
@property (nonatomic, readonly) NSTimeInterval timestamp;

@end

MP_EXTERN_CLASS_AVAILABLE(7_1)
@interface MPSkipIntervalCommandEvent : MPRemoteCommandEvent

/// The chosen interval for this skip command event.
@property (nonatomic, readonly) NSTimeInterval interval;

@end

typedef NS_ENUM(NSUInteger, MPSeekCommandEventType) {
    MPSeekCommandEventTypeBeginSeeking,
    MPSeekCommandEventTypeEndSeeking
} NS_ENUM_AVAILABLE_IOS(7_1);

MP_EXTERN_CLASS_AVAILABLE(7_1)
@interface MPSeekCommandEvent : MPRemoteCommandEvent

/// The type of seek command event, which specifies whether an external player
/// began or ended seeking.
@property (nonatomic, readonly) MPSeekCommandEventType type;

@end

MP_EXTERN_CLASS_AVAILABLE(7_1)
@interface MPRatingCommandEvent : MPRemoteCommandEvent

/// The chosen rating for this command event. This value will be within the
/// minimumRating and maximumRating values set for the MPRatingCommand object.
@property (nonatomic, readonly) float rating;

@end

MP_EXTERN_CLASS_AVAILABLE(7_1)
@interface MPChangePlaybackRateCommandEvent : MPRemoteCommandEvent

/// The chosen playback rate for this command event. This value will be equal
/// to one of the values specified in the supportedPlaybackRates array for the
/// MPChangePlaybackRateCommand object.
@property (nonatomic, readonly) float playbackRate;

@end

MP_EXTERN_CLASS_AVAILABLE(7_1)
@interface MPFeedbackCommandEvent : MPRemoteCommandEvent

/// Whether the command event is a negative operation. For example, the command
/// might ask that the app remove a bookmark for a particular track, rather than
/// add it. In this case, the handler for the bookmark command should check this
/// flag and remove the bookmark if it is set to YES.
///
/// For like/dislike, a "negative like" might be treated differently from a
/// dislike command. The app might want to remove the "like" flag from the
/// current track, but not blacklist and skip to the next track as it would for
/// a dislike command.
@property (nonatomic, readonly, getter = isNegative) BOOL negative;

@end


text:
from __future__ import unicode_literals

from django.contrib.auth.decorators import permission_required, login_required
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse

from djshop.apps.base import views as base_views
from djshop.apps.offers.forms.group_offers import GroupOfferForm
from djshop.apps.offers.models import GroupOffer

# List of group offers
@login_required
def index(request):
    group_offers = GroupOffer.objects.all().order_by("name")
    replacements = {
        "group_offers": group_offers
    }
    return render(request, "offers/group_offers/index.html", replacements)

# View a group offer
@login_required
def view(request, product_id):
    group_offer = get_object_or_404(GroupOffer, id=product_id)
    replacements = {
        "group_offer": group_offer
    }
    return render(request, "offers/group_offers/view.html", replacements)

# New group offer
@login_required
def new(request):
    group_offer = GroupOffer(creator=request.user)
    return base_views.edit(request, instance=group_offer, form_class=GroupOfferForm,
                           template_path="offers/group_offers/new.html", ok_url=reverse("offers:view_group_offers"))

# Edition of group offer
@login_required
def edit(request, group_offer_id):
    group_offer = get_object_or_404(GroupOffer, id=group_offer_id)
    return base_views.edit(request, instance=group_offer, form_class=GroupOfferForm,
                           template_path="offers/group_offers/edit.html", ok_url=reverse("offers:view_group_offers"))

# Delete a group offer
@login_required
def delete(request, group_offer_id):
    bundle_offer = get_object_or_404(GroupOffer, id=group_offer_id)
    return base_views.delete(request, instance=bundle_offer)


text:
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { defer } from 'rsvp';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';

export default Route.extend(AuthenticatedRouteMixin, {
  currentUser: service(),

  queryParams: {
    titleFilter: {
      replace: true
    }
  },

  model() {
    let rsvpDefer = defer();
    let model = {};
    this.get('currentUser.model').then(currentUser=>{
      this.store.findAll('school').then(schools => {
        model.schools = schools;
        currentUser.get('school').then(primarySchool => {
          model.primarySchool = primarySchool;
          rsvpDefer.resolve(model);
        });
      });
    });
    return rsvpDefer.promise;
  }
});


text:
@interface AppMonitorManager : NSObject
+ (void)swizzlingInClass:(Class)cls originalSelector:(SEL)originalSelector swizzledSelector:(SEL)swizzledSelector;
@end


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

using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using DotNETCore.Repository.Mongo;

namespace DataAccess.MongoDb.Models
{
    [BsonIgnoreExtraElements]
    public class Survey: Entity
    {
        public Survey()
            : base(){}

        [BsonElement("template_id"), BsonRequired]
        public string TemplateId { get; set; }
        [BsonElement("customer_id"), BsonRequired]
        public string CustomerId { get; set; }
        [BsonElement("assignment_id"), BsonRequired]
        public string AssignementId { get; set; }
        [BsonElement("responses"), BsonRequired]
        public List<SurveyResponse> Responses { get; set; }
        [BsonElement("is_complete")]
        public bool IsComplete { get; set; }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <corners android:radius="2dp"/>
    <stroke
        android:color="@color/Orange"
        android:width="1dp"/>
    <solid
        android:color="@color/White"/>
</shape>


text:
module API
  class CircuitBreakers < Grape::API
    before { authenticated_as_admin! }

    resource :circuit_breakers do
      params do
        requires :type,
                 type: String,
                 desc: "The type of circuitbreaker",
                 values: ['repository_storage']
      end
      resource ':type' do
        namespace '', requirements: { type: 'repository_storage' } do
          helpers do
            def failing_storage_health
              @failing_storage_health ||= Gitlab::Git::Storage::Health.for_failing_storages
            end

            def storage_health
              @failing_storage_health ||= Gitlab::Git::Storage::Health.for_all_storages
            end
          end

          desc 'Get all failing git storages' do
            detail 'This feature was introduced in GitLab 9.5'
            success Entities::RepositoryStorageHealth
          end
          get do
            present storage_health, with: Entities::RepositoryStorageHealth
          end

          desc 'Get all failing git storages' do
            detail 'This feature was introduced in GitLab 9.5'
            success Entities::RepositoryStorageHealth
          end
          get 'failing' do
            present failing_storage_health, with: Entities::RepositoryStorageHealth
          end

          desc 'Reset all storage failures and open circuitbreaker' do
            detail 'This feature was introduced in GitLab 9.5'
          end
          delete do
            Gitlab::Git::Storage::CircuitBreaker.reset_all!
          end
        end
      end
    end
  end
end


text:
<?php
namespace Utilisateur\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Utilisateur\Model\Utilisateur;          // <-- Add this import
use Utilisateur\Form\UtilisateurForm;       // <-- Add this import

class UtilisateurController extends AbstractActionController
{
	protected $utilisateurTable;

	public function indexAction()
	{
		return new ViewModel(array(
				'utilisateurs' => $this->getUtilisateurTable()->fetchAll(),
		));
	}

	public function inscriptionAction()
	{
		$form = new UtilisateurForm();
		$form->get('submit')->setValue('Add');

		$request = $this->getRequest();
		if ($request->isPost()) {
			$utilisateur = $this->getServiceLocator()->get('Utilisateur/Model/Utilisateur');
			$form->setInputFilter($utilisateur->getInputFilter());
			$form->setData($request->getPost());

			if ($form->isValid()) {
				$utilisateur->exchangeArray($form->getData());
				$this->getUtilisateurTable()->saveUtilisateur($utilisateur);

				// Redirect to list of utilisateurs
				return $this->redirect()->toRoute('utilisateur', array(
													'action' => 'inscription'));
			}
		}
		return array('form' => $form);
	}

	public function addAction()
	{
		$form = new UtilisateurForm();
		$form->get('submit')->setValue('Add');

		$request = $this->getRequest();
		if ($request->isPost()) {
			$utilisateur = $this->getServiceLocator()->get('Utilisateur/Model/Utilisateur');
			$form->setInputFilter($utilisateur->getInputFilter());
			$form->setData($request->getPost());

			if ($form->isValid()) {
				$utilisateur->exchangeArray($form->getData());
				$this->getUtilisateurTable()->saveUtilisateur($utilisateur);

				// Redirect to list of utilisateurs
				return $this->redirect()->toRoute('utilisateur');
			}
		}
		return array('form' => $form);
	}

	public function editAction()
	{
		$id = (int) $this->params()->fromRoute('id', 0);
		if (!$id) {
			return $this->redirect()->toRoute('utilisateur', array(
					'action' => 'add'
			));
		}

		// Get the Utilisateur with the specified id.  An exception is thrown
		// if it cannot be found, in which case go to the index page.
		try {
			$utilisateur = $this->getUtilisateurTable()->getUtilisateur($id);
		}
		catch (\Exception $ex) {
			return $this->redirect()->toRoute('utilisateur', array(
					'action' => 'index'
			));
		}

		$form  = new UtilisateurForm();
		$form->bind($utilisateur);
		$form->get('submit')->setAttribute('value', 'Edit');

		$request = $this->getRequest();
		if ($request->isPost()) {
			$form->setInputFilter($utilisateur->getInputFilter());
			$form->setData($request->getPost());

			if ($form->isValid()) {
				$this->getUtilisateurTable()->saveUtilisateur($utilisateur);

				// Redirect to list of utilisateurs
				return $this->redirect()->toRoute('utilisateur');
			}
		}

		return array(
				'id' => $id,
				'form' => $form,
		);
	}

	public function deleteAction()
	{
		$id = (int) $this->params()->fromRoute('id', 0);
		if (!$id) {
			return $this->redirect()->toRoute('utilisateur');
		}

		$request = $this->getRequest();
		if ($request->isPost()) {
			$del = $request->getPost('del', 'No');

			if ($del == 'Yes') {
				$id = (int) $request->getPost('id');
				$this->getUtilisateurTable()->deleteUtilisateur($id);
			}

			// Redirect to list of utilisateurs
			return $this->redirect()->toRoute('utilisateur');
		}

		return array(
				'id'    => $id,
				'utilisateur' => $this->getUtilisateurTable()->getUtilisateur($id)
		);
	}

	public function getUtilisateurTable()
	{
		if (!$this->utilisateurTable) {
			$sm = $this->getServiceLocator();
			$this->utilisateurTable = $sm->get('Utilisateur\Model\UtilisateurTable');
		}
		return $this->utilisateurTable;
	}
}


text:
var $ = require('jquery'),
    exercise = require('../exercise')

$.ajaxSetup({
    xhrFields: { withCredentials: true },
    crossDomain: true
})

$('#createsql').click( function() {
    var $fb = $('#createsqlfeedback').html('')

    $.get( '/createdb', { type: 'sql' } )
    .done( function() {
        $fb.css( 'color', 'green' ).html('One database. ORDERR UUUPPP!')
    })
    .fail( function( res ) {
        $fb.css( 'color', 'red' )
        if ( res.status === 403 ) {
            $fb.html('Error: You have not yet registered!')
        } else if ( res.status === 500 ) {
            $fb.html('Server Error. Please talk to Nick or email js@mit.edu')
        }
    })
})

$('#createmongo').click( function() {
     var $fb = $('#createmongofeedback').html('')

    $.get( '/createdb', { type: 'mongo' } )
    .done( function() {
        $fb.css( 'color', 'green' ).html('One database. ORDERR UUUPPP!')
    })
    .fail( function( res ) {
        $fb.css( 'color', 'red' )
        if ( res.status === 403 ) {
            $fb.html('Error: You have not yet registered!')
        } else if ( res.status === 500 ) {
            $fb.html('Server Error. Please talk to Nick or email js@mit.edu')
        }
    })
})


text:
////////////////////////////////////////////////////////////////////////////
// Porgram: CommandLineFlag
// Purpose: Go command line flags/switches/arguments demo
// Authors: Tong Sun (c) 2013, All rights reserved
////////////////////////////////////////////////////////////////////////////

// Style: gofmt -tabs=false -tabwidth=2 -w

package main

import (
	"flag"
	"fmt"
	"os"
	"strconv"
)

var (
	// main operation modes
	write = flag.Bool("w", false, "write result back instead of stdout\n\t\tDefault: No write back")

	// layout control
	tabWidth = flag.Int("tabwidth", 8, "tab width\n\t\tDefault: Standard")

	// debugging
	cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file\n\t\tDefault: no default")
)

func usage() {
	// Fprintf allows us to print to a specifed file handle or stream
	fmt.Fprintf(os.Stderr, "\nUsage: %s [flags] file [path ...]\n\n",
		"CommandLineFlag") // os.Args[0]
	flag.PrintDefaults()
	os.Exit(0)
}

func main() {
	fmt.Printf("Before parsing the flags\n")
	fmt.Printf("T: %d\nW: %s\nC: '%s'\n",
		*tabWidth, strconv.FormatBool(*write), *cpuprofile)

	flag.Usage = usage
	flag.Parse()

	// There is also a mandatory non-flag arguments
	if len(flag.Args()) < 1 {
		usage()
	}

	fmt.Printf("Testing the flag package\n")
	fmt.Printf("T: %d\nW: %s\nC: '%s'\n",
		*tabWidth, strconv.FormatBool(*write), *cpuprofile)

	for index, element := range flag.Args() {
		fmt.Printf("I: %d C: '%s'\n", index, element)
	}
}

/*

To Test:

  go run CommandLineFlag.go
  go run CommandLineFlag.go -tabwidth=6 aa

*/

/*
Ref:

http://golang.org/pkg/flag/
http://golang.org/src/cmd/gofmt/gofmt.go
https://github.com/lanep/golang-me/blob/master/misc_examples/flag.go
*/