text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>SSM configuration</display-name>
    <!-- 解决工程编码过滤器 -->
    <filter>
        <filter-name>characterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>characterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- 配置文件所在位置 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:spring.xml,classpath:mybatis-spring.xml</param-value>
    </context-param>
    <!-- Spring配置(监听器) -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- SpringMVC配置 -->
    <servlet>
        <servlet-name>springDispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>springDispatcherServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>


text:
$(function() {
	"use strict";

  var i, len;

  var resizeLanding = function () {
		$(".landing").height($(window).height());
	}

	resizeLanding();

  $( window ).resize(function() {
	  resizeLanding();
	});

  $('a.nav[href*=#]:not([href=#])').click(function(e) {
    e.preventDefault();
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {

      var target = $(this.hash);
      if (history.pushState) {
        history.pushState(null, null, this.hash);
      }

      // toggle the menu
      if ($(this).hasClass("menu")) {
        // hide the hamburger menu
        $(".cmn-toggle-switch").click();
      }

      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html,body').animate({
            scrollTop: target.offset().top
          }, 500, function() {
            window.location.hash = target.selector;
          });

        return false;
      }
    }
  });

  // Scroll the window to the anchor
  $(window).scroll(function () {
    if( $(window).scrollTop() > $('#register').offset().top && !($('#register').hasClass('fixed'))){
      $('#register').addClass('fixed');
    } else if ($(window).scrollTop() === 0){
      $('#register').removeClass('fixed');
    }
	});

  // Toggle the hamburger menu
  var toggles = document.querySelectorAll(".cmn-toggle-switch");

  function toggleHandler(toggle) {
    toggle.addEventListener( "click", function(e) {
      e.preventDefault();
      var menu = $("#hamburger");

      if ($(this).hasClass("active")) {
        $(this).removeClass("active");
        menu.removeClass("show");
      } else {
        $(this).addClass("active");
        menu.addClass("show");
      }
    });
  }

  for (i=toggles.length - 1; i >= 0; i--) {
    var toggle = toggles[i];
    toggleHandler(toggle);
  }

  // **********************
  // ACCORDION
  // **********************
  var d = document,
  accordionToggles = d.querySelectorAll('.js-accordionTrigger'),
  setAccordionAria,
  switchAccordion,
  skipClickDelay,
  setAriaAttr;

  skipClickDelay = function(e){
    e.preventDefault();
    e.target.click();
  }

  setAriaAttr = function(el, ariaType, newProperty){
    el.setAttribute(ariaType, newProperty);
  };
  setAccordionAria = function(el1, el2, expanded){
    switch(expanded) {
      case "true":
        setAriaAttr(el1, 'aria-expanded', 'true');
        setAriaAttr(el2, 'aria-hidden', 'false');
        break;
      case "false":
        setAriaAttr(el1, 'aria-expanded', 'false');
        setAriaAttr(el2, 'aria-hidden', 'true');
        break;
      default:
        break;
    }
  };
//function
switchAccordion = function(e) {
  e.preventDefault();
  var thisAnswer = e.target.parentNode.nextElementSibling;
  var thisQuestion = e.target;
  if($(thisAnswer).hasClass('is-collapsed')) {
    setAccordionAria(thisQuestion, thisAnswer, 'true');
  } else {
    setAccordionAria(thisQuestion, thisAnswer, 'false');
  }
    $(thisQuestion).toggleClass('is-collapsed');
    $(thisQuestion).toggleClass('is-expanded');
    $(thisAnswer).toggleClass('is-collapsed');
    $(thisAnswer).toggleClass('is-expanded');

    $(thisAnswer).toggleClass('animateIn');
  };

  for (i=0,len=accordionToggles.length; i<len; i++) {
    accordionToggles[i].addEventListener('click', switchAccordion, false);
  }
  // **********************
  // END ACCORDION
  // **********************

});

redpajama_set_name: RedPajamaGithub


text:
class BaseSessionStore(object):
    def __init__(self, connection):
        self.connection = connection
        self.keys = []

    def set(self, key, val):
        raise NotImplemented()

    def get(self, key):
        raise NotImplemented()

    def refresh_key_timeout(self, key):
        raise NotImplemented()

    def refresh_all_keys(self):
        for key in self.keys:
            self.refresh_key_timeout(key)


text:
* **Authors**: Ib Green and Ravi Akkenapally

Status: Ongoing

## Overview

The vision for our GPGPU support is a collection of code that make it easy to access the power of the GPU from JavaScript. This support code is expected to be provided in the form of JavaScript classes and shader code and shader modules, together with examples and docs.

Use cases include:

* TransformFeedback
* Aggregation
* Contour generation
* Textures (2D and 3D)
* Integer Arithmetic
* Compute Focused Shader Modules
* Unit Testing for Shaders

In general, we will want to expose ourselves to/play with lots of existing code that does GPU compute, to study patterns, refactor code into reusable functions and classes, and move the most promising of those to our gpgpu library.

References

