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

namespace DotNetContainer.Validation.Validators
{
    public static class ObjectValidator
    {
        public static Validator<T> IsNotNull<T, TException>(this Validator<T> validator, string message = null) where TException : Exception
        {
            validator.Validate<TException>(x => x != null, message);
            return validator;
        }

        public static Validator<T> IsNotNull<T>(this Validator<T> validator, string message = null)
        {
            validator.IsNotNull<T, ArgumentException>(message);
            return validator;
        }

        public static Validator<T> IsNull<T, TException>(this Validator<T> validator, string message = null) where TException : Exception
        {
            validator.Validate<TException>(x => x == null, message);
            return validator;
        }

        public static Validator<T> IsNull<T>(this Validator<T> validator, string message = null)
        {
            validator.IsNull<T, ArgumentException>(message);
            return validator;
        }

        public static Validator<T> IsNotDefault<T, TException>(this Validator<T> validator, string message = null) where TException : Exception
        {
            validator.Validate<TException>(x => !EqualityComparer<T>.Default.Equals(x, default(T)), message);
            return validator;
        }

        public static Validator<T> IsNotDefault<T>(this Validator<T> validator, string message = null)
        {
            validator.IsNotNull<T, ArgumentException>(message);
            return validator;
        }

        public static Validator<T> IsDefault<T, TException>(this Validator<T> validator, string message = null) where TException : Exception
        {
            validator.Validate<TException>(x => EqualityComparer<T>.Default.Equals(x, default(T)), message);
            return validator;
        }

        public static Validator<T> IsDefault<T>(this Validator<T> validator, string message = null)
        {
            validator.IsNull<T, ArgumentException>(message);
            return validator;
        }
    }
}


text:
int main(int argc, char **argv){
  occa::printAvailableDevices();

  return 0;
}

redpajama_set_name: RedPajamaGithub


text:
/*
    This file is part of the WebKit open source project.
    This file has been generated by generate-bindings.pl. DO NOT MODIFY!

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#include "config.h"

#if ENABLE(SVG) && ENABLE(FILTERS)

#include "JSSVGFEFuncAElement.h"

#include "SVGFEFuncAElement.h"
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

ASSERT_CLASS_FITS_IN_CELL(JSSVGFEFuncAElement);

/* Hash table */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif

static const HashTableValue JSSVGFEFuncAElementTableValues[2] =
{
    { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEFuncAElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
};

#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSSVGFEFuncAElementTable = { 2, 1, JSSVGFEFuncAElementTableValues, 0 };
/* Hash table for constructor */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif

static const HashTableValue JSSVGFEFuncAElementConstructorTableValues[1] =
{
    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
};

#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSSVGFEFuncAElementConstructorTable = { 1, 0, JSSVGFEFuncAElementConstructorTableValues, 0 };
class JSSVGFEFuncAElementConstructor : public DOMConstructorObject {
public:
    JSSVGFEFuncAElementConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);

    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
    virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
    static const JSC::ClassInfo s_info;
    static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
    {
        return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
    }
protected:
    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
};

const ClassInfo JSSVGFEFuncAElementConstructor::s_info = { "SVGFEFuncAElementConstructor", &DOMConstructorObject::s_info, &JSSVGFEFuncAElementConstructorTable, 0 };

JSSVGFEFuncAElementConstructor::JSSVGFEFuncAElementConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(structure, globalObject)
{
    ASSERT(inherits(&s_info));
    putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGFEFuncAElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
}

bool JSSVGFEFuncAElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSSVGFEFuncAElementConstructor, JSDOMWrapper>(exec, &JSSVGFEFuncAElementConstructorTable, this, propertyName, slot);
}

bool JSSVGFEFuncAElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
    return getStaticValueDescriptor<JSSVGFEFuncAElementConstructor, JSDOMWrapper>(exec, &JSSVGFEFuncAElementConstructorTable, this, propertyName, descriptor);
}

/* Hash table for prototype */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif

static const HashTableValue JSSVGFEFuncAElementPrototypeTableValues[1] =
{
    { 0, 0, 0, 0 THUNK_GENERATOR(0) }
};

#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSSVGFEFuncAElementPrototypeTable = { 1, 0, JSSVGFEFuncAElementPrototypeTableValues, 0 };
const ClassInfo JSSVGFEFuncAElementPrototype::s_info = { "SVGFEFuncAElementPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSSVGFEFuncAElementPrototypeTable, 0 };

JSObject* JSSVGFEFuncAElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
{
    return getDOMPrototype<JSSVGFEFuncAElement>(exec, globalObject);
}

const ClassInfo JSSVGFEFuncAElement::s_info = { "SVGFEFuncAElement", &JSSVGComponentTransferFunctionElement::s_info, &JSSVGFEFuncAElementTable, 0 };

JSSVGFEFuncAElement::JSSVGFEFuncAElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGFEFuncAElement> impl)
    : JSSVGComponentTransferFunctionElement(structure, globalObject, impl)
{
    ASSERT(inherits(&s_info));
}

JSObject* JSSVGFEFuncAElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
{
    return new (exec) JSSVGFEFuncAElementPrototype(exec->globalData(), globalObject, JSSVGFEFuncAElementPrototype::createStructure(exec->globalData(), JSSVGComponentTransferFunctionElementPrototype::self(exec, globalObject)));
}

bool JSSVGFEFuncAElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSSVGFEFuncAElement, Base>(exec, &JSSVGFEFuncAElementTable, this, propertyName, slot);
}

bool JSSVGFEFuncAElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
    return getStaticValueDescriptor<JSSVGFEFuncAElement, Base>(exec, &JSSVGFEFuncAElementTable, this, propertyName, descriptor);
}

JSValue jsSVGFEFuncAElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSSVGFEFuncAElement* domObject = static_cast<JSSVGFEFuncAElement*>(asObject(slotBase));
    return JSSVGFEFuncAElement::getConstructor(exec, domObject->globalObject());
}

JSValue JSSVGFEFuncAElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSSVGFEFuncAElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
}

}

#endif // ENABLE(SVG) && ENABLE(FILTERS)


text:
package org.ripple.power.i18n.message.handlers;

import java.text.MessageFormat;
import java.util.Locale;

import org.ripple.power.i18n.message.MessageHandler;

public class MessageFormatMessageHandler extends MessageHandler {

	public MessageFormatMessageHandler(Class<?> proxiedInterface) {
		super(proxiedInterface);
	}

	@Override
	protected String format(Locale locale, String format, Object[] args) {
		return MessageFormat.format(format, args);
	}

}


text:
from flask import render_template

from app import app

@app.route('/', methods=['GET'])
def index():
    return render_template("index.html")


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Named (Guice 2.0 API)
</TITLE>

<META NAME="date" CONTENT="2009-05-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT

com.google.inject.name

Annotation Type Named

@Retention(value=RUNTIME)
@Target(value={FIELD,PARAMETER,METHOD})
public @interface Named

Annotates named things.

Required Element Summary

 String
value

Element Detail

value

public abstract String value

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: REQUIRED | OPTIONAL

DETAIL: ELEMENT


text:
from __future__ import absolute_import
from __future__ import unicode_literals
import unittest
import mock

import google.auth
import google.datalab
from google.datalab.storage._api import Api

class TestCases(unittest.TestCase):

  def validate(self, mock_http_request, expected_url, expected_args=None, expected_data=None,
               expected_headers=None, expected_method=None):
    url = mock_http_request.call_args[0][0]
    kwargs = mock_http_request.call_args[1]
    self.assertEquals(expected_url, url)
    if expected_args is not None:
      self.assertEquals(expected_args, kwargs['args'])
    if expected_data is not None:
      self.assertEquals(expected_data, kwargs['data'])
    if expected_headers is not None:
      self.assertEquals(expected_headers, kwargs['headers'])
    if expected_method is not None:
      self.assertEquals(expected_method, kwargs['method'])

  @mock.patch('google.datalab.utils.Http.request')
  def test_buckets_insert(self, mock_http_request):
    api = TestCases._create_api()

    api.buckets_insert('foo')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/',
                  expected_args={'project': 'test'}, expected_data={'name': 'foo'})

    api.buckets_insert('foo', 'bar')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/',
                  expected_args={'project': 'bar'}, expected_data={'name': 'foo'})

  @mock.patch('google.datalab.utils.Http.request')
  def test_buckets_delete(self, mock_http_request):
    api = TestCases._create_api()
    api.buckets_delete('foo')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/foo',
                  expected_method='DELETE')

  @mock.patch('google.datalab.utils.Http.request')
  def test_buckets_get(self, mock_http_request):
    api = TestCases._create_api()
    api.buckets_get('foo')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/foo',
                  expected_args={'projection': 'noAcl'})
    api.buckets_get('foo', 'bar')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/foo',
                  expected_args={'projection': 'bar'})

  @mock.patch('google.datalab.utils.Http.request')
  def test_buckets_list(self, mock_http_request):
    api = TestCases._create_api()
    api.buckets_list()
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/',
                  expected_args={'project': 'test', 'projection': 'noAcl', 'maxResults': 100})

    api.buckets_list(projection='foo', max_results=99, page_token='xyz', project_id='bar')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/',
                  expected_args={'project': 'bar', 'maxResults': 99,
                                 'projection': 'foo', 'pageToken': 'xyz'})

  @mock.patch('google.datalab.utils.Http.request')
  def test_object_download(self, mock_http_request):
    api = TestCases._create_api()
    api.object_download('foo', 'bar')
    self.validate(mock_http_request, 'https://www.googleapis.com/download/storage/v1/b/foo/o/bar',
                  expected_args={'alt': 'media'})

  @mock.patch('google.datalab.utils.Http.request')
  def test_object_upload(self, mock_http_request):
    api = TestCases._create_api()
    api.object_upload('b', 'k', 'c', 't')
    self.validate(mock_http_request, 'https://www.googleapis.com/upload/storage/v1/b/b/o/',
                  expected_args={'uploadType': 'media', 'name': 'k'},
                  expected_data='c', expected_headers={'Content-Type': 't'})

  @mock.patch('google.datalab.utils.Http.request')
  def test_objects_copy(self, mock_http_request):
    api = TestCases._create_api()
    api.objects_copy('sb', 'sk', 'tb', 'tk')
    self.validate(mock_http_request,
                  'https://www.googleapis.com/storage/v1/b/sb/o/sk/copyTo/b/tb/o/tk',
                  expected_method='POST')

  @mock.patch('google.datalab.utils.Http.request')
  def test_objects_delete(self, mock_http_request):
    api = TestCases._create_api()
    api.objects_delete('b', 'k')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/b/o/k',
                  expected_method='DELETE')

  @mock.patch('google.datalab.utils.Http.request')
  def test_objects_get(self, mock_http_request):
    api = TestCases._create_api()
    api.objects_get('b', 'k')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/b/o/k',
                  expected_args={'projection': 'noAcl'})

    api.objects_get('b', 'k', 'p')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/b/o/k',
                  expected_args={'projection': 'p'})

  @mock.patch('google.datalab.utils.Http.request')
  def test_objects_list(self, mock_http_request):
    api = TestCases._create_api()
    api.objects_list('b')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/b/o/',
                  expected_args={'projection': 'noAcl', 'maxResults': 100})

    api.objects_list('b', 'p', 'd', 'pr', True, 99, 'foo')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/b/o/',
                  expected_args={'projection': 'pr', 'maxResults': 99,
                                 'prefix': 'p', 'delimiter': 'd', 'versions': 'true',
                                 'pageToken': 'foo'})

  @mock.patch('google.datalab.utils.Http.request')
  def test_objects_patch(self, mock_http_request):
    api = TestCases._create_api()
    api.objects_patch('b', 'k', 'i')
    self.validate(mock_http_request, 'https://www.googleapis.com/storage/v1/b/b/o/k',
                  expected_method='PATCH', expected_data='i')

  @staticmethod
  def _create_api():
    context = TestCases._create_context()
    return Api(context)

  @staticmethod
  def _create_context():
    project_id = 'test'
    creds = mock.Mock(spec=google.auth.credentials.Credentials)
    return google.datalab.Context(project_id, creds)


