text:
<?xml version="1.0" encoding="utf-8"?>
<Product xmlns='http://code.google.com/p/open-zwave/'>

<!-- wiDom: UBS104 Universal Relay Switch -->

	<!-- Configuration  -->
	<CommandClass id="112">
		<Value type="list" genre="config"  index="1" label="Device status 1 click" size="1" min="1" max="4" value="1">
			<Help>Device status when the external switch receives 1 click</Help>
			<Item label="Toggle" value="1" />
			<Item label="On" value="2" />
			<Item label="Off" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="list" genre="config"  index="2" label="Device status 2 clicks" size="1" min="1" max="4" value="1">
			<Help>Device status when the external switch receives 2 clicks</Help>
			<Item label="Toggle" value="1" />
			<Item label="On" value="2" />
			<Item label="Off" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="list" genre="config"  index="3" label="Device status 3 clicks" size="1" min="1" max="4" value="1">
			<Help>Device status when the external switch receives 3 clicks</Help>
			<Item label="Toggle" value="1" />
			<Item label="On" value="2" />
			<Item label="Off" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="list" genre="config"  index="4" label="Device status held down" size="1" min="1" max="4" value="1">
			<Help>Device status when the external switch is held down</Help>
			<Item label="Toggle" value="1" />
			<Item label="On" value="2" />
			<Item label="Off" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="list" genre="config"  index="5" label="Action when 1 click" size="1" min="1" max="6" value="1">
			<Help>Action on the associated devices when the external switch receives 1 click"</Help>
			<Item label="Toggle" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Toggle associated" value="4" />
			<Item label="Set as initial status value" value="5" />
			<Item label="Ignore" value="6" />
		</Value>

		<Value type="list" genre="config"  index="6" label="Action when 2 clicks" size="1" min="1" max="6" value="1">
			<Help>Action on the associated devices when the external switch receives 2 clicks</Help>
			<Item label="Toggle" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Toggle associated" value="4" />
			<Item label="Set as initial status value" value="5" />
			<Item label="Ignore" value="6" />
		</Value>

		<Value type="list" genre="config"  index="7" label="Action when 3 clicks" size="1" min="1" max="6" value="6">
			<Help>Action on the associated devices when the external switch receives 3 clicks</Help>
			<Item label="Toggle" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Toggle associated" value="4" />
			<Item label="Set as initial status value" value="5" />
			<Item label="Ignore" value="6" />
		</Value>

		<Value type="list" genre="config"  index="8" label="Action when is held down" size="1" min="1" max="6" value="1">
			<Help>Action on the associated devices when the external switch is held down</Help>
			<Item label="Toggle" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Toggle associated" value="4" />
			<Item label="Set as initial status value" value="5" />
			<Item label="Ignore" value="6" />
		</Value>

		<Value type="list" genre="config"  index="9" label="Action on all devices when 1 click" size="1" min="1" max="5" value="5">
			<Help>Action performed on all network devices when the external switch receives 1 click</Help>
			<Item label="Toggle" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Set as initial status value" value="4" />
			<Item label="Ignore" value="5" />
		</Value>

		<Value type="list" genre="config"  index="10" label="Action on all devices when 2 clicks" size="1" min="1" max="5" value="5">
			<Help>Action performed on all network devices when the external switch receives 2 clicks</Help>
			<Item label="Toggle" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Set as initial status value" value="4" />
			<Item label="Ignore" value="5" />
		</Value>

		<Value type="list" genre="config"  index="11" label="Action on all devices when 3 clicks" size="1" min="1" max="5" value="5">
			<Help>Action performed on all network devices when the external switch receives 3 clicks</Help>
			<Item label="Toggle" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Set as initial status value" value="4" />
			<Item label="Ignore" value="5" />
		</Value>

		<Value type="list" genre="config"  index="12" label="Action on all devices when held down" size="1" min="1" max="5" value="5">
			<Help>Action performed on all network devices when the external switch is held down</Help>
			<Item label="Toggle" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Set as initial status value" value="4" />
			<Item label="Ignore" value="5" />
		</Value>

		<Value type="list" genre="config"  index="20" label="Device status upon receipt of a Basic Set" size="1" min="1" max="4" value="1">
			<Help>Device status upon receipt of a Basic Set</Help>
			<Item label="How received" value="1" />
			<Item label="Ignore if On" value="2" />
			<Item label="Ignore if Off" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="byte" genre="config"  index="30" label="ON_LEVEL Group 2" size="1" min="0" max="255" value="255">
			<Help>ON_LEVEL value used for devices belonging to Group 2 (1 Click association group). Set value from 0 to 255 (Default: 255)</Help>
		</Value>

		<Value type="byte" genre="config"  index="31" label="OFF_LEVEL Group 2" size="1" min="0" max="255" value="0">
			<Help>OFF_LEVEL value used for devices belonging to Group 2 (1 Click association group). Set value from 0 to 255 (Default: 0)</Help>
		</Value>

		<Value type="byte" genre="config"  index="32" label="ON_LEVEL Group 3" size="1" min="0" max="255" value="255">
			<Help>ON_LEVEL value used for devices belonging to Group 3 (2 Click association group). Set value from 0 to 255 (Default: 255)</Help>
		</Value>

		<Value type="byte" genre="config"  index="33" label="OFF_LEVEL Group 3 " size="1" min="0" max="255" value="0">
			<Help>OFF_LEVEL value used for devices belonging to Group 3 (2 Click association group). Set value from 0 to 255 (Default: 0)</Help>
		</Value>

		<Value type="byte" genre="config"  index="34" label="ON_LEVEL Group 4" size="1" min="0" max="255" value="255">
			<Help>ON_LEVEL value used for devices belonging to Group 4 (3 Click association group). Set value from 0 to 255 (Default: 255)</Help>
		</Value>

		<Value type="byte" genre="config"  index="35" label="OFF_LEVEL Group 4" size="1" min="0" max="255" value="0">
			<Help>OFF_LEVEL value used for devices belonging to Group 4 (3 Click association group). Set value from 0 to 255 (Default: 0)</Help>
		</Value>

		<Value type="byte" genre="config"  index="36" label="ON_LEVEL Group 5" size="1" min="0" max="255" value="255">
			<Help>ON_LEVEL value used for devices belonging to Group 5 (Hold association group). Set value from 0 to 255 (Default: 255)</Help>
		</Value>

		<Value type="byte" genre="config"  index="37" label="OFF_LEVEL Group 5" size="1" min="0" max="255" value="0">
			<Help>OFF_LEVEL value used for devices belonging to Group 5 (Hold association group). Set value from 0 to 255 (Default: 0)</Help>
		</Value>

		<Value type="list" genre="config"  index="40" label="Timer associated with the 1 click" size="1" min="0" max="1" value="0">
			<Help>Timer associated with the 1 click event on the external switch</Help>
			<Item label="Timer disabled" value="0" />
			<Item label="Timer enabled" value="1" />
		</Value>

		<Value type="list" genre="config"  index="41" label="Timer associated with the 2 click" size="1" min="0" max="1" value="0">
			<Help>Timer associated with the 2 click event on the external switch</Help>
			<Item label="Timer disabled" value="0" />
			<Item label="Timer enabled" value="1" />
		</Value>

		<Value type="list" genre="config"  index="42" label="Timer associated with the 3 click" size="1" min="0" max="1" value="0">
			<Help>Timer associated with the 3 click event on the external switch</Help>
			<Item label="Timer disabled" value="0" />
			<Item label="Timer enabled" value="1" />
		</Value>

		<Value type="list" genre="config"  index="43" label="Timer associated with the hold" size="1" min="0" max="1" value="0">
			<Help>Timer associated with the hold event on the external switch</Help>
			<Item label="Timer disabled" value="0" />
			<Item label="Timer enabled" value="1" />
		</Value>

		<Value type="list" genre="config"  index="44" label="Timer associated with Basic Set command" size="1" min="0" max="1" value="0">
			<Help>Timer associated with the reception of a Basic Set command</Help>
			<Item label="Timer disabled" value="0" />
			<Item label="Timer enabled" value="1" />
		</Value>

		<Value type="short" genre="config"  index="45" label="Switch-off timer" size="2" min="0" max="3600" value="600">
			<Help>Time in seconds (1 3600). Default: 600 (10 minutes)</Help>
		</Value>

		<Value type="list" genre="config"  index="46" label="Switch-off timer validity" size="1" min="0" max="1" value="1">
			<Help>Switch-off timer validity</Help>
			<Item label="Cancel" value="0" />
			<Item label="Mantain" value="1" />
		</Value>

		<Value type="list" genre="config"  index="50" label="Smoke Alarm, CO, CO2 Action" size="1" min="1" max="4" value="1">
			<Help>Smoke Alarm, CO, CO2 Action</Help>
			<Item label="On" value="1" />
			<Item label="Off" value="2" />
			<Item label="Flash" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="list" genre="config"  index="51" label="Heat Allarm" size="1" min="1" max="4" value="1">
			<Help>Heat Allarm</Help>
			<Item label="On" value="1" />
			<Item label="Off" value="2" />
			<Item label="Flash" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="list" genre="config"  index="52" label="Water Allarm" size="1" min="1" max="4" value="2">
			<Help>Water Allarm</Help>
			<Item label="On" value="1" />
			<Item label="Off" value="2" />
			<Item label="Flash" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="list" genre="config"  index="53" label="Home Security" size="1" min="1" max="4" value="3">
			<Help>Home Security</Help>
			<Item label="On" value="1" />
			<Item label="Off" value="2" />
			<Item label="Flash" value="3" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="byte" genre="config"  index="54" label="ON time during flashing" size="1" min="0" max="255" value="5">
			<Help>ON time during flashing. Set value from 0 to 255 (Default: 5)</Help>
		</Value>

		<Value type="byte" genre="config"  index="55" label="OFF time during flashing" size="1" min="0" max="255" value="5">
			<Help>OFF time during flashing. Set value from 0 to 255 (Default: 5)</Help>
		</Value>

		<Value type="byte" genre="config"  index="56" label="Duration of flashing phase" size="1" min="0" max="255" value="10">
			<Help>Duration of flashing phase. Set value from 0 to 255 (Default: 10)</Help>
		</Value>

		<Value type="list" genre="config"  index="60" label="Startup Status" size="1" min="1" max="3" value="3">
			<Help>Startup Status</Help>
			<Item label="On" value="1" />
			<Item label="Off" value="2" />
			<Item label="Previous status" value="3" />
		</Value>

		<Value type="list" genre="config"  index="61" label="Configuration Reset" size="1" min="0" max="4" value="4">
			<Help>Configuration Reset</Help>
			<Item label="Factory reset" value="0" />
			<Item label="Reset associations" value="1" />
			<Item label="Reset configurations" value="2" />
			<Item label="Ignore" value="4" />
		</Value>

		<Value type="list" genre="config"  index="62" label="Type of external switch" size="1" min="0" max="4" value="4">
			<Help>Type of external switch</Help>
			<Item label="Ignore" value="0" />
			<Item label="Button" value="1" />
			<Item label="Bistable switch" value="2" />
			<Item label="AC sensing" value="3" />
			<Item label="Automatic recognition" value="4" />
		</Value>

		<Value type="byte" genre="config"  index="63" label="Sensitivity" size="1" min="0" max="255" value="9">
			<Help>Sensitivity. Set value from 0 to 255 (Default: 9)</Help>
		</Value>

		<Value type="short" genre="config"  index="64" label="Load protection" size="2" min="0" max="3600" value="0">
			<Help>Load protection. Time in seconds (3600). Default: 0</Help>
		</Value>

		<Value type="list" genre="config" index="65" label="Learn Mode" size="1" min="0" max="3" value="0">
			<Help>Learn Mode</Help>
			<Item label="Ignore" value="0" />
			<Item label="1 Click" value="1" />
			<Item label="2 Clicks" value="2" />
			<Item label="3 Clicks" value="3" />
		</Value>
	</CommandClass>

	<!-- Association Groups -->
	<CommandClass id="133">
		<Associations num_groups="3">
			<Group index="1" max_associations="16" label="devices that will be notified of changes in its status" auto="true"/>
			<Group index="2" max_associations="16" label="devices that will be controlled by a single click on the external switch" auto="false" />
			<Group index="3" max_associations="16" label="devices that will be controlled by a double click on the external switch" auto="false"/>
			<Group index="4" max_associations="16" label="devices that will be controlled by a triple click on the external switch" auto="false"/>
			<Group index="5" max_associations="16" label="devices that will be controlled by hold on the external switch" auto="false"/>
		</Associations>
	</CommandClass>

