text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.autofill;

import android.test.suitebuilder.annotation.MediumTest;
import android.view.ViewGroup;

import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
import org.chromium.chrome.test.ChromeActivityTestCaseBase;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.UiUtils;
import org.chromium.ui.autofill.AutofillPopup;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;

/**
 * Integration tests for interaction of the AutofillPopup and a keyboard.
 */
public class AutofillPopupWithKeyboardTest extends ChromeActivityTestCaseBase<ChromeActivity> {

    public AutofillPopupWithKeyboardTest() {
        super(ChromeActivity.class);
    }

    @Override
    public void startMainActivity() throws InterruptedException {
        // Don't launch activity automatically.
    }

    /**
     * Test that showing autofill popup and keyboard will not hide the autofill popup.
     */
    @MediumTest
    @Feature({"autofill-keyboard"})
    public void testShowAutofillPopupAndKeyboardimultaneously()
            throws InterruptedException, ExecutionException, TimeoutException {
        startMainActivityWithURL(UrlUtils.encodeHtmlDataUri(""
                + "<meta name=\"viewport\""
                + "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" />"
                + "<form method=\"POST\">"
                + "<input type=\"text\" id=\"fn\" autocomplete=\"given-name\" />
"
                + "<input type=\"text\" id=\"ln\" autocomplete=\"family-name\" />
"
                + "<textarea id=\"sa\" autocomplete=\"street-address\"></textarea>
"
                + "<input type=\"text\" id=\"a1\" autocomplete=\"address-line1\" />
"
                + "<input type=\"text\" id=\"a2\" autocomplete=\"address-line2\" />
"
                + "<input type=\"text\" id=\"ct\" autocomplete=\"locality\" />
"
                + "<input type=\"text\" id=\"zc\" autocomplete=\"postal-code\" />
"
                + "<input type=\"text\" id=\"em\" autocomplete=\"email\" />
"
                + "<input type=\"text\" id=\"ph\" autocomplete=\"tel\" />
"
                + "<input type=\"text\" id=\"fx\" autocomplete=\"fax\" />
"
                + "<select id=\"co\" autocomplete=\"country\">
"
                + "<option value=\"BR\">Brazil</option>"
                + "<option value=\"US\">United States</option>"
                + "</select>"
                + "<input type=\"submit\" />"
                + "</form>"));
        new AutofillTestHelper().setProfile(new AutofillProfile("", "https://www.example.com",
                "John Smith", "Acme Inc", "1 Main\nApt A", "CA", "San Francisco", "", "94102", "",
                "US", "(415) 888-9999", "john@acme.inc", "en"));
        final AtomicReference<ContentViewCore> viewCoreRef = new AtomicReference<ContentViewCore>();
        final AtomicReference<WebContents> webContentsRef = new AtomicReference<WebContents>();
        final AtomicReference<ViewGroup> viewRef = new AtomicReference<ViewGroup>();
        ThreadUtils.runOnUiThreadBlocking(new Runnable() {
            @Override
            public void run() {
                viewCoreRef.set(getActivity().getCurrentContentViewCore());
                webContentsRef.set(viewCoreRef.get().getWebContents());
                viewRef.set(viewCoreRef.get().getContainerView());
            }
        });
        assertTrue(DOMUtils.waitForNonZeroNodeBounds(webContentsRef.get(), "fn"));

        // Click on the unfocused input element for the first time to focus on it. This brings up
        // the autofill popup and shows the keyboard at the same time. Showing the keyboard should
        // not hide the autofill popup.
        DOMUtils.clickNode(this, viewCoreRef.get(), "fn");

        // Wait until the keyboard is showing.
        assertTrue("Keyboard was never shown.",
                CriteriaHelper.pollForUIThreadCriteria(new Criteria() {
                    @Override
                    public boolean isSatisfied() {
                        return UiUtils.isKeyboardShowing(
                                getActivity(),
                                getActivity().getCurrentContentViewCore().getContainerView());
                    }
                }));

        // Verify that the autofill popup is showing.
        assertTrue("Autofill Popup anchor view was never added.",
                CriteriaHelper.pollForUIThreadCriteria(new Criteria() {
                    @Override
                    public boolean isSatisfied() {
                        return viewRef.get().findViewById(R.id.dropdown_popup_window) != null;
                    }
                }));
        Object popupObject = ThreadUtils.runOnUiThreadBlocking(new Callable<Object>() {
            @Override
            public Object call() {
                return viewRef.get().findViewById(R.id.dropdown_popup_window).getTag();
            }
        });
        assertTrue(popupObject instanceof AutofillPopup);
        final AutofillPopup popup = (AutofillPopup) popupObject;
        assertTrue("Autofill Popup was never shown.",
                CriteriaHelper.pollForUIThreadCriteria(new Criteria() {
                    @Override
                    public boolean isSatisfied() {
                        return popup.isShowing();
                    }
                }));
    }
}


