text:
	<md-toolbar class="md-theme-indigo md-default-theme">

			    Create/Edit Member Information

    </md-toolbar>

    <md-content layout-padding="16" class="transparent-content">
		<md-content class="box-shadow-content">
			<form layout="row" layout-padding="16" name="enterpriseForm" layout-align="center center"
				ng-submit="submit()" ng-disabled="loading">
				<md-content style="width: 100%; max-width: 960px;"
					class="transparent-content enterprise-create">

					      		<md-input-container flex-gt-xs>
						          	Member name
						          	<input ng-model="data.name" name="name" required ng-disabled="loading">

Member name is needed

						        </md-input-container>
										<md-input-container flex-gt-xs>
												Acronym
												<input ng-model="data.appreviation" name="appreviation" required ng-disabled="loading">

Member appreviation is needed

										</md-input-container>
                  <md-input-container fake-md-no-float  flex-gt-xs>
							      	<md-icon md-font-icon="icon-mobile2" class="icon-contact"></md-icon>
							      	<input ng-model="data.phones" ng-disabled="loading" type="text" placeholder="Phone Number (required)" ng-required="false"  name="phone">
							    </md-input-container>
                  <md-input-container fake-md-no-float  flex-gt-xs>
							      	<md-icon md-font-icon="icon-mobile" class="icon-contact"></md-icon>
							      	<input ng-model="data.faxes" ng-disabled="loading" type="text" placeholder="Fax" ng-required="false"  name="fax">
							    </md-input-container>
							    <md-input-container  flex-gt-xs>

							      	<md-icon md-font-icon="icon-envelop" class="email icon-contact"></md-icon>
							      	<input ng-model="data.emails" ng-disabled="loading"
							      		type="email" placeholder="Email" name="email"
							      		fake-ng-required="true">
							    </md-input-container>
							    <md-input-container  flex-gt-xs>
							      	<md-icon md-font-icon="icon-earth" class="icon-contact" style="display:inline-block;"></md-icon>
							      	<input ng-model="data.websites" ng-disabled="loading" type="text" placeholder="Website"  name="website">
							    </md-input-container>
							    <md-input-container  flex-gt-xs>
							      	<md-icon md-font-icon="icon-location2" class="icon-contact" style="display:inline-block;"></md-icon>
							      	<input ng-model="data.address" ng-disabled="loading" type="text" placeholder="Address (required)" name="address"
							      	ng-required="true">
							    </md-input-container>

					         	<div class="logo-inner" layout="column" layout-align="center center"
					         		style="background-image: url('<% uploadingFile.src ? uploadingFile.src : data.logo.file_name %>')">

					         		Member Logo Here
					         		{{-- Please, save your listing first before upload --}}

					         		<md-progress-circular md-mode="determinate"
					         			ng-show="uploadingFile.loading"
					         			value="<% uploadingFile.progress %>"></md-progress-circular>

												<md-input-container flex-gt-xs>
														NGO Type:
														<md-select placeholder="NGO Type" ng-model="data.category_id"
																style="padding-bottom: 0px;" flex-gt-xs>
																<md-option value="">Select item type</md-option>
																<md-option value="<% item.id %>" ng-repeat="(k, item) in ngo_types"><% item.display_name %></md-option>
														</md-select>
												</md-input-container>
												<md-input-container flex-gt-xs>
														Project Type:
														<md-select placeholder="Project Type" ng-model="data.project_type_id"
																style="padding-bottom: 0px;" flex-gt-xs>
																<md-option value="">Select item type</md-option>
																<md-option value="<% item.id %>" ng-repeat="(k, item) in project_types"><% item.display_name %></md-option>
														</md-select>
												</md-input-container>
												<md-input-container flex-gt-xs>
														Location:
														<md-select placeholder="Location" ng-model="data.location_id"
																style="padding-bottom: 0px;" flex-gt-xs>
																<md-option value="">Select location</md-option>
																<md-option value="<% item.id %>" ng-repeat="(k, item) in locations"><% item.display_name %></md-option>
														</md-select>
												</md-input-container>

			      		<md-tabs md-dynamic-height md-border-bottom>
			      			{{-- Detail Description --}}
					      	<md-tab label="detail">
					        	<md-content class="md-padding">

			            	            <md-input-container flex-gt-xs>
			            	                Order Number
			            	                <input ng-model="data.seq_number" step="any" name="order" type="number">

Order number is not valid

			            	            </md-input-container>

								      	<md-input-container  flex-gt-xs>
							                Short Description
							                <textarea ng-model="data.short_description"
							                	style="min-height: 100px;"
							                	ng-disabled="loading" columns="1" name="shortDescription"
							                	md-maxlength="200"></textarea>
								      	</md-input-container>

								      	<md-input-container  flex-gt-xs>
							                Background
							                <textarea ng-model="data.background"
							                	style="min-height: 200px;"
							                	ng-disabled="loading" columns="1" name="background"
							                	md-maxlength="1000"></textarea>
											{{-- <textarea name="post-editor"
												co-editor
												id="post-editor" ng-model="data.description" rows="10"
												cols="80">
												Your text goes here!
											</textarea> --}}
								      	</md-input-container>

								      	<md-input-container  flex-gt-xs>
							                Vision
							                <textarea ng-model="data.vision"
							                	style="min-height: 200px;"
							                	ng-disabled="loading" columns="1" name="vision"
							                	md-maxlength="1000"></textarea>
								      	</md-input-container>

								      	<md-input-container  flex-gt-xs>
							                Mission
							                <textarea ng-model="data.mission"
							                	style="min-height: 200px;"
							                	ng-disabled="loading" columns="1" name="mission"
							                	md-maxlength="1000"></textarea>
								      	</md-input-container>
								      	<md-input-container  flex-gt-xs>
							                Goal
							                <textarea ng-model="data.goal"
							                	style="min-height: 200px;"
							                	ng-disabled="loading" columns="1" name="goal"
							                	md-maxlength="1000"></textarea>
								      	</md-input-container>

					        	</md-content>
					      	</md-tab>
                  {{-- staff --}}
					      	<md-tab label="staff">
										{{-- staff toolbar --}}
					        	<md-toolbar class="md-table-toolbar alternate toolbar-selected-item" ng-show="staff_selected.length" aria-hidden="false"
									style="min-height: 45px;">