</Product>

redpajama_set_name: RedPajamaGithub


text:
#include "2d/CCEventListener.h"
#include "2d/CCEventMouse.h"

#ifndef __cocos2d_libs__CCMouseEventListener__
#define __cocos2d_libs__CCMouseEventListener__

NS_CC_BEGIN

class Event;

class EventListenerMouse : public EventListener
{
public:
    static const std::string LISTENER_ID;

    static EventListenerMouse* create();

    /// Overrides
    virtual EventListenerMouse* clone() override;
    virtual bool checkAvailable() override;

    std::function<void(Event* event)> onMouseDown;
    std::function<void(Event* event)> onMouseUp;
    std::function<void(Event* event)> onMouseMove;
    std::function<void(Event* event)> onMouseScroll;

private:
    EventListenerMouse();
    bool init();
};

NS_CC_END

#endif /* defined(__cocos2d_libs__CCMouseEventListener__) */


text:
[![GoDoc](https://godoc.org/github.com/gdey/tbl?status.svg)](https://godoc.org/github.com/gdey/tbl) [![Build Status](https://travis-ci.org/gdey/tbltest.svg?branch=master)](https://travis-ci.org/gdey/tbltest)
[![Go Report Card](https://goreportcard.com/badge/github.com/gdey/tbltest)](https://goreportcard.com/report/github.com/gdey/tbltest)

This is a simple package to help with table driven tests. Given a set
of test cases, it will call the provided function each test case.

This helps remove boiler plate that comes with writing table driven code.

## Example

```go
package main

import (
  "github.com/gdey/tbltest"
  "testing"
)

func Foo(foo string) bool {
  if foo == "foo" {
    return true
  }
  return false
}

// tlb version
func TestFoo(t *testing.T) {
  type testcase struct {
    foo      string
    expected bool
  }

  tests := tlbtest.Cases(
    testcase{
      foo:      "foo",
      expected: true,
    },
    testcase{
      foo:      "bar",
      expected: false,
    },
  )

  tests.Run(func(tc testcase) {
    if Foo(tc.foo) != tc.expected {
      t.FailNow()
    }
  })

}

// standard version
func TestFoo(t *testing.T) {
  type testCase struct {
    foo      string
    expected bool
  }

  tests := []testCase{
    testCase{
      foo:      "foo",
      expected: true,
    },
    testcase{
      foo:      "bar",
      expected: false,
    },
  }

  for _, tc := range tests {
    if Foo(tc.foo) != tc.expected {
      t.FailNow()
    }
  }
}

```

# command line flags

In addition, the tool adds a new command line flag to help with debugging.

`--tblTest.RunOrder` : Allows one to specify the testcases's and the order they should run in.
This is usually helpful, when you are trying to fix one failing test, that you want to keep running
over and over again.

# Why

The biggest benefits provided by this library are:

1. By default randomizes the order in which the test cases are tested. Ensuring that there are no hidden dependencies between the tests caused by to call order.
2. Make it easy to run a single test case using the `--tblTest.runOrder` command line parameter.


text:
package com.dtflys.forest.backend.okhttp3.body;

import okhttp3.Request;
import okhttp3.RequestBody;

/**
 * @author gongjun[jun.gong@thebeastshop.com]
 * @since 2018-02-27 18:52
 */
public class OkHttp3PatchBodyBuilder extends AbstractOkHttp3BodyBuilder {

    @Override
    protected void setBody(Request.Builder builder, RequestBody body) {
        builder.patch(body);
    }
}


text:
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
.row-margin-none{
  margin-right: 0px !important;
  margin-left: 0px !important;
}
.row-margin{
  margin-top: 8px;
  margin-bottom: 8px;
}
.header-nav {

  height: 45px;
  min-width: 1015px;
  margin: 0px;
  padding: 0px;
  background-image: url(../images/support_images/header-nav-bg.png);
  border: 0px solid #ccc;
  border-bottom-width: 0px;
  position: fixed;
  top: 0px;
  left: 0px;
  right: 0px;
  z-index: 100;
}

.sup-plus{
font-size: 15px !important;
}

.header-nav > li > a {
color: #FFFFFF !important;
border-radius: 4px !important;
}
.header-nav > li > a:hover,
.header-nav > li > a:focus {
text-decoration: none !important;
color: #A9E236 !important;
background-color: transparent !important;
outline: none !important;
}
.header-nav > li > a.img-logo{
  padding-top: 5px;
}
.header-nav > li.text{
  padding-top: 10px;
  color: #FFFFFF;
}
.header-nav > li.signin > a {
padding-left: 2px;
}

.footer{
height: 100px;
margin: 0px;
padding: 20px;
background-image: url(../images/support_images/header-nav-bg.png);
border: 0px solid #ccc;
border-bottom-width: 0px;
}
.footer > p {
margin: 3px !important;
color: #FFFFFF;
}
.footer > p > a:hover,
.footer > p > a:focus {
text-decoration: none !important;
color: #A9E236 !important;
background-color: transparent !important;
outline: none !important;
}

.customer-name-nav-bar{
color: #FFFFFF;
}

.accout-dropdown-menu{
background-image: url(../images/support_images/header-nav-bg.png);
}
.accout-dropdown-menu > li > a {
color: #FFFFFF !important;
}
.accout-dropdown-menu > li > a:hover,
.accout-dropdown-menu > li > a:focus {
text-decoration: none;
color: #A9E236 !important;
background-color: transparent !important;
}
.accout-dropdown-menu .divider {
height: 1px;
overflow: hidden;
background-color: #9C9A9A !important;
}

.container-main{
margin-top:45px;
}

.btn-shop{
text-align: left !important;
color: #FFFFFF !important;
background-color: #393F44 !important;
width: 100% !important;
}

.caret-btn-shop{
margin-top: 8px;
}
.caret-btn-search{
margin-top: 0px;
}

.form-control-searchbox{
width: 100%;
}
.fa-serch-btn{
color: #FFFFFF !important;
background-color: #393F44 !important;
border-color: #393F44 !important;
}

.btn-signin{
margin-top: 5px;
background-color: #A9E236 !important;
border-color: #bce963 !important;
outline: none !important;
}
.btn-signin:focus,
.btn-signup.focus {
outline: none !important;
}
.btn-signin:hover {
background-color: #93C62E !important;
border-color: #bce963 !important;
outline: none !important;
}

.btn-signup{
color: #000000;
font-size: 20px;
background-color: #A9E236 !important;
border-color: #7FAA29!important;
}

.btn-delete{
color: #000000;
font-size: 20px;
border-color: #7FAA29!important;
}

.btn-signup:focus,
.btn-signup.focus {
color: #000000 !important;
background-color: #93C62E !important;
}
.btn-signup:hover {
color: #000000 !important;
background-color: #93C62E !important;
}

.thumbnail-signup{
padding: 20px !important;
background-color: #ecf9d2 !important;
}
.thumbnail-credit-card{
padding: 20px !important;
background-color: #DDDDDD !important;
}

.thumbnail-signup > form > h3 {
color: #8fc91d !important;
}

.credit-card-labels{
font-size: 10px;
}
.credit-card-labels-account{
font-size: 13px;
}

.textbox-address{
resize: none;
height: 70px !important;
}

.font-italic{
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 20px;
}

.thumbnail-image {
 position: relative;
 width: 100%; /* for IE 6 */
}

.thumbnail-image-product-pagination{
position: relative;
height: 180px !important;
width: 180px !important;
}

.img-desc{
padding: 8px 10px;
  background-image: url(https://images-na.ssl-images-amazon.com/images/G/01/omaha/images/ui/80_White_Overlay._V356448940_.png);
  position: absolute;
  bottom: 0px;
  left: 0px;
  font-size: 12px;
  color: #000;
  width: 100%;
}

.product-page-product-name{
font-weight: normal !important;
}

.product-page-other-products-by{
font-size: 12px !important;
}

.product-page-farmer-name > a {
font-weight: bold !important;
color: #80b319 !important;
}
.product-page-ratings-img {
color: #999999 !important;
font-size: 0.9em !important;
}
.product-page-price{
margin-top: 10px;
}
.product-page-price > span.price {
font-size: 25px;
font-weight: bold;
}
.product-page-price > span.unit-price {
font-size: 20px;
font-weight: normal;
color: #666666;
}
.product-page-add{
margin-top: 10px;
}
.btn-add{
color: #000000 !important;
background-color: #A9E236 !important;
border-color: #7FAA29!important;
}
hr.product-page-seperator{
border: none;
height: 1px;
/* Set the hr color */
color: #AAAAAA; /* old IE */
background-color: #AAAAAA; /* Modern Browsers */
}
.product-page-user-reviews{
margin-top: 10px;
}
.product-page-review-by{
font-size: 10px !important;
font-weight: bold !important;
}
.img-review{
  margin: 5px;
  height: 100px;
  width: 100px;
}
.admin-review-img{
  height: 100%;
  width: 100%;
}

.bill-deliver-to{
font-size: 12px !important;
}
.btn-proceed-to-checkout-disabled{
color: #FFFFFF !important;
background-color: #BBBBBB !important;
border-color: #DDDDDD!important;
}
.btn-proceed-to-checkout-enabled{
color: #333333 !important;
font-weight: bold !important;
background-color: #8fc91d !important;
border-color: #7FAA29!important;
}
.btn-proceed-to-checkout-enabled:focus,
.btn-proceed-to-checkout-enabled.focus {
color: #000000 !important;
background-color: #7ba527 !important;
}
.btn-proceed-to-checkout-enabled:hover {
color: #000000 !important;
background-color: #7ba527 !important;
}

.bill-subtotal{
font-size: 25px;
color: #80b319 !important;
}
.bill-items{
font-size: 25px;
}
.bill-cart{
border-style: none !important;
}
.bill-item-img{
margin: 5px;
height: 50px;
width: 50px;
}
.bill-cart-item-price{
color: #999999;
}
.bill-cart-remove-item{
/*margin-top: 50%;*/
}
.bill-cart-item-name{
font-size: 12px;
}

.bill-cart-qty-title{
font-size: 11px;
}
.bill-cart-qty-pad{
margin-top: 0px !important;
padding-top: 0px !important;
padding-right: 0px !important;
}
.bill-cart-item-pad{
padding-left: 0px !important;
padding-right: 0px !important;
}
.bill-cart-remove-pad{
padding-right: 0px !important;
}

.input-group-vertical {
margin-bottom: 0px;
}

.bill-cart-qty-btn{
background-color: #EEEEEE !important;
color: #333333 !important;
height: 15px !important;
width: 25px !important;
padding: 0px 2px 0px 2px !important;
border-radius: 2px !important;
}
.bill-cart-qty-btn.focus,
.bill-cart-qty-btn:focus{
border-style: none !important;
}
.bill-cart-qty-btn:hover{
border-style: none !important;
}

.bill-cart-qty-btn > span {
font-size: 7px !important;
}

.bill-cart-qty {
  color: #333333 !important;
  text-align: center !important;
  font-size: 12px !important;
  padding: 0px 1px 0px 1px !important;
  margin: 0px 0px 0px 0px !important;
  width: 25px !important;
  height: 18px !important;
}
.gly-plus-minus{
top: -5px !important;
}

.add-prod-description{
height: 100px !important;
resize: none;
}

hr.seperator-line{
border: none;
height: 1px;
/* Set the hr color */
color: #AAAAAA; /* old IE */
background-color: #AAAAAA; /* Modern Browsers */
}

.btn-theme{
color: #000000;
width: 100% !important;
font-size: 20px;
background-color: #8fc91d !important;
border-color: #7FAA29!important;
margin: 3px !important;
}

.btn-theme-narrow{
width: 80% !important;
}
.btn-change-date{
  padding: 0px !important;
}
.btn-theme:focus,
.btn-theme.focus {
color: #000000 !important;
background-color: #7ba527 !important;
}
.btn-theme:hover {
color: #000000 !important;
background-color: #7ba527 !important;
}

.btn-primary-theme{
color: #000000;
font-size: 20px;
background-color: #8fc91d !important;
border-color: #7FAA29!important;
margin: 3px !important;
}
.btn-primary-theme:focus,
.btn-primary-theme.focus {
color: #000000 !important;
background-color: #7ba527 !important;
}
.btn-primary-theme:hover {
color: #000000 !important;
background-color: #7ba527 !important;
}

.collapse-nav > a{
color: #709c16 !important;
}
.collapse-nav > a:hover,
.collapse-nav > a:focus {
text-decoration: none !important;
background-color: transparent !important;
}
.collapse-nav > a > span.badge {
text-decoration: none !important;
background-color: #555555 !important;
}

.collapse-body{
padding : 10px !important;
}

.approve-col-1{
font-weight: bold !important;
color: #777777 !important;
}
.approve-col-1 > div.row > h5 {
margin: 0px 5px 0px 5px;
}
.approve-col-2 > div.row {
padding-top: 1px !important;
}
.address-line > p {
margin-bottom: 4px !important;
}
.admin-page-title{
color: #8fc91d !important;
font-size: 25px !important;
}
.admin-page-title-cat{
color: #444444 !important;
font-size: 25px !important;
}

.pagination-bar{
background-color: #DDDDDD !important;
font-size: 12px;
padding: 1px 5px 1px 5px;
}
.sort-select{
padding: 0px !important;
height: 18px !important;
font-size: 13px !important;
}
.qty-select{
padding: 0px !important;
height: 22px !important;
font-size: 13px !important;
}

.nopadding{
padding: 0px !important;
}

.nomargin{
margin: 0px !important;
}

.thumbnail-product-image{
margin: 5px !important;
}

.product_list_name > a{
color: #222222 !important;
text-decoration: none !important;
}

.great{
color: #8fc91d !important;
}

.bs-wizard {margin-top: 0px;}

/*Form Wizard*/
.bs-wizard {border-bottom: solid 1px #e0e0e0; padding: 0 0 10px 0;}
.bs-wizard > .bs-wizard-step {padding: 0; position: relative;}
.bs-wizard > .bs-wizard-step + .bs-wizard-step {}
.bs-wizard > .bs-wizard-step .bs-wizard-stepnum {color: #595959; font-size: 16px; margin-bottom: 5px;}
.bs-wizard > .bs-wizard-step .bs-wizard-info {color: #999; font-size: 14px;}
.bs-wizard > .bs-wizard-step > .bs-wizard-dot {position: absolute; width: 30px; height: 30px; display: block; background: #c6ec79; top: 45px; left: 50%; margin-top: -15px; margin-left: -15px; border-radius: 50%;}
.bs-wizard > .bs-wizard-step > .bs-wizard-dot:after {content: ' '; width: 14px; height: 14px; background: #8fc91d; border-radius: 50px; position: absolute; top: 8px; left: 8px; }
.bs-wizard > .bs-wizard-step > .progress {position: relative; border-radius: 0px; height: 8px; box-shadow: none; margin: 20px 0;}
.bs-wizard > .bs-wizard-step > .progress > .progress-bar {width:0px; box-shadow: none; background: #c6ec79;}
.bs-wizard > .bs-wizard-step.complete > .progress > .progress-bar {width:100%;}
.bs-wizard > .bs-wizard-step.active > .progress > .progress-bar {width:50%;}
.bs-wizard > .bs-wizard-step:first-child.active > .progress > .progress-bar {width:0%;}
.bs-wizard > .bs-wizard-step:last-child.active > .progress > .progress-bar {width: 100%;}
.bs-wizard > .bs-wizard-step.disabled > .bs-wizard-dot {background-color: #f5f5f5;}
.bs-wizard > .bs-wizard-step.disabled > .bs-wizard-dot:after {opacity: 0;}
.bs-wizard > .bs-wizard-step:first-child  > .progress {left: 50%; width: 50%;}
.bs-wizard > .bs-wizard-step:last-child  > .progress {width: 50%;}
.bs-wizard > .bs-wizard-step.disabled a.bs-wizard-dot{ pointer-events: none; }
/*END Form Wizard*/

/*Rating*/
.rating {
  float:left;
}

/* :not(:checked) is a filter, so that browsers that don't support :checked don't
 follow these rules. Every browser that supports :checked also supports :not(), so
 it doesn't make the test unnecessarily selective */
.rating:not(:checked) > input {
  position:absolute;
  top:-9999px;
  clip:rect(0,0,0,0);
}

.rating:not(:checked) > label {
  float:right;
  width:1em;
  padding:0 .1em;
  overflow:hidden;
  white-space:nowrap;
  cursor:pointer;
  font-size:150%;
  line-height:1.2;
  color:#ddd;
  text-shadow:1px 1px #bbb, 2px 2px #666, .1em .1em .2em rgba(0,0,0,.5);
}

.rating:not(:checked) > label:before {
  content: '★ ';
}

.rating > input:checked ~ label {
  color: #a9e236;
  text-shadow:1px 1px #202d06, 2px 2px #B57340, .1em .1em .2em rgba(0,0,0,.5);
}

.rating:not(:checked) > label:hover,
.rating:not(:checked) > label:hover ~ label {
  color: #a9e236;
  text-shadow:1px 1px #202d06, 2px 2px #B57340, .1em .1em .2em rgba(0,0,0,.5);
}

.rating > input:checked + label:hover,
.rating > input:checked + label:hover ~ label,
.rating > input:checked ~ label:hover,
.rating > input:checked ~ label:hover ~ label,
.rating > label:hover ~ input:checked ~ label {
  color: #a9e236;
  text-shadow:1px 1px #202d06, 2px 2px #B57340, .1em .1em .2em rgba(0,0,0,.5);
}

.rating > label:active {
  position:relative;
  top:2px;
  left:2px;
}
/*Rating Over*/

.breadcrumb > li > a.inactive{
color: #777777 !important;
}
.alert-search {
padding: 5px;
margin-bottom: 0px;
border: 1px solid transparent;
border-radius: 2px;
color: #3c763d;
background-color: #e2f5bc;
border-color: #d6e9c6;
}

.thumbnail-no-result{
height: 358px !important;
background-color: #EFEFEF !important;
padding-top: 100px !important;
text-align: center !important;
font-size: 30px !important;
color: #999999 !important;
}

.error-page{
  background-image: url("../images/support_images/error-page-bc.jpg");
  background-size: 100%;
  color: #999999 !important;
}
.error-404{
  color: #A9E236;
  font-weight: bold !important;
  font-size: 100px !important;
}

.order-header{
  background-color: #DDDDDD;
  padding: 5px;
}

#sticky.stick {
    margin-top: 45px;
    position: fixed;
    top: 0;
    z-index: 2;
    border-radius: 0 0 0.5em 0.5em;
}

.thumbnail-review-video{
  background-image: url("../images/support_images/video-placeholder.png");
  background-size: 100%;
  height: 143px;
  width: 100%;
}

.my-alert{
  z-index: 243 !important;
  position: fixed;
  margin-top: 45px;
  top: 0;
  width: 50%;
  margin-left: 5% !important;
}


text:
import * as PhaserObjects from '../phaserObjects';

/** Base object for all Bar-like Widgets.
 * @private
 * @extends PhaserObjects.Group
 */
export class Bar extends PhaserObjects.Group {
    /**
     * @param {Object} game - Current game instance.
     * @param {number} x - The Bar's x position.
     * @param {number} y - The Bar's y position.
     * @param {boolean} vertical - Sets the Bar's alignment as vertical.
     * @param {string} trackKey - The key to use for the track.
     * @param {string} barKey - The key to use for the bar.
     */
    constructor(game, x = 0, y = 0, vertical = false, trackKey = '', barKey = '') {
        super(game);
        game.add.existing(this);

        this.game = game;
        this.x = x;
        this.y = y;

        this.vertical = vertical;

        this.trackKey = trackKey;
        this.barKey = barKey;
    }

    /**
     * @private
     * Determine the distance the bar can scroll over.
     */
    setTrackScrollAreaSize() {
        if (this.vertical) {
            this.trackScrollAreaSize = this.track.height - this.vslice;
        } else {
            this.trackScrollAreaSize = this.track.width - this.hslice;
        }
    }

    /**
     * @private
     * Sets position for the bar's non-moving axis. Centers it inside the track.
     */
    centerStaticAxis() {
        if (this.vertical) {
            this.bar.x = (
                this.track.x + (this.track.width / 2)) - (this.bar.displayWidth / 2);
        } else {
            this.bar.y = (
                this.track.y + (this.track.height / 2)) - (this.bar.displayHeight / 2);
        }
    }
}


text:
using System;

namespace _06.Custom_Enum_Attribute
{
    [AttributeUsage(AttributeTargets.All)]
    public class TypeAttribute : Attribute
    {
        private string type;
        private string category;
        public string description;

        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        public string Category
        {
            get { return category; }
            set { category = value; }
        }

        public string Description
        {
            get { return description; }
            set { description = value; }
        }
    }
}


text:
require 'aequitas/virtus_integration/inline_attribute_rule_extractor/object'

module Aequitas
  module VirtusIntegration
    module InlineAttributeRuleExtractor
      class Boolean < Object

        def extract_presence_rule
          Rule::Presence::NotNil.new(attribute.name)
        end

      end # class Boolean
    end # module InlineAttributeRuleExtractor
  end # module VirtusIntegration
end # module Aequitas


text:
title: Extend JS framework
type: references
order: 11.4
version: 2.1
---

# Extend JS framework

Work in progresss.


text:
// Generated by CoffeeScript 1.9.0
(function() {
  'use strict';

  /**
    * @ngdoc overview
    * @name pomodoroTimer
    * @description
    * # pomodoroTimer
   #
    * Main module of the application.
   */
  angular.module('pomodoroTimer', []).controller('PomodoroController', [
    '$scope', '$rootScope', '$interval', function($scope, $rootScope, $interval) {
      var AUDIOS, COUNTDOWN_RESOLUTION_MS, CYCLE_BREAK, CYCLE_WORK, NOTIFICATION_AUTO_CLOSE_DURATION_MS, Notification, TIME_BREAK_MS, TIME_WORK_MS, calcRemaingTime, currentCycle, dtDist, dtStart, init, isRunning, playAudio, remaingTimeMs, setTargetTime, showNotification, stopPromise, tick, toggleCycle, updateBackground, updateTimerDisplay;
      TIME_WORK_MS = 1500000;
      TIME_BREAK_MS = 300000;
      CYCLE_WORK = 'work';
      CYCLE_BREAK = 'break';
      COUNTDOWN_RESOLUTION_MS = 100;
      NOTIFICATION_AUTO_CLOSE_DURATION_MS = 15000;
      AUDIOS = {
        START: new Audio('assets/audio/start.m4a'),
        PAUSE: new Audio('assets/audio/pause.m4a'),
        WORK: new Audio('assets/audio/work.m4a'),
        BREAK: new Audio('assets/audio/break.m4a')
      };
      stopPromise = void 0;
      currentCycle = void 0;
      dtStart = dtDist = void 0;
      remaingTimeMs = 0;
      isRunning = false;
      Notification = window.Notification || window.mozNotification || window.webkitNotification;
      if (Notification && Notification.permission !== 'granted') {
        Notification.requestPermission(function(permission) {});
      }
      showNotification = function(msg) {
        var instance;
        if (Notification && Notification.permission === 'granted') {
          instance = new Notification('Time Expired', {
            body: msg,
            icon: 'assets/img/alarm.png'
          });
          instance.onshow = function() {
            return setTimeout(function() {
              return instance.close();
            }, NOTIFICATION_AUTO_CLOSE_DURATION_MS);
          };
        }
        return false;
      };
      playAudio = function(audioType) {
        return audioType.play();
      };
      updateBackground = function(cycle) {
        return $scope.cycleColor = "cycle-" + cycle;
      };
      updateTimerDisplay = function(ms, cycle) {
        var min, sec, timerDisplay;
        min = Math.floor(ms / 1000 / 60);
        sec = Math.floor(ms / 1000 % 60);
        timerDisplay = ms < 0 ? '00:00' : timerDisplay = ('00' + min).substr(-2) + ':' + ('00' + sec).substr(-2);
        $scope.indicator = {
          cycle: cycle,
          time: timerDisplay
        };
        $rootScope.title = cycle + " " + timerDisplay;
        return timerDisplay;
      };
      toggleCycle = function() {
        currentCycle = currentCycle === CYCLE_WORK ? CYCLE_BREAK : CYCLE_WORK;
        switch (currentCycle) {
          case CYCLE_WORK:
            showNotification('Get back to work.');
            playAudio(AUDIOS.WORK);
            setTargetTime(TIME_WORK_MS);
            break;
          default:
            showNotification('Have a break.');
            playAudio(AUDIOS.BREAK);
            setTargetTime(TIME_BREAK_MS);
        }
        updateBackground(currentCycle);
        return tick();
      };
      setTargetTime = function(intervalMs) {
        dtStart = new Date();
        return dtDist = new Date(dtStart.getTime() + intervalMs);
      };
      calcRemaingTime = function() {
        return dtDist.getTime() - Date.now();
      };
      tick = function() {
        remaingTimeMs = calcRemaingTime();
        return updateTimerDisplay(remaingTimeMs, currentCycle);
      };
      init = function() {
        isRunning = false;
        currentCycle = CYCLE_WORK;
        updateBackground('stop');
        remaingTimeMs = TIME_WORK_MS;
        return updateTimerDisplay(remaingTimeMs, currentCycle);
      };
      $scope.runPomodoro = function() {
        updateBackground(currentCycle);
        if (angular.isDefined(stopPromise)) {
          return;
        }
        if (!isRunning) {
          setTargetTime(TIME_WORK_MS);
          isRunning = true;
        }
        playAudio(AUDIOS.START);
        return stopPromise = $interval(function() {
          if (remaingTimeMs > 0) {
            return tick();
          } else {
            return toggleCycle();
          }
        }, COUNTDOWN_RESOLUTION_MS);
      };
      $scope.pausePomodoro = function() {
        if (angular.isDefined(stopPromise)) {
          $interval.cancel(stopPromise);
          stopPromise = void 0;
          playAudio(AUDIOS.PAUSE);
          return updateBackground('stop');
        }
      };
      $scope.resetPomodoro = function() {
        $scope.pausePomodoro();
        return init();
      };
      $scope.$on('$destroy', function() {
        return $scope.pausePomodoro();
      });
      return $scope.$watch('$viewContentLoaded', function() {
        return init();
      });
    }
  ]).directive('ptIndicator', function() {
    return {
      restrict: 'E',
      scope: {
        indicator: '='
      },
      templateUrl: 'app/indicator.tpl.html'
    };
  });

}).call(this);


text:
WAARecorderNode
================

`WAARecorderNode` is a simple, lightweight Web Audio API recorder node, with **precise scheduling methods**. It gives you perfect control over when your recording starts and stops, therefore allowing perfect synchronization with the rest of the audio graph.

To use, first grab the latest build [here](./dist) and add it to your web page.

Then to record some audio do ...

1) Create a `WAARecorderNode`, and connect the source you want to record from. Any Web Audio API `AudioNode` will work.

```
var recorderNode = new WAARecorderNode(audioContext)
recorderNode.recordFrom(audioNode)
```

2) Start the recording at a given time in the future, using for time reference `AudioContext.currentTime`.

```
// start the recording in exactly one second from now, record a duration of maximum 15 seconds
recorderNode.record(audioContext.currentTime + 1, 15)
```

or

```
// start the recording at audioContext.currentTime == 10
recorderNode.record(10, 15)
```

3) Add a callback to handle your recording when it will be complete

```
recorderNode.onended = function() {
  // getAudioBuffer returns the full recording as a Web Audio API AudioBuffer
  var myRecording = recorderNode.getAudioBuffer()
}
```


text:
package org.valid4j.matchers.jsonpath;

import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.JsonPathException;
import com.jayway.jsonpath.ReadContext;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;

import java.io.File;
import java.io.IOException;

public class IsJson<T> extends TypeSafeMatcher<T> {
    private final Matcher<? super ReadContext> jsonMatcher;

    public IsJson(Matcher<? super ReadContext> jsonMatcher) {
        this.jsonMatcher = jsonMatcher;
    }

    @Override
    protected boolean matchesSafely(T json) {
        try {
            ReadContext context = parse(json);
            return jsonMatcher.matches(context);
        } catch (JsonPathException e) {
            return false;
        } catch (IOException e) {
            return false;
        }
    }

    public void describeTo(Description description) {
        description.appendText("is json ").appendDescriptionOf(jsonMatcher);
    }

    @Override
    protected void describeMismatchSafely(T json, Description mismatchDescription) {
        try {
            ReadContext context = parse(json);
            jsonMatcher.describeMismatch(context, mismatchDescription);
        } catch (JsonPathException e) {
            buildMismatchDescription(json, mismatchDescription, e);
        } catch (IOException e) {
            buildMismatchDescription(json, mismatchDescription, e);
        }
    }

    private static void buildMismatchDescription(Object json, Description mismatchDescription, Exception e) {
        mismatchDescription
                .appendText("was ")
                .appendValue(json)
                .appendText(" which failed with ")
                .appendValue(e.getMessage());
    }

    private static ReadContext parse(Object object) throws IOException {
        if (object instanceof String) {
            return JsonPath.parse((String) object);
        } else if (object instanceof File) {
            return JsonPath.parse((File) object);
        } else {
            return JsonPath.parse(object);
        }
    }
}


text:
import { observable, extendObservable, action, runInAction, computed, reaction, map } from 'mobx';
import { autobind } from 'core-decorators';
import { browserHistory } from 'react-router';

import { ServiceStore } from '../_helpers';
import * as ServiceTypes from 'constants/services';

@autobind
export default class TwitchStore extends ServiceStore {

    constructor(app) {
        super(app, ServiceTypes.TWITCH);
    }
}


text:
package org.onosproject.kubevirtnetworking.api;

import org.onlab.packet.IpAddress;

/**
 * Service for administering the inventory of kubevirt network service.
 */
public interface KubevirtNetworkAdminService extends KubevirtNetworkService {

    /**
     * Creates a kubevirt network with the given information.
     *
     * @param network the new network
     */
    void createNetwork(KubevirtNetwork network);

    /**
     * Updates the kubevirt network with the given information.
     *
     * @param network the updated network
     */
    void updateNetwork(KubevirtNetwork network);

    /**
     * Removes the network.
     *
     * @param networkId network identifier
     */
    void removeNetwork(String networkId);

    /**
     * Allocate an IP address.
     *
     * @param networkId network identifier
     * @return IP address
     */
    IpAddress allocateIp(String networkId);

    /**
     * Reserve the given IP address.
     *
     * @param networkId network identifier
     * @param ip IP address to be reserved
     * @return reserve result
     */
    boolean reserveIp(String networkId, IpAddress ip);

    /**
     * Release the existing IP address.
     *
     * @param networkId network identifier
     * @param ip IP address to be released
     */
    void releaseIp(String networkId, IpAddress ip);

    void clear();
}


text:
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.exceptions;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.Response.StatusType;

import ${package}.features.customs.CustomStatus;

/**
 * The class ExceptionBuilder can be used to throw different kinds of exceptions.
 */
public class ExceptionBuilder {

	/**
	 * Builds an internal server error (status code 500) exception with the given message as the
	 * response body.
	 *
	 * @param message The message to use as the response body.
	 */
	public static WebApplicationException buildInternalServerError(String message) {
		return buildWebAppException(message, Status.INTERNAL_SERVER_ERROR);
	}

	/**
	 * Builds an internal server error (status code 500) exception with the given message as the
	 * response body.
	 *
	 * @param message The message to use as the response body.
	 */
	public static WebApplicationException buildBadRequestException(String message) {
		return buildWebAppException(message, Status.BAD_REQUEST);
	}

	/**
	 * Builds an internal server error (status code 500) exception with the given message as the
	 * response body.
	 *
	 * @param message The message to use as the response body.
	 */
	public static WebApplicationException buildLengthRequiredException(String message) {
		return buildWebAppException(message, CustomStatus.LENGTH_REQUIRED);
	}

	/**
	 * Builds a not found error (status code 404) exception with the given message as the response
	 * body.
	 *
	 * @param message The message to use as the response body.
	 */
	public static WebApplicationException buildNotFoundException(String message) {
		return buildWebAppException(message, Status.NOT_FOUND);
	}

	/**
	 * Builds a authorization error (status code 401) exception with the given message as the
	 * response
	 * body.
	 *
	 * @param message The message to use as the response body.
	 */
	public static WebApplicationException buildAuthorizationException(String message) {
		return buildWebAppException(message, Status.UNAUTHORIZED);
	}

	/**
	 * Builds a Service unavailable error (status code 503) exception with the given message as the
	 * response body.
	 *
	 * @param message The message to use as the response body.
	 */
	public static WebApplicationException buildUnavailableException(String message) {
		return buildWebAppException(message, Status.SERVICE_UNAVAILABLE);
	}

	/**
	 * Builds a {@see WebApplicationException} with the given status and message.
	 *
	 * @param message The message to use as the response body.
	 * @param status The status to use for the HTTP response.
	 */
	public static WebApplicationException buildWebAppException(String message, StatusType status) {
		Response response =
				Response.status(status).entity(message).type(MediaType.TEXT_PLAIN_TYPE).build();
		return new WebApplicationException(response);
	}
}


text:
osascript -e 'tell application "System Events" to get the name of every login item'; # Get the current user's login items.
exit 0;

#	GetLoginItems.sh
#
#	Karl V. P. B. `kvpb`
#	+1 (DDD) DDD-DDDD
#	local-part@domain
#	https://www.linkedin.com/in/
#	https://twitter.com/
#	https://github.com/kvpb
#	https://vm.tiktok.com//


text:
using Biz121.Web.Models;
using Microsoft.BizTalk.ExplorerOM;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;

namespace Biz121.Web.ExplorerOM
{
    public static class RPManager
    {
        #region Get Methods
        public static List<BizRP> GetReceivePorts(BtsCatalogExplorer root)
        {
            root.ConnectionString = ConfigurationManager.AppSettings.Get("ConnectionString");

            List<BizRP> listPorts = new List<BizRP>();
            foreach (ReceivePort rp in root.ReceivePorts)
            {
                List<BizRL> listlocations = new List<BizRL>();
                foreach (ReceiveLocation r in rp.ReceiveLocations)
                {
                    BizRL rl = MapToBizRL(r);
                    listlocations.Add(rl);

                }
                BizRP port = MapToBizRP(rp, listlocations);
                listPorts.Add(port);
            }
            return listPorts;

        }
        public static BizRP GetReceivePort(BtsCatalogExplorer root, string rpName)
        {
             root.ConnectionString = ConfigurationManager.AppSettings.Get("ConnectionString");
                ReceivePort rp = root.ReceivePorts[rpName];

                    if (rp == null)
                    {
                        return null;
                    }

                    List<BizRL> listlocations = new List<BizRL>();
                    foreach (ReceiveLocation r in rp.ReceiveLocations)
                    {
                        BizRL rl = MapToBizRL(r);
                        listlocations.Add(rl);
                    }
                    BizRP port = MapToBizRP(rp, listlocations);
                    return port;
        }

        private static BizRP MapToBizRP(ReceivePort rp, List<BizRL> listlocations)
        {
            BizRP port = new BizRP()
            {
                Name = rp.Name,
                Description = rp.Description,
                RLCount = rp.ReceiveLocations.Count,
                PrimaryRL = rp.PrimaryReceiveLocation.Name,
                RLs = listlocations,
                ApplicationName = rp.Application.Name
            };
            return port;
        }
        private static BizRL MapToBizRL(ReceiveLocation r)
        {
            BizRL rl = new BizRL()
            {
                Name = r.Name,
                TransportType = r.TransportType.Name,
                Address = r.PublicAddress,
                PipelineName = r.ReceivePipeline.FullName,
                TransportTypeData = r.TransportTypeData
            };
            return rl;
        }
        #endregion

        #region Create Methods

        public static bool CreateReceivePort(BtsCatalogExplorer root, BizRP port)
        {
            root.ConnectionString = ConfigurationManager.AppSettings.Get("ConnectionString");
            Application App = root.Applications[port.ApplicationName.Trim()];
            if (App == null)
            {
                App = root.Applications["BizTalk Application 1"]; // Hardcoded default
            }

            ReceivePort receivePort = App.AddNewReceivePort(false);

            //Note that if you dont set the name property for the receieve port,
            //it will create a new receive location and add it to the receive       //port.
            receivePort.Name = port.Name;
            receivePort.Description = port.Description;

            foreach (BizRL rl in port.RLs)
            {
                CreatedReceiveLocation(rl, receivePort, root);
            }

            //Try to commit the changes made so far. If the commit fails,
            //roll-back all changes.
            root.SaveChanges();
            return true;
        }
        private static void CreatedReceiveLocation(BizRL rl, ReceivePort receivePort, BtsCatalogExplorer root)
        {
            //Create a new receive location and add it to the receive port
            ReceiveLocation btsRL = receivePort.AddNewReceiveLocation();
            foreach (ReceiveHandler handler in root.ReceiveHandlers)
            {
                if (handler.TransportType.Name.ToUpper() == rl.TransportType.ToUpper())
                {
                    btsRL.ReceiveHandler = handler;
                    break;
                }
            }

            btsRL.Name = rl.Name;

            //Associate a transport protocol and URI with the receive location.
            btsRL.TransportType = root.ProtocolTypes[rl.TransportType];
            btsRL.TransportTypeData = rl.TransportTypeData;
            btsRL.Address = rl.Address;

            //Assign the first receive pipeline found to process the message.
            btsRL.ReceivePipeline = root.Pipelines["Microsoft.BizTalk.DefaultPipelines.PassThruReceive"]; //default Pipeline

            //Enable the receive location.
            btsRL.Enable = true;
            btsRL.FragmentMessages = Fragmentation.Yes;//optional property
            btsRL.ServiceWindowEnabled = false; //optional property

        }

        #endregion

        public static void DeleteReceivePort(BtsCatalogExplorer root, string rpName)
        {
            root.ConnectionString = ConfigurationManager.AppSettings.Get("ConnectionString");

            ReceivePort receivePort = root.ReceivePorts[rpName];
            root.RemoveReceivePort(receivePort);
            //Try to commit the changes made so far.
            root.SaveChanges();
        }
    }
}


text:
import { Component } from '@angular/core';
import { MdDialog, MdSnackBar } from '@angular/material';
import { AddBookDialogComponent, BookStoreService } from './books';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  links = [{
    name: 'Books'
  }];

  constructor(private dialog: MdDialog, private snackBar: MdSnackBar, private bookStoreService: BookStoreService) {
  }

  openAddBookDialog() {
    this.dialog.open(AddBookDialogComponent)
      .afterClosed()
      .filter(book => !!book)
      .switchMap(book => this.bookStoreService.addBook(book))
      .subscribe(result => {
        if (result.ok) {
          this.openSnackBar();
        }
      });
  }

  openSnackBar() {
    this.snackBar.open('Book Added', 'CLOSE', {
      duration: 1000
    });
  }
}


text:
package org.openur.module.domain.utils.compare;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.openur.module.domain.security.authorization.OpenURPermission;

public class PermissionComparer
	extends AbstractIdentifiableObjectComparer<OpenURPermission>
{
	@Override
	protected boolean internalEqualityCheck(OpenURPermission perm1, OpenURPermission perm2)
	{
		boolean isEqual = EqualsBuilder.reflectionEquals(perm1, perm2, "application");

		if (!isEqual)
		{
			return false;
		}

		return EqualsBuilder.reflectionEquals(perm1.getApplication(), perm2.getApplication());
	}
}


text:
S V U I   By: Failcoder
##########################################################
LOCALIZED LUA FUNCTIONS
##########################################################
]]--
--[[ GLOBALS ]]--
local _G = _G;
local unpack 	= _G.unpack;
local select 	= _G.select;
local pairs 	= _G.pairs;
local string 	= _G.string;
--[[ STRING METHODS ]]--
local format = string.format;
--[[
##########################################################
GET ADDON DATA
##########################################################
]]--
local SV = _G['SVUI'];
local L = SV.L;
local MOD = SV.Skins;
local Schema = MOD.Schema;
--[[
##########################################################
CLIQUE
##########################################################
]]--
local CliqueFrames = {
	"CliqueDialog",
	"CliqueConfig",
	"CliqueConfigPage1",
	"CliqueConfigPage2",
	"CliqueClickGrabber",
	"CliqueScrollFrame"
}

local CliqueButtons = {
	"CliqueConfigPage1ButtonSpell",
	"CliqueConfigPage1ButtonOther",
	"CliqueConfigPage1ButtonOptions",
	"CliqueConfigPage2ButtonBinding",
	"CliqueDialogButtonAccept",
	"CliqueDialogButtonBinding",
	"CliqueConfigPage2ButtonSave",
	"CliqueConfigPage2ButtonCancel",
	"CliqueSpellTab",
}

local CliqueStripped = {
	"CliqueConfigPage1Column1",
	"CliqueConfigPage1Column2",
	"CliqueConfigPage1_VSlider",
	"CliqueSpellTab",
	"CliqueConfigPage1ButtonSpell",
	"CliqueConfigPage1ButtonOther",
	"CliqueConfigPage1ButtonOptions",
	"CliqueConfigPage2ButtonBinding",
	"CliqueDialogButtonAccept",
	"CliqueDialogButtonBinding",
	"CliqueConfigPage2ButtonSave",
	"CliqueConfigPage2ButtonCancel",
}

local CliqueConfigPage1_OnShow = function(self)
	for i = 1, 12 do
		if _G["CliqueRow"..i] then
			_G["CliqueRow"..i.."Icon"]:SetTexCoord(0.1,0.9,0.1,0.9);
			_G["CliqueRow"..i.."Bind"]:ClearAllPoints()
			if _G["CliqueRow"..i] == CliqueRow1 then
				_G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], 8,0)
			else
				_G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], -9,0)
			end
			_G["CliqueRow"..i]:GetHighlightTexture():SetDesaturated(true)
		end
	end
	CliqueRow1:ClearAllPoints()
	CliqueRow1:SetPoint("TOPLEFT",5,-(CliqueConfigPage1Column1:GetHeight() +3))
end

local function StyleClique()
	assert(CliqueDialog, "AddOn Not Loaded")

	for _, gName in pairs(CliqueFrames) do
		local frame = _G[gName]
		if(frame) then
			SV.API:Set("Frame", frame, "Transparent")
			if(gName == "CliqueConfig") then
				frame.Panel:SetPoint("TOPLEFT",0,0)
				frame.Panel:SetPoint("BOTTOMRIGHT",0,-5)
			elseif(gName == "CliqueClickGrabber" or gName == "CliqueScrollFrame") then
				frame.Panel:SetPoint("TOPLEFT",4,0)
				frame.Panel:SetPoint("BOTTOMRIGHT",-2,4)
			else
				frame.Panel:SetPoint("TOPLEFT",0,0)
				frame.Panel:SetPoint("BOTTOMRIGHT",2,0)
			end
		end
	end

	for _, gName in pairs(CliqueStripped) do
		local frame = _G[gName]
		if(frame) then
			frame:RemoveTextures(true)
		end
	end

	for _, gName in pairs(CliqueButtons) do
		local button = _G[gName]
		if(button) then
			button:SetStyle("Button")
		end
	end

	SV.API:Set("CloseButton", CliqueDialog.CloseButton)

	CliqueConfigPage1:SetScript("OnShow", CliqueConfigPage1_OnShow)

	CliqueDialog:SetSize(CliqueDialog:GetWidth()-1, CliqueDialog:GetHeight()-1)

	CliqueConfigPage1ButtonSpell:ClearAllPoints()
	CliqueConfigPage1ButtonSpell:SetPoint("TOPLEFT", CliqueConfigPage1,"BOTTOMLEFT",0,-4)

	CliqueConfigPage1ButtonOptions:ClearAllPoints()
	CliqueConfigPage1ButtonOptions:SetPoint("TOPRIGHT", CliqueConfigPage1,"BOTTOMRIGHT",2,-4)

	CliqueConfigPage2ButtonSave:ClearAllPoints()
	CliqueConfigPage2ButtonSave:SetPoint("TOPLEFT", CliqueConfigPage2,"BOTTOMLEFT",0,-4)

	CliqueConfigPage2ButtonCancel:ClearAllPoints()
	CliqueConfigPage2ButtonCancel:SetPoint("TOPRIGHT", CliqueConfigPage2,"BOTTOMRIGHT",2,-4)

	CliqueSpellTab:GetRegions():SetSize(.1,.1)
	CliqueSpellTab:GetNormalTexture():SetTexCoord(0.1,0.9,0.1,0.9)
	CliqueSpellTab:GetNormalTexture():ClearAllPoints()
	CliqueSpellTab:GetNormalTexture():InsetPoints()
end

MOD:SaveAddonStyle("Clique", StyleClique)


text:
"""
Created on Mar 15, 2012

@author: moloch

 Copyright 2012 Root the Box

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

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

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

This file contains the base handlers, all other handlers should inherit
from these base classes.

"""
# pylint: disable=unused-wildcard-import,no-member

import logging
import traceback
import datetime
import time

from models import dbsession, chatsession
from models.User import User
from libs.SecurityDecorators import *
from libs.Sessions import MemcachedSession, MemcachedConnect
from libs.EventManager import EventManager
from libs.WebhookHelpers import *
from builtins import str

try:
    from urllib.parse import urlparse
except ImportError:
    from urlparse import urlparse
from tornado import locale
from tornado.web import RequestHandler
from tornado.ioloop import IOLoop
from tornado.websocket import WebSocketHandler
from tornado.options import options

class BaseHandler(RequestHandler):

    """User handlers extend this class"""

    csp = {
        "default-src": set(["'self'"]),
        "script-src": set(["'self'"]),
        "connect-src": set(["'self'"]),
        "frame-src": set(["'self'"]),
        "img-src": set(["'self'"]),
        "media-src": set(["'none'"]),
        "font-src": set(["'self'"]),
        "object-src": set(["'none'"]),
        "style-src": set(["'self'"]),
    }
    _session = None
    dbsession = dbsession
    chatsession = chatsession
    _memcached = None
    new_events = []
    io_loop = IOLoop.instance()
    event_manager = EventManager.instance()
    config = options  # backward compatibility

    def initialize(self):
        """Setup sessions, etc"""
        self.add_content_policy("connect-src", self.config.origin)
        # We need this for a few things, and so far as I know it doesn't
        # present too much of a security risk - TODO: no longer require
        # inline styles
        self.add_content_policy("style-src", "'unsafe-inline'")

    def get_current_user(self):
        """Get current user object from database"""
        if self.session is not None:
            try:
                return User.by_uuid(self.session["user_uuid"])
            except KeyError:
                logging.exception("Malformed session: %r" % self.session)
            except:
                logging.exception("Failed call to get_current_user()")
        return None

    def start_session(self):
        """Starts a new session"""
        self.session = self._create_session()
        flags = {"expires": self.session.expires, "path": "/", "HttpOnly": True}
        if self.config.ssl:
            flags["Secure"] = True
        self.set_secure_cookie("session_id", self.session.session_id, **flags)

    def add_content_policy(self, src, policy):
        """Add to the existing CSP header"""
        if not src.endswith("-src"):
            src += "-src"
        if src in self.csp:
            self.csp[src].add(policy)
            self._refresh_csp()
        else:
            raise ValueError("Invalid content source")

    def clear_content_policy(self, src):
        """Clear a content source in the existing CSP header"""
        if not src.endswith("-src"):
            src += "-src"
        if src in self.csp:
            self.csp[src] = set()
            self._refresh_csp()
        else:
            raise ValueError("Invalid content source")

    def _refresh_csp(self):
        """Rebuild the Content-Security-Policy header"""
        _csp = []
        for src, policies in list(self.csp.items()):
            if len(policies):
                _csp.append("%s %s; " % (src, " ".join(policies)))
        csp = "".join(_csp)
        # Disabled until i can figure out the bug
        # self.set_header("Content-Security-Policy", csp)

    @property
    def memcached(self):
        """Connects to Memcached instance"""
        if self._memcached is None:
            self._memcached = MemcachedConnect()
        return self._memcached

    def _create_session(self):
        """Creates a new session"""
        kwargs = {"connection": self.memcached, "ip_address": self.request.remote_ip}
        new_session = MemcachedSession(**kwargs)
        new_session.save()
        return new_session

    def flush_memcached(self):
        if self._memcached is not None:
            self._memcached.flush_all()

    @property
    def session(self):
        if self._session is None:
            session_id = self.get_secure_cookie("session_id")
            if session_id is not None:
                self._session = self._get_session(session_id)
        return self._session

    @session.setter
    def session(self, new_session):
        self._session = new_session

    def _get_session(self, session_id):
        kwargs = {
            "connection": self.memcached,
            "session_id": session_id,
            "ip_address": self.request.remote_ip,
        }
        old_session = MemcachedSession.load(**kwargs)
        if old_session and not old_session.is_expired():
            old_session.refresh()
            return old_session
        else:
            return None

    def set_default_headers(self):
        """
        Set security HTTP headers, and add some troll-y version headers
        """
        self.set_header("Server", "Microsoft-IIS/7.5")
        self.add_header("X-Powered-By", "ASP.NET")
        self.add_header("X-Frame-Options", "DENY")
        self.add_header("X-XSS-Protection", "1; mode=block")
        self.add_header("X-Content-Type-Options", "nosniff")
        self._refresh_csp()
        if self.config.ssl:
            self.add_header(
                "Strict-Transport-Security", "max-age=31536000; includeSubDomains;"
            )

    def write_error(self, status_code, **kwargs):
        """Write our custom error pages"""
        trace = "".join(traceback.format_exception(*kwargs["exc_info"]))
        logging.error(
            "Request from %s resulted in an error code %d:\n%s"
            % (self.request.remote_ip, status_code, trace)
        )
        if status_code in [403]:
            # This should only get called when the _xsrf check fails,
            # all other '403' cases we just send a redirect to /403
            # self.render('public/403.html', locked=False, xsrf=True)
            self.redirect("/logout")  # just log them out
        else:
            if not self.config.debug:
                # Never tell the user we got a 500
                self.render("public/404.html")
            else:
                # If debug mode is enabled, just call Tornado's write_error()
                super(BaseHandler, self).write_error(status_code, **kwargs)

    def get(self, *args, **kwargs):
        """Placeholder, in case child class does not impl this method"""
        self.render("public/404.html")

    def post(self, *args, **kwargs):
        """Placeholder, in case child class does not impl this method"""
        self.render("public/404.html")

    def put(self, *args, **kwargs):
        """Log odd behavior, this should never get legitimately called"""
        logging.warning("%s attempted to use PUT method" % self.request.remote_ip)

    def delete(self, *args, **kwargs):
        """Log odd behavior, this should never get legitimately called"""
        logging.warning("%s attempted to use DELETE method" % self.request.remote_ip)

    def head(self, *args, **kwargs):
        """Ignore it"""
        logging.warning("%s attempted to use HEAD method" % self.request.remote_ip)

    def options(self, *args, **kwargs):
        """Log odd behavior, this should never get legitimately called"""
        logging.warning("%s attempted to use OPTIONS method" % self.request.remote_ip)

    def on_finish(self, *args, **kwargs):
        """Called after a response is sent to the client"""
        self.dbsession.close()

    def timer(self):
        timer = None
        if self.application.settings["countdown_timer"]:
            timerdiff = self.application.settings["countdown_timer"] - time.time()
            if timerdiff <= 0:
                timerdiff = 0
                self.application.settings["hide_scoreboard"] = False
                if self.application.settings["stop_timer"]:
                    self.application.settings["stop_timer"] = False
                    self.stop_game()
            timer = str(timerdiff)
        return timer

    def start_game(self):
        """Start the game and any related callbacks"""
        if not self.application.settings["game_started"]:
            logging.info("The game is about to begin, good hunting!")
            self.application.settings["game_started"] = True
            self.application.settings["history_callback"].start()
            if self.config.use_bots:
                self.application.settings["score_bots_callback"].start()
            # Fire game start webhook
            send_game_start_webhook()

    def stop_game(self):
        """Stop the game and all callbacks"""
        if self.application.settings["game_started"]:
            logging.info("The game is stopping ...")
            self.application.settings["game_started"] = False
            if self.application.settings["history_callback"]._running:
                self.application.settings["history_callback"].stop()
            if self.application.settings["score_bots_callback"]._running:
                self.application.settings["score_bots_callback"].stop()
            # Fire game stop webhook
            send_game_stop_webhook()

    def get_user_locale(self):
        """
        Get user lang value from config.
        If None is returned, Tornado fall back to get_browser_locale()
        """
        if len(self.config.force_locale) > 0:
            return locale.get(self.config.force_locale)
        else:
            """
            This is a work around as Tornado get_browser_locale() is not returning the closest match.
            https://github.com/tornadoweb/tornado/issues/1858
            https://github.com/moloch--/RootTheBox/issues/367
            """
            codes = self.request.headers.get("Accept-Language")
            if codes:
                for code in codes.split(","):
                    code = code.split(";")[0]
                    for l in locale.get_supported_locales():
                        if code.lower() == l.split("_")[0]:
                            return locale.get(l)
        return None

class BaseWebSocketHandler(WebSocketHandler):

    """Handles websocket connections"""

    _session = None
    _memcached = None
    io_loop = IOLoop.instance()
    manager = EventManager.instance()
    config = options  # backward compatibility

    def check_origin(self, origin):
        """Parses the request's origin header"""
        try:
            request_origin = urlparse(origin)
            origin = urlparse(self.config.origin)
            logging.debug(
                "Checking request origin '%s' ends with '%s'" % (request_origin, origin)
            )
            return request_origin.netloc.endswith(origin)
        except:
            logging.exception("Failed to parse request origin: %r" % origin)
            return False

    @property
    def memcached(self):
        """Connects to Memcached instance"""
        if self._memcached is None:
            self._memcached = MemcachedConnect()
        return self._memcached

    @property
    def session(self):
        if self._session is None:
            session_id = self.get_secure_cookie("session_id")
            if session_id is not None:
                self._session = self._get_session(session_id)
        return self._session

    @session.setter
    def session(self, new_session):
        self._session = new_session

    def _get_session(self, session_id):
        kwargs = {
            "connection": self.memcached,
            "session_id": session_id,
            "ip_address": self.request.remote_ip,
        }
        old_session = MemcachedSession.load(**kwargs)
        if old_session and not old_session.is_expired():
            old_session.refresh()
            return old_session
        else:
            return None

    def get_current_user(self):
        """Get current user object from database"""
        if self.session is not None:
            try:
                return User.by_handle(self.session["handle"])
            except KeyError:
                logging.exception("Malformed session: %r" % self.session)
            except:
                logging.exception("Failed call to get_current_user()")
        return None

    def open(self):
        pass

    def on_message(self, message):
        pass

    def on_close(self):
        pass


text:
<?php

namespace Sylius\Bundle\ThemeBundle\Translation\Provider\Locale;

/**
 * @author Kamil Kokot <kamil.kokot@lakion.com>
 */
final class FallbackLocalesProvider implements FallbackLocalesProviderInterface
{
    /**
     * {@inheritdoc}
     */
    public function computeFallbackLocales($locale, array $baseFallbackLocales)
    {
        $localeWithoutModifier = strstr($locale, '@', true) ?: $locale;
        $localeModifier = substr(strrchr($locale, '@'), 1) ?: null;

        $fallbackLocales = [];
        foreach (array_merge([$localeWithoutModifier], $baseFallbackLocales) as $fallbackLocale) {
            foreach ($this->generateLocalesWithModifier($fallbackLocale, $localeModifier) as $generatedLocale) {
                if ($generatedLocale === $locale) {
                    continue;
                }

                $fallbackLocales[] = $generatedLocale;
            }
        }

        return array_unique($fallbackLocales);
    }

    /**
     * @param string $localeWithoutModifier
     * @param string|null $modifier
     *
     * @return \Generator
     */
    private function generateLocalesWithModifier($localeWithoutModifier, $modifier = null)
    {
        foreach ($this->generateLocales($localeWithoutModifier) as $generatedLocale) {
            if (null !== $modifier) {
                yield $generatedLocale . '@' . $modifier;
            }

            yield $generatedLocale;
        }
    }

    /**
     * @param string $localeWithoutModifier
     *
     * @return \Generator
     */
    private function generateLocales($localeWithoutModifier)
    {
        yield $localeWithoutModifier;

        if (false !== strrpos($localeWithoutModifier, '_')) {
            yield substr($localeWithoutModifier, 0, -strlen(strrchr($localeWithoutModifier, '_')));
        }
    }
}


text:
//
//  AATTActionMessageManager.h
//  MessageBeast
//
//  Created by Rob Brambley on 12/1/13.
//  Copyright (c) 2013 Always All The Time. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AATTMessageManager.h"

/**
 The AATTActionMessageManager is used to perform mutable actions on Messages.

 Since Annotations are not mutable, user-invoked actions on individual Messages (e.g.
 marking a Message as a favorite, as read/unread, etc.) are not manageable with the App.net API.
 This Manager class is used to hack around this limitation.

 We use Action Channels (Channels of type com.alwaysallthetime.action)
 with machine-only Messages to perform Actions on another Channel's Messages. These Action Messages
 have metadata annotations (type com.alwaysallthetime.action.metadata) that point to their associated
 "target" message in another Channel. All Messages in an Action Channel correspond to the same
 action (i.e. there is only one action per Action Channel). Since Messages can be deleted, deleting
 an Action Message effectively undoes a performed Action on the target Message.

 The ActionMessageManager abstracts away this hack by providing simple applyActionForActionChannelWithID:toTargetMessagePlus:
 and removeActionForActionChannelWithID:fromTargetMessageWithID: methods. Before performing either of these actions, you must call
 initActionChannelWithType:targetChannel:completionBlock: to create or get an existing Channel to host the Action Messages.
 To check if an action has been performed on a specific target message, use isActionedTargetMessageID:inActionChannelWithID:
 */
@interface AATTActionMessageManager : NSObject

typedef void (^AATTActionMessageManagerChannelInitBlock)(ANKChannel *actionChannel, NSError *error);

+ (AATTActionMessageManager *)sharedInstanceWithMessageManager:(AATTMessageManager *)messageManager;

#pragma mark - Action Channel

/*
 Initialize an Action Channel. This is typically done at app startup and must be done before any other
 AATTActionMessageManager methods are used on the Channel.

 @param actionType the identifier for the Action Channel (e.g. com.alwaysallthetime.pizzaparty)
 @param targetChannel the Channel whose messages will have actions performed.
 @param completionBlock AATTActionMessageManagerChannelInitBlock
 */
- (void)initActionChannelWithType:(NSString *)actionType targetChannel:(ANKChannel *)targetChannel completionBlock:(AATTActionMessageManagerChannelInitBlock)completionBlock;

#pragma mark - Lookup

/*
 Return YES if the specified target Message has had an action performed on it.

 @param targetMessageID the id of the target Message.
 @param actionChannelID the id of the Action Channel.
 */
- (BOOL)isActionedTargetMessageID:(NSString *)targetMessageID inActionChannelWithID:(NSString *)actionChannelID;

/**
 Get an array of messages that have had a specific action channel's action applied.

 @param actionChannelID the action channel ID
 @param beforeDate a date later than the display date of all returned messages.
 @param limit the maximum number of messages to return.
 */
- (NSArray *)actionedMessagesInActionChannelWithID:(NSString *)actionChannelID beforeDate:(NSDate *)beforeDate limit:(NSUInteger)limit;

#pragma mark - Other Getters

/*
 Get the AATTMessageManager instance used by this manager.
 */
- (AATTMessageManager *)messageManager;

#pragma mark - Retrieval

/*
 Sync and persist all Action Messages in a Channel.

 Instead of using the similar MessageManager method, this method should be used
 to sync messages for an Action Channel. As batches of Messages are obtained, the target Message id
 for each Action Message will be extracted from annotations and stored to the sqlite database
 for lookup at a later time.

 @param actionChannelID The id of the Action Channel for which Messages will be synced
 @param completionBlock AATTMessageManagerCompletionBlock
 */
- (void)fetchAndPersistAllMessagesInActionChannelWithID:(NSString *)actionChannelID completionBlock:(AATTMessageManagerCompletionBlock)completionBlock;

/*
 Fetch the newest messages in an Action Channel.

 @param actionChannelID the id of the Action Channel for which Messages should be fetched
 @param completionBlock the AATTMessageManagerCompletionBlock
 @return NO if unsent messages are preventing new messages from being fetched, YES otherwise. If NO is returned, you should
         use the MessageManager to send all unsent messages in the specified Action Channel.
 */
- (BOOL)fetchNewestMessagesInActionChannelWithID:(NSString *)actionChannelID completionBlock:(AATTMessageManagerCompletionBlock)completionBlock;

#pragma mark - Apply/Remove Actions

/*
 Apply the action associated with an Action Channel to the provided target Message.

 This creates a machine-only Message in the Action Channel that points to the target Message.

 @param actionChannelID the id of the Action Channel
 @param messagePlus the AATTMessagePlus with which to associate this action.
 */
- (void)applyActionForActionChannelWithID:(NSString *)actionChannelID toTargetMessagePlus:(AATTMessagePlus *)messagePlus;

/*
 Remove the action associated with an Action Channel from the Message associated with the provided target Message id.

 @param actionChannelID the id of the Action Channel
 @param targetMessageID the id of the target Message to which the action should no longer be applied
 */
- (void)removeActionForActionChannelWithID:(NSString *)actionChannelID fromTargetMessageWithID:(NSString *)targetMessageID;

#pragma mark - Other

/*
 Send all unsent Messages in an Action Channel. If the associated target Messages
 are not yet sent, then this method will not attempt to send and return NO.

 @param actionChannelID the id of the Action Channel
 @return YES if no Messages in the Action Channel are associated with unsent target
         Messages, NO otherwise. A returned value of NO implies that no send attempt
         will be made.
 */
- (BOOL)sendUnsentActionMessagesForChannelWithID:(NSString *)actionChannelID;

/*
 An easy hook for the AATTMessageManager to call into when unsent messages are sent.
 This is not intended to be used by client applications.
 */
- (void)didSendUnsentMessagesInChannelWithID:(NSString *)channelID sentMessageIDs:(NSArray *)sentMessageIDs replacementMessageIDs:(NSArray *)replacementMessageIDs;

@end


text:
{% extends "base.html" %}
{% load markdown_deux_tags %}

{% block header_title %}Blog{% endblock %}

{% block header %}

Municipal ME Blog

Thoughts and solutions for improving Maine government

{% endblock header %}


text:
package org.apache.ignite.internal.processors.cache.persistence.db.wal;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CacheRebalanceMode;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
import org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.DataRegionConfiguration;
import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.WALMode;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;

import static org.apache.ignite.IgniteSystemProperties.IGNITE_PDS_WAL_REBALANCE_THRESHOLD;

/**
 * Historic WAL rebalance base test.
 */
public class IgniteWalRebalanceTest extends GridCommonAbstractTest {
    /** Cache name. */
    private static final String CACHE_NAME = "cache";

    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
        System.setProperty(IGNITE_PDS_WAL_REBALANCE_THRESHOLD, "0"); //to make all rebalance wal-based

        IgniteConfiguration cfg = super.getConfiguration(gridName);

        cfg.setConsistentId(gridName);

        CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(CACHE_NAME);

        ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);

        ccfg.setRebalanceMode(CacheRebalanceMode.ASYNC);

        ccfg.setCacheMode(CacheMode.REPLICATED);

        ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));

        cfg.setCacheConfiguration(ccfg);

        DataStorageConfiguration dbCfg = new DataStorageConfiguration()
                    .setWalHistorySize(Integer.MAX_VALUE)
                    .setWalMode(WALMode.LOG_ONLY)
                    .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true));

        cfg.setDataStorageConfiguration(dbCfg);

        return cfg;
    }

    /** {@inheritDoc} */
    @Override protected void beforeTest() throws Exception {
        stopAllGrids();

        cleanPersistenceDir();
    }

    /** {@inheritDoc} */
    @Override protected void afterTest() throws Exception {
        System.clearProperty(IGNITE_PDS_WAL_REBALANCE_THRESHOLD);

        stopAllGrids();

        cleanPersistenceDir();
    }

    /**
     * Test simple WAL historical rebalance.
     *
     * @throws Exception if failed.
     */
    public void testSimple() throws Exception {
        IgniteEx ig0 = startGrid(0);
        IgniteEx ig1 = startGrid(1);
        final int entryCnt = 10_000;

        ig0.cluster().active(true);

        IgniteCache<Object, Object> cache = ig0.cache(CACHE_NAME);

        for (int k = 0; k < entryCnt; k++)
            cache.put(k, new IndexedObject(k));

        forceCheckpoint();

        stopGrid(1, false);

        for (int k = 0; k < entryCnt; k++)
            cache.put(k, new IndexedObject(k + 1));

        forceCheckpoint();

        ig1 = startGrid(1);

        awaitPartitionMapExchange();

        for (Ignite ig : G.allGrids()) {
            IgniteCache<Object, Object> cache1 = ig.cache(CACHE_NAME);

            for (int k = 0; k < entryCnt; k++)
                assertEquals(new IndexedObject(k + 1), cache1.get(k));
        }
    }

    /**
     * Test that cache entry removes are rebalanced properly using WAL.
     *
     * @throws Exception If failed.
     */
    public void testRebalanceRemoves() throws Exception {
        IgniteEx ig0 = startGrid(0);
        IgniteEx ig1 = startGrid(1);
        final int entryCnt = 10_000;

        ig0.cluster().active(true);

        IgniteCache<Object, Object> cache = ig0.cache(CACHE_NAME);

        for (int k = 0; k < entryCnt; k++)
            cache.put(k, new IndexedObject(k));

        forceCheckpoint();

        stopGrid(1, false);

        for (int k = 0; k < entryCnt; k++) {
            if (k % 3 != 2)
                cache.put(k, new IndexedObject(k + 1));
            else // Spread removes across all partitions.
                cache.remove(k);
        }

        forceCheckpoint();

        ig1 = startGrid(1);

        awaitPartitionMapExchange();

        for (Ignite ig : G.allGrids()) {
            IgniteCache<Object, Object> cache1 = ig.cache(CACHE_NAME);

            for (int k = 0; k < entryCnt; k++) {
                if (k % 3 != 2)
                    assertEquals(new IndexedObject(k + 1), cache1.get(k));
                else
                    assertNull(cache1.get(k));
            }
        }
    }

    /**
     *
     */
    private static class IndexedObject {
        /** */
        @QuerySqlField(index = true)
        private int iVal;

        /** */
        private byte[] payload = new byte[1024];

        /**
         * @param iVal Integer value.
         */
        private IndexedObject(int iVal) {
            this.iVal = iVal;
        }

        /** {@inheritDoc} */
        @Override public boolean equals(Object o) {
            if (this == o)
                return true;

            if (!(o instanceof IndexedObject))
                return false;

            IndexedObject that = (IndexedObject)o;

            return iVal == that.iVal;
        }

        /** {@inheritDoc} */
        @Override public int hashCode() {
            return iVal;
        }

        /** {@inheritDoc} */
        @Override public String toString() {
            return S.toString(IndexedObject.class, this);
        }
    }
}


