text:
class Yubikey::OTP
  # first few modhex encoded characters of the OTP
  attr_reader :public_id
  # decrypted binary token
  attr_reader :token
  # binary AES key
  attr_reader :aes_key
  # hex id (encrypted in OTP)
  attr_reader :secret_id
  # integer that increments each time the Yubikey is plugged in
  attr_reader :insert_counter
  # ~8hz timer, reset on every insert
  attr_reader :timestamp
  # activation counter, reset on every insert
  attr_reader :session_counter
  # random integer used as padding and extra random noise
  attr_reader :random_number

  # Decode/decrypt a Yubikey one-time password
  #
  # [+otp+] ModHex encoded Yubikey OTP (at least 32 characters)
  # [+key+] 32-character hex AES key
  def initialize(otp, key)
    raise InvalidOTPError, 'OTP must be at least 32 characters of modhex' unless otp.modhex? && otp.length >= 32
    raise InvalidKeyError, 'Key must be 32 hex characters' unless key.hex? && key.length == 32

    # Get the public ID first
    @public_id = otp[0, 12]

    # Strip prefix so otp will decode (following from yubico-c library)
    otp = otp[-32,32] if otp.length > 32

    @token = Yubikey::ModHex.decode(otp[-32,32])
    @aes_key = key.to_bin

    decrypter = OpenSSL::Cipher.new('AES-128-ECB').decrypt
    decrypter.key = @aes_key
    decrypter.padding = 0

    @token = decrypter.update(@token) + decrypter.final

    raise BadCRCError unless crc_valid?

    @secret_id, @insert_counter, @timestamp, @timestamp_lo, @session_counter, @random_number, @crc = @token.unpack('H12vvCCvv')
    @timestamp += @timestamp_lo * 65536
  end

  private

  def crc_valid?
    crc = 0xffff
    @token.each_byte do |b|
      crc ^= b & 0xff
      8.times do
        test = (crc & 1) == 1
        crc >>= 1
        crc ^= 0x8408 if test
      end
    end
    crc == 0xf0b8
  end

  # :stopdoc:
  class InvalidOTPError < StandardError; end
  class InvalidKeyError < StandardError; end
  class BadCRCError < StandardError; end
end # Yubikey::OTP


text:
package etcd

import (
	"strconv"
	"testing"
	"time"

	"github.com/coreos/go-etcd/etcd"
	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/errors"
	"k8s.io/kubernetes/pkg/api/rest/resttest"
	"k8s.io/kubernetes/pkg/api/testapi"
	"k8s.io/kubernetes/pkg/fields"
	"k8s.io/kubernetes/pkg/labels"
	etcdgeneric "k8s.io/kubernetes/pkg/registry/generic/etcd"
	"k8s.io/kubernetes/pkg/registry/registrytest"
	"k8s.io/kubernetes/pkg/runtime"
	etcdstorage "k8s.io/kubernetes/pkg/storage/etcd"
	"k8s.io/kubernetes/pkg/tools"
	"k8s.io/kubernetes/pkg/tools/etcdtest"
)

const (
	PASS = iota
	FAIL
)

func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
	etcdStorage, fakeClient := registrytest.NewEtcdStorage(t)
	return NewREST(etcdStorage), fakeClient
}

// createController is a helper function that returns a controller with the updated resource version.
func createController(storage *REST, rc api.ReplicationController, t *testing.T) (api.ReplicationController, error) {
	ctx := api.WithNamespace(api.NewContext(), rc.Namespace)
	obj, err := storage.Create(ctx, &rc)
	if err != nil {
		t.Errorf("Failed to create controller, %v", err)
	}
	newRc := obj.(*api.ReplicationController)
	return *newRc, nil
}

var validPodTemplate = api.PodTemplate{
	Template: api.PodTemplateSpec{
		ObjectMeta: api.ObjectMeta{
			Labels: map[string]string{"a": "b"},
		},
		Spec: api.PodSpec{
			Containers: []api.Container{
				{
					Name:            "test",
					Image:           "test_image",
					ImagePullPolicy: api.PullIfNotPresent,
				},
			},
			RestartPolicy: api.RestartPolicyAlways,
			DNSPolicy:     api.DNSClusterFirst,
		},
	},
}

var validControllerSpec = api.ReplicationControllerSpec{
	Selector: validPodTemplate.Template.Labels,
	Template: &validPodTemplate.Template,
}

var validController = api.ReplicationController{
	ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "default"},
	Spec:       validControllerSpec,
}

func TestCreate(t *testing.T) {
	storage, fakeClient := newStorage(t)
	test := resttest.New(t, storage, fakeClient.SetError)
	test.TestCreate(
		// valid
		&api.ReplicationController{
			Spec: api.ReplicationControllerSpec{
				Replicas: 2,
				Selector: map[string]string{"a": "b"},
				Template: &validPodTemplate.Template,
			},
		},
		func(ctx api.Context, obj runtime.Object) error {
			return registrytest.SetObject(fakeClient, storage.KeyFunc, ctx, obj)
		},
		func(ctx api.Context, obj runtime.Object) (runtime.Object, error) {
			return registrytest.GetObject(fakeClient, storage.KeyFunc, storage.NewFunc, ctx, obj)
		},
		// invalid
		&api.ReplicationController{
			Spec: api.ReplicationControllerSpec{
				Replicas: 2,
				Selector: map[string]string{},
				Template: &validPodTemplate.Template,
			},
		},
	)
}

func TestEtcdControllerValidatesUpdate(t *testing.T) {
	ctx := api.NewDefaultContext()
	storage, _ := newStorage(t)

	updateController, err := createController(storage, validController, t)
	if err != nil {
		t.Errorf("Failed to create controller, cannot proceed with test.")
	}

	updaters := []func(rc api.ReplicationController) (runtime.Object, bool, error){
		func(rc api.ReplicationController) (runtime.Object, bool, error) {
			rc.UID = "newUID"
			return storage.Update(ctx, &rc)
		},
		func(rc api.ReplicationController) (runtime.Object, bool, error) {
			rc.Name = ""
			return storage.Update(ctx, &rc)
		},
		func(rc api.ReplicationController) (runtime.Object, bool, error) {
			rc.Spec.Selector = map[string]string{}
			return storage.Update(ctx, &rc)
		},
	}
	for _, u := range updaters {
		c, updated, err := u(updateController)
		if c != nil || updated {
			t.Errorf("Expected nil object and not created")
		}
		if !errors.IsInvalid(err) && !errors.IsBadRequest(err) {
			t.Errorf("Expected invalid or bad request error, got %v of type %T", err, err)
		}
	}
}

func TestEtcdControllerValidatesNamespaceOnUpdate(t *testing.T) {
	storage, _ := newStorage(t)
	ns := "newnamespace"

	// The update should fail if the namespace on the controller is set to something
	// other than the namespace on the given context, even if the namespace on the
	// controller is valid.
	updateController, err := createController(storage, validController, t)

	newNamespaceController := validController
	newNamespaceController.Namespace = ns
	_, err = createController(storage, newNamespaceController, t)

	c, updated, err := storage.Update(api.WithNamespace(api.NewContext(), ns), &updateController)
	if c != nil || updated {
		t.Errorf("Expected nil object and not created")
	}
	// TODO: Be more paranoid about the type of error and make sure it has the substring
	// "namespace" in it, once #5684 is fixed. Ideally this would be a NewBadRequest.
	if err == nil {
		t.Errorf("Expected an error, but we didn't get one")
	}
}

func TestGenerationNumber(t *testing.T) {
	storage, _ := newStorage(t)
	modifiedSno := validController
	modifiedSno.Generation = 100
	modifiedSno.Status.ObservedGeneration = 10
	ctx := api.NewDefaultContext()
	rc, err := createController(storage, modifiedSno, t)
	ctrl, err := storage.Get(ctx, rc.Name)
	if err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	controller, _ := ctrl.(*api.ReplicationController)

	// Generation initialization
	if controller.Generation != 1 && controller.Status.ObservedGeneration != 0 {
		t.Fatalf("Unexpected generation number %v, status generation %v", controller.Generation, controller.Status.ObservedGeneration)
	}

	// Updates to spec should increment the generation number
	controller.Spec.Replicas += 1
	storage.Update(ctx, controller)
	if err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	ctrl, err = storage.Get(ctx, rc.Name)
	if err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	controller, _ = ctrl.(*api.ReplicationController)
	if controller.Generation != 2 || controller.Status.ObservedGeneration != 0 {
		t.Fatalf("Unexpected generation, spec: %v, status: %v", controller.Generation, controller.Status.ObservedGeneration)
	}

	// Updates to status should not increment either spec or status generation numbers
	controller.Status.Replicas += 1
	storage.Update(ctx, controller)
	if err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	ctrl, err = storage.Get(ctx, rc.Name)
	if err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	controller, _ = ctrl.(*api.ReplicationController)
	if controller.Generation != 2 || controller.Status.ObservedGeneration != 0 {
		t.Fatalf("Unexpected generation number, spec: %v, status: %v", controller.Generation, controller.Status.ObservedGeneration)
	}
}

func TestEtcdGetController(t *testing.T) {
	storage, fakeClient := newStorage(t)
	test := resttest.New(t, storage, fakeClient.SetError)
	copy := validController
	test.TestGet(&copy)
}

func TestEtcdListControllers(t *testing.T) {
	storage, fakeClient := newStorage(t)
	test := resttest.New(t, storage, fakeClient.SetError)
	key := etcdtest.AddPrefix(storage.KeyRootFunc(test.TestContext()))
	copy := validController
	test.TestList(
		&copy,
		func(objects []runtime.Object) []runtime.Object {
			return registrytest.SetObjectsForKey(fakeClient, key, objects)
		},
		func(resourceVersion uint64) {
			registrytest.SetResourceVersion(fakeClient, resourceVersion)
		})
}

func TestEtcdUpdateController(t *testing.T) {
	ctx := api.NewDefaultContext()
	storage, fakeClient := newStorage(t)
	key, _ := storage.KeyFunc(ctx, validController.Name)
	key = etcdtest.AddPrefix(key)

	// set a key, then retrieve the current resource version and try updating it
	resp, _ := fakeClient.Set(key, runtime.EncodeOrDie(testapi.Codec(), &validController), 0)
	update := validController
	update.ResourceVersion = strconv.FormatUint(resp.Node.ModifiedIndex, 10)
	update.Spec.Replicas = validController.Spec.Replicas + 1
	_, created, err := storage.Update(ctx, &update)
	if err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	if created {
		t.Errorf("expected an update but created flag was returned")
	}
	ctrl, err := storage.Get(ctx, validController.Name)
	updatedController, _ := ctrl.(*api.ReplicationController)
	if updatedController.Spec.Replicas != validController.Spec.Replicas+1 {
		t.Errorf("Unexpected controller: %#v", ctrl)
	}
}

func TestEtcdDeleteController(t *testing.T) {
	ctx := api.NewDefaultContext()
	storage, fakeClient := newStorage(t)
	key, _ := storage.KeyFunc(ctx, validController.Name)
	key = etcdtest.AddPrefix(key)

	fakeClient.Set(key, runtime.EncodeOrDie(testapi.Codec(), &validController), 0)
	obj, err := storage.Delete(ctx, validController.Name, nil)
	if err != nil {
		t.Errorf("unexpected error: %v", err)
	}
	if status, ok := obj.(*api.Status); !ok {
		t.Errorf("Expected status of delete, got %#v", status)
	} else if status.Status != api.StatusSuccess {
		t.Errorf("Expected success, got %#v", status.Status)
	}
	if len(fakeClient.DeletedKeys) != 1 {
		t.Errorf("Expected 1 delete, found %#v", fakeClient.DeletedKeys)
	}
	if fakeClient.DeletedKeys[0] != key {
		t.Errorf("Unexpected key: %s, expected %s", fakeClient.DeletedKeys[0], key)
	}
}