text:
package com.aviras.mrassistant.ui;

import android.app.DatePickerDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.widget.DatePicker;

import java.util.Calendar;

/**
 * Simple {@link DatePickerDialog} shown in {@link DialogFragment}
 * <p/>
 * Created by ashish on 19/6/16.
 */
public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {

    public static final String TAG = DatePickerFragment.class.getSimpleName();

    private DatePickerDialog.OnDateSetListener mDateSelectedListener;
    private long mDate;

    public DatePickerFragment() {

    }

    public DatePickerFragment(DatePickerDialog.OnDateSetListener dateSelectedListener, long date) {
        mDateSelectedListener = dateSelectedListener;
        mDate = date;
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        final Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(mDate);
        int year = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        return new DatePickerDialog(getActivity(), this, year, month, day);
    }

    public void onDateSet(DatePicker view, int year, int month, int day) {
        if (null != mDateSelectedListener) {
            mDateSelectedListener.onDateSet(view, year, month, day);
        }
    }
}


text:
package elasticthought

import (
	"errors"
	"fmt"

	"github.com/tleyden/go-couch"
)

// An ElasticThought user.
type User struct {
	ElasticThoughtDoc
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

// Create a new User
func NewUser() *User {
	return &User{
		ElasticThoughtDoc: ElasticThoughtDoc{Type: DOC_TYPE_USER},
	}
}

// Create a new User based on values in another user
func NewUserFromUser(other User) *User {
	user := NewUser()
	user.Username = other.Username
	user.Email = other.Email
	user.Password = other.Password
	return user
}

// Does this username/password combo exist in the database?  If so, return the
// user.  If not, return an error.
func AuthenticateUser(db couch.Database, username, password string) (*User, error) {

	userId := docIdFromUsername(username)

	authenticatedUser := NewUser()

	err := db.Retrieve(userId, authenticatedUser)

	if err != nil {
		// no valid user
		return nil, err
	}

	// we found a valid user, but do passwords match?
	if authenticatedUser.Password != password {
		err := errors.New("Passwords do not match")
		return nil, err
	}

	return authenticatedUser, err

}

// The doc id of this user.  If the username is "foo", the doc id will be "user:foo"
func (u User) DocId() string {
	return docIdFromUsername(u.Username)
}

func docIdFromUsername(username string) string {
	return fmt.Sprintf("user:%v", username)
}


text:
package com.azure.spring.data.cosmos.repository.repository;

import com.azure.spring.data.cosmos.domain.Address;
import com.azure.spring.data.cosmos.repository.CosmosRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

@Repository
public interface PageableAddressRepository extends CosmosRepository<Address, String> {
    Page<Address> findByStreet(String street, Pageable pageable);

    Page<Address> findByCity(String city, Pageable pageable);

}


text:
<?php
namespace TijsVerkoyen\DocDataPayments\Types;

use TijsVerkoyen\DocDataPayments\Base\Object;

/**
 * DocDataPayments PaymentRequest class
 *
 * @author Tijs Verkoyen <php-docdatapayments@verkoyen.eu>
 */
class PaymentRequest extends Object
{
    /**
     * @var \TijsVerkoyen\DocDataPayments\Types\PaymentReference
     */
    protected $initialPaymentReference;

    /**
     * @param \TijsVerkoyen\DocDataPayments\Types\PaymentReference $initialPaymentReference
     */
    public function setInitialPaymentReference($initialPaymentReference)
    {
        $this->initialPaymentReference = $initialPaymentReference;
    }

    /**
     * @return \TijsVerkoyen\DocDataPayments\Types\PaymentReference
     */
    public function getInitialPaymentReference()
    {
        return $this->initialPaymentReference;
    }
}


text:
package org.killbill.billing;

import java.util.UUID;

import org.joda.time.DateTimeZone;
import org.killbill.billing.callcontext.InternalCallContext;
import org.killbill.billing.callcontext.MutableCallContext;
import org.killbill.billing.callcontext.MutableInternalCallContext;
import org.killbill.billing.platform.api.KillbillConfigSource;
import org.killbill.billing.util.callcontext.CallContext;
import org.killbill.billing.util.callcontext.CallOrigin;
import org.killbill.billing.util.callcontext.InternalCallContextFactory;
import org.killbill.billing.util.callcontext.UserType;
import org.killbill.billing.util.glue.KillBillModule;
import org.killbill.clock.Clock;
import org.killbill.clock.ClockMock;

public class GuicyKillbillTestModule extends KillBillModule {

    private final MutableInternalCallContext internalCallContext;
    private final MutableCallContext callContext;
    private final ClockMock clock;

    public GuicyKillbillTestModule(final KillbillConfigSource configSource, final ClockMock clock) {
        super(configSource);
        this.clock = clock;

        internalCallContext = new MutableInternalCallContext(InternalCallContextFactory.INTERNAL_TENANT_RECORD_ID,
                                                             1687L,
                                                             DateTimeZone.UTC,
                                                             clock.getUTCNow(),
                                                             UUID.randomUUID(),
                                                             UUID.randomUUID().toString(),
                                                             CallOrigin.TEST,
                                                             UserType.TEST,
                                                             "Testing",
                                                             "This is a test",
                                                             clock.getUTCNow(),
                                                             clock.getUTCNow());
        callContext = new MutableCallContext(internalCallContext);
    }

    @Override
    protected void configure() {
        bind(ClockMock.class).toInstance(clock);
        bind(Clock.class).toInstance(clock);
        bind(InternalCallContext.class).toInstance(internalCallContext);
        bind(MutableInternalCallContext.class).toInstance(internalCallContext);
        bind(CallContext.class).toInstance(callContext);
        bind(MutableCallContext.class).toInstance(callContext);
    }
}


text:
using storage::ShareableFileReference;

namespace content {

TEST(ShareableFileReferenceTest, TestReferences) {
  base::MessageLoop message_loop;
  scoped_refptr<base::SingleThreadTaskRunner> task_runner =
      base::ThreadTaskRunnerHandle::Get();
  base::ScopedTempDir temp_dir;
  ASSERT_TRUE(temp_dir.CreateUniqueTempDir());

  // Create a file.
  base::FilePath file;
  base::CreateTemporaryFileInDir(temp_dir.path(), &file);
  EXPECT_TRUE(base::PathExists(file));

  // Create a first reference to that file.
  scoped_refptr<ShareableFileReference> reference1;
  reference1 = ShareableFileReference::Get(file);
  EXPECT_FALSE(reference1.get());
  reference1 = ShareableFileReference::GetOrCreate(
      file, ShareableFileReference::DELETE_ON_FINAL_RELEASE, task_runner.get());
  EXPECT_TRUE(reference1.get());
  EXPECT_TRUE(file == reference1->path());

  // Get a second reference to that file.
  scoped_refptr<ShareableFileReference> reference2;
  reference2 = ShareableFileReference::Get(file);
  EXPECT_EQ(reference1.get(), reference2.get());
  reference2 = ShareableFileReference::GetOrCreate(
      file, ShareableFileReference::DELETE_ON_FINAL_RELEASE, task_runner.get());
  EXPECT_EQ(reference1.get(), reference2.get());

  // Drop the first reference, the file and reference should still be there.
  reference1 = NULL;
  EXPECT_TRUE(ShareableFileReference::Get(file).get());
  base::RunLoop().RunUntilIdle();
  EXPECT_TRUE(base::PathExists(file));

  // Drop the second reference, the file and reference should get deleted.
  reference2 = NULL;
  EXPECT_FALSE(ShareableFileReference::Get(file).get());
  base::RunLoop().RunUntilIdle();
  EXPECT_FALSE(base::PathExists(file));

  // TODO(michaeln): add a test for files that aren't deletable behavior.
}

}  // namespace content


text:
namespace JKCore.Test.Fake.Classes
{
    public class AImplementationClass : AInterface
    {
    }
}


text:
package org.gradle.internal.reflect;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.List;
import java.util.Set;

public interface ClassDetails {
    /**
     * Returns the non-private properties of this class. Includes inherited properties
     */
    Set<String> getPropertyNames();

    /**
     * Returns the non-private properties of this class. Includes inherited properties
     */
    Collection<? extends PropertyDetails> getProperties();

    /**
     * Returns the details of a non-private property of this class.
     */
    PropertyDetails getProperty(String name) throws NoSuchPropertyException;

    /**
     * Returns all methods of this class, including all inherited, private and static methods.
     */
    List<Method> getAllMethods();

    /**
     * Returns the non-private instance methods of this class that are not property getter or setter methods.
     * Includes inherited methods.
     */
    Collection<Method> getInstanceMethods();

    /**
     * Returns all instance fields of this class. Includes inherited fields.
     */
    List<Field> getInstanceFields();
}


text:
package multiplicity3.input;

import multiplicity3.input.filters.IMultiTouchInputFilter;

public interface IMultiTouchEventProducer {
	public void registerMultiTouchEventListener(IMultiTouchEventListener listener);
	public void registerMultiTouchEventListener(IMultiTouchEventListener listener, int index);
	public void registerMultiTouchExceptionListener(IDispatchedMultiTouchEventExceptionListener listener);
	public void unregisterMultiTouchEventListener(IMultiTouchEventListener listener);
	public void addMultiTouchInputFilter(IMultiTouchInputFilter filter);
	public boolean isFilterActive(Class<? extends IMultiTouchInputFilter> filter);
	public IMultiTouchInputFilter getLastFilter();
}


text:
/**
 * @private
 */
Ext.define('Ext.event.publisher.Gesture', {
    extend: 'Ext.event.publisher.Dom',
    alternateClassName: 'Ext.event.publisher.TouchGesture',

    requires: [
        'Ext.util.Point',
        'Ext.AnimationQueue'
    ],

    config: {
        recognizers: {}
    },

    isCancelEvent: {
        touchcancel: 1,
        pointercancel: 1,
        MSPointerCancel: 1
    },

    constructor: function(config) {
        var me = this,
            onTouchStart = me.onTouchStart,
            // onTouchMove runs on requestAnimationFrame for performance reasons.
            // onTouchEnd must follow the same pattern, to avoid a scenario where touchend
            // could potentially be processed before the last touchmove
            onTouchMove = me.onTouchMove =
                // onTouchMove invocations are queued in such a way that the last invocation
                // wins if multiple invocations occur within a single animation frame
                // (this is the default behavior of createAnimationFrame)
                Ext.Function.createAnimationFrame(me.onTouchMove, me),
            onTouchEnd = me.onTouchEnd =
                // onTouchEnd invocations are queued in FIFO order.  This is different
                // from how onTouchMove behaves because when multiple "end" events occur
                // in quick succession, we need to handle them all so we can sync the
                // state of activeTouches and activeTouchesMap.
                Ext.Function.createAnimationFrame(me.onTouchEnd, me, null, 1);

        me.handlers = {
            touchstart: onTouchStart,
            touchmove: onTouchMove,
            touchend: onTouchEnd,
            touchcancel: onTouchEnd,
            pointerdown: onTouchStart,
            pointermove: onTouchMove,
            pointerup: onTouchEnd,
            pointercancel: onTouchEnd,
            MSPointerDown: onTouchStart,
            MSPointerMove: onTouchMove,
            MSPointerUp: onTouchEnd,
            MSPointerCancel: onTouchEnd,
            mousedown: onTouchStart,
            mousemove: onTouchMove,
            mouseup: onTouchEnd
        };

        // A map that tracks names of the handledEvents of all registered recognizers
        me.recognizedEvents = {};

        me.activeTouchesMap = {};
        me.activeTouches = [];
        me.changedTouches = [];

        if (Ext.supports.TouchEvents) {
            // bind handlers that are only invoked when the browser has touchevents
            me.onTargetTouchMove = me.onTargetTouchMove.bind(me);
            me.onTargetTouchEnd = me.onTargetTouchEnd.bind(me);
        }

        me.initConfig(config);

        return me.callParent();
    },

    applyRecognizers: function(recognizers) {
        var name, recognizer;

        for (name in recognizers) {
            recognizer = recognizers[name];

            if (recognizer) {
                this.registerRecognizer(recognizer);
            }
        }

        return recognizers;
    },

    handles: function(eventName) {
        var handledEvents = this.handledEventsMap;

        return !!handledEvents[eventName] || !!handledEvents['*'] || eventName === '*' ||
                this.recognizedEvents.hasOwnProperty(eventName);
    },

    registerRecognizer: function(recognizer) {
        var me = this,
            recognizedEvents = me.recognizedEvents,
            handledEvents = recognizer.getHandledEvents(),
            i, ln;

        // The recognizer will call our onRecognized method when it determines that a
        // gesture has occurred.
        recognizer.setOnRecognized(me.onRecognized);
        recognizer.setCallbackScope(me);

        // add the recognizer's handled events to our recognizedEvents map.  This enables
        // the handles method to tell the outside world that this publisher handles not
        // only its handledEvents, but also the handledEvents of all its recognizers
        for (i = 0, ln = handledEvents.length; i < ln; i++) {
            recognizedEvents[handledEvents[i]] = 1;
        }
    },

    onRecognized: function(eventName, e, info) {
        var me = this,
            changedTouches = e.changedTouches,
            ln = changedTouches.length,
            targetGroups, targets, i, touch;

        info = info || {};

        // At this point "e" still refers to the originally dispatched Ext.event.Event that
        // wraps a native browser event such as "touchend", or "mousemove".  We need to
        // dispatch with an an event object that has the correct "recognized" type such
        // as "tap", or "drag".  We don't want to change the type of the original event
        // object because it may be used asynchronously by event handlers, so we create a
        // new object that is chained to the original event.
        info.type = eventName;
        // Touch events have a handy feature - the original target of a touchstart is
        // always the target of successive touchmove/touchend events event if the touch
        // is dragged off of the original target.  Pointer events also have this behavior
        // via the setPointerCapture method, unless their target is removed from the dom
        // mid-gesture, however, we do not currently use setPointerCapture because it
        // can change the target of translated mouse events.  Mouse events do not have this
        // "capturing" feature at all - the target is always the element that was under
        // the mouse at the time the event occurred.  To be safe, and to ensure consistency,
        // we just always set the target of recognized events to be the original target
        // that was cached when the first "start" event was received.
        info.target = changedTouches[0].target;

        // reset isStopped just in case the event that we are wrapping had
        // stoppedPropagation called
        info.isStopped = false;

        e = e.chain(info);

        if (ln > 1) {
            targetGroups = [];
            for (i = 0; i < ln; i++) {
                touch = changedTouches[i];
                targetGroups.push(touch.targets);
            }

            targets = me.getCommonTargets(targetGroups);
        } else {
            targets = changedTouches[0].targets;
        }

        me.publish(eventName, targets, e);
    },

    getCommonTargets: function(targetGroups) {
        var firstTargetGroup = targetGroups[0],
            ln = targetGroups.length;

        if (ln === 1) {
            return firstTargetGroup;
        }

        var commonTargets = [],
            i = 1,
            target, targets, j;

        while (true) {
            target = firstTargetGroup[firstTargetGroup.length - i];

            if (!target) {
                return commonTargets;
            }

            for (j = 1; j < ln; j++) {
                targets = targetGroups[j];

                if (targets[targets.length - i] !== target) {
                    return commonTargets;
                }
            }

            commonTargets.unshift(target);
            i++;
        }

        return commonTargets;
    },

    invokeRecognizers: function(methodName, e) {
        var recognizers = this.getRecognizers(),
            name, recognizer;

        if (methodName === 'onStart') {
            for (name in recognizers) {
                recognizers[name].isActive = true;
            }
        }

        for (name in recognizers) {
            recognizer = recognizers[name];
            if (recognizer.isActive && recognizer[methodName].call(recognizer, e) === false) {
                recognizer.isActive = false;
            }
        }
    },

    updateTouches: function(e, isEnd) {
        var me = this,
            browserEvent = e.browserEvent,
            // the touchSource is the object from which we get data about the changed touch
            // point or points related to an event object, such as identifier, target, and
            // coordinates. For touch event the source is changedTouches, for mouse and
            // pointer events it is the event object itself.
            touchSources = browserEvent.changedTouches || [browserEvent],
            activeTouches = me.activeTouches,
            activeTouchesMap = me.activeTouchesMap,
            changedTouches = [],
            touchSource, identifier, touch, target, i, ln, x, y;

        for (i = 0, ln = touchSources.length; i < ln; i++) {
            touchSource = touchSources[i];

            if ('identifier' in touchSource) {
                // touch events have an identifier property on their touches objects.
                // It can be 0, hence the "in" check
                identifier = touchSource.identifier;
            } else if ('pointerId' in touchSource) {
                // Pointer events have a pointerId on the event object itself
                identifier = touchSource.pointerId;
            } else {
                // Mouse events don't have an identifier, so we always use 1 since there
                // can only be one mouse touch point active at a time
                identifier = 1;
            }

            touch = activeTouchesMap[identifier];

            if (isEnd) {
                delete activeTouchesMap[identifier];
                Ext.Array.remove(activeTouches, touch);
            } else  if (!touch) {
                target = Ext.event.Event.resolveTextNode(touchSource.target);
                touch = activeTouchesMap[identifier] = {
                    identifier: identifier,
                    target: target,
                    // There are 2 main advantages to caching the targets here, vs.
                    // waiting until onRecognized
                    // 1. for "move" events we don't have to construct the targets array
                    // for every event - a theoretical performance win
                    // 2. if the target is removed from the dom mid-gesture we still
                    // want any gestures listeners on elements that were above the
                    // target to complete.  This means the propagating targets must reflect
                    // the target element's initial hierarchy when the gesture began
                    targets: me.getPropagatingTargets(target)
                };
                activeTouches.push(touch);
            }

            x = touchSource.pageX;
            y = touchSource.pageY;

            touch.pageX = x;
            touch.pageY = y;
            // recognizers frequently use Point methods, so go ahead and create a Point.
            touch.point = new Ext.util.Point(x, y);
            changedTouches.push(touch);
        }

        // decorate the event object with the touch point info so that it can be used from
        // within gesture recognizers (clone touches, just in case event object is used
        // asynchronously since this.activeTouches is continuously modified)
        e.touches = Ext.Array.clone(activeTouches);
        // no need to clone changedTouches since we just created it from scratch
        e.changedTouches = changedTouches;
    },

    doDelegatedEvent: function(e) {
        var me = this;

        // call parent method to dispatch the browser event (e.g. touchstart, mousemove)
        // before proceeding to the gesture recognition step.
        e = me.callParent([e, false]);

        // superclass method will return false if the event being handled is a
        // "emulated" event.  This may include emulated mouse events on browsers that
        // support touch events, or "compatibility" mouse events on browsers that
        // support pointer events.  If this is the case, do not proceed with gesture
        // recognition.
        if (e) {
            if (!e.button || e.button < 1) {
                // mouse gestures (and pointer gestures triggered by a mouse) can only be
                // initiated using the left button (0).  button value < 0 is also acceptable
                // (e.g. pointermove has a button value of -1)
                me.handlers[e.type].call(me, e);
            }

            // wait until after handlers have been dispatched before calling afterEvent.
            // this ensures that timestamps captured in afterEvent represent the time
            // that event handling completed for this event.
            me.afterEvent(e);
        }
    },

    onTouchStart: function(e) {
        var me = this,
            target = e.target;

        if (e.browserEvent.type === 'touchstart') {
            // When using touch events, if the target is removed from the dom mid-gesture
            // the touchend event cannot be handled normally because it will not bubble
            // to the top of the dom since the target el is no longer attached to the dom.
            // Add some special handlers to clean everything up. (see onTargetTouchEnd)
            // use addEventListener directly so that we don't have to spin up an instance
            // of Ext.Element for every event target.
            target.addEventListener('touchmove', me.onTargetTouchMove);
            target.addEventListener('touchend', me.onTargetTouchEnd);
            target.addEventListener('touchcancel', me.onTargetTouchEnd);
        }

        me.updateTouches(e);

        if (!me.isStarted) {
            // this is the first active touch - invoke "onStart" which indicates the
            // beginning of a gesture
            me.isStarted = true;
            me.invokeRecognizers('onStart', e);

            // Disable garbage collection during gestures so that if the target element
            // of a gesture is removed from the dom, it does not get garbage collected
            // until the gesture is complete
            if (Ext.enableGarbageCollector) {
                Ext.dom.GarbageCollector.pause();
            }
        }
        me.invokeRecognizers('onTouchStart', e);
    },

    onTouchMove: function(e) {
        if (this.isStarted) {
            this.updateTouches(e);
            if (e.changedTouches.length > 0) {
                this.invokeRecognizers('onTouchMove', e);
            }
        }
    },

    // This method serves as the handler for both "end" and "cancel" events.  This is
    // because they are handled identically with the exception of the recognizer method
    // that is called.
    onTouchEnd: function(e) {
        var me = this;

        if (!me.isStarted) {
            return;
        }

        me.updateTouches(e, true);

        me.invokeRecognizers(me.isCancelEvent[e.type] ? 'onTouchCancel' : 'onTouchEnd', e);

        if (!me.activeTouches.length) {
            // no more active touches - invoke onEnd to indicate the end of the gesture
            me.isStarted = false;
            me.invokeRecognizers('onEnd', e);

            // Gesture is finished, safe to resume garbage collection so that any target
            // elements destroyed while gesture was in progress can be collected
            if (Ext.enableGarbageCollector) {
                Ext.dom.GarbageCollector.resume();
            }
        }
    },

    onTargetTouchMove: function(e) {
        if (Ext.elevateFunction) {
            // using [e] is faster than using arguments in most browsers
            // http://jsperf.com/passing-arguments
            Ext.elevateFunction(this.doTargetTouchMove, this, [e]);
        } else {
            this.doTargetTouchMove(e);
        }
    },

    doTargetTouchMove: function(e) {
        // handle touchmove if the target el was removed from dom mid-gesture.
        // see onTouchStart/onTargetTouchEnd for further explanation
        if (!Ext.getBody().contains(e.target)) {
            this.onTouchMove(new Ext.event.Event(e));
        }
    },

    onTargetTouchEnd: function(e) {
        if (Ext.elevateFunction) {
            // using [e] is faster than using arguments in most browsers
            // http://jsperf.com/passing-arguments
            Ext.elevateFunction(this.doTargetTouchEnd, this, [e]);
        } else {
            this.doTargetTouchEnd(e);
        }
    },

    doTargetTouchEnd: function(e) {
        var me = this,
            target = e.target;

        target.removeEventListener('touchmove', me.onTargetTouchMove);
        target.removeEventListener('touchend', me.onTargetTouchEnd);
        target.removeEventListener('touchcancel', me.onTargetTouchEnd);

        // if the target el was removed from the dom mid-gesture, then the touchend event,
        // when it occurs, will not be handled because it will not bubble to the top of
        // the dom. This is because the "target" of the touchend is the removed element.
        // If this is the case, go ahead and trigger touchend handling now.
        // Detect whether the target was removed from the DOM mid gesture by using Element.contains.
        // Originally we attempted to detect this by listening for the DOMNodeRemovedFromDocument
        // event, and setting a flag on the element when it was removed, however that
        // approach only works when the element is removed using removedChild, and fails
        // if the element is removed because some ancestor had innerHTML assigned.
        // note: this handling is applicable for actual touchend events, pointer and mouse
        // events will fire on whatever element is under the cursor/pointer after the
        // original target has been removed.
        if (!Ext.getBody().contains(target)) {
            me.onTouchEnd(new Ext.event.Event(e));
        }
    }

}, function() {
    var handledEvents = [],
        supports = Ext.supports,
        supportsTouchEvents = supports.TouchEvents;

    if (supports.PointerEvents) {
        handledEvents.push('pointerdown', 'pointermove', 'pointerup', 'pointercancel');
    } else if (supports.MSPointerEvents) {
        // IE10 uses vendor prefixed pointer events, IE11+ use unprefixed names.
        handledEvents.push('MSPointerDown', 'MSPointerMove', 'MSPointerUp', 'MSPointerCancel');
    } else if (supportsTouchEvents) {
        handledEvents.push('touchstart', 'touchmove', 'touchend', 'touchcancel');
    }

    if (!handledEvents.length || (supportsTouchEvents && Ext.isWebKit && Ext.os.is.Desktop)) {
        // If the browser doesn't have pointer events or touch events we use mouse events
        // to trigger gestures.  The exception to this rule is touch enabled webkit
        // browsers such as chrome on Windows 8.  These browsers accept both touch and
        // mouse input, so we need to listen for both touch events and mouse events.
        handledEvents.push('mousedown', 'mousemove', 'mouseup');
    }

    this.prototype.handledEvents = handledEvents;
});


text:
<title>
Workers hit the picket line at Harley-Davidson
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

Company wants givebacks despite huge profits

Workers hit the picket line at Harley-Davidson

By Lee Sustar | February 9, 2007 | Page 11

WORKERS AT Harley-Davidson's plant near York, Pa., defied the company's divide-and-conquer tactics with a strike that began February 2.

The 2,700 workers, members of International Association of Machinists (IAM) Local Lodge 175, voted by 98 percent to authorize a strike over Harley's demand to increase health care costs for current employees and force new hires into a lower-tier pay schedule.

The company has already extracted similar concessions from workers, members of the United Steelworkers, in its Milwaukee engine plant in a contract ratified in November. That deal not only imposed a two-tier pay system and raised health care costs but also cut retiree benefits and cost-of-living adjustments. In return, management promised to invest $120 million in the Milwaukee plant and add 100 jobs there rather than outsource the work.

Now management wants IAM members in the Pennsylvania plant--where 65 percent of Harley motorcycles are assembled--to swallow similar givebacks.

Although the proposed three-year contract contains a 4 percent pay increase in each year, half that raise is contingent on workers' acceptance of the health care plan used by salaried employees--a change that could cost unionized workers thousands of dollars each year. And the two-tier pay system would keep younger workers from ever reaching top pay levels.

Yet Harley certainly has the money to fund both decent raises and maintain health benefits. Worldwide, sales of Harley bikes shot up 9 percent last year. In the fourth quarter of 2006, the company made $252.4 million in profits on $1.5 billion in revenue--an 11.9 percent increase from the same period a year earlier.

Harley's stock price has soared 129 percent over the past five years, giving the company a market value of $18 billion--a large amount for a relatively small company.

As the Wall Street Journal reported, Harley executives seized the opportunity to cash in, selling 1.5 million shares worth $101.3 million, and then using the cash to exercise stock options that enabled them to buy back nearly as many shares for just $55.4 million. "That means the insiders made net profit of $45.9 million, or a gain of 83 percent," the Journal noted.

All this has left workers bitter--particularly since the unions took big concessions in the 1980s when the company was on the brink of bankruptcy. Protectionist legislation also gave Harley advantages over foreign competitors.

But workers have never fully shared in Harley's subsequent prosperity--and now the company wants workers to sacrifice again despite the company's success. "What is being proposed is significant health care cost shifting by a profitable company," Frank Larkin, a spokesperson for the IAM International, told Socialist Worker.

Joe Klyeman, a tool-and-die gauge maker who's worked at Harley for 28 years, is angry about the demands for cuts. "We took concessions here in the '80s, and now they're making billions of dollars, and they want us to pay for our insurance?" he told the York Daily Record. "We made them rich, and now they want us to [make concessions]?"

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
from __future__ import unicode_literals

#import datetime

#from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib import admin
from django.http import HttpResponse
#from django.core.mail import send_mail
#from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
#from django.utils.timezone import now

#from . import settings as app_settings
#from . import tasks
from . import utils
from .exporters import BadgeExporter
from .models import (Purchase, SupportTicket, VenueTicket, TicketType, Voucher, VoucherType,
    TShirtSize, SIMCardTicket, DietaryPreference)

def export_tickets(modeladmin, request, queryset):
    return HttpResponse(utils.create_tickets_export(queryset).csv, mimetype='text/csv')
export_tickets.short_description = _("Export as CSV")

def export_badges(modeladmin, request, queryset):
    base_url = 'https://' if request.is_secure() else 'http://'
    exporter = BadgeExporter(queryset, base_url=base_url + request.get_host())
    return HttpResponse(exporter.json, mimetype='application/json')

class TicketTypeAdmin(admin.ModelAdmin):
    list_display = ('product_number', '__unicode__', 'conference',
                    'fee', 'is_active', 'tutorial_ticket', 'purchases_count',
                    'max_purchases', 'date_valid_from', 'date_valid_to')
    list_display_links = ('product_number', '__unicode__')
    list_filter = ('is_active', 'conference')

    class Media(object):
        js = ('assets/js/admin.attendees.js',)

admin.site.register(TicketType, TicketTypeAdmin)

class ShirtSizeAdmin(admin.ModelAdmin):
    list_display = ('size', 'sort')

admin.site.register(TShirtSize, ShirtSizeAdmin)

class VoucherTypeAdmin(admin.ModelAdmin):
    list_display = ('name', 'conference')
    list_filter = ('conference',)

admin.site.register(VoucherType, VoucherTypeAdmin)

class VoucherAdmin(admin.ModelAdmin):
    list_display = ('pk', 'code', 'is_used', 'type', 'remarks', 'date_valid')
    list_filter = ('is_used', 'type')
    search_fields = ('code', 'remarks')

admin.site.register(Voucher, VoucherAdmin)

class TicketInline(admin.TabularInline):
    extra = 0

class SupportTicketInline(TicketInline):
    model = SupportTicket

class VenueTicketInline(TicketInline):
    model = VenueTicket

class SIMCardTicketInline(TicketInline):
    model = SIMCardTicket

class PurchaseAdmin(admin.ModelAdmin):
    list_display = (
        'full_invoice_number', 'pk', 'payment_total', 'first_name', 'last_name',
        'company_name', 'street', 'city', 'date_added', 'payment_method',
        'state', 'exported', 'download_invoice'
    )
    list_editable = ('state',)
    list_filter = ('state', 'date_added', 'payment_method', 'exported',)
    search_fields = ('invoice_number', 'first_name', 'last_name', 'email')
    inlines = (SupportTicketInline, VenueTicketInline, SIMCardTicketInline,)
    #actions = ('send_payment_confirmation', 'export_and_send_invoices',
    #           'send_invoice_to_myself', 'send_invoice_to_customer',
    #           'send_payment_reminder', 'send_purchase_canceled',)

    def download_invoice(self, obj):
        """Return URL to download the invoice of the purchase."""
        return format_html(
            'Download Invoice',
            reverse('attendees_download_invoice', kwargs={'pk': obj.pk})
        )

    #def export_and_send_invoices(self, request, queryset):
    #    for purchase in queryset:
    #        if not purchase.exported:
    #            tasks.render_invoice.delay(purchase.pk)
    #        else:
    #            self.message_user(request,
    #                _('Purchase %(invoice_number)s has already been exported. '
    #                  'Use "Send me a copy of the invoice" or "Send customer '
    #                  'a copy of the invoice" to mail the invoice.') % {
    #                    'invoice_number': purchase.full_invoice_number,
    #                })
    #export_and_send_invoices.short_description = _('Export invoice and send')

    #def send_invoice_to_myself(self, request, queryset):
    #    recipients = (request.user.email,)  # Needs a tuple
    #    for purchase in queryset:
    #        if purchase.exported:
    #            tasks.send_invoice.delay(purchase.pk, recipients)
    #        else:
    #            self.message_user(request,
    #                _('Purchase %(invoice_number)s has not been exported yet. '
    #                  'Use "Export invoice and send" to export the invoice '
    #                  'and send it to the customer.') % {
    #                    'invoice_number': purchase.full_invoice_number,
    #                })
    #send_invoice_to_myself.short_description = _('Send me a copy of the invoice')

    #def send_invoice_to_customer(self, request, queryset):
    #    for purchase in queryset:
    #        if purchase.exported:
    #            tasks.send_invoice.delay(purchase.pk, (purchase.email_receiver,))
    #        else:
    #            self.message_user(request,
    #                _('Purchase %(invoice_number)s has not been exported yet. '
    #                  'Use "Export invoice and send" to export the invoice '
    #                  'and send it to the customer.') % {
    #                    'invoice_number': purchase.full_invoice_number,
    #                })
    #send_invoice_to_customer.short_description = _('Send customer a copy of the invoice')

    #def send_payment_confirmation(self, request, queryset):
    #    sent = 0
    #    for purchase in queryset.filter(
    #            state__in=('invoice_created', 'payment_received')):
    #        send_mail(ugettext('Payment receipt confirmation'),
    #            render_to_string('attendees/mail_payment_received.txt', {
    #                'purchase': purchase,
    #                'conference': purchase.conference
    #            }),
    #            settings.DEFAULT_FROM_EMAIL,
    #            [purchase.email_receiver, settings.DEFAULT_FROM_EMAIL],
    #            fail_silently=True
    #        )
    #        if purchase.state == 'invoice_created':
    #            purchase.state = 'payment_received'
    #            purchase.save()
    #        sent += 1
    #    if sent == 1:
    #        message_bit = _('1 mail was')
    #    else:
    #        message_bit = _('%s mails were') % sent
    #    self.message_user(request, ugettext('%s successfully sent.') % message_bit)
    #send_payment_confirmation.short_description = _(
    #    'Send payment confirmation for selected %(verbose_name_plural)s')

    #def send_payment_reminder(self, request, queryset):
    #    due_date = now() + datetime.timedelta(days=app_settings.REMINDER_DUE_DATE_OFFSET)
    #    # Remove everything not date related
    #    due_date = datetime.datetime(due_date.year, due_date.month, due_date.day)
    #    # Check that due date is not behind latest due date
    #    if app_settings.REMINDER_LATEST_DUE_DATE:
    #        latest_due_date = datetime.datetime.strptime(app_settings.REMINDER_LATEST_DUE_DATE, '%Y-%m-%d')
    #        if due_date > latest_due_date:
    #            due_date = latest_due_date
    #    for purchase in queryset.filter(state='invoice_created'):
    #        send_mail(ugettext('%(conference)s payment reminder' % {
    #                'conference': purchase.conference.title,
    #            }),
    #            render_to_string('attendees/mail_payment_pending.txt', {
    #                'purchase': purchase,
    #                'conference': purchase.conference,
    #                'due_date': due_date
    #            }),
    #            settings.DEFAULT_FROM_EMAIL,
    #            (purchase.email_receiver, request.user.email,),
    #            fail_silently=True
    #        )
    #        if purchase.exported:
    #            tasks.send_invoice.delay(purchase.pk, (purchase.email_receiver,))
    #        else:
    #            self.message_user(request,
    #                _('Purchase %(invoice_number)s has not been exported yet. '
    #                  'Use "Export invoice and send" to export the invoice '
    #                  'and send it to the customer.') % {
    #                    'invoice_number': purchase.full_invoice_number,
    #                })
    #send_payment_reminder.short_description = _(
    #    'Send payment reminders for selected %(verbose_name_plural)s')

    #def send_purchase_canceled(self, request, queryset):
    #    qs = queryset.filter(state__in=('invoice_created', 'payment_received')) \
    #                 .select_related('user')
    #    for purchase in qs.all():
    #        recipients = (purchase.email_receiver, request.user.email,)  # Needs a tuple
    #        tasks.cancel_purchase(purchase.id, recipients)
    #send_purchase_canceled.short_description = _(
    #    'Cancel purchase and send cancelation notice for selected %(verbose_name_plural)s')

admin.site.register(Purchase, PurchaseAdmin)

class SupportTicketAdmin(admin.ModelAdmin):
    list_display = ('purchase', 'ticket_type', 'date_added', 'canceled')
    list_filter = ('ticket_type', 'date_added', 'purchase__state', 'canceled')
    search_fields = ('purchase__email', )
    actions = [export_tickets]

admin.site.register(SupportTicket, SupportTicketAdmin)

class VenueTicketAdmin(admin.ModelAdmin):
    list_display = ('purchase', 'first_name', 'last_name', 'ticket_type',
                    'user', 'shirtsize', 'date_added', 'canceled')
    list_filter = ('ticket_type', 'date_added', 'purchase__state',
                   'dietary_preferences', 'canceled')
    search_fields = ('first_name', 'last_name', 'purchase__email',
                     'user__email')
    actions = [export_tickets, export_badges]
    raw_id_fields = ('user', 'purchase', 'voucher')

    def queryset(self, request):
        qs = super(VenueTicketAdmin, self).queryset(request)
        qs = qs.select_related('ticket_type', 'purchase', 'shirtsize')
        return qs

admin.site.register(VenueTicket, VenueTicketAdmin)

class SIMCardTicketAdmin(admin.ModelAdmin):
    list_display = ('purchase', 'first_name', 'last_name', 'ticket_type',
                    'sim_id', 'date_added', 'canceled')
    list_filter = ('ticket_type', 'date_added', 'purchase__state', 'canceled')
    search_fields = ('first_name', 'last_name', 'purchase__email')
    actions = [export_tickets]

admin.site.register(SIMCardTicket, SIMCardTicketAdmin)

class DietaryPreferenceAdmin(admin.ModelAdmin):
    pass

admin.site.register(DietaryPreference, DietaryPreferenceAdmin)


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

    <ImageButton
        android:id="@+id/ImageButtonBack"
        android:layout_width="@dimen/ActionBar"
        android:layout_height="@dimen/ActionBar"
        android:background="@null"
        android:clickable="true"
        android:focusable="true"
        android:padding="12dp"
        android:scaleType="centerCrop"
        android:layout_alignParentStart="true"
        android:src="@drawable/z_general_back_blue"/>

    <TextView
        android:id="@+id/TextViewName"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/ActionBar"
        android:text="@string/GroupInfo"
        android:gravity="start|center_vertical"
        android:layout_toEndOf="@id/ImageButtonBack"
        android:layout_toStartOf="@id/ImageButtonCreate"
        android:textColor="@color/TextWhite"
        android:textAlignment="viewStart"
        android:textSize="18sp"/>

    <ImageButton
        android:id="@+id/ImageButtonCreate"
        android:layout_width="@dimen/ActionBar"
        android:layout_height="@dimen/ActionBar"
        android:background="@null"
        android:clickable="true"
        android:focusable="true"
        android:padding="6dp"
        android:scaleType="centerCrop"
        android:layout_alignParentEnd="true"
        android:src="@drawable/__general_done_blue"/>

    <View
        android:id="@+id/view"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_below="@id/TextViewName"
        android:background="#e1e1e1"/>

    <LinearLayout
        android:id="@+id/mainContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/view"
        android:layout_marginEnd="16dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:orientation="vertical">

        <TextView
            android:id="@+id/TextViewDescription"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/ChatUIGroupHelp"
            android:textColor="#424242"
            android:textAlignment="viewStart"
            android:textSize="14sp"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="24dp"
            android:layout_marginTop="20dp"
            android:gravity="center_vertical"
            android:padding="4dp">

            <de.hdodenhof.circleimageview.CircleImageView
                android:id="@+id/ImageViewProfile"
                android:layout_width="76dp"
                android:layout_height="76dp"
                android:src="@drawable/camera_bluegray2"
                app:civ_border_color="#e2e2e2"
                app:civ_border_width="3dp"/>

            <EditText
                android:id="@+id/EditTextName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginEnd="24dp"
                android:layout_marginStart="24dp"
                android:hint="@string/ChatUIGroupName"
                android:maxLength="32"
                android:maxLines="1"
                android:maxWidth="180dp"
                android:padding="10dp"
                android:textColor="?TextColor"
                android:textDirection="rtl"
                android:textSize="@dimen/FontMedium"/>

        </LinearLayout>

        <TextView
            android:id="@+id/TextViewGroup"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:text="@string/ChatUIGroupMembers"
            android:textAlignment="viewStart"
            android:textColor="#939393"
            android:textSize="14sp"
            android:textStyle="bold"/>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/MembersList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:reverseLayout="true"
        />

    </LinearLayout>

</RelativeLayout>


text:
<?php

namespace WindowsAzure\ServiceRuntime\Internal;

/**
 * The role instance endpoint data.
 *
 * @category  Microsoft
 * @package   WindowsAzure\ServiceRuntime\Internal
 * @author    Azure PHP SDK <azurephpsdk@microsoft.com>
 * @copyright 2012 Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 * @version   Release: @package_version@
 * @link      https://github.com/windowsazure/azure-sdk-for-php
 */
class RoleInstanceEndpoint
{
    /**
     * @var RoleInstance
     */
    private $_roleInstance;

    /**
     * @var string
     */
    private $_protocol;

    /**
     * @var string
     */
    private $_address;

    /**
     * @var string
     */
    private $_port;

    /**
     * Constructor
     *
     * @param string $protocol The protocol.
     * @param string $address  The Address.
     * @param string $port     The Port.
     */
    public function __construct($protocol, $address, $port)
    {
        $this->_protocol = $protocol;
        $this->_address  = $address;
        $this->_port     = $port;
    }

    /**
     * Sets the role instance.
     *
     * @param RoleInstance $roleInstance The role instance.
     *
     * @return none
     */
    public function setRoleInstance($roleInstance)
    {
        $this->_roleInstance = $roleInstance;
    }

    /**
     * Returns the RoleInstance object associated with this endpoint.
     *
     * @return RoleInstance
     */
    public function getRoleInstance()
    {
        return $this->_roleInstance;
    }

    /**
     * Returns the protocol associated with the endpoint.
     *
     * @return string
     */
    public function getProtocol()
    {
        return $this->_protocol;
    }

    /**
     * Return the address.
     *
     * @return string
     */
    public function getAddress()
    {
        return $this->_address;
    }

    /**
     * Return the port.
     *
     * @return string
     */
    public function getPort()
    {
        return $this->_port;
    }
}


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

<!DOCTYPE dependencies SYSTEM "http://depfind.sourceforge.net/dtd/dependencies.dtd">

<dependencies>
    <package confirmed="yes">
        <name>p2</name>
        <class confirmed="yes">
            <name>p2.C4</name>
            <outbound type="class" confirmed="yes">p1.C1</outbound>
            <feature confirmed="yes">
                <name>p2.C4.f6</name>
                <outbound type="class" confirmed="yes">p1.C1</outbound>
                <outbound type="feature" confirmed="yes">p1.C1.f1</outbound>
            </feature>
        </class>
    </package>
    <package confirmed="yes">
        <name>p1</name>
        <class confirmed="yes">
            <name>p1.C2</name>
            <outbound type="class" confirmed="yes">p1.C1</outbound>
            <feature confirmed="yes">
                <name>p1.C2.f4</name>
                <outbound type="class" confirmed="yes">p1.C1</outbound>
                <outbound type="feature" confirmed="yes">p1.C1.f1</outbound>
            </feature>
        </class>
        <class confirmed="yes">
            <name>p1.C1</name>
            <inbound type="class" confirmed="yes">p1.C2</inbound>
            <inbound type="feature" confirmed="yes">p1.C2.f4</inbound>
            <inbound type="class" confirmed="yes">p2.C4</inbound>
            <inbound type="feature" confirmed="yes">p2.C4.f6</inbound>
            <outbound type="class" confirmed="no">p1.C3</outbound>
            <outbound type="class" confirmed="no">p3.C5</outbound>
            <feature confirmed="yes">
                <name>p1.C1.f2</name>
                <outbound type="feature" confirmed="yes">p1.C1.f1</outbound>
            </feature>
            <feature confirmed="yes">
                <name>p1.C1.f1</name>
                <inbound type="feature" confirmed="yes">p1.C1.f2</inbound>
                <inbound type="feature" confirmed="yes">p1.C2.f4</inbound>
                <inbound type="feature" confirmed="yes">p2.C4.f6</inbound>
                <outbound type="feature" confirmed="yes">p1.C1.f3</outbound>
                <outbound type="class" confirmed="no">p1.C3</outbound>
                <outbound type="feature" confirmed="no">p1.C3.f5</outbound>
                <outbound type="class" confirmed="no">p3.C5</outbound>
                <outbound type="feature" confirmed="no">p3.C5.f7</outbound>
            </feature>
            <feature confirmed="yes">
                <name>p1.C1.f3</name>
                <inbound type="feature" confirmed="yes">p1.C1.f1</inbound>
            </feature>
        </class>
        <class confirmed="no">
            <name>p1.C3</name>
            <inbound type="class" confirmed="yes">p1.C1</inbound>
            <inbound type="feature" confirmed="yes">p1.C1.f1</inbound>
            <feature confirmed="no">
                <name>p1.C3.f5</name>
                <inbound type="feature" confirmed="yes">p1.C1.f1</inbound>
            </feature>
        </class>
    </package>
    <package confirmed="no">
        <name>p3</name>
        <class confirmed="no">
            <name>p3.C5</name>
            <inbound type="class" confirmed="yes">p1.C1</inbound>
            <inbound type="feature" confirmed="yes">p1.C1.f1</inbound>
            <feature confirmed="no">
                <name>p3.C5.f7</name>
                <inbound type="feature" confirmed="yes">p1.C1.f1</inbound>
            </feature>
        </class>
    </package>
</dependencies>


text:
package watcher

import (
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"regexp"
	"strings"
	"sync"
	"time"
)

var (
	// ErrDurationTooShort occurs when calling the watcher's Start
	// method with a duration that's less than 1 nanosecond.
	ErrDurationTooShort = errors.New("error: duration is less than 1ns")

	// ErrWatcherRunning occurs when trying to call the watcher's
	// Start method and the polling cycle is still already running
	// from previously calling Start and not yet calling Close.
	ErrWatcherRunning = errors.New("error: watcher is already running")

	// ErrWatchedFileDeleted is an error that occurs when a file or folder that was
	// being watched has been deleted.
	ErrWatchedFileDeleted = errors.New("error: watched file or folder deleted")

	// ErrSkip is less of an error, but more of a way for path hooks to skip a file or
	// directory.
	ErrSkip = errors.New("error: skipping file")
)

// An Op is a type that is used to describe what type
// of event has occurred during the watching process.
type Op uint32

// Ops
const (
	Create Op = iota
	Write
	Remove
	Rename
	Chmod
	Move
)

var ops = map[Op]string{
	Create: "CREATE",
	Write:  "WRITE",
	Remove: "REMOVE",
	Rename: "RENAME",
	Chmod:  "CHMOD",
	Move:   "MOVE",
}

// String prints the string version of the Op consts
func (e Op) String() string {
	if op, found := ops[e]; found {
		return op
	}
	return "???"
}

// An Event describes an event that is received when files or directory
// changes occur. It includes the os.FileInfo of the changed file or
// directory and the type of event that's occurred and the full path of the file.
type Event struct {
	Op
	Path    string
	OldPath string
	os.FileInfo
}

// String returns a string depending on what type of event occurred and the
// file name associated with the event.
func (e Event) String() string {
	if e.FileInfo == nil {
		return "???"
	}

	pathType := "FILE"
	if e.IsDir() {
		pathType = "DIRECTORY"
	}
	return fmt.Sprintf("%s %q %s [%s]", pathType, e.Name(), e.Op, e.Path)
}

// FilterFileHookFunc is a function that is called to filter files during listings.
// If a file is ok to be listed, nil is returned otherwise ErrSkip is returned.
type FilterFileHookFunc func(info os.FileInfo, fullPath string) error

// RegexFilterHook is a function that accepts or rejects a file
// for listing based on whether it's filename or full path matches
// a regular expression.
func RegexFilterHook(r *regexp.Regexp, useFullPath bool) FilterFileHookFunc {
	return func(info os.FileInfo, fullPath string) error {
		str := info.Name()

		if useFullPath {
			str = fullPath
		}

		// Match
		if r.MatchString(str) {
			return nil
		}

		// No match.
		return ErrSkip
	}
}

// Watcher describes a process that watches files for changes.
type Watcher struct {
	Event  chan Event
	Error  chan error
	Closed chan struct{}
	close  chan struct{}
	wg     *sync.WaitGroup

	// mu protects the following.
	mu           *sync.Mutex
	ffh          []FilterFileHookFunc
	running      bool
	names        map[string]bool        // bool for recursive or not.
	files        map[string]os.FileInfo // map of files.
	ignored      map[string]struct{}    // ignored files or directories.
	ops          map[Op]struct{}        // Op filtering.
	ignoreHidden bool                   // ignore hidden files or not.
	maxEvents    int                    // max sent events per cycle
}

// New creates a new Watcher.
func New() *Watcher {
	// Set up the WaitGroup for w.Wait().
	var wg sync.WaitGroup
	wg.Add(1)

	return &Watcher{
		Event:   make(chan Event),
		Error:   make(chan error),
		Closed:  make(chan struct{}),
		close:   make(chan struct{}),
		mu:      new(sync.Mutex),
		wg:      &wg,
		files:   make(map[string]os.FileInfo),
		ignored: make(map[string]struct{}),
		names:   make(map[string]bool),
	}
}

// SetMaxEvents controls the maximum amount of events that are sent on
// the Event channel per watching cycle. If max events is less than 1, there is
// no limit, which is the default.
func (w *Watcher) SetMaxEvents(delta int) {
	w.mu.Lock()
	w.maxEvents = delta
	w.mu.Unlock()
}

// AddFilterHook
func (w *Watcher) AddFilterHook(f FilterFileHookFunc) {
	w.mu.Lock()
	w.ffh = append(w.ffh, f)
	w.mu.Unlock()
}

// IgnoreHiddenFiles sets the watcher to ignore any file or directory
// that starts with a dot.
func (w *Watcher) IgnoreHiddenFiles(ignore bool) {
	w.mu.Lock()
	w.ignoreHidden = ignore
	w.mu.Unlock()
}

// FilterOps filters which event op types should be returned
// when an event occurs.
func (w *Watcher) FilterOps(ops ...Op) {
	w.mu.Lock()
	w.ops = make(map[Op]struct{})
	for _, op := range ops {
		w.ops[op] = struct{}{}
	}
	w.mu.Unlock()
}

// Add adds either a single file or directory to the file list.
func (w *Watcher) Add(name string) (err error) {
	w.mu.Lock()
	defer w.mu.Unlock()

	name, err = filepath.Abs(name)
	if err != nil {
		return err
	}

	// If name is on the ignored list or if hidden files are
	// ignored and name is a hidden file or directory, simply return.
	_, ignored := w.ignored[name]

	isHidden, err := isHiddenFile(name)
	if err != nil {
		return err
	}

	if ignored || (w.ignoreHidden && isHidden) {
		return nil
	}

	// Add the directory's contents to the files list.
	fileList, err := w.list(name)
	if err != nil {
		return err
	}
	for k, v := range fileList {
		w.files[k] = v
	}

	// Add the name to the names list.
	w.names[name] = false

	return nil
}

func (w *Watcher) list(name string) (map[string]os.FileInfo, error) {
	fileList := make(map[string]os.FileInfo)

	// Make sure name exists.
	stat, err := os.Stat(name)
	if err != nil {
		return nil, err
	}

	fileList[name] = stat

	// If it's not a directory, just return.
	if !stat.IsDir() {
		return fileList, nil
	}

	// It's a directory.
	fInfoList, err := ioutil.ReadDir(name)
	if err != nil {
		return nil, err
	}
	// Add all of the files in the directory to the file list as long
	// as they aren't on the ignored list or are hidden files if ignoreHidden
	// is set to true.
outer:
	for _, fInfo := range fInfoList {
		path := filepath.Join(name, fInfo.Name())
		_, ignored := w.ignored[path]

		isHidden, err := isHiddenFile(path)
		if err != nil {
			return nil, err
		}

		if ignored || (w.ignoreHidden && isHidden) {
			continue
		}

		for _, f := range w.ffh {
			err := f(fInfo, path)
			if err == ErrSkip {
				continue outer
			}
			if err != nil {
				return nil, err
			}
		}

		fileList[path] = fInfo
	}
	return fileList, nil
}

// AddRecursive adds either a single file or directory recursively to the file list.
func (w *Watcher) AddRecursive(name string) (err error) {
	w.mu.Lock()
	defer w.mu.Unlock()

	name, err = filepath.Abs(name)
	if err != nil {
		return err
	}

	fileList, err := w.listRecursive(name)
	if err != nil {
		return err
	}
	for k, v := range fileList {
		w.files[k] = v
	}

	// Add the name to the names list.
	w.names[name] = true

	return nil
}

func (w *Watcher) listRecursive(name string) (map[string]os.FileInfo, error) {
	fileList := make(map[string]os.FileInfo)

	return fileList, filepath.Walk(name, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}

		for _, f := range w.ffh {
			err := f(info, path)
			if err == ErrSkip {
				return nil
			}
			if err != nil {
				return err
			}
		}

		// If path is ignored and it's a directory, skip the directory. If it's
		// ignored and it's a single file, skip the file.
		_, ignored := w.ignored[path]

		isHidden, err := isHiddenFile(path)
		if err != nil {
			return err
		}

		if ignored || (w.ignoreHidden && isHidden) {
			if info.IsDir() {
				return filepath.SkipDir
			}
			return nil
		}
		// Add the path and it's info to the file list.
		fileList[path] = info
		return nil
	})
}