text:
package com.mattrjacobs.hystrix.client.grpc;

import com.mattrjacobs.hystrix.grpc.HelloReply;
import com.mattrjacobs.hystrix.grpc.HelloRequest;
import io.grpc.CallOptions;
import io.grpc.ClientCall;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;

public class ExampleClient {
    private final ManagedChannel channel;

    public ExampleClient(String host, int port) {
        this.channel = ManagedChannelBuilder.forAddress(host, port)
                .usePlaintext(true)
                .build();
    }

    public ClientCall<HelloRequest, HelloReply> async() {
        MethodDescriptor<HelloRequest, HelloReply> descriptor = io.grpc.MethodDescriptor.create(
                MethodDescriptor.MethodType.SERVER_STREAMING,
                MethodDescriptor.generateFullMethodName(
                        "helloworld.Greeter", "SayHello"),
                ProtoUtils.marshaller(com.mattrjacobs.hystrix.grpc.HelloRequest.getDefaultInstance()),
                ProtoUtils.marshaller(com.mattrjacobs.hystrix.grpc.HelloReply.getDefaultInstance()));
        CallOptions callOptions = CallOptions.DEFAULT;
        return channel.newCall(descriptor, callOptions);
    }
}

redpajama_set_name: RedPajamaGithub


text:
module Hobo

  module Controller

    include AuthenticationSupport

    class << self

      def included(base)
        if base.is_a?(Class)
          included_in_class(base)
        end
      end

      def included_in_class(klass)
        klass.extend(ClassMethods)
        klass.class_eval do
          alias_method_chain :redirect_to, :object_url
          @included_taglibs = []
        end
        Hobo::HoboHelper.add_to_controller(klass)
      end

      def controller_and_view_for(page_path)
        page_path.match(/(.*)\/([^\/]+)/)[1..2]
      end

    end

    module ClassMethods

      attr_reader :included_taglibs

      def include_taglib(src, options={})
        @included_taglibs << options.merge(:src => src)
      end

    end

    protected

    def redirect_to_with_object_url(destination, *args)
      if destination.is_a?(String, Hash, Symbol)
        redirect_to_without_object_url(destination)
      else
        redirect_to_without_object_url(object_url(destination, *args))
      end
    end

    def hobo_ajax_response(*args)
      results = args.extract_options!
      this = args.first || @this
      page_path = params[:page_path]
      r = params[:render]
      if r
        ajax_update_response(this, page_path, r.values, results)
        true
      else
        false
      end
    end

    def ajax_update_response(this, page_path, render_specs, results={})
      add_variables_to_assigns
      renderer = Hobo::Dryml.page_renderer(@template, [], page_path) if page_path

      render :update do |page|
        page << "var _update = typeof Hobo == 'undefined' ? Element.update : Hobo.updateElement;"
        for spec in render_specs
          function = spec[:function] || "_update"
          dom_id = spec[:id]

          if spec[:part_context]
            part_name, part_this, locals = Dryml::PartContext.unmarshal(spec[:part_context], this, session)
            part_content = renderer.call_part(dom_id, part_name, part_this, *locals)
            page.call(function, dom_id, part_content)
          elsif spec[:result]
            result = results[spec[:result].to_sym]
            page.call(function, spec[:id], result)
          else
            # spec didn't specify any action :-/
          end
        end
        page << renderer.part_contexts_storage if renderer
      end
    end

    def dryml_context
      @this
    end

    def render_tags(objects, tag, options={})
      for_type = options.delete(:for_type)
      add_variables_to_assigns
      dryml_renderer = Hobo::Dryml.empty_page_renderer(@template)

      results = objects.map do |o|
        tag = dryml_renderer.find_polymorphic_tag(tag, o.class) if for_type
        dryml_renderer.send(tag, options.merge(:with => o))
      end.join

      render :text => results + dryml_renderer.part_contexts_storage
    end

    def site_search(query)
      results = Hobo.find_by_search(query).select{|r| Hobo.can_view?(current_user, r, nil)}
      if results.empty?
        render :text => "
Your search returned no matches.
"
      else
        # TODO: call one tag that renders all the search results with headings for each model
        render_tags(results.map {|r|r.last}.flatten, :search_card, :for_type => true)
      end
    end

    # Store the given user in the session.
    def current_user=(new_user)
      session[:user] = (new_user.nil? || new_user.guest?) ? nil : new_user.typed_id
      @current_user = new_user
    end

    def request_no_cache?
      request.env['HTTP_CACHE_CONTROL'] =~ /max-age=\s*0/
    end

    def not_found

    end

  end
end

class ActionController::Base

  def home_page
    ""
  end