func TestEtcdWatchController(t *testing.T) {
	ctx := api.NewDefaultContext()
	storage, fakeClient := newStorage(t)
	watching, err := storage.Watch(ctx,
		labels.Everything(),
		fields.Everything(),
		"1",
	)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	fakeClient.WaitForWatchCompletion()

	select {
	case _, ok := <-watching.ResultChan():
		if !ok {
			t.Errorf("watching channel should be open")
		}
	default:
	}
	fakeClient.WatchInjectError <- nil
	if _, ok := <-watching.ResultChan(); ok {
		t.Errorf("watching channel should be closed")
	}
	watching.Stop()
}

func TestEtcdWatchControllersMatch(t *testing.T) {
	ctx := api.WithNamespace(api.NewDefaultContext(), validController.Namespace)
	storage, fakeClient := newStorage(t)
	fakeClient.ExpectNotFoundGet(etcdgeneric.NamespaceKeyRootFunc(ctx, "/registry/pods"))

	watching, err := storage.Watch(ctx,
		labels.SelectorFromSet(validController.Spec.Selector),
		fields.Everything(),
		"1",
	)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	fakeClient.WaitForWatchCompletion()

	// The watcher above is waiting for these Labels, on receiving them it should
	// apply the ControllerStatus decorator, which lists pods, causing a query against
	// the /registry/pods endpoint of the etcd client.
	controller := &api.ReplicationController{
		ObjectMeta: api.ObjectMeta{
			Name:      "foo",
			Labels:    validController.Spec.Selector,
			Namespace: "default",
		},
	}
	controllerBytes, _ := testapi.Codec().Encode(controller)
	fakeClient.WatchResponse <- &etcd.Response{
		Action: "create",
		Node: &etcd.Node{
			Value: string(controllerBytes),
		},
	}
	select {
	case _, ok := <-watching.ResultChan():
		if !ok {
			t.Errorf("watching channel should be open")
		}
	case <-time.After(time.Millisecond * 100):
		t.Error("unexpected timeout from result channel")
	}
	watching.Stop()
}

func TestEtcdWatchControllersFields(t *testing.T) {
	ctx := api.WithNamespace(api.NewDefaultContext(), validController.Namespace)
	storage, fakeClient := newStorage(t)
	fakeClient.ExpectNotFoundGet(etcdgeneric.NamespaceKeyRootFunc(ctx, "/registry/pods"))

	testFieldMap := map[int][]fields.Set{
		PASS: {
			{"status.replicas": "0"},
			{"metadata.name": "foo"},
			{"status.replicas": "0", "metadata.name": "foo"},
		},
		FAIL: {
			{"status.replicas": "10"},
			{"metadata.name": "bar"},
			{"name": "foo"},
			{"status.replicas": "10", "metadata.name": "foo"},
			{"status.replicas": "0", "metadata.name": "bar"},
		},
	}
	testEtcdActions := []string{
		etcdstorage.EtcdCreate,
		etcdstorage.EtcdSet,
		etcdstorage.EtcdCAS,
		etcdstorage.EtcdDelete}

	controller := &api.ReplicationController{
		ObjectMeta: api.ObjectMeta{
			Name:      "foo",
			Labels:    validController.Spec.Selector,
			Namespace: "default",
		},
		Status: api.ReplicationControllerStatus{
			Replicas: 0,
		},
	}
	controllerBytes, _ := testapi.Codec().Encode(controller)

	for expectedResult, fieldSet := range testFieldMap {
		for _, field := range fieldSet {
			for _, action := range testEtcdActions {
				watching, err := storage.Watch(ctx,
					labels.Everything(),
					field.AsSelector(),
					"1",
				)
				var prevNode *etcd.Node = nil
				node := &etcd.Node{
					Value: string(controllerBytes),
				}
				if action == etcdstorage.EtcdDelete {
					prevNode = node
				}
				fakeClient.WaitForWatchCompletion()
				fakeClient.WatchResponse <- &etcd.Response{
					Action:   action,
					Node:     node,
					PrevNode: prevNode,
				}
				if err != nil {
					t.Fatalf("unexpected error: %v", err)
				}

				select {
				case r, ok := <-watching.ResultChan():
					if expectedResult == FAIL {
						t.Errorf("Unexpected result from channel %#v", r)
					}
					if !ok {
						t.Errorf("watching channel should be open")
					}
				case <-time.After(time.Millisecond * 100):
					if expectedResult == PASS {
						t.Error("unexpected timeout from result channel")
					}
				}
				watching.Stop()
			}
		}
	}
}

func TestEtcdWatchControllersNotMatch(t *testing.T) {
	ctx := api.NewDefaultContext()
	storage, fakeClient := newStorage(t)
	fakeClient.ExpectNotFoundGet(etcdgeneric.NamespaceKeyRootFunc(ctx, "/registry/pods"))

	watching, err := storage.Watch(ctx,
		labels.SelectorFromSet(labels.Set{"name": "foo"}),
		fields.Everything(),
		"1",
	)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	fakeClient.WaitForWatchCompletion()

	controller := &api.ReplicationController{
		ObjectMeta: api.ObjectMeta{
			Name: "bar",
			Labels: map[string]string{
				"name": "bar",
			},
		},
	}
	controllerBytes, _ := testapi.Codec().Encode(controller)
	fakeClient.WatchResponse <- &etcd.Response{
		Action: "create",
		Node: &etcd.Node{
			Value: string(controllerBytes),
		},
	}

	select {
	case <-watching.ResultChan():
		t.Error("unexpected result from result channel")
	case <-time.After(time.Millisecond * 100):
		// expected case
	}
}

func TestDelete(t *testing.T) {
	ctx := api.NewDefaultContext()
	storage, fakeClient := newStorage(t)
	test := resttest.New(t, storage, fakeClient.SetError)
	key, _ := storage.KeyFunc(ctx, validController.Name)
	key = etcdtest.AddPrefix(key)

	createFn := func() runtime.Object {
		rc := validController
		rc.ResourceVersion = "1"
		fakeClient.Data[key] = tools.EtcdResponseWithError{
			R: &etcd.Response{
				Node: &etcd.Node{
					Value:         runtime.EncodeOrDie(testapi.Codec(), &rc),
					ModifiedIndex: 1,
				},
			},
		}
		return &rc
	}
	gracefulSetFn := func() bool {
		// If the controller is still around after trying to delete either the delete
		// failed, or we're deleting it gracefully.
		if fakeClient.Data[key].R.Node != nil {
			return true
		}
		return false
	}

	test.TestDelete(createFn, gracefulSetFn)
}

redpajama_set_name: RedPajamaGithub


text:
import ArrayDataManager from 'ember-railio-grid/utils/array-data-manager';
import APIDataManager from 'ember-railio-grid/utils/api-data-manager';
import { moduleForComponent, test } from 'ember-qunit';

import run from 'ember-runloop';
import get from 'ember-metal/get';

moduleForComponent('data-grid', 'Unit | Component | data-grid', {
  unit: true
});

test('with content: has a ArrayDataManager with content', function(assert) {
  let dataGrid;
  run(() => {
    dataGrid = this.subject({
      content: [1, 2, 3, 4]
    });
    dataGrid.didReceiveAttrs();
  });

  let dataManager = get(dataGrid, 'dataManager');

  assert.notEqual(dataManager, null, 'dataManager is defined');
  assert.ok(dataManager instanceof ArrayDataManager,
            'dataManager is of type ArrayDataManager');
  assert.deepEqual(dataManager.get('content'), [1, 2, 3, 4],
                   'dataManager gets content');
});

test('with modelName: has a APIDataManager with content from API', function(assert) {
  let dataGrid;
  run(() => {
    dataGrid = this.subject({
      modelName: 'animal'
    });
    dataGrid.didReceiveAttrs();
  });

  let dataManager = dataGrid.get('dataManager');

  assert.notEqual(dataManager, null, 'dataManager is defined');
  assert.ok(dataManager instanceof APIDataManager,
            'dataManager is of type APIDataManager');
  assert.equal(dataManager.get('modelName'), 'animal', 'dataManager has modelName');
});


text:
var modifyIframe = function(width, height) {
    var my_helloasso_widget = document.getElementById('my_helloasso_widget');

    my_helloasso_widget.style.width = width - 2 + "px";
    my_helloasso_widget.style.height = height - 2 + "px";

    if (height < 240) {
        document.getElementById('infos').style.position = "absolute";
        document.getElementById('infos').style.transform = "none";
        document.getElementById('infos').style.top = 10 + "px";
    }

    this.openDonateForm = function() {
        this.resizeIframe();
    }

    this.validerCoord = function() {
        if (document.getElementById('formCoordonnees').style.display == "none") {
             this.resizeIframe();
        } else {
            modifierHeightErreur(parseInt(window.frameElement.getAttribute("height")));
        }
    }

    this.validerMontant = function() {
        if (document.getElementById('formMontant').style.display == "none") {
             this.resizeIframe();
        } else {
            modifierHeightErreur(parseInt(window.frameElement.getAttribute("height")));
        }
    }

    this.paymentRegularOnce = function() {
        var height = parseInt(window.frameElement.getAttribute("height"));
        if (document.getElementById('frequenceSelect').value == "ONCE") {
             this.resizeIframe();
        } else {
            height += 60;
            window.frameElement.setAttribute("height", height);
        }
    }

    function modifierHeightErreur(value) {
        window.frameElement.setAttribute("height", value);
        var height = value;
        var erreurActive = document.getElementsByClassName('erreur');
        for (var i = 0; i < erreurActive.length; i++) {
            if (erreurActive[i].style['display'] == "block") {
                height += 6;
            }
        }
        window.frameElement.setAttribute("height", height);
    }

    this.retourAccueil = function(){
        window.frameElement.setAttribute("height",height);
    }

    this.resizeIframe = function() {
        var container = document.getElementById('formulaire_don');
        var height = container.offsetHeight;
        window.frameElement.setAttribute("height",height+27);
    }
}


text:
CSVGJEventType::
CSVGJEventType(CJavaScript *js) :
 CJObjType(js, CJToken::Type::Object, "SVGEvent")
{
}

//------

CSVGJEvent::
CSVGJEvent(CSVG *svg) :
 CJObj(svg->js(), svg->js()->eventType()), svg_(svg)
{
  auto *js = svg->js();

  objType_->addObjectFunction(js, "getTarget");
}

CJValueP
CSVGJEvent::
execNameFn(CJavaScript *, const std::string &name, const Values &)
{
  if (name == "getTarget") {
    auto *obj = svg_->eventObject();

    auto jobj = new CSVGJElement(obj);

    return CJValueP(jobj);
  }
  else
    return CJValueP();
}

#endif


text:
import struct

from seabreeze.pyseabreeze.features._base import SeaBreezeFeature
from seabreeze.pyseabreeze.protocol import OBPProtocol
from seabreeze.pyseabreeze.protocol import OOIProtocol

# Definition
# ==========
#
class SeaBreezeThermoElectricFeature(SeaBreezeFeature):
    identifier = "thermo_electric"

    def read_temperature_degrees_celsius(self) -> float:
        raise NotImplementedError("implement in derived class")

    def set_temperature_setpoint_degrees_celsius(self, temperature: float) -> None:
        raise NotImplementedError("implement in derived class")

    def enable_tec(self, state: bool) -> None:
        raise NotImplementedError("implement in derived class")

