text:
package com.thinkgem.jeesite.substation.model;

import java.io.Serializable;

/**
 *
 * {厂站实体类}
 * @author Zhu Jia
 * @mail 490618067@qq.com
 * @created 2015-12-1 上午1:43:30
 * @lastModify 2015-12-1 上午1:43:30
 * @version 1.0
 */
public class TosBaseSubstation implements Serializable{

	/**
	 * 序列化ID
	 */
	private static final long serialVersionUID = 10086L;

	private String id;

	/**
	 * UIP标识
	 */
	private String mrid;

	/**
	 * 英文名字
	 */
	private String ename;

	/**
	 * 中文名字
	 */
	private String cname;

	/**
	 * 电压等级
	 */
	private float voltage;

	/**
	 * 生效时间
	 */
	private String validate;

	/**
	 * 失效时间
	 */
	private String invalidate;

	/**
	 * 所属区域
	 */
	private String area;

	/**
	 * 数据来源
	 */
	private String source;

	/**
	 * 编码
	 */
	private String code;

	/**
	 * 名称
	 */
	private String fullName;

	/**
	 * 调度关系
	 * 1:国调 2:网调 3:省调
	 */
	private String dispatchRelation;

	/**
	 * 资产关系
	 */
	private String assetRelation;

	/**
	 * 所在地市供电公司
	 */
	private String powerSupplyCompany;

	/**
	 * 负责人
	 */
	private String leader;

	/**
	 * 电话
	 */
	private String phone;

	/**
	 * 传真
	 */
	private String fax;

	/**
	 * 手机号码
	 */
	private String mobile;

	/**
	 * 电子邮箱
	 */
	private String eMail;

	/**
	 * 地址
	 */
	private String address;

	/**
	 * 邮编
	 */
	private String zipCode;

	/**
	 * 类型
	 * 1:跨区 2:跨省 3:联络变 4:电厂
	 */
	private String kind;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getMrid() {
		return mrid;
	}

	public void setMrid(String mrid) {
		this.mrid = mrid;
	}

	public String getEname() {
		return ename;
	}

	public void setEname(String ename) {
		this.ename = ename;
	}