end


text:
import { GraphQLObjectType, GraphQLString } from "graphql"
import {
  ArtworkContextGridType,
  formDefaultGravityArgs,
} from "schema/v1/artwork/artworkContextGrids"
import { artworkConnection } from "schema/v1/artwork"
import { connectionFromArraySlice } from "graphql-relay"
import { artistArtworkArrayLength } from "schema/v1/artist"
import { pageable } from "relay-cursor-paging"

export const ArtistArtworkGridType = new GraphQLObjectType<
  { artist: any; artwork: any },
  any
>({
  name: "ArtistArtworkGrid",
  interfaces: [ArtworkContextGridType],
  fields: () => ({
    title: {
      type: GraphQLString,
      resolve: ({ artist }) => {
        if (!artist) return null
        return `Other works by ${artist.name}`
      },
    },
    ctaTitle: {
      type: GraphQLString,
      resolve: ({ artist }) => {
        if (!artist) return null
        return `View all works by ${artist.name}`
      },
    },
    ctaHref: {
      type: GraphQLString,
      resolve: ({ artist }) => {
        if (!artist) return null
        return `/artist/${artist.id}`
      },
    },
    artworks: {
      type: artworkConnection,
      args: pageable(),
      resolve: ({ artist, artwork }, options, { artistArtworksLoader }) => {
        if (!artist) return null
        const { gravityArgs, offset } = formDefaultGravityArgs({
          options,
          artwork,
        })
        gravityArgs.sort = "-published_at"

        return artistArtworksLoader(artist.id, gravityArgs).then(artworks => {
          if (!artworks) return null

          return connectionFromArraySlice(artworks, options, {
            arrayLength: artistArtworkArrayLength(artist, options.filter),
            sliceStart: offset,
          })
        })
      },
    },
  }),
})


text:
<?php
require_once 'session.php';
require_once 'functions.php';
require_once 'connect.php';

session_destroy();
$stmt = $conn->prepare("DELETE FROM users WHERE id=:id");
$stmt->bindParam(':id', $_SESSION['id']);

if(!$stmt->execute()){
  ecvdphp\addFlashMessage('error', 'Could not delete the user');
} else {
  ecvdphp\addFlashMessage('success', 'Your account has been deleted');
}

ecvdphp\redirect('index.php');


text:
package doc;

import org.mapdb.DB;
import org.mapdb.DBMaker;
import org.mapdb.HTreeMap;

public class htreemap_counter {

    public static void main(String[] args) {
        DB db = DBMaker.memoryDB().make();
        //a
        HTreeMap<String, Long> map = db.hashMapCreate("map")
                .counterEnable()
                .makeOrGet();
        //z
    }
}


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

    Copyright (c) 2002-2015 mgm technology partners GmbH

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<testplan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"	xmlns:xi="http://www.w3.org/2001/XInclude"
		xsi:noNamespaceSchemaLocation="http://mgm-tp.github.io/perfload/schema/1.0/perfload-testplan.xsd">
	<module>com.mgmtp.perfload.core.test.client.FibonacciModule</module>
	<loadProfile>fibonacci.perfload</loadProfile>
	<testJars>
		<testJar>perfload-test-client.jar</testJar>
	</testJars>
	<!--
	<jvmargs>
		<jvmarg>-javaagent:${env.JACOCO_AGENT}=destfile=${sonar.jacoco.reportPath}</jvmarg>
	</jvmargs>
	-->
</testplan>


text:
<?php
App::uses('CroogoHelper', 'Croogo.View/Helper');
App::uses('SessionComponent', 'Controller/Component');
App::uses('AuthComponent', 'Controller/Component');
App::uses('CakeSession', 'Model/Datasource');
App::uses('Controller', 'Controller');
App::uses('CroogoTestCase', 'Croogo.TestSuite');
App::uses('AclHelper', 'Acl.View/Helper');

class TheCroogoTestController extends Controller {

	public $uses = null;

	public $components = array();

}

class CroogoHelperTest extends CroogoTestCase {