# OOI implementation
# ==================
#
class ThermoElectricFeatureOOI(SeaBreezeThermoElectricFeature):
    _required_protocol_cls = OOIProtocol

    def enable_tec(self, state: bool) -> None:
        self.protocol.send(0x71, (bool(state), 0x00))

    def set_temperature_setpoint_degrees_celsius(self, temperature: float) -> None:
        self.protocol.send(0x73, int(temperature * 10))

    def read_temperature_degrees_celsius(self) -> float:
        self.protocol.send(0x72)
        ret = self.protocol.receive(timeout_ms=1000, mode="low_speed")
        return float(struct.unpack("<h", ret)[0] / 10.0)

    # NOTE: if implemented this would also need to be added to the interface
    # def set_tec_fan_enable(self, tec_fan_enable):
    #    # this is not implemented in the seabreeze library?
    #    self.usb_send(struct.pack('<BBB', 0x70, bool(tec_fan_enable), 0x00))
    #    raise NotImplementedError

# OBP implementation
# ==================
#
class ThermoElectricFeatureOBP(SeaBreezeThermoElectricFeature):
    _required_protocol_cls = OBPProtocol

    def enable_tec(self, state: bool) -> None:
        self.protocol.send(0x00420010, bool(state))

    def set_temperature_setpoint_degrees_celsius(self, temperature: float) -> None:
        self.protocol.send(0x00420011, float(temperature))

    def read_temperature_degrees_celsius(self) -> float:
        ret = self.protocol.query(0x00420004)
        return float(struct.unpack("<f", ret)[0])

    # def set_tec_fan_enable(self, tec_fan_enable):
    #     raise NotImplementedError


text:
package org.apache.sling.resourceresolver.impl.tree.params;

import java.util.Collections;
import java.util.Map;

/**
 * Parses path looking for semicolon-separated parameters. Parameters are extracted and exposed as an
 * immutable map. The path without parameters is available as raw path.
 *
 * Parameters should be added immedietaly before or after selectors and extension:
 * {@code /content/test;v='1.0'.html} or {@code /content/test.html;v=1.0}. Quotes can be used to escape the
 * parameter value (it is necessary if the value contains dot and parameter is added before extension).
 */
public class ParsedParameters {

    private final Map<String, String> parameters;

    private final String parametersString;

    private final String path;

    /**
     * Parse path and create parameters object.
     *
     * @param fullPath Path to parse.
     */
    public ParsedParameters(final String fullPath) {
        final PathParser parser = new PathParser();
        parser.parse(fullPath);

        parametersString = parser.getParametersString();
        parameters = Collections.unmodifiableMap(parser.getParameters());
        path = parser.getPath();
    }

    /**
     * @return Path with no parameters.
     */
    public String getRawPath() {
        return path;
    }

    /**
     * @return Path's substring containing parameters
     */
    public String getParametersString() {
        return parametersString;
    }

    /**
     * @return Map of the parameters.
     */
    public Map<String, String> getParameters() {
        return parameters;
    }

}


text:
#include <osk/mali_osk.h>

unsigned long osk_bitarray_find_first_zero_bit(const unsigned long *addr, unsigned long maxbit)
{
	unsigned long total;

	OSK_ASSERT(NULL != addr);

	for ( total = 0; total < maxbit; total += OSK_BITS_PER_LONG, ++addr )
	{
		if (OSK_ULONG_MAX != *addr)
		{
			int result;
			result = oskp_find_first_zero_bit( *addr );
			/* non-negative signifies the bit was found */
			if ( result >= 0 )
			{
				total += (unsigned long)result;
				break;
			}
		}
	}

	/* Now check if we reached maxbit or above */
	if ( total >= maxbit )
	{
		total = maxbit;
	}

	return total; /* either the found bit nr, or maxbit if not found */
}


text:
import PebblebedModel from "./PebblebedModel";

export * from "./Pebblebed";
export * from "./PebblebedGlobalConfig";
export * from "./types/PebblebedTypes";
export * from "./validation/PebblebedDataTypes";
export * from "./validation/PebblebedValidation";
export * from "./caching/PebblebedCacheStore";
export * from "./caching/PebblebedDefaultRedisCacheStore";
export * from "./userUtils/QueryUtils";

export {
  PebblebedModel,
}


text:
Re-invio di un messaggio

Quando scegliete di re-inviare un messaggio, questo verrà rimesso in coda, una volta che l'invio sarà terminato.
Il blocco del messaggio verrà impostato in base al tempo e alla frequenza di re-invio che specificate qui.

Questo farà in modo che il messaggio venga inviato agli utenti che si sono iscritti dopo l'invio.


text:
package org.apache.ibatis.submitted.ognlstatic;

public class StaticClass {

  public static String value = "User1";
}


text:
@class JDBDatabase;

@interface QueriesViewController : UITableViewController

@property (strong) JDBDatabase *database;
@property (strong) NSString *collectionName;

@end


text:
class GuessingGame
  def initialize(answer)
    # Your initialization code goes here
  end

  # Make sure you define the other required methods, too
end

# 4. Refactored Solution

# 1. DRIVER TESTS GO BELOW THIS LINE

# 5. Reflection


text:
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="urn:metadata.tooling.soap.sforce.com" fqn="BDI_FieldMappingSet">
    <apiVersion>48.0</apiVersion>
    <status>Active</status>
</ApexClass>


text:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="tests/bootstrap.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         stopOnFailure="true">
    <testsuites>
        <testsuite name="WordPress MVC - MVC">
            <directory>./tests/cases/</directory>
        </testsuite>
    </testsuites>
</phpunit>


text:
from a10sdk.common.A10BaseClass import A10BaseClass

class Stats(A10BaseClass):

    """This class does not support CRUD Operations please use parent.

    :param threshold_exceed: {"description": "Threshold exceeded count", "format": "counter", "type": "number", "oid": "7", "optional": true, "size": "2"}
    :param lockout_drop: {"description": "Lockout drops", "format": "counter", "type": "number", "oid": "8", "optional": true, "size": "2"}
    :param too_many_sessions: {"description": "Too many sessions consumed", "format": "counter", "type": "number", "oid": "4", "optional": true, "size": "2"}
    :param sessions_freed: {"description": "Sessions freed", "format": "counter", "type": "number", "oid": "2", "optional": true, "size": "2"}
    :param permitted: {"description": "Honor threshold  count", "format": "counter", "type": "number", "oid": "6", "optional": true, "size": "2"}
    :param log_msg_sent: {"description": "Log messages sent", "format": "counter", "type": "number", "oid": "9", "optional": true, "size": "2"}
    :param sessions_alloc: {"description": "Sessions allocated", "format": "counter", "type": "number", "oid": "1", "optional": true, "size": "2"}
    :param out_of_sessions: {"description": "Out of sessions", "format": "counter", "type": "number", "oid": "3", "optional": true, "size": "2"}
    :param called: {"description": "Threshold check count", "format": "counter", "type": "number", "oid": "5", "optional": true, "size": "2"}
    :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`

    """
    def __init__(self, **kwargs):
        self.ERROR_MSG = ""

        self.b_key = "stats"
        self.DeviceProxy = ""
        self.threshold_exceed = ""
        self.lockout_drop = ""
        self.too_many_sessions = ""
        self.sessions_freed = ""
        self.permitted = ""
        self.log_msg_sent = ""
        self.sessions_alloc = ""
        self.out_of_sessions = ""
        self.called = ""

        for keys, value in kwargs.items():
            setattr(self,keys, value)

class CrlSrcip(A10BaseClass):

    """Class Description::
    Statistics for the object crl-srcip.

    Class crl-srcip supports CRUD Operations and inherits from `common/A10BaseClass`.
    This class is the `"PARENT"` class for this module.`

    :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`

    URL for this object::
    `https://<Hostname|Ip address>//axapi/v3/slb/crl-srcip/stats`.

    """
    def __init__(self, **kwargs):
        self.ERROR_MSG = ""
        self.required=[]
        self.b_key = "crl-srcip"
        self.a10_url="/axapi/v3/slb/crl-srcip/stats"
        self.DeviceProxy = ""
        self.stats = {}

        for keys, value in kwargs.items():
            setattr(self,keys, value)


text:
use strict;
use warnings;

##for debugging - when thoroughly debugged, this can go away:
#use Data::Dumper;

use JSON;
# piggybacking on the files that are in deps that rachel put in for
# ragnastats-beta -- we will use this to read a json file, instead of
# sending JSON data.

## Array <= getDataFromJSON(String <Filename>)
#
#
# returns an array containing: $hostname, $username, $password
# if the file passed can be opened.
#
# It is the caller's responsibility to check if these returned values
# are valid or not.
#
sub getDBsettingsFromJSON
{
	my $fileName = shift;

	my $jsonText = do {
		open(my $jsonFH, "<:encoding(UTF-8)", $fileName)
		or return;
		local $/;
		<$jsonFH>
	};
	my $json = JSON->new;
	my $data = $json->decode($jsonText);
	#$data holds JSON data - return host/user/password to caller.

	return ($data->{host}, $data->{user}, $data->{password} );
}

##
# File locking -- prevent more than one instance of this file from running.
#
#
##
use Proc::ProcessTable;
my $count = 0;
my $table = Proc::ProcessTable->new;
for my $process ( @{ $table->table } ) {
	next unless $process->{cmndline};
	if ($process->{cmndline} =~ /$0/) {
		$count++;
		if ($count > 1) {
			die "This script is already running:";
		}
	}
}
##

use FindBin qw($RealBin);
use lib "$RealBin";
use lib "$RealBin/deps";

use Globals qw($interface);

## 2015/02/19 CRW
## with just SimpleClient, this instance gets on the bus, BUT, is not
## identified, ergo, the openkore instances can't see it.
## This MAY be useful if you don't wish to interact with openkore
## instances, but in most cases... that's exactly the reason why you
## *are* connected to the bus in the first place!
##
use Bus::Client;
#use Bus::SimpleClient;

use Interface::Console;
use Utils qw(parseArgs);

my $port;
if ($ARGV[0]) {
	$port = $ARGV[0];
} else {
	#TODO: make this handle no parameters, look for host/port in
	#/tmp/OpenKore-Bus.info first... if not found, hey, there's no bus
	#loaded, then give an error.

	print STDERR "No server port specified.\n";
	exit 1;
}

##======================================================================
##
## Constants
##
##======================================================================

# Plugin related constants
use constant {
	USERAGENT            => 'bus2db',
	#Will we need to make this a list of authorized clients??
	AUTHORIZED_USERAGENT => 'OpenKore',
	CHARNAME             => 'bus2db'
};

# Bus message related constants.
use constant {
	# Custom bus messages to talk to bus2db.pl plugin:
	# BMC_*
	BMC_MESSAGE     => 'BROADCAST_MSG',
	BMC_REGISTER    => 'B2DB_REGISTER', # sent by db-client to plugins
	BMC_REGISTER_ME => 'B2DB_REGISTER_ME', # reply to above from plugin.
	# Custom messages that should interact with the database:
	BMC_ZENY        => 'B2DB_ZENY',

	# Custom message sub-hash constants:
		#when a LIST_CLIENTS has this SEQ value, we try to register
		#the listed clients to interact with the database.
	BMC_LC_SEQ        => 'f00',

	# Standard bus messages
	# BM_*
	BM_HELLO        => 'HELLO',
	BM_JOIN         => 'JOIN',
	BM_LEAVE        => 'LEAVE',
	BM_LISTCLIENTS  => 'LIST_CLIENTS'

};

# DB Query related constants:
use constant {
	UPDATE_ZENY	=> 'UPDATE Characters SET Zeny = ? WHERE ID = ?' #pass dbCID, zenyamt
};
##======================================================================

print "Connecting to server at port $port\n";
$interface = new Interface::Console;
my $ipc;
my $busID;

