text:
#region Copyright (c) Lokad 2009-2010
// This code is released under the terms of the new BSD licence.
// URL: http://www.lokad.com/
#endregion

using System;
using System.Runtime.Serialization;
using Lokad.Cloud.Storage.Azure;
using Lokad.Cloud.Test;
using Lokad.Serialization;
using NUnit.Framework;

namespace Lokad.Cloud.Storage.Test
{
	[TestFixture]
	public class FatEntityTests
	{
		[DataContract]
		public class TimeValue
		{
			[DataMember] public DateTime Time { get; set;}
			[DataMember] public double Value { get; set;}
		}

		[DataContract]
		public class TimeSerie
		{
			[DataMember] public TimeValue[] TimeValues { get; set;}
		}

		[Serializable]
		public class TimeValueNoContract
		{
			public DateTime Time { get; set; }
			public double Value { get; set; }
		}

		[Serializable]
		public class TimeSerieNoContract
		{
			public TimeValueNoContract[] TimeValues { get; set; }
		}

		readonly IDataSerializer _serializer = GlobalSetup.Container.Resolve<IDataSerializer>();

		[Test]
		public void Convert()
		{
			var timevalues = new TimeValue[20000];
			for(int i = 0; i < timevalues.Length; i++)
			{
				timevalues[i] = new TimeValue {Time = new DateTime(2001, 1, 1).AddMinutes(i), Value = i};
			}

			var serie = new TimeSerie {TimeValues = timevalues};

			var cloudEntity = new CloudEntity<TimeSerie>
				{
					PartitionKey = "part",
					RowKey = "key",
					Value = serie
				};

			var fatEntity = FatEntity.Convert(cloudEntity, _serializer);
			var cloudEntity2 = FatEntity.Convert<TimeSerie>(fatEntity, _serializer, null);
			var fatEntity2 = FatEntity.Convert(cloudEntity2, _serializer);

			Assert.IsNotNull(cloudEntity2);
			Assert.IsNotNull(fatEntity2);

			Assert.AreEqual(cloudEntity.PartitionKey, fatEntity.PartitionKey);
			Assert.AreEqual(cloudEntity.RowKey, fatEntity.RowKey);

			Assert.AreEqual(cloudEntity.PartitionKey, fatEntity2.PartitionKey);
			Assert.AreEqual(cloudEntity.RowKey, fatEntity2.RowKey);

			Assert.IsNotNull(cloudEntity2.Value);
			Assert.AreEqual(cloudEntity.Value.TimeValues.Length, cloudEntity2.Value.TimeValues.Length);

			for(int i = 0; i < timevalues.Length; i++)
			{
				Assert.AreEqual(cloudEntity.Value.TimeValues[i].Time, cloudEntity2.Value.TimeValues[i].Time);
				Assert.AreEqual(cloudEntity.Value.TimeValues[i].Value, cloudEntity2.Value.TimeValues[i].Value);
			}

			var data1 = fatEntity.GetData();
			var data2 = fatEntity2.GetData();
			Assert.AreEqual(data1.Length, data2.Length);
			for(int i = 0; i < data2.Length; i++)
			{
				Assert.AreEqual(data1[i], data2[i]);
			}
		}

		[Test]
		public void ConvertNoContract()
		{
			var timevalues = new TimeValueNoContract[20000];
			for (int i = 0; i < timevalues.Length; i++)
			{
				timevalues[i] = new TimeValueNoContract { Time = new DateTime(2001, 1, 1).AddMinutes(i), Value = i };
			}

			var serie = new TimeSerieNoContract { TimeValues = timevalues };

			var cloudEntity = new CloudEntity<TimeSerieNoContract>
			{
				PartitionKey = "part",
				RowKey = "key",
				Value = serie
			};

			var fatEntity = FatEntity.Convert(cloudEntity, _serializer);
			var cloudEntity2 = FatEntity.Convert<TimeSerieNoContract>(fatEntity, _serializer, null);
			var fatEntity2 = FatEntity.Convert(cloudEntity2, _serializer);

			Assert.IsNotNull(cloudEntity2);
			Assert.IsNotNull(fatEntity2);

			Assert.AreEqual(cloudEntity.PartitionKey, fatEntity.PartitionKey);
			Assert.AreEqual(cloudEntity.RowKey, fatEntity.RowKey);

			Assert.AreEqual(cloudEntity.PartitionKey, fatEntity2.PartitionKey);
			Assert.AreEqual(cloudEntity.RowKey, fatEntity2.RowKey);

			Assert.IsNotNull(cloudEntity2.Value);
			Assert.AreEqual(cloudEntity.Value.TimeValues.Length, cloudEntity2.Value.TimeValues.Length);

			for (int i = 0; i < timevalues.Length; i++)
			{
				Assert.AreEqual(cloudEntity.Value.TimeValues[i].Time, cloudEntity2.Value.TimeValues[i].Time);
				Assert.AreEqual(cloudEntity.Value.TimeValues[i].Value, cloudEntity2.Value.TimeValues[i].Value);
			}

			var data1 = fatEntity.GetData();
			var data2 = fatEntity2.GetData();
			Assert.AreEqual(data1.Length, data2.Length);
			for (int i = 0; i < data2.Length; i++)
			{
				Assert.AreEqual(data1[i], data2[i]);
			}
		}
	}
}


text:
package attacker_test

import (
	"testing"

	"github.com/rha7/pressure/apptypes"
	"github.com/rha7/pressure/attacker"
	"github.com/sirupsen/logrus"
	. "github.com/smartystreets/goconvey/convey"
)

func TestPerform(t *testing.T) {
	Convey("Given a test spec and a logger", t, func() {
		spec := &apptypes.TestSpec{
			ConcurrentThreads: 3,
			Data:              "",
			Method:            "GET",
			Proxy:             "",
			RequestHeaders:    apptypes.Headers{},
			RequestTimeout:    10,
			ReuseConnections:  false,
			TotalRequests:     30,
			URL:               "http://www.google.com.mx/",
		}
		logger := &logrus.Logger{}
		Convey("When test is performed", func() {
			summary, err := attacker.Perform(logger, *spec)
			Convey("Then I should get no errors and a summary", func() {
				So(err, ShouldBeNil)
				So(summary, ShouldNotBeNil)
				So(summary.Reports, ShouldHaveLength, 30)
				So(summary.Stats.Aggregations.Count, ShouldEqual, 30)
			})
		})
	})
}

redpajama_set_name: RedPajamaGithub


text:
\hypertarget{_g_parse_master_id_8h}{\section{include/seqan/\-G\-Search/\-G\-Parse\-Master\-Id.h File Reference}
\label{_g_parse_master_id_8h}\index{include/seqan/\-G\-Search/\-G\-Parse\-Master\-Id.\-h@{include/seqan/\-G\-Search/\-G\-Parse\-Master\-Id.\-h}}
}
{\ttfamily \#include $<$seqan/sequence.\-h$>$}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
int \hyperlink{_g_parse_master_id_8h_a243bf68bc9682746ce29bed2754f2262}{G\-Parse\-Master\-Id} (String$<$ char $>$ \&master\-Id, String$<$ char $>$ \&Ref\-Seq)
\begin{DoxyCompactList}\small\item\em gets the master\-Id out of a clustered database Id. \end{DoxyCompactList}\end{DoxyCompactItemize}

\subsection{Function Documentation}
\hypertarget{_g_parse_master_id_8h_a243bf68bc9682746ce29bed2754f2262}{\index{G\-Parse\-Master\-Id.\-h@{G\-Parse\-Master\-Id.\-h}!G\-Parse\-Master\-Id@{G\-Parse\-Master\-Id}}
\index{G\-Parse\-Master\-Id@{G\-Parse\-Master\-Id}!GParseMasterId.h@{G\-Parse\-Master\-Id.\-h}}
\subsubsection[{G\-Parse\-Master\-Id}]{\setlength{\rightskip}{0pt plus 5cm}int G\-Parse\-Master\-Id (
\begin{DoxyParamCaption}
\item[{String$<$ char $>$ \&}]{master\-Id, }
\item[{String$<$ char $>$ \&}]{Ref\-Seq}
\end{DoxyParamCaption}
)}}\label{_g_parse_master_id_8h_a243bf68bc9682746ce29bed2754f2262}

gets the master\-Id out of a clustered database Id.

if there is no master\-Id in the given reference the function calls an error.
\begin{DoxyParams}[1]{Parameters}
\mbox{\tt out}  & {\em master\-Id} & object in which master id is written \\
\hline
\mbox{\tt in}  & {\em Ref\-Seq} & id from which master\-Id is read \\
\hline
\end{DoxyParams}


text:
using System.Reflection;
using Abp.Modules;

namespace AbpODataDemo
{
    public class AbpODataDemoCoreModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }
    }
}


text:
#ifndef WorkerLoaderProxy_h
#define WorkerLoaderProxy_h

#if ENABLE(WORKERS)

#include "ScriptExecutionContext.h"
#include <wtf/Forward.h>
#include <wtf/PassOwnPtr.h>

namespace WebCore {

    // A proxy to talk to the loader context. Normally, the document on the main thread
    // provides loading services for the subordinate workers. This interface provides 2-way
    // communications to the Document context and back to the worker.
    // Note that in multi-process browsers, the Worker object context and the Document
    // context can be distinct.
    class WorkerLoaderProxy {
    public:
        virtual ~WorkerLoaderProxy() { }

        // Posts a task to the thread which runs the loading code (normally, the main thread).
        virtual void postTaskToLoader(PassOwnPtr<ScriptExecutionContext::Task>) = 0;

        // Posts callbacks from loading code to the WorkerGlobalScope. The 'mode' is used to differentiate
        // specific synchronous loading requests so they can be 'nested', per spec.
        // Returns true if the task was posted successfully.
        virtual bool postTaskForModeToWorkerGlobalScope(PassOwnPtr<ScriptExecutionContext::Task>, const String& mode) = 0;
    };

} // namespace WebCore

#endif // ENABLE(WORKERS)

#endif // WorkerLoaderProxy_h


text:
Modern development is highly asynchronous: isn't it about time iOS developers had tools that made programming asynchronously powerful, easy and delightful?