text:
Test class with static function
--SKIPIF--
<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
--FILEEOF--
<?php

// this will call PublicClass::staticMethod()
TestBaseClass\ClassWithStatic::static1();

// this will call PrivateClass::staticMethod()
TestBaseClass\ClassWithStatic::static2();

// this will call regularFunction()
TestBaseClass\ClassWithStatic::static3();

// this will also call PrivateClass::staticMethod()
TestBaseClass\staticFun1();

//echo PHP_EOL;
--EXPECT--
testStaticPubClass::staticMethod()
testStatic regular function
testStaticPrivClass::staticMethod()
testStaticPrivClass::staticMethod()


text:
package org.apache.aries.transaction.test.impl;

import java.sql.SQLException;

import org.apache.aries.transaction.test.TestBean;

public class TestBeanImpl implements TestBean {
    private Connector connector;
    private TestBean bean;

    @Override
    public void insertRow(String name, int value, Exception e) throws SQLException {
        connector.insertRow(name, value);
        if (e instanceof SQLException) {
            throw (SQLException) e;
        } else if (e instanceof RuntimeException) {
            throw (RuntimeException) e;
        }
    }

    @Override
    public void delegateInsertRow(String name, int value) throws SQLException {
        bean.insertRow(name, value, null);
    }

    @Override
    public void throwApplicationException() throws SQLException {
        throw new SQLException("Test exception");
    }