	public $fixtures = array(
		'plugin.users.aco',
		'plugin.users.aro',
		'plugin.users.aros_aco',
		'plugin.settings.setting',
		'plugin.users.role',
		'plugin.taxonomy.type',
	);

/**
 * setUp
 */
	public function setUp() {
		parent::setUp();
		$this->ComponentCollection = new ComponentCollection();

		$request = new CakeRequest('nodes/index');
		$request->params = array(
			'controller' => 'nodes',
			'action' => 'index',
			'named' => array(),
		);
		$view = new View(new TheCroogoTestController($request, new CakeResponse()));
		$this->Croogo = new CroogoHelper($view);
		$aclHelper = Configure::read('Site.acl_plugin') . 'Helper';
		$this->Croogo->Acl = $this->getMock(
			$aclHelper,
			array('linkIsAllowedByRoleId'),
			array($view)
		);
		$this->Croogo->Acl
			->expects($this->any())
			->method('linkIsAllowedByRoleId')
			->will($this->returnValue(true));
		$this->menus = CroogoNav::items();
		CroogoNav::clear();
	}

/**
 * tearDown
 */
	public function tearDown() {
		ClassRegistry::flush();
		CroogoNav::items('sidebar', $this->menus);
		unset($this->Croogo);
	}

/**
 * testAdminMenus
 */
	public function testAdminMenus() {
		CakeSession::write('Auth.User', array('id' => 1, 'role_id' => 1));
		CroogoNav::add('contents', array(
			'title' => 'Contents',
			'url' => '#',
			)
		);
		$items = CroogoNav::items();
		$expected = '

 Contents

';
		$result = $this->Croogo->adminMenus(CroogoNav::items());
		$this->assertEquals($expected, $result);
	}

/**
 * testAdminRowActions
 */
	public function testAdminRowActions() {
		$this->Croogo->request->params = array(
			'controller' => 'test',
			'action' => 'action',
		);
		Configure::write('Admin.rowActions.Test/action', array(
			'Title' => 'plugin:example/controller:example/action:index/:id',
		));
		$result = $this->Croogo->adminRowActions(1);
		$expected = array(
			'a' => array(
				'href' => '/example/example/index/1',
				'class',
			),
			'Title',
			'/a',
		);
		$this->assertTags($result, $expected);

		// test row actions with options
		Configure::write('Admin.rowActions.Test/action', array(
			'Title' => array(
				'plugin:example/controller:example/action:index/:id' => array(
					'options' => array(
						'icon' => 'key',
						'title' => false,
					),
				),
			)
		));
		$result = $this->Croogo->adminRowActions(1);
		$expected = array(
			'a' => array(
				'href' => '/example/example/index/1',
				'class',
			),
			'i' => array(
				'class',
			),
			'/i',
			' Title',
			'/a',
		);
		$this->assertTags($result, $expected);

		// test row actions with no title + icon
		Configure::write('Admin.rowActions.Test/action', array(
			'Title' => array(
				'plugin:example/controller:example/action:edit/:id' => array(
					'title' => false,
					'options' => array(
						'icon' => 'edit',
						'title' => false,
					),
				),
			)
		));
		$result = $this->Croogo->adminRowActions(1);
		$expected = array(
			'a' => array(
				'href' => '/example/example/edit/1',
				'class' => 'edit',
			),
			'i' => array(
				'class' => 'icon-edit icon-large',
			),
			'/i',
			' ',
			'/a',
		);
		$this->assertTags($result, $expected);
	}

/**
 * testAdminTabs
 */
	public function testAdminTabs() {
		$this->Croogo->request->params = array(
			'controller' => 'test',
			'action' => 'action',
		);
		Configure::write('Admin.tabs.Test/action', array(
			'Title' => array(
				'element' => 'blank',
				'options' => array(),
			),
		));
		$result = $this->Croogo->adminTabs();
		$expected = '
Title
';
		$this->assertEquals($expected, $result);

		$result = $this->Croogo->adminTabs(true);
		$this->assertContains('test-title', $result);
	}

/**
 * testAdminTabsOptions
 */
	public function testAdminTabsOptions() {
		$this->Croogo->request->params = array(
			'controller' => 'test',
			'action' => 'action',
		);
		$testData = 'hellow world';
		Configure::write('Admin.tabs.Test/action', array(
			'Title' => array(
				'element' => 'tab_options',
				'options' => array(
					'elementData' => array(
						'dataFromHookAdminTab' => $testData,
					),
					'elementOptions' => array(
						'ignoreMissing' => true,
					),
				),
			),
		));
		$result = $this->Croogo->adminTabs();
		$expected = '
Title
';
		$this->assertEquals($expected, $result);

		$result = $this->Croogo->adminTabs(true);
		$this->assertContains($testData, $result);
		$this->assertContains('test-title', $result);
	}

	public function testAdminBoxes() {
		$this->Croogo->request->params = array(
			'controller' => 'test',
			'action' => 'action',
		);
		Configure::write('Admin.boxes.Test/action', array(
			'Title' => array(
				'element' => 'blank',
				'options' => array(),
			),
		));

		$result = $this->Croogo->adminBoxes('Title');
		$this->assertContains('class="box"', $result);
	}

	public function testAdminBoxesAlreadyPrinted() {
		$this->Croogo->params = array(
			'controller' => 'test',
			'action' => 'action',
		);
		Configure::write('Admin.tabs.Test/action', array(
			'Title' => array(
				'element' => 'blank',
				'options' => array(),
			),
		));

		$this->Croogo->adminBoxes('Title');
		$result = $this->Croogo->adminBoxes('Title');
		$this->assertEquals('', $result);
	}