```objc
[CLLocationManager promise].catch(^{
    return self.chicagoLocation;
}).then(^(CLLocation *loc){
    return [NSURLConnection GET:@"http://user.net/%f/%f", loc.latitude, loc.longitude];
}).then(^(NSDictionary *user){
    UIAlertView *alert = [UIAlertView new];
    alert.title = [NSString stringWithFormat:@"Hi, %@!", user.name];
    [alert addButtonWithTitle:@"Bye"];
    [alert addButtonWithTitle:@"Hi!"];
    return alert.promise;
}).then(^(NSNumber *tappedButtonIndex, UIAlertView *alert){
    if (tappedButtonIndex.intValue == alert.cancelButtonIndex)
        return nil;
    id vc = [HelloViewController new]
    return [self promiseViewController:vc animated:YES completion:nil].then(^(id resultFromViewController){
        //…
    });
}).catch(^(NSError *err){
    //…
});
```

* PromiseKit can and should be integrated into the other Pods you use.
* PromiseKit is complete, well-tested and in apps on the store.

For guides and complete documentation visit [promisekit.org](http://promisekit.org).


text:
from datetime import datetime
import json

from sms import app
from flask import render_template, request, redirect, url_for, flash
from model import db, User, SentMessage, FrequentText
from jinja2 import Environment

from tw_send import twilio_send, twilio_update

@app.route('/')
def index():
    sent_messages = SentMessage.query.order_by(SentMessage.id.desc())[0:10]
    users = User.query.order_by(User.first_name).all()
    return render_template('index.html', sent_messages=sent_messages,
                           users=users)

@app.route('/sms', methods=['POST'])
def sms():
    """Send an SMS to Twilio and save response to DB. """

    phone_numbers = request.form.getlist('user_phone')

    e = Environment()
    template = ''

    for p in phone_numbers:

        # Render Jinja2 template from message
        u = User.query.filter(User.phone == p).one()
        msg_template = e.from_string(request.form['message'])
        message = msg_template.render(first_name=u.first_name,
                                      last_name=u.last_name, phone=p)

        # Send to Twilio
        tw_response = twilio_send(p, message)

        # Convert JSON from Twilio to Python dict
        sms_data = json.loads(tw_response)
        #sms_data = {'to': 1234567899, 'body': 'Fake SMS', 'status': 'fake'}

        # Commit to database
        sms = SentMessage(sms_data['to'], sms_data['body'], sms_data['status'],
                          sms_data['sid'], datetime.now())
        db.session.add(sms)
        template += render_template('new_message.html', message=sms)

    db.session.commit()

    return template

@app.route('/sms/update/<sid>')
def sms_update(sid):
    """Update an SMS based on query from Twilio. """

    tw_response = twilio_update(sid)
    sms_data = json.loads(tw_response)

    sms = SentMessage.query.filter_by(sid=sid).one()
    sms.status = sms_data['status']
    db.session.commit()

    return sms.status

@app.route('/user')
def user_add():
    """Add a user to the DB. """

    u = User(request.form['user_name'], request.form['user_phone'])
    db.session.add(u)
    db.session.commit()

    users = User.query.all()

    return render_template('user.html', users=users)


text:
API is a simple API wrapper for interacting with [MailChimp API](http://www.mailchimp.com/api) 1.3.

##Requirements

A MailChimp account and API key. You can see your API keys [here](http://admin.mailchimp.com/account/api).

##Usage

There are a few ways to use API:

You can create an instance of the API wrapper:

    api = Mailchimp::API.new("your_api_key")

You can set your api_key globally and call class methods:

    Mailchimp::API.api_key = "your_api_key"
    Mailchimp::API.lists

You can also set the environment variable 'MC_API_KEY' and API will use it when you create an instance:

    api = Mailchimp::API.new

Fetching data is as simple as calling API methods directly on the wrapper
object.  The API calls may be made with either camelcase or  underscore
separated formatting as you see in the "More Advanced Examples" section below.

Check the API [documentation](http://apidocs.mailchimp.com/api/1.3/) for details.

### Fetching Campaigns

For example, to fetch your first 100 campaigns (page 0):

    campaigns = api.campaigns({:start => 0, :limit => 100})

### Fetching Lists

Similarly, to fetch your first 100 lists:

    lists = api.lists({:start => 0, :limit=> 100})

### More Advanced Examples

Getting batch member information for subscribers looks like this:

    info = api.list_member_info({:id => list_id, :email_address => email_array})

or

    info = api.listMemberInfo({:id => list_id, :email_address => email_array})

Fetch open and click detail for recipients of a particular campaign:

    email_stats = api.campaign_email_stats_aim({:cid => campaign_id, :email_address => email_array})

or

    email_stats = api.campaignEmailStatsAIM({:cid => campaign_id, :email_address => email_array})

### Export API usage

In addition to the standard API you can make calls to the
[MailChimp Export API](http://apidocs.mailchimp.com/export/1.0/) using a Mailchimp::Export object:

  mailchimp_export = Mailchimp::Export.new(@api_key)

Calling Export API functions is identical to making standard API calls but the
return value is an Enumerator which loops over the lines returned from the
Export API.  This is because the data returned from the Export API is a stream
of JSON objects rather than a single JSON array.

### Error handling

By default you are expected to handle errors returned by the APIs manually.  The
APIs will return a Hash with two keys "errors", a string containing some textual
information about the error, and "code", the numeric code of the error.

If you set the `throws_exceptions` boolean attribute for a given instance then
API will attempt to intercept the errors and raise an exception.


text:
#ifndef __SHIFTJIS_H__
#define __SHIFTJIS_H__

#include <itable.h>
#include <ctable.h>

public void DecodeShiftJis( state_t *state, byte codingSystem );

public void EncodeShiftJis( i_str_t *istr, int head, int tail,
			   byte codingSystem, boolean_t binary );

#endif /* __SHIFTJIS_H__ */


text:
namespace ash {

class TrayBrightnessTest : public AshTest {
 public:
  TrayBrightnessTest() {}
  ~TrayBrightnessTest() override {}

 protected:
  views::View* CreateDefaultView() {
    TrayBrightness tray(NULL);
    // The login status doesn't matter here; supply any random value.
    return tray.CreateDefaultView(LoginStatus::USER);
  }

  views::View* CreateDetailedView() {
    TrayBrightness tray(NULL);
    // The login status doesn't matter here; supply any random value.
    return tray.CreateDetailedView(LoginStatus::USER);
  }

 private:
  DISALLOW_COPY_AND_ASSIGN(TrayBrightnessTest);
};

// Tests that when the default view is initially created, that its
// BrightnessView is created not visible.
TEST_F(TrayBrightnessTest, CreateDefaultView) {
  std::unique_ptr<views::View> tray(CreateDefaultView());
  EXPECT_FALSE(tray->visible());
}

// Tests the construction of the default view while MaximizeMode is active.
// The BrightnessView should be visible.
TEST_F(TrayBrightnessTest, CreateDefaultViewDuringMaximizeMode) {
  WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
      true);
  std::unique_ptr<views::View> tray(CreateDefaultView());
  EXPECT_TRUE(tray->visible());
  WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
      false);
}

// Tests that the enabling of MaximizeMode affects a previously created
// BrightnessView, changing the visibility.
TEST_F(TrayBrightnessTest, DefaultViewVisibilityChangesDuringMaximizeMode) {
  std::unique_ptr<views::View> tray(CreateDefaultView());
  WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
      true);
  EXPECT_TRUE(tray->visible());
  WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
      false);
  EXPECT_FALSE(tray->visible());
}

// Tests that when the detailed view is initially created that its
// BrightnessView is created as visible for both MD and non MD modes.
TEST_F(TrayBrightnessTest, CreateDetailedView) {
  std::unique_ptr<views::View> tray(CreateDetailedView());
  EXPECT_TRUE(tray->visible());
}

// Tests that when the detailed view is created during MaximizeMode that its
// BrightnessView is visible.
TEST_F(TrayBrightnessTest, CreateDetailedViewDuringMaximizeMode) {
  WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
      true);
  std::unique_ptr<views::View> tray(CreateDetailedView());
  EXPECT_TRUE(tray->visible());
  WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
      false);
}

// Tests that the enabling of MaximizeMode has no affect on the visibility of a
// previously created BrightnessView that belongs to a detailed view.
TEST_F(TrayBrightnessTest, DetailedViewVisibilityChangesDuringMaximizeMode) {
  std::unique_ptr<views::View> tray(CreateDetailedView());
  WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
      true);
  EXPECT_TRUE(tray->visible());
  WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
      false);
  EXPECT_TRUE(tray->visible());
}

}  // namespace ash


text:
package t2;

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

public class TabelaDeSimbolos {

    private List<EntradaTabelaDeSimbolos> simbolos;

    public TabelaDeSimbolos() {
        simbolos = new ArrayList<EntradaTabelaDeSimbolos>();
    }

    public void adicionarSimbolo(String nome, String tipo, String valor) {
        simbolos.add(new EntradaTabelaDeSimbolos(nome, tipo, valor));
    }

    public boolean existeSimbolo(String nome) {
        for (EntradaTabelaDeSimbolos etds : simbolos) {
            if (etds.getNome().equals(nome)) {
                return true;
            }
        }
        return false;
    }

    public EntradaTabelaDeSimbolos buscaSimbolo(String nome) {
        for (EntradaTabelaDeSimbolos etds : simbolos) {
            if (etds.getNome().equals(nome)) {
                return etds;
            }
        }

        return null;
    }

    public String buscaTipoVariavel(String nome) {
        for (EntradaTabelaDeSimbolos etds : simbolos) {
            if (etds.getNome().equals(nome)) {
                return etds.getTipo();
            }
        }
        return null;
    }

    public String buscaValor(String nome) {
        for (EntradaTabelaDeSimbolos etds : simbolos) {
            if (etds.getNome().equals(nome)) {
                return etds.getValor();
            }
        }
        return null;
    }

}


text:
package com.mesaverde.specialization.resources;

public abstract class Resource {
	public static final int EMPTY = 0;  // for when we don't want to include a cost, like when specifying needs
	protected int amount;
	protected double cost;
	// children classes should set this amount based on their default max storage
	// SpecializedAgents can change this value for their own resources in their ResourceManager
	protected double maxStorage;
	protected double decayRate = 0d;  // the rate at which this resource decays if any

	protected Resource(int amount, double cost, double defaultMaxStorage) {
		this.amount = amount;
		this.cost = cost;
		this.maxStorage = defaultMaxStorage;
	}

	public void decreaseAmount(int amountToDecrease) {
		if (amount != 0) {
			cost *= (1 - amountToDecrease / amount); // decrease the costs by the same ratio
		}

		this.amount -= amountToDecrease;
	}

	/** Amount of this resource */
	public int getAmount() {
		return amount;
	}

	public double getCost() {
		return cost;
	}

	public double getMaxStorage() {
		return maxStorage;
	}

	/** The level at which we believe we have enough resources stored */
	public double getSatisfactoryAmount() {
		return maxStorage * 0.5;
	}