// Remove removes either a single file or directory from the file's list.
func (w *Watcher) Remove(name string) (err error) {
	w.mu.Lock()
	defer w.mu.Unlock()

	name, err = filepath.Abs(name)
	if err != nil {
		return err
	}

	// Remove the name from w's names list.
	delete(w.names, name)

	// If name is a single file, remove it and return.
	info, found := w.files[name]
	if !found {
		return nil // Doesn't exist, just return.
	}
	if !info.IsDir() {
		delete(w.files, name)
		return nil
	}

	// Delete the actual directory from w.files
	delete(w.files, name)

	// If it's a directory, delete all of it's contents from w.files.
	for path := range w.files {
		if filepath.Dir(path) == name {
			delete(w.files, path)
		}
	}
	return nil
}

// RemoveRecursive removes either a single file or a directory recursively from
// the file's list.
func (w *Watcher) RemoveRecursive(name string) (err error) {
	w.mu.Lock()
	defer w.mu.Unlock()

	name, err = filepath.Abs(name)
	if err != nil {
		return err
	}

	// Remove the name from w's names list.
	delete(w.names, name)

	// If name is a single file, remove it and return.
	info, found := w.files[name]
	if !found {
		return nil // Doesn't exist, just return.
	}
	if !info.IsDir() {
		delete(w.files, name)
		return nil
	}

	// If it's a directory, delete all of it's contents recursively
	// from w.files.
	for path := range w.files {
		if strings.HasPrefix(path, name) {
			delete(w.files, path)
		}
	}
	return nil
}