use DBI;
use DBD::mysql;

my $dbh; # database handle
my $sth; # SQL transaction handle

=pod
Data structure for storing character info, so it need not be re-passed:
(TODO - this should be... a class?)

hash %Characters
{
	<ConnectionNumber> => { InfoHash }

}

hash %InfoHash
{
#Internal data for this client:
	Authenticated => '1',
		#Is the connection authenticated?
#Data passed from the other client:
	AName	=> 'joeblow',
	AID		=> '12345678',
	CName	=> 'Joe is a thief', $char{name} value.
	CIdx	=> '1', #zero-based indexing 0..N-1 -- $config{char} value
#Data passed from the database, verified by the client's data.
	dbServer	=> '0',
		#Server account is based on, this is from the DB
		#use the AName and AID to determine this.
	dbAID		=> '121',
		#ID field in Accounts table on DB,
		#use the AName, AID to determine this.
	dbCID		=> '4217',
		#ID field in Character table on DB,
		#use the AID, CName to determine this.
}
=cut
#my %Characters = {};
my %Characters;

eval {
	#Start bus client.
	$ipc = new Bus::SimpleClient('localhost', $port);
#	$ipc = new Bus::Client(
#		'host' => 'localhost',
#		'port' => $port,
#		'userAgent' => USERAGENT,
#		'privateOnly' => 0
#	);

	##Start database
	startDB();
	##

	## Testing! run a query before starting up the loop,
	# let's see if the database works.
	$sth = $dbh->prepare("SELECT AccountID, Sum(Zeny) as AcctZeny from Characters group by AccountID");
	$sth->execute();

	my ($acctID, $sumZeny) = $sth->fetchrow();
	print "$acctID $sumZeny\n";
	print "=---------=\n";

	##

	# processng loop -- displays bus messages to screen, and
	# accepts input (a few select commands)
	while (1) {
		my $ID;
		while (my $args = $ipc->readNext(\$ID)) {
			processMessage($ID, $args);
		}

		my $input = $interface->getInput(0.02);
		if ($input) {
			processInput(parseArgs($input));
		}
	}

	## clean up database connections, etc.
	stopDB();
	##
};
if ($@) {
	print STDERR "Error: $@\n";
	exit 1;
}

## startDB
# Starts:
# - connection to mysql
# - sets the proper database
#
sub startDB {
	## Todo - load these settings from file so they're not in the code
	## WARNING - cannot github this project until this sort of thing is
	## isolated out, for security reasons.
	##
	#my $dbHost = 'localhost';
	#my $dsn = "dbi:mysql:koreInventory\@$dbHost";
	my $dsn = "dbi:mysql:koreInventory";
	my $dbUser = 'kore';
	my $dbPass = 'iROrules';
	##

	$dbh = DBI->connect(
		$dsn,
		$dbUser,
		$dbPass,
		{ RaiseError => 1 }
	) or die $DBI::errstr;
	print "-----\n";
	print "Database connected!\n";
} # startDB()

sub runQuery {
	my ($qStr) = @_;

	$sth = $dbh->prepare( $qStr );
	$sth->execute();

	my @result = $sth->fetch();

	#my $result = $sth->fetch();
	$sth->finish();
	return @result;
} # runQuery()

sub stopDB {
	$dbh->disconnect();
}

## void sub processMessage(String <MsgID>, hash of String <Args>)
#
# processMessage handles incoming bus messages.
# sub-messages found may generate outgoing bus messages.
#
# Based on the processMessage routine from test/busclient-test.pl,
# but expanded to:
# - Properly reply to a HELLO message, which allows this client to be
#   identified on the bus, and thus have other perks like being able to
#   receive broadcast messages on the bus.
# - Implements custom bus messages meant to be passed between this
#   database-linked standalone client, and the "bus2db.pl" plugin.
#
# TODO: break out sub-message areas of the ever-growing if-then-else
# logic, so they are separate routines.
##
sub processMessage {
	my ($MsgID, $args) = @_;

	if ($MsgID eq BM_LISTCLIENTS) {
		print "------- Client list --------\n";
		for (my $i = 0; $i < $args->{count}; $i++) {
			printf "%s: %s\n", $args->{"client$i"}, $args->{"clientUserAgent$i"};
		}
		# Handle optional SEQ, if passed back by server.
		print "--\n";
		print "SEQ = $args->{SEQ}\n" if $args->{SEQ};
		print "----------------------------\n";
		#Message from server: LIST_CLIENTS
		#client0        = 57
		#client1        = 33
		#clientUserAgent0 = OpenKore
		#clientUserAgent1 = bus2db
		#count          = 2
		#IRY            = 1		#Unknown - what is this??
		#SEQ            = foo	#Client passed token, so the client can
		#                    	#track responses.  Looks like it was
		#                    	#meant to be for a SEQuence of numbers,
		#                    	#for a history of clients connected.
		#-----------------------

		## Process client list sent after a HELLO reply
		# Enumerate all openkore clients, invite them to register
		# Remember, the SEQ portion of a HELLO reply is optional,
		# check if it exists, then, check if it's the special token.
		if (($args->{SEQ}) && ($args->{SEQ} eq BMC_LC_SEQ)) { #initial/special list-clients,
			for (my $i = 0; $i < $args->{count}; $i++) {
				my $cidx = $args->{"client$i"};
				my $auth = $Characters{$cidx}->{'Authenticated'}; #should be undef if $cidx has no value, otherwise it's 0 or 1.
				if (!$auth) { $auth = ''; }

				if ('1' ne $auth) {
					if ($args->{"clientUserAgent$i"} eq AUTHORIZED_USERAGENT) {
						printf "Sending a reg request to... %s\n", $cidx;
						initCharactersEntry($args->{$cidx});
						$ipc->send( BMC_REGISTER, { 'TO' => $cidx } );
					}
				}
			}
			print "----------------------------\n";
		}
	} elsif ($MsgID eq BMC_REGISTER_ME) {
		print "----------------------------\n";
		print "Register-me received\n";
		print "from client: $args->{FROM}\n";
		print "----------------------------\n";
		#TODO: parse this - we need to register this client now.
		if (($Characters{$args->{FROM}}) && (!$Characters{$args->{FROM}}{Authenticated})) {
			verifyCharactersEntry( $args->{FROM}, $args->{CName}, $args->{CIdx}, $args->{AName}, $args->{AID} );
		}

	} elsif ($MsgID eq BM_HELLO) {
		print "----------------------------\n";
		print "HELLO received\n";
		## Set our busID to 'sign' messages later...
		$busID = $args->{yourID};
		print "You are ID $busID\n";
		print "----------------------------\n";
		$ipc->send(BM_HELLO, { userAgent => USERAGENT, privateOnly => 0 });
		$ipc->send(BM_LISTCLIENTS, { 'SEQ' => 'f00' });
	} elsif ($MsgID eq BM_JOIN) {
		printf "JOIN : %s@%s\n", $args->{name}, $args->{host};
		print "----------------------------\n";
		#Message from server: JOIN
		#host           = 127.0.0.1
		#clientID       = 55
		#name           = OpenKore:55
		#userAgent      = OpenKore
		#-----------------------

		#Insert entry for the given clientID in %Characters if "OpenKore"
		printf "- add caching data for %s\n", $args->{clientID};
		initCharactersEntry($args->{clientID});
		if ($args->{userAgent} eq AUTHORIZED_USERAGENT) {
			$ipc->send( BMC_REGISTER, { 'TO' => $args->{clientID} } );
		}
		print "----------------------------\n";
	} elsif ($MsgID eq BM_LEAVE) {
		my $clientID = $args->{clientID};
		printf "LEAVE: client %s\n", $clientID;
		#Message from server: LEAVE
		#clientID       = 51
		#-----------------------

		#Remove entry for the given clientID in %Characters :
		if ($Characters{$clientID}) {
			printf "- remove cached data for %s\n", $clientID;
			delete $Characters{$clientID};
		}
		print "----------------------------\n";

	#custom bus messages here
	} elsif ($MsgID eq BMC_ZENY) {
		print "Message from server: $MsgID\n";
		my $clientID = $args->{FROM};
		if ($Characters{$clientID}) {
			if ($Characters{$clientID}{Authenticated} == 1) {
				print "Char $clientID is authenticated - send zeny update!\n";
				printf "Query: %s Values( %s, %s )\n", UPDATE_ZENY, $args->{zeny}, $Characters{$clientID}{dbCID};
				#$sql return value = the number of rows affected by the update -- should be always 1 in this case!
				my $sql = $dbh->do(
					'UPDATE Characters SET Zeny = ? WHERE ID = ?', #statement
					undef,
					$args->{zeny}, #first parameter
					$Characters{$clientID}{dbCID} #second parameter
				);
				$DBI::err && die $DBI::errstr;
				print "$sql row(s) updated\n";
				print "----------------------------\n";

			}
		}
		#Message from server: B2DB_ZENY
		#FROM   = 147
		#change = -3500
		#zeny   = 5149540
		#-----------------------

	#no matches, print it out, maybe we need to support it or debug
	} else {
		print "Message from server: $MsgID\n";
		if (ref($args) eq 'HASH') {
			foreach my $key (keys %{$args}) {
				printf "%-14s = %s\n", $key, $args->{$key};
			}
		} else {
			foreach my $entry (@{$args}) { print "$entry\n"; }
		}
		print "-----------------------\n";
	}
}  #processMessage

sub processInput {
	my @args = @_;
	#print "processInput: @args\n";

	if ($_[0] eq "q" || $_[0] eq "quit") {
		exit;

	} elsif ($_[0] eq "s") {
		if (@_ == 4) {
			print "Sending $_[1]: $_[2] = $_[3]\n";
			$ipc->send($_[1], { $_[2] => $_[3] });
		} else {
			print "Usage: s (ID) (KEY) (VALUE)\n";
			print "Send a message to the server.\n";
		}
	} elsif ($_[0] eq "lc") {
		if (@_ > 1) {
			print "send seq: $_[1] \n";
			$ipc->send(
				"LIST_CLIENTS",
				{ 'SEQ' => $_[1] }
			);
		} else {
			$ipc->send("LIST_CLIENTS");
		}
	} elsif ($_[0] eq "bmsg") {
		if (@_ >= 2) {
			shift @args;
			shift @args;
			my $player = $_[1];
			$ipc->send(
				BMC_MESSAGE,
				{
					'player' => $_[1],
					'FromName' => CHARNAME,
					'msg' => "@args"
				}
			);
			print "bMsg sent!\n";
			print "-----------------------\n";
		} else {
			print("Usage: bmsg <all|player name|map name> <command>.\n");
		}
	} else {
		print "Unrecognized command $_[0]\n";
		print "Available commands: bmsg, lc, s, quit\n";
	}
}

## initCharactersEntry(<ClientNum>);
#  Sets initial values for a %Characters entry at hash <ClientNum>
#
#  Set up what we DO know right now, even if it's not fully completely
# populated - we'll wait for the client to "register" with us to get the
# rest.
#
sub initCharactersEntry {
	my $clientID = shift;
	if (!$clientID) { return }
	print $clientID , "\n";
	$Characters{$clientID} = {
			Authenticated => 0,
			Registering   => 1,

			AName         => '',
			AID           => '',
			CName         => '',
			CIdx          => '',

			dbServer      => 0, #hard code for now?...
			dbAID         => '',
			dbCID         => ''
	}
}