	public function testAdminBoxesAll() {
		$this->Croogo->request->params = array(
			'controller' => 'test',
			'action' => 'action',
		);
		Configure::write('Admin.boxes.Test/action', array(
			'Title' => array(
				'element' => 'blank',
				'options' => array(),
			),
			'Content' => array(
				'element' => 'blank',
				'options' => array(),
			),
		));

		$result = $this->Croogo->adminBoxes();
		$this->assertContains('Title', $result);
		$this->assertContains('Content', $result);
	}

	public function testSettingsInputCheckbox() {
		$setting['Setting']['input_type'] = 'checkbox';
		$setting['Setting']['value'] = 0;
		$setting['Setting']['description'] = 'A description';
		$result = $this->Croogo->settingsInput($setting, 'MyLabel', 0);
		$this->assertContains('type="checkbox"', $result);
	}

	public function testSettingsInputCheckboxChecked() {
		$setting['Setting']['input_type'] = 'checkbox';
		$setting['Setting']['value'] = 1;
		$setting['Setting']['description'] = 'A description';
		$result = $this->Croogo->settingsInput($setting, 'MyLabel', 0);
		$this->assertContains('type="checkbox"', $result);
		$this->assertContains('checked="checked"', $result);
	}

	public function testSettingsInputTextbox() {
		$setting['Setting']['input_type'] = '';
		$setting['Setting']['description'] = 'A description';
		$setting['Setting']['value'] = 'Yes';
		$result = $this->Croogo->settingsInput($setting, 'MyLabel', 0);
		$this->assertContains('type="text"', $result);
	}

	public function testSettingsInputTextarea() {
		$setting['Setting']['input_type'] = 'textarea';
		$setting['Setting']['description'] = 'A description';
		$setting['Setting']['value'] = 'Yes';
		$result = $this->Croogo->settingsInput($setting, 'MyLabel', 0);
		$this->assertContains('</textarea>', $result);
	}

/**
 * testAdminRowAction
 */
	public function testAdminRowAction() {
		$url = array('controller' => 'users', 'action' => 'edit', 1);
		$expected = array(
			'a' => array(
				'href' => '/users/edit/1',
				'class' => 'edit',
			),
			'Edit',
			'/a',
		);
		$result = $this->Croogo->adminRowAction('Edit', $url);
		$this->assertTags($result, $expected);

		$options = array('class' => 'test-class');
		$message = 'Are you sure?';
		$onclick = "return confirm('" . $message . "');";
		if (version_compare(Configure::version(), '2.4.0', '>=')) {
			$onclick = sprintf(
				"if (confirm("%s")) { return true; } return false;",
				$message
			);
		}
		$expected = array(
			'a' => array(
				'href' => '/users/edit/1',
				'class' => 'test-class edit',
				'onclick' => $onclick,
			),
			'Edit',
			'/a',
		);
		$result = $this->Croogo->adminRowAction('Edit', $url, $options, $message);
		$this->assertTags($result, $expected);
	}

/**
 * testAdminRowActionEscapedConfirmMessage
 */
	public function testAdminRowActionEscapedConfirmMessage() {
		$url = array('action' => 'delete', 1);
		$options = array();
		$sure = 'Are you sure?';
		$expected = array(
			'form' => array(
				'action',
				'name',
				'id',
				'style',
				'method',
			),
			'input' => array(
				'type',
				'name',
				'value',
			),
			'/form',
			'a' => array(
				'href' => '#',
				'class' => 'delete',
				'onclick',
			),
			'span' => array(),
			'Del',
			'/span',
			'/a',
		);
		$result = $this->Croogo->adminRowAction('Del', $url, array(), $sure);
		$this->assertTags($result, $expected);
		$quot = '"';
		$this->assertContains($quot . $sure . $quot, $result);
	}

/**
 * testAdminRowActionBulkDelete
 */
	public function testAdminRowActionBulkDelete() {
		$url = '#Node1Id';
		$options = array(
			'rowAction' => 'delete',
		);
		$message = 'Delete this?';
		$expected = array(
			'a' => array(
				'href' => '#Node1Id',
				'data-row-action' => 'delete',
				'data-confirm-message',
			),
			'Delete',
			'/a',
		);
		$result = $this->Croogo->adminRowAction('Delete', $url, $options, $message);
		$this->assertTags($result, $expected);
	}

}


text:
A single and dual date picker, written for angular 2+ projects.

## Code Samples
Setup
```
import { DatePickerUtil, DatePickerConfig } from 'ct-ngx-datepicker';

...

class MyDatePickerConfig extends DatePickerConfig {

}

...

DatePickerUtil.forRoot(new MyDatePickerConfig())
```