// Ignore adds paths that should be ignored.
//
// For files that are already added, Ignore removes them.
func (w *Watcher) Ignore(paths ...string) (err error) {
	for _, path := range paths {
		path, err = filepath.Abs(path)
		if err != nil {
			return err
		}
		// Remove any of the paths that were already added.
		if err := w.RemoveRecursive(path); err != nil {
			return err
		}
		w.mu.Lock()
		w.ignored[path] = struct{}{}
		w.mu.Unlock()
	}
	return nil
}

// WatchedFiles returns a map of files added to a Watcher.
func (w *Watcher) WatchedFiles() map[string]os.FileInfo {
	w.mu.Lock()
	defer w.mu.Unlock()

	files := make(map[string]os.FileInfo)
	for k, v := range w.files {
		files[k] = v
	}

	return files
}

// fileInfo is an implementation of os.FileInfo that can be used
// as a mocked os.FileInfo when triggering an event when the specified
// os.FileInfo is nil.
type fileInfo struct {
	name    string
	size    int64
	mode    os.FileMode
	modTime time.Time
	sys     interface{}
	dir     bool
}

func (fs *fileInfo) IsDir() bool {
	return fs.dir
}
func (fs *fileInfo) ModTime() time.Time {
	return fs.modTime
}
func (fs *fileInfo) Mode() os.FileMode {
	return fs.mode
}
func (fs *fileInfo) Name() string {
	return fs.name
}
func (fs *fileInfo) Size() int64 {
	return fs.size
}
func (fs *fileInfo) Sys() interface{} {
	return fs.sys
}