## verifyCharactersEntry(<ClientNum>, <CName> <CIdx> <AName> <AID>);
#
# Upon a client registering, we must verify they have a valid entry in the Database.
#
# Called by a subsection of sub processMessage()
# When complete, the %Characters entry at <ClientNum> will have it's
# Authentication key flagged with value = 1, if the client is valid,
# value = 0, (unchanged) if the client did not validate correctly.
#
# The calling function should clear it's entry, if found to be invalid
# after calling this routine.
#
sub verifyCharactersEntry {
	my $clientID = shift; #<ClientNum>
	my $CharactersEntry = $Characters{$clientID};
	$CharactersEntry->{CName} = shift; #<CName>
	$CharactersEntry->{CIdx}  = shift; #<CIdx>;
	$CharactersEntry->{AName} = shift; #<AName>;
	$CharactersEntry->{AID}   = shift; #<AID>;

	print "Char Name: \"$CharactersEntry->{CName}\"\n";
	print "Verifying client... \n";
	print "----------------------------\n";
	#Data entered -- now, let's check if it's valid with the DB:

	#Query1: is the character name/index correct? does it return a row?
	# if the row is returned, the row's (ID and AccountID) is stored in $CharactersEntry
	$sth = $dbh->prepare('SELECT ID, AccountID FROM Characters WHERE Name = ? AND CharIdx = ?');
	$sth->execute(
		$CharactersEntry->{CName},
		$CharactersEntry->{CIdx}
	);

	my $result = $sth->fetchrow_hashref();
	$sth->finish();

	#Check for bad results in query1, return early if so:
	if (!$result) {
		print "Query 1 failed: Name or CharIdx incorrect.\n";
		print "Hint: Check name for typos, and CharIdx is 0-indexed.\n";
		print "---\n";
		return;
	}
	if (!defined($result->{ID})) {
		print "Early Exit Q1.2\n";
		print "---\n";
		return;
	}
	if (!defined($result->{AccountID})) {
		print "Early Exit Q1.3\n";
		print "---\n";
		return;
	}

	$CharactersEntry->{dbCID} = $result->{ID}; #index to Character, in the Characters table.
	$CharactersEntry->{dbAID} = $result->{AccountID}; #index to Account, in the Accounts table.
	undef $result;

	#Query2:
	# the Account name/SID vs the the row that matches the AccountID in the Accounts table.

	$sth = $dbh->prepare('SELECT ID,ServerIdx FROM Accounts WHERE Username = ? AND Number = ?');
	$sth->execute(
		$CharactersEntry->{AName},
		$CharactersEntry->{AID}
	);

	$result = $sth->fetchrow_hashref();
	$sth->finish();

	#Check for bad results in query2
	if (!$result) {
		print "Early Exit Q2.1\n";
		return;
	}
	if (!defined($result->{ID})) {
		print "Early Exit Q2.2\n";
		return;
	}
	if (!defined($result->{ServerIdx})) {
		print "Early Exit Q2.3\n";
		return;
	}
	if ($CharactersEntry->{dbAID} ne $result->{ID}) {
		print "Early Exit Q2.4\n";
		return;
	}

	$CharactersEntry->{dbServer} = $result->{ServerIdx};
	$CharactersEntry->{Authenticated} = 1; # all checks performed: client Authenticated
	print "Client authenticated!\n";
	print "----------------------------\n";
}


text:
<?php
class TiposFormacion extends ActiveRecord
{
    public function NivelDeFormacion($cod)
    {
        $tipo = new TiposFormacion();
        return ($tipo->find_first("id=$cod")->nombre);
    }
}


text:
const express = require('express')
const bodyParser = require('body-parser')
const methodOverride = require('method-override')
const mongoose = require('mongoose')
const restify = require('express-restify-mongoose')
const app = express()
const router = express.Router()
var Drop = require('./models/Drop')
var User = require('./models/User')
var Feed = require('./models/Feed')

var DropOptions = require('./options/Drop')
var UserOptions = require('./options/User')
var FeedOptions = require('./options/Feed')

mongoose.connect('mongodb://localhost:27017/database')
app.use(bodyParser.json())
app.use(require('cookie-parser')())
app.use(methodOverride())

var dropuri = restify.serve(router, Drop, DropOptions)
var useruri = restify.serve(router, User, UserOptions)
var feeduri = restify.serve(router, Feed, FeedOptions)

var DropAPI = require('./api/Drop')
var UserAPI = require('./api/User')
var FeedAPI = require('./api/Feed')
app.use('/api/v1/drops', DropAPI)
app.use('/api/v1/users', UserAPI)
app.use('/api/v1/feed', FeedAPI)

app.use(router)
app.listen(3000, () => {
  console.log('Express server listening on port 3000\n' + dropuri + '\n' + useruri + '\n' + feeduri)
})


text:
package bo.gotthardt.deploy;

import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.Files;
import org.codehaus.plexus.archiver.tar.TarGZipUnArchiver;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.logging.console.ConsoleLogger;
import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * Tests for {@link TarGzArchive}.
 *
 * @author Bo Gotthardt
 */
public class TarGzArchiveTest {
    private File input;
    private File unpackDir;

    @Before
    public void setup() throws IOException {
        input = File.createTempFile("qwerty", ".txt");
        Files.append("test", input, Charsets.UTF_8);
        unpackDir = Files.createTempDir();
        input.deleteOnExit();
        unpackDir.deleteOnExit();
    }

    @Test
    public void shouldCreateTarGzArchiveWithInputFile() throws IOException {
        File output = TarGzArchive.create(ImmutableSet.of(input), "");

        assertThat(output).exists();
        assertThat(output.getName()).endsWith(".tgz");

        List<File> unpackedFiles = unpack(output);

        assertThat(unpackedFiles).hasSize(1);
        assertThat(unpackedFiles.get(0).getName()).isEqualTo(input.getName());
        assertThat(Files.toString(unpackedFiles.get(0), Charsets.UTF_8)).isEqualTo("test");
    }

    @Test
    public void shouldPlaceInputFileInSpecifiedFolder() throws IOException {
        File output = TarGzArchive.create(ImmutableSet.of(input), "testfolder");

        assertThat(output).exists();

        List<File> unpackedFiles = unpack(output);
        File folder = unpackedFiles.get(0);

        assertThat(folder).isDirectory();
        assertThat(folder.getName()).isEqualTo("testfolder");

        List<File> filesInsideFolder = ImmutableList.copyOf(folder.listFiles());

        assertThat(filesInsideFolder).hasSize(1);
        assertThat(filesInsideFolder.get(0).getName()).isEqualTo(input.getName());
    }

    private List<File> unpack(File tgzFile) {
        TarGZipUnArchiver unarchiver = new TarGZipUnArchiver(tgzFile);
        unarchiver.enableLogging(new ConsoleLogger(Logger.LEVEL_DISABLED, "console"));
        unarchiver.setDestDirectory(unpackDir);
        unarchiver.extract();

        return ImmutableList.copyOf(unpackDir.listFiles());
    }
}


text:
package com.amazon.webservices.awsecommerceservice._2011_08_01;

import java.io.Serializable;
import com.leansoft.nano.annotation.*;
import java.util.List;

@RootElement(name = "SavedForLaterItems", namespace = "http://webservices.amazon.com/AWSECommerceService/2011-08-01")
public class SavedForLaterItems implements Serializable {

    private static final long serialVersionUID = -1L;

	@Element(name = "SubTotal")
	@Order(value=0)
	public Price subTotal;

	@Element(name = "SavedForLaterItem")
	@Order(value=1)
	public List<CartItem> savedForLaterItem;

}


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

<title>Constant Field Values</title>
<meta name="date" content="2019-12-28">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Constant Field Values

Contents

org.sbolstandard.*

org.sbolstandard.*

org.sbolstandard.core2.SBOLDocument

Modifier and Type
Constant Field
Value

public static final String
FASTAformat
"FASTA"

public static final String
GENBANK
"GENBANK"

public static final String
GFF3format
"GFF3"

public static final String
JSON
"JSON"

public static final String
RDF
"RDF"

public static final String
RDFV1
"RDFV1"

public static final String
SNAPGENE
"SNAPGENE"

public static final String
TURTLE
"TURTLE"

org.sbolstandard.core2.SBOLReader

Modifier and Type
Constant Field
Value

public static final String
SBOLVERSION1
"v1"

public static final String
SBOLVERSION2
"v2"

org.sbolstandard.core2.TopLevel

Modifier and Type
Constant Field
Value

public static final String
ACTIVITY
"act"

public static final String
AGENT
"agent"

public static final String
ANNOTATION
"anno"

public static final String
ATTACHMENT
"attach"

public static final String
COLLECTION
"col"

public static final String
COMBINATORIAL_DERIVATION
"comb"

public static final String
COMPONENT_DEFINITION
"cd"

public static final String
EXPERIMENT
"expt"

public static final String
EXPERIMENTAL_DATA
"data"

public static final String
GENERIC_TOP_LEVEL
"gen"

public static final String
IMPLEMENTATION
"impl"

public static final String
MODEL
"mod"

public static final String
MODULE_DEFINITION
"md"

public static final String
PLAN
"plan"

public static final String
SEQUENCE
"seq"

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
"""
Symbolic constant support, including collections and constants with text,
numeric, and bit flag values.
"""

__all__ = [
    'NamedConstant', 'ValueConstant', 'FlagConstant',
    'Names', 'Values', 'Flags']

from itertools import count
from operator import and_, or_, xor

_unspecified = object()
_constantOrder = count().next

class _Constant(object):
    """
    @ivar _index: A C{int} allocated from a shared counter in order to keep
        track of the order in which L{_Constant}s are instantiated.

    @ivar name: A C{str} giving the name of this constant; only set once the
        constant is initialized by L{_ConstantsContainer}.

    @ivar _container: The L{_ConstantsContainer} subclass this constant belongs
        to; only set once the constant is initialized by that subclass.
    """
    def __init__(self):
        self._index = _constantOrder()

    def __get__(self, oself, cls):
        """
        Ensure this constant has been initialized before returning it.
        """
        cls._initializeEnumerants()
        return self

    def __repr__(self):
        """
        Return text identifying both which constant this is and which collection
        it belongs to.
        """
        return "<%s=%s>" % (self._container.__name__, self.name)

    def _realize(self, container, name, value):
        """
        Complete the initialization of this L{_Constant}.

        @param container: The L{_ConstantsContainer} subclass this constant is
            part of.

        @param name: The name of this constant in its container.

        @param value: The value of this constant; not used, as named constants
            have no value apart from their identity.
        """
        self._container = container
        self.name = name

class _EnumerantsInitializer(object):
    """
    L{_EnumerantsInitializer} is a descriptor used to initialize a cache of
    objects representing named constants for a particular L{_ConstantsContainer}
    subclass.
    """
    def __get__(self, oself, cls):
        """
        Trigger the initialization of the enumerants cache on C{cls} and then
        return it.
        """
        cls._initializeEnumerants()
        return cls._enumerants