Config is optional, more details to come on what options are configurable.

Usage Example
```
<ct-date-picker [(date)]="date1" zIndex="100" formControlName="singlePicker">
    <input #date class="form-control" />
</ct-date-picker>
```
```
<ct-dual-picker [(dateFrom)]="date2" [(dateTo)]="date3" zIndex="100" formControlName="dualPicker">
    <input #dateFrom class="form-control" />
    <input #dateTo class="form-control" />
 </ct-dual-picker>
```

## Installation

```
npm install --save ct-ngx-datepicker
```

## Usage
### Single datepicker
```
<ct-date-picker [(date)]="date1" zIndex="100" formControlName="singlePicker">
    <input #date class="form-control" />
</ct-date-picker>
```
Wrap a input field in the <ct-date-picker> element. Mark the input field with #date

#### Single datepicker parameters
 * date - date model
 * dateChange - Event emitter for notification of date changes
 * zIndex - Allows specification of a custom z-index for the picker.
 * minDate - Minimum allowed date.
 * maxDate - Maximum allowed date.
 * ~~match - Optional regex for properly parsing typed in dates, e.g. mm/dd/yyyy~~ Removed in version 4.0.0
 * globalMode - Sets the starting mode for selecting a date, e.g. Calendar, Year. If no value is specified, Calendar mode is implied.

### Dual Date Picker
```
<ct-dual-picker [(dateFrom)]="date2" [(dateTo)]="date3" zIndex="100" formControlName="dualPicker">
    <input #dateFrom class="form-control" />
    <input #dateTo class="form-control" />
 </ct-dual-picker>
```
Wrap two input fields in the <ct-dual-picker> element. Mark each input #dateFrom and #dateTo respectively.

#### Dual datepicker parameters
 * dateFrom - date model
 * dateTo - date model
 * dateFromChange - Event emitter for notification of date changes
 * dateToChange - Event emitter for notification of date changes
 * zIndex - Allows specification of a custom z-index for the picker.
 * minDate - Minimum allowed date.
 * maxDate - Maximum allowed date.
 * ~~match - Optional regex for properly parsing typed in dates, e.g. mm/dd/yyyy~~ Removed in version 4.0.0
 * globalMode - Sets the starting mode for selecting a date, e.g. Calendar, Year. If no value is specified, Calendar mode is implied.

## Requirements
- Angular 2+ (common, core, forms)
- jQuery 3+ (see note below)
- moment 2

### Why jQuery?
I have already implemented the datepicker using the renderer class to support Angular Universal Apps, and avoid needing jQuery. However at this time renderer is experimental. When it is no longer experimental the code will be updated.

### Why moment?
Because the datepicker returns a moment date, not a string.

## Release Notes
 - 5.0.1 - Fix a bug where the month and year selection was not displaying properly.
 - 5.0.0 -- Angular 4+ is the future!
 - 4.3.0 - 4.4.0 -- The last of the Angular 2 days.
 - 4.2.4 - Fix bug where setting a from date, then clicking to date (dualpicker) without selecting a date and then clicking back into the from date causes an exception because dateTo is undefined.
 - 4.2.3 - Fix bug where dual picker is hidden when clicking on the to input.
 - 4.2.2 - Make jquery typings a dependency, remove unneded styling.
 - 4.2.0 - Date picker is now positioned fixed so it can overflow outside of containers with overflow: hidden/auto.
 - 4.1.0 - Modify positioning on input element to correct location of above positioned date picker.
 - 4.0.5 - Prevent date correction on dual picker from happening till focus is lost on the input.
 - 4.0.4 - This version cannot be found.
 - 4.0.2 - 4.0.3 -- Update the calendar when the minDate / maxDate changes.
 - 4.0.1 -- Include a UMD, because forgetting it breaks the whole thing.
 - 4.0.0 -- Bug fixes for: Positioning of the picker and the min/max windowing if today is outside. Removed the match regex option.
 - 3.2.1 - 3.2.2 -- Remove DatePickerConfig for now, until it's ready for prime time.
 - 3.0.0 - 3.2.0 -- Merge fix for changeDate being called more than once. Merge fix for the date getter using the minDate if no date value is supplied.
 - 2.5.3 -- Update ViewChild syntax. Also fix extra padding, which moved the picker off the input box.
 - 2.5.0 -- Ability to specify a minDate without a maxDate for validation
 - 2.4.0 -- Add ability to specify calendar default mode (globalMode), e.g. month/year.
 - 2.2.3 -- Remove sourcemap from dist build.
 - 2.2.2 -- Fixed bug where dates weren't invalid when cleared
 - 2.2.1 -- Fixed bug with validation on dual date picker.
 - 2.2.0 -- Added regex matching for date validation
 - 2.1.0 -- Added ability to validate dates on range, and moment.isValid
 - 2.0.0 -- Removed unused api parameters. Added basic validation for reactive forms.
 - 1.0.2 -- Notice about new repo.
 - 1.0.1 -- Unspecified bug fixes (sorry, just starting to do this right)
 - 1.0.0 -- Initial Release

 ## Migration Notes
 * From 1.x to 2.x
 ..* Remove references to ctDisabled and inputClass from the datepickers. Instead apply those directly to the transcluded input.
 * From 2.x to 3.x
 ..* We attempted an overhaul of the config, but then aborted. No migration needed if on > 3.2.0
 * From 3.x to 4.x
 ..* Remove the match binding (if used).