	/** The level at which we believe that we need more resources. CRITICAL state. */
	public int getShortageThreshold() {
		return (int) (maxStorage * 0.25);
	}

	/** Returns the amount above which an agent will try to trade away this resource.
	 * This is equivalent to the PHILANTHROPIC setting in Agent.  Currently it returns the value of max storage.
	 * You should override it for your resource if you want a different setting. */
	public double getTradeThresholdAmount() {
		return maxStorage;
	}

	/** Cost per unit of this resource */
	public double getUnitCost() {
		return getCost() / getAmount();
	}

	public void increaseAmount(double d, double costToGetIt) {
		this.amount += d;
		this.cost += costToGetIt;
	}

	/** Calculate the cost of transporting the resource */
	// A great and realistic idea that's not really implemented anywhere in the simulation
	//public abstract double calcTransportCost(int amount, double distance);

	public void increaseCost(double amount) {
		cost += amount;
	}

	/** Create a copy of this resource with the amount of units and costForIt */
	public abstract Resource makeInstance(int amount, double costForIt);

	public void setMaxStorage(double maxStore) {
		this.maxStorage = maxStore;
	}

	public double getDecayRate() {
		return decayRate;
	}

    public abstract double calculateTransportCost(double amount, double distance);
}


text:
package org.apache.qpid.proton.amqp.messaging;

public final class DeleteOnNoMessages implements LifetimePolicy
{
    private static final DeleteOnNoMessages INSTANCE = new DeleteOnNoMessages();

    private DeleteOnNoMessages()
    {
    }

    public String toString()
    {
        return "DeleteOnNoMessages{}";
    }

    public static DeleteOnNoMessages getInstance()
    {
        return INSTANCE;
    }
}


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

    <io.vov.vitamio.widget.CenterLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <io.vov.vitamio.widget.VideoView
            android:id="@+id/videoView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true" />
    </io.vov.vitamio.widget.CenterLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:orientation="horizontal" >

        <ProgressBar
            android:id="@+id/probar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/track"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:background="@color/black_overlay"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        android:padding="10dp"
        android:visibility="gone" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="70dp"
            android:layout_height="60dp"
            android:layout_gravity="center_horizontal"
            android:scaleType="fitXY"
            android:src="@drawable/logo"
            android:visibility="gone"/>

        <TextView
            android:id="@+id/tV_track"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/white"
            android:textSize="20dp"
            android:textStyle="bold" />
    </LinearLayout>

    <ImageButton
         android:id="@+id/lock_overlay_button"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_centerVertical="true"
         android:layout_alignParentLeft="true"
         android:layout_marginLeft="10dp"
         android:background="@drawable/ic_lock"
         android:visibility="visible" />

    <RelativeLayout
	            android:id="@+id/progress_overlay"
	            android:layout_width="fill_parent"
	            android:layout_height="wrap_content"
	            android:layout_alignParentBottom="true"
	            android:background="#99000000"
	            android:paddingLeft="5dp"
	            android:paddingRight="5dp"
	            android:visibility="visible" >

	            <ImageButton
	                android:id="@+id/player_overlay_play"
	                android:layout_width="40dip"
	                android:layout_height="40dip"
	                android:layout_alignParentLeft="true"
	                android:layout_centerVertical="true"
	                android:layout_marginRight="5dp"
	                android:background="@drawable/ic_pause_circle" />

	            <TextView
	                android:id="@+id/player_overlay_time"
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:layout_centerVertical="true"
	                android:layout_marginRight="5dp"
	                android:layout_toRightOf="@+id/player_overlay_play"
	                android:clickable="true"
	                android:text=""
	                android:textColor="#ffffff"
	                android:textSize="15sp" />

	            <SeekBar
	                android:id="@+id/player_overlay_seekbar"
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:layout_centerVertical="true"
	                android:layout_toLeftOf="@+id/player_overlay_length"
	                android:layout_toRightOf="@+id/player_overlay_time"
	                android:maxHeight="2dip"
	                android:minHeight="2dip"
	                android:paddingLeft="12dp"
	                android:paddingRight="12dp"
	                android:progressDrawable="@drawable/po_seekbar"
	                android:thumb="@drawable/seekbar_thumb" />

	 			<TextView
	                android:id="@+id/player_overlay_length"
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:layout_centerVertical="true"
	                android:layout_marginLeft="5dp"
	                android:layout_alignParentRight="true"
	                android:clickable="true"
	                android:text=""
	                android:textColor="#ffffff"
	                android:textSize="15sp" />

	        </RelativeLayout>

    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:layout_gravity="top"
            android:id="@+id/player_overlay_header"
            android:layout_alignParentTop="true"
            android:background="#99000000"
            android:visibility="visible" >

            <TextView
                android:id="@+id/player_overlay_title"
                android:layout_width="300dp"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_centerVertical="true"
                android:ellipsize="end"
                android:text="xxxxxxxxxxxxxxxxxxxx"
                android:textColor="@color/white"
                android:textSize="15sp" />

            <TextView
                android:id="@+id/player_overlay_battery"
                android:layout_marginLeft="10dp"
                android:layout_toLeftOf="@+id/player_overlay_systime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="5dp"
                android:layout_centerVertical="true"
                android:text="iiiiiiiiiiiiiiiiiiiiiiiiiiiiii"
                android:textColor="@color/white"
                android:textSize="15sp" />

            <TextView
                android:id="@+id/player_overlay_systime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_alignParentRight="true"
                android:layout_marginRight="5dp"
                android:textColor="@color/white"
                android:textSize="15sp" />
       </RelativeLayout>

</RelativeLayout>


text:
<?php

namespace Google\ApiCore\ResourceTemplate;

use Google\ApiCore\ValidationException;

/**
 * Represents a relative resource template, meaning that it will never contain a leading slash or
 * trailing verb (":<verb>").
 *
 * Examples:
 *   projects
 *   projects/{project}
 *   foo/{bar=**}/fizz/*
 *
 * Templates use the syntax of the API platform; see
 * https://github.com/googleapis/api-common-protos/blob/master/google/api/http.proto
 * for details. A template consists of a sequence of literals, wildcards, and variable bindings,
 * where each binding can have a sub-path. A string representation can be parsed into an
 * instance of AbsoluteResourceTemplate, which can then be used to perform matching and instantiation.
 *
 * @internal
 */
class RelativeResourceTemplate implements ResourceTemplateInterface
{
    /** @var Segment[] $segments */
    private $segments;

    /**
     * RelativeResourceTemplate constructor.
     *
     * @param string $path
     * @throws ValidationException
     */
    public function __construct(string $path)
    {
        if (empty($path)) {
            throw new ValidationException('Cannot construct RelativeResourceTemplate from empty string');
        }
        $this->segments = Parser::parseSegments($path);

        $doubleWildcardCount = self::countDoubleWildcards($this->segments);
        if ($doubleWildcardCount > 1) {
            throw new ValidationException(
                "Cannot parse '$path': cannot contain more than one path wildcard"
            );
        }

        // Check for duplicate keys
        $keys = [];
        foreach ($this->segments as $segment) {
            if ($segment->getSegmentType() === Segment::VARIABLE_SEGMENT) {
                if (isset($keys[$segment->getKey()])) {
                    throw new ValidationException(
                        "Duplicate key '{$segment->getKey()}' in path $path"
                    );
                }
                $keys[$segment->getKey()] = true;
            }
        }
    }

    /**
     * @inheritdoc
     */
    public function __toString()
    {
        return self::renderSegments($this->segments);
    }

    /**
     * @inheritdoc
     */
    public function render(array $bindings)
    {
        $literalSegments = [];
        $keySegmentTuples = self::buildKeySegmentTuples($this->segments);
        foreach ($keySegmentTuples as list($key, $segment)) {
            /** @var Segment $segment */
            if ($segment->getSegmentType() === Segment::LITERAL_SEGMENT) {
                $literalSegments[] = $segment;
                continue;
            }
            if (!array_key_exists($key, $bindings)) {
                throw $this->renderingException($bindings, "missing required binding '$key' for segment '$segment'");
            }
            $value = $bindings[$key];
            if (!is_null($value) && $segment->matches($value)) {
                $literalSegments[] = new Segment(
                    Segment::LITERAL_SEGMENT,
                    $value,
                    $segment->getValue(),
                    $segment->getTemplate(),
                    $segment->getSeparator()
                );
            } else {
                $valueString = is_null($value) ? "null" : "'$value'";
                throw $this->renderingException(
                    $bindings,
                    "expected binding '$key' to match segment '$segment', instead got $valueString"
                );
            }
        }
        return self::renderSegments($literalSegments);
    }

    /**
     * @inheritdoc
     */
    public function matches(string $path)
    {
        try {
            $this->match($path);
            return true;
        } catch (ValidationException $ex) {
            return false;
        }
    }