* Blog Post: [Automatic, GPU-based object highlighting in deck.gl Layers](https://medium.com/vis-gl/automatic-gpu-based-object-highlighting-in-deck-gl-layers-7fe3def44c89)

## Release Schedule

* v6.0 (deck.gl)- Jul 2018 - ScreenGridLayer with GPU based grid aggregation.
* v5.2 (luma.gl) - Apr 2018 - New Transform API, for GPGPU use cases.
* v5.1 (luma.gl) - Feb 2018 - Improved Transformfeedback API.
* v5.0 (deck.gl) - Dec 2017 - Automatic, GPU-based object highlighting in deck.gl Layers.

## Features under development

### v6.1

#### Shader Module Unit Testing Framework

Today we have a test suite for the fp64 shader module only. It contains some rather hacky code to get data between GPU and CPU (using textures) so that assertions can be made on the GPU. This code should be generalized so that it is easy (trivial) to add unit tests to all our shader modules.

#### Add Unit Tests to all Shader Modules

See previous.

#### Extend Transform to support WebGL1

Current Transform uses WebGL2 TransformFeedback API and only supported by WebGL2, extend this class to support WebGL1 using float textures, so Transform can be used under WebGL1 and WebGL2.

#### Contour generation on GPU

Marching Squares algorithm used for iso-lines and iso-bands is suitable for GPU implementation. Build Contour Layer that generates iso-lines and iso-bands on GPU.

### v6.2

#### Heatmap generation on GPU

Aggregation can be extended to build heatmaps, where multiple cells are processed in parallel on the GPU.

#### GridLaye:r add GPUAggregation support.

GPUGridLayer with limited features (compared to current GridLayer) is released as experimental layer in v6.0 that perform aggregation on GPU. Extend this layer to support remaining features (aggregation on user provided keys and support for min, max and average aggregation function)

### vNext

#### Support Compute-Focused Shader Modules

The luma.gl shader module system has great potential as a building block for GPGPU. However currently it only supports specific `vs` or `fs` shaders which doesn't fit. Add support for `cs` type shaders and change existing fp32 fp64 etc libs to use that.
Note: this is a shader packaging improvement, not a WebGL compute shader feature.

RFC

#### Build out our library of Math Shader Modules

Fp32 and fp64 are great building blocks. We could add well-designed (api audited), reusable, documented shader modules for complex number support, interval arithmetic, root finding etc.

#### Dynamic Discovery of GPU limitations

Today we sniff driver names to figure out if we need to flip on some fp64 patch path. Instead we could run a shader that checks whether the GPU is actually doing the right thing, and based on the result dynamically flip on the right flags.

This would likely be a simple extension of the Shader Unit Test framework.
Implement WebGL1 fallbacks (TransformFeedback / FloatingPoint textures)
There are a bunch of clever tricks (many available on github) to use textures instead of transform feedback, to encode floating points in RGBA etc. It could make sense to have such tricks packaged up and tested in a GPGPU library.
An application could be to make deck.gl attribute animation work under non-WebGL2 contexts.

Or make Wind example work on WebGL1

#### Existing work

Study existing GPGPU frameworks. See if we can leverage/integrate or if there are good ideas that we can use.

* GPU.js - Break out GPGPU type code from Wind Example Lots of interesting code in the shaders. Some of it can likely be thought of as reusable GPGPU code.

Step 1: Reorganize code inside Wind Example

#### Pre calculate WebMercator Transformations

Currently the same lng/lats are reprojected every frame. Why not use GPGPU to do initial projection as soon as the attribute has been updated? If we do it using a nice GPGPU abstraction the code should remain clean and maintainable.

#### Graph Edge bundling

Perform edge bundling on GPU.

#### Shader module for binning

Add a shader module that performs grid and hexgon binning on GPU. We can take existing shader code from GPU Aggregator for grid binning.

### Ideas: For Discussion

#### Optimized f64 projection module

We are not able to enable fp64 flag on some of our applications (like heaven) due to vast geometry being run through VS transformations. Existing clipping seem to be not enough, so this method explores an idea of clipping early.

In optimized fp64 project module, we can first perform f32 projection and compare these screen space location against viewport (passed as uniforms), if it passes perform f64 projection, if not treat this vertex differently , two possible ways as explained below:
Idea1: For each vertex processed add a varying which will contain 1.0 if inside viewport, if not 0. In FS we can check this varying, if 0, discard the fragment early.

Idea2: Using TF generate two buffers, one containing vertices that passed and the other containing that failed. (this might not handle the cases that are partially visible)

## Appendix: Shipped features

Work items that have been completed are placed here

### v6.0

### ScreenGridLayer with GPU based grid aggregation.

ScreenGridLayer is updated to support aggregation on GPU. Depending on the data set aggregation on GPU can be 10-12X faster and capable of handling large data sets (MM) where CPU version freezes the UI.

### v5.2

#### Transform : Improved Transformfeedback API

This new class provides an easy-to-use interface to Transform Feedback. It hides WebGL API complexity by internally creating and managing all required WebGL objects that are necessary to perform Transform Feedback operations. New demos and existing features (AttributeTransitions) are updated to use this newer class to reduce code complexity.

### v5.1

#### TransformFeedback: Clear up the Confusion!

The luma.gl v5 TF API should be solid, although we keep hearing suggestions it is not. This Likely a mix of TF being hard to understand and some remaining minor bug.

Actions
* Talk to all team members and understand why TF is considered broken
* Provide better luma.gl examples showing API usage
* Write better docs
* Fix any remaining bugs in TransformFeedback / Buffer classes
* Update any TF code/PRs: Wind example and Attribute animation

### v5.0

#### GPU based object highlighting

Picking shader module has been enhanced to support custom and automatic object highlighting. Check [Blogpost](https://medium.com/vis-gl/automatic-gpu-based-object-highlighting-in-deck-gl-layers-7fe3def44c89) for more details.


text:
#ifndef _OS_PORT_H
#define _OS_PORT_H

//Dependencies
#include "os_port_config.h"
#include "compiler_port.h"

//Compilation flags used to enable/disable features
#define ENABLED  1
#define DISABLED 0

//Deprecated API support
#ifndef OS_DEPRECATED_API_SUPPORT
   #define OS_DEPRECATED_API_SUPPORT DISABLED
#elif (OS_DEPRECATED_API_SUPPORT != ENABLED && OS_DEPRECATED_API_SUPPORT != DISABLED)
   #error OS_DEPRECATED_API_SUPPORT parameter is not valid
#endif

#define PTR_OFFSET(addr, offset) ((void *) ((uint8_t *) (addr) + (offset)))

#define timeCompare(t1, t2) ((int32_t) ((t1) - (t2)))

//Miscellaneous macros
#ifndef FALSE
   #define FALSE 0
#endif

#ifndef TRUE
   #define TRUE 1
#endif

#ifndef LSB
   #define LSB(x) ((x) & 0xFF)
#endif

#ifndef MSB
   #define MSB(x) (((x) >> 8) & 0xFF)
#endif

#ifndef MIN
   #define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif

#ifndef MAX
   #define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif

#ifndef arraysize
   #define arraysize(a) (sizeof(a) / sizeof(a[0]))
#endif

//Inifinite delay
#define INFINITE_DELAY ((uint_t) -1)

//Invalid handle value
#define OS_INVALID_HANDLE NULL

//ChibiOS/RT port?
#if defined(USE_CHIBIOS)
   #include "os_port_chibios.h"
//CMSIS-RTOS port?
#elif defined(USE_CMSIS_RTOS)
   #include "os_port_cmsis_rtos.h"
//FreeRTOS port?
#elif defined(USE_FREERTOS)
   #include "os_port_freertos.h"
//Keil RTX port?
#elif defined(USE_RTX)
   #include "os_port_rtx.h"
//Micrium uC/OS-II port?
#elif defined(USE_UCOS2)
   #include "os_port_ucos2.h"
//Micrium uC/OS-III port?
#elif defined(USE_UCOS3)
   #include "os_port_ucos3.h"
//Windows port?
#elif defined(_WIN32)
   #include "os_port_windows.h"
//No RTOS defined?
#else
   #include "os_port_none.h"
#endif

//Delay routines
#define usleep(delay) {volatile uint32_t n = delay * 4; while(n > 0) n--;}
#define sleep(delay) {volatile uint32_t n = delay * 4000; while(n > 0) n--;}

//Deprecated API (conflicts with CMSIS-RTOS API)
#if (OS_DEPRECATED_API_SUPPORT == ENABLED)
   #define osTaskCreate osCreateTask
   #define osTaskCreateStatic osCreateStaticTask
   #define osTaskDelete osDeleteTask
   #define osTaskSuspendAll osSuspendAllTasks
   #define osTaskResumeAll osResumeAllTasks
   #define osTaskSwitch osSwitchTask
   #define osTaskSwitchFromIrq osSwitchTaskFromIsr

   #define osEventCreate osCreateEvent
   #define osEventClose osDeleteEvent
   #define osEventSet osSetEvent
   #define osEventReset osResetEvent
   #define osEventWait osWaitForEvent
   #define osEventSetFromIrq osSetEventFromIsr

   #define osSemaphoreCreate osCreateSemaphore
   #define osSemaphoreClose osCloseSemaphore
   #define osSemaphoreWait osWaitForSemaphore
   #define osSemaphoreRelease osReleaseSemaphore

   #define osMutexCreate osCreateMutex
   #define osMutexClose osDeleteMutex
   #define osMutexAcquire osAcquireMutex
   #define osMutexRelease osReleaseMutex

   #define osDelay osDelayTask
   #define osGetTickCount osGetSystemTime

   #define osMemAlloc osAllocMem
   #define osMemFree osFreeMem
#endif

#endif


text:
import abc

import six

@six.add_metaclass(abc.ABCMeta)
class AbstractVersionHandler(object):

    @abc.abstractmethod
    def get_node_processes(self):
        return

    @abc.abstractmethod
    def get_plugin_configs(self):
        return

    @abc.abstractmethod
    def configure_cluster(self, cluster):
        return

    @abc.abstractmethod
    def start_cluster(self, cluster):
        return

    @abc.abstractmethod
    def validate(self, cluster):
        return

    @abc.abstractmethod
    def scale_cluster(self, cluster, instances):
        return

    @abc.abstractmethod
    def decommission_nodes(self, cluster, instances):
        return

    @abc.abstractmethod
    def validate_scaling(self, cluster, existing, additional):
        return

    @abc.abstractmethod
    def get_edp_engine(self, cluster, job_type):
        return

    @abc.abstractmethod
    def get_edp_job_types(self):
        return []

    @abc.abstractmethod
    def get_edp_config_hints(self, job_type):
        return {}

    @abc.abstractmethod
    def get_open_ports(self, node_group):
        return

    def on_terminate_cluster(self, cluster):
        pass


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/cpb_white"
    android:orientation="vertical"
    tools:context=".ui.activity.FakeJikeActivity">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/heart"
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:background="#63656B">

        <ImageView
            android:id="@+id/iv"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_marginTop="100dp"
            android:contentDescription="@null"
            android:src="@drawable/maomao"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <android.widget.Space
            android:id="@+id/space"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginEnd="20dp"
            android:layout_marginBottom="20dp"
            android:background="@android:color/holo_blue_bright"
            app:layout_constraintBottom_toBottomOf="@+id/iv"
            app:layout_constraintEnd_toEndOf="@+id/iv" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/red_round_card"
            android:gravity="center"
            android:text="Hello World!"
            android:textColor="@android:color/white"
            app:layout_constraintStart_toEndOf="@+id/space"
            app:layout_constraintTop_toBottomOf="@+id/space" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/blue_round_card"
            android:text="11111111"
            android:textColor="@color/white"
            android:translationX="20dp"
            android:translationY="20dp"
            app:layout_constraintBottom_toBottomOf="@id/iv"
            app:layout_constraintEnd_toStartOf="@id/iv" />

        <com.engineer.imitate.ui.widget.FlutteringLayout
            android:id="@+id/flutter_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="10dp" />

        <TextView
            android:id="@+id/count"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginEnd="10dp"
            android:background="@drawable/blue_round_no_padding_card"
            android:paddingStart="6dp"
            android:paddingTop="4dp"
            android:paddingEnd="6dp"
            android:paddingBottom="4dp"
            android:text="测试测试"
            android:textColor="@color/white"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <android.widget.Space
            android:id="@+id/space_1"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginStart="6dp"
            app:layout_constraintStart_toStartOf="@id/count"
            app:layout_constraintTop_toTopOf="@id/count" />

        <com.engineer.imitate.ui.widget.custom.StackViewLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layoutDirection="rtl"
            app:layout_constraintEnd_toEndOf="@id/space_1"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <de.hdodenhof.circleimageview.CircleImageView
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:src="@drawable/maomao" />

            <de.hdodenhof.circleimageview.CircleImageView
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:src="@drawable/maomao" />

            <de.hdodenhof.circleimageview.CircleImageView
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:src="@drawable/maomao" />

        </com.engineer.imitate.ui.widget.custom.StackViewLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:background="@color/colorAccent">

        <View
            android:id="@+id/bg"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/colorPrimary"
            app:layout_constraintBottom_toBottomOf="@id/text"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent" />

        <TextView
            android:id="@+id/text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:paddingBottom="12dp"
            android:text="@string/click"
            android:textColor="@color/white"
            android:textSize="22sp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:background="@drawable/blue_round_no_padding_card"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="@string/app_name"
            android:textColor="@color/white" />

        <ImageView
            android:id="@+id/add"
            android:layout_width="13dp"
            android:layout_height="13dp"
            android:padding="3dp"
            android:src="@drawable/ic_add_white_24dp" />

    </LinearLayout>

    <RelativeLayout
        android:layout_width="50dp"
        android:layout_height="15dp"
        android:layout_margin="10dp"
        android:background="@drawable/blue_round_no_padding_card"
        android:gravity="center"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_margin="3dp"
            android:layout_toStartOf="@id/host"
            android:ellipsize="end"
            android:maxLines="1"
            android:text="111123311133555333"
            android:textColor="@color/white"
            android:textSize="8sp" />

        <ImageView
            android:id="@+id/host"
            android:layout_width="8dp"
            android:layout_height="6dp"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="3dp"
            android:src="@drawable/ic_add_white_24dp" />

    </RelativeLayout>

    <TextView
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="1111"
        android:textSize="33sp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:visibility="visible">

        <com.engineer.imitate.ui.widget.view.AnimationBorder
            android:id="@+id/animation_border"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal">

            <Button
                android:id="@+id/follow"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="3dp"
                android:text="关注" />

        </com.engineer.imitate.ui.widget.view.AnimationBorder>
    </LinearLayout>

    <com.zhy.view.flowlayout.FlowLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:orientation="vertical"
        android:visibility="visible">

        <Button
            android:id="@+id/toast1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="toast1" />

        <Button
            android:id="@+id/toast2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="toast2" />

        <Button
            android:id="@+id/toast3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="toast3" />

        <Button
            android:id="@+id/toast4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="toast4" />
    </com.zhy.view.flowlayout.FlowLayout>

</LinearLayout>


text:
<?php
namespace Wow\WowBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Wow\WowBundle\Entity\News;
use Sonata\AdminBundle\Validator\ErrorElement;

use Knp\Menu\ItemInterface as MenuItemInterface;

class NewsAdmin extends Admin
{
	// setup the default sort column and order
    protected $datagridValues = array(
        '_sort_order' => 'ASC',
        '_sort_by' => 'id'
    );

    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper

            ->add('title')
            ->add('description')
            ->add('date')
            ->add('image')
        ;
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper

            ->add('title')
            ->add('description')
            ->add('date')
            ->add('image')
        ;
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->add('id')
            ->add('title')
            ->add('description')
            ->add('date')
            ->add('image')
	        ->add('_action', 'actions', array(
    	            'actions' => array(
                    'view' => array(),
                    'edit' => array(),
                    'delete' => array(),
                )
            ))
        ;

    }

    protected function configureShowField(ShowMapper $showMapper)
    {
        $showMapper
             ->add('id')
            ->add('title')
            ->add('description')
            ->add('date')
            ->add('image')
        ;
    }

}


text:
//
//  LILLogFormatter.h
//  LILKit
//
//  Created by August Hovland on 08/08/15.
//  Copyright (c) 2015 August Hovland. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>

/**
 *  Custom log formatter for Cocoa LumberJack
 */
@interface LILLogFormatter : NSObject <DDLogFormatter>

@end


text:
package monix.catnap
import cats.effect.IO
import minitest.SimpleTestSuite
import monix.execution.schedulers.ReferenceSchedulerSuite.DummyScheduler

import scala.concurrent.duration._
import scala.util.Success

class ReferenceSchedulerEffectSuite extends SimpleTestSuite {
  test("clock.monotonic") {
    val s = new DummyScheduler
    val clock = SchedulerEffect.clock[IO](s)

    val clockMonotonic = clock.monotonic(MILLISECONDS).unsafeRunSync()
    assert(clockMonotonic > 0)
  }

  test("clock.realTime") {
    val s = new DummyScheduler
    val clock = SchedulerEffect.clock[IO](s)

    val clockRealTime = clock.realTime(MILLISECONDS).unsafeRunSync()
    assert(clockRealTime > 0)
  }

  test("timer.sleep") {
    val s = new DummyScheduler
    val timer = SchedulerEffect.timerLiftIO[IO](s)

    val f = timer.sleep(10.seconds).unsafeToFuture()
    assertEquals(f.value, None)

    s.tick(5.seconds)
    assertEquals(f.value, None)

    s.tick(5.seconds)
    assertEquals(f.value, Some(Success(())))
  }

  test("contextShift.shift") {
    val s = new DummyScheduler
    val contextShift = SchedulerEffect.contextShift[IO](s)

    val f = contextShift.shift.unsafeToFuture()
    assertEquals(f.value, None)

    s.tick()
    assertEquals(f.value, Some(Success(())))
  }

  test("contextShift.evalOn") {
    val s = new DummyScheduler
    val contextShift = SchedulerEffect.contextShift[IO](s)
    val s2 = new DummyScheduler()

    val f = contextShift.evalOn(s2)(IO(1)).unsafeToFuture()
    assertEquals(f.value, None)

    s.tick()
    assertEquals(f.value, None)

    s2.tick()
    assertEquals(f.value, None)
    s.tick()
    assertEquals(f.value, Some(Success(1)))
  }
}


text:
'use strict';

/**
 * Imports
 */
var gulp = require('gulp'),
	plugins = require('gulp-load-plugins')(),
	requireDir = require('require-dir'),
	config = require('./config.json'),
	pkg = require('./package.json'),
	tasks = requireDir('./gulp-tasks');

/** ===================================================
 * 						TASKS
 * ===================================================*/

/**
 * Default task
 *
 * @example
 * gulp
 */
gulp.task('default', ['jshint', 'css', 'inject', 'watch']);

/**----------------------------------------------------
 * Javascript
 */
gulp.task('ng', function() {
	tasks.ng(gulp, config, pkg, function() {
		gulp.start('inject');
	});
});
// Javascript minification
gulp.task('js', ['jshint'], tasks.js(gulp, plugins, config));

// Javascript Linting
gulp.task('jshint', tasks.jshint(gulp, plugins, config));

// Testing
gulp.task('test', ['jshint', 'test:unit', 'test:e2e']);

// End2End tests using Protractor
gulp.task('test:e2e', ['jshint'], tasks.testE2e(gulp, plugins, config));

// Unit tests using Karma and Jasmine
gulp.task('test:unit', ['jshint'], tasks.testUnit());

/**----------------------------------------------------
 * CSS
 */

// css compiling
gulp.task('css', tasks.css(gulp, plugins, config));

/**----------------------------------------------------
 * Watching
 */

// Watch LESS files For Changes
gulp.task('watch', tasks.watch(gulp, plugins, config));

// watch files for changes and reload
gulp.task('serve', tasks.serve(gulp, plugins, config));

// Add required scripts and styles to index.html and karma.conf.js
gulp.task('inject', tasks.inject(gulp, plugins, config));

/**----------------------------------------------------
 * Building
 */

// copy files to public
gulp.task('copy', tasks.copy(gulp, plugins, config));

// copy files to prod
gulp.task('copy:prod', tasks.copyProd(gulp, plugins, config));

// delete copied files
gulp.task('clean', tasks.clean(config));

// optimize images
gulp.task('images', tasks.images(gulp, plugins, config));

// Builds a dist/public version
gulp.task('build', ['clean', 'copy', 'images'], tasks.build(gulp, plugins, config));

// Builds a prod version
gulp.task('build:prod', ['build', 'copy:prod']);


text:
"""autogenerated by genpy from skeleton_markers/ResetPWMRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct

class ResetPWMRequest(genpy.Message):
  _md5sum = "3c73acac87e2052dbc507251ce940f6a"
  _type = "skeleton_markers/ResetPWMRequest"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """int64 reset

"""
  __slots__ = ['reset']
  _slot_types = ['int64']

  def __init__(self, *args, **kwds):
    """
    Constructor. Any message fields that are implicitly/explicitly
    set to None will be assigned a default value. The recommend
    use is keyword arguments as this is more robust to future message
    changes.  You cannot mix in-order arguments and keyword arguments.

    The available fields are:
       reset

    :param args: complete set of field values, in .msg order
    :param kwds: use keyword arguments corresponding to message field names
    to set specific fields.
    """
    if args or kwds:
      super(ResetPWMRequest, self).__init__(*args, **kwds)
      #message fields cannot be None, assign default values for those that are
      if self.reset is None:
        self.reset = 0
    else:
      self.reset = 0

  def _get_types(self):
    """
    internal API method
    """
    return self._slot_types

  def serialize(self, buff):
    """
    serialize message into buffer
    :param buff: buffer, ``StringIO``
    """
    try:
      buff.write(_struct_q.pack(self.reset))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))

  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    :param str: byte array of serialized message, ``str``
    """
    try:
      end = 0
      start = end
      end += 8
      (self.reset,) = _struct_q.unpack(str[start:end])
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill

  def serialize_numpy(self, buff, numpy):
    """
    serialize message with numpy array types into buffer
    :param buff: buffer, ``StringIO``
    :param numpy: numpy python module
    """
    try:
      buff.write(_struct_q.pack(self.reset))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))

  def deserialize_numpy(self, str, numpy):
    """
    unpack serialized message in str into this message instance using numpy for array types
    :param str: byte array of serialized message, ``str``
    :param numpy: numpy python module
    """
    try:
      end = 0
      start = end
      end += 8
      (self.reset,) = _struct_q.unpack(str[start:end])
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill

_struct_I = genpy.struct_I
_struct_q = struct.Struct("<q")
"""autogenerated by genpy from skeleton_markers/ResetPWMResponse.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct

class ResetPWMResponse(genpy.Message):
  _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
  _type = "skeleton_markers/ResetPWMResponse"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """

"""
  __slots__ = []
  _slot_types = []

  def __init__(self, *args, **kwds):
    """
    Constructor. Any message fields that are implicitly/explicitly
    set to None will be assigned a default value. The recommend
    use is keyword arguments as this is more robust to future message
    changes.  You cannot mix in-order arguments and keyword arguments.

    The available fields are:

    :param args: complete set of field values, in .msg order
    :param kwds: use keyword arguments corresponding to message field names
    to set specific fields.
    """
    if args or kwds:
      super(ResetPWMResponse, self).__init__(*args, **kwds)

  def _get_types(self):
    """
    internal API method
    """
    return self._slot_types

  def serialize(self, buff):
    """
    serialize message into buffer
    :param buff: buffer, ``StringIO``
    """
    try:
      pass
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))

  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    :param str: byte array of serialized message, ``str``
    """
    try:
      end = 0
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill

  def serialize_numpy(self, buff, numpy):
    """
    serialize message with numpy array types into buffer
    :param buff: buffer, ``StringIO``
    :param numpy: numpy python module
    """
    try:
      pass
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))

  def deserialize_numpy(self, str, numpy):
    """
    unpack serialized message in str into this message instance using numpy for array types
    :param str: byte array of serialized message, ``str``
    :param numpy: numpy python module
    """
    try:
      end = 0
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill

_struct_I = genpy.struct_I
class ResetPWM(object):
  _type          = 'skeleton_markers/ResetPWM'
  _md5sum = '3c73acac87e2052dbc507251ce940f6a'
  _request_class  = ResetPWMRequest
  _response_class = ResetPWMResponse


text:
// Lucene version compatibility level 4.8.1
using Lucene.Net.Support.Threading;
using RandomizedTesting.Generators;
using System;
using System.Threading;

namespace Lucene.Net.Facet
{

    using IndexInput = Lucene.Net.Store.IndexInput;
    using IndexOutput = Lucene.Net.Store.IndexOutput;
    using IOContext = Lucene.Net.Store.IOContext;
    using RAMDirectory = Lucene.Net.Store.RAMDirectory;

    /// <summary>
    /// Test utility - slow directory
    /// </summary>
    // TODO: move to test-framework and sometimes use in tests?
    public class SlowRAMDirectory : RAMDirectory
    {
        private const int IO_SLEEP_THRESHOLD = 50;

        internal Random random;
        private int sleepMillis;

        public virtual void SetSleepMillis(int sleepMillis)
        {
            this.sleepMillis = sleepMillis;
        }

        public SlowRAMDirectory(int sleepMillis, Random random)
        {
            this.sleepMillis = sleepMillis;
            this.random = random;
        }

        public override IndexOutput CreateOutput(string name, IOContext context)
        {
            if (sleepMillis != -1)
            {
                return new SlowIndexOutput(this, base.CreateOutput(name, context));
            }

            return base.CreateOutput(name, context);
        }

        public override IndexInput OpenInput(string name, IOContext context)
        {
            if (sleepMillis != -1)
            {
                return new SlowIndexInput(this, base.OpenInput(name, context));
            }
            return base.OpenInput(name, context);
        }

        internal virtual void DoSleep(Random random, int length)
        {
            int sTime = length < 10 ? sleepMillis : (int)(sleepMillis * Math.Log(length));
            if (random != null)
            {
                sTime = random.Next(sTime);
            }

            try
            {
                Thread.Sleep(sTime);
            }
            catch (Exception ie) when (ie.IsInterruptedException())
            {
                throw new Util.ThreadInterruptedException(ie);
            }
        }

        /// <summary>
        /// Make a private random. </summary>
        internal virtual Random ForkRandom()
        {
            if (random is null)
            {
                return null;
            }
            return new J2N.Randomizer(random.NextInt64());
        }

        /// <summary>
        /// Delegate class to wrap an IndexInput and delay reading bytes by some
        /// specified time.
        /// </summary>
        private class SlowIndexInput : IndexInput
        {
            private readonly SlowRAMDirectory outerInstance;

            private readonly IndexInput ii;
            private int numRead = 0;
            private readonly Random rand;

            public SlowIndexInput(SlowRAMDirectory outerInstance, IndexInput ii)
                : base("SlowIndexInput(" + ii + ")")
            {
                this.outerInstance = outerInstance;
                this.rand = outerInstance.ForkRandom();
                this.ii = ii;
            }