## Known Bug
- When using an ISO date (yyyy-mm-dd), the day selected on the calendar picker ends uup being localized for your timezone.


text:
package com.javanetworking;

import java.util.List;

/**
 {@link ImageURLRequestOperation} is a {@link HTTPURLRequestOperation} subclass for downloading images.

 By default {@link ImageURLRequestOperation} accepts the following MIME content types:

 - `image/tiff`
 - `image/jpeg`
 - `image/gif`
 - `image/png`
 - `image/ico`
 - `image/x-icon`
 - `image/bmp`
 - `image/x-bmp`
 - `image/x-xbitmap`
 - `image/x-win-bitmap`
 */
public class ImageURLRequestOperation extends HTTPURLRequestOperation {

    /**
     A static constructor method that creates and returns a {@link ImageURLRequestOperation} instance.
     */
    public static ImageURLRequestOperation operationWithURLRequest(URLRequest request, HTTPCompletion completion) {
        return new ImageURLRequestOperation(request, completion);
    }

    /**
     Instantiate this class and sets the {@link URLRequest}, and the {@link HTTPCompletion} interface.

     This is the preferred constructor.

     @param urlConnection An open {@link URLRequest} to be used for HTTP network access.
     @param completion A {@link HTTPCompletion} instance that handles the completion interface methods.
     */
    public ImageURLRequestOperation(URLRequest request, HTTPCompletion completion) {
        super(request, null);

        this.setCompletion(completion);
    }

    /**
     Get acceptable content types list for current connection. Default values for {@link ImageURLRequestOperation} is:

     - `image/tiff`
     - `image/jpeg`
     - `image/gif`
     - `image/png`
     - `image/ico`
     - `image/x-icon`
     - `image/bmp`
     - `image/x-bmp`
     - `image/x-xbitmap`
     - `image/x-win-bitmap`

     @return A {@code List<String>} with acceptable content types.
     */
    @Override
    protected List<String> getAcceptableContentTypes() {
        return HTTPURLRequestOperation.arrayToList(new String[] { "image/tiff", "image/jpeg", "image/gif", "image/png", "image/ico", "image/x-icon", "image/bmp", "image/x-bmp", "image/x-xbitmap", "image/x-win-bitmap" });
    }

}


text:
{% load static %}
<!-- SLIDER REVOLUTION 5.x SCRIPTS  -->
<!-- Theme Base, Components and Settings -->
<script src="{% static "assets/js/theme-functions.js" %}"></script>

<!-- Custom js file -->
<script src="{% static "assets/js/custom.js" %}"></script>


text:
package com.intellij.ui.components.editors;

import com.intellij.icons.AllIcons;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.TableUtil;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBList;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.EmptyIcon;
import consulo.awt.TargetAWT;
import consulo.ui.image.Image;

import javax.swing.*;
import javax.swing.event.TableModelEvent;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

/**
 * Solves rendering problems in JTable components when JComboBox objects are used as cell
 * editors components. Known issues of using JComboBox component are the following:
 *
1. Ugly view if row height is small enough
 *
2. Truncated strings in the combobox popup if column width is less than text value width
 *

 *   How to use:
 *
1. In get getTableCellEditorComponent method create or use existent
 *   JBComboBoxTableCellEditorComponent instance

 *
2. Init component by calling setCell, setOptions,
 *   setDefaultValue methods
 *
3. Return the instance
 *
 * @author Konstantin Bulenkov
 * @see com.intellij.ui.components.JBComboBoxLabel
 */
public class JBComboBoxTableCellEditorComponent extends JBLabel {
  private JTable myTable;
  private int myRow = 0;
  private int myColumn = 0;
  private final JBList myList = new JBList();
  private Object[] myOptions = {};
  private Object myValue;
  private Function<Object, String> myToString = StringUtil.createToStringFunction(Object.class);
  private final List<ActionListener> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();