    /**
     * @inheritdoc
     */
    public function match(string $path)
    {
        // High level strategy for matching:
        // - Build a list of Segments from our template, where any variable segments are
        //   flattened into a single, non-nested list
        // - Break $path into pieces based on '/'.
        //     - Use the segments to further subdivide the pieces using any applicable non-slash separators.
        // - Match pieces of the path with Segments in the flattened list

        // In order to build correct bindings after we match the $path against our template, we
        // need to (a) calculate the correct positional keys for our wildcards, and (b) maintain
        // information about the variable identifier of any flattened segments. To do this, we
        // build a list of [string, Segment] tuples, where the string component is the appropriate
        // key.
        $keySegmentTuples = self::buildKeySegmentTuples($this->segments);

        $flattenedKeySegmentTuples = self::flattenKeySegmentTuples($keySegmentTuples);
        $flattenedKeySegmentTuplesCount = count($flattenedKeySegmentTuples);
        assert($flattenedKeySegmentTuplesCount > 0);

        $slashPathPieces = explode('/', $path);
        $pathPieces = [];
        $pathPiecesIndex = 0;
        $startIndex = 0;
        $slashPathPiecesCount = count($slashPathPieces);
        $doubleWildcardPieceCount = $slashPathPiecesCount - $flattenedKeySegmentTuplesCount + 1;

        for ($i = 0; $i < count($flattenedKeySegmentTuples); $i++) {
            $segmentKey = $flattenedKeySegmentTuples[$i][0];
            $segment = $flattenedKeySegmentTuples[$i][1];
            // In our flattened list of segments, we should never encounter a variable segment
            assert($segment->getSegmentType() !== Segment::VARIABLE_SEGMENT);

            if ($segment->getSegmentType() == Segment::DOUBLE_WILDCARD_SEGMENT) {
                $pathPiecesForSegment = array_slice($slashPathPieces, $pathPiecesIndex, $doubleWildcardPieceCount);
                $pathPiece = implode('/', $pathPiecesForSegment);
                $pathPiecesIndex += $doubleWildcardPieceCount;
                $pathPieces[] = $pathPiece;
                continue;
            }

            if ($segment->getSegmentType() == Segment::WILDCARD_SEGMENT) {
                if ($pathPiecesIndex >= $slashPathPiecesCount) {
                    break;
                }
            }
            if ($segment->getSeparator() === '/') {
                if ($pathPiecesIndex >= $slashPathPiecesCount) {
                    throw $this->matchException($path, "segment and path length mismatch");
                }
                $pathPiece = substr($slashPathPieces[$pathPiecesIndex++], $startIndex);
                $startIndex = 0;
            } else {
                $rawPiece = substr($slashPathPieces[$pathPiecesIndex], $startIndex);
                $pathPieceLength = strpos($rawPiece, $segment->getSeparator());
                $pathPiece = substr($rawPiece, 0, $pathPieceLength);
                $startIndex += $pathPieceLength + 1;
            }
            $pathPieces[] = $pathPiece;
        }

        if ($flattenedKeySegmentTuples[$i - 1][1]->getSegmentType() !== Segment::DOUBLE_WILDCARD_SEGMENT) {
            // Process any remaining pieces. The binding logic will throw exceptions for any invalid paths.
            for (; $pathPiecesIndex < count($slashPathPieces); $pathPiecesIndex++) {
                $pathPieces[] = $slashPathPieces[$pathPiecesIndex];
            }
        }
        $pathPiecesCount = count($pathPieces);

        // We would like to match pieces of our path 1:1 with the segments of our template. However,
        // this is confounded by the presence of double wildcards ('**') in the template, which can
        // match multiple segments in the path.
        // Because there can only be one '**' present, we can determine how many segments it must
        // match by examining the difference in count between the template segments and the
        // path pieces.

        if ($pathPiecesCount < $flattenedKeySegmentTuplesCount) {
            // Each segment in $flattenedKeyedSegments must consume at least one
            // segment in $pathSegments, so matching must fail.
            throw $this->matchException($path, "path does not contain enough segments to be matched");
        }

        $doubleWildcardPieceCount = $pathPiecesCount - $flattenedKeySegmentTuplesCount + 1;

        $bindings = [];
        $pathPiecesIndex = 0;
        /** @var Segment $segment */
        foreach ($flattenedKeySegmentTuples as list($segmentKey, $segment)) {
            $pathPiece = $pathPieces[$pathPiecesIndex++];
            if (!$segment->matches($pathPiece)) {
                throw $this->matchException($path, "expected path element matching '$segment', got '$pathPiece'");
            }

            // If we have a valid key, add our $pathPiece to the $bindings array. Note that there
            // may be multiple copies of the same $segmentKey. This is because a flattened variable
            // segment can match multiple pieces from the path. We can add these to an array and
            // collapse them all once the bindings are complete.
            if (isset($segmentKey)) {
                $bindings += [$segmentKey => []];
                $bindings[$segmentKey][] = $pathPiece;
            }
        }

        // It is possible that we have left over path pieces, which can occur if our template does
        // not have a double wildcard. In that case, the match should fail.
        if ($pathPiecesIndex !== $pathPiecesCount) {
            throw $this->matchException($path, "expected end of path, got '$pathPieces[$pathPiecesIndex]'");
        }

        // Collapse the bindings from lists into strings
        $collapsedBindings = [];
        foreach ($bindings as $key => $boundPieces) {
            $collapsedBindings[$key] = implode('/', $boundPieces);
        }

        return $collapsedBindings;
    }

    private function matchException(string $path, string $reason)
    {
        return new ValidationException("Could not match path '$path' to template '$this': $reason");
    }

    private function renderingException(array $bindings, string $reason)
    {
        $bindingsString = print_r($bindings, true);
        return new ValidationException(
            "Error rendering '$this': $reason\n" .
            "Provided bindings: $bindingsString"
        );
    }

    /**
     * @param Segment[] $segments
     * @param string|null $separator An optional string separator
     * @return array[] A list of [string, Segment] tuples
     */
    private static function buildKeySegmentTuples(array $segments, string $separator = null)
    {
        $keySegmentTuples = [];
        $positionalArgumentCounter = 0;
        foreach ($segments as $segment) {
            switch ($segment->getSegmentType()) {
                case Segment::WILDCARD_SEGMENT:
                case Segment::DOUBLE_WILDCARD_SEGMENT:
                    $positionalKey = "\$$positionalArgumentCounter";
                    $positionalArgumentCounter++;
                    $newSegment = $segment;
                    if ($separator !== null) {
                        $newSegment = new Segment(
                            $segment->getSegmentType(),
                            $segment->getValue(),
                            $segment->getKey(),
                            $segment->getTemplate(),
                            $separator
                        );
                    }
                    $keySegmentTuples[] = [$positionalKey, $newSegment];
                    break;
                default:
                    $keySegmentTuples[] = [$segment->getKey(), $segment];
            }
        }
        return $keySegmentTuples;
    }

    /**
     * @param array[] $keySegmentTuples A list of [string, Segment] tuples
     * @return array[] A list of [string, Segment] tuples
     */
    private static function flattenKeySegmentTuples(array $keySegmentTuples)
    {
        $flattenedKeySegmentTuples = [];
        foreach ($keySegmentTuples as list($key, $segment)) {
            /** @var Segment $segment */
            switch ($segment->getSegmentType()) {
                case Segment::VARIABLE_SEGMENT:
                    // For segment variables, replace the segment with the segments of its children
                    $template = $segment->getTemplate();
                    $nestedKeySegmentTuples = self::buildKeySegmentTuples(
                        $template->segments,
                        $segment->getSeparator()
                    );
                    foreach ($nestedKeySegmentTuples as list($nestedKey, $nestedSegment)) {
                        /** @var Segment $nestedSegment */
                        // Nested variables are not allowed
                        assert($nestedSegment->getSegmentType() !== Segment::VARIABLE_SEGMENT);
                        // Insert the nested segment with key set to the outer key of the
                        // parent variable segment
                        $flattenedKeySegmentTuples[] = [$key, $nestedSegment];
                    }
                    break;
                default:
                    // For all other segments, don't change the key or segment
                    $flattenedKeySegmentTuples[] = [$key, $segment];
            }
        }
        return $flattenedKeySegmentTuples;
    }

    /**
     * @param Segment[] $segments
     * @return int
     */
    private static function countDoubleWildcards(array $segments)
    {
        $doubleWildcardCount = 0;
        foreach ($segments as $segment) {
            switch ($segment->getSegmentType()) {
                case Segment::DOUBLE_WILDCARD_SEGMENT:
                    $doubleWildcardCount++;
                    break;
                case Segment::VARIABLE_SEGMENT:
                    $doubleWildcardCount += self::countDoubleWildcards($segment->getTemplate()->segments);
                    break;
            }
        }
        return $doubleWildcardCount;
    }

    /**
     * Joins segments using their separators.
     * @param array $segmentsToRender
     * @return string
     */
    private static function renderSegments(array $segmentsToRender)
    {
        $renderResult = "";
        for ($i = 0; $i < count($segmentsToRender); $i++) {
            $segment = $segmentsToRender[$i];
            $renderResult .= $segment;
            if ($i < count($segmentsToRender) - 1) {
                $renderResult .= $segment->getSeparator();
            }
        }
        return $renderResult;
    }
}


text: <!doctype html><nobr><nobr></nobr><nobr>