class _ConstantsContainer(object):
    """
    L{_ConstantsContainer} is a class with attributes used as symbolic
    constants.  It is up to subclasses to specify what kind of constants are
    allowed.

    @cvar _constantType: Specified by a L{_ConstantsContainer} subclass to
        specify the type of constants allowed by that subclass.

    @cvar _enumerantsInitialized: A C{bool} tracking whether C{_enumerants} has
        been initialized yet or not.

    @cvar _enumerants: A C{dict} mapping the names of constants (eg
        L{NamedConstant} instances) found in the class definition to those
        instances.  This is initialized via the L{_EnumerantsInitializer}
        descriptor the first time it is accessed.
    """
    _constantType = None

    _enumerantsInitialized = False
    _enumerants = _EnumerantsInitializer()

    def __new__(cls):
        """
        Classes representing constants containers are not intended to be
        instantiated.

        The class object itself is used directly.
        """
        raise TypeError("%s may not be instantiated." % (cls.__name__,))

    def _initializeEnumerants(cls):
        """
        Find all of the L{NamedConstant} instances in the definition of C{cls},
        initialize them with constant values, and build a mapping from their
        names to them to attach to C{cls}.
        """
        if not cls._enumerantsInitialized:
            constants = []
            for (name, descriptor) in cls.__dict__.iteritems():
                if isinstance(descriptor, cls._constantType):
                    constants.append((descriptor._index, name, descriptor))
            enumerants = {}
            constants.sort()
            for (index, enumerant, descriptor) in constants:
                value = cls._constantFactory(enumerant, descriptor)
                descriptor._realize(cls, enumerant, value)
                enumerants[enumerant] = descriptor
            # Replace the _enumerants descriptor with the result so future
            # access will go directly to the values.  The _enumerantsInitialized
            # flag is still necessary because NamedConstant.__get__ may also
            # call this method.
            cls._enumerants = enumerants
            cls._enumerantsInitialized = True
    _initializeEnumerants = classmethod(_initializeEnumerants)

    def _constantFactory(cls, name, descriptor):
        """
        Construct the value for a new constant to add to this container.

        @param name: The name of the constant to create.

        @return: L{NamedConstant} instances have no value apart from identity,
            so return a meaningless dummy value.
        """
        return _unspecified
    _constantFactory = classmethod(_constantFactory)

    def lookupByName(cls, name):
        """
        Retrieve a constant by its name or raise a C{ValueError} if there is no
        constant associated with that name.

        @param name: A C{str} giving the name of one of the constants defined by
            C{cls}.

        @raise ValueError: If C{name} is not the name of one of the constants
            defined by C{cls}.

        @return: The L{NamedConstant} associated with C{name}.
        """
        if name in cls._enumerants:
            return getattr(cls, name)
        raise ValueError(name)
    lookupByName = classmethod(lookupByName)

    def iterconstants(cls):
        """
        Iteration over a L{Names} subclass results in all of the constants it
        contains.

        @return: an iterator the elements of which are the L{NamedConstant}
            instances defined in the body of this L{Names} subclass.
        """
        constants = cls._enumerants.values()
        constants.sort(key=lambda descriptor: descriptor._index)
        return iter(constants)
    iterconstants = classmethod(iterconstants)

class NamedConstant(_Constant):
    """
    L{NamedConstant} defines an attribute to be a named constant within a
    collection defined by a L{Names} subclass.

    L{NamedConstant} is only for use in the definition of L{Names}
    subclasses.  Do not instantiate L{NamedConstant} elsewhere and do not
    subclass it.
    """

class Names(_ConstantsContainer):
    """
    A L{Names} subclass contains constants which differ only in their names and
    identities.
    """
    _constantType = NamedConstant

class ValueConstant(_Constant):
    """
    L{ValueConstant} defines an attribute to be a named constant within a
    collection defined by a L{Values} subclass.

    L{ValueConstant} is only for use in the definition of L{Values} subclasses.
    Do not instantiate L{ValueConstant} elsewhere and do not subclass it.
    """
    def __init__(self, value):
        _Constant.__init__(self)
        self.value = value

class Values(_ConstantsContainer):
    """
    A L{Values} subclass contains constants which are associated with arbitrary
    values.
    """
    _constantType = ValueConstant

    def lookupByValue(cls, value):
        """
        Retrieve a constant by its value or raise a C{ValueError} if there is no
        constant associated with that value.

        @param value: The value of one of the constants defined by C{cls}.

        @raise ValueError: If C{value} is not the value of one of the constants
            defined by C{cls}.

        @return: The L{ValueConstant} associated with C{value}.
        """
        for constant in cls.iterconstants():
            if constant.value == value:
                return constant
        raise ValueError(value)
    lookupByValue = classmethod(lookupByValue)

def _flagOp(op, left, right):
    """
    Implement a binary operator for a L{FlagConstant} instance.

    @param op: A two-argument callable implementing the binary operation.  For
        example, C{operator.or_}.

    @param left: The left-hand L{FlagConstant} instance.
    @param right: The right-hand L{FlagConstant} instance.

    @return: A new L{FlagConstant} instance representing the result of the
        operation.
    """
    value = op(left.value, right.value)
    names = op(left.names, right.names)
    result = FlagConstant()
    result._realize(left._container, names, value)
    return result

class FlagConstant(_Constant):
    """
    L{FlagConstant} defines an attribute to be a flag constant within a
    collection defined by a L{Flags} subclass.

    L{FlagConstant} is only for use in the definition of L{Flags} subclasses.
    Do not instantiate L{FlagConstant} elsewhere and do not subclass it.
    """
    def __init__(self, value=_unspecified):
        _Constant.__init__(self)
        self.value = value

    def _realize(self, container, names, value):
        """
        Complete the initialization of this L{FlagConstant}.

        This implementation differs from other C{_realize} implementations in
        that a L{FlagConstant} may have several names which apply to it, due to
        flags being combined with various operators.

        @param container: The L{Flags} subclass this constant is part of.

        @param names: When a single-flag value is being initialized, a C{str}
            giving the name of that flag.  This is the case which happens when a
            L{Flags} subclass is being initialized and L{FlagConstant} instances
            from its body are being realized.  Otherwise, a C{set} of C{str}
            giving names of all the flags set on this L{FlagConstant} instance.
            This is the case when two flags are combined using C{|}, for
            example.
        """
        if isinstance(names, str):
            name = names
            names = set([names])
        elif len(names) == 1:
            (name,) = names
        else:
            name = "{" + ",".join(sorted(names)) + "}"
        _Constant._realize(self, container, name, value)
        self.value = value
        self.names = names

    def __or__(self, other):
        """
        Define C{|} on two L{FlagConstant} instances to create a new
        L{FlagConstant} instance with all flags set in either instance set.
        """
        return _flagOp(or_, self, other)

    def __and__(self, other):
        """
        Define C{&} on two L{FlagConstant} instances to create a new
        L{FlagConstant} instance with only flags set in both instances set.
        """
        return _flagOp(and_, self, other)

    def __xor__(self, other):
        """
        Define C{^} on two L{FlagConstant} instances to create a new
        L{FlagConstant} instance with only flags set on exactly one instance
        set.
        """
        return _flagOp(xor, self, other)

    def __invert__(self):
        """
        Define C{~} on a L{FlagConstant} instance to create a new
        L{FlagConstant} instance with all flags not set on this instance set.
        """
        result = FlagConstant()
        result._realize(self._container, set(), 0)
        for flag in self._container.iterconstants():
            if flag.value & self.value == 0:
                result |= flag
        return result

class Flags(Values):
    """
    A L{Flags} subclass contains constants which can be combined using the
    common bitwise operators (C{|}, C{&}, etc) similar to a I{bitvector} from a
    language like C.
    """
    _constantType = FlagConstant

    _value = 1

    def _constantFactory(cls, name, descriptor):
        """
        For L{FlagConstant} instances with no explicitly defined value, assign
        the next power of two as its value.
        """
        if descriptor.value is _unspecified:
            value = cls._value
            cls._value <<= 1
        else:
            value = descriptor.value
            cls._value = value << 1
        return value
    _constantFactory = classmethod(_constantFactory)


text:
const extractScenes = require('./extractScenes');
const bechdelResults = require('./BechdelResults');
const movieScript = require('../__mocks__/mock-boyhood');

describe('extractScenes', () => {
	beforeEach(() => {
		bechdelResults.reset();
	});
	it('should return a function', () => {
		expect(typeof extractScenes).toBe('function');
	});

	it('should return an array of scenes', () => {
		const scenes = extractScenes(movieScript);
		const scene1 = scenes[0];
		const expectedScene1 = `BOYHOOD
Written by Richard Linklater
Boyhood Inc.
1901 E. 51st Street
Austin, TX 78723
512.322.0031
`;
		expect(scene1).toBe(expectedScene1);
		const scene2 = scenes[2];
		const expectedScene2 = `INT. CAR - DAY Driving...
MOM
So how was your day at school?
Fine.
MASON
MOM
Hey, I had a good meeting with Miss
Butler this time. I kinda liked her.
MASON What did she say?
MOM
Well... she said that you weren't
turning in your homework assignments. And I told her, "I know he does them, 'cause I check them every night." She said she found a big chunk of them crumpled up at the bottom of your backpack.
MASON
She didn't ask for 'em.
MOM
Well, baby, she doesn't have to.
You're supposed to turn them in. And she said you're still staring out the window all day.
MASON Not all day.
MOM
And she said that you destroyed her
pencil sharpener.
MASON Not on purpose.
MOM
Wait, she said that you crammed a
bunch of rocks in it.
MASON
I thought if it could sharpen pencils,
maybe we could sharpen rocks.
MOM (stifling laugh)
Well, what were you gonna do with a bunch of sharpened rocks?
MASON
I was trying to make arrowheads for
my rock collection.
MOM
Hm.
`;
		expect(scene2).toBe(expectedScene2);
	});
});


text:
//FileName: require-config.js
//Configuring the initial required modules to load the app and respective paths
var ImgServer ="backbone/js";
var domainUrl = window.location.protocol+"//"+window.location.host + "/";
var ImageServerUrl = img_domain+"/js";
require.config({
    "baseUrl": ImageServerUrl,
    "tplBasePath": domainUrl + "templates/",
    "cssBasePath": domainUrl + "css/",
    "paths": {
        // Libraries.
        "modernizr": "libs/modernizr",
        "text": "libs/text",
        /* TODO: change jquery url to image server */
        "jquery":"libs/jquery",
        "bootstrap":"libs/bootstrap",
        "underscore": "libs/underscore",
        "backbone": "libs/backbone",
        "hammer": "libs/jquery.hammer.min",
        "lazy": "helpers/lazy.require",
        "lazyLoader": "helpers/lazy.loader",
        "jcookie": "libs/jquery.cookie",
        "validator" : "libs/validator_minified",

        // Helper Script and App JS Files.
        "Seva": "helpers/seva.helper",
        "mixin": "helpers/underscore.mixin",
        "tpl": "helpers/text.tpl",
        "views":"views",
        "view": "views/common/view",
        "page": "views/common/page",
        "model": "models/base/base.model",
        "collection": "collections/common/base.collection",
        "controllers": "controllers",
        "toolbox": "helpers/toolbox",
        "templates":"../templates"

    },

    //Sets the configuration for third party
    //scripts that are not AMD compatible
    shim: {

        "underscore": {
            "exports": "_"
        },

        "mixin": {
            "deps": ["underscore"],
            "exports": "_mixin"
        },

        "backbone": {
            "deps": ["underscore", "jquery"],
            "exports": "Backbone"
        },

        "toolbox": {
            "deps": ["underscore"],
            "exports": "Toolbox"
        },

        //seva.helper
        "seva.helper": {
            "deps": ["jquery", "backbone", "bootstrap-tooltip", "bootstrap-popopover", "bootstrap-modal"],
            "exports": "Seva"
        },

        //modernizr
        "modernizr": {
            "exports": "Modernizr"
        },

        "hammer": {
            "deps": ["jquery"],
            "exports": "Hammer"
        },
        "bootstrap":{
            "deps": ["jquery"]
        }
    }

});

require(['app'],function(App){
	if ($("#botend").length == 0) {
		App.initialize();
	}
});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Shop Homepage - Start Bootstrap Template</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bootstrap.css') }}">

  <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='shop-homepage.css') }}">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Start Bootstrap

                        About

                        Services

                        Contact

Shop Name

                    Category 1
                    Category 2
                    Category 3

$24.99

First Product

See more snippets like this online store item at Bootsnipp - http://bootsnipp.com.

15 reviews

$64.99

Second Product

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

12 reviews

$74.99

Third Product

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

31 reviews

$84.99

Fourth Product

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