  @SuppressWarnings({"GtkPreferredJComboBoxRenderer"})
  private ListCellRenderer myRenderer = new DefaultListCellRenderer() {
    public Icon myEmptyIcon;

    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
      final JLabel label = (JLabel)super.getListCellRendererComponent(list, myToString.fun(value), index, isSelected, cellHasFocus);
      if (value == myValue) {
        label.setIcon(TargetAWT.to(getIcon(isSelected)));
      } else {
        label.setIcon(getEmptyIcon());
      }
      return label;
    }

    private Icon getEmptyIcon() {
      if (myEmptyIcon == null) {
        myEmptyIcon = EmptyIcon.create(getIcon(true).getWidth());
      }
      return myEmptyIcon;
    }

    private Image getIcon(boolean selected) {
      final boolean small = "small".equals(JBComboBoxTableCellEditorComponent.this.getClientProperty("JComponent.sizeVariant"));
      return small
             ? selected ? AllIcons.Actions.Checked_small_selected :  AllIcons.Actions.Checked_small
             : selected ? AllIcons.Actions.Checked_selected : AllIcons.Actions.Checked;
    }
  };

  public JBComboBoxTableCellEditorComponent() {
  }

  public JBComboBoxTableCellEditorComponent(JTable table) {
    myTable = table;
  }

  public void setCell(JTable table, int row, int column) {
    setTable(table);
    setRow(row);
    setColumn(column);
  }

  public void setTable(JTable table) {
    myTable = table;
  }

  public void setRow(int row) {
    myRow = row;
  }

  public void setColumn(int column) {
    myColumn = column;
  }

  public Object[] getOptions() {
    return myOptions;
  }

  public void setOptions(Object... options) {
    myOptions = options;
  }

  @Override
  public void addNotify() {
    super.addNotify();
    initAndShowPopup();
  }

  private void initAndShowPopup() {
    myList.removeAll();
    final Rectangle rect = myTable.getCellRect(myRow, myColumn, true);
    final Point point = new Point(rect.x, rect.y);
    myList.setModel(JBList.createDefaultListModel(myOptions));
    if (myRenderer != null) {
      myList.setCellRenderer(myRenderer);
    }
    JBPopupFactory.getInstance()
      .createListPopupBuilder(myList)
      .setItemChoosenCallback(new Runnable() {
        @Override
        public void run() {
          final ActionEvent event = new ActionEvent(myList, ActionEvent.ACTION_PERFORMED, "elementChosen");
          for (ActionListener listener : myListeners) {
            listener.actionPerformed(event);
          }
          myValue = myList.getSelectedValue();
          TableUtil.stopEditing(myTable);

          myTable.setValueAt(myValue, myRow, myColumn); // on Mac getCellEditorValue() called before myValue is set.
          myTable.tableChanged(new TableModelEvent(myTable.getModel(), myRow));  // force repaint
        }
      })
      .setCancelCallback(new Computable<Boolean>() {
        @Override
        public Boolean compute() {
          TableUtil.stopEditing(myTable);
          return true;
        }
      })
      .createPopup()
      .show(new RelativePoint(myTable, point));
  }

  public Object getEditorValue() {
    return myValue;
  }

  public void setRenderer(ListCellRenderer renderer) {
    myRenderer = renderer;
  }

  public void setDefaultValue(Object value) {
    myValue = value;
  }

  public void setToString(Function<Object, String> toString) {
    myToString = toString;
  }

  public void addActionListener(ActionListener listener) {
    myListeners.add(listener);
  }
}


text:
package org.apereo.cas.web.flow.config;

import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.web.flow.CasWebflowConfigurer;
import org.apereo.cas.web.flow.Pac4jErrorViewResolver;
import org.apereo.cas.web.flow.Pac4jWebflowConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.web.ErrorViewResolver;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.webflow.definition.registry.FlowDefinitionRegistry;
import org.springframework.webflow.engine.builder.support.FlowBuilderServices;

/**
 * This is {@link Pac4jWebflowConfiguration}.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */
@Configuration("pac4jWebflowConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class Pac4jWebflowConfiguration {

    @Autowired
    @Qualifier("loginFlowRegistry")
    private FlowDefinitionRegistry loginFlowDefinitionRegistry;

    @Autowired
    private FlowBuilderServices flowBuilderServices;

    @ConditionalOnMissingBean(name = "pac4jWebflowConfigurer")
    @Bean
    public CasWebflowConfigurer pac4jWebflowConfigurer() {
        final Pac4jWebflowConfigurer r = new Pac4jWebflowConfigurer();
        r.setLoginFlowDefinitionRegistry(loginFlowDefinitionRegistry);
        r.setFlowBuilderServices(flowBuilderServices);
        return r;
    }

    @Bean
    public ErrorViewResolver pac4jErrorViewResolver() {
        return new Pac4jErrorViewResolver();
    }
}


text:
<?php

namespace Bixev\InterventionSdk;

class Exception extends \Exception
{

}