text:
a.asc:before {
  content: '\e72f';
}
a.desc:before {
  content: '\e730';
}
a.asc,
a.desc {
  font-family: ZenIcon;
  speak: none;
  font-size: 14px;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


text:
package name.panitz.game.framework.swing;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.Font;
import javax.swing.ImageIcon;

import name.panitz.game.framework.GraphicsTool;
import name.panitz.game.framework.GameObject;

public class SwingGraphicsTool implements GraphicsTool<Image>{
  Graphics g;

  public SwingGraphicsTool(Graphics g) {
    this.g = g;
  }

  @Override
  public void drawImage(Image img, double x, double y) {
    g.drawImage(img, (int)x, (int)y, null);
  }

  @Override
  public void drawRect(double x, double y, double w, double h) {
    g.drawRect((int)x, (int)y, (int)w, (int)h);
  }

  @Override
  public void fillRect(double x, double y, double w, double h) {
    g.fillRect((int)x, (int)y, (int)w, (int)h);
  }

  @Override
  public void drawOval(double x, double y, double w, double h) {
    g.drawOval((int)x, (int)y, (int)w, (int)h);
  }

  @Override
  public void fillOval(double x, double y, double w, double h) {
    g.fillOval((int)x, (int)y, (int)w, (int)h);
  }

  @Override
  public void drawString(double x,double y,int fontSize, String fontName, String text){
    g.setFont(new Font(fontName, Font.PLAIN, fontSize));
    g.drawString(text, (int)x, (int)y);
  }
  @Override
  public  Image generateImage(String name, GameObject<Image> go){
    ImageIcon image = new ImageIcon(getClass().getClassLoader().getResource(name));
    go.setWidth(image.getIconWidth());
    go.setHeight(image.getIconHeight());
    return image.getImage();
  }
}


text:
The openfire server stores the map for parking lot and has the information of all the empty and occupied parking positions in the parking area. Parking Model consists of sensor attached to every parking slot. These sensors run Smack-tcp client to send their status to the server. Also every new car arriving runs a smack client as well and makes a request to openfire server to get and reserve a empty parking slot. All the connections and request goes over TCP with TLS authentication using XMPP Protocol. Multiple client tries to connect to server in separate threads over same socket. The service time of each client is noted to study the queuing delay r waiting time for customers to get their request served.Traffic coming to the server follows the poisson arrival.

## Code Changes:-
### Server side handling:-
* ClientStanzaHandler.java
* AdminConsolePlugin.java

File Location:-
* openfire_src/src/java/org/jivesoftware/openfire/net/ClientStanzaHandler.java
* openfire_src/src/java/org/jivesoftware/openfire/container/AdminConsolePlugin

### Client side changes:-
Created new folder client in smack-tcp. Clients thread are running and service time for each client is noted to evaluate prformance. Clients are arriving according to Poisson Distribution.

Folder Location:- smack-tcp/src/main/java/org/jivesoftware/smack/tcp/client

Files added:-
* XMPPOpenfireConnection.java
* abstractClientWrapper.java
* clientsThread.java
* putClient.java
* getClient.java
* deleteClient.java

## Installation and run:-
### Pre requisites
* Install ant to build openfire server and gradle to build smack client.
* Install eclipse and import smack-core, smack-java7, smack-resolver-javax, smack-sasl-javax and smack-tcp projects.
* Add smack-java7 as build dependency in smack-tcp.
* Add math3 jars present at Smack-master/Jars as external jar to resolve errors
* From terminal go inside each folder in the above sequence and run $ gradle eclipse build

### Openfire build and start server
Inside folder openfire_src/build run following command

$ ant

Now after successful build go to folder openfire_src/target/openfire/bin and run

$ ./openfire.sh

Follow the steps in http://www.2daygeek.com/install-openfire-instant-messaging-server-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/# to "Configure openfile server" on the listening address displayed on terminal.
Activate required plugins to allow client interaction by going to plugin tabs and see list of Available Plugins.

### Running Smack Client
Inside Smack-master/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/client run XMPPOpenfireConnection.java


text:
package com.asakusafw.directio.hive.serde;

import org.apache.hadoop.hive.serde2.io.ShortWritable;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.ShortObjectInspector;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;

import com.asakusafw.runtime.value.ShortOption;
import com.asakusafw.runtime.value.ValueOption;

/**
 * Inspects {@link ShortOption} object.
 * @since 0.7.0
 */
public class ShortOptionInspector extends AbstractValueInspector implements ShortObjectInspector {

    /**
     * Creates a new instance.
     */
    public ShortOptionInspector() {
        super(TypeInfoFactory.shortTypeInfo);
    }

    @Override
    protected ValueOption<?> newObject() {
        return new ShortOption();
    }

    @Override
    public Object getPrimitiveJavaObject(Object o) {
        ShortOption object = (ShortOption) o;
        if (object == null || object.isNull()) {
            return null;
        }
        return object.get();
    }

    @Override
    public Object getPrimitiveWritableObject(Object o) {
        ShortOption object = (ShortOption) o;
        if (object == null || object.isNull()) {
            return null;
        }
        return new ShortWritable(object.get());
    }

    @Override
    public short get(Object o) {
        return ((ShortOption) o).get();
    }
}


text:
/*
    This file contains Backbeat API routes and route details
*/

/**
 * The metrics route model.
 * @param {Object} locations - Locations by service
 * @param {Array} locations.crr - The list of replication location names
 * @param {Array} locations.ingestion - The list of ingestion location names
 * @return {Array} The array of route objects
 */
function routes(locations) {
    /* eslint-disable no-param-reassign */
    locations.crr = locations.crr || [];
    locations.ingestion = locations.ingestion || [];
    /* eslint-enable no-param-reassign */

    return [
        // Route: /_/healthcheck
        {
            httpMethod: 'GET',
            category: 'healthcheck',
            type: 'basic',
            method: 'getHealthcheck',
            extensions: {},
        },
        // Route: /_/metrics/crr/<location>/pending
        // Route: /_/metrics/ingestion/<location>/pending
        {
            httpMethod: 'GET',
            category: 'metrics',
            type: 'pending',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'getPending',
            dataPoints: ['opsPending', 'bytesPending'],
        },
        // Route: /_/metrics/crr/<location>/backlog
        {
            httpMethod: 'GET',
            category: 'metrics',
            type: 'backlog',
            extensions: { crr: [...locations.crr, 'all'] },
            method: 'getBacklog',
            dataPoints: ['opsPending', 'bytesPending'],
        },
        // Route: /_/metrics/crr/<location>/completions
        // Route: /_/metrics/ingestion/<location>/completions
        {
            httpMethod: 'GET',
            category: 'metrics',
            type: 'completions',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'getCompletions',
            dataPoints: ['opsDone', 'bytesDone'],
        },
        // Route: /_/metrics/crr/<location>/failures
        {
            httpMethod: 'GET',
            category: 'metrics',
            type: 'failures',
            extensions: { crr: [...locations.crr, 'all'] },
            method: 'getFailedMetrics',
            dataPoints: ['opsFail', 'bytesFail'],
        },
        // Route: /_/metrics/crr/<location>/throughput
        // Route: /_/metrics/ingestion/<location>/throughput
        {
            httpMethod: 'GET',
            category: 'metrics',
            type: 'throughput',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'getThroughput',
            dataPoints: ['opsDone', 'bytesDone'],
        },
        // Route: /_/metrics/crr/<location>/all
        // Route: /_/metrics/ingestion/<location>/all
        {
            httpMethod: 'GET',
            category: 'metrics',
            type: 'all',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'getAllMetrics',
            dataPoints: ['ops', 'opsDone', 'opsFail', 'bytes', 'bytesDone',
                'bytesFail', 'opsPending', 'bytesPending'],
        },
        // Route: /_/metrics/crr/<site>/progress/<bucket>/<key>
        {
            httpMethod: 'GET',
            category: 'metrics',
            type: 'progress',
            level: 'object',
            extensions: { crr: [...locations.crr] },
            method: 'getObjectProgress',
            dataPoints: ['objectBytes', 'objectBytesDone'],
        },
        // Route: /_/metrics/crr/<site>/throughput/<bucket>/<key>
        {
            httpMethod: 'GET',
            category: 'metrics',
            type: 'throughput',
            level: 'object',
            extensions: { crr: [...locations.crr] },
            method: 'getObjectThroughput',
            dataPoints: ['objectBytesDone'],
        },
        // Route: /_/crr/failed?site=<site>&marker=<marker>
        {
            httpMethod: 'GET',
            type: 'all',
            extensions: { crr: ['failed'] },
            method: 'getSiteFailedCRR',
        },
        // Route: /_/crr/failed/<bucket>/<key>/<versionId>
        {
            httpMethod: 'GET',
            type: 'specific',
            extensions: { crr: ['failed'] },
            method: 'getFailedCRR',
        },
        // Route: /_/crr/failed
        {
            httpMethod: 'POST',
            type: 'all',
            extensions: { crr: ['failed'] },
            method: 'retryFailedCRR',
        },
        // Route: /_/monitoring/metrics
        {
            httpMethod: 'GET',
            category: 'monitoring',
            type: 'metrics',
            extensions: {},
            method: 'monitoringHandler',
        },
        // Route: /_/crr/pause/<location>
        // Route: /_/ingestion/pause/<location>
        // Where <location> is an optional field
        {
            httpMethod: 'POST',
            type: 'pause',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'pauseService',
        },
        // Route: /_/crr/resume/<location>
        // Route: /_/ingestion/resume/<location>
        // Route: /_/crr/resume/<location>/schedule
        // Route: /_/ingestion/resume/<location>/schedule
        // Where <location> is an optional field unless "schedule" route
        {
            httpMethod: 'POST',
            type: 'resume',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'resumeService',
        },
        {
            httpMethod: 'DELETE',
            type: 'resume',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'deleteScheduledResumeService',
        },
        // Route: /_/crr/resume/<location>
        // Route: /_/ingestion/resume/<location>
        {
            httpMethod: 'GET',
            type: 'resume',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'getResumeSchedule',
        },
        // Route: /_/crr/status/<location>
        // Route: /_/ingestion/status/<location>
        // Where <location> is an optional field
        {
            httpMethod: 'GET',
            type: 'status',
            extensions: {
                crr: [...locations.crr, 'all'],
                ingestion: [...locations.ingestion, 'all'],
            },
            method: 'getServiceStatus',
        },
        // Route: /_/configuration/workflows
        {
            httpMethod: 'POST',
            category: 'configuration',
            type: 'workflows',
            method: 'applyWorkflowConfiguration',
            extensions: {},
        },
    ];
}

module.exports = routes;


text:
angular.module('ngCountUp', []).
  directive('ngCountUp', ['$timeout', function($timeout) {

    var linker = function ($scope, element, attrs) {
      // Set default values
      $scope.from = 0;
      $scope.to = 0;
      $scope.decimals = 0;
      $scope.duration = 0;
      $scope.delay = 0;

      $scope.$watchCollection('[from, to, decimals, duration, delay]', function(newValues, oldValues) {
        if (newValues) {
          var elem = element[0];

          // Create countUp
          var count = new countUp(
            elem,
            $scope.from,
            $scope.to,
            $scope.decimals,
            $scope.duration,
            $scope.options
          );

          // Run after delay
          if ($scope.delay) {
            angular.element(elem).addClass('ng-hide');      // Hide countUp if delay exist
            $timeout(function() {
              angular.element(elem).removeClass('ng-hide'); // Display countUp when delay has ended
              count.start();
            }, $scope.delay);
          } else {
            count.start();
          }
        } else {

        }
      });
    };

    return {
      restrict: 'E',
      scope: {
        from: '@',
        to: '@',
        decimals: '@',
        duration: '@',
        delay: '@',
        options: '='
      },
      link: linker
    };

  }]);


text:
class UserMailer < ActionMailer::Base
  default :from => "xiruken@gmail.com"

  def password_reset(user)
    @user = user
    mail :to => user.email, :subject => "Password Reset"
  end

  def confirmation_instructions(user)
    @user = user
    mail :to => user.email, :subject => "Confirmation instructions"
  end
end


text:
<?php

namespace Abc\Bundle\JobBundle\Tests\Validator\Constraints;

use Abc\Bundle\JobBundle\Job\Status;
use Abc\Bundle\JobBundle\Validator\Constraints\Status as StatusConstraint;
use Abc\Bundle\JobBundle\Validator\Constraints\StatusValidator;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Context\ExecutionContext;
use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface;

class StatusValidatorTest extends TestCase
{
    /**
     * @var ExecutionContext|\PHPUnit_Framework_MockObject_MockObject
     */
    private $context;

    /**
     * @var StatusValidator
     */
    private $subject;

    /**
     * {@inheritdoc}
     */
    public function setUp()
    {
        $this->subject = new StatusValidator();
        $this->context = $this->getMockBuilder(ExecutionContext::class)->disableOriginalConstructor()->getMock();
        $this->subject->initialize($this->context);
    }

    public function testValidateWithNull()
    {
        $this->context->expects($this->never())
            ->method('buildViolation');

        $this->subject->validate(null, new StatusConstraint());
    }

    public function testWithInvalidType()
    {
        $value   = 'foobar';
        $builder = $this->createMock(ConstraintViolationBuilderInterface::class);

        $this->context->expects($this->once())
            ->method('buildViolation')
            ->willReturn($builder);

        $builder->expects($this->once())
            ->method('setParameter')
            ->with('{{string}}', $value)
            ->willReturn($builder);

        $builder->expects($this->once())
            ->method('addViolation');

        $this->subject->validate($value, new StatusConstraint());
    }

    public function testValidateWithValidStatus()
    {
        foreach (Status::toArray() as $value) {
            $this->context->expects($this->never())
                ->method('buildViolation');

            $this->subject->validate($value, new StatusConstraint());
        }
    }
}


text:
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Steeltoe.CloudFoundry.Connector.RabbitMQ;
using Steeltoe.Management.CloudFoundry;

namespace RabbitMQ
{
    public class Startup
    {
        public IConfiguration Configuration { get; set; }

        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRabbitMQConnection(Configuration);

            services.AddControllersWithViews();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseRouting();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=RabbitMQ}/{action=Send}/{id?}");
            });
        }
    }
}