6 reviews

$94.99

Fifth Product

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

18 reviews

Like this template?

If you like this template, then check out this tutorial on how to build a working review system for your online store!

                        View Tutorial

Copyright © Your Website 2014


text:
//
//  Copyright 2011-2013, Xamarin Inc.
//
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.
//

using Geolocator.Plugin.Abstractions;
using System;
using System.Device.Location;
using System.Threading;
using System.Threading.Tasks;

namespace Geolocator.Plugin
{
  internal class SinglePositionListener
  {
    internal SinglePositionListener(double accuracy, int timeout, CancellationToken cancelToken)
    {
      cancelToken.Register(HandleTimeout, true);
      this.desiredAccuracy = accuracy;
      this.start = DateTime.Now;
      this.timeout = timeout;

      System.Threading.Tasks.Task.Factory.StartNew(() =>
      {
        this.watcher = new GeoCoordinateWatcher(GeolocatorImplementation.GetAccuracy(accuracy));
        this.watcher.PositionChanged += WatcherOnPositionChanged;
        this.watcher.StatusChanged += WatcherOnStatusChanged;

        this.watcher.Start();
      });

      if (timeout != Timeout.Infinite)
        this.timer = new Timer(HandleTimeout, null, timeout, Timeout.Infinite);

      Task.ContinueWith(Cleanup);
    }

    public Task<Position> Task
    {
      get { return this.tcs.Task; }
    }

    private GeoPosition<GeoCoordinate> bestPosition;
    private GeoCoordinateWatcher watcher;
    private readonly double desiredAccuracy;
    private readonly DateTimeOffset start;
    private readonly Timer timer;
    private readonly int timeout;
    private readonly TaskCompletionSource<Position> tcs = new TaskCompletionSource<Position>();

    private void Cleanup(Task task)
    {
      this.watcher.PositionChanged -= WatcherOnPositionChanged;
      this.watcher.StatusChanged -= WatcherOnStatusChanged;

      this.watcher.Stop();
      this.watcher.Dispose();

      if (this.timer != null)
        this.timer.Dispose();
    }

    private void HandleTimeout(object state)
    {
      if (state != null && (bool)state)
        this.tcs.TrySetCanceled();

      if (this.bestPosition != null)
        this.tcs.TrySetResult(GeolocatorImplementation.GetPosition(this.bestPosition));
      else
        this.tcs.TrySetCanceled();
    }

    private void WatcherOnStatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
    {
      switch (e.Status)
      {
        case GeoPositionStatus.NoData:
          this.tcs.TrySetException(new GeolocationException(GeolocationError.PositionUnavailable));
          break;

        case GeoPositionStatus.Disabled:
          this.tcs.TrySetException(new GeolocationException(GeolocationError.Unauthorized));
          break;
      }
    }

    private void WatcherOnPositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
    {
      if (e.Position.Location.IsUnknown)
        return;

      bool isRecent = timeout == Timeout.Infinite || (e.Position.Timestamp - this.start).TotalMilliseconds < this.timeout;

      if (e.Position.Location.HorizontalAccuracy <= this.desiredAccuracy && isRecent)
        this.tcs.TrySetResult(GeolocatorImplementation.GetPosition(e.Position));

      if (this.bestPosition == null || e.Position.Location.HorizontalAccuracy < this.bestPosition.Location.HorizontalAccuracy)
        this.bestPosition = e.Position;
    }
  }
}


text:
typedef NS_ENUM(NSInteger, SettingType)
{
    SettingTypeOnlyText = 0,
    SettingTypeFolderName,
    SettingTypeNewFolderName,
    SettingTypeFileVersionRemark,
    SettingTypeFileName
};

@interface XIU_SettingTextViewController : XIU_HiddenTabBarController<UITableViewDataSource, UITableViewDelegate>

@property (copy, nonatomic) void(^doneBlock)(NSString *textValue);
@property (strong, nonatomic) NSString *textValue, *placeholderStr;
@property (assign, nonatomic) SettingType settingType;

+ (instancetype)settingTextVCWithTitle:(NSString *)title textValue:(NSString *)textValue doneBlock:(void(^)(NSString *textValue))block;
@end


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

include_once 'PorterStemmer.php';

class Preprocessing {

	protected $this;

	public function render(){

	}
	public function pemecah_kalimat($text){

        $pecah      = explode(".",$text);
        return $pecah;

    }
	public function casefolding($text){
        $input = preg_replace('@[?:;,+=|!~#()0-9]+@', "", strtolower($text));//("@[^\d:,]+@i"," ",strtolower($value));
        return $input;
    }

	public function tokenizing($text){

        $pecah = explode('.', $text);

        foreach ($pecah as $key => $values) {
            $response[] =  $values;
        }
        return $response;
    }

    public function filtering($kalimat){
        /*menghilangkan array yang sama*/
        $data = $this->tokenizing($kalimat);
        foreach ($data as $key => $value) {

            $index_array = $this->array_empty_remover($value);

            //$uniq =  array_unique($index_array);

            $filtering[]  = $$index_array; //array_merge($uniq);

        }

        return $filtering;

    }
    public function stopword($array_kalimat,$array_stopword){

        return str_ireplace($array_stopword, "", $array_kalimat);
    }

    public function array_empty_remover($array, $remove_null_number = true) {
        $array_remove =  array(
            "yang",
            "dan",

        );
    }
    public function stemming($word){

    	/*$stem = PorterStemmer::Stem($word);
    	return $stem;*/
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="main.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>

                    Driving Safely in Work Zones

You've seen the orange cones and barrels in Maryland's roadway work zones. You've probably seen our highway workers, too. They're out on the road every day mowing, repairing pot holes and repaiting roads and bridges - making our State safe for you and your family

                    Pedestrian and Bicycle Safety

We're on the road together, expect and respect is the theme of SHA's new bicycle safety education effort geared to both drivers and bicyclists.

                    Drive Safely Work Week

To help reduce motor vehicle crashes, the Maryland State Highway Administration (SHA) and partners are proud to join with the Network of Employers for Traffic Safety (NETS) in support of their annual Drive Safely Work Week (DSWW) recognition.


text:
package org.apereo.cas.otp.repository.token;

import com.github.benmanes.caffeine.cache.LoadingCache;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.Collection;

/**
 * This is {@link CachingOneTimeTokenRepository}.
 *
 * @author Misagh Moayyed
 * @since 5.1.0
 */
@Slf4j
@AllArgsConstructor
public class CachingOneTimeTokenRepository extends BaseOneTimeTokenRepository {
    private final LoadingCache<String, Collection<OneTimeToken>> storage;

    @Override
    public void cleanInternal() {
        LOGGER.debug("Beginning to clean up the cache storage to remove expiring tokens");
        this.storage.cleanUp();
        LOGGER.debug("Estimated total of [{}] token(s) remain in the cache and may be removed in future iterations", this.storage.estimatedSize());
    }

    @Override
    public void store(final OneTimeToken token) {
        if (exists(token.getUserId(), token.getToken())) {
            try {
                final Collection<OneTimeToken> tokens = this.storage.get(token.getUserId());
                tokens.add(token);

                LOGGER.debug("Storing previously used tokens [{}] for user [{}]", tokens, token.getUserId());
                this.storage.put(token.getUserId(), tokens);
            } catch (final Exception e) {
                LOGGER.warn(e.getMessage(), e);
            }
        } else {
            final Collection<OneTimeToken> tokens = new ArrayList<>();
            tokens.add(token);

            LOGGER.debug("Storing previously used token [{}] for user [{}]", token, token.getUserId());
            this.storage.put(token.getUserId(), tokens);
        }
    }

    @Override
    public OneTimeToken get(final String uid, final Integer otp) {
        try {
            final Collection<OneTimeToken> tokens = this.storage.getIfPresent(uid);
            LOGGER.debug("Found used tokens [{}]", tokens);
            if (tokens != null) {
                return tokens
                        .stream()
                        .filter(t -> t.getToken().equals(otp))
                        .findFirst()
                        .orElse(null);
            }
        } catch (final Exception e) {
            LOGGER.warn(e.getMessage(), e);
        }
        return null;
    }
}


text:
(function(){

  arbor = (typeof(arbor)!=='undefined') ? arbor : {}
  $.extend(arbor, {
    // object constructors (don't use 'new', just call them)
    ParticleSystem:ParticleSystem,
    Tween:Tween,
    Point:function(x, y){ return new Point(x, y) },
    Graphics:function(canvas){ return Graphics(canvas) },

    // immutable objects with useful methods
    colors:{
      CSS:Colors.CSS,           // {colorname:#fef2e2,...}
      validate:Colors.validate, // ƒ(str) -> t/f
      decode:Colors.decode,     // ƒ(hexString_or_cssColor) -> {r,g,b,a}
      encode:Colors.encode,     // ƒ({r,g,b,a}) -> hexOrRgbaString
      blend:Colors.blend        // ƒ(color, opacity) -> rgbaString
    },
    etc:{
      trace:trace,              // ƒ(msg) -> safe console logging
      dirname:dirname,          // ƒ(path) -> leading part of path
      basename:basename,        // ƒ(path) -> trailing part of path
      ordinalize:ordinalize,    // ƒ(num) -> abbrev integers (and add commas)
      objcopy:objcopy,          // ƒ(old) -> clone an object
      objcmp:objcmp,            // ƒ(a, b, strict_ordering) -> t/f comparison
      objkeys:objkeys,          // ƒ(obj) -> array of all keys in obj
      objmerge:objmerge,        // ƒ(dst, src) -> like $.extend but non-destructive
      uniq:uniq,                // ƒ(arr) -> array of unique items in arr
      arbor_path:arbor_path,    // ƒ() -> guess the directory of the lib code
    }
  })

})()


text:
package org.apache.beam.runners.portability;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

import org.apache.beam.model.fnexecution.v1.BeamFnApi.StartWorkerRequest;
import org.apache.beam.model.fnexecution.v1.BeamFnApi.StartWorkerResponse;
import org.apache.beam.model.fnexecution.v1.BeamFnApi.StopWorkerRequest;
import org.apache.beam.model.fnexecution.v1.BeamFnApi.StopWorkerResponse;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.vendor.grpc.v1p36p0.io.grpc.stub.StreamObserver;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public class ExternalWorkerServiceTest {

  @Test
  public void startWorker() {
    PipelineOptions options = PipelineOptionsFactory.create();
    StartWorkerRequest request = StartWorkerRequest.getDefaultInstance();
    StreamObserver<StartWorkerResponse> responseObserver = mock(StreamObserver.class);
    ExternalWorkerService service = new ExternalWorkerService(options);
    service.startWorker(request, responseObserver);

    verify(responseObserver).onNext(any(StartWorkerResponse.class));
    verify(responseObserver).onCompleted();
  }

  @Test
  public void stopWorker() {
    PipelineOptions options = PipelineOptionsFactory.create();
    StopWorkerRequest request = StopWorkerRequest.getDefaultInstance();
    StreamObserver<StopWorkerResponse> responseObserver = mock(StreamObserver.class);
    ExternalWorkerService service = new ExternalWorkerService(options);
    service.stopWorker(request, responseObserver);

    verify(responseObserver).onNext(any(StopWorkerResponse.class));
    verify(responseObserver).onCompleted();
  }
}


text:
<?php
/**
 * Yii bootstrap file.
 * Used for enhanced IDE code autocompletion.
 */
class Yii extends \yii\BaseYii
{
    /**
     * @var BaseApplication|WebApplication|ConsoleApplication the application instance
     */
    public static $app;
}

spl_autoload_register(['Yii', 'autoload'], true, true);
Yii::$classMap = include(__DIR__ . '/../vendor/yiisoft/yii2/classes.php');
Yii::$container = new yii\di\Container;

/**
 * Class BaseApplication
 * Used for properties that are identical for both WebApplication and ConsoleApplication
 * @property yii\redis\Connection $redis
 * @property app\common\components\wechat\CustomWechat $wechat
 * @property app\common\components\salesforce\LkkCrmComponent $lkkCrmService
 */
abstract class BaseApplication extends yii\base\Application
{
}

/**
 * Class WebApplication
 * Include only Web application related components here
 * @property app\common\components\CustomWechat $wechat
 */
class WebApplication extends yii\web\Application
{
}

/**
 * Class ConsoleApplication
 * Include only Console application related components here
 * @property app\common\components\CustomWechat $wechat
 */
class ConsoleApplication extends yii\console\Application
{
}


text:
//Write a program that reads two positive integer numbers and prints
//how many numbers p exist between them such that the reminder of the division
// by 5 is 0 (inclusive). Example: p(17,25) = 2.

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

class TwoNumbers
{
    static void Main(string[] args)
    {
        Console.WriteLine("Please enter the first number: ");
        int number1 = int.Parse(Console.ReadLine());
        Console.WriteLine("Please enter the second number: ");
        int number2 = int.Parse(Console.ReadLine());
        int p = 0;
        for (int i = number1; i <= number2; i++)
        {
            if (i % 5 == 0) //checking if the current number can be divided by 5 without a remainder
            {
                p = p + 1;
            }
        }
        Console.WriteLine(p);

    }
}


text:
package com.myjavaworld.jftp;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.MessageFormat;
import java.util.ResourceBundle;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.JSeparator;
import javax.swing.SwingConstants;
import javax.swing.Timer;

import com.myjavaworld.gui.MButton;
import com.myjavaworld.gui.MDialog;
import com.myjavaworld.gui.MLabel;
import com.myjavaworld.util.CommonResources;
import com.myjavaworld.util.ResourceLoader;
import com.myjavaworld.util.SystemUtil;

/**
 *
 *
 */
public class AboutDlg extends MDialog implements ActionListener {

	private static ResourceBundle resources = ResourceLoader
			.getBundle("com.myjavaworld.jftp.AboutDlg");
	private static final String CREDITS_HELP_ID = "credits";
	private MLabel labTotalMemory = null;
	private MLabel labAvailableMemory = null;
	private MLabel labUsedMemory = null;
	private MButton butClose = null;
	private MButton butReleaseMemory = null;
	private MButton butCredits = null;
	private Timer timer = null;

	public AboutDlg(Frame parent) {
		super(parent, resources.getString("title.dialog"), false);
		getAccessibleContext().setAccessibleDescription("dialog.description");
		initComponents();
		pack();
	}

	public void actionPerformed(ActionEvent evt) {
		if (evt.getSource() == butClose) {
			timer.stop();
			dispose();
			System.gc();
		} else if (evt.getSource() == butReleaseMemory) {
			System.gc();
		} else if (evt.getSource() == timer) {
			recalculateMemory();
		}
	}

	@Override
	protected void escape() {
		butClose.doClick();
	}

	private void recalculateMemory() {
		long totalMemory = Runtime.getRuntime().totalMemory();
		totalMemory = (totalMemory + 1023) / 1024;
		long availableMemory = Runtime.getRuntime().freeMemory();
		availableMemory = (availableMemory + 1023) / 1024;
		labTotalMemory.setText(totalMemory + " KB");
		labAvailableMemory.setText(availableMemory + " KB");
		labUsedMemory.setText((totalMemory - availableMemory) + " KB");
	}

	private void initComponents() {
		getContentPane().setLayout(new GridBagLayout());
		GridBagConstraints c = new GridBagConstraints();
		c.anchor = GridBagConstraints.WEST;

		c.gridx = 0;
		c.gridy = 0;
		c.gridwidth = 2;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(12, 12, 12, 12);
		MessageFormat mf = new MessageFormat(
				resources.getString("text.productInfo"));
		String[] mfArgs = { JFTPConstants.PRODUCT_NAME,
				JFTPConstants.PRODUCT_VERSION, JFTPConstants.PRODUCT_BUILD,
				JFTPConstants.COMPANY_NAME, JFTPConstants.PRODUCT_WEBSITE,
				JFTPConstants.SUPPORT_EMAIL };
		String productInfo = mf.format(mfArgs);
		MLabel labProductName = new MLabel(productInfo, SwingConstants.CENTER);
		Icon logoIcon = JFTPUtil.getIcon("jftp32.gif");
		labProductName.setIcon(logoIcon);
		labProductName.setIconTextGap(20);
		getContentPane().add(labProductName, c);

		c.gridx = 0;
		c.gridy = 1;
		c.gridwidth = 2;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(new JSeparator(SwingConstants.HORIZONTAL), c);

		c.gridx = 0;
		c.gridy = 2;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(new MLabel(resources.getString("text.osName")), c);

		c.gridx = 1;
		c.gridy = 2;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 0, 12, 12);
		getContentPane().add(new MLabel(SystemUtil.getOSName()), c);

		c.gridx = 0;
		c.gridy = 3;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(new MLabel(resources.getString("text.osVersion")),
				c);

		c.gridx = 1;
		c.gridy = 3;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 0, 12, 12);
		getContentPane().add(new MLabel(SystemUtil.getOSVersion()), c);

		c.gridx = 0;
		c.gridy = 4;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(
				new MLabel(resources.getString("text.jreVersion")), c);

		c.gridx = 1;
		c.gridy = 4;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 0, 12, 12);
		getContentPane().add(new MLabel(SystemUtil.getJREVersion()), c);