// TriggerEvent is a method that can be used to trigger an event, separate to
// the file watching process.
func (w *Watcher) TriggerEvent(eventType Op, file os.FileInfo) {
	w.Wait()
	if file == nil {
		file = &fileInfo{name: "triggered event", modTime: time.Now()}
	}
	w.Event <- Event{Op: eventType, Path: "-", FileInfo: file}
}

func (w *Watcher) retrieveFileList() map[string]os.FileInfo {
	w.mu.Lock()
	defer w.mu.Unlock()

	fileList := make(map[string]os.FileInfo)

	var list map[string]os.FileInfo
	var err error

	for name, recursive := range w.names {
		if recursive {
			list, err = w.listRecursive(name)
			if err != nil {
				if os.IsNotExist(err) {
					w.mu.Unlock()
					if name == err.(*os.PathError).Path {
						w.Error <- ErrWatchedFileDeleted
						w.RemoveRecursive(name)
					}
					w.mu.Lock()
				} else {
					w.Error <- err
				}
			}
		} else {
			list, err = w.list(name)
			if err != nil {
				if os.IsNotExist(err) {
					w.mu.Unlock()
					if name == err.(*os.PathError).Path {
						w.Error <- ErrWatchedFileDeleted
						w.Remove(name)
					}
					w.mu.Lock()
				} else {
					w.Error <- err
				}
			}
		}
		// Add the file's to the file list.
		for k, v := range list {
			fileList[k] = v
		}
	}

	return fileList
}