text:
<?php

namespace Google\Service\Dialogflow;

class GoogleCloudDialogflowV2IntentMessageSimpleResponses extends \Google\Collection
{
  protected $collection_key = 'simpleResponses';
  protected $simpleResponsesType = GoogleCloudDialogflowV2IntentMessageSimpleResponse::class;
  protected $simpleResponsesDataType = 'array';

  /**
   * @param GoogleCloudDialogflowV2IntentMessageSimpleResponse[]
   */
  public function setSimpleResponses($simpleResponses)
  {
    $this->simpleResponses = $simpleResponses;
  }
  /**
   * @return GoogleCloudDialogflowV2IntentMessageSimpleResponse[]
   */
  public function getSimpleResponses()
  {
    return $this->simpleResponses;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleCloudDialogflowV2IntentMessageSimpleResponses::class, 'Google_Service_Dialogflow_GoogleCloudDialogflowV2IntentMessageSimpleResponses');


text:
<?php

interface TimeSlot
{
	/**
	 * @return DateTime
	 */
	public function getStartDate();

	/**
	 * @return DateTime
	 */
	public function getEndDate();
}


text:
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { UserComponent } from './components/user.component';
import { AboutComponent } from './components/about.component';
import { CarsComponent } from './components/cars/cars.component';
import { NewCarComponent } from './components/cars/newCar.component';
import { GithubProfileComponent } from './components/profile/github.profile.component';
import { SigninComponent } from './components/common/signin.component';
import { SignupComponent } from './components/common/signup.component';

const AppRoutes: Routes = [
    {
        path: '',
        component: UserComponent
    },
    {
        path: 'about',
        component: AboutComponent
    },
    {
        path: 'cars',
        component: CarsComponent
    },
    {
        path: 'newCar',
        component: NewCarComponent
    },
    {
      path: 'github',
      component: GithubProfileComponent
    },
    {
        path: 'signin',
        component: SigninComponent
    },
    {
        path: 'signup',
        component: SignupComponent
    }
];

export const routing: ModuleWithProviders = RouterModule.forRoot(AppRoutes);


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">

  <title>Bootstrap 101 Template</title>

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

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


text:
import types
from collections import namedtuple
from copy import deepcopy

TransitionResult = namedtuple('TransitionResult', ('new_state', 'events'))

# Quick overview
# --------------
#
# Goals:
# - Reliable failure recovery.
#
# Approach:
# - Use a write-ahead-log for state changes. Under a node restart the
# latest state snapshot can be recovered and the pending state changes
# reaplied.
#
# Requirements:
# - The function call `state_transition(curr_state, state_change)` must be
# deterministic, the recovery depends on the re-execution of the state changes
# from the WAL and must produce the same result.
# - StateChange must be idenpotent because the partner node might be recovering
# from a failure and a Event might be produced more than once.
#
# Requirements that are enforced:
# - A state_transition function must not produce a result that must be further
# processed, i.e. the state change must be self contained and the result state
# tree must be serializable to produce a snapshot. To enforce this inputs and
# outputs are separated under different class hierarquies (StateChange and Event).

class State(object):
    """ An isolated state, modified by StateChange messages.

    Notes:
    - Don't duplicate the same state data in two different States, instead use
    identifiers.
    - State objects may be nested.
    - State classes don't have logic by design.
    - Each iteration must operate on fresh copy of the state, treating the old
      objects as immutable.
    - This class is used as a marker for states.
    """
    __slots__ = ()

class StateChange(object):
    """ Declare the transition to be applied in a state object.

    StateChanges are incoming events that change this node state (eg. a
    blockchain event, a new packet, an error). It is not used for the node to
    communicate with the outer world.

    Nomenclature convention:
    - 'Receive' prefix for protocol messages.
    - 'ContractReceive' prefix for smart contract logs.
    - 'Action' prefix for other interactions.

    Notes:
    - These objects don't have logic by design.
    - This class is used as a marker for state changes.
    """
    __slots__ = ()

class Event(object):
    """ Events produced by the execution of a state change.

    Nomenclature convention:
    - 'Send' prefix for protocol messages.
    - 'ContractSend' prefix for smart contract function calls.
    - 'Event' for node events.

    Notes:
    - This class is used as a marker for events.
    - These objects don't have logic by design.
    - Separate events are preferred because there is a decoupling of what the
      upper layer will use the events for.
    """
    __slots__ = ()

class StateManager(object):
    """ The mutable storage for the application state, this storage can do
    state transitions by applying the StateChanges to the current State.
    """
    __slots__ = (
        'state_transition',
        'current_state',
    )

    def __init__(self, state_transition, current_state):
        """ Initialize the state manager.

        Args:
            state_transition: function that can apply a StateChange message.
            current_state: current application state.
        """
        if not callable(state_transition):
            raise ValueError('state_transition must be a callable')

        self.state_transition = state_transition
        self.current_state = current_state

    def dispatch(self, state_change):
        """ Apply the `state_change` in the current machine and return the
        resulting events.

        Args:
            state_change (StateChange): An object representation of a state
            change.

        Return:
            Event: A list of events produced by the state transition, it's
            the upper layer's responsibility to decided how to handle these
            events.
        """
        assert isinstance(state_change, StateChange)

        # the state objects must be treated as immutable, so make a copy of the
        # current state and pass the copy to the state machine to be modified.
        next_state = deepcopy(self.current_state)

        # update the current state by applying the change
        iteration = self.state_transition(
            next_state,
            state_change,
        )

        assert isinstance(iteration, TransitionResult)

        self.current_state, events = iteration

        assert isinstance(self.current_state, (State, types.NoneType))
        assert all(isinstance(e, Event) for e in events)