		c.gridx = 0;
		c.gridy = 5;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(new MLabel(resources.getString("text.jreVendor")),
				c);

		c.gridx = 1;
		c.gridy = 5;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 0, 12, 12);
		getContentPane().add(new MLabel(SystemUtil.getJREVendor()), c);

		c.gridx = 0;
		c.gridy = 6;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(new MLabel(resources.getString("text.userHome")),
				c);

		c.gridx = 1;
		c.gridy = 6;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 0, 12, 12);
		getContentPane().add(new MLabel(SystemUtil.getUserHome()), c);

		c.gridx = 0;
		c.gridy = 7;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(
				new MLabel(resources.getString("text.totalMemory")), c);

		c.gridx = 1;
		c.gridy = 7;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 0, 12, 12);
		long totalMemory = Runtime.getRuntime().totalMemory();
		totalMemory = (totalMemory + 1023) / 1024;
		labTotalMemory = new MLabel(totalMemory + " KB");
		getContentPane().add(labTotalMemory, c);

		c.gridx = 0;
		c.gridy = 8;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(
				new MLabel(resources.getString("text.availableMemory")), c);

		c.gridx = 1;
		c.gridy = 8;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 0, 12, 12);
		long availableMemory = Runtime.getRuntime().freeMemory();
		availableMemory = (availableMemory + 1023) / 1024;
		labAvailableMemory = new MLabel(availableMemory + " KB");
		getContentPane().add(labAvailableMemory, c);

		c.gridx = 0;
		c.gridy = 9;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 12, 12, 12);
		getContentPane().add(
				new MLabel(resources.getString("text.usedMemory")), c);

		c.gridx = 1;
		c.gridy = 9;
		c.gridwidth = 1;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.HORIZONTAL;
		c.insets = new Insets(0, 0, 12, 12);
		long usedMemory = totalMemory - availableMemory;
		labUsedMemory = new MLabel(usedMemory + " KB");
		getContentPane().add(labUsedMemory, c);

		c.gridx = 0;
		c.gridy = 10;
		c.gridwidth = 2;
		c.gridheight = 1;
		c.weightx = 1.0;
		c.weighty = 1.0;
		c.fill = GridBagConstraints.BOTH;
		c.insets = new Insets(0, 0, 0, 0);
		getContentPane().add(new MLabel(), c);

		c.gridx = 0;
		c.gridy = 11;
		c.gridwidth = 2;
		c.gridheight = 1;
		c.weightx = 0.0;
		c.weightx = 0.0;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = GridBagConstraints.NONE;
		c.insets = new Insets(6, 12, 12, 12);
		c.anchor = GridBagConstraints.EAST;
		getContentPane().add(getCommandButtons(), c);

		timer = new Timer(1000, this);
		timer.start();
	}

	private Component getCommandButtons() {
		Box panel = new Box(BoxLayout.X_AXIS);
		butClose = new MButton(CommonResources.getString("text.close"));
		butClose.addActionListener(this);
		getRootPane().setDefaultButton(butClose);

		butCredits = new MButton(resources.getString("text.credits"));
		JFTPHelp2.getInstance().enableHelp(butCredits, CREDITS_HELP_ID);

		butReleaseMemory = new MButton(
				resources.getString("text.releaseMemory"));
		butReleaseMemory.addActionListener(this);

		panel.add(butClose);
		panel.add(Box.createRigidArea(new Dimension(5, 0)));
		panel.add(butCredits);
		panel.add(Box.createRigidArea(new Dimension(5, 0)));
		panel.add(butReleaseMemory);

		return panel;
	}
}


text:
<?php

namespace ZEDx\Events\Subscription;

use Illuminate\Queue\SerializesModels;
use ZEDx\Events\Event;
use ZEDx\Models\Subscription;

class SubscriptionEvent extends Event
{
    use SerializesModels;

    /**
     * Subscription model.
     *
     * @var Subscription
     */
    public $subscription;

    /**
     * Create a new event instance.
     *
     * @param \ZEDx\Models\Subscription $subscription
     *
     * @return void
     */
    public function __construct(Subscription $subscription)
    {
        $this->subscription = $subscription;
    }
}


text:
<!DOCTYPE html>

<title>AddressBook_add_nameField_partSet</title>


text:
#ifndef __ASM_HARDIRQ_H
#define __ASM_HARDIRQ_H

#include <linux/threads.h>
#include <linux/cache.h>

typedef struct {
	unsigned int __softirq_pending;
} ____cacheline_aligned irq_cpustat_t;

#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */

void ack_bad_irq(unsigned int irq);

#define HARDIRQ_BITS	8

/*
 * The hardirq mask has to be large enough to have
 * space for potentially all IRQ sources in the system
 * nesting on a single CPU:
 */
#if (1 << HARDIRQ_BITS) < NR_IRQS
# error HARDIRQ_BITS is too low!
#endif

#endif /* __ASM_HARDIRQ_H */


text:
class Specinfra::Command::Base::KernelModule < Specinfra::Command::Base
end


text:
using System.Runtime.Serialization;

namespace HarmonyHub.Entities.Auth
{
    /// <summary>
    ///     Result of call to myharmony.com web service.
    ///     AccountId is always (so far) 0.
    /// </summary>
    [DataContract]
    public class GetUserAuthTokenResult
    {
        /// <summary>
        /// ID of the account
        /// </summary>
        [DataMember(Name = "AccountId")]
        public int AccountId { get; set; }

        /// <summary>
        /// Auth-Token for accessing the HarmonyHub, this can be used to get an acces token.
        /// </summary>
        [DataMember(Name = "UserAuthToken")]
        public string UserAuthToken { get; set; }
    }
}


text:
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
/*
    Created on : 20 avr. 2015, 15:08:53
    Author     : dell
*/

body {
    padding-top: 50px;
}
.page {
    max-width: 960px;
    margin: auto;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/nav_header_layout"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:padding="10dp"
    android:background="@color/colorBarBg">
    <ImageView
        android:id="@+id/nav_user_image"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_centerHorizontal="true"
        android:layout_alignParentTop="true" />

    <TextView
        android:id="@+id/nav_user_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:textColor="#fff"
        android:textSize="14sp"
        />
</RelativeLayout>