text:
{-# LANGUAGE RankNTypes #-}
module Kis.Notifications
    ( NotificationHandler(..)
    , notificationsThread
    )
where

import Kis.Kis
import Kis.Model

import Control.Concurrent
import Control.Concurrent.Async
import Control.Monad
import Data.Maybe (isJust)
import Data.Time.Clock
import Database.Persist
import qualified Data.ByteString as BS
import qualified Data.Map as Map
import qualified Data.Text as T

data NotificationHandler =
    NotificationHandler
    { nh_saveNotif ::
          forall a m . (KisRead m, Monad m)
          => (KisRequest a, a)
          -> m (Maybe BS.ByteString)
    , nh_processNotif :: UTCTime -> BS.ByteString -> IO ()
    , nh_signature :: T.Text
    }

notificationsThread ::
    IO [Entity Notification]
    -- ^ Function to retrieve Notifications
    -> (NotificationId -> IO ())
    -- ^ Function to delete Notifications
    -> [NotificationHandler]
    -- ^ Notificationhandlers that are run whenever a new notification is written.
    -> MVar ()
    -- ^ signal that new notifications have been written
    -> MVar ()
    -- ^ stop signal
    -> IO ()
notificationsThread getNotifications deleteNotif handlers newNotifs stopSignal =
    case twoNotifHandlersWithEqualSignature handlers of
      True -> error "two notifhandlers with the same signature were added"
      False -> loop
    where
      loop =
          do shouldStop <- tryReadMVar stopSignal
             case isJust shouldStop of
               True ->
                   do notifs <- getNotifications
                      case notifs of
                        [] -> return ()
                        _ -> handleNotifications
               False -> handleNotifications
      handleNotifications =
          do notifications <- getNotifications
             forM_ notifications $
                 \(Entity notifId (Notification timestamp payload sig)) ->
                     case Map.lookup sig notifProcessFunktionMap of
                       Just processFunc ->
                           do processFunc timestamp payload
                              deleteNotif notifId
                       Nothing ->
                           error $ "notifications for handler"
                                   ++ (T.unpack sig)
                                   ++ "found but this handler has not been registered!"
             newNotifSignal <- async $ takeMVar newNotifs
             stop <- async $ readMVar stopSignal
             waitEither_ newNotifSignal stop
             loop
      notifProcessFunktionMap =
          Map.fromList $ map (\nh -> (nh_signature nh, nh_processNotif nh)) handlers

      twoNotifHandlersWithEqualSignature [] = False
      twoNotifHandlersWithEqualSignature (nh:nhs) =
          any ((==) (nh_signature nh)) (map nh_signature nhs)
                  || (twoNotifHandlersWithEqualSignature nhs)

redpajama_set_name: RedPajamaGithub


text:
'use strict';

Object.defineProperty(Array.prototype, 'girth', {
    get: function () {
        return this.length;
    },
    set: function (newGirth) {
        this.length = newGirth;
    },
    enumerable: false,
    configurable: false
});


text:
require 'spec_helper'
require 'oneboxer'
require 'oneboxer/android_app_store_onebox'

describe Oneboxer::AndroidAppStoreOnebox do
  before(:each) do
    @o = Oneboxer::AndroidAppStoreOnebox.new("https://play.google.com/store/apps/details?id=com.moosoft.parrot")
    FakeWeb.register_uri(:get, @o.translate_url, response: fixture_file('oneboxer/android.response'))
  end

  it "generates the expected onebox for Android App Store" do
    @o.onebox.should match_html expected_android_app_store_result
  end

private
  def expected_android_app_store_result
    <<EXPECTED

           play.google.com

Talking Parrot

      Listen to the parrot repeat what you say. A Fun application for all ages. Upgrade to Talking Parrot Pro to save sounds, set them as your ringtone and control recording.
 Press the MENU button to access the settings where you can change the record time and repeat count.
 This app uses anonymous usage stats to understand and improve performance.
 Comments and feedback welcome.

EXPECTED
  end
end


text:
// Generated by xsd compiler for android/java
// DO NOT CHANGE!
package com.ebay.trading.api;

/**
 *
 * Container for other alerts for Selling Manager.
 *
 */
public enum SellingManagerGeneralPropertyTypeCodeType {

    /**
     *
   * Items that received negative feeback.
   *
     */
    NEGATIVE_FEEDBACK_RECEIVED("NegativeFeedbackReceived"),

    /**
     *
   * Unpaid item disputes require your response.
   *
     */
    UNPAID_ITEM_DISPUTE("UnpaidItemDispute"),

    /**
     *
   * Emails not set because of HTML or active content.
   *
     */
    BAD_EMAIL_TEMPLATE("BadEmailTemplate"),

    /**
     *
   * (out) Reserved for internal or future use.
   *
     */
    CUSTOM_CODE("CustomCode");

    private final String value;

    SellingManagerGeneralPropertyTypeCodeType(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static SellingManagerGeneralPropertyTypeCodeType fromValue(String v) {
        if (v != null) {
            for (SellingManagerGeneralPropertyTypeCodeType c: SellingManagerGeneralPropertyTypeCodeType.values()) {
                if (c.value.equals(v)) {
                    return c;
                }
            }
        }
        throw new IllegalArgumentException(v);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Основи на програмирането" – 20 ноември 2016

class Program
{
    static void Main()
    {
        int firstPlayer = int.Parse(Console.ReadLine());
        int secondPlayer = int.Parse(Console.ReadLine());
        int max = int.Parse(Console.ReadLine());
        int counter = 0;

        for (int i = 1; i <= firstPlayer; i++)
        {
            for (int j = 1; j <= secondPlayer; j++)
            {
                Console.Write("<{0}-{1}>", i, j);
                counter++;
                if (counter == max)
                {
                    return;
                }
            }
        }
    }
}


text:
<?php

namespace PO;

/**
 * @author Marcelo Jacobus <marcelo.jacobus@gmail.com>
 */
class String extends Object
{

    protected $content;

    /**
     * @param string $string
     */
    public function __construct($string = '')
    {
        $this->content = (string) $string;
    }

    /**
     * Append text to the string
     * @param string $string
     */
    public function append($string)
    {
        $this->content .= $string;

        return $this;
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->content;
    }

    /**
     * To Upper Case
     * @return String
     */
    public function toUpperCase()
    {
        return new String(mb_strtoupper($this, 'UTF-8'));
    }

    /**
     * To Lower Case
     * @return String
     */
    public function toLowerCase()
    {
        return new String(mb_strtolower($this, 'UTF-8'));
    }

    /**
     * String to parameter
     *
     * @param string separator
     * @return String
     */
    public function parameterize($separator = '-')
    {
        $forbiddenChars = "/[^$separator,a-z]/";

        return $this->toLowerCase()
            ->gsub('/\s+/', $separator)
            ->gsub($forbiddenChars, '');
    }

    /**
     * Replace string
     *
     * @pattern string regexp or string
     * @return String
     */
    public function gsub($pattern, $replacement)
    {
        $pattern = new String($pattern);

        if ($pattern->isRegexp()) {
            return new String(preg_replace($pattern, $replacement, $this));
        } else {
            return new String(str_replace($pattern, $replacement, $this));
        }
    }

    /**
     * Checks if string is a Regular Expression.
     *
     * If param is not given, the considered string is the object itself.
     *
     * @param  string $string defaults to null
     * @return bool
     */
    protected function isRegexp($string = null)
    {
        if ($string === null) {
            $string = $this;
        }

        return preg_match('/\/.*\//', $string);
    }

    /**
     * Splits the string
     * @param string separator
     * @return Hash[String]
     */
    public function split($separator)
    {
        $hash = new Hash(explode((string) $separator, (string) $this));

        return $hash->map(
            function ($value) {
                return new String($value);
            }
        );
    }

    /**
     * Get the number of chars
     * @return int
     */
    public function count()
    {
        return mb_strlen((string) $this, 'UTF-8');
    }

    /**
     * Get the number of chars
     * @return int
     */
    public function length()
    {
        return $this->count();
    }

    /**
     * Returns part of a string
     *
     * @param integer start
     * @param  integer   $length the length of the string from the starting point
     * @return PO\String
     */
    public function at($start = null, $length = null)
    {
        return new String(mb_substr((string) $this, $start, $length, 'UTF-8'));
    }

    /**
     * Removes leading and trailing spaces
     * @return PO\String
     */
    public function trim()
    {
        return new String(trim((string) $this));
    }
}


text:
package uk.co.jamesmcguigan.patterns.behavioural.command;

public interface Command {
    void execute();
}


text:
% OLComputeSpectralShiftCorrectionsFromStateMeasurements - Returns a struct which contains spectral shift amplitude and time information for the sequence of spectral shift measurements in a calfile.
%
% Syntax:
%   spectralShiftCorrection = OLComputeSpectralShiftCorrectionsFromStateMeasurements(cal)
%
% 8/22/16   npc     Wrote it.

function spectralShiftCorrection = OLComputeSpectralShiftCorrectionsFromStateMeasurements(cal)

    referenceSPD = cal.raw.spectralShiftsMeas.measSpd(:, 1);

    spectralAxis = SToWls(cal.describe.S);
    % Peaks of the comb function
    combPeaks = [480 540 596 652]+10;

    for stateMeasIndex = 1:size(cal.raw.spectralShiftsMeas.measSpd,2)-1
        theSPD = cal.raw.spectralShiftsMeas.measSpd(:, stateMeasIndex);
        [spectralShifts, referenceSPDpeaks, fitParams, paramNames] = OLComputeSpectralShiftBetweenCombSPDs(theSPD, referenceSPD, combPeaks, spectralAxis);
        % median shift across the 4 peaks
        spectralShiftCorrection.amplitudes(stateMeasIndex) = -median(spectralShifts);
        spectralShiftCorrection.times(stateMeasIndex) = cal.raw.spectralShiftsMeas.t(:, stateMeasIndex);
        spectralShiftCorrection.fitParams(stateMeasIndex,:,:) = fitParams;
    end

    %disp('OLComputeSpectralShiftCorrectionsFromStateMeasurements:');
    spectralShiftCorrection.paramNames = paramNames;
    spectralShiftCorrection.combPeaks = combPeaks;
    spectralShiftCorrection.referenceSPDpeaks = referenceSPDpeaks;
end


text:
package io.github.hapjava.characteristics.impl.filtermaintenance;

import io.github.hapjava.characteristics.EventableCharacteristic;
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
import io.github.hapjava.characteristics.impl.base.EnumCharacteristic;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Supplier;

public class FilterChangeIndicationCharacteristic
    extends EnumCharacteristic<FilterChangeIndicationEnum> implements EventableCharacteristic {

  public FilterChangeIndicationCharacteristic(
      Supplier<CompletableFuture<FilterChangeIndicationEnum>> getter,
      Consumer<HomekitCharacteristicChangeCallback> subscriber,
      Runnable unsubscriber) {
    super(
        "000000AC-0000-1000-8000-0026BB765291",
        "filter change indication",
        FilterChangeIndicationEnum.values(),
        Optional.of(getter),
        Optional.empty(),
        Optional.of(subscriber),
        Optional.of(unsubscriber));
  }
}


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="referrer" content="always">
    <meta name="robots" content="index, follow">
    <link rel="icon" href="about:blank" type="image/x-icon">

    <title>
        Sberbank Conducts Money Transfer on an IBM Blockchain
    </title>

    <meta name="title" content="Sberbank Conducts Money Transfer on an IBM Blockchain">
    <meta name="description"
          content="Recently, Sberbank, Russia's largest bank by asset, has conducted the first money transfer over an IBM-built blockchain based on the Hyperledger Fabric 1.0 .">
    <meta name="keywords" content=" Sberbank ; Blockchain; IBM">

    <link rel="stylesheet" type="text/css" href="../css/article-font.css">
    <link rel="stylesheet" href="../css/article.min.css">

                                        中文

                                 Unitalks

                                 News

                                 Knowledge

                                 Events

                                 Home

                                            Qianxi

                                            <time>Dec 13, 2017</time>

                                        Sberbank Conducts Money Transfer on an IBM Blockchain

                                            "Recently, Sberbank, Russia's largest bank by asset, has conducted the first
                                            money transfer over an IBM-built blockchain based on the Hyperledger Fabric
                                            1.0 ."

Reportedly, Sberbank, Russia's biggest bank by
                                        assets, has made a real-time money transfer using a blockchain software based on
                                        the Hyperledger Fabric built by IBM. The transfer was completed by Sberbank's IT
                                        systems that also provide a web application for the bank's customers to track
                                        the transfer.

The Hyperledger Fabric 1.0 was officially
                                        released by the Linux Foundation-led open-source Hyperledger blockchain
                                        consortium in July this year. Managing director of Sberbank, Stella Kudachkina
                                        said, "The blockchain solution created by Sberbank has allowed us to make the
                                        first pilot payment transaction using IBM-built blockchain based on the
                                        Hyperledger Fabric 1.0 in the Russian banking sector"

Sberbank also listed its partners
                                        participating in the pilot payment transaction, including technology giant IBM,
                                        Russia's second-largest mobile phone operator MegaFon, Moscow-based IT solutions
                                        provider MegaLabs and alfa-bank, the first private bank in Russia. It is notable
                                        that Sberbank and alfa-bank have set the ultimate goal for hosting the
                                        blockchain's nodes to: become the primary scenario for developing a new
                                        settlement function between two banks.

The executive of Sberbank said, "The advantage
                                        of using blockchain technology when performing settlements is the high speed at
                                        which transfers are made. After the money is sent, the transaction is recorded
                                        on the receiver's account almost instantly. Unlike the traditional system, such
                                        kind of transfer is in real time."

                                            「 Declaration: Please indicate the source if repost the article in UNITIMES.
                                            Opinions expressed by Contributors belong to themselves. 」

                                            Tags:

                                                Blockchain

                                                Sberbank

                                                IBM

                                                        News

                                                        China Bans all Token Offering Financing Activities, Price of the
                                                        Virtual Currencies Decline

                                                                Xue Xu

                                                                    <time>4 Sept, 2017</time>

                                                        News

                                                        The 3rd Global Blockchain Summit Successfully Held in Shanghai

                                                                Qinghuan

                                                                    <time>18 Sept, 2017</time>

                                                        News

                                                        Ethereum's ERC-20 Token Standard Has Been Finalized

                                                                Qianxi

                                                                    <time>11 Sept, 2017</time>

© UNITIMES. All
                                    Rights Reserved.


text:
script_name=$(basename -- "$0")
env="/home/pi/.venv/jns"

if [ $(id -u) = 0 ]
then
   echo "usage: ./$script_name"
   exit 1
fi

# activate virtual environment
source $env/bin/activate

# clone SQLite kernel repository
git clone https://github.com/brownan/sqlite3-kernel.git

# install kernel
cd sqlite3-kernel
python setup.py install
python -m sqlite3_kernel.install
cd ..
rm -rf sqlite3-kernel/


text:
require 'spec_helper'

describe OrganizationAPI do
  before(:all) do
    OrganizationAPI.set_endpoint(
      'https://organization-service-dev.herokuapp.com',
      'web_service_user',
      'messingaroundinboats')
  end

  before(:each) do
    @org1 = OrganizationAPI::Organization.new( {
        name: 'Org1',
        address1: '123 Fake St.',
        city: 'Lawrenceville',
        state: 'Ga',
        zipcode: '30044',
        phone_number: '1234567890'
      })
    @org2 = OrganizationAPI::Organization.new( {
        name: 'Org2',
        address1: '456 Fake St.',
        city: 'Lawrenceville',
        state: 'Ga',
        zipcode: '30044',
        phone_number: '3216540987'
      })
    @app1 = OrganizationAPI::Application.new( {
      name: 'App1',
      url: 'https://not-a-real-url.com',
      icon_image_url: 'http://not-a-real-url.com/app1-icon.png'
      })
    @app2 = OrganizationAPI::Application.new( {
      name: 'App2',
      url: 'https://not-a-real-url2.com',
      icon_image_url: 'https://not-a-real-url.com/app2-icon.png'
      })
  end

  it 'should create and delete and organization' do
    response = OrganizationAPI.create_organization(@org1)
    response.name.should eq(@org1.name)
    response = OrganizationAPI.delete_organization(response.id)
    response.should eq(true)
  end

  it 'should return a particular organization' do
    response = OrganizationAPI.create_organization(@org1)
    org = OrganizationAPI.get_organization(response.id)
    org.name.should eq(response.name)
    OrganizationAPI.delete_organization(org.id)
  end

  it 'should return a list of organizations' do
    OrganizationAPI.create_organization(@org1)
    OrganizationAPI.create_organization(@org2)
    response = OrganizationAPI.get_organizations
    response[0].name.should eq(@org1.name)
    OrganizationAPI.delete_organization(response[0].id)
    OrganizationAPI.delete_organization(response[1].id)
  end

  it 'should update an organization' do
    org = OrganizationAPI.create_organization(@org1)
    org.name = 'New Name'
    org = OrganizationAPI.update_organization(org)
    org.name.should eq('New Name')
    OrganizationAPI.delete_organization(org.id)
  end

  it 'should create and delete an application' do
    app = OrganizationAPI.create_application(@app1)
    app.name.should eq(@app1.name)
    response = OrganizationAPI.delete_application(app.id)
    response.should eq(true)
  end

  it 'should return a particular application' do
    app = OrganizationAPI.create_application(@app1)
    response = OrganizationAPI.get_application(app.id)
    response.name.should eq(app.name)
    OrganizationAPI.delete_application(app.id)
  end

  it 'should return a list of applications' do
    OrganizationAPI.create_application(@app1)
    OrganizationAPI.create_application(@app2)
    response = OrganizationAPI.get_applications
    response[0].name.should eq(@app1.name)
    OrganizationAPI.delete_application(response[0].id)
    OrganizationAPI.delete_application(response[1].id)
  end

  it 'should update an application' do
    app = OrganizationAPI.create_application(@app1)
    app.name = 'New Name'
    response = OrganizationAPI.update_application(app)
    response.name.should eq('New Name')
    OrganizationAPI.delete_application(response.id)
  end

  it 'should create, get, and delete an organization with an application' do
    app = OrganizationAPI.create_application(@app1)
    org = OrganizationAPI.create_organization(@org1)
    org.applications << app
    org = OrganizationAPI.update_organization(org)
    org.applications = OrganizationAPI.get_applications_for_organization(org)
    org.applications[0].name.should eq(app.name)
    OrganizationAPI.delete_organization(org.id)
    OrganizationAPI.delete_application(app.id)
  end
end


text:
@extends('layouts.admin')

@section('content')

System Settings Manager

                    <input type="text" class="form-control" placeholder="Search for...">

                      <button class="btn btn-default" type="button">Go!</button>

Table design Custom design

Settings 1

Settings 2

						    {!! Form::open(array('url' => url('admin/'.$type), 'method' => 'POST', 'class' => 'form-horizontal form-label-left', 'files'=> true)) !!}
                              System Settings Info

                              	{!! Form::label('category', trans("admin/systemsettings.category"), array('class' => 'control-label col-md-3 col-sm-3 col-xs-12')) !!}

                              	{!! Form::text('category', null, array('class' => 'form-control col-md-7 col-xs-12', 'required'=>'required')) !!}

                              	{!! Form::label('settings', trans("admin/systemsettings.settings"), array('class' => 'control-label col-md-3 col-sm-3 col-xs-12')) !!}

                              	{!! Form::textarea('settings', null, array('class' => 'form-control col-md-7 col-xs-12', 'required'=>'required')) !!}

		                          <button type="submit" class="btn btn-primary">Cancel</button>
		                          <button id="send" type="submit" class="btn btn-success">Submit</button>

                            {!! Form::close() !!}

@endsection


text:
@interface CocoaCracker () {
    Class _targetCls;
}

@end

@implementation CocoaCracker

+ (instancetype)handle:(Class)cls {
    return [[self alloc] initWithClass:cls];
}

- (instancetype)initWithClass:(Class)cls
{
    self = [super init];
    if (self) {

        _targetCls = cls;
    }
    return self;
}

#pragma mark-  copy property list

- (void)copyPropertyName:(void(^)(NSString *pName))block {
    NSParameterAssert(block);

    [self copyPropertyInfo:^(NSString *pName, NSString *pType) {
        block(pName);
    } copyAttriEntirely:NO];
}

- (void)copyPropertyType:(void(^)(NSString *pType))block {
    NSParameterAssert(block);

    [self copyPropertyInfo:^(NSString *pName, NSString *pType) {
        block(pType);
    } copyAttriEntirely:NO];
}

- (void)copyPropertyTypeEntirely:(void(^)(NSString *pTypeEntirely))block {
    NSParameterAssert(block);
    [self copyPropertyInfo:^(NSString *pName, NSString *pTypeEntirely) {
        block(pTypeEntirely);
    } copyAttriEntirely:YES];
}

- (void)copyPropertyInfo:(void(^)(NSString *pName, NSString *pTypeEntirely))block
            copyAttriEntirely:(BOOL)isCopy {
    NSParameterAssert(block);
    [self copyPropertyList:^(objc_property_t property) {
        NSString *pName = [NSString stringWithUTF8String:property_getName(property)];
        NSString *pType;
        if (isCopy)
            pType = [NSString stringWithUTF8String:property_getAttributes(property)];
        else
            pType = [NSString stringWithUTF8String:property_copyAttributeValue(property, "T")];

        block(pName, pType);
    }];
}

- (void)copyPropertyList:(void(^)(objc_property_t property))block {
    NSParameterAssert(block);
    u_int count;
    objc_property_t *properties = class_copyPropertyList(_targetCls, &count);
    for (u_int i = 0; i < count; i++) {
        block(properties[i]);
    }

    free(properties);
}

#pragma mark-  swizzle methods

- (BOOL)swizzleMethod:(SEL)oldSelector withMethod:(SEL)newSelector {

    Method oldMethod = class_getInstanceMethod(_targetCls, oldSelector);
    Method newMethod = class_getInstanceMethod(_targetCls, newSelector);

    BOOL didAddMethod = class_addMethod(_targetCls,
                                        oldSelector,
                                        method_getImplementation(newMethod),
                                        method_getTypeEncoding(newMethod));

    if (didAddMethod) {
        class_replaceMethod(_targetCls,
                            newSelector,
                            method_getImplementation(oldMethod),
                            method_getTypeEncoding(oldMethod));
    }
    else {
        method_exchangeImplementations(oldMethod, newMethod);
    }
    return didAddMethod;
}

#pragma mark-  copy method list
- (void)copyMethodName:(void (^)(NSString *selectorName))block {
    NSParameterAssert(block);

    [self copyMethodList:^(SEL aSelector) {
        block(NSStringFromSelector(aSelector));
    }];
}

- (void)copyMethodList:(void (^)(SEL aSelector))block {
    NSParameterAssert(block);
    u_int count;
    Method *methods = class_copyMethodList(_targetCls, &count);
    for (int i = 0; i < count ; i++) {
        SEL aSelector = method_getName(methods[i]);
        block(aSelector);
    }
    free(methods);
}

@end


text:
Cloudify DSL Parser
===================

[![Build Status](https://travis-ci.org/cloudify-cosmo/cloudify-dsl-parser.svg?branch=master)](https://travis-ci.org/cloudify-cosmo/cloudify-dsl-parser)
[![Circle CI](https://circleci.com/gh/cloudify-cosmo/cloudify-system-tests/tree/master.svg?&style=shield)](https://circleci.com/gh/cloudify-cosmo/cloudify-dsl-parser/tree/master)
[![PyPI](http://img.shields.io/pypi/dm/cloudify-dsl-parser.svg)](http://img.shields.io/pypi/dm/cloudify-dsl-parser.svg)
[![PypI](http://img.shields.io/pypi/v/cloudify-dsl-parser.svg)](http://img.shields.io/pypi/v/cloudify-dsl-parser.svg)

Cloudify DSL parsing package

## Reference

For details on the DSL specification see [DSL Specification](http://docs.getcloudify.org/latest/blueprints/overview/).


text:
<?php

declare(strict_types=1);

namespace Cmfcmf\Module\MediaModule\Listener;

use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Zikula\Core\CoreEvents;
use Zikula\Core\Event\ModuleStateEvent;

/**
 * Listen to module removals.
 */
class ModuleListener implements EventSubscriberInterface
{
    /**
     * @var EntityManagerInterface
     */
    private $em;

    /**
     * @param EntityManagerInterface $em
     */
    public function __construct(EntityManagerInterface $em)
    {
        $this->em = $em;
    }

    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents()
    {
        return [
            CoreEvents::MODULE_REMOVE => 'moduleRemoved'
        ];
    }

    /**
     * Called if a module is removed.
     *
     * @param ModuleStateEvent $event
     */
    public function moduleRemoved(ModuleStateEvent $event)
    {
        if ($event->getModule()) {
            $name = $event->getModule()->getName();
        } else {
            $name = $event->modinfo['name'];
            if (empty($name)) {
                // Just to make sure..
                return;
            }
        }

        $this->em->getRepository('CmfcmfMediaModule:HookedObject\HookedObjectEntity')
            ->deleteAllOfModule($name);
    }
}


text:
namespace mckl {

namespace internal {

class StirlingMatrix2
{
  public:
    StirlingMatrix2(std::size_t n, std::size_t m)
        : ncol_(m + 1), data_((n + 1) * (m + 1))
    {
        std::fill(data_.begin(), data_.end(), 0);
        get(0, 0) = 1;
        for (std::size_t j = 1; j <= m; ++j) {
            get(j, j) = 1;
            for (std::size_t i = j + 1; i <= n; ++i) {
                get(i, j) = j * get(i - 1, j) + get(i - 1, j - 1);
            }
        }
    }

    double operator()(std::size_t i, std::size_t j) const
    {
        return data_[i * ncol_ + j];
    }

  private:
    std::size_t ncol_;
    Vector<double> data_;

    double &get(std::size_t i, std::size_t j) { return data_[i * ncol_ + j]; }
}; // class StirlingMatrix2

template <unsigned long long U,
    int N = std::numeric_limits<unsigned long long>::digits - 1>
class Log2L
{
    static constexpr unsigned long long M = 1ULL << N;

  public:
    static constexpr int value = M <= U ? N : Log2L<U, N - 1>::value;
}; // class Log2L

template <unsigned long long U>
class Log2L<U, 0>
{
  public:
    static constexpr int value = 0;
}; // class Log2L

template <int N>
class Log2L<0, N>
{
  public:
    static constexpr int value = N + 1;
}; // class Log2L

template <typename UIntType, UIntType U>
class Log2 : public Log2L<U, std::numeric_limits<UIntType>::digits - 1>
{
}; // class Log2

template <unsigned long long B, unsigned N, bool = N % 2 == 0>
class PowL
{
    static constexpr unsigned long long b = PowL<B, N / 2>::value;

  public:
    static constexpr unsigned long long value = b * b;
}; // class PowL

template <unsigned long long B, unsigned N>
class PowL<B, N, false>
{
  public:
    static constexpr unsigned long long value = B * PowL<B, N - 1>::value;
}; // class PowL

template <unsigned long long B>
class PowL<B, 0, true>
{
  public:
    static constexpr unsigned long long value = 1;
}; // class PowL

template <typename UIntType, unsigned long long B, unsigned N>
class Pow
{
  public:
    static constexpr UIntType value = static_cast<UIntType>(PowL<B, N>::value);
}; // class Pow

template <int P,
    int Q = (std::numeric_limits<unsigned long long>::digits <
                        std::numeric_limits<long double>::digits ?
                    std::numeric_limits<unsigned long long>::digits :
                    std::numeric_limits<long double>::digits) -
        1,
    bool = (Q < P)>
class Pow2L
{
  public:
    static constexpr long double value =
        static_cast<long double>(1ULL << Q) * Pow2L<P - Q>::value;
}; // class Pow2L

template <int P, int Q>
class Pow2L<P, Q, false>
{
  public:
    static constexpr long double value = static_cast<long double>(1ULL << P);
}; // class Pow2L

template <typename RealType, int P, bool = P >= 0>
class Pow2Impl
{
  public:
    static constexpr RealType value = static_cast<RealType>(Pow2L<P>::value);
}; // class Pow2

template <typename RealType, int P>
class Pow2Impl<RealType, P, false>
{
  public:
    static constexpr RealType value =
        static_cast<RealType>(1.0L / Pow2L<-P>::value);
}; // class Pow2

template <typename RealType, int P>
using Pow2 = Pow2Impl<RealType, P>;

template <typename UIntType, unsigned N>
class Factorial
{
  public:
    static constexpr UIntType value = N * Factorial<UIntType, N - 1>::value;
}; // class Factorial

template <typename UIntType>
class Factorial<UIntType, 1>
{
  public:
    static constexpr UIntType value = 1;
}; // class Factorial

template <typename UIntType>
class Factorial<UIntType, 0>
{
  public:
    static constexpr UIntType value = 1;
}; // class Factorial

} // namespace internal

} // namespace mckl

#endif // MCKL_INTERNAL_CONST_MATH_HPP


text:
Code

Name

    Cur
    Price
    +/-
    %+/-

    III

        3I GRP.

    GBX
    443.90

        -13.70

        -2.99

    ABF

        A.B.FOOD

    GBX
    3,166.00

        -60.00

        -1.86

    ADN

        ABDN.ASSET.MAN.

    GBX
    444.80

        -16.90

        -3.66

    ADM

        ADMIRAL GRP

    GBX
    1,259.00

        -26.00

        -2.02

    AGK

        AGGREKO

    GBX
    1,489.00

        -72.00

        -4.61

    AAL

        ANGLO AMERICAN

    GBX
    1,223.00

        -21.00

        -1.69

    ANTO

        ANTOFAGASTA

    GBX
    731.00

        +4.50

        +0.62

    ARM

        ARM HLDGS.

    GBX
    943.00

        -20.00

        -2.08

    AHT

        ASHTEAD GRP.

    GBX
    1,077.00

        -27.00

        -2.45

    AZN

        ASTRAZENECA

    GBX
    4,561.50

        -134.00

        -2.85

    AV.

        AVIVA

    GBX
    492.60

        -14.40

        -2.84

    BAB

        BABCOCK INTL

    GBX
    1,120.00

        -18.00

        -1.58

    BA.

        BAE SYS.

    GBX
    467.70

        -12.10

        -2.52

    BARC

        BARCLAYS

    GBX
    238.50

        -8.65

        -3.50

    BG.

        BG GRP.

    GBX
    898.80

        +3.80

        +0.42

    BLT

        BHP BILLITON

    GBX
    1,413.50

        -23.50

        -1.64

    BP.

        BP

    GBX
    405.95

        -11.35

        -2.72

    BATS

        BR.AMER.TOB.

    GBX
    3,608.00

        -78.50

        -2.13

    BLND

        BR.LAND

    GBX
    757.50

        -14.00

        -1.81

    BT.A

        BT GROUP

    GBX
    408.50

        -8.00

        -1.92


text:
{
  axios.defaults.headers.get["X-CUSTOM-HEADER"] = "foo";
  axios.get("/foo");
  getAjaxRequest().then(function(request) {
    expect(request.requestHeaders["X-CUSTOM-HEADER"]).toBe("foo");
    done();
  });
}


text:
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace EmptyKeys.UserInterface.Generator.Values
{
    /// <summary>
    /// Implements generator for all brushes
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class BrushGeneratorValue<T> : IGeneratorValue
    {
        /// <summary>
        /// Gets the type of the value.
        /// </summary>
        /// <value>
        /// The type of the value.
        /// </value>
        public Type ValueType
        {
            get
            {
                return typeof(T);
            }
        }

        /// <summary>
        /// Generates the specified parent class.
        /// </summary>
        /// <param name="parentClass">The parent class.</param>
        /// <param name="method">The method.</param>
        /// <param name="value">The value.</param>
        /// <param name="baseName">Name of the base.</param>
        /// <param name="dictionary">The dictionary.</param>
        /// <returns></returns>
        public CodeExpression Generate(CodeTypeDeclaration parentClass, CodeMemberMethod method, object value, string baseName, ResourceDictionary dictionary = null)
        {
            string brushVarName = baseName + "_b";
            return CodeComHelper.GenerateBrushInstance(method, value as Brush, brushVarName);
        }
    }
}


text:
#include "CCBalanceGate.h"
#include "CCStoreInventory.h"
#include "CCSoomlaUtils.h"
#include "CCStoreEventDispatcher.h"

USING_NS_CC;

namespace soomla {

#define TAG "SOOMLA BalanceGate"

    soomla::CCBalanceGate *soomla::CCBalanceGate::create(cocos2d::__String *id, cocos2d::__String *associatedItemId, cocos2d::__Integer *desiredBalance) {
        CCBalanceGate *ret = new CCBalanceGate();
        if (ret->init(id, associatedItemId, desiredBalance)) {
            ret->autorelease();
        }
        else {
            CC_SAFE_DELETE(ret);
        }

        return ret;
    }

    bool soomla::CCBalanceGate::init(cocos2d::__String *id, cocos2d::__String *associatedItemId, cocos2d::__Integer *desiredBalance) {
        bool result = CCGate::init(id, NULL);
        if (result) {
            setAssociatedItemId(associatedItemId);
            setDesiredBalance(desiredBalance);
            return true;
        }
        return result;
    }

    bool soomla::CCBalanceGate::initWithDictionary(cocos2d::__Dictionary *dict) {
        bool result = CCGate::initWithDictionary(dict);
        if (result) {
            fillAssociatedItemIdFromDict(dict);
            fillDesiredBalanceFromDict(dict);
            return true;
        }
        return result;
    }

    const char *soomla::CCBalanceGate::getType() const {
        return CCLevelUpConsts::JSON_JSON_TYPE_BALANCE_GATE;
    }

    cocos2d::__Dictionary *soomla::CCBalanceGate::toDictionary() {
        cocos2d::__Dictionary *dict = CCGate::toDictionary();

        putAssociatedItemIdToDict(dict);
        putDesiredBalanceToDict(dict);

        return dict;
    }

    soomla::CCBalanceGate::~CCBalanceGate() {
        CC_SAFE_RELEASE(mAssociatedItemId);
        CC_SAFE_RELEASE(mDesiredBalance);
        CC_SAFE_RELEASE(mCurrencyBalanceChangedListener);
        CC_SAFE_RELEASE(mGoodBalanceChangedListener);
    }

    bool CCBalanceGate::canOpenInner() {
        CCError *error = NULL;
        int balance = CCStoreInventory::sharedStoreInventory()->getItemBalance(mAssociatedItemId->getCString(), &error);
        if (error) {
            CCSoomlaUtils::logError(TAG, cocos2d::__String::createWithFormat(
                    "(canOpenInner) Couldn't find itemId. itemId: %s", mAssociatedItemId->getCString())->getCString());
            CCSoomlaUtils::logError(TAG, error->getInfo());
            return false;
        }
        return (balance >= mDesiredBalance->getValue());
    }

    bool CCBalanceGate::openInner() {
        if (canOpen()) {
            // There's nothing to do here... If the DesiredBalance was reached then the gate is just open.
            forceOpen(true);
            return true;
        }

        return false;
    }

    void CCBalanceGate::registerEvents() {
        if (!isOpen()) {
            setCurrencyBalanceChangedListener(Director::getInstance()->getEventDispatcher()->addCustomEventListener(CCStoreConsts::EVENT_CURRENCY_BALANCE_CHANGED,
                                                                                CC_CALLBACK_1(CCBalanceGate::onCurrencyBalanceChanged, this)));
            setGoodBalanceChangedListener(Director::getInstance()->getEventDispatcher()->addCustomEventListener(CCStoreConsts::EVENT_GOOD_BALANCE_CHANGED,
                                                                                CC_CALLBACK_1(CCBalanceGate::onGoodBalanceChanged, this)));
        }
    }

    void CCBalanceGate::unregisterEvents() {
        EventListener *listener = getCurrencyBalanceChangedListener();
        if (listener) {
            Director::getInstance()->getEventDispatcher()->removeEventListener(listener);
            setCurrencyBalanceChangedListener(NULL);
        }

        listener = getGoodBalanceChangedListener();
        if (listener) {
            Director::getInstance()->getEventDispatcher()->removeEventListener(listener);
            setCurrencyBalanceChangedListener(NULL);
        }
    }

    void CCBalanceGate::checkItemIdBalance(cocos2d::__String *itemId, int balance) {
        if (mAssociatedItemId->compare(itemId->getCString()) == 0 && balance >= mDesiredBalance->getValue()) {
            forceOpen(true);
        }
    }

    void CCBalanceGate::onCurrencyBalanceChanged(cocos2d::EventCustom *event) {
        __Dictionary *eventData = (__Dictionary *)event->getUserData();
        CCVirtualCurrency *virtualCurrency = dynamic_cast<CCVirtualCurrency *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_CURRENCY));
        CC_ASSERT(virtualCurrency);
        __Integer *balance = dynamic_cast<__Integer *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_BALANCE));
        CC_ASSERT(balance);

        checkItemIdBalance(virtualCurrency->getItemId(), balance->getValue());
    }

    void CCBalanceGate::onGoodBalanceChanged(cocos2d::EventCustom *event) {
        __Dictionary *eventData = (__Dictionary *)event->getUserData();
        CCVirtualGood *virtualGood = dynamic_cast<CCVirtualGood *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_GOOD));
        CC_ASSERT(virtualGood);
        __Integer *balance = dynamic_cast<__Integer *>(eventData->objectForKey(CCStoreConsts::DICT_ELEMENT_BALANCE));
        CC_ASSERT(balance);

        checkItemIdBalance(virtualGood->getItemId(), balance->getValue());
    }
}


text:
#ifndef POINT2D
#define POINT2D

/**
 * Class for 2D points.
 *
 * @author Viktor Kirilov
 *
 * @email n1ntendo@abv.bg
 *
 * @date 22 Match 2010
 */
class Point2d {
private:

public:

	/**
	 * the x pos of the point
	 */
	int x;

	/**
	 * the y pos of the point
	 */
	int y;

private:

public:

	/**
	 * default constructor
	 */
	Point2d();

	/**
	 * constructor with parameters
	 * @param X the x of the point
	 * @param Y the y of the point
	 */
	Point2d(int X, int Y);

	/**
	 * default destructor
	 */
	~Point2d();

	/**
	 * the overloaded operator*
	 * @param scale the number to multiply by
	 * @return the resulting point
	 */
	Point2d operator*(float scale) const ;

	/**
	 * the overloaded operator/
	 * @param scale the number to divide by
	 * @return the resulting point
	 */
	Point2d operator/(float scale) const ;

	/**
	 * the overloaded operator+
	 * @param other the other point to sum to
	 * @return the resulting point
	 */
	Point2d operator+(const Point2d &other) const ;

	/**
	 * the overloaded operator-
	 * @param other the other point to substract
	 * @return the resulting point
	 */
	Point2d operator-(const Point2d &other) const ;

	/**
	 * the overloaded operator-
	 * @return the resulting point
	 */
	Point2d operator-() const ;
};

#endif


text:
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="A front-end template that helps you build fast, modern mobile web apps.">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <title>Excision 2</title>

  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="images/android-desktop.png">

  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Material Design Lite">
  <link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png">

  <meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
  <meta name="msapplication-TileColor" content="#3372DF">

  <link rel="shortcut icon" href="images/favicon.png">

  <link rel="stylesheet" href="{{ url_for('static', filename = "css/roboto.css") }}">
  <link rel="stylesheet" href="{{ url_for('static', filename = "css/material_icons.css") }}">
  <link rel="stylesheet" href="{{ url_for('static', filename = "css/material.deep_purple-pink.min.css") }}">
  <link rel="stylesheet" href="{{ url_for('static', filename = "css/style_mdl.css") }}">

          Excision

            Tutorial
            About
            Story
            Launch

        Title

          Link
          Link
          Link
          Link

          <button onclick="location.href='{{ url_for('play', title=lvl_title)}}'" style="top: 20%; height: 72px; font-size: 28;" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-color--accent mdl-color-text--accent-contrast">
            Launch
          </button>


text:
<?php

namespace Cake\Test\TestCase\Controller;

use Cake\Controller\ComponentRegistry;
use Cake\Controller\Component\AuthComponent;
use Cake\Controller\Component\CookieComponent;
use Cake\Controller\Controller;
use Cake\Core\App;
use Cake\Core\Plugin;
use Cake\TestSuite\TestCase;

/**
 * Extended CookieComponent
 */
class CookieAliasComponent extends CookieComponent {
}

class ComponentRegistryTest extends TestCase {

/**
 * setUp
 *
 * @return void
 */
	public function setUp() {
		parent::setUp();
		$controller = new Controller();
		$this->Components = new ComponentRegistry($controller);
	}

/**
 * tearDown
 *
 * @return void
 */
	public function tearDown() {
		parent::tearDown();
		unset($this->Components);
	}

/**
 * test triggering callbacks on loaded helpers
 *
 * @return void
 */
	public function testLoad() {
		$result = $this->Components->load('Cookie');
		$this->assertInstanceOf('Cake\Controller\Component\CookieComponent', $result);
		$this->assertInstanceOf('Cake\Controller\Component\CookieComponent', $this->Components->Cookie);

		$result = $this->Components->loaded();
		$this->assertEquals(array('Cookie'), $result, 'loaded() results are wrong.');

		$result = $this->Components->load('Cookie');
		$this->assertSame($result, $this->Components->Cookie);
	}

/**
 * Tests loading as an alias
 *
 * @return void
 */
	public function testLoadWithAlias() {
		$result = $this->Components->load('Cookie', array('className' => __NAMESPACE__ . '\CookieAliasComponent', 'somesetting' => true));
		$this->assertInstanceOf(__NAMESPACE__ . '\CookieAliasComponent', $result);
		$this->assertInstanceOf(__NAMESPACE__ . '\CookieAliasComponent', $this->Components->Cookie);
		$this->assertTrue($this->Components->Cookie->config('somesetting'));

		$result = $this->Components->loaded();
		$this->assertEquals(array('Cookie'), $result, 'loaded() results are wrong.');

		$result = $this->Components->load('Cookie');
		$this->assertInstanceOf(__NAMESPACE__ . '\CookieAliasComponent', $result);

		Plugin::load('TestPlugin');
		$result = $this->Components->load('SomeOther', array('className' => 'TestPlugin.Other'));
		$this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $result);
		$this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $this->Components->SomeOther);

		$result = $this->Components->loaded();
		$this->assertEquals(array('Cookie', 'SomeOther'), $result, 'loaded() results are wrong.');
	}

/**
 * test load and enable = false
 *
 * @return void
 */
	public function testLoadWithEnableFalse() {
		$mock = $this->getMock('Cake\Event\EventManager');
		$mock->expects($this->never())
			->method('attach');

		$this->Components->getController()->setEventManager($mock);

		$result = $this->Components->load('Cookie', array('enabled' => false));
		$this->assertInstanceOf('Cake\Controller\Component\CookieComponent', $result);
		$this->assertInstanceOf('Cake\Controller\Component\CookieComponent', $this->Components->Cookie);
	}

/**
 * test missingcomponent exception
 *
 * @expectedException \Cake\Controller\Error\MissingComponentException
 * @return void
 */
	public function testLoadMissingComponent() {
		$this->Components->load('ThisComponentShouldAlwaysBeMissing');
	}

/**
 * test loading a plugin component.
 *
 * @return void
 */
	public function testLoadPluginComponent() {
		Plugin::load('TestPlugin');
		$result = $this->Components->load('TestPlugin.Other');
		$this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $result, 'Component class is wrong.');
		$this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $this->Components->Other, 'Class is wrong');
	}

/**
 * Test loading components with aliases and plugins.
 *
 * @return void
 */
	public function testLoadWithAliasAndPlugin() {
		Plugin::load('TestPlugin');
		$result = $this->Components->load('AliasedOther', ['className' => 'TestPlugin.Other']);
		$this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $result);
		$this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $this->Components->AliasedOther);

		$result = $this->Components->loaded();
		$this->assertEquals(['AliasedOther'], $result, 'loaded() results are wrong.');
	}

/**
 * test getting the controller out of the collection
 *
 * @return void
 */
	public function testGetController() {
		$result = $this->Components->getController();
		$this->assertInstanceOf('Cake\Controller\Controller', $result);
	}

/**
 * Test reset.
 *
 * @return void
 */
	public function testReset() {
		$eventManager = $this->Components->getController()->getEventManager();
		$instance = $this->Components->load('Auth');
		$this->assertSame(
			$instance,
			$this->Components->Auth,
			'Instance in registry should be the same as previously loaded'
		);
		$this->assertCount(1, $eventManager->listeners('Controller.startup'));

		$this->assertNull($this->Components->reset(), 'No return expected');
		$this->assertCount(0, $eventManager->listeners('Controller.startup'));

		$this->assertNotSame($instance, $this->Components->load('Auth'));
	}

/**
 * Test unloading.
 *
 * @return void
 */
	public function testUnload() {
		$eventManager = $this->Components->getController()->getEventManager();

		$result = $this->Components->load('Auth');
		$this->Components->unload('Auth');

		$this->assertFalse(isset($this->Components->Auth), 'Should be gone');
		$this->assertCount(0, $eventManager->listeners('Controller.startup'));
	}

/**
 * Test set.
 *
 * @return void
 */
	public function testSet() {
		$eventManager = $this->Components->getController()->getEventManager();
		$this->assertCount(0, $eventManager->listeners('Controller.startup'));

		$auth = new AuthComponent($this->Components);
		$this->Components->set('Auth', $auth);

		$this->assertTrue(isset($this->Components->Auth), 'Should be gone');
		$this->assertCount(1, $eventManager->listeners('Controller.startup'));
	}

}


text:
package net.sandius.rembulan.lib.luajava;

public class MethodSelectionException extends Exception {

	public MethodSelectionException(String message) {
		super(message);
	}

	public MethodSelectionException(Throwable cause) {
		super(cause);
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar"
        />

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <android.support.v4.view.PagerTabStrip
            android:id="@+id/pager_tab_strip"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top"
            android:background="?attr/colorPrimaryDark"
            android:paddingBottom="5dp"
            android:paddingTop="5dp"
            android:paddingRight="5dp"
            android:paddingLeft="5dp"
            android:textColor="#ffffff"
            />
    </android.support.v4.view.ViewPager>

</LinearLayout>


text:
package io.github.resilience4j.fallback.autoconfigure;

import io.github.resilience4j.fallback.*;
import io.github.resilience4j.fallback.configure.FallbackConfiguration;
import io.github.resilience4j.spelresolver.SpelResolver;
import io.github.resilience4j.spelresolver.autoconfigure.SpelResolverConfigurationOnMissingBean;
import io.github.resilience4j.utils.ReactorOnClasspathCondition;
import io.github.resilience4j.utils.RxJava2OnClasspathCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import java.util.List;

/**
 * {@link Configuration} for {@link FallbackDecorators}.
 */
@Configuration
@Import(SpelResolverConfigurationOnMissingBean.class)
public class FallbackConfigurationOnMissingBean {

    private final FallbackConfiguration fallbackConfiguration;

    public FallbackConfigurationOnMissingBean() {
        this.fallbackConfiguration = new FallbackConfiguration();
    }

    @Bean
    @ConditionalOnMissingBean
    public FallbackDecorators fallbackDecorators(@Autowired(required = false) List<FallbackDecorator> fallbackDecorators) {
        return fallbackConfiguration.fallbackDecorators(fallbackDecorators);
    }

    @Bean
    @ConditionalOnMissingBean
    public FallbackExecutor fallbackExecutor(SpelResolver spelResolver, FallbackDecorators fallbackDecorators) {
        return fallbackConfiguration.fallbackExecutor(spelResolver, fallbackDecorators);
    }

    @Bean
    @Conditional(value = {RxJava2OnClasspathCondition.class})
    @ConditionalOnMissingBean
    public RxJava2FallbackDecorator rxJava2FallbackDecorator() {
        return fallbackConfiguration.rxJava2FallbackDecorator();
    }

    @Bean
    @Conditional(value = {ReactorOnClasspathCondition.class})
    @ConditionalOnMissingBean
    public ReactorFallbackDecorator reactorFallbackDecorator() {
        return fallbackConfiguration.reactorFallbackDecorator();
    }

    @Bean
    @ConditionalOnMissingBean
    public CompletionStageFallbackDecorator completionStageFallbackDecorator() {
        return fallbackConfiguration.completionStageFallbackDecorator();
    }
}


text:
define(function (require) {
    var customElement = require('customElement').create();
    var $ = require('zepto');

    function render() {
        var element = this.element;
        var node = document.createElement('script');
        node.type = 'text/javascript';
        // 引入36漫画广告管理组件,实现广告素材轮播功能
        node.src = 'https://www.36mh.com/bd/a-36mh.js';
        node.async = 'async';
        $(element).append(node);
    }
    customElement.prototype.build = render;
    return customElement;
});


text:
package main

import (
	"fmt"
	"os"

	"github.com/urfave/cli/v2"

	"github.com/nsec/askgod/internal/daemon"
)

func main() {
	app := cli.NewApp()
	app.Name = "askgod-server"
	app.Usage = "CTF scoring system - server"
	app.ArgsUsage = "<config>"
	app.HideVersion = true
	app.HideHelp = true
	app.EnableBashCompletion = true

	app.Action = func(c *cli.Context) error {
		if c.NArg() == 0 {
			cli.ShowAppHelp(c)
			return fmt.Errorf("Missing required arguments")
		}

		d, err := daemon.NewDaemon(c.Args().Get(0))
		if err != nil {
			return err
		}

		return d.Run()
	}

	err := app.Run(os.Args)
	if err != nil {
		fmt.Printf("error: %v\n", err)
		os.Exit(1)
	}
}


text:
<?php

namespace App\Exceptions;

class UserException extends Exception
{
    public function setFile($file)
    {
        $this->file = $file;
    }

    public function setLine($line)
    {
        $this->line = $line;
    }

}


text:
<?php
require "vendor/autoload.php";

require_once 'config.php';

$routes = require 'configroutes.php';

 $uri = htmlspecialchars(
          parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
        );

$routes->direct($uri);


text: natalia-s blog


text:
title: "Jump Game"
description: "Some description ..."
authors: ["lek-tin"]
tags: ["leetcode", "greedy", "dynamic-programming"]
categories: ["algorithm"]
date: 2020-04-25T08:23:15-07:00
lastmod: 2020-04-25T08:23:15-07:00
draft: false
archive: false
---

Given an array of **non-negative** integers, you are initially positioned at the first index of the array.

Each element in the array represents your maximum jump length at that position.

Determine if you are able to reach the last index.

### Example 1

```
Input: [2,3,1,1,4]
Output: true
Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.
```

### Example 2

```
Input: [3,2,1,0,4]
Output: false
Explanation: You will always arrive at index 3 no matter what. Its maximum
             jump length is 0, which makes it impossible to reach the last index.
```

### Solution (dynamic programming)

```java
class Solution {
    public boolean canJump(int[] nums) {
        if (nums.length <= 1) {
            return true;
        }

        int N = nums.length;
        int[] dp = new int[N];

        dp[0] = nums[0];

        for (int i = 1; i < N; i++) {
            // impossible, abort
            if (dp[i-1] < i) {
                return false;
            }
            // possible, abort
            if (dp[i-1] >= N-1) {
                return true;
            }
            // principle of optimality, continue
            dp[i] = Math.max(dp[i-1], nums[i]+i);
        }

        return false;
    }
}
```


text:
/*

When editing make sure the margin, padding, and border sizes are the same for the
header cells, week header cells, and day cells. If they are different the calendar
will look messed up.

*/

/*
Root calendar element
*/
.JFrontierCal {
	border: 0px solid #dddddd;
	padding: 0px;
	margin: 0px;
	width: 932px;
	/*width: 1024px;*/
	/*
	If you want a background image for the entire calendar than you must comment out the
	individual background-images for the day cells below. Then you can uncomment this
	line and use your image of choice. You may also want to enable borders on the day
	cells.
	*/
	/*background-image:url('images/bw-tree.jpg');*/
}
/*
Style shared by all day cells.
*/
.JFrontierCal .JFrontierCal-Day-Cell,
.JFrontierCal .JFrontierCal-Day-Cell-Last,
.JFrontierCal .JFrontierCal-PrevMonth-Day-Cell,
.JFrontierCal .JFrontierCal-NextMonth-Day-Cell,
.JFrontierCal .JFrontierCal-NextMonth-Day-Cell-Last,
.JFrontierCal .JFrontierCal-Day-Cell-Droppable,
.JFrontierCal .JFrontierCal-Day-Cell-Today {
	padding: 0px;
	border-bottom: 0px solid #ffffff;
	border-left: 0px solid #ffffff;
	font: 13px verdana;
	float: left;
	clear: right;
	/*
	height is only used for initialization. heights are calculated by aspect
	ratio relative to width of calendar parent div.
	*/
	height: 80px;
	text-align: right;
}
/*
Style for day cells on the current month.
*/
.JFrontierCal .JFrontierCal-Day-Cell,
.JFrontierCal .JFrontierCal-Day-Cell-Last{
	background-color: #efefef;
	color: #444444;
	background-image:url('../images/dayCellCurrentMonth.png');
	background-repeat:repeat-y;
}
/*
Style for previous month and next month day cells.
*/
.JFrontierCal .JFrontierCal-PrevMonth-Day-Cell,
.JFrontierCal .JFrontierCal-NextMonth-Day-Cell,
.JFrontierCal .JFrontierCal-NextMonth-Day-Cell-Last {
	background-color: #cccccc;
	color: #999999;
	background-image:url('../images/dayCellOtherMonth.png');
	background-repeat:repeat-y;
}
/*
Style for Saturday cells.
*/
.JFrontierCal .JFrontierCal-Day-Cell-Last,
.JFrontierCal .JFrontierCal-NextMonth-Day-Cell-Last {
	border-right: 0px solid #ffffff;
}
/*
Style for hover effect on droppable day cells (drag and drop agenda items.)
*/
.JFrontierCal .JFrontierCal-Day-Cell-Droppable {
	background-color: #a6c7ff;
	background-image: none;
}
/*
Style for current date day cell
*/
.JFrontierCal .JFrontierCal-Day-Cell-Today {
	background-color: #d6e2ff;
	color: #444444;
	/*background-image: none;*/
	background-image:url('../images/dayCellToday.png');
}
/*
Style for header cells (day name cells at top of calendar)
*/
.JFrontierCal .JFrontierCal-Header-Cell,
.JFrontierCal .JFrontierCal-Header-Cell-Last {
	padding: 0px;
	border-top: 0px solid #ffffff;
	border-bottom: 0px solid #ffffff;
	border-left: 0px solid #ffffff;
	background-color: #777777;
	color: white;
	font: 13px verdana;
	/*font-weight: bold;*/
	float: left;
	clear: right;
	height: 17px;
}
/*
Style for Saturday header cell at top of calendar.
*/
.JFrontierCal .JFrontierCal-Header-Cell-Last {
	border-right: 0px solid #ffffff;
}
/*
Style for week Header cells (cells for day numbers above each week)
*/
.JFrontierCal .JFrontierCal-Week-Header-Cell,
.JFrontierCal .JFrontierCal-Week-Header-Cell-Last,
.JFrontierCal .JFrontierCal-PrevMonth-Week-Header-Cell,
.JFrontierCal .JFrontierCal-NextMonth-Week-Header-Cell,
.JFrontierCal .JFrontierCal-NextMonth-Week-Header-Cell-Last {
	padding: 0px;
	border-left: 0px solid #ffffff;
	background-color: #dedede;
	color: #000000;
	font: 13px verdana;
	float: left;
	clear: right;
	height: 17px;
	text-align: right;
}
/*
Style for week header cells for the previous and next month. Make them a little darker.
*/
.JFrontierCal .JFrontierCal-PrevMonth-Week-Header-Cell,
.JFrontierCal .JFrontierCal-NextMonth-Week-Header-Cell,
.JFrontierCal .JFrontierCal-NextMonth-Week-Header-Cell-Last  {
	background-color: #aaaaaa;
	color: #333333;
}
/*
Style for Saturday week header cell.
*/
.JFrontierCal .JFrontierCal-Week-Header-Cell-Last,
.JFrontierCal .JFrontierCal-NextMonth-Week-Header-Cell-Last {
	border-right: 0px solid #ffffff;
}
/*
Style for agenda items. These are simply default values. Some values can be configured through the API (height, color, background-color, font, etc...)
*/
.JFrontierCal-Modal-Agenda-Item,
.JFrontierCal .JFrontierCal-Day-Cell .JFrontierCal-Agenda-Item {
	height: 15px;
	/*
	Don't let text creep outside div
	*/
	overflow: hidden;
	font: 11px verdana;
	background-color: #003366;
	color: #ffffff;
	margin: 0px;
	white-space: nowrap;
	text-align: left;
}
/*
Style for the "more" link seen when not all agenda items fit within a day cell.
*/
.JFrontierCal .JFrontierCal-Day-Cell .JFrontierCal-Agenda-More-Link {
	height: 15px;
	/*
	Don't let text creep outside div
	*/
	overflow: hidden;
	font: 11px verdana;
	color: blue;
	margin: 0px;
	white-space: nowrap;
	text-align: center;
}


text:
module Gitlab
  module PerformanceBar
    module WithTopLevelWarnings
      def results
        results = super

        results.merge(has_warnings: has_warnings?(results))
      end

      def has_warnings?(results)
        results[:data].any? do |_, value|
          value[:warnings].present?
        end
      end
    end
  end
end


text:
create table t1(a int, b int, c int) using parquet;
insert into t1 values(1,0,0);
insert into t1 values(2,0,1);
insert into t1 values(3,1,0);
insert into t1 values(4,1,1);
insert into t1 values(5,null,0);
insert into t1 values(6,null,1);
insert into t1 values(7,null,null);

-- Adding anything to null gives null
select a, b+c from t1;

-- Multiplying null by zero gives null
select a+10, b*0 from t1;

-- nulls are NOT distinct in SELECT DISTINCT
select distinct b from t1;

-- nulls are NOT distinct in UNION
select b from t1 union select b from t1;

-- CASE WHEN null THEN 1 ELSE 0 END is 0
select a+20, case b when c then 1 else 0 end from t1;
select a+30, case c when b then 1 else 0 end from t1;
select a+40, case when b<>0 then 1 else 0 end from t1;
select a+50, case when not b<>0 then 1 else 0 end from t1;
select a+60, case when b<>0 and c<>0 then 1 else 0 end from t1;

-- "not (null AND false)" is true
select a+70, case when not (b<>0 and c<>0) then 1 else 0 end from t1;

-- "null OR true" is true
select a+80, case when b<>0 or c<>0 then 1 else 0 end from t1;
select a+90, case when not (b<>0 or c<>0) then 1 else 0 end from t1;

-- null with aggregate operators
select count(*), count(b), sum(b), avg(b), min(b), max(b) from t1;

-- Check the behavior of NULLs in WHERE clauses
select a+100 from t1 where b<10;
select a+110 from t1 where not b>10;
select a+120 from t1 where b<10 OR c=1;
select a+130 from t1 where b<10 AND c=1;
select a+140 from t1 where not (b<10 AND c=1);
select a+150 from t1 where not (c=1 AND b<10);

-- null-safe comparisons
select b, c, equal_null(b, c), equal_null(c, b) from t1;

drop table t1;


text:
<?php
/**
 * Application module
 *
 * @package Application
 * @author Péter Balogh <peter.balogh@theory9.hu>
 */

namespace Application\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\Paginator\Paginator;
use Zend\Paginator\Adapter\Iterator as paginatorIterator;
use Zend\View\Model\ViewModel;
use Application\Model\Contact;
use Application\Form\ContactForm;
use Application\Form\Filter\ContactInputFilter;
use Application\Model\CategoryTable;
use Application\Model\ContactTable;

/**
 * Controller for contact actions
 *
 * {@inheritDoc}
 */
class ContactController extends AbstractActionController
{
    /**
     * @var ContactTable
     */
    protected $contactTable;

    /**
     * @var ContactInputFilter
     */
    protected $contactInputFilter;

    /**
     * @var array
     */
    protected $appConfig;

    /**
     * @var CategoryTable
     */
    protected $categoryTable;

    /**
     * Controller constructor
     *
     * @param ContactTable $contactTable
     */
    public function __construct(
        ContactTable $contactTable,
        ContactInputFilter $contactInputFilter,
        $appConfig,
        CategoryTable $categoryTable
    ) {
        $this->contactTable = $contactTable;
        $this->contactInputFilter = $contactInputFilter;
        $this->appConfig = $appConfig;
        $this->categoryTable = $categoryTable;
    }

    /**
     * List of contacts
     *
     * @return ViewModel
     */
    public function listAction()
    {
        $order_by = $this->params()->fromRoute('order_by', 'contact_name');
        $order = $this->params()->fromRoute('order', 'ASC');

        $page = $this->params()->fromRoute('page')
            ? (int) $this->params()->fromRoute('page')
            : 1
        ;

        $params = array(
            'order_by' => $order_by,
            'order' => $order
        );

        $contacts = $this->contactTable->fetchAll($params);

        $itemsPerPage = $this->appConfig['items_per_page'];

        $contacts->current();
        $paginator = new Paginator(new paginatorIterator($contacts));
        $paginator->setCurrentPageNumber($page)
            ->setItemCountPerPage($itemsPerPage)
            ->setPageRange(5);

        return array(
            'order_by' => $order_by,
            'order' => $order,
            'paginator' => $paginator
        );
    }

    /**
     * Add contact with categories
     *
     * @return ViewModel|\Zend\Http\Response
     */
    public function addAction()
    {
        $form = new ContactForm();
        $request = $this->getRequest();

        if ($request->isPost()) {
            $contact = new Contact();
            $inputFilter = $this->contactInputFilter;
            $form->setInputFilter($inputFilter->getInputFilter());
            $form->setValidationGroup(
                'contact_name',
                'contact_email',
                'contact_cell',
                'categories'
            );
            $form->setData($request->getPost());

            if ($form->isValid()) {
                $contact->exchangeArray($form->getData());
                $this->contactTable->saveContact($contact);
                $this->contactTable->saveContactCategories($request->getPost());

                $this->redirect()->toRoute('contact');
            }
        }

        $params = array(
            'order_by' => 'category_name',
            'order' => 'ASC',
            'forSelect' => true
        );
        $categoryValues = $this->categoryTable->fetchAll($params);

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

    /**
     * Modify contacts
     *
     * @return ViewModel|\Zend\Http\Response
     */
    public function editAction()
    {
        $id = (int) $this->params()->fromRoute('id', 0);

        try {
            $contact = $this->contactTable->getContact($id);
        } catch (\Exception $e) {
            $this->redirect()->toRoute('contact');
        }

        $form = new ContactForm();
        $form->bind($contact);

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

            $inputFilter = $this->contactInputFilter;
            $form->setInputFilter($inputFilter->getInputFilter($id));
            $form->setValidationGroup(
                'id',
                'contact_name',
                'contact_email',
                'contact_cell'
            );

            if ($form->isValid()) {
                $this->contactTable->saveContact($contact);
                $this->categoryTable->deleteContactCategories($contact->id);
                $this->contactTable->saveContactCategories($request->getPost());

                $this->redirect()->toRoute('contact');
            }
        }

        $params = array(
            'order_by' => 'category_name',
            'order' => 'ASC',
            'forSelect' => true
        );
        $categoryValues = $this->categoryTable->fetchAll($params);
        $defaultCategoryValues
            = $this->categoryTable->findCategoriesByContact($id);

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

    /**
     * Delete contacts
     *
     * @return ViewModel|\Zend\Http\Response
     */
    public function delAction()
    {
        $id = (int) $this->params()->fromRoute('id', 0);
        $this->contactTable->deleteContact($id);
        $this->categoryTable->deleteContactCategories($id);

        $this->redirect()->toRoute('contact');
    }
}


text:
package middleware

import (
	"crypto/rand"
	"encoding/base64"
	"fmt"
	"net/http"
	"strings"
	"sync/atomic"

	"github.com/goadesign/goa"

	"context"
)

const (
	// RequestIDHeader is the name of the header used to transmit the request ID.
	RequestIDHeader = "X-Request-Id"

	// DefaultRequestIDLengthLimit is the default maximum length for the request ID header value.
	DefaultRequestIDLengthLimit = 128
)

// Counter used to create new request ids.
var reqID int64

// Common prefix to all newly created request ids for this process.
var reqPrefix string

// Initialize common prefix on process startup.
func init() {
	// algorithm taken from https://github.com/zenazn/goji/blob/master/web/middleware/request_id.go#L44-L50
	var buf [12]byte
	var b64 string
	for len(b64) < 10 {
		rand.Read(buf[:])
		b64 = base64.StdEncoding.EncodeToString(buf[:])
		b64 = strings.NewReplacer("+", "", "/", "").Replace(b64)
	}
	reqPrefix = string(b64[0:10])
}

// RequestIDWithHeader behaves like the middleware RequestID, but it takes the request id header
// as the (first) argument.
func RequestIDWithHeader(requestIDHeader string) goa.Middleware {
	return RequestIDWithHeaderAndLengthLimit(requestIDHeader, DefaultRequestIDLengthLimit)
}

// RequestIDWithHeaderAndLengthLimit behaves like the middleware RequestID, but it takes the
// request id header as the (first) argument and a length limit for truncation of the request
// header value if it exceeds a reasonable length. The limit can be negative for unlimited.
func RequestIDWithHeaderAndLengthLimit(requestIDHeader string, lengthLimit int) goa.Middleware {
	return func(h goa.Handler) goa.Handler {
		return func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {
			id := req.Header.Get(requestIDHeader)
			if id == "" {
				id = fmt.Sprintf("%s-%d", reqPrefix, atomic.AddInt64(&reqID, 1))
			} else if lengthLimit >= 0 && len(id) > lengthLimit {
				id = id[:lengthLimit]
			}
			ctx = context.WithValue(ctx, reqIDKey, id)

			return h(ctx, rw, req)
		}
	}
}

// RequestID is a middleware that injects a request ID into the context of each request.
// Retrieve it using ctx.Value(ReqIDKey). If the incoming request has a RequestIDHeader header then
// that value is used else a random value is generated.
func RequestID() goa.Middleware {
	return RequestIDWithHeader(RequestIDHeader)
}

// ContextRequestID extracts the Request ID from the context.
func ContextRequestID(ctx context.Context) (reqID string) {
	id := ctx.Value(reqIDKey)
	if id != nil {
		reqID = id.(string)
	}
	return
}


text:
package org.chromium.android_webview.test;

import android.test.suitebuilder.annotation.SmallTest;
import android.webkit.ValueCallback;

import org.chromium.android_webview.AwContents;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;

import java.io.File;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

public class ArchiveTest extends AndroidWebViewTestBase {

    private static final long TEST_TIMEOUT = 20000L;

    private static final String TEST_PAGE =
            "data:text/html;utf-8,test";

    private TestAwContentsClient mContentsClient = new TestAwContentsClient();
    private AwTestContainerView mTestContainerView;

    @Override
    protected void setUp() throws Exception {
        mTestContainerView = createAwTestContainerViewOnMainSync(mContentsClient);
    }

    private void doArchiveTest(final AwContents contents, final String path,
            final boolean autoName, String expectedPath) throws InterruptedException {
        if (expectedPath != null) {
            File file = new File(expectedPath);
            file.delete();
        }

        // Set up a handler to handle the completion callback
        final Semaphore s = new Semaphore(0);
        final AtomicReference<String> msgPath = new AtomicReference<String>();
        final ValueCallback<String> callback = new ValueCallback<String>() {
            @Override
            public void onReceiveValue(String path) {
                msgPath.set(path);
                s.release();
            }
        };

        // Generate MHTML and wait for completion
        ThreadUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                contents.saveWebArchive(path, autoName, callback);
            }
        });
        assertTrue(s.tryAcquire(TEST_TIMEOUT, TimeUnit.MILLISECONDS));

        assertEquals(expectedPath, msgPath.get());
        if (expectedPath != null) {
            File file = new File(expectedPath);
            assertTrue(file.exists());
            assertTrue(file.length() > 0);
        } else {
            // A path was provided, but the expected path was null. This means the save should have
            // failed, and so there shouldn't be a file path path.
            if (path != null) {
                assertFalse(new File(path).exists());
            }
        }
    }

    @SmallTest
    @Feature({"Android-WebView"})
    public void testExplicitGoodPath() throws Throwable {
        final String path = new File(getActivity().getFilesDir(), "test.mht").getAbsolutePath();
        File file = new File(path);
        file.delete();
        assertFalse(file.exists());

        loadUrlSync(mTestContainerView.getAwContents(),
                mContentsClient.getOnPageFinishedHelper(), TEST_PAGE);

        doArchiveTest(mTestContainerView.getAwContents(), path, false, path);
    }

    @SmallTest
    @Feature({"Android-WebView"})
    public void testAutoGoodPath() throws Throwable {
        final String path = getActivity().getFilesDir().getAbsolutePath() + "/";

        loadUrlSync(mTestContainerView.getAwContents(),
                mContentsClient.getOnPageFinishedHelper(), TEST_PAGE);

        // Create the first archive
        {
            String expectedPath = path + "index.mht";
            doArchiveTest(mTestContainerView.getAwContents(), path, true, expectedPath);
        }

        // Create a second archive, making sure that the second archive's name is auto incremented.
        {
            String expectedPath = path + "index-1.mht";
            doArchiveTest(mTestContainerView.getAwContents(), path, true, expectedPath);
        }
    }

    @SmallTest
    @Feature({"Android-WebView"})
    public void testExplicitBadPath() throws Throwable {
        final String path = new File("/foo/bar/baz.mht").getAbsolutePath();
        File file = new File(path);
        file.delete();
        assertFalse(file.exists());

        loadUrlSync(mTestContainerView.getAwContents(),
                mContentsClient.getOnPageFinishedHelper(), TEST_PAGE);

        doArchiveTest(mTestContainerView.getAwContents(), path, false, null);
    }

    @SmallTest
    @Feature({"Android-WebView"})
    public void testAutoBadPath() throws Throwable {
        final String path = new File("/foo/bar/").getAbsolutePath();
        File file = new File(path);
        file.delete();
        assertFalse(file.exists());

        loadUrlSync(mTestContainerView.getAwContents(),
                mContentsClient.getOnPageFinishedHelper(), TEST_PAGE);

        doArchiveTest(mTestContainerView.getAwContents(), path, true, null);
    }

}