    @Override
    public void throwRuntimeException() {
        throw new RuntimeException("Test exception"); // NOSONAR
    }

    public void setTestBean(TestBean bean) {
        this.bean = bean;
    }

    public void setConnector(Connector connector) {
        this.connector = connector;
    }

}


text:
module Graphiti
  class Scoping::Paginate < Scoping::Base
    DEFAULT_PAGE_SIZE = 20

    def apply
      if size > resource.max_page_size
        raise Graphiti::Errors::UnsupportedPageSize
          .new(size, resource.max_page_size)
      elsif requested? && @opts[:sideload_parent_length].to_i > 1
        raise Graphiti::Errors::UnsupportedPagination
      else
        super
      end
    end

    # We want to apply this logic unless we've explicitly received the
    # +default: false+ option. In that case, only apply if pagination
    # was explicitly specified in the request.
    #
    # @return [Boolean] should we apply this logic?
    def apply?
      if @opts[:default_paginate] == false
        requested?
      else
        true
      end
    end

    # @return [Proc, Nil] the custom pagination proc
    def custom_scope
      resource.pagination
    end

    # Apply default pagination proc via the Resource adapter
    def apply_standard_scope
      resource.adapter.paginate(@scope, number, size)
    end

    # Apply the custom pagination proc
    def apply_custom_scope
      resource.instance_exec(@scope, number, size, resource.context, &custom_scope)
    end

    private

    def requested?
      ![page_param[:size], page_param[:number]].all?(&:nil?)
    end

    def page_param
      @page_param ||= (query_hash[:page] || {})
    end

    def number
      (page_param[:number] || 1).to_i
    end

    def size
      (page_param[:size] || resource.default_page_size || DEFAULT_PAGE_SIZE).to_i
    end
  end
