text
stringlengths 4
5.48M
| meta
stringlengths 14
6.54k
|
---|---|
package images // import "github.com/docker/docker/daemon/images"
import (
"context"
"encoding/json"
"fmt"
"sort"
"time"
"github.com/pkg/errors"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"github.com/docker/docker/container"
"github.com/docker/docker/image"
"github.com/docker/docker/layer"
"github.com/docker/docker/pkg/system"
)
var acceptedImageFilterTags = map[string]bool{
"dangling": true,
"label": true,
"before": true,
"since": true,
"reference": true,
}
// byCreated is a temporary type used to sort a list of images by creation
// time.
type byCreated []*types.ImageSummary
func (r byCreated) Len() int { return len(r) }
func (r byCreated) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r byCreated) Less(i, j int) bool { return r[i].Created < r[j].Created }
// Map returns a map of all images in the ImageStore
func (i *ImageService) Map() map[image.ID]*image.Image {
return i.imageStore.Map()
}
// Images returns a filtered list of images.
func (i *ImageService) Images(_ context.Context, opts types.ImageListOptions) ([]*types.ImageSummary, error) {
if err := opts.Filters.Validate(acceptedImageFilterTags); err != nil {
return nil, err
}
var danglingOnly bool
if opts.Filters.Contains("dangling") {
if opts.Filters.ExactMatch("dangling", "true") {
danglingOnly = true
} else if !opts.Filters.ExactMatch("dangling", "false") {
return nil, invalidFilter{"dangling", opts.Filters.Get("dangling")}
}
}
var (
beforeFilter, sinceFilter *image.Image
err error
)
err = opts.Filters.WalkValues("before", func(value string) error {
beforeFilter, err = i.GetImage(value, nil)
return err
})
if err != nil {
return nil, err
}
err = opts.Filters.WalkValues("since", func(value string) error {
sinceFilter, err = i.GetImage(value, nil)
return err
})
if err != nil {
return nil, err
}
var selectedImages map[image.ID]*image.Image
if danglingOnly {
selectedImages = i.imageStore.Heads()
} else {
selectedImages = i.imageStore.Map()
}
var (
summaries = make([]*types.ImageSummary, 0, len(selectedImages))
summaryMap map[*image.Image]*types.ImageSummary
allContainers []*container.Container
)
for id, img := range selectedImages {
if beforeFilter != nil {
if img.Created.Equal(beforeFilter.Created) || img.Created.After(beforeFilter.Created) {
continue
}
}
if sinceFilter != nil {
if img.Created.Equal(sinceFilter.Created) || img.Created.Before(sinceFilter.Created) {
continue
}
}
if opts.Filters.Contains("label") {
// Very old image that do not have image.Config (or even labels)
if img.Config == nil {
continue
}
// We are now sure image.Config is not nil
if !opts.Filters.MatchKVList("label", img.Config.Labels) {
continue
}
}
// Skip any images with an unsupported operating system to avoid a potential
// panic when indexing through the layerstore. Don't error as we want to list
// the other images. This should never happen, but here as a safety precaution.
if !system.IsOSSupported(img.OperatingSystem()) {
continue
}
var size int64
if layerID := img.RootFS.ChainID(); layerID != "" {
l, err := i.layerStore.Get(layerID)
if err != nil {
// The layer may have been deleted between the call to `Map()` or
// `Heads()` and the call to `Get()`, so we just ignore this error
if err == layer.ErrLayerDoesNotExist {
continue
}
return nil, err
}
size, err = l.Size()
layer.ReleaseAndLog(i.layerStore, l)
if err != nil {
return nil, err
}
}
summary := newImageSummary(img, size)
for _, ref := range i.referenceStore.References(id.Digest()) {
if opts.Filters.Contains("reference") {
var found bool
var matchErr error
for _, pattern := range opts.Filters.Get("reference") {
found, matchErr = reference.FamiliarMatch(pattern, ref)
if matchErr != nil {
return nil, matchErr
}
if found {
break
}
}
if !found {
continue
}
}
if _, ok := ref.(reference.Canonical); ok {
summary.RepoDigests = append(summary.RepoDigests, reference.FamiliarString(ref))
}
if _, ok := ref.(reference.NamedTagged); ok {
summary.RepoTags = append(summary.RepoTags, reference.FamiliarString(ref))
}
}
if summary.RepoDigests == nil && summary.RepoTags == nil {
if opts.All || len(i.imageStore.Children(id)) == 0 {
if opts.Filters.Contains("dangling") && !danglingOnly {
// dangling=false case, so dangling image is not needed
continue
}
if opts.Filters.Contains("reference") { // skip images with no references if filtering by reference
continue
}
summary.RepoDigests = []string{"<none>@<none>"}
summary.RepoTags = []string{"<none>:<none>"}
} else {
continue
}
} else if danglingOnly && len(summary.RepoTags) > 0 {
continue
}
if opts.ContainerCount {
// Lazily init allContainers.
if allContainers == nil {
allContainers = i.containers.List()
}
// Get container count
var containers int64
for _, c := range allContainers {
if c.ImageID == id {
containers++
}
}
// NOTE: By default, Containers is -1, or "not set"
summary.Containers = containers
}
if opts.ContainerCount || opts.SharedSize {
// Lazily init summaryMap.
if summaryMap == nil {
summaryMap = make(map[*image.Image]*types.ImageSummary, len(selectedImages))
}
summaryMap[img] = summary
}
summaries = append(summaries, summary)
}
if opts.SharedSize {
allLayers := i.layerStore.Map()
layerRefs := make(map[layer.ChainID]int, len(allLayers))
allImages := selectedImages
if danglingOnly {
// If danglingOnly is true, then selectedImages include only dangling images,
// but we need to consider all existing images to correctly perform reference counting.
// If danglingOnly is false, selectedImages (and, hence, allImages) is already equal to i.imageStore.Map()
// and we can avoid performing an otherwise redundant method call.
allImages = i.imageStore.Map()
}
// Count layer references across all known images
for _, img := range allImages {
rootFS := *img.RootFS
rootFS.DiffIDs = nil
for _, id := range img.RootFS.DiffIDs {
rootFS.Append(id)
layerRefs[rootFS.ChainID()]++
}
}
// Get Shared sizes
for img, summary := range summaryMap {
rootFS := *img.RootFS
rootFS.DiffIDs = nil
// Indicate that we collected shared size information (default is -1, or "not set")
summary.SharedSize = 0
for _, id := range img.RootFS.DiffIDs {
rootFS.Append(id)
chid := rootFS.ChainID()
if layerRefs[chid] > 1 {
if _, ok := allLayers[chid]; !ok {
return nil, fmt.Errorf("layer %v was not found (corruption?)", chid)
}
diffSize, err := allLayers[chid].DiffSize()
if err != nil {
return nil, err
}
summary.SharedSize += diffSize
}
}
}
}
sort.Sort(sort.Reverse(byCreated(summaries)))
return summaries, nil
}
// SquashImage creates a new image with the diff of the specified image and the specified parent.
// This new image contains only the layers from it's parent + 1 extra layer which contains the diff of all the layers in between.
// The existing image(s) is not destroyed.
// If no parent is specified, a new image with the diff of all the specified image's layers merged into a new layer that has no parents.
func (i *ImageService) SquashImage(id, parent string) (string, error) {
var (
img *image.Image
err error
)
if img, err = i.imageStore.Get(image.ID(id)); err != nil {
return "", err
}
var parentImg *image.Image
var parentChainID layer.ChainID
if len(parent) != 0 {
parentImg, err = i.imageStore.Get(image.ID(parent))
if err != nil {
return "", errors.Wrap(err, "error getting specified parent layer")
}
parentChainID = parentImg.RootFS.ChainID()
} else {
rootFS := image.NewRootFS()
parentImg = &image.Image{RootFS: rootFS}
}
if !system.IsOSSupported(img.OperatingSystem()) {
return "", errors.Wrap(err, system.ErrNotSupportedOperatingSystem.Error())
}
l, err := i.layerStore.Get(img.RootFS.ChainID())
if err != nil {
return "", errors.Wrap(err, "error getting image layer")
}
defer i.layerStore.Release(l)
ts, err := l.TarStreamFrom(parentChainID)
if err != nil {
return "", errors.Wrapf(err, "error getting tar stream to parent")
}
defer ts.Close()
newL, err := i.layerStore.Register(ts, parentChainID)
if err != nil {
return "", errors.Wrap(err, "error registering layer")
}
defer i.layerStore.Release(newL)
newImage := *img
newImage.RootFS = nil
rootFS := *parentImg.RootFS
rootFS.DiffIDs = append(rootFS.DiffIDs, newL.DiffID())
newImage.RootFS = &rootFS
for i, hi := range newImage.History {
if i >= len(parentImg.History) {
hi.EmptyLayer = true
}
newImage.History[i] = hi
}
now := time.Now()
var historyComment string
if len(parent) > 0 {
historyComment = fmt.Sprintf("merge %s to %s", id, parent)
} else {
historyComment = fmt.Sprintf("create new from %s", id)
}
newImage.History = append(newImage.History, image.History{
Created: now,
Comment: historyComment,
})
newImage.Created = now
b, err := json.Marshal(&newImage)
if err != nil {
return "", errors.Wrap(err, "error marshalling image config")
}
newImgID, err := i.imageStore.Create(b)
if err != nil {
return "", errors.Wrap(err, "error creating new image after squash")
}
return string(newImgID), nil
}
func newImageSummary(image *image.Image, size int64) *types.ImageSummary {
summary := &types.ImageSummary{
ParentID: image.Parent.String(),
ID: image.ID().String(),
Created: image.Created.Unix(),
Size: size,
VirtualSize: size,
// -1 indicates that the value has not been set (avoids ambiguity
// between 0 (default) and "not set". We cannot use a pointer (nil)
// for this, as the JSON representation uses "omitempty", which would
// consider both "0" and "nil" to be "empty".
SharedSize: -1,
Containers: -1,
}
if image.Config != nil {
summary.Labels = image.Config.Labels
}
return summary
}
| {'content_hash': '884c7bf8df399d55c8c9802de5c55e17', 'timestamp': '', 'source': 'github', 'line_count': 367, 'max_line_length': 136, 'avg_line_length': 27.88283378746594, 'alnum_prop': 0.6673507280367439, 'repo_name': 'docker/docker', 'id': 'e756bc334d3999f3ced6cd6e9744fbc75c3e1087', 'size': '10233', 'binary': False, 'copies': '9', 'ref': 'refs/heads/master', 'path': 'daemon/images/images.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '81'}, {'name': 'C', 'bytes': '5027'}, {'name': 'Go', 'bytes': '7330577'}, {'name': 'Makefile', 'bytes': '12708'}, {'name': 'PowerShell', 'bytes': '23242'}, {'name': 'Protocol Buffer', 'bytes': '119'}, {'name': 'Shell', 'bytes': '507547'}, {'name': 'Vim script', 'bytes': '1350'}]} |
namespace base {
class DictionaryValue;
class Value;
}
namespace rlz_lib {
// An implementation of RlzValueStore for ChromeOS.
class RlzValueStoreChromeOS : public RlzValueStore {
public:
// The maximum retry times allowed for |SetRlzPingSent|.
static const int kMaxRetryCount;
// Creates new instance and synchronously reads data from file.
explicit RlzValueStoreChromeOS(const base::FilePath& store_path);
~RlzValueStoreChromeOS() override;
// RlzValueStore overrides:
bool HasAccess(AccessType type) override;
bool WritePingTime(Product product, int64_t time) override;
bool ReadPingTime(Product product, int64_t* time) override;
bool ClearPingTime(Product product) override;
bool WriteAccessPointRlz(AccessPoint access_point,
const char* new_rlz) override;
bool ReadAccessPointRlz(AccessPoint access_point,
char* rlz,
size_t rlz_size) override;
bool ClearAccessPointRlz(AccessPoint access_point) override;
bool UpdateExistingAccessPointRlz(const std::string& brand) override;
bool AddProductEvent(Product product, const char* event_rlz) override;
bool ReadProductEvents(Product product,
std::vector<std::string>* events) override;
bool ClearProductEvent(Product product, const char* event_rlz) override;
bool ClearAllProductEvents(Product product) override;
bool AddStatefulEvent(Product product, const char* event_rlz) override;
bool IsStatefulEvent(Product product, const char* event_rlz) override;
bool ClearAllStatefulEvents(Product product) override;
void CollectGarbage() override;
private:
// Returns true if the |rlz_embargo_end_date| present in VPD has passed
// compared to the current time.
static bool HasRlzEmbargoEndDatePassed();
// Reads RLZ store from file.
void ReadStore();
// Writes RLZ store back to file.
void WriteStore();
// Adds |value| to list at |list_name| path in JSON store.
bool AddValueToList(const std::string& list_name,
std::unique_ptr<base::Value> value);
// Removes |value| from list at |list_name| path in JSON store.
bool RemoveValueFromList(const std::string& list_name,
const base::Value& value);
// Returns true if the store contains |access_point|.
bool HasAccessPointRlz(AccessPoint access_point) const;
// In-memory store with RLZ data.
std::unique_ptr<base::DictionaryValue> rlz_store_;
base::FilePath store_path_;
bool read_only_;
SEQUENCE_CHECKER(sequence_checker_);
DISALLOW_COPY_AND_ASSIGN(RlzValueStoreChromeOS);
};
} // namespace rlz_lib
#endif // RLZ_CHROMEOS_LIB_RLZ_VALUE_STORE_CHROMEOS_H_
| {'content_hash': 'bfa1ebc1882cb6e6e5b37213052add1f', 'timestamp': '', 'source': 'github', 'line_count': 80, 'max_line_length': 74, 'avg_line_length': 33.85, 'alnum_prop': 0.7182422451994092, 'repo_name': 'endlessm/chromium-browser', 'id': 'a42b6d477eae2149382e60694d10b0cc4017644f', 'size': '3177', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'rlz/chromeos/lib/rlz_value_store_chromeos.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
export {
SkyAvatarModule
} from '@skyux/avatar/modules/avatar/avatar.module';
| {'content_hash': '6500ce36f87ca68673fcad3902a4d38c', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 52, 'avg_line_length': 26.666666666666668, 'alnum_prop': 0.7625, 'repo_name': 'blackbaud/skyux2', 'id': 'd2849db2e77a16434aa3e1fcb2a34cbd61e78943', 'size': '80', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/modules/avatar/avatar.module.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2382'}, {'name': 'HTML', 'bytes': '111218'}, {'name': 'JavaScript', 'bytes': '44123'}, {'name': 'Shell', 'bytes': '4785'}, {'name': 'TypeScript', 'bytes': '269098'}]} |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static play.mvc.Http.Status.BAD_REQUEST;
import static play.mvc.Http.Status.NOT_FOUND;
import static play.mvc.Http.Status.OK;
import static play.test.Helpers.callAction;
import static play.test.Helpers.contentAsString;
import static play.test.Helpers.fakeApplication;
import static play.test.Helpers.fakeRequest;
import static play.test.Helpers.inMemoryDatabase;
import static play.test.Helpers.start;
import static play.test.Helpers.status;
import static play.test.Helpers.stop;
import java.util.HashMap;
import java.util.Map;
import models.Address;
import models.Product;
import models.Tag;
import models.Warehouse;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import play.mvc.Result;
import play.test.FakeApplication;
import play.test.FakeRequest;
public class ControllerTest {
private FakeApplication application;
@Before
public void startApp() {
application = fakeApplication(inMemoryDatabase());
start(application);
}
@After
public void stopApp(){
stop(application);
}
@Test
public void testProductController(){
//test GET /product on an empty database
Result result = callAction(controllers.routes.ref.Product.index());
assertTrue("Empty products", contentAsString(result).contains("No products"));
//test GET /product on a database containing a single product.
String productId = "Product-01";
Product product = new Product(productId, "French press", "Coffee Maker");
product.save();
result = callAction(controllers.routes.ref.Product.index());
assertTrue("One product", contentAsString(result).contains(productId));
//test GET /product/Product-01
result = callAction(controllers.routes.ref.Product.details(productId));
assertTrue("Product detail", contentAsString(result).contains(productId));
//test GET /product/BadProductId and make sure get a 404
result = callAction(controllers.routes.ref.Product.details("BadProductId"));
assertEquals("Product detail (bad)", NOT_FOUND, status(result));
//Test POST /products (with simulated, valid form data)
Map<String, String> productData = new HashMap<String, String>();
productData.put("productId", "Product-02");
productData.put("name", "Baby Gaggia");
productData.put("description", "Espresso machine");
FakeRequest request = fakeRequest();
request.withFormUrlEncodedBody(productData);
result = callAction(controllers.routes.ref.Product.newProduct(), request);
assertEquals("Create new product", OK, status(result));
//Test POST /products (with simulated invalid data)
request = fakeRequest();
result = callAction(controllers.routes.ref.Product.newProduct(), request);
assertEquals("Create bad product fails", BAD_REQUEST, status(result));
//test DELETE /products/Product-01 (a valid productId)
result = callAction(controllers.routes.ref.Product.delete(productId));
assertEquals("Delete current product OK", OK, status(result));
result = callAction(controllers.routes.ref.Product.details(productId));
assertEquals("Deleted product gone", NOT_FOUND, status(result));
result = callAction(controllers.routes.ref.Product.delete(productId));
assertEquals("Delete missing product also OK", OK, status(result));
} //end test product controller
@Test
public void testTagController() {
//test GET /tags on an empty database
Result result = callAction(controllers.routes.ref.Tag.index());
assertTrue("empty tags", contentAsString(result).contains("No Tags"));
//test GET /tag on a database containing a single tag
String tagId = "Tag-01";
Tag tag = new Tag(tagId);
tag.save();
result = callAction(controllers.routes.ref.Tag.index());
assertTrue("One tag", contentAsString(result).contains(tagId));
//Test GET /tags/Tag-01
result = callAction(controllers.routes.ref.Tag.details(tagId));
assertTrue("Tag detail", contentAsString(result).contains(tagId));
//test GET /tags/BadTagId and make sure get a 404
result = callAction(controllers.routes.ref.Tag.details("BadTagId"));
assertEquals("Tag detail (bad)", NOT_FOUND, status(result));
//Test POST /tags (with simulated, valid form data)
Map<String, String> tagData = new HashMap<String, String>();
tagData.put("tagId", "Tag-02");
FakeRequest request = fakeRequest();
request.withFormUrlEncodedBody(tagData);
result = callAction(controllers.routes.ref.Tag.newTag(), request);
assertEquals("Create new tag", OK, status(result));
//Test POST /tags (with invalid tag: tags cannot be named "Tag").
request = fakeRequest();
tagData.put("tagId", "Tag");
request.withFormUrlEncodedBody(tagData);
result = callAction(controllers.routes.ref.Tag.newTag(), request);
assertEquals("Create bad tag fails", BAD_REQUEST, status(result));
//Test DELETE /tags/Tag-01 (a valid tag)
result = callAction(controllers.routes.ref.Tag.delete(tagId));
assertEquals("Delete current tag OK", OK, status(result));
result = callAction(controllers.routes.ref.Tag.details(tagId));
assertEquals("Delete tag gone", NOT_FOUND, status(result));
result = callAction(controllers.routes.ref.Tag.delete(tagId));
assertEquals("Delete missing tag also OK", OK, status(result));
}
@Test
public void testWarehouseController() {
//test GET on empty
Result result = callAction(controllers.routes.ref.Warehouse.index());
assertTrue("Empty warehouses", contentAsString(result).contains("No warehouses"));
//test GET on a database containing a single warehouse
//NOTE: warehouses need an existing address inorder to be made.
String addr1Id = "Address-01";
models.Address addr = new models.Address(addr1Id, "Hawaii street");
addr.save();
String warehouseId = "Warehouse-01";
models.Warehouse warehouse = new models.Warehouse(warehouseId, "Costgo", addr1Id);
warehouse.save();
result = callAction(controllers.routes.ref.Warehouse.index());
assertTrue("One warehouse item", contentAsString(result).contains(warehouseId));
//test GET /warehouses/Warehouse-01
result = callAction(controllers.routes.ref.Warehouse.details(warehouseId));
assertTrue("Warehouse detail", contentAsString(result).contains(warehouseId));
//test Get /warehouses/BadId
result = callAction(controllers.routes.ref.Warehouse.details("BadId"));
assertEquals("Warehouse detail (bad)", NOT_FOUND, status(result));
//Test POST /warehouses (with simulated, valid form data)
//Note: addresses and warehouse have 1:1 cardinality, need to make new address.
String addrId2 = "Address-02";
models.Address addr2 = new models.Address(addrId2, "Also Hawaii street");
addr2.save();
Map<String, String> warehouseData = new HashMap<String,String>();
warehouseData.put("warehouseId", "Warehouse-02");
warehouseData.put("name", "Costgo-02");
warehouseData.put("addressId", addrId2);
FakeRequest request = fakeRequest();
request.withFormUrlEncodedBody(warehouseData);
result = callAction(controllers.routes.ref.Warehouse.newWarehouse(), request);
//assertEquals("Created new warehouse" + contentAsString(result), 000, status(result));
assertEquals("Created new warehouse" + contentAsString(result), OK, status(result));
// Make sure our newly created warehouse has an Address entity.
Warehouse warehouse02 = Warehouse.find().where().eq("warehouseId", "Warehouse-02").findUnique();
assertNotNull("Warehouse 02 has an address", warehouse02.getAddress());
//Test POST /warehouse with invalid address
request = fakeRequest();
warehouseData.put("address", "This address doesn't exsit");
request.withFormUrlEncodedBody(warehouseData);
result = callAction(controllers.routes.ref.Warehouse.newWarehouse(), request);
assertEquals("Create bad warehouse fails (non-existent address)", BAD_REQUEST, status(result));
//Test POST /warehouse with missing name
Map<String, String> warehouseData2 = new HashMap<String,String>();
warehouseData2.put("warehouseId", "Warehouse-02");
warehouseData2.put("address", addrId2);
request = fakeRequest();
request.withFormUrlEncodedBody(warehouseData2);
result = callAction(controllers.routes.ref.Warehouse.newWarehouse(), request);
assertEquals("Create bad warehouse fails (missing name)", BAD_REQUEST, status(result));
//Test DELETE /warehouse/Warehouse-01 (a valid warehouse)
result = callAction(controllers.routes.ref.Warehouse.delete(warehouseId));
assertEquals("Delete the warehouse OK", OK, status(result));
result = callAction(controllers.routes.ref.Warehouse.details(warehouseId));
assertEquals("Warehouse is not retrievable", NOT_FOUND, status(result));
result = callAction(controllers.routes.ref.Warehouse.delete(warehouseId));
assertEquals("Delete missing warehouse also OK", OK, status(result));
}
@Test
public void testStockItemController() {
//test GET on empty
Result result = callAction(controllers.routes.ref.StockItem.index());
assertTrue("Empty stock items", contentAsString(result).contains("No stockItems"));
//test GET on a database containing a single stockItem.
//NOTE: need existing product and warehouse to make a stock item.
//ALSO NOTE: a warehouse needs an existing address
String addr1Id = "Address-01";
models.Address addr = new models.Address(addr1Id, "Hawaii street location");
addr.save();
String whId = "Warehouse-01";
models.Warehouse wh = new models.Warehouse(whId, "Costgo", addr1Id);
wh.save();
String prodId = "Product-01";
models.Product prod = new models.Product(prodId, "French Press", "Coffee machine");
prod.save();
String stockItemId = "StockItem-01";
models.StockItem stockItem = new models.StockItem(stockItemId, whId, prodId, 10);
stockItem.save();
result = callAction(controllers.routes.ref.StockItem.details(stockItemId));
assertTrue("One stock item", contentAsString(result).contains(stockItemId));
}
}
| {'content_hash': '711bc120ddf2e1f73215c970e47b209d', 'timestamp': '', 'source': 'github', 'line_count': 235, 'max_line_length': 100, 'avg_line_length': 43.94042553191489, 'alnum_prop': 0.7198334301762541, 'repo_name': 'khiraide/Warehouse-1', 'id': '99c14e4159b69672aa60eb055d9e3646d6345c46', 'size': '10326', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/ControllerTest.java', 'mode': '33188', 'license': 'mit', 'language': []} |
package net.kr9ly.entitysupports;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface EqualsSupport {
}
| {'content_hash': '280961773016f1ec225bb1dbf7dea763', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 44, 'avg_line_length': 24.583333333333332, 'alnum_prop': 0.8305084745762712, 'repo_name': 'kr9ly/entity-supports', 'id': 'a07bfa5d32ca6bffbc742a063ccb7cfee130bc97', 'size': '901', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/net/kr9ly/entitysupports/EqualsSupport.java', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '3609'}, {'name': 'Shell', 'bytes': '498'}]} |
package evs4j.impl.message;
public class Buffer {
/**
* The array of bytes containing
* the data.
*/
private byte[] data;
public byte[] getData() {
return data;
}
/**
* The number of useful bytes in the data array.
* This property is needed because the byte arrays
* are fixed length, to allows us to pool them.
*/
private int length;
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
public Buffer(int length) {
this.data = new byte[Message.MAX_PACKET_SIZE];
this.length = length;
}
/**
* Returns a MessageBuffer that contains a copy of the
* data contained in this MessageBuffer.
*/
public Buffer copy() {
Buffer buffer = new Buffer(length);
System.arraycopy(this.data, 0,
buffer.data, 0,
length);
return buffer;
}
}
| {'content_hash': 'a32f775002de2273988c06559f02f810', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 59, 'avg_line_length': 18.333333333333332, 'alnum_prop': 0.5957219251336898, 'repo_name': 'akivalichtner/evs4j', 'id': 'b6eff55f80bd6103e2b00bcc331de08aa208653e', 'size': '1581', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/evs4j/impl/message/Buffer.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '175466'}]} |
#ifndef ZLMEDIAKIT_RTMPCODEC_H
#define ZLMEDIAKIT_RTMPCODEC_H
#include "Rtmp/Rtmp.h"
#include "Extension/Frame.h"
#include "Util/RingBuffer.h"
using namespace toolkit;
namespace mediakit{
class RtmpRing{
public:
typedef std::shared_ptr<RtmpRing> Ptr;
typedef RingBuffer<RtmpPacket::Ptr> RingType;
RtmpRing() {}
virtual ~RtmpRing() {}
/**
* 获取rtmp环形缓存
* @return
*/
virtual RingType::Ptr getRtmpRing() const {
return _rtmpRing;
}
/**
* 设置rtmp环形缓存
* @param ring
*/
virtual void setRtmpRing(const RingType::Ptr &ring) {
_rtmpRing = ring;
}
/**
* 输入rtmp包
* @param rtmp rtmp包
*/
virtual void inputRtmp(const RtmpPacket::Ptr &rtmp) {
if (_rtmpRing) {
_rtmpRing->write(rtmp, rtmp->isVideoKeyFrame());
}
}
protected:
RingType::Ptr _rtmpRing;
};
class RtmpCodec : public RtmpRing, public FrameDispatcher , public CodecInfo{
public:
typedef std::shared_ptr<RtmpCodec> Ptr;
RtmpCodec(){}
virtual ~RtmpCodec(){}
virtual void makeConfigPacket() {};
};
}//namespace mediakit
#endif //ZLMEDIAKIT_RTMPCODEC_H
| {'content_hash': '8ca8b9d08977b8538de9dff580bbb2ce', 'timestamp': '', 'source': 'github', 'line_count': 61, 'max_line_length': 77, 'avg_line_length': 19.131147540983605, 'alnum_prop': 0.6246786632390745, 'repo_name': 'xiongziliang/ZLMediaKit', 'id': '15a4496a38371caaed6d43035f18b0deb8a09755', 'size': '1596', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Rtmp/RtmpCodec.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '7790839'}, {'name': 'CMake', 'bytes': '141555'}, {'name': 'HTML', 'bytes': '287'}, {'name': 'Java', 'bytes': '6202'}, {'name': 'Objective-C', 'bytes': '5915'}, {'name': 'Shell', 'bytes': '1614'}]} |
package org.apache.camel.component.sql;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.camel.Exchange;
import org.apache.camel.ExtendedExchange;
import org.apache.camel.support.DefaultProducer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCallback;
import org.springframework.jdbc.core.PreparedStatementCreator;
import static org.springframework.jdbc.support.JdbcUtils.closeConnection;
import static org.springframework.jdbc.support.JdbcUtils.closeResultSet;
import static org.springframework.jdbc.support.JdbcUtils.closeStatement;
public class SqlProducer extends DefaultProducer {
private static final Logger LOG = LoggerFactory.getLogger(SqlProducer.class);
private final String query;
private String resolvedQuery;
private final JdbcTemplate jdbcTemplate;
private final boolean batch;
private final boolean alwaysPopulateStatement;
private final SqlPrepareStatementStrategy sqlPrepareStatementStrategy;
private final boolean useMessageBodyForSql;
private int parametersCount;
public SqlProducer(SqlEndpoint endpoint, String query, JdbcTemplate jdbcTemplate, SqlPrepareStatementStrategy sqlPrepareStatementStrategy,
boolean batch, boolean alwaysPopulateStatement, boolean useMessageBodyForSql) {
super(endpoint);
this.jdbcTemplate = jdbcTemplate;
this.sqlPrepareStatementStrategy = sqlPrepareStatementStrategy;
this.query = query;
this.batch = batch;
this.alwaysPopulateStatement = alwaysPopulateStatement;
this.useMessageBodyForSql = useMessageBodyForSql;
}
@Override
public SqlEndpoint getEndpoint() {
return (SqlEndpoint) super.getEndpoint();
}
@Override
protected void doStart() throws Exception {
super.doStart();
String placeholder = getEndpoint().isUsePlaceholder() ? getEndpoint().getPlaceholder() : null;
resolvedQuery = SqlHelper.resolveQuery(getEndpoint().getCamelContext(), query, placeholder);
}
@Override
public void process(final Exchange exchange) throws Exception {
final String sql;
if (useMessageBodyForSql) {
sql = exchange.getIn().getBody(String.class);
} else {
String queryHeader = exchange.getIn().getHeader(SqlConstants.SQL_QUERY, String.class);
sql = queryHeader != null ? queryHeader : resolvedQuery;
}
final String preparedQuery = sqlPrepareStatementStrategy.prepareQuery(sql, getEndpoint().isAllowNamedParameters(), exchange);
final Boolean shouldRetrieveGeneratedKeys =
exchange.getIn().getHeader(SqlConstants.SQL_RETRIEVE_GENERATED_KEYS, false, Boolean.class);
PreparedStatementCreator statementCreator = new PreparedStatementCreator() {
@Override
public PreparedStatement createPreparedStatement(Connection con) throws SQLException {
if (!shouldRetrieveGeneratedKeys) {
return con.prepareStatement(preparedQuery);
} else {
Object expectedGeneratedColumns = exchange.getIn().getHeader(SqlConstants.SQL_GENERATED_COLUMNS);
if (expectedGeneratedColumns == null) {
return con.prepareStatement(preparedQuery, Statement.RETURN_GENERATED_KEYS);
} else if (expectedGeneratedColumns instanceof String[]) {
return con.prepareStatement(preparedQuery, (String[]) expectedGeneratedColumns);
} else if (expectedGeneratedColumns instanceof int[]) {
return con.prepareStatement(preparedQuery, (int[]) expectedGeneratedColumns);
} else {
throw new IllegalArgumentException(
"Header specifying expected returning columns isn't an instance of String[] or int[] but "
+ expectedGeneratedColumns.getClass());
}
}
}
};
// special for processing stream list (batch not supported)
SqlOutputType outputType = getEndpoint().getOutputType();
if (outputType == SqlOutputType.StreamList) {
processStreamList(exchange, statementCreator, sql, preparedQuery);
return;
}
LOG.trace("jdbcTemplate.execute: {}", preparedQuery);
jdbcTemplate.execute(statementCreator, new PreparedStatementCallback<Map<?, ?>>() {
public Map<?, ?> doInPreparedStatement(PreparedStatement ps) throws SQLException {
ResultSet rs = null;
try {
int expected = parametersCount > 0 ? parametersCount : ps.getParameterMetaData().getParameterCount();
// only populate if really needed
if (alwaysPopulateStatement || expected > 0) {
// transfer incoming message body data to prepared statement parameters, if necessary
if (batch) {
Iterator<?> iterator;
if (useMessageBodyForSql) {
iterator = exchange.getIn().getHeader(SqlConstants.SQL_PARAMETERS, Iterator.class);
} else {
iterator = exchange.getIn().getBody(Iterator.class);
}
while (iterator != null && iterator.hasNext()) {
Object value = iterator.next();
Iterator<?> i = sqlPrepareStatementStrategy.createPopulateIterator(sql, preparedQuery, expected, exchange, value);
sqlPrepareStatementStrategy.populateStatement(ps, i, expected);
ps.addBatch();
}
} else {
Object value;
if (useMessageBodyForSql) {
value = exchange.getIn().getHeader(SqlConstants.SQL_PARAMETERS);
} else {
value = exchange.getIn().getBody();
}
Iterator<?> i = sqlPrepareStatementStrategy.createPopulateIterator(sql, preparedQuery, expected, exchange, value);
sqlPrepareStatementStrategy.populateStatement(ps, i, expected);
}
}
boolean isResultSet = false;
// execute the prepared statement and populate the outgoing message
if (batch) {
int[] updateCounts = ps.executeBatch();
int total = 0;
for (int count : updateCounts) {
total += count;
}
exchange.getIn().setHeader(SqlConstants.SQL_UPDATE_COUNT, total);
} else {
isResultSet = ps.execute();
if (isResultSet) {
// preserve headers first, so we can override the SQL_ROW_COUNT header
exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
rs = ps.getResultSet();
SqlOutputType outputType = getEndpoint().getOutputType();
LOG.trace("Got result list from query: {}, outputType={}", rs, outputType);
if (outputType == SqlOutputType.SelectList) {
List<?> data = getEndpoint().queryForList(rs, true);
// for noop=true we still want to enrich with the row count header
if (getEndpoint().isNoop()) {
exchange.getOut().setBody(exchange.getIn().getBody());
} else if (getEndpoint().getOutputHeader() != null) {
exchange.getOut().setBody(exchange.getIn().getBody());
exchange.getOut().setHeader(getEndpoint().getOutputHeader(), data);
} else {
exchange.getOut().setBody(data);
}
exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, data.size());
} else if (outputType == SqlOutputType.SelectOne) {
Object data = getEndpoint().queryForObject(rs);
if (data != null) {
// for noop=true we still want to enrich with the row count header
if (getEndpoint().isNoop()) {
exchange.getOut().setBody(exchange.getIn().getBody());
} else if (getEndpoint().getOutputHeader() != null) {
exchange.getOut().setBody(exchange.getIn().getBody());
exchange.getOut().setHeader(getEndpoint().getOutputHeader(), data);
} else {
exchange.getOut().setBody(data);
}
exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, 1);
} else {
if (getEndpoint().isNoop()) {
exchange.getOut().setBody(exchange.getIn().getBody());
} else if (getEndpoint().getOutputHeader() != null) {
exchange.getOut().setBody(exchange.getIn().getBody());
}
exchange.getOut().setHeader(SqlConstants.SQL_ROW_COUNT, 0);
}
} else {
throw new IllegalArgumentException("Invalid outputType=" + outputType);
}
} else {
exchange.getIn().setHeader(SqlConstants.SQL_UPDATE_COUNT, ps.getUpdateCount());
}
}
if (shouldRetrieveGeneratedKeys) {
// if no OUT message yet then create one and propagate headers
if (!exchange.hasOut()) {
exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
}
if (isResultSet) {
// we won't return generated keys for SELECT statements
exchange.getOut().setHeader(SqlConstants.SQL_GENERATED_KEYS_DATA, Collections.EMPTY_LIST);
exchange.getOut().setHeader(SqlConstants.SQL_GENERATED_KEYS_ROW_COUNT, 0);
} else {
List<?> generatedKeys = getEndpoint().queryForList(ps.getGeneratedKeys(), false);
exchange.getOut().setHeader(SqlConstants.SQL_GENERATED_KEYS_DATA, generatedKeys);
exchange.getOut().setHeader(SqlConstants.SQL_GENERATED_KEYS_ROW_COUNT, generatedKeys.size());
}
}
// data is set on exchange so return null
return null;
} finally {
closeResultSet(rs);
}
}
});
}
protected void processStreamList(Exchange exchange, PreparedStatementCreator statementCreator, String sql, String preparedQuery) throws Exception {
LOG.trace("processStreamList: {}", preparedQuery);
// do not use the jdbcTemplate as it will auto-close connection/ps/rs when exiting the execute method
// and we need to keep the connection alive while routing and close it when the Exchange is done being routed
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
con = jdbcTemplate.getDataSource().getConnection();
ps = statementCreator.createPreparedStatement(con);
int expected = parametersCount > 0 ? parametersCount : ps.getParameterMetaData().getParameterCount();
// only populate if really needed
if (alwaysPopulateStatement || expected > 0) {
// transfer incoming message body data to prepared statement parameters, if necessary
if (batch) {
Iterator<?> iterator;
if (useMessageBodyForSql) {
iterator = exchange.getIn().getHeader(SqlConstants.SQL_PARAMETERS, Iterator.class);
} else {
iterator = exchange.getIn().getBody(Iterator.class);
}
while (iterator != null && iterator.hasNext()) {
Object value = iterator.next();
Iterator<?> i = sqlPrepareStatementStrategy.createPopulateIterator(sql, preparedQuery, expected, exchange, value);
sqlPrepareStatementStrategy.populateStatement(ps, i, expected);
ps.addBatch();
}
} else {
Object value;
if (useMessageBodyForSql) {
value = exchange.getIn().getHeader(SqlConstants.SQL_PARAMETERS);
} else {
value = exchange.getIn().getBody();
}
Iterator<?> i = sqlPrepareStatementStrategy.createPopulateIterator(sql, preparedQuery, expected, exchange, value);
sqlPrepareStatementStrategy.populateStatement(ps, i, expected);
}
}
boolean isResultSet = ps.execute();
if (isResultSet) {
rs = ps.getResultSet();
ResultSetIterator iterator = getEndpoint().queryForStreamList(con, ps, rs);
//pass through all headers
exchange.getOut().getHeaders().putAll(exchange.getIn().getHeaders());
if (getEndpoint().isNoop()) {
exchange.getOut().setBody(exchange.getIn().getBody());
} else if (getEndpoint().getOutputHeader() != null) {
exchange.getOut().setBody(exchange.getIn().getBody());
exchange.getOut().setHeader(getEndpoint().getOutputHeader(), iterator);
} else {
exchange.getOut().setBody(iterator);
}
// we do not know the row count so we cannot set a ROW_COUNT header
// defer closing the iterator when the exchange is complete
exchange.adapt(ExtendedExchange.class).addOnCompletion(new ResultSetIteratorCompletion(iterator));
}
} catch (Exception e) {
// in case of exception then close all this before rethrow
closeConnection(con);
closeStatement(ps);
closeResultSet(rs);
throw e;
}
}
public void setParametersCount(int parametersCount) {
this.parametersCount = parametersCount;
}
}
| {'content_hash': '9cae3f2406bf182212a9609c96193839', 'timestamp': '', 'source': 'github', 'line_count': 302, 'max_line_length': 151, 'avg_line_length': 52.51655629139073, 'alnum_prop': 0.5432534678436318, 'repo_name': 'ullgren/camel', 'id': '49acb557871c065a3091f81bc5913401053130f6', 'size': '16662', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlProducer.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Apex', 'bytes': '6519'}, {'name': 'Batchfile', 'bytes': '1518'}, {'name': 'CSS', 'bytes': '16394'}, {'name': 'Elm', 'bytes': '10852'}, {'name': 'FreeMarker', 'bytes': '11410'}, {'name': 'Groovy', 'bytes': '14490'}, {'name': 'HTML', 'bytes': '896075'}, {'name': 'Java', 'bytes': '69929414'}, {'name': 'JavaScript', 'bytes': '90399'}, {'name': 'Makefile', 'bytes': '513'}, {'name': 'Shell', 'bytes': '17108'}, {'name': 'Tcl', 'bytes': '4974'}, {'name': 'Thrift', 'bytes': '6979'}, {'name': 'XQuery', 'bytes': '546'}, {'name': 'XSLT', 'bytes': '270186'}]} |
<?php
namespace closeio;
class Lead extends Methods {
public $route = '/lead';
}
?>
| {'content_hash': 'b9ca8a7a5e0e4753b04e44e124c5b8fc', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 28, 'avg_line_length': 9.88888888888889, 'alnum_prop': 0.6404494382022472, 'repo_name': 'TheDeveloper/closeio-php-sdk', 'id': 'baa563a0cdc821dc67aed30efbc1f01aa785b47d', 'size': '89', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/routes/Lead.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '4170'}]} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': 'abbb8ebe4a2293f6bc27877e313753a7', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': '7436faf12c59eb23f2a33165f1e616d0dbbaac85', 'size': '169', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Ulmaceae/Ulmus/Ulmus scabra/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
package driver
import (
"fmt"
"io"
"regexp"
"strconv"
"strings"
"github.com/docker/distribution/context"
)
// Version is a string representing the storage driver version, of the form
// Major.Minor.
// The registry must accept storage drivers with equal major version and greater
// minor version, but may not be compatible with older storage driver versions.
type Version string
// Major returns the major (primary) component of a version.
func (version Version) Major() uint {
majorPart := strings.Split(string(version), ".")[0]
major, _ := strconv.ParseUint(majorPart, 10, 0)
return uint(major)
}
// Minor returns the minor (secondary) component of a version.
func (version Version) Minor() uint {
minorPart := strings.Split(string(version), ".")[1]
minor, _ := strconv.ParseUint(minorPart, 10, 0)
return uint(minor)
}
// CurrentVersion is the current storage driver Version.
const CurrentVersion Version = "0.1"
// StorageDriver defines methods that a Storage Driver must implement for a
// filesystem-like key/value object storage.
type StorageDriver interface {
// Name returns the human-readable "name" of the driver, useful in error
// messages and logging. By convention, this will just be the registration
// name, but drivers may provide other information here.
Name() string
// GetContent retrieves the content stored at "path" as a []byte.
// This should primarily be used for small objects.
GetContent(ctx context.Context, path string) ([]byte, error)
// PutContent stores the []byte content at a location designated by "path".
// This should primarily be used for small objects.
PutContent(ctx context.Context, path string, content []byte) error
// ReadStream retrieves an io.ReadCloser for the content stored at "path"
// with a given byte offset.
// May be used to resume reading a stream by providing a nonzero offset.
ReadStream(ctx context.Context, path string, offset int64) (io.ReadCloser, error)
// WriteStream stores the contents of the provided io.ReadCloser at a
// location designated by the given path.
// May be used to resume writing a stream by providing a nonzero offset.
// The offset must be no larger than the CurrentSize for this path.
WriteStream(ctx context.Context, path string, offset int64, reader io.Reader) (nn int64, err error)
// Stat retrieves the FileInfo for the given path, including the current
// size in bytes and the creation time.
Stat(ctx context.Context, path string) (FileInfo, error)
// List returns a list of the objects that are direct descendants of the
//given path.
List(ctx context.Context, path string) ([]string, error)
// Move moves an object stored at sourcePath to destPath, removing the
// original object.
// Note: This may be no more efficient than a copy followed by a delete for
// many implementations.
Move(ctx context.Context, sourcePath string, destPath string) error
// Delete recursively deletes all objects stored at "path" and its subpaths.
Delete(ctx context.Context, path string) error
// URLFor returns a URL which may be used to retrieve the content stored at
// the given path, possibly using the given options.
// May return an ErrUnsupportedMethod in certain StorageDriver
// implementations.
URLFor(ctx context.Context, path string, options map[string]interface{}) (string, error)
}
// PathRegexp is the regular expression which each file path must match. A
// file path is absolute, beginning with a slash and containing a positive
// number of path components separated by slashes, where each component is
// restricted to lowercase alphanumeric characters or a period, underscore, or
// hyphen.
var PathRegexp = regexp.MustCompile(`^(/[A-Za-z0-9._-]+)+$`)
// ErrUnsupportedMethod may be returned in the case where a StorageDriver implementation does not support an optional method.
type ErrUnsupportedMethod struct {
DriverName string
}
func (err ErrUnsupportedMethod) Error() string {
return fmt.Sprintf("[%s] unsupported method", err.DriverName)
}
// PathNotFoundError is returned when operating on a nonexistent path.
type PathNotFoundError struct {
Path string
DriverName string
}
func (err PathNotFoundError) Error() string {
return fmt.Sprintf("[%s] Path not found: %s", err.DriverName, err.Path)
}
// InvalidPathError is returned when the provided path is malformed.
type InvalidPathError struct {
Path string
DriverName string
}
func (err InvalidPathError) Error() string {
return fmt.Sprintf("[%s] Invalid path: %s", err.DriverName, err.Path)
}
// InvalidOffsetError is returned when attempting to read or write from an
// invalid offset.
type InvalidOffsetError struct {
Path string
Offset int64
DriverName string
}
func (err InvalidOffsetError) Error() string {
return fmt.Sprintf("[%s] Invalid offset: %d for path: %s", err.DriverName, err.Offset, err.Path)
}
// Error is a catch-all error type which captures an error string and
// the driver type on which it occured.
type Error struct {
DriverName string
Enclosed error
}
func (err Error) Error() string {
return fmt.Sprintf("[%s] %s", err.DriverName, err.Enclosed)
}
| {'content_hash': 'f7431b0b171220c816e5c7fb075f41ce', 'timestamp': '', 'source': 'github', 'line_count': 144, 'max_line_length': 125, 'avg_line_length': 35.701388888888886, 'alnum_prop': 0.7482979964987356, 'repo_name': 'pdevine/distribution', 'id': 'cd1c883b1186b4b14e4fa2dcb583b4cf280b4efb', 'size': '5141', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'registry/storage/driver/storagedriver.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '1077124'}, {'name': 'Makefile', 'bytes': '2285'}, {'name': 'Nginx', 'bytes': '1198'}, {'name': 'Shell', 'bytes': '13523'}]} |
<?php
/** Zend_Mobile_Push_Message_Mpns **/
#require_once 'Zend/Mobile/Push/Message/Mpns.php';
/**
* Mpns Tile Message
*
* @category Zend
* @package Zend_Mobile
* @subpackage Zend_Mobile_Push
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Mobile_Push_Message_Mpns_Tile extends Zend_Mobile_Push_Message_Mpns
{
/**
* Mpns delays
*
* @var int
*/
const DELAY_IMMEDIATE = 1;
const DELAY_450S = 11;
const DELAY_900S = 21;
/**
* Background Image
*
* @var string
*/
protected $_backgroundImage;
/**
* Count
*
* @var int
*/
protected $_count = 0;
/**
* Title
*
* @var string
*/
protected $_title;
/**
* Back Background Image
*
* @var string
*/
protected $_backBackgroundImage;
/**
* Back Title
*
* @var string
*/
protected $_backTitle;
/**
* Back Content
*
* @var string
*/
protected $_backContent;
/**
* Tile ID
*
* @var string
*/
protected $_tileId;
/**
* Get Background Image
*
* @return string
*/
public function getBackgroundImage()
{
return $this->_backgroundImage;
}
/**
* Set Background Image
*
* @param string $bgImg
* @return Zend_Mobile_Push_Message_Mpns_Tile
* @throws Zend_Mobile_Push_Message_Exception
*/
public function setBackgroundImage($bgImg)
{
if (!is_string($bgImg)) {
throw new Zend_Mobile_Push_Message_Exception('$bgImg must be a string');
}
$this->_backgroundImage = $bgImg;
return $this;
}
/**
* Get Count
*
* @return int
*/
public function getCount()
{
return $this->_count;
}
/**
* Set Count
*
* @param int $count
* @return Zend_Mobile_Push_Message_Mpns_Tile
* @throws Zend_Mobile_Push_Message_Exception
*/
public function setCount($count)
{
if (!is_numeric($count)) {
throw new Zend_Mobile_Push_Message_Exception('$count is not numeric');
}
$this->_count = (int) $count;
return $this;
}
/**
* Get Title
*
* @return string
*/
public function getTitle()
{
return $this->_title;
}
/**
* Set Title
*
* @param string $title
* @return Zend_Mobile_Push_Message_Mpns_Tile
* @throws Zend_Mobile_Push_Message_Exception
*/
public function setTitle($title)
{
if (!is_string($title)) {
throw new Zend_Mobile_Push_Message_Exception('$title must be a string');
}
$this->_title = $title;
return $this;
}
/**
* Get Back Background Image
*
* @return string
*/
public function getBackBackgroundImage()
{
return $this->_backBackgroundImage;
}
/**
* Set Back Background Image
*
* @param string $bgImg
* @return Zend_Mobile_Push_Message_Mpns_Tile
* @throws Zend_Mobile_Push_Message_Exception
*/
public function setBackBackgroundImage($bgImg)
{
if (!is_string($bgImg)) {
throw new Zend_Mobile_Push_Message_Exception('$bgImg must be a string');
}
$this->_backBackgroundImage = $bgImg;
return $this;
}
/**
* Get Back Title
*
* @return string
*/
public function getBackTitle()
{
return $this->_backTitle;
}
/**
* Set Back Title
*
* @param string $title
* @return Zend_Mobile_Push_Message_Mpns_Tile
* @throws Zend_Mobile_Push_Message_Exception
*/
public function setBackTitle($title)
{
if (!is_string($title)) {
throw new Zend_Mobile_Push_Message_Exception('$title must be a string');
}
$this->_backTitle = $title;
return $this;
}
/**
* Get Back Content
*
* @return string
*/
public function getBackContent()
{
return $this->_backContent;
}
/**
* Set Back Content
*
* @param string $content
* @return Zend_Mobile_Push_Message_Mpns_Tile
* @throws Zend_Mobile_Push_Message_Exception
*/
public function setBackContent($content)
{
if (!is_string($content)) {
throw new Zend_Mobile_Push_Message_Exception('$content must be a string');
}
$this->_backContent = $content;
}
/**
* Get Tile Id
*
* @return string
*/
public function getTileId()
{
return $this->_tileId;
}
/**
* Set Tile Id
*
* @param string $tileId
* @return Zend_Mobile_Push_Message_Mpns_Tile
* @throws Zend_Mobile_Push_Message_Exception
*/
public function setTileId($tileId)
{
if (!is_string($tileId)) {
throw new Zend_Mobile_Push_Message_Exception('$tileId is not a string');
}
$this->_tileId = $tileId;
return $this;
}
/**
* Get Delay
*
* @return int
*/
public function getDelay()
{
if (!$this->_delay) {
return self::DELAY_IMMEDIATE;
}
return $this->_delay;
}
/**
* Set Delay
*
* @param int $delay
* @return Zend_Mobile_Push_Message_Mpns_Tile
* @throws Zend_Mobile_Push_Message_Exception
*/
public function setDelay($delay)
{
if (!in_array($delay, array(
self::DELAY_IMMEDIATE,
self::DELAY_450S,
self::DELAY_900S
))) {
throw new Zend_Mobile_Push_Message_Exception('$delay must be one of the DELAY_* constants');
}
$this->_delay = $delay;
return $this;
}
/**
* Get Notification Type
*
* @return string
*/
public static function getNotificationType()
{
return 'token';
}
/**
* Get XML Payload
*
* @return string
*/
public function getXmlPayload()
{
$ret = '<?xml version="1.0" encoding="utf-8"?>'
. '<wp:Notification xmlns:wp="WPNotification">'
. '<wp:Tile' . (($this->_tileId) ? ' Id="' . htmlspecialchars($this->_tileId) . '"' : '') . '>'
. '<wp:BackgroundImage>' . htmlspecialchars($this->_backgroundImage) . '</wp:BackgroundImage>'
. '<wp:Count>' . (int) $this->_count . '</wp:Count>'
. '<wp:Title>' . htmlspecialchars($this->_title) . '</wp:Title>';
if ($this->_backBackgroundImage) {
$ret .= '<wp:BackBackgroundImage>' . htmlspecialchars($this->_backBackgroundImage) . '</wp:BackBackgroundImage>';
}
if ($this->_backTitle) {
$ret .= '<wp:BackTitle>' . htmlspecialchars($this->_backTitle) . '</wp:BackTitle>';
}
if ($this->_backContent) {
$ret .= '<wp:BackContent>' . htmlspecialchars($this->_backContent) . '</wp:BackContent>';
}
$ret .= '</wp:Tile>'
. '</wp:Notification>';
return $ret;
}
/**
* Validate proper mpns message
*
* @return boolean
*/
public function validate()
{
if (!isset($this->_token) || strlen($this->_token) === 0) {
return false;
}
if (empty($this->_backgroundImage)) {
return false;
}
if (empty($this->_title)) {
return false;
}
return parent::validate();
}
}
| {'content_hash': '06b2f20576a0061f8cfe0b853a1798af', 'timestamp': '', 'source': 'github', 'line_count': 347, 'max_line_length': 125, 'avg_line_length': 23.103746397694525, 'alnum_prop': 0.4978171385805164, 'repo_name': 'almadaocta/lordbike-production', 'id': '09e6add05956c3533c9ab377640b083422ea0b68', 'size': '8739', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'errors/includes/src/Zend_Mobile_Push_Message_Mpns_Tile.php', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'ActionScript', 'bytes': '20744'}, {'name': 'ApacheConf', 'bytes': '6510'}, {'name': 'Batchfile', 'bytes': '1053'}, {'name': 'C', 'bytes': '25531'}, {'name': 'CSS', 'bytes': '2695575'}, {'name': 'HTML', 'bytes': '7607119'}, {'name': 'JavaScript', 'bytes': '4942446'}, {'name': 'Makefile', 'bytes': '266'}, {'name': 'PHP', 'bytes': '111927807'}, {'name': 'Perl', 'bytes': '1124'}, {'name': 'PowerShell', 'bytes': '1042'}, {'name': 'Roff', 'bytes': '1009'}, {'name': 'Ruby', 'bytes': '298'}, {'name': 'Shell', 'bytes': '2118'}, {'name': 'XSLT', 'bytes': '2135'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Facebook Reaction Counter - Live Poll</title>
<link href="https://fonts.googleapis.com/css?family=Archivo+Narrow:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/main.css">
</head>
<body class="livepoll">
<h1 style="position: fixed; left: 0; top: 0; background-color: rgba(0,0,0,.75); padding: 4px 8px; color: white; font-family: Arial; font-weight: lighter; letter-spacing: -1px;"><span class="fbr-total" style="font-weight: bold;"></span> Reactions</h1>
<!-- REACTIONS (Allowed reactions: love, like, haha, wow, angry, sad) -->
<main class="reaction-container">
<section data-reaction="love" class="reaction love">
<h6>Love</h6>
<img src="images/love.png" alt="reaction_love" />
</section>
<section data-reaction="like" class="reaction like">
<h6>Like</h6>
<img src="images/like.png" alt="reaction_like" />
</section>
<section data-reaction="haha" class="reaction haha">
<h6>Haha</h6>
<img src="images/haha.png" alt="reaction_haha" />
</section>
<section data-reaction="wow" class="reaction wow">
<h6>Wow</h6>
<img src="images/wow.png" alt="reaction_wow" />
</section>
<section data-reaction="angry" class="reaction angry">
<h6>Angry</h6>
<img src="images/angry.png" alt="reaction_angry" />
</section>
<section data-reaction="sad" class="reaction sad">
<h6>Sad</h6>
<img src="images/sad.png" alt="reaction_sad" />
</section>
</main>
<!-- Include scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="../jquery.fb-reaction-counter.js"></script>
<!-- Init reaction counter -->
<script>
$(document).ready(function() {
$('.reaction-container').reactionCounter({
clientID: "", // Change this to your own
clientSecret: "", // Change this to your own
pageURL: "", // Change this to your own
postID: "", // Change this to your own
refreshTime: 5,
appendPrepend: 'prepend',
totalType: 'selected'
});
});
</script>
</body>
</html>
| {'content_hash': '11eadd623e39357ba4bb7a878bbcc7c1', 'timestamp': '', 'source': 'github', 'line_count': 70, 'max_line_length': 251, 'avg_line_length': 30.0, 'alnum_prop': 0.6461904761904762, 'repo_name': 'christohill/fb-reaction-counter', 'id': '3baccb13617c29b861f3a32a3c3fbd96c7e7c7d0', 'size': '2100', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'examples/livepoll.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '6282'}]} |
See also [Notes on Wolfram Language to Python Translation](TranslateToPythonNotes.md).
## Overview of the Abstract Syntax Tree, Symbols, Scopes, Types, and Passes
For a simple FullForm emitter, we can get away with a parse tree (concrete syntax tree). If we want to do anything sophisticated, we need an abstract syntax tree (AST) which we can decorate with attributes and can efficiently transform.
The nodes of the AST are instances of `ASTNode`. An `ASTNode` is a particular appearence of a function, symbol, or other language construct in the source code. Every `ASTNode` has a `Type`, but many nodes may have the same `Type`. Do not confuse the `ASTNode` type in the implementation language (`MapNode`, `DecrementNode`, etc.) with the `Type` of the `ASTNode` in the source language^1 (`IntegerType`, `StringType`, etc.), even though some of the names overlap (a `StringNode` always has type `String`). Indeed, two nodes of the same subtype of `ASTNode` in the implementation language may have different `Type`'s in the source language.
A *symbol* is a name, a string, referring to a value with a type valid within some `Scope`. We call the string name the *identifier*, while a symbol is the `(identifier, type, value)` tripple^2. Wolfram Language also allows a symbol to have neither value nor type. In FoxySheep, "no type" and "undetermined type" are themselves represented as types. The value of a symbol may change during runtime, and the type of a symbol may change at different places within the source code (and, as a corollary, at runtime). The scope in which the symbol lives tracks the changing type and value of a symbol. When a name is matched to its entry in the symbol table, the name is said to be *resolved*.
A *pass* is an AST visitor instance that walks the AST to compute properties of the AST nodes, e.g. symbol resolution or type inference, or perform tree transformations, e.g. converting `Table` to `While`. Semantic analysis and HIL translation require multiple passes. The visitor pattern maintains separation of concerns and modularity. Thus, transformation and translation code does not belong in the ASTNode classes.
1. By "source language" I mean either Wolfram Language, the "language" of some intermediate representation, or Python.
2. This usage is nonstandard. Other authors use *symbol* and *identifier* synonymously and would just consider the `(identifier, type, value)` tripple as the symbol table entry for `identifier`.
## AST Design
Wolfram Language does not (yet) expose a type system to the user with the exception of some numeric types that are implemented as attributes of primitive number objects (`SetAccuracy[3.14, 10]`).
### AST Class Hierarchy
This list will grow exponentially during development. We need an ASTNode for every *distinct* language construct and atomic. Does the class hierarchy need to be more flat than it is?
* [x] ASTNodeBase
* [ ] ListNodeBase
* [ ] SymbolicFunction
* [ ] ListNode
* [ ] AssociationNodeBase
* [ ] OptionsPatternNode
* [ ] AssociationNode
* [ ] FunctionNode
* [ ] TableNodeBase
* [ ] TableNode
* [ ] DoNode
* [ ] ModuleNodeBase
* [ ] PlotNodeBase
* ....
* [ ] NumberNode
* [ ] StringNode
* [ ] IdentifierNode
# Error Class Hierarchy
Class hierarchy for syntactic, semantic, and HIL translator errors.
# Scoping, Typing
Classes for name resolution and typing.
# Passes
## Construction
* [ ] ConstructScope
## Semantic Analysis
### Type inference
* [ ] HMTypeInference
### Usage correctness
* [ ] CheckArgumentPattern
* [ ] CheckOptionsPattern
* [ ] MarkUseBeforeAssignment
## Lowering Passes
### Transformations based on function attributes
* [ ] UnwrapIteratedFunctions
* E.g. `Table[ ... , {x, 1, 2}, {y, 1, 4}]` becomes `Table[Table[ ... , {y, 1, 4}], {x, 1, 2}]`. Affects Scoping.
* [ ] ThreadListableFunctions
* [ ] FlattenFlatFunctions
### Convert loop constructs to While
* [ ] ForToWhile
* [ ] DoToWhile
* [ ] NestWhileToWhile
* [ ] FixedPointToWhile
## Translation
* [ ] PythonEmitter
* [ ] FullFormEmitter
| {'content_hash': '57ae944adbcb3a2542c70eec2a57a431', 'timestamp': '', 'source': 'github', 'line_count': 90, 'max_line_length': 690, 'avg_line_length': 46.333333333333336, 'alnum_prop': 0.7225419664268585, 'repo_name': 'rljacobson/FoxySheep', 'id': 'c1f81a8eb8f5c373fa31ded7ed7eb0ea9f962d19', 'size': '4181', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'doc/TranslateToPythonRoadmap.md', 'mode': '33261', 'license': 'bsd-2-clause', 'language': [{'name': 'ANTLR', 'bytes': '24295'}, {'name': 'Java', 'bytes': '72986'}, {'name': 'Jupyter Notebook', 'bytes': '8769'}, {'name': 'Makefile', 'bytes': '2878'}, {'name': 'Mathematica', 'bytes': '710'}, {'name': 'Matlab', 'bytes': '8'}, {'name': 'Python', 'bytes': '173842'}]} |
@implementation RNPFImageLoader
RCT_EXPORT_MODULE()
@synthesize bridge = _bridge;
#pragma mark - RCTImageLoader
#define PHOTOS_SCHEME_IDENTIFIER @"photos"
NSString *const SCHEME_WITH_SIGNS = PHOTOS_SCHEME_IDENTIFIER @"://";
- (BOOL)canLoadImageURL:(NSURL *)requestURL
{
if (![PHAsset class]) {
return NO;
}
return [requestURL.scheme caseInsensitiveCompare:PHOTOS_SCHEME_IDENTIFIER] == NSOrderedSame;
}
- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL
size:(CGSize)size
scale:(CGFloat)scale
resizeMode:(RCTResizeMode)resizeMode
progressHandler:(RCTImageLoaderProgressBlock)progressHandler
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler
{
static PHFetchOptions *fetchOptions = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
fetchOptions = [[PHFetchOptions alloc] init];
[fetchOptions setIncludeHiddenAssets:YES];
[fetchOptions setIncludeAllBurstAssets:YES];
[fetchOptions setWantsIncrementalChangeDetails:NO];
});
NSString *localIdentifier = [imageURL.absoluteString substringFromIndex:SCHEME_WITH_SIGNS.length];
PHFetchResult *results = [PHAsset fetchAssetsWithLocalIdentifiers:@[localIdentifier] options:fetchOptions];
if (results.count == 0) {
NSString *errorText = [NSString stringWithFormat:@"Failed to fetch PHAsset with local identifier %@ with no error message.", localIdentifier];
completionHandler(RCTErrorWithMessage(errorText), nil);
return ^{};
}
PHAsset *asset = [results firstObject];
PHImageRequestOptions *imageOptions = [PHImageRequestOptions new];
// Allow PhotoKit to fetch images from iCloud
imageOptions.networkAccessAllowed = YES;
if (progressHandler) {
imageOptions.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary<NSString *, id> *info) {
static const double multiplier = 1e6;
progressHandler(progress * multiplier, multiplier);
};
}
BOOL useMaximumSize = CGSizeEqualToSize(size, CGSizeZero);
CGSize targetSize;
if (useMaximumSize) {
targetSize = PHImageManagerMaximumSize;
imageOptions.resizeMode = PHImageRequestOptionsResizeModeNone;
} else {
targetSize = CGSizeApplyAffineTransform(size, CGAffineTransformMakeScale(scale, scale));
imageOptions.resizeMode = PHImageRequestOptionsResizeModeFast;
}
PHImageContentMode contentMode = PHImageContentModeAspectFill;
if (resizeMode == RCTResizeModeContain) {
contentMode = PHImageContentModeAspectFit;
}
__block PHImageRequestOptionsDeliveryMode deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
imageOptions.deliveryMode = deliveryMode;
if(imageURL.query != nil) {
NSURLComponents *urlComponents = [NSURLComponents componentsWithURL:imageURL
resolvingAgainstBaseURL:NO];
NSArray *queryItems = urlComponents.queryItems;
NSString *deliveryModeQuery = [self valueForKey:@"deliveryMode"
fromQueryItems:queryItems];
if(deliveryModeQuery != nil) {
if([deliveryModeQuery isEqualToString:@"opportunistic"]) {
deliveryMode = PHImageRequestOptionsDeliveryModeOpportunistic;
}
else if([deliveryModeQuery isEqualToString:@"highQuality"]) {
deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
}
else if([deliveryModeQuery isEqualToString:@"fast"]) {
deliveryMode = PHImageRequestOptionsDeliveryModeFastFormat;
}
}
}
PHImageRequestID requestID =
[[PHCachingImageManagerInstance sharedCachingManager] requestImageForAsset:asset
targetSize:targetSize
contentMode:contentMode
options:imageOptions
resultHandler:^(UIImage *result, NSDictionary<NSString *, id> *info) {
if (result) {
if(deliveryMode == PHImageRequestOptionsDeliveryModeOpportunistic && [info[@"PHImageResultIsDegradedKey"] boolValue] == YES) {
if (partialLoadHandler) {
partialLoadHandler(result);
}
}else {
completionHandler(nil, result);
}
} else {
completionHandler(info[PHImageErrorKey], nil);
}
}];
return ^{
[[PHCachingImageManagerInstance sharedCachingManager] cancelImageRequest:requestID];
};
}
- (NSString *)valueForKey:(NSString *)key
fromQueryItems:(NSArray *)queryItems
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name=%@", key];
NSURLQueryItem *queryItem = [[queryItems
filteredArrayUsingPredicate:predicate]
firstObject];
return queryItem.value;
}
@end
| {'content_hash': '35e697c3d5a20904609242fa5c07c423', 'timestamp': '', 'source': 'github', 'line_count': 130, 'max_line_length': 199, 'avg_line_length': 48.184615384615384, 'alnum_prop': 0.5474137931034483, 'repo_name': 'jnuine/react-native-photos-framework', 'id': '2330dd47fd0662f25af13fdade99d4ba1ff0709d', 'size': '6346', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ios/RNPhotosFramework/RNPFImageLoader.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '301'}, {'name': 'HTML', 'bytes': '4911'}, {'name': 'Java', 'bytes': '2715'}, {'name': 'JavaScript', 'bytes': '403131'}, {'name': 'Makefile', 'bytes': '429'}, {'name': 'Objective-C', 'bytes': '133584'}, {'name': 'Python', 'bytes': '3284'}, {'name': 'Ruby', 'bytes': '516'}, {'name': 'Shell', 'bytes': '1406'}]} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '847419dc9fe1befc91c63497605badd4', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'c99b9c219d0bd7548f6389ba604d3b4d345048a1', 'size': '175', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Poales/Cyperaceae/Cyperus/Cyperus barmsianus/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
class spop_reverse
: public traits_op_passthru
{
public:
template<typename eT>
inline static void apply_spmat(SpMat<eT>& out, const SpMat<eT>& X, const uword dim);
template<typename T1>
inline static void apply_proxy(SpMat<typename T1::elem_type>& out, const T1& X, const uword dim);
template<typename T1>
inline static void apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_reverse>& in);
};
//! @}
| {'content_hash': 'c42de4992a4b58949f2286b8ac82ea59', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 99, 'avg_line_length': 24.61111111111111, 'alnum_prop': 0.6862302483069977, 'repo_name': 'kumanna/armadillo-debian', 'id': '4b55e3f2767b976f9f165615008682d60b8ff8e0', 'size': '1237', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'include/armadillo_bits/spop_reverse_bones.hpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C++', 'bytes': '5914067'}, {'name': 'CMake', 'bytes': '51238'}, {'name': 'HTML', 'bytes': '594326'}, {'name': 'MATLAB', 'bytes': '204'}, {'name': 'Makefile', 'bytes': '714'}]} |
<p class="no-bullet"></p>
- <i class="fa fa-twitter"></i> [martindsouza](https://twitter.com/martin)
- <i class="fa fa-rss"></i> [www.talkapex.com](http://www.talkapex.com)
- <i class="fa fa-github"></i> [martindsouza](https://github.com/martindsouza)
- <i class="fa fa-envelope-o"></i> [[email protected]](mailto:[email protected])
- <i class="fa fa-building-o"></i> [Insum Solutions](http://www.insum.ca)
Presentation: [bit.ly/open-source-apex](http://martindsouza.github.io/pres-open-source-apex/)
Notes:
- [Turn off notes](javascript: Reveal.configure({"showNotes": false});)
new-slide-vertical
<!-- .slide: data-background="#000000" -->
Notes:
- Started ~1.5 years ago</br>
- Over 10 active projects w. 15 active developers</br>
- 1 Project Sponsor
new-slide-vertical
# Slides
<i class="fa fa-github"></i> [github.com/martindsouza/pres-open-source-apex](https://github.com/martindsouza/pres-open-source-apex)
<p class="fragment"><p>
Notes:
- This entire presentation is open source.<br>
- This may be a first at OOW! <br>
- Can fork the project, modify, and make any changes you'd like!<br>
- View the presentation [online](http://martindsouza.github.io/pres-open-source-apex/) right now
new-slide-vertical
Notes:
Goal:<br>
- Learn about an OS project that can help you out<br>
- Get involved<br>
<br>
Outline:<br>
- Introduction<br>
- Popular projects<br>
- Considerations<br>
- How to get involved<br>
| {'content_hash': 'fafa16a72f0fbce826e8c2afaa0d4cc8', 'timestamp': '', 'source': 'github', 'line_count': 46, 'max_line_length': 131, 'avg_line_length': 32.15217391304348, 'alnum_prop': 0.7065584854631508, 'repo_name': 'martindsouza/pres-open-source-apex', 'id': '21047feaa1a9ea96aeb03825539befbe5c1ce2e1', 'size': '1508', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'slides/intro.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '256'}, {'name': 'HTML', 'bytes': '5854'}, {'name': 'JavaScript', 'bytes': '1672'}, {'name': 'PLSQL', 'bytes': '1020415'}, {'name': 'Shell', 'bytes': '170'}]} |
import curses
import logging
from typing import Callable
from uuid import UUID
from minesweeper import GameObserver, MenuOptions, Board, CellType, CreateMinefieldUseCaseObserver, \
TakeTurnUseCaseObserver, StartMenuOptionType
from minesweeper.common.values import Turn, TurnAction, GameState
from minesweeper.create_board import CreateBoardUseCaseObserver
from minesweeper.present_create_board_options import PresentCreateBoardOptionsUseCaseObserver
from tui.curses_logging_handler import CursesLoggingHandler
from tui.data_sources import StartMenuDataSource
from tui.controllers import TitledController, CursesMenuController, LineListController, GameController
from tui.controller_configuration import CursesMenuControllerObserver, GameControllerObserver
logger = logging.getLogger('MinesweeperLogger')
logger.setLevel(logging.DEBUG)
class TUI(GameObserver, CursesMenuControllerObserver, GameControllerObserver):
def __init__(self, curses_module=curses, logger=logger):
super().__init__()
self.curses_module = curses_module
self.logger = logger
self.row_count = None
self.column_count = None
self.board = None
self.minefield_identifier = None
self.most_recent_turn = None
self.most_recent_board_snapshot = None
self.create_minefield = None
self.reveal_cell = None
self.toggle_flag = None
self.cursor_row = 0
self.cursor_column = 0
self.presentation_count = 0
self.FOREGROUND_COLOR_KEY = 1
self.BACKGROUND_COLOR_KEY = 2
self.screen_controller = None
self.game_controller = None
self.menu_options = None
self.present_create_board_options = None
####
#
# GameObserver
#
def game_did_present_start_menu(self,
menu_options: MenuOptions,
present_create_board_options: Callable[
[PresentCreateBoardOptionsUseCaseObserver], None]):
self.logger.info("Presenting start menu…")
self.menu_options = menu_options
self.present_create_board_options = present_create_board_options
self.curses_module.wrapper(self._start)
def game_did_present_create_board_options(self,
minimum_row_count: int,
minimum_column_count: int,
default_row_count: int,
default_column_count: int,
create_board: Callable[[int, int, CreateBoardUseCaseObserver], None]):
row_count = minimum_row_count
column_count = minimum_column_count
message = "At some point we will show a board options menu here, for now, just choose size {} x {}…"
self.logger.info(message.format(row_count, column_count))
self.logging_controller.refresh()
create_board(row_count=row_count, column_count=column_count)
def game_did_create_board(self,
board: Board,
board_snapshot: [[CellType]],
create_minefield: Callable[[int, int, CreateMinefieldUseCaseObserver], None]):
self.create_minefield = create_minefield
self.game_controller.prepare_to_create_minefield(board=board, board_snapshot=board_snapshot, observer=self)
def game_did_create_minefield(self,
minefield_identifier: UUID,
first_turn: Turn,
board_snapshot: [[CellType]],
reveal_cell: Callable[[int, int, TakeTurnUseCaseObserver], None],
toggle_flag: Callable[[int, int, TakeTurnUseCaseObserver], None]):
self.logger.info("First cell revealed, mines placed, game on…")
self.logging_controller.refresh()
self.minefield_identifier = minefield_identifier
self.most_recent_turn = first_turn
self.reveal_cell = reveal_cell
self.toggle_flag = toggle_flag
self.game_controller.update_and_refresh(board_snapshot=board_snapshot)
def game_did_take_turn(self,
turn: Turn,
game_state: GameState,
board_snapshot: [[CellType]],
reveal_cell: Callable[[int, int, TakeTurnUseCaseObserver], None],
toggle_flag: Callable[[int, int, TakeTurnUseCaseObserver], None]):
if game_state == GameState.Won:
message = "You won! Congratulations."
elif game_state == GameState.Lost:
message = "Ruh-roh, looks like you stepped on a mine"
else:
message = "Took turn to {} on x: {}, y: {}".format(turn.action.name,
turn.coordinate.row_index,
turn.coordinate.column_index)
self.logger.info(message)
self.logging_controller.refresh()
self.most_recent_turn = turn
self.reveal_cell = reveal_cell
self.toggle_flag = toggle_flag
self.game_controller.update_and_refresh(board_snapshot=board_snapshot)
####
#
# GameControllerObserver
#
def did_signal_intent_to_toggle_flag(self, controller, row_index, column_index):
if self.toggle_flag:
self.toggle_flag(column_index=column_index, row_index=row_index)
def did_signal_intent_to_reveal_cell(self, controller, row_index, column_index):
if self.reveal_cell:
self.reveal_cell(column_index=column_index, row_index=row_index)
elif self.create_minefield:
self.create_minefield(column_index=column_index, row_index=row_index)
def did_signal_intent_to_pause_game(self, controller):
self.screen_controller.refresh()
def did_update_cursor_location(self, controller):
controller.refresh()
####
#
# CursesMenuControllerObserver
#
def did_signal_intent_to_close_menu(self, controller):
pass
def did_select_menu_option_at_index(self, controller, menu_option_index: int):
menu_option = self.menu_options.options[menu_option_index]
if menu_option == StartMenuOptionType.StartNewGame:
self.logger.info("Starting new game…")
self.present_create_board_options()
return True
elif menu_option == StartMenuOptionType.Quit:
self.logger.info("Quiting…")
exit(1)
def will_redisplay_updated_menu_options(self, controller):
self._prepare_for_doupdate()
def did_redisplay_updated_menu_options(self, controller):
self.curses_module.doupdate()
####
#
# Private
#
def _start(self, screen):
self.curses_module.noecho()
self.curses_module.cbreak()
self.curses_module.curs_set(0)
if self.curses_module.has_colors():
self.curses_module.start_color()
screen_height, screen_width = screen.getmaxyx()
start_menu_height = 20
start_menu_width = 25
start_menu_origin_y = 1
start_menu_origin_x = 0
start_menu_window = self.curses_module.newwin(start_menu_height, start_menu_width, start_menu_origin_y,
start_menu_origin_x)
start_menu_window.keypad(1)
data_source = StartMenuDataSource(menu_options=self.menu_options)
start_menu_controller = CursesMenuController(keypress_listener=start_menu_window.getch,
window=start_menu_window,
data_source=data_source,
box=True)
game_height = start_menu_height
game_width = screen_width - start_menu_width
game_origin_y = start_menu_origin_y
game_origin_x = start_menu_origin_x + start_menu_width
game_window = self.curses_module.newwin(game_height,
game_width,
game_origin_y,
game_origin_x)
game_window.keypad(1)
self.curses_module.init_pair(self.FOREGROUND_COLOR_KEY,
self.curses_module.COLOR_BLACK,
self.curses_module.COLOR_RED)
self.curses_module.init_pair(self.BACKGROUND_COLOR_KEY,
self.curses_module.COLOR_WHITE,
self.curses_module.COLOR_BLACK)
highlighted_color_pair = self.curses_module.color_pair(self.FOREGROUND_COLOR_KEY)
nonhighlighted_color_pair = self.curses_module.color_pair(self.BACKGROUND_COLOR_KEY)
self.game_controller = GameController(window=game_window,
keypress_listener=game_window.getch,
highlighted_color_pair=highlighted_color_pair,
nonhighlighted_color_pair=nonhighlighted_color_pair,
logger=self.logger,
box=True)
logging_window_height = 6
logging_window_width = screen_width
logging_window = self.curses_module.newwin(logging_window_height,
logging_window_width,
start_menu_height + 1,
0)
self.logging_controller = LineListController(window=logging_window, lines="", box=True)
curses_logging_handler = CursesLoggingHandler(controller=self.logging_controller)
self.logger.addHandler(curses_logging_handler)
screen_controller_children = [start_menu_controller, self.game_controller, self.logging_controller]
self.screen_controller = TitledController(title="MINESWEEPER",
window=screen,
child_controllers=screen_controller_children)
self._prepare_for_doupdate()
self.curses_module.doupdate()
start_menu_controller.wait_and_listen_for_keypress(observer=self)
def _prepare_for_doupdate(self):
self.screen_controller.refresh()
| {'content_hash': '22d5f312b9fec12276103a14d3ea64c9', 'timestamp': '', 'source': 'github', 'line_count': 240, 'max_line_length': 116, 'avg_line_length': 44.5375, 'alnum_prop': 0.5761998316025821, 'repo_name': 'wileykestner/minesweeper_tui', 'id': '2f5df7dca083c96f4213794bceb1aa291a4cf9b6', 'size': '10699', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tui/game_observer.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '35700'}]} |
<?php
pake_desc('initialize a new propel CRUD module');
pake_task('propel-init-crud', 'app_exists');
pake_desc('generate a new propel CRUD module');
pake_task('propel-generate-crud', 'app_exists');
function run_propel_init_crud($task, $args)
{
if (count($args) < 2)
{
throw new Exception('You must provide your module name.');
}
if (count($args) < 3)
{
throw new Exception('You must provide your model class name.');
}
$app = $args[0];
$module = $args[1];
$model_class = $args[2];
try
{
$author_name = $task->get_property('author', 'symfony');
}
catch (pakeException $e)
{
$author_name = 'Your name here';
}
$constants = array(
'PROJECT_NAME' => $task->get_property('name', 'symfony'),
'APP_NAME' => $app,
'MODULE_NAME' => $module,
'MODEL_CLASS' => $model_class,
'AUTHOR_NAME' => $author_name,
);
$sf_root_dir = sfConfig::get('sf_root_dir');
$moduleDir = $sf_root_dir.'/'.sfConfig::get('sf_apps_dir_name').'/'.$app.'/'.sfConfig::get('sf_app_module_dir_name').'/'.$module;
// create basic application structure
$finder = pakeFinder::type('any')->ignore_version_control()->discard('.sf');
pake_mirror($finder, sfConfig::get('sf_symfony_data_dir').'/generator/sfPropelCrud/default/skeleton', $moduleDir);
// create basic test
pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/module/test/actionsTest.php', $sf_root_dir.'/test/functional/'.$app.'/'.$module.'ActionsTest.php');
// customize test file
pake_replace_tokens($module.'ActionsTest.php', $sf_root_dir.'/test/functional/'.$app, '##', '##', $constants);
// customize php and yml files
$finder = pakeFinder::type('file')->name('*.php', '*.yml');
pake_replace_tokens($finder, $moduleDir, '##', '##', $constants);
}
function run_propel_generate_crud($task, $args)
{
if (count($args) < 2)
{
throw new Exception('You must provide your module name.');
}
if (count($args) < 3)
{
throw new Exception('You must provide your model class name.');
}
$theme = isset($args[3]) ? $args[3] : 'default';
$app = $args[0];
$module = $args[1];
$model_class = $args[2];
$sf_root_dir = sfConfig::get('sf_root_dir');
// generate module
$tmp_dir = $sf_root_dir.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.md5(uniqid(rand(), true));
sfConfig::set('sf_module_cache_dir', $tmp_dir);
$generator_manager = new sfGeneratorManager();
$generator_manager->initialize();
$generator_manager->generate('sfPropelCrudGenerator', array('model_class' => $model_class, 'moduleName' => $module, 'theme' => $theme));
$moduleDir = $sf_root_dir.'/'.sfConfig::get('sf_apps_dir_name').'/'.$app.'/'.sfConfig::get('sf_app_module_dir_name').'/'.$module;
// copy our generated module
$finder = pakeFinder::type('any');
pake_mirror($finder, $tmp_dir.'/auto'.ucfirst($module), $moduleDir);
// change module name
pake_replace_tokens($moduleDir.'/actions/actions.class.php', getcwd(), '', '', array('auto'.ucfirst($module) => $module));
try
{
$author_name = $task->get_property('author', 'symfony');
}
catch (pakeException $e)
{
$author_name = 'Your name here';
}
$constants = array(
'PROJECT_NAME' => $task->get_property('name', 'symfony'),
'APP_NAME' => $app,
'MODULE_NAME' => $module,
'MODEL_CLASS' => $model_class,
'AUTHOR_NAME' => $author_name,
);
// customize php and yml files
$finder = pakeFinder::type('file')->name('*.php', '*.yml');
pake_replace_tokens($finder, $moduleDir, '##', '##', $constants);
// create basic test
pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/module/test/actionsTest.php', $sf_root_dir.'/test/functional/'.$app.'/'.$module.'ActionsTest.php');
// customize test file
pake_replace_tokens($module.'ActionsTest.php', $sf_root_dir.'/test/functional/'.$app, '##', '##', $constants);
// delete temp files
$finder = pakeFinder::type('any');
pake_remove($finder, $tmp_dir);
}
| {'content_hash': '081c285eea757c4f914e88f974dfc324', 'timestamp': '', 'source': 'github', 'line_count': 128, 'max_line_length': 159, 'avg_line_length': 32.5, 'alnum_prop': 0.6038461538461538, 'repo_name': 'vincent03460/fortrend-web', 'id': '02d57a9daed5b7bcb5de6348e37a099e921e8e81', 'size': '4421', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'data/symfony/tasks/sfPakePropelCrudGenerator.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '1626'}, {'name': 'CSS', 'bytes': '369471'}, {'name': 'HTML', 'bytes': '34'}, {'name': 'JavaScript', 'bytes': '1073331'}, {'name': 'PHP', 'bytes': '1684917'}, {'name': 'Shell', 'bytes': '4594'}]} |
<label class="block-label form-label" for="landlord">Talk to your landlord about the payment gap
<input type="checkbox" id="landlord" name="needToDo" value="landlord">
</label>
<label class="block-label form-label" for="rent">Find out how to pay your rent yourself
<input type="checkbox" id="rent" name="needToDo" value="email">
</label>
| {'content_hash': '5fb7facce1600e843072bb4be7c04a8b', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 96, 'avg_line_length': 57.666666666666664, 'alnum_prop': 0.7225433526011561, 'repo_name': 'JoeChapman82/ucSwitch', 'id': 'a6c264d7efefbf07f96c2c082518ba4715ffb68b', 'size': '346', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/views/ucs1/partials/hb2.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '5026'}, {'name': 'HTML', 'bytes': '72227'}, {'name': 'JavaScript', 'bytes': '35421'}, {'name': 'Shell', 'bytes': '1872'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
<title>Fetch me some eye-bleach forthwith</title>
<style>
body {
text-align: center;
background: url("http://bestanimations.com/Site/funny-internet-animated-gif-45.gif") center center fixed;
text-decoration: none;
overflow: hidden;
font-family: "Comic Sans MS", "Comic Sans", cursive;
}
.jumbotron {
height: 80vh;
opacity: 0.7;
}
</style>
</head>
<body>
<a class="btn btn-primary btn-lg" href="https://devvit.io/ReallyAnnoyingDirectory/">Back to Directory</a>
<div class="container">
<div class="jumbotron">
<div>
<h1>Do you have a headache yet?</h1>
<p>I really apologize for this. Please, for your own sanity, click the button above ASAP</p>
</div>
</div>
</div>
</body>
</html>
| {'content_hash': 'c4ff612655d5805faad6c7e469f45524', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 115, 'avg_line_length': 29.44736842105263, 'alnum_prop': 0.6246648793565683, 'repo_name': 'DevvitIO/ReallyAnnoyingDirectory', 'id': '726bb918bffa5f2144d793103efa28956ba8684e', 'size': '1119', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'subDirectory/humanforklift.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '11994'}, {'name': 'HTML', 'bytes': '205956'}, {'name': 'JavaScript', 'bytes': '2477'}]} |
<footer class="footer navbar-fixed-bottom row-flui">
<div class="container">
<p class="text-muted pull-right">©Все права защищены, 2016</p>
</div>
</footer> | {'content_hash': 'afc4f84ea39f17c700f317b21c0f56a1', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 71, 'avg_line_length': 33.8, 'alnum_prop': 0.6863905325443787, 'repo_name': 'wkomor/pickthebook', 'id': '6fd9fd4bd3ab5a0b4ae3284120fd129df763fb8f', 'size': '185', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'templates/footer.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '370'}, {'name': 'HTML', 'bytes': '19326'}, {'name': 'JavaScript', 'bytes': '7148'}, {'name': 'Python', 'bytes': '18870'}]} |
/**
* AdCopyResult.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.dfa.axis.v1_19;
public class AdCopyResult extends com.google.api.ads.dfa.axis.v1_19.SaveResult implements java.io.Serializable {
private com.google.api.ads.dfa.axis.v1_19.AdCopyRequest adCopyRequest;
private java.lang.String errorMessage;
private java.lang.String name;
public AdCopyResult() {
}
public AdCopyResult(
long id,
com.google.api.ads.dfa.axis.v1_19.AdCopyRequest adCopyRequest,
java.lang.String errorMessage,
java.lang.String name) {
super(
id);
this.adCopyRequest = adCopyRequest;
this.errorMessage = errorMessage;
this.name = name;
}
/**
* Gets the adCopyRequest value for this AdCopyResult.
*
* @return adCopyRequest
*/
public com.google.api.ads.dfa.axis.v1_19.AdCopyRequest getAdCopyRequest() {
return adCopyRequest;
}
/**
* Sets the adCopyRequest value for this AdCopyResult.
*
* @param adCopyRequest
*/
public void setAdCopyRequest(com.google.api.ads.dfa.axis.v1_19.AdCopyRequest adCopyRequest) {
this.adCopyRequest = adCopyRequest;
}
/**
* Gets the errorMessage value for this AdCopyResult.
*
* @return errorMessage
*/
public java.lang.String getErrorMessage() {
return errorMessage;
}
/**
* Sets the errorMessage value for this AdCopyResult.
*
* @param errorMessage
*/
public void setErrorMessage(java.lang.String errorMessage) {
this.errorMessage = errorMessage;
}
/**
* Gets the name value for this AdCopyResult.
*
* @return name
*/
public java.lang.String getName() {
return name;
}
/**
* Sets the name value for this AdCopyResult.
*
* @param name
*/
public void setName(java.lang.String name) {
this.name = name;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof AdCopyResult)) return false;
AdCopyResult other = (AdCopyResult) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.adCopyRequest==null && other.getAdCopyRequest()==null) ||
(this.adCopyRequest!=null &&
this.adCopyRequest.equals(other.getAdCopyRequest()))) &&
((this.errorMessage==null && other.getErrorMessage()==null) ||
(this.errorMessage!=null &&
this.errorMessage.equals(other.getErrorMessage()))) &&
((this.name==null && other.getName()==null) ||
(this.name!=null &&
this.name.equals(other.getName())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getAdCopyRequest() != null) {
_hashCode += getAdCopyRequest().hashCode();
}
if (getErrorMessage() != null) {
_hashCode += getErrorMessage().hashCode();
}
if (getName() != null) {
_hashCode += getName().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(AdCopyResult.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.doubleclick.net/dfa-api/v1.19", "AdCopyResult"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("adCopyRequest");
elemField.setXmlName(new javax.xml.namespace.QName("", "adCopyRequest"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.doubleclick.net/dfa-api/v1.19", "AdCopyRequest"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("errorMessage");
elemField.setXmlName(new javax.xml.namespace.QName("", "errorMessage"));
elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("name");
elemField.setXmlName(new javax.xml.namespace.QName("", "name"));
elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| {'content_hash': '5355f730612c79762c3842d9a8b2e721', 'timestamp': '', 'source': 'github', 'line_count': 194, 'max_line_length': 121, 'avg_line_length': 31.72680412371134, 'alnum_prop': 0.6113728675873273, 'repo_name': 'nafae/developer', 'id': '592e2ac41c153d362474c22c7bf017256dc67f13', 'size': '6155', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'modules/dfa_axis/src/main/java/com/google/api/ads/dfa/axis/v1_19/AdCopyResult.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '127846798'}, {'name': 'Perl', 'bytes': '28418'}]} |
usermod -G containers -a www-data
| {'content_hash': '5d1dac9cebad229d7c67c337ea9eb1b3', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 34, 'avg_line_length': 35.0, 'alnum_prop': 0.7428571428571429, 'repo_name': 'EnginesOS/System', 'id': '63f93cfbfdfc046f8c20ab1d13917b24b93c83f9', 'size': '48', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'system/templates/deployment/sinatra/build_scripts/finalise_environment.sh', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '101320'}, {'name': 'HTML', 'bytes': '4478768'}, {'name': 'JavaScript', 'bytes': '72060'}, {'name': 'Makefile', 'bytes': '40933'}, {'name': 'Ruby', 'bytes': '844890'}, {'name': 'Shell', 'bytes': '118832'}, {'name': 'TSQL', 'bytes': '3205'}]} |
import Field from "./Field";
class TemplateField extends Field {
constructor(name) {
super(name);
this._template = function() { return ''; };
this._type = "template";
}
getTemplateValue(data) {
if (typeof(this._template) === 'function') {
return this._template(data);
}
return this._template;
}
template(template) {
if (!arguments.length) return this._template;
this._template = template;
return this;
}
}
export default TemplateField;
| {'content_hash': '379ec4f937a79e369c71ea4e281ba501', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 53, 'avg_line_length': 21.96, 'alnum_prop': 0.5664845173041895, 'repo_name': 'tqchagas/ng-admin', 'id': '0839a31573cc518f4c7a9a5668cf17324b46ba06', 'size': '549', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/javascripts/ng-admin/es6/lib/Field/TemplateField.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '65471'}, {'name': 'HTML', 'bytes': '18258'}, {'name': 'JavaScript', 'bytes': '361969'}, {'name': 'Makefile', 'bytes': '382'}]} |
SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/opt/kinect/LAB/Eclipse/TuxSimbad")
SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/opt/kinect/LAB/Eclipse/TuxSimbad")
# Force unix paths in dependencies.
SET(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file search paths:
SET(CMAKE_C_INCLUDE_PATH
"OgreMain/include"
"include"
"/usr/include/freetype2"
"/usr/include/OIS"
"/usr/include/Cg"
"Components/Terrain/../Paging/include"
"Components/Terrain/include"
)
SET(CMAKE_CXX_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH})
SET(CMAKE_Fortran_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH})
# The C and CXX include file regular expressions for this directory.
SET(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
SET(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
SET(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
| {'content_hash': '9ba6ddfbb78973f121a1a2badd697595', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 71, 'avg_line_length': 35.458333333333336, 'alnum_prop': 0.745005875440658, 'repo_name': 'ttair/TuxSinbad', 'id': 'a5a65dfdb201f47408f95493960fa4ab2d99f5a4', 'size': '994', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Components/Terrain/CMakeFiles/CMakeDirectoryInformation.cmake', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '3568'}, {'name': 'C', 'bytes': '8085175'}, {'name': 'C++', 'bytes': '12990880'}, {'name': 'D', 'bytes': '15164'}, {'name': 'Objective-C', 'bytes': '118267'}, {'name': 'Python', 'bytes': '382281'}, {'name': 'Shell', 'bytes': '12290'}, {'name': 'Visual Basic', 'bytes': '1029'}]} |
"""Generate template values for a callback interface.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
from idl_types import IdlTypeBase
from v8_globals import includes
from v8_interface import constant_context
import v8_types
import v8_utilities
CALLBACK_INTERFACE_H_INCLUDES = frozenset([
'platform/bindings/callback_interface_base.h',
'platform/bindings/v8_value_or_script_wrappable_adapter.h',
])
CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([
'bindings/core/v8/generated_code_helper.h',
'bindings/core/v8/v8_binding_for_core.h',
'core/execution_context/execution_context.h',
'platform/bindings/exception_messages.h',
'platform/bindings/script_forbidden_scope.h',
])
LEGACY_CALLBACK_INTERFACE_H_INCLUDES = frozenset([
'platform/bindings/dom_wrapper_world.h',
'platform/bindings/wrapper_type_info.h',
])
LEGACY_CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([
'bindings/core/v8/v8_dom_configuration.h',
])
def callback_interface_context(callback_interface, _, component_info):
is_legacy_callback_interface = len(callback_interface.constants) > 0
includes.clear()
includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)
if is_legacy_callback_interface:
includes.update(LEGACY_CALLBACK_INTERFACE_CPP_INCLUDES)
header_includes = set(CALLBACK_INTERFACE_H_INCLUDES)
if is_legacy_callback_interface:
header_includes.update(LEGACY_CALLBACK_INTERFACE_H_INCLUDES)
# https://heycam.github.io/webidl/#dfn-single-operation-callback-interface
is_single_operation = True
if (callback_interface.parent or len(callback_interface.attributes) > 0
or len(callback_interface.operations) == 0):
is_single_operation = False
else:
operations = callback_interface.operations
basis = operations[0]
for op in operations[1:]:
if op.name != basis.name:
is_single_operation = False
break
return {
'constants': [
constant_context(constant, callback_interface, component_info)
for constant in callback_interface.constants
],
'cpp_class':
callback_interface.name,
'do_not_check_constants':
'DoNotCheckConstants' in callback_interface.extended_attributes,
'forward_declarations':
sorted(forward_declarations(callback_interface)),
'header_includes':
header_includes,
'interface_name':
callback_interface.name,
'is_legacy_callback_interface':
is_legacy_callback_interface,
'is_single_operation_callback_interface':
is_single_operation,
'methods': [
method_context(operation)
for operation in callback_interface.operations
],
'v8_class':
v8_utilities.v8_class_name(callback_interface),
}
def forward_declarations(callback_interface):
def find_forward_declaration(idl_type):
if idl_type.is_interface_type or idl_type.is_dictionary:
return idl_type.implemented_as
elif idl_type.is_array_or_sequence_type:
return find_forward_declaration(idl_type.element_type)
elif idl_type.is_nullable:
return find_forward_declaration(idl_type.inner_type)
return None
declarations = set()
for operation in callback_interface.operations:
for argument in operation.arguments:
name = find_forward_declaration(argument.idl_type)
if name:
declarations.add(name)
return declarations
def add_includes_for_operation(operation):
operation.idl_type.add_includes_for_type()
for argument in operation.arguments:
argument.idl_type.add_includes_for_type()
def method_context(operation):
extended_attributes = operation.extended_attributes
idl_type = operation.idl_type
idl_type_str = str(idl_type)
add_includes_for_operation(operation)
context = {
'cpp_type':
idl_type.cpp_type,
'idl_type':
idl_type_str,
'name':
operation.name,
'native_value_traits_tag':
v8_types.idl_type_to_native_value_traits_tag(idl_type),
}
context.update(arguments_context(operation.arguments))
return context
def arguments_context(arguments):
def argument_context(argument):
return {
'cpp_value_to_v8_value':
argument.idl_type.cpp_value_to_v8_value(
argument.name,
isolate='GetIsolate()',
creation_context='argument_creation_context'),
'name':
argument.name,
'v8_name':
'v8_' + argument.name,
}
def argument_cpp_type(argument):
if argument.idl_type.is_dictionary:
return 'const %s*' % argument.idl_type.implemented_as
return argument.idl_type.cpp_type_args(
extended_attributes=argument.extended_attributes,
raw_type=False,
used_as_rvalue_type=True,
used_as_variadic_argument=argument.is_variadic)
argument_declarations = [
'bindings::V8ValueOrScriptWrappableAdapter callback_this_value'
]
argument_declarations.extend(
'%s %s' % (argument_cpp_type(argument), argument.name)
for argument in arguments)
return {
'argument_declarations': argument_declarations,
'arguments': [argument_context(argument) for argument in arguments],
}
| {'content_hash': 'a917a5a0ecffd99eeb074658edf7754e', 'timestamp': '', 'source': 'github', 'line_count': 163, 'max_line_length': 78, 'avg_line_length': 33.785276073619634, 'alnum_prop': 0.6560740875249682, 'repo_name': 'endlessm/chromium-browser', 'id': '33232bdbbb4323a0518fab4577332c6456ac5eeb', 'size': '7036', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'third_party/blink/renderer/bindings/scripts/v8_callback_interface.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
package http
import (
"encoding/json"
"go-common/app/service/main/vip/model"
"go-common/library/ecode"
"go-common/library/log"
bm "go-common/library/net/http/blademaster"
)
const (
_payNotifySuccess = "SUCCESS"
_payNotifyFail = "FAIL"
)
func notify(c *bm.Context) {
d := new(model.PayCallBackResult)
if err := c.Bind(d); err != nil {
log.Error("pr.Bind err(%+v)", err)
return
}
if d.TradeNO == "" {
c.JSON(nil, ecode.RequestErr)
return
}
if d.OutTradeNO == "" {
c.JSON(nil, ecode.RequestErr)
return
}
if d.TradeStatus != model.TradeSuccess {
c.JSON(nil, ecode.RequestErr)
return
}
if err := vipSvc.PayNotify(c, d); err != nil {
log.Error("s.PayNotify err(%+v)", err)
c.JSON(nil, err)
return
}
c.JSON(nil, nil)
}
func notify2(c *bm.Context) {
var (
err error
)
arg := new(struct {
MsgContent string `form:"msgContent" validate:"required"`
})
if err = c.Bind(arg); err != nil {
log.Error("c.Bind err(%+v)", err)
c.Writer.Write([]byte(_payNotifyFail))
return
}
p := &model.PayNotifyContent{}
if err = json.Unmarshal([]byte(arg.MsgContent), p); err != nil {
c.Writer.Write([]byte(_payNotifyFail))
return
}
if err = vipSvc.PayNotify2(c, p); err != nil {
log.Error("s.PayNotify2 err(%+v)", err)
if err == ecode.VipOrderAlreadyHandlerErr {
c.Writer.Write([]byte(_payNotifySuccess))
return
}
c.Writer.Write([]byte(_payNotifyFail))
return
}
c.Writer.Write([]byte(_payNotifySuccess))
}
func signNotify(c *bm.Context) {
var (
err error
)
arg := new(struct {
MsgContent string `form:"msgContent" validate:"required"`
})
if err = c.Bind(arg); err != nil {
return
}
p := new(model.PaySignNotify)
if err = json.Unmarshal([]byte(arg.MsgContent), p); err != nil {
c.Writer.Write([]byte(_payNotifyFail))
return
}
if err = vipSvc.PaySignNotify(c, p); err != nil {
log.Error("vip.paySignNotify(%+v) error(%+v)", p, err)
c.Writer.Write([]byte(_payNotifyFail))
return
}
c.Writer.Write([]byte(_payNotifySuccess))
}
func refundOrderNotify(c *bm.Context) {
var (
err error
)
arg := new(struct {
MsgContent string `form:"msgContent" validate:"required"`
})
if err = c.Bind(arg); err != nil {
return
}
p := new(model.PayRefundNotify)
log.Info("refun order notify params:%+v", arg.MsgContent)
if err = json.Unmarshal([]byte(arg.MsgContent), p); err != nil {
log.Error("error(%+v)", err)
c.Writer.Write([]byte(_payNotifyFail))
return
}
if err = vipSvc.RefundNotify(c, p); err != nil {
log.Error("vip.refundNotify(%+v) error(%+v)", arg.MsgContent, err)
c.Writer.Write([]byte(_payNotifyFail))
return
}
c.Writer.Write([]byte(_payNotifySuccess))
}
| {'content_hash': 'd494964c3a49f6010819f407fdbc6668', 'timestamp': '', 'source': 'github', 'line_count': 117, 'max_line_length': 69, 'avg_line_length': 22.803418803418804, 'alnum_prop': 0.6476761619190404, 'repo_name': 'LQJJ/demo', 'id': 'ec311df796af8b90e5084e8b5c8df0fbd429c804', 'size': '2668', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '126-go-common-master/app/service/main/vip/http/notify.go', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '5910716'}, {'name': 'C++', 'bytes': '113072'}, {'name': 'CSS', 'bytes': '10791'}, {'name': 'Dockerfile', 'bytes': '934'}, {'name': 'Go', 'bytes': '40121403'}, {'name': 'Groovy', 'bytes': '347'}, {'name': 'HTML', 'bytes': '359263'}, {'name': 'JavaScript', 'bytes': '545384'}, {'name': 'Makefile', 'bytes': '6671'}, {'name': 'Mathematica', 'bytes': '14565'}, {'name': 'Objective-C', 'bytes': '14900720'}, {'name': 'Objective-C++', 'bytes': '20070'}, {'name': 'PureBasic', 'bytes': '4152'}, {'name': 'Python', 'bytes': '4490569'}, {'name': 'Ruby', 'bytes': '44850'}, {'name': 'Shell', 'bytes': '33251'}, {'name': 'Swift', 'bytes': '463286'}, {'name': 'TSQL', 'bytes': '108861'}]} |
package org.apache.kafka.streams.kstream;
import org.apache.kafka.common.utils.Bytes;
import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.StreamsConfig;
import org.apache.kafka.streams.Topology;
import org.apache.kafka.streams.state.KeyValueStore;
import org.apache.kafka.streams.state.QueryableStoreType;
import org.apache.kafka.streams.state.WindowStore;
import java.time.Duration;
/**
* {@code TimeWindowedKStream} is an abstraction of a <i>windowed</i> record stream of {@link KeyValue} pairs.
* It is an intermediate representation of a {@link KStream} in order to apply a windowed aggregation operation on the original
* {@link KStream} records.
* <p>
* It is an intermediate representation after a grouping and windowing of a {@link KStream} before an aggregation is applied to the
* new (partitioned) windows resulting in a windowed {@link KTable}
* (a <emph>windowed</emph> {@code KTable} is a {@link KTable} with key type {@link Windowed Windowed<K>}.
* <p>
* The specified {@code windows} define either hopping time windows that can be overlapping or tumbling (c.f.
* {@link TimeWindows}) or they define landmark windows (c.f. {@link UnlimitedWindows}).
* The result is written into a local windowed {@link KeyValueStore} (which is basically an ever-updating
* materialized view) that can be queried using the name provided in the {@link Materialized} instance.
*
* New events are added to windows until their grace period ends (see {@link Windows#grace(Duration)}).
*
* Furthermore, updates to the store are sent downstream into a windowed {@link KTable} changelog stream, where
* "windowed" implies that the {@link KTable} key is a combined key of the original record key and a window ID.
* A {@code WindowedKStream} must be obtained from a {@link KGroupedStream} via {@link KGroupedStream#windowedBy(Windows)} .
*
* @param <K> Type of keys
* @param <V> Type of values
* @see KStream
* @see KGroupedStream
*/
public interface TimeWindowedKStream<K, V> {
/**
* Count the number of records in this stream by the grouped key and the defined windows.
* Records with {@code null} key or value are ignored.
* <p>
* Not all updates might get sent downstream, as an internal cache is used to deduplicate consecutive updates to
* the same window and key.
* The rate of propagated updates depends on your input data rate, the number of distinct keys, the number of
* parallel running Kafka Streams instances, and the {@link StreamsConfig configuration} parameters for
* {@link StreamsConfig#CACHE_MAX_BYTES_BUFFERING_CONFIG cache size}, and
* {@link StreamsConfig#COMMIT_INTERVAL_MS_CONFIG commit intervall}.
* <p>
* For failure and recovery the store will be backed by an internal changelog topic that will be created in Kafka.
* The changelog topic will be named "${applicationId}-${internalStoreName}-changelog", where "applicationId" is
* user-specified in {@link StreamsConfig StreamsConfig} via parameter
* {@link StreamsConfig#APPLICATION_ID_CONFIG APPLICATION_ID_CONFIG}, "internalStoreName" is an internal name
* and "-changelog" is a fixed suffix.
* Note that the internal store name may not be queriable through Interactive Queries.
*
* You can retrieve all generated internal topic names via {@link Topology#describe()}.
*
* @return a {@link KTable} that contains "update" records with unmodified keys and {@link Long} values that
* represent the latest (rolling) count (i.e., number of records) for each key
*/
KTable<Windowed<K>, Long> count();
/**
* Count the number of records in this stream by the grouped key and the defined windows.
* Records with {@code null} key or value are ignored.
* <p>
* Not all updates might get sent downstream, as an internal cache will be used to deduplicate consecutive updates to
* the same window and key if caching is enabled on the {@link Materialized} instance.
* When caching is enabled the rate of propagated updates depends on your input data rate, the number of distinct keys, the number of
* parallel running Kafka Streams instances, and the {@link StreamsConfig configuration} parameters for
* {@link StreamsConfig#CACHE_MAX_BYTES_BUFFERING_CONFIG cache size}, and
* {@link StreamsConfig#COMMIT_INTERVAL_MS_CONFIG commit intervall}
*
* <p>
* To query the local windowed {@link KeyValueStore} it must be obtained via
* {@link KafkaStreams#store(String, QueryableStoreType) KafkaStreams#store(...)}:
* <pre>{@code
* KafkaStreams streams = ... // counting words
* Store queryableStoreName = ... // the queryableStoreName should be the name of the store as defined by the Materialized instance
* ReadOnlyWindowStore<String,Long> localWindowStore = streams.store(queryableStoreName, QueryableStoreTypes.<String, Long>windowStore());
*
* String key = "some-word";
* long fromTime = ...;
* long toTime = ...;
* WindowStoreIterator<Long> countForWordsForWindows = localWindowStore.fetch(key, timeFrom, timeTo); // key must be local (application state is shared over all running Kafka Streams instances)
* }</pre>
* For non-local keys, a custom RPC mechanism must be implemented using {@link KafkaStreams#allMetadata()} to
* query the value of the key on a parallel running instance of your Kafka Streams application.
*
* <p>
* For failure and recovery the store will be backed by an internal changelog topic that will be created in Kafka.
* Therefore, the store name defined by the Materialized instance must be a valid Kafka topic name and cannot contain characters other than ASCII
* alphanumerics, '.', '_' and '-'.
* The changelog topic will be named "${applicationId}-${storeName}-changelog", where "applicationId" is
* user-specified in {@link StreamsConfig} via parameter
* {@link StreamsConfig#APPLICATION_ID_CONFIG APPLICATION_ID_CONFIG}, "storeName" is the
* provide store name defined in {@code Materialized}, and "-changelog" is a fixed suffix.
*
* You can retrieve all generated internal topic names via {@link Topology#describe()}.
*
* @param materialized an instance of {@link Materialized} used to materialize a state store. Cannot be {@code null}.
* Note: the valueSerde will be automatically set to {@link org.apache.kafka.common.serialization.Serdes#Long() Serdes#Long()}
* if there is no valueSerde provided
* @return a {@link KTable} that contains "update" records with unmodified keys and {@link Long} values that
* represent the latest (rolling) count (i.e., number of records) for each key
*/
KTable<Windowed<K>, Long> count(final Materialized<K, Long, WindowStore<Bytes, byte[]>> materialized);
/**
* Aggregate the values of records in this stream by the grouped key.
* Records with {@code null} key or value are ignored.
* Aggregating is a generalization of {@link #reduce(Reducer) combining via reduce(...)} as it, for example,
* allows the result to have a different type than the input values.
* The result is written into a local {@link KeyValueStore} (which is basically an ever-updating materialized view)
* that can be queried using the provided {@code queryableStoreName}.
* Furthermore, updates to the store are sent downstream into a {@link KTable} changelog stream.
* <p>
* The specified {@link Initializer} is applied once directly before the first input record is processed to
* provide an initial intermediate aggregation result that is used to process the first record.
* The specified {@link Aggregator} is applied for each input record and computes a new aggregate using the current
* aggregate (or for the very first record using the intermediate aggregation result provided via the
* {@link Initializer}) and the record's value.
* Thus, {@code aggregate(Initializer, Aggregator)} can be used to compute aggregate functions like
* count (c.f. {@link #count()}).
* <p>
* The default value serde from config will be used for serializing the result.
* If a different serde is required then you should use {@link #aggregate(Initializer, Aggregator, Materialized)}.
* <p>
* Not all updates might get sent downstream, as an internal cache is used to deduplicate consecutive updates to
* the same key.
* The rate of propagated updates depends on your input data rate, the number of distinct keys, the number of
* parallel running Kafka Streams instances, and the {@link StreamsConfig configuration} parameters for
* {@link StreamsConfig#CACHE_MAX_BYTES_BUFFERING_CONFIG cache size}, and
* {@link StreamsConfig#COMMIT_INTERVAL_MS_CONFIG commit intervall}.
* <p>
* For failure and recovery the store will be backed by an internal changelog topic that will be created in Kafka.
* The changelog topic will be named "${applicationId}-${internalStoreName}-changelog", where "applicationId" is
* user-specified in {@link StreamsConfig} via parameter
* {@link StreamsConfig#APPLICATION_ID_CONFIG APPLICATION_ID_CONFIG}, "internalStoreName" is an internal name
* and "-changelog" is a fixed suffix.
* Note that the internal store name may not be queriable through Interactive Queries.
*
* You can retrieve all generated internal topic names via {@link Topology#describe()}.
*
*
* @param <VR> the value type of the resulting {@link KTable}
* @param initializer an {@link Initializer} that computes an initial intermediate aggregation result
* @param aggregator an {@link Aggregator} that computes a new aggregate result
* @return a {@link KTable} that contains "update" records with unmodified keys, and values that represent the
* latest (rolling) aggregate for each key
*/
<VR> KTable<Windowed<K>, VR> aggregate(final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator);
/**
* Aggregate the values of records in this stream by the grouped key.
* Records with {@code null} key or value are ignored.
* Aggregating is a generalization of {@link #reduce(Reducer) combining via reduce(...)} as it, for example,
* allows the result to have a different type than the input values.
* The result is written into a local {@link KeyValueStore} (which is basically an ever-updating materialized view)
* that can be queried using the store name as provided with {@link Materialized}.
* <p>
* The specified {@link Initializer} is applied once directly before the first input record is processed to
* provide an initial intermediate aggregation result that is used to process the first record.
* The specified {@link Aggregator} is applied for each input record and computes a new aggregate using the current
* aggregate (or for the very first record using the intermediate aggregation result provided via the
* {@link Initializer}) and the record's value.
* Thus, {@code aggregate(Initializer, Aggregator, Materialized)} can be used to compute aggregate functions like
* count (c.f. {@link #count()}).
* <p>
* <p>
* Not all updates might get sent downstream, as an internal cache will be used to deduplicate consecutive updates to
* the same window and key if caching is enabled on the {@link Materialized} instance.
* When caching is enable the rate of propagated updates depends on your input data rate, the number of distinct keys, the number of
* parallel running Kafka Streams instances, and the {@link StreamsConfig configuration} parameters for
* {@link StreamsConfig#CACHE_MAX_BYTES_BUFFERING_CONFIG cache size}, and
* {@link StreamsConfig#COMMIT_INTERVAL_MS_CONFIG commit intervall}
*
* <p>
* To query the local windowed {@link KeyValueStore} it must be obtained via
* {@link KafkaStreams#store(String, QueryableStoreType) KafkaStreams#store(...)}:
* <pre>{@code
* KafkaStreams streams = ... // counting words
* Store queryableStoreName = ... // the queryableStoreName should be the name of the store as defined by the Materialized instance
* ReadOnlyWindowStore<String,Long> localWindowStore = streams.store(queryableStoreName, QueryableStoreTypes.<String, Long>windowStore());
*
* String key = "some-word";
* long fromTime = ...;
* long toTime = ...;
* WindowStoreIterator<Long> aggregateStore = localWindowStore.fetch(key, timeFrom, timeTo); // key must be local (application state is shared over all running Kafka Streams instances)
* }</pre>
*
* <p>
* For failure and recovery the store will be backed by an internal changelog topic that will be created in Kafka.
* Therefore, the store name defined by the Materialized instance must be a valid Kafka topic name and cannot contain characters other than ASCII
* alphanumerics, '.', '_' and '-'.
* The changelog topic will be named "${applicationId}-${storeName}-changelog", where "applicationId" is
* user-specified in {@link StreamsConfig} via parameter
* {@link StreamsConfig#APPLICATION_ID_CONFIG APPLICATION_ID_CONFIG}, "storeName" is the
* provide store name defined in {@code Materialized}, and "-changelog" is a fixed suffix.
*
* You can retrieve all generated internal topic names via {@link Topology#describe()}.
*
* @param initializer an {@link Initializer} that computes an initial intermediate aggregation result
* @param aggregator an {@link Aggregator} that computes a new aggregate result
* @param materialized an instance of {@link Materialized} used to materialize a state store. Cannot be {@code null}.
* @param <VR> the value type of the resulting {@link KTable}
* @return a {@link KTable} that contains "update" records with unmodified keys, and values that represent the
* latest (rolling) aggregate for each key
*/
<VR> KTable<Windowed<K>, VR> aggregate(final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator,
final Materialized<K, VR, WindowStore<Bytes, byte[]>> materialized);
/**
* Combine the values of records in this stream by the grouped key.
* Records with {@code null} key or value are ignored.
* Combining implies that the type of the aggregate result is the same as the type of the input value.
* The result is written into a local {@link KeyValueStore} (which is basically an ever-updating materialized view)
* that can be queried using the provided {@code queryableStoreName}.
* Furthermore, updates to the store are sent downstream into a {@link KTable} changelog stream.
* <p>
* The specified {@link Reducer} is applied for each input record and computes a new aggregate using the current
* aggregate and the record's value.
* If there is no current aggregate the {@link Reducer} is not applied and the new aggregate will be the record's
* value as-is.
* Thus, {@code reduce(Reducer, String)} can be used to compute aggregate functions like sum, min, or max.
* <p>
* Not all updates might get sent downstream, as an internal cache is used to deduplicate consecutive updates to
* the same key.
* The rate of propagated updates depends on your input data rate, the number of distinct keys, the number of
* parallel running Kafka Streams instances, and the {@link StreamsConfig configuration} parameters for
* {@link StreamsConfig#CACHE_MAX_BYTES_BUFFERING_CONFIG cache size}, and
* {@link StreamsConfig#COMMIT_INTERVAL_MS_CONFIG commit intervall}.
* <p>
* For failure and recovery the store will be backed by an internal changelog topic that will be created in Kafka.
* The changelog topic will be named "${applicationId}-${internalStoreName}-changelog", where "applicationId" is
* user-specified in {@link StreamsConfig} via parameter
* {@link StreamsConfig#APPLICATION_ID_CONFIG APPLICATION_ID_CONFIG}, "internalStoreName" is an internal name
* and "-changelog" is a fixed suffix.
*
* You can retrieve all generated internal topic names via {@link Topology#describe()}.
*
* @param reducer a {@link Reducer} that computes a new aggregate result
* @return a {@link KTable} that contains "update" records with unmodified keys, and values that represent the
* latest (rolling) aggregate for each key
*/
KTable<Windowed<K>, V> reduce(final Reducer<V> reducer);
/**
* Combine the values of records in this stream by the grouped key.
* Records with {@code null} key or value are ignored.
* Combining implies that the type of the aggregate result is the same as the type of the input value.
* The result is written into a local {@link KeyValueStore} (which is basically an ever-updating materialized view)
* that can be queried using the store name as provided with {@link Materialized}.
* Furthermore, updates to the store are sent downstream into a {@link KTable} changelog stream.
* <p>
* The specified {@link Reducer} is applied for each input record and computes a new aggregate using the current
* aggregate and the record's value.
* If there is no current aggregate the {@link Reducer} is not applied and the new aggregate will be the record's
* value as-is.
* Thus, {@code reduce(Reducer, String)} can be used to compute aggregate functions like sum, min, or max.
* <p>
* Not all updates might get sent downstream, as an internal cache will be used to deduplicate consecutive updates to
* the same window and key if caching is enabled on the {@link Materialized} instance.
* When caching is enable the rate of propagated updates depends on your input data rate, the number of distinct keys, the number of
* parallel running Kafka Streams instances, and the {@link StreamsConfig configuration} parameters for
* {@link StreamsConfig#CACHE_MAX_BYTES_BUFFERING_CONFIG cache size}, and
* {@link StreamsConfig#COMMIT_INTERVAL_MS_CONFIG commit intervall}
* <p>
* To query the local windowed {@link KeyValueStore} it must be obtained via
* {@link KafkaStreams#store(String, QueryableStoreType) KafkaStreams#store(...)}:
* <pre>{@code
* KafkaStreams streams = ... // counting words
* Store queryableStoreName = ... // the queryableStoreName should be the name of the store as defined by the Materialized instance
* ReadOnlyWindowStore<String,Long> localWindowStore = streams.store(queryableStoreName, QueryableStoreTypes.<String, Long>windowStore());
*
* String key = "some-word";
* long fromTime = ...;
* long toTime = ...;
* WindowStoreIterator<Long> reduceStore = localWindowStore.fetch(key, timeFrom, timeTo); // key must be local (application state is shared over all running Kafka Streams instances)
* }</pre>
*
* <p>
* For failure and recovery the store will be backed by an internal changelog topic that will be created in Kafka.
* Therefore, the store name defined by the Materialized instance must be a valid Kafka topic name and cannot contain characters other than ASCII
* alphanumerics, '.', '_' and '-'.
* The changelog topic will be named "${applicationId}-${storeName}-changelog", where "applicationId" is
* user-specified in {@link StreamsConfig} via parameter
* {@link StreamsConfig#APPLICATION_ID_CONFIG APPLICATION_ID_CONFIG}, "storeName" is the
* provide store name defined in {@code Materialized}, and "-changelog" is a fixed suffix.
*
* You can retrieve all generated internal topic names via {@link Topology#describe()}.
*
* @param reducer a {@link Reducer} that computes a new aggregate result
* @return a {@link KTable} that contains "update" records with unmodified keys, and values that represent the
* latest (rolling) aggregate for each key
*/
KTable<Windowed<K>, V> reduce(final Reducer<V> reducer,
final Materialized<K, V, WindowStore<Bytes, byte[]>> materialized);
}
| {'content_hash': '429735bde413e27928f3429af437b2aa', 'timestamp': '', 'source': 'github', 'line_count': 306, 'max_line_length': 197, 'avg_line_length': 67.08496732026144, 'alnum_prop': 0.708593141075604, 'repo_name': 'Esquive/kafka', 'id': 'd6f4082592546475784e547dc76b05b370619ee4', 'size': '21326', 'binary': False, 'copies': '3', 'ref': 'refs/heads/trunk', 'path': 'streams/src/main/java/org/apache/kafka/streams/kstream/TimeWindowedKStream.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '20422'}, {'name': 'HTML', 'bytes': '4595'}, {'name': 'Java', 'bytes': '3646896'}, {'name': 'Python', 'bytes': '294812'}, {'name': 'Scala', 'bytes': '2840404'}, {'name': 'Shell', 'bytes': '43757'}, {'name': 'XSLT', 'bytes': '7116'}]} |
<html>
<body>
<h1>Welcome to this form. Please enter some info below:</h1>
<form>
<p>Please enter your name</p>
<label>First Name:<input type='text' name='first_name'></label>
<label>Last Name:<input type='text' name='last_name'></label>
<p>Please select your gender:</p>
<label><input type="radio" name="gender" value="male"> M</label>
<label><input type="radio" name="gender" value="female"> F</label>
<input type="submit" value="submit">
</form>
</body>
</html>
| {'content_hash': '146f52234ff3441b32e245b72e7fc45c', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 72, 'avg_line_length': 37.357142857142854, 'alnum_prop': 0.6080305927342257, 'repo_name': 'dallaspythondojo/python', 'id': '21277e80eb1e4405377ceb4c4eb4d2dee4aef0ec', 'size': '523', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Tan_ShinYi/Assignments/Flask_Fundamentals/1_Landing_Page/templates/dojos.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '25381'}, {'name': 'HTML', 'bytes': '256675'}, {'name': 'JavaScript', 'bytes': '528'}, {'name': 'Python', 'bytes': '399336'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_22) on Wed Apr 03 10:03:21 GMT-03:00 2013 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Dictionary (Apache OpenNLP Tools 1.5.3 API)
</TITLE>
<META NAME="keywords" CONTENT="opennlp.tools.coref.mention.Dictionary interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Dictionary (Apache OpenNLP Tools 1.5.3 API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../opennlp/tools/coref/mention/DefaultParse.html" title="class in opennlp.tools.coref.mention"><B>PREV CLASS</B></A>
<A HREF="../../../../opennlp/tools/coref/mention/DictionaryFactory.html" title="class in opennlp.tools.coref.mention"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?opennlp/tools/coref/mention/Dictionary.html" target="_top"><B>FRAMES</B></A>
<A HREF="Dictionary.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
opennlp.tools.coref.mention</FONT>
<BR>
Interface Dictionary</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../opennlp/tools/coref/mention/JWNLDictionary.html" title="class in opennlp.tools.coref.mention">JWNLDictionary</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>Dictionary</B></DL>
</PRE>
<P>
Interface to provide dictionary information to the coreference module assuming a
hierarchically structured dictionary (such as WordNet) is available.
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../opennlp/tools/coref/mention/Dictionary.html#getLemmas(java.lang.String, java.lang.String)">getLemmas</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> word,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pos)</CODE>
<BR>
Returns the lemmas of the specified word with the specified part-of-speech.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../opennlp/tools/coref/mention/Dictionary.html#getNumSenses(java.lang.String, java.lang.String)">getNumSenses</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> lemma,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pos)</CODE>
<BR>
Returns the number of senses in the dictionary for the specified lemma.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../opennlp/tools/coref/mention/Dictionary.html#getParentSenseKeys(java.lang.String, java.lang.String, int)">getParentSenseKeys</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> lemma,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pos,
int senseNumber)</CODE>
<BR>
Returns an array of keys for each parent of the specified sense number of the specified lemma with the specified part-of-speech.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../opennlp/tools/coref/mention/Dictionary.html#getSenseKey(java.lang.String, java.lang.String, int)">getSenseKey</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> lemma,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pos,
int senseNumber)</CODE>
<BR>
Returns a key indicating the specified sense number of the specified
lemma with the specified part-of-speech.</TD>
</TR>
</TABLE>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getLemmas(java.lang.String, java.lang.String)"><!-- --></A><H3>
getLemmas</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] <B>getLemmas</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> word,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pos)</PRE>
<DL>
<DD>Returns the lemmas of the specified word with the specified part-of-speech.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>word</CODE> - The word whose lemmas are desired.<DD><CODE>pos</CODE> - The part-of-speech of the specified word.
<DT><B>Returns:</B><DD>The lemmas of the specified word given the specified part-of-speech.</DL>
</DD>
</DL>
<HR>
<A NAME="getSenseKey(java.lang.String, java.lang.String, int)"><!-- --></A><H3>
getSenseKey</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getSenseKey</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> lemma,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pos,
int senseNumber)</PRE>
<DL>
<DD>Returns a key indicating the specified sense number of the specified
lemma with the specified part-of-speech.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lemma</CODE> - The lemmas for which the key is desired.<DD><CODE>pos</CODE> - The pos for which the key is desired.<DD><CODE>senseNumber</CODE> - The sense number for which the key is desired.
<DT><B>Returns:</B><DD>a key indicating the specified sense number of the specified
lemma with the specified part-of-speech.</DL>
</DD>
</DL>
<HR>
<A NAME="getNumSenses(java.lang.String, java.lang.String)"><!-- --></A><H3>
getNumSenses</H3>
<PRE>
int <B>getNumSenses</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> lemma,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pos)</PRE>
<DL>
<DD>Returns the number of senses in the dictionary for the specified lemma.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lemma</CODE> - A lemmatized form of the word to look up.<DD><CODE>pos</CODE> - The part-of-speech for the lemma.
<DT><B>Returns:</B><DD>the number of senses in the dictionary for the specified lemma.</DL>
</DD>
</DL>
<HR>
<A NAME="getParentSenseKeys(java.lang.String, java.lang.String, int)"><!-- --></A><H3>
getParentSenseKeys</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] <B>getParentSenseKeys</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> lemma,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> pos,
int senseNumber)</PRE>
<DL>
<DD>Returns an array of keys for each parent of the specified sense number of the specified lemma with the specified part-of-speech.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lemma</CODE> - A lemmatized form of the word to look up.<DD><CODE>pos</CODE> - The part-of-speech for the lemma.<DD><CODE>senseNumber</CODE> - The sense number for which the parent keys are desired.
<DT><B>Returns:</B><DD>an array of keys for each parent of the specified sense number of the specified lemma with the specified part-of-speech.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../opennlp/tools/coref/mention/DefaultParse.html" title="class in opennlp.tools.coref.mention"><B>PREV CLASS</B></A>
<A HREF="../../../../opennlp/tools/coref/mention/DictionaryFactory.html" title="class in opennlp.tools.coref.mention"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?opennlp/tools/coref/mention/Dictionary.html" target="_top"><B>FRAMES</B></A>
<A HREF="Dictionary.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
| {'content_hash': '5b7469cf6806043e570a3269cb2840ef', 'timestamp': '', 'source': 'github', 'line_count': 294, 'max_line_length': 309, 'avg_line_length': 52.24829931972789, 'alnum_prop': 0.6602434737321788, 'repo_name': 'opener-project/nerc-fr', 'id': 'a8e0eb8132544e520d8f71780d8ada1cd4da52ba', 'size': '15361', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'opennlp/docs/apidocs/opennlp-tools/opennlp/tools/coref/mention/Dictionary.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1732'}, {'name': 'CSS', 'bytes': '10884'}, {'name': 'HTML', 'bytes': '19664974'}, {'name': 'Java', 'bytes': '112817'}, {'name': 'Shell', 'bytes': '1253'}]} |
@interface FindPaswordViewController : UIViewController
@end
| {'content_hash': '92996eac6c2bfa10da1d04157dcc7380', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 55, 'avg_line_length': 20.666666666666668, 'alnum_prop': 0.8548387096774194, 'repo_name': 'WangXueJuan/BurstLaught', 'id': '43b28366203d9782726c56bd9ca4ff21b6d2f034', 'size': '232', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'BurstLaugh/BurstLaugh/Classes/Mine/Login/Controllers/FindPaswordViewController.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Objective-C', 'bytes': '950741'}, {'name': 'Ruby', 'bytes': '79'}, {'name': 'Shell', 'bytes': '7953'}]} |
(function(){
// Initial Setup
// -------------
// Save a reference to the global object (`window` in the browser, `exports`
// on the server).
var root = this;
// Save the previous value of the `Backbone` variable, so that it can be
// restored later on, if `noConflict` is used.
var previousBackbone = root.Backbone;
// Create local references to array methods we'll want to use later.
var array = [];
var push = array.push;
var slice = array.slice;
var splice = array.splice;
// The top-level namespace. All public Backbone classes and modules will
// be attached to this. Exported for both the browser and the server.
var Backbone;
if (typeof exports !== 'undefined') {
Backbone = exports;
} else {
Backbone = root.Backbone = {};
}
// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '1.0.0';
// Require Underscore, if we're on the server, and it's not already present.
var _ = root._;
if (!_ && (typeof require !== 'undefined')) _ = require('underscore');
// For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
// the `$` variable.
Backbone.$ = root.jQuery || root.Zepto || root.ender || root.$;
// Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
// to its previous owner. Returns a reference to this Backbone object.
Backbone.noConflict = function() {
root.Backbone = previousBackbone;
return this;
};
// Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
// will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
// set a `X-Http-Method-Override` header.
Backbone.emulateHTTP = false;
// Turn on `emulateJSON` to support legacy servers that can't deal with direct
// `application/json` requests ... will encode the body as
// `application/x-www-form-urlencoded` instead and will send the model in a
// form param named `model`.
Backbone.emulateJSON = false;
// Backbone.Events
// ---------------
// A module that can be mixed in to *any object* in order to provide it with
// custom events. You may bind with `on` or remove with `off` callback
// functions to an event; `trigger`-ing an event fires all callbacks in
// succession.
//
// var object = {};
// _.extend(object, Backbone.Events);
// object.on('expand', function(){ alert('expanded'); });
// object.trigger('expand');
//
var Events = Backbone.Events = {
// Bind an event to a `callback` function. Passing `"all"` will bind
// the callback to all events fired.
on: function(name, callback, context) {
if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []);
events.push({callback: callback, context: context, ctx: context || this});
return this;
},
// Bind an event to only be triggered a single time. After the first time
// the callback is invoked, it will be removed.
once: function(name, callback, context) {
if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
var self = this;
var once = _.once(function() {
self.off(name, once);
callback.apply(this, arguments);
});
once._callback = callback;
return this.on(name, once, context);
},
// Remove one or many callbacks. If `context` is null, removes all
// callbacks with that function. If `callback` is null, removes all
// callbacks for the event. If `name` is null, removes all bound
// callbacks for all events.
off: function(name, callback, context) {
var retain, ev, events, names, i, l, j, k;
if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
if (!name && !callback && !context) {
this._events = {};
return this;
}
names = name ? [name] : _.keys(this._events);
for (i = 0, l = names.length; i < l; i++) {
name = names[i];
if (events = this._events[name]) {
this._events[name] = retain = [];
if (callback || context) {
for (j = 0, k = events.length; j < k; j++) {
ev = events[j];
if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
(context && context !== ev.context)) {
retain.push(ev);
}
}
}
if (!retain.length) delete this._events[name];
}
}
return this;
},
// Trigger one or many events, firing all bound callbacks. Callbacks are
// passed the same arguments as `trigger` is, apart from the event name
// (unless you're listening on `"all"`, which will cause your callback to
// receive the true name of the event as the first argument).
trigger: function(name) {
if (!this._events) return this;
var args = slice.call(arguments, 1);
if (!eventsApi(this, 'trigger', name, args)) return this;
var events = this._events[name];
var allEvents = this._events.all;
if (events) triggerEvents(events, args);
if (allEvents) triggerEvents(allEvents, arguments);
return this;
},
// Tell this object to stop listening to either specific events ... or
// to every object it's currently listening to.
stopListening: function(obj, name, callback) {
var listeners = this._listeners;
if (!listeners) return this;
var deleteListener = !name && !callback;
if (typeof name === 'object') callback = this;
if (obj) (listeners = {})[obj._listenerId] = obj;
for (var id in listeners) {
listeners[id].off(name, callback, this);
if (deleteListener) delete this._listeners[id];
}
return this;
}
};
// Regular expression used to split event strings.
var eventSplitter = /\s+/;
// Implement fancy features of the Events API such as multiple event
// names `"change blur"` and jQuery-style event maps `{change: action}`
// in terms of the existing API.
var eventsApi = function(obj, action, name, rest) {
if (!name) return true;
// Handle event maps.
if (typeof name === 'object') {
for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest));
}
return false;
}
// Handle space separated event names.
if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0, l = names.length; i < l; i++) {
obj[action].apply(obj, [names[i]].concat(rest));
}
return false;
}
return true;
};
// A difficult-to-believe, but optimized internal dispatch function for
// triggering events. Tries to keep the usual cases speedy (most internal
// Backbone events have 3 arguments).
var triggerEvents = function(events, args) {
var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
switch (args.length) {
case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
}
};
var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
// Inversion-of-control versions of `on` and `once`. Tell *this* object to
// listen to an event in another object ... keeping track of what it's
// listening to.
_.each(listenMethods, function(implementation, method) {
Events[method] = function(obj, name, callback) {
var listeners = this._listeners || (this._listeners = {});
var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
listeners[id] = obj;
if (typeof name === 'object') callback = this;
obj[implementation](name, callback, this);
return this;
};
});
// Aliases for backwards compatibility.
Events.bind = Events.on;
Events.unbind = Events.off;
// Allow the `Backbone` object to serve as a global event bus, for folks who
// want global "pubsub" in a convenient place.
_.extend(Backbone, Events);
// Backbone.Model
// --------------
// Backbone **Models** are the basic data object in the framework --
// frequently representing a row in a table in a database on your server.
// A discrete chunk of data and a bunch of useful, related methods for
// performing computations and transformations on that data.
// Create a new model with the specified attributes. A client id (`cid`)
// is automatically generated and assigned for you.
var Model = Backbone.Model = function(attributes, options) {
var defaults;
var attrs = attributes || {};
options || (options = {});
this.cid = _.uniqueId('c');
this.attributes = {};
_.extend(this, _.pick(options, modelOptions));
if (options.parse) attrs = this.parse(attrs, options) || {};
if (defaults = _.result(this, 'defaults')) {
attrs = _.defaults({}, attrs, defaults);
}
this.set(attrs, options);
this.changed = {};
this.initialize.apply(this, arguments);
};
// A list of options to be attached directly to the model, if provided.
var modelOptions = ['url', 'urlRoot', 'collection'];
// Attach all inheritable methods to the Model prototype.
_.extend(Model.prototype, Events, {
// A hash of attributes whose current and previous value differ.
changed: null,
// The value returned during the last failed validation.
validationError: null,
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
// CouchDB users may want to set this to `"_id"`.
idAttribute: 'id',
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// Return a copy of the model's `attributes` object.
toJSON: function(options) {
return _.clone(this.attributes);
},
// Proxy `Backbone.sync` by default -- but override this if you need
// custom syncing semantics for *this* particular model.
sync: function() {
return Backbone.sync.apply(this, arguments);
},
// Get the value of an attribute.
get: function(attr) {
return this.attributes[attr];
},
// Get the HTML-escaped value of an attribute.
escape: function(attr) {
return _.escape(this.get(attr));
},
// Returns `true` if the attribute contains a value that is not null
// or undefined.
has: function(attr) {
return this.get(attr) != null;
},
// Set a hash of model attributes on the object, firing `"change"`. This is
// the core primitive operation of a model, updating the data and notifying
// anyone who needs to know about the change in state. The heart of the beast.
set: function(key, val, options) {
var attr, attrs, unset, changes, silent, changing, prev, current;
if (key == null) return this;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (typeof key === 'object') {
attrs = key;
options = val;
} else {
(attrs = {})[key] = val;
}
options || (options = {});
// Run validation.
if (!this._validate(attrs, options)) return false;
// Extract attributes and options.
unset = options.unset;
silent = options.silent;
changes = [];
changing = this._changing;
this._changing = true;
if (!changing) {
this._previousAttributes = _.clone(this.attributes);
this.changed = {};
}
current = this.attributes, prev = this._previousAttributes;
// Check for changes of `id`.
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
// For each `set` attribute, update or delete the current value.
for (attr in attrs) {
val = attrs[attr];
if (!_.isEqual(current[attr], val)) changes.push(attr);
if (!_.isEqual(prev[attr], val)) {
this.changed[attr] = val;
} else {
delete this.changed[attr];
}
unset ? delete current[attr] : current[attr] = val;
}
// Trigger all relevant attribute changes.
if (!silent) {
if (changes.length) this._pending = true;
for (var i = 0, l = changes.length; i < l; i++) {
this.trigger('change:' + changes[i], this, current[changes[i]], options);
}
}
// You might be wondering why there's a `while` loop here. Changes can
// be recursively nested within `"change"` events.
if (changing) return this;
if (!silent) {
while (this._pending) {
this._pending = false;
this.trigger('change', this, options);
}
}
this._pending = false;
this._changing = false;
return this;
},
// Remove an attribute from the model, firing `"change"`. `unset` is a noop
// if the attribute doesn't exist.
unset: function(attr, options) {
return this.set(attr, void 0, _.extend({}, options, {unset: true}));
},
// Clear all attributes on the model, firing `"change"`.
clear: function(options) {
var attrs = {};
for (var key in this.attributes) attrs[key] = void 0;
return this.set(attrs, _.extend({}, options, {unset: true}));
},
// Determine if the model has changed since the last `"change"` event.
// If you specify an attribute name, determine if that attribute has changed.
hasChanged: function(attr) {
if (attr == null) return !_.isEmpty(this.changed);
return _.has(this.changed, attr);
},
// Return an object containing all the attributes that have changed, or
// false if there are no changed attributes. Useful for determining what
// parts of a view need to be updated and/or what attributes need to be
// persisted to the server. Unset attributes will be set to undefined.
// You can also pass an attributes object to diff against the model,
// determining if there *would be* a change.
changedAttributes: function(diff) {
if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
var val, changed = false;
var old = this._changing ? this._previousAttributes : this.attributes;
for (var attr in diff) {
if (_.isEqual(old[attr], (val = diff[attr]))) continue;
(changed || (changed = {}))[attr] = val;
}
return changed;
},
// Get the previous value of an attribute, recorded at the time the last
// `"change"` event was fired.
previous: function(attr) {
if (attr == null || !this._previousAttributes) return null;
return this._previousAttributes[attr];
},
// Get all of the attributes of the model at the time of the previous
// `"change"` event.
previousAttributes: function() {
return _.clone(this._previousAttributes);
},
// Fetch the model from the server. If the server's representation of the
// model differs from its current attributes, they will be overridden,
// triggering a `"change"` event.
fetch: function(options) {
options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true;
var model = this;
var success = options.success;
options.success = function(resp) {
if (!model.set(model.parse(resp, options), options)) return false;
if (success) success(model, resp, options);
model.trigger('sync', model, resp, options);
};
wrapError(this, options);
return this.sync('read', this, options);
},
// Set a hash of model attributes, and sync the model to the server.
// If the server returns an attributes hash that differs, the model's
// state will be `set` again.
save: function(key, val, options) {
var attrs, method, xhr, attributes = this.attributes;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || typeof key === 'object') {
attrs = key;
options = val;
} else {
(attrs = {})[key] = val;
}
// If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.
if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;
options = _.extend({validate: true}, options);
// Do not persist invalid models.
if (!this._validate(attrs, options)) return false;
// Set temporary attributes if `{wait: true}`.
if (attrs && options.wait) {
this.attributes = _.extend({}, attributes, attrs);
}
// After a successful server-side save, the client is (optionally)
// updated with the server-side state.
if (options.parse === void 0) options.parse = true;
var model = this;
var success = options.success;
options.success = function(resp) {
// Ensure attributes are restored during synchronous saves.
model.attributes = attributes;
var serverAttrs = model.parse(resp, options);
if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
return false;
}
if (success) success(model, resp, options);
model.trigger('sync', model, resp, options);
};
wrapError(this, options);
method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
if (method === 'patch') options.attrs = attrs;
xhr = this.sync(method, this, options);
// Restore attributes.
if (attrs && options.wait) this.attributes = attributes;
return xhr;
},
// Destroy this model on the server if it was already persisted.
// Optimistically removes the model from its collection, if it has one.
// If `wait: true` is passed, waits for the server to respond before removal.
destroy: function(options) {
options = options ? _.clone(options) : {};
var model = this;
var success = options.success;
var destroy = function() {
model.trigger('destroy', model, model.collection, options);
};
options.success = function(resp) {
if (options.wait || model.isNew()) destroy();
if (success) success(model, resp, options);
if (!model.isNew()) model.trigger('sync', model, resp, options);
};
if (this.isNew()) {
options.success();
return false;
}
wrapError(this, options);
var xhr = this.sync('delete', this, options);
if (!options.wait) destroy();
return xhr;
},
// Default URL for the model's representation on the server -- if you're
// using Backbone's restful methods, override this to change the endpoint
// that will be called.
url: function() {
var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
if (this.isNew()) return base;
return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);
},
// **parse** converts a response into the hash of attributes to be `set` on
// the model. The default implementation is just to pass the response along.
parse: function(resp, options) {
return resp;
},
// Create a new model with identical attributes to this one.
clone: function() {
return new this.constructor(this.attributes);
},
// A model is new if it has never been saved to the server, and lacks an id.
isNew: function() {
return this.id == null;
},
// Check if the model is currently in a valid state.
isValid: function(options) {
return this._validate({}, _.extend(options || {}, { validate: true }));
},
// Run validation against the next complete set of model attributes,
// returning `true` if all is well. Otherwise, fire an `"invalid"` event.
_validate: function(attrs, options) {
if (!options.validate || !this.validate) return true;
attrs = _.extend({}, this.attributes, attrs);
var error = this.validationError = this.validate(attrs, options) || null;
if (!error) return true;
this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error}));
return false;
}
});
// Underscore methods that we want to implement on the Model.
var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];
// Mix in each Underscore method as a proxy to `Model#attributes`.
_.each(modelMethods, function(method) {
Model.prototype[method] = function() {
var args = slice.call(arguments);
args.unshift(this.attributes);
return _[method].apply(_, args);
};
});
// Backbone.Collection
// -------------------
// If models tend to represent a single row of data, a Backbone Collection is
// more analagous to a table full of data ... or a small slice or page of that
// table, or a collection of rows that belong together for a particular reason
// -- all of the messages in this particular folder, all of the documents
// belonging to this particular author, and so on. Collections maintain
// indexes of their models, both in order, and for lookup by `id`.
// Create a new **Collection**, perhaps to contain a specific type of `model`.
// If a `comparator` is specified, the Collection will maintain
// its models in sort order, as they're added and removed.
var Collection = Backbone.Collection = function(models, options) {
options || (options = {});
if (options.url) this.url = options.url;
if (options.model) this.model = options.model;
if (options.comparator !== void 0) this.comparator = options.comparator;
this._reset();
this.initialize.apply(this, arguments);
if (models) this.reset(models, _.extend({silent: true}, options));
};
// Default options for `Collection#set`.
var setOptions = {add: true, remove: true, merge: true};
var addOptions = {add: true, merge: false, remove: false};
// Define the Collection's inheritable methods.
_.extend(Collection.prototype, Events, {
// The default model for a collection is just a **Backbone.Model**.
// This should be overridden in most cases.
model: Model,
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// The JSON representation of a Collection is an array of the
// models' attributes.
toJSON: function(options) {
return this.map(function(model){ return model.toJSON(options); });
},
// Proxy `Backbone.sync` by default.
sync: function() {
return Backbone.sync.apply(this, arguments);
},
// Add a model, or list of models to the set.
add: function(models, options) {
return this.set(models, _.defaults(options || {}, addOptions));
},
// Remove a model, or a list of models from the set.
remove: function(models, options) {
models = _.isArray(models) ? models.slice() : [models];
options || (options = {});
var i, l, index, model;
for (i = 0, l = models.length; i < l; i++) {
model = this.get(models[i]);
if (!model) continue;
delete this._byId[model.id];
delete this._byId[model.cid];
index = this.indexOf(model);
this.models.splice(index, 1);
this.length--;
if (!options.silent) {
options.index = index;
model.trigger('remove', model, this, options);
}
this._removeReference(model);
}
return this;
},
// Update a collection by `set`-ing a new list of models, adding new ones,
// removing models that are no longer present, and merging models that
// already exist in the collection, as necessary. Similar to **Model#set**,
// the core operation for updating the data contained by the collection.
set: function(models, options) {
options = _.defaults(options || {}, setOptions);
if (options.parse) models = this.parse(models, options);
if (!_.isArray(models)) models = models ? [models] : [];
var i, l, model, attrs, existing, sort;
var at = options.at;
var sortable = this.comparator && (at == null) && options.sort !== false;
var sortAttr = _.isString(this.comparator) ? this.comparator : null;
var toAdd = [], toRemove = [], modelMap = {};
// Turn bare objects into model references, and prevent invalid models
// from being added.
for (i = 0, l = models.length; i < l; i++) {
if (!(model = this._prepareModel(models[i], options))) continue;
// If a duplicate is found, prevent it from being added and
// optionally merge it into the existing model.
if (existing = this.get(model)) {
if (options.remove) modelMap[existing.cid] = true;
if (options.merge) {
existing.set(model.attributes, options);
if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
}
// This is a new model, push it to the `toAdd` list.
} else if (options.add) {
toAdd.push(model);
// Listen to added models' events, and index models for lookup by
// `id` and by `cid`.
model.on('all', this._onModelEvent, this);
this._byId[model.cid] = model;
if (model.id != null) this._byId[model.id] = model;
}
}
// Remove nonexistent models if appropriate.
if (options.remove) {
for (i = 0, l = this.length; i < l; ++i) {
if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
}
if (toRemove.length) this.remove(toRemove, options);
}
// See if sorting is needed, update `length` and splice in new models.
if (toAdd.length) {
if (sortable) sort = true;
this.length += toAdd.length;
if (at != null) {
splice.apply(this.models, [at, 0].concat(toAdd));
} else {
push.apply(this.models, toAdd);
}
}
// Silently sort the collection if appropriate.
if (sort) this.sort({silent: true});
if (options.silent) return this;
// Trigger `add` events.
for (i = 0, l = toAdd.length; i < l; i++) {
(model = toAdd[i]).trigger('add', model, this, options);
}
// Trigger `sort` if the collection was sorted.
if (sort) this.trigger('sort', this, options);
return this;
},
// When you have more items than you want to add or remove individually,
// you can reset the entire set with a new list of models, without firing
// any granular `add` or `remove` events. Fires `reset` when finished.
// Useful for bulk operations and optimizations.
reset: function(models, options) {
options || (options = {});
for (var i = 0, l = this.models.length; i < l; i++) {
this._removeReference(this.models[i]);
}
options.previousModels = this.models;
this._reset();
this.add(models, _.extend({silent: true}, options));
if (!options.silent) this.trigger('reset', this, options);
return this;
},
// Add a model to the end of the collection.
push: function(model, options) {
model = this._prepareModel(model, options);
this.add(model, _.extend({at: this.length}, options));
return model;
},
// Remove a model from the end of the collection.
pop: function(options) {
var model = this.at(this.length - 1);
this.remove(model, options);
return model;
},
// Add a model to the beginning of the collection.
unshift: function(model, options) {
model = this._prepareModel(model, options);
this.add(model, _.extend({at: 0}, options));
return model;
},
// Remove a model from the beginning of the collection.
shift: function(options) {
var model = this.at(0);
this.remove(model, options);
return model;
},
// Slice out a sub-array of models from the collection.
slice: function(begin, end) {
return this.models.slice(begin, end);
},
// Get a model from the set by id.
get: function(obj) {
if (obj == null) return void 0;
return this._byId[obj.id != null ? obj.id : obj.cid || obj];
},
// Get the model at the given index.
at: function(index) {
return this.models[index];
},
// Return models with matching attributes. Useful for simple cases of
// `filter`.
where: function(attrs, first) {
if (_.isEmpty(attrs)) return first ? void 0 : [];
return this[first ? 'find' : 'filter'](function(model) {
for (var key in attrs) {
if (attrs[key] !== model.get(key)) return false;
}
return true;
});
},
// Return the first model with matching attributes. Useful for simple cases
// of `find`.
findWhere: function(attrs) {
return this.where(attrs, true);
},
// Force the collection to re-sort itself. You don't need to call this under
// normal circumstances, as the set will maintain sort order as each item
// is added.
sort: function(options) {
if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
options || (options = {});
// Run sort based on type of `comparator`.
if (_.isString(this.comparator) || this.comparator.length === 1) {
this.models = this.sortBy(this.comparator, this);
} else {
this.models.sort(_.bind(this.comparator, this));
}
if (!options.silent) this.trigger('sort', this, options);
return this;
},
// Figure out the smallest index at which a model should be inserted so as
// to maintain order.
sortedIndex: function(model, value, context) {
value || (value = this.comparator);
var iterator = _.isFunction(value) ? value : function(model) {
return model.get(value);
};
return _.sortedIndex(this.models, model, iterator, context);
},
// Pluck an attribute from each model in the collection.
pluck: function(attr) {
return _.invoke(this.models, 'get', attr);
},
// Fetch the default set of models for this collection, resetting the
// collection when they arrive. If `reset: true` is passed, the response
// data will be passed through the `reset` method instead of `set`.
fetch: function(options) {
options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true;
var success = options.success;
var collection = this;
options.success = function(resp) {
var method = options.reset ? 'reset' : 'set';
collection[method](resp, options);
if (success) success(collection, resp, options);
collection.trigger('sync', collection, resp, options);
};
wrapError(this, options);
return this.sync('read', this, options);
},
// Create a new instance of a model in this collection. Add the model to the
// collection immediately, unless `wait: true` is passed, in which case we
// wait for the server to agree.
create: function(model, options) {
options = options ? _.clone(options) : {};
if (!(model = this._prepareModel(model, options))) return false;
if (!options.wait) this.add(model, options);
var collection = this;
var success = options.success;
options.success = function(resp) {
if (options.wait) collection.add(model, options);
if (success) success(model, resp, options);
};
model.save(null, options);
return model;
},
// **parse** converts a response into a list of models to be added to the
// collection. The default implementation is just to pass it through.
parse: function(resp, options) {
return resp;
},
// Create a new collection with an identical list of models as this one.
clone: function() {
return new this.constructor(this.models);
},
// Private method to reset all internal state. Called when the collection
// is first initialized or reset.
_reset: function() {
this.length = 0;
this.models = [];
this._byId = {};
},
// Prepare a hash of attributes (or other model) to be added to this
// collection.
_prepareModel: function(attrs, options) {
if (attrs instanceof Model) {
if (!attrs.collection) attrs.collection = this;
return attrs;
}
options || (options = {});
options.collection = this;
var model = new this.model(attrs, options);
if (!model._validate(attrs, options)) {
this.trigger('invalid', this, attrs, options);
return false;
}
return model;
},
// Internal method to sever a model's ties to a collection.
_removeReference: function(model) {
if (this === model.collection) delete model.collection;
model.off('all', this._onModelEvent, this);
},
// Internal method called every time a model in the set fires an event.
// Sets need to update their indexes when models change ids. All other
// events simply proxy through. "add" and "remove" events that originate
// in other collections are ignored.
_onModelEvent: function(event, model, collection, options) {
if ((event === 'add' || event === 'remove') && collection !== this) return;
if (event === 'destroy') this.remove(model, options);
if (model && event === 'change:' + model.idAttribute) {
delete this._byId[model.previous(model.idAttribute)];
if (model.id != null) this._byId[model.id] = model;
}
this.trigger.apply(this, arguments);
}
});
// Underscore methods that we want to implement on the Collection.
// 90% of the core usefulness of Backbone Collections is actually implemented
// right here:
var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',
'isEmpty', 'chain'];
// Mix in each Underscore method as a proxy to `Collection#models`.
_.each(methods, function(method) {
Collection.prototype[method] = function() {
var args = slice.call(arguments);
args.unshift(this.models);
return _[method].apply(_, args);
};
});
// Underscore methods that take a property name as an argument.
var attributeMethods = ['groupBy', 'countBy', 'sortBy'];
// Use attributes instead of properties.
_.each(attributeMethods, function(method) {
Collection.prototype[method] = function(value, context) {
var iterator = _.isFunction(value) ? value : function(model) {
return model.get(value);
};
return _[method](this.models, iterator, context);
};
});
// Backbone.View
// -------------
// Backbone Views are almost more convention than they are actual code. A View
// is simply a JavaScript object that represents a logical chunk of UI in the
// DOM. This might be a single item, an entire list, a sidebar or panel, or
// even the surrounding frame which wraps your whole app. Defining a chunk of
// UI as a **View** allows you to define your DOM events declaratively, without
// having to worry about render order ... and makes it easy for the view to
// react to specific changes in the state of your models.
// Creating a Backbone.View creates its initial element outside of the DOM,
// if an existing element is not provided...
var View = Backbone.View = function(options) {
this.cid = _.uniqueId('view');
this._configure(options || {});
this._ensureElement();
this.initialize.apply(this, arguments);
this.delegateEvents();
};
// Cached regex to split keys for `delegate`.
var delegateEventSplitter = /^(\S+)\s*(.*)$/;
// List of view options to be merged as properties.
var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
// Set up all inheritable **Backbone.View** properties and methods.
_.extend(View.prototype, Events, {
// The default `tagName` of a View's element is `"div"`.
tagName: 'div',
// jQuery delegate for element lookup, scoped to DOM elements within the
// current view. This should be prefered to global lookups where possible.
$: function(selector) {
return this.$el.find(selector);
},
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// **render** is the core function that your view should override, in order
// to populate its element (`this.el`), with the appropriate HTML. The
// convention is for **render** to always return `this`.
render: function() {
return this;
},
// Remove this view by taking the element out of the DOM, and removing any
// applicable Backbone.Events listeners.
remove: function() {
this.$el.remove();
this.stopListening();
return this;
},
// Change the view's element (`this.el` property), including event
// re-delegation.
setElement: function(element, delegate) {
if (this.$el) this.undelegateEvents();
this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
this.el = this.$el[0];
if (delegate !== false) this.delegateEvents();
return this;
},
// Set callbacks, where `this.events` is a hash of
//
// *{"event selector": "callback"}*
//
// {
// 'mousedown .title': 'edit',
// 'click .button': 'save'
// 'click .open': function(e) { ... }
// }
//
// pairs. Callbacks will be bound to the view, with `this` set properly.
// Uses event delegation for efficiency.
// Omitting the selector binds the event to `this.el`.
// This only works for delegate-able events: not `focus`, `blur`, and
// not `change`, `submit`, and `reset` in Internet Explorer.
delegateEvents: function(events) {
if (!(events || (events = _.result(this, 'events')))) return this;
this.undelegateEvents();
for (var key in events) {
var method = events[key];
if (!_.isFunction(method)) method = this[events[key]];
if (!method) continue;
var match = key.match(delegateEventSplitter);
var eventName = match[1], selector = match[2];
method = _.bind(method, this);
eventName += '.delegateEvents' + this.cid;
if (selector === '') {
this.$el.on(eventName, method);
} else {
this.$el.on(eventName, selector, method);
}
}
return this;
},
// Clears all callbacks previously bound to the view with `delegateEvents`.
// You usually don't need to use this, but may wish to if you have multiple
// Backbone views attached to the same DOM element.
undelegateEvents: function() {
this.$el.off('.delegateEvents' + this.cid);
return this;
},
// Performs the initial configuration of a View with a set of options.
// Keys with special meaning *(e.g. model, collection, id, className)* are
// attached directly to the view. See `viewOptions` for an exhaustive
// list.
_configure: function(options) {
if (this.options) options = _.extend({}, _.result(this, 'options'), options);
_.extend(this, _.pick(options, viewOptions));
this.options = options;
},
// Ensure that the View has a DOM element to render into.
// If `this.el` is a string, pass it through `$()`, take the first
// matching element, and re-assign it to `el`. Otherwise, create
// an element from the `id`, `className` and `tagName` properties.
_ensureElement: function() {
if (!this.el) {
var attrs = _.extend({}, _.result(this, 'attributes'));
if (this.id) attrs.id = _.result(this, 'id');
if (this.className) attrs['class'] = _.result(this, 'className');
var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
this.setElement($el, false);
} else {
this.setElement(_.result(this, 'el'), false);
}
}
});
// Backbone.sync
// -------------
// Override this function to change the manner in which Backbone persists
// models to the server. You will be passed the type of request, and the
// model in question. By default, makes a RESTful Ajax request
// to the model's `url()`. Some possible customizations could be:
//
// * Use `setTimeout` to batch rapid-fire updates into a single request.
// * Send up the models as XML instead of JSON.
// * Persist models via WebSockets instead of Ajax.
//
// Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
// as `POST`, with a `_method` parameter containing the true HTTP method,
// as well as all requests with the body as `application/x-www-form-urlencoded`
// instead of `application/json` with the model in a param named `model`.
// Useful when interfacing with server-side languages like **PHP** that make
// it difficult to read the body of `PUT` requests.
Backbone.sync = function(method, model, options) {
var type = methodMap[method];
// Default options, unless specified.
_.defaults(options || (options = {}), {
emulateHTTP: Backbone.emulateHTTP,
emulateJSON: Backbone.emulateJSON
});
// Default JSON-request options.
var params = {type: type, dataType: 'json'};
// Ensure that we have a URL.
if (!options.url) {
params.url = _.result(model, 'url') || urlError();
}
// Ensure that we have the appropriate request data.
if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
params.contentType = 'application/json';
params.data = JSON.stringify(options.attrs || model.toJSON(options));
}
// For older servers, emulate JSON by encoding the request into an HTML-form.
if (options.emulateJSON) {
params.contentType = 'application/x-www-form-urlencoded';
params.data = params.data ? {model: params.data} : {};
}
// For older servers, emulate HTTP by mimicking the HTTP method with `_method`
// And an `X-HTTP-Method-Override` header.
if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
params.type = 'POST';
if (options.emulateJSON) params.data._method = type;
var beforeSend = options.beforeSend;
options.beforeSend = function(xhr) {
xhr.setRequestHeader('X-HTTP-Method-Override', type);
if (beforeSend) return beforeSend.apply(this, arguments);
};
}
// Don't process data on a non-GET request.
if (params.type !== 'GET' && !options.emulateJSON) {
params.processData = false;
}
// If we're sending a `PATCH` request, and we're in an old Internet Explorer
// that still has ActiveX enabled by default, override jQuery to use that
// for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
if (params.type === 'PATCH' && window.ActiveXObject &&
!(window.external && window.external.msActiveXFilteringEnabled)) {
params.xhr = function() {
return new ActiveXObject("Microsoft.XMLHTTP");
};
}
// Make the request, allowing the user to override any Ajax options.
var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
model.trigger('request', model, xhr, options);
return xhr;
};
// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
var methodMap = {
'create': 'POST',
'update': 'PUT',
'patch': 'PATCH',
'delete': 'DELETE',
'read': 'GET'
};
// Set the default implementation of `Backbone.ajax` to proxy through to `$`.
// Override this if you'd like to use a different library.
Backbone.ajax = function() {
return Backbone.$.ajax.apply(Backbone.$, arguments);
};
// Backbone.Router
// ---------------
// Routers map faux-URLs to actions, and fire events when routes are
// matched. Creating a new one sets its `routes` hash, if not set statically.
var Router = Backbone.Router = function(options) {
options || (options = {});
if (options.routes) this.routes = options.routes;
this._bindRoutes();
this.initialize.apply(this, arguments);
};
// Cached regular expressions for matching named param parts and splatted
// parts of route strings.
var optionalParam = /\((.*?)\)/g;
var namedParam = /(\(\?)?:\w+/g;
var splatParam = /\*\w+/g;
var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
// Set up all inheritable **Backbone.Router** properties and methods.
_.extend(Router.prototype, Events, {
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// Manually bind a single named route to a callback. For example:
//
// this.route('search/:query/p:num', 'search', function(query, num) {
// ...
// });
//
route: function(route, name, callback) {
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
if (_.isFunction(name)) {
callback = name;
name = '';
}
if (!callback) callback = this[name];
var router = this;
Backbone.history.route(route, function(fragment) {
var args = router._extractParameters(route, fragment);
callback && callback.apply(router, args);
router.trigger.apply(router, ['route:' + name].concat(args));
router.trigger('route', name, args);
Backbone.history.trigger('route', router, name, args);
});
return this;
},
// Simple proxy to `Backbone.history` to save a fragment into the history.
navigate: function(fragment, options) {
Backbone.history.navigate(fragment, options);
return this;
},
// Bind all defined routes to `Backbone.history`. We have to reverse the
// order of the routes here to support behavior where the most general
// routes can be defined at the bottom of the route map.
_bindRoutes: function() {
if (!this.routes) return;
this.routes = _.result(this, 'routes');
var route, routes = _.keys(this.routes);
while ((route = routes.pop()) != null) {
this.route(route, this.routes[route]);
}
},
// Convert a route string into a regular expression, suitable for matching
// against the current location hash.
_routeToRegExp: function(route) {
route = route.replace(escapeRegExp, '\\$&')
.replace(optionalParam, '(?:$1)?')
.replace(namedParam, function(match, optional){
return optional ? match : '([^\/]+)';
})
.replace(splatParam, '(.*?)');
return new RegExp('^' + route + '$');
},
// Given a route, and a URL fragment that it matches, return the array of
// extracted decoded parameters. Empty or unmatched parameters will be
// treated as `null` to normalize cross-browser behavior.
_extractParameters: function(route, fragment) {
var params = route.exec(fragment).slice(1);
return _.map(params, function(param) {
return param ? decodeURIComponent(param) : null;
});
}
});
// Backbone.History
// ----------------
// Handles cross-browser history management, based on either
// [pushState](http://diveintohtml5.info/history.html) and real URLs, or
// [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
// and URL fragments. If the browser supports neither (old IE, natch),
// falls back to polling.
var History = Backbone.History = function() {
this.handlers = [];
_.bindAll(this, 'checkUrl');
// Ensure that `History` can be used outside of the browser.
if (typeof window !== 'undefined') {
this.location = window.location;
this.history = window.history;
}
};
// Cached regex for stripping a leading hash/slash and trailing space.
var routeStripper = /^[#\/]|\s+$/g;
// Cached regex for stripping leading and trailing slashes.
var rootStripper = /^\/+|\/+$/g;
// Cached regex for detecting MSIE.
var isExplorer = /msie [\w.]+/;
// Cached regex for removing a trailing slash.
var trailingSlash = /\/$/;
// Has the history handling already been started?
History.started = false;
// Set up all inheritable **Backbone.History** properties and methods.
_.extend(History.prototype, Events, {
// The default interval to poll for hash changes, if necessary, is
// twenty times a second.
interval: 50,
// Gets the true hash value. Cannot use location.hash directly due to bug
// in Firefox where location.hash will always be decoded.
getHash: function(window) {
var match = (window || this).location.href.match(/#(.*)$/);
return match ? match[1] : '';
},
// Get the cross-browser normalized URL fragment, either from the URL,
// the hash, or the override.
getFragment: function(fragment, forcePushState) {
if (fragment == null) {
if (this._hasPushState || !this._wantsHashChange || forcePushState) {
fragment = this.location.pathname;
var root = this.root.replace(trailingSlash, '');
if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
} else {
fragment = this.getHash();
}
}
return fragment.replace(routeStripper, '');
},
// Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise.
start: function(options) {
if (History.started) throw new Error("Backbone.history has already been started");
History.started = true;
// Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available?
this.options = _.extend({}, {root: '/'}, this.options, options);
this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false;
this._wantsPushState = !!this.options.pushState;
this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
var fragment = this.getFragment();
var docMode = document.documentMode;
var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
// Normalize root to always include a leading and trailing slash.
this.root = ('/' + this.root + '/').replace(rootStripper, '/');
if (oldIE && this._wantsHashChange) {
this.iframe = Backbone.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
this.navigate(fragment);
}
// Depending on whether we're using pushState or hashes, and whether
// 'onhashchange' is supported, determine how we check the URL state.
if (this._hasPushState) {
Backbone.$(window).on('popstate', this.checkUrl);
} else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
Backbone.$(window).on('hashchange', this.checkUrl);
} else if (this._wantsHashChange) {
this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
}
// Determine if we need to change the base url, for a pushState link
// opened by a non-pushState browser.
this.fragment = fragment;
var loc = this.location;
var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
// If we've started off with a route from a `pushState`-enabled browser,
// but we're currently in a browser that doesn't support it...
if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
this.fragment = this.getFragment(null, true);
this.location.replace(this.root + this.location.search + '#' + this.fragment);
// Return immediately as browser will do redirect to new url
return true;
// Or if we've started out with a hash-based route, but we're currently
// in a browser where it could be `pushState`-based instead...
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
this.fragment = this.getHash().replace(routeStripper, '');
this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
}
if (!this.options.silent) return this.loadUrl();
},
// Disable Backbone.history, perhaps temporarily. Not useful in a real app,
// but possibly useful for unit testing Routers.
stop: function() {
Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
clearInterval(this._checkUrlInterval);
History.started = false;
},
// Add a route to be tested when the fragment changes. Routes added later
// may override previous routes.
route: function(route, callback) {
this.handlers.unshift({route: route, callback: callback});
},
// Checks the current URL to see if it has changed, and if it has,
// calls `loadUrl`, normalizing across the hidden iframe.
checkUrl: function(e) {
var current = this.getFragment();
if (current === this.fragment && this.iframe) {
current = this.getFragment(this.getHash(this.iframe));
}
if (current === this.fragment) return false;
if (this.iframe) this.navigate(current);
this.loadUrl() || this.loadUrl(this.getHash());
},
// Attempt to load the current URL fragment. If a route succeeds with a
// match, returns `true`. If no defined routes matches the fragment,
// returns `false`.
loadUrl: function(fragmentOverride) {
var fragment = this.fragment = this.getFragment(fragmentOverride);
var matched = _.any(this.handlers, function(handler) {
if (handler.route.test(fragment)) {
handler.callback(fragment);
return true;
}
});
return matched;
},
// Save a fragment into the hash history, or replace the URL state if the
// 'replace' option is passed. You are responsible for properly URL-encoding
// the fragment in advance.
//
// The options object can contain `trigger: true` if you wish to have the
// route callback be fired (not usually desirable), or `replace: true`, if
// you wish to modify the current URL without adding an entry to the history.
navigate: function(fragment, options) {
if (!History.started) return false;
if (!options || options === true) options = {trigger: options};
fragment = this.getFragment(fragment || '');
if (this.fragment === fragment) return;
this.fragment = fragment;
var url = this.root + fragment;
// If pushState is available, we use it to set the fragment as a real URL.
if (this._hasPushState) {
this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
// If hash changes haven't been explicitly disabled, update the hash
// fragment to store history.
} else if (this._wantsHashChange) {
this._updateHash(this.location, fragment, options.replace);
if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
// Opening and closing the iframe tricks IE7 and earlier to push a
// history entry on hash-tag change. When replace is true, we don't
// want this.
if(!options.replace) this.iframe.document.open().close();
this._updateHash(this.iframe.location, fragment, options.replace);
}
// If you've told us that you explicitly don't want fallback hashchange-
// based history, then `navigate` becomes a page refresh.
} else {
return this.location.assign(url);
}
if (options.trigger) this.loadUrl(fragment);
},
// Update the hash location, either replacing the current entry, or adding
// a new one to the browser history.
_updateHash: function(location, fragment, replace) {
if (replace) {
var href = location.href.replace(/(javascript:|#).*$/, '');
location.replace(href + '#' + fragment);
} else {
// Some browsers require that `hash` contains a leading #.
location.hash = '#' + fragment;
}
}
});
// Create the default Backbone.history.
Backbone.history = new History;
// Helpers
// -------
// Helper function to correctly set up the prototype chain, for subclasses.
// Similar to `goog.inherits`, but uses a hash of prototype properties and
// class properties to be extended.
var extend = function(protoProps, staticProps) {
var parent = this;
var child;
// The constructor function for the new subclass is either defined by you
// (the "constructor" property in your `extend` definition), or defaulted
// by us to simply call the parent's constructor.
if (protoProps && _.has(protoProps, 'constructor')) {
child = protoProps.constructor;
} else {
child = function(){ return parent.apply(this, arguments); };
}
// Add static properties to the constructor function, if supplied.
_.extend(child, parent, staticProps);
// Set the prototype chain to inherit from `parent`, without calling
// `parent`'s constructor function.
var Surrogate = function(){ this.constructor = child; };
Surrogate.prototype = parent.prototype;
child.prototype = new Surrogate;
// Add prototype properties (instance properties) to the subclass,
// if supplied.
if (protoProps) _.extend(child.prototype, protoProps);
// Set a convenience property in case the parent's prototype is needed
// later.
child.__super__ = parent.prototype;
return child;
};
// Set up inheritance for the model, collection, router, view and history.
Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
// Throw an error when a URL is needed, and none is supplied.
var urlError = function() {
throw new Error('A "url" property or function must be specified');
};
// Wrap an optional error callback with a fallback error event.
var wrapError = function (model, options) {
var error = options.error;
options.error = function(resp) {
if (error) error(model, resp, options);
model.trigger('error', model, resp, options);
};
};
}).call(this);
// Backbone.js 1.0.0
// (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
(function(){
// Initial Setup
// -------------
// Save a reference to the global object (`window` in the browser, `exports`
// on the server).
var root = this;
// Save the previous value of the `Backbone` variable, so that it can be
// restored later on, if `noConflict` is used.
var previousBackbone = root.Backbone;
// Create local references to array methods we'll want to use later.
var array = [];
var push = array.push;
var slice = array.slice;
var splice = array.splice;
// The top-level namespace. All public Backbone classes and modules will
// be attached to this. Exported for both the browser and the server.
var Backbone;
if (typeof exports !== 'undefined') {
Backbone = exports;
} else {
Backbone = root.Backbone = {};
}
// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '1.0.0';
// Require Underscore, if we're on the server, and it's not already present.
var _ = root._;
if (!_ && (typeof require !== 'undefined')) _ = require('underscore');
// For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
// the `$` variable.
Backbone.$ = root.jQuery || root.Zepto || root.ender || root.$;
// Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
// to its previous owner. Returns a reference to this Backbone object.
Backbone.noConflict = function() {
root.Backbone = previousBackbone;
return this;
};
// Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
// will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
// set a `X-Http-Method-Override` header.
Backbone.emulateHTTP = false;
// Turn on `emulateJSON` to support legacy servers that can't deal with direct
// `application/json` requests ... will encode the body as
// `application/x-www-form-urlencoded` instead and will send the model in a
// form param named `model`.
Backbone.emulateJSON = false;
// Backbone.Events
// ---------------
// A module that can be mixed in to *any object* in order to provide it with
// custom events. You may bind with `on` or remove with `off` callback
// functions to an event; `trigger`-ing an event fires all callbacks in
// succession.
//
// var object = {};
// _.extend(object, Backbone.Events);
// object.on('expand', function(){ alert('expanded'); });
// object.trigger('expand');
//
var Events = Backbone.Events = {
// Bind an event to a `callback` function. Passing `"all"` will bind
// the callback to all events fired.
on: function(name, callback, context) {
if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []);
events.push({callback: callback, context: context, ctx: context || this});
return this;
},
// Bind an event to only be triggered a single time. After the first time
// the callback is invoked, it will be removed.
once: function(name, callback, context) {
if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
var self = this;
var once = _.once(function() {
self.off(name, once);
callback.apply(this, arguments);
});
once._callback = callback;
return this.on(name, once, context);
},
// Remove one or many callbacks. If `context` is null, removes all
// callbacks with that function. If `callback` is null, removes all
// callbacks for the event. If `name` is null, removes all bound
// callbacks for all events.
off: function(name, callback, context) {
var retain, ev, events, names, i, l, j, k;
if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
if (!name && !callback && !context) {
this._events = {};
return this;
}
names = name ? [name] : _.keys(this._events);
for (i = 0, l = names.length; i < l; i++) {
name = names[i];
if (events = this._events[name]) {
this._events[name] = retain = [];
if (callback || context) {
for (j = 0, k = events.length; j < k; j++) {
ev = events[j];
if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
(context && context !== ev.context)) {
retain.push(ev);
}
}
}
if (!retain.length) delete this._events[name];
}
}
return this;
},
// Trigger one or many events, firing all bound callbacks. Callbacks are
// passed the same arguments as `trigger` is, apart from the event name
// (unless you're listening on `"all"`, which will cause your callback to
// receive the true name of the event as the first argument).
trigger: function(name) {
if (!this._events) return this;
var args = slice.call(arguments, 1);
if (!eventsApi(this, 'trigger', name, args)) return this;
var events = this._events[name];
var allEvents = this._events.all;
if (events) triggerEvents(events, args);
if (allEvents) triggerEvents(allEvents, arguments);
return this;
},
// Tell this object to stop listening to either specific events ... or
// to every object it's currently listening to.
stopListening: function(obj, name, callback) {
var listeners = this._listeners;
if (!listeners) return this;
var deleteListener = !name && !callback;
if (typeof name === 'object') callback = this;
if (obj) (listeners = {})[obj._listenerId] = obj;
for (var id in listeners) {
listeners[id].off(name, callback, this);
if (deleteListener) delete this._listeners[id];
}
return this;
}
};
// Regular expression used to split event strings.
var eventSplitter = /\s+/;
// Implement fancy features of the Events API such as multiple event
// names `"change blur"` and jQuery-style event maps `{change: action}`
// in terms of the existing API.
var eventsApi = function(obj, action, name, rest) {
if (!name) return true;
// Handle event maps.
if (typeof name === 'object') {
for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest));
}
return false;
}
// Handle space separated event names.
if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0, l = names.length; i < l; i++) {
obj[action].apply(obj, [names[i]].concat(rest));
}
return false;
}
return true;
};
// A difficult-to-believe, but optimized internal dispatch function for
// triggering events. Tries to keep the usual cases speedy (most internal
// Backbone events have 3 arguments).
var triggerEvents = function(events, args) {
var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
switch (args.length) {
case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
}
};
var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
// Inversion-of-control versions of `on` and `once`. Tell *this* object to
// listen to an event in another object ... keeping track of what it's
// listening to.
_.each(listenMethods, function(implementation, method) {
Events[method] = function(obj, name, callback) {
var listeners = this._listeners || (this._listeners = {});
var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
listeners[id] = obj;
if (typeof name === 'object') callback = this;
obj[implementation](name, callback, this);
return this;
};
});
// Aliases for backwards compatibility.
Events.bind = Events.on;
Events.unbind = Events.off;
// Allow the `Backbone` object to serve as a global event bus, for folks who
// want global "pubsub" in a convenient place.
_.extend(Backbone, Events);
// Backbone.Model
// --------------
// Backbone **Models** are the basic data object in the framework --
// frequently representing a row in a table in a database on your server.
// A discrete chunk of data and a bunch of useful, related methods for
// performing computations and transformations on that data.
// Create a new model with the specified attributes. A client id (`cid`)
// is automatically generated and assigned for you.
var Model = Backbone.Model = function(attributes, options) {
var defaults;
var attrs = attributes || {};
options || (options = {});
this.cid = _.uniqueId('c');
this.attributes = {};
_.extend(this, _.pick(options, modelOptions));
if (options.parse) attrs = this.parse(attrs, options) || {};
if (defaults = _.result(this, 'defaults')) {
attrs = _.defaults({}, attrs, defaults);
}
this.set(attrs, options);
this.changed = {};
this.initialize.apply(this, arguments);
};
// A list of options to be attached directly to the model, if provided.
var modelOptions = ['url', 'urlRoot', 'collection'];
// Attach all inheritable methods to the Model prototype.
_.extend(Model.prototype, Events, {
// A hash of attributes whose current and previous value differ.
changed: null,
// The value returned during the last failed validation.
validationError: null,
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
// CouchDB users may want to set this to `"_id"`.
idAttribute: 'id',
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// Return a copy of the model's `attributes` object.
toJSON: function(options) {
return _.clone(this.attributes);
},
// Proxy `Backbone.sync` by default -- but override this if you need
// custom syncing semantics for *this* particular model.
sync: function() {
return Backbone.sync.apply(this, arguments);
},
// Get the value of an attribute.
get: function(attr) {
return this.attributes[attr];
},
// Get the HTML-escaped value of an attribute.
escape: function(attr) {
return _.escape(this.get(attr));
},
// Returns `true` if the attribute contains a value that is not null
// or undefined.
has: function(attr) {
return this.get(attr) != null;
},
// Set a hash of model attributes on the object, firing `"change"`. This is
// the core primitive operation of a model, updating the data and notifying
// anyone who needs to know about the change in state. The heart of the beast.
set: function(key, val, options) {
var attr, attrs, unset, changes, silent, changing, prev, current;
if (key == null) return this;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (typeof key === 'object') {
attrs = key;
options = val;
} else {
(attrs = {})[key] = val;
}
options || (options = {});
// Run validation.
if (!this._validate(attrs, options)) return false;
// Extract attributes and options.
unset = options.unset;
silent = options.silent;
changes = [];
changing = this._changing;
this._changing = true;
if (!changing) {
this._previousAttributes = _.clone(this.attributes);
this.changed = {};
}
current = this.attributes, prev = this._previousAttributes;
// Check for changes of `id`.
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
// For each `set` attribute, update or delete the current value.
for (attr in attrs) {
val = attrs[attr];
if (!_.isEqual(current[attr], val)) changes.push(attr);
if (!_.isEqual(prev[attr], val)) {
this.changed[attr] = val;
} else {
delete this.changed[attr];
}
unset ? delete current[attr] : current[attr] = val;
}
// Trigger all relevant attribute changes.
if (!silent) {
if (changes.length) this._pending = true;
for (var i = 0, l = changes.length; i < l; i++) {
this.trigger('change:' + changes[i], this, current[changes[i]], options);
}
}
// You might be wondering why there's a `while` loop here. Changes can
// be recursively nested within `"change"` events.
if (changing) return this;
if (!silent) {
while (this._pending) {
this._pending = false;
this.trigger('change', this, options);
}
}
this._pending = false;
this._changing = false;
return this;
},
// Remove an attribute from the model, firing `"change"`. `unset` is a noop
// if the attribute doesn't exist.
unset: function(attr, options) {
return this.set(attr, void 0, _.extend({}, options, {unset: true}));
},
// Clear all attributes on the model, firing `"change"`.
clear: function(options) {
var attrs = {};
for (var key in this.attributes) attrs[key] = void 0;
return this.set(attrs, _.extend({}, options, {unset: true}));
},
// Determine if the model has changed since the last `"change"` event.
// If you specify an attribute name, determine if that attribute has changed.
hasChanged: function(attr) {
if (attr == null) return !_.isEmpty(this.changed);
return _.has(this.changed, attr);
},
// Return an object containing all the attributes that have changed, or
// false if there are no changed attributes. Useful for determining what
// parts of a view need to be updated and/or what attributes need to be
// persisted to the server. Unset attributes will be set to undefined.
// You can also pass an attributes object to diff against the model,
// determining if there *would be* a change.
changedAttributes: function(diff) {
if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
var val, changed = false;
var old = this._changing ? this._previousAttributes : this.attributes;
for (var attr in diff) {
if (_.isEqual(old[attr], (val = diff[attr]))) continue;
(changed || (changed = {}))[attr] = val;
}
return changed;
},
// Get the previous value of an attribute, recorded at the time the last
// `"change"` event was fired.
previous: function(attr) {
if (attr == null || !this._previousAttributes) return null;
return this._previousAttributes[attr];
},
// Get all of the attributes of the model at the time of the previous
// `"change"` event.
previousAttributes: function() {
return _.clone(this._previousAttributes);
},
// Fetch the model from the server. If the server's representation of the
// model differs from its current attributes, they will be overridden,
// triggering a `"change"` event.
fetch: function(options) {
options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true;
var model = this;
var success = options.success;
options.success = function(resp) {
if (!model.set(model.parse(resp, options), options)) return false;
if (success) success(model, resp, options);
model.trigger('sync', model, resp, options);
};
wrapError(this, options);
return this.sync('read', this, options);
},
// Set a hash of model attributes, and sync the model to the server.
// If the server returns an attributes hash that differs, the model's
// state will be `set` again.
save: function(key, val, options) {
var attrs, method, xhr, attributes = this.attributes;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || typeof key === 'object') {
attrs = key;
options = val;
} else {
(attrs = {})[key] = val;
}
// If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.
if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;
options = _.extend({validate: true}, options);
// Do not persist invalid models.
if (!this._validate(attrs, options)) return false;
// Set temporary attributes if `{wait: true}`.
if (attrs && options.wait) {
this.attributes = _.extend({}, attributes, attrs);
}
// After a successful server-side save, the client is (optionally)
// updated with the server-side state.
if (options.parse === void 0) options.parse = true;
var model = this;
var success = options.success;
options.success = function(resp) {
// Ensure attributes are restored during synchronous saves.
model.attributes = attributes;
var serverAttrs = model.parse(resp, options);
if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
return false;
}
if (success) success(model, resp, options);
model.trigger('sync', model, resp, options);
};
wrapError(this, options);
method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
if (method === 'patch') options.attrs = attrs;
xhr = this.sync(method, this, options);
// Restore attributes.
if (attrs && options.wait) this.attributes = attributes;
return xhr;
},
// Destroy this model on the server if it was already persisted.
// Optimistically removes the model from its collection, if it has one.
// If `wait: true` is passed, waits for the server to respond before removal.
destroy: function(options) {
options = options ? _.clone(options) : {};
var model = this;
var success = options.success;
var destroy = function() {
model.trigger('destroy', model, model.collection, options);
};
options.success = function(resp) {
if (options.wait || model.isNew()) destroy();
if (success) success(model, resp, options);
if (!model.isNew()) model.trigger('sync', model, resp, options);
};
if (this.isNew()) {
options.success();
return false;
}
wrapError(this, options);
var xhr = this.sync('delete', this, options);
if (!options.wait) destroy();
return xhr;
},
// Default URL for the model's representation on the server -- if you're
// using Backbone's restful methods, override this to change the endpoint
// that will be called.
url: function() {
var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
if (this.isNew()) return base;
return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);
},
// **parse** converts a response into the hash of attributes to be `set` on
// the model. The default implementation is just to pass the response along.
parse: function(resp, options) {
return resp;
},
// Create a new model with identical attributes to this one.
clone: function() {
return new this.constructor(this.attributes);
},
// A model is new if it has never been saved to the server, and lacks an id.
isNew: function() {
return this.id == null;
},
// Check if the model is currently in a valid state.
isValid: function(options) {
return this._validate({}, _.extend(options || {}, { validate: true }));
},
// Run validation against the next complete set of model attributes,
// returning `true` if all is well. Otherwise, fire an `"invalid"` event.
_validate: function(attrs, options) {
if (!options.validate || !this.validate) return true;
attrs = _.extend({}, this.attributes, attrs);
var error = this.validationError = this.validate(attrs, options) || null;
if (!error) return true;
this.trigger('invalid', this, error, _.extend(options || {}, {validationError: error}));
return false;
}
});
// Underscore methods that we want to implement on the Model.
var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];
// Mix in each Underscore method as a proxy to `Model#attributes`.
_.each(modelMethods, function(method) {
Model.prototype[method] = function() {
var args = slice.call(arguments);
args.unshift(this.attributes);
return _[method].apply(_, args);
};
});
// Backbone.Collection
// -------------------
// If models tend to represent a single row of data, a Backbone Collection is
// more analagous to a table full of data ... or a small slice or page of that
// table, or a collection of rows that belong together for a particular reason
// -- all of the messages in this particular folder, all of the documents
// belonging to this particular author, and so on. Collections maintain
// indexes of their models, both in order, and for lookup by `id`.
// Create a new **Collection**, perhaps to contain a specific type of `model`.
// If a `comparator` is specified, the Collection will maintain
// its models in sort order, as they're added and removed.
var Collection = Backbone.Collection = function(models, options) {
options || (options = {});
if (options.url) this.url = options.url;
if (options.model) this.model = options.model;
if (options.comparator !== void 0) this.comparator = options.comparator;
this._reset();
this.initialize.apply(this, arguments);
if (models) this.reset(models, _.extend({silent: true}, options));
};
// Default options for `Collection#set`.
var setOptions = {add: true, remove: true, merge: true};
var addOptions = {add: true, merge: false, remove: false};
// Define the Collection's inheritable methods.
_.extend(Collection.prototype, Events, {
// The default model for a collection is just a **Backbone.Model**.
// This should be overridden in most cases.
model: Model,
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// The JSON representation of a Collection is an array of the
// models' attributes.
toJSON: function(options) {
return this.map(function(model){ return model.toJSON(options); });
},
// Proxy `Backbone.sync` by default.
sync: function() {
return Backbone.sync.apply(this, arguments);
},
// Add a model, or list of models to the set.
add: function(models, options) {
return this.set(models, _.defaults(options || {}, addOptions));
},
// Remove a model, or a list of models from the set.
remove: function(models, options) {
models = _.isArray(models) ? models.slice() : [models];
options || (options = {});
var i, l, index, model;
for (i = 0, l = models.length; i < l; i++) {
model = this.get(models[i]);
if (!model) continue;
delete this._byId[model.id];
delete this._byId[model.cid];
index = this.indexOf(model);
this.models.splice(index, 1);
this.length--;
if (!options.silent) {
options.index = index;
model.trigger('remove', model, this, options);
}
this._removeReference(model);
}
return this;
},
// Update a collection by `set`-ing a new list of models, adding new ones,
// removing models that are no longer present, and merging models that
// already exist in the collection, as necessary. Similar to **Model#set**,
// the core operation for updating the data contained by the collection.
set: function(models, options) {
options = _.defaults(options || {}, setOptions);
if (options.parse) models = this.parse(models, options);
if (!_.isArray(models)) models = models ? [models] : [];
var i, l, model, attrs, existing, sort;
var at = options.at;
var sortable = this.comparator && (at == null) && options.sort !== false;
var sortAttr = _.isString(this.comparator) ? this.comparator : null;
var toAdd = [], toRemove = [], modelMap = {};
// Turn bare objects into model references, and prevent invalid models
// from being added.
for (i = 0, l = models.length; i < l; i++) {
if (!(model = this._prepareModel(models[i], options))) continue;
// If a duplicate is found, prevent it from being added and
// optionally merge it into the existing model.
if (existing = this.get(model)) {
if (options.remove) modelMap[existing.cid] = true;
if (options.merge) {
existing.set(model.attributes, options);
if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
}
// This is a new model, push it to the `toAdd` list.
} else if (options.add) {
toAdd.push(model);
// Listen to added models' events, and index models for lookup by
// `id` and by `cid`.
model.on('all', this._onModelEvent, this);
this._byId[model.cid] = model;
if (model.id != null) this._byId[model.id] = model;
}
}
// Remove nonexistent models if appropriate.
if (options.remove) {
for (i = 0, l = this.length; i < l; ++i) {
if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
}
if (toRemove.length) this.remove(toRemove, options);
}
// See if sorting is needed, update `length` and splice in new models.
if (toAdd.length) {
if (sortable) sort = true;
this.length += toAdd.length;
if (at != null) {
splice.apply(this.models, [at, 0].concat(toAdd));
} else {
push.apply(this.models, toAdd);
}
}
// Silently sort the collection if appropriate.
if (sort) this.sort({silent: true});
if (options.silent) return this;
// Trigger `add` events.
for (i = 0, l = toAdd.length; i < l; i++) {
(model = toAdd[i]).trigger('add', model, this, options);
}
// Trigger `sort` if the collection was sorted.
if (sort) this.trigger('sort', this, options);
return this;
},
// When you have more items than you want to add or remove individually,
// you can reset the entire set with a new list of models, without firing
// any granular `add` or `remove` events. Fires `reset` when finished.
// Useful for bulk operations and optimizations.
reset: function(models, options) {
options || (options = {});
for (var i = 0, l = this.models.length; i < l; i++) {
this._removeReference(this.models[i]);
}
options.previousModels = this.models;
this._reset();
this.add(models, _.extend({silent: true}, options));
if (!options.silent) this.trigger('reset', this, options);
return this;
},
// Add a model to the end of the collection.
push: function(model, options) {
model = this._prepareModel(model, options);
this.add(model, _.extend({at: this.length}, options));
return model;
},
// Remove a model from the end of the collection.
pop: function(options) {
var model = this.at(this.length - 1);
this.remove(model, options);
return model;
},
// Add a model to the beginning of the collection.
unshift: function(model, options) {
model = this._prepareModel(model, options);
this.add(model, _.extend({at: 0}, options));
return model;
},
// Remove a model from the beginning of the collection.
shift: function(options) {
var model = this.at(0);
this.remove(model, options);
return model;
},
// Slice out a sub-array of models from the collection.
slice: function(begin, end) {
return this.models.slice(begin, end);
},
// Get a model from the set by id.
get: function(obj) {
if (obj == null) return void 0;
return this._byId[obj.id != null ? obj.id : obj.cid || obj];
},
// Get the model at the given index.
at: function(index) {
return this.models[index];
},
// Return models with matching attributes. Useful for simple cases of
// `filter`.
where: function(attrs, first) {
if (_.isEmpty(attrs)) return first ? void 0 : [];
return this[first ? 'find' : 'filter'](function(model) {
for (var key in attrs) {
if (attrs[key] !== model.get(key)) return false;
}
return true;
});
},
// Return the first model with matching attributes. Useful for simple cases
// of `find`.
findWhere: function(attrs) {
return this.where(attrs, true);
},
// Force the collection to re-sort itself. You don't need to call this under
// normal circumstances, as the set will maintain sort order as each item
// is added.
sort: function(options) {
if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
options || (options = {});
// Run sort based on type of `comparator`.
if (_.isString(this.comparator) || this.comparator.length === 1) {
this.models = this.sortBy(this.comparator, this);
} else {
this.models.sort(_.bind(this.comparator, this));
}
if (!options.silent) this.trigger('sort', this, options);
return this;
},
// Figure out the smallest index at which a model should be inserted so as
// to maintain order.
sortedIndex: function(model, value, context) {
value || (value = this.comparator);
var iterator = _.isFunction(value) ? value : function(model) {
return model.get(value);
};
return _.sortedIndex(this.models, model, iterator, context);
},
// Pluck an attribute from each model in the collection.
pluck: function(attr) {
return _.invoke(this.models, 'get', attr);
},
// Fetch the default set of models for this collection, resetting the
// collection when they arrive. If `reset: true` is passed, the response
// data will be passed through the `reset` method instead of `set`.
fetch: function(options) {
options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true;
var success = options.success;
var collection = this;
options.success = function(resp) {
var method = options.reset ? 'reset' : 'set';
collection[method](resp, options);
if (success) success(collection, resp, options);
collection.trigger('sync', collection, resp, options);
};
wrapError(this, options);
return this.sync('read', this, options);
},
// Create a new instance of a model in this collection. Add the model to the
// collection immediately, unless `wait: true` is passed, in which case we
// wait for the server to agree.
create: function(model, options) {
options = options ? _.clone(options) : {};
if (!(model = this._prepareModel(model, options))) return false;
if (!options.wait) this.add(model, options);
var collection = this;
var success = options.success;
options.success = function(resp) {
if (options.wait) collection.add(model, options);
if (success) success(model, resp, options);
};
model.save(null, options);
return model;
},
// **parse** converts a response into a list of models to be added to the
// collection. The default implementation is just to pass it through.
parse: function(resp, options) {
return resp;
},
// Create a new collection with an identical list of models as this one.
clone: function() {
return new this.constructor(this.models);
},
// Private method to reset all internal state. Called when the collection
// is first initialized or reset.
_reset: function() {
this.length = 0;
this.models = [];
this._byId = {};
},
// Prepare a hash of attributes (or other model) to be added to this
// collection.
_prepareModel: function(attrs, options) {
if (attrs instanceof Model) {
if (!attrs.collection) attrs.collection = this;
return attrs;
}
options || (options = {});
options.collection = this;
var model = new this.model(attrs, options);
if (!model._validate(attrs, options)) {
this.trigger('invalid', this, attrs, options);
return false;
}
return model;
},
// Internal method to sever a model's ties to a collection.
_removeReference: function(model) {
if (this === model.collection) delete model.collection;
model.off('all', this._onModelEvent, this);
},
// Internal method called every time a model in the set fires an event.
// Sets need to update their indexes when models change ids. All other
// events simply proxy through. "add" and "remove" events that originate
// in other collections are ignored.
_onModelEvent: function(event, model, collection, options) {
if ((event === 'add' || event === 'remove') && collection !== this) return;
if (event === 'destroy') this.remove(model, options);
if (model && event === 'change:' + model.idAttribute) {
delete this._byId[model.previous(model.idAttribute)];
if (model.id != null) this._byId[model.id] = model;
}
this.trigger.apply(this, arguments);
}
});
// Underscore methods that we want to implement on the Collection.
// 90% of the core usefulness of Backbone Collections is actually implemented
// right here:
var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',
'isEmpty', 'chain'];
// Mix in each Underscore method as a proxy to `Collection#models`.
_.each(methods, function(method) {
Collection.prototype[method] = function() {
var args = slice.call(arguments);
args.unshift(this.models);
return _[method].apply(_, args);
};
});
// Underscore methods that take a property name as an argument.
var attributeMethods = ['groupBy', 'countBy', 'sortBy'];
// Use attributes instead of properties.
_.each(attributeMethods, function(method) {
Collection.prototype[method] = function(value, context) {
var iterator = _.isFunction(value) ? value : function(model) {
return model.get(value);
};
return _[method](this.models, iterator, context);
};
});
// Backbone.View
// -------------
// Backbone Views are almost more convention than they are actual code. A View
// is simply a JavaScript object that represents a logical chunk of UI in the
// DOM. This might be a single item, an entire list, a sidebar or panel, or
// even the surrounding frame which wraps your whole app. Defining a chunk of
// UI as a **View** allows you to define your DOM events declaratively, without
// having to worry about render order ... and makes it easy for the view to
// react to specific changes in the state of your models.
// Creating a Backbone.View creates its initial element outside of the DOM,
// if an existing element is not provided...
var View = Backbone.View = function(options) {
this.cid = _.uniqueId('view');
this._configure(options || {});
this._ensureElement();
this.initialize.apply(this, arguments);
this.delegateEvents();
};
// Cached regex to split keys for `delegate`.
var delegateEventSplitter = /^(\S+)\s*(.*)$/;
// List of view options to be merged as properties.
var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
// Set up all inheritable **Backbone.View** properties and methods.
_.extend(View.prototype, Events, {
// The default `tagName` of a View's element is `"div"`.
tagName: 'div',
// jQuery delegate for element lookup, scoped to DOM elements within the
// current view. This should be prefered to global lookups where possible.
$: function(selector) {
return this.$el.find(selector);
},
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// **render** is the core function that your view should override, in order
// to populate its element (`this.el`), with the appropriate HTML. The
// convention is for **render** to always return `this`.
render: function() {
return this;
},
// Remove this view by taking the element out of the DOM, and removing any
// applicable Backbone.Events listeners.
remove: function() {
this.$el.remove();
this.stopListening();
return this;
},
// Change the view's element (`this.el` property), including event
// re-delegation.
setElement: function(element, delegate) {
if (this.$el) this.undelegateEvents();
this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
this.el = this.$el[0];
if (delegate !== false) this.delegateEvents();
return this;
},
// Set callbacks, where `this.events` is a hash of
//
// *{"event selector": "callback"}*
//
// {
// 'mousedown .title': 'edit',
// 'click .button': 'save'
// 'click .open': function(e) { ... }
// }
//
// pairs. Callbacks will be bound to the view, with `this` set properly.
// Uses event delegation for efficiency.
// Omitting the selector binds the event to `this.el`.
// This only works for delegate-able events: not `focus`, `blur`, and
// not `change`, `submit`, and `reset` in Internet Explorer.
delegateEvents: function(events) {
if (!(events || (events = _.result(this, 'events')))) return this;
this.undelegateEvents();
for (var key in events) {
var method = events[key];
if (!_.isFunction(method)) method = this[events[key]];
if (!method) continue;
var match = key.match(delegateEventSplitter);
var eventName = match[1], selector = match[2];
method = _.bind(method, this);
eventName += '.delegateEvents' + this.cid;
if (selector === '') {
this.$el.on(eventName, method);
} else {
this.$el.on(eventName, selector, method);
}
}
return this;
},
// Clears all callbacks previously bound to the view with `delegateEvents`.
// You usually don't need to use this, but may wish to if you have multiple
// Backbone views attached to the same DOM element.
undelegateEvents: function() {
this.$el.off('.delegateEvents' + this.cid);
return this;
},
// Performs the initial configuration of a View with a set of options.
// Keys with special meaning *(e.g. model, collection, id, className)* are
// attached directly to the view. See `viewOptions` for an exhaustive
// list.
_configure: function(options) {
if (this.options) options = _.extend({}, _.result(this, 'options'), options);
_.extend(this, _.pick(options, viewOptions));
this.options = options;
},
// Ensure that the View has a DOM element to render into.
// If `this.el` is a string, pass it through `$()`, take the first
// matching element, and re-assign it to `el`. Otherwise, create
// an element from the `id`, `className` and `tagName` properties.
_ensureElement: function() {
if (!this.el) {
var attrs = _.extend({}, _.result(this, 'attributes'));
if (this.id) attrs.id = _.result(this, 'id');
if (this.className) attrs['class'] = _.result(this, 'className');
var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
this.setElement($el, false);
} else {
this.setElement(_.result(this, 'el'), false);
}
}
});
// Backbone.sync
// -------------
// Override this function to change the manner in which Backbone persists
// models to the server. You will be passed the type of request, and the
// model in question. By default, makes a RESTful Ajax request
// to the model's `url()`. Some possible customizations could be:
//
// * Use `setTimeout` to batch rapid-fire updates into a single request.
// * Send up the models as XML instead of JSON.
// * Persist models via WebSockets instead of Ajax.
//
// Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
// as `POST`, with a `_method` parameter containing the true HTTP method,
// as well as all requests with the body as `application/x-www-form-urlencoded`
// instead of `application/json` with the model in a param named `model`.
// Useful when interfacing with server-side languages like **PHP** that make
// it difficult to read the body of `PUT` requests.
Backbone.sync = function(method, model, options) {
var type = methodMap[method];
// Default options, unless specified.
_.defaults(options || (options = {}), {
emulateHTTP: Backbone.emulateHTTP,
emulateJSON: Backbone.emulateJSON
});
// Default JSON-request options.
var params = {type: type, dataType: 'json'};
// Ensure that we have a URL.
if (!options.url) {
params.url = _.result(model, 'url') || urlError();
}
// Ensure that we have the appropriate request data.
if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
params.contentType = 'application/json';
params.data = JSON.stringify(options.attrs || model.toJSON(options));
}
// For older servers, emulate JSON by encoding the request into an HTML-form.
if (options.emulateJSON) {
params.contentType = 'application/x-www-form-urlencoded';
params.data = params.data ? {model: params.data} : {};
}
// For older servers, emulate HTTP by mimicking the HTTP method with `_method`
// And an `X-HTTP-Method-Override` header.
if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
params.type = 'POST';
if (options.emulateJSON) params.data._method = type;
var beforeSend = options.beforeSend;
options.beforeSend = function(xhr) {
xhr.setRequestHeader('X-HTTP-Method-Override', type);
if (beforeSend) return beforeSend.apply(this, arguments);
};
}
// Don't process data on a non-GET request.
if (params.type !== 'GET' && !options.emulateJSON) {
params.processData = false;
}
// If we're sending a `PATCH` request, and we're in an old Internet Explorer
// that still has ActiveX enabled by default, override jQuery to use that
// for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
if (params.type === 'PATCH' && window.ActiveXObject &&
!(window.external && window.external.msActiveXFilteringEnabled)) {
params.xhr = function() {
return new ActiveXObject("Microsoft.XMLHTTP");
};
}
// Make the request, allowing the user to override any Ajax options.
var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
model.trigger('request', model, xhr, options);
return xhr;
};
// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
var methodMap = {
'create': 'POST',
'update': 'PUT',
'patch': 'PATCH',
'delete': 'DELETE',
'read': 'GET'
};
// Set the default implementation of `Backbone.ajax` to proxy through to `$`.
// Override this if you'd like to use a different library.
Backbone.ajax = function() {
return Backbone.$.ajax.apply(Backbone.$, arguments);
};
// Backbone.Router
// ---------------
// Routers map faux-URLs to actions, and fire events when routes are
// matched. Creating a new one sets its `routes` hash, if not set statically.
var Router = Backbone.Router = function(options) {
options || (options = {});
if (options.routes) this.routes = options.routes;
this._bindRoutes();
this.initialize.apply(this, arguments);
};
// Cached regular expressions for matching named param parts and splatted
// parts of route strings.
var optionalParam = /\((.*?)\)/g;
var namedParam = /(\(\?)?:\w+/g;
var splatParam = /\*\w+/g;
var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
// Set up all inheritable **Backbone.Router** properties and methods.
_.extend(Router.prototype, Events, {
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize: function(){},
// Manually bind a single named route to a callback. For example:
//
// this.route('search/:query/p:num', 'search', function(query, num) {
// ...
// });
//
route: function(route, name, callback) {
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
if (_.isFunction(name)) {
callback = name;
name = '';
}
if (!callback) callback = this[name];
var router = this;
Backbone.history.route(route, function(fragment) {
var args = router._extractParameters(route, fragment);
callback && callback.apply(router, args);
router.trigger.apply(router, ['route:' + name].concat(args));
router.trigger('route', name, args);
Backbone.history.trigger('route', router, name, args);
});
return this;
},
// Simple proxy to `Backbone.history` to save a fragment into the history.
navigate: function(fragment, options) {
Backbone.history.navigate(fragment, options);
return this;
},
// Bind all defined routes to `Backbone.history`. We have to reverse the
// order of the routes here to support behavior where the most general
// routes can be defined at the bottom of the route map.
_bindRoutes: function() {
if (!this.routes) return;
this.routes = _.result(this, 'routes');
var route, routes = _.keys(this.routes);
while ((route = routes.pop()) != null) {
this.route(route, this.routes[route]);
}
},
// Convert a route string into a regular expression, suitable for matching
// against the current location hash.
_routeToRegExp: function(route) {
route = route.replace(escapeRegExp, '\\$&')
.replace(optionalParam, '(?:$1)?')
.replace(namedParam, function(match, optional){
return optional ? match : '([^\/]+)';
})
.replace(splatParam, '(.*?)');
return new RegExp('^' + route + '$');
},
// Given a route, and a URL fragment that it matches, return the array of
// extracted decoded parameters. Empty or unmatched parameters will be
// treated as `null` to normalize cross-browser behavior.
_extractParameters: function(route, fragment) {
var params = route.exec(fragment).slice(1);
return _.map(params, function(param) {
return param ? decodeURIComponent(param) : null;
});
}
});
// Backbone.History
// ----------------
// Handles cross-browser history management, based on either
// [pushState](http://diveintohtml5.info/history.html) and real URLs, or
// [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
// and URL fragments. If the browser supports neither (old IE, natch),
// falls back to polling.
var History = Backbone.History = function() {
this.handlers = [];
_.bindAll(this, 'checkUrl');
// Ensure that `History` can be used outside of the browser.
if (typeof window !== 'undefined') {
this.location = window.location;
this.history = window.history;
}
};
// Cached regex for stripping a leading hash/slash and trailing space.
var routeStripper = /^[#\/]|\s+$/g;
// Cached regex for stripping leading and trailing slashes.
var rootStripper = /^\/+|\/+$/g;
// Cached regex for detecting MSIE.
var isExplorer = /msie [\w.]+/;
// Cached regex for removing a trailing slash.
var trailingSlash = /\/$/;
// Has the history handling already been started?
History.started = false;
// Set up all inheritable **Backbone.History** properties and methods.
_.extend(History.prototype, Events, {
// The default interval to poll for hash changes, if necessary, is
// twenty times a second.
interval: 50,
// Gets the true hash value. Cannot use location.hash directly due to bug
// in Firefox where location.hash will always be decoded.
getHash: function(window) {
var match = (window || this).location.href.match(/#(.*)$/);
return match ? match[1] : '';
},
// Get the cross-browser normalized URL fragment, either from the URL,
// the hash, or the override.
getFragment: function(fragment, forcePushState) {
if (fragment == null) {
if (this._hasPushState || !this._wantsHashChange || forcePushState) {
fragment = this.location.pathname;
var root = this.root.replace(trailingSlash, '');
if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
} else {
fragment = this.getHash();
}
}
return fragment.replace(routeStripper, '');
},
// Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise.
start: function(options) {
if (History.started) throw new Error("Backbone.history has already been started");
History.started = true;
// Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available?
this.options = _.extend({}, {root: '/'}, this.options, options);
this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false;
this._wantsPushState = !!this.options.pushState;
this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
var fragment = this.getFragment();
var docMode = document.documentMode;
var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
// Normalize root to always include a leading and trailing slash.
this.root = ('/' + this.root + '/').replace(rootStripper, '/');
if (oldIE && this._wantsHashChange) {
this.iframe = Backbone.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
this.navigate(fragment);
}
// Depending on whether we're using pushState or hashes, and whether
// 'onhashchange' is supported, determine how we check the URL state.
if (this._hasPushState) {
Backbone.$(window).on('popstate', this.checkUrl);
} else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
Backbone.$(window).on('hashchange', this.checkUrl);
} else if (this._wantsHashChange) {
this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
}
// Determine if we need to change the base url, for a pushState link
// opened by a non-pushState browser.
this.fragment = fragment;
var loc = this.location;
var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
// If we've started off with a route from a `pushState`-enabled browser,
// but we're currently in a browser that doesn't support it...
if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
this.fragment = this.getFragment(null, true);
this.location.replace(this.root + this.location.search + '#' + this.fragment);
// Return immediately as browser will do redirect to new url
return true;
// Or if we've started out with a hash-based route, but we're currently
// in a browser where it could be `pushState`-based instead...
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
this.fragment = this.getHash().replace(routeStripper, '');
this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
}
if (!this.options.silent) return this.loadUrl();
},
// Disable Backbone.history, perhaps temporarily. Not useful in a real app,
// but possibly useful for unit testing Routers.
stop: function() {
Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
clearInterval(this._checkUrlInterval);
History.started = false;
},
// Add a route to be tested when the fragment changes. Routes added later
// may override previous routes.
route: function(route, callback) {
this.handlers.unshift({route: route, callback: callback});
},
// Checks the current URL to see if it has changed, and if it has,
// calls `loadUrl`, normalizing across the hidden iframe.
checkUrl: function(e) {
var current = this.getFragment();
if (current === this.fragment && this.iframe) {
current = this.getFragment(this.getHash(this.iframe));
}
if (current === this.fragment) return false;
if (this.iframe) this.navigate(current);
this.loadUrl() || this.loadUrl(this.getHash());
},
// Attempt to load the current URL fragment. If a route succeeds with a
// match, returns `true`. If no defined routes matches the fragment,
// returns `false`.
loadUrl: function(fragmentOverride) {
var fragment = this.fragment = this.getFragment(fragmentOverride);
var matched = _.any(this.handlers, function(handler) {
if (handler.route.test(fragment)) {
handler.callback(fragment);
return true;
}
});
return matched;
},
// Save a fragment into the hash history, or replace the URL state if the
// 'replace' option is passed. You are responsible for properly URL-encoding
// the fragment in advance.
//
// The options object can contain `trigger: true` if you wish to have the
// route callback be fired (not usually desirable), or `replace: true`, if
// you wish to modify the current URL without adding an entry to the history.
navigate: function(fragment, options) {
if (!History.started) return false;
if (!options || options === true) options = {trigger: options};
fragment = this.getFragment(fragment || '');
if (this.fragment === fragment) return;
this.fragment = fragment;
var url = this.root + fragment;
// If pushState is available, we use it to set the fragment as a real URL.
if (this._hasPushState) {
this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
// If hash changes haven't been explicitly disabled, update the hash
// fragment to store history.
} else if (this._wantsHashChange) {
this._updateHash(this.location, fragment, options.replace);
if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
// Opening and closing the iframe tricks IE7 and earlier to push a
// history entry on hash-tag change. When replace is true, we don't
// want this.
if(!options.replace) this.iframe.document.open().close();
this._updateHash(this.iframe.location, fragment, options.replace);
}
// If you've told us that you explicitly don't want fallback hashchange-
// based history, then `navigate` becomes a page refresh.
} else {
return this.location.assign(url);
}
if (options.trigger) this.loadUrl(fragment);
},
// Update the hash location, either replacing the current entry, or adding
// a new one to the browser history.
_updateHash: function(location, fragment, replace) {
if (replace) {
var href = location.href.replace(/(javascript:|#).*$/, '');
location.replace(href + '#' + fragment);
} else {
// Some browsers require that `hash` contains a leading #.
location.hash = '#' + fragment;
}
}
});
// Create the default Backbone.history.
Backbone.history = new History;
// Helpers
// -------
// Helper function to correctly set up the prototype chain, for subclasses.
// Similar to `goog.inherits`, but uses a hash of prototype properties and
// class properties to be extended.
var extend = function(protoProps, staticProps) {
var parent = this;
var child;
// The constructor function for the new subclass is either defined by you
// (the "constructor" property in your `extend` definition), or defaulted
// by us to simply call the parent's constructor.
if (protoProps && _.has(protoProps, 'constructor')) {
child = protoProps.constructor;
} else {
child = function(){ return parent.apply(this, arguments); };
}
// Add static properties to the constructor function, if supplied.
_.extend(child, parent, staticProps);
// Set the prototype chain to inherit from `parent`, without calling
// `parent`'s constructor function.
var Surrogate = function(){ this.constructor = child; };
Surrogate.prototype = parent.prototype;
child.prototype = new Surrogate;
// Add prototype properties (instance properties) to the subclass,
// if supplied.
if (protoProps) _.extend(child.prototype, protoProps);
// Set a convenience property in case the parent's prototype is needed
// later.
child.__super__ = parent.prototype;
return child;
};
// Set up inheritance for the model, collection, router, view and history.
Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
// Throw an error when a URL is needed, and none is supplied.
var urlError = function() {
throw new Error('A "url" property or function must be specified');
};
// Wrap an optional error callback with a fallback error event.
var wrapError = function (model, options) {
var error = options.error;
options.error = function(resp) {
if (error) error(model, resp, options);
model.trigger('error', model, resp, options);
};
};
}).call(this); | {'content_hash': 'e8cb358c6733971556c282aae843781e', 'timestamp': '', 'source': 'github', 'line_count': 3135, 'max_line_length': 129, 'avg_line_length': 42.13875598086124, 'alnum_prop': 0.5570266076227244, 'repo_name': 'PatronGames/SilverSoldier', 'id': 'c222d7c77b962b6a72fca1ef4523341f8c461d1b', 'size': '132325', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'public/lib/backbone/backbone.js', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'ApacheConf', 'bytes': '711'}, {'name': 'CSS', 'bytes': '2823'}, {'name': 'HTML', 'bytes': '7292'}, {'name': 'JavaScript', 'bytes': '228755'}, {'name': 'PHP', 'bytes': '72422'}]} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- From: file:/C:/Users/Juan/Documents/GitHub/cw-omnibus/Notifications/FullScreen/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values-es-rUS/values-es-rUS.xml -->
<eat-comment/>
<string msgid="4600421777120114993" name="abc_action_bar_home_description">"Navegar a la página principal"</string>
<string msgid="1594238315039666878" name="abc_action_bar_up_description">"Navegar hacia arriba"</string>
<string msgid="3588849162933574182" name="abc_action_menu_overflow_description">"Más opciones"</string>
<string msgid="4076576682505996667" name="abc_action_mode_done">"Listo"</string>
<string msgid="7468859129482906941" name="abc_activity_chooser_view_see_all">"Ver todo"</string>
<string msgid="2031811694353399454" name="abc_activitychooserview_choose_application">"Elige una aplicación."</string>
<string msgid="3691816814315814921" name="abc_searchview_description_clear">"Eliminar la consulta"</string>
<string msgid="2550479030709304392" name="abc_searchview_description_query">"Consulta de búsqueda"</string>
<string msgid="8264924765203268293" name="abc_searchview_description_search">"Búsqueda"</string>
<string msgid="8928215447528550784" name="abc_searchview_description_submit">"Enviar consulta"</string>
<string msgid="893419373245838918" name="abc_searchview_description_voice">"Búsqueda por voz"</string>
<string msgid="3421042268587513524" name="abc_shareactionprovider_share_with">"Compartir con"</string>
<string msgid="7165123711973476752" name="abc_shareactionprovider_share_with_application">"Compartir con %s"</string>
</resources> | {'content_hash': 'ae1c1125076fe0fcc429e15de0f65fa6', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 200, 'avg_line_length': 94.33333333333333, 'alnum_prop': 0.7620730270906949, 'repo_name': 'juanmendez/cw-omnibus', 'id': '80300778aaec03da2f1860dfbe824b330b559b76', 'size': '1704', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Notifications/FullScreen/build/intermediates/res/merged/debug/values-es-rUS/values-es-rUS.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '2322'}, {'name': 'CSS', 'bytes': '26706'}, {'name': 'HTML', 'bytes': '5679702'}, {'name': 'Java', 'bytes': '14524688'}, {'name': 'JavaScript', 'bytes': '209086'}, {'name': 'Makefile', 'bytes': '14011'}, {'name': 'Python', 'bytes': '546'}, {'name': 'Shell', 'bytes': '1056'}]} |
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# the lib use python logging can get it if the following is set in your
# Ansible config.
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_firewall_addrgrp6
short_description: Configure IPv6 address groups in Fortinet's FortiOS and FortiGate.
description:
- This module is able to configure a FortiGate or FortiOS by
allowing the user to configure firewall feature and addrgrp6 category.
Examples includes all options and need to be adjusted to datasources before usage.
Tested with FOS v6.0.2
version_added: "2.8"
author:
- Miguel Angel Munoz (@mamunozgonzalez)
- Nicolas Thomas (@thomnico)
notes:
- Requires fortiosapi library developed by Fortinet
- Run as a local_action in your playbook
requirements:
- fortiosapi>=0.9.8
options:
host:
description:
- FortiOS or FortiGate ip address.
required: true
username:
description:
- FortiOS or FortiGate username.
required: true
password:
description:
- FortiOS or FortiGate password.
default: ""
vdom:
description:
- Virtual domain, among those defined previously. A vdom is a
virtual instance of the FortiGate that can be configured and
used as a different unit.
default: root
https:
description:
- Indicates if the requests towards FortiGate must use HTTPS
protocol
type: bool
default: false
firewall_addrgrp6:
description:
- Configure IPv6 address groups.
default: null
suboptions:
state:
description:
- Indicates whether to create or remove the object
choices:
- present
- absent
color:
description:
- Integer value to determine the color of the icon in the GUI (1 - 32, default = 0, which sets the value to 1).
comment:
description:
- Comment.
member:
description:
- Address objects contained within the group.
suboptions:
name:
description:
- Address6/addrgrp6 name. Source firewall.address6.name firewall.addrgrp6.name.
required: true
name:
description:
- IPv6 address group name.
required: true
tagging:
description:
- Config object tagging.
suboptions:
category:
description:
- Tag category. Source system.object-tagging.category.
name:
description:
- Tagging entry name.
required: true
tags:
description:
- Tags.
suboptions:
name:
description:
- Tag name. Source system.object-tagging.tags.name.
required: true
uuid:
description:
- Universally Unique Identifier (UUID; automatically assigned but can be manually reset).
visibility:
description:
- Enable/disable address group6 visibility in the GUI.
choices:
- enable
- disable
'''
EXAMPLES = '''
- hosts: localhost
vars:
host: "192.168.122.40"
username: "admin"
password: ""
vdom: "root"
tasks:
- name: Configure IPv6 address groups.
fortios_firewall_addrgrp6:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
vdom: "{{ vdom }}"
firewall_addrgrp6:
state: "present"
color: "3"
comment: "Comment."
member:
-
name: "default_name_6 (source firewall.address6.name firewall.addrgrp6.name)"
name: "default_name_7"
tagging:
-
category: "<your_own_value> (source system.object-tagging.category)"
name: "default_name_10"
tags:
-
name: "default_name_12 (source system.object-tagging.tags.name)"
uuid: "<your_own_value>"
visibility: "enable"
'''
RETURN = '''
build:
description: Build number of the fortigate image
returned: always
type: str
sample: '1547'
http_method:
description: Last method used to provision the content into FortiGate
returned: always
type: str
sample: 'PUT'
http_status:
description: Last result given by FortiGate on last operation applied
returned: always
type: str
sample: "200"
mkey:
description: Master key (id) used in the last call to FortiGate
returned: success
type: str
sample: "key1"
name:
description: Name of the table used to fulfill the request
returned: always
type: str
sample: "urlfilter"
path:
description: Path of the table used to fulfill the request
returned: always
type: str
sample: "webfilter"
revision:
description: Internal revision number
returned: always
type: str
sample: "17.0.2.10658"
serial:
description: Serial number of the unit
returned: always
type: str
sample: "FGVMEVYYQT3AB5352"
status:
description: Indication of the operation's result
returned: always
type: str
sample: "success"
vdom:
description: Virtual domain used
returned: always
type: str
sample: "root"
version:
description: Version of the FortiGate
returned: always
type: str
sample: "v5.6.3"
'''
from ansible.module_utils.basic import AnsibleModule
fos = None
def login(data):
host = data['host']
username = data['username']
password = data['password']
fos.debug('on')
if 'https' in data and not data['https']:
fos.https('off')
else:
fos.https('on')
fos.login(host, username, password)
def filter_firewall_addrgrp6_data(json):
option_list = ['color', 'comment', 'member',
'name', 'tagging', 'uuid',
'visibility']
dictionary = {}
for attribute in option_list:
if attribute in json and json[attribute] is not None:
dictionary[attribute] = json[attribute]
return dictionary
def firewall_addrgrp6(data, fos):
vdom = data['vdom']
firewall_addrgrp6_data = data['firewall_addrgrp6']
filtered_data = filter_firewall_addrgrp6_data(firewall_addrgrp6_data)
if firewall_addrgrp6_data['state'] == "present":
return fos.set('firewall',
'addrgrp6',
data=filtered_data,
vdom=vdom)
elif firewall_addrgrp6_data['state'] == "absent":
return fos.delete('firewall',
'addrgrp6',
mkey=filtered_data['name'],
vdom=vdom)
def fortios_firewall(data, fos):
login(data)
methodlist = ['firewall_addrgrp6']
for method in methodlist:
if data[method]:
resp = eval(method)(data, fos)
break
fos.logout()
return not resp['status'] == "success", resp['status'] == "success", resp
def main():
fields = {
"host": {"required": True, "type": "str"},
"username": {"required": True, "type": "str"},
"password": {"required": False, "type": "str", "no_log": True},
"vdom": {"required": False, "type": "str", "default": "root"},
"https": {"required": False, "type": "bool", "default": "False"},
"firewall_addrgrp6": {
"required": False, "type": "dict",
"options": {
"state": {"required": True, "type": "str",
"choices": ["present", "absent"]},
"color": {"required": False, "type": "int"},
"comment": {"required": False, "type": "str"},
"member": {"required": False, "type": "list",
"options": {
"name": {"required": True, "type": "str"}
}},
"name": {"required": True, "type": "str"},
"tagging": {"required": False, "type": "list",
"options": {
"category": {"required": False, "type": "str"},
"name": {"required": True, "type": "str"},
"tags": {"required": False, "type": "list",
"options": {
"name": {"required": True, "type": "str"}
}}
}},
"uuid": {"required": False, "type": "str"},
"visibility": {"required": False, "type": "str",
"choices": ["enable", "disable"]}
}
}
}
module = AnsibleModule(argument_spec=fields,
supports_check_mode=False)
try:
from fortiosapi import FortiOSAPI
except ImportError:
module.fail_json(msg="fortiosapi module is required")
global fos
fos = FortiOSAPI()
is_error, has_changed, result = fortios_firewall(module.params, fos)
if not is_error:
module.exit_json(changed=has_changed, meta=result)
else:
module.fail_json(msg="Error in repo", meta=result)
if __name__ == '__main__':
main()
| {'content_hash': '78a524f013c7b77ad1a026a6dd13edca', 'timestamp': '', 'source': 'github', 'line_count': 337, 'max_line_length': 131, 'avg_line_length': 31.623145400593472, 'alnum_prop': 0.539645303556348, 'repo_name': 'SergeyCherepanov/ansible', 'id': '765b175bb012731a1df060eb3651effaa05b32bf', 'size': '10675', 'binary': False, 'copies': '24', 'ref': 'refs/heads/master', 'path': 'ansible/ansible/modules/network/fortios/fortios_firewall_addrgrp6.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Shell', 'bytes': '824'}]} |
define(['./default', 'libs/farbtastic/farbtastic'], function(FieldDefault) {
var field = function(main) {
this.main = main;
this.divs = [];
};
field.prototype = $.extend({}, FieldDefault, {
initHtml: function() {
var field = this;
// Change the input value will change the input hidden value
this.fillExpander();
this._picker = this.main.domExpander.find('.bi-formfield-Uploaderpicker').farbtastic(function(Uploader) {
field._hasChanged(Uploader);
});
},
addField: function(position) {
var div = $("<div />");
this.divs.splice(position, 0, div)
var input = $("<input />");
return { html: div, field: div, input: input, index: position };
},
removeField: function(position) {
this.divs.splice(position, 1)[0].remove();
},
startEditing: function(position) {
var field = this.main.fields[position];
field.field.html(this.main.getValue(position));
$.farbtastic(this._picker).setUploader(this.main.getValue(position));
//this.main.fields[position].input.remove();
this.main.toggleExpander(position);
},
stopEditing: function(position) {
var field = this.main.fields[position];
//this.main.changeValue(position, this.main.fields[position].input.val());
this.main.hideExpander();
},
_setValueText: function(index, value) {
this.main.fields[index].html.html(value);
this.main.changeValue(index, value);
}
});
return field;
}); | {'content_hash': 'b254a3d311435317d4d378ed9cf40a00', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 108, 'avg_line_length': 25.43859649122807, 'alnum_prop': 0.6558620689655172, 'repo_name': 'khaliiid/visualizer', 'id': '16a8abcc9c4ee867b1edfc8f97fbeb94cec3b52b', 'size': '1451', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'scripts/libs/forms/types/uploader/table.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ABAP', 'bytes': '1924'}, {'name': 'ActionScript', 'bytes': '2266'}, {'name': 'Assembly', 'bytes': '1012'}, {'name': 'AutoHotkey', 'bytes': '1440'}, {'name': 'C', 'bytes': '61363'}, {'name': 'C#', 'bytes': '166'}, {'name': 'C++', 'bytes': '26528'}, {'name': 'CSS', 'bytes': '1342147'}, {'name': 'Clojure', 'bytes': '1588'}, {'name': 'CoffeeScript', 'bytes': '10192'}, {'name': 'ColdFusion', 'bytes': '172'}, {'name': 'Common Lisp', 'bytes': '1264'}, {'name': 'DOT', 'bytes': '11820'}, {'name': 'Dart', 'bytes': '1968'}, {'name': 'Erlang', 'bytes': '974'}, {'name': 'Go', 'bytes': '1282'}, {'name': 'Groovy', 'bytes': '10653'}, {'name': 'Haskell', 'bytes': '1024'}, {'name': 'Haxe', 'bytes': '894'}, {'name': 'Java', 'bytes': '10763'}, {'name': 'JavaScript', 'bytes': '85419041'}, {'name': 'Julia', 'bytes': '404'}, {'name': 'LiveScript', 'bytes': '11494'}, {'name': 'Lua', 'bytes': '1918'}, {'name': 'OCaml', 'bytes': '1078'}, {'name': 'Objective-C', 'bytes': '5344'}, {'name': 'PHP', 'bytes': '4019023'}, {'name': 'Pascal', 'bytes': '2824'}, {'name': 'Perl', 'bytes': '36978'}, {'name': 'PowerShell', 'bytes': '836'}, {'name': 'Python', 'bytes': '596530'}, {'name': 'R', 'bytes': '1336'}, {'name': 'Ruby', 'bytes': '1062'}, {'name': 'Rust', 'bytes': '990'}, {'name': 'Scala', 'bytes': '3082'}, {'name': 'Scheme', 'bytes': '1118'}, {'name': 'Shell', 'bytes': '19657'}, {'name': 'Tcl', 'bytes': '1798'}, {'name': 'TeX', 'bytes': '2690'}, {'name': 'TypeScript', 'bytes': '3214'}, {'name': 'Visual Basic', 'bytes': '1832'}, {'name': 'XQuery', 'bytes': '228'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>series-areaspline-stacked - YUI 3</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title="YUI 3"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 3.18.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/Anim.html">Anim</a></li>
<li><a href="../classes/App.html">App</a></li>
<li><a href="../classes/App.Base.html">App.Base</a></li>
<li><a href="../classes/App.Content.html">App.Content</a></li>
<li><a href="../classes/App.Transitions.html">App.Transitions</a></li>
<li><a href="../classes/App.TransitionsNative.html">App.TransitionsNative</a></li>
<li><a href="../classes/AreaSeries.html">AreaSeries</a></li>
<li><a href="../classes/AreaSplineSeries.html">AreaSplineSeries</a></li>
<li><a href="../classes/Array.html">Array</a></li>
<li><a href="../classes/ArrayList.html">ArrayList</a></li>
<li><a href="../classes/ArraySort.html">ArraySort</a></li>
<li><a href="../classes/AsyncQueue.html">AsyncQueue</a></li>
<li><a href="../classes/Attribute.html">Attribute</a></li>
<li><a href="../classes/AttributeCore.html">AttributeCore</a></li>
<li><a href="../classes/AttributeEvents.html">AttributeEvents</a></li>
<li><a href="../classes/AttributeExtras.html">AttributeExtras</a></li>
<li><a href="../classes/AttributeLite.html">AttributeLite</a></li>
<li><a href="../classes/AttributeObservable.html">AttributeObservable</a></li>
<li><a href="../classes/AutoComplete.html">AutoComplete</a></li>
<li><a href="../classes/AutoCompleteBase.html">AutoCompleteBase</a></li>
<li><a href="../classes/AutoCompleteFilters.html">AutoCompleteFilters</a></li>
<li><a href="../classes/AutoCompleteHighlighters.html">AutoCompleteHighlighters</a></li>
<li><a href="../classes/AutoCompleteList.html">AutoCompleteList</a></li>
<li><a href="../classes/Axis.html">Axis</a></li>
<li><a href="../classes/AxisBase.html">AxisBase</a></li>
<li><a href="../classes/BarSeries.html">BarSeries</a></li>
<li><a href="../classes/Base.html">Base</a></li>
<li><a href="../classes/BaseCore.html">BaseCore</a></li>
<li><a href="../classes/BaseObservable.html">BaseObservable</a></li>
<li><a href="../classes/BottomAxisLayout.html">BottomAxisLayout</a></li>
<li><a href="../classes/Button.html">Button</a></li>
<li><a href="../classes/ButtonCore.html">ButtonCore</a></li>
<li><a href="../classes/ButtonGroup.html">ButtonGroup</a></li>
<li><a href="../classes/Cache.html">Cache</a></li>
<li><a href="../classes/CacheOffline.html">CacheOffline</a></li>
<li><a href="../classes/Calendar.html">Calendar</a></li>
<li><a href="../classes/CalendarBase.html">CalendarBase</a></li>
<li><a href="../classes/CandlestickSeries.html">CandlestickSeries</a></li>
<li><a href="../classes/CanvasCircle.html">CanvasCircle</a></li>
<li><a href="../classes/CanvasDrawing.html">CanvasDrawing</a></li>
<li><a href="../classes/CanvasEllipse.html">CanvasEllipse</a></li>
<li><a href="../classes/CanvasGraphic.html">CanvasGraphic</a></li>
<li><a href="../classes/CanvasPath.html">CanvasPath</a></li>
<li><a href="../classes/CanvasPieSlice.html">CanvasPieSlice</a></li>
<li><a href="../classes/CanvasRect.html">CanvasRect</a></li>
<li><a href="../classes/CanvasShape.html">CanvasShape</a></li>
<li><a href="../classes/CartesianChart.html">CartesianChart</a></li>
<li><a href="../classes/CartesianSeries.html">CartesianSeries</a></li>
<li><a href="../classes/CategoryAxis.html">CategoryAxis</a></li>
<li><a href="../classes/CategoryAxisBase.html">CategoryAxisBase</a></li>
<li><a href="../classes/CategoryImpl.html">CategoryImpl</a></li>
<li><a href="../classes/Chart.html">Chart</a></li>
<li><a href="../classes/ChartBase.html">ChartBase</a></li>
<li><a href="../classes/ChartLegend.html">ChartLegend</a></li>
<li><a href="../classes/Circle.html">Circle</a></li>
<li><a href="../classes/CircleGroup.html">CircleGroup</a></li>
<li><a href="../classes/ClassNameManager.html">ClassNameManager</a></li>
<li><a href="../classes/ClickableRail.html">ClickableRail</a></li>
<li><a href="../classes/Color.html">Color</a></li>
<li><a href="../classes/Color.Harmony.html">Color.Harmony</a></li>
<li><a href="../classes/Color.HSL.html">Color.HSL</a></li>
<li><a href="../classes/Color.HSV.html">Color.HSV</a></li>
<li><a href="../classes/ColumnSeries.html">ColumnSeries</a></li>
<li><a href="../classes/ComboSeries.html">ComboSeries</a></li>
<li><a href="../classes/ComboSplineSeries.html">ComboSplineSeries</a></li>
<li><a href="../classes/config.html">config</a></li>
<li><a href="../classes/Console.html">Console</a></li>
<li><a href="../classes/ContentEditable.html">ContentEditable</a></li>
<li><a href="../classes/Controller.html">Controller</a></li>
<li><a href="../classes/Cookie.html">Cookie</a></li>
<li><a href="../classes/CurveUtil.html">CurveUtil</a></li>
<li><a href="../classes/CustomEvent.html">CustomEvent</a></li>
<li><a href="../classes/DataSchema.Array.html">DataSchema.Array</a></li>
<li><a href="../classes/DataSchema.Base.html">DataSchema.Base</a></li>
<li><a href="../classes/DataSchema.JSON.html">DataSchema.JSON</a></li>
<li><a href="../classes/DataSchema.Text.html">DataSchema.Text</a></li>
<li><a href="../classes/DataSchema.XML.html">DataSchema.XML</a></li>
<li><a href="../classes/DataSource.Function.html">DataSource.Function</a></li>
<li><a href="../classes/DataSource.Get.html">DataSource.Get</a></li>
<li><a href="../classes/DataSource.IO.html">DataSource.IO</a></li>
<li><a href="../classes/DataSource.Local.html">DataSource.Local</a></li>
<li><a href="../classes/DataSourceArraySchema.html">DataSourceArraySchema</a></li>
<li><a href="../classes/DataSourceCache.html">DataSourceCache</a></li>
<li><a href="../classes/DataSourceCacheExtension.html">DataSourceCacheExtension</a></li>
<li><a href="../classes/DataSourceJSONSchema.html">DataSourceJSONSchema</a></li>
<li><a href="../classes/DataSourceTextSchema.html">DataSourceTextSchema</a></li>
<li><a href="../classes/DataSourceXMLSchema.html">DataSourceXMLSchema</a></li>
<li><a href="../classes/DataTable.html">DataTable</a></li>
<li><a href="../classes/DataTable.Base.html">DataTable.Base</a></li>
<li><a href="../classes/DataTable.BodyView.html">DataTable.BodyView</a></li>
<li><a href="../classes/DataTable.BodyView.Formatters.html">DataTable.BodyView.Formatters</a></li>
<li><a href="../classes/DataTable.Column.html">DataTable.Column</a></li>
<li><a href="../classes/DataTable.ColumnWidths.html">DataTable.ColumnWidths</a></li>
<li><a href="../classes/DataTable.Core.html">DataTable.Core</a></li>
<li><a href="../classes/DataTable.HeaderView.html">DataTable.HeaderView</a></li>
<li><a href="../classes/DataTable.Highlight.html">DataTable.Highlight</a></li>
<li><a href="../classes/DataTable.KeyNav.html">DataTable.KeyNav</a></li>
<li><a href="../classes/DataTable.Message.html">DataTable.Message</a></li>
<li><a href="../classes/DataTable.Mutable.html">DataTable.Mutable</a></li>
<li><a href="../classes/DataTable.Paginator.html">DataTable.Paginator</a></li>
<li><a href="../classes/DataTable.Paginator.Model.html">DataTable.Paginator.Model</a></li>
<li><a href="../classes/DataTable.Paginator.View.html">DataTable.Paginator.View</a></li>
<li><a href="../classes/DataTable.Scrollable.html">DataTable.Scrollable</a></li>
<li><a href="../classes/DataTable.Sortable.html">DataTable.Sortable</a></li>
<li><a href="../classes/DataTable.TableView.html">DataTable.TableView</a></li>
<li><a href="../classes/Date.html">Date</a></li>
<li><a href="../classes/DD.DDM.html">DD.DDM</a></li>
<li><a href="../classes/DD.Delegate.html">DD.Delegate</a></li>
<li><a href="../classes/DD.Drag.html">DD.Drag</a></li>
<li><a href="../classes/DD.Drop.html">DD.Drop</a></li>
<li><a href="../classes/DD.Scroll.html">DD.Scroll</a></li>
<li><a href="../classes/Dial.html">Dial</a></li>
<li><a href="../classes/Do.html">Do</a></li>
<li><a href="../classes/Do.AlterArgs.html">Do.AlterArgs</a></li>
<li><a href="../classes/Do.AlterReturn.html">Do.AlterReturn</a></li>
<li><a href="../classes/Do.Error.html">Do.Error</a></li>
<li><a href="../classes/Do.Halt.html">Do.Halt</a></li>
<li><a href="../classes/Do.Method.html">Do.Method</a></li>
<li><a href="../classes/Do.Prevent.html">Do.Prevent</a></li>
<li><a href="../classes/DOM.html">DOM</a></li>
<li><a href="../classes/DOMEventFacade.html">DOMEventFacade</a></li>
<li><a href="../classes/Drawing.html">Drawing</a></li>
<li><a href="../classes/Easing.html">Easing</a></li>
<li><a href="../classes/EditorBase.html">EditorBase</a></li>
<li><a href="../classes/EditorSelection.html">EditorSelection</a></li>
<li><a href="../classes/Ellipse.html">Ellipse</a></li>
<li><a href="../classes/EllipseGroup.html">EllipseGroup</a></li>
<li><a href="../classes/Escape.html">Escape</a></li>
<li><a href="../classes/Event.html">Event</a></li>
<li><a href="../classes/EventFacade.html">EventFacade</a></li>
<li><a href="../classes/EventHandle.html">EventHandle</a></li>
<li><a href="../classes/EventTarget.html">EventTarget</a></li>
<li><a href="../classes/Features.html">Features</a></li>
<li><a href="../classes/File.html">File</a></li>
<li><a href="../classes/FileFlash.html">FileFlash</a></li>
<li><a href="../classes/FileHTML5.html">FileHTML5</a></li>
<li><a href="../classes/Fills.html">Fills</a></li>
<li><a href="../classes/Frame.html">Frame</a></li>
<li><a href="../classes/Get.html">Get</a></li>
<li><a href="../classes/Get.Transaction.html">Get.Transaction</a></li>
<li><a href="../classes/GetNodeJS.html">GetNodeJS</a></li>
<li><a href="../classes/Graph.html">Graph</a></li>
<li><a href="../classes/Graphic.html">Graphic</a></li>
<li><a href="../classes/GraphicBase.html">GraphicBase</a></li>
<li><a href="../classes/Gridlines.html">Gridlines</a></li>
<li><a href="../classes/GroupDiamond.html">GroupDiamond</a></li>
<li><a href="../classes/GroupRect.html">GroupRect</a></li>
<li><a href="../classes/Handlebars.html">Handlebars</a></li>
<li><a href="../classes/Highlight.html">Highlight</a></li>
<li><a href="../classes/Histogram.html">Histogram</a></li>
<li><a href="../classes/HistoryBase.html">HistoryBase</a></li>
<li><a href="../classes/HistoryHash.html">HistoryHash</a></li>
<li><a href="../classes/HistoryHTML5.html">HistoryHTML5</a></li>
<li><a href="../classes/HorizontalLegendLayout.html">HorizontalLegendLayout</a></li>
<li><a href="../classes/ImgLoadGroup.html">ImgLoadGroup</a></li>
<li><a href="../classes/ImgLoadImgObj.html">ImgLoadImgObj</a></li>
<li><a href="../classes/InlineEditor.html">InlineEditor</a></li>
<li><a href="../classes/Intl.html">Intl</a></li>
<li><a href="../classes/IO.html">IO</a></li>
<li><a href="../classes/JSON.html">JSON</a></li>
<li><a href="../classes/JSONPRequest.html">JSONPRequest</a></li>
<li><a href="../classes/Lang.html">Lang</a></li>
<li><a href="../classes/LazyModelList.html">LazyModelList</a></li>
<li><a href="../classes/LeftAxisLayout.html">LeftAxisLayout</a></li>
<li><a href="../classes/Lines.html">Lines</a></li>
<li><a href="../classes/LineSeries.html">LineSeries</a></li>
<li><a href="../classes/Loader.html">Loader</a></li>
<li><a href="../classes/MarkerSeries.html">MarkerSeries</a></li>
<li><a href="../classes/Matrix.html">Matrix</a></li>
<li><a href="../classes/MatrixUtil.html">MatrixUtil</a></li>
<li><a href="../classes/Model.html">Model</a></li>
<li><a href="../classes/ModelList.html">ModelList</a></li>
<li><a href="../classes/ModelSync.Local.html">ModelSync.Local</a></li>
<li><a href="../classes/ModelSync.REST.html">ModelSync.REST</a></li>
<li><a href="../classes/Node.html">Node</a></li>
<li><a href="../classes/NodeList.html">NodeList</a></li>
<li><a href="../classes/Number.html">Number</a></li>
<li><a href="../classes/NumericAxis.html">NumericAxis</a></li>
<li><a href="../classes/NumericAxisBase.html">NumericAxisBase</a></li>
<li><a href="../classes/NumericImpl.html">NumericImpl</a></li>
<li><a href="../classes/Object.html">Object</a></li>
<li><a href="../classes/OHLCSeries.html">OHLCSeries</a></li>
<li><a href="../classes/Overlay.html">Overlay</a></li>
<li><a href="../classes/Paginator.html">Paginator</a></li>
<li><a href="../classes/Paginator.Core.html">Paginator.Core</a></li>
<li><a href="../classes/Paginator.Url.html">Paginator.Url</a></li>
<li><a href="../classes/Panel.html">Panel</a></li>
<li><a href="../classes/Parallel.html">Parallel</a></li>
<li><a href="../classes/Path.html">Path</a></li>
<li><a href="../classes/PieChart.html">PieChart</a></li>
<li><a href="../classes/PieSeries.html">PieSeries</a></li>
<li><a href="../classes/Pjax.html">Pjax</a></li>
<li><a href="../classes/PjaxBase.html">PjaxBase</a></li>
<li><a href="../classes/PjaxContent.html">PjaxContent</a></li>
<li><a href="../classes/Plots.html">Plots</a></li>
<li><a href="../classes/Plugin.Align.html">Plugin.Align</a></li>
<li><a href="../classes/Plugin.AutoComplete.html">Plugin.AutoComplete</a></li>
<li><a href="../classes/Plugin.Base.html">Plugin.Base</a></li>
<li><a href="../classes/Plugin.Button.html">Plugin.Button</a></li>
<li><a href="../classes/Plugin.Cache.html">Plugin.Cache</a></li>
<li><a href="../classes/Plugin.CalendarNavigator.html">Plugin.CalendarNavigator</a></li>
<li><a href="../classes/Plugin.ConsoleFilters.html">Plugin.ConsoleFilters</a></li>
<li><a href="../classes/Plugin.CreateLinkBase.html">Plugin.CreateLinkBase</a></li>
<li><a href="../classes/Plugin.DataTableDataSource.html">Plugin.DataTableDataSource</a></li>
<li><a href="../classes/Plugin.DDConstrained.html">Plugin.DDConstrained</a></li>
<li><a href="../classes/Plugin.DDNodeScroll.html">Plugin.DDNodeScroll</a></li>
<li><a href="../classes/Plugin.DDProxy.html">Plugin.DDProxy</a></li>
<li><a href="../classes/Plugin.DDWindowScroll.html">Plugin.DDWindowScroll</a></li>
<li><a href="../classes/Plugin.Drag.html">Plugin.Drag</a></li>
<li><a href="../classes/Plugin.Drop.html">Plugin.Drop</a></li>
<li><a href="../classes/Plugin.EditorBidi.html">Plugin.EditorBidi</a></li>
<li><a href="../classes/Plugin.EditorBR.html">Plugin.EditorBR</a></li>
<li><a href="../classes/Plugin.EditorLists.html">Plugin.EditorLists</a></li>
<li><a href="../classes/Plugin.EditorPara.html">Plugin.EditorPara</a></li>
<li><a href="../classes/Plugin.EditorParaBase.html">Plugin.EditorParaBase</a></li>
<li><a href="../classes/Plugin.EditorParaIE.html">Plugin.EditorParaIE</a></li>
<li><a href="../classes/Plugin.EditorTab.html">Plugin.EditorTab</a></li>
<li><a href="../classes/Plugin.ExecCommand.html">Plugin.ExecCommand</a></li>
<li><a href="../classes/Plugin.ExecCommand.COMMANDS.html">Plugin.ExecCommand.COMMANDS</a></li>
<li><a href="../classes/Plugin.Flick.html">Plugin.Flick</a></li>
<li><a href="../classes/Plugin.Host.html">Plugin.Host</a></li>
<li><a href="../classes/plugin.NodeFocusManager.html">plugin.NodeFocusManager</a></li>
<li><a href="../classes/Plugin.NodeFX.html">Plugin.NodeFX</a></li>
<li><a href="../classes/plugin.NodeMenuNav.html">plugin.NodeMenuNav</a></li>
<li><a href="../classes/Plugin.Pjax.html">Plugin.Pjax</a></li>
<li><a href="../classes/Plugin.Resize.html">Plugin.Resize</a></li>
<li><a href="../classes/Plugin.ResizeConstrained.html">Plugin.ResizeConstrained</a></li>
<li><a href="../classes/Plugin.ResizeProxy.html">Plugin.ResizeProxy</a></li>
<li><a href="../classes/Plugin.ScrollInfo.html">Plugin.ScrollInfo</a></li>
<li><a href="../classes/Plugin.ScrollViewList.html">Plugin.ScrollViewList</a></li>
<li><a href="../classes/Plugin.ScrollViewPaginator.html">Plugin.ScrollViewPaginator</a></li>
<li><a href="../classes/Plugin.ScrollViewScrollbars.html">Plugin.ScrollViewScrollbars</a></li>
<li><a href="../classes/Plugin.Shim.html">Plugin.Shim</a></li>
<li><a href="../classes/Plugin.SortScroll.html">Plugin.SortScroll</a></li>
<li><a href="../classes/Plugin.Tree.Lazy.html">Plugin.Tree.Lazy</a></li>
<li><a href="../classes/Plugin.WidgetAnim.html">Plugin.WidgetAnim</a></li>
<li><a href="../classes/Pollable.html">Pollable</a></li>
<li><a href="../classes/Promise.html">Promise</a></li>
<li><a href="../classes/Promise.Resolver.html">Promise.Resolver</a></li>
<li><a href="../classes/QueryString.html">QueryString</a></li>
<li><a href="../classes/Queue.html">Queue</a></li>
<li><a href="../classes/RangeSeries.html">RangeSeries</a></li>
<li><a href="../classes/Record.html">Record</a></li>
<li><a href="../classes/Recordset.html">Recordset</a></li>
<li><a href="../classes/RecordsetFilter.html">RecordsetFilter</a></li>
<li><a href="../classes/RecordsetIndexer.html">RecordsetIndexer</a></li>
<li><a href="../classes/RecordsetSort.html">RecordsetSort</a></li>
<li><a href="../classes/Rect.html">Rect</a></li>
<li><a href="../classes/Renderer.html">Renderer</a></li>
<li><a href="../classes/Resize.html">Resize</a></li>
<li><a href="../classes/RightAxisLayout.html">RightAxisLayout</a></li>
<li><a href="../classes/Router.html">Router</a></li>
<li><a href="../classes/ScrollView.html">ScrollView</a></li>
<li><a href="../classes/Selector.html">Selector</a></li>
<li><a href="../classes/SeriesBase.html">SeriesBase</a></li>
<li><a href="../classes/Shape.html">Shape</a></li>
<li><a href="../classes/ShapeGroup.html">ShapeGroup</a></li>
<li><a href="../classes/Slider.html">Slider</a></li>
<li><a href="../classes/SliderBase.html">SliderBase</a></li>
<li><a href="../classes/SliderValueRange.html">SliderValueRange</a></li>
<li><a href="../classes/Sortable.html">Sortable</a></li>
<li><a href="../classes/SplineSeries.html">SplineSeries</a></li>
<li><a href="../classes/StackedAreaSeries.html">StackedAreaSeries</a></li>
<li><a href="../classes/StackedAreaSplineSeries.html">StackedAreaSplineSeries</a></li>
<li><a href="../classes/StackedAxis.html">StackedAxis</a></li>
<li><a href="../classes/StackedAxisBase.html">StackedAxisBase</a></li>
<li><a href="../classes/StackedBarSeries.html">StackedBarSeries</a></li>
<li><a href="../classes/StackedColumnSeries.html">StackedColumnSeries</a></li>
<li><a href="../classes/StackedComboSeries.html">StackedComboSeries</a></li>
<li><a href="../classes/StackedComboSplineSeries.html">StackedComboSplineSeries</a></li>
<li><a href="../classes/StackedImpl.html">StackedImpl</a></li>
<li><a href="../classes/StackedLineSeries.html">StackedLineSeries</a></li>
<li><a href="../classes/StackedMarkerSeries.html">StackedMarkerSeries</a></li>
<li><a href="../classes/StackedSplineSeries.html">StackedSplineSeries</a></li>
<li><a href="../classes/StackingUtil.html">StackingUtil</a></li>
<li><a href="../classes/State.html">State</a></li>
<li><a href="../classes/StyleSheet.html">StyleSheet</a></li>
<li><a href="../classes/Subscriber.html">Subscriber</a></li>
<li><a href="../classes/SVGCircle.html">SVGCircle</a></li>
<li><a href="../classes/SVGDrawing.html">SVGDrawing</a></li>
<li><a href="../classes/SVGEllipse.html">SVGEllipse</a></li>
<li><a href="../classes/SVGGraphic.html">SVGGraphic</a></li>
<li><a href="../classes/SVGPath.html">SVGPath</a></li>
<li><a href="../classes/SVGPieSlice.html">SVGPieSlice</a></li>
<li><a href="../classes/SVGRect.html">SVGRect</a></li>
<li><a href="../classes/SVGShape.html">SVGShape</a></li>
<li><a href="../classes/SWF.html">SWF</a></li>
<li><a href="../classes/SWFDetect.html">SWFDetect</a></li>
<li><a href="../classes/SyntheticEvent.html">SyntheticEvent</a></li>
<li><a href="../classes/SyntheticEvent.Notifier.html">SyntheticEvent.Notifier</a></li>
<li><a href="../classes/SynthRegistry.html">SynthRegistry</a></li>
<li><a href="../classes/Tab.html">Tab</a></li>
<li><a href="../classes/TabView.html">TabView</a></li>
<li><a href="../classes/Template.html">Template</a></li>
<li><a href="../classes/Template.Micro.html">Template.Micro</a></li>
<li><a href="../classes/Test.ArrayAssert.html">Test.ArrayAssert</a></li>
<li><a href="../classes/Test.Assert.html">Test.Assert</a></li>
<li><a href="../classes/Test.AssertionError.html">Test.AssertionError</a></li>
<li><a href="../classes/Test.ComparisonFailure.html">Test.ComparisonFailure</a></li>
<li><a href="../classes/Test.Console.html">Test.Console</a></li>
<li><a href="../classes/Test.CoverageFormat.html">Test.CoverageFormat</a></li>
<li><a href="../classes/Test.DateAssert.html">Test.DateAssert</a></li>
<li><a href="../classes/Test.EventTarget.html">Test.EventTarget</a></li>
<li><a href="../classes/Test.Mock.html">Test.Mock</a></li>
<li><a href="../classes/Test.Mock.Value.html">Test.Mock.Value</a></li>
<li><a href="../classes/Test.ObjectAssert.html">Test.ObjectAssert</a></li>
<li><a href="../classes/Test.Reporter.html">Test.Reporter</a></li>
<li><a href="../classes/Test.Results.html">Test.Results</a></li>
<li><a href="../classes/Test.Runner.html">Test.Runner</a></li>
<li><a href="../classes/Test.ShouldError.html">Test.ShouldError</a></li>
<li><a href="../classes/Test.ShouldFail.html">Test.ShouldFail</a></li>
<li><a href="../classes/Test.TestCase.html">Test.TestCase</a></li>
<li><a href="../classes/Test.TestFormat.html">Test.TestFormat</a></li>
<li><a href="../classes/Test.TestNode.html">Test.TestNode</a></li>
<li><a href="../classes/Test.TestRunner.html">Test.TestRunner</a></li>
<li><a href="../classes/Test.TestSuite.html">Test.TestSuite</a></li>
<li><a href="../classes/Test.UnexpectedError.html">Test.UnexpectedError</a></li>
<li><a href="../classes/Test.UnexpectedValue.html">Test.UnexpectedValue</a></li>
<li><a href="../classes/Test.Wait.html">Test.Wait</a></li>
<li><a href="../classes/Text.AccentFold.html">Text.AccentFold</a></li>
<li><a href="../classes/Text.WordBreak.html">Text.WordBreak</a></li>
<li><a href="../classes/TimeAxis.html">TimeAxis</a></li>
<li><a href="../classes/TimeAxisBase.html">TimeAxisBase</a></li>
<li><a href="../classes/TimeImpl.html">TimeImpl</a></li>
<li><a href="../classes/ToggleButton.html">ToggleButton</a></li>
<li><a href="../classes/TopAxisLayout.html">TopAxisLayout</a></li>
<li><a href="../classes/Transition.html">Transition</a></li>
<li><a href="../classes/Tree.html">Tree</a></li>
<li><a href="../classes/Tree.Labelable.html">Tree.Labelable</a></li>
<li><a href="../classes/Tree.Node.html">Tree.Node</a></li>
<li><a href="../classes/Tree.Node.Labelable.html">Tree.Node.Labelable</a></li>
<li><a href="../classes/Tree.Node.Openable.html">Tree.Node.Openable</a></li>
<li><a href="../classes/Tree.Node.Selectable.html">Tree.Node.Selectable</a></li>
<li><a href="../classes/Tree.Node.Sortable.html">Tree.Node.Sortable</a></li>
<li><a href="../classes/Tree.Openable.html">Tree.Openable</a></li>
<li><a href="../classes/Tree.Selectable.html">Tree.Selectable</a></li>
<li><a href="../classes/Tree.Sortable.html">Tree.Sortable</a></li>
<li><a href="../classes/UA.html">UA</a></li>
<li><a href="../classes/Uploader.html">Uploader</a></li>
<li><a href="../classes/Uploader.Queue.html">Uploader.Queue</a></li>
<li><a href="../classes/UploaderFlash.html">UploaderFlash</a></li>
<li><a href="../classes/UploaderHTML5.html">UploaderHTML5</a></li>
<li><a href="../classes/ValueChange.html">ValueChange</a></li>
<li><a href="../classes/VerticalLegendLayout.html">VerticalLegendLayout</a></li>
<li><a href="../classes/View.html">View</a></li>
<li><a href="../classes/View.NodeMap.html">View.NodeMap</a></li>
<li><a href="../classes/VMLCircle.html">VMLCircle</a></li>
<li><a href="../classes/VMLDrawing.html">VMLDrawing</a></li>
<li><a href="../classes/VMLEllipse.html">VMLEllipse</a></li>
<li><a href="../classes/VMLGraphic.html">VMLGraphic</a></li>
<li><a href="../classes/VMLPath.html">VMLPath</a></li>
<li><a href="../classes/VMLPieSlice.html">VMLPieSlice</a></li>
<li><a href="../classes/VMLRect.html">VMLRect</a></li>
<li><a href="../classes/VMLShape.html">VMLShape</a></li>
<li><a href="../classes/Widget.html">Widget</a></li>
<li><a href="../classes/WidgetAutohide.html">WidgetAutohide</a></li>
<li><a href="../classes/WidgetButtons.html">WidgetButtons</a></li>
<li><a href="../classes/WidgetChild.html">WidgetChild</a></li>
<li><a href="../classes/WidgetModality.html">WidgetModality</a></li>
<li><a href="../classes/WidgetParent.html">WidgetParent</a></li>
<li><a href="../classes/WidgetPosition.html">WidgetPosition</a></li>
<li><a href="../classes/WidgetPositionAlign.html">WidgetPositionAlign</a></li>
<li><a href="../classes/WidgetPositionConstrain.html">WidgetPositionConstrain</a></li>
<li><a href="../classes/WidgetStack.html">WidgetStack</a></li>
<li><a href="../classes/WidgetStdMod.html">WidgetStdMod</a></li>
<li><a href="../classes/XML.html">XML</a></li>
<li><a href="../classes/YQL.html">YQL</a></li>
<li><a href="../classes/YQLRequest.html">YQLRequest</a></li>
<li><a href="../classes/YUI.html">YUI</a></li>
<li><a href="../classes/YUI~substitute.html">YUI~substitute</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/align-plugin.html">align-plugin</a></li>
<li><a href="../modules/anim.html">anim</a></li>
<li><a href="../modules/anim-base.html">anim-base</a></li>
<li><a href="../modules/anim-color.html">anim-color</a></li>
<li><a href="../modules/anim-curve.html">anim-curve</a></li>
<li><a href="../modules/anim-easing.html">anim-easing</a></li>
<li><a href="../modules/anim-node-plugin.html">anim-node-plugin</a></li>
<li><a href="../modules/anim-scroll.html">anim-scroll</a></li>
<li><a href="../modules/anim-shape.html">anim-shape</a></li>
<li><a href="../modules/anim-shape-transform.html">anim-shape-transform</a></li>
<li><a href="../modules/anim-xy.html">anim-xy</a></li>
<li><a href="../modules/app.html">app</a></li>
<li><a href="../modules/app-base.html">app-base</a></li>
<li><a href="../modules/app-content.html">app-content</a></li>
<li><a href="../modules/app-transitions.html">app-transitions</a></li>
<li><a href="../modules/app-transitions-native.html">app-transitions-native</a></li>
<li><a href="../modules/array-extras.html">array-extras</a></li>
<li><a href="../modules/array-invoke.html">array-invoke</a></li>
<li><a href="../modules/arraylist.html">arraylist</a></li>
<li><a href="../modules/arraylist-add.html">arraylist-add</a></li>
<li><a href="../modules/arraylist-filter.html">arraylist-filter</a></li>
<li><a href="../modules/arraysort.html">arraysort</a></li>
<li><a href="../modules/async-queue.html">async-queue</a></li>
<li><a href="../modules/attribute.html">attribute</a></li>
<li><a href="../modules/attribute-base.html">attribute-base</a></li>
<li><a href="../modules/attribute-complex.html">attribute-complex</a></li>
<li><a href="../modules/attribute-core.html">attribute-core</a></li>
<li><a href="../modules/attribute-extras.html">attribute-extras</a></li>
<li><a href="../modules/attribute-observable.html">attribute-observable</a></li>
<li><a href="../modules/autocomplete.html">autocomplete</a></li>
<li><a href="../modules/autocomplete-base.html">autocomplete-base</a></li>
<li><a href="../modules/autocomplete-filters.html">autocomplete-filters</a></li>
<li><a href="../modules/autocomplete-filters-accentfold.html">autocomplete-filters-accentfold</a></li>
<li><a href="../modules/autocomplete-highlighters.html">autocomplete-highlighters</a></li>
<li><a href="../modules/autocomplete-highlighters-accentfold.html">autocomplete-highlighters-accentfold</a></li>
<li><a href="../modules/autocomplete-list.html">autocomplete-list</a></li>
<li><a href="../modules/autocomplete-list-keys.html">autocomplete-list-keys</a></li>
<li><a href="../modules/autocomplete-plugin.html">autocomplete-plugin</a></li>
<li><a href="../modules/autocomplete-sources.html">autocomplete-sources</a></li>
<li><a href="../modules/axis.html">axis</a></li>
<li><a href="../modules/axis-base.html">axis-base</a></li>
<li><a href="../modules/axis-category.html">axis-category</a></li>
<li><a href="../modules/axis-category-base.html">axis-category-base</a></li>
<li><a href="../modules/axis-numeric.html">axis-numeric</a></li>
<li><a href="../modules/axis-numeric-base.html">axis-numeric-base</a></li>
<li><a href="../modules/axis-stacked.html">axis-stacked</a></li>
<li><a href="../modules/axis-stacked-base.html">axis-stacked-base</a></li>
<li><a href="../modules/axis-time.html">axis-time</a></li>
<li><a href="../modules/axis-time-base.html">axis-time-base</a></li>
<li><a href="../modules/base.html">base</a></li>
<li><a href="../modules/base-base.html">base-base</a></li>
<li><a href="../modules/base-build.html">base-build</a></li>
<li><a href="../modules/base-core.html">base-core</a></li>
<li><a href="../modules/base-observable.html">base-observable</a></li>
<li><a href="../modules/base-pluginhost.html">base-pluginhost</a></li>
<li><a href="../modules/button.html">button</a></li>
<li><a href="../modules/button-core.html">button-core</a></li>
<li><a href="../modules/button-group.html">button-group</a></li>
<li><a href="../modules/button-plugin.html">button-plugin</a></li>
<li><a href="../modules/cache.html">cache</a></li>
<li><a href="../modules/cache-base.html">cache-base</a></li>
<li><a href="../modules/cache-offline.html">cache-offline</a></li>
<li><a href="../modules/cache-plugin.html">cache-plugin</a></li>
<li><a href="../modules/calendar.html">calendar</a></li>
<li><a href="../modules/calendar-base.html">calendar-base</a></li>
<li><a href="../modules/calendarnavigator.html">calendarnavigator</a></li>
<li><a href="../modules/charts.html">charts</a></li>
<li><a href="../modules/charts-base.html">charts-base</a></li>
<li><a href="../modules/charts-legend.html">charts-legend</a></li>
<li><a href="../modules/classnamemanager.html">classnamemanager</a></li>
<li><a href="../modules/clickable-rail.html">clickable-rail</a></li>
<li><a href="../modules/collection.html">collection</a></li>
<li><a href="../modules/color.html">color</a></li>
<li><a href="../modules/color-base.html">color-base</a></li>
<li><a href="../modules/color-harmony.html">color-harmony</a></li>
<li><a href="../modules/color-hsl.html">color-hsl</a></li>
<li><a href="../modules/color-hsv.html">color-hsv</a></li>
<li><a href="../modules/console.html">console</a></li>
<li><a href="../modules/console-filters.html">console-filters</a></li>
<li><a href="../modules/content-editable.html">content-editable</a></li>
<li><a href="../modules/cookie.html">cookie</a></li>
<li><a href="../modules/createlink-base.html">createlink-base</a></li>
<li><a href="../modules/dataschema.html">dataschema</a></li>
<li><a href="../modules/dataschema-array.html">dataschema-array</a></li>
<li><a href="../modules/dataschema-base.html">dataschema-base</a></li>
<li><a href="../modules/dataschema-json.html">dataschema-json</a></li>
<li><a href="../modules/dataschema-text.html">dataschema-text</a></li>
<li><a href="../modules/dataschema-xml.html">dataschema-xml</a></li>
<li><a href="../modules/datasource.html">datasource</a></li>
<li><a href="../modules/datasource-arrayschema.html">datasource-arrayschema</a></li>
<li><a href="../modules/datasource-cache.html">datasource-cache</a></li>
<li><a href="../modules/datasource-function.html">datasource-function</a></li>
<li><a href="../modules/datasource-get.html">datasource-get</a></li>
<li><a href="../modules/datasource-io.html">datasource-io</a></li>
<li><a href="../modules/datasource-jsonschema.html">datasource-jsonschema</a></li>
<li><a href="../modules/datasource-local.html">datasource-local</a></li>
<li><a href="../modules/datasource-polling.html">datasource-polling</a></li>
<li><a href="../modules/datasource-textschema.html">datasource-textschema</a></li>
<li><a href="../modules/datasource-xmlschema.html">datasource-xmlschema</a></li>
<li><a href="../modules/datatable.html">datatable</a></li>
<li><a href="../modules/datatable-base.html">datatable-base</a></li>
<li><a href="../modules/datatable-body.html">datatable-body</a></li>
<li><a href="../modules/datatable-column-widths.html">datatable-column-widths</a></li>
<li><a href="../modules/datatable-core.html">datatable-core</a></li>
<li><a href="../modules/datatable-datasource.html">datatable-datasource</a></li>
<li><a href="../modules/datatable-foot.html">datatable-foot</a></li>
<li><a href="../modules/datatable-formatters.html">datatable-formatters</a></li>
<li><a href="../modules/datatable-head.html">datatable-head</a></li>
<li><a href="../modules/datatable-highlight.html">datatable-highlight</a></li>
<li><a href="../modules/datatable-keynav.html">datatable-keynav</a></li>
<li><a href="../modules/datatable-message.html">datatable-message</a></li>
<li><a href="../modules/datatable-mutable.html">datatable-mutable</a></li>
<li><a href="../modules/datatable-paginator.html">datatable-paginator</a></li>
<li><a href="../modules/datatable-scroll.html">datatable-scroll</a></li>
<li><a href="../modules/datatable-sort.html">datatable-sort</a></li>
<li><a href="../modules/datatable-table.html">datatable-table</a></li>
<li><a href="../modules/datatype.html">datatype</a></li>
<li><a href="../modules/datatype-date.html">datatype-date</a></li>
<li><a href="../modules/datatype-date-format.html">datatype-date-format</a></li>
<li><a href="../modules/datatype-date-math.html">datatype-date-math</a></li>
<li><a href="../modules/datatype-date-parse.html">datatype-date-parse</a></li>
<li><a href="../modules/datatype-number.html">datatype-number</a></li>
<li><a href="../modules/datatype-number-format.html">datatype-number-format</a></li>
<li><a href="../modules/datatype-number-parse.html">datatype-number-parse</a></li>
<li><a href="../modules/datatype-xml.html">datatype-xml</a></li>
<li><a href="../modules/datatype-xml-format.html">datatype-xml-format</a></li>
<li><a href="../modules/datatype-xml-parse.html">datatype-xml-parse</a></li>
<li><a href="../modules/dd.html">dd</a></li>
<li><a href="../modules/dd-constrain.html">dd-constrain</a></li>
<li><a href="../modules/dd-ddm.html">dd-ddm</a></li>
<li><a href="../modules/dd-ddm-base.html">dd-ddm-base</a></li>
<li><a href="../modules/dd-ddm-drop.html">dd-ddm-drop</a></li>
<li><a href="../modules/dd-delegate.html">dd-delegate</a></li>
<li><a href="../modules/dd-drag.html">dd-drag</a></li>
<li><a href="../modules/dd-drop.html">dd-drop</a></li>
<li><a href="../modules/dd-drop-plugin.html">dd-drop-plugin</a></li>
<li><a href="../modules/dd-gestures.html">dd-gestures</a></li>
<li><a href="../modules/dd-plugin.html">dd-plugin</a></li>
<li><a href="../modules/dd-proxy.html">dd-proxy</a></li>
<li><a href="../modules/dd-scroll.html">dd-scroll</a></li>
<li><a href="../modules/dial.html">dial</a></li>
<li><a href="../modules/dom.html">dom</a></li>
<li><a href="../modules/dom-base.html">dom-base</a></li>
<li><a href="../modules/dom-screen.html">dom-screen</a></li>
<li><a href="../modules/dom-style.html">dom-style</a></li>
<li><a href="../modules/dump.html">dump</a></li>
<li><a href="../modules/editor.html">editor</a></li>
<li><a href="../modules/editor-base.html">editor-base</a></li>
<li><a href="../modules/editor-bidi.html">editor-bidi</a></li>
<li><a href="../modules/editor-br.html">editor-br</a></li>
<li><a href="../modules/editor-inline.html">editor-inline</a></li>
<li><a href="../modules/editor-lists.html">editor-lists</a></li>
<li><a href="../modules/editor-para.html">editor-para</a></li>
<li><a href="../modules/editor-para-base.html">editor-para-base</a></li>
<li><a href="../modules/editor-para-ie.html">editor-para-ie</a></li>
<li><a href="../modules/editor-tab.html">editor-tab</a></li>
<li><a href="../modules/escape.html">escape</a></li>
<li><a href="../modules/event.html">event</a></li>
<li><a href="../modules/event-base.html">event-base</a></li>
<li><a href="../modules/event-contextmenu.html">event-contextmenu</a></li>
<li><a href="../modules/event-custom.html">event-custom</a></li>
<li><a href="../modules/event-custom-base.html">event-custom-base</a></li>
<li><a href="../modules/event-custom-complex.html">event-custom-complex</a></li>
<li><a href="../modules/event-delegate.html">event-delegate</a></li>
<li><a href="../modules/event-flick.html">event-flick</a></li>
<li><a href="../modules/event-focus.html">event-focus</a></li>
<li><a href="../modules/event-gestures.html">event-gestures</a></li>
<li><a href="../modules/event-hover.html">event-hover</a></li>
<li><a href="../modules/event-key.html">event-key</a></li>
<li><a href="../modules/event-mouseenter.html">event-mouseenter</a></li>
<li><a href="../modules/event-mousewheel.html">event-mousewheel</a></li>
<li><a href="../modules/event-move.html">event-move</a></li>
<li><a href="../modules/event-outside.html">event-outside</a></li>
<li><a href="../modules/event-resize.html">event-resize</a></li>
<li><a href="../modules/event-simulate.html">event-simulate</a></li>
<li><a href="../modules/event-synthetic.html">event-synthetic</a></li>
<li><a href="../modules/event-tap.html">event-tap</a></li>
<li><a href="../modules/event-touch.html">event-touch</a></li>
<li><a href="../modules/event-valuechange.html">event-valuechange</a></li>
<li><a href="../modules/exec-command.html">exec-command</a></li>
<li><a href="../modules/features.html">features</a></li>
<li><a href="../modules/file.html">file</a></li>
<li><a href="../modules/file-flash.html">file-flash</a></li>
<li><a href="../modules/file-html5.html">file-html5</a></li>
<li><a href="../modules/frame.html">frame</a></li>
<li><a href="../modules/gesture-simulate.html">gesture-simulate</a></li>
<li><a href="../modules/get.html">get</a></li>
<li><a href="../modules/get-nodejs.html">get-nodejs</a></li>
<li><a href="../modules/graphics.html">graphics</a></li>
<li><a href="../modules/graphics-group.html">graphics-group</a></li>
<li><a href="../modules/handlebars.html">handlebars</a></li>
<li><a href="../modules/handlebars-base.html">handlebars-base</a></li>
<li><a href="../modules/handlebars-compiler.html">handlebars-compiler</a></li>
<li><a href="../modules/highlight.html">highlight</a></li>
<li><a href="../modules/highlight-accentfold.html">highlight-accentfold</a></li>
<li><a href="../modules/highlight-base.html">highlight-base</a></li>
<li><a href="../modules/history.html">history</a></li>
<li><a href="../modules/history-base.html">history-base</a></li>
<li><a href="../modules/history-hash.html">history-hash</a></li>
<li><a href="../modules/history-hash-ie.html">history-hash-ie</a></li>
<li><a href="../modules/history-html5.html">history-html5</a></li>
<li><a href="../modules/imageloader.html">imageloader</a></li>
<li><a href="../modules/intl.html">intl</a></li>
<li><a href="../modules/io.html">io</a></li>
<li><a href="../modules/io-base.html">io-base</a></li>
<li><a href="../modules/io-form.html">io-form</a></li>
<li><a href="../modules/io-nodejs.html">io-nodejs</a></li>
<li><a href="../modules/io-queue.html">io-queue</a></li>
<li><a href="../modules/io-upload-iframe.html">io-upload-iframe</a></li>
<li><a href="../modules/io-xdr.html">io-xdr</a></li>
<li><a href="../modules/json.html">json</a></li>
<li><a href="../modules/json-parse.html">json-parse</a></li>
<li><a href="../modules/json-stringify.html">json-stringify</a></li>
<li><a href="../modules/jsonp.html">jsonp</a></li>
<li><a href="../modules/jsonp-url.html">jsonp-url</a></li>
<li><a href="../modules/lazy-model-list.html">lazy-model-list</a></li>
<li><a href="../modules/loader.html">loader</a></li>
<li><a href="../modules/loader-base.html">loader-base</a></li>
<li><a href="../modules/loader-yui3.html">loader-yui3</a></li>
<li><a href="../modules/matrix.html">matrix</a></li>
<li><a href="../modules/model.html">model</a></li>
<li><a href="../modules/model-list.html">model-list</a></li>
<li><a href="../modules/model-sync-rest.html">model-sync-rest</a></li>
<li><a href="../modules/node.html">node</a></li>
<li><a href="../modules/node-base.html">node-base</a></li>
<li><a href="../modules/node-core.html">node-core</a></li>
<li><a href="../modules/node-data.html">node-data</a></li>
<li><a href="../modules/node-event-delegate.html">node-event-delegate</a></li>
<li><a href="../modules/node-event-html5.html">node-event-html5</a></li>
<li><a href="../modules/node-event-simulate.html">node-event-simulate</a></li>
<li><a href="../modules/node-flick.html">node-flick</a></li>
<li><a href="../modules/node-focusmanager.html">node-focusmanager</a></li>
<li><a href="../modules/node-load.html">node-load</a></li>
<li><a href="../modules/node-menunav.html">node-menunav</a></li>
<li><a href="../modules/node-pluginhost.html">node-pluginhost</a></li>
<li><a href="../modules/node-screen.html">node-screen</a></li>
<li><a href="../modules/node-scroll-info.html">node-scroll-info</a></li>
<li><a href="../modules/node-style.html">node-style</a></li>
<li><a href="../modules/oop.html">oop</a></li>
<li><a href="../modules/overlay.html">overlay</a></li>
<li><a href="../modules/paginator.html">paginator</a></li>
<li><a href="../modules/paginator-core.html">paginator-core</a></li>
<li><a href="../modules/paginator-url.html">paginator-url</a></li>
<li><a href="../modules/panel.html">panel</a></li>
<li><a href="../modules/parallel.html">parallel</a></li>
<li><a href="../modules/pjax.html">pjax</a></li>
<li><a href="../modules/pjax-base.html">pjax-base</a></li>
<li><a href="../modules/pjax-content.html">pjax-content</a></li>
<li><a href="../modules/pjax-plugin.html">pjax-plugin</a></li>
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/pluginhost.html">pluginhost</a></li>
<li><a href="../modules/pluginhost-base.html">pluginhost-base</a></li>
<li><a href="../modules/pluginhost-config.html">pluginhost-config</a></li>
<li><a href="../modules/promise.html">promise</a></li>
<li><a href="../modules/querystring.html">querystring</a></li>
<li><a href="../modules/querystring-parse.html">querystring-parse</a></li>
<li><a href="../modules/querystring-parse-simple.html">querystring-parse-simple</a></li>
<li><a href="../modules/querystring-stringify.html">querystring-stringify</a></li>
<li><a href="../modules/querystring-stringify-simple.html">querystring-stringify-simple</a></li>
<li><a href="../modules/queue-promote.html">queue-promote</a></li>
<li><a href="../modules/range-slider.html">range-slider</a></li>
<li><a href="../modules/recordset.html">recordset</a></li>
<li><a href="../modules/recordset-base.html">recordset-base</a></li>
<li><a href="../modules/recordset-filter.html">recordset-filter</a></li>
<li><a href="../modules/recordset-indexer.html">recordset-indexer</a></li>
<li><a href="../modules/recordset-sort.html">recordset-sort</a></li>
<li><a href="../modules/resize.html">resize</a></li>
<li><a href="../modules/resize-contrain.html">resize-contrain</a></li>
<li><a href="../modules/resize-plugin.html">resize-plugin</a></li>
<li><a href="../modules/resize-proxy.html">resize-proxy</a></li>
<li><a href="../modules/rollup.html">rollup</a></li>
<li><a href="../modules/router.html">router</a></li>
<li><a href="../modules/scrollview.html">scrollview</a></li>
<li><a href="../modules/scrollview-base.html">scrollview-base</a></li>
<li><a href="../modules/scrollview-base-ie.html">scrollview-base-ie</a></li>
<li><a href="../modules/scrollview-list.html">scrollview-list</a></li>
<li><a href="../modules/scrollview-paginator.html">scrollview-paginator</a></li>
<li><a href="../modules/scrollview-scrollbars.html">scrollview-scrollbars</a></li>
<li><a href="../modules/selection.html">selection</a></li>
<li><a href="../modules/selector-css2.html">selector-css2</a></li>
<li><a href="../modules/selector-css3.html">selector-css3</a></li>
<li><a href="../modules/selector-native.html">selector-native</a></li>
<li><a href="../modules/series-area.html">series-area</a></li>
<li><a href="../modules/series-area-stacked.html">series-area-stacked</a></li>
<li><a href="../modules/series-areaspline.html">series-areaspline</a></li>
<li><a href="../modules/series-areaspline-stacked.html">series-areaspline-stacked</a></li>
<li><a href="../modules/series-bar.html">series-bar</a></li>
<li><a href="../modules/series-bar-stacked.html">series-bar-stacked</a></li>
<li><a href="../modules/series-base.html">series-base</a></li>
<li><a href="../modules/series-candlestick.html">series-candlestick</a></li>
<li><a href="../modules/series-cartesian.html">series-cartesian</a></li>
<li><a href="../modules/series-column.html">series-column</a></li>
<li><a href="../modules/series-column-stacked.html">series-column-stacked</a></li>
<li><a href="../modules/series-combo.html">series-combo</a></li>
<li><a href="../modules/series-combo-stacked.html">series-combo-stacked</a></li>
<li><a href="../modules/series-combospline.html">series-combospline</a></li>
<li><a href="../modules/series-combospline-stacked.html">series-combospline-stacked</a></li>
<li><a href="../modules/series-curve-util.html">series-curve-util</a></li>
<li><a href="../modules/series-fill-util.html">series-fill-util</a></li>
<li><a href="../modules/series-histogram.html">series-histogram</a></li>
<li><a href="../modules/series-line.html">series-line</a></li>
<li><a href="../modules/series-line-stacked.html">series-line-stacked</a></li>
<li><a href="../modules/series-line-util.html">series-line-util</a></li>
<li><a href="../modules/series-marker.html">series-marker</a></li>
<li><a href="../modules/series-marker-stacked.html">series-marker-stacked</a></li>
<li><a href="../modules/series-ohlc.html">series-ohlc</a></li>
<li><a href="../modules/series-pie.html">series-pie</a></li>
<li><a href="../modules/series-plot-util.html">series-plot-util</a></li>
<li><a href="../modules/series-range.html">series-range</a></li>
<li><a href="../modules/series-spline.html">series-spline</a></li>
<li><a href="../modules/series-spline-stacked.html">series-spline-stacked</a></li>
<li><a href="../modules/series-stacked.html">series-stacked</a></li>
<li><a href="../modules/shim-plugin.html">shim-plugin</a></li>
<li><a href="../modules/slider.html">slider</a></li>
<li><a href="../modules/slider-base.html">slider-base</a></li>
<li><a href="../modules/slider-value-range.html">slider-value-range</a></li>
<li><a href="../modules/sortable.html">sortable</a></li>
<li><a href="../modules/sortable-scroll.html">sortable-scroll</a></li>
<li><a href="../modules/stylesheet.html">stylesheet</a></li>
<li><a href="../modules/substitute.html">substitute</a></li>
<li><a href="../modules/swf.html">swf</a></li>
<li><a href="../modules/swfdetect.html">swfdetect</a></li>
<li><a href="../modules/tabview.html">tabview</a></li>
<li><a href="../modules/template.html">template</a></li>
<li><a href="../modules/template-base.html">template-base</a></li>
<li><a href="../modules/template-micro.html">template-micro</a></li>
<li><a href="../modules/test.html">test</a></li>
<li><a href="../modules/test-console.html">test-console</a></li>
<li><a href="../modules/text.html">text</a></li>
<li><a href="../modules/text-accentfold.html">text-accentfold</a></li>
<li><a href="../modules/text-wordbreak.html">text-wordbreak</a></li>
<li><a href="../modules/timers.html">timers</a></li>
<li><a href="../modules/transition.html">transition</a></li>
<li><a href="../modules/transition-timer.html">transition-timer</a></li>
<li><a href="../modules/tree.html">tree</a></li>
<li><a href="../modules/tree-labelable.html">tree-labelable</a></li>
<li><a href="../modules/tree-lazy.html">tree-lazy</a></li>
<li><a href="../modules/tree-node.html">tree-node</a></li>
<li><a href="../modules/tree-openable.html">tree-openable</a></li>
<li><a href="../modules/tree-selectable.html">tree-selectable</a></li>
<li><a href="../modules/tree-sortable.html">tree-sortable</a></li>
<li><a href="../modules/uploader.html">uploader</a></li>
<li><a href="../modules/uploader-flash.html">uploader-flash</a></li>
<li><a href="../modules/uploader-html5.html">uploader-html5</a></li>
<li><a href="../modules/uploader-queue.html">uploader-queue</a></li>
<li><a href="../modules/view.html">view</a></li>
<li><a href="../modules/view-node-map.html">view-node-map</a></li>
<li><a href="../modules/widget.html">widget</a></li>
<li><a href="../modules/widget-anim.html">widget-anim</a></li>
<li><a href="../modules/widget-autohide.html">widget-autohide</a></li>
<li><a href="../modules/widget-base.html">widget-base</a></li>
<li><a href="../modules/widget-base-ie.html">widget-base-ie</a></li>
<li><a href="../modules/widget-buttons.html">widget-buttons</a></li>
<li><a href="../modules/widget-child.html">widget-child</a></li>
<li><a href="../modules/widget-htmlparser.html">widget-htmlparser</a></li>
<li><a href="../modules/widget-modality.html">widget-modality</a></li>
<li><a href="../modules/widget-parent.html">widget-parent</a></li>
<li><a href="../modules/widget-position.html">widget-position</a></li>
<li><a href="../modules/widget-position-align.html">widget-position-align</a></li>
<li><a href="../modules/widget-position-constrain.html">widget-position-constrain</a></li>
<li><a href="../modules/widget-skin.html">widget-skin</a></li>
<li><a href="../modules/widget-stack.html">widget-stack</a></li>
<li><a href="../modules/widget-stdmod.html">widget-stdmod</a></li>
<li><a href="../modules/widget-uievents.html">widget-uievents</a></li>
<li><a href="../modules/yql.html">yql</a></li>
<li><a href="../modules/yql-jsonp.html">yql-jsonp</a></li>
<li><a href="../modules/yql-nodejs.html">yql-nodejs</a></li>
<li><a href="../modules/yql-winjs.html">yql-winjs</a></li>
<li><a href="../modules/yui.html">yui</a></li>
<li><a href="../modules/yui-base.html">yui-base</a></li>
<li><a href="../modules/yui-later.html">yui-later</a></li>
<li><a href="../modules/yui-log.html">yui-log</a></li>
<li><a href="../modules/yui-throttle.html">yui-throttle</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>series-areaspline-stacked Module</h1>
<div class="box clearfix meta">
<a class="button link-docs" href="/yui/docs/charts">User Guide & Examples</a>
<div class="foundat">
Defined in: <a href="../files/charts_js_StackedAreaSplineSeries.js.html#l7"><code>charts/js/StackedAreaSplineSeries.js:7</code></a>
</div>
</div>
<div class="box intro">
<p>Provides functionality for creating a stacked area spline series.</p>
</div>
<div class="yui3-g">
<div class="yui3-u-1-2">
<p>This module provides the following classes:</p>
<ul class="module-classes">
<li class="module-class">
<a href="../classes/StackedAreaSplineSeries.html">
StackedAreaSplineSeries
</a>
</li>
</ul>
</div>
<div class="yui3-u-1-2">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
| {'content_hash': 'f24216980aa69c8d30a62eed11281051', 'timestamp': '', 'source': 'github', 'line_count': 1634, 'max_line_length': 153, 'avg_line_length': 45.56242350061199, 'alnum_prop': 0.4713025023841825, 'repo_name': 'mabetle/mps', 'id': '9df225dcd4e0aca69f177a51cb9aca18c3e7a81e', 'size': '74449', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_libs/yui-3.18.1/api/modules/series-areaspline-stacked.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '912598'}, {'name': 'HTML', 'bytes': '16579'}, {'name': 'JavaScript', 'bytes': '2790381'}, {'name': 'Makefile', 'bytes': '192'}]} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '952926eaee95f79707b3ba5c730a0750', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '6257c8616d8076366d347f6e8e36264ea92fc30a', 'size': '201', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Alismatales/Araceae/Epipremnum/Epipremnum carolinense/ Syn. Rhaphidophora carolinensis/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
heamy.dataset module
======================================
.. automodule:: heamy.dataset
.. autoclass:: Dataset
:members:
| {'content_hash': 'b0cb86e086add2c30f86703990cd7b7a', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 38, 'avg_line_length': 18.428571428571427, 'alnum_prop': 0.4883720930232558, 'repo_name': 'rushter/heamy', 'id': 'f20da4ca09b3f829915ed9755d8e0bf2e8d19c0a', 'size': '129', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/dataset.rst', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Makefile', 'bytes': '2094'}, {'name': 'Python', 'bytes': '64982'}]} |
require 'spec_helper'
require 'vagrant-openstack-cloud-provider/action/read_ssh_info_from_api'
RSpec.describe VagrantPlugins::OpenStack::Action::ReadSSHInfoFromAPI do
describe '#call' do
it "passes proper parameters to read_ssh_info and puts them in machine_ssh_info" do
app = lambda { |only_one_parameter| }
env = {:openstack_compute => :my_compute, :machine => :my_machine}
subject = described_class.new(app, nil)
expect(subject).to receive(:read_ssh_info).with(:my_compute, :my_machine).and_return(:my_ssh_info)
subject.call(env)
expect(env[:machine_ssh_info]).to eq(:my_ssh_info)
end
it "calls app.call with the right env" do
app = double()
env = {:openstack_compute => nil, :machine => nil}
expect(app).to receive(:call).with(env)
subject = described_class.new(app, nil)
expect(subject).to receive(:read_ssh_info)
subject.call(env)
end
end
describe '#read_ssh_info' do
subject {
described_class.new(nil, nil)
}
let(:machine) { double }
let(:openstack) { double }
let(:servers) { double }
let(:invalid_openstack_server_instance) { double }
let(:openstack_server_instance) { double }
let(:provider_config) { double(:config,
:public_network_name => "public",
:ssh_username => "username")
}
it "should return nil if machine is nil" do
expect(machine).to receive(:id).and_return(nil)
expect(subject.read_ssh_info(nil, machine)).to eq(nil)
end
it "assigns machine_id to nil and returns nil if openstack returns nil" do
expect(machine).to receive(:id).at_least(:once).and_return("anything")
expect(machine).to receive(:id=).at_least(:once)
expect(servers).to receive(:get).and_return(nil)
expect(openstack).to receive(:servers).and_return(servers)
expect(subject.read_ssh_info(openstack, machine)).to eq(nil)
end
it "returns nil when something bad happens while fetching address" do
expect(machine).to receive(:id).at_least(:once).and_return("anything")
expect(machine).to receive(:provider_config).and_return(provider_config)
expect(invalid_openstack_server_instance).to receive(:addresses).and_raise(StandardError)
expect(servers).to receive(:get).and_return(invalid_openstack_server_instance)
expect(openstack).to receive(:servers).and_return(servers)
result = subject.read_ssh_info(openstack, machine)
expect(result).to eq({:port => 22, :username => 'username', :host => nil})
end
it "returns a proper ssh_info hash" do
expect(provider_config).to receive(:ssh_username).and_return("root")
expect(machine).to receive(:id).at_least(:once).and_return("anything")
expect(machine).to receive(:provider_config).and_return(provider_config)
valid_server_addresses = {
"public" => [
{ "addr" => 'server1.example.org' },
{ "addr" => 'server2.example.org' }
]
}
expect(openstack_server_instance).to receive(:addresses).and_return(valid_server_addresses)
expect(servers).to receive(:get).and_return(openstack_server_instance)
expect(openstack).to receive(:servers).and_return(servers)
result = subject.read_ssh_info(openstack, machine)
expect(result).to eq({:port => 22, :username => "root", :host => "server2.example.org"})
end
it "uses the public network name from the config" do
expect(provider_config).to receive(:public_network_name).and_return("my_custom_public_network_name")
expect(machine).to receive(:id).at_least(:once).and_return("anything")
expect(machine).to receive(:provider_config).and_return(provider_config)
valid_server_addresses = {
"my_custom_public_network_name" => [
{ "addr" => 'server1.example.org' },
{ "addr" => 'server2.example.org' }
]
}
expect(openstack_server_instance).to receive(:addresses).and_return(valid_server_addresses)
expect(servers).to receive(:get).and_return(openstack_server_instance)
expect(openstack).to receive(:servers).and_return(servers)
result = subject.read_ssh_info(openstack, machine)
expect(result).to eq({:port => 22, :username => "username", :host => "server2.example.org"})
end
end
end
| {'content_hash': '85be67a1bdb7bf56edc3e5fa58240025', 'timestamp': '', 'source': 'github', 'line_count': 116, 'max_line_length': 106, 'avg_line_length': 37.827586206896555, 'alnum_prop': 0.649954421148587, 'repo_name': 'mat128/vagrant-openstack', 'id': '639889ff72a3ba700207a3c064660700f6729a31', 'size': '4388', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'spec/vagrant-openstack-cloud-provider/action/read_ssh_info_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '50504'}]} |
package org.red5.io.webm;
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import org.red5.io.matroska.ConverterException;
import org.red5.io.matroska.dtd.CompoundTag;
import org.red5.io.matroska.dtd.StringTag;
import org.red5.io.matroska.dtd.Tag;
import org.red5.io.matroska.dtd.TagFactory;
import org.red5.io.matroska.dtd.UnsignedIntegerTag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Class able to write webm tags to file
*
*/
public class WebmWriter implements Closeable, TagConsumer {
private static Logger log = LoggerFactory.getLogger(WebmWriter.class);
private boolean append;
private RandomAccessFile dataFile;
private File file;
@SuppressWarnings("unused")
private volatile long bytesWritten;
private String filePath;
/**
* Constructor
*
* @param file
* - file the data need to written to
* @param append
* - if <code>false</code> the file will be rewritten, if <code>true</code> data will be appended
*/
public WebmWriter(File file, boolean append) {
// the final version of the file will go here
this.file = file;
filePath = file.getAbsolutePath();
try {
this.append = append;
if (append) {
// grab the file we will append to
if (!file.exists() || !file.canRead() || !file.canWrite()) {
throw new FileNotFoundException("File does not exist or cannot be accessed");
} else {
log.trace("File size: {} last modified: {}", file.length(), file.lastModified());
// update the bytes written so we write to the correct starting position
bytesWritten = file.length();
}
this.dataFile = new RandomAccessFile(file, "rws");
} else {
// temporary data file for storage of stream data
File dat = new File(filePath + ".ser");
if (dat.exists()) {
dat.delete();
dat.createNewFile();
}
this.dataFile = new RandomAccessFile(dat, "rws");
}
} catch (Exception e) {
log.error("Failed to create FLV writer", e);
}
}
/**
* method to write webm header to the new file
*
* @throws IOException
* - in case of IO errors
* @throws ConverterException
* - in case of conversion errors
*/
public void writeHeader() throws IOException, ConverterException {
if (append) {
return;
}
try {
CompoundTag ebml = TagFactory.<CompoundTag> create("EBML").add(TagFactory.<UnsignedIntegerTag> create("EBMLVersion").setValue(1)).add(TagFactory.<UnsignedIntegerTag> create("EBMLReadVersion").setValue(1)).add(TagFactory.<UnsignedIntegerTag> create("EBMLMaxIDLength").setValue(4)).add(TagFactory.<UnsignedIntegerTag> create("EBMLMaxSizeLength").setValue(8))
.add(TagFactory.<StringTag> create("DocType").setValue("webm")).add(TagFactory.<UnsignedIntegerTag> create("DocTypeVersion").setValue(3)).add(TagFactory.<UnsignedIntegerTag> create("DocTypeReadVersion").setValue(2));
byte[] hb = ebml.encode();
bytesWritten += hb.length;
dataFile.write(hb);
} catch (IOException | ConverterException e) {
log.error("Failed to write header", e);
throw e;
}
}
/**
* will write tag bytesWritten counter will be increased by the number of bytes actually written
*
* @param tag
* - tag to be written
* @throws IOException
* - in case of any IO errors
*/
public void writeTag(Tag tag) throws IOException {
byte[] hb = tag.encode();
bytesWritten += hb.length;
dataFile.write(hb);
}
/**
* Will close all opened resources and "finalize" the write process
*/
@Override
public void close() throws IOException {
if (dataFile != null) {
//TODO create separate method for this
if (!append) {
dataFile.seek(0);
try (RandomAccessFile rf = new RandomAccessFile(file, "rw")) {
rf.getChannel().transferFrom(dataFile.getChannel(), 0, dataFile.length());
}
}
try {
dataFile.close();
dataFile = null;
} catch (Throwable th) {
//no-op
}
}
}
/**
* @see org.red5.io.webm.TagConsumer#consume(org.red5.io.matroska.dtd.Tag)
*/
@Override
public void consume(Tag tag) throws IOException {
//TODO add mode switch
writeTag(tag);
}
}
| {'content_hash': 'c3396f2108bed167b996a75120032898', 'timestamp': '', 'source': 'github', 'line_count': 145, 'max_line_length': 368, 'avg_line_length': 34.220689655172414, 'alnum_prop': 0.5802095929060862, 'repo_name': 'maritelle/red5-io', 'id': '7d292698746179b7dce723bb8207e2554e50fb56', 'size': '5771', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'src/main/java/org/red5/io/webm/WebmWriter.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '1009734'}]} |
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script. Only //
// add custom code in the designated areas or it will be overwritten during //
// the next update. //
//-----------------------------------NOTICE----------------------------------//
#ifndef _NI3DSMORPHSHAPE_H_
#define _NI3DSMORPHSHAPE_H_
//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//
#include "NiObject.h"
namespace Niflib
{
class Ni3dsMorphShape;
typedef Ref<Ni3dsMorphShape> Ni3dsMorphShapeRef;
/*! Unknown! */
class Ni3dsMorphShape : public NiObject
{
public:
/*! Constructor */
NIFLIB_API Ni3dsMorphShape();
/*! Destructor */
NIFLIB_API virtual ~Ni3dsMorphShape();
/*!
* A constant value which uniquly identifies objects of this type.
*/
NIFLIB_API static const Type TYPE;
/*!
* A factory function used during file reading to create an instance of this type of object.
* \return A pointer to a newly allocated instance of this type of object.
*/
NIFLIB_API static NiObject * Create();
/*!
* Summarizes the information contained in this object in English.
* \param[in] verbose Determines whether or not detailed information about large areas of data will be printed out.
* \return A string containing a summary of the information within the object in English. This is the function that Niflyze calls to generate its analysis, so the output is the same.
*/
NIFLIB_API virtual string asString(bool verbose = false) const;
/*!
* Used to determine the type of a particular instance of this object.
* \return The type constant for the actual type of the object.
*/
NIFLIB_API virtual const Type & GetType() const;
//--This object has no eligable attributes. No example implementation generated--//
//--BEGIN MISC CUSTOM CODE--//
//--END CUSTOM CODE--//
protected:
/*! Unknown. */
array<14, byte > unknown1;
public:
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Read(istream& in, list<unsigned int> & link_stack, const NifInfo & info);
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Write(ostream& out, const map<NiObjectRef, unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info) const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void FixLinks(const map<unsigned int, NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info);
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObject *> GetPtrs() const;
};
//--BEGIN FILE FOOT CUSTOM CODE--//
//--END CUSTOM CODE--//
} //End Niflib namespace
#endif
| {'content_hash': '7fa7f06fab5dd982f7344a9620147516', 'timestamp': '', 'source': 'github', 'line_count': 81, 'max_line_length': 185, 'avg_line_length': 36.95061728395062, 'alnum_prop': 0.6598730370865352, 'repo_name': 'BlazesRus/niflib', 'id': 'd126aa1cb71bbb4f49423ddbeab6932d7c952b94', 'size': '3107', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'include/obj/Ni3dsMorphShape.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C++', 'bytes': '5722136'}, {'name': 'CMake', 'bytes': '13336'}, {'name': 'HTML', 'bytes': '485'}, {'name': 'Objective-C', 'bytes': '10426'}]} |
<?php
namespace SensioLabs\DeprecationDetector\FileInfo\Deprecation;
class MethodDeprecation implements DeprecationInterface
{
/**
* @var string
*/
private $parentName;
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $comment;
/**
* @param string $parentName
* @param string $name
* @param string $comment
*/
public function __construct($parentName, $name, $comment)
{
$this->parentName = $parentName;
$this->name = $name;
$this->comment = $comment;
}
/**
* @return string
*/
public function parentName()
{
return $this->parentName;
}
/**
* @return string
*/
public function comment()
{
return $this->comment;
}
/**
* @return string
*/
public function name()
{
return $this->name;
}
}
| {'content_hash': '354dbf5a249aab2df604cc326ce34065', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 62, 'avg_line_length': 16.24561403508772, 'alnum_prop': 0.521598272138229, 'repo_name': 'sensiolabs-de/deprecation-detector', 'id': '48fc321be2df8cae7fd658b23319c511bd608083', 'size': '926', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/FileInfo/Deprecation/MethodDeprecation.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '7343'}, {'name': 'PHP', 'bytes': '342744'}]} |
import { assertUrl, resolvePageUrl } from '../test-page-url';
import handleTagArgs from '../../utils/handle-tag-args';
import { delegateAPI, getDelegatedAPIList } from '../../utils/delegated-api';
import { assertType, is } from '../../errors/runtime/type-assertions';
export default class TestingUnit {
constructor (testFile, unitTypeName) {
this.testFile = testFile;
this.unitTypeName = unitTypeName;
this.name = null;
this.pageUrl = null;
this.authCredentials = null;
this.meta = {};
this.only = false;
this.skip = false;
this.disablePageReloads = void 0;
var unit = this;
this.apiOrigin = function apiOrigin (...args) {
return unit._add(...args);
};
delegateAPI(this.apiOrigin, this.constructor.API_LIST, { handler: this });
}
_add () {
throw new Error('Not implemented');
}
_only$getter () {
this.only = true;
return this.apiOrigin;
}
_skip$getter () {
this.skip = true;
return this.apiOrigin;
}
_disablePageReloads$getter () {
this.disablePageReloads = true;
return this.apiOrigin;
}
_enablePageReloads$getter () {
this.disablePageReloads = false;
return this.apiOrigin;
}
_page$ (url, ...rest) {
this.pageUrl = handleTagArgs(url, rest);
assertType(is.string, 'page', 'The page URL', this.pageUrl);
assertUrl(this.pageUrl, 'page');
this.pageUrl = resolvePageUrl(this.pageUrl, this.testFile.filename);
return this.apiOrigin;
}
_httpAuth$ (credentials) {
assertType(is.nonNullObject, 'httpAuth', 'credentials', credentials);
assertType(is.string, 'httpAuth', 'credentials.username', credentials.username);
assertType(is.string, 'httpAuth', 'credentials.password', credentials.password);
if (credentials.domain)
assertType(is.string, 'httpAuth', 'credentials.domain', credentials.domain);
if (credentials.workstation)
assertType(is.string, 'httpAuth', 'credentials.workstation', credentials.workstation);
this.authCredentials = credentials;
return this.apiOrigin;
}
_meta$ (...args) {
assertType([is.string, is.nonNullObject], 'meta', `${this.unitTypeName}.meta`, args[0]);
const data = typeof args[0] === 'string' ? { [args[0]]: args[1] } : args[0];
Object.keys(data).forEach(key => {
this.meta[key] = data[key];
});
return this.apiOrigin;
}
static _makeAPIListForChildClass (ChildClass) {
ChildClass.API_LIST = TestingUnit.API_LIST.concat(getDelegatedAPIList(ChildClass.prototype));
}
}
TestingUnit.API_LIST = getDelegatedAPIList(TestingUnit.prototype);
| {'content_hash': '9a073a35b2e6c1c3df91b74bf6e963ad', 'timestamp': '', 'source': 'github', 'line_count': 104, 'max_line_length': 101, 'avg_line_length': 27.83653846153846, 'alnum_prop': 0.5993091537132987, 'repo_name': 'churkin/testcafe', 'id': 'e1d79a59e74e0641ca70894887f2d5d1986197a6', 'size': '2895', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/api/structure/testing-unit.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '19732'}, {'name': 'Dockerfile', 'bytes': '472'}, {'name': 'HTML', 'bytes': '186603'}, {'name': 'JavaScript', 'bytes': '2549826'}, {'name': 'Shell', 'bytes': '307'}, {'name': 'TypeScript', 'bytes': '65892'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sturrock</groupId>
<artifactId>jboss-active-directory</artifactId>
<version>1.0.0.0</version>
<packaging>war</packaging>
<name>JBoss Active Directory Integration</name>
<description>Demo of how to use Active Directory for authentication and authorisation</description>
<properties>
<!-- Explicitly declaring the source encoding eliminates the following
message: -->
<!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent! -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- JBoss dependency versions -->
<!-- A base list of dependency and plugin version used in the various quick
starts. -->
<version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
<version.org.infinispan>6.3.0.Final-redhat-5</version.org.infinispan>
<!-- other plugin versions -->
<version.com.mycyla.license>2.5</version.com.mycyla.license>
<version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
<!-- Define the version of the JBoss BOMs we want to import to specify
tested stacks. -->
<version.jboss.bom.eap>6.4.0.GA</version.jboss.bom.eap>
<!-- other plugin versions -->
<version.war.plugin>2.1.1</version.war.plugin>
<version.surefire.plugin>2.10</version.surefire.plugin>
<!-- maven-compiler-plugin -->
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<!-- Remote Server URL -->
<remote.server.url>http://127.0.0.1:8080/</remote.server.url>
</properties>
<profiles>
<!-- Configure the JBoss GA Maven repository -->
<profile>
<id>jboss-ga-repository</id>
<activation>
<property>
<name>env.JBOSS_REPO</name>
<value>jboss-ga-repository</value>
</property>
</activation>
<repositories>
<repository>
<id>jboss-ga-repository</id>
<url>http://maven.repository.redhat.com/techpreview/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-ga-plugin-repository</id>
<url>http://maven.repository.redhat.com/techpreview/all</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<!-- Define the version of JBoss' Java EE 6 APIs we want to import. Any
dependencies from org.jboss.spec will have their version defined by this
BOM -->
<!-- JBoss distributes a complete set of Java EE 6 APIs including a Bill
of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection)
of artifacts. We use this here so that we always get the correct versions
of artifacts. Here we use the jboss-javaee-6.0 stack (you can read this as
the JBoss stack of the Java EE 6 APIs). You can actually use this stack with
any version of JBoss EAP that implements Java EE 6. -->
<dependency>
<groupId>org.jboss.bom.eap</groupId>
<artifactId>jboss-javaee-6.0-with-tools</artifactId>
<version>${version.jboss.bom.eap}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.bom.eap</groupId>
<artifactId>jboss-javaee-6.0-with-logging</artifactId>
<version>${version.jboss.bom.eap}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!--
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-bom</artifactId>
<version>${version.org.infinispan}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the CDI API, we use provided scope as the API is included in
JBoss EAP 6 -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Import the Servlet API, we use provided scope as the API is included
in JBoss EAP 6 -->
<!--
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.0_spec</artifactId>
<scope>provided</scope>
</dependency>
-->
<!-- Import the Common Annotations API (JSR-250), we use provided scope
as the API is included in JBoss EAP 6 -->
<dependency>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<!-- jboss-logging API -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<scope>provided</scope>
</dependency>
<!-- RESTEasy implementation of JSR311 -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>0.11</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>2.3.10.Final-redhat-1</version>
<scope>provided</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.10.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- Set the name of the war, used as the context root when the app is
deployed -->
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${version.war.plugin}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!-- JBoss AS plugin to deploy war -->
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${version.jboss.maven.plugin}</version>
<configuration>
<hostname>127.0.0.1</hostname>
<port>9999</port>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {'content_hash': 'b063246adc00983842ca6ad253fab0a7', 'timestamp': '', 'source': 'github', 'line_count': 247, 'max_line_length': 104, 'avg_line_length': 29.23076923076923, 'alnum_prop': 0.6806094182825485, 'repo_name': 'andysturrock/jboss-active-directory', 'id': '17c87d8f8cd1164177af75872ed4325e3a5cf87a', 'size': '7220', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'pom.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '906'}, {'name': 'Java', 'bytes': '2826'}]} |
@class DVTPromise, NSTimer;
@interface DVTDownloadable_PKInstallClientDelegate : NSObject
{
NSTimer *_timer;
BOOL _isRunningModal;
DVTPromise *_promise;
}
- (void).cxx_destruct;
@property(retain) NSTimer *timer; // @synthesize timer=_timer;
- (void)_callPKInstallClientStatusTimer:(id)arg1;
- (void)installClientDidFinish:(id)arg1;
- (void)installClient:(id)arg1 didFailWithError:(id)arg2;
- (void)installClient:(id)arg1 currentState:(int)arg2 package:(id)arg3 progress:(double)arg4 timeRemaining:(double)arg5;
- (void)installClientDidBegin:(id)arg1;
- (id)initForModal:(BOOL)arg1 promise:(id)arg2;
@end
| {'content_hash': '7025071041af7c193688a71c1104faee', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 120, 'avg_line_length': 31.0, 'alnum_prop': 0.7532258064516129, 'repo_name': 'XVimProject/XVim2', 'id': '6fa2a05e994032be45b059e4ac9487026cdba044', 'size': '790', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'XVim2/XcodeHeader/DVTFoundation/DVTDownloadable_PKInstallClientDelegate.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '3672'}, {'name': 'C', 'bytes': '65096'}, {'name': 'C++', 'bytes': '10438'}, {'name': 'Makefile', 'bytes': '2176'}, {'name': 'Objective-C', 'bytes': '5172541'}, {'name': 'Python', 'bytes': '1161'}, {'name': 'Ruby', 'bytes': '1083'}, {'name': 'Shell', 'bytes': '593'}, {'name': 'Swift', 'bytes': '24720'}]} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.rreeggkk</groupId>
<artifactId>YellowPages</artifactId>
<version>1.7.9-1.0.1</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.9-R0.3-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project> | {'content_hash': 'f082b61f94d09ab9f71a6f7656cc21b5', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 204, 'avg_line_length': 35.39393939393939, 'alnum_prop': 0.5813356164383562, 'repo_name': 'rreeggkk/YellowPages', 'id': 'be3173667390d5616208bd743c57d37aaf073d65', 'size': '1168', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'target/classes/META-INF/maven/io.github.rreeggkk/YellowPages/pom.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '24910'}]} |
<div class="panel-body swatch-white" ng-controller="tagController">
<h4>User Contributed Tags <a href="#" tip="User tags are terms added to records by Research Data Switchboard users to assist discovery of these records by themselves and others. By clicking on an added tag you can discover other related records with the same tag. In order to tag a record you must first login to Research Data Switchboard. Tags can be any string you choose but should be meaningful and have relevance to the record the tag is being added to. To assist you in assigning a tag, previously used tags and terms from the ANZSRC Fields of research (FOR) and Socio-economic objective (SEO) vocabularies are offered via autocomplete suggestions."><i class="fa fa-info"></i></a></h4>
@if($ro->tags)
@foreach($ro->tags as $tag)
@if($ro->core['class'] != 'collection')
<a href="{{base_url('search')}}#!/tag={{$tag['name']}}/class={{$ro->core['class']}}" class="btn btn-primary btn-link btn-sm btn-icon-left"><span><i class="fa fa-tag"></i></span>{{$tag['name']}}</a>
@else
<a href="{{base_url('search')}}#!/tag={{$tag['name']}}" class="btn btn-primary btn-link btn-sm btn-icon-left"><span><i class="fa fa-tag"></i></span>{{$tag['name']}}</a>
@endif
@endforeach
@endif
@if(!$this->user->isLoggedIn())
<p class="element-short-top"><a href="{{portal_url('profile')}}">Login</a> to tag this record with meaningful keywords to make it easier to discover</p>
@else
<form class="element-short-top input-group" style="width:270px" ng-submit="addTag()">
<input type="text" class="form-control col-md-4" placeholder="Start typing to add tags" ng-model="newTag" typeahead="value.name for value in getSuggestTag($viewValue)" typeahead-min-length="2" typeahead-loading="loadingSuggestions">
<span class="input-group-btn">
<input type="submit" class="btn btn-primary" value="Add Tag"><i class="fa fa-tag"></i> Add Tag</input>
</span>
</form> <br /><em><span id="tag_error"/></em>
<i ng-show="loadingSuggestions" class="fa fa-refresh fa-spin"></i>
@endif
</div> | {'content_hash': 'bfdc70dedd8541c205efcdf2e8a607f9', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 720, 'avg_line_length': 89.125, 'alnum_prop': 0.6778868630201028, 'repo_name': 'rd-switchboard/Browser', 'id': 'bb4b83324f07179595eb92d83fc741878726dc11', 'size': '2139', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'applications/portal/templates/omega/registry_object/contents/tags.blade.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1413738'}, {'name': 'HTML', 'bytes': '49872'}, {'name': 'JavaScript', 'bytes': '4276757'}, {'name': 'PHP', 'bytes': '4722290'}, {'name': 'Puppet', 'bytes': '14384'}, {'name': 'Python', 'bytes': '139802'}, {'name': 'Shell', 'bytes': '1383'}, {'name': 'Smarty', 'bytes': '2395'}, {'name': 'XSLT', 'bytes': '424808'}]} |
export class Student{
_id: any;
firstName: string;
lastName:string;
email: string;
phone: string;
editState: boolean;
active: boolean;
registered: boolean;
} | {'content_hash': 'f04ea411ced3fc080ad4ec356b2d48a6', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 25, 'avg_line_length': 20.0, 'alnum_prop': 0.6, 'repo_name': 'tfn0876/pokemon_team', 'id': 'e87baecac26cbdfc04d1f796db9ee4c7a00f4b78', 'size': '201', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'client/model/student.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '5483'}, {'name': 'HTML', 'bytes': '48385'}, {'name': 'JavaScript', 'bytes': '23632'}, {'name': 'TypeScript', 'bytes': '119063'}]} |
namespace asio {
template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec)
{
ec = asio::error_code();
asio::detail::consuming_buffers<
mutable_buffer, MutableBufferSequence> tmp(buffers);
std::size_t total_transferred = 0;
tmp.prepare(detail::adapt_completion_condition_result(
completion_condition(ec, total_transferred)));
while (tmp.begin() != tmp.end())
{
std::size_t bytes_transferred = d.read_some_at(
offset + total_transferred, tmp, ec);
tmp.consume(bytes_transferred);
total_transferred += bytes_transferred;
tmp.prepare(detail::adapt_completion_condition_result(
completion_condition(ec, total_transferred)));
}
return total_transferred;
}
template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers)
{
asio::error_code ec;
std::size_t bytes_transferred = read_at(
d, offset, buffers, transfer_all(), ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
asio::error_code& ec)
{
return read_at(d, offset, buffers, transfer_all(), ec);
}
template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
CompletionCondition completion_condition)
{
asio::error_code ec;
std::size_t bytes_transferred = read_at(
d, offset, buffers, completion_condition, ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
#if !defined(ASIO_NO_IOSTREAM)
template <typename SyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition>
std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b,
CompletionCondition completion_condition, asio::error_code& ec)
{
ec = asio::error_code();
std::size_t total_transferred = 0;
std::size_t max_size = detail::adapt_completion_condition_result(
completion_condition(ec, total_transferred));
std::size_t bytes_available = read_size_helper(b, max_size);
while (bytes_available > 0)
{
std::size_t bytes_transferred = d.read_some_at(
offset + total_transferred, b.prepare(bytes_available), ec);
b.commit(bytes_transferred);
total_transferred += bytes_transferred;
max_size = detail::adapt_completion_condition_result(
completion_condition(ec, total_transferred));
bytes_available = read_size_helper(b, max_size);
}
return total_transferred;
}
template <typename SyncRandomAccessReadDevice, typename Allocator>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b)
{
asio::error_code ec;
std::size_t bytes_transferred = read_at(
d, offset, b, transfer_all(), ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
template <typename SyncRandomAccessReadDevice, typename Allocator>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b,
asio::error_code& ec)
{
return read_at(d, offset, b, transfer_all(), ec);
}
template <typename SyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition>
inline std::size_t read_at(SyncRandomAccessReadDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b,
CompletionCondition completion_condition)
{
asio::error_code ec;
std::size_t bytes_transferred = read_at(
d, offset, b, completion_condition, ec);
asio::detail::throw_error(ec, "read_at");
return bytes_transferred;
}
#endif // !defined(ASIO_NO_IOSTREAM)
namespace detail
{
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
typename ReadHandler>
class read_at_op
: detail::base_from_completion_cond<CompletionCondition>
{
public:
read_at_op(AsyncRandomAccessReadDevice& device,
uint64_t offset, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, ReadHandler& handler)
: detail::base_from_completion_cond<
CompletionCondition>(completion_condition),
device_(device),
offset_(offset),
buffers_(buffers),
start_(0),
total_transferred_(0),
handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
{
}
#if defined(ASIO_HAS_MOVE)
read_at_op(const read_at_op& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
buffers_(other.buffers_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(other.handler_)
{
}
read_at_op(read_at_op&& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
buffers_(other.buffers_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
std::size_t bytes_transferred, int start = 0)
{
switch (start_ = start)
{
case 1:
buffers_.prepare(this->check_for_completion(ec, total_transferred_));
for (;;)
{
device_.async_read_some_at(offset_ + total_transferred_,
buffers_, ASIO_MOVE_CAST(read_at_op)(*this));
return; default:
total_transferred_ += bytes_transferred;
buffers_.consume(bytes_transferred);
buffers_.prepare(this->check_for_completion(ec, total_transferred_));
if ((!ec && bytes_transferred == 0)
|| buffers_.begin() == buffers_.end())
break;
}
handler_(ec, static_cast<const std::size_t&>(total_transferred_));
}
}
//private:
AsyncRandomAccessReadDevice& device_;
uint64_t offset_;
asio::detail::consuming_buffers<
mutable_buffer, MutableBufferSequence> buffers_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
template <typename AsyncRandomAccessReadDevice,
typename CompletionCondition, typename ReadHandler>
class read_at_op<AsyncRandomAccessReadDevice,
asio::mutable_buffers_1, CompletionCondition, ReadHandler>
: detail::base_from_completion_cond<CompletionCondition>
{
public:
read_at_op(AsyncRandomAccessReadDevice& device,
uint64_t offset, const asio::mutable_buffers_1& buffers,
CompletionCondition completion_condition, ReadHandler& handler)
: detail::base_from_completion_cond<
CompletionCondition>(completion_condition),
device_(device),
offset_(offset),
buffer_(buffers),
start_(0),
total_transferred_(0),
handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
{
}
#if defined(ASIO_HAS_MOVE)
read_at_op(const read_at_op& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
buffer_(other.buffer_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(other.handler_)
{
}
read_at_op(read_at_op&& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
buffer_(other.buffer_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
std::size_t bytes_transferred, int start = 0)
{
std::size_t n = 0;
switch (start_ = start)
{
case 1:
n = this->check_for_completion(ec, total_transferred_);
for (;;)
{
device_.async_read_some_at(offset_ + total_transferred_,
asio::buffer(buffer_ + total_transferred_, n),
ASIO_MOVE_CAST(read_at_op)(*this));
return; default:
total_transferred_ += bytes_transferred;
if ((!ec && bytes_transferred == 0)
|| (n = this->check_for_completion(ec, total_transferred_)) == 0
|| total_transferred_ == asio::buffer_size(buffer_))
break;
}
handler_(ec, static_cast<const std::size_t&>(total_transferred_));
}
}
//private:
AsyncRandomAccessReadDevice& device_;
uint64_t offset_;
asio::mutable_buffer buffer_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
template <typename AsyncRandomAccessReadDevice, typename Elem,
typename CompletionCondition, typename ReadHandler>
class read_at_op<AsyncRandomAccessReadDevice, boost::array<Elem, 2>,
CompletionCondition, ReadHandler>
: detail::base_from_completion_cond<CompletionCondition>
{
public:
read_at_op(AsyncRandomAccessReadDevice& device,
uint64_t offset, const boost::array<Elem, 2>& buffers,
CompletionCondition completion_condition, ReadHandler& handler)
: detail::base_from_completion_cond<
CompletionCondition>(completion_condition),
device_(device),
offset_(offset),
buffers_(buffers),
start_(0),
total_transferred_(0),
handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
{
}
#if defined(ASIO_HAS_MOVE)
read_at_op(const read_at_op& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
buffers_(other.buffers_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(other.handler_)
{
}
read_at_op(read_at_op&& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
buffers_(other.buffers_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
std::size_t bytes_transferred, int start = 0)
{
typename asio::detail::dependent_type<Elem,
boost::array<asio::mutable_buffer, 2> >::type bufs = {{
asio::mutable_buffer(buffers_[0]),
asio::mutable_buffer(buffers_[1]) }};
std::size_t buffer_size0 = asio::buffer_size(bufs[0]);
std::size_t buffer_size1 = asio::buffer_size(bufs[1]);
std::size_t n = 0;
switch (start_ = start)
{
case 1:
n = this->check_for_completion(ec, total_transferred_);
for (;;)
{
bufs[0] = asio::buffer(bufs[0] + total_transferred_, n);
bufs[1] = asio::buffer(
bufs[1] + (total_transferred_ < buffer_size0
? 0 : total_transferred_ - buffer_size0),
n - asio::buffer_size(bufs[0]));
device_.async_read_some_at(offset_ + total_transferred_,
bufs, ASIO_MOVE_CAST(read_at_op)(*this));
return; default:
total_transferred_ += bytes_transferred;
if ((!ec && bytes_transferred == 0)
|| (n = this->check_for_completion(ec, total_transferred_)) == 0
|| total_transferred_ == buffer_size0 + buffer_size1)
break;
}
handler_(ec, static_cast<const std::size_t&>(total_transferred_));
}
}
//private:
AsyncRandomAccessReadDevice& device_;
uint64_t offset_;
boost::array<Elem, 2> buffers_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
#if defined(ASIO_HAS_STD_ARRAY)
template <typename AsyncRandomAccessReadDevice, typename Elem,
typename CompletionCondition, typename ReadHandler>
class read_at_op<AsyncRandomAccessReadDevice, std::array<Elem, 2>,
CompletionCondition, ReadHandler>
: detail::base_from_completion_cond<CompletionCondition>
{
public:
read_at_op(AsyncRandomAccessReadDevice& device,
uint64_t offset, const std::array<Elem, 2>& buffers,
CompletionCondition completion_condition, ReadHandler& handler)
: detail::base_from_completion_cond<
CompletionCondition>(completion_condition),
device_(device),
offset_(offset),
buffers_(buffers),
start_(0),
total_transferred_(0),
handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
{
}
#if defined(ASIO_HAS_MOVE)
read_at_op(const read_at_op& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
buffers_(other.buffers_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(other.handler_)
{
}
read_at_op(read_at_op&& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
buffers_(other.buffers_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
std::size_t bytes_transferred, int start = 0)
{
typename asio::detail::dependent_type<Elem,
std::array<asio::mutable_buffer, 2> >::type bufs = {{
asio::mutable_buffer(buffers_[0]),
asio::mutable_buffer(buffers_[1]) }};
std::size_t buffer_size0 = asio::buffer_size(bufs[0]);
std::size_t buffer_size1 = asio::buffer_size(bufs[1]);
std::size_t n = 0;
switch (start_ = start)
{
case 1:
n = this->check_for_completion(ec, total_transferred_);
for (;;)
{
bufs[0] = asio::buffer(bufs[0] + total_transferred_, n);
bufs[1] = asio::buffer(
bufs[1] + (total_transferred_ < buffer_size0
? 0 : total_transferred_ - buffer_size0),
n - asio::buffer_size(bufs[0]));
device_.async_read_some_at(offset_ + total_transferred_,
bufs, ASIO_MOVE_CAST(read_at_op)(*this));
return; default:
total_transferred_ += bytes_transferred;
if ((!ec && bytes_transferred == 0)
|| (n = this->check_for_completion(ec, total_transferred_)) == 0
|| total_transferred_ == buffer_size0 + buffer_size1)
break;
}
handler_(ec, static_cast<const std::size_t&>(total_transferred_));
}
}
//private:
AsyncRandomAccessReadDevice& device_;
uint64_t offset_;
std::array<Elem, 2> buffers_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
#endif // defined(ASIO_HAS_STD_ARRAY)
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
typename ReadHandler>
inline void* asio_handler_allocate(std::size_t size,
read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
CompletionCondition, ReadHandler>* this_handler)
{
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
}
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
typename ReadHandler>
inline void asio_handler_deallocate(void* pointer, std::size_t size,
read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
CompletionCondition, ReadHandler>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
}
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
typename ReadHandler>
inline bool asio_handler_is_continuation(
read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
CompletionCondition, ReadHandler>* this_handler)
{
return this_handler->start_ == 0 ? true
: asio_handler_cont_helpers::is_continuation(
this_handler->handler_);
}
template <typename Function, typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
typename ReadHandler>
inline void asio_handler_invoke(Function& function,
read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
CompletionCondition, ReadHandler>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename Function, typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
typename ReadHandler>
inline void asio_handler_invoke(const Function& function,
read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
CompletionCondition, ReadHandler>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename AsyncRandomAccessReadDevice,
typename MutableBufferSequence, typename CompletionCondition,
typename ReadHandler>
inline read_at_op<AsyncRandomAccessReadDevice,
MutableBufferSequence, CompletionCondition, ReadHandler>
make_read_at_op(AsyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, ReadHandler handler)
{
return read_at_op<AsyncRandomAccessReadDevice,
MutableBufferSequence, CompletionCondition, ReadHandler>(
d, offset, buffers, completion_condition, handler);
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition, typename ReadHandler, typename Allocator>
struct associated_allocator<
detail::read_at_op<AsyncRandomAccessReadDevice,
MutableBufferSequence, CompletionCondition, ReadHandler>,
Allocator>
{
typedef typename associated_allocator<ReadHandler, Allocator>::type type;
static type get(
const detail::read_at_op<AsyncRandomAccessReadDevice,
MutableBufferSequence, CompletionCondition, ReadHandler>& h,
const Allocator& a = Allocator()) ASIO_NOEXCEPT
{
return associated_allocator<ReadHandler, Allocator>::get(h.handler_, a);
}
};
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition, typename ReadHandler, typename Executor>
struct associated_executor<
detail::read_at_op<AsyncRandomAccessReadDevice,
MutableBufferSequence, CompletionCondition, ReadHandler>,
Executor>
{
typedef typename associated_executor<ReadHandler, Executor>::type type;
static type get(
const detail::read_at_op<AsyncRandomAccessReadDevice,
MutableBufferSequence, CompletionCondition, ReadHandler>& h,
const Executor& ex = Executor()) ASIO_NOEXCEPT
{
return associated_executor<ReadHandler, Executor>::get(h.handler_, ex);
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
typename CompletionCondition, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t))
async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
async_completion<ReadHandler,
void (asio::error_code, std::size_t)> init(handler);
detail::read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
CompletionCondition, ASIO_HANDLER_TYPE(ReadHandler,
void (asio::error_code, std::size_t))>(
d, offset, buffers, completion_condition, init.handler)(
asio::error_code(), 0, 1);
return init.result.get();
}
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t))
async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, const MutableBufferSequence& buffers,
ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
async_completion<ReadHandler,
void (asio::error_code, std::size_t)> init(handler);
detail::read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
detail::transfer_all_t, ASIO_HANDLER_TYPE(ReadHandler,
void (asio::error_code, std::size_t))>(
d, offset, buffers, transfer_all(), init.handler)(
asio::error_code(), 0, 1);
return init.result.get();
}
#if !defined(ASIO_NO_IOSTREAM)
namespace detail
{
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler>
class read_at_streambuf_op
: detail::base_from_completion_cond<CompletionCondition>
{
public:
read_at_streambuf_op(AsyncRandomAccessReadDevice& device,
uint64_t offset, basic_streambuf<Allocator>& streambuf,
CompletionCondition completion_condition, ReadHandler& handler)
: detail::base_from_completion_cond<
CompletionCondition>(completion_condition),
device_(device),
offset_(offset),
streambuf_(streambuf),
start_(0),
total_transferred_(0),
handler_(ASIO_MOVE_CAST(ReadHandler)(handler))
{
}
#if defined(ASIO_HAS_MOVE)
read_at_streambuf_op(const read_at_streambuf_op& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
streambuf_(other.streambuf_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(other.handler_)
{
}
read_at_streambuf_op(read_at_streambuf_op&& other)
: detail::base_from_completion_cond<CompletionCondition>(other),
device_(other.device_),
offset_(other.offset_),
streambuf_(other.streambuf_),
start_(other.start_),
total_transferred_(other.total_transferred_),
handler_(ASIO_MOVE_CAST(ReadHandler)(other.handler_))
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator()(const asio::error_code& ec,
std::size_t bytes_transferred, int start = 0)
{
std::size_t max_size, bytes_available;
switch (start_ = start)
{
case 1:
max_size = this->check_for_completion(ec, total_transferred_);
bytes_available = read_size_helper(streambuf_, max_size);
for (;;)
{
device_.async_read_some_at(offset_ + total_transferred_,
streambuf_.prepare(bytes_available),
ASIO_MOVE_CAST(read_at_streambuf_op)(*this));
return; default:
total_transferred_ += bytes_transferred;
streambuf_.commit(bytes_transferred);
max_size = this->check_for_completion(ec, total_transferred_);
bytes_available = read_size_helper(streambuf_, max_size);
if ((!ec && bytes_transferred == 0) || bytes_available == 0)
break;
}
handler_(ec, static_cast<const std::size_t&>(total_transferred_));
}
}
//private:
AsyncRandomAccessReadDevice& device_;
uint64_t offset_;
asio::basic_streambuf<Allocator>& streambuf_;
int start_;
std::size_t total_transferred_;
ReadHandler handler_;
};
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler>
inline void* asio_handler_allocate(std::size_t size,
read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
CompletionCondition, ReadHandler>* this_handler)
{
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
}
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler>
inline void asio_handler_deallocate(void* pointer, std::size_t size,
read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
CompletionCondition, ReadHandler>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
}
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler>
inline bool asio_handler_is_continuation(
read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
CompletionCondition, ReadHandler>* this_handler)
{
return this_handler->start_ == 0 ? true
: asio_handler_cont_helpers::is_continuation(
this_handler->handler_);
}
template <typename Function, typename AsyncRandomAccessReadDevice,
typename Allocator, typename CompletionCondition, typename ReadHandler>
inline void asio_handler_invoke(Function& function,
read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
CompletionCondition, ReadHandler>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename Function, typename AsyncRandomAccessReadDevice,
typename Allocator, typename CompletionCondition, typename ReadHandler>
inline void asio_handler_invoke(const Function& function,
read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
CompletionCondition, ReadHandler>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
} // namespace detail
#if !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler, typename Allocator1>
struct associated_allocator<
detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
Allocator, CompletionCondition, ReadHandler>,
Allocator1>
{
typedef typename associated_allocator<ReadHandler, Allocator1>::type type;
static type get(
const detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
Allocator, CompletionCondition, ReadHandler>& h,
const Allocator1& a = Allocator1()) ASIO_NOEXCEPT
{
return associated_allocator<ReadHandler, Allocator1>::get(h.handler_, a);
}
};
template <typename AsyncRandomAccessReadDevice, typename Executor,
typename CompletionCondition, typename ReadHandler, typename Executor1>
struct associated_executor<
detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
Executor, CompletionCondition, ReadHandler>,
Executor1>
{
typedef typename associated_executor<ReadHandler, Executor1>::type type;
static type get(
const detail::read_at_streambuf_op<AsyncRandomAccessReadDevice,
Executor, CompletionCondition, ReadHandler>& h,
const Executor1& ex = Executor1()) ASIO_NOEXCEPT
{
return associated_executor<ReadHandler, Executor1>::get(h.handler_, ex);
}
};
#endif // !defined(GENERATING_DOCUMENTATION)
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename CompletionCondition, typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t))
async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b,
CompletionCondition completion_condition,
ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
async_completion<ReadHandler,
void (asio::error_code, std::size_t)> init(handler);
detail::read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
CompletionCondition, ASIO_HANDLER_TYPE(ReadHandler,
void (asio::error_code, std::size_t))>(
d, offset, b, completion_condition, init.handler)(
asio::error_code(), 0, 1);
return init.result.get();
}
template <typename AsyncRandomAccessReadDevice, typename Allocator,
typename ReadHandler>
inline ASIO_INITFN_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t))
async_read_at(AsyncRandomAccessReadDevice& d,
uint64_t offset, asio::basic_streambuf<Allocator>& b,
ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
async_completion<ReadHandler,
void (asio::error_code, std::size_t)> init(handler);
detail::read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
detail::transfer_all_t, ASIO_HANDLER_TYPE(ReadHandler,
void (asio::error_code, std::size_t))>(
d, offset, b, transfer_all(), init.handler)(
asio::error_code(), 0, 1);
return init.result.get();
}
#endif // !defined(ASIO_NO_IOSTREAM)
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_IMPL_READ_AT_HPP
| {'content_hash': 'f7bce592680e44f4b5c9399991a0c360', 'timestamp': '', 'source': 'github', 'line_count': 852, 'max_line_length': 79, 'avg_line_length': 35.62676056338028, 'alnum_prop': 0.6793173881531265, 'repo_name': 'letitvi/VideoGridPlayer', 'id': '634f03552d02006d5b773c1678f42a1c89626a65', 'size': '31503', 'binary': False, 'copies': '7', 'ref': 'refs/heads/master', 'path': 'thirdparty/source/asio-1.11.0/include/asio/impl/read_at.hpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '1189'}, {'name': 'C++', 'bytes': '26483'}, {'name': 'Objective-C', 'bytes': '13'}]} |
@interface UIColor (BM)
+(UIColor *)BMLightGrey;
@end
| {'content_hash': 'e2adf32a936af3b65a4a637d6ebd42f9', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 24, 'avg_line_length': 11.2, 'alnum_prop': 0.6964285714285714, 'repo_name': 'gemanwu/beautiful-minds-ios', 'id': 'dfe0d147dcd74234850fa109f661c300f91887dc', 'size': '214', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'BeautifulMinds/Categories/UIColor+BM.h', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '93903'}, {'name': 'Ruby', 'bytes': '554'}]} |
<!DOCTYPE html>
<html>
<head>
<title>CHEM 370 | Week 6</title>
<link rel="stylesheet" type="text/css" href="remark-dark.css">
<link rel="stylesheet" type="text/css" href="mermaid.css">
<div w3-include-html="slide-types.htm"></div>
<div w3-include-html="common-text.htm"></div>
</head>
<body>
<textarea id="source">
layout: true
---
<div style="margin-top: 100px;"></div>
<img src="https://upload.wikimedia.org/wikipedia/commons/f/f5/Light_dispersion_conceptual_waves.gif" style = "height:350px; margin-left: auto; margin-right: auto; display: block;">
<h5 style = "text-align: left; font-weight: bold; margin-left: 110px;">Spectroscopy | Harvey Ch 10</h5>
---
class: left
<div style="margin-top: 100px;"></div>
> **Spectroscopy:** The study of interactions between ***light*** and ***matter***.
<!--
class: left
<div style="margin-top: 150px;"></div>
## What is light? -->
---
class: center
<div style="margin-top: 100px;"></div>
<img src="img/week5_em_spectrum.png" style = "margin-left: auto; margin-right: auto; display: block;">
.image-credit[Adapted from work by [Philip Ronan, Gringer](https://commons.wikimedia.org/wiki/File:EM_spectrumrevised.png) / [CC BY-SA](https://creativecommons.org/licenses/by-sa/3.0)]
---
class: center
<div style="margin-top: 200px;"></div>
$$
A_t = A \sin(2\pi\nu t + \phi)
$$
---
class: center
<div style="margin-top: 100px;"></div>
$$
A_t = A \sin(2\pi\nu t + \phi)
$$
$$
\lambda = \frac{c}{\nu}
$$
$$
E = \frac{hc}{\lambda} = hc \bar{\nu}, \text{ }
h = 6.626 \times 10^{-34} \text{ J} \cdot \text{s}
$$
$$
\bar{\nu} = \lambda^{-1} \text{ (where } \lambda \text{ is in cm)}
$$
---
class: left
<div style="margin-top: 100px;"></div>
Others:
- Polarization
- Velocity (refractive index):
$$
n = \frac{c}{v}
$$
---
class: center
<div style="margin-top: 100px;"></div>
<img src="img/week5_abs-em.png" style = "margin-left: auto; margin-right: auto; display: block;">
.image-credit[David Harvey / [Analytical Chemistry 2.1](https://chem.libretexts.org/Bookshelves/Analytical_Chemistry/Book%3A_Analytical_Chemistry_2.1_%28Harvey%29) / [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/3.0/at/deed.en)]
<!-- =============================================================================== -->
</textarea>
<script src="/assets/js/include-html.js" type="text/javascript"></script>
<script src="remark.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.0.0/mermaid.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured" type="text/javascript"></script>
<script src="https://kit.fontawesome.com/efbc54fa3b.js"></script>
<script type="text/javascript">
var slideshow = remark.create(
{
navigation: {scroll: false, touch: true},
slideNumberFormat: '%current%',
highlightLanguage: 'r',
highlightStyle: 'atom-one-light',
});
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ['\\(','\\)'] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
} });
MathJax.Hub.Configured();
mermaid.initialize({
startOnLoad: false,
cloneCssStyles: false,
theme: null
});
function initMermaid(s) {
var diagrams = document.querySelectorAll('.mermaid');
var i;
for(i=0;i<diagrams.length;i++){
if(diagrams[i].offsetWidth>0){
mermaid.init(undefined, diagrams[i]);
}
}
}
slideshow.on('afterShowSlide', initMermaid);
initMermaid(slideshow.getSlides()[slideshow.getCurrentSlideIndex()])
</script>
</body>
</html>
| {'content_hash': '035a99aef43e6dcbfd7d0672026814cf', 'timestamp': '', 'source': 'github', 'line_count': 144, 'max_line_length': 240, 'avg_line_length': 27.270833333333332, 'alnum_prop': 0.5933282403870639, 'repo_name': 'alphonse/alphonse.github.io', 'id': 'a10bc2a6fd64d475680b722c6575c531d8a25bf2', 'size': '3927', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'chem370/lectures/Week-06-Video-Slides.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '8750'}, {'name': 'C++', 'bytes': '211'}, {'name': 'CSS', 'bytes': '506324'}, {'name': 'HTML', 'bytes': '5800975'}, {'name': 'JavaScript', 'bytes': '548637'}, {'name': 'Jupyter Notebook', 'bytes': '7164370'}, {'name': 'TeX', 'bytes': '222574'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
<sec:global-method-security secured-annotations="enabled" mode="aspectj" />
<!--
<bean id="aspectJSecurityInterceptor"
class="org.springframework.security.access.intercept.aspectj.AspectJMethodSecurityInterceptor">
<property name="authenticationManager" ref="authenticationManager" />
<property name="accessDecisionManager" ref="accessDecisionManager" />
<property name="securityMetadataSource">
<bean
class="org.springframework.security.access.annotation.SecuredAnnotationSecurityMetadataSource" />
</property>
</bean>
<bean id="authenticationManager"
class="org.springframework.security.authentication.ProviderManager">
<property name="providers">
<bean
class="org.springframework.security.authentication.TestingAuthenticationProvider" />
</property>
</bean>
<bean id="accessDecisionManager"
class="org.springframework.security.access.vote.AffirmativeBased">
<property name="decisionVoters">
<list>
<bean
class="org.springframework.security.access.vote.RoleVoter" />
</list>
</property>
</bean>
<bean
class="org.springframework.security.access.intercept.aspectj.aspect.AnnotationSecurityAspect"
factory-method="aspectOf">
<property name="securityInterceptor" ref="aspectJSecurityInterceptor" />
</bean>
-->
<bean class="sample.aspectj.Service" />
<bean class="sample.aspectj.SecuredService" />
</beans>
| {'content_hash': '86e3f93060f9238846f65d8987741574', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 139, 'avg_line_length': 43.25, 'alnum_prop': 0.6782273603082851, 'repo_name': 'vitorgv/spring-security', 'id': '6aa5a29db9910d16eb63e51fdc94093a9d8b0585', 'size': '2076', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'samples/aspectj-xml/src/main/resources/aspectj-context.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AGS Script', 'bytes': '29590'}, {'name': 'AspectJ', 'bytes': '2756'}, {'name': 'CSS', 'bytes': '1373'}, {'name': 'Groovy', 'bytes': '706188'}, {'name': 'Java', 'bytes': '5238856'}, {'name': 'Python', 'bytes': '129'}, {'name': 'Ruby', 'bytes': '1312'}, {'name': 'Shell', 'bytes': '234'}, {'name': 'XSLT', 'bytes': '5723'}]} |
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef _ACCONFIG_H
#define _ACCONFIG_H
/******************************************************************************
*
* Configuration options
*
*****************************************************************************/
/*
* ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the
* ACPI subsystem. This includes the DEBUG_PRINT output
* statements. When disabled, all DEBUG_PRINT
* statements are compiled out.
*
* ACPI_APPLICATION - Use this switch if the subsystem is going to be run
* at the application level.
*
*/
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20070126
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
* but there is a large base of ASL/AML code in existing machines that check
* for the string below. The use of this string usually guarantees that
* the ASL will execute down the most tested code path. Also, there is some
* code that will not execute the _OSI method unless _OS matches the string
* below. Therefore, change this string at your own risk.
*/
#define ACPI_OS_NAME "Microsoft Windows NT"
/* Maximum objects in the various object caches */
#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */
#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */
/*
* Should the subsystem abort the loading of an ACPI table if the
* table checksum is incorrect?
*/
#define ACPI_CHECKSUM_ABORT FALSE
/******************************************************************************
*
* Subsystem Constants
*
*****************************************************************************/
/* Version of ACPI supported */
#define ACPI_CA_SUPPORT_LEVEL 3
/* Maximum count for a semaphore object */
#define ACPI_MAX_SEMAPHORE_COUNT 256
/* Maximum object reference count (detects object deletion issues) */
#define ACPI_MAX_REFERENCE_COUNT 0x1000
/* Size of cached memory mapping for system memory operation region */
#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096
/* owner_id tracking. 8 entries allows for 255 owner_ids */
#define ACPI_NUM_OWNERID_MASKS 8
/* Size of the root table array is increased by this increment */
#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4
/******************************************************************************
*
* ACPI Specification constants (Do not change unless the specification changes)
*
*****************************************************************************/
/* Number of distinct GPE register blocks and register width */
#define ACPI_MAX_GPE_BLOCKS 2
#define ACPI_GPE_REGISTER_WIDTH 8
/* Method info (in WALK_STATE), containing local variables and argumetns */
#define ACPI_METHOD_NUM_LOCALS 8
#define ACPI_METHOD_MAX_LOCAL 7
#define ACPI_METHOD_NUM_ARGS 7
#define ACPI_METHOD_MAX_ARG 6
/* Length of _HID, _UID, _CID, and UUID values */
#define ACPI_DEVICE_ID_LENGTH 0x09
#define ACPI_MAX_CID_LENGTH 48
#define ACPI_UUID_LENGTH 16
/*
* Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
*/
#define ACPI_OBJ_NUM_OPERANDS 8
#define ACPI_OBJ_MAX_OPERAND 7
/* Names within the namespace are 4 bytes long */
#define ACPI_NAME_SIZE 4
#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
#define ACPI_PATH_SEPARATOR '.'
/* Sizes for ACPI table headers */
#define ACPI_OEM_ID_SIZE 6
#define ACPI_OEM_TABLE_ID_SIZE 8
/* Constants used in searching for the RSDP in low memory */
#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */
#define ACPI_EBDA_PTR_LENGTH 2
#define ACPI_EBDA_WINDOW_SIZE 1024
#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */
#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000
#define ACPI_RSDP_SCAN_STEP 16
/* Operation regions */
#define ACPI_NUM_PREDEFINED_REGIONS 8
#define ACPI_USER_REGION_BEGIN 0x80
/* Maximum space_ids for Operation Regions */
#define ACPI_MAX_ADDRESS_SPACE 255
/* Array sizes. Used for range checking also */
#define ACPI_MAX_MATCH_OPCODE 5
/* RSDP checksums */
#define ACPI_RSDP_CHECKSUM_LENGTH 20
#define ACPI_RSDP_XCHECKSUM_LENGTH 36
/* SMBus bidirectional buffer size */
#define ACPI_SMBUS_BUFFER_SIZE 34
/******************************************************************************
*
* ACPI AML Debugger
*
*****************************************************************************/
#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
#endif /* _ACCONFIG_H */
| {'content_hash': 'd2974824b1157de10d47be336721f690', 'timestamp': '', 'source': 'github', 'line_count': 206, 'max_line_length': 87, 'avg_line_length': 35.68446601941748, 'alnum_prop': 0.6120255747517345, 'repo_name': 'impedimentToProgress/UCI-BlueChip', 'id': '422f29c06c77d10e17a10c434300fda383502768', 'size': '7351', 'binary': False, 'copies': '167', 'ref': 'refs/heads/master', 'path': 'snapgear_linux/linux-2.6.21.1/include/acpi/acconfig.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'AGS Script', 'bytes': '25338'}, {'name': 'ASP', 'bytes': '4526'}, {'name': 'Ada', 'bytes': '1075367'}, {'name': 'Assembly', 'bytes': '2137017'}, {'name': 'Awk', 'bytes': '133306'}, {'name': 'Bison', 'bytes': '399484'}, {'name': 'BlitzBasic', 'bytes': '101509'}, {'name': 'C', 'bytes': '288543995'}, {'name': 'C++', 'bytes': '7495614'}, {'name': 'CSS', 'bytes': '2128'}, {'name': 'Clojure', 'bytes': '3747'}, {'name': 'Common Lisp', 'bytes': '239683'}, {'name': 'Elixir', 'bytes': '790'}, {'name': 'Emacs Lisp', 'bytes': '45827'}, {'name': 'Erlang', 'bytes': '171340'}, {'name': 'GAP', 'bytes': '3002'}, {'name': 'Groff', 'bytes': '4517911'}, {'name': 'Groovy', 'bytes': '26513'}, {'name': 'HTML', 'bytes': '8141161'}, {'name': 'Java', 'bytes': '481441'}, {'name': 'JavaScript', 'bytes': '339345'}, {'name': 'Logos', 'bytes': '16160'}, {'name': 'M', 'bytes': '2443'}, {'name': 'Makefile', 'bytes': '1309237'}, {'name': 'Max', 'bytes': '3812'}, {'name': 'Nemerle', 'bytes': '966202'}, {'name': 'Objective-C', 'bytes': '376270'}, {'name': 'OpenEdge ABL', 'bytes': '69290'}, {'name': 'PHP', 'bytes': '11533'}, {'name': 'PLSQL', 'bytes': '8464'}, {'name': 'Pascal', 'bytes': '54420'}, {'name': 'Perl', 'bytes': '6498220'}, {'name': 'Perl6', 'bytes': '4155'}, {'name': 'Prolog', 'bytes': '62574'}, {'name': 'Python', 'bytes': '24287'}, {'name': 'QMake', 'bytes': '8619'}, {'name': 'R', 'bytes': '25999'}, {'name': 'Ruby', 'bytes': '31311'}, {'name': 'SAS', 'bytes': '15573'}, {'name': 'Scala', 'bytes': '1506'}, {'name': 'Scilab', 'bytes': '23534'}, {'name': 'Shell', 'bytes': '6951414'}, {'name': 'Smalltalk', 'bytes': '2661'}, {'name': 'Stata', 'bytes': '7930'}, {'name': 'Tcl', 'bytes': '1518344'}, {'name': 'TeX', 'bytes': '1574651'}, {'name': 'UnrealScript', 'bytes': '20822'}, {'name': 'VHDL', 'bytes': '37384578'}, {'name': 'Verilog', 'bytes': '376626'}, {'name': 'Visual Basic', 'bytes': '180'}, {'name': 'XS', 'bytes': '24500'}, {'name': 'XSLT', 'bytes': '5872'}]} |
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Documento
*
* @ORM\Table(name="documento", indexes={@ORM\Index(name="TIPO_DOCUMENTO_IDX", columns={"tipo_documento_id"}), @ORM\Index(name="DOCUMENTO_USUARIO_IDX", columns={"usuario_id"})})
* @ORM\Entity
*/
class Documento
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=100, nullable=false)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="path", type="string", length=250, nullable=false)
*/
private $path;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="date", nullable=false)
*/
private $createdAt;
/**
* @var string
*
* @ORM\Column(name="description", type="string", length=250, nullable=true)
*/
private $description;
/**
* @var \AppBundle\Entity\TipoDocumento
*
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\TipoDocumento")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="tipo_documento_id", referencedColumnName="id")
* })
*/
private $tipoDocumento;
/**
* @var \AppBundle\Entity\Usuario
*
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Usuario")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="usuario_id", referencedColumnName="id")
* })
*/
private $usuario;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
*
* @return Documento
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set path
*
* @param string $path
*
* @return Documento
*/
public function setPath($path)
{
$this->path = $path;
return $this;
}
/**
* Get path
*
* @return string
*/
public function getPath()
{
return $this->path;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return Documento
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set description
*
* @param string $description
*
* @return Documento
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set tipoDocumento
*
* @param \AppBundle\Entity\TipoDocumento $tipoDocumento
*
* @return Documento
*/
public function setTipoDocumento(\AppBundle\Entity\TipoDocumento $tipoDocumento = null)
{
$this->tipoDocumento = $tipoDocumento;
return $this;
}
/**
* Get tipoDocumento
*
* @return \AppBundle\Entity\TipoDocumento
*/
public function getTipoDocumento()
{
return $this->tipoDocumento;
}
/**
* Set usuario
*
* @param \AppBundle\Entity\Usuario $usuario
*
* @return Documento
*/
public function setUsuario(\AppBundle\Entity\Usuario $usuario = null)
{
$this->usuario = $usuario;
return $this;
}
/**
* Get usuario
*
* @return \AppBundle\Entity\Usuario
*/
public function getUsuario()
{
return $this->usuario;
}
}
| {'content_hash': 'b5c587eddbb9eb1a976f0c80d4012238', 'timestamp': '', 'source': 'github', 'line_count': 227, 'max_line_length': 177, 'avg_line_length': 17.889867841409693, 'alnum_prop': 0.5249938438808175, 'repo_name': 'iruasev/mapunto', 'id': '1ded1026acf1f7dc32dea2162ecd4731dedb4542', 'size': '4061', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/AppBundle/Entity/Documento.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '4956'}, {'name': 'PHP', 'bytes': '116191'}]} |
FROM balenalib/odroid-c1-ubuntu:cosmic-run
# remove several traces of debian python
RUN apt-get purge -y python.*
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# install python dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
&& rm -rf /var/lib/apt/lists/*
# key 63C7CC90: public key "Simon McVittie <[email protected]>" imported
# key 3372DCFA: public key "Donald Stufft (dstufft) <[email protected]>" imported
RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
&& gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
&& gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
ENV PYTHON_VERSION 3.7.9
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.0.1
ENV SETUPTOOLS_VERSION 56.0.0
RUN set -x \
&& buildDeps=' \
curl \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" \
&& echo "41d30a89ec9efa76be08d7485d82df0a1d0a4d7ff496cea3dd3a7bcb68d840bc Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" | sha256sum -c - \
&& tar -xzf "Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" --strip-components=1 \
&& rm -rf "Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" \
&& ldconfig \
&& if [ ! -e /usr/local/bin/pip3 ]; then : \
&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \
&& echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \
&& python3 get-pip.py \
&& rm get-pip.py \
; fi \
&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python ~/.cache
# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -sf pip3 pip \
&& { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
&& ln -sf idle3 idle \
&& ln -sf pydoc3 pydoc \
&& ln -sf python3 python \
&& ln -sf python3-config python-config
# set PYTHONPATH to point to dist-packages
ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \
&& echo "Running test-stack@python" \
&& chmod +x [email protected] \
&& bash [email protected] \
&& rm -rf [email protected]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu cosmic \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.7.9, Pip v21.0.1, Setuptools v56.0.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {'content_hash': '4d315cf80defc50a98b2a75d79f210ae', 'timestamp': '', 'source': 'github', 'line_count': 78, 'max_line_length': 708, 'avg_line_length': 51.88461538461539, 'alnum_prop': 0.7079318013343218, 'repo_name': 'nghiant2710/base-images', 'id': '3aecdc165af89eca08872eaab01df87424f841bf', 'size': '4068', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'balena-base-images/python/odroid-c1/ubuntu/cosmic/3.7.9/run/Dockerfile', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '144558581'}, {'name': 'JavaScript', 'bytes': '16316'}, {'name': 'Shell', 'bytes': '368690'}]} |
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type MoveAbility = string;
| {'content_hash': '9d8608e51c6214c8a7b5562ea978bcc8', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 33, 'avg_line_length': 20.8, 'alnum_prop': 0.6826923076923077, 'repo_name': 'aptos-labs/aptos-core', 'id': '311c5db9003a8d5a6a94b6eff4ddd96c46753e5e', 'size': '104', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'ecosystem/typescript/sdk/src/generated/models/MoveAbility.ts', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Boogie', 'bytes': '62'}, {'name': 'CSS', 'bytes': '31355'}, {'name': 'Dockerfile', 'bytes': '10300'}, {'name': 'Go', 'bytes': '1308'}, {'name': 'HCL', 'bytes': '190756'}, {'name': 'HTML', 'bytes': '2168'}, {'name': 'JavaScript', 'bytes': '48386'}, {'name': 'Makefile', 'bytes': '2632'}, {'name': 'Move', 'bytes': '1354163'}, {'name': 'Mustache', 'bytes': '21042'}, {'name': 'PLpgSQL', 'bytes': '1145'}, {'name': 'PowerShell', 'bytes': '842'}, {'name': 'Python', 'bytes': '240445'}, {'name': 'Rust', 'bytes': '10592521'}, {'name': 'Shell', 'bytes': '69203'}, {'name': 'Smarty', 'bytes': '1224'}, {'name': 'TypeScript', 'bytes': '513895'}]} |
/* @flow */
import type RequestManager from '../util/request-manager.js';
import type {ConfigRegistries} from './index.js';
import {YARN_REGISTRY} from '../constants.js';
import NpmRegistry from './npm-registry.js';
import stringify from '../lockfile/stringify.js';
import parse from '../lockfile/parse.js';
import * as fs from '../util/fs.js';
const userHome = require('user-home');
const defaults = require('defaults');
const path = require('path');
const pkg: { version: string } = require('../../package.json');
export const DEFAULTS = {
'version-tag-prefix': 'v',
'version-git-tag': true,
'version-git-sign': false,
'version-git-message': 'v%s',
'init-version': '1.0.0',
'init-license': 'MIT',
'save-prefix': '^',
'ignore-scripts': false,
'ignore-optional': false,
registry: YARN_REGISTRY,
'strict-ssl': true,
'user-agent': [
`yarn/${pkg.version}`,
'npm/?',
`node/${process.version}`,
process.platform,
process.arch,
].join(' '),
};
const npmMap = {
'version-git-sign': 'sign-git-tag',
'version-tag-prefix': 'tag-version-prefix',
'version-git-tag': 'git-tag-version',
'version-git-message': 'message',
};
export default class YarnRegistry extends NpmRegistry {
constructor(cwd: string, registries: ConfigRegistries, requestManager: RequestManager) {
super(cwd, registries, requestManager);
this.homeConfigLoc = path.join(userHome, '.yarnrc');
this.homeConfig = {};
}
static filename = 'yarn.json';
homeConfigLoc: string;
homeConfig: Object;
getOption(key: string): mixed {
let val = this.config[key];
// if this isn't set in a yarn config, then use npm
if (typeof val === 'undefined') {
val = this.registries.npm.getOption(npmMap[key]);
}
if (typeof val === 'undefined') {
val = this.registries.npm.getOption(key);
}
// if this isn't set in a yarn config or npm config, then use the default (or undefined)
if (typeof val === 'undefined') {
val = DEFAULTS[key];
}
return val;
}
async loadConfig(): Promise<void> {
for (const [isHome, loc, file] of await this.getPossibleConfigLocations('.yarnrc')) {
const config = parse(file);
if (isHome) {
this.homeConfig = config;
}
// normalize offline mirror path relative to the current yarnrc
const offlineLoc = config['yarn-offline-mirror'];
// don't normalize if we already have a mirror path
if (!this.config['yarn-offline-mirror'] && offlineLoc) {
const mirrorLoc = config['yarn-offline-mirror'] = path.resolve(path.dirname(loc), offlineLoc);
await fs.mkdirp(mirrorLoc);
}
defaults(this.config, config);
}
// default yarn config
defaults(this.config, DEFAULTS);
}
async saveHomeConfig(config: Object): Promise<void> {
for (const key in config) {
const val = config[key];
// if the current config key was taken from home config then update
// the global config
if (this.homeConfig[key] === this.config[key]) {
this.config[key] = val;
}
// update just the home config
this.homeConfig[key] = config[key];
}
await fs.writeFilePreservingEol(this.homeConfigLoc, `${stringify(this.homeConfig)}\n`);
}
}
| {'content_hash': '46f20bdee8631773aed08e5f8b2719c0', 'timestamp': '', 'source': 'github', 'line_count': 119, 'max_line_length': 102, 'avg_line_length': 27.49579831932773, 'alnum_prop': 0.6390586797066015, 'repo_name': 'suitupalex/yarn', 'id': '09fcaa4e0fe92c0580fecc3f76db9b9ca9265f81', 'size': '3272', 'binary': False, 'copies': '7', 'ref': 'refs/heads/master', 'path': 'src/registries/yarn-registry.js', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Batchfile', 'bytes': '289'}, {'name': 'JavaScript', 'bytes': '577408'}, {'name': 'PowerShell', 'bytes': '2598'}, {'name': 'Shell', 'bytes': '14963'}]} |
Access it [here](hisabimbola.github.io)
| {'content_hash': '0d2e073844a05c8cf7a5c8e2943ec120', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 39, 'avg_line_length': 40.0, 'alnum_prop': 0.775, 'repo_name': 'hisabimbola/hisabimbola.github.io', 'id': '9672c5fd6e3caf19acd02b8d939681bdcaddc962', 'size': '56', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '15260'}, {'name': 'HTML', 'bytes': '7174'}]} |
package com.bazaarvoice.emodb.sor.core;
import com.bazaarvoice.emodb.common.api.impl.LimitCounter;
import com.bazaarvoice.emodb.common.dropwizard.lifecycle.LifeCycleRegistry;
import com.bazaarvoice.emodb.common.json.deferred.LazyJsonMap;
import com.bazaarvoice.emodb.common.uuid.TimeUUIDs;
import com.bazaarvoice.emodb.common.zookeeper.store.MapStore;
import com.bazaarvoice.emodb.sor.api.Audit;
import com.bazaarvoice.emodb.sor.api.AuditBuilder;
import com.bazaarvoice.emodb.sor.api.AuditsUnavailableException;
import com.bazaarvoice.emodb.sor.api.Change;
import com.bazaarvoice.emodb.sor.api.CompactionControlSource;
import com.bazaarvoice.emodb.sor.api.Coordinate;
import com.bazaarvoice.emodb.sor.api.DataStore;
import com.bazaarvoice.emodb.sor.api.DefaultTable;
import com.bazaarvoice.emodb.sor.api.FacadeOptions;
import com.bazaarvoice.emodb.sor.api.History;
import com.bazaarvoice.emodb.sor.api.Intrinsic;
import com.bazaarvoice.emodb.sor.api.Names;
import com.bazaarvoice.emodb.sor.api.ReadConsistency;
import com.bazaarvoice.emodb.sor.api.StashNotAvailableException;
import com.bazaarvoice.emodb.sor.api.StashRunTimeInfo;
import com.bazaarvoice.emodb.sor.api.StashTimeKey;
import com.bazaarvoice.emodb.sor.api.TableOptions;
import com.bazaarvoice.emodb.sor.api.UnknownPlacementException;
import com.bazaarvoice.emodb.sor.api.UnknownTableException;
import com.bazaarvoice.emodb.sor.api.UnpublishedDatabusEvent;
import com.bazaarvoice.emodb.sor.api.UnpublishedDatabusEventType;
import com.bazaarvoice.emodb.sor.api.Update;
import com.bazaarvoice.emodb.sor.api.WriteConsistency;
import com.bazaarvoice.emodb.sor.audit.AuditWriter;
import com.bazaarvoice.emodb.sor.compactioncontrol.LocalCompactionControl;
import com.bazaarvoice.emodb.sor.condition.Condition;
import com.bazaarvoice.emodb.sor.condition.Conditions;
import com.bazaarvoice.emodb.sor.db.DataReaderDAO;
import com.bazaarvoice.emodb.sor.db.DataWriterDAO;
import com.bazaarvoice.emodb.sor.db.Key;
import com.bazaarvoice.emodb.sor.db.MultiTableScanOptions;
import com.bazaarvoice.emodb.sor.db.MultiTableScanResult;
import com.bazaarvoice.emodb.sor.db.Record;
import com.bazaarvoice.emodb.sor.db.RecordUpdate;
import com.bazaarvoice.emodb.sor.db.ScanRange;
import com.bazaarvoice.emodb.sor.db.ScanRangeSplits;
import com.bazaarvoice.emodb.sor.delta.Delta;
import com.bazaarvoice.emodb.sor.log.SlowQueryLog;
import com.bazaarvoice.emodb.table.db.DroppedTableException;
import com.bazaarvoice.emodb.table.db.StashBlackListTableCondition;
import com.bazaarvoice.emodb.table.db.StashTableDAO;
import com.bazaarvoice.emodb.table.db.Table;
import com.bazaarvoice.emodb.table.db.TableBackingStore;
import com.bazaarvoice.emodb.table.db.TableDAO;
import com.bazaarvoice.emodb.table.db.TableSet;
import com.bazaarvoice.emodb.table.db.stash.StashTokenRange;
import com.codahale.metrics.Counter;
import com.codahale.metrics.Meter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.base.Throwables;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.hash.Hashing;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.google.inject.Inject;
import io.dropwizard.lifecycle.ExecutorServiceManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.net.URI;
import java.time.Clock;
import java.time.Duration;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
public class DefaultDataStore implements DataStore, DataProvider, DataTools, TableBackingStore {
private static final int NUM_COMPACTION_THREADS = 2;
private static final int MAX_COMPACTION_QUEUE_LENGTH = 100;
private final Logger _log = LoggerFactory.getLogger(DefaultDataStore.class);
private final DatabusEventWriterRegistry _eventWriterRegistry;
private final TableDAO _tableDao;
private final DataReaderDAO _dataReaderDao;
private final DataWriterDAO _dataWriterDao;
private final SlowQueryLog _slowQueryLog;
private final ExecutorService _compactionExecutor;
private final HistoryStore _historyStore;
private final Optional<URI> _stashRootDirectory;
private final Condition _stashBlackListTableCondition;
private final Timer _resolveAnnotatedEventTimer;
private final AuditWriter _auditWriter;
@VisibleForTesting
protected final Counter _archiveDeltaSize;
private final Meter _discardedCompactions;
private final Compactor _compactor;
private final CompactionControlSource _compactionControlSource;
private final MapStore<DataStoreMinSplitSize> _minSplitSizeMap;
private final Clock _clock;
private StashTableDAO _stashTableDao;
@Inject
public DefaultDataStore(LifeCycleRegistry lifeCycle, MetricRegistry metricRegistry, DatabusEventWriterRegistry eventWriterRegistry, TableDAO tableDao,
DataReaderDAO dataReaderDao, DataWriterDAO dataWriterDao, SlowQueryLog slowQueryLog, HistoryStore historyStore,
@StashRoot Optional<URI> stashRootDirectory, @LocalCompactionControl CompactionControlSource compactionControlSource,
@StashBlackListTableCondition Condition stashBlackListTableCondition, AuditWriter auditWriter,
@MinSplitSizeMap MapStore<DataStoreMinSplitSize> minSplitSizeMap, Clock clock) {
this(eventWriterRegistry, tableDao, dataReaderDao, dataWriterDao, slowQueryLog, defaultCompactionExecutor(lifeCycle),
historyStore, stashRootDirectory, compactionControlSource, stashBlackListTableCondition, auditWriter,
minSplitSizeMap, metricRegistry, clock);
}
@VisibleForTesting
public DefaultDataStore(DatabusEventWriterRegistry eventWriterRegistry,TableDAO tableDao,
DataReaderDAO dataReaderDao, DataWriterDAO dataWriterDao,
SlowQueryLog slowQueryLog, ExecutorService compactionExecutor, HistoryStore historyStore,
Optional<URI> stashRootDirectory, CompactionControlSource compactionControlSource,
Condition stashBlackListTableCondition, AuditWriter auditWriter,
MapStore<DataStoreMinSplitSize> minSplitSizeMap, MetricRegistry metricRegistry, Clock clock) {
_eventWriterRegistry = requireNonNull(eventWriterRegistry, "eventWriterRegistry");
_tableDao = requireNonNull(tableDao, "tableDao");
_dataReaderDao = requireNonNull(dataReaderDao, "dataReaderDao");
_dataWriterDao = requireNonNull(dataWriterDao, "dataWriterDao");
_slowQueryLog = requireNonNull(slowQueryLog, "slowQueryLog");
_compactionExecutor = requireNonNull(compactionExecutor, "compactionExecutor");
_historyStore = requireNonNull(historyStore, "historyStore");
_stashRootDirectory = requireNonNull(stashRootDirectory, "stashRootDirectory");
_stashBlackListTableCondition = requireNonNull(stashBlackListTableCondition, "stashBlackListTableCondition");
_auditWriter = requireNonNull(auditWriter, "auditWriter");
_resolveAnnotatedEventTimer = metricRegistry.timer(getMetricName("resolve_event"));
_archiveDeltaSize = metricRegistry.counter(MetricRegistry.name("bv.emodb.sor", "DefaultCompactor", "archivedDeltaSize"));
_discardedCompactions = metricRegistry.meter(MetricRegistry.name("bv.emodb.sor", "DefaultDataStore", "discarded_compactions"));
_compactor = new DistributedCompactor(_archiveDeltaSize, _historyStore.isDeltaHistoryEnabled(), metricRegistry);
_compactionControlSource = requireNonNull(compactionControlSource, "compactionControlSource");
_minSplitSizeMap = requireNonNull(minSplitSizeMap, "minSplitSizeMap");
_clock = requireNonNull(clock, "clock");
}
/**
* Optional binding, required only if running in stash mode.
*/
@Inject (optional = true)
public void setStashDAO(StashTableDAO stashTableDao) {
_stashTableDao = stashTableDao;
}
private static ExecutorService defaultCompactionExecutor(LifeCycleRegistry lifeCycle) {
String nameFormat = "DataStore Compaction-%d";
ExecutorService executor = new ThreadPoolExecutor(
NUM_COMPACTION_THREADS, NUM_COMPACTION_THREADS,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(MAX_COMPACTION_QUEUE_LENGTH),
new ThreadFactoryBuilder().setNameFormat(nameFormat).build(),
new ThreadPoolExecutor.AbortPolicy());
lifeCycle.manage(new ExecutorServiceManager(executor, io.dropwizard.util.Duration.seconds(5), nameFormat));
return executor;
}
@Override
public Iterator<com.bazaarvoice.emodb.sor.api.Table> listTables(@Nullable String fromTableExclusive, long limit) {
checkArgument(limit > 0, "Limit must be >0");
LimitCounter remaining = new LimitCounter(limit);
final Iterator<Table> tableIter = _tableDao.list(fromTableExclusive, remaining);
return remaining.limit(new AbstractIterator<com.bazaarvoice.emodb.sor.api.Table>() {
@Override
protected com.bazaarvoice.emodb.sor.api.Table computeNext() {
while (tableIter.hasNext()) {
Table table = tableIter.next();
if (!table.isInternal()) {
return toDefaultTable(table);
}
}
return endOfData();
}
});
}
@Override
public Iterator<UnpublishedDatabusEvent> listUnpublishedDatabusEvents(Date fromInclusive, Date toExclusive) {
return _tableDao.listUnpublishedDatabusEvents(fromInclusive, toExclusive);
}
private DefaultTable toDefaultTable(Table table) {
return new DefaultTable(table.getName(), table.getOptions(), table.getAttributes(), table.getAvailability());
}
@Override
public void createTable(String table, TableOptions options, Map<String, ?> template, Audit audit) {
checkLegalTableName(table);
requireNonNull(options, "options");
checkLegalTableAttributes(template);
requireNonNull(audit, "audit");
_tableDao.create(table, options, template, audit);
}
@Override
public void dropTable(String table, Audit audit) {
checkLegalTableName(table);
requireNonNull(audit, "audit");
_tableDao.drop(table, audit);
}
@Override
public void purgeTableUnsafe(String tableName, Audit audit) {
checkLegalTableName(tableName);
requireNonNull(audit, "audit");
Table table = _tableDao.get(tableName);
_tableDao.writeUnpublishedDatabusEvent(tableName, UnpublishedDatabusEventType.PURGE);
_tableDao.audit(tableName, "purge", audit);
_dataWriterDao.purgeUnsafe(table);
}
@Override
public boolean getTableExists(String table) {
checkLegalTableName(table);
return _tableDao.exists(table);
}
@Override
public boolean isTableAvailable(String table) {
checkLegalTableName(table);
return _tableDao.get(table).getAvailability() != null;
}
@Override
public com.bazaarvoice.emodb.sor.api.Table getTableMetadata(String table) {
checkLegalTableName(table);
return toDefaultTable(_tableDao.get(table));
}
@Override
public Table getTable(String table) {
return _tableDao.get(table);
}
@Override
public Map<String, Object> getTableTemplate(String table) {
checkLegalTableName(table);
return _tableDao.get(table).getAttributes();
}
@Override
public void setTableTemplate(String table, Map<String, ?> template, Audit audit)
throws UnknownTableException {
checkLegalTableName(table);
checkLegalTableAttributes(template);
requireNonNull(audit, "audit");
_tableDao.setAttributes(table, template, audit);
}
@Override
public TableOptions getTableOptions(String table) {
checkLegalTableName(table);
return _tableDao.get(table).getOptions();
}
@Override
public long getTableApproximateSize(String tableName) {
checkLegalTableName(tableName);
Table table = _tableDao.get(tableName);
return _dataReaderDao.count(table, ReadConsistency.WEAK);
}
@Override
public long getTableApproximateSize(String tableName, int limit) {
checkLegalTableName(tableName);
requireNonNull(limit);
checkArgument(limit > 0, "limit must be greater than 0");
Table table = _tableDao.get(tableName);
return _dataReaderDao.count(table, limit, ReadConsistency.WEAK);
}
@Override
public Map<String, Object> get(String table, String key) {
return get(table, key, ReadConsistency.STRONG);
}
@Override
public Map<String, Object> get(String tableName, String key, ReadConsistency consistency) {
checkLegalTableName(tableName);
requireNonNull(key, "key");
requireNonNull(consistency, "consistency");
Table table = _tableDao.get(tableName);
// Query from the database
Record record = _dataReaderDao.read(new Key(table, key), consistency);
// Resolve the deltas into a single object
Resolved resolved = resolve(record, consistency);
// Convert to the final JSON format including intrinsic fields
return toContent(resolved, consistency);
}
@Override
public AnnotatedGet prepareGetAnnotated(final ReadConsistency consistency) {
requireNonNull(consistency, "consistency");
return new AnnotatedGet() {
private final List<Key> _keys = Lists.newArrayList();
@Override
public AnnotatedGet add(String tableName, String key)
throws UnknownTableException, UnknownPlacementException {
checkLegalTableName(tableName);
requireNonNull(key, "key");
// The following call will throw UnknownTableException if the table doesn't currently exist. This
// happens if the table was dropped prior to this call.
Table table = _tableDao.get(tableName);
// It's also possible that the table exists but is not available locally. This happens if the table
// once had a locally available facade but the facade was since dropped. Check if this is the case and,
// if so, raise UnknownPlacementException.
if (table.getAvailability() == null) {
throw new UnknownPlacementException("Table unavailable locally and has no local facade",
table.getOptions().getPlacement(), tableName);
}
_keys.add(new Key(table, key));
return this;
}
@Override
public Iterator<AnnotatedContent> execute() {
if (_keys.isEmpty()) {
return Collections.emptyIterator();
}
// Limit memory usage using an iterator such that only one row's change list is in memory at a time.
Iterator<Record> recordIterator = _dataReaderDao.readAll(_keys, consistency);
return Iterators.transform(recordIterator, new Function<Record, AnnotatedContent>() {
@Override
public AnnotatedContent apply(Record record) {
Timer.Context timerCtx = _resolveAnnotatedEventTimer.time();
AnnotatedContent result = resolveAnnotated(record, consistency);
timerCtx.stop();
return result;
}
});
}
};
}
/**
* Resolve a set of changes read from the {@link DataWriterDAO} into a single JSON literal object + metadata.
* If the record can be compacted an asynchronous compaction will be scheduled unless
* scheduleCompactionIfPresent is false.
*/
private Resolved resolve(Record record, ReadConsistency consistency, boolean scheduleCompactionIfPresent) {
Table table = record.getKey().getTable();
String key = record.getKey().getKey();
// Resolve the timeline into a flattened object
Expanded expanded = expand(record, false, consistency);
// Log records with too many uncompacted deltas as a potential performance problem.
_slowQueryLog.log(table.getName(), key, expanded);
// Are there deltas in this record that we no longer need? If so, schedule an asynchronous compaction.
if (scheduleCompactionIfPresent && expanded.getPendingCompaction() != null) {
compactAsync(table, key, expanded.getPendingCompaction());
}
return expanded.getResolved();
}
/**
* Convenience call to {@link #resolve(Record, ReadConsistency, boolean)} which always schedules asynchronous
* compaction is applicable.
*/
private Resolved resolve(Record record, ReadConsistency consistency) {
return resolve(record, consistency, true);
}
private Expanded expand(final Record record, boolean ignoreRecent, final ReadConsistency consistency) {
long fullConsistencyTimeStamp = _dataWriterDao.getFullConsistencyTimestamp(record.getKey().getTable());
long rawConsistencyTimeStamp = _dataWriterDao.getRawConsistencyTimestamp(record.getKey().getTable());
Map<StashTimeKey, StashRunTimeInfo> stashTimeInfoMap = _compactionControlSource.getStashTimesForPlacement(record.getKey().getTable().getAvailability().getPlacement());
// we will consider the earliest timestamp found as our compactionControlTimestamp.
// we are also filtering out any expired timestamps. (CompactionControlMonitor should do this for us, but for now it's running every hour. So, just to fill that gap, we are filtering here.)
// If no timestamps are found, then taking minimum value because we want all the deltas after the compactionControlTimestamp to be deleted as per the compaction rules as usual.
long compactionControlTimestamp = stashTimeInfoMap.isEmpty() ?
Long.MIN_VALUE : stashTimeInfoMap.values().stream().filter(s -> s.getExpiredTimestamp() > System.currentTimeMillis()).map(StashRunTimeInfo::getTimestamp).min(Long::compareTo).orElse(Long.MIN_VALUE);
return expand(record, fullConsistencyTimeStamp, rawConsistencyTimeStamp, compactionControlTimestamp, ignoreRecent, consistency);
}
private Expanded expand(final Record record, long fullConsistencyTimestamp, long rawConsistencyTimestamp, long compactionControlTimestamp, boolean ignoreRecent, final ReadConsistency consistency) {
MutableIntrinsics intrinsics = MutableIntrinsics.create(record.getKey());
return _compactor.expand(record, fullConsistencyTimestamp, rawConsistencyTimestamp, compactionControlTimestamp, intrinsics, ignoreRecent, new Supplier<Record>() {
@Override
public Record get() {
return _dataReaderDao.read(record.getKey(), consistency);
}
});
}
/**
* Resolve a set of changes, returning an interface that includes info about specific change IDs.
*/
private AnnotatedContent resolveAnnotated(Record record, final ReadConsistency consistency) {
final Resolved resolved = resolve(record, consistency);
final Table table = record.getKey().getTable();
return new AnnotatedContent() {
@Override
public Map<String, Object> getContent() {
return toContent(resolved, consistency);
}
@Override
public boolean isChangeDeltaPending(UUID changeId) {
long fullConsistencyTimestamp = _dataWriterDao.getFullConsistencyTimestamp(table);
return resolved.isChangeDeltaPending(changeId, fullConsistencyTimestamp);
}
@Override
public boolean isChangeDeltaRedundant(UUID changeId) {
return resolved.isChangeDeltaRedundant(changeId);
}
};
}
@VisibleForTesting
public Map<String, Object> toContent(Resolved resolved, ReadConsistency consistency) {
Map<String, Object> result;
if (!resolved.isUndefined()) {
Object content = resolved.getContent();
if (content instanceof LazyJsonMap) {
// If the content is a lazy map it's more efficient to create a copy.
result = ((LazyJsonMap) content).lazyCopy();
} else {
result = Maps.newLinkedHashMap();
if (content instanceof Map) {
for (Map.Entry<?, ?> entry : ((Map<?, ?>) content).entrySet()) {
result.put(entry.getKey().toString(), entry.getValue());
}
}
}
} else {
result = Maps.newLinkedHashMap();
}
MutableIntrinsics intrinsics = resolved.getIntrinsics();
result.putAll(intrinsics.getTemplate());
result.put(Intrinsic.ID, requireNonNull(intrinsics.getId()));
result.put(Intrinsic.TABLE, requireNonNull(intrinsics.getTable()));
if (consistency != ReadConsistency.WEAK) {
// Version #s are consistent within a data center when reads are performed using LOCAL_QUORUM. this
// means (a) you can't compare version #s from different data centers (unless you read w/EACH_QUORUM,
// which we don't) and (b) version #s can't be trusted with anything weaker than LOCAL_QUORUM.
result.put(Intrinsic.VERSION, intrinsics.getVersion());
}
result.put(Intrinsic.SIGNATURE, requireNonNull(intrinsics.getSignature()));
result.put(Intrinsic.DELETED, resolved.isUndefined());
// Note that Dates are formatted as strings not Date objects so the result is standard JSON
String firstUpdateAt = intrinsics.getFirstUpdateAt();
if (firstUpdateAt != null) {
result.put(Intrinsic.FIRST_UPDATE_AT, firstUpdateAt);
}
String lastUpdateAt = intrinsics.getLastUpdateAt();
if (lastUpdateAt != null) {
result.put(Intrinsic.LAST_UPDATE_AT, lastUpdateAt);
}
String lastMutateAt = intrinsics.getLastMutateAt();
if (lastMutateAt != null) {
result.put(Intrinsic.LAST_MUTATE_AT, lastMutateAt);
}
return result;
}
@Override
public Iterator<Change> getTimeline(String tableName, String key, boolean includeContentData, boolean includeAuditInformation,
@Nullable UUID start, @Nullable UUID end, boolean reversed, long limit, ReadConsistency consistency) {
checkLegalTableName(tableName);
requireNonNull(key, "key");
if (includeAuditInformation) {
throw new AuditsUnavailableException();
}
if (start != null && end != null) {
if (reversed) {
checkArgument(TimeUUIDs.compare(start, end) >= 0, "Start must be >=End for reversed ranges");
} else {
checkArgument(TimeUUIDs.compare(start, end) <= 0, "Start must be <=End");
}
}
checkArgument(limit > 0, "Limit must be >0");
requireNonNull(consistency, "consistency");
Table table = _tableDao.get(tableName);
// Query the database. Return the raw timeline. Don't perform compaction--it modifies the timeline which
// could make getTimeline() less useful for debugging.
return _dataReaderDao.readTimeline(new Key(table, key), includeContentData, start, end, reversed, limit, consistency);
}
@Override
public Iterator<Map<String, Object>> scan(String tableName, @Nullable String fromKeyExclusive,
long limit, boolean includeDeletes, ReadConsistency consistency) {
checkLegalTableName(tableName);
checkArgument(limit > 0, "Limit must be >0");
requireNonNull(consistency, "consistency");
LimitCounter remaining = new LimitCounter(limit);
return remaining.limit(scan(tableName, fromKeyExclusive, remaining, includeDeletes, consistency));
}
// Internal API used by table DAOs that supports a LimitCounter instead of a long limit.
@Override
public Iterator<Map<String, Object>> scan(String tableName, @Nullable String fromKeyExclusive,
LimitCounter limit, ReadConsistency consistency) {
return scan(tableName, fromKeyExclusive, limit, false, consistency);
}
private Iterator<Map<String, Object>> scan(String tableName, @Nullable String fromKeyExclusive,
LimitCounter limit, boolean includeDeletes, ReadConsistency consistency) {
checkLegalTableName(tableName);
checkArgument(limit.remaining() > 0, "Limit must be >0");
requireNonNull(consistency, "consistency");
Table table = _tableDao.get(tableName);
Iterator<Record> records = _dataReaderDao.scan(table, fromKeyExclusive, limit, consistency);
return resolveScanResults(records, consistency, includeDeletes);
}
@Override
public Collection<String> getSplits(String tableName, int desiredRecordsPerSplit) {
checkLegalTableName(tableName);
checkArgument(desiredRecordsPerSplit > 0, "DesiredRecordsPerSplit must be >0");
// Check if Emo is allowed to request splits from Cassandra of this size. If a previous user has recently timed
// out trying to splits close to this size, query for larger splits according the splitSizeMap's directive.
DataStoreMinSplitSize minSplitSize = _minSplitSizeMap.get(tableName);
int localResplits = 0;
int actualSplitSize = desiredRecordsPerSplit;
if (minSplitSize != null && minSplitSize.getExpirationTime().isAfter(_clock.instant())) {
while (actualSplitSize < Math.max(desiredRecordsPerSplit, minSplitSize.getMinSplitSize())
&& actualSplitSize < 100000000) {
actualSplitSize *= 2;
localResplits++;
}
}
Table table = _tableDao.get(tableName);
try {
return _dataReaderDao.getSplits(table, actualSplitSize, localResplits);
} catch (TimeoutException timeoutException) {
try {
_minSplitSizeMap.set(tableName,
new DataStoreMinSplitSize(actualSplitSize * 8, _clock.instant().plus(1, ChronoUnit.DAYS)));
} catch (Exception e) {
_log.warn("Unable to store min split size for table {}", tableName);
}
throw Throwables.propagate(timeoutException);
}
}
@Override
public Iterator<Map<String, Object>> getSplit(String tableName, String split,
@Nullable String fromKeyExclusive,
long limit, boolean includeDeletes, ReadConsistency consistency) {
checkLegalTableName(tableName);
requireNonNull(split, "split");
checkArgument(limit > 0, "Limit must be >0");
requireNonNull(consistency, "consistency");
Table table = _tableDao.get(tableName);
LimitCounter remaining = new LimitCounter(limit);
Iterator<Record> records = _dataReaderDao.getSplit(table, split, fromKeyExclusive, remaining, consistency);
return remaining.limit(resolveScanResults(records, consistency, includeDeletes));
}
@Override
public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates) {
return multiGet(coordinates, ReadConsistency.STRONG);
}
@Override
public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates, ReadConsistency consistency) {
requireNonNull(coordinates, "coordinates");
requireNonNull(consistency, "consistency");
AnnotatedGet multiGet = prepareGetAnnotated(consistency);
for (Coordinate coordinate : coordinates) {
multiGet.add(coordinate.getTable(), coordinate.getId());
}
return Iterators.transform(multiGet.execute(), new Function<AnnotatedContent, Map<String, Object>>() {
@Override
public Map<String, Object> apply(AnnotatedContent input) {
return input.getContent();
}
});
}
private Iterator<Map<String, Object>> resolveScanResults(final Iterator<Record> records,
final ReadConsistency consistency,
final boolean includeDeletes) {
return new AbstractIterator<Map<String, Object>>() {
@Override
protected Map<String, Object> computeNext() {
while (records.hasNext()) {
Record record = records.next();
// Collapse the deltas into a Resolved object.
Resolved resolved = resolve(record, consistency);
// Skip deleted objects, if not desired
if (!includeDeletes && !resolved.matches(Conditions.isDefined())) {
continue;
}
// Convert to the final JSON format including intrinsic fields
return toContent(resolved, consistency);
}
return endOfData();
}
};
}
@Override
public void update(String table, String key, UUID changeId, Delta delta, Audit audit) {
update(table, key, changeId, delta, audit, WriteConsistency.STRONG);
}
@Override
public void update(String table, String key, UUID changeId, Delta delta, Audit audit, WriteConsistency consistency) {
updateAll(Collections.singletonList(new Update(table, key, changeId, delta, audit, consistency)));
}
@Override
public void updateAll(Iterable<Update> updates) {
updateAll(updates, false, ImmutableSet.of());
}
@Override
public void updateAll(Iterable<Update> updates, Set<String> tags) {
updateAll(updates, false, tags);
}
private void updateAll(Iterable<Update> updates, final boolean isFacade,
@NotNull final Set<String> tags) {
requireNonNull(updates, "updates");
checkLegalTags(tags);
requireNonNull(tags, "tags");
Iterator<Update> updatesIter = updates.iterator();
if (!updatesIter.hasNext()) {
return;
}
_dataWriterDao.updateAll(Iterators.transform(updatesIter, new Function<Update, RecordUpdate>() {
@Override
public RecordUpdate apply(Update update) {
requireNonNull(update, "update");
String tableName = update.getTable();
String key = update.getKey();
UUID changeId = update.getChangeId();
Delta delta = update.getDelta();
Audit audit = update.getAudit();
// Strip intrinsics and "~tags". Verify the Delta results in a top-level object.
delta = SanitizeDeltaVisitor.sanitize(delta);
Table table = _tableDao.get(tableName);
if (isFacade && !table.isFacade()) {
// Someone is trying to update a facade, but is inadvertently going to update the primary table in this dc
throw new SecurityException("Access denied. Update intended for a facade, but the table would be updated.");
}
if (table.isFacade() && !isFacade) {
throw new SecurityException("Access denied. Unauthorized attempt to update a facade.");
}
// We'll likely fail to resolve write conflicts if deltas are written into the far past after
// compaction may have occurred.
if (TimeUUIDs.getTimeMillis(changeId) <= _dataWriterDao.getFullConsistencyTimestamp(table)) {
throw new IllegalArgumentException(
"The 'changeId' UUID is from too far in the past: " + TimeUUIDs.getDate(changeId));
}
return new RecordUpdate(table, key, changeId, delta, audit, tags, update.getConsistency());
}
}), new DataWriterDAO.UpdateListener() {
@Override
public void beforeWrite(Collection<RecordUpdate> updateBatch) {
// Tell the databus we're about to write.
// Algorithm note: It is worth mentioning here how we make sure our data bus listeners do not lose updates.
// 1. We always write to databus *before* writing to SoR. If we fail to write to databus, then we also fail
// to update SoR.
// 2. Databus event UpdateRef has the coordinate (table/row-id) and the change-Id (time uuid) of the update
// 3. When the event is polled, the poller makes sure that the change Id for a given event is present in the fetched record,
// or the change id is before the full consistency timestamp. If not, it will skip the event and get to it later.
// Notes:
// If the update fails to get written to SoR, its just a phantom event on the databus, and listeners will see a duplicate.
// If the update isn't replicated to another datacenter SoR, but the databus event is, then poller will just wait for replication to finish
// before polling the event.
List<UpdateRef> updateRefs = Lists.newArrayListWithCapacity(updateBatch.size());
for (RecordUpdate update : updateBatch) {
if (!update.getTable().isInternal()) {
updateRefs.add(new UpdateRef(update.getTable().getName(), update.getKey(), update.getChangeId(), tags));
}
}
if (!updateRefs.isEmpty()) {
_eventWriterRegistry.getDatabusWriter().writeEvents(updateRefs);
}
}
public void afterWrite(Collection<RecordUpdate> updateBatch) {
// Write the audit to the audit store after we know the delta has written sucessfully.
// Using this model for writing audits, there should never be any audit written for a delta that
// didn't end in Cassandra. However, it is absolutely possible for audits to be missing if Emo
// terminates unexpectedly without a graceful shutdown to drain all audit that haven't been flushed yet.
// Add the hash of the delta to the audit log to make it easy to tell when the same delta is written multiple times
// Update the audit to include the tags associated with the update
updateBatch.forEach(update -> {
Audit augmentedAudit = AuditBuilder.from(update.getAudit())
.set(Audit.SHA1, Hashing.sha1().hashUnencodedChars(update.getDelta().toString()).toString())
.set(Audit.TAGS, tags)
.build();
_auditWriter.persist(update.getTable().getName(), update.getKey(), augmentedAudit, TimeUUIDs.getTimeMillis(update.getChangeId()));
});
}
});
}
/**
* Facade related methods
**/
@Override
public void createFacade(String table, FacadeOptions facadeOptions, Audit audit) {
checkLegalTableName(table);
requireNonNull(facadeOptions, "facadeDefinition");
requireNonNull(audit, "audit");
_tableDao.createFacade(table, facadeOptions, audit);
}
@Override
public void updateAllForFacade(Iterable<Update> updates) {
updateAll(updates, true, ImmutableSet.of());
}
@Override
public void updateAllForFacade(Iterable<Update> updates, Set<String> tags) {
updateAll(updates, true, tags);
}
@Override
public void dropFacade(String table, String placement, Audit audit)
throws UnknownTableException {
checkLegalTableName(table);
requireNonNull(placement, "placement");
requireNonNull(audit, "audit");
_tableDao.dropFacade(table, placement, audit);
}
@Override
public void compact(String tableName, String key, @Nullable Duration ttlOverride, ReadConsistency readConsistency, WriteConsistency writeConsistency) {
checkLegalTableName(tableName);
requireNonNull(key, "key");
requireNonNull(readConsistency, "readConsistency");
requireNonNull(writeConsistency, "writeConsistency");
Table table = _tableDao.get(tableName);
// Query from the database
Record record = _dataReaderDao.read(new Key(table, key), readConsistency);
// Resolve the timeline into a flattened object
Expanded expanded;
if (ttlOverride != null) {
// The caller can override DataWriterDAO.getFullConsistencyTimestamp() for debugging. Use with caution!
long overriddenfullConsistencyTimestamp = System.currentTimeMillis() - ttlOverride.toMillis();
expanded = expand(record, overriddenfullConsistencyTimestamp, overriddenfullConsistencyTimestamp, Long.MIN_VALUE, true,
readConsistency);
} else {
expanded = expand(record, true, readConsistency);
}
// Write the results of compaction back to Cassandra
if (expanded.getPendingCompaction() != null) {
doCompact(table, key, expanded.getPendingCompaction(), writeConsistency);
}
}
@Override
public Collection<String> getTablePlacements() {
return getTablePlacements(true, false);
}
@Override
public Collection<String> getTablePlacements(boolean includeInternal, boolean localOnly) {
return _tableDao.getTablePlacements(includeInternal, localOnly);
}
private void compactAsync(final Table table, final String key, final PendingCompaction pendingCompaction) {
try {
_compactionExecutor.submit(new Runnable() {
@Override
public void run() {
// We should always write this with strong consistency
doCompact(table, key, pendingCompaction, WriteConsistency.STRONG);
}
});
} catch (RejectedExecutionException ex) {
_discardedCompactions.mark();
decrementDeltaSizes(pendingCompaction);
}
}
private void doCompact(Table table, String key, PendingCompaction pendingCompaction, WriteConsistency consistency) {
// Make sure you capture deltaHistory before saving compaction to disk.
// Otherwise, we will lose the compacted away deltas.
List<History> deltaHistory = getDeltaHistory(table, key, pendingCompaction);
// Save the compaction result to disk
try {
_dataWriterDao.compact(table, key, pendingCompaction.getCompactionKey(), pendingCompaction.getCompaction(),
pendingCompaction.getChangeId(), pendingCompaction.getDelta(), pendingCompaction.getKeysToDelete(), deltaHistory, consistency);
} finally {
// Decrement delta sizes
decrementDeltaSizes(pendingCompaction);
}
}
private List<History> getDeltaHistory(Table table, String key, PendingCompaction pendingCompaction) {
// Check if delta history is disabled by setting the TTL to zero or deltaArchives are empty
if (Duration.ZERO.equals(_historyStore.getHistoryTtl()) || pendingCompaction.getDeltasToArchive().isEmpty()) {
return Lists.newArrayList();
}
MutableIntrinsics intrinsics = MutableIntrinsics.create(new Key(table, key));
Iterator<DataAudit> dataAudits = _compactor.getAuditedContent(pendingCompaction, intrinsics);
List<History> deltaHistory = Lists.newArrayList();
while (dataAudits.hasNext()) {
DataAudit dataAudit = dataAudits.next();
Resolved resolved = dataAudit.getResolved();
deltaHistory.add(new History(dataAudit.getChangeId(), toContent(resolved, ReadConsistency.STRONG),
dataAudit.getDelta()));
}
return deltaHistory;
}
@Override
public ScanRangeSplits getScanRangeSplits(String placement, int desiredRecordsPerSplit, Optional<ScanRange> subrange) {
requireNonNull(placement, "placement");
return _dataReaderDao.getScanRangeSplits(placement, desiredRecordsPerSplit, subrange);
}
@Override
public String getPlacementCluster(String placement) {
requireNonNull(placement, "placement");
return _dataReaderDao.getPlacementCluster(placement);
}
@Override
public Iterator<MultiTableScanResult> multiTableScan(MultiTableScanOptions query, TableSet tables, LimitCounter limit, ReadConsistency consistency, @Nullable Instant cutoffTime) {
requireNonNull(query, "query");
requireNonNull(tables, "tables");
requireNonNull(limit, "limit");
requireNonNull(consistency, "consistency");
return _dataReaderDao.multiTableScan(query, tables, limit, consistency, cutoffTime);
}
@Override
public Iterator<MultiTableScanResult> stashMultiTableScan(String stashId, String placement, ScanRange scanRange, LimitCounter limit,
ReadConsistency consistency, @Nullable Instant cutoffTime) {
requireNonNull(stashId, "stashId");
requireNonNull(placement, "placement");
requireNonNull(scanRange, "scanRange");
requireNonNull(limit, "limit");
requireNonNull(consistency, "consistency");
// Since the range may wrap from high to low end of the token range we need to unwrap it
List<ScanRange> unwrappedRanges = scanRange.unwrapped();
Iterator<StashTokenRange> stashTokenRanges = Iterators.concat(
Iterators.transform(
unwrappedRanges.iterator(),
unwrappedRange -> _stashTableDao.getStashTokenRangesFromSnapshot(stashId, placement, unwrappedRange.getFrom(), unwrappedRange.getTo())));
return Iterators.concat(
Iterators.transform(stashTokenRanges, stashTokenRange -> {
// Create a table set which always returns the table, since we know all records in this range come
// exclusively from this table.
TableSet tableSet = new TableSet() {
@Override
public Table getByUuid(long uuid)
throws UnknownTableException, DroppedTableException {
return stashTokenRange.getTable();
}
@Override
public void close()
throws IOException {
// No-op
}
};
MultiTableScanOptions tableQuery = new MultiTableScanOptions()
.setScanRange(ScanRange.create(stashTokenRange.getFrom(), stashTokenRange.getTo()))
.setPlacement(placement)
.setIncludeDeletedTables(false)
.setIncludeMirrorTables(false);
return multiTableScan(tableQuery, tableSet, limit, consistency, cutoffTime);
})
);
}
@Override
public Map<String, Object> toContent(MultiTableScanResult result, ReadConsistency consistency, boolean allowAsyncCompaction) {
return toContent(resolve(result.getRecord(), consistency, allowAsyncCompaction), consistency);
}
@Override
public TableSet createTableSet() {
return _tableDao.createTableSet();
}
private void checkLegalTableName(String tableName) {
checkValidTableOrAttributeName("Table", tableName);
}
private void checkLegalTableAttributes(Map<String, ?> template) {
requireNonNull(template, "template");
for (String attributeName : template.keySet()) {
checkArgument(Names.isLegalTableAttributeName(attributeName), "Table attribute names cannot start with '~'");
}
}
private void checkLegalTags(Set<String> tags) {
// We need to keep tags from exploding in size. So we will restrain it to only 3 tags,
// max 8 chars each
for (String tag : tags) {
checkArgument(tag.length() < 9,
format("Tag %s is of more than the allowed length of 8 characters.", tag));
}
checkArgument(tags.size() <= 3, "Maximum of 3 tags are allowed");
}
private void checkValidTableOrAttributeName(String tableOrAttribute, String name) {
checkArgument(Names.isLegalTableName(name),
format("%s name must be a lowercase ASCII string between 1 and 255 characters in length. " +
"Allowed punctuation characters are -.:@_ and the table name may not start with a single underscore character. " +
"An example of a valid table name would be 'review:testcustomer'.", tableOrAttribute));
}
@Override
public URI getStashRoot()
throws StashNotAvailableException {
if (!_stashRootDirectory.isPresent()) {
throw new StashNotAvailableException();
}
return _stashRootDirectory.get();
}
@Override
public void createStashTokenRangeSnapshot(String stashId, Set<String> placements) {
requireNonNull(stashId, "stashId");
requireNonNull(placements, "placements");
checkState(_stashTableDao != null, "Cannot create stash snapshot without a StashTableDAO implementation");
_stashTableDao.createStashTokenRangeSnapshot(stashId, placements, _stashBlackListTableCondition);
}
@Override
public void clearStashTokenRangeSnapshot(String stashId) {
requireNonNull(stashId, "stashId");
checkState(_stashTableDao != null, "Cannot clear stash snapshot without a StashTableDAO implementation");
_stashTableDao.clearStashTokenRangeSnapshot(stashId);
}
private void decrementDeltaSizes(PendingCompaction pendingCompaction) {
// How many delta archives are we holding in memory for this pending compaction?
for (Map.Entry<UUID, Delta> entry : pendingCompaction.getDeltasToArchive()) {
_archiveDeltaSize.dec(entry.getValue().size());
}
}
private String getMetricName(String name) {
return MetricRegistry.name("bv.emodb.sor", "DefaultDataStore", name);
}
}
| {'content_hash': '8d6d62d3fc7abbd8b39d905866fb332c', 'timestamp': '', 'source': 'github', 'line_count': 1028, 'max_line_length': 214, 'avg_line_length': 46.9863813229572, 'alnum_prop': 0.6657695333526562, 'repo_name': 'bazaarvoice/emodb', 'id': 'dadbdd3b4eee3dee7c50e78e1212ce872ca20a48', 'size': '48302', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'sor/src/main/java/com/bazaarvoice/emodb/sor/core/DefaultDataStore.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '1012'}, {'name': 'Java', 'bytes': '6388105'}, {'name': 'Shell', 'bytes': '12562'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>38.0</apiVersion>
<description>A Lightning Component Bundle</description>
<type>Component</type>
</AuraDefinitionBundle> | {'content_hash': '2fa8988b24a349610fffd9f37ec98b30', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 70, 'avg_line_length': 42.333333333333336, 'alnum_prop': 0.7362204724409449, 'repo_name': 'sankarmarappan/sfdx_dreamhouse', 'id': '6920a972fc064cd6b5d78865074abed7ebba46dc', 'size': '254', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'src/ui/main/default/aura/IQPictureUploader/IQPictureUploader.cmp-meta.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Apex', 'bytes': '4347'}, {'name': 'CSS', 'bytes': '4502'}, {'name': 'JavaScript', 'bytes': '10257'}]} |
<?xml version='1.0' encoding='utf-8'?><!--
============================================================================================
House of Commons - Canada
- - - - - - - - - - - - - - - - - - - - - - - - -
The data contained in this document is provided in a standard XML format. Once imported into a spreadsheet
or database tool of your choice, the data can be filtered and sorted to create customized reports.
Please refer to the instructions within the tool of your choice to find out how to import external data.
For information about the disclaimer of liability:
http://www2.parl.gc.ca/HouseChamberBusiness/ChamberDisclaimer.aspx?Language=E
============================================================================================
-->
<Vote schemaVersion="1.0">
<Context>
<Para>
<AmendmentText>
<Para />
</AmendmentText>
</Para>
</Context>
<Sponsor>Mr. Harris (St. John's East)</Sponsor>
<Decision>Negatived</Decision>
<RelatedBill number="C-10">
<Title>An Act to enact the Justice for Victims of Terrorism Act and to amend the State Immunity Act, the Criminal Code, the Controlled Drugs and Substances Act, the Corrections and Conditional Release Act, the Youth Criminal Justice Act, the Immigration and Refugee Protection Act and other Acts</Title>
</RelatedBill>
<Participant>
<Name>Ms. Nycole Turmel</Name>
<FirstName>Nycole</FirstName>
<LastName>Turmel</LastName>
<Constituency>Hull—Aylmer</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Malcolm Allen</Name>
<FirstName>Malcolm</FirstName>
<LastName>Allen</LastName>
<Constituency>Welland</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Pat Martin</Name>
<FirstName>Pat</FirstName>
<LastName>Martin</LastName>
<Constituency>Winnipeg Centre</Constituency>
<Province code="MB">Manitoba</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Peter Stoffer</Name>
<FirstName>Peter</FirstName>
<LastName>Stoffer</LastName>
<Constituency>Sackville—Eastern Shore</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Françoise Boivin</Name>
<FirstName>Françoise</FirstName>
<LastName>Boivin</LastName>
<Constituency>Gatineau</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Yvon Godin</Name>
<FirstName>Yvon</FirstName>
<LastName>Godin</LastName>
<Constituency>Acadie—Bathurst</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Olivia Chow</Name>
<FirstName>Olivia</FirstName>
<LastName>Chow</LastName>
<Constituency>Trinity—Spadina</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Paul Dewar</Name>
<FirstName>Paul</FirstName>
<LastName>Dewar</LastName>
<Constituency>Ottawa Centre</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jack Harris</Name>
<FirstName>Jack</FirstName>
<LastName>Harris</LastName>
<Constituency>St. John's East</Constituency>
<Province code="NL">Newfoundland and Labrador</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Joe Comartin</Name>
<FirstName>Joe</FirstName>
<LastName>Comartin</LastName>
<Constituency>Windsor—Tecumseh</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Libby Davies</Name>
<FirstName>Libby</FirstName>
<LastName>Davies</LastName>
<Constituency>Vancouver East</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Peggy Nash</Name>
<FirstName>Peggy</FirstName>
<LastName>Nash</LastName>
<Constituency>Parkdale—High Park</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Peter Julian</Name>
<FirstName>Peter</FirstName>
<LastName>Julian</LastName>
<Constituency>Burnaby—New Westminster</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Alexandre Boulerice</Name>
<FirstName>Alexandre</FirstName>
<LastName>Boulerice</LastName>
<Constituency>Rosemont—La Petite-Patrie</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Jean Crowder</Name>
<FirstName>Jean</FirstName>
<LastName>Crowder</LastName>
<Constituency>Nanaimo—Cowichan</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Charlie Angus</Name>
<FirstName>Charlie</FirstName>
<LastName>Angus</LastName>
<Constituency>Timmins—James Bay</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Linda Duncan</Name>
<FirstName>Linda</FirstName>
<LastName>Duncan</LastName>
<Constituency>Edmonton—Strathcona</Constituency>
<Province code="AB">Alberta</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Manon Perreault</Name>
<FirstName>Manon</FirstName>
<LastName>Perreault</LastName>
<Constituency>Montcalm</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Don Davies</Name>
<FirstName>Don</FirstName>
<LastName>Davies</LastName>
<Constituency>Vancouver Kingsway</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Paulina Ayala</Name>
<FirstName>Paulina</FirstName>
<LastName>Ayala</LastName>
<Constituency>Honoré-Mercier</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Hélène LeBlanc</Name>
<FirstName>Hélène</FirstName>
<LastName>LeBlanc</LastName>
<Constituency>LaSalle—Émard</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Robert Aubin</Name>
<FirstName>Robert</FirstName>
<LastName>Aubin</LastName>
<Constituency>Trois-Rivières</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Christine Moore</Name>
<FirstName>Christine</FirstName>
<LastName>Moore</LastName>
<Constituency>Abitibi—Témiscamingue</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Fin Donnelly</Name>
<FirstName>Fin</FirstName>
<LastName>Donnelly</LastName>
<Constituency>New Westminster—Coquitlam</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Hélène Laverdière</Name>
<FirstName>Hélène</FirstName>
<LastName>Laverdière</LastName>
<Constituency>Laurier—Sainte-Marie</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jasbir Sandhu</Name>
<FirstName>Jasbir</FirstName>
<LastName>Sandhu</LastName>
<Constituency>Surrey North</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Hoang Mai</Name>
<FirstName>Hoang</FirstName>
<LastName>Mai</LastName>
<Constituency>Brossard—La Prairie</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Alex Atamanenko</Name>
<FirstName>Alex</FirstName>
<LastName>Atamanenko</LastName>
<Constituency>British Columbia Southern Interior</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Chris Charlton</Name>
<FirstName>Chris</FirstName>
<LastName>Charlton</LastName>
<Constituency>Hamilton Mountain</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Megan Leslie</Name>
<FirstName>Megan</FirstName>
<LastName>Leslie</LastName>
<Constituency>Halifax</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Tyrone Benskin</Name>
<FirstName>Tyrone</FirstName>
<LastName>Benskin</LastName>
<Constituency>Jeanne-Le Ber</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. David Christopherson</Name>
<FirstName>David</FirstName>
<LastName>Christopherson</LastName>
<Constituency>Hamilton Centre</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Brian Masse</Name>
<FirstName>Brian</FirstName>
<LastName>Masse</LastName>
<Constituency>Windsor West</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Marie-Claude Morin</Name>
<FirstName>Marie-Claude</FirstName>
<LastName>Morin</LastName>
<Constituency>Saint-Hyacinthe—Bagot</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Irene Mathyssen</Name>
<FirstName>Irene</FirstName>
<LastName>Mathyssen</LastName>
<Constituency>London—Fanshawe</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Claude Patry</Name>
<FirstName>Claude</FirstName>
<LastName>Patry</LastName>
<Constituency>Jonquière—Alma</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Wayne Marston</Name>
<FirstName>Wayne</FirstName>
<LastName>Marston</LastName>
<Constituency>Hamilton East—Stoney Creek</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Denise Savoie</Name>
<FirstName>Denise</FirstName>
<LastName>Savoie</LastName>
<Constituency>Victoria</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Lysane Blanchette-Lamothe</Name>
<FirstName>Lysane</FirstName>
<LastName>Blanchette-Lamothe</LastName>
<Constituency>Pierrefonds—Dollard</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Tarik Brahmi</Name>
<FirstName>Tarik</FirstName>
<LastName>Brahmi</LastName>
<Constituency>Saint-Jean</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Andrew Cash</Name>
<FirstName>Andrew</FirstName>
<LastName>Cash</LastName>
<Constituency>Davenport</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Sylvain Chicoine</Name>
<FirstName>Sylvain</FirstName>
<LastName>Chicoine</LastName>
<Constituency>Châteauguay—Saint-Constant</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Anne-Marie Day</Name>
<FirstName>Anne-Marie</FirstName>
<LastName>Day</LastName>
<Constituency>Charlesbourg—Haute-Saint-Charles</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Pierre Dionne Labelle</Name>
<FirstName>Pierre</FirstName>
<LastName>Dionne Labelle</LastName>
<Constituency>Rivière-du-Nord</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Ruth Ellen Brosseau</Name>
<FirstName>Ruth Ellen</FirstName>
<LastName>Brosseau</LastName>
<Constituency>Berthier—Maskinongé</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Rathika Sitsabaiesan</Name>
<FirstName>Rathika</FirstName>
<LastName>Sitsabaiesan</LastName>
<Constituency>Scarborough—Rouge River</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Philip Toone</Name>
<FirstName>Philip</FirstName>
<LastName>Toone</LastName>
<Constituency>Gaspésie—Îles-de-la-Madeleine</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Kennedy Stewart</Name>
<FirstName>Kennedy</FirstName>
<LastName>Stewart</LastName>
<Constituency>Burnaby—Douglas</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Guy Caron</Name>
<FirstName>Guy</FirstName>
<LastName>Caron</LastName>
<Constituency>Rimouski-Neigette—Témiscouata—Les Basques</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Claude Gravelle</Name>
<FirstName>Claude</FirstName>
<LastName>Gravelle</LastName>
<Constituency>Nickel Belt</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. John Rafferty</Name>
<FirstName>John</FirstName>
<LastName>Rafferty</LastName>
<Constituency>Thunder Bay—Rainy River</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Carol Hughes</Name>
<FirstName>Carol</FirstName>
<LastName>Hughes</LastName>
<Constituency>Algoma—Manitoulin—Kapuskasing</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Bruce Hyer</Name>
<FirstName>Bruce</FirstName>
<LastName>Hyer</LastName>
<Constituency>Thunder Bay—Superior North</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Pierre Nantel</Name>
<FirstName>Pierre</FirstName>
<LastName>Nantel</LastName>
<Constituency>Longueuil—Pierre-Boucher</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Marjolaine Boutin-Sweet</Name>
<FirstName>Marjolaine</FirstName>
<LastName>Boutin-Sweet</LastName>
<Constituency>Hochelaga</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Glenn Thibeault</Name>
<FirstName>Glenn</FirstName>
<LastName>Thibeault</LastName>
<Constituency>Sudbury</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Matthew Dubé</Name>
<FirstName>Matthew</FirstName>
<LastName>Dubé</LastName>
<Constituency>Chambly—Borduas</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jonathan Genest-Jourdain</Name>
<FirstName>Jonathan</FirstName>
<LastName>Genest-Jourdain</LastName>
<Constituency>Manicouagan</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Alain Giguère</Name>
<FirstName>Alain</FirstName>
<LastName>Giguère</LastName>
<Constituency>Marc-Aurèle-Fortin</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Sadia Groguhé</Name>
<FirstName>Sadia</FirstName>
<LastName>Groguhé</LastName>
<Constituency>Saint-Lambert</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Dan Harris</Name>
<FirstName>Dan</FirstName>
<LastName>Harris</LastName>
<Constituency>Scarborough Southwest</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Matthew Kellway</Name>
<FirstName>Matthew</FirstName>
<LastName>Kellway</LastName>
<Constituency>Beaches—East York</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Alexandrine Latendresse</Name>
<FirstName>Alexandrine</FirstName>
<LastName>Latendresse</LastName>
<Constituency>Louis-Saint-Laurent</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Laurin Liu</Name>
<FirstName>Laurin</FirstName>
<LastName>Liu</LastName>
<Constituency>Rivière-des-Mille-Îles</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jamie Nicholls</Name>
<FirstName>Jamie</FirstName>
<LastName>Nicholls</LastName>
<Constituency>Vaudreuil-Soulanges</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Annick Papillon</Name>
<FirstName>Annick</FirstName>
<LastName>Papillon</LastName>
<Constituency>Québec</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Anne Minh-Thu Quach</Name>
<FirstName>Anne Minh-Thu</FirstName>
<LastName>Quach</LastName>
<Constituency>Beauharnois—Salaberry</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mathieu Ravignat</Name>
<FirstName>Mathieu</FirstName>
<LastName>Ravignat</LastName>
<Constituency>Pontiac</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Jinny Jogindera Sims</Name>
<FirstName>Jinny Jogindera</FirstName>
<LastName>Sims</LastName>
<Constituency>Newton—North Delta</Constituency>
<Province code="BC">British Columbia</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mike Sullivan</Name>
<FirstName>Mike</FirstName>
<LastName>Sullivan</LastName>
<Constituency>York South—Weston</Constituency>
<Province code="ON">Ontario</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Denis Blanchette</Name>
<FirstName>Denis</FirstName>
<LastName>Blanchette</LastName>
<Constituency>Louis-Hébert</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Charmaine Borg</Name>
<FirstName>Charmaine</FirstName>
<LastName>Borg</LastName>
<Constituency>Terrebonne—Blainville</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. François Choquette</Name>
<FirstName>François</FirstName>
<LastName>Choquette</LastName>
<Constituency>Drummond</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ryan Cleary</Name>
<FirstName>Ryan</FirstName>
<LastName>Cleary</LastName>
<Constituency>St. John's South—Mount Pearl</Constituency>
<Province code="NL">Newfoundland and Labrador</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Rosane Doré Lefebvre</Name>
<FirstName>Rosane</FirstName>
<LastName>Doré Lefebvre</LastName>
<Constituency>Alfred-Pellan</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Pierre-Luc Dusseault</Name>
<FirstName>Pierre-Luc</FirstName>
<LastName>Dusseault</LastName>
<Constituency>Sherbrooke</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Mylène Freeman</Name>
<FirstName>Mylène</FirstName>
<LastName>Freeman</LastName>
<Constituency>Argenteuil—Papineau—Mirabel</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Réjean Genest</Name>
<FirstName>Réjean</FirstName>
<LastName>Genest</LastName>
<Constituency>Shefford</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Pierre Jacob</Name>
<FirstName>Pierre</FirstName>
<LastName>Jacob</LastName>
<Constituency>Brome—Missisquoi</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. François Lapointe</Name>
<FirstName>François</FirstName>
<LastName>Lapointe</LastName>
<Constituency>Montmagny—L'Islet—Kamouraska—Rivière-du-Loup</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jean-François Larose</Name>
<FirstName>Jean-François</FirstName>
<LastName>Larose</LastName>
<Constituency>Repentigny</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. José Nunez-Melo</Name>
<FirstName>José</FirstName>
<LastName>Nunez-Melo</LastName>
<Constituency>Laval</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Élaine Michaud</Name>
<FirstName>Élaine</FirstName>
<LastName>Michaud</LastName>
<Constituency>Portneuf—Jacques-Cartier</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Dany Morin</Name>
<FirstName>Dany</FirstName>
<LastName>Morin</LastName>
<Constituency>Chicoutimi—Le Fjord</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Isabelle Morin</Name>
<FirstName>Isabelle</FirstName>
<LastName>Morin</LastName>
<Constituency>Notre-Dame-de-Grâce—Lachine</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Marc-André Morin</Name>
<FirstName>Marc-André</FirstName>
<LastName>Morin</LastName>
<Constituency>Laurentides—Labelle</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Ève Péclet</Name>
<FirstName>Ève</FirstName>
<LastName>Péclet</LastName>
<Constituency>La Pointe-de-l'Île</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. François Pilon</Name>
<FirstName>François</FirstName>
<LastName>Pilon</LastName>
<Constituency>Laval—Les Îles</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Francine Raynault</Name>
<FirstName>Francine</FirstName>
<LastName>Raynault</LastName>
<Constituency>Joliette</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Djaouida Sellah</Name>
<FirstName>Djaouida</FirstName>
<LastName>Sellah</LastName>
<Constituency>Saint-Bruno—Saint-Hubert</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Lise St-Denis</Name>
<FirstName>Lise</FirstName>
<LastName>St-Denis</LastName>
<Constituency>Saint-Maurice—Champlain</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jonathan Tremblay</Name>
<FirstName>Jonathan</FirstName>
<LastName>Tremblay</LastName>
<Constituency>Montmorency—Charlevoix—Haute-Côte-Nord</Constituency>
<Province code="QC">Québec</Province>
<Party>NDP</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Lawrence MacAulay</Name>
<FirstName>Lawrence</FirstName>
<LastName>MacAulay</LastName>
<Constituency>Cardigan</Constituency>
<Province code="PE">Prince Edward Island</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ralph Goodale</Name>
<FirstName>Ralph</FirstName>
<LastName>Goodale</LastName>
<Constituency>Wascana</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Marc Garneau</Name>
<FirstName>Marc</FirstName>
<LastName>Garneau</LastName>
<Constituency>Westmount—Ville-Marie</Constituency>
<Province code="QC">Québec</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Wayne Easter</Name>
<FirstName>Wayne</FirstName>
<LastName>Easter</LastName>
<Constituency>Malpeque</Constituency>
<Province code="PE">Prince Edward Island</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Geoff Regan</Name>
<FirstName>Geoff</FirstName>
<LastName>Regan</LastName>
<Constituency>Halifax West</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mauril Bélanger</Name>
<FirstName>Mauril</FirstName>
<LastName>Bélanger</LastName>
<Constituency>Ottawa—Vanier</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Gerry Byrne</Name>
<FirstName>Gerry</FirstName>
<LastName>Byrne</LastName>
<Constituency>Humber—St. Barbe—Baie Verte</Constituency>
<Province code="NL">Newfoundland and Labrador</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Massimo Pacetti</Name>
<FirstName>Massimo</FirstName>
<LastName>Pacetti</LastName>
<Constituency>Saint-Léonard—Saint-Michel</Constituency>
<Province code="QC">Québec</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Judy Foote</Name>
<FirstName>Judy</FirstName>
<LastName>Foote</LastName>
<Constituency>Random—Burin—St. George's</Constituency>
<Province code="NL">Newfoundland and Labrador</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Kevin Lamoureux</Name>
<FirstName>Kevin</FirstName>
<LastName>Lamoureux</LastName>
<Constituency>Winnipeg North</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Stéphane Dion</Name>
<FirstName>Stéphane</FirstName>
<LastName>Dion</LastName>
<Constituency>Saint-Laurent—Cartierville</Constituency>
<Province code="QC">Québec</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Carolyn Bennett</Name>
<FirstName>Carolyn</FirstName>
<LastName>Bennett</LastName>
<Constituency>St. Paul's</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Denis Coderre</Name>
<FirstName>Denis</FirstName>
<LastName>Coderre</LastName>
<Constituency>Bourassa</Constituency>
<Province code="QC">Québec</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Scott Brison</Name>
<FirstName>Scott</FirstName>
<LastName>Brison</LastName>
<Constituency>Kings—Hants</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jim Karygiannis</Name>
<FirstName>Jim</FirstName>
<LastName>Karygiannis</LastName>
<Constituency>Scarborough—Agincourt</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Judy Sgro</Name>
<FirstName>Judy</FirstName>
<LastName>Sgro</LastName>
<Constituency>York West</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Irwin Cotler</Name>
<FirstName>Irwin</FirstName>
<LastName>Cotler</LastName>
<Constituency>Mount Royal</Constituency>
<Province code="QC">Québec</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rodger Cuzner</Name>
<FirstName>Rodger</FirstName>
<LastName>Cuzner</LastName>
<Constituency>Cape Breton—Canso</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mark Eyking</Name>
<FirstName>Mark</FirstName>
<LastName>Eyking</LastName>
<Constituency>Sydney—Victoria</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Dominic LeBlanc</Name>
<FirstName>Dominic</FirstName>
<LastName>LeBlanc</LastName>
<Constituency>Beauséjour</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. John McCallum</Name>
<FirstName>John</FirstName>
<LastName>McCallum</LastName>
<Constituency>Markham—Unionville</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. David McGuinty</Name>
<FirstName>David</FirstName>
<LastName>McGuinty</LastName>
<Constituency>Ottawa South</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Francis Scarpaleggia</Name>
<FirstName>Francis</FirstName>
<LastName>Scarpaleggia</LastName>
<Constituency>Lac-Saint-Louis</Constituency>
<Province code="QC">Québec</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Scott Simms</Name>
<FirstName>Scott</FirstName>
<LastName>Simms</LastName>
<Constituency>Bonavista—Gander—Grand Falls—Windsor</Constituency>
<Province code="NL">Newfoundland and Labrador</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Joyce Murray</Name>
<FirstName>Joyce</FirstName>
<LastName>Murray</LastName>
<Constituency>Vancouver Quadra</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Kirsty Duncan</Name>
<FirstName>Kirsty</FirstName>
<LastName>Duncan</LastName>
<Constituency>Etobicoke North</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Justin Trudeau</Name>
<FirstName>Justin</FirstName>
<LastName>Trudeau</LastName>
<Constituency>Papineau</Constituency>
<Province code="QC">Québec</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Frank Valeriote</Name>
<FirstName>Frank</FirstName>
<LastName>Valeriote</LastName>
<Constituency>Guelph</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ted Hsu</Name>
<FirstName>Ted</FirstName>
<LastName>Hsu</LastName>
<Constituency>Kingston and the Islands</Constituency>
<Province code="ON">Ontario</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Sean Casey</Name>
<FirstName>Sean</FirstName>
<LastName>Casey</LastName>
<Constituency>Charlottetown</Constituency>
<Province code="PE">Prince Edward Island</Province>
<Party>Liberal</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Elizabeth May</Name>
<FirstName>Elizabeth</FirstName>
<LastName>May</LastName>
<Constituency>Saanich—Gulf Islands</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Green Party</Party>
<RecordedVote>
<Yea>1</Yea>
<Nay>0</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Stephen Harper</Name>
<FirstName>Stephen</FirstName>
<LastName>Harper</LastName>
<Constituency>Calgary Southwest</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Steven Fletcher</Name>
<FirstName>Steven</FirstName>
<LastName>Fletcher</LastName>
<Constituency>Charleswood—St. James—Assiniboia</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Peter Penashue</Name>
<FirstName>Peter</FirstName>
<LastName>Penashue</LastName>
<Constituency>Labrador</Constituency>
<Province code="NL">Newfoundland and Labrador</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Keith Ashfield</Name>
<FirstName>Keith</FirstName>
<LastName>Ashfield</LastName>
<Constituency>Fredericton</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Lisa Raitt</Name>
<FirstName>Lisa</FirstName>
<LastName>Raitt</LastName>
<Constituency>Halton</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Denis Lebel</Name>
<FirstName>Denis</FirstName>
<LastName>Lebel</LastName>
<Constituency>Roberval—Lac-Saint-Jean</Constituency>
<Province code="QC">Québec</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Rona Ambrose</Name>
<FirstName>Rona</FirstName>
<LastName>Ambrose</LastName>
<Constituency>Edmonton—Spruce Grove</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Vic Toews</Name>
<FirstName>Vic</FirstName>
<LastName>Toews</LastName>
<Constituency>Provencher</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rob Nicholson</Name>
<FirstName>Rob</FirstName>
<LastName>Nicholson</LastName>
<Constituency>Niagara Falls</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Peter MacKay</Name>
<FirstName>Peter</FirstName>
<LastName>MacKay</LastName>
<Constituency>Central Nova</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Peter Van Loan</Name>
<FirstName>Peter</FirstName>
<LastName>Van Loan</LastName>
<Constituency>York—Simcoe</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Tony Clement</Name>
<FirstName>Tony</FirstName>
<LastName>Clement</LastName>
<Constituency>Parry Sound—Muskoka</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. John Baird</Name>
<FirstName>John</FirstName>
<LastName>Baird</LastName>
<Constituency>Ottawa West—Nepean</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Diane Finley</Name>
<FirstName>Diane</FirstName>
<LastName>Finley</LastName>
<Constituency>Haldimand—Norfolk</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jason Kenney</Name>
<FirstName>Jason</FirstName>
<LastName>Kenney</LastName>
<Constituency>Calgary Southeast</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. James Moore</Name>
<FirstName>James</FirstName>
<LastName>Moore</LastName>
<Constituency>Port Moody—Westwood—Port Coquitlam</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. John Duncan</Name>
<FirstName>John</FirstName>
<LastName>Duncan</LastName>
<Constituency>Vancouver Island North</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Gail Shea</Name>
<FirstName>Gail</FirstName>
<LastName>Shea</LastName>
<Constituency>Egmont</Constituency>
<Province code="PE">Prince Edward Island</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Peter Kent</Name>
<FirstName>Peter</FirstName>
<LastName>Kent</LastName>
<Constituency>Thornhill</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ed Fast</Name>
<FirstName>Ed</FirstName>
<LastName>Fast</LastName>
<Constituency>Abbotsford</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Steven Blaney</Name>
<FirstName>Steven</FirstName>
<LastName>Blaney</LastName>
<Constituency>Lévis—Bellechasse</Constituency>
<Province code="QC">Québec</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Joe Oliver</Name>
<FirstName>Joe</FirstName>
<LastName>Oliver</LastName>
<Constituency>Eglinton—Lawrence</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Julian Fantino</Name>
<FirstName>Julian</FirstName>
<LastName>Fantino</LastName>
<Constituency>Vaughan</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Lee Richardson</Name>
<FirstName>Lee</FirstName>
<LastName>Richardson</LastName>
<Constituency>Calgary Centre</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Leon Benoit</Name>
<FirstName>Leon</FirstName>
<LastName>Benoit</LastName>
<Constituency>Vegreville—Wainwright</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Garry Breitkreuz</Name>
<FirstName>Garry</FirstName>
<LastName>Breitkreuz</LastName>
<Constituency>Yorkton—Melville</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Richard Harris</Name>
<FirstName>Richard</FirstName>
<LastName>Harris</LastName>
<Constituency>Cariboo—Prince George</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rob Merrifield</Name>
<FirstName>Rob</FirstName>
<LastName>Merrifield</LastName>
<Constituency>Yellowhead</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rob Moore</Name>
<FirstName>Rob</FirstName>
<LastName>Moore</LastName>
<Constituency>Fundy Royal</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Randy Kamp</Name>
<FirstName>Randy</FirstName>
<LastName>Kamp</LastName>
<Constituency>Pitt Meadows—Maple Ridge—Mission</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Pierre Poilievre</Name>
<FirstName>Pierre</FirstName>
<LastName>Poilievre</LastName>
<Constituency>Nepean—Carleton</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mike Lake</Name>
<FirstName>Mike</FirstName>
<LastName>Lake</LastName>
<Constituency>Edmonton—Mill Woods—Beaumont</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Deepak Obhrai</Name>
<FirstName>Deepak</FirstName>
<LastName>Obhrai</LastName>
<Constituency>Calgary East</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Maxime Bernier</Name>
<FirstName>Maxime</FirstName>
<LastName>Bernier</LastName>
<Constituency>Beauce</Constituency>
<Province code="QC">Québec</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Bal Gosal</Name>
<FirstName>Bal</FirstName>
<LastName>Gosal</LastName>
<Constituency>Bramalea—Gore—Malton</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Gordon O'Connor</Name>
<FirstName>Gordon</FirstName>
<LastName>O'Connor</LastName>
<Constituency>Carleton—Mississippi Mills</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Alice Wong</Name>
<FirstName>Alice</FirstName>
<LastName>Wong</LastName>
<Constituency>Richmond</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Diane Ablonczy</Name>
<FirstName>Diane</FirstName>
<LastName>Ablonczy</LastName>
<Constituency>Calgary—Nose Hill</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ted Menzies</Name>
<FirstName>Ted</FirstName>
<LastName>Menzies</LastName>
<Constituency>Macleod</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Tim Uppal</Name>
<FirstName>Tim</FirstName>
<LastName>Uppal</LastName>
<Constituency>Edmonton—Sherwood Park</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rick Dykstra</Name>
<FirstName>Rick</FirstName>
<LastName>Dykstra</LastName>
<Constituency>St. Catharines</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Paul Calandra</Name>
<FirstName>Paul </FirstName>
<LastName>Calandra</LastName>
<Constituency>Oak Ridges—Markham</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. David Anderson</Name>
<FirstName>David</FirstName>
<LastName>Anderson</LastName>
<Constituency>Cypress Hills—Grasslands</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jacques Gourde</Name>
<FirstName>Jacques</FirstName>
<LastName>Gourde</LastName>
<Constituency>Lotbinière—Chutes-de-la-Chaudière</Constituency>
<Province code="QC">Québec</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Colin Carrie</Name>
<FirstName>Colin</FirstName>
<LastName>Carrie</LastName>
<Constituency>Oshawa</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Gerald Keddy</Name>
<FirstName>Gerald</FirstName>
<LastName>Keddy</LastName>
<Constituency>South Shore—St. Margaret's</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rob Anders</Name>
<FirstName>Rob</FirstName>
<LastName>Anders</LastName>
<Constituency>Calgary West</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Peter Goldring</Name>
<FirstName>Peter</FirstName>
<LastName>Goldring</LastName>
<Constituency>Edmonton East</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Maurice Vellacott</Name>
<FirstName>Maurice</FirstName>
<LastName>Vellacott</LastName>
<Constituency>Saskatoon—Wanuskewin</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Cheryl Gallant</Name>
<FirstName>Cheryl</FirstName>
<LastName>Gallant</LastName>
<Constituency>Renfrew—Nipissing—Pembroke</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. James Lunney</Name>
<FirstName>James</FirstName>
<LastName>Lunney</LastName>
<Constituency>Nanaimo—Alberni</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. James Rajotte</Name>
<FirstName>James</FirstName>
<LastName>Rajotte</LastName>
<Constituency>Edmonton—Leduc</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Scott Reid</Name>
<FirstName>Scott</FirstName>
<LastName>Reid</LastName>
<Constituency>Lanark—Frontenac—Lennox and Addington</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Kevin Sorenson</Name>
<FirstName>Kevin</FirstName>
<LastName>Sorenson</LastName>
<Constituency>Crowfoot</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Gary Schellenberger</Name>
<FirstName>Gary</FirstName>
<LastName>Schellenberger</LastName>
<Constituency>Perth—Wellington</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Dean Allison</Name>
<FirstName>Dean</FirstName>
<LastName>Allison</LastName>
<Constituency>Niagara West—Glanbrook</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. James Bezan</Name>
<FirstName>James</FirstName>
<LastName>Bezan</LastName>
<Constituency>Selkirk—Interlake</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Gordon Brown</Name>
<FirstName>Gordon</FirstName>
<LastName>Brown</LastName>
<Constituency>Leeds—Grenville</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Chris Alexander</Name>
<FirstName>Chris</FirstName>
<LastName>Alexander</LastName>
<Constituency>Ajax—Pickering</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Michelle Rempel</Name>
<FirstName>Michelle</FirstName>
<LastName>Rempel</LastName>
<Constituency>Calgary Centre-North</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Greg Rickford</Name>
<FirstName>Greg</FirstName>
<LastName>Rickford</LastName>
<Constituency>Kenora</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Robert Goguen</Name>
<FirstName>Robert</FirstName>
<LastName>Goguen</LastName>
<Constituency>Moncton—Riverview—Dieppe</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Kerry-Lynne D. Findlay</Name>
<FirstName>Kerry-Lynne D.</FirstName>
<LastName>Findlay</LastName>
<Constituency>Delta—Richmond East</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Dean Del Mastro</Name>
<FirstName>Dean</FirstName>
<LastName>Del Mastro</LastName>
<Constituency>Peterborough</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Tom Lukiwski</Name>
<FirstName>Tom</FirstName>
<LastName>Lukiwski</LastName>
<Constituency>Regina—Lumsden—Lake Centre</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Susan Truppe</Name>
<FirstName>Susan</FirstName>
<LastName>Truppe</LastName>
<Constituency>London North Centre</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Pierre Lemieux</Name>
<FirstName>Pierre</FirstName>
<LastName>Lemieux</LastName>
<Constituency>Glengarry—Prescott—Russell</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Candice Hoeppner</Name>
<FirstName>Candice</FirstName>
<LastName>Hoeppner</LastName>
<Constituency>Portage—Lisgar</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Eve Adams</Name>
<FirstName>Eve</FirstName>
<LastName>Adams</LastName>
<Constituency>Mississauga—Brampton South</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Shelly Glover</Name>
<FirstName>Shelly</FirstName>
<LastName>Glover</LastName>
<Constituency>Saint Boniface</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Kellie Leitch</Name>
<FirstName>Kellie</FirstName>
<LastName>Leitch</LastName>
<Constituency>Simcoe—Grey</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Chungsen Leung</Name>
<FirstName>Chungsen</FirstName>
<LastName>Leung</LastName>
<Constituency>Willowdale</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Andrew Saxton</Name>
<FirstName>Andrew</FirstName>
<LastName>Saxton</LastName>
<Constituency>North Vancouver</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Lois Brown</Name>
<FirstName>Lois</FirstName>
<LastName>Brown</LastName>
<Constituency>Newmarket—Aurora</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Cathy McLeod</Name>
<FirstName>Cathy</FirstName>
<LastName>McLeod</LastName>
<Constituency>Kamloops—Thompson—Cariboo</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Laurie Hawn</Name>
<FirstName>Laurie</FirstName>
<LastName>Hawn</LastName>
<Constituency>Edmonton Centre</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Michael Chong</Name>
<FirstName>Michael</FirstName>
<LastName>Chong</LastName>
<Constituency>Wellington—Halton Hills</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Nina Grewal</Name>
<FirstName>Nina</FirstName>
<LastName>Grewal</LastName>
<Constituency>Fleetwood—Port Kells</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Russ Hiebert</Name>
<FirstName>Russ</FirstName>
<LastName>Hiebert</LastName>
<Constituency>South Surrey—White Rock—Cloverdale</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Brian Jean</Name>
<FirstName>Brian</FirstName>
<LastName>Jean</LastName>
<Constituency>Fort McMurray—Athabasca</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ed Komarnicki</Name>
<FirstName>Ed</FirstName>
<LastName>Komarnicki</LastName>
<Constituency>Souris—Moose Mountain</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Daryl Kramp</Name>
<FirstName>Daryl</FirstName>
<LastName>Kramp</LastName>
<Constituency>Prince Edward—Hastings</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Guy Lauzon</Name>
<FirstName>Guy</FirstName>
<LastName>Lauzon</LastName>
<Constituency>Stormont—Dundas—South Glengarry</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Dave MacKenzie</Name>
<FirstName>Dave</FirstName>
<LastName>MacKenzie</LastName>
<Constituency>Oxford</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Larry Miller</Name>
<FirstName>Larry</FirstName>
<LastName>Miller</LastName>
<Constituency>Bruce—Grey—Owen Sound</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Joe Preston</Name>
<FirstName>Joe</FirstName>
<LastName>Preston</LastName>
<Constituency>Elgin—Middlesex—London</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Joy Smith</Name>
<FirstName>Joy</FirstName>
<LastName>Smith</LastName>
<Constituency>Kildonan—St. Paul</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. David Tilson</Name>
<FirstName>David</FirstName>
<LastName>Tilson</LastName>
<Constituency>Dufferin—Caledon</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Brad Trost</Name>
<FirstName>Brad</FirstName>
<LastName>Trost</LastName>
<Constituency>Saskatoon—Humboldt</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Merv Tweed</Name>
<FirstName>Merv</FirstName>
<LastName>Tweed</LastName>
<Constituency>Brandon—Souris</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mark Warawa</Name>
<FirstName>Mark</FirstName>
<LastName>Warawa</LastName>
<Constituency>Langley</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jeff Watson</Name>
<FirstName>Jeff</FirstName>
<LastName>Watson</LastName>
<Constituency>Essex</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Harold Albrecht</Name>
<FirstName>Harold</FirstName>
<LastName>Albrecht</LastName>
<Constituency>Kitchener—Conestoga</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mike Allen</Name>
<FirstName>Mike</FirstName>
<LastName>Allen</LastName>
<Constituency>Tobique—Mactaquac</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Patrick Brown</Name>
<FirstName>Patrick</FirstName>
<LastName>Brown</LastName>
<Constituency>Barrie</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rod Bruinooge</Name>
<FirstName>Rod</FirstName>
<LastName>Bruinooge</LastName>
<Constituency>Winnipeg South</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Blaine Calkins</Name>
<FirstName>Blaine</FirstName>
<LastName>Calkins</LastName>
<Constituency>Wetaskiwin</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ron Cannan</Name>
<FirstName>Ron</FirstName>
<LastName>Cannan</LastName>
<Constituency>Kelowna—Lake Country</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Patricia Davidson</Name>
<FirstName>Patricia</FirstName>
<LastName>Davidson</LastName>
<Constituency>Sarnia—Lambton</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Royal Galipeau</Name>
<FirstName>Royal</FirstName>
<LastName>Galipeau</LastName>
<Constituency>Ottawa—Orléans</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Colin Mayes</Name>
<FirstName>Colin</FirstName>
<LastName>Mayes</LastName>
<Constituency>Okanagan—Shuswap</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rick Norlock</Name>
<FirstName>Rick</FirstName>
<LastName>Norlock</LastName>
<Constituency>Northumberland—Quinte West</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Bev Shipley</Name>
<FirstName>Bev</FirstName>
<LastName>Shipley</LastName>
<Constituency>Lambton—Kent—Middlesex</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Brian Storseth</Name>
<FirstName>Brian</FirstName>
<LastName>Storseth</LastName>
<Constituency>Westlock—St. Paul</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. David Sweet</Name>
<FirstName>David</FirstName>
<LastName>Sweet</LastName>
<Constituency>Ancaster—Dundas—Flamborough—Westdale</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Dave Van Kesteren</Name>
<FirstName>Dave</FirstName>
<LastName>Van Kesteren</LastName>
<Constituency>Chatham-Kent—Essex</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mike Wallace</Name>
<FirstName>Mike</FirstName>
<LastName>Wallace</LastName>
<Constituency>Burlington</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Chris Warkentin</Name>
<FirstName>Chris</FirstName>
<LastName>Warkentin</LastName>
<Constituency>Peace River</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rob Clarke</Name>
<FirstName>Rob</FirstName>
<LastName>Clarke</LastName>
<Constituency>Desnethé—Missinippi—Churchill River</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Kelly Block</Name>
<FirstName>Kelly</FirstName>
<LastName>Block</LastName>
<Constituency>Saskatoon—Rosetown—Biggar</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ray Boughen</Name>
<FirstName>Ray</FirstName>
<LastName>Boughen</LastName>
<Constituency>Palliser</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Peter Braid</Name>
<FirstName>Peter</FirstName>
<LastName>Braid</LastName>
<Constituency>Kitchener—Waterloo</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Earl Dreeshen</Name>
<FirstName>Earl</FirstName>
<LastName>Dreeshen</LastName>
<Constituency>Red Deer</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Randy Hoback</Name>
<FirstName>Randy</FirstName>
<LastName>Hoback</LastName>
<Constituency>Prince Albert</Constituency>
<Province code="SK">Saskatchewan</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ed Holder</Name>
<FirstName>Ed</FirstName>
<LastName>Holder</LastName>
<Constituency>London West</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Greg Kerr</Name>
<FirstName>Greg</FirstName>
<LastName>Kerr</LastName>
<Constituency>West Nova</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ben Lobb</Name>
<FirstName>Ben</FirstName>
<LastName>Lobb</LastName>
<Constituency>Huron—Bruce</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Phil McColeman</Name>
<FirstName>Phil</FirstName>
<LastName>McColeman</LastName>
<Constituency>Brant</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Tilly O'Neill Gordon</Name>
<FirstName>Tilly</FirstName>
<LastName>O'Neill Gordon</LastName>
<Constituency>Miramichi</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. LaVar Payne</Name>
<FirstName>LaVar</FirstName>
<LastName>Payne</LastName>
<Constituency>Medicine Hat</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Brent Rathgeber</Name>
<FirstName>Brent</FirstName>
<LastName>Rathgeber</LastName>
<Constituency>Edmonton—St. Albert</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Blake Richards</Name>
<FirstName>Blake</FirstName>
<LastName>Richards</LastName>
<Constituency>Wild Rose</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Devinder Shory</Name>
<FirstName>Devinder</FirstName>
<LastName>Shory</LastName>
<Constituency>Calgary Northeast</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. John Weston</Name>
<FirstName>John</FirstName>
<LastName>Weston</LastName>
<Constituency>West Vancouver—Sunshine Coast—Sea to Sky Country</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Rodney Weston</Name>
<FirstName>Rodney</FirstName>
<LastName>Weston</LastName>
<Constituency>Saint John</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Stephen Woodworth</Name>
<FirstName>Stephen</FirstName>
<LastName>Woodworth</LastName>
<Constituency>Kitchener Centre</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Terence Young</Name>
<FirstName>Terence</FirstName>
<LastName>Young</LastName>
<Constituency>Oakville</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Scott Armstrong</Name>
<FirstName>Scott</FirstName>
<LastName>Armstrong</LastName>
<Constituency>Cumberland—Colchester—Musquodoboit Valley</Constituency>
<Province code="NS">Nova Scotia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Robert Sopuck</Name>
<FirstName>Robert</FirstName>
<LastName>Sopuck</LastName>
<Constituency>Dauphin—Swan River—Marquette</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mark Adler</Name>
<FirstName>Mark</FirstName>
<LastName>Adler</LastName>
<Constituency>York Centre</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mrs. Stella Ambler</Name>
<FirstName>Stella</FirstName>
<LastName>Ambler</LastName>
<Constituency>Mississauga South</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Joyce Bateman</Name>
<FirstName>Joyce</FirstName>
<LastName>Bateman</LastName>
<Constituency>Winnipeg South Centre</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. John Carmichael</Name>
<FirstName>John</FirstName>
<LastName>Carmichael</LastName>
<Constituency>Don Valley West</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Bryan Hayes</Name>
<FirstName>Bryan</FirstName>
<LastName>Hayes</LastName>
<Constituency>Sault Ste. Marie</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Roxanne James</Name>
<FirstName>Roxanne</FirstName>
<LastName>James</LastName>
<Constituency>Scarborough Centre</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Wladyslaw Lizon</Name>
<FirstName>Wladyslaw</FirstName>
<LastName>Lizon</LastName>
<Constituency>Mississauga East—Cooksville</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ted Opitz</Name>
<FirstName>Ted</FirstName>
<LastName>Opitz</LastName>
<Constituency>Etobicoke Centre</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Kyle Seeback</Name>
<FirstName>Kyle</FirstName>
<LastName>Seeback</LastName>
<Constituency>Brampton West</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Mark Strahl</Name>
<FirstName>Mark</FirstName>
<LastName>Strahl</LastName>
<Constituency>Chilliwack—Fraser Canyon</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Bernard Trottier</Name>
<FirstName>Bernard</FirstName>
<LastName>Trottier</LastName>
<Constituency>Etobicoke—Lakeshore</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. John Williamson</Name>
<FirstName>John</FirstName>
<LastName>Williamson</LastName>
<Constituency>New Brunswick Southwest</Constituency>
<Province code="NB">New Brunswick</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Ms. Wai Young</Name>
<FirstName>Wai</FirstName>
<LastName>Young</LastName>
<Constituency>Vancouver South</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Bob Zimmer</Name>
<FirstName>Bob</FirstName>
<LastName>Zimmer</LastName>
<Constituency>Prince George—Peace River</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Dan Albas</Name>
<FirstName>Dan</FirstName>
<LastName>Albas</LastName>
<Constituency>Okanagan—Coquihalla</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jay Aspin</Name>
<FirstName>Jay</FirstName>
<LastName>Aspin</LastName>
<Constituency>Nipissing—Timiskaming</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Brad Butt</Name>
<FirstName>Brad</FirstName>
<LastName>Butt</LastName>
<Constituency>Mississauga—Streetsville</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Corneliu Chisu</Name>
<FirstName>Corneliu</FirstName>
<LastName>Chisu</LastName>
<Constituency>Pickering—Scarborough East</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Parm Gill</Name>
<FirstName>Parm</FirstName>
<LastName>Gill</LastName>
<Constituency>Brampton—Springdale</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Jim Hillyer</Name>
<FirstName>Jim</FirstName>
<LastName>Hillyer</LastName>
<Constituency>Lethbridge</Constituency>
<Province code="AB">Alberta</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Ryan Leef</Name>
<FirstName>Ryan</FirstName>
<LastName>Leef</LastName>
<Constituency>Yukon</Constituency>
<Province code="YT">Yukon</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Costas Menegakis</Name>
<FirstName>Costas</FirstName>
<LastName>Menegakis</LastName>
<Constituency>Richmond Hill</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Barry Devolin</Name>
<FirstName>Barry</FirstName>
<LastName>Devolin</LastName>
<Constituency>Haliburton—Kawartha Lakes—Brock</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Lawrence Toet</Name>
<FirstName>Lawrence</FirstName>
<LastName>Toet</LastName>
<Constituency>Elmwood—Transcona</Constituency>
<Province code="MB">Manitoba</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. David Wilks</Name>
<FirstName>David</FirstName>
<LastName>Wilks</LastName>
<Constituency>Kootenay—Columbia</Constituency>
<Province code="BC">British Columbia</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Bruce Stanton</Name>
<FirstName>Bruce</FirstName>
<LastName>Stanton</LastName>
<Constituency>Simcoe North</Constituency>
<Province code="ON">Ontario</Province>
<Party>Conservative</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. Louis Plamondon</Name>
<FirstName>Louis</FirstName>
<LastName>Plamondon</LastName>
<Constituency>Bas-Richelieu—Nicolet—Bécancour</Constituency>
<Province code="QC">Québec</Province>
<Party>Bloc Québécois</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
<Participant>
<Name>Mr. André Bellavance</Name>
<FirstName>André</FirstName>
<LastName>Bellavance</LastName>
<Constituency>Richmond—Arthabaska</Constituency>
<Province code="QC">Québec</Province>
<Party>Bloc Québécois</Party>
<RecordedVote>
<Yea>0</Yea>
<Nay>1</Nay>
<Paired>0</Paired>
</RecordedVote>
</Participant>
</Vote> | {'content_hash': '34b8ae896da164407f0d8fa9be08730f', 'timestamp': '', 'source': 'github', 'line_count': 3670, 'max_line_length': 307, 'avg_line_length': 28.932697547683922, 'alnum_prop': 0.6145051467749074, 'repo_name': 'tomclegg/whovoted', 'id': 'ffe17c39a592ae25700977ec995e42d7f79079bc', 'size': '106705', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'data-import/data/vote-41-1-87.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1576'}, {'name': 'HTML', 'bytes': '629'}, {'name': 'JavaScript', 'bytes': '18948'}, {'name': 'Ruby', 'bytes': '3433'}]} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
namespace Ducksboard.TypeExtensions
{
public static class DataContractNameTypeExtension
{
public static string GetResourceFromTypeDataContractAttribute(this Type type)
{
var props = type.GetCustomAttributes(
typeof(DataContractAttribute),
true);
var dataContractAttribute = props[0] as DataContractAttribute;
if (dataContractAttribute == null)
throw new ArgumentException("Can only use classes decorated with the Name DataContractAttribute");
return dataContractAttribute.Name;
}
}
}
| {'content_hash': '65914b363180782393b16877790f56f7', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 114, 'avg_line_length': 29.72, 'alnum_prop': 0.6810228802153432, 'repo_name': 'modulexcite/Ducksboard', 'id': '4493067ecafbc3d52095e88021a0397e801b77df', 'size': '745', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Ducksboard/TypeExtensions/DataContractNameTypeExtension.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '47624'}]} |
// version 14:
import lombok.EqualsAndHashCode;
public @EqualsAndHashCode record EqualsAndHashCodeOnRecord(String a, String b) {
/* Implicit */ private final String a;
/* Implicit */ private final String b;
public EqualsAndHashCodeOnRecord(String a, String b) {
super();
.a = a;
.b = b;
}
}
| {'content_hash': '3f4f44c30f3419f7164936016d768070', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 80, 'avg_line_length': 28.09090909090909, 'alnum_prop': 0.6925566343042071, 'repo_name': 'rzwitserloot/lombok', 'id': '583191e6d8bdd056e13b7d5c49b61a345f26cf3c', 'size': '309', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'test/transform/resource/after-ecj/EqualsAndHashCodeOnRecord.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '91'}, {'name': 'C', 'bytes': '1905'}, {'name': 'CSS', 'bytes': '6944'}, {'name': 'Dockerfile', 'bytes': '4765'}, {'name': 'HTML', 'bytes': '229017'}, {'name': 'Java', 'bytes': '3862587'}, {'name': 'JavaScript', 'bytes': '15874'}, {'name': 'Shell', 'bytes': '6799'}, {'name': 'Starlark', 'bytes': '536'}]} |
package util
import "errors"
type stackItem struct {
next *stackItem
item *interface{}
}
// Stack is a LIFO (last in, first out) data collection.
// It can store any type of data.
type Stack struct {
size int
top *stackItem
}
// Size returns the number of elements in the stack.
func (s *Stack) Size() int {
return s.size
}
// Empty returns true if the stack is empty, false otherwise.
func (s *Stack) Empty() bool {
return s.size == 0
}
// Push adds the given element on top of the stack.
func (s *Stack) Push(element interface{}) {
var si = stackItem{
next: s.top,
item: &element,
}
s.top = &si
s.size++
}
// Pop removes and returns the element on top of the stack.
func (s *Stack) Pop() (interface{}, error) {
if s.size == 0 {
return nil, errors.New("Cannot pop an empty stack")
}
var element = s.top.item
s.top = s.top.next
s.size--
return *element, nil
}
// Peek returns the element on the top of the stack.
func (s *Stack) Peek() (interface{}, error) {
if s.size == 0 {
return nil, errors.New("Cannot peek an empty stack")
}
return *s.top.item, nil
}
| {'content_hash': '06d015150dad054f3d9defbd9009cece', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 61, 'avg_line_length': 20.24074074074074, 'alnum_prop': 0.6633119853613907, 'repo_name': 'didier-schmitt/util', 'id': '103fd5df9cdce604be20ca202f6e879c60b736bb', 'size': '1093', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'stack.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '10191'}]} |
<?php namespace SFrame\Router;
/**
* The route
*/
class Route
{
const DEFAULT_CONTROLLER = 'Index';
const DEFAULT_ACTION = 'index';
protected $_controller_path = '';
protected $_controller_namespace = null;
protected $_controller = '';
protected $_action = '';
protected $_group_index = null;
protected $_groups = array();
protected $_routes = array();
public function __construct($controller_path, $namespace = null)
{
$this->_controller_path = $controller_path;
$this->_controller_namespace = $namespace;
}
public function getHost()
{
return filter_input(INPUT_SERVER, 'HTTP_HOST');
}
public function getScript()
{
return filter_has_var(INPUT_SERVER, 'SCRIPT_NAME') ? filter_input(INPUT_SERVER, 'SCRIPT_NAME') : filter_input(INPUT_SERVER, 'PHP_SELF');
}
public function getBase()
{
return rtrim(dirname($this->getScript()), '\\/');
}
public function getUri()
{
return filter_input(INPUT_SERVER, 'REQUEST_URI');
}
/**
* Get the rewrite path in the url
*/
public function getPath()
{
$uri = $this->getUri();
$script = $this->getScript();
$base = $this->getBase();
if (($pos = strpos($uri, '?')) !== false) {
$uri = substr($uri, 0, $pos);
}
if ($script && strpos($uri, $script) === 0) {
$path = substr($uri, strlen($script));
} elseif ($base && strpos($uri, $base) === 0) {
$path = substr($uri, strlen($base));
} else {
$path = $uri;
}
return preg_replace('/\/+/', '/', trim($path, '/'));
}
/**
* Group
*/
public function group(array $options, $routes)
{
$this->_groups[] = $options;
$this->_group_index = count($this->_groups) - 1;
$routes($this);
$this->_group_index = null;
}
protected function _addRoute($method, $match, $action)
{
$this->_routes[] = array(
'method' => $method,
'match' => $match,
'action' => $action,
'group' => $this->_group_index
);
}
public function get($match, $action)
{
$this->_addRoute('GET', $match, $action);
}
public function post($match, $action)
{
$this->_addRoute('POST', $match, $action);
}
public function put($match, $action)
{
$this->_addRoute('PUT', $match, $action);
}
public function delete($match, $action)
{
$this->_addRoute('DELETE', $match, $action);
}
/**
* Dispatch
*/
public function dispatch()
{
$path = $this->getPath();
$method = filter_has_var(INPUT_SERVER, 'REQUEST_METHOD') ? filter_input(INPUT_SERVER, 'REQUEST_METHOD') : 'GET';
$is_routed = 0;
// Match the given route first
if (!empty($this->_routes)) {
foreach ($this->_routes as $route) {
if ($method == $route['method'] && true == ($is_routed = $this->_routeMatch($method, $path, $route))) {
break;
}
}
}
// If not found, then execute the default route
if (!$is_routed) {
$path = explode('/', $path);
// The controller
// url: test-foo-bar -> controller: TestFooBar
$controller = self::DEFAULT_CONTROLLER;
if (!empty($path[0])) {
$cts = explode('-', strtolower($path[0]));
$controller = '';
foreach ($cts as $part) {
$controller .= ucfirst($part);
}
}
// Action
// url: act-foo-bar -> action: actFooBar
$action = self::DEFAULT_ACTION;
if (!empty($path[1])) {
$acts = explode('-', strtolower($path[1]));
$action = '';
foreach ($acts as $part) {
$action .= ucfirst($part);
}
}
// execute
$this->_run($method, $controller, $action);
}
}
/**
* Match specified route
* @param string $path
* @param array $route
*/
protected function _routeMatch($method, $path, $route)
{
$match = $route['match'];
// group
if (null !== $route['group'] && !empty($this->_groups[$route['group']])) {
$group = $this->_groups[$route['group']];
if (!empty($group['prefix'])) {
$match = $group['prefix'] .'/'. $match;
}
}
// match
$pattern = preg_replace('/\{([\w-]+)\}/i', '([\w-]+)', $match);
$pattern = str_replace('/', '\/', $pattern);
$pattern = '/^'. $pattern .'(\/?\?.*)?$/i';
if (preg_match($pattern, $path, $matches)) {
// action
$action_match = explode('@', $route['action']);
$controller = $action_match[0];
$action = empty($action_match[1]) ? self::DEFAULT_ACTION : $action_match[1];
unset($matches[0]);
$this->_run($method, $controller, $action, $matches);
return true;
}
return false;
}
/**
* Run
*/
protected function _run($method, $controller, $action, $params = array())
{
$this->_controller = $controller;
$this->_action = $action;
// Execute controller->action
$controller_file = $this->_controller_path . '/' . $controller . '.php';
if (!is_file($controller_file)) {
throw new NotFoundException('The Controller '. $controller .' is not exists');
}
require_once $controller_file;
// controller class new instance
if ($this->_controller_namespace) {
$controller_class_name = $this->_controller_namespace .'\\'. $controller;
} else {
$controller_class_name = $controller;
}
if (!class_exists($controller_class_name)) {
throw new NotFoundException('The Controller Class '. $controller_class_name .' is invalid');
}
$controller_class = new $controller_class_name($this);
// action call
$action_method = strtolower($method) . ucfirst($action);
if (!method_exists($controller_class, $action_method)) {
throw new NotFoundException('The Action '. $action .' is invalid');
}
if (empty($params)) {
$controller_class->$action_method();
} else {
call_user_func_array(array($controller_class, $action_method), $params);
}
}
public function getController()
{
return $this->_controller;
}
public function getAction()
{
return $this->_action;
}
public function setAction($action)
{
$this->_action = $action;
}
}
| {'content_hash': '3e7a5b9296ee606c7106f2c389191c74', 'timestamp': '', 'source': 'github', 'line_count': 247, 'max_line_length': 144, 'avg_line_length': 28.870445344129553, 'alnum_prop': 0.4808582246529238, 'repo_name': 'SIBPHP/SFrame', 'id': '5f2d39525224a2d4811a512fce5e992896c17731', 'size': '7131', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/SFrame/Router/Route.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '92102'}]} |
package main
| {'content_hash': '8e04bf7504317c96874fc1e40efdd7c2', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 12, 'avg_line_length': 13.0, 'alnum_prop': 0.8461538461538461, 'repo_name': 't-yuki/zipkin-query-go', 'id': '5d9e2a4829af9fd39567cb44fac0b83f52539cc9', 'size': '208', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'gen.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '21995'}]} |
package galileo.comm;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import galileo.dataset.SpatialHint;
import galileo.dataset.feature.FeatureType;
import galileo.event.Event;
import galileo.serialization.SerializationException;
import galileo.serialization.SerializationInputStream;
import galileo.serialization.SerializationOutputStream;
import galileo.util.GeoHash;
import galileo.util.Pair;
/**
* Internal use only. To create or delete file systems in galileo
* @author kachikaran
*
*/
public class FilesystemEvent implements Event{
public static final int MAX_PRECISION = GeoHash.MAX_PRECISION/5;
private String name;
private FilesystemAction action;
private int precision;
private TemporalType temporalType;
private int nodesPerGroup;
private List<Pair<String, FeatureType>> featureList;
private SpatialHint spatialHint;
public FilesystemEvent(String name, FilesystemAction action, List<Pair<String, FeatureType>> featureList,
SpatialHint spatialHint) {
if (name == null || name.trim().length() == 0 || !name.matches("[a-z0-9-]{5,50}"))
throw new IllegalArgumentException(
"name is required and must be lowercase having length at least 5 and at most 50 characters. "
+ "alphabets, numbers and hyphens are allowed.");
if (action == null)
throw new IllegalArgumentException(
"action cannot be null. must be one of the actions specified by galileo.comm.FileSystemAction");
if (featureList != null && spatialHint == null)
throw new IllegalArgumentException("Spatial hint is needed when feature list is provided");
if (this.featureList != null && this.spatialHint != null) {
boolean latOK = false;
boolean lngOK = false;
for (Pair<String, FeatureType> pair : this.featureList) {
if (pair.a.equals(this.spatialHint.getLatitudeHint()) && pair.b == FeatureType.FLOAT)
latOK = true;
else if (pair.a.equals(this.spatialHint.getLongitudeHint()) && pair.b == FeatureType.FLOAT)
lngOK = true;
}
if (!latOK)
throw new IllegalArgumentException(
"latitude hint must be one of the features in feature list and its type must be FeatureType.FLOAT");
if (!lngOK)
throw new IllegalArgumentException(
"longitude hint must be one of the features in feature list and its type must be FeatureType.FLOAT");
}
this.name = name;
this.precision = 4;
this.nodesPerGroup = 0; //zero indicates to make use of the default network organization
this.temporalType = TemporalType.DAY_OF_MONTH;
this.action = action;
this.featureList = featureList;
this.spatialHint = spatialHint;
}
public String getFeatures() {
if (this.featureList == null)
return null;
StringBuffer sb = new StringBuffer();
for (Pair<String, FeatureType> pair : this.featureList) {
sb.append(pair.a + ":" + pair.b.toInt() + ",");
}
sb.setLength(sb.length() - 1);
return sb.toString();
}
private boolean hasFeatures() {
return this.featureList != null;
}
private boolean hasSpatialHint() {
return this.spatialHint != null;
}
public List<Pair<String, FeatureType>> getFeatureList(){
return this.featureList;
}
private List<Pair<String, FeatureType>> getFeatureList(String features) {
if (features == null)
return null;
String[] pairs = features.split(",");
this.featureList = new ArrayList<>();
for (String pair : pairs) {
String[] pairSplit = pair.split(":");
this.featureList.add(
new Pair<String, FeatureType>(pairSplit[0], FeatureType.fromInt(Integer.parseInt(pairSplit[1]))));
}
return this.featureList;
}
public SpatialHint getSpatialHint() {
return this.spatialHint;
}
public void setPrecision(int precision) {
if (precision >=2 && precision <= MAX_PRECISION)
this.precision = precision;
}
public void setTemporalType(TemporalType temporalType) {
if (temporalType != null) {
this.temporalType = temporalType;
}
}
public void setNodesPerGroup(int numNodes) {
if (numNodes > 0)
this.nodesPerGroup = numNodes;
}
public int getNodesPerGroup() {
return this.nodesPerGroup;
}
public int getPrecision() {
return this.precision;
}
public String getName() {
return this.name;
}
public String getTemporalString() {
return this.temporalType.name();
}
public int getTemporalValue() {
return this.temporalType.getType();
}
public TemporalType getTemporalType() {
return this.temporalType;
}
public FilesystemAction getAction() {
return this.action;
}
@Deserialize
public FilesystemEvent(SerializationInputStream in) throws IOException, SerializationException {
this.name = in.readString();
this.precision = in.readInt();
this.action = FilesystemAction.fromAction(in.readString());
this.temporalType = TemporalType.fromType(in.readInt());
this.nodesPerGroup = in.readInt();
if(in.readBoolean())
this.featureList = getFeatureList(in.readString());
if(in.readBoolean())
this.spatialHint = new SpatialHint(in);
}
@Override
public void serialize(SerializationOutputStream out) throws IOException {
out.writeString(this.name);
out.writeInt(this.precision);
out.writeString(this.action.getAction());
out.writeInt(this.temporalType.getType());
out.writeInt(this.nodesPerGroup);
out.writeBoolean(hasFeatures());
if (hasFeatures())
out.writeString(getFeatures());
out.writeBoolean(hasSpatialHint());
if(hasSpatialHint())
this.spatialHint.serialize(out);
}
} | {'content_hash': '524f5192274396d62e4dbd2e86326d2e', 'timestamp': '', 'source': 'github', 'line_count': 180, 'max_line_length': 107, 'avg_line_length': 31.13888888888889, 'alnum_prop': 0.704371097234612, 'repo_name': 'jkachika/galileo', 'id': 'f07e472c98fa7eaa739996023f11f2a00a06524c', 'size': '5605', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/galileo/comm/FilesystemEvent.java', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Java', 'bytes': '921635'}, {'name': 'Shell', 'bytes': '17573'}]} |
package com.dmitrymalkovich.androidgithubapi;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.dmitrymalkovich.androidgithubapi.test", appContext.getPackageName());
}
}
| {'content_hash': '03f431c2c8c36e3de04f7808cbd1e88f', 'timestamp': '', 'source': 'github', 'line_count': 26, 'max_line_length': 95, 'avg_line_length': 30.46153846153846, 'alnum_prop': 0.7626262626262627, 'repo_name': 'DmitryMalkovich/gito-github-client', 'id': '2b85965c169b15a35e234a00ca0f7bea260d8250', 'size': '792', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'github-api/src/androidTest/java/com/dmitrymalkovich/androidgithubapi/ExampleInstrumentedTest.java', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '337028'}]} |
require 'test_helper'
class PatientsControllerTest < ActionDispatch::IntegrationTest
before do
@user = create :user
@admin = create :user, role: :admin
@line = create :line
@data_volunteer = create :user, role: :data_volunteer
sign_in @user
choose_line @line
@clinic = create :clinic
@patient = create :patient,
name: 'Susie Everyteen',
primary_phone: '123-456-7890',
other_phone: '333-444-5555',
line: @line
@archived_patient = create :archived_patient,
line: @line,
initial_call_date: 400.days.ago
end
describe 'index method' do
before do
# Not sure if there is a better way to do this, but just calling
# `sign_in` a second time doesn't work as expected
delete destroy_user_session_path
end
it 'should reject users without access' do
sign_in @user
get patients_path
assert_redirected_to root_path
get patients_path(format: :csv)
assert_redirected_to root_path
end
it 'should not serve html' do
sign_in @data_volunteer
assert_raise ActionController::UnknownFormat do
get patients_path
end
end
it 'should get csv when user is admin' do
sign_in @admin
get patients_path(format: :csv)
assert_response :success
end
it 'should get csv when user is data volunteer' do
sign_in @data_volunteer
get patients_path(format: :csv)
assert_response :success
end
it 'should use proper mimetype' do
sign_in @data_volunteer
get patients_path(format: :csv)
assert_equal 'text/csv', response.content_type.split(';').first
end
it 'should consist of a header line, the patient record, and the archived patient record' do
sign_in @data_volunteer
get patients_path(format: :csv)
lines = response.body.split("\n").reject(&:blank?)
assert_equal 3, lines.count
assert_match @patient.id.to_s, lines[1]
assert_match @archived_patient.id.to_s, lines[2]
end
it 'should not contain personally-identifying information' do
sign_in @data_volunteer
get patients_path(format: :csv)
refute_match @patient.name.to_s, response.body
refute_match @patient.primary_phone.to_s, response.body
refute_match @patient.other_phone.to_s, response.body
end
end
describe 'create method' do
before do
@new_patient = attributes_for :patient, name: 'Test Patient', line_id: @line.id
end
it 'should create and save a new patient' do
assert_difference 'Patient.count', 1 do
post patients_path, params: { patient: @new_patient }
end
end
it 'should redirect to the root path afterwards' do
post patients_path, params: { patient: @new_patient }
assert_redirected_to root_path
end
it 'should fail to save if name is blank' do
@new_patient[:name] = ''
assert_no_difference 'Patient.count' do
post patients_path, params: { patient: @new_patient }
end
end
it 'should fail to save if primary phone is blank' do
@new_patient[:primary_phone] = ''
assert_no_difference 'Patient.count' do
post patients_path, params: { patient: @new_patient }
end
end
it 'should create an associated fulfillment object' do
post patients_path, params: { patient: @new_patient }
assert_not_nil Patient.find_by(name: 'Test Patient').fulfillment
end
end
describe 'edit method' do
before do
get edit_patient_path(@patient)
end
it 'should get edit' do
assert_response :success
end
it 'should redirect to root on a bad id' do
get edit_patient_path('notanid')
assert_redirected_to root_path
end
it 'should contain the current record' do
assert_match /Susie Everyteen/, response.body
assert_match /123-456-7890/, response.body
assert_match /Friendly Clinic/, response.body
end
end
describe 'update method' do
before do
@date = 5.days.from_now.to_date
@payload = {
appointment_date: @date.strftime('%Y-%m-%d'),
name: 'Susie Everyteen 2',
resolved_without_fund: true,
fund_pledge: 100,
clinic_id: @clinic.id
}
patch patient_path(@patient), params: { patient: @payload }, xhr: true
@patient.reload
end
it 'should update pledge fields' do
@payload[:pledge_sent] = true
patch patient_path(@patient), params: { patient: @payload }, xhr: true
@patient.reload
assert_kind_of Time, @patient.pledge_sent_at
assert_kind_of Object, @patient.pledge_sent_by
end
it 'should update last edited by' do
assert_equal @user, @patient.last_edited_by
end
it 'should respond success on completion' do
patch patient_path(@patient), params: { patient: @payload }, xhr: true
assert response.body.include? 'saved'
end
it 'should respond not acceptable error on failure' do
@payload[:primary_phone] = nil
patch patient_path(@patient), params: { patient: @payload }, xhr: true
assert response.body.include? 'alert alert-danger'
end
it 'should update patient fields' do
assert_equal 'Susie Everyteen 2', @patient.name
end
it 'should redirect if record does not exist' do
patch patient_path('notanactualid'), params: { patient: @payload }
assert_redirected_to root_path
end
end
describe 'pledge method' do
it 'should respond success on completion' do
get submit_pledge_path(@patient), xhr: true
assert_response :success
end
end
describe 'data_entry method' do
it 'should respond success on completion' do
get data_entry_path
assert_response :success
end
end
describe 'download' do
it 'should not download a pdf with no case manager name' do
get generate_pledge_patient_path(@patient), params: { case_manager_name: '' }
assert_redirected_to edit_patient_path(@patient)
end
it 'should download a pdf' do
pledge_generator_mock = Minitest::Mock.new
pdf_mock_result = Minitest::Mock.new
pledge_generator_mock.expect(:generate_pledge_pdf, pdf_mock_result)
pdf_mock_result.expect :render, "mow"
assert_nil @patient.pledge_generated_at
PledgeFormGenerator.stub(:new, pledge_generator_mock) do
get generate_pledge_patient_path(@patient), params: { case_manager_name: 'somebody' }
end
refute_nil @patient.reload.pledge_generated_at
refute_nil @patient.reload.pledge_generated_by
assert_response :success
end
end
# confirm sending a 'post' with a payload results in a new patient
describe 'data_entry_create method' do
before do
@test_patient = attributes_for :patient, name: 'Test Patient', line_id: create(:line).id
end
it 'should create and save a new patient' do
assert_difference 'Patient.count', 1 do
post data_entry_create_path, params: { patient: @test_patient }
end
end
it 'should redirect to edit_patient_path afterwards' do
post data_entry_create_path, params: { patient: @test_patient }
@created_patient = Patient.find_by(name: 'Test Patient')
assert_redirected_to edit_patient_path @created_patient
end
it 'should fail to save if name is blank' do
@test_patient[:name] = ''
assert_no_difference 'Patient.count' do
post data_entry_create_path, params: { patient: @test_patient }
end
end
it 'should fail to save if primary phone is blank' do
@test_patient[:primary_phone] = ''
assert_no_difference 'Patient.count' do
post data_entry_create_path, params: { patient: @test_patient }
assert_response :success
end
end
it 'should create an associated fulfillment object' do
post data_entry_create_path, params: { patient: @test_patient }
assert_not_nil Patient.find_by(name: 'Test Patient').fulfillment
end
it 'should fail to save if initial call date is nil' do
@test_patient[:initial_call_date] = nil
@test_patient[:appointment_date] = Date.tomorrow
assert_no_difference 'Patient.count' do
post data_entry_create_path, params: { patient: @test_patient }
assert_response :success
end
end
end
describe 'destroy' do
describe 'authorization' do
it 'should allow admins only' do
[@user, @data_volunteer].each do |user|
delete destroy_user_session_path
sign_in @user
assert_no_difference 'Patient.count' do
delete patient_path(@patient)
end
assert_redirected_to root_url
end
end
end
describe 'behavior' do
before do
delete destroy_user_session_path
sign_in @admin
end
it 'should destroy a patient' do
assert_difference 'Patient.count', -1 do
delete patient_path(@patient)
end
refute_nil flash[:notice]
end
it 'should prevent a patient from being destroyed under some circumstances' do
@patient.update appointment_date: 2.days.from_now,
clinic: (create :clinic),
fund_pledge: 100,
pledge_sent: true
assert_no_difference 'Patient.count' do
delete patient_path(@patient)
end
refute_nil flash[:alert]
end
end
end
end
| {'content_hash': '630747063876b5b08b0de9bba9ea2015', 'timestamp': '', 'source': 'github', 'line_count': 313, 'max_line_length': 96, 'avg_line_length': 30.677316293929714, 'alnum_prop': 0.6352843157675484, 'repo_name': 'Kevin-Wei/dcaf_case_management', 'id': '430337e4edb0731d467a6fc5e537be4abe370290', 'size': '9602', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/controllers/patients_controller_test.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '2210'}, {'name': 'HTML', 'bytes': '93698'}, {'name': 'JavaScript', 'bytes': '23619'}, {'name': 'Makefile', 'bytes': '3658'}, {'name': 'Procfile', 'bytes': '77'}, {'name': 'Ruby', 'bytes': '538608'}, {'name': 'SCSS', 'bytes': '12915'}, {'name': 'Shell', 'bytes': '275'}]} |
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;
public class ComboText : MonoBehaviour
{
[GetComponent] public Text text;
public Game game;
public float punchScale = 1.15f;
public float punchDuration = 0.08f;
public float fadeDuration = 0.1f;
public Ease ease = Ease.OutSine;
private TierState tierState;
private int lastCombo;
private Sequence lastSequence;
private bool exited;
protected void Awake()
{
text.text = "";
text.color = text.color.WithAlpha(0);
game.onGameLoaded.AddListener(_ => OnGameLoaded());
game.onGameBeforeExit.AddListener(_ => OnGameBeforeExit());
}
protected void OnGameLoaded()
{
if (game.State.Mode == GameMode.Tier)
{
tierState = Context.TierState;
}
}
protected void LateUpdate()
{
if (!exited && game.IsLoaded && game.State.IsStarted)
{
if (game.State.Mode == GameMode.Calibration) return;
var combo = tierState?.Combo ?? game.State.Combo;
if (combo != lastCombo)
{
if (combo > 0)
{
lastSequence?.Kill();
transform.localScale = new Vector3((punchScale + 1) / 2f, punchScale, 1);
lastSequence = DOTween.Sequence()
.Append(text.DOFade(1, fadeDuration).SetEase(ease))
.Append(transform.DOScale(1, punchDuration).SetEase(ease));
}
else
{
text.DOFade(0, fadeDuration).SetEase(ease);
}
}
lastCombo = combo;
text.text = lastCombo + "x";
}
}
public void OnGameBeforeExit()
{
exited = true;
text.DOFade(0, fadeDuration).SetEase(ease);
}
} | {'content_hash': 'b3cb86b10ebef85d739f6afd7b851c2c', 'timestamp': '', 'source': 'github', 'line_count': 66, 'max_line_length': 93, 'avg_line_length': 28.545454545454547, 'alnum_prop': 0.5387473460721869, 'repo_name': 'TigerHix/Cytoid', 'id': 'e18871f7143b5dd1db07a9f4a77a008b3278c1b4', 'size': '1884', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'Assets/Scripts/Game/Elements/ComboText.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '457486'}, {'name': 'Objective-C++', 'bytes': '533'}, {'name': 'ShaderLab', 'bytes': '22978'}]} |
using Knightware.Primitives;
using Spyder.Client.Common;
using Spyder.Client.Models.StackupProviders;
using Spyder.Client.Net.DrawingData;
namespace Spyder.Client.Models
{
public class RenderPixelSpace : RenderObject
{
private int id;
public int ID
{
get { return id; }
set
{
if (id != value)
{
id = value;
OnPropertyChanged();
}
}
}
public int X
{
get { return rect.X; }
}
public int Y
{
get { return rect.Y; }
}
public int Width
{
get { return rect.Width; }
}
public int Height
{
get { return rect.Height; }
}
private Rectangle rect;
public Rectangle Rect
{
get { return rect; }
set
{
if (rect != value)
{
rect = value;
OnPropertyChanged();
OnPropertyChanged("X");
OnPropertyChanged("Y");
OnPropertyChanged("Width");
OnPropertyChanged("Height");
}
}
}
private string background0;
public string Background0
{
get { return background0; }
set
{
if (background0 != value)
{
background0 = value;
OnPropertyChanged();
}
}
}
private string background1;
public string Background1
{
get { return background1; }
set
{
if (background1 != value)
{
background1 = value;
OnPropertyChanged();
}
}
}
private double background1Opacity;
public double Background1Opacity
{
get { return background1Opacity; }
set
{
if (background1Opacity != value)
{
background1Opacity = value;
OnPropertyChanged();
}
}
}
private double scale = 1;
public double Scale
{
get { return scale; }
set
{
if (scale != value)
{
scale = value;
OnPropertyChanged();
}
}
}
private double stackupProviderScale = 1;
public double StackupProviderScale
{
get { return stackupProviderScale; }
set
{
if (stackupProviderScale != value)
{
stackupProviderScale = value;
OnPropertyChanged();
}
}
}
public void CopyFrom(DrawingData data, int pixelSpaceID, IStackupProvider stackupProvider = null)
{
var ps = data.GetPixelSpace(pixelSpaceID);
if (ps == null)
return;
CopyFrom(ps, stackupProvider);
}
public void CopyFrom(PixelSpace pixelSpace, IStackupProvider stackupProvider = null)
{
this.ID = pixelSpace.ID;
this.Rect = (stackupProvider == null ? pixelSpace.Rect : stackupProvider.GenerateOffsetRect(pixelSpace.Rect, pixelSpace.ID));
this.StackupProviderScale = Rect.Width / ((double)pixelSpace.Rect.Width / pixelSpace.Scale);
this.Scale = pixelSpace.Scale;
this.ZIndex = pixelSpace.ID;
var drawingPs = pixelSpace as DrawingPixelSpace;
if (drawingPs == null)
{
this.Background0 = pixelSpace.NextBackgroundStill;
this.Background1Opacity = 0;
}
else
{
this.Background1Opacity = ((255 - drawingPs.Layer1Transparency) / (double)255);
if (drawingPs.NextBackgroundStillIsOnLayer1)
{
this.Background0 = pixelSpace.LastBackgroundStill;
this.Background1 = pixelSpace.NextBackgroundStill;
}
else
{
this.Background0 = pixelSpace.NextBackgroundStill;
this.Background1 = pixelSpace.LastBackgroundStill;
}
}
}
}
}
| {'content_hash': '37a0923f22bc9abb3b885af9c229afac', 'timestamp': '', 'source': 'github', 'line_count': 172, 'max_line_length': 137, 'avg_line_length': 26.99418604651163, 'alnum_prop': 0.44626319190178765, 'repo_name': 'dsmithson/SpyderClientLibrary', 'id': '3805ad529ee0bfd26a793481257df14f32fc7b94', 'size': '4645', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/SpyderClientLibrary/Models/RenderPixelSpace.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '1116171'}]} |
package http2curl
import (
"bytes"
"fmt"
"net/http"
"testing"
. "github.com/scaleway/scaleway-cli/vendor/github.com/smartystreets/goconvey/convey"
)
func ExampleGetCurlCommand() {
req, _ := http.NewRequest("PUT", "http://www.example.com/abc/def.ghi?jlk=mno&pqr=stu", bytes.NewBufferString(`{"hello":"world","answer":42}`))
req.Header.Set("Content-Type", "application/json")
command, _ := GetCurlCommand(req)
fmt.Println(command)
// Output:
// curl -X PUT -d "{\"hello\":\"world\",\"answer\":42}" -H "Content-Type: application/json" http://www.example.com/abc/def.ghi?jlk=mno&pqr=stu
}
func TestGetCurlCommand(t *testing.T) {
Convey("Testing http2curl", t, func() {
uri := "http://www.example.com/abc/def.ghi?jlk=mno&pqr=stu"
payload := new(bytes.Buffer)
payload.Write([]byte(`{"hello":"world","answer":42}`))
req, err := http.NewRequest("PUT", uri, payload)
So(err, ShouldBeNil)
req.Header.Set("X-Auth-Token", "private-token")
req.Header.Set("Content-Type", "application/json")
command, err := GetCurlCommand(req)
So(err, ShouldBeNil)
expected := `curl -X PUT -d "{\"hello\":\"world\",\"answer\":42}" -H "X-Auth-Token: private-token" -H "Content-Type: application/json" http://www.example.com/abc/def.ghi?jlk=mno&pqr=stu`
So(command.String(), ShouldEqual, expected)
})
}
| {'content_hash': 'b691d49ec920f4bccbd4fb6935f14af3', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 188, 'avg_line_length': 34.55263157894737, 'alnum_prop': 0.6755521706016756, 'repo_name': 'ebfe/scaleway-cli', 'id': 'd53e6a31a2c9a944417b8eefd49171f6b153ad33', 'size': '1313', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'vendor/github.com/moul/http2curl/http2curl_test.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '237743'}, {'name': 'Makefile', 'bytes': '5555'}, {'name': 'Ruby', 'bytes': '1319'}, {'name': 'Shell', 'bytes': '20832'}, {'name': 'Smarty', 'bytes': '434'}]} |
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>DestinyItemComponentSetOfuint32 | The Traveler</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">The Traveler</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="destinyitemcomponentsetofuint32.html">DestinyItemComponentSetOfuint32</a>
</li>
</ul>
<h1>Interface DestinyItemComponentSetOfuint32</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">DestinyItemComponentSetOfuint32</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section tsd-is-external">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="destinyitemcomponentsetofuint32.html#instances" class="tsd-kind-icon">instances</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="destinyitemcomponentsetofuint32.html#objectives" class="tsd-kind-icon">objectives</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="destinyitemcomponentsetofuint32.html#perks" class="tsd-kind-icon">perks</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="destinyitemcomponentsetofuint32.html#plugstates" class="tsd-kind-icon">plug<wbr>States</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="destinyitemcomponentsetofuint32.html#renderdata" class="tsd-kind-icon">render<wbr>Data</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="destinyitemcomponentsetofuint32.html#sockets" class="tsd-kind-icon">sockets</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="destinyitemcomponentsetofuint32.html#stats" class="tsd-kind-icon">stats</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface tsd-is-external"><a href="destinyitemcomponentsetofuint32.html#talentgrids" class="tsd-kind-icon">talent<wbr>Grids</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-external">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a name="instances" class="tsd-anchor"></a>
<h3>instances</h3>
<div class="tsd-signature tsd-kind-icon">instances<span class="tsd-signature-symbol">:</span> <a href="dictionarycomponentresponse.html" class="tsd-signature-type">DictionaryComponentResponse</a><span class="tsd-signature-symbol"><</span><a href="destinyiteminstancecomponent.html" class="tsd-signature-type">DestinyItemInstanceComponent</a><span class="tsd-signature-symbol">></span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/alexanderwe/the-traveler/blob/bfd7db0/src/type-definitions/destiny2/interfaces.ts#L11167">type-definitions/destiny2/interfaces.ts:11167</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a name="objectives" class="tsd-anchor"></a>
<h3>objectives</h3>
<div class="tsd-signature tsd-kind-icon">objectives<span class="tsd-signature-symbol">:</span> <a href="dictionarycomponentresponse.html" class="tsd-signature-type">DictionaryComponentResponse</a><span class="tsd-signature-symbol"><</span><a href="destinyitemobjectivescomponent.html" class="tsd-signature-type">DestinyItemObjectivesComponent</a><span class="tsd-signature-symbol">></span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/alexanderwe/the-traveler/blob/bfd7db0/src/type-definitions/destiny2/interfaces.ts#L11174">type-definitions/destiny2/interfaces.ts:11174</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a name="perks" class="tsd-anchor"></a>
<h3>perks</h3>
<div class="tsd-signature tsd-kind-icon">perks<span class="tsd-signature-symbol">:</span> <a href="dictionarycomponentresponse.html" class="tsd-signature-type">DictionaryComponentResponse</a><span class="tsd-signature-symbol"><</span><a href="destinyitemperkscomponent.html" class="tsd-signature-type">DestinyItemPerksComponent</a><span class="tsd-signature-symbol">></span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/alexanderwe/the-traveler/blob/bfd7db0/src/type-definitions/destiny2/interfaces.ts#L11168">type-definitions/destiny2/interfaces.ts:11168</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a name="plugstates" class="tsd-anchor"></a>
<h3>plug<wbr>States</h3>
<div class="tsd-signature tsd-kind-icon">plug<wbr>States<span class="tsd-signature-symbol">:</span> <a href="dictionarycomponentresponse.html" class="tsd-signature-type">DictionaryComponentResponse</a><span class="tsd-signature-symbol"><</span><a href="destinyitemplugcomponent.html" class="tsd-signature-type">DestinyItemPlugComponent</a><span class="tsd-signature-symbol">></span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/alexanderwe/the-traveler/blob/bfd7db0/src/type-definitions/destiny2/interfaces.ts#L11173">type-definitions/destiny2/interfaces.ts:11173</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a name="renderdata" class="tsd-anchor"></a>
<h3>render<wbr>Data</h3>
<div class="tsd-signature tsd-kind-icon">render<wbr>Data<span class="tsd-signature-symbol">:</span> <a href="dictionarycomponentresponse.html" class="tsd-signature-type">DictionaryComponentResponse</a><span class="tsd-signature-symbol"><</span><a href="destinyitemrendercomponent.html" class="tsd-signature-type">DestinyItemRenderComponent</a><span class="tsd-signature-symbol">></span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/alexanderwe/the-traveler/blob/bfd7db0/src/type-definitions/destiny2/interfaces.ts#L11169">type-definitions/destiny2/interfaces.ts:11169</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a name="sockets" class="tsd-anchor"></a>
<h3>sockets</h3>
<div class="tsd-signature tsd-kind-icon">sockets<span class="tsd-signature-symbol">:</span> <a href="dictionarycomponentresponse.html" class="tsd-signature-type">DictionaryComponentResponse</a><span class="tsd-signature-symbol"><</span><a href="destinyitemsocketscomponent.html" class="tsd-signature-type">DestinyItemSocketsComponent</a><span class="tsd-signature-symbol">></span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/alexanderwe/the-traveler/blob/bfd7db0/src/type-definitions/destiny2/interfaces.ts#L11171">type-definitions/destiny2/interfaces.ts:11171</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a name="stats" class="tsd-anchor"></a>
<h3>stats</h3>
<div class="tsd-signature tsd-kind-icon">stats<span class="tsd-signature-symbol">:</span> <a href="dictionarycomponentresponse.html" class="tsd-signature-type">DictionaryComponentResponse</a><span class="tsd-signature-symbol"><</span><a href="destinyitemstatscomponent.html" class="tsd-signature-type">DestinyItemStatsComponent</a><span class="tsd-signature-symbol">></span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/alexanderwe/the-traveler/blob/bfd7db0/src/type-definitions/destiny2/interfaces.ts#L11170">type-definitions/destiny2/interfaces.ts:11170</a></li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a name="talentgrids" class="tsd-anchor"></a>
<h3>talent<wbr>Grids</h3>
<div class="tsd-signature tsd-kind-icon">talent<wbr>Grids<span class="tsd-signature-symbol">:</span> <a href="dictionarycomponentresponse.html" class="tsd-signature-type">DictionaryComponentResponse</a><span class="tsd-signature-symbol"><</span><a href="destinyitemtalentgridcomponent.html" class="tsd-signature-type">DestinyItemTalentGridComponent</a><span class="tsd-signature-symbol">></span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/alexanderwe/the-traveler/blob/bfd7db0/src/type-definitions/destiny2/interfaces.ts#L11172">type-definitions/destiny2/interfaces.ts:11172</a></li>
</ul>
</aside>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Globals</em></a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
</ul>
<ul class="current">
<li class="current tsd-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html" class="tsd-kind-icon">Destiny<wbr>Item<wbr>Component<wbr>Set<wbr>Ofuint32</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html#instances" class="tsd-kind-icon">instances</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html#objectives" class="tsd-kind-icon">objectives</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html#perks" class="tsd-kind-icon">perks</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html#plugstates" class="tsd-kind-icon">plug<wbr>States</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html#renderdata" class="tsd-kind-icon">render<wbr>Data</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html#sockets" class="tsd-kind-icon">sockets</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html#stats" class="tsd-kind-icon">stats</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-external">
<a href="destinyitemcomponentsetofuint32.html#talentgrids" class="tsd-kind-icon">talent<wbr>Grids</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html> | {'content_hash': 'a51fba0502fbac8c957fcedc9e45a2cc', 'timestamp': '', 'source': 'github', 'line_count': 292, 'max_line_length': 412, 'avg_line_length': 62.76027397260274, 'alnum_prop': 0.6909309178216742, 'repo_name': 'alexanderwe/the-traveler', 'id': '2942d5541fff04aa6a5aae69047927afaea645b0', 'size': '18326', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/interfaces/destinyitemcomponentsetofuint32.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '298'}, {'name': 'TypeScript', 'bytes': '690965'}]} |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using Azure.Core;
namespace Azure.AI.MetricsAdvisor.Models
{
internal partial class DataFeedDetail
{
public string DataFeedId { get; }
/// <summary> dimension list. </summary>
public IList<DataFeedDimension> Dimension { get; }
/// <summary> data feed administrator. </summary>
public IList<string> Admins { get; }
/// <summary> data feed viewer. </summary>
public IList<string> Viewers { get; }
/// <summary> roll up columns. </summary>
public IList<string> RollUpColumns { get; }
/// <summary> Initializes a new instance of DataFeedDetail. </summary>
/// <param name="dataFeedName"> data feed name. </param>
/// <param name="granularityName"> granularity of the time series. </param>
/// <param name="metrics"> measure list. </param>
/// <param name="dataStartFrom"> ingestion start time. </param>
/// <exception cref="ArgumentNullException"> <paramref name="dataFeedName"/> or <paramref name="metrics"/> is null. </exception>
public DataFeedDetail(string dataFeedName, DataFeedGranularityType granularityName, IEnumerable<DataFeedMetric> metrics, DateTimeOffset dataStartFrom)
{
Argument.AssertNotNullOrEmpty(dataFeedName, nameof(dataFeedName));
Argument.AssertNotNullOrEmpty(metrics, nameof(metrics));
DataFeedName = dataFeedName;
GranularityName = granularityName;
Metrics = metrics.ToList();
Dimension = new ChangeTrackingList<DataFeedDimension>();
DataStartFrom = dataStartFrom;
RollUpColumns = new ChangeTrackingList<string>();
Admins = new ChangeTrackingList<string>();
Viewers = new ChangeTrackingList<string>();
}
/// <summary> Initializes a new instance of DataFeedDetail. </summary>
/// <param name="dataSourceType"> data source type. </param>
/// <param name="dataFeedId"> data feed unique id. </param>
/// <param name="dataFeedName"> data feed name. </param>
/// <param name="dataFeedDescription"> data feed description. </param>
/// <param name="granularityName"> granularity of the time series. </param>
/// <param name="granularityAmount"> if granularity is custom,it is required. </param>
/// <param name="metrics"> measure list. </param>
/// <param name="dimension"> dimension list. </param>
/// <param name="timestampColumn"> user-defined timestamp column. if timestampColumn is null, start time of every time slice will be used as default value. </param>
/// <param name="dataStartFrom"> ingestion start time. </param>
/// <param name="startOffsetInSeconds"> the time that the beginning of data ingestion task will delay for every data slice according to this offset. </param>
/// <param name="maxConcurrency"> the max concurrency of data ingestion queries against user data source. 0 means no limitation. </param>
/// <param name="minRetryIntervalInSeconds"> the min retry interval for failed data ingestion tasks. </param>
/// <param name="stopRetryAfterInSeconds"> stop retry data ingestion after the data slice first schedule time in seconds. </param>
/// <param name="needRollup"> mark if the data feed need rollup. </param>
/// <param name="rollUpMethod"> roll up method. </param>
/// <param name="rollUpColumns"> roll up columns. </param>
/// <param name="allUpIdentification"> the identification value for the row of calculated all-up value. </param>
/// <param name="fillMissingPointType"> the type of fill missing point for anomaly detection. </param>
/// <param name="fillMissingPointValue"> the value of fill missing point for anomaly detection. </param>
/// <param name="viewMode"> data feed access mode, default is Private. </param>
/// <param name="admins"> data feed administrator. </param>
/// <param name="viewers"> data feed viewer. </param>
/// <param name="isAdmin"> the query user is one of data feed administrator or not. </param>
/// <param name="creator"> data feed creator. </param>
/// <param name="status"> data feed status. </param>
/// <param name="createdTime"> data feed created time. </param>
/// <param name="actionLinkTemplate"> action link for alert. </param>
/// <exception cref="ArgumentNullException"> <paramref name="dataFeedName"/> or <paramref name="metrics"/> is null. </exception>
internal DataFeedDetail(DataFeedSourceKind dataSourceType, string dataFeedId, string dataFeedName, string dataFeedDescription, DataFeedGranularityType granularityName, int? granularityAmount, IList<DataFeedMetric> metrics, IList<DataFeedDimension> dimension, string timestampColumn, DateTimeOffset dataStartFrom, long? startOffsetInSeconds, int? maxConcurrency, long? minRetryIntervalInSeconds, long? stopRetryAfterInSeconds, DataFeedRollupType? needRollup, DataFeedAutoRollupMethod? rollUpMethod, IList<string> rollUpColumns, string allUpIdentification, DataFeedMissingDataPointFillType? fillMissingPointType, double? fillMissingPointValue, DataFeedAccessMode? viewMode, IList<string> admins, IList<string> viewers, bool? isAdmin, string creator, DataFeedStatus? status, DateTimeOffset? createdTime, string actionLinkTemplate)
{
Argument.AssertNotNullOrEmpty(dataFeedName, nameof(dataFeedName));
Argument.AssertNotNullOrEmpty(metrics, nameof(metrics));
DataSourceType = dataSourceType;
DataFeedId = dataFeedId;
DataFeedName = dataFeedName;
DataFeedDescription = dataFeedDescription;
GranularityName = granularityName;
GranularityAmount = granularityAmount;
Metrics = metrics;
Dimension = dimension ?? new ChangeTrackingList<DataFeedDimension>();
TimestampColumn = timestampColumn;
DataStartFrom = dataStartFrom;
StartOffsetInSeconds = startOffsetInSeconds;
MaxConcurrency = maxConcurrency;
MinRetryIntervalInSeconds = minRetryIntervalInSeconds;
StopRetryAfterInSeconds = stopRetryAfterInSeconds;
NeedRollup = needRollup;
RollUpMethod = rollUpMethod;
RollUpColumns = rollUpColumns ?? new ChangeTrackingList<string>();
AllUpIdentification = allUpIdentification;
FillMissingPointType = fillMissingPointType;
FillMissingPointValue = fillMissingPointValue;
ViewMode = viewMode;
Admins = admins ?? new ChangeTrackingList<string>();
Viewers = viewers ?? new ChangeTrackingList<string>();
IsAdmin = isAdmin;
Creator = creator;
Status = status;
CreatedTime = createdTime;
ActionLinkTemplate = actionLinkTemplate;
}
}
}
| {'content_hash': '5dc93e00f5a504ae4656ff64313e3bde', 'timestamp': '', 'source': 'github', 'line_count': 115, 'max_line_length': 835, 'avg_line_length': 62.17391304347826, 'alnum_prop': 0.6763636363636364, 'repo_name': 'AsrOneSdk/azure-sdk-for-net', 'id': 'f22af08b1af6e2cec7c2dc0d5ea1f9d454113058', 'size': '7152', 'binary': False, 'copies': '2', 'ref': 'refs/heads/psSdkJson6Current', 'path': 'sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Models/CodeGenInternal/DataFeedDetail.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '15473'}, {'name': 'Bicep', 'bytes': '13438'}, {'name': 'C#', 'bytes': '72203239'}, {'name': 'CSS', 'bytes': '6089'}, {'name': 'Dockerfile', 'bytes': '5652'}, {'name': 'HTML', 'bytes': '6169271'}, {'name': 'JavaScript', 'bytes': '16012'}, {'name': 'PowerShell', 'bytes': '649218'}, {'name': 'Shell', 'bytes': '31287'}, {'name': 'Smarty', 'bytes': '11135'}]} |
import { Observable } from '../../Observable';
import { audit } from '../../operator/audit';
Observable.prototype.audit = audit;
| {'content_hash': '994875d83553087a979e913fa6ce0b85', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 46, 'avg_line_length': 43.0, 'alnum_prop': 0.6744186046511628, 'repo_name': 'thelgevold/closure-compiler-angular-bundling', 'id': 'e0df48701d2c2c170aae7e76a693322bbf2416f1', 'size': '129', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'vendor/rxjs/add/operator/audit.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '31'}, {'name': 'HTML', 'bytes': '1994'}, {'name': 'Shell', 'bytes': '2007'}, {'name': 'TypeScript', 'bytes': '6220'}]} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Selenium::WebDriver::Chrome::Launcher</title>
<link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
relpath = '../../..';
if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
</head>
<body>
<script type="text/javascript" charset="utf-8">
if (window.top.frames.main) document.body.className = 'frames';
</script>
<div id="header">
<div id="menu">
<a href="../../../_index.html">Index (L)</a> »
<span class='title'><a href="../../../Selenium.html" title="Selenium (module)">Selenium</a></span> » <span class='title'><a href="../../WebDriver.html" title="Selenium::WebDriver (module)">WebDriver</a></span> » <span class='title'><a href="../Chrome.html" title="Selenium::WebDriver::Chrome (module)">Chrome</a></span>
»
<span class="title">Launcher</span>
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>
<div id="search">
<a id="class_list_link" href="#">Class List</a>
<a id="method_list_link" href="#">Method List</a>
<a id ="file_list_link" href="#">File List</a>
</div>
<div class="clear"></div>
</div>
<iframe id="search_frame"></iframe>
<div id="content"><h1>Class: Selenium::WebDriver::Chrome::Launcher
</h1>
<dl class="box">
<dt class="r1">Inherits:</dt>
<dd class="r1">
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Selenium::WebDriver::Chrome::Launcher</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
<dt class="r2">Includes:</dt>
<dd class="r2">FileUtils</dd>
<dt class="r1 last">Defined in:</dt>
<dd class="r1 last">chrome/src/rb/lib/selenium/webdriver/chrome/launcher.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><a href="Launcher/UnixLauncher.html" title="Selenium::WebDriver::Chrome::Launcher::UnixLauncher (class)">Launcher::UnixLauncher</a>, <a href="Launcher/WindowsLauncher.html" title="Selenium::WebDriver::Chrome::Launcher::WindowsLauncher (class)">Launcher::WindowsLauncher</a></p>
</div>
<h2>Instance Attribute Summary</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#pid-instance_method" title="#pid (instance method)">- (Object) <strong>pid</strong> </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc">
Returns the value of attribute pid.
</span>
</li>
</ul>
<h2>Class Method Summary</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#binary_path-class_method" title="binary_path (class method)">+ (Object) <strong>binary_path</strong> </a>
</span>
<span class="summary_desc"></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#launcher-class_method" title="launcher (class method)">+ (Object) <strong>launcher</strong> </a>
</span>
<span class="summary_desc"></span>
</li>
</ul>
<h2>Instance Method Summary</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#kill-instance_method" title="#kill (instance method)">- (Object) <strong>kill</strong> </a>
</span>
<span class="summary_desc"></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#launch-instance_method" title="#launch (instance method)">- (Object) <strong>launch</strong>(server_url) </a>
</span>
<span class="summary_desc"></span>
</li>
</ul>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id=""></span>
<span id="pid-instance_method"></span>
<div class="method_details first">
<p class="signature first" id="pid-instance_method">
- (<tt>Object</tt>) <strong>pid</strong> <span class="extras">(readonly)</span>
</p><div class="docstring">
<div class="discussion">
<p>
Returns the value of attribute pid
</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
9
10
11</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'chrome/src/rb/lib/selenium/webdriver/chrome/launcher.rb', line 9</span>
<span class='def def kw'>def</span> <span class='pid identifier id'>pid</span>
<span class='@pid ivar id'>@pid</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
</div>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<p class="signature first" id="binary_path-class_method">
+ (<tt>Object</tt>) <strong>binary_path</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
26
27
28
29
30
31</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'chrome/src/rb/lib/selenium/webdriver/chrome/launcher.rb', line 26</span>
<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='binary_path identifier id'>binary_path</span>
<span class='@binary_path ivar id'>@binary_path</span> <span class='opasgn op'>||=</span> <span class='lparen token'>(</span>
<span class='path identifier id'>path</span> <span class='assign token'>=</span> <span class='possible_paths identifier id'>possible_paths</span><span class='dot token'>.</span><span class='find identifier id'>find</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='f identifier id'>f</span><span class='bitor op'>|</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='exist? fid id'>exist?</span><span class='lparen token'>(</span><span class='f identifier id'>f</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span>
<span class='path identifier id'>path</span> <span class='orop op'>||</span> <span class='raise identifier id'>raise</span><span class='lparen token'>(</span><span class='Error constant id'>Error</span><span class='colon2 op'>::</span><span class='WebDriverError constant id'>WebDriverError</span><span class='comma token'>,</span> <span class='dstring node'>"Could not find Chrome binary. Make sure Chrome is installed (OS: #{Platform.os})"</span><span class='rparen token'>)</span>
<span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="launcher-class_method">
+ (<tt>Object</tt>) <strong>launcher</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
11
12
13
14
15
16
17
18
19
20
21
22
23
24</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'chrome/src/rb/lib/selenium/webdriver/chrome/launcher.rb', line 11</span>
<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='launcher identifier id'>launcher</span>
<span class='launcher identifier id'>launcher</span> <span class='assign token'>=</span> <span class='case case kw'>case</span> <span class='Platform constant id'>Platform</span><span class='dot token'>.</span><span class='os identifier id'>os</span>
<span class='when when kw'>when</span> <span class='symbol val'>:windows</span>
<span class='WindowsLauncher constant id'>WindowsLauncher</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
<span class='when when kw'>when</span> <span class='symbol val'>:macosx</span>
<span class='MacOSXLauncher constant id'>MacOSXLauncher</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
<span class='when when kw'>when</span> <span class='symbol val'>:unix</span><span class='comma token'>,</span> <span class='symbol val'>:linux</span>
<span class='UnixLauncher constant id'>UnixLauncher</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
<span class='else else kw'>else</span>
<span class='raise identifier id'>raise</span> <span class='dstring node'>"unknown OS: #{Platform.os}"</span>
<span class='end end kw'>end</span>
<span class='launcher identifier id'>launcher</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<p class="signature first" id="kill-instance_method">
- (<tt>Object</tt>) <strong>kill</strong>
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
41
42
43</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'chrome/src/rb/lib/selenium/webdriver/chrome/launcher.rb', line 41</span>
<span class='def def kw'>def</span> <span class='kill identifier id'>kill</span>
<span class='@process ivar id'>@process</span><span class='dot token'>.</span><span class='kill identifier id'>kill</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<p class="signature " id="launch-instance_method">
- (<tt>Object</tt>) <strong>launch</strong>(server_url)
</p><table class="source_code">
<tr>
<td>
<pre class="lines">
33
34
35
36
37
38
39</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'chrome/src/rb/lib/selenium/webdriver/chrome/launcher.rb', line 33</span>
<span class='def def kw'>def</span> <span class='launch identifier id'>launch</span><span class='lparen token'>(</span><span class='server_url identifier id'>server_url</span><span class='rparen token'>)</span>
<span class='create_extension identifier id'>create_extension</span>
<span class='create_profile identifier id'>create_profile</span>
<span class='launch_chrome identifier id'>launch_chrome</span> <span class='server_url identifier id'>server_url</span>
<span class='pid identifier id'>pid</span>
<span class='end end kw'>end</span>
</pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Wed Apr 21 13:36:26 2010 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
0.5.3 (ruby-1.8.7).
</div>
</body>
</html> | {'content_hash': '1b047e9bcff6e08cd34eedf96209a144', 'timestamp': '', 'source': 'github', 'line_count': 446, 'max_line_length': 622, 'avg_line_length': 26.634529147982065, 'alnum_prop': 0.6114992844515532, 'repo_name': 'mfazekas/safaridriver', 'id': '86d6f7a5e48d2a4943261cdaa96b1707235b3a98', 'size': '11879', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/api/rb/Selenium/WebDriver/Chrome/Launcher.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '853'}, {'name': 'C', 'bytes': '17707'}, {'name': 'C#', 'bytes': '1142439'}, {'name': 'C++', 'bytes': '9351513'}, {'name': 'Java', 'bytes': '4942599'}, {'name': 'JavaScript', 'bytes': '11288115'}, {'name': 'Objective-C', 'bytes': '210758'}, {'name': 'Python', 'bytes': '2142248'}, {'name': 'Ruby', 'bytes': '181980'}, {'name': 'Shell', 'bytes': '7226'}]} |
package com.example.mihael.scanapp;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
public class SplashScreen extends AppCompatActivity {
private final int SPLASH_DISPLAY_LENGTH = 2000;
private static final String TEXT_TYPE = " TEXT";
private static final String URL = "https://tranquil-mountain-52969.herokuapp.com/barcodes/";
FeedReaderDbHelper mDbHelper;
public static final String SQL_CREATE_ENTRIES =
"CREATE TABLE " + FeedReaderContract.FeedEntry.TABLE_NAME + " (" +
FeedReaderContract.FeedEntry.COLUMN_NAME_ENTRY_ID + " INTEGER PRIMARY KEY," +
FeedReaderContract.FeedEntry.COLUMN_NAME_DESCRIPTION + TEXT_TYPE +
" )";
public static final String SQL_DELETE_ENTRIES =
"DROP TABLE IF EXISTS " + FeedReaderContract.FeedEntry.TABLE_NAME;
private String TAG = "SplashScreen";
private class GetDataFromAPIAsyncTask extends AsyncTask<Void, Void, String> {
@Override
protected String doInBackground(Void... params) {
try {
URL url = new URL(URL);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.connect();
// log info
Log.i(TAG, String.format("Connecting to %s", url.toString()));
Log.i(TAG, String.format("HTTP Status Code: %d", connection.getResponseCode()));
// if result differs from HTTP status code 200 (OK), quit
if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) {
return null;
}
// get the result as String
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
StringBuilder stringBuilder = new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) {
stringBuilder.append(line + '\n');
}
// show the result in log
Log.i(TAG, String.format("GET: %s", stringBuilder.toString()));
// return the result as JSONObject
return stringBuilder.toString();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return "{}";
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
JSONArray json = null;
SQLiteDatabase db = mDbHelper.getWritableDatabase();
try {
json = new JSONArray(result);
for (int i = 0; i < json.length(); i++) {
JSONObject jsonObject = (JSONObject) json.get(i);
String barcode = jsonObject.getString("barcode");
String qrcode = jsonObject.getString("qrCode");
try {
ContentValues values = new ContentValues();
values.put(FeedReaderContract.FeedEntry.COLUMN_NAME_ENTRY_ID, barcode);
values.put(FeedReaderContract.FeedEntry.COLUMN_NAME_DESCRIPTION, qrcode);
long newRowId;
newRowId = db.insert(FeedReaderContract.FeedEntry.TABLE_NAME,
null,
values);
} catch (Exception e) {
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
mDbHelper = new FeedReaderDbHelper(this);
SQLiteDatabase db = mDbHelper.getWritableDatabase();
HashMap<String, String> data = DBImmitator.getInstance().getTranslator();
if (isNetworkAvailable()) {
fetchDataFromAPI();
} else {
for (String piece : data.keySet()) {
try {
ContentValues values = new ContentValues();
values.put(FeedReaderContract.FeedEntry.COLUMN_NAME_ENTRY_ID, piece);
values.put(FeedReaderContract.FeedEntry.COLUMN_NAME_DESCRIPTION, data.get(piece));
long newRowId;
newRowId = db.insert(FeedReaderContract.FeedEntry.TABLE_NAME,
null,
values);
} catch (Exception e) {
}
}
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
/* Create an Intent that will start the Menu-Activity. */
Intent mainIntent = new Intent(SplashScreen.this, BarcodeScanActivity.class);
SplashScreen.this.startActivity(mainIntent);
SplashScreen.this.finish();
}
}, SPLASH_DISPLAY_LENGTH);
}
private void fetchDataFromAPI() {
GetDataFromAPIAsyncTask task = new GetDataFromAPIAsyncTask();
task.execute();
}
private boolean isNetworkAvailable() {
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
} | {'content_hash': 'aa4963c74ce4a4afbfe3f8d20ef172c5', 'timestamp': '', 'source': 'github', 'line_count': 167, 'max_line_length': 119, 'avg_line_length': 37.77245508982036, 'alnum_prop': 0.5892517438173748, 'repo_name': 'typhoon994/ScanApp', 'id': 'd0286075363be7bcdcd30f356cbf116f4c75a946', 'size': '6308', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/example/mihael/scanapp/SplashScreen.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '19352'}]} |
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/tools/designer/src/lib/sdk/abstractactioneditor.cpp -->
<head>
<title>Qt 4.3: List of All Members for QDesignerActionEditorInterface</title>
<link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">List of All Members for QDesignerActionEditorInterface</h1>
<p>This is the complete list of members for <a href="qdesigneractioneditorinterface.html">QDesignerActionEditorInterface</a>, including inherited members.</p>
<p><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"/>enum <a href="qpaintdevice.html#PaintDeviceMetric-enum">PaintDeviceMetric</a></li>
<li><div class="fn"/>enum <a href="qwidget.html#RenderFlag-enum">RenderFlag</a></li>
<li><div class="fn"/>flags <a href="qwidget.html#RenderFlag-enum">RenderFlags</a></li>
<li><div class="fn"/><a href="qdesigneractioneditorinterface.html#QDesignerActionEditorInterface">QDesignerActionEditorInterface</a> ( QWidget *, Qt::WindowFlags )</li>
<li><div class="fn"/><a href="qdesigneractioneditorinterface.html#dtor.QDesignerActionEditorInterface">~QDesignerActionEditorInterface</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#acceptDrops-prop">acceptDrops</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#accessibleDescription-prop">accessibleDescription</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#accessibleName-prop">accessibleName</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#actionEvent">actionEvent</a> ( QActionEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#actions">actions</a> () const : QList<QAction *></li>
<li><div class="fn"/><a href="qwidget.html#activateWindow">activateWindow</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#addAction">addAction</a> ( QAction * )</li>
<li><div class="fn"/><a href="qwidget.html#addActions">addActions</a> ( QList<QAction *> )</li>
<li><div class="fn"/><a href="qwidget.html#adjustSize">adjustSize</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#autoFillBackground-prop">autoFillBackground</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#backgroundRole">backgroundRole</a> () const : QPalette::ColorRole</li>
<li><div class="fn"/><a href="qwidget.html#baseSize-prop">baseSize</a> () const : QSize</li>
<li><div class="fn"/><a href="qobject.html#blockSignals">blockSignals</a> ( bool ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#changeEvent">changeEvent</a> ( QEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#childAt">childAt</a> ( int, int ) const : QWidget *</li>
<li><div class="fn"/><a href="qwidget.html#childAt-4">childAt</a> ( const QPoint & ) const : QWidget *</li>
<li><div class="fn"/><a href="qobject.html#childEvent">childEvent</a> ( QChildEvent * )</li>
<li><div class="fn"/><a href="qobject.html#children">children</a> () const : const QObjectList &</li>
<li><div class="fn"/><a href="qwidget.html#childrenRect-prop">childrenRect</a> () const : QRect</li>
<li><div class="fn"/><a href="qwidget.html#childrenRegion-prop">childrenRegion</a> () const : QRegion</li>
<li><div class="fn"/><a href="qwidget.html#clearFocus">clearFocus</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#clearMask">clearMask</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#close">close</a> () : bool</li>
<li><div class="fn"/><a href="qwidget.html#closeEvent">closeEvent</a> ( QCloseEvent * )</li>
<li><div class="fn"/><a href="qobject.html#connect">connect</a> ( const QObject *, const char *, const QObject *, const char *, Qt::ConnectionType ) : bool</li>
<li><div class="fn"/><a href="qobject.html#connect-2">connect</a> ( const QObject *, const char *, const char *, Qt::ConnectionType ) const : bool</li>
<li><div class="fn"/><a href="qobject.html#connectNotify">connectNotify</a> ( const char * )</li>
<li><div class="fn"/><a href="qwidget.html#contentsRect">contentsRect</a> () const : QRect</li>
<li><div class="fn"/><a href="qwidget.html#contextMenuEvent">contextMenuEvent</a> ( QContextMenuEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#contextMenuPolicy-prop">contextMenuPolicy</a> () const : Qt::ContextMenuPolicy</li>
<li><div class="fn"/><a href="qdesigneractioneditorinterface.html#core">core</a> () const : QDesignerFormEditorInterface *</li>
<li><div class="fn"/><a href="qwidget.html#create">create</a> ( WId, bool, bool )</li>
<li><div class="fn"/><a href="qwidget.html#cursor-prop">cursor</a> () const : QCursor</li>
<li><div class="fn"/><a href="qwidget.html#customContextMenuRequested">customContextMenuRequested</a> ( const QPoint & )</li>
<li><div class="fn"/><a href="qobject.html#customEvent">customEvent</a> ( QEvent * )</li>
<li><div class="fn"/><a href="qobject.html#deleteLater">deleteLater</a> ()</li>
<li><div class="fn"/><a href="qpaintdevice.html#depth">depth</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#destroy">destroy</a> ( bool, bool )</li>
<li><div class="fn"/><a href="qobject.html#destroyed">destroyed</a> ( QObject * )</li>
<li><div class="fn"/><a href="qobject.html#disconnect">disconnect</a> ( const QObject *, const char *, const QObject *, const char * ) : bool</li>
<li><div class="fn"/><a href="qobject.html#disconnect-2">disconnect</a> ( const char *, const QObject *, const char * ) : bool</li>
<li><div class="fn"/><a href="qobject.html#disconnect-3">disconnect</a> ( const QObject *, const char * ) : bool</li>
<li><div class="fn"/><a href="qobject.html#disconnectNotify">disconnectNotify</a> ( const char * )</li>
<li><div class="fn"/><a href="qwidget.html#dragEnterEvent">dragEnterEvent</a> ( QDragEnterEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#dragLeaveEvent">dragLeaveEvent</a> ( QDragLeaveEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#dragMoveEvent">dragMoveEvent</a> ( QDragMoveEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#dropEvent">dropEvent</a> ( QDropEvent * )</li>
<li><div class="fn"/><a href="qobject.html#dumpObjectInfo">dumpObjectInfo</a> ()</li>
<li><div class="fn"/><a href="qobject.html#dumpObjectTree">dumpObjectTree</a> ()</li>
<li><div class="fn"/><a href="qobject.html#dynamicPropertyNames">dynamicPropertyNames</a> () const : QList<QByteArray></li>
<li><div class="fn"/><a href="qwidget.html#ensurePolished">ensurePolished</a> () const</li>
<li><div class="fn"/><a href="qwidget.html#enterEvent">enterEvent</a> ( QEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#event">event</a> ( QEvent * ) : bool</li>
<li><div class="fn"/><a href="qobject.html#eventFilter">eventFilter</a> ( QObject *, QEvent * ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#find">find</a> ( WId ) : QWidget *</li>
<li><div class="fn"/><a href="qobject.html#findChild">findChild</a> ( const QString & ) const : T</li>
<li><div class="fn"/><a href="qobject.html#findChildren">findChildren</a> ( const QString & ) const : QList<T></li>
<li><div class="fn"/><a href="qobject.html#findChildren-2">findChildren</a> ( const QRegExp & ) const : QList<T></li>
<li><div class="fn"/><a href="qwidget.html#focusInEvent">focusInEvent</a> ( QFocusEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#focusNextChild">focusNextChild</a> () : bool</li>
<li><div class="fn"/><a href="qwidget.html#focusNextPrevChild">focusNextPrevChild</a> ( bool ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#focusOutEvent">focusOutEvent</a> ( QFocusEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#focusPolicy-prop">focusPolicy</a> () const : Qt::FocusPolicy</li>
<li><div class="fn"/><a href="qwidget.html#focusPreviousChild">focusPreviousChild</a> () : bool</li>
<li><div class="fn"/><a href="qwidget.html#focusProxy">focusProxy</a> () const : QWidget *</li>
<li><div class="fn"/><a href="qwidget.html#focusWidget">focusWidget</a> () const : QWidget *</li>
<li><div class="fn"/><a href="qwidget.html#font-prop">font</a> () const : const QFont &</li>
<li><div class="fn"/><a href="qwidget.html#fontInfo">fontInfo</a> () const : QFontInfo</li>
<li><div class="fn"/><a href="qwidget.html#fontMetrics">fontMetrics</a> () const : QFontMetrics</li>
<li><div class="fn"/><a href="qwidget.html#foregroundRole">foregroundRole</a> () const : QPalette::ColorRole</li>
<li><div class="fn"/><a href="qwidget.html#frameGeometry-prop">frameGeometry</a> () const : QRect</li>
<li><div class="fn"/><a href="qwidget.html#frameSize-prop">frameSize</a> () const : QSize</li>
<li><div class="fn"/><a href="qwidget.html#geometry-prop">geometry</a> () const : const QRect &</li>
<li><div class="fn"/><a href="qwidget.html#getContentsMargins">getContentsMargins</a> ( int *, int *, int *, int * ) const</li>
<li><div class="fn"/><a href="qwidget.html#getDC">getDC</a> () const : HDC</li>
<li><div class="fn"/><a href="qwidget.html#grabKeyboard">grabKeyboard</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#grabMouse">grabMouse</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#grabMouse-2">grabMouse</a> ( const QCursor & )</li>
<li><div class="fn"/><a href="qwidget.html#grabShortcut">grabShortcut</a> ( const QKeySequence &, Qt::ShortcutContext ) : int</li>
<li><div class="fn"/><a href="qwidget.html#hasEditFocus">hasEditFocus</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#focus-prop">hasFocus</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#mouseTracking-prop">hasMouseTracking</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#height-prop">height</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#heightForWidth">heightForWidth</a> ( int ) const : int</li>
<li><div class="fn"/><a href="qpaintdevice.html#heightMM">heightMM</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#hide">hide</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#hideEvent">hideEvent</a> ( QHideEvent * )</li>
<li><div class="fn"/><a href="qobject.html#inherits">inherits</a> ( const char * ) const : bool</li>
<li><div class="fn"/><a href="qwidget.html#inputContext">inputContext</a> () : QInputContext *</li>
<li><div class="fn"/><a href="qwidget.html#inputMethodEvent">inputMethodEvent</a> ( QInputMethodEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#inputMethodQuery">inputMethodQuery</a> ( Qt::InputMethodQuery ) const : QVariant</li>
<li><div class="fn"/><a href="qwidget.html#insertAction">insertAction</a> ( QAction *, QAction * )</li>
<li><div class="fn"/><a href="qwidget.html#insertActions">insertActions</a> ( QAction *, QList<QAction *> )</li>
<li><div class="fn"/><a href="qobject.html#installEventFilter">installEventFilter</a> ( QObject * )</li>
<li><div class="fn"/><a href="qwidget.html#isActiveWindow-prop">isActiveWindow</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#isAncestorOf">isAncestorOf</a> ( const QWidget * ) const : bool</li>
<li><div class="fn"/><a href="qwidget.html#enabled-prop">isEnabled</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#isEnabledTo">isEnabledTo</a> ( QWidget * ) const : bool</li>
<li><div class="fn"/><a href="qwidget.html#fullScreen-prop">isFullScreen</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#isHidden">isHidden</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#maximized-prop">isMaximized</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#minimized-prop">isMinimized</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#modal-prop">isModal</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#visible-prop">isVisible</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#isVisibleTo">isVisibleTo</a> ( QWidget * ) const : bool</li>
<li><div class="fn"/><a href="qobject.html#isWidgetType">isWidgetType</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#isWindow">isWindow</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#windowModified-prop">isWindowModified</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#keyPressEvent">keyPressEvent</a> ( QKeyEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#keyReleaseEvent">keyReleaseEvent</a> ( QKeyEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#keyboardGrabber">keyboardGrabber</a> () : QWidget *</li>
<li><div class="fn"/><a href="qobject.html#killTimer">killTimer</a> ( int )</li>
<li><div class="fn"/><a href="qwidget.html#layout">layout</a> () const : QLayout *</li>
<li><div class="fn"/><a href="qwidget.html#layoutDirection-prop">layoutDirection</a> () const : Qt::LayoutDirection</li>
<li><div class="fn"/><a href="qwidget.html#leaveEvent">leaveEvent</a> ( QEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#locale-prop">locale</a> () const : QLocale</li>
<li><div class="fn"/><a href="qpaintdevice.html#logicalDpiX">logicalDpiX</a> () const : int</li>
<li><div class="fn"/><a href="qpaintdevice.html#logicalDpiY">logicalDpiY</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#lower">lower</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#macCGHandle">macCGHandle</a> () const : Qt::HANDLE</li>
<li><div class="fn"/><a href="qwidget.html#macEvent">macEvent</a> ( EventHandlerCallRef, EventRef ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#macQDHandle">macQDHandle</a> () const : Qt::HANDLE</li>
<li><div class="fn"/><a href="qdesigneractioneditorinterface.html#manageAction">manageAction</a> ( QAction * )</li>
<li><div class="fn"/><a href="qwidget.html#mapFrom">mapFrom</a> ( QWidget *, const QPoint & ) const : QPoint</li>
<li><div class="fn"/><a href="qwidget.html#mapFromGlobal">mapFromGlobal</a> ( const QPoint & ) const : QPoint</li>
<li><div class="fn"/><a href="qwidget.html#mapFromParent">mapFromParent</a> ( const QPoint & ) const : QPoint</li>
<li><div class="fn"/><a href="qwidget.html#mapTo">mapTo</a> ( QWidget *, const QPoint & ) const : QPoint</li>
<li><div class="fn"/><a href="qwidget.html#mapToGlobal">mapToGlobal</a> ( const QPoint & ) const : QPoint</li>
<li><div class="fn"/><a href="qwidget.html#mapToParent">mapToParent</a> ( const QPoint & ) const : QPoint</li>
<li><div class="fn"/><a href="qwidget.html#mask">mask</a> () const : QRegion</li>
<li><div class="fn"/><a href="qwidget.html#maximumHeight-prop">maximumHeight</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#maximumSize-prop">maximumSize</a> () const : QSize</li>
<li><div class="fn"/><a href="qwidget.html#maximumWidth-prop">maximumWidth</a> () const : int</li>
<li><div class="fn"/><a href="qobject.html#metaObject">metaObject</a> () const : const QMetaObject *</li>
<li><div class="fn"/><a href="qwidget.html#metric">metric</a> ( PaintDeviceMetric ) const : int</li>
<li><div class="fn"/><a href="qwidget.html#minimumHeight-prop">minimumHeight</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#minimumSize-prop">minimumSize</a> () const : QSize</li>
<li><div class="fn"/><a href="qwidget.html#minimumSizeHint-prop">minimumSizeHint</a> () const : QSize</li>
<li><div class="fn"/><a href="qwidget.html#minimumWidth-prop">minimumWidth</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a> ( QMouseEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#mouseGrabber">mouseGrabber</a> () : QWidget *</li>
<li><div class="fn"/><a href="qwidget.html#mouseMoveEvent">mouseMoveEvent</a> ( QMouseEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#mousePressEvent">mousePressEvent</a> ( QMouseEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#mouseReleaseEvent">mouseReleaseEvent</a> ( QMouseEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#pos-prop">move</a> ( const QPoint & )</li>
<li><div class="fn"/><a href="qwidget.html#pos-prop">move</a> ( int, int )</li>
<li><div class="fn"/><a href="qwidget.html#moveEvent">moveEvent</a> ( QMoveEvent * )</li>
<li><div class="fn"/><a href="qobject.html#moveToThread">moveToThread</a> ( QThread * )</li>
<li><div class="fn"/><a href="qwidget.html#nextInFocusChain">nextInFocusChain</a> () const : QWidget *</li>
<li><div class="fn"/><a href="qwidget.html#normalGeometry-prop">normalGeometry</a> () const : QRect</li>
<li><div class="fn"/><a href="qpaintdevice.html#numColors">numColors</a> () const : int</li>
<li><div class="fn"/><a href="qobject.html#objectName-prop">objectName</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#overrideWindowFlags">overrideWindowFlags</a> ( Qt::WindowFlags )</li>
<li><div class="fn"/><a href="qwidget.html#paintEngine">paintEngine</a> () const : QPaintEngine *</li>
<li><div class="fn"/><a href="qwidget.html#paintEvent">paintEvent</a> ( QPaintEvent * )</li>
<li><div class="fn"/><a href="qpaintdevice.html#paintingActive">paintingActive</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#palette-prop">palette</a> () const : const QPalette &</li>
<li><div class="fn"/><a href="qobject.html#parent">parent</a> () const : QObject *</li>
</ul></td><td valign="top"><ul>
<li><div class="fn"/><a href="qwidget.html#parentWidget">parentWidget</a> () const : QWidget *</li>
<li><div class="fn"/><a href="qpaintdevice.html#physicalDpiX">physicalDpiX</a> () const : int</li>
<li><div class="fn"/><a href="qpaintdevice.html#physicalDpiY">physicalDpiY</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#pos-prop">pos</a> () const : QPoint</li>
<li><div class="fn"/><a href="qobject.html#property">property</a> ( const char * ) const : QVariant</li>
<li><div class="fn"/><a href="qwidget.html#qwsEvent">qwsEvent</a> ( QWSEvent * ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#raise">raise</a> ()</li>
<li><div class="fn"/><a href="qobject.html#receivers">receivers</a> ( const char * ) const : int</li>
<li><div class="fn"/><a href="qwidget.html#rect-prop">rect</a> () const : QRect</li>
<li><div class="fn"/><a href="qwidget.html#releaseDC">releaseDC</a> ( HDC ) const</li>
<li><div class="fn"/><a href="qwidget.html#releaseKeyboard">releaseKeyboard</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#releaseMouse">releaseMouse</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#releaseShortcut">releaseShortcut</a> ( int )</li>
<li><div class="fn"/><a href="qwidget.html#removeAction">removeAction</a> ( QAction * )</li>
<li><div class="fn"/><a href="qobject.html#removeEventFilter">removeEventFilter</a> ( QObject * )</li>
<li><div class="fn"/><a href="qwidget.html#render">render</a> ( QPaintDevice *, const QPoint &, const QRegion &, RenderFlags )</li>
<li><div class="fn"/><a href="qwidget.html#repaint">repaint</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#repaint-6">repaint</a> ( int, int, int, int )</li>
<li><div class="fn"/><a href="qwidget.html#repaint-7">repaint</a> ( const QRect & )</li>
<li><div class="fn"/><a href="qwidget.html#repaint-8">repaint</a> ( const QRegion & )</li>
<li><div class="fn"/><a href="qwidget.html#resetInputContext">resetInputContext</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#size-prop">resize</a> ( const QSize & )</li>
<li><div class="fn"/><a href="qwidget.html#size-prop">resize</a> ( int, int )</li>
<li><div class="fn"/><a href="qwidget.html#resizeEvent">resizeEvent</a> ( QResizeEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#restoreGeometry">restoreGeometry</a> ( const QByteArray & ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#saveGeometry">saveGeometry</a> () const : QByteArray</li>
<li><div class="fn"/><a href="qwidget.html#scroll">scroll</a> ( int, int )</li>
<li><div class="fn"/><a href="qwidget.html#scroll-2">scroll</a> ( int, int, const QRect & )</li>
<li><div class="fn"/><a href="qobject.html#sender">sender</a> () const : QObject *</li>
<li><div class="fn"/><a href="qwidget.html#acceptDrops-prop">setAcceptDrops</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#accessibleDescription-prop">setAccessibleDescription</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#accessibleName-prop">setAccessibleName</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#setAttribute">setAttribute</a> ( Qt::WidgetAttribute, bool )</li>
<li><div class="fn"/><a href="qwidget.html#autoFillBackground-prop">setAutoFillBackground</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#setBackgroundRole">setBackgroundRole</a> ( QPalette::ColorRole )</li>
<li><div class="fn"/><a href="qwidget.html#baseSize-prop">setBaseSize</a> ( const QSize & )</li>
<li><div class="fn"/><a href="qwidget.html#baseSize-prop">setBaseSize</a> ( int, int )</li>
<li><div class="fn"/><a href="qwidget.html#setContentsMargins">setContentsMargins</a> ( int, int, int, int )</li>
<li><div class="fn"/><a href="qwidget.html#contextMenuPolicy-prop">setContextMenuPolicy</a> ( Qt::ContextMenuPolicy )</li>
<li><div class="fn"/><a href="qwidget.html#cursor-prop">setCursor</a> ( const QCursor & )</li>
<li><div class="fn"/><a href="qwidget.html#setDisabled">setDisabled</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#setEditFocus">setEditFocus</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#enabled-prop">setEnabled</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#setFixedHeight">setFixedHeight</a> ( int )</li>
<li><div class="fn"/><a href="qwidget.html#setFixedSize">setFixedSize</a> ( const QSize & )</li>
<li><div class="fn"/><a href="qwidget.html#setFixedSize-2">setFixedSize</a> ( int, int )</li>
<li><div class="fn"/><a href="qwidget.html#setFixedWidth">setFixedWidth</a> ( int )</li>
<li><div class="fn"/><a href="qwidget.html#setFocus">setFocus</a> ( Qt::FocusReason )</li>
<li><div class="fn"/><a href="qwidget.html#setFocus-2">setFocus</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#focusPolicy-prop">setFocusPolicy</a> ( Qt::FocusPolicy )</li>
<li><div class="fn"/><a href="qwidget.html#setFocusProxy">setFocusProxy</a> ( QWidget * )</li>
<li><div class="fn"/><a href="qwidget.html#font-prop">setFont</a> ( const QFont & )</li>
<li><div class="fn"/><a href="qwidget.html#setForegroundRole">setForegroundRole</a> ( QPalette::ColorRole )</li>
<li><div class="fn"/><a href="qdesigneractioneditorinterface.html#setFormWindow">setFormWindow</a> ( QDesignerFormWindowInterface * )</li>
<li><div class="fn"/><a href="qwidget.html#geometry-prop">setGeometry</a> ( const QRect & )</li>
<li><div class="fn"/><a href="qwidget.html#geometry-prop">setGeometry</a> ( int, int, int, int )</li>
<li><div class="fn"/><a href="qwidget.html#setHidden">setHidden</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#setInputContext">setInputContext</a> ( QInputContext * )</li>
<li><div class="fn"/><a href="qwidget.html#setLayout">setLayout</a> ( QLayout * )</li>
<li><div class="fn"/><a href="qwidget.html#layoutDirection-prop">setLayoutDirection</a> ( Qt::LayoutDirection )</li>
<li><div class="fn"/><a href="qwidget.html#locale-prop">setLocale</a> ( const QLocale & )</li>
<li><div class="fn"/><a href="qwidget.html#setMask">setMask</a> ( const QBitmap & )</li>
<li><div class="fn"/><a href="qwidget.html#setMask-2">setMask</a> ( const QRegion & )</li>
<li><div class="fn"/><a href="qwidget.html#maximumHeight-prop">setMaximumHeight</a> ( int )</li>
<li><div class="fn"/><a href="qwidget.html#maximumSize-prop">setMaximumSize</a> ( const QSize & )</li>
<li><div class="fn"/><a href="qwidget.html#maximumSize-prop">setMaximumSize</a> ( int, int )</li>
<li><div class="fn"/><a href="qwidget.html#maximumWidth-prop">setMaximumWidth</a> ( int )</li>
<li><div class="fn"/><a href="qwidget.html#minimumHeight-prop">setMinimumHeight</a> ( int )</li>
<li><div class="fn"/><a href="qwidget.html#minimumSize-prop">setMinimumSize</a> ( const QSize & )</li>
<li><div class="fn"/><a href="qwidget.html#minimumSize-prop">setMinimumSize</a> ( int, int )</li>
<li><div class="fn"/><a href="qwidget.html#minimumWidth-prop">setMinimumWidth</a> ( int )</li>
<li><div class="fn"/><a href="qwidget.html#mouseTracking-prop">setMouseTracking</a> ( bool )</li>
<li><div class="fn"/><a href="qobject.html#objectName-prop">setObjectName</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#palette-prop">setPalette</a> ( const QPalette & )</li>
<li><div class="fn"/><a href="qwidget.html#setParent">setParent</a> ( QWidget * )</li>
<li><div class="fn"/><a href="qwidget.html#setParent-2">setParent</a> ( QWidget *, Qt::WindowFlags )</li>
<li><div class="fn"/><a href="qobject.html#setProperty">setProperty</a> ( const char *, const QVariant & ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#setShortcutAutoRepeat">setShortcutAutoRepeat</a> ( int, bool )</li>
<li><div class="fn"/><a href="qwidget.html#setShortcutEnabled">setShortcutEnabled</a> ( int, bool )</li>
<li><div class="fn"/><a href="qwidget.html#sizeIncrement-prop">setSizeIncrement</a> ( const QSize & )</li>
<li><div class="fn"/><a href="qwidget.html#sizeIncrement-prop">setSizeIncrement</a> ( int, int )</li>
<li><div class="fn"/><a href="qwidget.html#sizePolicy-prop">setSizePolicy</a> ( QSizePolicy )</li>
<li><div class="fn"/><a href="qwidget.html#sizePolicy-prop">setSizePolicy</a> ( QSizePolicy::Policy, QSizePolicy::Policy )</li>
<li><div class="fn"/><a href="qwidget.html#statusTip-prop">setStatusTip</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#setStyle">setStyle</a> ( QStyle * )</li>
<li><div class="fn"/><a href="qwidget.html#styleSheet-prop">setStyleSheet</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#setTabOrder">setTabOrder</a> ( QWidget *, QWidget * )</li>
<li><div class="fn"/><a href="qwidget.html#toolTip-prop">setToolTip</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#updatesEnabled-prop">setUpdatesEnabled</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#visible-prop">setVisible</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#whatsThis-prop">setWhatsThis</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#windowFlags-prop">setWindowFlags</a> ( Qt::WindowFlags )</li>
<li><div class="fn"/><a href="qwidget.html#windowIcon-prop">setWindowIcon</a> ( const QIcon & )</li>
<li><div class="fn"/><a href="qwidget.html#windowIconText-prop">setWindowIconText</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#windowModality-prop">setWindowModality</a> ( Qt::WindowModality )</li>
<li><div class="fn"/><a href="qwidget.html#windowModified-prop">setWindowModified</a> ( bool )</li>
<li><div class="fn"/><a href="qwidget.html#windowOpacity-prop">setWindowOpacity</a> ( qreal )</li>
<li><div class="fn"/><a href="qwidget.html#setWindowRole">setWindowRole</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#setWindowState">setWindowState</a> ( Qt::WindowStates )</li>
<li><div class="fn"/><a href="qwidget.html#setWindowSurface">setWindowSurface</a> ( QWindowSurface * )</li>
<li><div class="fn"/><a href="qwidget.html#windowTitle-prop">setWindowTitle</a> ( const QString & )</li>
<li><div class="fn"/><a href="qwidget.html#show">show</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#showEvent">showEvent</a> ( QShowEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#showFullScreen">showFullScreen</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#showMaximized">showMaximized</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#showMinimized">showMinimized</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#showNormal">showNormal</a> ()</li>
<li><div class="fn"/><a href="qobject.html#signalsBlocked">signalsBlocked</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#size-prop">size</a> () const : QSize</li>
<li><div class="fn"/><a href="qwidget.html#sizeHint-prop">sizeHint</a> () const : QSize</li>
<li><div class="fn"/><a href="qwidget.html#sizeIncrement-prop">sizeIncrement</a> () const : QSize</li>
<li><div class="fn"/><a href="qwidget.html#sizePolicy-prop">sizePolicy</a> () const : QSizePolicy</li>
<li><div class="fn"/><a href="qwidget.html#stackUnder">stackUnder</a> ( QWidget * )</li>
<li><div class="fn"/><a href="qobject.html#startTimer">startTimer</a> ( int ) : int</li>
<li><div class="fn"/><a href="qobject.html#staticMetaObject-var">staticMetaObject</a> : const QMetaObject</li>
<li><div class="fn"/><a href="qwidget.html#statusTip-prop">statusTip</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#style">style</a> () const : QStyle *</li>
<li><div class="fn"/><a href="qwidget.html#styleSheet-prop">styleSheet</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#tabletEvent">tabletEvent</a> ( QTabletEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#testAttribute">testAttribute</a> ( Qt::WidgetAttribute ) const : bool</li>
<li><div class="fn"/><a href="qobject.html#thread">thread</a> () const : QThread *</li>
<li><div class="fn"/><a href="qobject.html#timerEvent">timerEvent</a> ( QTimerEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#toolTip-prop">toolTip</a> () const : QString</li>
<li><div class="fn"/><a href="qobject.html#tr">tr</a> ( const char *, const char *, int ) : QString</li>
<li><div class="fn"/><a href="qobject.html#trUtf8">trUtf8</a> ( const char *, const char *, int ) : QString</li>
<li><div class="fn"/><a href="qwidget.html#underMouse">underMouse</a> () const : bool</li>
<li><div class="fn"/><a href="qdesigneractioneditorinterface.html#unmanageAction">unmanageAction</a> ( QAction * )</li>
<li><div class="fn"/><a href="qwidget.html#cursor-prop">unsetCursor</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#layoutDirection-prop">unsetLayoutDirection</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#locale-prop">unsetLocale</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#update">update</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#update-2">update</a> ( int, int, int, int )</li>
<li><div class="fn"/><a href="qwidget.html#update-3">update</a> ( const QRect & )</li>
<li><div class="fn"/><a href="qwidget.html#update-4">update</a> ( const QRegion & )</li>
<li><div class="fn"/><a href="qwidget.html#updateGeometry">updateGeometry</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#updateMicroFocus">updateMicroFocus</a> ()</li>
<li><div class="fn"/><a href="qwidget.html#updatesEnabled-prop">updatesEnabled</a> () const : bool</li>
<li><div class="fn"/><a href="qwidget.html#visibleRegion">visibleRegion</a> () const : QRegion</li>
<li><div class="fn"/><a href="qwidget.html#whatsThis-prop">whatsThis</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#wheelEvent">wheelEvent</a> ( QWheelEvent * )</li>
<li><div class="fn"/><a href="qwidget.html#width-prop">width</a> () const : int</li>
<li><div class="fn"/><a href="qpaintdevice.html#widthMM">widthMM</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#winEvent">winEvent</a> ( MSG *, long * ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#winId">winId</a> () const : WId</li>
<li><div class="fn"/><a href="qwidget.html#window">window</a> () const : QWidget *</li>
<li><div class="fn"/><a href="qwidget.html#windowFlags-prop">windowFlags</a> () const : Qt::WindowFlags</li>
<li><div class="fn"/><a href="qwidget.html#windowIcon-prop">windowIcon</a> () const : QIcon</li>
<li><div class="fn"/><a href="qwidget.html#windowIconText-prop">windowIconText</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#windowModality-prop">windowModality</a> () const : Qt::WindowModality</li>
<li><div class="fn"/><a href="qwidget.html#windowOpacity-prop">windowOpacity</a> () const : qreal</li>
<li><div class="fn"/><a href="qwidget.html#windowRole">windowRole</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#windowState">windowState</a> () const : Qt::WindowStates</li>
<li><div class="fn"/><a href="qwidget.html#windowSurface">windowSurface</a> () const : QWindowSurface *</li>
<li><div class="fn"/><a href="qwidget.html#windowTitle-prop">windowTitle</a> () const : QString</li>
<li><div class="fn"/><a href="qwidget.html#windowType">windowType</a> () const : Qt::WindowType</li>
<li><div class="fn"/><a href="qwidget.html#x-prop">x</a> () const : int</li>
<li><div class="fn"/><a href="qwidget.html#x11Event">x11Event</a> ( XEvent * ) : bool</li>
<li><div class="fn"/><a href="qwidget.html#x11Info">x11Info</a> () const : const QX11Info &</li>
<li><div class="fn"/><a href="qwidget.html#x11PictureHandle">x11PictureHandle</a> () const : Qt::HANDLE</li>
<li><div class="fn"/><a href="qwidget.html#y-prop">y</a> () const : int</li>
</ul>
</td></tr>
</table></p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright © 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
| {'content_hash': '22ce3734322c7bab2788394b8785a031', 'timestamp': '', 'source': 'github', 'line_count': 352, 'max_line_length': 562, 'avg_line_length': 97.91477272727273, 'alnum_prop': 0.6748679858411187, 'repo_name': 'misizeji/StudyNote_201308', 'id': '84e92c137de4c3841f09e274ab3d3e3f1d59f68e', 'size': '34466', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'webserver/html/qdesigneractioneditorinterface-members.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '24904'}, {'name': 'Batchfile', 'bytes': '344'}, {'name': 'C', 'bytes': '38209826'}, {'name': 'C++', 'bytes': '52779448'}, {'name': 'CSS', 'bytes': '10599'}, {'name': 'HTML', 'bytes': '38756865'}, {'name': 'JavaScript', 'bytes': '11538'}, {'name': 'Makefile', 'bytes': '160624'}, {'name': 'QMake', 'bytes': '20539'}, {'name': 'Shell', 'bytes': '6618'}]} |
DECLARE_bool(fst_default_cache_gc);
DECLARE_int64(fst_default_cache_gc_limit);
namespace fst {
// Options for controlling caching behavior; higher level than CacheImplOptions.
struct CacheOptions {
bool gc; // Enables GC.
size_t gc_limit; // Number of bytes allowed before GC.
explicit CacheOptions(bool gc = FLAGS_fst_default_cache_gc,
size_t gc_limit = FLAGS_fst_default_cache_gc_limit)
: gc(gc), gc_limit(gc_limit) {}
};
// Options for controlling caching behavior, at a lower level than
// CacheOptions; templated on the cache store and allows passing the store.
template <class CacheStore>
struct CacheImplOptions {
bool gc; // Enables GC.
size_t gc_limit; // Number of bytes allowed before GC.
CacheStore *store; // Cache store.
bool own_store; // Should CacheImpl takes ownership of the store?
explicit CacheImplOptions(bool gc = FLAGS_fst_default_cache_gc,
size_t gc_limit = FLAGS_fst_default_cache_gc_limit,
CacheStore *store = nullptr)
: gc(gc), gc_limit(gc_limit), store(store), own_store(true) {}
explicit CacheImplOptions(const CacheOptions &opts)
: gc(opts.gc), gc_limit(opts.gc_limit), store(nullptr), own_store(true) {}
};
// Cache flags.
constexpr uint32 kCacheFinal = 0x0001; // Final weight has been cached.
constexpr uint32 kCacheArcs = 0x0002; // Arcs have been cached.
constexpr uint32 kCacheInit = 0x0004; // Initialized by GC.
constexpr uint32 kCacheRecent = 0x0008; // Visited since GC.
constexpr uint32 kCacheFlags =
kCacheFinal | kCacheArcs | kCacheInit | kCacheRecent;
// Cache state, with arcs stored in a per-state std::vector.
template <class A, class M = PoolAllocator<A>>
class CacheState {
public:
using Arc = A;
using Label = typename Arc::Label;
using StateId = typename Arc::StateId;
using Weight = typename Arc::Weight;
using ArcAllocator = M;
using StateAllocator =
typename ArcAllocator::template rebind<CacheState<A, M>>::other;
// Provides STL allocator for arcs.
explicit CacheState(const ArcAllocator &alloc)
: final_(Weight::Zero()),
niepsilons_(0),
noepsilons_(0),
arcs_(alloc),
flags_(0),
ref_count_(0) {}
CacheState(const CacheState<A> &state, const ArcAllocator &alloc)
: final_(state.Final()),
niepsilons_(state.NumInputEpsilons()),
noepsilons_(state.NumOutputEpsilons()),
arcs_(state.arcs_.begin(), state.arcs_.end(), alloc),
flags_(state.Flags()),
ref_count_(0) {}
void Reset() {
final_ = Weight::Zero();
niepsilons_ = 0;
noepsilons_ = 0;
ref_count_ = 0;
flags_ = 0;
arcs_.clear();
}
Weight Final() const { return final_; }
size_t NumInputEpsilons() const { return niepsilons_; }
size_t NumOutputEpsilons() const { return noepsilons_; }
size_t NumArcs() const { return arcs_.size(); }
const Arc &GetArc(size_t n) const { return arcs_[n]; }
// Used by the ArcIterator<Fst<Arc>> efficient implementation.
const Arc *Arcs() const { return !arcs_.empty() ? &arcs_[0] : nullptr; }
// Accesses flags; used by the caller.
uint32 Flags() const { return flags_; }
// Accesses ref count; used by the caller.
int RefCount() const { return ref_count_; }
void SetFinal(Weight weight = Weight::One()) { final_ = std::move(weight); }
void ReserveArcs(size_t n) { arcs_.reserve(n); }
// Adds one arc at a time with all needed book-keeping; use PushArc and
// SetArcs for a more efficient alternative.
void AddArc(const Arc &arc) {
IncrementNumEpsilons(arc);
arcs_.push_back(arc);
}
void AddArc(Arc &&arc) {
IncrementNumEpsilons(arc);
arcs_.push_back(std::move(arc));
}
// Adds one arc at a time with delayed book-keeping; finalize with SetArcs().
void PushArc(const Arc &arc) { arcs_.push_back(arc); }
void PushArc(Arc &&arc) { arcs_.push_back(std::move(arc)); }
// Adds one arc at a time with delayed book-keeping; finalize with SetArcs().
template <class... T>
void EmplaceArc(T &&... ctor_args) {
arcs_.emplace_back(std::forward<T>(ctor_args)...);
}
// Finalizes arcs book-keeping; call only once.
void SetArcs() {
for (const auto &arc : arcs_) {
IncrementNumEpsilons(arc);
}
}
// Modifies nth arc.
void SetArc(const Arc &arc, size_t n) {
if (arcs_[n].ilabel == 0) --niepsilons_;
if (arcs_[n].olabel == 0) --noepsilons_;
IncrementNumEpsilons(arc);
arcs_[n] = arc;
}
// Deletes all arcs.
void DeleteArcs() {
niepsilons_ = 0;
noepsilons_ = 0;
arcs_.clear();
}
void DeleteArcs(size_t n) {
for (size_t i = 0; i < n; ++i) {
if (arcs_.back().ilabel == 0) --niepsilons_;
if (arcs_.back().olabel == 0) --noepsilons_;
arcs_.pop_back();
}
}
// Sets status flags; used by the caller.
void SetFlags(uint32 flags, uint32 mask) const {
flags_ &= ~mask;
flags_ |= flags;
}
// Mutates reference counts; used by the caller.
int IncrRefCount() const { return ++ref_count_; }
int DecrRefCount() const { return --ref_count_; }
// Used by the ArcIterator<Fst<Arc>> efficient implementation.
int *MutableRefCount() const { return &ref_count_; }
// Used for state class allocation.
void *operator new(size_t size, StateAllocator *alloc) {
return alloc->allocate(1);
}
// For state destruction and memory freeing.
static void Destroy(CacheState<Arc> *state, StateAllocator *alloc) {
if (state) {
state->~CacheState<Arc>();
alloc->deallocate(state, 1);
}
}
private:
// Update the number of epsilons as a result of having added an arc.
void IncrementNumEpsilons(const Arc &arc) {
if (arc.ilabel == 0) ++niepsilons_;
if (arc.olabel == 0) ++noepsilons_;
}
Weight final_; // Final weight.
size_t niepsilons_; // # of input epsilons.
size_t noepsilons_; // # of output epsilons.
std::vector<Arc, ArcAllocator> arcs_; // Arcs representation.
mutable uint32 flags_;
mutable int ref_count_; // If 0, available for GC.
};
// Cache store, allocating and storing states, providing a mapping from state
// IDs to cached states, and an iterator over these states. The state template
// argument must implement the CacheState interface. The state for a StateId s
// is constructed when requested by GetMutableState(s) if it is not yet stored.
// Initially, a state has a reference count of zero, but the user may increment
// or decrement this to control the time of destruction. In particular, a state
// is destroyed when:
//
// 1. This instance is destroyed, or
// 2. Clear() or Delete() is called, or
// 3. Possibly (implementation-dependently) when:
// - Garbage collection is enabled (as defined by opts.gc),
// - The cache store size exceeds the limits (as defined by opts.gc_limits),
// - The state's reference count is zero, and
// - The state is not the most recently requested state.
//
// template <class S>
// class CacheStore {
// public:
// using State = S;
// using Arc = typename State::Arc;
// using StateId = typename Arc::StateId;
//
// // Required constructors/assignment operators.
// explicit CacheStore(const CacheOptions &opts);
//
// // Returns nullptr if state is not stored.
// const State *GetState(StateId s);
//
// // Creates state if state is not stored.
// State *GetMutableState(StateId s);
//
// // Similar to State::AddArc() but updates cache store book-keeping.
// void AddArc(State *state, const Arc &arc);
//
// // Similar to State::SetArcs() but updates cache store book-keeping; call
// // only once.
// void SetArcs(State *state);
//
// // Similar to State::DeleteArcs() but updates cache store book-keeping.
//
// void DeleteArcs(State *state);
//
// void DeleteArcs(State *state, size_t n);
//
// // Deletes all cached states.
// void Clear();
//
// // Number of cached states.
// StateId CountStates();
//
// // Iterates over cached states (in an arbitrary order); only needed if
// // opts.gc is true.
// bool Done() const; // End of iteration.
// StateId Value() const; // Current state.
// void Next(); // Advances to next state (when !Done).
// void Reset(); // Returns to initial condition.
// void Delete(); // Deletes current state and advances to next.
// };
// Container cache stores.
// This class uses a vector of pointers to states to store cached states.
template <class S>
class VectorCacheStore {
public:
using State = S;
using Arc = typename State::Arc;
using StateId = typename Arc::StateId;
using StateList = std::list<StateId, PoolAllocator<StateId>>;
// Required constructors/assignment operators.
explicit VectorCacheStore(const CacheOptions &opts) : cache_gc_(opts.gc) {
Clear();
Reset();
}
VectorCacheStore(const VectorCacheStore<S> &store)
: cache_gc_(store.cache_gc_) {
CopyStates(store);
Reset();
}
~VectorCacheStore() { Clear(); }
VectorCacheStore<State> &operator=(const VectorCacheStore<State> &store) {
if (this != &store) {
CopyStates(store);
Reset();
}
return *this;
}
bool InBounds(StateId s) const {
return s < static_cast<StateId>(state_vec_.size());
}
// Returns nullptr if state is not stored.
const State *GetState(StateId s) const {
return InBounds(s) ? state_vec_[s] : nullptr;
}
// Creates state if state is not stored.
State *GetMutableState(StateId s) {
State *state = nullptr;
if (InBounds(s)) {
state = state_vec_[s];
} else {
state_vec_.resize(s + 1, nullptr);
}
if (!state) {
state = new (&state_alloc_) State(arc_alloc_);
state_vec_[s] = state;
if (cache_gc_) state_list_.push_back(s);
}
return state;
}
// Similar to State::AddArc() but updates cache store book-keeping
void AddArc(State *state, const Arc &arc) { state->AddArc(arc); }
// Similar to State::SetArcs() but updates cache store book-keeping; call
// only once.
void SetArcs(State *state) { state->SetArcs(); }
// Deletes all arcs.
void DeleteArcs(State *state) { state->DeleteArcs(); }
// Deletes some arcs.
void DeleteArcs(State *state, size_t n) { state->DeleteArcs(n); }
// Deletes all cached states.
void Clear() {
for (State *s : state_vec_) {
State::Destroy(s, &state_alloc_);
}
state_vec_.clear();
state_list_.clear();
}
StateId CountStates() const {
return std::count_if(state_vec_.begin(), state_vec_.end(),
[](const State *s) { return s != nullptr; });
}
// Iterates over cached states (in an arbitrary order); only works if GC is
// enabled (o.w. avoiding state_list_ overhead).
bool Done() const { return iter_ == state_list_.end(); }
StateId Value() const { return *iter_; }
void Next() { ++iter_; }
void Reset() { iter_ = state_list_.begin(); }
// Deletes current state and advances to next.
void Delete() {
State::Destroy(state_vec_[*iter_], &state_alloc_);
state_vec_[*iter_] = nullptr;
state_list_.erase(iter_++);
}
private:
void CopyStates(const VectorCacheStore<State> &store) {
Clear();
state_vec_.reserve(store.state_vec_.size());
for (size_t s = 0; s < store.state_vec_.size(); ++s) {
State *state = nullptr;
const auto *store_state = store.state_vec_[s];
if (store_state) {
state = new (&state_alloc_) State(*store_state, arc_alloc_);
if (cache_gc_) state_list_.push_back(s);
}
state_vec_.push_back(state);
}
}
bool cache_gc_; // Supports iteration when true.
std::vector<State *> state_vec_; // Vector of states (or null).
StateList state_list_; // List of states.
typename StateList::iterator iter_; // State list iterator.
typename State::StateAllocator state_alloc_; // For state allocation.
typename State::ArcAllocator arc_alloc_; // For arc allocation.
};
// This class uses a hash map from state IDs to pointers to cached states.
template <class S>
class HashCacheStore {
public:
using State = S;
using Arc = typename State::Arc;
using StateId = typename Arc::StateId;
using StateMap =
std::unordered_map<StateId, State *, std::hash<StateId>,
std::equal_to<StateId>,
PoolAllocator<std::pair<const StateId, State *>>>;
// Required constructors/assignment operators.
explicit HashCacheStore(const CacheOptions &opts) {
Clear();
Reset();
}
HashCacheStore(const HashCacheStore<S> &store) {
CopyStates(store);
Reset();
}
~HashCacheStore() { Clear(); }
HashCacheStore<State> &operator=(const HashCacheStore<State> &store) {
if (this != &store) {
CopyStates(store);
Reset();
}
return *this;
}
// Returns nullptr if state is not stored.
const State *GetState(StateId s) const {
const auto it = state_map_.find(s);
return it != state_map_.end() ? it->second : nullptr;
}
// Creates state if state is not stored.
State *GetMutableState(StateId s) {
auto *&state = state_map_[s];
if (!state) state = new (&state_alloc_) State(arc_alloc_);
return state;
}
// Similar to State::AddArc() but updates cache store book-keeping.
void AddArc(State *state, const Arc &arc) { state->AddArc(arc); }
// Similar to State::SetArcs() but updates internal cache size; call only
// once.
void SetArcs(State *state) { state->SetArcs(); }
// Deletes all arcs.
void DeleteArcs(State *state) { state->DeleteArcs(); }
// Deletes some arcs.
void DeleteArcs(State *state, size_t n) { state->DeleteArcs(n); }
// Deletes all cached states.
void Clear() {
for (auto it = state_map_.begin(); it != state_map_.end(); ++it) {
State::Destroy(it->second, &state_alloc_);
}
state_map_.clear();
}
StateId CountStates() const { return state_map_.size(); }
// Iterates over cached states (in an arbitrary order).
bool Done() const { return iter_ == state_map_.end(); }
StateId Value() const { return iter_->first; }
void Next() { ++iter_; }
void Reset() { iter_ = state_map_.begin(); }
// Deletes current state and advances to next.
void Delete() {
State::Destroy(iter_->second, &state_alloc_);
state_map_.erase(iter_++);
}
private:
void CopyStates(const HashCacheStore<State> &store) {
Clear();
for (auto it = store.state_map_.begin(); it != store.state_map_.end();
++it) {
state_map_[it->first] =
new (&state_alloc_) State(*it->second, arc_alloc_);
}
}
StateMap state_map_; // Map from state ID to state.
typename StateMap::iterator iter_; // State map iterator.
typename State::StateAllocator state_alloc_; // For state allocation.
typename State::ArcAllocator arc_alloc_; // For arc allocation.
};
// Garbage-colllection cache stores.
// This class implements a simple garbage collection scheme when
// 'opts.gc_limit = 0'. In particular, the first cached state is reused for each
// new state so long as the reference count is zero on the to-be-reused state.
// Otherwise, the full underlying store is used. The caller can increment the
// reference count to inhibit the GC of in-use states (e.g., in an ArcIterator).
//
// The typical use case for this optimization is when a single pass over a
// cached
// FST is performed with only one-state expanded at a time.
template <class CacheStore>
class FirstCacheStore {
public:
using State = typename CacheStore::State;
using Arc = typename State::Arc;
using StateId = typename Arc::StateId;
// Required constructors/assignment operators.
explicit FirstCacheStore(const CacheOptions &opts)
: store_(opts),
cache_gc_(opts.gc_limit == 0), // opts.gc ignored historically.
cache_first_state_id_(kNoStateId),
cache_first_state_(nullptr) {}
FirstCacheStore(const FirstCacheStore<CacheStore> &store)
: store_(store.store_),
cache_gc_(store.cache_gc_),
cache_first_state_id_(store.cache_first_state_id_),
cache_first_state_(store.cache_first_state_id_ != kNoStateId
? store_.GetMutableState(0)
: nullptr) {}
FirstCacheStore<CacheStore> &operator=(
const FirstCacheStore<CacheStore> &store) {
if (this != &store) {
store_ = store.store_;
cache_gc_ = store.cache_gc_;
cache_first_state_id_ = store.cache_first_state_id_;
cache_first_state_ = store.cache_first_state_id_ != kNoStateId
? store_.GetMutableState(0)
: nullptr;
}
return *this;
}
// Returns nullptr if state is not stored.
const State *GetState(StateId s) const {
// store_ state 0 may hold first cached state; the rest are shifted by 1.
return s == cache_first_state_id_ ? cache_first_state_
: store_.GetState(s + 1);
}
// Creates state if state is not stored.
State *GetMutableState(StateId s) {
// store_ state 0 used to hold first cached state; the rest are shifted by
// 1.
if (cache_first_state_id_ == s) {
return cache_first_state_; // Request for first cached state.
}
if (cache_gc_) {
if (cache_first_state_id_ == kNoStateId) {
cache_first_state_id_ = s; // Sets first cached state.
cache_first_state_ = store_.GetMutableState(0);
cache_first_state_->SetFlags(kCacheInit, kCacheInit);
cache_first_state_->ReserveArcs(2 * kAllocSize);
return cache_first_state_;
} else if (cache_first_state_->RefCount() == 0) {
cache_first_state_id_ = s; // Updates first cached state.
cache_first_state_->Reset();
cache_first_state_->SetFlags(kCacheInit, kCacheInit);
return cache_first_state_;
} else { // Keeps first cached state.
cache_first_state_->SetFlags(0, kCacheInit); // Clears initialized bit.
cache_gc_ = false; // Disables GC.
}
}
auto *state = store_.GetMutableState(s + 1);
return state;
}
// Similar to State::AddArc() but updates cache store book-keeping.
void AddArc(State *state, const Arc &arc) { store_.AddArc(state, arc); }
// Similar to State::SetArcs() but updates internal cache size; call only
// once.
void SetArcs(State *state) { store_.SetArcs(state); }
// Deletes all arcs
void DeleteArcs(State *state) { store_.DeleteArcs(state); }
// Deletes some arcs
void DeleteArcs(State *state, size_t n) { store_.DeleteArcs(state, n); }
// Deletes all cached states
void Clear() {
store_.Clear();
cache_first_state_id_ = kNoStateId;
cache_first_state_ = nullptr;
}
StateId CountStates() const { return store_.CountStates(); }
// Iterates over cached states (in an arbitrary order). Only needed if GC is
// enabled.
bool Done() const { return store_.Done(); }
StateId Value() const {
// store_ state 0 may hold first cached state; rest shifted + 1.
const auto s = store_.Value();
return s ? s - 1 : cache_first_state_id_;
}
void Next() { store_.Next(); }
void Reset() { store_.Reset(); }
// Deletes current state and advances to next.
void Delete() {
if (Value() == cache_first_state_id_) {
cache_first_state_id_ = kNoStateId;
cache_first_state_ = nullptr;
}
store_.Delete();
}
private:
CacheStore store_; // Underlying store.
bool cache_gc_; // GC enabled.
StateId cache_first_state_id_; // First cached state ID.
State *cache_first_state_; // First cached state.
};
// This class implements mark-sweep garbage collection on an underlying cache
// store. If GC is enabled, garbage collection of states is performed in a
// rough approximation of LRU order once when 'gc_limit' bytes is reached. The
// caller can increment the reference count to inhibit the GC of in-use state
// (e.g., in an ArcIterator). With GC enabled, the 'gc_limit' parameter allows
// the caller to trade-off time vs. space.
template <class CacheStore>
class GCCacheStore {
public:
using State = typename CacheStore::State;
using Arc = typename State::Arc;
using StateId = typename Arc::StateId;
// Required constructors/assignment operators.
explicit GCCacheStore(const CacheOptions &opts)
: store_(opts),
cache_gc_request_(opts.gc),
cache_limit_(opts.gc_limit > kMinCacheLimit ? opts.gc_limit
: kMinCacheLimit),
cache_gc_(false),
cache_size_(0) {}
// Returns 0 if state is not stored.
const State *GetState(StateId s) const { return store_.GetState(s); }
// Creates state if state is not stored
State *GetMutableState(StateId s) {
auto *state = store_.GetMutableState(s);
if (cache_gc_request_ && !(state->Flags() & kCacheInit)) {
state->SetFlags(kCacheInit, kCacheInit);
cache_size_ += sizeof(State) + state->NumArcs() * sizeof(Arc);
// GC is enabled once an uninited state (from underlying store) is seen.
cache_gc_ = true;
if (cache_size_ > cache_limit_) GC(state, false);
}
return state;
}
// Similar to State::AddArc() but updates cache store book-keeping.
void AddArc(State *state, const Arc &arc) {
store_.AddArc(state, arc);
if (cache_gc_ && (state->Flags() & kCacheInit)) {
cache_size_ += sizeof(Arc);
if (cache_size_ > cache_limit_) GC(state, false);
}
}
// Similar to State::SetArcs() but updates internal cache size; call only
// once.
void SetArcs(State *state) {
store_.SetArcs(state);
if (cache_gc_ && (state->Flags() & kCacheInit)) {
cache_size_ += state->NumArcs() * sizeof(Arc);
if (cache_size_ > cache_limit_) GC(state, false);
}
}
// Deletes all arcs.
void DeleteArcs(State *state) {
if (cache_gc_ && (state->Flags() & kCacheInit)) {
cache_size_ -= state->NumArcs() * sizeof(Arc);
}
store_.DeleteArcs(state);
}
// Deletes some arcs.
void DeleteArcs(State *state, size_t n) {
if (cache_gc_ && (state->Flags() & kCacheInit)) {
cache_size_ -= n * sizeof(Arc);
}
store_.DeleteArcs(state, n);
}
// Deletes all cached states.
void Clear() {
store_.Clear();
cache_size_ = 0;
}
StateId CountStates() const { return store_.CountStates(); }
// Iterates over cached states (in an arbitrary order); only needed if GC is
// enabled.
bool Done() const { return store_.Done(); }
StateId Value() const { return store_.Value(); }
void Next() { store_.Next(); }
void Reset() { store_.Reset(); }
// Deletes current state and advances to next.
void Delete() {
if (cache_gc_) {
const auto *state = store_.GetState(Value());
if (state->Flags() & kCacheInit) {
cache_size_ -= sizeof(State) + state->NumArcs() * sizeof(Arc);
}
}
store_.Delete();
}
// Removes from the cache store (not referenced-counted and not the current)
// states that have not been accessed since the last GC until at most
// cache_fraction * cache_limit_ bytes are cached. If that fails to free
// enough, attempts to uncaching recently visited states as well. If still
// unable to free enough memory, then widens cache_limit_.
void GC(const State *current, bool free_recent, float cache_fraction = 0.666);
// Returns the current cache size in bytes or 0 if GC is disabled.
size_t CacheSize() const { return cache_size_; }
// Returns the cache limit in bytes.
size_t CacheLimit() const { return cache_limit_; }
private:
static constexpr size_t kMinCacheLimit = 8096; // Minimum cache limit.
CacheStore store_; // Underlying store.
bool cache_gc_request_; // GC requested but possibly not yet enabled.
size_t cache_limit_; // Number of bytes allowed before GC.
bool cache_gc_; // GC enabled
size_t cache_size_; // Number of bytes cached.
};
template <class CacheStore>
void GCCacheStore<CacheStore>::GC(const State *current, bool free_recent,
float cache_fraction) {
if (!cache_gc_) return;
VLOG(2) << "GCCacheStore: Enter GC: object = "
<< "(" << this << "), free recently cached = " << free_recent
<< ", cache size = " << cache_size_
<< ", cache frac = " << cache_fraction
<< ", cache limit = " << cache_limit_ << "\n";
size_t cache_target = cache_fraction * cache_limit_;
store_.Reset();
while (!store_.Done()) {
auto *state = store_.GetMutableState(store_.Value());
if (cache_size_ > cache_target && state->RefCount() == 0 &&
(free_recent || !(state->Flags() & kCacheRecent)) && state != current) {
if (state->Flags() & kCacheInit) {
size_t size = sizeof(State) + state->NumArcs() * sizeof(Arc);
if (size < cache_size_) {
cache_size_ -= size;
}
}
store_.Delete();
} else {
state->SetFlags(0, kCacheRecent);
store_.Next();
}
}
if (!free_recent && cache_size_ > cache_target) { // Recurses on recent.
GC(current, true, cache_fraction);
} else if (cache_target > 0) { // Widens cache limit.
while (cache_size_ > cache_target) {
cache_limit_ *= 2;
cache_target *= 2;
}
} else if (cache_size_ > 0) {
FSTERROR() << "GCCacheStore:GC: Unable to free all cached states";
}
VLOG(2) << "GCCacheStore: Exit GC: object = "
<< "(" << this << "), free recently cached = " << free_recent
<< ", cache size = " << cache_size_
<< ", cache frac = " << cache_fraction
<< ", cache limit = " << cache_limit_ << "\n";
}
template <class CacheStore>
constexpr size_t GCCacheStore<CacheStore>::kMinCacheLimit;
// This class is the default cache state and store used by CacheBaseImpl.
// It uses VectorCacheStore for storage decorated by FirstCacheStore
// and GCCacheStore to do (optional) garbage collection.
template <class Arc>
class DefaultCacheStore
: public GCCacheStore<FirstCacheStore<VectorCacheStore<CacheState<Arc>>>> {
public:
explicit DefaultCacheStore(const CacheOptions &opts)
: GCCacheStore<FirstCacheStore<VectorCacheStore<CacheState<Arc>>>>(opts) {
}
};
namespace internal {
// This class is used to cache FST elements stored in states of type State
// (see CacheState) with the flags used to indicate what has been cached. Use
// HasStart(), HasFinal(), and HasArcs() to determine if cached and SetStart(),
// SetFinal(), AddArc(), (or PushArc() and SetArcs()) to cache. Note that you
// must set the final weight even if the state is non-final to mark it as
// cached. The state storage method and any garbage collection policy are
// determined by the cache store. If the store is passed in with the options,
// CacheBaseImpl takes ownership.
template <class State,
class CacheStore = DefaultCacheStore<typename State::Arc>>
class CacheBaseImpl : public FstImpl<typename State::Arc> {
public:
using Arc = typename State::Arc;
using StateId = typename Arc::StateId;
using Weight = typename Arc::Weight;
using Store = CacheStore;
using FstImpl<Arc>::Type;
using FstImpl<Arc>::Properties;
explicit CacheBaseImpl(const CacheOptions &opts = CacheOptions())
: has_start_(false),
cache_start_(kNoStateId),
nknown_states_(0),
min_unexpanded_state_id_(0),
max_expanded_state_id_(-1),
cache_gc_(opts.gc),
cache_limit_(opts.gc_limit),
cache_store_(new CacheStore(opts)),
new_cache_store_(true),
own_cache_store_(true) {}
explicit CacheBaseImpl(const CacheImplOptions<CacheStore> &opts)
: has_start_(false),
cache_start_(kNoStateId),
nknown_states_(0),
min_unexpanded_state_id_(0),
max_expanded_state_id_(-1),
cache_gc_(opts.gc),
cache_limit_(opts.gc_limit),
cache_store_(opts.store ? opts.store : new CacheStore(CacheOptions(
opts.gc, opts.gc_limit))),
new_cache_store_(!opts.store),
own_cache_store_(opts.store ? opts.own_store : true) {}
// Preserve gc parameters. If preserve_cache is true, also preserves
// cache data.
CacheBaseImpl(const CacheBaseImpl<State, CacheStore> &impl,
bool preserve_cache = false)
: FstImpl<Arc>(),
has_start_(false),
cache_start_(kNoStateId),
nknown_states_(0),
min_unexpanded_state_id_(0),
max_expanded_state_id_(-1),
cache_gc_(impl.cache_gc_),
cache_limit_(impl.cache_limit_),
cache_store_(new CacheStore(CacheOptions(cache_gc_, cache_limit_))),
new_cache_store_(impl.new_cache_store_ || !preserve_cache),
own_cache_store_(true) {
if (preserve_cache) {
*cache_store_ = *impl.cache_store_;
has_start_ = impl.has_start_;
cache_start_ = impl.cache_start_;
nknown_states_ = impl.nknown_states_;
expanded_states_ = impl.expanded_states_;
min_unexpanded_state_id_ = impl.min_unexpanded_state_id_;
max_expanded_state_id_ = impl.max_expanded_state_id_;
}
}
~CacheBaseImpl() override { if (own_cache_store_) delete cache_store_; }
void SetStart(StateId s) {
cache_start_ = s;
has_start_ = true;
if (s >= nknown_states_) nknown_states_ = s + 1;
}
void SetFinal(StateId s, Weight weight = Weight::One()) {
auto *state = cache_store_->GetMutableState(s);
state->SetFinal(std::move(weight));
static constexpr auto flags = kCacheFinal | kCacheRecent;
state->SetFlags(flags, flags);
}
// Disabled to ensure PushArc not AddArc is used in existing code
// TODO(sorenj): re-enable for backing store
#if 0
// AddArc adds a single arc to a state and does incremental cache
// book-keeping. For efficiency, prefer PushArc and SetArcs below
// when possible.
void AddArc(StateId s, const Arc &arc) {
auto *state = cache_store_->GetMutableState(s);
cache_store_->AddArc(state, arc);
if (arc.nextstate >= nknown_states_)
nknown_states_ = arc.nextstate + 1;
SetExpandedState(s);
static constexpr auto flags = kCacheArcs | kCacheRecent;
state->SetFlags(flags, flags);
}
#endif
// Adds a single arc to a state but delays cache book-keeping. SetArcs must
// be called when all PushArc and EmplaceArc calls at a state are complete.
// Do not mix with calls to AddArc.
void PushArc(StateId s, const Arc &arc) {
auto *state = cache_store_->GetMutableState(s);
state->PushArc(arc);
}
void PushArc(StateId s, Arc &&arc) {
auto *state = cache_store_->GetMutableState(s);
state->PushArc(std::move(arc));
}
// Adds a single arc to a state but delays cache book-keeping. SetArcs must
// be called when all PushArc and EmplaceArc calls at a state are complete.
// Do not mix with calls to AddArc.
template <class... T>
void EmplaceArc(StateId s, T &&... ctor_args) {
auto *state = cache_store_->GetMutableState(s);
state->EmplaceArc(std::forward<T>(ctor_args)...);
}
// Marks arcs of a state as cached and does cache book-keeping after all
// calls to PushArc have been completed. Do not mix with calls to AddArc.
void SetArcs(StateId s) {
auto *state = cache_store_->GetMutableState(s);
cache_store_->SetArcs(state);
const auto narcs = state->NumArcs();
for (size_t a = 0; a < narcs; ++a) {
const auto &arc = state->GetArc(a);
if (arc.nextstate >= nknown_states_) nknown_states_ = arc.nextstate + 1;
}
SetExpandedState(s);
static constexpr auto flags = kCacheArcs | kCacheRecent;
state->SetFlags(flags, flags);
}
void ReserveArcs(StateId s, size_t n) {
auto *state = cache_store_->GetMutableState(s);
state->ReserveArcs(n);
}
void DeleteArcs(StateId s) {
auto *state = cache_store_->GetMutableState(s);
cache_store_->DeleteArcs(state);
}
void DeleteArcs(StateId s, size_t n) {
auto *state = cache_store_->GetMutableState(s);
cache_store_->DeleteArcs(state, n);
}
void Clear() {
nknown_states_ = 0;
min_unexpanded_state_id_ = 0;
max_expanded_state_id_ = -1;
has_start_ = false;
cache_start_ = kNoStateId;
cache_store_->Clear();
}
// Is the start state cached?
bool HasStart() const {
if (!has_start_ && Properties(kError)) has_start_ = true;
return has_start_;
}
// Is the final weight of the state cached?
bool HasFinal(StateId s) const {
const auto *state = cache_store_->GetState(s);
if (state && state->Flags() & kCacheFinal) {
state->SetFlags(kCacheRecent, kCacheRecent);
return true;
} else {
return false;
}
}
// Are arcs of the state cached?
bool HasArcs(StateId s) const {
const auto *state = cache_store_->GetState(s);
if (state && state->Flags() & kCacheArcs) {
state->SetFlags(kCacheRecent, kCacheRecent);
return true;
} else {
return false;
}
}
StateId Start() const { return cache_start_; }
Weight Final(StateId s) const {
const auto *state = cache_store_->GetState(s);
return state->Final();
}
size_t NumArcs(StateId s) const {
const auto *state = cache_store_->GetState(s);
return state->NumArcs();
}
size_t NumInputEpsilons(StateId s) const {
const auto *state = cache_store_->GetState(s);
return state->NumInputEpsilons();
}
size_t NumOutputEpsilons(StateId s) const {
const auto *state = cache_store_->GetState(s);
return state->NumOutputEpsilons();
}
// Provides information needed for generic arc iterator.
void InitArcIterator(StateId s, ArcIteratorData<Arc> *data) const {
const auto *state = cache_store_->GetState(s);
data->base = nullptr;
data->narcs = state->NumArcs();
data->arcs = state->Arcs();
data->ref_count = state->MutableRefCount();
state->IncrRefCount();
}
// Number of known states.
StateId NumKnownStates() const { return nknown_states_; }
// Updates number of known states, taking into account the passed state ID.
void UpdateNumKnownStates(StateId s) {
if (s >= nknown_states_) nknown_states_ = s + 1;
}
// Finds the mininum never-expanded state ID.
StateId MinUnexpandedState() const {
while (min_unexpanded_state_id_ <= max_expanded_state_id_ &&
ExpandedState(min_unexpanded_state_id_)) {
++min_unexpanded_state_id_;
}
return min_unexpanded_state_id_;
}
// Returns maximum ever-expanded state ID.
StateId MaxExpandedState() const { return max_expanded_state_id_; }
void SetExpandedState(StateId s) {
if (s > max_expanded_state_id_) max_expanded_state_id_ = s;
if (s < min_unexpanded_state_id_) return;
if (s == min_unexpanded_state_id_) ++min_unexpanded_state_id_;
if (cache_gc_ || cache_limit_ == 0) {
if (expanded_states_.size() <= static_cast<size_t>(s))
expanded_states_.resize(s + 1, false);
expanded_states_[s] = true;
}
}
bool ExpandedState(StateId s) const {
if (cache_gc_ || cache_limit_ == 0) {
return expanded_states_[s];
} else if (new_cache_store_) {
return cache_store_->GetState(s) != nullptr;
} else {
// If the cache was not created by this class, then the cached state needs
// to be inspected to update nknown_states_.
return false;
}
}
const CacheStore *GetCacheStore() const { return cache_store_; }
CacheStore *GetCacheStore() { return cache_store_; }
// Caching on/off switch, limit and size accessors.
bool GetCacheGc() const { return cache_gc_; }
size_t GetCacheLimit() const { return cache_limit_; }
private:
mutable bool has_start_; // Is the start state cached?
StateId cache_start_; // ID of start state.
StateId nknown_states_; // Number of known states.
std::vector<bool> expanded_states_; // States that have been expanded.
mutable StateId min_unexpanded_state_id_; // Minimum never-expanded state ID
mutable StateId max_expanded_state_id_; // Maximum ever-expanded state ID
bool cache_gc_; // GC enabled.
size_t cache_limit_; // Number of bytes allowed before GC.
CacheStore *cache_store_; // The store of cached states.
bool new_cache_store_; // Was the store was created by class?
bool own_cache_store_; // Is the store owned by class?
CacheBaseImpl &operator=(const CacheBaseImpl &impl) = delete;
};
// A CacheBaseImpl with the default cache state type.
template <class Arc>
class CacheImpl : public CacheBaseImpl<CacheState<Arc>> {
public:
using State = CacheState<Arc>;
CacheImpl() {}
explicit CacheImpl(const CacheOptions &opts)
: CacheBaseImpl<CacheState<Arc>>(opts) {}
CacheImpl(const CacheImpl<Arc> &impl, bool preserve_cache = false)
: CacheBaseImpl<State>(impl, preserve_cache) {}
private:
CacheImpl &operator=(const CacheImpl &impl) = delete;
};
} // namespace internal
// Use this to make a state iterator for a CacheBaseImpl-derived FST, which must
// have Arc and Store types defined. Note this iterator only returns those
// states reachable from the initial state, so consider implementing a
// class-specific one.
//
// This class may be derived from.
template <class FST>
class CacheStateIterator : public StateIteratorBase<typename FST::Arc> {
public:
using Arc = typename FST::Arc;
using StateId = typename Arc::StateId;
using Weight = typename Arc::Weight;
using Store = typename FST::Store;
using State = typename Store::State;
using Impl = internal::CacheBaseImpl<State, Store>;
CacheStateIterator(const FST &fst, Impl *impl)
: fst_(fst), impl_(impl), s_(0) {
fst_.Start(); // Forces start state.
}
bool Done() const final {
if (s_ < impl_->NumKnownStates()) return false;
for (StateId u = impl_->MinUnexpandedState(); u < impl_->NumKnownStates();
u = impl_->MinUnexpandedState()) {
// Forces state expansion.
ArcIterator<FST> aiter(fst_, u);
aiter.SetFlags(kArcValueFlags, kArcValueFlags | kArcNoCache);
for (; !aiter.Done(); aiter.Next()) {
impl_->UpdateNumKnownStates(aiter.Value().nextstate);
}
impl_->SetExpandedState(u);
if (s_ < impl_->NumKnownStates()) return false;
}
return true;
}
StateId Value() const final { return s_; }
void Next() final { ++s_; }
void Reset() final { s_ = 0; }
private:
const FST &fst_;
Impl *impl_;
StateId s_;
};
// Used to make an arc iterator for a CacheBaseImpl-derived FST, which must
// have Arc and State types defined.
template <class FST>
class CacheArcIterator {
public:
using Arc = typename FST::Arc;
using StateId = typename Arc::StateId;
using Weight = typename Arc::Weight;
using Store = typename FST::Store;
using State = typename Store::State;
using Impl = internal::CacheBaseImpl<State, Store>;
CacheArcIterator(Impl *impl, StateId s) : i_(0) {
state_ = impl->GetCacheStore()->GetMutableState(s);
state_->IncrRefCount();
}
~CacheArcIterator() { state_->DecrRefCount(); }
bool Done() const { return i_ >= state_->NumArcs(); }
const Arc &Value() const { return state_->GetArc(i_); }
void Next() { ++i_; }
size_t Position() const { return i_; }
void Reset() { i_ = 0; }
void Seek(size_t a) { i_ = a; }
constexpr uint32 Flags() const { return kArcValueFlags; }
void SetFlags(uint32 flags, uint32 mask) {}
private:
const State *state_;
size_t i_;
CacheArcIterator(const CacheArcIterator &) = delete;
CacheArcIterator &operator=(const CacheArcIterator &) = delete;
};
// Use this to make a mutable arc iterator for a CacheBaseImpl-derived FST,
// which must have types Arc and Store defined.
template <class FST>
class CacheMutableArcIterator
: public MutableArcIteratorBase<typename FST::Arc> {
public:
using Arc = typename FST::Arc;
using StateId = typename Arc::StateId;
using Weight = typename Arc::Weight;
using Store = typename FST::Store;
using State = typename Store::State;
using Impl = internal::CacheBaseImpl<State, Store>;
// User must call MutateCheck() in the constructor.
CacheMutableArcIterator(Impl *impl, StateId s) : i_(0), s_(s), impl_(impl) {
state_ = impl_->GetCacheStore()->GetMutableState(s_);
state_->IncrRefCount();
}
~CacheMutableArcIterator() override { state_->DecrRefCount(); }
bool Done() const final { return i_ >= state_->NumArcs(); }
const Arc &Value() const final { return state_->GetArc(i_); }
void Next() final { ++i_; }
size_t Position() const final { return i_; }
void Reset() final { i_ = 0; }
void Seek(size_t a) final { i_ = a; }
void SetValue(const Arc &arc) final { state_->SetArc(arc, i_); }
uint32 Flags() const final { return kArcValueFlags; }
void SetFlags(uint32, uint32) final {}
private:
size_t i_;
StateId s_;
Impl *impl_;
State *state_;
CacheMutableArcIterator(const CacheMutableArcIterator &) = delete;
CacheMutableArcIterator &operator=(const CacheMutableArcIterator &) = delete;
};
// Wrap existing CacheStore implementation to use with ExpanderFst.
template <class CacheStore>
class ExpanderCacheStore {
public:
using State = typename CacheStore::State;
using Arc = typename CacheStore::Arc;
using StateId = typename Arc::StateId;
using Weight = typename Arc::Weight;
explicit ExpanderCacheStore(const CacheOptions &opts = CacheOptions())
: store_(opts) {}
template <class Expander>
State *FindOrExpand(Expander &expander, StateId s) { // NOLINT
auto *state = store_.GetMutableState(s);
if (state->Flags()) {
state->SetFlags(kCacheRecent, kCacheRecent);
} else {
StateBuilder builder(state);
expander.Expand(s, &builder);
state->SetFlags(kCacheFlags, kCacheFlags);
store_.SetArcs(state);
}
return state;
}
private:
CacheStore store_;
struct StateBuilder {
State *state;
explicit StateBuilder(State *state_) : state(state_) {}
void AddArc(const Arc &arc) { state->PushArc(arc); }
void AddArc(Arc &&arc) { state->PushArc(std::move(arc)); }
void SetFinal(Weight weight = Weight::One()) {
state->SetFinal(std::move(weight));
}
};
};
} // namespace fst
#endif // FST_CACHE_H_
| {'content_hash': '729f100b92fdc1373134e993809ec776', 'timestamp': '', 'source': 'github', 'line_count': 1309, 'max_line_length': 80, 'avg_line_length': 32.55156608097784, 'alnum_prop': 0.6370100915278104, 'repo_name': 'Simran-B/arangodb', 'id': 'e5c9f49895f1c728e1ccd5d03c21d7cfc8d719b2', 'size': '43015', 'binary': False, 'copies': '2', 'ref': 'refs/heads/devel', 'path': '3rdParty/iresearch/external/openfst/fst/cache.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '61827'}, {'name': 'Batchfile', 'bytes': '3282'}, {'name': 'C', 'bytes': '275955'}, {'name': 'C++', 'bytes': '29221660'}, {'name': 'CMake', 'bytes': '375992'}, {'name': 'CSS', 'bytes': '212174'}, {'name': 'EJS', 'bytes': '218744'}, {'name': 'HTML', 'bytes': '23114'}, {'name': 'JavaScript', 'bytes': '30616196'}, {'name': 'LLVM', 'bytes': '14753'}, {'name': 'Makefile', 'bytes': '526'}, {'name': 'NASL', 'bytes': '129286'}, {'name': 'NSIS', 'bytes': '49153'}, {'name': 'PHP', 'bytes': '46519'}, {'name': 'Pascal', 'bytes': '75391'}, {'name': 'Perl', 'bytes': '9811'}, {'name': 'PowerShell', 'bytes': '7885'}, {'name': 'Python', 'bytes': '181384'}, {'name': 'Ruby', 'bytes': '1041531'}, {'name': 'SCSS', 'bytes': '254419'}, {'name': 'Shell', 'bytes': '128175'}, {'name': 'TypeScript', 'bytes': '25245'}, {'name': 'Yacc', 'bytes': '68516'}]} |
<html dir="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<title>AcceptOnMatch Property</title>
<xml>
</xml>
<link rel="stylesheet" type="text/css" href="MSDN.css" />
</head>
<body id="bodyID" class="dtBODY">
<div id="nsbanner">
<div id="bannerrow1">
<table class="bannerparthead" cellspacing="0">
<tr id="hdr">
<td class="runninghead">Apache log4net SDK Documentation - Microsoft .NET Framework 4.0</td>
<td class="product">
</td>
</tr>
</table>
</div>
<div id="TitleRow">
<h1 class="dtH1">StringMatchFilter.AcceptOnMatch Property</h1>
</div>
</div>
<div id="nstext">
<p>
<a href="log4net.Filter.FilterDecision.html">Accept</a> when matching <a href="log4net.Filter.StringMatchFilter.StringToMatch.html">StringToMatch</a> or <a href="log4net.Filter.StringMatchFilter.RegexToMatch.html">RegexToMatch</a>
</p>
<div class="syntax">
<span class="lang">[Visual Basic]</span>
<br />Public Property AcceptOnMatch As <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemBooleanClassTopic.htm">Boolean</a></div>
<div class="syntax">
<span class="lang">[C#]</span>
<br />public <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemBooleanClassTopic.htm">bool</a> AcceptOnMatch {get; set;}</div>
<p>
</p>
<h4 class="dtH4">Remarks</h4>
<p> The <b>AcceptOnMatch</b> property is a flag that determines the behavior when a matching <a href="log4net.Core.Level.html">Level</a> is found. If the flag is set to true then the filter will <a href="log4net.Filter.FilterDecision.html">Accept</a> the logging event, otherwise it will <a href="log4net.Filter.FilterDecision.html">Neutral</a> the event. </p>
<p> The default is <code>true</code> i.e. to <b>Accept</b> the event. </p>
<h4 class="dtH4">See Also</h4><p><a href="log4net.Filter.StringMatchFilter.html">StringMatchFilter Class</a> | <a href="log4net.Filter.html">log4net.Filter Namespace</a></p><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;"><param name="Keyword" value="AcceptOnMatch property"></param><param name="Keyword" value="AcceptOnMatch property, StringMatchFilter class"></param><param name="Keyword" value="StringMatchFilter.AcceptOnMatch property"></param></object><hr /><div id="footer"><a href='http://logging.apache.org/log4net/'>Copyright 2004-2013 The Apache Software Foundation.</a><br></br>Apache log4net, Apache and log4net are trademarks of The Apache Software Foundation.</div></div>
</body>
</html> | {'content_hash': 'aa36b0407039a5500051ab13d58dbec6', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 781, 'avg_line_length': 69.45238095238095, 'alnum_prop': 0.655810764484059, 'repo_name': 'gersonkurz/manualisator', 'id': '936aed8fbe6c67ec99d026eb5fc8968d4827a8a6', 'size': '2917', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'manualisator/log4net-1.2.13/doc/release/sdk/log4net.Filter.StringMatchFilter.AcceptOnMatch.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '235121'}, {'name': 'CSS', 'bytes': '15869'}, {'name': 'HTML', 'bytes': '9723377'}, {'name': 'JavaScript', 'bytes': '5685'}, {'name': 'NSIS', 'bytes': '1916'}, {'name': 'Shell', 'bytes': '1041'}]} |
layout: page
title: About
permalink: /about/
---
I am a Ph.D. candidate with the [Computational and Biological Learning group](http://mlg.eng.cam.ac.uk/) at the University
of Cambridge, supervised by [Dr José Miguel Hernández-Lobato](https://jmhl.org/) and advised by
[Dr Richard Turner](http://cbl.eng.cam.ac.uk/Public/Turner/WebHome). My research focuses on developing probabilistic
models (typically parameterized by deep neural networks) and associated scalable approximate inference procedures.
I am particularly interested in developing deep probabilistic models that capture structure existing in specific data modalities,
and exhibit nice behaviours such as sample and parameter efficiency, generalization, and calibrated uncertainties. Much of
my recent work has focused on meta-learning, which enables fast few-shot generalization. Another theme in my research
is modelling symmetries in the data, such as by incorporating translation or permutation equivariance.
In my previous studies I examined applications of machine learning to specific domains such as healthcare and manufacturing.
Specifically, I examined how machine learning might be useful in prognosis and prediction of ALS progression based on
clinical trial data. I also worked on a project to develop optimal sampling strategies for quality assurance processes in
semi-conductor manufacturing environments.
## Education
* Present - PhD in Machine learning -- University of Cambridge
* 2017 - MPhil in Machine Learning, Speech and Language Technology -- University of Cambridge (distinction).
* 2016 - MSc. in Applied Statistics and Engineering -- Ben-Gurion University (magna cum laude).
* 2014 - BSc. in Engineering -- Ben-Gurion University (magna cum laude).
## Publications
* **Convolutional Conditional Neural Processes**
J. Gordon, W. P. Bruinsma, A. Y. K. Foong, J. Requeima, Y. Dubois, and R. E. Turner, _ICLR 2019_ (Oral presentation) [arXiv:1910.13556](https://arxiv.org/abs/1910.13556)
***
* **Permutation Equivariant Models for Compositional Generalization in Language**
J. Gordon, D. Lopez-Paz, M. Baroni, and D. Bouchacourt, [_ICLR 2019_](https://openreview.net/forum?id=SylVNerFvr)
***
* **Fast and Flexible Multi-Task Classification Using Conditional Neural Adaptive Processes**
J. R. Requima, J. Gordon, J. F. Bronskill, S. Nowozin, and R. E. Turner, _NeurIPS 2019_ (Spotlight) [arXiv:1906.07697](https://arxiv.org/abs/1906.07697)
***
* **Bayesian Batch Active Learning as Sparse Subset Approximation**
R. Pinsler, J. Gordon, E. Nalisnick, and J. M. H. Lobato, _NeurIPS 2019_ [arXiv:1908.02144](https://arxiv.org/abs/1908.02144)
***
* **Combining Deep Genereative and Discriminative Models for Bayesian Semi-supervised Learning**
J. Gordon, and J. M. H. Lobato, [_Pattern Recognition_](https://www.sciencedirect.com/science/article/pii/S003132031930456X)
***
* **Probabilistic Neural Architecture Search**
F. P. Casale, J. Gordon, and N. Fusi, [arXiv:1902.05116](https://arxiv.org/abs/1902.05116)
***
* **Meta-Learning Probabilistic Inference for Prediction**
J. Gordon, J. F. Bronskill, M. Bauer, S. Nowozin, and R. E. Turner, _ICLR 2019_ [_arXiv_:1805.09921](https://arxiv.org/abs/1805.09921)
***
* **Consolidating the Meta-Learning Zoo: a Unifying Perspective as Posterior Predictive Inference**
J. Gordon, J. F. Bronskill, M. Bauer, S. Nowozin, and R. E. Turner, [_Meta-Learning Workshop, NeurIPS 2018_](http://metalearning.ml/2018/papers/metalearn2018_paper26.pdf)
***
* **Versa: Versatile and Efficient Few-Shot Learning**
J. Gordon, J. F. Bronskill, M. Bauer, S. Nowozin, and R. E. Turner, [_Bayesian Deep Learning Workshop, NeurIPS 2018_](http://bayesiandeeplearning.org/2018/papers/10.pdf)
***
* **Cambridge MPhil thesis**
MPhil thesis on Bayesian adaptations of VAEs and VAE-BNN hybrids ([Download](https://github.com/Gordonjo/papers/blob/master/MPhilThesis/thesis.pdf/?raw=true))
***
* **Bayesian Semi-Supervised and Active Learning with Deep Generative Models**
J. Gordon and J. M. H. Lobato, _ICML Workshop on Principled Approaches to Deep Learning_, [arXiv:1706.09751](https://arxiv.org/abs/1706.09751)
***
* **Exposing and Modeling Underlying Mechanisms in ALS with Machine Learning**
J. Gordon and B. Lerner, _International Conference on Pattern Recognition, 2016_
***
* **Disease State Prediction, Knowledge Representation, and Heterogeneity Decomposition for ALS**
J. Gordon and B. Lerner, _UAI Workshop on Machine Learning in Healthcare, 2016_
***
## Awards and Scholarships
* [**Research Grant and Studenship**](#)
Funding for my Ph.D. research at the University of Cambridge, generously provided by Samsung ltd., the University of Cambridge, and the CBL.
***
* [**AJA Karten Trust Scholarhip**](#)
Yearly scholarship awarded for outstanding research, generously provided by the AJA foundation for two years.
***
* [**Kenneth Lindsay Scholarship Trust**](#)
Yearly scholarship awarded for outstanding research, generously provided by the Kenneth Lindsay foundation for one year.
***
* [**Dean's Scholarship for Outstanding Students**](#)
Funding and tuition provided for two years of MSc. studies for outstanding students, generously provided by Ben-Gurion University and the department of Engineering.
***
## Contact me
[[email protected]](mailto:[email protected])
| {'content_hash': '54aab4a1eed7c763c803cb1a89e0b7e7', 'timestamp': '', 'source': 'github', 'line_count': 144, 'max_line_length': 174, 'avg_line_length': 37.90277777777778, 'alnum_prop': 0.7389153536093808, 'repo_name': 'Gordonjo/Jekyll-Mono', 'id': '4eaadd666eedfb3cbce3e4b4182e5d8e69d303d6', 'size': '5464', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': 'about.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '16092'}, {'name': 'HTML', 'bytes': '12151'}, {'name': 'Ruby', 'bytes': '26'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Vietnamese Tutsplus Translation Team</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="/assets/css/main.css">
</head>
<body>
<div class="outer-wrapper d-md-flex align-items-stretch">
<div class="nav-wrapper d-md-flex flex-column bg-inverse">
<div class="collapse bg-inverse mb-auto" id="navbarHeader">
<div class="container">
<div class="row">
<div class="col-sm-8 col-md-12 py-4">
<h4 class="text-white">Về chúng tôi</h4>
<p class="text-muted mb-0">Chúng tôi đã dành thời gian, công sức, và sự đam mê để dịch những bài viết hay và bổ ích trên tutsplus, không chỉ là để giúp các bạn dễ đọc cũng như tìm hiểu, mà còn là một cách để giúp các bạn nâng cao vốn tiếng Anh bằng cách đọc song ngữ. Chúng tôi hy vọng các bạn cũng như chúng tôi, cũng đam mê và thích thú những bài viết trên tutsplus!</p>
</div>
<div class="col-sm-4 col-md-12 py-4 py-md-0">
<ul class="nav flex-column mb-3">
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/design/" >Thiết kế</a></li>
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/code/" >Lập trình</a></li>
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/webdesign/" >Thiết kế Web</a></li>
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/photography/" >Nhiếp ảnh</a></li>
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/business/" >Kinh doanh</a></li>
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/music/" >Âm nhạc</a></li>
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/cgi/" >CGI</a></li>
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/gamedevelopment/" >Phát triển Game</a></li>
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http://www.tutsquick.com/computers/" >Kỹ năng Tin học</a></li>
</ul>
<h4 class="text-white">Liên hệ</h4>
<ul class="list-unstyled">
<li><a href="https://twitter.com/TutsplusTeam" class="text-white">Twitter</a></li>
<li><a href="https://www.facebook.com/Tutsplus-Translation-Team-1028208713983323/" class="text-white">Facebook</a></li>
<li><a href="mailto:[email protected]" class="text-white">Email</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="navbar navbar-inverse bg-inverse px-md-0">
<div class="container d-flex justify-content-between">
<a href="http://www.tutsquick.com" class="navbar-brand">TutsPlusVN</a>
<button class="navbar-toggler d-md-none" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
</div>
<div class="content-wrapper">
<div class="row">
<div class="col">
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">Xây dựng một CMS: rubyPress</h1>
<p class="post-meta">
<time datetime="2016-05-10T19:00:58+07:00" itemprop="datePublished">
May 10, 2016
</time>
</p>
</header>
<div class="post-content" itemprop="articleBody">
<p>Sau khi tạo ra cấu trúc cơ bản của Hệ thống Quản lý Nội dung (CMS) và máy chủ thật sự bằng Go và Node.js, bạn đã sẵn sàng để thử một ngôn ngữ khác.</p>
</div>
</article>
</div>
</div>
</div>
</div>
<footer class="footer bg-faded">
<div class="container text-center">
<span class="text-muted">© 2017 DAI PHONG | Made with ❤️</span>
</div>
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="/assets/js/bootstrap.min.js"></script>
</body>
</html>
| {'content_hash': '19c4c548d3b668e5f88c931ac40f4dc5', 'timestamp': '', 'source': 'github', 'line_count': 121, 'max_line_length': 380, 'avg_line_length': 42.72727272727273, 'alnum_prop': 0.6061895551257254, 'repo_name': 'ddanh85/tutsvn', 'id': 'a9b5abc44d4d586727f55218b8e29b516db25231', 'size': '5361', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'code/2016/05/10/building-a-cms-rubypress.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '148232'}, {'name': 'HTML', 'bytes': '10362488'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2014 akquinet engineering GmbH
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-->
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="AddressbookExample" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<!-- (Tomcat) -->
<non-jta-data-source>java:comp/env/jdbc/vaadin</non-jta-data-source>
<class>de.akquinet.engineering.vaadinator.example.address.model.Address</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.target-database" value="PostgreSQL" />
<property name="eclipselink.application-location" value="." />
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="eclipselink.ddl-generation.output-mode" value="sql-script"/>
<property name="eclipselink.create-ddl-jdbc-file-name" value="create-tables.sql"/>
<property name="eclipselink.drop-ddl-jdbc-file-name" value="drop-tables.sql"/>
<!-- (Tomcat 4 Server Plug-In) -->
<property name="eclipselink.target-server" value=""/>
</properties>
</persistence-unit>
</persistence>
| {'content_hash': 'fc31dbd3a1e40a98cce8e17a675a90ea', 'timestamp': '', 'source': 'github', 'line_count': 37, 'max_line_length': 120, 'avg_line_length': 50.486486486486484, 'alnum_prop': 0.7542826552462527, 'repo_name': 'akquinet/vaadinator', 'id': '6d8da12e4ad5a2a5cc065ceec950f34686805ba1', 'size': '1868', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'VaadinatorExample/AddressbookExample/src/tomcatex/main/resources/META-INF/persistence.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '50'}, {'name': 'CSS', 'bytes': '2840'}, {'name': 'Java', 'bytes': '605688'}]} |
#include "testutil.hpp"
const char *bind_address = 0;
const char *connect_address = 0;
void test_round_robin_out (void *ctx)
{
void *dealer = zmq_socket (ctx, ZMQ_DEALER);
assert (dealer);
int rc = zmq_bind (dealer, bind_address);
assert (rc == 0);
const size_t services = 5;
void *rep [services];
for (size_t peer = 0; peer < services; ++peer) {
rep [peer] = zmq_socket (ctx, ZMQ_REP);
assert (rep [peer]);
int timeout = 250;
rc = zmq_setsockopt (rep [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0);
rc = zmq_connect (rep [peer], connect_address);
assert (rc == 0);
}
// Wait for connections.
msleep (SETTLE_TIME);
// Send all requests
for (size_t i = 0; i < services; ++i)
s_send_seq (dealer, 0, "ABC", SEQ_END);
// Expect every REP got one message
zmq_msg_t msg;
zmq_msg_init (&msg);
for (size_t peer = 0; peer < services; ++peer)
s_recv_seq (rep [peer], "ABC", SEQ_END);
rc = zmq_msg_close (&msg);
assert (rc == 0);
close_zero_linger (dealer);
for (size_t peer = 0; peer < services; ++peer)
close_zero_linger (rep [peer]);
// Wait for disconnects.
msleep (SETTLE_TIME);
}
void test_fair_queue_in (void *ctx)
{
void *receiver = zmq_socket (ctx, ZMQ_DEALER);
assert (receiver);
int timeout = 250;
int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0);
rc = zmq_bind (receiver, bind_address);
assert (rc == 0);
const size_t services = 5;
void *senders [services];
for (size_t peer = 0; peer < services; ++peer) {
senders [peer] = zmq_socket (ctx, ZMQ_DEALER);
assert (senders [peer]);
rc = zmq_setsockopt (senders [peer], ZMQ_RCVTIMEO, &timeout, sizeof (int));
assert (rc == 0);
rc = zmq_connect (senders [peer], connect_address);
assert (rc == 0);
}
zmq_msg_t msg;
rc = zmq_msg_init (&msg);
assert (rc == 0);
s_send_seq (senders [0], "A", SEQ_END);
s_recv_seq (receiver, "A", SEQ_END);
s_send_seq (senders [0], "A", SEQ_END);
s_recv_seq (receiver, "A", SEQ_END);
// send our requests
for (size_t peer = 0; peer < services; ++peer)
s_send_seq (senders [peer], "B", SEQ_END);
// Wait for data.
msleep (SETTLE_TIME);
// handle the requests
for (size_t peer = 0; peer < services; ++peer)
s_recv_seq (receiver, "B", SEQ_END);
rc = zmq_msg_close (&msg);
assert (rc == 0);
close_zero_linger (receiver);
for (size_t peer = 0; peer < services; ++peer)
close_zero_linger (senders [peer]);
// Wait for disconnects.
msleep (SETTLE_TIME);
}
void test_destroy_queue_on_disconnect (void *ctx)
{
void *A = zmq_socket (ctx, ZMQ_DEALER);
assert (A);
int rc = zmq_bind (A, bind_address);
assert (rc == 0);
void *B = zmq_socket (ctx, ZMQ_DEALER);
assert (B);
rc = zmq_connect (B, connect_address);
assert (rc == 0);
// Send a message in both directions
s_send_seq (A, "ABC", SEQ_END);
s_send_seq (B, "DEF", SEQ_END);
rc = zmq_disconnect (B, connect_address);
assert (rc == 0);
// Disconnect may take time and need command processing.
zmq_pollitem_t poller [2] = { { A, 0, 0, 0 }, { B, 0, 0, 0 } };
rc = zmq_poll (poller, 2, 100);
assert (rc == 0);
rc = zmq_poll (poller, 2, 100);
assert (rc == 0);
// No messages should be available, sending should fail.
zmq_msg_t msg;
zmq_msg_init (&msg);
rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT);
assert (rc == -1);
assert (errno == EAGAIN);
rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT);
assert (rc == -1);
assert (errno == EAGAIN);
// After a reconnect of B, the messages should still be gone
rc = zmq_connect (B, connect_address);
assert (rc == 0);
rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT);
assert (rc == -1);
assert (errno == EAGAIN);
rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT);
assert (rc == -1);
assert (errno == EAGAIN);
rc = zmq_msg_close (&msg);
assert (rc == 0);
close_zero_linger (A);
close_zero_linger (B);
// Wait for disconnects.
msleep (SETTLE_TIME);
}
void test_block_on_send_no_peers (void *ctx)
{
void *sc = zmq_socket (ctx, ZMQ_DEALER);
assert (sc);
int timeout = 250;
int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout));
assert (rc == 0);
rc = zmq_send (sc, 0, 0, ZMQ_DONTWAIT);
assert (rc == -1);
assert (errno == EAGAIN);
rc = zmq_send (sc, 0, 0, 0);
assert (rc == -1);
assert (errno == EAGAIN);
rc = zmq_close (sc);
assert (rc == 0);
}
int main (void)
{
setup_test_environment();
void *ctx = zmq_ctx_new ();
assert (ctx);
const char *binds [] = { "inproc://a", "tcp://127.0.0.1:5555" };
const char *connects [] = { "inproc://a", "tcp://localhost:5555" };
for (int transports = 0; transports < 2; ++transports) {
bind_address = binds [transports];
connect_address = connects [transports];
// SHALL route outgoing messages to available peers using a round-robin
// strategy.
test_round_robin_out (ctx);
// SHALL receive incoming messages from its peers using a fair-queuing
// strategy.
test_fair_queue_in (ctx);
// SHALL block on sending, or return a suitable error, when it has no connected peers.
test_block_on_send_no_peers (ctx);
// SHALL create a double queue when a peer connects to it. If this peer
// disconnects, the DEALER socket SHALL destroy its double queue and SHALL
// discard any messages it contains.
// *** Test disabled until libzmq does this properly ***
// test_destroy_queue_on_disconnect (ctx);
}
int rc = zmq_ctx_term (ctx);
assert (rc == 0);
return 0 ;
}
| {'content_hash': '36115cec936567b49238adb97a2762c9', 'timestamp': '', 'source': 'github', 'line_count': 232, 'max_line_length': 94, 'avg_line_length': 25.823275862068964, 'alnum_prop': 0.5655149390752796, 'repo_name': 'wachel/RayTraceRenderer', 'id': '92f1923e4da47287d34fd08b225ad6f664cf6b25', 'size': '7409', 'binary': False, 'copies': '18', 'ref': 'refs/heads/master', 'path': 'Renderer/Depends/zeromq-4.2.2/tests/test_spec_dealer.cpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '3959'}, {'name': 'C', 'bytes': '310172'}, {'name': 'C#', 'bytes': '140059'}, {'name': 'C++', 'bytes': '3742744'}, {'name': 'CMake', 'bytes': '198497'}, {'name': 'HTML', 'bytes': '1422721'}, {'name': 'M4', 'bytes': '102630'}, {'name': 'Makefile', 'bytes': '428681'}, {'name': 'Objective-C', 'bytes': '22486'}, {'name': 'Roff', 'bytes': '358048'}, {'name': 'Shell', 'bytes': '371524'}]} |
'use strict';
const FocusScope = require('./src/FocusScope');
module.exports = FocusScope.default || FocusScope;
| {'content_hash': 'd47958dd1a52e5a99c382cbb57a8b2a2', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 50, 'avg_line_length': 16.714285714285715, 'alnum_prop': 0.717948717948718, 'repo_name': 'VioletLife/react', 'id': '2ff785ef79266cf4fd8e44ab6d50165b8a8a97e3', 'size': '317', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'packages/react-events/focus-scope.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '5225'}, {'name': 'C++', 'bytes': '44278'}, {'name': 'CSS', 'bytes': '11525'}, {'name': 'CoffeeScript', 'bytes': '16077'}, {'name': 'HTML', 'bytes': '56296'}, {'name': 'JavaScript', 'bytes': '3226417'}, {'name': 'Makefile', 'bytes': '189'}, {'name': 'Python', 'bytes': '259'}, {'name': 'Shell', 'bytes': '3914'}, {'name': 'TypeScript', 'bytes': '20252'}]} |
package org.semagrow.plan.queryblock;
import org.semagrow.plan.*;
import java.util.Collection;
import java.util.Set;
/**
* @author acharal
* @since 2.0
*/
public interface QueryBlock {
/**
* Get the name of the variables that will occur
* in the output of the block
* @return the set of the output variables
*/
Set<String> getOutputVariables();
/**
* Get the structure properties that are enforced by this query block on its output
* @return the structure properties of the output (if any). If the block does not
* impose any properties on its output then the returned properties are trivial.
* @see DataProperties ::isTrivial
*/
DataProperties getOutputDataProperties();
/**
* Infer the fact that the output may contain duplicates.
* This depends on the {@link OutputStrategy} associated with this block
* and from its children.
* @return false if it is guaranteed that the output will not contain duplicates; false otherwise.
* @see OutputStrategy
* @see this::setDuplicateStrategy
*/
boolean hasDuplicates();
/**
* Get the {@link OutputStrategy} that is set for this block.
* <p>
* If not set, the default is {@link OutputStrategy::PRESERVE}
*
* @return the current output strategy
*/
OutputStrategy getDuplicateStrategy();
/**
* Set the {@link OutputStrategy} for this block
* @param duplicateStrategy the desired output strategy.
*/
void setDuplicateStrategy(OutputStrategy duplicateStrategy);
/**
* Get the interesting properties that are associated
* with this query block
* @return the associated interesting properties
*/
InterestingProperties getInterestingProperties();
/**
* Associates a set of interesting properties with this block
* @param intProps the interesting properties to associate with
*/
void setInterestingProperties(InterestingProperties intProps);
<X extends Exception> void visit(QueryBlockVisitor<X> visitor) throws X;
<X extends Exception> void visitChildren(QueryBlockVisitor<X> visitor) throws X;
Collection<Plan> getPlans(CompilerContext context);
}
| {'content_hash': '7c27d69c33ece84d1d865c91ec0faa6b', 'timestamp': '', 'source': 'github', 'line_count': 74, 'max_line_length': 102, 'avg_line_length': 30.22972972972973, 'alnum_prop': 0.6888690210102816, 'repo_name': 'semagrow/semagrow', 'id': '37551784e8eb79e2990e32f479eedf0c010c97e0', 'size': '2237', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core/src/main/java/org/semagrow/plan/queryblock/QueryBlock.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1172'}, {'name': 'CSS', 'bytes': '14911'}, {'name': 'Dockerfile', 'bytes': '1227'}, {'name': 'Groovy', 'bytes': '14789'}, {'name': 'HTML', 'bytes': '346638'}, {'name': 'Java', 'bytes': '870412'}, {'name': 'JavaScript', 'bytes': '898418'}, {'name': 'SCSS', 'bytes': '4126'}, {'name': 'Shell', 'bytes': '25787'}, {'name': 'XSLT', 'bytes': '20979'}]} |
package io.crate.breaker;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertThat;
import java.util.Locale;
import org.elasticsearch.common.breaker.CircuitBreaker;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.indices.breaker.CircuitBreakerService;
import org.elasticsearch.indices.breaker.CircuitBreakerStats;
import org.elasticsearch.indices.breaker.HierarchyCircuitBreakerService;
import org.junit.Test;
import io.crate.test.integration.CrateDummyClusterServiceUnitTest;
public class CrateCircuitBreakerServiceTest extends CrateDummyClusterServiceUnitTest {
@Test
public void testQueryCircuitBreakerRegistration() throws Exception {
CircuitBreakerService breakerService = new HierarchyCircuitBreakerService(
Settings.EMPTY,
clusterService.getClusterSettings()
);
CircuitBreaker breaker = breakerService.getBreaker(HierarchyCircuitBreakerService.QUERY);
assertThat(breaker, notNullValue());
assertThat(breaker, instanceOf(CircuitBreaker.class));
assertThat(breaker.getName(), is(HierarchyCircuitBreakerService.QUERY));
}
@Test
public void testQueryBreakerAssignment() throws Exception {
Settings settings = Settings.builder()
.put(HierarchyCircuitBreakerService.QUERY_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "10m")
.build();
HierarchyCircuitBreakerService breakerService = new HierarchyCircuitBreakerService(
settings,
clusterService.getClusterSettings()
);
CircuitBreaker breaker = breakerService.getBreaker(HierarchyCircuitBreakerService.QUERY);
assertThat(breaker.getLimit(), is(10_485_760L));
Settings newSettings = Settings.builder()
.put(HierarchyCircuitBreakerService.QUERY_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "100m")
.build();
clusterService.getClusterSettings().applySettings(newSettings);
breaker = breakerService.getBreaker(HierarchyCircuitBreakerService.QUERY);
assertThat(breaker.getLimit(), is(104_857_600L));
}
@Test
public void testStatsBreakerAssignment() throws Exception {
Settings settings = Settings.builder()
.put(HierarchyCircuitBreakerService.JOBS_LOG_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "10m")
.put(HierarchyCircuitBreakerService.OPERATIONS_LOG_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "10m")
.build();
CircuitBreakerService breakerService = new HierarchyCircuitBreakerService(
settings,
clusterService.getClusterSettings()
);
CircuitBreaker breaker;
breaker = breakerService.getBreaker(HierarchyCircuitBreakerService.JOBS_LOG);
assertThat(breaker.getLimit(), is(10_485_760L));
breaker = breakerService.getBreaker(HierarchyCircuitBreakerService.OPERATIONS_LOG);
assertThat(breaker.getLimit(), is(10_485_760L));
Settings newSettings = Settings.builder()
.put(HierarchyCircuitBreakerService.JOBS_LOG_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "100m")
.put(HierarchyCircuitBreakerService.OPERATIONS_LOG_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "100m")
.build();
clusterService.getClusterSettings().applySettings(newSettings);
breaker = breakerService.getBreaker(HierarchyCircuitBreakerService.JOBS_LOG);
assertThat(breaker.getLimit(), is(104_857_600L));
breaker = breakerService.getBreaker(HierarchyCircuitBreakerService.OPERATIONS_LOG);
assertThat(breaker.getLimit(), is(104_857_600L));
}
@Test
public void testBreakingExceptionMessage() throws Exception {
String message = HierarchyCircuitBreakerService.breakingExceptionMessage("dummy", 1234);
assertThat(message, is(String.format(Locale.ENGLISH, HierarchyCircuitBreakerService.BREAKING_EXCEPTION_MESSAGE, "dummy", 1234, new ByteSizeValue(1234))));
}
@Test
public void testStats() throws Exception {
CircuitBreakerService breakerService = new HierarchyCircuitBreakerService(
Settings.EMPTY, clusterService.getClusterSettings());
CircuitBreakerStats queryBreakerStats = breakerService.stats(HierarchyCircuitBreakerService.QUERY);
assertThat(queryBreakerStats.getUsed(), is(0L));
}
}
| {'content_hash': '32800facb11c51d1897d4d32bb486e48', 'timestamp': '', 'source': 'github', 'line_count': 102, 'max_line_length': 162, 'avg_line_length': 44.35294117647059, 'alnum_prop': 0.735632183908046, 'repo_name': 'crate/crate', 'id': '3c2993f82f27fb21282802764ee2f27103933bf6', 'size': '5535', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'server/src/test/java/io/crate/breaker/CrateCircuitBreakerServiceTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '41007'}, {'name': 'Batchfile', 'bytes': '4449'}, {'name': 'Java', 'bytes': '31937866'}, {'name': 'Python', 'bytes': '71077'}, {'name': 'Shell', 'bytes': '13572'}]} |
<?php
namespace Google\Cloud\Tests\PubSub\Connection;
use Google\Cloud\PubSub\Connection\ConnectionInterface;
use Google\Cloud\PubSub\Connection\IamTopic;
use Prophecy\Argument;
/**
* @group pubsub
*/
class IamTopicTest extends \PHPUnit_Framework_TestCase
{
public function testProxies()
{
$connection = $this->prophesize(ConnectionInterface::class);
$connection->getTopicIamPolicy(Argument::withEntry('foo', 'bar'))
->willReturn('test')
->shouldBeCalledTimes(1);
$connection->setTopicIamPolicy(Argument::withEntry('foo', 'bar'))
->willReturn('test')
->shouldBeCalledTimes(1);
$connection->testTopicIamPermissions(Argument::withEntry('foo', 'bar'))
->willReturn('test')
->shouldBeCalledTimes(1);
$iamTopic = new IamTopic($connection->reveal());
$this->assertEquals('test', $iamTopic->getPolicy(['foo' => 'bar']));
$this->assertEquals('test', $iamTopic->setPolicy(['foo' => 'bar']));
$this->assertEquals('test', $iamTopic->testPermissions(['foo' => 'bar']));
}
}
| {'content_hash': '2d67927d45fe11b921ba43e5b0480405', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 82, 'avg_line_length': 31.11111111111111, 'alnum_prop': 0.6339285714285714, 'repo_name': 'IRWNetwork/Stakeholders', 'id': '4fedb85eb8555d7f7103882d58adc98be227a388', 'size': '1715', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'gcloud/vendor/google/cloud/tests/unit/PubSub/Connection/IamTopicTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '3485'}, {'name': 'CSS', 'bytes': '1469000'}, {'name': 'HTML', 'bytes': '1040650'}, {'name': 'JavaScript', 'bytes': '2326357'}, {'name': 'Makefile', 'bytes': '285'}, {'name': 'PHP', 'bytes': '18185943'}, {'name': 'Shell', 'bytes': '680'}, {'name': 'Smarty', 'bytes': '4111127'}]} |
namespace BitFunnel
{
//*************************************************************************
//
// RingBuffer is a simple queue embedded in a fixed-length circular buffer.
//
// The length of the circular buffer is constrained to be a power of two in
// order to avoid using the mod operator when computing index values.
//
// The capacity of the RingBuffer is one less than the size of its circular
// buffer.
//
//*************************************************************************
template <typename T, size_t LOG2_CAPACITY>
class RingBuffer
{
public:
// Create an empty RingBuffer.
RingBuffer();
// Resets the RingBuffer to an empty state. Note that Reset() will
// never invoke the destructor for T.
void Reset();
// Extends the back of the queue and returns the pointer to the last
// item. Caller may use this pointer to set value of the last item.
// This method will assert if the RingBuffer is already full and
// cannot be extended.
//
// DESIGN NOTE: This method returns a T* instead of a T& in order to
// facilitate a usage pattern where the caller does a placement new of
// T at the address returned by PushBack. Constructing T in place
// allows the caller to avoid a copy of T. Once consequence of this
// design is that RingBuffer doesn't really manage a buffer of T. It
// never calls T's constructor and destructor.
T* PushBack();
// Removed the front item from the queue. This method will assert if
// the RingBuffer is already empty. Note that this method will not call
// T::~T().
void PopFront();
// Returns a reference to the item in the buffer at the specified index
// relative to the head item. Asserts if index references a slot beyond
// the end of the buffer.
T& operator[](size_t index) const;
// Returns true if the RingBuffer is empty. In this implementation, the
// buffer is considered empty when m_head == m_tail.
bool IsEmpty() const;
// Returns true if the RingBuffer is full. In this implementation, the
// buffer is considered full when (m_tail + 1) % c_slotCount == m_head.
bool IsFull() const;
// Returns the number of items currently in the buffer.
size_t GetCount() const;
private:
static const size_t c_slotCount = 1 << LOG2_CAPACITY;
static const size_t c_slotMask = c_slotCount - 1;
#ifdef _MSC_VER
__declspec(align(8)) char m_buffer[sizeof(T) * c_slotCount];
#else
__attribute__((__aligned__(8))) char m_buffer[sizeof(T) * c_slotCount];
#endif
T* m_slots;
size_t m_head;
size_t m_tail;
};
template <typename T, size_t LOG2_CAPACITY>
RingBuffer<T, LOG2_CAPACITY>::RingBuffer()
: m_slots(reinterpret_cast<T*>(m_buffer)),
m_head(0),
m_tail(0)
{
static_assert(LOG2_CAPACITY < 32, "RingBuffer: LOG2_CAPACITY must be less than 32.");
}
template <typename T, size_t LOG2_CAPACITY>
void RingBuffer<T, LOG2_CAPACITY>::Reset()
{
m_head = 0;
m_tail = 0;
}
template <typename T, size_t LOG2_CAPACITY>
T* RingBuffer<T, LOG2_CAPACITY>::PushBack()
{
LogAssertB(!IsFull(), "Ring buffer is full.");
T* slot = m_slots + m_tail;
m_tail = (m_tail + 1) & c_slotMask;
return slot;
}
template <typename T, size_t LOG2_CAPACITY>
void RingBuffer<T, LOG2_CAPACITY>::PopFront()
{
LogAssertB(!IsEmpty(), "Ring buffer is empty.");
m_head = (m_head + 1) & c_slotMask;
}
template <typename T, size_t LOG2_CAPACITY>
T& RingBuffer<T, LOG2_CAPACITY>::operator[](size_t index) const
{
size_t slot = m_head + index;
size_t tail = (m_tail < m_head) ? m_tail + c_slotCount : m_tail;
LogAssertB(slot < tail, "Ring buffer invalid index.");
return m_slots[slot & c_slotMask];
}
template <typename T, size_t LOG2_CAPACITY>
bool RingBuffer<T, LOG2_CAPACITY>::IsEmpty() const
{
return m_head == m_tail;
}
template <typename T, size_t LOG2_CAPACITY>
bool RingBuffer<T, LOG2_CAPACITY>::IsFull() const
{
return ((m_tail + 1) & c_slotMask) == m_head;
}
template <typename T, size_t LOG2_CAPACITY>
size_t RingBuffer<T, LOG2_CAPACITY>::GetCount() const
{
if (m_head <= m_tail)
{
return m_tail - m_head;
}
else
{
return m_tail + c_slotCount - m_head;
}
}
}
| {'content_hash': 'e2178a8ebef41b4dab8f3ab186c8dd1b', 'timestamp': '', 'source': 'github', 'line_count': 152, 'max_line_length': 93, 'avg_line_length': 31.144736842105264, 'alnum_prop': 0.5756231516687791, 'repo_name': 'BitFunnel/BitFunnel', 'id': '4181c4de0c803acff7dcfe82cb8127795472f3bb', 'size': '5917', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'inc/BitFunnel/Utilities/RingBuffer.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '307950'}, {'name': 'Batchfile', 'bytes': '6339'}, {'name': 'C', 'bytes': '38936'}, {'name': 'C++', 'bytes': '13607602'}, {'name': 'CMake', 'bytes': '105334'}, {'name': 'Go', 'bytes': '8231'}, {'name': 'M4', 'bytes': '50774'}, {'name': 'Makefile', 'bytes': '51574'}, {'name': 'PowerShell', 'bytes': '9427'}, {'name': 'Python', 'bytes': '924865'}, {'name': 'R', 'bytes': '11182'}, {'name': 'Shell', 'bytes': '66005'}]} |
using namespace boost;
const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds
const QString BITCOIN_IPC_PREFIX("coincoin:");
//
// Create a name that is unique for:
// testnet / non-testnet
// data directory
//
static QString ipcServerName()
{
QString name("BitcoinQt");
// Append a simple hash of the datadir
// Note that GetDataDir(true) returns a different path
// for -testnet versus main net
QString ddir(GetDataDir(true).string().c_str());
name.append(QString::number(qHash(ddir)));
return name;
}
//
// This stores payment requests received before
// the main GUI window is up and ready to ask the user
// to send payment.
//
static QStringList savedPaymentRequests;
//
// Sending to the server is done synchronously, at startup.
// If the server isn't already running, startup continues,
// and the items in savedPaymentRequest will be handled
// when uiReady() is called.
//
bool PaymentServer::ipcSendCommandLine()
{
bool fResult = false;
const QStringList& args = qApp->arguments();
for (int i = 1; i < args.size(); i++)
{
if (!args[i].startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive))
continue;
savedPaymentRequests.append(args[i]);
}
foreach (const QString& arg, savedPaymentRequests)
{
QLocalSocket* socket = new QLocalSocket();
socket->connectToServer(ipcServerName(), QIODevice::WriteOnly);
if (!socket->waitForConnected(BITCOIN_IPC_CONNECT_TIMEOUT))
return false;
QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly);
out.setVersion(QDataStream::Qt_4_0);
out << arg;
out.device()->seek(0);
socket->write(block);
socket->flush();
socket->waitForBytesWritten(BITCOIN_IPC_CONNECT_TIMEOUT);
socket->disconnectFromServer();
delete socket;
fResult = true;
}
return fResult;
}
PaymentServer::PaymentServer(QApplication* parent) : QObject(parent), saveURIs(true)
{
// Install global event filter to catch QFileOpenEvents on the mac (sent when you click bitcoin: links)
parent->installEventFilter(this);
QString name = ipcServerName();
// Clean up old socket leftover from a crash:
QLocalServer::removeServer(name);
uriServer = new QLocalServer(this);
if (!uriServer->listen(name))
qDebug() << tr("Cannot start coincoin: click-to-pay handler");
else
connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection()));
}
bool PaymentServer::eventFilter(QObject *object, QEvent *event)
{
// clicking on bitcoin: URLs creates FileOpen events on the Mac:
if (event->type() == QEvent::FileOpen)
{
QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
if (!fileEvent->url().isEmpty())
{
if (saveURIs) // Before main window is ready:
savedPaymentRequests.append(fileEvent->url().toString());
else
emit receivedURI(fileEvent->url().toString());
return true;
}
}
return false;
}
void PaymentServer::uiReady()
{
saveURIs = false;
foreach (const QString& s, savedPaymentRequests)
emit receivedURI(s);
savedPaymentRequests.clear();
}
void PaymentServer::handleURIConnection()
{
QLocalSocket *clientConnection = uriServer->nextPendingConnection();
while (clientConnection->bytesAvailable() < (int)sizeof(quint32))
clientConnection->waitForReadyRead();
connect(clientConnection, SIGNAL(disconnected()),
clientConnection, SLOT(deleteLater()));
QDataStream in(clientConnection);
in.setVersion(QDataStream::Qt_4_0);
if (clientConnection->bytesAvailable() < (int)sizeof(quint16)) {
return;
}
QString message;
in >> message;
if (saveURIs)
savedPaymentRequests.append(message);
else
emit receivedURI(message);
}
| {'content_hash': 'e9d9ce200daf4dac3977ffbcf4409cba', 'timestamp': '', 'source': 'github', 'line_count': 138, 'max_line_length': 107, 'avg_line_length': 28.695652173913043, 'alnum_prop': 0.6585858585858586, 'repo_name': 'CoinCoin-Dev/CoinCoin', 'id': 'ec0a5f7d833dd5aa68e5c7eca54d069a727d1a3f', 'size': '4505', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/qt/paymentserver.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '32790'}, {'name': 'C++', 'bytes': '2613371'}, {'name': 'CSS', 'bytes': '1127'}, {'name': 'Groff', 'bytes': '18289'}, {'name': 'HTML', 'bytes': '50615'}, {'name': 'Makefile', 'bytes': '13384'}, {'name': 'NSIS', 'bytes': '5944'}, {'name': 'Objective-C', 'bytes': '1052'}, {'name': 'Objective-C++', 'bytes': '5864'}, {'name': 'Python', 'bytes': '69721'}, {'name': 'QMake', 'bytes': '15202'}, {'name': 'Shell', 'bytes': '13173'}]} |
package xray
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/restjson"
)
// XRay provides the API operation methods for making requests to
// AWS X-Ray. See this package's package overview docs
// for details on the service.
//
// XRay methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type XRay struct {
*client.Client
}
// Used for custom client initialization logic
var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "xray" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "XRay" // ServiceID is a unique identifier of a specific service.
)
// New creates a new instance of the XRay client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// mySession := session.Must(session.NewSession())
//
// // Create a XRay client from just a session.
// svc := xray.New(mySession)
//
// // Create a XRay client with additional configuration
// svc := xray.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *XRay {
c := p.ClientConfig(EndpointsID, cfgs...)
return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *XRay {
svc := &XRay{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
PartitionID: partitionID,
Endpoint: endpoint,
APIVersion: "2016-04-12",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(
protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(),
)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a XRay operation and runs any
// custom request initialization.
func (c *XRay) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
// Run custom request initialization if present
if initRequest != nil {
initRequest(req)
}
return req
}
| {'content_hash': '7328ece6670d7cccdbe161c004a3ae34', 'timestamp': '', 'source': 'github', 'line_count': 99, 'max_line_length': 123, 'avg_line_length': 32.0, 'alnum_prop': 0.7361111111111112, 'repo_name': 'mkumatag/origin', 'id': '134114cdfb79551efd31dec0afb3704211805ba9', 'size': '3238', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'vendor/github.com/aws/aws-sdk-go/service/xray/service.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Awk', 'bytes': '921'}, {'name': 'Dockerfile', 'bytes': '2240'}, {'name': 'Go', 'bytes': '2298920'}, {'name': 'Makefile', 'bytes': '6395'}, {'name': 'Python', 'bytes': '14593'}, {'name': 'Shell', 'bytes': '310275'}]} |
<?php echo Form::open(array("class"=>"form-horizontal")); ?>
<fieldset>
<div class="form-group">
<?php echo Form::label('Text', 'text', array('class'=>'control-label')); ?>
<?php echo Form::input('text', Input::post('text', isset($entryType) ? $entryType->text : ''), array('class' => 'col-md-4 form-control', 'placeholder'=>'Text')); ?>
</div>
<div class="form-group">
<?php echo Form::label('Type', 'type', array('class'=>'control-label')); ?>
<?php echo Form::input('type', Input::post('type', isset($entryType) ? $entryType->type : ''), array('class' => 'col-md-4 form-control', 'placeholder'=>'Type')); ?>
</div>
<div class="form-group">
<label class='control-label'> </label>
<?php echo Form::submit('submit', 'Save', array('class' => 'btn btn-primary')); ?> </div>
</fieldset>
<?php echo Form::close(); ?> | {'content_hash': '8f702017c83f33262f142f398ab67018', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 168, 'avg_line_length': 42.75, 'alnum_prop': 0.5941520467836258, 'repo_name': 'grantelgin/refraction', 'id': 'e19b86ac17bd5272c51bb5bb85c79cd7ec9521cf', 'size': '855', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'fuel/app/views/entrytype/_form.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '18794'}, {'name': 'PHP', 'bytes': '1975644'}]} |
class MissingValue(object):
"""An observation's missing value.
More information: <http://www.stata.com/help.cgi?missing>"""
def __init__(self, offset, value):
self._value = value
if type(value) is int or type(value) is long:
self._str = value-offset is 1 and '.' or ('.' + chr(value-offset+96))
else:
self._str = '.'
string = property(lambda self: self._str, doc="The Stata representation of the missing value: '.', '.a'..'.z'")
value = property(lambda self: self._value, doc='The binary representation of the missing value.')
def __str__(self): return self._str
__str__.__doc__ = string.__doc__
class Variable(object):
"""A dataset variable."""
def __init__(self, variable_data): self._data = variable_data
def __int__(self): return self.index
def __str__(self): return self.name
index = property(lambda self: self._data[0], doc='the variable\'s index within an observation')
type = property(lambda self: self._data[1], doc='the data type of variable\n\nPossible types are:\n{1..244:string, b:byte, h:int, l:long, f:float, d:double)')
name = property(lambda self: self._data[2], doc='the name of the variable')
format = property(lambda self: self._data[4], doc='the variable\'s Stata format')
value_format = property(lambda self: self._data[5], doc='the variable\'s value format')
label = property(lambda self: self._data[6], doc='the variable\'s label')
__int__.__doc__ = index.__doc__
__str__.__doc__ = name.__doc__
| {'content_hash': 'ca3b986ace1d827a58b301a8d884f581', 'timestamp': '', 'source': 'github', 'line_count': 29, 'max_line_length': 162, 'avg_line_length': 53.3448275862069, 'alnum_prop': 0.6257272139625081, 'repo_name': 'karimbahgat/PythonGis', 'id': '8a8de54026a4a6debb29d5c4d9b67cbaa93acae6', 'size': '1547', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'pythongis/vector/fileformats/thirdparty/PyDTA/StataTypes.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '125'}, {'name': 'HTML', 'bytes': '1979518'}, {'name': 'Python', 'bytes': '1762972'}, {'name': 'Tcl', 'bytes': '345753'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../docs/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Apache JMeter - User's Manual: Regular Expressions</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<table border="0" cellspacing="0">
<tr>
<td align="left">
<a href="http://www.apache.org"><img title="Apache Software Foundation" width="387" height="100" src="../../docs/images/asf-logo.gif" border="0"/></a>
</td>
<td align="right">
<a href="http://jmeter.apache.org/"><img width="221" height="102" src="../../docs/images/logo.jpg" alt="Apache JMeter" title="Apache JMeter" border="0"></a>
</td>
</tr>
</table>
<table border="0" cellspacing="4">
<tr><td>
<hr noshade size="1">
</td></tr>
<tr>
<td align="left" valign="top">
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="hints_and_tips.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="functions.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="regex"><strong>20. Regular Expressions</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="overview"><strong>20.1 Overview</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
JMeter includes the pattern matching software
<a href="http://jakarta.apache.org/oro/">
Apache Jakarta ORO
</a>
<br>
There is some documentation for this on the Jakarta web-site, for example
<a href="http://jakarta.apache.org/oro/api/org/apache/oro/text/regex/package-summary.html">
a summary of the pattern matching characters
</a>
</p>
<p>
There is also documentation on an older incarnation of the product at
<a href="http://www.savarese.org/oro/docs/OROMatcher/index.html">
OROMatcher User's guide
</a>
, which might prove useful.
</p>
<p>
The pattern matching is very similar to the pattern matching in Perl.
A full installation of Perl will include plenty of documentation on regular expressions - look for perlrequick, perlretut, perlre, perlreref.
</p>
<p>
It is worth stressing the difference between "contains" and "matches", as used on the Response Assertion test element:
</p>
<ul>
<li>
"contains" means that the regular expression matched at least some part of the target,
so 'alphabet' "contains" 'ph.b.' because the regular expression matches the substring 'phabe'.
</li>
<li>
"matches" means that the regular expression matched the whole target.
So 'alphabet' is "matched" by 'al.*t'.
</li>
</ul>
<p>
In this case, it is equivalent to wrapping the regular expression in ^ and $, viz '^al.*t$'.
</p>
<p>
However, this is not always the case.
For example, the regular expression 'alp|.lp.*' is "contained" in 'alphabet', but does not match 'alphabet'.
</p>
<p>
Why? Because when the pattern matcher finds the sequence 'alp' in 'alphabet', it stops trying any other combinations - and 'alp' is not the same as 'alphabet', as it does not include 'habet'.
</p>
<p>
Note: unlike Perl, there is no need to (i.e. do not) enclose the regular expression in //.
</p>
<p>
So how does one use the modifiers ismx etc if there is no trailing /?
The solution is to use
<i>
extended regular expressions
</i>
, i.e. /abc/i becomes (?i)abc.
See also
<a href="placement">
Placement of modifiers
</a>
below.
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="examples"><strong>20.2 Examples</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<h3>
Extract single string
</h3>
<p>
Suppose you want to match the following portion of a web-page:
<br>
<code>
name="file" value="readme.txt">
</code>
<br>
and you want to extract
<code>
readme.txt
</code>
.
<br>
A suitable regular expression would be:
<br>
<code>
name="file" value="(.+?)">
</code>
<p>
The special characters above are:
</p>
<ul>
<li>
( and ) - these enclose the portion of the match string to be returned
</li>
<li>
. - match any character
</li>
<li>
+ - one or more times
</li>
<li>
? - don't be greedy, i.e. stop when first match succeeds
</li>
</ul>
<p>
Note: without the ?, the .+ would continue past the first
<code>
">
</code>
until it found the last possible
<code>
">
</code>
- which is probably not what was intended.
</p>
<p>
Note: although the above expression works, it's more efficient to use the following expression:
<br>
<code>
name="file" value="([^"]+)">
</code>
where
<br>
[^"] - means match anything except "
<br>
In this case, the matching engine can stop looking as soon as it sees the first
<code>
"
</code>
,
whereas in the previous case the engine has to check that it has found
<code>
">
</code>
rather than say
<code>
" >
</code>
.
</p>
<h3>
Extract multiple strings
</h3>
<p>
Suppose you want to match the following portion of a web-page:
<br>
<code>
name="file.name" value="readme.txt"
</code>
and you want to extract both
<code>
file.name
</code>
and
<code>
readme.txt
</code>
.
<br>
A suitable reqular expression would be:
<br>
<code>
name="([^"]+)" value="([^"]+)"
</code>
<br>
This would create 2 groups, which could be used in the JMeter Regular Expression Extractor template as $1$ and $2$.
</p>
<p>
The JMeter Regex Extractor saves the values of the groups in additional variables.
</p>
<p>
For example, assume:
</p>
<ul>
<li>
Reference Name: MYREF
</li>
<li>
Regex: name="(.+?)" value="(.+?)"
</li>
<li>
Template: $1$$2$
</li>
</ul>
<p><table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Do not enclose the regular expression in / /
</td></tr>
</table></p>
<p>
The following variables would be set:
</p>
<ul>
<li>
MYREF: file.namereadme.txt
</li>
<li>
MYREF_g0: name="file.name" value="readme.txt"
</li>
<li>
MYREF_g1: file.name
</li>
<li>
MYREF_g2: readme.txt
</li>
</ul>
These variables can be referred to later on in the JMeter test plan, as ${MYREF}, ${MYREF_g1} etc
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="line_mode"><strong>20.3 Line mode</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
The pattern matching behaves in various slightly different ways,
depending on the setting of the multi-line and single-line modifiers.
Note that the single-line and multi-line operators have nothing to do with each other;
they can be specified independently.
</p>
<h3>
Single-line mode
</h3>
<p>
Single-line mode only affects how the '.' meta-character is interpreted.
</p>
<p>
Default behaviour is that '.' matches any character except newline.
In single-line mode, '.' also matches newline.
</p>
<h3>
Multi-line mode
</h3>
<p>
Multi-line mode only affects how the meta-characters '^' and '$' are interpreted.
</p>
<p>
Default behaviour is that '^' and '$' only match at the very beginning and end of the string.
When Multi-line mode is used, the '^' metacharacter matches at the beginning of every line,
and the '$' metacharacter matches at the end of every line.
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="meta_chars"><strong>20.4 Meta characters</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
Regular expressions use certain characters as meta characters - these characters have a special meaning to the RE engine.
Such characters must be escaped by preceeding them with \ (backslash) in order to treat them as ordinary characters.
Here is a list of the meta characters and their meaning (please check the ORO documentation if in doubt).
</p>
<ul>
<li>
( ) - grouping
</li>
<li>
[ ] - character classes
</li>
<li>
{ } - repetition
</li>
<li>
* + ? - repetition
</li>
<li>
. - wild-card character
</li>
<li>
\ - escape character
</li>
<li>
| - alternatives
</li>
<li>
^ $ - start and end of string or line
</li>
</ul>
<p><table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
<p>
Please note that ORO does not support the \Q and \E meta-characters.
[In other RE engines, these can be used to quote a portion of an RE so that the meta-characters stand for themselves.]
You can use function to do the equivalent, see
<a href="functions.html#__escapeOroRegexpChars">
${__escapeOroRegexpChars(valueToEscape)}
</a>
.
</p>
</td></tr>
</table></p>
<p>
The following Perl5 extended regular expressions are supported by ORO.
<dl>
<dt>
(?#text)
</dt>
<dd>
An embedded comment causing text to be ignored.
</dd>
<dt>
(?:regexp)
</dt>
<dd>
Groups things like "()" but doesn't cause the group match to be saved.
</dd>
<dt>
(?=regexp)
</dt>
<dd>
A zero-width positive lookahead assertion. For example, \w+(?=\s) matches a word followed by whitespace, without including whitespace in the MatchResult.
</dd>
<dt>
(?!regexp)
</dt>
<dd>
A zero-width negative lookahead assertion. For example foo(?!bar) matches any occurrence of "foo" that isn't followed by "bar". Remember that this is a zero-width assertion, which means that a(?!b)d will match ad because a is followed by a character that is not b (the d) and a d follows the zero-width assertion.
</dd>
<dt>
(?imsx)
</dt>
<dd>
One or more embedded pattern-match modifiers. i enables case insensitivity, m enables multiline treatment of the input, s enables single line treatment of the input, and x enables extended whitespace comments.
</dd>
</dl>
<b>
Note that
<code>
(?<=regexp)
</code>
- lookbehind - is not supported.
</b>
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="placement"><strong>20.5 Placement of modifiers</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
Modifiers can be placed anywhere in the regex, and apply from that point onwards.
[A bug in ORO means that they cannot be used at the very end of the regex.
However they would have no effect there anyway.]
</p>
<p>
The single-line (?s) and multi-line (?m) modifiers are normally placed at the start of the regex.
</p>
<p>
The ignore-case modifier (?i) may be usefully applied to just part of a regex,
for example:
<pre>
Match ExAct case or (?i)ArBiTrARY(?-i) case
</pre>
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="testing_expressions"><strong>20.6 Testing Regular Expressions</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>
Since JMeter 2.4, the listener
<a href="component_reference.html#View_Results_Tree">
View Results Tree
</a>
include a RegExp Tester to test regular expressions directly on sampler response data.
</p>
<p>
There is a
<a href="http://jakarta.apache.org/oro/demo.html">
demo
</a>
applet for Apache JMeter ORO.
</p>
<p>
Another approach is to use a simple test plan to test the regular expressions.
The Java Request sampler can be used to generate a sample, or the HTTP Sampler can be used to load a file.
Add a Debug Sampler and a Tree View Listener and changes to the regular expression can be tested quickly,
without needing to access any external servers.
</p>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<br>
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="hints_and_tips.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="functions.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr><td>
<hr noshade size="1">
</td></tr>
<tr>
<td>
<table width=100%>
<tr>
<td>
<font color="#525D76" size="-1"><em>
Copyright © 1999-2013, Apache Software Foundation
</em></font>
</td>
<td align="right">
<font color="#525D76" size="-1"><em>
$Id: regular_expressions.xml 1412530 2012-11-22 12:45:06Z pmouawad $
</em></font>
</td>
</tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1">
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.
</font>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
| {'content_hash': '53f854813981172f7efae730d260c1a8', 'timestamp': '', 'source': 'github', 'line_count': 786, 'max_line_length': 313, 'avg_line_length': 18.348600508905854, 'alnum_prop': 0.6779226182221606, 'repo_name': 'jhulick/zuul-netty', 'id': '10446688a0074ab4684761fc10220a55aa43bc61', 'size': '14422', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'zuul-perf-tests/tools/apache-jmeter-2.9/printable_docs/usermanual/regular_expressions.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '23099'}, {'name': 'Groovy', 'bytes': '28044'}, {'name': 'HTML', 'bytes': '1254107'}, {'name': 'Java', 'bytes': '100356'}, {'name': 'Makefile', 'bytes': '451'}, {'name': 'Shell', 'bytes': '16250'}, {'name': 'XSLT', 'bytes': '49150'}]} |
package cn.com.heaton.blelibrary.ble.proxy;
import android.content.Context;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import cn.com.heaton.blelibrary.ble.BleLog;
import cn.com.heaton.blelibrary.ble.request.ConnectRequest;
import cn.com.heaton.blelibrary.ble.request.DescriptorRequest;
import cn.com.heaton.blelibrary.ble.request.MtuRequest;
import cn.com.heaton.blelibrary.ble.request.NotifyRequest;
import cn.com.heaton.blelibrary.ble.request.ReadRequest;
import cn.com.heaton.blelibrary.ble.request.ReadRssiRequest;
import cn.com.heaton.blelibrary.ble.request.Rproxy;
import cn.com.heaton.blelibrary.ble.request.ScanRequest;
import cn.com.heaton.blelibrary.ble.request.WriteRequest;
/**
*
* Created by LiuLei on 2017/9/1.
*/
public class RequestProxy implements InvocationHandler{
private static final String TAG = "RequestProxy";
private RequestProxy(){}
private Object receiver;
public static RequestProxy newProxy(){
return new RequestProxy();
}
//Bind the delegate object and return the proxy class
public Object bindProxy(Context context, Object tar){
this.receiver = tar;
//绑定委托对象,并返回代理类
BleLog.d(TAG, "bindProxy: "+"Binding agent successfully");
Rproxy.init(ConnectRequest.class, MtuRequest.class,
NotifyRequest.class, ReadRequest.class,
ReadRssiRequest.class, ScanRequest.class,
WriteRequest.class, DescriptorRequest.class);
return Proxy.newProxyInstance(
tar.getClass().getClassLoader(),
tar.getClass().getInterfaces(),
this);
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return method.invoke(receiver, args);
}
}
| {'content_hash': '26e7c22cff9fd4f5a21b64669f369f57', 'timestamp': '', 'source': 'github', 'line_count': 55, 'max_line_length': 87, 'avg_line_length': 33.67272727272727, 'alnum_prop': 0.718682505399568, 'repo_name': 'liulei-0911/BleDemo', 'id': '95a13c9f9f78c5fd80d725bad24034eb674db9b8', 'size': '1878', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'core/src/main/java/cn/com/heaton/blelibrary/ble/proxy/RequestProxy.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '144766'}]} |
local Clip, parent = torch.class("nn.Clip", "nn.Module")
function Clip:__init(minval, maxval)
assert(torch.type(minval) == 'number')
assert(torch.type(maxval) == 'number')
self.minval = minval
self.maxval = maxval
parent.__init(self)
end
function Clip:updateOutput(input)
-- bound results within height and width
self._mask = self._mask or input.new()
self._byte = self._byte or torch.ByteTensor()
self.output:resizeAs(input):copy(input)
self._mask:gt(self.output, self.maxval)
local byte = torch.type(self.output) == 'torch.CudaTensor' and self._mask
or self._byte:resize(self._mask:size()):copy(self._mask)
self.output[byte] = self.maxval
self._mask:lt(self.output, self.minval)
byte = torch.type(self.output) == 'torch.CudaTensor' and self._mask
or self._byte:resize(self._mask:size()):copy(self._mask)
self.output[byte] = self.minval
return self.output
end
function Clip:updateGradInput(input, gradOutput)
self.gradInput:set(gradOutput)
return self.gradInput
end
| {'content_hash': 'ff8e5883591c2985eff553b03070eac9', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 77, 'avg_line_length': 33.516129032258064, 'alnum_prop': 0.6948989412897016, 'repo_name': 'sagarwaghmare69/dpnn', 'id': 'fdd04de2e78a6f5b2e7d2b59858e105bd74c6e8b', 'size': '1241', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'Clip.lua', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CMake', 'bytes': '549'}, {'name': 'Lua', 'bytes': '308787'}]} |
package virtcontainers
import (
"fmt"
"os"
"path/filepath"
"syscall"
)
// Process gathers data related to a container process.
type Process struct {
Token string
Pid int
}
// ContainerStatus describes a container status.
type ContainerStatus struct {
ID string
State State
PID int
RootFs string
}
// ContainerConfig describes one container runtime configuration.
type ContainerConfig struct {
ID string
// RootFs is the container workload image on the host.
RootFs string
// Cmd specifies the command to run on a container
Cmd Cmd
}
// valid checks that the container configuration is valid.
func (containerConfig *ContainerConfig) valid() bool {
if containerConfig == nil {
return false
}
if containerConfig.ID == "" {
return false
}
return true
}
// Container is composed of a set of containers and a runtime environment.
// A Container can be created, deleted, started, stopped, listed, entered, paused and restored.
type Container struct {
id string
podID string
rootFs string
config *ContainerConfig
pod *Pod
runPath string
configPath string
containerPath string
state State
process Process
}
// ID returns the container identifier string.
func (c *Container) ID() string {
return c.id
}
// Process returns the container process.
func (c *Container) Process() Process {
return c.process
}
// GetToken returns the token related to this container's process.
func (c *Container) GetToken() string {
return c.process.Token
}
// GetPid returns the pid related to this container's process.
func (c *Container) GetPid() int {
return c.process.Pid
}
// SetPid sets and stores the given pid as the pid of container's process.
func (c *Container) SetPid(pid int) error {
c.process.Pid = pid
return c.storeProcess()
}
// URL returns the URL related to the pod.
func (c *Container) URL() string {
return c.pod.URL()
}
func (c *Container) startShim() error {
proxyInfo, url, err := c.pod.proxy.connect(*(c.pod), true)
if err != nil {
return err
}
if err := c.pod.proxy.disconnect(); err != nil {
return err
}
if c.pod.state.URL != url {
return fmt.Errorf("Pod URL %s and URL from proxy %s MUST be identical", c.pod.state.URL, url)
}
shimParams := ShimParams{
Token: proxyInfo.Token,
URL: url,
Console: c.config.Cmd.Console,
}
pid, err := c.pod.shim.start(*(c.pod), shimParams)
if err != nil {
return err
}
c.process = Process{
Token: proxyInfo.Token,
Pid: pid,
}
if err := c.storeProcess(); err != nil {
return err
}
return nil
}
func (c *Container) storeProcess() error {
return c.pod.storage.storeContainerProcess(c.podID, c.id, c.process)
}
func (c *Container) fetchProcess() (Process, error) {
return c.pod.storage.fetchContainerProcess(c.podID, c.id)
}
// fetchContainer fetches a container config from a pod ID and returns a Container.
func fetchContainer(pod *Pod, containerID string) (*Container, error) {
if pod == nil {
return nil, errNeedPod
}
if containerID == "" {
return nil, errNeedContainerID
}
fs := filesystem{}
config, err := fs.fetchContainerConfig(pod.id, containerID)
if err != nil {
return nil, err
}
virtLog.Infof("Info structure: %+v", config)
return createContainer(pod, config)
}
// storeContainer stores a container config.
func (c *Container) storeContainer() error {
fs := filesystem{}
err := fs.storeContainerResource(c.pod.id, c.id, configFileType, *(c.config))
if err != nil {
return err
}
return nil
}
func (c *Container) setContainerState(state stateString) error {
if state == "" {
return errNeedState
}
c.state = State{
State: state,
}
err := c.pod.storage.storeContainerResource(c.podID, c.id, stateFileType, c.state)
if err != nil {
return err
}
return nil
}
func (c *Container) createContainersDirs() error {
err := os.MkdirAll(c.runPath, dirMode)
if err != nil {
return err
}
err = os.MkdirAll(c.configPath, dirMode)
if err != nil {
c.pod.storage.deleteContainerResources(c.podID, c.id, nil)
return err
}
return nil
}
func createContainers(pod *Pod, contConfigs []ContainerConfig) ([]*Container, error) {
if pod == nil {
return nil, errNeedPod
}
var containers []*Container
for idx, contConfig := range contConfigs {
if contConfig.valid() == false {
return containers, fmt.Errorf("Invalid container configuration")
}
c := &Container{
id: contConfig.ID,
podID: pod.id,
rootFs: contConfig.RootFs,
config: &contConfigs[idx],
pod: pod,
runPath: filepath.Join(runStoragePath, pod.id, contConfig.ID),
configPath: filepath.Join(configStoragePath, pod.id, contConfig.ID),
containerPath: filepath.Join(pod.id, contConfig.ID),
state: State{},
process: Process{},
}
state, err := c.pod.storage.fetchContainerState(c.podID, c.id)
if err == nil {
c.state.State = state.State
}
process, err := c.pod.storage.fetchContainerProcess(c.podID, c.id)
if err == nil {
c.process = process
}
containers = append(containers, c)
}
return containers, nil
}
func createContainer(pod *Pod, contConfig ContainerConfig) (*Container, error) {
if pod == nil {
return nil, errNeedPod
}
if contConfig.valid() == false {
return nil, fmt.Errorf("Invalid container configuration")
}
c := &Container{
id: contConfig.ID,
podID: pod.id,
rootFs: contConfig.RootFs,
config: &contConfig,
pod: pod,
runPath: filepath.Join(runStoragePath, pod.id, contConfig.ID),
configPath: filepath.Join(configStoragePath, pod.id, contConfig.ID),
containerPath: filepath.Join(pod.id, contConfig.ID),
state: State{},
process: Process{},
}
err := c.createContainersDirs()
if err != nil {
return nil, err
}
process, err := c.fetchProcess()
if err == nil {
c.process = process
}
state, err := c.pod.storage.fetchContainerState(c.podID, c.id)
if err == nil && state.State != "" {
c.state.State = state.State
return c, nil
}
// If we reached that point, this means that no state file has been
// found and that we are in the first creation of this container.
// We don't want the following code to be executed outside of this
// specific case.
pod.containers = append(pod.containers, c)
if err := c.startShim(); err != nil {
return nil, err
}
if err := c.pod.setContainerState(c.id, StateReady); err != nil {
return nil, err
}
return c, nil
}
func (c *Container) delete() error {
state, err := c.pod.storage.fetchContainerState(c.podID, c.id)
if err != nil {
return err
}
if state.State != StateReady && state.State != StateStopped {
return fmt.Errorf("Container not ready or stopped, impossible to delete")
}
err = c.pod.storage.deleteContainerResources(c.podID, c.id, nil)
if err != nil {
return err
}
return nil
}
// fetchState retrieves the container state.
//
// cmd specifies the operation (or verb) that the retieval is destined
// for and is only used to make the returned error as descriptive as
// possible.
func (c *Container) fetchState(cmd string) (State, error) {
if cmd == "" {
return State{}, fmt.Errorf("Cmd cannot be empty")
}
state, err := c.pod.storage.fetchPodState(c.pod.id)
if err != nil {
return State{}, err
}
if state.State != StateRunning {
return State{}, fmt.Errorf("Pod not running, impossible to %s the container", cmd)
}
state, err = c.pod.storage.fetchContainerState(c.podID, c.id)
if err != nil {
return State{}, err
}
return state, nil
}
func (c *Container) start() error {
state, err := c.fetchState("start")
if err != nil {
return err
}
if state.State != StateReady && state.State != StateStopped {
return fmt.Errorf("Container not ready or stopped, impossible to start")
}
err = state.validTransition(StateReady, StateRunning)
if err != nil {
err = state.validTransition(StateStopped, StateRunning)
if err != nil {
return err
}
}
if _, _, err := c.pod.proxy.connect(*(c.pod), false); err != nil {
return err
}
defer c.pod.proxy.disconnect()
err = c.pod.agent.startContainer(*(c.pod), *c)
if err != nil {
c.stop()
return err
}
err = c.setContainerState(StateRunning)
if err != nil {
return err
}
return nil
}
func (c *Container) stop() error {
state, err := c.fetchState("stop")
if err != nil {
return err
}
if state.State != StateRunning {
return fmt.Errorf("Container not running, impossible to stop")
}
err = state.validTransition(StateRunning, StateStopped)
if err != nil {
return err
}
if _, _, err := c.pod.proxy.connect(*(c.pod), false); err != nil {
return err
}
defer c.pod.proxy.disconnect()
err = c.pod.agent.killContainer(*(c.pod), *c, syscall.SIGTERM)
if err != nil {
return err
}
err = c.pod.agent.stopContainer(*(c.pod), *c)
if err != nil {
return err
}
err = c.setContainerState(StateStopped)
if err != nil {
return err
}
return nil
}
func (c *Container) enter(cmd Cmd) (*Process, error) {
state, err := c.fetchState("enter")
if err != nil {
return nil, err
}
if state.State != StateRunning {
return nil, fmt.Errorf("Container not running, impossible to enter")
}
proxyInfo, url, err := c.pod.proxy.connect(*(c.pod), true)
if err != nil {
return nil, err
}
defer c.pod.proxy.disconnect()
if c.pod.state.URL != url {
return nil, fmt.Errorf("Pod URL %s and URL from proxy %s MUST be identical", c.pod.state.URL, url)
}
shimParams := ShimParams{
Token: proxyInfo.Token,
URL: url,
Console: cmd.Console,
}
pid, err := c.pod.shim.start(*(c.pod), shimParams)
if err != nil {
return nil, err
}
process := &Process{
Token: proxyInfo.Token,
Pid: pid,
}
if err := c.pod.agent.exec(c.pod, *c, *process, cmd); err != nil {
return nil, err
}
return process, nil
}
func (c *Container) kill(signal syscall.Signal) error {
state, err := c.fetchState("signal")
if err != nil {
return err
}
if state.State != StateRunning {
return fmt.Errorf("Container not running, impossible to signal the container")
}
if _, _, err := c.pod.proxy.connect(*(c.pod), false); err != nil {
return err
}
defer c.pod.proxy.disconnect()
err = c.pod.agent.killContainer(*(c.pod), *c, signal)
if err != nil {
return err
}
return nil
}
| {'content_hash': '52464c7095fb5a8980bcdbde02eb1f30', 'timestamp': '', 'source': 'github', 'line_count': 490, 'max_line_length': 100, 'avg_line_length': 21.055102040816326, 'alnum_prop': 0.6672482310749249, 'repo_name': 'dlespiau/proxy', 'id': '32664c4a783d12e13207647f94181b24be53164f', 'size': '10923', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'vendor/github.com/containers/virtcontainers/container.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '81332'}, {'name': 'Makefile', 'bytes': '2014'}, {'name': 'Shell', 'bytes': '3224'}]} |
package com.netflix.metacat.connector.snowflake;
import com.netflix.metacat.common.server.connectors.ConnectorFactory;
import com.netflix.metacat.common.server.connectors.ConnectorPlugin;
import com.netflix.metacat.common.server.connectors.ConnectorTypeConverter;
import com.netflix.metacat.common.server.connectors.ConnectorContext;
import lombok.NonNull;
import javax.annotation.Nonnull;
/**
* Snowflake Connector Plugin.
*
* @author amajumdar
* @since 1.2.0
*/
public class SnowflakeConnectorPlugin implements ConnectorPlugin {
private static final String CONNECTOR_TYPE = "snowflake";
private static final SnowflakeTypeConverter TYPE_CONVERTER = new SnowflakeTypeConverter();
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return CONNECTOR_TYPE;
}
/**
* {@inheritDoc}
*/
@Override
public ConnectorFactory create(@Nonnull @NonNull final ConnectorContext connectorContext) {
return new SnowflakeConnectorFactory(connectorContext.getCatalogName(),
connectorContext.getCatalogShardName(), connectorContext.getConfiguration());
}
/**
* {@inheritDoc}
*/
@Override
public ConnectorTypeConverter getTypeConverter() {
return TYPE_CONVERTER;
}
}
| {'content_hash': '10da1e2d91ee76229adda2216138b191', 'timestamp': '', 'source': 'github', 'line_count': 47, 'max_line_length': 95, 'avg_line_length': 27.382978723404257, 'alnum_prop': 0.7257187257187258, 'repo_name': 'ajoymajumdar/metacat', 'id': '687cc407c8364a632ab95549b430c1642df19f6d', 'size': '1916', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'metacat-connector-snowflake/src/main/java/com/netflix/metacat/connector/snowflake/SnowflakeConnectorPlugin.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Groovy', 'bytes': '880604'}, {'name': 'Java', 'bytes': '2437008'}, {'name': 'PLpgSQL', 'bytes': '25253'}, {'name': 'Shell', 'bytes': '2902'}, {'name': 'TSQL', 'bytes': '21342'}]} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.