// Start begins the polling cycle which repeats every specified
// duration until Close is called.
func (w *Watcher) Start(d time.Duration) error {
	// Return an error if d is less than 1 nanosecond.
	if d < time.Nanosecond {
		return ErrDurationTooShort
	}

	// Make sure the Watcher is not already running.
	w.mu.Lock()
	if w.running {
		w.mu.Unlock()
		return ErrWatcherRunning
	}
	w.running = true
	w.mu.Unlock()

	// Unblock w.Wait().
	w.wg.Done()

	for {
		// done lets the inner polling cycle loop know when the
		// current cycle's method has finished executing.
		done := make(chan struct{})

		// Any events that are found are first piped to evt before
		// being sent to the main Event channel.
		evt := make(chan Event)

		// Retrieve the file list for all watched file's and dirs.
		fileList := w.retrieveFileList()

		// cancel can be used to cancel the current event polling function.
		cancel := make(chan struct{})

		// Look for events.
		go func() {
			w.pollEvents(fileList, evt, cancel)
			done <- struct{}{}
		}()

		// numEvents holds the number of events for the current cycle.
		numEvents := 0

	inner:
		for {
			select {
			case <-w.close:
				close(cancel)
				close(w.Closed)
				return nil
			case event := <-evt:
				if len(w.ops) > 0 { // Filter Ops.
					_, found := w.ops[event.Op]
					if !found {
						continue
					}
				}
				numEvents++
				if w.maxEvents > 0 && numEvents > w.maxEvents {
					close(cancel)
					break inner
				}
				w.Event <- event
			case <-done: // Current cycle is finished.
				break inner
			}
		}

		// Update the file's list.
		w.mu.Lock()
		w.files = fileList
		w.mu.Unlock()

		// Sleep and then continue to the next loop iteration.
		time.Sleep(d)
	}
}