end


text:
(function() {
    angular.module('app.demo', ['ngRoute', 'ngSanitize']);
})();


text:
/**
 *
 */
package net.i2geo.comped.dao;

import java.util.List;

import org.appfuse.dao.BaseDaoTestCase;
import org.appfuse.dao.UserDao;
import org.appfuse.model.User;
import org.junit.After;
import org.junit.Before;

import net.i2geo.comped.model.AbstractTopic;
import net.i2geo.comped.model.Thing;
import net.i2geo.comped.dao.ThingDao;

/**
 * @author Martin Homik
 *
 */
public class ThingDaoTest extends BaseDaoTestCase {

	private ThingDao thingDao = null;
	private UserDao  userDao  = null;
	private User     user1    = null;
	private User     user2    = null;

    public void setThingDao(ThingDao thingDao) {
        this.thingDao = thingDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

	@Before
    public void onSetUp() throws Exception {
		user1 = userDao.get(-1L);
		user2 = userDao.get(-2L);
	}

	@After
    public void onTearDown() throws Exception {
		user1=null;
		user2=null;
	}

    public void testFindByCreator() throws Exception {
    	List<Thing> things1 = thingDao.findByCreator(user2);
    	assertNotNull(things1);
    	assertTrue(things1.size() > 0);
    	assertEquals(3, things1.size());

    	List<Thing> things2 = thingDao.findByCreator(user1);

    	assertNotNull(things2);
    	assertTrue(things2.size() > 0);
    	assertEquals(13, things2.size());
    }

    // Find an occurrence
    public void testFindThingByUri() throws Exception {
        List<Thing> things = thingDao.findByUri("%Graphical_display_of_data_r%");
        assertNotNull(things);
        assertTrue(things.size() > 0);
        Thing thing = things.get(0);
        assertEquals(new Long(171), thing.getId());

        assertTrue(thing instanceof AbstractTopic);
    }

    /*
    public void testAddAndRemoveThing() throws Exception {
        Thing thing = new Thing();

        Date date = new Date();
    	thing.setCreated(date);
    	thing.setModified(date);
    	thing.setStatus(Thing.STATUS_PUBLISHED);
    	thing.setCommentStatus(Thing.COMMENTS_OPENED);
    	thing.setCommentDays(0);
    	thing.setCreator(userDao.get(-1L));

        thing = thingDao.save(thing);
        flush();

        thing = thingDao.get(thing.getId());

        assertNotNull(thing.getId());
        // assertNotNull(thing.getCreated());
        // assertNotNull(thing.getModified());

        log.debug("removing thing ...");

        thingDao.remove(thing.getId());
        flush();

        try {
            thingDao.get(thing.getId());
            fail("Thing found in database");
        } catch (DataAccessException dae) {
            log.debug("Expected exception: " + dae.getMessage());
            assertNotNull(dae);
        }
    }
    */
}


text:
package br.com.livraria.dao;

import javax.persistence.NoResultException;

import br.com.livraria.models.Editora;

/**
 *
 * Interface responsável por definir os metodos que acessam informações do banco de dados
 *
 * @author Elton
 * @since 05/02/2016 - 12:21:26
 * @version 1.0
 */
public interface EditoraDAO extends DAO<Editora, Integer>{