        return events


text:
/**
 * Tester Class Expected output:
 *
 *      0
 *      2
 *      5
 *      5
 *      1
 */
import java.util.ArrayList;

public class FuelDepotTest
{
    public static void main(String[] args)
    {
        int[] levels = {20, 30, 80, 55, 50, 75, 20};
        ArrayList<FuelTank> tanks = new ArrayList<FuelTank>();
        for (int level : levels)
            tanks.add(new MyFuelTank(level));

        FuelRobot filler = new MyFuelRobot(2);
        FuelDepot depot = new FuelDepot(filler, tanks);
        System.out.println(depot.nextTankToFill(50));
        System.out.println(depot.nextTankToFill(15));
        depot.moveToLocation(5);
        System.out.println(filler.getCurrentIndex());
        depot.moveToLocation(5);
        System.out.println(filler.getCurrentIndex());
        depot.moveToLocation(1);
        System.out.println(filler.getCurrentIndex());
    }
}


text:
/**
  @addtogroup BLE_COMMON
  @{
  @defgroup ble_ranges Module specific SVC and event number subranges
  @{

  @brief Definition of SVC and event number subranges for each API module.

  @note
  SVCs and event numbers are split into subranges for each API module.
  Each module receives its entire allocated range of SVC calls, whether implemented or not,
  but return BLE_ERROR_NOT_SUPPORTED for unimplemented or undefined calls in its range.

  Note that the symbols BLE_<module>_SVC_LAST is the end of the allocated SVC range,
  rather than the last SVC function call actually defined and implemented.

  Specific SVC and event values are defined in each module's ble_<module>.h file,
  which defines names of each individual SVC code based on the range start value.
*/

#ifndef BLE_RANGES_H__
#define BLE_RANGES_H__

#define BLE_SVC_BASE           0x60
#define BLE_SVC_LAST           0x6B       /* Total: 12. */

#define BLE_RESERVED_SVC_BASE  0x6C
#define BLE_RESERVED_SVC_LAST  0x6F       /* Total: 4. */

#define BLE_GAP_SVC_BASE       0x70
#define BLE_GAP_SVC_LAST       0x8F       /* Total: 32. */

#define BLE_GATTC_SVC_BASE     0x90
#define BLE_GATTC_SVC_LAST     0x9F       /* Total: 16. */

#define BLE_GATTS_SVC_BASE     0xA0
#define BLE_GATTS_SVC_LAST     0xAF       /* Total: 16. */

#define BLE_L2CAP_SVC_BASE     0xB0
#define BLE_L2CAP_SVC_LAST     0xBF       /* Total: 16. */

#define BLE_EVT_INVALID        0x00

#define BLE_EVT_BASE           0x01
#define BLE_EVT_LAST           0x0F       /* Total: 15. */

#define BLE_GAP_EVT_BASE       0x10
#define BLE_GAP_EVT_LAST       0x2F       /* Total: 32. */

#define BLE_GATTC_EVT_BASE     0x30
#define BLE_GATTC_EVT_LAST     0x4F       /* Total: 32. */

#define BLE_GATTS_EVT_BASE     0x50
#define BLE_GATTS_EVT_LAST     0x6F       /* Total: 32. */

#define BLE_L2CAP_EVT_BASE     0x70
#define BLE_L2CAP_EVT_LAST     0x8F       /* Total: 32.  */

#define BLE_OPT_INVALID        0x00       /**< Invalid BLE Option. */

#define BLE_OPT_BASE           0x01       /**< Common BLE Option base. */
#define BLE_OPT_LAST           0x1F       /**< Total: 31. */

#define BLE_GAP_OPT_BASE       0x20       /**< GAP BLE Option base. */
#define BLE_GAP_OPT_LAST       0x3F       /**< Total: 32. */

#define BLE_GATTC_OPT_BASE     0x40       /**< GATTC BLE Option base. */
#define BLE_GATTC_OPT_LAST     0x5F       /**< Total: 32. */

#define BLE_GATTS_OPT_BASE     0x60       /**< GATTS BLE Option base. */
#define BLE_GATTS_OPT_LAST     0x7F       /**< Total: 32. */

#define BLE_L2CAP_OPT_BASE     0x80       /**< L2CAP BLE Option base. */
#define BLE_L2CAP_OPT_LAST     0x9F       /**< Total: 32.  */

#endif /* BLE_RANGES_H__ */

/**
  @}
  @}
*/


text:
using Machine.Specifications;
using ShopifySharp.Tests.Test_Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShopifySharp.Tests
{
    [Subject(typeof(ShopifyOrderService))]
    public class When_deleting_an_order
    {
        Establish context = () =>
        {
            Service = new ShopifyOrderService(Utils.MyShopifyUrl, Utils.AccessToken);
            Order = Service.CreateAsync(OrderCreation.GenerateOrder()).Await().AsTask.Result;
        };

        Because of = () =>
        {
            try
            {
                Service.DeleteAsync(Order.Id.Value).Await();
            }
            catch(ShopifyException e)
            {
                Exception = e;
            }
        };

        It should_delete_an_order = () =>
        {
            Exception.ShouldBeNull();
        };

        Cleanup after = () =>
        {

        };

        static ShopifyOrderService Service;
        static ShopifyOrder Order;
        static ShopifyException Exception;
    }
}


text:
$(document).ready(function(){
    $(".checkall").click(function(){
        var result=$(this).prop('checked');
        $(".check").prop("checked",result);
        checkListStyle();
    });
    $(".check").click(function(){
        checkListStyle();
    });
});
function adminLogin () {
    var admin = new Object();
    admin.username = $("#username").val();
    admin.password = $("#password").val();
    dataHandler('/adminajax/login',admin,null,null,null,adminLoginSuccess,false,false);
}
function adminLoginSuccess(){
    location.href='/admin/index';
}
function reload(){
    location.reload();
}
function checkListStyle(){
    var allChecked=true;
    $(".data-item").each(function(index){
        var result=$(this).find('.checker span input').prop('checked');
        if(result){
            $(this).addClass('checked');
        }else{
            allChecked=false;
            $(this).removeClass('checked');
        }
    });
    $(".checkall").prop('checked',allChecked);
}
function uploadThumb(){
    uploadImageAdvance("#uploadImgThumb",beforeUpload,successHandler);
}
function beforeUpload(){
    $("#thumbnail").attr('src','/assets/images/cms/loading.gif');
}
function successHandler(src){
    $("#thumbnail").attr('src',src);
}
function uploadThumb1(){
    uploadImageAdvance("#uploadImgThumb1",beforeUpload1,successHandler1);
}
function beforeUpload1(){
    $("#thumbnail1").attr('src','/assets/images/cms/loading.gif');
}
function successHandler1(src){
    $("#thumbnail1").attr('src',src);
}
function uploadThumb2(){
    uploadImageAdvance("#uploadImgThumb2",beforeUpload2,successHandler2);
}
function beforeUpload2(){
    $("#thumbnail2").attr('src','/assets/images/cms/loading.gif');
}
function successHandler2(src){
    $("#thumbnail2").attr('src',src);
}
function uploadThumb3(){
    uploadImageAdvance("#uploadImgThumb3",beforeUpload3,successHandler3);
}
function beforeUpload3(){
    $("#thumbnail3").attr('src','/assets/images/cms/loading.gif');
}
function successHandler3(src){
    $("#thumbnail3").attr('src',src);
}
function showAddEssayDiv(){
    setDivCenter('#addEssayDiv',true);
}
function addEssay(){
    if($("#title").val()==''){
        alert('标题不能为空!');
        $("#title").focus();
        return false;
    }
    $("#addEssayDiv").hide(100);
    showWait();
    var essay = new Object();
    essay.infoType = 'essay';
    essay.column = $("#column").val();
    essay.title = $("#title").val();
    essay.islink = $("#islink").val();
    essay.link = $("#link").val();
    essay.summary = $("#summary").val();
    essay.thumbnail = $("#thumbnail").attr('src');
    essay.authorAvatar = $("#thumbnail2").attr('src');
    essay.content = contentEditor.html();
    if($("#author").length > 0){
        essay.author = $("#author").val();
    }
    if($("#thumbnail2").length > 0){
        essay.avatar = $("#thumbnail2").attr('src');
    }
    dataHandler('/common/addInfo',essay,null,null,null,addEssaySuccessHandler,false,false);

}
function addEssaySuccessHandler(){
    $("#waitDiv").hide(100);
    showAlert('success','添加成功!','');
    reload();
}
function saveEssay(){
    if($("#title1").val()==''){
        alert('标题不能为空!');
        $("#title").focus();
        return false;
    }
    $("#editEssayDiv").hide();
    //alert($("#thumbnail2").attr('src'));
    showWait();
    var essay = new Object();
    essay.infoType = 'essay';
    essay.id = currentEssayId;
    essay.column = $("#column1").val();
    essay.title = $("#title1").val();
    essay.islink = $("#islink1").val();
    essay.link = $("#link1").val();
    essay.summary = $("#summary1").val();
    essay.thumbnail = $("#thumbnail1").attr('src');
    essay.authorAvatar = $("#thumbnail2").attr('src');

    essay.content = contentEditor1.html();
    if($("#author1").length > 0){
        essay.author = $("#author1").val();
    }
    if($("#thumbnail3").length > 0){
        essay.avatar = $("#thumbnail3").attr('src');
    }
    dataHandler('/common/modifyInfo',essay,null,null,null,saveEssaySuccessHandler,false,false);

}
function saveEssaySuccessHandler(){
    $("#waitDiv").hide(100);
    showAlert('success','修改成功!','');
    reload();
}
var currentEssayId=0;
function editEssay(id){
    showWait();
    currentEssayId=id;
    var essay = new Object();
    essay.infoType = 'essay';
    essay.id = id;
    dataHandler('/common/getInfo',essay,null,null,null,getEssaySuccessHandler,false,false);
}
function getEssaySuccessHandler(essay){
    $("#title1").val(essay.title);
    $("#summary1").val(essay.summary);
    $("#islink1").val(essay.islink);
    if(essay.islink==1){
        $("#link1").show();
    }else{
        $("#link1").hide();
    }
    if($("#author1").length > 0){
        $("#author1").val(essay.author);
    }
    if($("#thumbnail3").length > 0){
        $("#thumbnail3").attr('src',essay.authorAvatar);
    }
    $("#link1").val(essay.link);
    $("#column1").val(essay.column);
    contentEditor1.html(essay.content);
    $("#thumbnail1").attr('src',essay.thumbnail);
    $("#waitDiv").hide(100);
    setDivCenter('#editEssayDiv',true);
}
function deleteEssay(id){
    var essay = new Object();
    essay.infoType = 'essay';
    essay.id = id;
    dataHandler('/common/deleteInfo',essay,'确定删除?',null,null,deleteEssaySuccessHandler,false,false);
}
function deleteEssaySuccessHandler(){
    showAlert('success','删除成功!','正在刷新...');
    reload();
}
function selectEssay(baseUrl){
    var extUrl="";
    if($("#searchColumn").val()!=0) extUrl+="&column="+$("#searchColumn").val();
    if($("#keywords").val()!="") extUrl+="&keywords="+$("#keywords").val();
    location.href=baseUrl+extUrl;
}


text:
#ifndef __itkDiffusionTensor3D_h
#define __itkDiffusionTensor3D_h

// Undefine an eventual DiffusionTensor3D macro
#ifdef DiffusionTensor3D
#undef DiffusionTensor3D
#endif

#include "itkSymmetricSecondRankTensor.h"

namespace itk
{
/** \class DiffusionTensor3D
 * \brief Represent a diffusion tensor as used in DTI images.
 *
 * This class implements a 3D symmetric tensor as it is used for representing
 * diffusion of water molecules in Diffusion Tensor Images.
 *
 * This class derive from the SymmetricSecondRankTensor and from it inherit
 * most of the Tensor related behavior. At this level we add the methods that
 * are specific to 3D and that are closely related to the concept of diffusion.
 *
 *
 * \author Jeffrey Duda from School of Engineering at University of Pennsylvania
 * \author Torsten Rohlfing from SRI International Neuroscience Program.
 *
 * This class was mostly based on files that Jeffrey Duda, Torsten Rohlfing and
 * Martin Styner contributed to the ITK users list during a discussion on
 * support for DiffusionTensorImages. A discussion on the design of this class
 * can be found in the WIKI pages of NAMIC:
 *
 * http://www.na-mic.org/Wiki/index.php/NAMIC_Wiki:DTI:ITK-DiffusionTensorPixelType
 *
 * \note This work is part of the National Alliance for Medical Image
 * Computing (NAMIC), funded by the National Institutes of Health
 * through the NIH Roadmap for Medical Research, Grant U54 EB005149.
 * Information on the National Centers for Biomedical Computing
 * can be obtained from http://commonfund.nih.gov/bioinformatics.
 *
 *
 * \note Contributions by Torsten Rohlfing were funded by the following NIH grants
 *
 * Alcohol, HIV and the Brain,
 * NIAAA AA12999, PI: A. Pfefferbaum
 *
 * Normal Aging of Brain Structure and Function
 * NIA AG 17919, PI: E.V. Sullivan.
 *
 *
 * \par References
 * E. R. Melhem, S. Mori, G. Mukundan, M. A. Kraut, M. G. Pomper, and
 * P. C. M. van Zijl, "Diffusion tensor MR imaging of the brain and white
 * matter tractography," Am. J. Roentgenol., vol. 178, pp. 3-16, 2002.
*
 * \sa SymmetricSecondRankTensor
 *
 * \ingroup ImageObjects   TensorObjects    Geometry
 * \ingroup ITK-Common
 */

template< typename TComponent >
class DiffusionTensor3D:public SymmetricSecondRankTensor< TComponent, 3 >
{
public:
  /** Standard class typedefs. */
  typedef DiffusionTensor3D                          Self;
  typedef SymmetricSecondRankTensor< TComponent, 3 > Superclass;

  /** Propagating some typedef from the superclass */
  typedef typename Superclass::ValueType     ValueType;
  typedef typename Superclass::ComponentType ComponentType;
#if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) && ( __GNUC__ == 3 )
  typedef ComponentType ComponentArrayType[6];
#else
  typedef typename Superclass::ComponentArrayType ComponentArrayType;
#endif
  typedef typename Superclass::AccumulateValueType AccumulateValueType;
  typedef typename Superclass::RealValueType       RealValueType;

  typedef typename Superclass::EigenValuesArrayType   EigenValuesArrayType;
  typedef typename Superclass::EigenVectorsMatrixType EigenVectorsMatrixType;

  /** Default Constructor. */
  DiffusionTensor3D();

  /** Constructor with initialization. */
  DiffusionTensor3D(const Superclass & r);
  DiffusionTensor3D(const ComponentType & r);
  DiffusionTensor3D(const ComponentArrayType r);

  /** Constructor to enable casting...  */
  template< typename TCoordRepB >
  DiffusionTensor3D(const DiffusionTensor3D< TCoordRepB > & pa):
    SymmetricSecondRankTensor< TComponent, 3 >(pa) {}