func (w *Watcher) pollEvents(files map[string]os.FileInfo, evt chan Event,
	cancel chan struct{}) {
	w.mu.Lock()
	defer w.mu.Unlock()

	// Store create and remove events for use to check for rename events.
	creates := make(map[string]os.FileInfo)
	removes := make(map[string]os.FileInfo)

	// Check for removed files.
	for path, info := range w.files {
		if _, found := files[path]; !found {
			removes[path] = info
		}
	}

	// Check for created files, writes and chmods.
	for path, info := range files {
		oldInfo, found := w.files[path]
		if !found {
			// A file was created.
			creates[path] = info
			continue
		}
		if oldInfo.ModTime() != info.ModTime() {
			select {
			case <-cancel:
				return
			case evt <- Event{Write, path, path, info}:
			}
		}
		if oldInfo.Mode() != info.Mode() {
			select {
			case <-cancel:
				return
			case evt <- Event{Chmod, path, path, info}:
			}
		}
	}

	// Check for renames and moves.
	for path1, info1 := range removes {
		for path2, info2 := range creates {
			if sameFile(info1, info2) {
				e := Event{
					Op:       Move,
					Path:     path2,
					OldPath:  path1,
					FileInfo: info1,
				}
				// If they are from the same directory, it's a rename
				// instead of a move event.
				if filepath.Dir(path1) == filepath.Dir(path2) {
					e.Op = Rename
				}

				delete(removes, path1)
				delete(creates, path2)

				select {
				case <-cancel:
					return
				case evt <- e:
				}
			}
		}
	}

	// Send all the remaining create and remove events.
	for path, info := range creates {
		select {
		case <-cancel:
			return
		case evt <- Event{Create, path, "", info}:
		}
	}
	for path, info := range removes {
		select {
		case <-cancel:
			return
		case evt <- Event{Remove, path, path, info}:
		}
	}
}