	/**
	 *
	 * Método que realiza a busca do objeto informando sua descrição
	 *
	 * @author Elton
	 * @since 06/02/2016
	 * @version 1.0
	 * @param descricao Nome da editora
	 * @return O proprio objeto
	 */
	public Editora findBy(String descricao) throws NoResultException;

}


text:
package protoprocess

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/wrappers"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// Client API for API service

type APIClient interface {
	Do(ctx context.Context, opts ...grpc.CallOption) (API_DoClient, error)
}

type aPIClient struct {
	cc *grpc.ClientConn
}

func NewAPIClient(cc *grpc.ClientConn) APIClient {
	return &aPIClient{cc}
}

func (c *aPIClient) Do(ctx context.Context, opts ...grpc.CallOption) (API_DoClient, error) {
	stream, err := grpc.NewClientStream(ctx, &_API_serviceDesc.Streams[0], c.cc, "/protoprocess.API/Do", opts...)
	if err != nil {
		return nil, err
	}
	x := &aPIDoClient{stream}
	return x, nil
}

type API_DoClient interface {
	Send(*google_protobuf.BytesValue) error
	Recv() (*google_protobuf.BytesValue, error)
	grpc.ClientStream
}

type aPIDoClient struct {
	grpc.ClientStream
}

func (x *aPIDoClient) Send(m *google_protobuf.BytesValue) error {
	return x.ClientStream.SendMsg(m)
}

func (x *aPIDoClient) Recv() (*google_protobuf.BytesValue, error) {
	m := new(google_protobuf.BytesValue)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// Server API for API service

type APIServer interface {
	Do(API_DoServer) error
}

func RegisterAPIServer(s *grpc.Server, srv APIServer) {
	s.RegisterService(&_API_serviceDesc, srv)
}

func _API_Do_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(APIServer).Do(&aPIDoServer{stream})
}

type API_DoServer interface {
	Send(*google_protobuf.BytesValue) error
	Recv() (*google_protobuf.BytesValue, error)
	grpc.ServerStream
}

type aPIDoServer struct {
	grpc.ServerStream
}

func (x *aPIDoServer) Send(m *google_protobuf.BytesValue) error {
	return x.ServerStream.SendMsg(m)
}

func (x *aPIDoServer) Recv() (*google_protobuf.BytesValue, error) {
	m := new(google_protobuf.BytesValue)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

var _API_serviceDesc = grpc.ServiceDesc{
	ServiceName: "protoprocess.API",
	HandlerType: (*APIServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Do",
			Handler:       _API_Do_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "process/protoprocess.proto",
}

func init() { proto.RegisterFile("process/protoprocess.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{
	// 117 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0x28, 0xca, 0x4f,
	0x4e, 0x2d, 0x2e, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x87, 0x72, 0xf4, 0xc0, 0x1c, 0x21, 0x1e,
	0x64, 0x31, 0x29, 0xb9, 0xf4, 0xfc, 0xfc, 0xf4, 0x9c, 0x54, 0x88, 0xc2, 0xa4, 0xd2, 0x34, 0xfd,
	0xf2, 0xa2, 0xc4, 0x82, 0x82, 0xd4, 0x22, 0xa8, 0x6a, 0x23, 0x6f, 0x2e, 0x66, 0xc7, 0x00, 0x4f,
	0x21, 0x17, 0x2e, 0x26, 0x97, 0x7c, 0x21, 0x69, 0x3d, 0x88, 0x6a, 0x3d, 0x98, 0x6a, 0x3d, 0xa7,
	0xca, 0x92, 0xd4, 0xe2, 0xb0, 0xc4, 0x9c, 0xd2, 0x54, 0x29, 0x7c, 0x92, 0x4a, 0x0c, 0x1a, 0x8c,
	0x06, 0x8c, 0x49, 0x6c, 0x60, 0x29, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x44, 0x68, 0x7e,
	0x7b, 0x9f, 0x00, 0x00, 0x00,
}