  /** Pass-through assignment operator for the Array base class. */
  Self & operator=(const Superclass & r);

  Self & operator=(const ComponentType & r);

  Self & operator=(const ComponentArrayType r);

  /** Templated Pass-through assignment  for the Array base class. */
  template< typename TCoordRepB >
  Self & operator=(const DiffusionTensor3D< TCoordRepB > & pa)
  {
    SymmetricSecondRankTensor< TComponent, 3 >::operator=(pa);
    return *this;
  }

  /** Get Trace value */
  AccumulateValueType GetTrace() const;

  /** Get the value of Fractional Anisotropy from the Tensor. */
  RealValueType GetFractionalAnisotropy() const;

  /** Get the value of Relative Anisotropy from the Tensor. */
  RealValueType GetRelativeAnisotropy() const;

  /** Get the Inner Scalar Product from the Tensor. */
  RealValueType GetInnerScalarProduct() const;
};
} // end namespace itk
#include "itkNumericTraitsDiffusionTensor3DPixel.h"

// Define instantiation macro for this template.
#define ITK_TEMPLATE_DiffusionTensor3D(_, EXPORT, TypeX, TypeY)     \
  namespace itk                                                     \
  {                                                                 \
  _( 1 ( class EXPORT DiffusionTensor3D< ITK_TEMPLATE_1 TypeX > ) ) \
  namespace Templates                                               \
  {                                                                 \
  typedef DiffusionTensor3D< ITK_TEMPLATE_1 TypeX >                 \
  DiffusionTensor3D##TypeY;                                       \
  }                                                                 \
  }

#if ITK_TEMPLATE_EXPLICIT
#include "Templates/itkDiffusionTensor3D+-.h"
#endif

#if ITK_TEMPLATE_TXX
#include "itkDiffusionTensor3D.txx"
#endif

#endif


text:
<?xml version="1.0" ?>

    <meta charset="utf-8"/>
    <title> Book Table of Contents </title>
    <link href="style.css" rel="stylesheet"/>

Real-Time Net Value (RTNV) - System Level Test Procedures

INIT - App Initialization

ENTER - Pressing the "Enter" Button

DELETE - Pressing the "Delete" Button

NEXT - Pressing the "Next" Button

DISPLAY - Display

PERF - Performance Requirements

 Requirements to Test Case ID Trace

 Test Case ID to Requirements Trace

 Test Log Entry

 Test Log


text:
<?php

namespace DoctrineModule\Stdlib\Hydrator\Strategy;

/**
 * When this strategy is used for Collections, if the new collection does not contain elements that are present in
 * the original collection, then this strategy remove elements from the original collection. For instance, if the
 * collection initially contains elements A and B, and that the new collection contains elements B and C, then the
 * final collection will contain elements B and C (while element A will be asked to be removed).
 *
 * This strategy is by reference, this means it won't use public API to add/remove elements to the collection
 *
 * @license MIT
 * @link    http://www.doctrine-project.org/
 * @since   0.7.0
 * @author  Michael Gallego <mic.gallego@gmail.com>
 */
class AllowRemoveByReference extends AbstractCollectionStrategy
{
    /**
     * {@inheritDoc}
     */
    public function hydrate($value)
    {
        $collection      = $this->getCollectionFromObjectByReference();
        $collectionArray = $collection->toArray();

        $toAdd    = array_udiff($value, $collectionArray, [$this, 'compareObjects']);
        $toRemove = array_udiff($collectionArray, $value, [$this, 'compareObjects']);

        foreach ($toAdd as $element) {
            $collection->add($element);
        }

        foreach ($toRemove as $element) {
            $collection->removeElement($element);
        }

        return $collection;
    }
}


text:
module Wardrobe
  module Plugins
    module Validation
      module InstanceMethods
        def _validate
          return ValidationRunner.validate(self) if frozen?
          unless _validated?
            @_validator = ValidationRunner.validate(self)
            @_validated = true
          end
          @_validator
        end

        def _validate!
          validator = _validate
          raise ValidationError.new(validator.errors) unless validator.errors.empty?
          self
        end

        def _valid?
          _validate.errors.empty?
        end

        def _validation_errors
          _validate.errors
        end

        private

        def _validated?
          return false if frozen?
          @_validated ||= false
        end
      end
    end
  end
end


text:
> A list of comment-patterns for different languages

This module contains an extract of the [language-database of ](http://nevir.github.io/groc/languages.html)`groc`
with information about how single- and multi-line comments are written in different languages.

## Basic usage

```js
var commentPattern = require('comment-patterns');
var p = commentPattern('filename.js');
```

This will lead to `p` being:

```js
{
  name: "JavaScript",
  nameMatchers: [".js"],
  multiLineComment: [{
    start: /\/\*\*/,
    middle: "*",
    end: "*/",
    apidoc: true
  }, {
    start: /\/\*/,
    middle: "*",
    end: "*/"
  }],
  singleLineComment: [{
    start: "//"
  }]
}
```

* **name** is the name of the language
* **nameMatchers** is an array of file extensions of filenames that
files in this language usually have.
* **multiLineComment** is an array of patterns for comments that may span multiple lines
  - **start** is the beginning of a comment
  - **middle** is a character of a regex that occurs in front of each comment line
  - **end** marks the end of the comment
* **singleLineComment** is the prefix of comments that go until the end of the line

## Variation (regex)

It is also possible to retrieve a regular expression that matches comments
(up to the next line of code):

```js
var re = commentPattern.regex('filename.js');
```

The result `re` will be:

```js
{
  regex: /^([ \t]*)(\/\*\*([\s\S]*?)\*\/|\/\*([\s\S]*?)\*\/|((?:[ \t]*?\/\/.*\r?\n?)+))[\r\n]*/gm,
  cg: {
    indent: 1,
    wholeComment: 2,
    contentStart: 3
  },
  middle: [/^[ \t]*\*/gm, /^[ \t]*\*/gm, /^[ \t]*\/\//gm],
  name: "JavaScript",
  info: [{
    type: "multiline",
    apidoc: true
  }, {
    type: "multiline"
  }, {
    type: "singleline"
  }]
}
```

* **regex** is the actual regular expression. It matches the comments in a string,
including any empty lines after the comment.
* **cg** are constant values refering to capturing groups of the regex.
  - `match[cg.indent]` contains the spaces that indent comment-start-delimiter.
  - `match[cg.wholeComment]` matches the comment including delimiters.
  - `match[cg.contentStart]` is the first group that captures the contents of the comment
In this case, there are multiple possible delimiters, so dependending on which
delimiter is used, `match[cg.contentStart]` or `match[cg.contentStart + 1]` is
filled. the others are undefined.
* **middle** contains one pattern for each group after `  cg.contentStart` that matches
the prefix used before comment lines. It can be used to remove this prefix.
If the middle-prefix for this capturing group is empty (`''`), the pattern is `null`.
* **info** contains additional information for each group after `  cg.contentStart`, currently
this information is only `{ apidocs: true }` if the group is matching an apidoc comment.
* **name** is the language name for debugging purposes.

## Variation (codeContext)

For API-documentation, it is important to determine the context of the comment (i.e.
the thing that the comment is documenting). Although this does not strictly belong to
the comment itself, this library also has methods to determine the code-context of a comment
These are functions that return a json by matching a single-line of code against a regular expression.

```js
var detector = commentPattern.codeContext("filename.js");
var cc = detector("function abc(param1,param2) {",2);
```

The result in `cc` will be

```js
{
  begin: 2,
  type: "function statement",
  name: "abc",
  params: ["param1", "param2"],
  string: "abc()",
  original: "function abc(param1,param2) {"
}
```

This result (for 'JavaScript' is actuall taken from the `parse-code-context` module by Jon Schlinkert.
The method `codeContext` returns a `Detector`

## API-Reference

### [commentPattern](index.js#L30)

Load the comment-pattern for a given file.
The file-language is determined by the file-extension.

**Params**

* `filename` **{string}**: the name of the file
* `returns` **{object}**: the comment-patterns

### [.commentPattern.regex](index.js#L49)

Load the comment-regex for a given file.
The result contains a regex that matches the comments
in the specification. It also has information about
which the different capturing groups of an object.

**Params**

* `filename` **{string}**: the name of the file
* `returns` **{object}**: an object containing regular expressions and capturing-group metadata, see usage example for details

### The code-context detector

### [Detector](lib/detector.js#L18)

Create a new detector. A detector contains a list of parsers which extract the
code context from a list of nodes.
It is an immutable object that can be `extend`ed, creating a new instance with more parsers.

**Params**

* **{function(string)}**: parsers

### [.extend](lib/detector.js#L27)

Creates an extended Detector with additional parsers. A new instance will be created.
The old `Detector` remains untouched.

**Params**

* **{function(string)}**: moreParsers more parsers. Those are inserted at the beginning of the list, so they override existing parsers.
* `returns` **{Detector}**: a new Detector instance

### [.detect](lib/detector.js#L40)

Perform detection. This method calls the included parsers one after another
and returns the first-non-null result. The line-number is returned
as `begin`-property in the result, but the parser-function can override it.

**Params**

* **{string}**: string the line-of-code
* **{number}**: lineNr the line-number
* `returns` **{object}**

### [.parser](lib/detector.js#L62)

Helper function to create a parser from a `regex` that matches a string
and a `resolver` that parses the

**Params**

* **{RegExp}**: regex a regular expression that is matched against a code-line.
* **{function(...string)}**: resolver a function that resolves the regex match into a code-context object. The function-parameters are the capturing groups of the regex
* `returns` **{function}**: a function that can be used as parser

## The database

The language-specification can be found in the
`languages`-directory. There is one file
for each language. The actual databases will be
created from these files on `prepublish`.

[The content of language database can be found here](docs/languages.md)

## Contributing

See the [contributing guide](docs/contributing.md)

## Run tests

Install dev dependencies:

```sh
$ npm i -d && npm test
```

## Related

[extract-comments](https://www.npmjs.com/package/extract-comments): Uses esprima to extract line and block comments from a string of JavaScript. Also optionally… [more](https://www.npmjs.com/package/extract-comments) | [homepage](https://github.com/jonschlinkert/extract-comments)

## Author

**Nils Knappmeier**

+ [github/nknapp](https://github.com/nknapp)
* [twitter/knappi79](http://twitter.com/knappi79)

## License

Released under the MIT license.

***


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width">

    <link rel="stylesheet" href="bower_components/sass-bootstrap/dist/css/bootstrap.css" />

    <link rel="stylesheet" href="styles/main.css">