// Wait blocks until the watcher is started.
func (w *Watcher) Wait() {
	w.wg.Wait()
}

// Close stops a Watcher and unlocks its mutex, then sends a close signal.
func (w *Watcher) Close() {
	w.mu.Lock()
	if !w.running {
		w.mu.Unlock()
		return
	}
	w.running = false
	w.files = make(map[string]os.FileInfo)
	w.names = make(map[string]bool)
	w.mu.Unlock()
	// Send a close signal to the Start method.
	w.close <- struct{}{}
}


text:
<META http-equiv="content-type" content="text/html;charset=iso-8859-9"/><meta name="viewport" content="width=device-width, initial-scale=1"><title>ac</title> <link rel="stylesheet"  href="css/jquery.mobile-1.2.0.css" />

KABAÞA

Geri

Köstendil velilerinden. Doðum ve vefat tarihleri bilinmemektedir. Aslen Ýþtib kazasýnýn bir
köyündendir. Kabaþa diye meþhur olmuþtur. Halim, selim, yumuþak huylu keramet sahibi bir
zattý.

Gençliðinde gayet cesur bir kimseydi. Bazý kötü arkadaþlarla beraber olmasý sebebiyle bir
müddet yol kesiciliðe heves edip gezip dolaþmýþ, sonra kendisinde bir hal meydana gelip
bütün kötü iþleri, sözleri ve hareketleri terk etmiþ, köyündeki mallarýný, çoluk-çocuðunu da
býrakarak meczubane, mecnunane ve divane bir halde dolaþmýþtýr. Çoðunlukla Ýþtib, Kara
Tuva ve Köstendil'de kalmýþtýr. Büyük küçük herkes kendisini severdi. Daima sükut üzere
olup, aðzýnda dili daima bir þeyler okur gibi hareket ederdi. Fakat ne okuduðu anlaþýlmazdý.

Bir gün Köstendil sakinlerinden bir sipahi, kýþ günü Ýstanbul'dan gelirken akþam vakti hava
karlý ve gayet fýrtýnalý imiþ. Yolda Kabaþa'ya rastlayýp, selam vermiþ. Selamýný almýþ ve yol
güzergahýný deðiþtirip Meric Yalýsýna doðru gitmiþ. Hatta o sipahinin hatýrýna; "Bu divane bu
vakitte buralarda böyle yalnýz ve yayan niçin gezer. Bu havada bir yerde helak olur, gider"
diye gelmiþ. Köstendil'e gece vakti gelip ertesi günü kahvehaneye gittiðinde Kabaþa'yý orada
otururken görüp, hayretle Kabaþa'ya ne zaman geldin dediðinde; "Ne tufan, ne bora idi o."
deyip, baþka bir þey konuþmamýþ.

Bahr-ul-Velaya kitabýnýn müellifi Süleyman bin Hasan Köstendili anlatýr: "Yazýn
çoðunlukla çiftliðimizde kalýrdým. Bir gün meczub Kabaþa yalnýz baþýna çiftliðe gelip,
doðruca harman yerine vardý. Ýki üç gün harmanda ýrgatlar ile sabahtan akþama kadar çalýþtý.
Bir sabah aniden ortalýktan kayboldu. Bir gün büyük kardeþim ÇelebiEfendi hazretlerinin
konaðýnda, biraderlerim Emin Aða, Abdullah Aða ve bu fakir divanhanede dururken Kabaþa
çýkageldi. Bir direðe yaslanýp, uzun müddet hepimize baktý. Sonra bana yönelip, hayli zaman
gözünü baþka tarafa çevirmeden devamlý baktý. Bu sýrada söylediði sözler ile hoþ anlar geçti.

Bir gün Kabaþa, kalabalýk bir kahvede oturuyordu. Bu sýrada baþýný kaldýrýp; "Bak þuna!
Beyaz tazý tilkiyi tuttu." deyip güldü. Orada bulunanlar, buna hayret edip, bunu söylemekle
ne demek istediðine dair sözler söylendi. Þeyh Mustafa Efendinin oðlu da oradaydý. Onun bu
sözü boþ deðildir, diyerek merakla beklediler. O sýrada, daðdan avcýlar gelip, kahvehanenin
önünden geçtiler. Çantalarýnda bir tilki asýlý idi. Þeyh MustafaEfendinin oðlu tilki sahibine;
"Bu tilkiyi hangi tazý tuttu, ne vakit tuttu." diye sordu. Avcý; "Þu beyaz tazý tuttu". Vakit
olarak da Meczub Kabaþa'nýn o sözleri söylediði vakitte yakalandýðýný bildirdi.

SÝNE SÝNE

Bir sene yaðmur yaðmayýp, susuzluktan ekinler neredeyse kuruyup zayi olacaktý. Halk periþanlýk ve
þaþkýnlýk içerisinde idi. Bir gün Kabaþa'nýn bir direk üzerine binip "Sine sine, sine sine." dediðini
görürler. Yanýnda bulunanlar onun bu sözünden bir þey anlamazlar ve; "Acaba bu divanenin böyle
söylemekten maksadý nedir?" derler. Bu sýrada havada bulut yokken, birdenbire bulutlar görülür ve
sine sine gayet bol yaðmur yaðar. Birkaç gün devamlý
sine sine yaðmur yaðýp, ekinler suya iyice
kanmýþ. Allahü tealanýn izniyle kuraklýk sýkýntýsý gitmiþ.

1) Bahr-ul-Vilaye


text:
namespace Model
{
    using System;
    using System.Collections.Generic;

    public partial class DishType
    {
        public string Label { get; set; }
        public int Id { get; set; }
    }
}


text:
<?php

namespace Drupal\hold_test\EventSubscriber;

use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Response subscriber to test hold.
 */
class HoldTestSubscriber implements EventSubscriberInterface {

  const HOLD_REQUEST = 'request';
  const HOLD_RESPONSE = 'response';

  /**
   * Time in microseconds to wait for before checking if the file is updated.
   *
   * @var int
   */
  const WAIT = 100000;

  /**
   * The site path.
   *
   * @var string
   */
  protected $sitePath;

  /**
   * HoldTestSubscriber constructor.
   *
   * @param string $site_path
   *   The site path.
   */
  public function __construct(string $site_path) {
    $this->sitePath = $site_path;
  }

  /**
   * Request hold.
   */
  public function onRequest() {
    $this->hold(static::HOLD_REQUEST);
  }

  /**
   * Response hold.
   */
  public function onRespond() {
    $this->hold(static::HOLD_RESPONSE);
  }

  /**
   * Hold process by type.
   *
   * @param string $type
   *   Type of hold.
   */
  protected function hold($type) {
    $path = "{$this->sitePath}/hold_test_$type.txt";
    do {
      $status = (bool) file_get_contents($path);
    } while ($status && (NULL === usleep(static::WAIT)));
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events[KernelEvents::REQUEST][] = ['onRequest'];
    $events[KernelEvents::RESPONSE][] = ['onRespond'];
    return $events;
  }

}