            public override byte ReadByte()
            {
                if (numRead >= IO_SLEEP_THRESHOLD)
                {
                    outerInstance.DoSleep(rand, 0);
                    numRead = 0;
                }
                ++numRead;
                return ii.ReadByte();
            }

            public override void ReadBytes(byte[] b, int offset, int len)
            {
                if (numRead >= IO_SLEEP_THRESHOLD)
                {
                    outerInstance.DoSleep(rand, len);
                    numRead = 0;
                }
                numRead += len;
                ii.ReadBytes(b, offset, len);
            }

            // TODO: is it intentional that clone doesnt wrap?
            public override object Clone()
            {
                return ii.Clone();
            }

            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    ii.Dispose();
                }
            }

            public override bool Equals(object o)
            {
                return ii.Equals(o);
            }

            public override long Position => ii.Position; // LUCENENET specific: Renamed from getFilePointer() to match FileStream

            public override int GetHashCode()
            {
                return ii.GetHashCode();
            }

            public override long Length => ii.Length;

            public override void Seek(long pos)
            {
                ii.Seek(pos);
            }
        }

        /// <summary>
        /// Delegate class to wrap an IndexOutput and delay writing bytes by some
        /// specified time.
        /// </summary>
        private class SlowIndexOutput : IndexOutput
        {
            private readonly SlowRAMDirectory outerInstance;

            private readonly IndexOutput io;
            private int numWrote;
            private readonly Random rand;

            public SlowIndexOutput(SlowRAMDirectory outerInstance, IndexOutput io)
            {
                this.outerInstance = outerInstance;
                this.io = io;
                this.rand = outerInstance.ForkRandom();
            }

            public override void WriteByte(byte b)
            {
                if (numWrote >= IO_SLEEP_THRESHOLD)
                {
                    outerInstance.DoSleep(rand, 0);
                    numWrote = 0;
                }
                ++numWrote;
                io.WriteByte(b);
            }

            public override void WriteBytes(byte[] b, int offset, int length)
            {
                if (numWrote >= IO_SLEEP_THRESHOLD)
                {
                    outerInstance.DoSleep(rand, length);
                    numWrote = 0;
                }
                numWrote += length;
                io.WriteBytes(b, offset, length);
            }

            [Obsolete]
            public override void Seek(long pos)
            {
                io.Seek(pos);
            }

            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    io.Dispose();
                }
            }

            public override void Flush()
            {
                io.Flush();
            }

            public override long Position => io.Position; // LUCENENET specific: Renamed from getFilePointer() to match FileStream

            public override long Length
            {
                get => io.Length;
                set => throw IllegalStateException.Create("Length is readonly"); // LUCENENET specific: We cannot override get without also overriding set, so we throw if it is set
            }

            public override long Checksum => io.Checksum;
        }
    }
}


text:
layout: post-index
title: My Rumblings
excerpt: "My Thoughts and Some work "
---


text:
import { expect } from 'chai';
import * as types from '../../../app/constants/ActionTypes';
import * as actions from '../../../app/actions/issue';

describe('githubExtension Issue actions', () => {
  it('getIssuesError should create GET_ISSUES_ERROR action', () => {
    expect(actions.getIssuesError('data')).to.eql({
      type: types.GET_ISSUES_ERROR,
      data: 'data',
    });
  });
  it('getAllIssuesSuccess should create GET_ALL_ISSUES_SUCCESS action', () => {
    expect(actions.getAllIssuesSuccess('data')).to.eql({
      type: types.GET_ALL_ISSUES_SUCCESS,
      data: 'data',
    });
  });
  it('getSubscribedIssuesSuccess should create GET_SUBSCRIBED_ISSUES_SUCCESS action', () => {
    expect(actions.getSubscribedIssuesSuccess('data')).to.eql({
      type: types.GET_SUBSCRIBED_ISSUES_SUCCESS,
      data: 'data',
    });
  });
  it('getMentionedIssuesSuccess should create GET_MENTIONED_ISSUES_SUCCESS action', () => {
    expect(actions.getMentionedIssuesSuccess('data')).to.eql({
      type: types.GET_MENTIONED_ISSUES_SUCCESS,
      data: 'data',
    });
  });
  it('getCreatedIssuesSuccess should create GET_CREATED_ISSUES_SUCCESS action', () => {
    expect(actions.getCreatedIssuesSuccess('data')).to.eql({
      type: types.GET_CREATED_ISSUES_SUCCESS,
      data: 'data',
    });
  });
  it('getAssignedIssuesSuccess should create GET_ASSIGNED_ISSUES_SUCCESS action', () => {
    expect(actions.getAssignedIssuesSuccess('data')).to.eql({
      type: types.GET_ASSIGNED_ISSUES_SUCCESS,
      data: 'data',
    });
  });
  it('getIssuesStart should create GET_ISSUES_START action', () => {
    expect(actions.getIssuesStart('data')).to.eql({
      type: types.GET_ISSUES_START,
      data: 'data',
    });
  });
});


text:
<?xml version='1.0' encoding='UTF-8'?>
<com.cloudbees.jenkins.GitHubPushTrigger_-DescriptorImpl>
  <helpRedirect/>
  <manageHook>false</manageHook>
  <credentials/>
</com.cloudbees.jenkins.GitHubPushTrigger_-DescriptorImpl>


text:
 FactoryGirl.define do
   factory :short_answer_card, :class =>MemoryCard do
     question "Factory Question"
     answer  "A"
     question_type "text"
     editing true
     question_choices nil
     category "Personal"
     previous_answers ""
     user_id 1
   end

   factory :multiple_choice_card, :class =>MemoryCard do
     question "Q"
     answer  "A"
     question_type "multiple_choice"
     question_choices "A|B|C|D"
     editing true
     category nil
   end

   factory :admin_user, :class =>User do
     username "admin"
     password  "123"
     password_confirmation "123"
     role "admin"
   end
 end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. natn. Sci. Mus. , Tokyo, B 4(3): 116 (1978)

#### Original name
Nectria scitula Syd.

### Remarks
null


text:
from __future__ import unicode_literals

from django.db import models, migrations
import ckeditor.fields

class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='InformationDetail',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('display_order', models.IntegerField()),
                ('visibility', models.CharField(default=b'Unpusblished', max_length=20, choices=[(b'Published', b'Published'), (b'Unpusblished', b'Unpusblished')])),
                ('title', models.CharField(max_length=50)),
                ('body', ckeditor.fields.RichTextField()),
            ],
            options={
                'abstract': False,
            },
        ),
    ]


text:
'use strict';

angular.module('seaWebApp')
    .controller('HomeCtrl', function($scope, $log, SeawebBackend, User) {
        $scope.submissionFailed = false;
        $scope.submissionSucceeded = false;
        $scope.submissionStatus = '';
        $scope.jobs = [];
        $scope.username = User.username();

        $scope.job = {
            title: '',
            structureFile: null,
            topologyFile: null,
            calculationType: 'dipole',
            iterations: 10,
            surfaceDetail: 8
        };

        $scope.options = {
            calcType: ['dipole', 'quadrupole'],
            iterations: [10, 25, 50, 100, 500],
            surfDetail: [4, 8, 12, 16]
        };

        $scope.closeAlert = function() {
            $scope.submissionFailed = false;
            $scope.submissionSucceeded = false;
            $scope.submissionStatus = '';
        };

        $scope.saveJob = function() {
            var fd = new FormData();
            fd.append('title', $scope.job.title);
            fd.append('structure', $scope.job.structureFile);
            fd.append('topology', $scope.job.topologyFile);
            fd.append('calculation_type', $scope.job.calculationType);
            fd.append('iterations', $scope.job.iterations);
            fd.append('surface_detail', $scope.job.surfaceDetail);

            SeawebBackend.saveJob(fd)
            .success(function(data, status, headers, config) {
                $scope.status = status;
                $log.debug('Job post success');
                $scope.refreshJobs();
                $scope.submissionSucceeded = true;
            })
            .error(function(data, status, headers, config) {
                $scope.status = status;
                $log.debug('Job post failed');
                $scope.refreshJobs();
                $scope.submissionFailed = true;
                $scope.submissionStatus = status;
            });
            $scope.jobForm.$setPristine();
            $scope.job.title = '';
            angular.forEach(
            angular.element("input[type='file']"),
            function(inputElem) {
                angular.element(inputElem).val(null);
            });
        };

        $scope.refreshJobs = function() {
            SeawebBackend.refreshJobs()
            .success(function(data, status) {
                $scope.status = status;
                $scope.jobs = data.results;
                $log.debug('Job refresh success');
            })
            .error(function(data, status) {
                $scope.jobs = data || 'Job refresh failed';
                $scope.status = status;
                $log.debug('Job refresh failed');
            });
        };

        $scope.refreshJobs();
    });


text:
Chapter 4 Queries
---

The following queries are supported:

 - DUAL Table

### 4.1 DUAL Table
DUAL table is a virtual table provided by the system.
Use when executing SQL where access to a base table is not required,
such as when performing tests to get result expressions such as functions and operators.

**Example**

----

In the following example, the current system date is returned.

~~~
SELECT  CURRENT_DATE  "date" FROM DUAL;
    date
------------
 2013-05-14
(1 row)
~~~

----


text:
package org.jboss.pnc.spi.notifications.model;

import org.jboss.pnc.spi.events.BuildCoordinationStatusChangedEvent;
import org.jboss.pnc.spi.events.BuildSetStatusChangedEvent;

public interface NotificationFactory {
    Notification createNotification(BuildCoordinationStatusChangedEvent event);
    Notification createNotification(BuildSetStatusChangedEvent event);
}


text:
package com.hp.autonomy.frontend.find.idol.search;

import com.hp.autonomy.frontend.find.core.search.AbstractDocumentServiceIT;

public class IdolDocumentServiceIT extends AbstractDocumentServiceIT {
}


text:
PYTHONIC_NS_BEGIN

namespace numpy
{
  template <class T, class pS>
  typename std::enable_if<std::tuple_size<pS>::value == 2,
                          types::ndarray<T, types::pshape<long>>>::type
  diag(types::ndarray<T, pS> const &a, long k = 0);

  template <class T, class pS>
  typename std::enable_if<std::tuple_size<pS>::value == 1,
                          types::ndarray<T, types::array<long, 2>>>::type
  diag(types::ndarray<T, pS> const &a, long k = 0);

  template <class T>
  auto diag(types::list<T> const &a, long k = 0)
      -> decltype(diag(asarray(a), k));

  NUMPY_EXPR_TO_NDARRAY0_DECL(diag);
  DEFINE_FUNCTOR(pythonic::numpy, diag);
}
PYTHONIC_NS_END