<% staff_selected.length %> items selected

						                <md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="staff_selected.length > 1"
						                    type="button" ng-click="editStaff($event)" aria-label="edit">
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>
														<md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="staff_selected.length > 1"
						                    type="button" ng-click="removeStaff($event)" aria-label="remove">
						                    <md-icon md-font-icon="icon-cancel-circle" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-toolbar>
										{{-- staff table --}}
						        <md-table-container class="box-shadow-content">

						                Staff Type
						                Qty
						                Female
						                Updated at

						                <% item.type.display_name %>
						                <% item.quantity %>
														<% item.female_quantity %>
						                <% formatUtcDate(item.updated_at) %>

													<tr md-row ng-show="staffs.length <= 0">
														There is no staff data.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addStaff($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

 0">
														Add more staff.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addStaff($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-plus" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-table-container>
					      	</md-tab>
                  {{-- budget --}}
					      	<md-tab label="budget">
					        	<md-toolbar class="md-table-toolbar alternate toolbar-selected-item" ng-show="budget_selected.length" aria-hidden="false"
									style="min-height: 45px;">

<% budget_selected.length %> items selected

						                <md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="budget_selected.length > 1"
						                    type="button" ng-click="editBudget($event)" aria-label="edit">
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>
														<md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="budget_selected.length > 1"
						                    type="button" ng-click="removeBudget($event)" aria-label="remove">
						                    <md-icon md-font-icon="icon-cancel-circle" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-toolbar>

						        <md-table-container class="box-shadow-content">

						                Budget Year
						                Organizational Budget
						                Project cost
														Admin cost
														Other cost
														Education Project Budget
						                Updated at

						                <% item.year %>
						                <% item.org_budget %>
						                <% item.project_cost %>
						                <% item.admin_cost %>
                            <% item.other_cost %>
														<% item.edu_project_cost %>
						                <% formatUtcDate(item.updated_at) %>

													<tr md-row ng-show="budgets.length <= 0">
														There is no budget data.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addBudget($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

 0">
														Add more budget.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addBudget($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-plus" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-table-container>
					      	</md-tab>
                            {{-- donor --}}
					      	<md-tab label="donor">
					        	<md-toolbar class="md-table-toolbar alternate toolbar-selected-item" ng-show="donor_selected.length" aria-hidden="false"
									style="min-height: 45px;">

<% donor_selected.length %> items selected

						                <md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="donor_selected.length > 1"
						                    type="button" ng-click="editDonor($event)" aria-label="edit">
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>
														<md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="donor_selected.length > 1"
						                    type="button" ng-click="removeDonor($event)" aria-label="remove">
						                    <md-icon md-font-icon="icon-cancel-circle" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-toolbar>

						        <md-table-container class="box-shadow-content">

						                Donor Year
						                Donor Name
						                Description
						                Updated at

						                <% item.year %>
						                <% item.name %>
						                <% item.description %>
						                <% formatUtcDate(item.updated_at) %>

													<tr md-row ng-show="donors.length <= 0">
														There is no donor data.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addDonor($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

 0">
														Add more donor.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addDonor($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-plus" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-table-container>
					      	</md-tab>
                  {{-- activities --}}
					      	<md-tab label="activity">
					        	<md-toolbar class="md-table-toolbar alternate toolbar-selected-item" ng-show="activity_selected.length" aria-hidden="false"
									style="min-height: 45px;">

<% activity_selected.length %> items selected

						                <md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="activity_selected.length > 1"
						                    type="button" ng-click="editActivity($event)" aria-label="edit">
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>
														<md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="staff_selected.length > 1"
						                    type="button" ng-click="removeActivity($event)" aria-label="remove">
						                    <md-icon md-font-icon="icon-cancel-circle" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-toolbar>

						        <md-table-container class="box-shadow-content">

						                Project Name
						                Location
						                Description
                            Date
						                Updated at

						                <% item.name %>
						                <% item.location_obj.display_name %>
						                <% item.description %>
                            <% item.activity_date %>
						                <% formatUtcDate(item.updated_at) %>

													<tr md-row ng-show="activities.length <= 0">
														There is no activity data.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addActivity($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

 0">
														Add more activity.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addActivity($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-plus" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-table-container>
					      	</md-tab>
                  {{-- contact --}}
					      	<md-tab label="contact">
					        	<md-toolbar class="md-table-toolbar alternate toolbar-selected-item" ng-show="contact_selected.length" aria-hidden="false"
									style="min-height: 45px;">

<% contact_selected.length %> items selected

						                <md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="contact_selected.length > 1"
						                    type="button" ng-click="editContact($event)" aria-label="edit">
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>
														<md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="contact_selected.length > 1"
						                    type="button" ng-click="removeContact($event)" aria-label="remove">
						                    <md-icon md-font-icon="icon-cancel-circle" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-toolbar>

						        <md-table-container class="box-shadow-content">

						                Name
														Contact Type
						                Position
						                Email
														Phone
														Social Network
						                Updated at

						                <% item.name %>
														<% contact_types[item.contact_type] %>
						                <% item.position.display_name %>
						                <% item.email %>
														<% item.phone %>
														<% item.social_network %>
														<% formatUtcDate(item.updated_at) %>

													<tr md-row ng-show="contacts.length <= 0">
														There is no contact data.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addContact($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

 0">
														Add more contact.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addContact($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-plus" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-table-container>
					      	</md-tab>
									{{-- library --}}
					      	<md-tab label="library">
					        	<md-toolbar class="md-table-toolbar alternate toolbar-selected-item" ng-show="library_selected.length" aria-hidden="false"
									style="min-height: 45px;">

<% library_selected.length %> items selected

						                <md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="library_selected.length > 1"
						                    type="button" ng-click="editLibrary($event)" aria-label="edit">
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>
														<md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="library_selected.length > 1"
						                    type="button" ng-click="removeLibrary($event)" aria-label="remove">
						                    <md-icon md-font-icon="icon-cancel-circle" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-toolbar>

						        <md-table-container class="box-shadow-content">

						                Name
						                Description
						                English
														Khmer
														Downloads (Eng)
														Downloads (Khm)
						                Updated at

						                <% item.name %>
						                <% item.description %>
						                <td md-cell style="<% item.document_english ? 'font-weight: bold': ''%>"><% item.document_english ? 'Yes' : 'No' %>
														<td md-cell style="<% item.document_khmer ? 'font-weight: bold': ''%>"><% item.document_khmer ? 'Yes' : 'No' %>
														<td md-cell style="<% item.document_english ? 'font-weight: bold': ''%>"><% item.document_english_download %>
														<td md-cell style="<% item.document_khmer ? 'font-weight: bold': ''%>"><% item.document_khmer_download %>
														<% formatUtcDate(item.updated_at) %>

													<tr md-row ng-show="libraries.length <= 0">
														There is no library data.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addLibrary($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

 0">
														Add more library.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addLibrary($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-plus" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-table-container>
					      	</md-tab>

									{{-- user --}}
					      	<md-tab label="user">
					        	<md-toolbar class="md-table-toolbar alternate toolbar-selected-item" ng-show="user_selected.length" aria-hidden="false"
									style="min-height: 45px;">

<% user_selected.length %> items selected

						                <md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="user_selected.length > 1"
						                    type="button" ng-click="editUser($event)" aria-label="edit">
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>
														<md-button class="md-icon-button md-button md-ink-ripple"
						                    ng-hide="user_selected.length > 1"
						                    type="button" ng-click="removeUser($event)" aria-label="remove">
						                    <md-icon md-font-icon="icon-cancel-circle" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-toolbar>

						        <md-table-container class="box-shadow-content">

						                Name
						                Email
														Role
						                Updated at

						                <% item.name %>
						                <% item.email %>
														<% item.role.display_name %>
														<% formatUtcDate(item.updated_at) %>

													<tr md-row ng-show="users.length <= 0">
														There is no user data.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addUser($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-pencil" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

 0">
														Add more user.

															 <md-button class="md-primary md-button md-ink-ripple"
						                    type="button" ng-click="addUser($event)" aria-label="addStaff">
																Add
						                    <md-icon md-font-icon="icon-plus" class="md-font material-icons icon-office" aria-hidden="true"></md-icon>
						                </md-button>

						        </md-table-container>
					      	</md-tab>
				    	</md-tabs>

			        		<md-button class="md-raised md-primary" type="submit"
				      			fng-click="save($event)">Save</md-button>
			        		<md-button class="md-raised md-danger" type="button"
				      			ng-click="delete($event)">Delete</md-button>

			    </md-content>
		    </form>
	    </md-content>
    </md-content>


text:
<!-- start custom head snippets -->
<link rel="icon" type="image/png" href="/assets/images/favicon.png">
<!-- end custom head snippets -->

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Success\NotificationBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

//class GreetCommand extends ContainerAwareCommand
//{
//}
//

class ProcessSMSCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('notify:process_sms')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $text = 'Processing SMS';
        $nm = $this->getContainer()->get('success.notification.notification_manager');
        $nm->processSMSNotifications();
        $output->writeln($text);
    }
}


text:
package org.apache.commons.jcs.engine;

import java.io.IOException;
import java.io.Serializable;

import junit.extensions.ActiveTestSuite;
import junit.framework.Test;
import junit.framework.TestCase;

import org.apache.commons.jcs.engine.behavior.ICacheElement;
import org.apache.commons.jcs.engine.behavior.ICacheListener;

/**
 * This test case is designed to makes sure there are no deadlocks in the event queue. The time to
 * live should be set to a very short interval to make a deadlock more likely.
 *

 * @author Aaron Smuts
 */
public class EventQueueConcurrentLoadTest
    extends TestCase
{
    /** The queue implementation */
    private static CacheEventQueue<String, String> queue = null;

    /** The mock listener */
    private static CacheListenerImpl<String, String> listen = null;

    /** max failure setting */
    private final int maxFailure = 3;

    /** time to wait before retrying on failure. */
    private final int waitBeforeRetry = 100;

    /** very small idle time */
    private final int idleTime = 2;

    /**
     * Constructor for the TestDiskCache object.
     * @param testName
     */
    public EventQueueConcurrentLoadTest( String testName )
    {
        super( testName );
    }

    /**
     * Main method passes this test to the text test runner.
     * @param args
     */
    public static void main( String args[] )
    {
        String[] testCaseName = { EventQueueConcurrentLoadTest.class.getName() };
        junit.textui.TestRunner.main( testCaseName );
    }

    /**
     * A unit test suite for JUnit
     * @return The test suite
     */
    public static Test suite()
    {
        ActiveTestSuite suite = new ActiveTestSuite();

        suite.addTest( new EventQueueConcurrentLoadTest( "testRunPutTest1" )
        {
            @Override
            public void runTest()
                throws Exception
            {
                this.runPutTest( 200, 200 );
            }
        } );

        suite.addTest( new EventQueueConcurrentLoadTest( "testRunPutTest2" )
        {
            @Override
            public void runTest()
                throws Exception
            {
                this.runPutTest( 1200, 1400 );
            }
        } );

        suite.addTest( new EventQueueConcurrentLoadTest( "testRunRemoveTest1" )
        {
            @Override
            public void runTest()
                throws Exception
            {
                this.runRemoveTest( 2200 );
            }
        } );

        suite.addTest( new EventQueueConcurrentLoadTest( "testStopProcessing1" )
        {
            @Override
            public void runTest()
                throws Exception
            {
                this.runStopProcessingTest();
            }
        } );

        suite.addTest( new EventQueueConcurrentLoadTest( "testRunPutTest4" )
        {
            @Override
            public void runTest()
                throws Exception
            {
                this.runPutTest( 5200, 6600 );
            }
        } );

        suite.addTest( new EventQueueConcurrentLoadTest( "testRunRemoveTest2" )
        {
            @Override
            public void runTest()
                throws Exception
            {
                this.runRemoveTest( 5200 );
            }
        } );

        suite.addTest( new EventQueueConcurrentLoadTest( "testStopProcessing2" )
        {
            @Override
            public void runTest()
                throws Exception
            {
                this.runStopProcessingTest();
            }
        } );

        suite.addTest( new EventQueueConcurrentLoadTest( "testRunPutDelayTest" )
        {
            @Override
            public void runTest()
                throws Exception
            {
                this.runPutDelayTest( 100, 6700 );
            }
        } );

        return suite;
    }

    /**
     * Test setup. Create the static queue to be used by all tests
     */
    @Override
    public void setUp()
    {
        listen = new CacheListenerImpl<String, String>();
        queue = new CacheEventQueue<String, String>( listen, 1L, "testCache1", maxFailure, waitBeforeRetry );

        queue.setWaitToDieMillis( idleTime );
    }

    /**
     * Adds put events to the queue.
     * @param end
     * @param expectedPutCount
     * @throws Exception
     */
    public void runPutTest( int end, int expectedPutCount )
        throws Exception
    {
        for ( int i = 0; i <= end; i++ )
        {
            CacheElement<String, String> elem = new CacheElement<String, String>( "testCache1", i + ":key", i + "data" );
            queue.addPutEvent( elem );
        }

        while ( !queue.isEmpty() )
        {
            synchronized ( this )
            {
                System.out.println( "queue is still busy, waiting 250 millis" );
                this.wait( 250 );
            }
        }
        System.out.println( "queue is empty, comparing putCount" );

        // this becomes less accurate with each test. It should never fail. If
        // it does things are very off.
        assertTrue( "The put count [" + listen.putCount + "] is below the expected minimum threshold ["
            + expectedPutCount + "]", listen.putCount >= ( expectedPutCount - 1 ) );

    }

    /**
     * Add remove events to the event queue.
     * @param end
     * @throws Exception
     */
    public void runRemoveTest( int end )
        throws Exception
    {
        for ( int i = 0; i <= end; i++ )
        {
            queue.addRemoveEvent( i + ":key" );
        }

    }

    /**
     * Add remove events to the event queue.
     * @throws Exception
     */
    public void runStopProcessingTest()
        throws Exception
    {
        queue.stopProcessing();
    }

    /**
     * Test putting and a delay. Waits until queue is empty to start.
     * @param end
     * @param expectedPutCount
     * @throws Exception
     */
    public void runPutDelayTest( int end, int expectedPutCount )
        throws Exception
    {
        while ( !queue.isEmpty() )
        {
            synchronized ( this )
            {
                System.out.println( "queue is busy, waiting 250 millis to begin" );
                this.wait( 250 );
            }
        }
        System.out.println( "queue is empty, begin" );

        // get it going
        CacheElement<String, String> elem = new CacheElement<String, String>( "testCache1", "a:key", "adata" );
        queue.addPutEvent( elem );

        for ( int i = 0; i <= end; i++ )
        {
            synchronized ( this )
            {
                if ( i % 2 == 0 )
                {
                    this.wait( idleTime );
                }
                else
                {
                    this.wait( idleTime / 2 );
                }
            }
            CacheElement<String, String> elem2 = new CacheElement<String, String>( "testCache1", i + ":key", i + "data" );
            queue.addPutEvent( elem2 );
        }

        while ( !queue.isEmpty() )
        {
            synchronized ( this )
            {
                System.out.println( "queue is still busy, waiting 250 millis" );
                this.wait( 250 );
            }
        }
        System.out.println( "queue is empty, comparing putCount" );

        Thread.sleep( 1000 );

        // this becomes less accurate with each test. It should never fail. If
        // it does things are very off.
        assertTrue( "The put count [" + listen.putCount + "] is below the expected minimum threshold ["
            + expectedPutCount + "]", listen.putCount >= ( expectedPutCount - 1 ) );

    }

    /**
     * This is a dummy cache listener to use when testing the event queue.
     */
    protected static class CacheListenerImpl<K extends Serializable, V extends Serializable>
        implements ICacheListener<K, V>
    {
        /**
         * putCount
         */
        protected int putCount = 0;

        /**
         * removeCount
         */
        protected int removeCount = 0;

        /**
         * @param item
         * @throws IOException
         */
        public void handlePut( ICacheElement<K, V> item )
            throws IOException
        {
            synchronized ( this )
            {
                putCount++;
            }
        }

        /**
         * @param cacheName
         * @param key
         * @throws IOException
         */
        public void handleRemove( String cacheName, K key )
            throws IOException
        {
            synchronized ( this )
            {
                removeCount++;
            }

        }

        /**
         * @param cacheName
         * @throws IOException
         */
        public void handleRemoveAll( String cacheName )
            throws IOException
        {
            // TODO Auto-generated method stub

        }

        /**
         * @param cacheName
         * @throws IOException
         */
        public void handleDispose( String cacheName )
            throws IOException
        {
            // TODO Auto-generated method stub

        }

        /**
         * @param id
         * @throws IOException
         */
        public void setListenerId( long id )
            throws IOException
        {
            // TODO Auto-generated method stub

        }

        /**
         * @return 0
         * @throws IOException
         */
        public long getListenerId()
            throws IOException
        {
            // TODO Auto-generated method stub
            return 0;
        }

    }
}


text:
from setuptools import setup, find_packages

version = '0.1'

with open('README.rst', 'rt') as readme:
    description = readme.read()

with open('CHANGES.txt', 'rt') as changes:
    history = changes.read()

setup(name='doctrine.urwid',
      version=version,
      description="A urwid editor widget",
      long_description=description + '\n' + history,
      # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
      classifiers=['Development Status :: 1 - Pre-Alpha',
                   'Programming Language :: Python :: 3.4',
                   'License :: OSI Approved :: MIT License',
                   ],
      keywords='',
      author='Lennart Regebro',
      author_email='regebro@gmail.com',
      url='https://github.com/regebro/doctrine.urwid',
      license='MIT',
      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
      include_package_data=True,
      zip_safe=False,
      test_suite='tests',
      install_requires=[
          'urwid',
          'doctrine.code'
      ],
      )


text:
package net.bytebuddy.implementation.attribute;

import net.bytebuddy.description.annotation.AnnotationDescription;
import net.bytebuddy.description.annotation.AnnotationList;
import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.method.ParameterDescription;
import net.bytebuddy.description.type.TypeDescription;
import org.objectweb.asm.MethodVisitor;

import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;

/**
 * An appender that writes attributes or annotations to a given ASM {@link org.objectweb.asm.MethodVisitor}.
 */
public interface MethodAttributeAppender {

    /**
     * Applies this attribute appender to a given method visitor.
     *
     * @param methodVisitor     The method visitor to which the attributes that are represented by this attribute
     *                          appender are written to.
     * @param methodDescription The description of the method for which the given method visitor creates an
     *                          instrumentation for.
     */
    void apply(MethodVisitor methodVisitor, MethodDescription methodDescription);

    /**
     * A method attribute appender that does not append any attributes.
     */
    enum NoOp implements MethodAttributeAppender, Factory {

        /**
         * The singleton instance.
         */
        INSTANCE;

        @Override
        public MethodAttributeAppender make(TypeDescription typeDescription) {
            return this;
        }

        @Override
        public void apply(MethodVisitor methodVisitor, MethodDescription methodDescription) {
            /* do nothing */
        }

        @Override
        public String toString() {
            return "MethodAttributeAppender.NoOp." + name();
        }
    }

    /**
     * Implementation of a method attribute appender that writes all annotations of the instrumented method to the
     * method that is being created. This includes method and parameter annotations.
     */
    class ForInstrumentedMethod implements MethodAttributeAppender, Factory {

        /**
         * The value filter to apply for discovering which values of an annotation should be written.
         */
        private final AnnotationAppender.ValueFilter valueFilter;

        /**
         * Creates a new appender for appending the instrumented method's annotation to the created method.
         *
         * @param valueFilter The value filter to apply for discovering which values of an annotation should be written.
         */
        public ForInstrumentedMethod(AnnotationAppender.ValueFilter valueFilter) {
            this.valueFilter = valueFilter;
        }

        @Override
        public void apply(MethodVisitor methodVisitor, MethodDescription methodDescription) {
            AnnotationAppender methodAppender = new AnnotationAppender.Default(new AnnotationAppender.Target.OnMethod(methodVisitor), valueFilter);
            for (AnnotationDescription annotation : methodDescription.getDeclaredAnnotations()) {
                methodAppender.append(annotation, AnnotationAppender.AnnotationVisibility.of(annotation));
            }
            int index = 0;
            for (ParameterDescription parameterDescription : methodDescription.getParameters()) {
                AnnotationAppender parameterAppender = new AnnotationAppender.Default(new AnnotationAppender.Target.OnMethodParameter(methodVisitor, index++), valueFilter);
                for (AnnotationDescription annotation : parameterDescription.getDeclaredAnnotations()) {
                    parameterAppender.append(annotation, AnnotationAppender.AnnotationVisibility.of(annotation));
                }
            }
        }

        @Override
        public MethodAttributeAppender make(TypeDescription typeDescription) {
            return this;
        }

        @Override
        public boolean equals(Object other) {
            return this == other || !(other == null || getClass() != other.getClass())
                    && valueFilter.equals(((ForInstrumentedMethod) other).valueFilter);
        }

        @Override
        public int hashCode() {
            return valueFilter.hashCode();
        }

        @Override
        public String toString() {
            return "MethodAttributeAppender.ForInstrumentedMethod{" +
                    "valueFilter=" + valueFilter +
                    '}';
        }
    }

    /**
     * A factory that creates method attribute appenders for a given type.
     */
    interface Factory {

        /**
         * Returns a method attribute appender that is applicable for a given type description.
         *
         * @param typeDescription The type for which a method attribute appender is to be applied for.
         * @return The method attribute appender which should be applied for the given type.
         */
        MethodAttributeAppender make(TypeDescription typeDescription);

        /**
         * A method attribute appender factory that combines several method attribute appender factories to be
         * represented as a single factory.
         */
        class Compound implements Factory {

            /**
             * The factories this compound factory represents in their application order.
             */
            private final Factory[] factory;

            /**
             * Creates a new compound method attribute appender factory.
             *
             * @param factory The factories that are to be combined by this compound factory in the order of their
             *                application.
             */
            public Compound(Factory... factory) {
                this.factory = factory;
            }

            @Override
            public MethodAttributeAppender make(TypeDescription typeDescription) {
                MethodAttributeAppender[] methodAttributeAppender = new MethodAttributeAppender[factory.length];
                int index = 0;
                for (Factory factory : this.factory) {
                    methodAttributeAppender[index++] = factory.make(typeDescription);
                }
                return new MethodAttributeAppender.Compound(methodAttributeAppender);
            }

            @Override
            public boolean equals(Object other) {
                return this == other || !(other == null || getClass() != other.getClass())
                        && Arrays.equals(factory, ((Compound) other).factory);
            }

            @Override
            public int hashCode() {
                return Arrays.hashCode(factory);
            }

            @Override
            public String toString() {
                return "MethodAttributeAppender.Factory.Compound{factory=" + Arrays.toString(factory) + '}';
            }
        }
    }

    /**
     * Appends an annotation to a method or method parameter. The visibility of the annotation is determined by the
     * annotation type's {@link java.lang.annotation.RetentionPolicy} annotation.
     */
    class ForAnnotation implements MethodAttributeAppender, Factory {

        /**
         * the annotations this method attribute appender is writing to its target.
         */
        private final List<? extends AnnotationDescription> annotations;

        /**
         * The target to which the annotations are written to.
         */
        private final Target target;

        /**
         * The value filter to apply for discovering which values of an annotation should be written.
         */
        private final AnnotationAppender.ValueFilter valueFilter;

        /**
         * Creates a new appender for appending an annotation to a method parameter.
         *
         * @param parameterIndex The index of the parameter to which the annotations should be written.
         * @param valueFilter    The value filter to apply for discovering which values of an annotation should be written.
         * @param annotation     The annotations that should be written.
         */
        public ForAnnotation(int parameterIndex, AnnotationAppender.ValueFilter valueFilter, Annotation... annotation) {
            this(parameterIndex, new AnnotationList.ForLoadedAnnotation(annotation), valueFilter);
        }

        /**
         * Creates a new appender for appending an annotation to a method parameter.
         *
         * @param valueFilter The value filter to apply for discovering which values of an annotation should be written.
         * @param annotation  The annotations that should be written.
         */
        public ForAnnotation(AnnotationAppender.ValueFilter valueFilter, Annotation... annotation) {
            this(new AnnotationList.ForLoadedAnnotation(annotation), valueFilter);
        }

        /**
         * Creates a new appender for appending an annotation to a method.
         *
         * @param parameterIndex The index of the parameter to which the annotations should be written.
         * @param annotations    The annotations that should be written.
         * @param valueFilter    The value filter to apply for discovering which values of an annotation should be written.
         */
        public ForAnnotation(int parameterIndex, List<? extends AnnotationDescription> annotations, AnnotationAppender.ValueFilter valueFilter) {
            this.annotations = annotations;
            target = new Target.OnMethodParameter(parameterIndex);
            this.valueFilter = valueFilter;
        }

        /**
         * Creates a new appender for appending an annotation to a method.
         *
         * @param annotations The annotations that should be written.
         * @param valueFilter The value filter to apply for discovering which values of an annotation should be written.
         */
        public ForAnnotation(List<? extends AnnotationDescription> annotations, AnnotationAppender.ValueFilter valueFilter) {
            this.annotations = annotations;
            target = Target.OnMethod.INSTANCE;
            this.valueFilter = valueFilter;
        }

        @Override
        public void apply(MethodVisitor methodVisitor, MethodDescription methodDescription) {
            AnnotationAppender appender = new AnnotationAppender.Default(target.make(methodVisitor, methodDescription), valueFilter);
            for (AnnotationDescription annotation : this.annotations) {
                appender.append(annotation, AnnotationAppender.AnnotationVisibility.of(annotation));
            }
        }

        @Override
        public MethodAttributeAppender make(TypeDescription typeDescription) {
            return this;
        }

        @Override
        public boolean equals(Object other) {
            return this == other || !(other == null || getClass() != other.getClass())
                    && annotations.equals(((ForAnnotation) other).annotations)
                    && valueFilter.equals(((ForAnnotation) other).valueFilter)
                    && target.equals(((ForAnnotation) other).target);
        }

        @Override
        public int hashCode() {
            return 31 * (31 * annotations.hashCode() + valueFilter.hashCode()) + target.hashCode();
        }

        @Override
        public String toString() {
            return "MethodAttributeAppender.ForAnnotation{" +
                    "annotations=" + annotations +
                    ", valueFilter=" + valueFilter +
                    ", target=" + target +
                    '}';
        }

        /**
         * Represents the target on which this method attribute appender should write its annotations to.
         */
        protected interface Target {

            /**
             * Materializes the target for a given creation process.
             *
             * @param methodVisitor     The method visitor to which the attributes that are represented by this
             *                          attribute appender are written to.
             * @param methodDescription The description of the method for which the given method visitor creates an
             *                          instrumentation for.
             * @return The target of the annotation appender this target represents.
             */
            AnnotationAppender.Target make(MethodVisitor methodVisitor, MethodDescription methodDescription);

            /**
             * A method attribute appender target for writing annotations directly onto the method.
             */
            enum OnMethod implements Target {

                /**
                 * The singleton instance.
                 */
                INSTANCE;

                @Override
                public AnnotationAppender.Target make(MethodVisitor methodVisitor, MethodDescription methodDescription) {
                    return new AnnotationAppender.Target.OnMethod(methodVisitor);
                }

                @Override
                public String toString() {
                    return "MethodAttributeAppender.ForAnnotation.Target.OnMethod." + name();
                }
            }

            /**
             * A method attribute appender target for writing annotations onto a given method parameter.
             */
            class OnMethodParameter implements Target {

                /**
                 * The index of the parameter to write the annotation to.
                 */
                private final int parameterIndex;

                /**
                 * Creates a target for a method attribute appender for a method parameter of the given index.
                 *
                 * @param parameterIndex The index of the target parameter.
                 */
                protected OnMethodParameter(int parameterIndex) {
                    this.parameterIndex = parameterIndex;
                }

                @Override
                public AnnotationAppender.Target make(MethodVisitor methodVisitor, MethodDescription methodDescription) {
                    if (parameterIndex >= methodDescription.getParameters().size()) {
                        throw new IllegalArgumentException("Method " + methodDescription + " has less then " + parameterIndex + " parameters");
                    }
                    return new AnnotationAppender.Target.OnMethodParameter(methodVisitor, parameterIndex);
                }

                @Override
                public boolean equals(Object other) {
                    return this == other || !(other == null || getClass() != other.getClass())
                            && parameterIndex == ((OnMethodParameter) other).parameterIndex;
                }

                @Override
                public int hashCode() {
                    return parameterIndex;
                }

                @Override
                public String toString() {
                    return "MethodAttributeAppender.ForAnnotation.Target.OnMethodParameter{parameterIndex=" + parameterIndex + '}';
                }
            }
        }
    }

    /**
     * Implementation of a method attribute appender that writes all annotations of a given loaded method to the
     * method that is being created. This includes method and parameter annotations. In order to being able to do so,
     * the target method and the given method must have compatible signatures, i.e. an identical number of method
     * parameters. Otherwise, an exception is thrown when this attribute appender is applied on a method.
     */
    class ForMethod implements MethodAttributeAppender, Factory {

        /**
         * The method of which the annotations are to be copied.
         */
        private final MethodDescription methodDescription;

        /**
         * The value filter to apply for discovering which values of an annotation should be written.
         */
        private final AnnotationAppender.ValueFilter valueFilter;

        /**
         * Creates an that copies the annotations of a given constructor to its target.
         *
         * @param constructor The constructor of which the annotations should be copied.
         * @param valueFilter The value filter to apply for discovering which values of an annotation should be written.
         */
        public ForMethod(Constructor<?> constructor, AnnotationAppender.ValueFilter valueFilter) {
            this(new MethodDescription.ForLoadedConstructor(constructor), valueFilter);
        }

        /**
         * Creates an that copies the annotations of a given method to its target.
         *
         * @param method      The method of which the annotations should be copied.
         * @param valueFilter The value filter to apply for discovering which values of an annotation should be written.
         */
        public ForMethod(Method method, AnnotationAppender.ValueFilter valueFilter) {
            this(new MethodDescription.ForLoadedMethod(method), valueFilter);
        }

        /**
         * Creates an that copies the annotations of a given method description to its target.
         *
         * @param methodDescription The method description of which the annotations should be copied.
         * @param valueFilter       The value filter to apply for discovering which values of an annotation should be written.
         */
        public ForMethod(MethodDescription methodDescription, AnnotationAppender.ValueFilter valueFilter) {
            this.methodDescription = methodDescription;
            this.valueFilter = valueFilter;
        }

        @Override
        public void apply(MethodVisitor methodVisitor, MethodDescription methodDescription) {
            if (this.methodDescription.getParameters().size() > methodDescription.getParameters().size()) {
                throw new IllegalArgumentException(this.methodDescription + " has more parameters than the instrumented method " + methodDescription);
            }
            AnnotationAppender methodAppender = new AnnotationAppender.Default(new AnnotationAppender.Target.OnMethod(methodVisitor), valueFilter);
            for (AnnotationDescription annotation : this.methodDescription.getDeclaredAnnotations()) {
                methodAppender.append(annotation, AnnotationAppender.AnnotationVisibility.of(annotation));
            }
            int index = 0;
            for (ParameterDescription parameterDescription : this.methodDescription.getParameters()) {
                AnnotationAppender parameterAppender = new AnnotationAppender.Default(new AnnotationAppender.Target.OnMethodParameter(methodVisitor, index++), valueFilter);
                for (AnnotationDescription annotation : parameterDescription.getDeclaredAnnotations()) {
                    parameterAppender.append(annotation, AnnotationAppender.AnnotationVisibility.of(annotation));
                }
            }
        }

        @Override
        public MethodAttributeAppender make(TypeDescription typeDescription) {
            return this;
        }

        @Override
        public boolean equals(Object other) {
            return this == other || !(other == null || getClass() != other.getClass())
                    && methodDescription.equals(((ForMethod) other).methodDescription)
                    && valueFilter.equals(((ForMethod) other).valueFilter);
        }

        @Override
        public int hashCode() {
            return 31 * methodDescription.hashCode() + valueFilter.hashCode();
        }

        @Override
        public String toString() {
            return "MethodAttributeAppender.ForMethod{" +
                    "methodDescription=" + methodDescription +
                    ", valueFilter=" + valueFilter +
                    '}';
        }
    }

    /**
     * A method attribute appender that combines several method attribute appenders to be represented as a single
     * method attribute appender.
     */
    class Compound implements MethodAttributeAppender {

        /**
         * The method attribute appenders this compound appender represents in their application order.
         */
        private final MethodAttributeAppender[] methodAttributeAppender;

        /**
         * Creates a new compound method attribute appender.
         *
         * @param methodAttributeAppender The method attribute appenders that are to be combined by this compound appender
         *                                in the order of their application.
         */
        public Compound(MethodAttributeAppender... methodAttributeAppender) {
            this.methodAttributeAppender = methodAttributeAppender;
        }

        @Override
        public void apply(MethodVisitor methodVisitor, MethodDescription methodDescription) {
            for (MethodAttributeAppender methodAttributeAppender : this.methodAttributeAppender) {
                methodAttributeAppender.apply(methodVisitor, methodDescription);
            }
        }

        @Override
        public boolean equals(Object other) {
            return this == other || !(other == null || getClass() != other.getClass())
                    && Arrays.equals(methodAttributeAppender, ((Compound) other).methodAttributeAppender);
        }

        @Override
        public int hashCode() {
            return Arrays.hashCode(methodAttributeAppender);
        }

        @Override
        public String toString() {
            return "MethodAttributeAppender.Compound{methodAttributeAppender=" + Arrays.toString(methodAttributeAppender) + '}';
        }
    }
}


text:
using System;
using System.Collections.ObjectModel;
using System.ComponentModel.Composition;
using System.Reactive.Disposables;
using System.Windows.Input;
using GitHub.Exports;
using GitHub.Extensions;
using GitHub.Models;
using GitHub.Services;
using GitHub.UI;
using GitHub.ViewModels;
using GitHub.VisualStudio.Base;
using GitHub.VisualStudio.Helpers;
using NullGuard;
using ReactiveUI;

namespace GitHub.VisualStudio.UI.Views
{
    public class GenericGitHubPaneView : SimpleViewUserControl<IGitHubPaneViewModel, GitHubPaneView>
    {
    }

    [ExportView(ViewType = UIViewType.GitHubPane)]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public partial class GitHubPaneView : GenericGitHubPaneView
    {
        public GitHubPaneView()
        {
            this.InitializeComponent();
            DataContextChanged += (s, e) => ViewModel = e.NewValue as GitHubPaneViewModel;
        }
    }

    [ExportViewModel(ViewType = UIViewType.GitHubPane)]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public class GitHubPaneViewModel : TeamExplorerSectionBase, IGitHubPaneViewModel
    {
        CompositeDisposable disposables = new CompositeDisposable();
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        IUIController uiController;

        [ImportingConstructor]
        public GitHubPaneViewModel(ITeamExplorerServiceHolder holder, IConnectionManager cm)
            : base(holder, cm)
        {
            Controls = new ObservableCollection<IView>();
        }

        public override void Initialize(IServiceProvider serviceProvider)
        {
            base.Initialize(serviceProvider);

            var disp = ServiceProvider.GetExportedValue<IUIProvider>().GetService<IExportFactoryProvider>().UIControllerFactory.CreateExport();
            disposables.Add(disp);
            uiController = disp.Value;

            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubToolbarCmdSet, PkgCmdIDList.pullRequestCommand,
                (s, e) => {});

            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubToolbarCmdSet, PkgCmdIDList.backCommand,
                (s, e) => { });

            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubToolbarCmdSet, PkgCmdIDList.forwardCommand,
                (s, e) => { });

            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubToolbarCmdSet, PkgCmdIDList.refreshCommand,
                (s, e) => { });
        }

        ObservableCollection<IView> controls;
        public ObservableCollection<IView> Controls
        {
            [return: AllowNull] get { return controls; }
            set { controls = value; this.RaisePropertyChange(); }
        }

        public ReactiveCommand<object> CancelCommand { get; private set; }
        public ICommand Cancel => CancelCommand;

        public bool IsShowing => true;

        bool disposed = false;
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!disposed)
                {
                    controls.Clear();
                    disposables.Dispose();
                    disposed = true;
                }
            }
            base.Dispose(disposing);
        }
    }
}


text:
import expect from 'expect';
import $ from 'jQuery';
import ReactTestUtils from 'react-addons-test-utils';
import { React, makeHelper, ReactDOM } from 'app/__tests__/domUtils';
import { FileTransferDialog } from 'app/components/files/index';
import { FileTransferStore } from 'app/flux/fileTransfer/store';

const $node = $('<div>');
const helper = makeHelper($node);

describe('components/files', function () {

  beforeEach(()=> {
    helper.setup()
  });

  afterEach(() => {
    helper.clean();
  })

  it('should render upload controls', () => {
    let wasClosed = false
    let store = new FileTransferStore()

    store = store.merge({
      isOpen: true,
      isUpload: true
    });

    const onClose = () => {
      wasClosed = true;
    }

    const onTransfer = () => { }

    render({
      store,
      onClose,
      onTransfer
    });

    expect($node.find('.grv-file-transfer-upload').length).toEqual(1)
    expect($node.find('.grv-file-transfer-btn:disabled').length).toEqual(1)

    // verify close actions
    ReactTestUtils.Simulate.click($node.find('.grv-file-transfer-footer button')[0]);
    expect(wasClosed).toEqual(true)
  });

  it('should render download controls', () => {
    let store = new FileTransferStore()

    store = store.merge({
      isOpen: true,
      isUpload: false
    });

    const onClose = () => { }
    const onTransfer = () => { }

    render({
      store,
      onClose,
      onTransfer
    });

    expect($node.find('.grv-file-transfer-download').length).toEqual(1)
    expect($node.find('.grv-file-transfer-btn:disabled').length).toEqual(1)
  });

  const render = props => {
    return ReactDOM.render((
      <FileTransferDialog {...props}
        />
    ), $node[0]);
  }

});


text:
typedef struct List List;
typedef struct Element* ListIterator;
typedef void* Item;

List* List_new();
void List_delete(List* list, void (*delete)(void*));

void List_insertFront(List* list, Item item);
void List_insertBack(List* list, Item item);
Item List_removeFront(List* list);
Item List_removeBack(List* list);

Item List_front(const List* list);
Item List_back(const List* list);
size_t List_size(const List* list);
bool List_isEmpty(const List* list);

ListIterator List_begin(const List* list);
ListIterator List_end(const List* list);
ListIterator List_reverseBegin(const List* list);
ListIterator List_reverseEnd(const List* list);
ListIterator List_next(ListIterator iterator);
ListIterator List_previous(ListIterator iterator);
Item List_item(ListIterator iterator);

#endif //LIST_H


text:
import * as ts from 'typescript';

import {ReflectorHostContext} from '../src/reflector_host';

export type Entry = string | Directory;

export interface Directory { [name: string]: Entry; }

export class MockContext implements ReflectorHostContext {
  constructor(public currentDirectory: string, private files: Entry) {}

  fileExists(fileName: string): boolean { return typeof this.getEntry(fileName) === 'string'; }

  directoryExists(path: string): boolean { return typeof this.getEntry(path) === 'object'; }

  readFile(fileName: string): string|undefined {
    let data = this.getEntry(fileName);
    if (typeof data === 'string') {
      return data;
    }
    return undefined;
  }

  writeFile(fileName: string, data: string): void {
    let parts = fileName.split('/');
    let name = parts.pop();
    let entry = this.getEntry(parts);
    if (entry && typeof entry !== 'string') {
      entry[name] = data;
    }
  }

  assumeFileExists(fileName: string): void { this.writeFile(fileName, ''); }

  getEntry(fileName: string|string[]): Entry|undefined {
    let parts = typeof fileName === 'string' ? fileName.split('/') : fileName;
    if (parts[0]) {
      parts = this.currentDirectory.split('/').concat(parts);
    }
    parts.shift();
    parts = normalize(parts);
    let current = this.files;
    while (parts.length) {
      let part = parts.shift();
      if (typeof current === 'string') {
        return undefined;
      }
      let next = (<Directory>current)[part];
      if (next === undefined) {
        return undefined;
      }
      current = next;
    }
    return current;
  }
}

function normalize(parts: string[]): string[] {
  let result: string[] = [];
  while (parts.length) {
    let part = parts.shift();
    switch (part) {
      case '.':
        break;
      case '..':
        result.pop();
        break;
      default:
        result.push(part);
    }
  }
  return result;
}

export class MockCompilerHost implements ts.CompilerHost {
  constructor(private context: MockContext) {}

  fileExists(fileName: string): boolean { return this.context.fileExists(fileName); }

  readFile(fileName: string): string { return this.context.readFile(fileName); }

  directoryExists(directoryName: string): boolean {
    return this.context.directoryExists(directoryName);
  }

  getSourceFile(
      fileName: string, languageVersion: ts.ScriptTarget,
      onError?: (message: string) => void): ts.SourceFile {
    let sourceText = this.context.readFile(fileName);
    if (sourceText) {
      return ts.createSourceFile(fileName, sourceText, languageVersion);
    } else {
      return undefined;
    }
  }

  getDefaultLibFileName(options: ts.CompilerOptions): string {
    return ts.getDefaultLibFileName(options);
  }

  writeFile: ts.WriteFileCallback = (fileName, text) => { this.context.writeFile(fileName, text); }

  getCurrentDirectory(): string {
    return this.context.currentDirectory;
  }

  getCanonicalFileName(fileName: string): string { return fileName; }

  useCaseSensitiveFileNames(): boolean { return false; }

  getNewLine(): string { return '\n'; }
}


text:
using AutoMapper;
using BunBlog.API.Const;
using BunBlog.API.Models;
using BunBlog.API.Models.Tags;
using BunBlog.Core.Domain.Tags;
using BunBlog.Services.Tags;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BunBlog.API.Controllers
{
    /// <summary>
    /// 标签
    /// </summary>
    [Route("api/tags")]
    [ApiController]
    public class TagController : ControllerBase
    {
        private readonly ITagService _tagService;
        private readonly IMapper _mapper;

        public TagController(
            ITagService tagService,
            IMapper mapper)
        {
            _tagService = tagService;
            _mapper = mapper;
        }

        /// <summary>
        /// 获取标签列表
        /// </summary>
        /// <returns></returns>
        [HttpGet("")]
        public async Task<IActionResult> GetTagListAsync()
        {
            var tagList = await _tagService.GetListAsync();
            return Ok(_mapper.Map<List<TagModel>>(tagList));
        }

        /// <summary>
        /// 根据链接名称,获取指定标签
        /// </summary>
        /// <param name="linkName">链接名称</param>
        /// <returns></returns>
        [HttpGet("{linkName}", Name = nameof(GetTagByLinkNameAsync))]
        public async Task<IActionResult> GetTagByLinkNameAsync([FromRoute]string linkName)
        {
            var tag = await _tagService.GetByLinkNameAsync(linkName);

            if (tag == null)
            {
                return NotFound();
            }

            return Ok(_mapper.Map<TagModel>(tag));
        }

        /// <summary>
        /// 添加一个标签
        /// </summary>
        /// <param name="tagModel">添加标签请求</param>
        /// <returns></returns>
        [HttpPost("")]
        [Authorize]
        public async Task<IActionResult> AddTagAsync([FromBody]TagModel tagModel)
        {
            if (ModelState.IsValid)
            {
                var tag = _mapper.Map<Tag>(tagModel);

                var isExistsResult = await _tagService.IsExistsAsync(tag);
                switch (isExistsResult)
                {
                    case IsTagExists.None:
                        break;

                    case IsTagExists.DisplayName:
                        return BadRequest(new ErrorResponse(ErrorResponseCode.DISPLAY_NAME_ALREADY_EXISTS, $"displayName \"{tagModel.DisplayName}\" 已存在"));

                    case IsTagExists.LinkName:
                        return BadRequest(new ErrorResponse(ErrorResponseCode.LINK_NAME_ALREADY_EXISTS, $"linkName \"{tagModel.LinkName}\" 已存在"));

                    default:
                        throw new InvalidOperationException($"意料外的枚举值 {isExistsResult.ToString()}");
                }

                await _tagService.AddAsync(tag);

                return CreatedAtRoute(nameof(GetTagByLinkNameAsync), new { linkName = tag.LinkName }, _mapper.Map<TagModel>(tag));
            }

            return UnprocessableEntity(ModelState);
        }

        /// <summary>
        /// 根据链接名称,修改指定标签
        /// </summary>
        /// <param name="linkName">链接名称</param>
        /// <param name="tagModel">标签新的内容</param>
        /// <returns></returns>
        [HttpPut("{linkName}")]
        [Authorize]
        public async Task<IActionResult> EditTagByLinkNameAsync([FromRoute]string linkName, [FromBody]TagModel tagModel)
        {
            var tag = await _tagService.GetByLinkNameAsync(linkName, tracking: true);

            if (tag == null)
            {
                return NotFound();
            }

            tag = _mapper.Map(tagModel, tag);
            await _tagService.EditAsync(tag);

            return NoContent();
        }

        /// <summary>
        /// 根据链接名称,删除指定标签
        /// </summary>
        /// <param name="linkName">链接名称</param>
        /// <returns></returns>
        [HttpDelete("{linkName}")]
        [Authorize]
        public async Task<IActionResult> DeleteTagByLinkNameAsync([FromRoute]string linkName)
        {
            var tag = await _tagService.GetByLinkNameAsync(linkName, tracking: true);

            if (tag == null)
            {
                return NotFound();
            }

            if (await _tagService.IsInUse(tag.Id))
            {
                return BadRequest(new ErrorResponse(ErrorResponseCode.IN_USE, $"标签 {tag.LinkName} 有博文使用,不能删除"));
            }

            await _tagService.DeleteAsync(tag);

            return NoContent();
        }
    }
}


text:
import re
from django import http
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from kanboard import models, forms

PHASE_RE = re.compile('^phase-([\d]+)$')
CARD_RE = re.compile('^card-([\d]+)$')

def _debug(board, message):
    print "DEBUG (%s): %s" % (board.slug, message)

def board(request, board_slug, template_name='kanboard/board.html'):
    board = get_object_or_404(models.Board, slug=board_slug)
    form_data = request.method == 'POST' and request.POST or None
    form = forms.AddCard(data=form_data, user=request.user, board=board)
    if form.is_valid():
        form.save()
        http.HttpResponseRedirect('.')
    print form
    return render_to_response(template_name,
                              dict(board=board, form=form),
                              context_instance=RequestContext(request))

def update(request, board_slug):
    updates = []
    try:
        board = get_object_or_404(models.Board, slug=board_slug)
        for phase_name, card_names in request.POST.lists():
            cards = []
            phase_match = PHASE_RE.match(phase_name)
            if not phase_match:
                raise Exception("Malformed phase_name: <%s>" % phase_name)
            phase = get_object_or_404(models.Phase, board=board,
                                      pk=int(phase_match.group(1)))
            for card_name in card_names:
                card_match = CARD_RE.match(card_name)
                if not card_match:
                    raise Exception("Malformed card_name: <%s>" % card_name)
                card = get_object_or_404(models.Card, phase__board=board,
                                         pk=int(card_match.group(1)))
                cards.append(card)
            updates.append((phase, cards))
            updates.sort(cmp=lambda x,y: cmp(x[0].order, y[0].order))

            for phase, cards in updates:
                for card in cards:
                    if card.phase != phase:
                        card.change_phase(phase)
            for phase, cards in updates:
                for i, card in enumerate(cards):
                    card.order = i
                    card.save()

    except Exception, e:
        print "Exception: %s, %r" % (e, e)
        raise

    return http.HttpResponse() # nothing exciting...


text:
<!DOCTYPE html>
<html lang="en">

<head>
    <!--Let browser know website is optimized for mobile-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta charset="UTF-8">
    <!-- <meta name="csrf-token" content="{{ csrf_token() }}"> -->
    <!--Import Google Icon Font-->
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <!--Import materialize.css-->
    <link rel="stylesheet" href="<?php echo base_url('assets/css/materialize.css'); ?>" type="text/css" media="screen,projection" />
    <link rel="stylesheet" href="<?php echo base_url('assets/css/prism.css');?>" type="text/css" media="screen,projection" />
    <link rel="stylesheet" href="<?php echo base_url('assets/css/materialdesignicons.css'); ?>" type="text/css" media="screen,projection" />

    <!-- Stylesheet  -->
    <link rel="stylesheet" href="<?php echo base_url('assets/css/style.css'); ?>" type="text/css">
    <link href="<?php echo base_url('assets/css/print/jquery.dataTables.min.css'); ?>" rel="stylesheet">
    <link href="<?php echo base_url('assets/css/print/buttons.dataTables.min.css'); ?>" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo base_url('assets/datetimepicker/jquery.datetimepicker.css'); ?>">

</head>
<style type="text/css" media="screen">
    .notification-content li > h5 {
        font-size: 16px;
        text-transform: capitalize;
        font-weight: 500;
        line-height: 20px;
    }
    .notification-content li {
        padding: 5px;
        font-size: 14px;
        min-height: 0px;
    }
    .notification-content li.divider {
        padding: 0px;
    }
    .dropdown-content li.divider {
        min-height: 0;
        height: 1px;
    }
    .notification-content{
        white-space:initial !important;
    }
</style>
<body>


text:
namespace MbUnit.Framework {
    using System;
    using System.IO;
    using System.Reflection;

    /// <summary>
    /// Tags a class whose assembly file and associated pdb file should be copied elsewhere
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public class CopyAttribute : Attribute {

        /// <summary>
        /// Initializes a new instance of the <see cref="CopyAttribute"/> class.
        /// </summary>
        /// <param name="type">The type whose assembly will be copied</param>
        public CopyAttribute(Type type) {
            string assemblyFile = new Uri(type.Assembly.CodeBase).LocalPath;
            string pdbFile = Path.Combine(Path.GetDirectoryName(assemblyFile), Path.GetFileNameWithoutExtension(assemblyFile) + ".pdb");
            if (File.Exists(pdbFile)) { _files = new string[] { assemblyFile, pdbFile }; } else { _files = new string[] { assemblyFile }; }
        }

        /// <summary>
        /// Gets the files to be copied.
        /// </summary>
        /// <value>An array of the files being copied</value>
        public string[] Files {
            get { return _files; }
        }
        private string[] _files;

        /// <summary>
        /// Gets or sets the place for the files to be copied to.
        /// </summary>
        /// <value>The new path for the files</value>
        public string Destination {
            set { _destination = value; }
            get { return _destination; }
        }
        private string _destination;
    }
}


text:
package org.mikala.testqwondo.tests;

import org.mikala.testqwondo.spring.repository.PlanRepository;
import org.mikala.testqwondo.spring.services.UserManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.data.web.config.SpringDataWebConfigurationMixin;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.springframework.test.context.web.WebAppConfiguration;
import org.testng.annotations.Test;

//@SpringBootApplication
@SpringApplicationConfiguration(ApplicationConfig.class)
@Test
public class JpaTests extends AbstractTestNGSpringContextTests{

	@Autowired
	PlanRepository pr;
	//@Autowired
	//UserManagerService um;
	@Test
	public void testHome() throws Exception {
		//pr.findAll();

	}
}


text:
<?php
/**
 *	app/classes/app.php
 *	a collection of "global" functions & variables
 */

/**
 *  A simple message/error dump
 */
function dumper($error) {

    echo '
';
    echo '
' .  print_r($error) . '

';
    echo '
';
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class TopCouponsModel extends CI_Model {

  public function __construct(){
    parent::__construct();
    $this->load->database();
    // $this->load->library("Datatable");
  }

  public function get_top_coupons(){
    $data = array();
    $sql = "SELECT coupon_id, coupon_name, coupon_thumbnail
            FROM coupons WHERE coupon_id IN (SELECT coupon_id FROM top_coupons ORDER BY rank)";
    $query = $this->db->query($sql);

    if($query->num_rows() > 0){
      $data = $query->result_array();
    }

    return $data;
  }

  public function get_coup($loc_id){
      $data = array();

      $this->db->select("coupon_id, coupon_name, coupon_thumbnail");
      $this->db->where("location_id", $loc_id);

      $query = $this->db->get("coupons");

      if($query->num_rows() > 0){
          $data = $query->result_array();
      }

      return $data;
  }

  public function get_ending_coupons(){
      $data = array();

      $this->db->select("coupon_id, coupon_name, coupon_thumbnail, coupon_expiry");
      $this->db->where("status", 1);
      $this->db->where("coupon_expiry <", date("Y-m-d H:i:s", strtotime("+1 week")));
      $this->db->where("coupon_expiry >", date("Y-m-d H:i:s") );
      $this->db->order_by("coupon_expiry", "desc");
      $query = $this->db->get("coupons");
      if($query->num_rows() > 0){
          $data = $query->result_array();
        //   echo "<pre>";
        //   print_r($data);
        //   exit;
      }

      return $data;
  }

}


text:
import React, { Component } from 'react';
import * as PropTypes from 'prop-types';
import { connect } from 'react-redux';
import * as R from 'ramda';
import Dialog from '@mui/material/Dialog';
import DialogTitle from '@mui/material/DialogTitle';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogActions from '@mui/material/DialogActions';
import Button from '@mui/material/Button';
import IconButton from '@mui/material/IconButton';
import { MoreVert } from '@mui/icons-material';
import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import { updateLog, deleteLog } from '../../../../actions/Log';
import LogForm from './LogForm';
import inject18n from '../../../../components/i18n';
import { Transition } from '../../../../utils/Environment';
import { storeHelper, tagsConverter } from '../../../../actions/Schema';
import { isExerciseReadOnly } from '../../../../utils/Exercise';

class LogPopover extends Component {
  constructor(props) {
    super(props);
    this.state = {
      openDelete: false,
      openEdit: false,
      openPopover: false,
    };
  }

  handlePopoverOpen(event) {
    event.stopPropagation();
    this.setState({ anchorEl: event.currentTarget });
  }

  handlePopoverClose() {
    this.setState({ anchorEl: null });
  }

  handleOpenEdit() {
    this.setState({ openEdit: true });
    this.handlePopoverClose();
  }

  handleCloseEdit() {
    this.setState({ openEdit: false });
  }

  onSubmitEdit(data) {
    const inputValues = R.pipe(
      R.assoc('log_tags', R.pluck('id', data.log_tags)),
    )(data);
    return this.props
      .updateLog(this.props.exerciseId, this.props.log.log_id, inputValues)
      .then(() => this.handleCloseEdit());
  }

  handleOpenDelete() {
    this.setState({ openDelete: true });
    this.handlePopoverClose();
  }

  handleCloseDelete() {
    this.setState({ openDelete: false });
  }

  submitDelete() {
    this.props.deleteLog(this.props.exerciseId, this.props.log.log_id);
    this.handleCloseDelete();
  }

  render() {
    const { t, log, exercise, tagsMap } = this.props;
    const logTags = tagsConverter(log.log_tags, tagsMap);
    const initialValues = R.pipe(
      R.assoc('log_tags', logTags),
      R.pick(['log_title', 'log_content', 'log_tags']),
    )(log);
    return (
      <div>
        <IconButton
          onClick={this.handlePopoverOpen.bind(this)}
          aria-haspopup="true"
          size="large"
          disabled={isExerciseReadOnly(exercise, true)}
        >
          <MoreVert />
        </IconButton>
        <Menu
          anchorEl={this.state.anchorEl}
          open={Boolean(this.state.anchorEl)}
          onClose={this.handlePopoverClose.bind(this)}
        >
          <MenuItem onClick={this.handleOpenEdit.bind(this)}>
            {t('Update')}
          </MenuItem>
          <MenuItem onClick={this.handleOpenDelete.bind(this)}>
            {t('Delete')}
          </MenuItem>
        </Menu>
        <Dialog
          open={this.state.openDelete}
          TransitionComponent={Transition}
          onClose={this.handleCloseDelete.bind(this)}
          PaperProps={{ elevation: 1 }}
        >
          <DialogContent>
            <DialogContentText>
              {t('Do you want to delete this log?')}
            </DialogContentText>
          </DialogContent>
          <DialogActions>
            <Button onClick={this.handleCloseDelete.bind(this)}>
              {t('Cancel')}
            </Button>
            <Button color="secondary" onClick={this.submitDelete.bind(this)}>
              {t('Delete')}
            </Button>
          </DialogActions>
        </Dialog>
        <Dialog
          TransitionComponent={Transition}
          open={this.state.openEdit}
          onClose={this.handleCloseEdit.bind(this)}
          fullWidth={true}
          maxWidth="md"
          PaperProps={{ elevation: 1 }}
        >
          <DialogTitle>{t('Update the log')}</DialogTitle>
          <DialogContent>
            <LogForm
              initialValues={initialValues}
              editing={true}
              onSubmit={this.onSubmitEdit.bind(this)}
              handleClose={this.handleCloseEdit.bind(this)}
            />
          </DialogContent>
        </Dialog>
      </div>
    );
  }
}

LogPopover.propTypes = {
  t: PropTypes.func,
  exerciseId: PropTypes.string,
  exercise: PropTypes.object,
  log: PropTypes.object,
  updateLog: PropTypes.func,
  deleteLog: PropTypes.func,
};

const select = (state, ownProps) => {
  const helper = storeHelper(state);
  const { exerciseId } = ownProps;
  return {
    exercise: helper.getExercise(exerciseId),
    tagsMap: helper.getTagsMap(),
  };
};

export default R.compose(
  connect(select, { updateLog, deleteLog }),
  inject18n,
)(LogPopover);


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Puccinia similus Long

### Remarks
null


text:
package com.allen_sauer.gwt.game.space.client.collision;

import com.allen_sauer.gwt.game.client.Game;
import com.allen_sauer.gwt.game.client.collision.CollisionDetector;
import com.allen_sauer.gwt.game.client.sprite.Sprite;
import com.allen_sauer.gwt.game.space.client.sprite.explosion.ExplosionSpritePool;
import com.allen_sauer.gwt.game.space.client.sprite.player.PlayerSpritePool;
import com.allen_sauer.gwt.game.space.client.sprite.player.SpacePlayer;
import com.allen_sauer.gwt.game.space.client.sprite.player.SpacePlayerSprite;
import com.allen_sauer.gwt.game.space.client.sprite.robot.RobotSpritePool;

public class PlayerRobotCollisionDetector extends CollisionDetector {
  private final ExplosionSpritePool explosionSpritePool;

  public PlayerRobotCollisionDetector(Game game, PlayerSpritePool playerSpritePool,
      RobotSpritePool robotSpritePool, ExplosionSpritePool explosionSpritePool) {
    super(game, playerSpritePool, robotSpritePool);
    this.explosionSpritePool = explosionSpritePool;
  }

  @Override
  protected void handleCollision(Sprite playerSprite, Sprite robotSprite) {
    robotSprite.markForRemoval();
    if (!explosionSpritePool.exhausted()) {
      Sprite explosionSprite = explosionSpritePool.create();
      explosionSprite.setPosition(robotSprite.getX(), robotSprite.getY());
    }

    SpacePlayer player = ((SpacePlayerSprite) playerSprite).getPlayer();
    player.die();
  }
}


text:
<?php

/*
 * This file is part of questocat/epic-emoji package.
 *
 * (c) questocat <zhengchaopu@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Tests;

class HelpersTest extends TestCase
{
    public function testEmojiUtf8Bytes()
    {
        $bytesOne = emoji_utf8_bytes(0x0023);
        $bytesTwo = emoji_utf8_bytes(0x00AE);
        $bytesThree = emoji_utf8_bytes(0x3299);
        $bytesFour = emoji_utf8_bytes(0x26F9).emoji_utf8_bytes(0xFE0F).emoji_utf8_bytes(0x200D).emoji_utf8_bytes(0x2642).emoji_utf8_bytes(0xFE0F);

        $this->assertSame('#', $bytesOne);
        $this->assertSame('®', $bytesTwo);
        $this->assertSame('㊙', $bytesThree);
        $this->assertSame('⛹♂', $bytesFour);
    }
}


text:
pyflare
=======

.. image:: https://secure.travis-ci.org/jlinn/pyflare.png?branch=master
        :target: http://travis-ci.org/jlinn/pyflare

About
-----

Pyflare is a Python adapter for `CloudFlare's Client API <http://www.cloudflare.com/docs/client-api.html>`_ and `CloudFlare's Hosting provider API <http://www.cloudflare.com/docs/host-api.html>`_.

Installation
------------

.. code-block:: bash

    $ pip install pyflare

Usage
-----

.. code-block:: python

    from pyflare import PyflareClient
    cf = PyflareClient('address@example.com', 'your_api_key')
    # Create a new A record
    response = cf.rec_new('example.com', 'A', 'sub', '1.2.3.4')

    from pyflare import PyflareHosting
    hf = PyflareHosting('your_host_api_key')
    # Authenticate a user
    response = hf.user_auth('one@example.com', 'user_password')


text:
import toDate from "../toDate/index.js";
import differenceInCalendarISOWeekYears from "../differenceInCalendarISOWeekYears/index.js";
import compareAsc from "../compareAsc/index.js";
import subISOWeekYears from "../subISOWeekYears/index.js";
import requiredArgs from "../_lib/requiredArgs/index.js";
/**
 * @name differenceInISOWeekYears
 * @category ISO Week-Numbering Year Helpers
 * @summary Get the number of full ISO week-numbering years between the given dates.
 *
 * @description
 * Get the number of full ISO week-numbering years between the given dates.
 *
 * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
 *
 * ### v2.0.0 breaking changes:
 *
 * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
 *
 * - The function was renamed from `differenceInISOYears` to `differenceInISOWeekYears`.
 *   "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
 *   This change makes the name consistent with
 *   locale-dependent week-numbering year helpers, e.g., `addWeekYears`.
 *
 * @param {Date|Number} dateLeft - the later date
 * @param {Date|Number} dateRight - the earlier date
 * @returns {Number} the number of full ISO week-numbering years
 * @throws {TypeError} 2 arguments required
 *
 * @example
 * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?
 * var result = differenceInISOWeekYears(
 *   new Date(2012, 0, 1),
 *   new Date(2010, 0, 1)
 * )
 * //=> 1
 */

export default function differenceInISOWeekYears(dirtyDateLeft, dirtyDateRight) {
  requiredArgs(2, arguments);
  var dateLeft = toDate(dirtyDateLeft);
  var dateRight = toDate(dirtyDateRight);
  var sign = compareAsc(dateLeft, dateRight);
  var difference = Math.abs(differenceInCalendarISOWeekYears(dateLeft, dateRight));
  dateLeft = subISOWeekYears(dateLeft, sign * difference); // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1
  // if last calendar ISO year is not full
  // If so, result must be decreased by 1 in absolute value

  var isLastISOWeekYearNotFull = Number(compareAsc(dateLeft, dateRight) === -sign);
  var result = sign * (difference - isLastISOWeekYearNotFull); // Prevent negative zero

  return result === 0 ? 0 : result;
}


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

    <integer name="post_grid_num_columns">4</integer>

</resources>


text:
package fr.flurby.server;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Server {

    protected Map<String, User> _lstUser;
    protected Map<String, ChatRoom> _lstChatRoom;
    protected ServerSocket _socketServer;
    protected Pinger _pinger;
    protected int port;
    private static Server _instance;
    private String _welcomeMsg;

    /**
     * Crée une instance du Server
     */
    protected Server() {
        _lstUser = new HashMap<String, User>();
        _lstChatRoom = new HashMap<String, ChatRoom>();
        _pinger = new Pinger();
    }

    /**
     * Récupère l'instance du Server
     *
     * @return Server
     */
    public static Server getInstance() {
        if (_instance == null) {
            _instance = new Server();
        }
        return _instance;
    }

    public int getPort() {
        return port;
    }

    public Map<String, User> getLstUser() {
        return _lstUser;
    }

    public Map<String, ChatRoom> getLstChatRoom() {
        return _lstChatRoom;
    }

    public void setPort(int port) {
        this.port = port;
    }

    /**
     * Démarre l'écoute du serveur
     */
    public void listen() {

        try {
            _socketServer = new ServerSocket(port);
            new Thread(_pinger).start();
        } catch (IOException e) {
            System.out.println("Crash du server au démarrage " + e.getMessage());
        }
        while (true) {
            try {
                new Thread(new ClientManager(_socketServer.accept())).start();
            } catch (IOException e) {
                System.out.println("Erreur lors de la connexion : " + e.getMessage());
            }
        }
    }

    public Pinger getPinger() {
        return _pinger;
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        Server s = Server.getInstance();
        s.setPort(9876);
        s.listen();

    }

    public String getWelcomeMessage() {
        if(_welcomeMsg == null) try {
            _welcomeMsg = Utils.fileGetContents("welcome.msg");
        } catch (FileNotFoundException ex) {
            _welcomeMsg = "";
        }
        return _welcomeMsg;
    }

    public String getHelp() {
        return    "Liste des commandes \n"
                + "/join #chatroom : Permet de rejoindre la chatroom nommé #chatroom\n"
                + "/part #chatroom : Permet de quitter la chatroom nommé #chatroom\n"
                + "/privmsg #chatroom message : Envoie le message \"message\" à tout les utilisateurs connectés à #chatroom\n"
                + "/privmsg user message : Envoie le message \"message\" à tout l'utilisateurs user\n"
                + "/list : Envoie la liste des utilisateurs connecté au chat\n"
                + "/list #chatroom : Envoie la liste des utilisateurs connecté à la chatroom #chatroom\n"
                + "/rooms : Envoie la liste des chatrooms existantes sur le serveur\n"
                + "/quit : Quitte le serveur\n"
                + "/help : Envoie l'aide (ce que vous êtes en train de lire :p )";
    }
}


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<title>Scuffle</title>
		<link rel="stylesheet" type="text/css" href="css/page.css" />


text:
/*
 * Camel ApiMethod Enumeration generated by camel-api-component-maven-plugin
 */
package org.apache.camel.component.twilio.internal;

import java.lang.reflect.Method;
import java.util.List;

import com.twilio.rest.api.v2010.account.usage.record.Yearly;

import org.apache.camel.support.component.ApiMethod;
import org.apache.camel.support.component.ApiMethodArg;
import org.apache.camel.support.component.ApiMethodImpl;

import static org.apache.camel.support.component.ApiMethodArg.arg;

/**
 * Camel {@link ApiMethod} Enumeration for com.twilio.rest.api.v2010.account.usage.record.Yearly
 */
public enum UsageRecordYearlyApiMethod implements ApiMethod {

    READER(
        com.twilio.rest.api.v2010.account.usage.record.YearlyReader.class,
        "reader"),

    READER_1(
        com.twilio.rest.api.v2010.account.usage.record.YearlyReader.class,
        "reader",
        arg("pathAccountSid", String.class));

    private final ApiMethod apiMethod;

    private UsageRecordYearlyApiMethod(Class<?> resultType, String name, ApiMethodArg... args) {
        this.apiMethod = new ApiMethodImpl(Yearly.class, resultType, name, args);
    }

    @Override
    public String getName() { return apiMethod.getName(); }

    @Override
    public Class<?> getResultType() { return apiMethod.getResultType(); }

    @Override
    public List<String> getArgNames() { return apiMethod.getArgNames(); }

    @Override
    public List<Class<?>> getArgTypes() { return apiMethod.getArgTypes(); }

    @Override
    public Method getMethod() { return apiMethod.getMethod(); }
}


text:
module VolunteersHelper
end


text:
package com.arturmkrtchyan.kafka;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zeroturnaround.exec.ProcessExecutor;

import java.io.IOException;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
 * KafkaManager to start and stop zookeeper and kafka instances.
 */
public class KafkaManager {

    public static final String KAFKA_PROCESS_NAME = "Kafka";
    public static final String ZOOKEEPER_PROCESS_NAME = "QuorumPeerMain";

    final Logger logger = LoggerFactory.getLogger(KafkaManager.class);

    /**
     * Starts a kafka instance.
     *
     * @param instance Kafka instance
     * @throws KafkaPluginException if fails to start an instance
     */
    public void startKafka(final KafkaInstance instance) {
        try {
            executeInBackground(instance.getStartupScript().toString(), instance.getConfig().toString());
            wait(7, TimeUnit.SECONDS);
            logger.debug(execute("jps", "-v"));
        } catch (Exception e) {
            throw new KafkaPluginException(String.format("Unable to start kafka instance based on %s",
                    instance.getPath().toString()), e);
        }
    }

    /**
     * Stops a kafka instance.
     *
     * @param instance Kafka instance
     * @throws KafkaPluginException if fails to stop an instance
     */
    public void stopKafka(final KafkaInstance instance) {
        try {
            executeInBackground(instance.getShutdownScript().toString());
            wait(5, TimeUnit.SECONDS);
            logger.debug(execute("jps", "-v"));
        } catch (Exception e) {
            throw new KafkaPluginException(String.format("Unable to stop kafka instance based on %s",
                    instance.getPath().toString()), e);
        }
    }

    /**
     * Starts a zookeeper instance.
     *
     * @param instance Kafka instance
     * @throws KafkaPluginException if fails to stop an instance
     */
    protected void startZookeeper(final KafkaInstance instance) {
        try {
            executeInBackground(instance.getZookeeperStartupScript().toString(),
                    instance.getZookeeperConfig().toString());
            wait(7, TimeUnit.SECONDS);
            logger.debug(execute("jps", "-v"));
        } catch (Exception e) {
            throw new KafkaPluginException(String.format("Unable to start zookeeper instance based on %s",
                    instance.getPath().toString()), e);
        }
    }

    /**
     * Stops a zookeeper instance.
     *
     * @param instance Kafka instance
     * @throws KafkaPluginException if fails to stop an instance
     */
    protected void stopZookeeper(final KafkaInstance instance) {
        try {
            executeInBackground(instance.getZookeeperShutdownScript().toString());
            wait(5, TimeUnit.SECONDS);
            logger.debug(execute("jps", "-v"));
        } catch (Exception e) {
            throw new KafkaPluginException(String.format("Unable to stop zookeeper instance based on %s",
                    instance.getPath().toString()), e);
        }
    }

    private void wait(final int seconds, TimeUnit unit) {
        try {
            unit.sleep(seconds);
        } catch (InterruptedException e) {
            logger.warn("Thread was interupted.", e);
        }
    }

    private void executeInBackground(final String... commands) throws IOException {
        new ProcessExecutor().command(Arrays.asList(commands)).start();
    }

    private String execute(final String... commands) throws InterruptedException, TimeoutException, IOException {
        return new ProcessExecutor().command(Arrays.asList(commands))
                    .readOutput(true).execute()
                    .outputUTF8();
    }
}