	public String getCname() {
		return cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public float getVoltage() {
		return voltage;
	}

	public void setVoltage(float voltage) {
		this.voltage = voltage;
	}

	public String getValidate() {
		return validate;
	}

	public void setValidate(String validate) {
		this.validate = validate;
	}

	public String getInvalidate() {
		return invalidate;
	}

	public void setInvalidate(String invalidate) {
		this.invalidate = invalidate;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getDispatchRelation() {
		return dispatchRelation;
	}

	public void setDispatchRelation(String dispatchRelation) {
		this.dispatchRelation = dispatchRelation;
	}

	public String getAssetRelation() {
		return assetRelation;
	}

	public void setAssetRelation(String assetRelation) {
		this.assetRelation = assetRelation;
	}

	public String getPowerSupplyCompany() {
		return powerSupplyCompany;
	}

	public void setPowerSupplyCompany(String powerSupplyCompany) {
		this.powerSupplyCompany = powerSupplyCompany;
	}

	public String getLeader() {
		return leader;
	}

	public void setLeader(String leader) {
		this.leader = leader;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String geteMail() {
		return eMail;
	}

	public void seteMail(String eMail) {
		this.eMail = eMail;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	public String getKind() {
		return kind;
	}

	public void setKind(String kind) {
		this.kind = kind;
	}

}


text:
Webb discovers active HTTP servers within a provided range and opens the addresses in Safari.
Named after the space telescope named after James E. Webb.

Powered by cedras GmbH, Winterthur, Switzerland.

## Installation

Add this line to your application's Gemfile:

    gem 'webb'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install webb

## Usage

    $ webb scan 172.16.0.0

    $ webb sweep 172.16.0.0 172.18.255.255

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

redpajama_set_name: RedPajamaGithub


text:
//
//  MainTableViewController.m
//  SearchControllerDemo
//
//  Created by dai.fengyi on 15/8/3.
//  Copyright (c) 2015年 childrenOurFuture. All rights reserved.
//

#import "MainTableViewController.h"
#import "APLResultsTableController.h"
#import "APLProduct.h"
@interface MainTableViewController ()<UISearchControllerDelegate, UISearchResultsUpdating>
@property (strong, nonatomic) NSArray *dataArray;
@property (strong, nonatomic) UISearchController *searchController;
// our secondary search results table view
@property (nonatomic, strong) APLResultsTableController *resultsTableController;
@property (weak, nonatomic) IBOutlet UISearchBar *searchBar;
@end

@implementation MainTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    self.dataArray = @[[APLProduct productWithType:[APLProduct deviceTypeTitle]
                                              name:@"iPhone"
                                              year:@2007
                                             price:@599.00],
                       [APLProduct productWithType:[APLProduct deviceTypeTitle]
                                              name:@"iPod"
                                              year:@2001
                                             price:@399.00],
                       [APLProduct productWithType:[APLProduct deviceTypeTitle]
                                              name:@"iPod touch"
                                              year:@2007
                                             price:@210.00],
                       [APLProduct productWithType:[APLProduct deviceTypeTitle]
                                              name:@"iPad"
                                              year:@2010
                                             price:@499.00],
                       [APLProduct productWithType:[APLProduct deviceTypeTitle]
                                              name:@"iPad mini"
                                              year:@2012
                                             price:@659.00],
                       [APLProduct productWithType:[APLProduct deviceTypeTitle]
                                              name:@"iMac"
                                              year:@1997
                                             price:@1299.00],
                       [APLProduct productWithType:[APLProduct deviceTypeTitle]
                                              name:@"Mac Pro"
                                              year:@2006
                                             price:@2499.00],
                       [APLProduct productWithType:[APLProduct portableTypeTitle]
                                              name:@"MacBook Air"
                                              year:@2008
                                             price:@1799.00],
                       [APLProduct productWithType:[APLProduct portableTypeTitle]
                                              name:@"MacBook Pro"
                                              year:@2006
                                             price:@1499.00]
                       ];

    _resultsTableController = [[APLResultsTableController alloc] init];
    //可以直接传nil,相当于直接在本类中的tableView上实现筛选后的情况
    _searchController = [[UISearchController alloc] initWithSearchResultsController:_resultsTableController];
    self.searchController.searchResultsUpdater = self;
    [self.searchController.searchBar sizeToFit];
    self.tableView.tableHeaderView = self.searchController.searchBar;

    // we want to be the delegate for our filtered table so didSelectRowAtIndexPath is called for both tables
    self.resultsTableController.tableView.delegate = self;
    self.searchController.delegate = self;
    self.searchController.dimsBackgroundDuringPresentation = NO; // default is YES
//    self.searchController.searchBar.delegate = self; // so we can monitor text changes + others

    // Search is now just presenting a view controller. As such, normal view controller
    // presentation semantics apply. Namely that presentation will walk up the view controller
    // hierarchy until it finds the root view controller or one that defines a presentation context.
    //
    self.definesPresentationContext = YES;  // know where you want UISearchController to be displayed

}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return self.dataArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"];
    }

    // Configure the cell...
    APLProduct *product = self.dataArray[indexPath.row];
    cell.textLabel.text = product.title;
    cell.detailTextLabel.text = [product.introPrice stringValue];
    return cell;
}

- (void)updateSearchResultsForSearchController:(UISearchController *)searchController {
    // update the filtered array based on the search text
    NSString *searchText = searchController.searchBar.text;
    NSMutableArray *searchResults = [self.dataArray mutableCopy];

    // strip out all the leading and trailing spaces
    NSString *strippedString = [searchText stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

    // break up the search terms (separated by spaces)
    NSArray *searchItems = nil;
    if (strippedString.length > 0) {
        searchItems = [strippedString componentsSeparatedByString:@" "];
    }

    // build all the "AND" expressions for each value in the searchString
    //
    NSMutableArray *andMatchPredicates = [NSMutableArray array];

    for (NSString *searchString in searchItems) {
        // each searchString creates an OR predicate for: name, yearIntroduced, introPrice
        //
        // example if searchItems contains "iphone 599 2007":
        //      name CONTAINS[c] "iphone"
        //      name CONTAINS[c] "599", yearIntroduced ==[c] 599, introPrice ==[c] 599
        //      name CONTAINS[c] "2007", yearIntroduced ==[c] 2007, introPrice ==[c] 2007
        //
        NSMutableArray *searchItemsPredicate = [NSMutableArray array];

        // Below we use NSExpression represent expressions in our predicates.
        // NSPredicate is made up of smaller, atomic parts: two NSExpressions (a left-hand value and a right-hand value)

        // name field matching
        NSExpression *lhs = [NSExpression expressionForKeyPath:@"title"];
        NSExpression *rhs = [NSExpression expressionForConstantValue:searchString];
        NSPredicate *finalPredicate = [NSComparisonPredicate
                                       predicateWithLeftExpression:lhs
                                       rightExpression:rhs
                                       modifier:NSDirectPredicateModifier
                                       type:NSContainsPredicateOperatorType
                                       options:NSCaseInsensitivePredicateOption];
        [searchItemsPredicate addObject:finalPredicate];

        // yearIntroduced field matching
        NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
        numberFormatter.numberStyle = NSNumberFormatterNoStyle;
        NSNumber *targetNumber = [numberFormatter numberFromString:searchString];
        if (targetNumber != nil) {   // searchString may not convert to a number
            lhs = [NSExpression expressionForKeyPath:@"yearIntroduced"];
            rhs = [NSExpression expressionForConstantValue:targetNumber];
            finalPredicate = [NSComparisonPredicate
                              predicateWithLeftExpression:lhs
                              rightExpression:rhs
                              modifier:NSDirectPredicateModifier
                              type:NSEqualToPredicateOperatorType
                              options:NSCaseInsensitivePredicateOption];
            [searchItemsPredicate addObject:finalPredicate];

            // price field matching
            lhs = [NSExpression expressionForKeyPath:@"introPrice"];
            rhs = [NSExpression expressionForConstantValue:targetNumber];
            finalPredicate = [NSComparisonPredicate
                              predicateWithLeftExpression:lhs
                              rightExpression:rhs
                              modifier:NSDirectPredicateModifier
                              type:NSEqualToPredicateOperatorType
                              options:NSCaseInsensitivePredicateOption];
            [searchItemsPredicate addObject:finalPredicate];
        }

        // at this OR predicate to our master AND predicate
        NSCompoundPredicate *orMatchPredicates = [NSCompoundPredicate orPredicateWithSubpredicates:searchItemsPredicate];
        [andMatchPredicates addObject:orMatchPredicates];
    }

    // match up the fields of the Product object
    NSCompoundPredicate *finalCompoundPredicate =
    [NSCompoundPredicate andPredicateWithSubpredicates:andMatchPredicates];
    searchResults = [[searchResults filteredArrayUsingPredicate:finalCompoundPredicate] mutableCopy];

    // hand over the filtered results to our search results table
    APLResultsTableController *tableController = (APLResultsTableController *)self.searchController.searchResultsController;
    tableController.filteredProducts = searchResults;
    [tableController.tableView reloadData];
//    self.dataArray = searchResults;
//    [self.tableView reloadData];
}

//- (void)presentSearchController:(UISearchController *)searchController {
//
//}
//- (void)willPresentSearchController:(UISearchController *)searchController {
//
//}
//- (void)didPresentSearchController:(UISearchController *)searchController {
//
//}
//- (void)willDismissSearchController:(UISearchController *)searchController {
//
//}
//- (void)didDismissSearchController:(UISearchController *)searchController {
//
//}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
qx.Mixin.define("dev.layout.LayoutSpacer", {

	members : {

		createSpacer : function ( theThis, elem, parent ) {
			var obj = new qx.ui.core.Spacer;
			this.processAttributes( theThis, elem, obj );
			return obj;
		}

	}
});


text:
namespace blink {

class OffscreenCanvas;

// WorkerAnimationFrameProvider is a member of WorkerGlobalScope and it provides
// RequestAnimationFrame capabilities to Workers.
//
// It's responsible for registering and dealing with callbacks.
// And maintains a connection with the Display process, through
// CompositorFrameSink, that is used to v-sync with the display.
//
// OffscreenCanvases can notify when there's been a change on any
// OffscreenCanvas that is connected to a Canvas, and this class signals
// OffscreenCanvases when it's time to dispatch frames.
class CORE_EXPORT WorkerAnimationFrameProvider
    : public GarbageCollected<WorkerAnimationFrameProvider>,
      public BeginFrameProviderClient {
 public:
  WorkerAnimationFrameProvider(
      ExecutionContext* context,
      const BeginFrameProviderParams& begin_frame_provider_params);
  WorkerAnimationFrameProvider(const WorkerAnimationFrameProvider&) = delete;
  WorkerAnimationFrameProvider& operator=(const WorkerAnimationFrameProvider&) =
      delete;

  int RegisterCallback(FrameCallback* callback);
  void CancelCallback(int id);

  void Trace(Visitor* visitor) const override;

  // BeginFrameProviderClient
  void BeginFrame(const viz::BeginFrameArgs&) override;
  scoped_refptr<base::SingleThreadTaskRunner> GetCompositorTaskRunner()
      override;

  void RegisterOffscreenCanvas(OffscreenCanvas*);
  void DeregisterOffscreenCanvas(OffscreenCanvas*);

  static const int kInvalidCallbackId = -1;

 private:
  const Member<BeginFrameProvider> begin_frame_provider_;
  FrameRequestCallbackCollection callback_collection_;

  HeapLinkedHashSet<WeakMember<OffscreenCanvas>> offscreen_canvases_;

  Member<ExecutionContext> context_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_FRAME_WORKER_ANIMATION_FRAME_PROVIDER_H_


text:
/*****************************************************************************/
/* CurrentExpenditures: Event Handlers */
/*****************************************************************************/
Template.CurrentExpenditures.events({
});

/*****************************************************************************/
/* CurrentExpenditures: Helpers */
/*****************************************************************************/
Template.CurrentExpenditures.helpers({
});

/*****************************************************************************/
/* CurrentExpenditures: Lifecycle Hooks */
/*****************************************************************************/
Template.CurrentExpenditures.created = function () {
};

Template.CurrentExpenditures.rendered = function () {

    var selecteddates = Session.get("selectedDates");

    if(selecteddates == undefined){
        var start = moment().startOf('year'); var end=  moment();
        selecteddates = {startdate : start._d, enddate : end._d};
    }

    Meteor.call("dashboard/get_current_expenditures_chart_data", selecteddates, function(err, data){

        var members = Members.find({}).fetch();
        var bardata = [];

        _.each(members, function(item){

            var member  = item.membe_name;
            var deductiblevalue = (item.deductible  / 100).toFixed(2);
            var contributionvalue = 0;

            //var deductibleitem = _.find(item.plan_details, function(deducvalue){
            //    return s.clean(deducvalue.plan_features) == s.clean("In Network Annual Deductible Includes Pharmacy");
            //});
            //
            //deductiblevalue = (deductibleitem.limit / 100).toFixed(2);

            var contributionitem = _.find(data, function(contrivalue){
                return contrivalue._id.member.member == item.member_name;
            });

            if(contributionitem != undefined){
                contributionvalue = contributionitem.totalClaimRate
            }else{
                if(item.member_name == "Family"){
                    _.each(data, function(item2){
                        contributionvalue = contributionvalue + item2.totalClaimRate;
                    })

                }
            }
            contributionvalue = (contributionvalue).toFixed(2)

            bardata.push( { member: item.member_name, a: contributionvalue, b: deductiblevalue })
        })

        $("#morris2").html('');

        Morris.Bar({
            element: 'morris2',
            data: bardata,
            xkey: 'member',
            ykeys: ['a', 'b'],
            labels: ['Contribution', 'Deductible'],
            barRatio: 0.4,
            xLabelAngle: 35,
            hideHover: 'auto',
            stacked: true,
            barColors: ['rgba(34, 152, 186, 0.69)','rgb(34, 130, 186)'],
            resize: true
        });

    })

};

Template.CurrentExpenditures.destroyed = function () {
};


text:
"""Implementation of acl command for cloud storage providers."""

from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals

from apitools.base.py import encoding
from gslib import metrics
from gslib.cloud_api import AccessDeniedException
from gslib.cloud_api import BadRequestException
from gslib.cloud_api import PreconditionException
from gslib.cloud_api import Preconditions
from gslib.cloud_api import ServiceException
from gslib.command import Command
from gslib.command import SetAclExceptionHandler
from gslib.command import SetAclFuncWrapper
from gslib.command_argument import CommandArgument
from gslib.cs_api_map import ApiSelector
from gslib.exception import CommandException
from gslib.help_provider import CreateHelpText
from gslib.storage_url import StorageUrlFromString
from gslib.storage_url import UrlsAreForSingleProvider
from gslib.third_party.storage_apitools import storage_v1_messages as apitools_messages
from gslib.utils import acl_helper
from gslib.utils.constants import NO_MAX
from gslib.utils.retry_util import Retry

_SET_SYNOPSIS = """
  gsutil acl set [-f] [-r] [-a] <file-or-canned_acl_name> url...
"""

_GET_SYNOPSIS = """
  gsutil acl get url
"""

_CH_SYNOPSIS = """
  gsutil acl ch [-f] [-r] <grant>... url...

  where each <grant> is one of the following forms:

    -u <id>|<email>:<permission>
    -g <id>|<email>|<domain>|All|AllAuth:<permission>
    -p (viewers|editors|owners)-<project number>:<permission>
    -d <id>|<email>|<domain>|All|AllAuth|(viewers|editors|owners)-<project number>
"""

_GET_DESCRIPTION = """
GET
  The "acl get" command gets the ACL text for a bucket or object, which you can
  save and edit for the acl set command.
"""

_SET_DESCRIPTION = """
SET
  The "acl set" command allows you to set an Access Control List on one or
  more buckets and objects. The file-or-canned_acl_name parameter names either
  a canned ACL or the path to a file that contains ACL text. The simplest way
  to use the "acl set" command is to specify one of the canned ACLs, e.g.,:

    gsutil acl set private gs://bucket

  If you want to make an object or bucket publicly readable or writable, it is
  recommended to use "acl ch", to avoid accidentally removing OWNER permissions.
  See the "acl ch" section for details.

  See `Predefined ACLs
  <https://cloud.google.com/storage/docs/access-control/lists#predefined-acl>`_
  for a list of canned ACLs.

  If you want to define more fine-grained control over your data, you can
  retrieve an ACL using the "acl get" command, save the output to a file, edit
  the file, and then use the "acl set" command to set that ACL on the buckets
  and/or objects. For example:

    gsutil acl get gs://bucket/file.txt > acl.txt

  Make changes to acl.txt such as adding an additional grant, then:

    gsutil acl set acl.txt gs://cats/file.txt

  Note that you can set an ACL on multiple buckets or objects at once. For
  example, to set ACLs on all .jpg files found in a bucket:

    gsutil acl set acl.txt gs://bucket/**.jpg

  If you have a large number of ACLs to update you might want to use the
  gsutil -m option, to perform a parallel (multi-threaded/multi-processing)
  update:

    gsutil -m acl set acl.txt gs://bucket/**.jpg

  Note that multi-threading/multi-processing is only done when the named URLs
  refer to objects, which happens either if you name specific objects or
  if you enumerate objects by using an object wildcard or specifying
  the acl -r flag.

SET OPTIONS
  The "set" sub-command has the following options

  -R, -r      Performs "acl set" request recursively, to all objects under
              the specified URL.

  -a          Performs "acl set" request on all object versions.

  -f          Normally gsutil stops at the first error. The -f option causes
              it to continue when it encounters errors. If some of the ACLs
              couldn't be set, gsutil's exit status will be non-zero even if
              this flag is set. This option is implicitly set when running
              "gsutil -m acl...".
"""

_CH_DESCRIPTION = """
CH
  The "acl ch" (or "acl change") command updates access control lists, similar
  in spirit to the Linux chmod command. You can specify multiple access grant
  additions and deletions in a single command run; all changes will be made
  atomically to each object in turn. For example, if the command requests
  deleting one grant and adding a different grant, the ACLs being updated will
  never be left in an intermediate state where one grant has been deleted but
  the second grant not yet added. Each change specifies a user or group grant
  to add or delete, and for grant additions, one of R, W, O (for the
  permission to be granted). A more formal description is provided in a later
  section; below we provide examples.

CH EXAMPLES
  Examples for "ch" sub-command:

  Grant anyone on the internet READ access to the object example-object:

    gsutil acl ch -u AllUsers:R gs://example-bucket/example-object

  NOTE: By default, publicly readable objects are served with a Cache-Control
  header allowing such objects to be cached for 3600 seconds. If you need to
  ensure that updates become visible immediately, you should set a
  Cache-Control header of "Cache-Control:private, max-age=0, no-transform" on
  such objects. For help doing this, see "gsutil help setmeta".

  Grant anyone on the internet WRITE access to the bucket example-bucket:

  WARNING: this is not recommended as you will be responsible for the content

    gsutil acl ch -u AllUsers:W gs://example-bucket

  Grant the user john.doe@example.com WRITE access to the bucket
  example-bucket:

    gsutil acl ch -u john.doe@example.com:WRITE gs://example-bucket

  Grant the group admins@example.com OWNER access to all jpg files in
  example-bucket:

    gsutil acl ch -g admins@example.com:O gs://example-bucket/**.jpg

  Grant the owners of project example-project WRITE access to the bucket
  example-bucket:

    gsutil acl ch -p owners-example-project:W gs://example-bucket

  NOTE: You can replace 'owners' with 'viewers' or 'editors' to grant access
  to a project's viewers/editors respectively.

  Remove access to the bucket example-bucket for the viewers of project number
  12345:

    gsutil acl ch -d viewers-12345 gs://example-bucket

  NOTE: You cannot remove the project owners group from ACLs of gs:// buckets in
  the given project. Attempts to do so will appear to succeed, but the service
  will add the project owners group into the new set of ACLs before applying it.

  Note that removing a project requires you to reference the project by
  its number (which you can see with the acl get command) as opposed to its
  project ID string.

  Grant the user with the specified canonical ID READ access to all objects
  in example-bucket that begin with folder/:

    gsutil acl ch -r \\
      -u 84fac329bceSAMPLE777d5d22b8SAMPLE785ac2SAMPLE2dfcf7c4adf34da46:R \\
      gs://example-bucket/folder/

  Grant the service account foo@developer.gserviceaccount.com WRITE access to
  the bucket example-bucket:

    gsutil acl ch -u foo@developer.gserviceaccount.com:W gs://example-bucket

  Grant all users from the `G Suite
  <https://www.google.com/work/apps/business/>`_ domain my-domain.org READ
  access to the bucket gcs.my-domain.org:

    gsutil acl ch -g my-domain.org:R gs://gcs.my-domain.org

  Remove any current access by john.doe@example.com from the bucket
  example-bucket:

    gsutil acl ch -d john.doe@example.com gs://example-bucket

  If you have a large number of objects to update, enabling multi-threading
  with the gsutil -m flag can significantly improve performance. The
  following command adds OWNER for admin@example.org using
  multi-threading:

    gsutil -m acl ch -r -u admin@example.org:O gs://example-bucket

  Grant READ access to everyone from my-domain.org and to all authenticated
  users, and grant OWNER to admin@mydomain.org, for the buckets
  my-bucket and my-other-bucket, with multi-threading enabled:

    gsutil -m acl ch -r -g my-domain.org:R -g AllAuth:R \\
      -u admin@mydomain.org:O gs://my-bucket/ gs://my-other-bucket

CH ROLES
  You may specify the following roles with either their shorthand or
  their full name:

    R: READ
    W: WRITE
    O: OWNER

  For more information on these roles and the access they grant, see the
  permissions section of the `Access Control Lists page
  <https://cloud.google.com/storage/docs/access-control/lists#permissions>`_.

CH ENTITIES
  There are four different entity types: Users, Groups, All Authenticated Users,
  and All Users.

  Users are added with -u and a plain ID or email address, as in
  "-u john-doe@gmail.com:r". Note: Service Accounts are considered to be users.

  Groups are like users, but specified with the -g flag, as in
  "-g power-users@example.com:O". Groups may also be specified as a full
  domain, as in "-g my-company.com:r".

  AllAuthenticatedUsers and AllUsers are specified directly, as
  in "-g AllUsers:R" or "-g AllAuthenticatedUsers:O". These are case
  insensitive, and may be shortened to "all" and "allauth", respectively.

  Removing roles is specified with the -d flag and an ID, email
  address, domain, or one of AllUsers or AllAuthenticatedUsers.

  Many entities' roles can be specified on the same command line, allowing
  bundled changes to be executed in a single run. This will reduce the number of
  requests made to the server.

CH OPTIONS
  The "ch" sub-command has the following options

  -d          Remove all roles associated with the matching entity.

  -f          Normally gsutil stops at the first error. The -f option causes
              it to continue when it encounters errors. With this option the
              gsutil exit status will be 0 even if some ACLs couldn't be
              changed.

  -g          Add or modify a group entity's role.

  -p          Add or modify a project viewers/editors/owners role.

  -R, -r      Performs acl ch request recursively, to all objects under the
              specified URL.

  -u          Add or modify a user entity's role.
"""

_SYNOPSIS = (_SET_SYNOPSIS + _GET_SYNOPSIS.lstrip('\n') +
             _CH_SYNOPSIS.lstrip('\n') + '\n\n')

_DESCRIPTION = ("""
  The acl command has three sub-commands:
""" + '\n'.join([_GET_DESCRIPTION, _SET_DESCRIPTION, _CH_DESCRIPTION]))

_DETAILED_HELP_TEXT = CreateHelpText(_SYNOPSIS, _DESCRIPTION)

_get_help_text = CreateHelpText(_GET_SYNOPSIS, _GET_DESCRIPTION)
_set_help_text = CreateHelpText(_SET_SYNOPSIS, _SET_DESCRIPTION)
_ch_help_text = CreateHelpText(_CH_SYNOPSIS, _CH_DESCRIPTION)

def _ApplyExceptionHandler(cls, exception):
  cls.logger.error('Encountered a problem: %s', exception)
  cls.everything_set_okay = False

def _ApplyAclChangesWrapper(cls, url_or_expansion_result, thread_state=None):
  cls.ApplyAclChanges(url_or_expansion_result, thread_state=thread_state)

class AclCommand(Command):
  """Implementation of gsutil acl command."""

  # Command specification. See base class for documentation.
  command_spec = Command.CreateCommandSpec(
      'acl',
      command_name_aliases=['getacl', 'setacl', 'chacl'],
      usage_synopsis=_SYNOPSIS,
      min_args=2,
      max_args=NO_MAX,
      supported_sub_args='afRrg:u:d:p:',
      file_url_ok=False,
      provider_url_ok=False,
      urls_start_arg=1,
      gs_api_support=[ApiSelector.XML, ApiSelector.JSON],
      gs_default_api=ApiSelector.JSON,
      argparse_arguments={
          'set': [
              CommandArgument.MakeFileURLOrCannedACLArgument(),
              CommandArgument.MakeZeroOrMoreCloudURLsArgument()
          ],
          'get': [CommandArgument.MakeNCloudURLsArgument(1)],
          'ch': [CommandArgument.MakeZeroOrMoreCloudURLsArgument()],
      })
  # Help specification. See help_provider.py for documentation.
  help_spec = Command.HelpSpec(
      help_name='acl',
      help_name_aliases=['getacl', 'setacl', 'chmod', 'chacl'],
      help_type='command_help',
      help_one_line_summary='Get, set, or change bucket and/or object ACLs',
      help_text=_DETAILED_HELP_TEXT,
      subcommand_help_text={
          'get': _get_help_text,
          'set': _set_help_text,
          'ch': _ch_help_text
      },
  )

  def _CalculateUrlsStartArg(self):
    if not self.args:
      self.RaiseWrongNumberOfArgumentsException()
    if (self.args[0].lower() == 'set') or (self.command_alias_used == 'setacl'):
      return 1
    else:
      return 0

  def _SetAcl(self):
    """Parses options and sets ACLs on the specified buckets/objects."""
    self.continue_on_error = False
    if self.sub_opts:
      for o, unused_a in self.sub_opts:
        if o == '-a':
          self.all_versions = True
        elif o == '-f':
          self.continue_on_error = True
        elif o == '-r' or o == '-R':
          self.recursion_requested = True
        else:
          self.RaiseInvalidArgumentException()
    try:
      self.SetAclCommandHelper(SetAclFuncWrapper, SetAclExceptionHandler)
    except AccessDeniedException as unused_e:
      self._WarnServiceAccounts()
      raise
    if not self.everything_set_okay:
      raise CommandException('ACLs for some objects could not be set.')

  def _ChAcl(self):
    """Parses options and changes ACLs on the specified buckets/objects."""
    self.parse_versions = True
    self.changes = []
    self.continue_on_error = False

    if self.sub_opts:
      for o, a in self.sub_opts:
        if o == '-f':
          self.continue_on_error = True
        elif o == '-g':
          if 'gserviceaccount.com' in a:
            raise CommandException(
                'Service accounts are considered users, not groups; please use '
                '"gsutil acl ch -u" instead of "gsutil acl ch -g"')
          self.changes.append(
              acl_helper.AclChange(a, scope_type=acl_helper.ChangeType.GROUP))
        elif o == '-p':
          self.changes.append(
              acl_helper.AclChange(a, scope_type=acl_helper.ChangeType.PROJECT))
        elif o == '-u':
          self.changes.append(
              acl_helper.AclChange(a, scope_type=acl_helper.ChangeType.USER))
        elif o == '-d':
          self.changes.append(acl_helper.AclDel(a))
        elif o == '-r' or o == '-R':
          self.recursion_requested = True
        else:
          self.RaiseInvalidArgumentException()

    if not self.changes:
      raise CommandException('Please specify at least one access change '
                             'with the -g, -u, or -d flags')

    if (not UrlsAreForSingleProvider(self.args) or
        StorageUrlFromString(self.args[0]).scheme != 'gs'):
      raise CommandException(
          'The "{0}" command can only be used with gs:// URLs'.format(
              self.command_name))

    self.everything_set_okay = True
    self.ApplyAclFunc(_ApplyAclChangesWrapper,
                      _ApplyExceptionHandler,
                      self.args,
                      object_fields=['acl', 'generation', 'metageneration'])
    if not self.everything_set_okay:
      raise CommandException('ACLs for some objects could not be set.')

  def _RaiseForAccessDenied(self, url):
    self._WarnServiceAccounts()
    raise CommandException('Failed to set acl for %s. Please ensure you have '
                           'OWNER-role access to this resource.' % url)

  @Retry(ServiceException, tries=3, timeout_secs=1)
  def ApplyAclChanges(self, name_expansion_result, thread_state=None):
    """Applies the changes in self.changes to the provided URL.

    Args:
      name_expansion_result: NameExpansionResult describing the target object.
      thread_state: If present, gsutil Cloud API instance to apply the changes.
    """
    if thread_state:
      gsutil_api = thread_state
    else:
      gsutil_api = self.gsutil_api

    url = name_expansion_result.expanded_storage_url
    if url.IsBucket():
      bucket = gsutil_api.GetBucket(url.bucket_name,
                                    provider=url.scheme,
                                    fields=['acl', 'metageneration'])
      current_acl = bucket.acl
    elif url.IsObject():
      gcs_object = encoding.JsonToMessage(apitools_messages.Object,
                                          name_expansion_result.expanded_result)
      current_acl = gcs_object.acl

    if not current_acl:
      self._RaiseForAccessDenied(url)
    if self._ApplyAclChangesAndReturnChangeCount(url, current_acl) == 0:
      self.logger.info('No changes to %s', url)
      return

    try:
      if url.IsBucket():
        preconditions = Preconditions(meta_gen_match=bucket.metageneration)
        bucket_metadata = apitools_messages.Bucket(acl=current_acl)
        gsutil_api.PatchBucket(url.bucket_name,
                               bucket_metadata,
                               preconditions=preconditions,
                               provider=url.scheme,
                               fields=['id'])
      else:  # Object
        preconditions = Preconditions(gen_match=gcs_object.generation,
                                      meta_gen_match=gcs_object.metageneration)
        object_metadata = apitools_messages.Object(acl=current_acl)
        try:
          gsutil_api.PatchObjectMetadata(url.bucket_name,
                                         url.object_name,
                                         object_metadata,
                                         preconditions=preconditions,
                                         provider=url.scheme,
                                         generation=url.generation,
                                         fields=['id'])
        except PreconditionException as e:
          # Special retry case where we want to do an additional step, the read
          # of the read-modify-write cycle, to fetch the correct object
          # metadata before reattempting ACL changes.
          self._RefetchObjectMetadataAndApplyAclChanges(url, gsutil_api)

      self.logger.info('Updated ACL on %s', url)
    except BadRequestException as e:
      # Don't retry on bad requests, e.g. invalid email address.
      raise CommandException('Received bad request from server: %s' % str(e))
    except AccessDeniedException:
      self._RaiseForAccessDenied(url)
    except PreconditionException as e:
      # For objects, retry attempts should have already been handled.
      if url.IsObject():
        raise CommandException(str(e))
      # For buckets, raise PreconditionException and continue to next retry.
      raise e

  @Retry(PreconditionException, tries=3, timeout_secs=1)
  def _RefetchObjectMetadataAndApplyAclChanges(self, url, gsutil_api):
    """Reattempts object ACL changes after a PreconditionException."""
    gcs_object = gsutil_api.GetObjectMetadata(
        url.bucket_name,
        url.object_name,
        provider=url.scheme,
        fields=['acl', 'generation', 'metageneration'])
    current_acl = gcs_object.acl

    if self._ApplyAclChangesAndReturnChangeCount(url, current_acl) == 0:
      self.logger.info('No changes to %s', url)
      return

    object_metadata = apitools_messages.Object(acl=current_acl)
    preconditions = Preconditions(gen_match=gcs_object.generation,
                                  meta_gen_match=gcs_object.metageneration)
    gsutil_api.PatchObjectMetadata(url.bucket_name,
                                   url.object_name,
                                   object_metadata,
                                   preconditions=preconditions,
                                   provider=url.scheme,
                                   generation=gcs_object.generation,
                                   fields=['id'])

  def _ApplyAclChangesAndReturnChangeCount(self, storage_url, acl_message):
    modification_count = 0
    for change in self.changes:
      modification_count += change.Execute(storage_url, acl_message, 'acl',
                                           self.logger)
    return modification_count

  def RunCommand(self):
    """Command entry point for the acl command."""
    action_subcommand = self.args.pop(0)
    self.ParseSubOpts(check_args=True)

    # Commands with both suboptions and subcommands need to reparse for
    # suboptions, so we log again.
    metrics.LogCommandParams(sub_opts=self.sub_opts)
    self.def_acl = False
    if action_subcommand == 'get':
      metrics.LogCommandParams(subcommands=[action_subcommand])
      self.GetAndPrintAcl(self.args[0])
    elif action_subcommand == 'set':
      metrics.LogCommandParams(subcommands=[action_subcommand])
      self._SetAcl()
    elif action_subcommand in ('ch', 'change'):
      metrics.LogCommandParams(subcommands=[action_subcommand])
      self._ChAcl()
    else:
      raise CommandException(
          ('Invalid subcommand "%s" for the %s command.\n'
           'See "gsutil help acl".') % (action_subcommand, self.command_name))

    return 0


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>cigoto</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="Manuel de référence canonique de Csound" />
    <link rel="up" href="OpcodesTop.html" title="Opcodes et opérateurs de l'orchestre" />
    <link rel="prev" href="chuap.html" title="chuap" />
    <link rel="next" href="ckgoto.html" title="ckgoto" />

          cigoto

          Précédent
          Opcodes et opérateurs de l'orchestre
           Suivant

          cigoto

cigoto —
      Transfert conditionnel du contrôle pendant la phase d'initialisation.

Description

      Tranfert conditionnel du contrôle vers l'instruction étiquetée par
      label, lors de la phase d'initialisation seulement.

Syntaxe

cigoto condition, label

      où label se trouve dans le même bloc d'instrument et n'est
      pas une expression, et où condition utilise un des opérateurs
      relationnels (<, =,
      <=, ==, !=)
      (et = par commodité, voir aussi
      Valeurs Conditionnelles).

Exemples

      Voici un exemple de l'opcode cigoto. Il utilise le fichier
      cigoto.csd.

            Exemple 124. Exemple de l'opcode cigoto.

Voir les sections Audio en Temps Réel
        et Options de la Ligne de Commande pour plus
        d'information sur l'utilisation des options de la ligne de commande.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc     ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o cigoto.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  ; Get the value of the 4th p-field from the score.
  iparam = p4

  ; If iparam is 1 then play the high note.
  ; If not then play the low note.
  cigoto (iparam ==1), highnote
    igoto lownote

highnote:
  ifreq = 880
  goto playit

lownote:
  ifreq = 440
  goto playit

playit:
  ; Print the values of iparam and ifreq.
  print iparam
  print ifreq

  a1 oscil 10000, ifreq, 1
  out a1
endin

</CsInstruments>
<CsScore>

; Table #1: a simple sine wave.
f 1 0 32768 10 1

; p4: 1 = high note, anything else = low note
; Play Instrument #1 for one second, a low note.
i 1 0 1 0
; Play a Instrument #1 for one second, a high note.
i 1 1 1 1
e

</CsScore>
</CsoundSynthesizer>

      Sa sortie contiendra des lignes comme celles-ci :

instr 1:  iparam = 0.000
instr 1:  ifreq = 440.000
instr 1:  iparam = 1.000
instr 1:  ifreq = 880.000

Voir aussi

      cggoto,
      ckgoto,
      cngoto,
      goto,
      if,
      kgoto,
      rigoto,
      tigoto,
      timout

Crédits

Exemple écrit par Kevin Conder.

          Précédent

            Niveau supérieur

           Suivant

          chuap

            Sommaire

           ckgoto


text:
using namespace ci;
using namespace std;

namespace cidart {

// FIXME: apparently this can't be called unless we're inside a Dart_Invoke, maybe need to move it to Script and keep track of that
// - but this isn't feasible for things like cidart::getValue(), since it doesn't know of the current script
// - possible hack solution: get the stacktrace and search for the invoke() command, if we don't find that then throw regularly
// - PROBABLE SOLUTION: build dart runtime with exceptions enabled and throw regular C++ exception
void throwException( const std::string &description )
{
	cidart::DartScope enterScope;

	Dart_Handle exceptionHandle = toDart( description );
	CIDART_CHECK( Dart_ThrowException( exceptionHandle ) );
}

void throwIfError( Dart_Handle handle, const std::string &description )
{
	if( Dart_IsError( handle ) ) {
		throwException( description + ", description: " + Dart_GetError( handle ) );
	}
}

} // namespace cidart


text:
import glob
import os
from setuptools import setup

import datascope_tools

# get all of the scripts
scripts = glob.glob("bin/*")

# read in the description from README
with open("README.md") as stream:
    long_description = stream.read()

github_url='https://github.com/datascopeanalytics/datascope-tools'

# read in the dependencies from the virtualenv requirements file
dependencies = []
filename = "requirements.txt"
with open(filename, 'r') as stream:
    for line in stream:
        package = line.strip().split('#')[0]
        if package:
            dependencies.append(package)

setup(
    name=datascope_tools.__name__,
    version=datascope_tools.VERSION,
    description="import random.scripts, random.tools, random.ideas",
    long_description=long_description,
    url=github_url,
    download_url="%s/archives/master" % github_url,
    author='Datascope Analytics',
    author_email='github.admin@datascopeanalytics.com',
    license='MIT',
    scripts=scripts,
    packages=[datascope_tools.__name__],
    install_requires=dependencies,
    zip_safe=False,
)


text:
namespace content {

void NavigationResourceHandler::GetSSLStatusForRequest(
    const GURL& url,
    const net::SSLInfo& ssl_info,
    int child_id,
    SSLStatus* ssl_status) {
  DCHECK(ssl_info.cert);
  *ssl_status = SSLStatus(ssl_info);
}

NavigationResourceHandler::NavigationResourceHandler(
    net::URLRequest* request,
    NavigationURLLoaderImplCore* core,
    ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate)
    : ResourceHandler(request),
      core_(core),
      resource_dispatcher_host_delegate_(resource_dispatcher_host_delegate) {
  core_->set_resource_handler(this);
  writer_.set_immediate_mode(true);
}

NavigationResourceHandler::~NavigationResourceHandler() {
  if (core_) {
    core_->NotifyRequestFailed(false, net::ERR_ABORTED);
    DetachFromCore();
  }
}

void NavigationResourceHandler::Cancel() {
  controller()->Cancel();
  core_ = nullptr;
}

void NavigationResourceHandler::FollowRedirect() {
  controller()->Resume();
}

void NavigationResourceHandler::ProceedWithResponse() {
  // Detach from the loader; at this point, the request is now owned by the
  // StreamHandle sent in OnResponseStarted.
  DetachFromCore();
  controller()->Resume();
}

void NavigationResourceHandler::SetController(ResourceController* controller) {
  writer_.set_controller(controller);
  ResourceHandler::SetController(controller);
}

bool NavigationResourceHandler::OnRequestRedirected(
    const net::RedirectInfo& redirect_info,
    ResourceResponse* response,
    bool* defer) {
  DCHECK(core_);

  // TODO(davidben): Perform a CSP check here, and anything else that would have
  // been done renderer-side.
  NetLogObserver::PopulateResponseInfo(request(), response);
  response->head.encoded_data_length = request()->GetTotalReceivedBytes();
  core_->NotifyRequestRedirected(redirect_info, response);
  *defer = true;
  return true;
}

bool NavigationResourceHandler::OnResponseStarted(ResourceResponse* response,
                                                  bool* defer) {
  DCHECK(core_);

  ResourceRequestInfoImpl* info = GetRequestInfo();

  StreamContext* stream_context =
      GetStreamContextForResourceContext(info->GetContext());
  writer_.InitializeStream(stream_context->registry(),
                           request()->url().GetOrigin());

  NetLogObserver::PopulateResponseInfo(request(), response);
  response->head.encoded_data_length = request()->raw_header_size();

  std::unique_ptr<NavigationData> cloned_data;
  if (resource_dispatcher_host_delegate_) {
    // Ask the embedder for a NavigationData instance.
    NavigationData* navigation_data =
        resource_dispatcher_host_delegate_->GetNavigationData(request());

    // Clone the embedder's NavigationData before moving it to the UI thread.
    if (navigation_data)
      cloned_data = navigation_data->Clone();
  }

  SSLStatus ssl_status;
  if (request()->ssl_info().cert.get()) {
    GetSSLStatusForRequest(request()->url(), request()->ssl_info(),
                           info->GetChildID(), &ssl_status);
  }

  core_->NotifyResponseStarted(response, writer_.stream()->CreateHandle(),
                               ssl_status, std::move(cloned_data),
                               info->GetGlobalRequestID(), info->IsDownload(),
                               info->is_stream());
  // Don't defer stream based requests. This includes requests initiated via
  // mime type sniffing, etc.
  // TODO(ananta)
  // Make sure that the requests go through the throttle checks. Currently this
  // does not work as the InterceptingResourceHandler is above us and hence it
  // does not expect the old handler to defer the request.
  // TODO(clamy): We should also make the downloads wait on the
  // NavigationThrottle checks be performed. Similarly to streams, it doesn't
  // work because of the InterceptingResourceHandler.
  // TODO(clamy): This NavigationResourceHandler should be split in two, with
  // one part that wait on the NavigationThrottle to execute located between the
  // MIME sniffing and the ResourceThrotlle, and one part that write the
  // response to the stream being the leaf ResourceHandler.
  if (!info->is_stream() && !info->IsDownload())
    *defer = true;

  return true;
}

bool NavigationResourceHandler::OnWillStart(const GURL& url, bool* defer) {
  return true;
}

bool NavigationResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf,
                                           int* buf_size,
                                           int min_size) {
  writer_.OnWillRead(buf, buf_size, min_size);
  return true;
}

bool NavigationResourceHandler::OnReadCompleted(int bytes_read, bool* defer) {
  writer_.OnReadCompleted(bytes_read, defer);
  return true;
}

void NavigationResourceHandler::OnResponseCompleted(
    const net::URLRequestStatus& status,
    bool* defer) {
  // If the request has already committed, close the stream and leave it as-is.
  if (writer_.stream()) {
    writer_.Finalize(status.error());
    return;
  }

  if (core_) {
    DCHECK_NE(net::OK, status.error());
    core_->NotifyRequestFailed(request()->response_info().was_cached,
                               status.error());
    DetachFromCore();
  }
}

void NavigationResourceHandler::OnDataDownloaded(int bytes_downloaded) {
  NOTREACHED();
}

void NavigationResourceHandler::DetachFromCore() {
  DCHECK(core_);
  core_->set_resource_handler(nullptr);
  core_ = nullptr;
}

}  // namespace content


text:
module.exports = {
    extends: ['@proton/eslint-config-proton'],
    parser: '@typescript-eslint/parser',
    env: {
        jasmine: true,
    },
    parserOptions: {
        tsconfigRootDir: __dirname,
        project: './tsconfig.json',
    },
    rules: {
        'import/no-unresolved': [
            'error',
            {
                ignore: ['design-system'],
            },
        ],
    },
    ignorePatterns: ['.eslintrc.js'],
};


text:
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/icons_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_weight="1"
        android:textSize="45sp"
        android:textColor="#9b59b6"
        android:text="@string/fa_icon_areachart" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_weight="1"
        android:textSize="45sp"
        android:textColor="#3498db"
        android:text="@string/fa_icon_piechart" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_weight="1"
        android:textSize="45sp"
        android:textColor="#1abc9c"
        android:text="@string/fa_icon_linechart" />

</LinearLayout>


text:
using std::fabs;
using std::max;
using std::min;

static const unsigned char kCurrentLosslessEncodingVersionNumber = 1;

S2LatLngRect S2LatLngRect::FromCenterSize(const S2LatLng& center,
                                          const S2LatLng& size) {
  return FromPoint(center).Expanded(0.5 * size);
}

S2LatLngRect S2LatLngRect::FromPoint(const S2LatLng& p) {
  S2_DLOG_IF(ERROR, !p.is_valid())
      << "Invalid S2LatLng in S2LatLngRect::GetDistance: " << p;

  return S2LatLngRect(p, p);
}

S2LatLngRect S2LatLngRect::FromPointPair(const S2LatLng& p1,
                                         const S2LatLng& p2) {
  S2_DLOG_IF(ERROR, !p1.is_valid())
      << "Invalid S2LatLng in S2LatLngRect::FromPointPair: " << p1;

  S2_DLOG_IF(ERROR, !p2.is_valid())
      << "Invalid S2LatLng in S2LatLngRect::FromPointPair: " << p2;

  return S2LatLngRect(R1Interval::FromPointPair(p1.lat().radians(),
                                                p2.lat().radians()),
                      S1Interval::FromPointPair(p1.lng().radians(),
                                                p2.lng().radians()));
}

S2LatLngRect* S2LatLngRect::Clone() const {
  return new S2LatLngRect(*this);
}

S2LatLng S2LatLngRect::GetVertex(int k) const {
  // Twiddle bits to return the points in CCW order (lower left, lower right,
  // upper right, upper left).
  int i = (k >> 1) & 1;
  return S2LatLng::FromRadians(lat_[i], lng_[i ^ (k & 1)]);
}

S2LatLng S2LatLngRect::GetCenter() const {
  return S2LatLng::FromRadians(lat_.GetCenter(), lng_.GetCenter());
}

S2LatLng S2LatLngRect::GetSize() const {
  return S2LatLng::FromRadians(lat_.GetLength(), lng_.GetLength());
}

double S2LatLngRect::Area() const {
  if (is_empty()) return 0.0;
  // This is the size difference of the two spherical caps, multiplied by
  // the longitude ratio.
  return lng().GetLength() * (sin(lat_hi()) - sin(lat_lo()));
}

S2Point S2LatLngRect::GetCentroid() const {
  // When a sphere is divided into slices of constant thickness by a set of
  // parallel planes, all slices have the same surface area.  This implies
  // that the z-component of the centroid is simply the midpoint of the
  // z-interval spanned by the S2LatLngRect.
  //
  // Similarly, it is easy to see that the (x,y) of the centroid lies in the
  // plane through the midpoint of the rectangle's longitude interval.  We
  // only need to determine the distance "d" of this point from the z-axis.
  //
  // Let's restrict our attention to a particular z-value.  In this z-plane,
  // the S2LatLngRect is a circular arc.  The centroid of this arc lies on a
  // radial line through the midpoint of the arc, and at a distance from the
  // z-axis of
  //
  //     r * (sin(alpha) / alpha)
  //
  // where r = sqrt(1-z^2) is the radius of the arc, and "alpha" is half of
  // the arc length (i.e., the arc covers longitudes [-alpha, alpha]).
  //
  // To find the centroid distance from the z-axis for the entire rectangle,
  // we just need to integrate over the z-interval.  This gives
  //
  //    d = Integrate[sqrt(1-z^2)*sin(alpha)/alpha, z1..z2] / (z2 - z1)
  //
  // where [z1, z2] is the range of z-values covered by the rectangle.  This
  // simplifies to
  //
  //    d = sin(alpha)/(2*alpha*(z2-z1))*(z2*r2 - z1*r1 + theta2 - theta1)
  //
  // where [theta1, theta2] is the latitude interval, z1=sin(theta1),
  // z2=sin(theta2), r1=cos(theta1), and r2=cos(theta2).
  //
  // Finally, we want to return not the centroid itself, but the centroid
  // scaled by the area of the rectangle.  The area of the rectangle is
  //
  //    A = 2 * alpha * (z2 - z1)
  //
  // which fortunately appears in the denominator of "d".

  if (is_empty()) return S2Point();
  double z1 = sin(lat_lo()), z2 = sin(lat_hi());
  double r1 = cos(lat_lo()), r2 = cos(lat_hi());
  double alpha = 0.5 * lng_.GetLength();
  double r = sin(alpha) * (r2 * z2 - r1 * z1 + lat_.GetLength());
  double lng = lng_.GetCenter();
  double z = alpha * (z2 + z1) * (z2 - z1);  // scaled by the area
  return S2Point(r * cos(lng), r * sin(lng), z);
}

bool S2LatLngRect::Contains(const S2LatLng& ll) const {
  S2_DLOG_IF(ERROR, !ll.is_valid())
      << "Invalid S2LatLng in S2LatLngRect::Contains: " << ll;

  return (lat_.Contains(ll.lat().radians()) &&
          lng_.Contains(ll.lng().radians()));
}

bool S2LatLngRect::InteriorContains(const S2Point& p) const {
  return InteriorContains(S2LatLng(p));
}

bool S2LatLngRect::InteriorContains(const S2LatLng& ll) const {
  S2_DLOG_IF(ERROR, !ll.is_valid())
      << "Invalid S2LatLng in S2LatLngRect::InteriorContains: " << ll;

  return (lat_.InteriorContains(ll.lat().radians()) &&
          lng_.InteriorContains(ll.lng().radians()));
}

bool S2LatLngRect::Contains(const S2LatLngRect& other) const {
  return lat_.Contains(other.lat_) && lng_.Contains(other.lng_);
}

bool S2LatLngRect::InteriorContains(const S2LatLngRect& other) const {
  return (lat_.InteriorContains(other.lat_) &&
          lng_.InteriorContains(other.lng_));
}

bool S2LatLngRect::Intersects(const S2LatLngRect& other) const {
  return lat_.Intersects(other.lat_) && lng_.Intersects(other.lng_);
}

bool S2LatLngRect::InteriorIntersects(const S2LatLngRect& other) const {
  return (lat_.InteriorIntersects(other.lat_) &&
          lng_.InteriorIntersects(other.lng_));
}

bool S2LatLngRect::BoundaryIntersects(const S2Point& v0,
                                      const S2Point& v1) const {
  if (is_empty()) return false;
  if (!lng_.is_full()) {
    if (IntersectsLngEdge(v0, v1, lat_, lng_.lo())) return true;
    if (IntersectsLngEdge(v0, v1, lat_, lng_.hi())) return true;
  }
  if (lat_.lo() != -M_PI_2 && IntersectsLatEdge(v0, v1, lat_.lo(), lng_)) {
    return true;
  }
  if (lat_.hi() != M_PI_2 && IntersectsLatEdge(v0, v1, lat_.hi(), lng_)) {
    return true;
  }
  return false;
}

void S2LatLngRect::AddPoint(const S2Point& p) {
  AddPoint(S2LatLng(p));
}

void S2LatLngRect::AddPoint(const S2LatLng& ll) {
  S2_DLOG_IF(ERROR, !ll.is_valid())
      << "Invalid S2LatLng in S2LatLngRect::AddPoint: " << ll;

  lat_.AddPoint(ll.lat().radians());
  lng_.AddPoint(ll.lng().radians());
}

S2LatLngRect S2LatLngRect::Expanded(const S2LatLng& margin) const {
  R1Interval lat = lat_.Expanded(margin.lat().radians());
  S1Interval lng = lng_.Expanded(margin.lng().radians());
  if (lat.is_empty() || lng.is_empty()) return Empty();
  return S2LatLngRect(lat.Intersection(FullLat()), lng);
}

S2LatLngRect S2LatLngRect::PolarClosure() const {
  if (lat_.lo() == -M_PI_2 || lat_.hi() == M_PI_2) {
    return S2LatLngRect(lat_, S1Interval::Full());
  }
  return *this;
}

S2LatLngRect S2LatLngRect::Union(const S2LatLngRect& other) const {
  return S2LatLngRect(lat_.Union(other.lat_),
                      lng_.Union(other.lng_));
}

S2LatLngRect S2LatLngRect::Intersection(const S2LatLngRect& other) const {
  R1Interval lat = lat_.Intersection(other.lat_);
  S1Interval lng = lng_.Intersection(other.lng_);
  if (lat.is_empty() || lng.is_empty()) {
    // The lat/lng ranges must either be both empty or both non-empty.
    return Empty();
  }
  return S2LatLngRect(lat, lng);
}

S2LatLngRect S2LatLngRect::ExpandedByDistance(S1Angle distance) const {
  if (distance >= S1Angle::Zero()) {
    // The most straightforward approach is to build a cap centered on each
    // vertex and take the union of all the bounding rectangles (including the
    // original rectangle; this is necessary for very large rectangles).

    // TODO(ericv): Update this code to use an algorithm like the one below.
    S1ChordAngle radius(distance);
    S2LatLngRect r = *this;
    for (int k = 0; k < 4; ++k) {
      r = r.Union(S2Cap(GetVertex(k).ToPoint(), radius).GetRectBound());
    }
    return r;
  } else {
    // Shrink the latitude interval unless the latitude interval contains a pole
    // and the longitude interval is full, in which case the rectangle has no
    // boundary at that pole.
    R1Interval lat_result(
        lat().lo() <= FullLat().lo() && lng().is_full() ?
            FullLat().lo() : lat().lo() - distance.radians(),
        lat().hi() >= FullLat().hi() && lng().is_full() ?
            FullLat().hi() : lat().hi() + distance.radians());
    if (lat_result.is_empty()) {
      return S2LatLngRect::Empty();
    }

    // Maximum absolute value of a latitude in lat_result. At this latitude,
    // the cap occupies the largest longitude interval.
    double max_abs_lat = max(-lat_result.lo(), lat_result.hi());

    // Compute the largest longitude interval that the cap occupies. We use the
    // law of sines for spherical triangles. For the details, see the comment in
    // S2Cap::GetRectBound().
    //
    // When sin_a >= sin_c, the cap covers all the latitude.
    double sin_a = sin(-distance.radians());
    double sin_c = cos(max_abs_lat);
    double max_lng_margin = sin_a < sin_c ? asin(sin_a / sin_c) : M_PI_2;

    S1Interval lng_result = lng().Expanded(-max_lng_margin);
    if (lng_result.is_empty()) {
      return S2LatLngRect::Empty();
    }
    return S2LatLngRect(lat_result, lng_result);
  }
}

S2Cap S2LatLngRect::GetCapBound() const {
  // We consider two possible bounding caps, one whose axis passes
  // through the center of the lat-long rectangle and one whose axis
  // is the north or south pole.  We return the smaller of the two caps.

  if (is_empty()) return S2Cap::Empty();

  double pole_z, pole_angle;
  if (lat_.lo() + lat_.hi() < 0) {
    // South pole axis yields smaller cap.
    pole_z = -1;
    pole_angle = M_PI_2 + lat_.hi();
  } else {
    pole_z = 1;
    pole_angle = M_PI_2 - lat_.lo();
  }
  // Ensure that the bounding cap is conservative taking into account errors
  // in the arithmetic above and the S1Angle/S1ChordAngle conversion.
  S2Cap pole_cap(S2Point(0, 0, pole_z),
                 S1Angle::Radians((1 + 2 * DBL_EPSILON) * pole_angle));

  // For bounding rectangles that span 180 degrees or less in longitude, the
  // maximum cap size is achieved at one of the rectangle vertices.  For
  // rectangles that are larger than 180 degrees, we punt and always return a
  // bounding cap centered at one of the two poles.
  if (lng_.GetLength() < 2 * M_PI) {
    S2Cap mid_cap(GetCenter().ToPoint(), S1Angle::Zero());
    for (int k = 0; k < 4; ++k) {
      mid_cap.AddPoint(GetVertex(k).ToPoint());
    }
    if (mid_cap.height() < pole_cap.height())
      return mid_cap;
  }
  return pole_cap;
}

S2LatLngRect S2LatLngRect::GetRectBound() const {
  return *this;
}

bool S2LatLngRect::Contains(const S2Cell& cell) const {
  // A latitude-longitude rectangle contains a cell if and only if it contains
  // the cell's bounding rectangle.  This test is exact from a mathematical
  // point of view, assuming that the bounds returned by S2Cell::GetRectBound()
  // are tight.  However, note that there can be a loss of precision when
  // converting between representations -- for example, if an S2Cell is
  // converted to a polygon, the polygon's bounding rectangle may not contain
  // the cell's bounding rectangle.  This has some slightly unexpected side
  // effects; for instance, if one creates an S2Polygon from an S2Cell, the
  // polygon will contain the cell, but the polygon's bounding box will not.
  return Contains(cell.GetRectBound());
}

bool S2LatLngRect::MayIntersect(const S2Cell& cell) const {
  // This test is cheap but is NOT exact (see s2latlng_rect.h).
  return Intersects(cell.GetRectBound());
}

void S2LatLngRect::Encode(Encoder* encoder) const {
  encoder->Ensure(40);  // sufficient

  encoder->put8(kCurrentLosslessEncodingVersionNumber);
  encoder->putdouble(lat_.lo());
  encoder->putdouble(lat_.hi());
  encoder->putdouble(lng_.lo());
  encoder->putdouble(lng_.hi());

  S2_DCHECK_GE(encoder->avail(), 0);
}

bool S2LatLngRect::Decode(Decoder* decoder) {
  if (decoder->avail() < sizeof(unsigned char) + 4 * sizeof(double))
    return false;
  unsigned char version = decoder->get8();
  if (version > kCurrentLosslessEncodingVersionNumber) return false;

  double lat_lo = decoder->getdouble();
  double lat_hi = decoder->getdouble();
  lat_ = R1Interval(lat_lo, lat_hi);
  double lng_lo = decoder->getdouble();
  double lng_hi = decoder->getdouble();
  lng_ = S1Interval(lng_lo, lng_hi);

  if (!is_valid()) {
    S2_DLOG_IF(ERROR, absl::GetFlag(FLAGS_s2debug))
        << "Invalid result in S2LatLngRect::Decode: " << *this;
    return false;
  }

  return true;
}

bool S2LatLngRect::IntersectsLngEdge(const S2Point& a, const S2Point& b,
                                     const R1Interval& lat, double lng) {
  // Return true if the segment AB intersects the given edge of constant
  // longitude.  The nice thing about edges of constant longitude is that
  // they are straight lines on the sphere (geodesics).

  return S2::CrossingSign(
      a, b, S2LatLng::FromRadians(lat.lo(), lng).ToPoint(),
      S2LatLng::FromRadians(lat.hi(), lng).ToPoint()) > 0;
}

bool S2LatLngRect::IntersectsLatEdge(const S2Point& a, const S2Point& b,
                                     double lat, const S1Interval& lng) {
  // Return true if the segment AB intersects the given edge of constant
  // latitude.  Unfortunately, lines of constant latitude are curves on
  // the sphere.  They can intersect a straight edge in 0, 1, or 2 points.
  S2_DCHECK(S2::IsUnitLength(a));
  S2_DCHECK(S2::IsUnitLength(b));

  // First, compute the normal to the plane AB that points vaguely north.
  Vector3_d z = S2::RobustCrossProd(a, b).Normalize();
  if (z[2] < 0) z = -z;

  // Extend this to an orthonormal frame (x,y,z) where x is the direction
  // where the great circle through AB achieves its maximium latitude.
  Vector3_d y = S2::RobustCrossProd(z, S2Point(0, 0, 1)).Normalize();
  Vector3_d x = y.CrossProd(z);
  S2_DCHECK(S2::IsUnitLength(x));
  S2_DCHECK_GE(x[2], 0);

  // Compute the angle "theta" from the x-axis (in the x-y plane defined
  // above) where the great circle intersects the given line of latitude.
  double sin_lat = sin(lat);
  if (fabs(sin_lat) >= x[2]) {
    return false;  // The great circle does not reach the given latitude.
  }
  S2_DCHECK_GT(x[2], 0);
  double cos_theta = sin_lat / x[2];
  double sin_theta = sqrt(1 - cos_theta * cos_theta);
  double theta = atan2(sin_theta, cos_theta);

  // The candidate intersection points are located +/- theta in the x-y
  // plane.  For an intersection to be valid, we need to check that the
  // intersection point is contained in the interior of the edge AB and
  // also that it is contained within the given longitude interval "lng".

  // Compute the range of theta values spanned by the edge AB.
  S1Interval ab_theta = S1Interval::FromPointPair(
      atan2(a.DotProd(y), a.DotProd(x)),
      atan2(b.DotProd(y), b.DotProd(x)));

  if (ab_theta.Contains(theta)) {
    // Check if the intersection point is also in the given "lng" interval.
    S2Point isect = x * cos_theta + y * sin_theta;
    if (lng.Contains(atan2(isect[1], isect[0]))) return true;
  }
  if (ab_theta.Contains(-theta)) {
    // Check if the intersection point is also in the given "lng" interval.
    S2Point isect = x * cos_theta - y * sin_theta;
    if (lng.Contains(atan2(isect[1], isect[0]))) return true;
  }
  return false;
}

bool S2LatLngRect::Intersects(const S2Cell& cell) const {
  // First we eliminate the cases where one region completely contains the
  // other.  Once these are disposed of, then the regions will intersect
  // if and only if their boundaries intersect.

  if (is_empty()) return false;
  if (Contains(cell.GetCenterRaw())) return true;
  if (cell.Contains(GetCenter().ToPoint())) return true;

  // Quick rejection test (not required for correctness).
  if (!Intersects(cell.GetRectBound())) return false;

  // Precompute the cell vertices as points and latitude-longitudes.  We also
  // check whether the S2Cell contains any corner of the rectangle, or
  // vice-versa, since the edge-crossing tests only check the edge interiors.

  S2Point cell_v[4];
  S2LatLng cell_ll[4];
  for (int i = 0; i < 4; ++i) {
    cell_v[i] = cell.GetVertex(i);  // Must be normalized.
    cell_ll[i] = S2LatLng(cell_v[i]);
    if (Contains(cell_ll[i])) return true;
    if (cell.Contains(GetVertex(i).ToPoint())) return true;
  }

  // Now check whether the boundaries intersect.  Unfortunately, a
  // latitude-longitude rectangle does not have straight edges -- two edges
  // are curved, and at least one of them is concave.

  for (int i = 0; i < 4; ++i) {
    S1Interval edge_lng = S1Interval::FromPointPair(
        cell_ll[i].lng().radians(), cell_ll[(i+1)&3].lng().radians());
    if (!lng_.Intersects(edge_lng)) continue;

    const S2Point& a = cell_v[i];
    const S2Point& b = cell_v[(i+1)&3];
    if (edge_lng.Contains(lng_.lo())) {
      if (IntersectsLngEdge(a, b, lat_, lng_.lo())) return true;
    }
    if (edge_lng.Contains(lng_.hi())) {
      if (IntersectsLngEdge(a, b, lat_, lng_.hi())) return true;
    }
    if (IntersectsLatEdge(a, b, lat_.lo(), lng_)) return true;
    if (IntersectsLatEdge(a, b, lat_.hi(), lng_)) return true;
  }
  return false;
}

S1Angle S2LatLngRect::GetDistance(const S2LatLngRect& other) const {
  const S2LatLngRect& a = *this;
  const S2LatLngRect& b = other;
  S2_DCHECK(!a.is_empty());
  S2_DCHECK(!b.is_empty());

  // First, handle the trivial cases where the longitude intervals overlap.
  if (a.lng().Intersects(b.lng())) {
    if (a.lat().Intersects(b.lat()))
      return S1Angle::Radians(0);  // Intersection between a and b.

    // We found an overlap in the longitude interval, but not in the latitude
    // interval. This means the shortest path travels along some line of
    // longitude connecting the high-latitude of the lower rect with the
    // low-latitude of the higher rect.
    S1Angle lo, hi;
    if (a.lat().lo() > b.lat().hi()) {
      lo = b.lat_hi();
      hi = a.lat_lo();
    } else {
      lo = a.lat_hi();
      hi = b.lat_lo();
    }
    return hi - lo;
  }

  // The longitude intervals don't overlap. In this case, the closest points
  // occur somewhere on the pair of longitudinal edges which are nearest in
  // longitude-space.
  S1Angle a_lng, b_lng;
  S1Interval lo_hi = S1Interval::FromPointPair(a.lng().lo(), b.lng().hi());
  S1Interval hi_lo = S1Interval::FromPointPair(a.lng().hi(), b.lng().lo());
  if (lo_hi.GetLength() < hi_lo.GetLength()) {
    a_lng = a.lng_lo();
    b_lng = b.lng_hi();
  } else {
    a_lng = a.lng_hi();
    b_lng = b.lng_lo();
  }

  // The shortest distance between the two longitudinal segments will include at
  // least one segment endpoint. We could probably narrow this down further to a
  // single point-edge distance by comparing the relative latitudes of the
  // endpoints, but for the sake of clarity, we'll do all four point-edge
  // distance tests.
  S2Point a_lo = S2LatLng(a.lat_lo(), a_lng).ToPoint();
  S2Point a_hi = S2LatLng(a.lat_hi(), a_lng).ToPoint();
  S2Point b_lo = S2LatLng(b.lat_lo(), b_lng).ToPoint();
  S2Point b_hi = S2LatLng(b.lat_hi(), b_lng).ToPoint();
  return min(S2::GetDistance(a_lo, b_lo, b_hi),
         min(S2::GetDistance(a_hi, b_lo, b_hi),
         min(S2::GetDistance(b_lo, a_lo, a_hi),
             S2::GetDistance(b_hi, a_lo, a_hi))));
}

S1Angle S2LatLngRect::GetDistance(const S2LatLng& p) const {
  // The algorithm here is the same as in GetDistance(S2LatLngRect), only
  // with simplified calculations.
  const S2LatLngRect& a = *this;
  S2_DLOG_IF(ERROR, a.is_empty())
      << "Empty S2LatLngRect in S2LatLngRect::GetDistance: " << a;

  S2_DLOG_IF(ERROR, !p.is_valid())
      << "Invalid S2LatLng in S2LatLngRect::GetDistance: " << p;

  if (a.lng().Contains(p.lng().radians())) {
    return S1Angle::Radians(max(0.0, max(p.lat().radians() - a.lat().hi(),
                                         a.lat().lo() - p.lat().radians())));
  }

  S1Interval interval(a.lng().hi(), a.lng().GetComplementCenter());
  double a_lng;
  if (interval.Contains(p.lng().radians())) {
    a_lng = a.lng().hi();
  } else {
    a_lng = a.lng().lo();
  }
  S2Point lo = S2LatLng::FromRadians(a.lat().lo(), a_lng).ToPoint();
  S2Point hi = S2LatLng::FromRadians(a.lat().hi(), a_lng).ToPoint();
  return S2::GetDistance(p.ToPoint(), lo, hi);
}

S1Angle S2LatLngRect::GetHausdorffDistance(const S2LatLngRect& other) const {
  return max(GetDirectedHausdorffDistance(other),
             other.GetDirectedHausdorffDistance(*this));
}

S1Angle S2LatLngRect::GetDirectedHausdorffDistance(
    const S2LatLngRect& other) const {
  if (is_empty()) {
    return S1Angle::Radians(0);
  }
  if (other.is_empty()) {
    return S1Angle::Radians(M_PI);  // maximum possible distance on S2
  }

  double lng_distance = lng().GetDirectedHausdorffDistance(other.lng());
  S2_DCHECK_GE(lng_distance, 0);
  return GetDirectedHausdorffDistance(lng_distance, lat(), other.lat());
}

// Return the directed Hausdorff distance from one longitudinal edge spanning
// latitude range 'a_lat' to the other longitudinal edge spanning latitude
// range 'b_lat', with their longitudinal difference given by 'lng_diff'.
S1Angle S2LatLngRect::GetDirectedHausdorffDistance(
    double lng_diff, const R1Interval& a, const R1Interval& b) {
  // By symmetry, we can assume a's longtitude is 0 and b's longtitude is
  // lng_diff. Call b's two endpoints b_lo and b_hi. Let H be the hemisphere
  // containing a and delimited by the longitude line of b. The Voronoi diagram
  // of b on H has three edges (portions of great circles) all orthogonal to b
  // and meeting at b_lo cross b_hi.
  // E1: (b_lo, b_lo cross b_hi)
  // E2: (b_hi, b_lo cross b_hi)
  // E3: (-b_mid, b_lo cross b_hi), where b_mid is the midpoint of b
  //
  // They subdivide H into three Voronoi regions. Depending on how longitude 0
  // (which contains edge a) intersects these regions, we distinguish two cases:
  // Case 1: it intersects three regions. This occurs when lng_diff <= M_PI_2.
  // Case 2: it intersects only two regions. This occurs when lng_diff > M_PI_2.
  //
  // In the first case, the directed Hausdorff distance to edge b can only be
  // realized by the following points on a:
  // A1: two endpoints of a.
  // A2: intersection of a with the equator, if b also intersects the equator.
  //
  // In the second case, the directed Hausdorff distance to edge b can only be
  // realized by the following points on a:
  // B1: two endpoints of a.
  // B2: intersection of a with E3
  // B3: farthest point from b_lo to the interior of D, and farthest point from
  //     b_hi to the interior of U, if any, where D (resp. U) is the portion
  //     of edge a below (resp. above) the intersection point from B2.

  S2_DCHECK_GE(lng_diff, 0);
  S2_DCHECK_LE(lng_diff, M_PI);

  if (lng_diff == 0) {
    return S1Angle::Radians(a.GetDirectedHausdorffDistance(b));
  }

  // Assumed longtitude of b.
  double b_lng = lng_diff;
  // Two endpoints of b.
  S2Point b_lo = S2LatLng::FromRadians(b.lo(), b_lng).ToPoint();
  S2Point b_hi = S2LatLng::FromRadians(b.hi(), b_lng).ToPoint();

  // Handling of each case outlined at the top of the function starts here.
  // This is initialized a few lines below.
  S1Angle max_distance;

  // Cases A1 and B1.
  S2Point a_lo = S2LatLng::FromRadians(a.lo(), 0).ToPoint();
  S2Point a_hi = S2LatLng::FromRadians(a.hi(), 0).ToPoint();
  max_distance = S2::GetDistance(a_lo, b_lo, b_hi);
  max_distance = max(
      max_distance, S2::GetDistance(a_hi, b_lo, b_hi));

  if (lng_diff <= M_PI_2) {
    // Case A2.
    if (a.Contains(0) && b.Contains(0)) {
      max_distance = max(max_distance, S1Angle::Radians(lng_diff));
    }
  } else {
    // Case B2.
    const S2Point& p = GetBisectorIntersection(b, b_lng);
    double p_lat = S2LatLng::Latitude(p).radians();
    if (a.Contains(p_lat)) {
      max_distance = max(max_distance, S1Angle(p, b_lo));
    }

    // Case B3.
    if (p_lat > a.lo()) {
      max_distance = max(max_distance, GetInteriorMaxDistance(
          R1Interval(a.lo(), min(p_lat, a.hi())), b_lo));
    }
    if (p_lat < a.hi()) {
      max_distance = max(max_distance, GetInteriorMaxDistance(
          R1Interval(max(p_lat, a.lo()), a.hi()), b_hi));
    }
  }

  return max_distance;
}

// Return the intersection of longitude 0 with the bisector of an edge
// on longitude 'lng' and spanning latitude range 'lat'.
S2Point S2LatLngRect::GetBisectorIntersection(const R1Interval& lat,
                                              double lng) {
  lng = fabs(lng);
  double lat_center = lat.GetCenter();
  // A vector orthogonal to the bisector of the given longitudinal edge.
  S2LatLng ortho_bisector;
  if (lat_center >= 0) {
    ortho_bisector = S2LatLng::FromRadians(lat_center - M_PI_2, lng);
  } else {
    ortho_bisector = S2LatLng::FromRadians(-lat_center - M_PI_2, lng - M_PI);
  }
  // A vector orthogonal to longitude 0.
  static const S2Point ortho_lng = S2Point(0, -1, 0);
  return S2::RobustCrossProd(ortho_lng, ortho_bisector.ToPoint());
}

// Return max distance from a point b to the segment spanning latitude range
// a_lat on longitude 0, if the max occurs in the interior of a_lat. Otherwise
// return -1.
S1Angle S2LatLngRect::GetInteriorMaxDistance(const R1Interval& a_lat,
                                             const S2Point& b) {
  // Longitude 0 is in the y=0 plane. b.x() >= 0 implies that the maximum
  // does not occur in the interior of a_lat.
  if (a_lat.is_empty() || b.x() >= 0) return S1Angle::Radians(-1);

  // Project b to the y=0 plane. The antipodal of the normalized projection is
  // the point at which the maxium distance from b occurs, if it is contained
  // in a_lat.
  S2Point intersection_point = S2Point(-b.x(), 0, -b.z()).Normalize();
  if (a_lat.InteriorContains(
      S2LatLng::Latitude(intersection_point).radians())) {
    return S1Angle(b, intersection_point);
  } else {
    return S1Angle::Radians(-1);
  }
}

bool S2LatLngRect::Contains(const S2Point& p) const {
  return Contains(S2LatLng(p));
}

bool S2LatLngRect::ApproxEquals(const S2LatLngRect& other,
                                S1Angle max_error) const {
  return (lat_.ApproxEquals(other.lat_, max_error.radians()) &&
          lng_.ApproxEquals(other.lng_, max_error.radians()));
}

bool S2LatLngRect::ApproxEquals(const S2LatLngRect& other,
                                const S2LatLng& max_error) const {
  return (lat_.ApproxEquals(other.lat_, max_error.lat().radians()) &&
          lng_.ApproxEquals(other.lng_, max_error.lng().radians()));
}

std::ostream& operator<<(std::ostream& os, const S2LatLngRect& r) {
  return os << "[Lo" << r.lo() << ", Hi" << r.hi() << "]";
}


text:
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
                        unicode_literals, with_statement)

from pants.backend.python.targets.python_target import PythonTarget

class PythonAntlrLibrary(PythonTarget):
  """A Python library generated from Antlr grammar files."""

  def __init__(self, module=None, antlr_version='3.1.3', *args, **kwargs):
    """
    :param module: everything beneath module is relative to this module name, None if root namespace
    :param antlr_version:
    """

    super(PythonAntlrLibrary, self).__init__(*args, **kwargs)

    self.module = module
    self.antlr_version = antlr_version


text:
bc_oad
======

BLE Oad Service For PhoneGap


text:
namespace mobagen {
  class GLManager {
  public:
    GLManager(std::unique_ptr<Renderer> renderer, const glm::vec2 &windowSize);

    ~GLManager(void);

    void setDrawSize(const glm::vec2 &size);

    void bindRenderTarget(void) const;

    void renderScene(Entity *entity);

    void setActiveCamera(std::shared_ptr<Camera> camera);

    void addDirectionalLight(std::shared_ptr<DirectionalLight> light);

    void addPointLight(std::shared_ptr<PointLight> light);

    void addSpotLight(std::shared_ptr<SpotLight> light);

    void removeDirectionalLight(std::shared_ptr<DirectionalLight> light);

    void removePointLight(std::shared_ptr<PointLight> light);

    void removeSpotLight(std::shared_ptr<SpotLight> light);

    glm::mat4 getViewMatrix(void);

    glm::mat4 getProjectionMatrix(void);

    void drawEntity(Entity *entity);

    void drawLine(Line line);

    int width, height;

    GLuint lineBuffer;
    GLuint VertexArrayID;

  private:
    std::unique_ptr<Renderer> m_renderer;
    std::unique_ptr<SimpleRenderer> m_simpleRenderer;

    std::shared_ptr<Camera> m_activeCamera;

    std::vector<std::shared_ptr<DirectionalLight>> m_directionalLights;
    std::vector<std::shared_ptr<PointLight>> m_pointLights;
    std::vector<std::shared_ptr<SpotLight>> m_spotLights;
  };
}


text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.6">
  <compounddef id="structboost_1_1geometry_1_1resolve__variant_1_1equals_3_01boost_1_1variant_3_01_b_o_o_s_t___v_a_1444bce33686cf0fa9447788861b936a" kind="struct" prot="public">
    <compoundname>boost::geometry::resolve_variant::equals< boost::variant< BOOST_VARIANT_ENUM_PARAMS(T1)>, boost::variant< BOOST_VARIANT_ENUM_PARAMS(T2)>></compoundname>
    <includes local="no">equals.hpp</includes>
    <innerclass refid="structboost_1_1geometry_1_1resolve__variant_1_1equals_3_01boost_1_1variant_3_01_b_o_o_s_t___v_a_c050b04e1a64312df07050b392f02566" prot="public">boost::geometry::resolve_variant::equals< boost::variant< BOOST_VARIANT_ENUM_PARAMS(T1)>, boost::variant< BOOST_VARIANT_ENUM_PARAMS(T2)>>::visitor</innerclass>
    <templateparamlist>
      <param>
        <type>BOOST_VARIANT_ENUM_PARAMS(typename T1)</type>
      </param>
    </templateparamlist>
      <sectiondef kind="public-static-func">
      <memberdef kind="function" id="structboost_1_1geometry_1_1resolve__variant_1_1equals_3_01boost_1_1variant_3_01_b_o_o_s_t___v_a_1444bce33686cf0fa9447788861b936a_1a4b955c0b0f24f5fa515a9cf2d9cd1175" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>bool</type>
        <definition>static bool boost::geometry::resolve_variant::variant< BOOST_VARIANT_ENUM_PARAMS(T2)>>::apply</definition>
        <argsstring>(boost::variant< BOOST_VARIANT_ENUM_PARAMS(T1)> const &geometry1, boost::variant< BOOST_VARIANT_ENUM_PARAMS(T2)> const &geometry2)</argsstring>
        <name>apply</name>
        <param>
          <type>boost::variant< BOOST_VARIANT_ENUM_PARAMS(T1)> const &</type>
          <declname>geometry1</declname>
        </param>
        <param>
          <type>boost::variant< BOOST_VARIANT_ENUM_PARAMS(T2)> const &</type>
          <declname>geometry2</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/equals.hpp" line="445" column="1" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/equals.hpp" bodystart="445" bodyend="451"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <location file="/home/travis/build/boostorg/boost/boost/geometry/algorithms/equals.hpp" line="432" column="1" bodyfile="/home/travis/build/boostorg/boost/boost/geometry/algorithms/equals.hpp" bodystart="428" bodyend="452"/>
    <listofallmembers>
      <member refid="structboost_1_1geometry_1_1resolve__variant_1_1equals_3_01boost_1_1variant_3_01_b_o_o_s_t___v_a_1444bce33686cf0fa9447788861b936a_1a4b955c0b0f24f5fa515a9cf2d9cd1175" prot="public" virt="non-virtual"><scope>boost::geometry::resolve_variant::equals< boost::variant< BOOST_VARIANT_ENUM_PARAMS(T1)>, boost::variant< BOOST_VARIANT_ENUM_PARAMS(T2)>></scope><name>apply</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>


text:
/*
 * GstProbeManager.cpp
 *
 *  Created on: May 23, 2014
 *      Author: loganek
 */

#include "GstProbeManager.h"
#include "Utils/StringUtils.h"
#include <algorithm>

using namespace std;
using namespace Gst;
using Glib::RefPtr;

GstProbeManager& GstProbeManager::get_instance()
{
	static GstProbeManager manager;

	return manager;
}

vector<pair<string,PadProbeType>> GstProbeManager::get_available_probes ()
{
#define Q(x) #x
#define GENERATE_PROBE_PAIR(probe_name) \
		{ \
	string str = StringUtils::to_lower(Q(probe_name)); \
	replace(str.begin(), str.end(), '_', ' ');\
	vect.push_back(make_pair( \
			str, \
			PAD_PROBE_TYPE_ ## probe_name));\
		}

	static vector<pair<string, PadProbeType>> vect;

	if (vect.size() > 0)
		return vect;

	GENERATE_PROBE_PAIR(INVALID)
	GENERATE_PROBE_PAIR(IDLE)
	GENERATE_PROBE_PAIR(BLOCK)
	GENERATE_PROBE_PAIR(BUFFER)
	GENERATE_PROBE_PAIR(BUFFER_LIST)
	GENERATE_PROBE_PAIR(EVENT_DOWNSTREAM)
	GENERATE_PROBE_PAIR(EVENT_UPSTREAM)
	GENERATE_PROBE_PAIR(EVENT_FLUSH)
	GENERATE_PROBE_PAIR(QUERY_DOWNSTREAM)
	GENERATE_PROBE_PAIR(QUERY_UPSTREAM)
	GENERATE_PROBE_PAIR(PUSH)
	GENERATE_PROBE_PAIR(PULL)
	GENERATE_PROBE_PAIR(BLOCKING)
	GENERATE_PROBE_PAIR(DATA_DOWNSTREAM)
	GENERATE_PROBE_PAIR(DATA_UPSTREAM)
	GENERATE_PROBE_PAIR(DATA_BOTH)
	GENERATE_PROBE_PAIR(BLOCK_DOWNSTREAM)
	GENERATE_PROBE_PAIR(BLOCK_UPSTREAM)
	GENERATE_PROBE_PAIR(EVENT_BOTH)
	GENERATE_PROBE_PAIR(QUERY_BOTH)
	GENERATE_PROBE_PAIR(ALL_BOTH)
	GENERATE_PROBE_PAIR(SCHEDULING);

	return vect;
}

void GstProbeManager::set_probe (RefPtr<Pad> pad, PadProbeType type)
{
	remove_probe(pad, type);

	probe_ides[pad][type] = pad->add_probe(type, [this](const RefPtr<Pad>& pad, const PadProbeInfo& info) {
		PadProbeInfo tmp = const_cast<PadProbeInfo&>(info);
		if (tmp.get_type() & PAD_PROBE_TYPE_BUFFER)
			for (auto observer : observers)
				observer->buffer_probe(pad, tmp.get_buffer());
		if (tmp.get_type() & (PAD_PROBE_TYPE_EVENT_DOWNSTREAM | PAD_PROBE_TYPE_EVENT_UPSTREAM))
			for (auto observer : observers)
				observer->event_probe(pad, tmp.get_event());
		if (tmp.get_type() & (PAD_PROBE_TYPE_QUERY_DOWNSTREAM | PAD_PROBE_TYPE_QUERY_UPSTREAM))
			for (auto observer : observers)
				observer->query_probe(pad, tmp.get_query());

		return Gst::PAD_PROBE_OK;
	});
}

void GstProbeManager::remove_probe (RefPtr<Pad> pad, PadProbeType type)
{
	if (is_probe_exists(pad, type))
	{
		pad->remove_probe(probe_ides[pad][type]);
		probe_ides[pad].erase(type);
	}
}

bool GstProbeManager::is_probe_exists (RefPtr<Pad> pad, PadProbeType type)
{
	return probe_ides.find(pad) != probe_ides.end() &&
			probe_ides[pad].find(type) != probe_ides[pad].end();
}

void GstProbeManager::register_probe_observer(IProbeObserver* observer)
{
	if (!observers.insert(observer).second)
		throw std::runtime_error("Cannot register observer");
}

void GstProbeManager::unregister_probe_observer(IProbeObserver* observer)
{
	if (!observers.erase(observer))
		throw std::runtime_error("Cannot unregister observer");
}


text:
application=$FCLAW_APPLICATIONS_BUILD_DIR/elliptic/allencahn/allencahn

# change to source dir for working directory
cd $FCLAW_APPLICATIONS_SRC_DIR/elliptic/allencahn/

# run programs, exit script with nonzero on failure (or else script will exit with value of last program run)
$FCLAW_MPIRUN $FCLAW_MPI_TEST_FLAGS $application -F regression.ini  || exit 1


text:
\chapter{Restrições do Projeto}

\section{Restrições Obrigatórias}

\subsection{Restrições de solução}
\noindent\textbf{Descrição:} O sistema deve ser implementado na linguagem de programação PHP.
\newline\textbf{Razão:} Compatibilidade e interoperabilidade
\newline\textbf{Critério de encaixe:} O sistema de ocorrências é uma adição a um sistema já existente.

\vspace{3mm}

\noindent\textbf{Descrição:} O sistema tem que obter dados a partir de uma base de dados MySQL já existente.
\newline\textbf{Razão:} Foi pedido do cliente que o sistema faça recurso a uma determinada base de dados que já é por ele usada para outros produtos.
\newline\textbf{Critério de encaixe:} O sistema de ocorrências é uma adição a um sistema já existente.

\subsection{Ambiente de implementação do sistema atual}

No sistema atual os gestores, agentes, jornalistas e treinadores fazem toda a gestão das ocorrências manualmente, seja criando notificações nos seus calendários de forma manual ou num documento de forma manual.

\subsection{Aplicações parceiras}

Nesta fase não foi detetada a necessidade de colaborar com outras aplicações.

\subsection{\emph{Off-the-shelf software}}

\noindent\textbf{Descrição:} \emph{Talent Spy}
\newline\textbf{Razão:} O serviço de ocorrências deve ser implementado no \emph{software} já existente.
\newline\textbf{Critério de encaixe:} O sistema de ocorrências é uma adição a um sistema já existente.

\subsection{Restrições de Prazo/Agendamento}

\noindent\textbf{Descrição:} Ter o serviço pronto até à abertura do mercado de transferências da época desportivas 2018/19.
\newline\textbf{Razão:} O serviço já deve ser usado na próxima época.
\newline\textbf{Critério de encaixe:} De forma a começar a testar o sistema.

\subsection{Restrições orçamentais}

\noindent\textbf{Descrição:} O orçamento total para a implementação é 9000 euros.
\newline\textbf{Razão:} A equipa de engenheiros é constituída por 2 engenheiros da \emph{F3M Information Systems S.A} com salários mensais de 1.200 euros, os 4 elementos do grupo com salários mensais de 500 euros e as licenças para as aplicações móveis que por ano custam 200 euros.
\newline\textbf{Critério de encaixe:} A equipa de desenvolvimento tem que ser remunerada e é necessário pagar as licenças das aplicações móveis.

\newpage

\section{Convenções de nomes e definições}

\subsection{Definições de todos os termos, incluindo acrónimos, utilizados}

\begin{itemize}
    \item \emph{FTSpy}: \emph{TalentSpy}
\end{itemize}

\subsection{Dicionário de de dados para todos os modelos incluídos}

\begin{itemize}
    \item Notificação: ocorrência despoletada.
    \item Ocorrência: tipo de evento que ocorre e que está associado a um determinado jogador.
\end{itemize}


text:
package org.apache.camel.spring.cloud;

import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.cloud.ServiceDefinition;
import org.apache.camel.cloud.ServiceLoadBalancer;
import org.apache.camel.cloud.ServiceLoadBalancerFunction;
import org.apache.camel.impl.cloud.DefaultServiceDefinition;
import org.apache.camel.support.ServiceSupport;
import org.apache.camel.util.ObjectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;

public class CamelSpringCloudServiceLoadBalancer extends ServiceSupport implements CamelContextAware, ServiceLoadBalancer {
    private static final Logger LOGGER = LoggerFactory.getLogger(CamelSpringCloudServiceLoadBalancer.class);

    private final LoadBalancerClient loadBalancerClient;
    private CamelContext camelContext;

    public CamelSpringCloudServiceLoadBalancer(LoadBalancerClient loadBalancerClient) {
        this.loadBalancerClient = loadBalancerClient;
    }

    @Override
    public CamelContext getCamelContext() {
        return camelContext;
    }

    @Override
    public void setCamelContext(CamelContext camelContext) {
        this.camelContext = camelContext;
    }

    @Override
    protected void doStart() throws Exception {
        ObjectHelper.notNull(camelContext, "camelContext");
        ObjectHelper.notNull(loadBalancerClient, "loadBalancerClient");

        LOGGER.info("ServiceCall is using cloud load balancer of type: {}", loadBalancerClient.getClass());
    }

    @Override
    protected void doStop() throws Exception {
    }

    @Override
    public <T> T process(String serviceName, ServiceLoadBalancerFunction<T> function) throws Exception {
        return loadBalancerClient.execute(serviceName,  i -> function.apply(instanceToDefinition(i)));
    }

    // *******************************
    // Helpers
    // *******************************

    private ServiceDefinition instanceToDefinition(ServiceInstance instance) {
        return new DefaultServiceDefinition(
            instance.getServiceId(),
            instance.getHost(),
            instance.getPort(),
            instance.getMetadata()
        );
    }
}


text:
int Get_Butterworth_Order(LP_Filter_Spec_t *Filter_p);
void Butterworth_Filter_roots(LP_Filter_Spec_t * Filter_p, double complex coeff[]);


text:
import React from 'react'
import axios from 'axios'
import {Link} from 'react-router'
import {
  Table,
  TableBody,
  TableHeader,
  TableHeaderColumn,
  TableRow,
  TableRowColumn
} from 'material-ui/Table';
import {RaisedButton} from 'material-ui'
var moment = require('moment');

class Calls extends React.Component {

  constructor(props) {
    super(props);
    this.callSearch = this.callSearch.bind(this);
  }

  callSearch(evt) {
    evt.preventDefault();
    this.props.findCallsByName(evt.target.search.value);
  }

  render() {
    return (

      {this.props.user ?

          <TableHeader
            adjustForCheckbox={false}
            displaySelectAll={false}>
            <TableRow>
              <TableHeaderColumn>
Calls

{this.props.searchResults && this.props.countOfResults(this.props.searchResults)}
</TableHeaderColumn>
              <TableHeaderColumn></TableHeaderColumn>
              <TableHeaderColumn></TableHeaderColumn>
              <TableHeaderColumn>

                <form method="GET" onSubmit={this.callSearch}>
                <input type="text" placeholder="Find Calls" name="search" id="search" />
                  <RaisedButton
                    type="submit"
                    label="Find Calls"
                    backgroundColor='green'
                    labelColor='white'/>
                </form>

              </TableHeaderColumn>
            </TableRow>
            <TableRow>
              <TableHeaderColumn>
Name
</TableHeaderColumn>
              <TableHeaderColumn>
Pub
</TableHeaderColumn>
              <TableHeaderColumn>
Date Start
</TableHeaderColumn>
              <TableHeaderColumn>
Date End
</TableHeaderColumn>
              <TableHeaderColumn>
Open or Closed
</TableHeaderColumn>
            </TableRow>
          </TableHeader>
          <TableBody displayRowCheckbox={false}>
          {this.props.searchResults && this.props.searchResults.map(call => (
            <TableRow key={call.id}>
              <TableRowColumn><Link to={`/calls/${call.id}`}>{call.call_name}</Link></TableRowColumn>
              <TableRowColumn><Link to={`/pubs/${call.pub.id}`}>{call.pub.pub_name}</Link></TableRowColumn>
              <TableRowColumn>{moment(call.call_start).format('LL')}</TableRowColumn>
              <TableRowColumn>{moment(call.call_end).format('LL')}</TableRowColumn>
              <TableRowColumn>{call.open_or_closed}</TableRowColumn>
            </TableRow>)
          )}
          </TableBody>

 :
Please log in.
}

    )
  }
}

import {connect} from 'react-redux'
import {findCallsByName} from 'APP/app/reducers/calls/callSearchResults'
import countOfResults from 'APP/app/utils/countOfResults'

export default connect(
  ({ auth, callSearchResults }) => ({
  	user: auth,
    searchResults: callSearchResults
  }), {findCallsByName, countOfResults},
)(Calls)