#endif


text:
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

#ifdef __cplusplus
extern "C" {
#endif

// Get window and screen dimensions
typedef struct {
  struct {
    CGFloat width, height, scale, fontScale;
  } window, screen;
} ABI42_0_0RCTDimensions;
extern __attribute__((visibility("default"))) ABI42_0_0RCTDimensions ABI42_0_0RCTGetDimensions(CGFloat fontScale);

// Get font size multiplier for font base size (Large) by content size category
extern __attribute__((visibility("default"))) CGFloat ABI42_0_0RCTGetMultiplierForContentSizeCategory(
    UIContentSizeCategory category);

#ifdef __cplusplus
}
#endif

NS_ASSUME_NONNULL_END


text:
package com.skyrocketgwt.demo.client.widgets;

import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.TextResource;
import com.skyrocketgwt.demo.client.resources.code.CodeResources;
import com.skyrocketgwt.demo.client.resources.doc.description.DescriptionResources;
import com.skyrocketgwt.demo.client.resources.doc.documentation.DocumentationResources;
import com.skyrocketgwt.demo.client.widgets.images.ImageResources;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by v on 05/08/2015.
 */
public abstract class AbstractWidget implements WidgetDemo {

    @Override
    public String getWidgetName() {
        return getWidgetDescription();
    }

    @Override
    public TextResource getShortDescription(DescriptionResources resources) {
        return new TextResource() {
            @Override
            public String getText() {
                return getWidgetName();
            }

            @Override
            public String getName() {
                return getWidgetName();
            }
        };
    }

    @Override
    public TextResource getDocumentation(DocumentationResources resources) {
        return new TextResource() {
            @Override
            public String getText() {
                return "";
            }

            @Override
            public String getName() {
                return "";
            }
        };
    }

    @Override
    public List<TextResource> getSourceList(CodeResources resources) {
        return new ArrayList<TextResource>();
    }

    @Override
    public ImageResource getImageResource(ImageResources resources) {
        return resources.skySplitLayoutPanel();
    }

    @Override
    public ImageResource getInactiveImageResource(ImageResources resources) {
        return resources.skySplitLayoutPanelBW();
    }

}


text:
package org.r4d5.teamcity.todo.agent;

import jetbrains.buildServer.RunBuildException;
import jetbrains.buildServer.agent.BuildProgressLogger;
import jetbrains.buildServer.agent.artifacts.ArtifactsWatcher;
import org.jetbrains.annotations.NotNull;
import org.r4d5.teamcity.todo.common.InterruptionChecker;
import org.r4d5.teamcity.todo.common.StatusLogger;
import org.r4d5.teamcity.todo.common.TodoBuildRunnerConstants;
import org.r4d5.teamcity.todo.common.TodoScanner;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

public class TodoBuildProcessAdapter extends AbstractBuildProcessAdapter {

    final ArtifactsWatcher artifactsWatcher;
    final File workingRoot;
    final File reportingRoot;
    final List<String> includes;
    final List<String> excludes;
    final List<String> minors;
    final List<String> majors;
    final List<String> criticals;

    public TodoBuildProcessAdapter(
            @NotNull ArtifactsWatcher artifactsWatcher,
            @NotNull BuildProgressLogger logger,
            @NotNull File workingRoot,
            @NotNull File reportingRoot,
            @NotNull List<String> includes,
            @NotNull List<String> excludes,
            @NotNull List<String> minors,
            @NotNull List<String> majors,
            @NotNull List<String> criticals) {
        super(logger);
        this.artifactsWatcher = artifactsWatcher;
        this.workingRoot = workingRoot;
        this.reportingRoot = reportingRoot;
        this.includes = includes;
        this.excludes = excludes;
        this.minors = minors;
        this.majors = majors;
        this.criticals = criticals;
    }

    @Override
    protected void runProcess() throws RunBuildException {
        try {
            // initialize working root path
            final String workingRootCanonicalPath = workingRoot.getCanonicalPath();
            progressLogger.message(String.format("The working root path is [%1$s].", workingRootCanonicalPath));
            final Path workingRootPath = Paths.get(workingRootCanonicalPath);

            // initialize reporting root path
            final String reportingRootCanonicalPath = reportingRoot.getCanonicalPath();
            progressLogger.message(String.format("The reporting root path is [%1$s].", reportingRootCanonicalPath));
            final Path reportingRootPath = Paths.get(reportingRootCanonicalPath, TodoBuildRunnerConstants.TODO_REPORTING_FOLDER);
            Files.createDirectory(reportingRootPath);
            progressLogger.message(String.format("Create directory for reporting [%1$s].", reportingRootPath));

            // initialize the Todo Scanner
            final TodoScanner scanner = new TodoScanner(
                    workingRootPath,
                    reportingRootPath,
                    includes,
                    excludes,
                    minors,
                    majors,
                    criticals);
            final AtomicReference<Exception> scannerException = new AtomicReference<Exception>(null);
            final Runnable interruptibleScanner = new Runnable() {
                public void run() {
                    try {
                        scanner.Run(
                                new InterruptionChecker() {
                                    public boolean isInterrupted() {
                                        return TodoBuildProcessAdapter.this.isInterrupted();
                                    }
                                },
                                new StatusLogger() {
                                    @Override
                                    public void info(String message) {
                                        progressLogger.message(message);
                                    }
                                });
                    } catch (Exception e) {
                        progressLogger.error(e.getMessage());
                        scannerException.set(e);
                    }
                }
            };

            // run the Todo Scanner
            final Thread scannerThread = new Thread(interruptibleScanner);
            scannerThread.start();
            scannerThread.join();

            // register artifacts
            artifactsWatcher.addNewArtifactsPath(reportingRootPath.toString());

            // handle exceptions
            final Exception innerException = scannerException.get();
            if (innerException != null) {
                throw innerException;
            }

        } catch (RunBuildException e) {
            throw e;
        } catch (Exception e) {
            throw new RunBuildException(e);
        } finally {

        }

    }
}


text:
This sample demonstrates how to use Visual Basic to write grain code. The sample consists of three projects:

* Interfaces - a Visual Basic project containing a grain interface, `IHelloGrain`
* Grains - a Visual Basic projects with a class, `HelloGrain`, which implements `IHelloGrain`
* HelloWorld - A C# project to host the grains

The `Microsoft.Orleans.CodeGenerator.MSBuild` package does not support emitting Visual Basic code, however it supports analyzing Visual Basic assemblies and emitting C# code.
Therefore, this sample works by instructing the code generator to analyze the `Grains` project when it is generating code for the `HelloWorld` project.
This is accomplished using the following directive in `HelloWorld`'s `Program.cs` file:

``` C#
[assembly: KnownAssembly(typeof(IHelloGrain))]
[assembly: KnownAssembly(typeof(HelloGrain))]
```

With the above attribute in place, the code generator analyzes the F# assembly and emits C# code into the `HelloWorld` project.

Run the sample by executing the following command:

``` powershell
dotnet run --project HelloWorld
```


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi;

import com.intellij.lang.Language;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public abstract class PsiFileFactory {
  public static final Key<PsiFile> ORIGINAL_FILE = Key.create("ORIGINAL_FILE");

  public static PsiFileFactory getInstance(Project project) {
    return ServiceManager.getService(project, PsiFileFactory.class);
  }

  /**
   * Creates a file from the specified text.
   *
   * @param name the name of the file to create (the extension of the name determines the file type).
   * @param text the text of the file to create.
   * @return the created file.
   * @throws IncorrectOperationException if the file type with specified extension is binary.
   * @deprecated Please use {@link #createFileFromText(String, FileType, CharSequence)} instead,
   * since file type detecting by file extension becomes vulnerable when file type mappings are changed.
   */
  @Deprecated
  @NotNull
  public abstract PsiFile createFileFromText(@NotNull @NonNls String name, @NotNull @NonNls String text) throws IncorrectOperationException;

  @NotNull
  public abstract PsiFile createFileFromText(@NonNls @NotNull String fileName, @NotNull FileType fileType, @NotNull @NonNls CharSequence text) throws IncorrectOperationException;

  @NotNull
  public abstract PsiFile createFileFromText(@NonNls @NotNull String name, @NotNull FileType fileType, @NotNull @NonNls CharSequence text,
                                             long modificationStamp, boolean eventSystemEnabled) throws IncorrectOperationException;

  @NotNull
  public abstract PsiFile createFileFromText(@NonNls @NotNull String name, @NotNull FileType fileType, @NotNull @NonNls CharSequence text,
                                             long modificationStamp, boolean eventSystemEnabled, boolean markAsCopy) throws IncorrectOperationException;

  public abstract PsiFile createFileFromText(@NonNls @NotNull String name, @NotNull Language language, @NotNull @NonNls CharSequence text) throws IncorrectOperationException;

  public PsiFile createFileFromText(@NotNull Language language, @NotNull @NonNls CharSequence text) throws IncorrectOperationException {
    return createFileFromText("foo.bar", language, text);
  }

  public abstract PsiFile createFileFromText(@NonNls @NotNull String name, @NotNull Language language, @NotNull @NonNls CharSequence text,
                                             boolean eventSystemEnabled, boolean markAsCopy) throws IncorrectOperationException;

  public abstract PsiFile createFileFromText(@NonNls @NotNull String name, @NotNull Language language, @NotNull @NonNls CharSequence text,
                                             boolean eventSystemEnabled, boolean markAsCopy, boolean noSizeLimit) throws IncorrectOperationException;

  public abstract PsiFile createFileFromText(@NonNls @NotNull String name, @NotNull Language language, @NotNull @NonNls CharSequence text,
                                             boolean eventSystemEnabled, boolean markAsCopy, boolean noSizeLimit,
                                             @Nullable VirtualFile original) throws IncorrectOperationException;

  public abstract PsiFile createFileFromText(FileType fileType, @NonNls String fileName, @NonNls CharSequence chars, int startOffset, int endOffset) throws IncorrectOperationException;

  @Nullable
  public abstract PsiFile createFileFromText(@NotNull @NonNls CharSequence chars, @NotNull PsiFile original) throws IncorrectOperationException;
}


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

namespace flowgear.Logging.Monitoring
{
    public interface IMonitoredResources
    {
        /// <summary>
        /// Returns a set of snapshots. Only ResourceName and Value need to be populated by this method
        /// </summary>
        /// <returns></returns>
        List<ResourceSnapshot> GetResourceSnapshot();

    }
}


text:
#import <UIKit/UIKit.h>

typedef void(^MoveCellDataSourceUpdateBlock)(NSIndexPath *dstIndexPath, NSIndexPath *srcIndexPath);

@interface UITableView (MoveCell)

/**
 *  长按拖拽TableViewCells,数据源需要在block中更新
 *

 示例用法:

 @property (strong, nonatomic) NSMutableArray *dataForTableView;

 __weak typeof(self) weakSelf = self;

 [self.tableView enableDragCellWithDataSourceUpdateBlock:

    ^(NSIndexPath *dstIndexPath, NSIndexPath *srcIndexPath) {

    [weakSelf.dataForTableView exchangeObjectAtIndex:dstIndexPath.row withObjectAtIndex:srcIndexPath.row];

 }];

 开始用二维指针传递数据源的方式实现,想把整个流程做得更自动化。发现要照顾的细节较多,故改成block由调用方决定数据源的同步操作。

 参考自:http://www.raywenderlich.com/63089/cookbook-moving-table-view-cells-with-a-long-press-gesture

 TODO:UICollectionView实现类似功能
 TODO:拖拽超过屏幕时,调整容器,方便向上或向下移动单元格
 TODO:更自然的动画

 *  @param block 更新数据源
 *
 *  @return 表视图
 */
- (instancetype)enableDragCellWithDataSourceUpdateBlock:(__autoreleasing MoveCellDataSourceUpdateBlock)block;

@end


text:
'use strict';

import * as types from '../constants/SpecActionTypes';

import {valueIsDefined} from '../utils';

export function parseToClientSpec() {
  return (dispatch) => {

    dispatch({
      type: types.PARSE_TO_CLIENT_SPEC
    });
  };
}

export function addTestHookToTrack(args = {}) {
  return (dispatch) => {
    if(!args.hookToAdd) { console.warn("%c {SR} 😤 Hey bro! Where's the hookToAdd value? I'm aint adding nothing. 😕 ", 'color: red'); return;}

    dispatch({
      type:       types.ADD_TEST_HOOK_TO_TRACK,
      hookToAdd:  args.hookToAdd
    });
  };
}

export function addTrackableEvent(eventType) {
  return (dispatch) => {
    dispatch({
      type:       types.ADD_TRACKABLE_EVENT,
      eventType:  eventType
    });
  };
}

export function removeTrackableEvent(eventType) {
  return (dispatch) => {
    dispatch({
      type:       types.REMOVE_TRACKABLE_EVENT,
      eventType:  eventType
    });
  };
}

export function addDescriptor(fileInput) {
  return (dispatch) => {
    function fileInputChangeListener(inputChangeEvent) {
      if(inputChangeEvent.target.files[0]) {
        let file = inputChangeEvent.target.files[0];
        let reader = new FileReader();

        reader.onloadend = (e) => {
          try {
            let newDescriptor = JSON.parse(e.target.result);

            for(let key in newDescriptor) {
              let newDescriptorItem = newDescriptor[key];
              if(!newDescriptorItem.spec || !valueIsDefined(newDescriptorItem.spec.start) || !valueIsDefined(newDescriptorItem.spec.end)){
                throw Error("{SR} 😤 Boy! That's aint a valid descriptor!");
              }
            }

            dispatch({
              type:                 types.ADD_DESCRIPTOR,
              userLoadedDescriptor: newDescriptor
            });
          } catch(e) {
            console.error("{SR} 😤 Well something went wrong when I tried to parse that bro! Make sure that's a valid JSON file! " + (e.massage || e));
          }

          //because that's how you clear the FileList :/
          inputChangeEvent.target.value = '';
        };

        reader.onerror = () => {
          console.error('{SR} 😤 Well something when I tried to load that file bro!');
        };

        reader.readAsText(file);
      }

      fileInput.removeEventListener('change', fileInputChangeListener);
    };

    if(fileInput) {
      fileInput.addEventListener('change', fileInputChangeListener);
    }
  };
}


text:
MobileApp = function(name, options) {
  if (MobileApp.instance) {
    return MobileApp.instance
  } else if (this != window) {
    MobileApp.instance = this;
  }
  this.name = name
  // set up application options.
  this.options = {
    'clickEvent': 'click',
    'panelTransitionTime': 300,
    'scale': 400,
    'menuFont': '2em'
  }
  if (options) {
    for (var i in options) {
      this.options[i] = options[i];
    }
  }
  if (this.options.scale) {
    this.scale(this.options.scale);
  }
  this.browser = this.detectBrowser();
  this.actionBar = new ActionBar(name);
  $('title').html(name);
  this.content = $('

');
  this.storage = new Storage(name + ' storage');
  this.settings = new Storage(name + ' settings');
  $(document.body).append(this.content);
  $(window).on('hashchange', (function() {
    this.loadView(location.hash.substring(1));
  }).bind(this));
//  this.emulateSwipe(); // broken
  // iOS7 status bar background
  if (this.browser.iOS && this.browser.iOS.version.major >= 7 &&
      this.browser.webview) {
    var statusHeight = 20 / this.zoom;
    $(document.body).css('border-top', statusHeight + 'px solid #ccc');
    this.actionBar.container.css('border-top', statusHeight + 'px solid #ccc');
  }
  return this;
}

/**
 * This is only designed to detect mobile browsers for now. Results on Desktop
 * browsers may be unpredictable.
 *
 * TODO: Fix this for tablet and desktop browser detection.
 */
MobileApp.prototype.detectBrowser = function() {
  var browser = {};
  if (/(iPhone|iPad)/.exec(navigator.userAgent)) {
    browser.iOS = {};
    browser.iOS.version = {}
    $(document.body).addClass('iOS');
    var version = /OS (\d+)_(\d+)(?:_(\d+))?/.exec(navigator.userAgent);
    if (version.length > 1) {
      browser.iOS.version.major = Number(version[1]);
    }
    if (version.length > 2) {
      browser.iOS.version.minor = Number(version[2]);
    }
    if (version.length > 3) {
      browser.iOS.version.rev = Number(version[3]);
    }
    if (/Mac OS/.exec(navigator.userAgent)) {
      browser.iOS.safari = true;
    }
    if (/CriOS/.exec(navigator.userAgent)) {
      browser.iPhone.chrome = true;
    }
    if (/iPad/.exec(navigator.userAgent)) {
      browser.tablet = true;
      $(document.body).addClass('tablet');
    }
    browser.webview = !/Safari/.exec(navigator.userAgent);
  }
  if (/Android/.exec(navigator.userAgent)) {
    browser.android = {}
    browser.android.version = {}
    $(document.body).addClass('android');
    var version = /Android (\d+)\.(\d+)(?:\.(\d+))?/.exec(navigator.userAgent);
    if (version.length > 1) {
      browser.android.version.major = Number(version[1]);
    }
    if (version.length > 2) {
      browser.android.version.minor = Number(version[2]);
    }
    if (version.length > 3) {
      browser.android.version.rev = Number(version[3]);
    }
    if (/Chrome\//.exec(navigator.userAgent)) {
      browser.android.chrome = true;
    } else {
      browser.webview = true;
    }
    if (!/Mobile Safari/.exec(navigator.userAgent)) {
      browser.tablet = true;
      $(document.body).addClass('tablet');
    }
  }
  return browser;
}

MobileApp.prototype.request = function(settings) {
  return new AjaxRequest(settings);
}

MobileApp.prototype.requireAuth = function(authURL, deauthURL) {
  this.authURL = authURL;
  this.deauthURL = deauthURL;
}

MobileApp.prototype.scale = function(width) {
  if (width) {
    this.zoom = $(window).width() / width;
    $(document.body).css('zoom', this.zoom);
  }
  return this.zoom;
}

MobileApp.prototype.width = function() {
    return $(window).width() / Number($(document.body).css('zoom'));
}

MobileApp.prototype.initPanels = function(selector) {
  if (!selector)
    selector = '.view_panel';
  this.panels = {};
  this.panels.elements = $(selector);
  this.panels.elements.css('position', 'absolute').
    css('left', this.width()).
    css('width', this.width()).hide().
    first().css('left', 0).show();
  this.panels.current = 0;
}

MobileApp.prototype.showMessage = function(message, duration) {
  if (!duration)
    duration = 2000;
  if (!this.messageBox) {
    this.messageBox = $('

');
    this.messageBox.css({
      'position': 'fixed',
      'bottom': '25%',
      'width': '50%',
      'margin-left': '25%',
      'text-align': 'center',
      'background-color': '#333',
      'border': '1px solid #aaa',
      'color': 'white',
      'padding': '0.5em',
      'opacity': 0,
      'z-index': 10
    });
  }
  if (this.messageBox.parent().length) {
    // a message is already being displayed - wait for it.
    setTimeout(this.showMessage.bind(this, message, duration), 100);
    return;
  }
  this.messageBox.html(message);
  $(document.body).append(this.messageBox);
  this.messageBox.animate({'opacity':1}, 1000);
  var hideMessage = (function() {
    this.messageBox.animate({'opacity':0}, 1000, (function(){
      this.messageBox.detach();
    }).bind(this));
  }).bind(this)
  setTimeout(hideMessage, duration)
}

MobileApp.prototype.showPanel = function(index) {
  if (this.panels.current < index) {
    $(this.panels.elements[this.panels.current]).
        animate({'left': -this.width()},
        this.options.panelTransitionTime);
    $(this.panels.elements[index]).show().animate({'left': 0},
        this.options.panelTransitionTime);
    for (var i = this.panels.current+1; i < index; i++) {
      $(this.panels.elements[i]).css('left', -this.width()).hide();
    }
  } else if (this.panels.current > index) {
    $(this.panels.elements[this.panels.current]).animate({
      'left': this.width()
    }, this.options.panelTransitionTime, function() { $(this).hide(); });
    $(this.panels.elements[index]).show().animate({'left': 0},
        this.options.panelTransitionTime);
    for (var i = index+1; i < this.panels.current; i++) {
      $(this.panels.elements[i]).css('left', this.width()).hide();
    }
  }
  this.panels.current = index;
}

MobileApp.prototype.mustache = function(element, values) {
  if (values === undefined) {
    values = element;
    element = this.content;
  }
  var newContent = $(element).mustache(values);
  $(element).empty()
  $(element).append(newContent);
}

/*
 * Emulate swipes in javascript. This doesn't work yet.
 */
MobileApp.prototype.emulateSwipe = function() {
  // emulate 'swipe' events
  $(document.body).capture('touchstart', (function(evt) {
    e = evt;
    this.touchInfo = {
      startX: evt.pageX,
      startY: evt.pageY,
      startTime: new Date().getTime(),
      lastX: evt.pageX,
      lastY: evt.pageY,
      maxForce: 0
    };
  }).bind(this));

  $(document.body).on('touchmove', (function(evt) {
    var x = evt.originalEvent.targetTouches[0].pageX;
    var y = evt.originalEvent.targetTouches[0].pageY;
    window.scrollBy(this.touchInfo.lastX - x, this.touchInfo.lastY - y);
    if (this.touchInfo) {
      this.touchInfo.lastX = x
      this.touchInfo.lastY = y
      var force = evt.originalEvent.targetTouches[0].webkitForce || 0;
      if (force > this.touchInfo.maxForce)
        this.touchInfo.maxForce = force;
    }
    evt.preventDefault();
    evt.stopPropagation();
  }).bind(this));

  $(document.body).capture('touchend', (function(evt) {
    if (this.touchInfo) {
      var deltaX = evt.changedTouches[0].pageX - this.touchInfo.startX;
      var deltaY = this.touchInfo.startY - evt.changedTouches[0].pageY;
      app.showMessage(deltaX)
      var r = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
      if (r > $(window).width() / 4) {
        var theta = Math.atan2(deltaY, deltaX);
        var swipe = {
          type: 'swipe',
          duration: new Date().getTime() - evt.startTime,
          startX: this.touchInfo.startX,
          startY: this.touchInfo.startY,
          endX: evt.changedTouches[0].pageX,
          endY: evt.changedTouches[0].pageY,
          r: r,
          theta: theta,
          maxForce: this.touchInfo.maxForce
        };
        $(document.body).trigger('swipe', swipe);
        evt.stopPropagation();
        evt.preventDefault();
        // temporary?
        (function() {
          this.handleSwipe(swipeEvent);
        }).bind(MobileApp());
      }
    }
  }).bind(this));
}

MobileApp.prototype.handleSwipe= function(username, password, options) {

}

MobileApp.prototype.authenticate = function(username, password, options) {
  this.request({
      url: this.authURL,
      data: { 'username': username, 'password':password },
      type: 'post',
      dataType: 'json'
  }).done(this.performAuth.bind(this, options)).error(
    (function(options) {
      // do somthing more elegant than 'alert'
      this.showMessage('There was an error during authentication');
      this.loadView(options.fail)
  }).bind(this, options));
}

MobileApp.prototype.isAuthenticated = function(options) {
  this.request({
      url: this.authURL,
      type: 'get',
      dataType: 'json'
  }).done(this.performAuth.bind(this, options)).error(
        this.loadView.bind(this, options.fail));
}

MobileApp.prototype.performAuth = function(options, response) {
  if (response.userid) {
    this.userid = response.userid;
    this.loadView(options.success)
  } else {
    this.loadView(options.fail)
  }
}

MobileApp.prototype.logout = function() {
  if (this.deauthURL) {
    this.request({
        url: this.deauthURL,
        dataType: 'json'
    }).done((function(response) {
        this.showMessage(response.message);
        setTimeout(this.loadView.bind(this, 'login'), 1000);
    }).bind(this));
  } else {
    this.showMessage("Logout is not enabled");
  }
}

MobileApp.prototype.initMenu = function(items) {
  this.menu = new MainMenu(items)
  this.actionBar.setAction('menu')
  return this;
}

MobileApp.prototype.initViews = function(views) {
  this.views = views;
  if (location.hash) {
    this.loadView(location.hash.substring(1));
  }
  return this;
}

MobileApp.prototype.createItemDetailView = function() {
  this.itemDetailView = new ItemDetailView(this.content, this.content);
  return this.itemDetailView;
}

MobileApp.prototype.setViewHTML = function(html) {
  this.content.html(html);
}

MobileApp.prototype.loadView = function(view) {
  if (!view) {
    return;
  }
  if (view.contains('/')) { // temporary
    return;
  }
  if (this.currentView) {
    this.unloadResources(this.currentView.resources.slice(0));
    if (this.currentView.unload) {
    this.currentView.unload();
  }
  }
  this.currentView = this.views[view];
  if (!this.currentView) {
    return;
  }
  this.loadResources(
    // load any resources first
    ((this.currentView.resources) ? this.currentView.resources.slice(0).reverse()
      : undefined),
    // load the view html
    (function() {
      if (location.hash != '#'+view)
        location.hash = view;
      if (this.currentView.html) {
        this.content.load(this.currentView.html, (function(view, data) {
          if (view.title) {
            this.setTitle(view.title);
          }
          if (view.init) {
            view.init();
          }
          this._fireEvent('contentLoaded')
        }.bind(this, this.currentView)));
      } else {
        this.content.empty();
        // run any initialization code after html is loaded
        if (this.currentView.init) {
          this.currentView.init();
        }
        this.setTitle(this.currentView.title);
      }
      if (this.currentView.actionBar) {
        this.actionBar.setAction(this.currentView.actionBar);
      }
    }).bind(this)
  );
  return this;
}

/* Event handling */
MobileApp.prototype.listeners = {};
MobileApp.prototype.on = function(evt, func) {
  this.listeners[evt] = this.listeners[evt] || [];
  this.listeners[evt].push(func);
}

MobileApp.prototype._fireEvent = function(evt) {
  // put the arguments into an array
  var args = []
  Array.prototype.push.apply(args, arguments);
  args[0] = this;
  if (this.listeners[evt]) {
    for (var i in this.listeners[evt]) {
      this.listeners[evt][i].apply(this);
    }
  }
}
/* End event handling */

MobileApp.prototype.setTitle = function(text) {
  this.actionBar.setTitle(text);
}

MobileApp.prototype.loadResources = function(resources, complete) {
  if (!resources || !resources.length) {
    if (complete) {
      return complete();
    }
    return;
  }
  var resource = resources.pop();
  this.loadResource(resource, undefined,
      this.loadResources.bind(this, resources, complete));
}

MobileApp.prototype.unloadResources = function(resources, complete) {
  if (!resources || !resources.length) {
    if (complete) {
      return complete();
    }
    return;
  }
  var resource = resources.pop();
  this.unloadResource(resource, undefined,
      this.unloadResources.bind(this, resources, complete));
}

MobileApp.prototype.loadResource = function(resource, type, complete) {
  // autodetect the resource type
  if (type == 'css' || resource.substring(resource.length - 4) == '.css') {
    if (!$('link[href="'+resource+'"]').length) {
      $('head').append($('<link rel="stylesheet" type="text/css" href="'+
          resource+'">'));
    }
    if (complete)
      complete();
  }
  else if (type == 'js' || resource.substring(resource.length - 3) == '.js') {
      $.getScript(resource, complete);
  }
  else // unable to determine the type. abort.
    return;
}

MobileApp.prototype.unloadResource = function(resource, type, complete) {
  // autodetect the resource type
  if (type == 'css' || resource.substring(resource.length - 4) == '.css') {
    $('link[href="'+resource+'"]').detach();
    if (complete)
      complete();
  }
  else if (type == 'js' || resource.substring(resource.length - 3) == '.js') {
    // TODO: figure out how to disable or remove scripts.
  }
  else // unable to determine the type. abort.
    return;
}

// find a home for this
function roundCircles() {
  $('.circle').each(function() {
    $(this).css('height', $(this).css('width'));
  });
}

ActionBar = function(title) {
  if (ActionBar.instance) {
    return ActionBar.instance;
  }
  ActionBar.instance = this;
  this.container = $('#actionBar')
  if (!this.container.length) {
    this.container = $('

');
    this.title = $('
')
    this.container.append(this.title);
    this.buttons = {};
    this.addButton({
      name: "menu",
      icon: "img/menu_icon.svg",
      action: function( ) {
        MobileApp().menu.show()
      }
    });
    this.addButton({
      name: "back",
      icon: "img/back_icon.svg",
      action: function( ) {
        history.go(-1);
      }
    });
    $(document.body).prepend(this.container);
  }
  if (title) {
    this.title.html(title);
  }
  return this;
}

ActionBar.prototype.setColor = function(color) {
  this.container.css('background-color', color);
}

ActionBar.prototype.setAction = function(type) {
  if (type == 'menu') {
      this.showButton('menu', true);
      this.showButton('back', false);
  } else if (type == 'back') {
      this.showButton('menu', false);
      this.showButton('back', true);
  } else if (type == 'none') {
      this.showButton('menu', false);
      this.showButton('back', false);
  }
  if (this.iconAction)
    this.iconBox.on(MobileApp().options.clickEvent, this.iconAction)
  return this;
}

ActionBar.prototype.hide = function() {
  this.container.hide();
}

ActionBar.prototype.show = function() {
  this.container.show();
}

ActionBar.prototype.setTitle = function(title) {
  this.title.html(title)
}

ActionBar.prototype.addButton = function(options) {
    options.side = options.side || "left";
    options.container =  $('

').css('float', options.side);
    if (options.action)
        options.container.click(options.action);
    this.buttons[options.name] = options;
    this.title.before(options.container);
}

ActionBar.prototype.showButton = function(name, show) {
    if (!this.buttons[name]) {
        console.log("No button named " + name);
        return;
    }
    if (show) {
        this.buttons[name].container.show();
    } else {
        this.buttons[name].container.hide();
    }
}

MainMenu = function(itemOptions) {
  this.container = $('

').css({
    'position': 'fixed',
    'top': 0,
    'left': 0,
    'width': '75%',
    'height': '100%',
    'background-color': 'white',
    'z-index': 3,
    'font-size': '1em'
  });
  this.element = $('

');
  this.overlay = ($('

'));
  this.overlay.hide();
  this.overlay.on(MobileApp().options.clickEvent, (function() {
    this.hide();
  }).bind(this));
  $(document.body).prepend(this.overlay);
  this.container.append(this.element);
  this.items = [];
  for (i in itemOptions) {
    this.add(itemOptions[i]);
  }
  $(document.body).prepend(this.container);
  // hide the menu
  this.container.css('left', -this.container.width());

  // open the menu when the user swipes.
  $(document.body).on('swipe', (function(evt) {
    if (evt.startX < $(window).width() / 10
        && Math.abs(evt.theta) < Math.PI / 8) {
      this.show();
    }
  }).bind(this));
  // listen for the menu button on devices that have one
  document.addEventListener("menubutton", function () {
    if (this.showing) {
      this.hide();
    } else {
      this.show();
    }
  }.bind(this), false);
  return this;
}

MainMenu.prototype.add = function(options) {
  var newItem = new MenuItem(options);
  this.items.push(newItem);
  this.element.append(newItem.element);
  this.enabled = true;
  return this;
}

MainMenu.prototype.remove = function(name) {
  return this;
}

MainMenu.prototype.trigger = function(menuItem) {
  menuItem.action();
  return this;
}

MainMenu.prototype.show = function() {
  if (this.enabled) {
    this.overlay.show();
    this.container.animate({'left': 0}, 100);
  }
  this.showing = true;
}

MainMenu.prototype.hide = function() {
  this.overlay.hide();
  this.container.animate({'left': -this.container.width()}, 100);
  this.showing = false;
}

MainMenu.prototype.setEnabled = function(enabled) {
  this.enabled = !!enabled;
  if (!enabled) {
    this.hide();
  }
}

MenuItem = function(options) {
  this.element = $("

");
  this.action = options.action;
  this.element.on(MobileApp().options.clickEvent, this.action);
  this.setName(options.name);
  this.setIcon(options.icon);
}

MenuItem.prototype.setName = function(name) {
  this.name = name
  this.update()
}

MenuItem.prototype.setIcon = function(icon) {
  this.icon = icon
  this.update()
}

MenuItem.prototype.update = function() {
  if (this.icon) {
    var iconImg = $('');
    // Android webkit doesn't handle svg sizing correctly, so don't use it there
    this.element.html('

' + this.name);
    if (this.icon.size) {
      this.element.find('div.icon').css({
        'width':  this.icon.size[0],
        'height': this.icon.size[1],
        'float': 'left',
        'margin-right': '0.5em'
      }).append(iconImg);
    }
  } else {
    this.element.html(this.name);
  }
}

/*
Function: MobileApp.log
  Prints a message to console.log if it is available.

Arguments:
  String[s] to be printed to the logger

Returns:
  True if console.log is available, false otherwise

 */
MobileApp.prototype.log = function( ) {
  if ( window.console && console.log ) {
    for ( var i = 0; i < arguments.length; i++ ) {
      console.log( arguments[ i ] );
    }
    return true;
  }
  return false;
}

/**
 * Gets or sets a cookie.
 *
 * @param key The key for the cookie to be set or retrieved.
 * @param value (optional) The new value for the cookie. If omitted, the
 *  current value of the cookie is returned. If null is passed, the cookie is
 *  deleted.
 * @return The current value of the cookie if value is omitted. Otherwise
 *  returns the new complete cookie string.
 */
MobileApp.prototype.cookie=function(key, value){
  var f=encodeURIComponent(key);
  if(value === undefined){
    var result = new RegExp("(?:^|;)\\s*"+f+"=([^;]*)(?:;|$)").exec(document.cookie);
    if(result){
      return decodeURIComponent(result[1])
    }else{
      return undefined
    }
  }else{
    if(value === null){
      return document.cookie = key+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"
    } else {
      return document.cookie = key+"="+value
    }
  }
};

DynamicStyle = function( selector, rule ) {
  var style;
  if (DynamicStyle.instance) {
    style = DynamicStyle.instance
  } else if (this != window) {
    style = DynamicStyle.instance = this;
  } else {
    style = new DynamicStyle()
  }
  if (!style.element) {
    // add a new style element to the DOM.
    style.element = $("");
    $('head').append( this.element );
  }
  // if any new rules were passed in, add them.
  if (selector) {
    if (rule) {
      style.add(selector, rule);
    } else {
      style.addRaw(selector)
    }
  }
  return style;
}

DynamicStyle.prototype.add = function( selector, rule ) {
  this.element.text( this.element.text( ) + selector + "{" + rule + "}" );
}

DynamicStyle.prototype.addRaw = function( rules ) {
  this.element.text( this.element.text( )  + rules );
}

DynamicStyle.prototype.clear = function( ) {
  this.element.text('');
}

DynamicStyle.prototype.remove = function( selector, rule ) {
  this.element.text( this.element.text( ).replace(
      selector + "{" + rule + "}", "" ));
}

ItemDetailView = function(listContainer, detailContainer) {
  this.container = $(listContainer);
  this.detailContainer = $(detailContainer);
  this.listElement = $('

');
  this.detailElement = $('

');
  this.container.append(this.listElement);
  this.items = {}
  this.detailCallback = (function(html) {
    this.listElement.detach();
    this.detailElement.html(html);
    this.container.append(this.detailElement);
  }).bind(this);
  return this;
}

ItemDetailView.prototype.createItem = function(options) { // itemId, itemName, detailFunc, icon) {
  options.callback = this.detailCallback;
  var item = new Item(options);
  this.items[options.id] = item;
  this.listElement.append(item.element);
//  MobileApp()._fireEvent('contentLoaded')
  return item;
}

ItemDetailView.prototype.showDetail = function(itemId) {
  this.items[itemId].detail();
}

Item = function(options) { //id, name, detailFunc, detailCallback, icon) {
  this.id = options.id;
  this.detail = options.detail;
  this.detailCallback = options.callback;
  this.element = $('
'+options.content+'
');
  if (options.icon) {
    this.icon = $('

');
    this.element.addClass('withIcon');
    this.element.prepend(this.icon);
  }
  this.element.on(MobileApp().options.clickEvent, (function() {
    return this.showDetail();
  }).bind(this));
  return this;
}

Item.prototype.showDetail = function() {
  location.hash = location.hash + '/' + this.id
  ActionBar().setAction('back');
  this.detail(this.detailCallback);
}

// set up jQuery ajax to send cookies to other domains
$(function() {
  $.ajaxSetup({
      dataType: 'json',
      xhrFields: {
         withCredentials: true
      },
      crossDomain: true
  });
});

// A wrapper around jquery's ajax implementation which will manually
// handle session cookies so they don't time out.
AjaxRequest = function(settings) {
  if (this != window) {
    settings.Cookie = localStorage.getItem('session')
    settings.dataType = 'json';
    this.jqXHR = $.ajax(settings);
    return this;
  }
}

AjaxRequest.concurrent = 0;

AjaxRequest.prototype.abort = function(statusText)  {
  this.jqXHR.abort(statusText);
  return this;
}

AjaxRequest.prototype.always = function(func) {
  this.jqXHR.always(function(response) {
    this.getSession();
    func.apply(arguments);
    func.apply(this, arguments);
  }.bind(this));
  return this;
}

AjaxRequest.prototype.complete = function(func) {
  this.jqXHR.complete(function(response) {
    this.getSession();
    func.apply(this, arguments);
  }.bind(this));
  return this;
}

AjaxRequest.prototype.done = function(func) {
  this.jqXHR.done(function(response) {
    this.getSession();
    func.apply(this, arguments);
  }.bind(this));
  return this;
}

AjaxRequest.prototype.error = function(func) {
  this.jqXHR.error(function(response) {
    this.getSession();
    func.apply(this, arguments);
  }.bind(this));
  return this;
}

AjaxRequest.prototype.fail = function(func) {
  this.jqXHR.fail(function(response) {
    this.getSession();
    func.apply(this, arguments);
  }.bind(this));
  return this;
}

AjaxRequest.prototype.getSession = function() {
  var match = this.jqXHR.getAllResponseHeaders().match(
      /(Set-Cookie|set-cookie): (.+?);/);
  if (match) {
    localStorage.setItem("session", match[2]);
    return match[2];
  }
}

Storage = function(name) {
    if (!name) {
        return undefined;
    }
    if (this == window) {
        return new Storage(name);
    }
    this.name = name;
    if (localStorage.getItem(name)) {
        this.raw = JSON.parse(localStorage[name]);
     } else {
        this.raw = {}
     }
     return this;
}

Storage.prototype.get = function(name) {
    return this.raw[name];
}

Storage.prototype.set = function(name, value) {
    this.raw[name] = value;
    this.save();
    return this;
}

Storage.prototype.remove = function(name) {
    var returnvalue = this.raw[name];
    delete this.raw[name];
    this.save();
    return returnvalue;
}

Storage.prototype.save = function() {
    localStorage.setItem(this.name, JSON.stringify(this.raw));
    return this;
}

Storage.prototype.clear = function() {
    localStorage.removeItem(this.name);
    this.raw = {};
    return this;
}

/** ==== NATIVE CLASS EXTENSIONS ==== */

/** Gives a relative date and time */
Date.prototype.smartFormat = function() {
  var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
              "Saturday"];
  var months = ["January", "February", "March", "April", "May", "June", "July",
                "August", "September", "October", "November", "December" ]
  var timestamp = this.getTime();
  var now = new Date();
  // 86400000 == one day
  var midnight = new Date(now.getYear()+1900, now.getMonth(), now.getDate(), 0, 0, 0, 0, 0)
  var dayString;
  if (timestamp > midnight) {
    dayString = "Today";
  } else if (timestamp > midnight - 86400000) {
    dayString = "Yesterday";
  } else if (timestamp > midnight - 86400000 * 6 ) {
    dayString = days[this.getDay()] + ",";
  } else {
    dayString = months[this.getMonth()] + " " +
        this.getDate();
  }
  var minutes = this.getMinutes().pad(2);
  var ampm = this.getHours() < 12 ? "AM" : "PM";
//  ampm = jQuery.translate(ampm)
  var hour = this.getHours() % 12;
  if (hour === 0) {
    hour = 12;
  }
  var returnvalue = dayString + " ";
  if (this.getYear() != new Date().getYear())
    returnvalue = returnvalue += " " + this.getFullYear() + " ";
  returnvalue += hour +":"+ minutes +" "+ ampm;
  return returnvalue;
}

/**
 * Pads a number by prepending zeros to the beginning
 *
 * @param digits The number of digits needed before the decimal point.
 * @return A string containing the padded number
 */
Number.prototype.pad = function(digits) {
  var zerosNeeded = digits - this.toFixed(0).length;
  var returnvalue = String(this);
  for (var i = zerosNeeded; i > 0; i--) {
    returnvalue = "0" + returnvalue;
  }
  return returnvalue;
}

String.prototype.contains = function(str) {
  return this.indexOf(str) >= 0
}

/*
 * Respond to an event in the 'capture' phase
 * This doesn't work in IE8 or less!
 */
jQuery.fn.capture = function(evt, handler) {
  // this works, but probably needs more error handling.
  this.each(function(i, ele) {
    if (ele.addEventListener) {
      ele.addEventListener(evt, handler, true);
    }
  });
}


text:
package bytes

import "bytes"

func init() {
	Exports["containsAny"] = bytes.ContainsAny
	Exports["containsRune"] = bytes.ContainsRune
}


text:
import AppDispatcher from '../dispatcher/AppDispatcher';
import LogReaderConstants from '../constants/LogReaderConstants';

class ConfigActions {

  recieveConfigData(config) {
    AppDispatcher.dispatch({
        actionType: LogReaderConstants.RECEIVE_CONFIG,
        config: config
    });
  }

  setCurrentEnvironment(env) {
    AppDispatcher.dispatch({
        actionType: LogReaderConstants.SET_SELECTED_ENVIRONMENT,
        env: env
    });
  }

  setSearchApplication(application) {
    AppDispatcher.dispatch({
        actionType: LogReaderConstants.SET_SEARCH_APPLICATION,
        application: application
    });
  }

  setSearchMachine(machine) {
    AppDispatcher.dispatch({
        actionType: LogReaderConstants.SET_SEARCH_MACHINE,
        machine: machine
    });
  }

}

module.exports = new ConfigActions(AppDispatcher);