text:
This is a simple theme designed to work along side Django Church.

## Install

Simply copy these assets into the theme templates directory inside your Django app.

## Documentation

For more info see the main project docs: [Read the
Docs](http://djangochurch.readthedocs.org/)


text:
function [f, hits,selected] = lreg_AS_main_3(X,deg,dim,alpha,labels,options)
	%%% [hits,selected] = lreg_AS_main(X,deg,dim,alpha,labels,options)
	%%% Input:
	%%% X: n-by-d matrix. Each row is the feature vector of a node computed by Eigenmap.
	%%% deg: n-by-1 vector. Each entry is the sum of pairwise similarity values between a node and all other nodes.
	%%% dim: a positive integer indicating the number of leading dimensions in X to use
	%%% alpha: a positive real number used in the calculation of the selection score
	%%% labels: n-by-1 vector. True labels of data points. 1: target, 0: non-target.
	%%% options: a structure specifying values for the following algorithmic options:
	%%% 	num_evaluations: number of points we want to investigate (default: 5000)
	%%% 	randomSeed: seed of random number generator (default: the current time)
	%%% 	log_prefix: prefix of log file name (default: current time string)
	%%% 	n_conncomp: number of connected components in the similarity matrix (default 1)
	%%% 	omega0: weight assigned to regularization on unlabeled points (default: 1/(#data points))
	%%% 	prior_prob: prior target probability (default: 0.05)
	%%% 	eta: jump probability (default: 0.5)
	%%%
	%%% Output:
	%%% hits: a vector of cumulative counts of discovered target points
	%%% selected: a vector of indices of points selected by the algorithm

	X = X(:,1:dim); % Use the first dim dimensions
	n = size(X,1);
	sqd = sqrt(deg);
	yp = labels .* sqd;

	%%% Default values for options
	num_evaluations = 5000; %number of points we want to investigate
	randomSeed = now; %seed of random number generator, set to the current time
	log_prefix = datestr(now,30); %prefix of log file name
	b = 1; %number of connected components in the similarity matrix
	omega0 = 1/n; %ht assigned to regularization on unlabeled points
	pai = 0.5; %prior target probability
	eta = 0.5; %jump probability

	%%% Set values for options according to input
	if(isfield(options,'num_evaluations'))
		num_evaluations = options.num_evaluations;
	end
	if(isfield(options,'randomSeed'))
		randomSeed = options.randomSeed;
	end
	if(isfield(options,'log_prefix'))
		log_prefix = options.log_prefix;
	end
	if(isfield(options,'n_conncomp'))
		b = options.n_conncomp;
	end
	if(isfield(options,'omega0'))
		omega0 = options.omega0;
	end
	if(isfield(options,'prior_prob'))
		pai = options.prior_prob;
	end
	if(isfield(options,'eta'))
		eta = options.eta;
	end

	lamb = (1-eta)/eta;
	r = lamb*omega0;
	c = 1/(1-r);
	num_initial = 1; % For now we always initialize with 1 target point.
	% stream = RandStream('mt19937ar', 'Seed', randomSeed);
	% RandStream.setGlobalStream(stream);
	% fid = fopen([log_prefix '_seed' num2str(randomSeed) '_alpha' num2str(alpha) '_omega0-' num2str(omega0) '_d' num2str(dim) '.txt'], 'w');

	d = size(X,2);
	Xp = bsxfun(@times, X, sqd);

	%%% Randomly pick 1 target point as the first point
	in_train = false(n,1);
	f = find(labels==1); randp = randperm(length(f));
	start_point = f(randp(1:num_initial));

	%%% If user specifies a start point, use it
	if(isfield(options,'start_point'))
		start_point = options.start_point;
		disp('Set use-specified start point.')
		if(labels(start_point) ~= 1)
			% printf(2,'Warning: user-specified start point %d is not positive. Change it to positive. \n', start_point);
			labels(start_point) = 1;
			yp(start_point) = labels(start_point) * sqd(start_point);
		end
	end

	in_train(start_point) = true;
	best_ind = start_point;

	% fprintf(fid,'start point: %d\n',best_ind);
	hits = zeros(num_evaluations+1,1);
	selected = zeros(num_evaluations+1,1);
	hits(1) = 1;
	selected(1) = best_ind;

	%%% Initialization of varaibles needed by the algorithm
	disp('Initializing variables..');
	disp('Constructing C..');
	C = r*(Xp'*Xp) + (1-r)*(Xp(best_ind,:)'*Xp(best_ind,:)) + lamb*diag([zeros(b,1); ones(d-b,1)]);
	disp('Inverting C..');
	C = inv(C);

	disp('Computing h and f..');
	h = sum((Xp*C).*Xp,2);
	f = X * (C * (r*Xp'*sqd*pai + Xp(best_ind,:)'*(yp(best_ind)-r*sqd(best_ind)*pai)));

	disp('Entering main loop..');
	%%% Main loop
	for i = 1:num_evaluations
		tic;

		%%% Calculating change
		test_ind = ~in_train;
		change = ((((test_ind'*X)*C)*Xp')' - (h./sqd)) .* sqd .* ((1-r*pai)*c-f) ./ (c+h);
		f_bnd = min(max(f(test_ind),0),1);

		%%% Calculating selection criteria
		score = f_bnd + alpha*f_bnd.*max(change(test_ind),0);

		%%% select best index
		[best_score best_ind] = max(score);
		best_f = f_bnd(best_ind);
		test_ind = find(test_ind);
		best_ind = test_ind(best_ind);
		best_change = max(change(best_ind),0);
		in_train(best_ind) = true;

		if((nnz(labels(in_train)==1))==nnz(labels==1))
			elapsed = toc;
			% fprintf(fid, '%d %d %f\n', i, nnz(labels(in_train)==1), elapsed);
			break;
		end

		%%% Updating parameters
		%keyboard;
		%yp(best_ind) = sqd(best_ind) * input(['Requesting label for e-mail '  num2str(best_ind)  ':']);
		CXp = C * Xp(best_ind,:)';
		f = f + X * ( (CXp*((yp(best_ind)-r*sqd(best_ind)*pai)*c - sqd(best_ind)*f(best_ind)) / (c+h(best_ind))) );
		%f = f + X * CXp * (yp_new(i) - yp(i));
		C = C - (CXp*CXp')/(c+h(best_ind));
		h = h - (Xp*CXp).^2 / (c+h(best_ind));
		elapsed = toc;

		selected(i+1) = best_ind;
		hits(i+1) = nnz(labels(in_train) == 1);
		if(mod(i,1)==0 || i==1)
		  % disp([num2str(i) ', #' num2str(selected(i+1)) ', E[u]=' num2str(best_score) ', best f = ' num2str(best_f) ', best change = ' num2str(best_change) ...
		  %       ', hits ' num2str(hits(i+1)) '/' num2str(i+1)...
		  %       ', took: ' num2str(elapsed) 's']);
		end
		% fprintf(fid, '%d %d %f %d\n', i, hits(i+1), elapsed, selected(i+1));
end

% % fclose(fid);

redpajama_set_name: RedPajamaGithub


text:
ES5Harness.registerTest({

    id: "15.4.4.20-2-5",

    path: "TestCases/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-2-5.js",

    description: "Array.prototype.filter to Array-like object, 'length' is an own data property that overrides an inherited accessor property",

    test: function testcase() {

        function callbackfn(val, idx, obj) {
            return obj.length === 2;
        }

        var proto = {};

        Object.defineProperty(proto, "length", {
            get: function () {
                return 3;
            },
            configurable: true
        });

        var Con = function () { };
        Con.prototype = proto;

        var child = new Con();
        Object.defineProperty(child, "length", {
            value: 2,
            configurable: true
        });
        child[0] = 12;
        child[1] = 11;
        child[2] = 9;

        var newArr = Array.prototype.filter.call(child, callbackfn);
        return newArr.length === 2;
    },

    precondition: function prereq() {
        return fnExists(Array.prototype.filter) && fnExists(Object.defineProperty);
    }

});


text:
import PropTypes from 'prop-types';
import {
  backgroundDoc,
  roundPropType,
  marginProp,
  OVERFLOW_VALUES,
} from '../../utils/general-prop-types';

// if you update values here, make sure to update in Box too.
const dropOverflowPropTypes = PropTypes.oneOfType([
  PropTypes.oneOf(OVERFLOW_VALUES),
  PropTypes.shape({
    horizontal: PropTypes.oneOf(OVERFLOW_VALUES),
    vertical: PropTypes.oneOf(OVERFLOW_VALUES),
  }),
  PropTypes.string,
]);

let PropType = {};
if (process.env.NODE_ENV !== 'production') {
  PropType = {
    align: PropTypes.shape({
      top: PropTypes.oneOf(['top', 'bottom']),
      bottom: PropTypes.oneOf(['top', 'bottom']),
      right: PropTypes.oneOf(['left', 'right']),
      left: PropTypes.oneOf(['left', 'right']),
    }),
    background: backgroundDoc,
    elevation: PropTypes.oneOfType([
      PropTypes.oneOf(['none', 'xsmall', 'small', 'medium', 'large', 'xlarge']),
      PropTypes.string,
    ]),
    margin: marginProp,
    onClickOutside: PropTypes.func,
    onEsc: PropTypes.func,
    overflow: dropOverflowPropTypes,
    plain: PropTypes.bool,
    responsive: PropTypes.bool,
    restrictFocus: PropTypes.bool,
    round: roundPropType,
    stretch: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['align'])]),
    target: PropTypes.object.isRequired,
    trapFocus: PropTypes.bool,
  };
}
export const DropPropTypes = PropType;


text:
static NSString *locateCellId = @"locateCellId";
static NSString *pickUpCellId = @"pickUpCellId";

@interface YBZYPickUpController () <UITableViewDelegate, UITableViewDataSource, CLLocationManagerDelegate>

@property (nonatomic, weak) UITableView *pickUpView;

@property (nonatomic, strong) CLLocationManager *locationManager;

@property (nonatomic, copy) NSString *locateString;

@property (nonatomic, strong) NSArray<YBZYPickUpModel *> *pickUps;

@end

@implementation YBZYPickUpController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.translucent = false;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
    [self loadPickUpData];
    [self locate];
    [SVProgressHUD showWithStatus:@"定位中"];
}

- (void)setupUI {
    self.view.backgroundColor = YBZYCommonBackgroundColor;

    UITableView *pickUpView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    pickUpView.delegate = self;
    pickUpView.dataSource = self;
    pickUpView.backgroundColor = YBZYCommonBackgroundColor;
    [self.view addSubview:pickUpView];
    self.pickUpView = pickUpView;
    [pickUpView registerClass:[YBZYAddressLocateCell class] forCellReuseIdentifier:locateCellId];
    [pickUpView registerClass:[YBZYAddressPickUpCell class] forCellReuseIdentifier:pickUpCellId];
}

#pragma mark - tableview

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (section) {
        return self.pickUps.count;
    }
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        return 44;
    }
    return 100;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    if (section) {
        return 25;
    }
    return 8;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.01;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    if (section) {
        UILabel *headerLabel = [UILabel ybzy_labelWithText:@"  抓不到请求接口, 就抓了几个返回的数据写死了" andTextColor:YBZYCommonMidTextColor andFontSize:14];
        [headerLabel sizeToFit];
        return headerLabel;
    }
    return nil;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (!indexPath.section) {
        YBZYAddressLocateCell *cell = [tableView dequeueReusableCellWithIdentifier:locateCellId forIndexPath:indexPath];
        cell.locateString = self.locateString;
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        return cell;
    }
    YBZYAddressPickUpCell *cell = [tableView dequeueReusableCellWithIdentifier:pickUpCellId forIndexPath:indexPath];
    cell.pickUpModel = self.pickUps[indexPath.row];
    YBZYPickUpModel *currentPickUp = [[[YBZYSQLiteManager sharedManager] getPickUpWithUserId:YBZYUserId] firstObject][@"pickUpModel"];
    if ([currentPickUp.id isEqualToString:cell.pickUpModel.id]) {
        cell.isCurrentPickUp = true;
    } else {
        cell.isCurrentPickUp = false;
    }
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if (!indexPath.section) {
        [self.locationManager startUpdatingLocation];
        [SVProgressHUD showWithStatus:@"定位中"];
        return;
    }
    [[YBZYSQLiteManager sharedManager] setPickUp:self.pickUps[indexPath.row] withUserId:YBZYUserId];
    [self.navigationController popViewControllerAnimated:true];
}

#pragma mark - 定位及代理

- (void)locate {
    if ([CLLocationManager locationServicesEnabled]) {
        self.locationManager = [[CLLocationManager alloc] init];
        self.locationManager.delegate = self;
        if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
            [self.locationManager requestWhenInUseAuthorization];
        }
        [self.locationManager startUpdatingLocation];
    }
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
    self.locateString = @"未打开定位服务";
    [self.pickUpView reloadData];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [SVProgressHUD dismiss];
    });
    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"允许\"定位\"提示" message:@"请在设置中打开定位" preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *ok = [UIAlertAction actionWithTitle:@"打开定位" style:UIAlertActionStyleDefault handler:^(UIAlertAction *_Nonnull action) {
        //打开设置
        NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
        [[UIApplication sharedApplication] openURL:settingsURL options:@{} completionHandler:nil];
    }];
    UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *_Nonnull action){
    }];
    [alertVC addAction:cancel];
    [alertVC addAction:ok];
    [self presentViewController:alertVC animated:YES completion:nil];
}

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations {
    [self.locationManager stopUpdatingLocation];
    CLLocation *currentLocation = [locations lastObject];
    CLGeocoder *geoCoder = [[CLGeocoder alloc] init];
    //反编码
    [geoCoder reverseGeocodeLocation:currentLocation completionHandler:^(NSArray<CLPlacemark *> *_Nullable placemarks, NSError *_Nullable error) {
        if (placemarks.count > 0) {
            CLPlacemark *placeMark = placemarks[0];
            self.locateString = placeMark.thoroughfare;
            if (!self.locateString) {
                self.locateString = @"无法定位具体位置";
            }
            NSLog(@"%@", self.locateString);//城市名
            NSLog(@"%@", placeMark.name);  //全长度地址
        } else if (error == nil && placemarks.count == 0) {
            NSLog(@"No location and error return");
            self.locateString = @"无法定位具体位置";
        } else if (error) {
            NSLog(@"location error: %@ ", error);
            self.locateString = @"无法定位具体位置";
        }
        [self.pickUpView reloadData];
    }];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [SVProgressHUD dismiss];
    });
}

#pragma mark - 数据

- (void)loadPickUpData {
    NSString *urlString = @"https://coding.net/u/YiBaZhuangYuan/p/BeeQuickData/git/raw/master/BeeQuickHomePickUp.json";
    [[YBZYHTTPSessionManager sharedSessionManager] requestMethod:YBZYHTTPMethodGet URLString:urlString parameters:nil completion:^(id response, NSError *error) {
        if (error) {
            NSLog(@"%@",error);
            return;
        }
        NSDictionary *data = response[@"data"];
        NSArray *dealers = data[@"dealers"];
        self.pickUps = [NSArray yy_modelArrayWithClass:[YBZYPickUpModel class] json:dealers];
        [self.pickUpView reloadData];
    }];
}

@end


text:
var sumList = 0;
    var randomList = [1, 2, 3, 4, 5, 6, 7 ,8, 9, 10];
    for(var i = 0; i < randomList.length; i++)
    {

         sumList += randomList[i];

    }

    console.log(sumList);

//Pseudo code for finding Median
//initialize constant variable median=0.
//Sort the list as list.sort()
//Find the length of list as listlength=list.length
//if listlength is odd{
	// find the middle number middle as Math.round(listlength-1)
	// Now median=list[middle-1]
//}
//else{
	// middle=list.length/2
	// median=(list[middle]+list[middle-1])/2
//}

//print median on console using console.log(median)
var median = 0;
        var middle;
        var list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
        var listlength = list.length;
        list.sort();

        if (listlength%2 !== 0){
           middle =  Math.round(listlength-1);
           median = list[middle-1];
           }
        else{
           middle = listlength/2;
           median = (list[middle]+list[middle-1])/2;
        }
        console.log(median);

// Pseudo code for finding mean of a list.

//initialize constant variable mean=0.
//find the sum of list using the same method as in idea 1.
//find the length of the list as listlength=list.length
//find the mean as mean=sumList/listlength

//print mean on console using console.log(mean)

var mean = 0;
   for(var i = 0; i < randomList.length; i++)
   var list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
   var listlength = list.length;

   {

    mean = sumList/list.length;

   }

   console.log(mean);


text:
package com.djsz.rxjava2demo;

import android.os.Bundle;
import android.os.SystemClock;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Button;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

/**
 * author: Shawn
 * time  : 2017/3/3 13:30
 */

public class CreatingOperatorActivity extends AppCompatActivity {

    private static final String TAG = "CreatingOperatorActivit";
    private Button btnRange;
    CompositeDisposable disList;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_creating_operator);

        disList = new CompositeDisposable();

        findViewById(R.id.btn_from).setOnClickListener(v -> testFromOperator());
        findViewById(R.id.btn_just).setOnClickListener(v -> testJustOperator());
        findViewById(R.id.btn_interval).setOnClickListener(v -> testIntervalOperator());
        findViewById(R.id.btn_defer).setOnClickListener(v -> testDeferOperator());
        findViewById(R.id.btn_timer).setOnClickListener(v -> testTimerOperator());

        btnRange = (Button) findViewById(R.id.btn_range);
        btnRange.setOnClickListener(v -> testRangeOperator());

    }

    /**
     * Timer 操作符 至起一个延时的功能
     */
    private void testTimerOperator() {
        Observable
                .timer(3, TimeUnit.SECONDS)
                .subscribe(new Observer<Long>() {
                    @Override
                    public void onSubscribe(Disposable d) {
                        Log.i(TAG, "onSubscribe: ");
                    }

                    @Override
                    public void onNext(Long value) {
                        Log.i(TAG, "onNext: " + value);
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }

    /**
     * Defer 操作符
     */
    private void testDeferOperator() {
        Observable
                .defer(new Callable<ObservableSource<?>>() {
                    @Override
                    public ObservableSource<?> call() throws Exception {
                        return Observable.range(0, 20);
                    }
                })
                .subscribe(new Observer<Object>() {
                    @Override
                    public void onSubscribe(Disposable d) {
                        Log.i(TAG, "onSubscribe: ");
                    }

                    @Override
                    public void onNext(Object value) {
                        Log.i(TAG, "onNext: " + value);
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }

    /**
     * Interval 操作符
     * 将接收事件间隔开
     */
    private void testIntervalOperator() {
        Observable
                .intervalRange(1, 20, 3, 1, TimeUnit.SECONDS)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Observer<Long>() {
                    @Override
                    public void onSubscribe(Disposable d) {
                        Log.i(TAG, "onSubscribe: ");
                        disList.add(d);
                    }

                    @Override
                    public void onNext(Long value) {
                        Log.i(TAG, "onNext: " + value);
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {
                        Log.i(TAG, "onComplete: ");
                    }
                });
    }

    /**
     * Range 操作符
     */
    private void testRangeOperator() {
        //        Observable
        //                .range(1, 20)
        //                .filter(integer -> integer % 2 == 0)
        //                .doOnNext(integer -> Log.i(TAG, "testRangeOperator: " + integer))
        //                .subscribe();

        // 60s 倒计时的实现
        Observable
                .intervalRange(1, 60, 0, 1000, TimeUnit.MILLISECONDS)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .doOnNext(i -> {
                    Log.i(TAG, "testRangeOperator: " + i);
                    btnRange.setText(String.valueOf(60 - i));
                })
                .doOnComplete(() -> {
                    btnRange.setText("Complete");
                })
                .subscribe();
    }

    /**
     * Just 操作符
     */
    private void testJustOperator() {
        Observable
                .just(1, 3, 5)
                .doOnNext(integer -> Log.i(TAG, "testJustOperator: " + integer))
                .doOnComplete(() -> Log.i(TAG, "testJustOperator: "))
                .subscribe();
    }

    /**
     * From 操作符
     */
    private void testFromOperator() {
        List<Integer> list = Arrays.asList(1, 3, 5);

        Observable
                .fromIterable(list)
                .subscribeOn(Schedulers.computation())
                .observeOn(Schedulers.io())
                .subscribe(new Observer<Integer>() {

                    @Override
                    public void onSubscribe(Disposable d) {
                        for (int i = 0; i < 10; i++) {
                            Log.i(TAG, "onSubscribe: " + i);
                            SystemClock.sleep(2000);
                        }
                        //                        d.dispose();
                    }

                    @Override
                    public void onNext(Integer value) {
                        Log.i(TAG, "onNext: " + value);
                    }

                    @Override
                    public void onError(Throwable e) {
                        Log.i(TAG, "onError: ");
                    }

                    @Override
                    public void onComplete() {
                        Log.i(TAG, "onComplete: ");
                    }
                });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        // 注意,当 Activivty 销毁时,RxJava 未处理的事件依然会接着处理,所以,要通过 Dispose 关闭所有事件的接收
        disList.clear();
    }
}


text:
<!--
Ext.define simple example.

Notes:
- You can pass a package name to Ext.define and it will put your object
in the right package.
- 'instanceof' works correctly.
- Even if you define a class that is package MyPkg the file in which you define
it does not matter (this file is not called Person or whatever). This is true
unless you want dynamic loading to work.

TODO:
What happens if you drop the package name?

	Mark Veltzer <mark.veltzer@gmail.com>
-->
<html>
	<head>
		<title>Ext.define simple example</title>
		<link rel='stylesheet' href='../../../toolkits/extjs/resources/css/ext-all.css'/>
		<script src='../../../toolkits/extjs/ext-all.js'></script>
		<script>
			Ext.onReady(function() {
				Ext.define('MyPkg.Person', {
					// A property
					name: 'Unknown',
					// A method
					eat: function(foodType) {
						console.log(this.name+' is eating a '+foodType);
					}
				});
				// lets create an instance
				var aaron=new MyPkg.Person();
				// lets set an attribute
				aaron.name='aaron';
				// lets call a method
				aaron.eat('Sandwich');
				// lets see if instanceof works as advertised
				console.log(aaron instanceof MyPkg.Person);
				console.log(aaron instanceof Ext.Base);
				console.log(aaron instanceof Object);
				// lets see the internals...
				console.log(aaron);
				console.log(MyPkg.Person);
			});
		</script>
	</head>
	<body>
	</body>
</html>


text:
using System;
using System.IO;

namespace Problem
{
    internal class Inputs
    {
        internal static void SetInput(string testNum)
        {
            var ar = new StreamReader(File.Open($@"..\..\tests\test.{testNum}.out.txt", FileMode.Open));
            Console.WriteLine($"Expected: {ar.ReadLine()}");

            var tr = new StreamReader(File.Open($@"..\..\tests\test.{testNum}.in.txt", FileMode.Open));
            Console.SetIn(tr);

        }
    }
}


text:
package com.gusev.spring.core;

import com.gusev.spring.core.beans.Client;
import com.gusev.spring.core.beans.Event;
import com.gusev.spring.core.configs.AppConfig;
import com.gusev.spring.core.configs.DBConfig;
import com.gusev.spring.core.configs.LogConfig;
import com.gusev.spring.core.loggers.CacheFileEventLogger;
import com.gusev.spring.core.loggers.CombinedEventLogger;
import com.gusev.spring.core.loggers.EventLogger;
import com.gusev.spring.core.loggers.FileEventLogger;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Collection;
import java.util.UUID;
import java.util.stream.Collectors;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class TestContext {

    @Test
    public void testPropertyPlaceholderSystemOverride() {
        System.setProperty("id", "3");
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
        ctx.register(AppConfig.class);
        ctx.refresh();

        Client client = ctx.getBean(Client.class);
        ctx.close();

        assertEquals("3", client.getId());
    }

    @Test
    public void testFileEventLoggerDefaultValue() throws IOException {
        File file = new File("target/log.txt");
        assertFileEventLogger(file);
    }

    private void assertFileEventLogger(File file) throws IOException {
        System.setProperty("log.file", file.getAbsolutePath());

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(LogConfig.class);
        context.scan(FileEventLogger.class.getPackage().getName());
        context.refresh();

        EventLogger logger = context.getBean("fileEventLogger", FileEventLogger.class);
        Event event = new Event();

        String uid = UUID.randomUUID().toString();

        event.setMsg(uid);
        logger.logEvent(event);

        context.close();

        String str = FileUtils.readFileToString(file, Charset.defaultCharset());
        assertTrue(str.contains(uid));
    }

    @Test
    public void testLoggersNames() {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.register(LogConfig.class, DBConfig.class);
        context.scan(FileEventLogger.class.getPackage().getName());
        context.refresh();

        EventLogger fileLogger = context.getBean("fileEventLogger", FileEventLogger.class);
        EventLogger cacheLogger = context.getBean("cacheFileEventLogger", CacheFileEventLogger.class);
        CombinedEventLogger combinedLogger = context.getBean(CombinedEventLogger.class);

        assertEquals(fileLogger.getName() + " uses cache", cacheLogger.getName());

        Collection<String> combinedNames = combinedLogger.getLoggers().stream()
                .map(v -> v.getName()).collect(Collectors.toList());

        assertEquals("Combined " + combinedNames, combinedLogger.getName());

        context.close();
    }
}


text:
function Material(options, system) {
  this.construct(options, system, 'phong');
}

Material.prototype.types = {
  _intro: function (options) {
    this.include(options, {
      friction: 0.3, restitution: 0.1,
      color: 0x333333, opacity: 1, transparent: false,
      wireframe: false
    });
    if (this.options().wireframe === undefined) {
      this.options().wireframe = this.wireframe = this.globalSettings().wireframe;
    }
    this.options().transparent = !!((this.opacity != undefined) && (this.opacity < 1));
    this.notifyUndefined(['friction', 'restitution']);
  },
  basic: function (options) {
    this.include(options, {
    });
    Material.prototype.types._intro.call(this, options);
    if (this.runsRender()) this.three = new THREE.MeshBasicMaterial(this.options());
  },
  phong: function (options) {
    this.include(options, {
      emissive: 0x000000, specular: 0x555555
    });
    Material.prototype.types._intro.call(this, options);
    if (this.runsRender()) this.three = new THREE.MeshPhongMaterial(this.options());
  }
};

Material.prototype.getFriction = function () {
  return this.options().friction;
};

Material.prototype.getRestitution = function () {
  return this.options().restitution;
};

extend(Material, Component);
Component.prototype.maker.material = Material;
Component.prototype.defaultType.material = 'phong';


text:
package org.javersion.json.web;

import static java.util.Arrays.asList;
import static org.javersion.json.web.JsonStoreConfig.UnreferencedUpdateStrategy.BRANCH_HEADS;
import static org.javersion.json.web.JsonStoreConfig.UnreferencedUpdateStrategy.TOP;

import java.util.List;

import org.javersion.core.Revision;
import org.javersion.core.VersionGraph;
import org.javersion.core.VersionNode;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;

public class JsonStoreConfig {

    public List<UnreferencedUpdateStrategy> unreferencedUpdateStrategy = ImmutableList.of(
            BRANCH_HEADS,
            TOP
    );

    public static enum UnreferencedUpdateStrategy {
        TIP {
            @Override
            Iterable<Revision> getParents(VersionGraph<?, ?, ?, ?, ?> versionGraph, String branch) {
                VersionNode<?, ?, ?> tip = versionGraph.getTip();
                if (tip == null) {
                    return null;
                }
                return asList(tip.getRevision());
            }
        },
        BRANCH_HEAD {
            @Override
            Iterable<Revision> getParents(VersionGraph<?, ?, ?, ?, ?> versionGraph, String branch) {
                VersionNode<?, ?, ?> branchHead = versionGraph.getHead(branch);
                if (branchHead != null) {
                    return asList(branchHead.getRevision());
                } else {
                    return null;
                }
            }
        },
        BRANCH_HEADS {
            @Override
            Iterable<Revision> getParents(VersionGraph<?, ?, ?, ?, ?> versionGraph, String branch) {
                Iterable<? extends VersionNode<?, ?, ?>> heads = versionGraph.getHeads(branch);
                if (heads.iterator().hasNext()) {
                    return Iterables.transform(heads, n -> n.getRevision());
                } else {
                    return null;
                }
            }
        },
        TOP {
            @Override
            Iterable<Revision> getParents(VersionGraph<?, ?, ?, ?, ?> versionGraph, String branch) {
                return asList();
            }
        };
        abstract Iterable<Revision> getParents(VersionGraph<?, ?, ?, ?, ?> versionGraph, String branch);
    }
}


text:
"use strict";

/**
 * The kermit service manager.
 * It is responsible for holding the service registry and giving shared access to the service instances.
 */
class ServiceManager {
    /**
     * The map of key => service.
     *
     * @property services {Object}
     */

    /**
     * The strict mode flag of the service manager.
     * If set to true, the service manager will throw errors.
     *
     * @property {boolean} strictMode
     */

    /**
     * The config key for setting the strict mode of the service manager from application/configuration context.
     *
     * @returns {string}
     */
    static get STRICT_MODE_CONFIG_KEY() {
        return 'service-manager.strictMode';
    }

    /**
     * Initialize services map.
     *
     * @constructor
     */
    constructor() {
        this.services = {};
        this.strictMode = false;
    }

    /**
     * Retrieves the strict mode flag of the service manager.
     *
     * @returns {boolean}
     */
    getStrictMode() {
        return this.strictMode;
    }

    /**
     * Sets the strict mode flag of the service manager.
     *
     * @param {boolean} strictMode
     * @returns {ServiceManager}
     */
    setStrictMode(strictMode) {
        this.strictMode = strictMode;

        return this;
    }

    /**
     * Lookup and return a service by its key.
     *
     * @param   {String} key
     * @param   {Boolean} strict (optional) default false
     * @throws  {Error} if strict mode is enabled and there is no such service.
     * @return  {Object}|{undefined}
     */
    get(key, strict) {
        if (((this.strictMode === true && strict !== false) || strict === true) && !this.has(key)) {
            throw new Error(`Cannot return unknown service for key: ${key} in strict mode.`);
        }

        return this.services[key];
    }

    /**
     * Store a service for the given key.
     *
     * @param   {String} key
     * @param   {Object} service
     * @param   {Boolean} strict (optional) default false
     * @throws  {Error} if strict mode is enabled and a service for the given key already exists.
     * @return  {ServiceManager}
     */
    set(key, service, strict) {
        if (((this.strictMode === true && strict !== false) || strict === true) && this.has(key)) {
            throw new Error(`Cannot re-register service for key: ${key} in strict mode.`);
        }

        this.services[key] = service;

        return this;
    }

    /**
     * Delete the service for the given key.
     *
     * @param   {String} key
     * @param   {Boolean} strict (optional) default false
     * @return  {ServiceManager}
     */
    remove(key, strict) {
        if (((this.strictMode === true && strict !== false) || strict === true) && !this.has(key)) {
            throw new Error(`Cannot remove unknown service for key: ${key} in strict mode.`);
        }

        delete this.services[key];

        return this;
    }

    /**
     * Check for the existence of a service by its key.
     *
     * @param   {String} key
     * @return  {Boolean}
     */
    has(key) {
        return (key in this.services);
    }
}

module.exports = ServiceManager;


text:
python3 ../../../DiligentCore/BuildTools/FormatValidation/clang-format-validate.py \
--clang-format-executable ../../../DiligentCore/BuildTools/FormatValidation/clang-format_mac_10.0.0 \
-r ../../AssetLoader ../../Imgui ../../NativeApp/include  ../../NativeApp/src ../../TextureLoader ../../Tests \
../../RenderStateNotation ../../RenderStatePackager \
--exclude ../../Imgui/interface/ImGuiImplMacOS.h \
--exclude ../../Imgui/interface/ImGuiImplIOS.h \
--exclude ../../NativeApp/src/UWP \
--exclude ../../NativeApp/include/UWP


text:
package com.hardik.hirapara;

/**
 * Box Class
 *
 * @author HARDIK HIRAPARA
 *
 */
public class Box {

	public double width;
	public double height;
	public double depth;

	@Override
	public String toString() {
		return "Box [width=" + this.width + ", height=" + this.height + ", depth=" + this.depth + "]";
	}
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using KabMan.Data;

namespace KabMan.Forms.Logs
{
    public partial class Logs : DevExpress.XtraEditors.XtraForm
    {
        public Logs()
        {
            InitializeComponent();
        }

        private void Logs_Load(object sender, EventArgs e)
        {
            logsGrid.DataSource = DBAssistant.ExecProcedure(sproc.Log_SelectAll).Tables[0];

            itemResultCount.Caption = logsView.RowCount.ToString();
        }

        private void searchThisText_EditValueChanged(object sender, EventArgs e)
        {
            logsGrid.DataSource = DBAssistant.ExecProcedure(sproc.Log_SelectAll, new object[] { "@Query", searchThisText.EditValue }).Tables[0];

            itemResultCount.Caption = logsView.RowCount.ToString();
        }

        private void clearAllLogsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DBAssistant.ExecProcedure(sproc.Log_DeleteAll);

            logsGrid.DataSource = DBAssistant.ExecProcedure(sproc.Log_SelectAll).Tables[0];
            this.logsGrid.RefreshDataSource();

            itemResultCount.Caption = logsView.RowCount.ToString();
        }
    }
}


text:
import numpy as np
from numpy.testing import assert_allclose
import pytest
import scipy.sparse as sp

from sklearn.datasets import make_regression
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import create_memmap_backed_data

from sklearn.utils._testing import ignore_warnings
from sklearn.exceptions import ConvergenceWarning

from sklearn.linear_model import Lasso, ElasticNet, LassoCV, ElasticNetCV

def test_sparse_coef():
    # Check that the sparse_coef property works
    clf = ElasticNet()
    clf.coef_ = [1, 2, 3]

    assert sp.isspmatrix(clf.sparse_coef_)
    assert clf.sparse_coef_.toarray().tolist()[0] == clf.coef_

def test_lasso_zero():
    # Check that the sparse lasso can handle zero data without crashing
    X = sp.csc_matrix((3, 1))
    y = [0, 0, 0]
    T = np.array([[1], [2], [3]])
    clf = Lasso().fit(X, y)
    pred = clf.predict(T)
    assert_array_almost_equal(clf.coef_, [0])
    assert_array_almost_equal(pred, [0, 0, 0])
    assert_almost_equal(clf.dual_gap_, 0)

@pytest.mark.parametrize("with_sample_weight", [True, False])
def test_enet_toy_list_input(with_sample_weight):
    # Test ElasticNet for various values of alpha and l1_ratio with list X

    X = np.array([[-1], [0], [1]])
    X = sp.csc_matrix(X)
    Y = [-1, 0, 1]  # just a straight line
    T = np.array([[2], [3], [4]])  # test sample
    if with_sample_weight:
        sw = np.array([2.0, 2, 2])
    else:
        sw = None

    # this should be the same as unregularized least squares
    clf = ElasticNet(alpha=0, l1_ratio=1.0)
    # catch warning about alpha=0.
    # this is discouraged but should work.
    ignore_warnings(clf.fit)(X, Y, sample_weight=sw)
    pred = clf.predict(T)
    assert_array_almost_equal(clf.coef_, [1])
    assert_array_almost_equal(pred, [2, 3, 4])
    assert_almost_equal(clf.dual_gap_, 0)

    clf = ElasticNet(alpha=0.5, l1_ratio=0.3)
    clf.fit(X, Y, sample_weight=sw)
    pred = clf.predict(T)
    assert_array_almost_equal(clf.coef_, [0.50819], decimal=3)
    assert_array_almost_equal(pred, [1.0163, 1.5245, 2.0327], decimal=3)
    assert_almost_equal(clf.dual_gap_, 0)

    clf = ElasticNet(alpha=0.5, l1_ratio=0.5)
    clf.fit(X, Y, sample_weight=sw)
    pred = clf.predict(T)
    assert_array_almost_equal(clf.coef_, [0.45454], 3)
    assert_array_almost_equal(pred, [0.9090, 1.3636, 1.8181], 3)
    assert_almost_equal(clf.dual_gap_, 0)

def test_enet_toy_explicit_sparse_input():
    # Test ElasticNet for various values of alpha and l1_ratio with sparse X
    f = ignore_warnings
    # training samples
    X = sp.lil_matrix((3, 1))
    X[0, 0] = -1
    # X[1, 0] = 0
    X[2, 0] = 1
    Y = [-1, 0, 1]  # just a straight line (the identity function)

    # test samples
    T = sp.lil_matrix((3, 1))
    T[0, 0] = 2
    T[1, 0] = 3
    T[2, 0] = 4

    # this should be the same as lasso
    clf = ElasticNet(alpha=0, l1_ratio=1.0)
    f(clf.fit)(X, Y)
    pred = clf.predict(T)
    assert_array_almost_equal(clf.coef_, [1])
    assert_array_almost_equal(pred, [2, 3, 4])
    assert_almost_equal(clf.dual_gap_, 0)

    clf = ElasticNet(alpha=0.5, l1_ratio=0.3)
    clf.fit(X, Y)
    pred = clf.predict(T)
    assert_array_almost_equal(clf.coef_, [0.50819], decimal=3)
    assert_array_almost_equal(pred, [1.0163, 1.5245, 2.0327], decimal=3)
    assert_almost_equal(clf.dual_gap_, 0)

    clf = ElasticNet(alpha=0.5, l1_ratio=0.5)
    clf.fit(X, Y)
    pred = clf.predict(T)
    assert_array_almost_equal(clf.coef_, [0.45454], 3)
    assert_array_almost_equal(pred, [0.9090, 1.3636, 1.8181], 3)
    assert_almost_equal(clf.dual_gap_, 0)

def make_sparse_data(
    n_samples=100,
    n_features=100,
    n_informative=10,
    seed=42,
    positive=False,
    n_targets=1,
):
    random_state = np.random.RandomState(seed)

    # build an ill-posed linear regression problem with many noisy features and
    # comparatively few samples

    # generate a ground truth model
    w = random_state.randn(n_features, n_targets)
    w[n_informative:] = 0.0  # only the top features are impacting the model
    if positive:
        w = np.abs(w)

    X = random_state.randn(n_samples, n_features)
    rnd = random_state.uniform(size=(n_samples, n_features))
    X[rnd > 0.5] = 0.0  # 50% of zeros in input signal

    # generate training ground truth labels
    y = np.dot(X, w)
    X = sp.csc_matrix(X)
    if n_targets == 1:
        y = np.ravel(y)
    return X, y

def _test_sparse_enet_not_as_toy_dataset(alpha, fit_intercept, positive):
    n_samples, n_features, max_iter = 100, 100, 1000
    n_informative = 10

    X, y = make_sparse_data(n_samples, n_features, n_informative, positive=positive)

    X_train, X_test = X[n_samples // 2 :], X[: n_samples // 2]
    y_train, y_test = y[n_samples // 2 :], y[: n_samples // 2]

    s_clf = ElasticNet(
        alpha=alpha,
        l1_ratio=0.8,
        fit_intercept=fit_intercept,
        max_iter=max_iter,
        tol=1e-7,
        positive=positive,
        warm_start=True,
    )
    s_clf.fit(X_train, y_train)

    assert_almost_equal(s_clf.dual_gap_, 0, 4)
    assert s_clf.score(X_test, y_test) > 0.85

    # check the convergence is the same as the dense version
    d_clf = ElasticNet(
        alpha=alpha,
        l1_ratio=0.8,
        fit_intercept=fit_intercept,
        max_iter=max_iter,
        tol=1e-7,
        positive=positive,
        warm_start=True,
    )
    d_clf.fit(X_train.toarray(), y_train)

    assert_almost_equal(d_clf.dual_gap_, 0, 4)
    assert d_clf.score(X_test, y_test) > 0.85

    assert_almost_equal(s_clf.coef_, d_clf.coef_, 5)
    assert_almost_equal(s_clf.intercept_, d_clf.intercept_, 5)

    # check that the coefs are sparse
    assert np.sum(s_clf.coef_ != 0.0) < 2 * n_informative

def test_sparse_enet_not_as_toy_dataset():
    _test_sparse_enet_not_as_toy_dataset(alpha=0.1, fit_intercept=False, positive=False)
    _test_sparse_enet_not_as_toy_dataset(alpha=0.1, fit_intercept=True, positive=False)
    _test_sparse_enet_not_as_toy_dataset(alpha=1e-3, fit_intercept=False, positive=True)
    _test_sparse_enet_not_as_toy_dataset(alpha=1e-3, fit_intercept=True, positive=True)

def test_sparse_lasso_not_as_toy_dataset():
    n_samples = 100
    max_iter = 1000
    n_informative = 10
    X, y = make_sparse_data(n_samples=n_samples, n_informative=n_informative)

    X_train, X_test = X[n_samples // 2 :], X[: n_samples // 2]
    y_train, y_test = y[n_samples // 2 :], y[: n_samples // 2]

    s_clf = Lasso(alpha=0.1, fit_intercept=False, max_iter=max_iter, tol=1e-7)
    s_clf.fit(X_train, y_train)
    assert_almost_equal(s_clf.dual_gap_, 0, 4)
    assert s_clf.score(X_test, y_test) > 0.85

    # check the convergence is the same as the dense version
    d_clf = Lasso(alpha=0.1, fit_intercept=False, max_iter=max_iter, tol=1e-7)
    d_clf.fit(X_train.toarray(), y_train)
    assert_almost_equal(d_clf.dual_gap_, 0, 4)
    assert d_clf.score(X_test, y_test) > 0.85

    # check that the coefs are sparse
    assert np.sum(s_clf.coef_ != 0.0) == n_informative

def test_enet_multitarget():
    n_targets = 3
    X, y = make_sparse_data(n_targets=n_targets)

    estimator = ElasticNet(alpha=0.01, precompute=False)
    # XXX: There is a bug when precompute is not False!
    estimator.fit(X, y)
    coef, intercept, dual_gap = (
        estimator.coef_,
        estimator.intercept_,
        estimator.dual_gap_,
    )

    for k in range(n_targets):
        estimator.fit(X, y[:, k])
        assert_array_almost_equal(coef[k, :], estimator.coef_)
        assert_array_almost_equal(intercept[k], estimator.intercept_)
        assert_array_almost_equal(dual_gap[k], estimator.dual_gap_)

def test_path_parameters():
    X, y = make_sparse_data()
    max_iter = 50
    n_alphas = 10
    clf = ElasticNetCV(
        n_alphas=n_alphas,
        eps=1e-3,
        max_iter=max_iter,
        l1_ratio=0.5,
        fit_intercept=False,
    )
    ignore_warnings(clf.fit)(X, y)  # new params
    assert_almost_equal(0.5, clf.l1_ratio)
    assert n_alphas == clf.n_alphas
    assert n_alphas == len(clf.alphas_)
    sparse_mse_path = clf.mse_path_
    ignore_warnings(clf.fit)(X.toarray(), y)  # compare with dense data
    assert_almost_equal(clf.mse_path_, sparse_mse_path)

@pytest.mark.parametrize("Model", [Lasso, ElasticNet, LassoCV, ElasticNetCV])
@pytest.mark.parametrize("fit_intercept", [False, True])
@pytest.mark.parametrize("n_samples, n_features", [(24, 6), (6, 24)])
@pytest.mark.parametrize("with_sample_weight", [True, False])
def test_sparse_dense_equality(
    Model, fit_intercept, n_samples, n_features, with_sample_weight
):
    X, y = make_regression(
        n_samples=n_samples,
        n_features=n_features,
        effective_rank=n_features // 2,
        n_informative=n_features // 2,
        bias=4 * fit_intercept,
        noise=1,
        random_state=42,
    )
    if with_sample_weight:
        sw = np.abs(np.random.RandomState(42).normal(scale=10, size=y.shape))
    else:
        sw = None
    Xs = sp.csc_matrix(X)
    params = {"fit_intercept": fit_intercept}
    reg_dense = Model(**params).fit(X, y, sample_weight=sw)
    reg_sparse = Model(**params).fit(Xs, y, sample_weight=sw)
    if fit_intercept:
        assert reg_sparse.intercept_ == pytest.approx(reg_dense.intercept_)
        # balance property
        assert np.average(reg_sparse.predict(X), weights=sw) == pytest.approx(
            np.average(y, weights=sw)
        )
    assert_allclose(reg_sparse.coef_, reg_dense.coef_)

def test_same_output_sparse_dense_lasso_and_enet_cv():
    X, y = make_sparse_data(n_samples=40, n_features=10)
    clfs = ElasticNetCV(max_iter=100)
    clfs.fit(X, y)
    clfd = ElasticNetCV(max_iter=100)
    clfd.fit(X.toarray(), y)
    assert_almost_equal(clfs.alpha_, clfd.alpha_, 7)
    assert_almost_equal(clfs.intercept_, clfd.intercept_, 7)
    assert_array_almost_equal(clfs.mse_path_, clfd.mse_path_)
    assert_array_almost_equal(clfs.alphas_, clfd.alphas_)

    clfs = LassoCV(max_iter=100, cv=4)
    clfs.fit(X, y)
    clfd = LassoCV(max_iter=100, cv=4)
    clfd.fit(X.toarray(), y)
    assert_almost_equal(clfs.alpha_, clfd.alpha_, 7)
    assert_almost_equal(clfs.intercept_, clfd.intercept_, 7)
    assert_array_almost_equal(clfs.mse_path_, clfd.mse_path_)
    assert_array_almost_equal(clfs.alphas_, clfd.alphas_)

def test_same_multiple_output_sparse_dense():
    l = ElasticNet()
    X = [
        [0, 1, 2, 3, 4],
        [0, 2, 5, 8, 11],
        [9, 10, 11, 12, 13],
        [10, 11, 12, 13, 14],
    ]
    y = [
        [1, 2, 3, 4, 5],
        [1, 3, 6, 9, 12],
        [10, 11, 12, 13, 14],
        [11, 12, 13, 14, 15],
    ]
    l.fit(X, y)
    sample = np.array([1, 2, 3, 4, 5]).reshape(1, -1)
    predict_dense = l.predict(sample)

    l_sp = ElasticNet()
    X_sp = sp.coo_matrix(X)
    l_sp.fit(X_sp, y)
    sample_sparse = sp.coo_matrix(sample)
    predict_sparse = l_sp.predict(sample_sparse)

    assert_array_almost_equal(predict_sparse, predict_dense)

def test_sparse_enet_coordinate_descent():
    """Test that a warning is issued if model does not converge"""
    clf = Lasso(max_iter=2)
    n_samples = 5
    n_features = 2
    X = sp.csc_matrix((n_samples, n_features)) * 1e50
    y = np.ones(n_samples)
    warning_message = (
        "Objective did not converge. You might want "
        "to increase the number of iterations."
    )
    with pytest.warns(ConvergenceWarning, match=warning_message):
        clf.fit(X, y)

@pytest.mark.parametrize("copy_X", (True, False))
def test_sparse_read_only_buffer(copy_X):
    """Test that sparse coordinate descent works for read-only buffers"""
    rng = np.random.RandomState(0)

    clf = ElasticNet(alpha=0.1, copy_X=copy_X, random_state=rng)
    X = sp.random(100, 20, format="csc", random_state=rng)

    # Make X.data read-only
    X.data = create_memmap_backed_data(X.data)

    y = rng.rand(100)
    clf.fit(X, y)


text:
"use strict";
const assert = require("power-assert");
const addDelay = require("../src/promise-resolve-use").addDelay;
describe("addDelay", () => {
    context("when passing non promise object", () => {
        it("should return promise object", (done) => {
            const result = addDelay(1).catch(done);
            assert(result instanceof Promise);
            done();
        });
        it("could handling promitive value", () => {
            return shouldFulfilled(addDelay("value", 1)).then((value) => {
                assert(value === "value");
            });
        });
        it("could handling function as value", () => {
            const fn = function() {
                return "result";
            };
            return shouldFulfilled(addDelay(fn, 1)).then((value) => {
                assert(value === fn);
                assert(fn() === "result");
            });
        });
    });
    context("when passing promise object", () => {
        it("should add delay for promise's resolve", () => {
            const expectedValue = "解決";
            const promise = Promise.resolve(expectedValue);
            return shouldFulfilled(addDelay(promise, 1)).then((value) => {
                assert(value === expectedValue);
            });
        });
    });
});


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
    NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
    NSLog(@"apps: %@", [workspace performSelector:@selector(allApplications)]);
    id result = [workspace performSelector:@selector(allApplications)];
    if ([result isKindOfClass:[NSArray class]]) {
        NSLog(@"是一个数组%@",result[0]);

    }

    NSLog(@"name:%@",[PINCache sharedCache].name);

    NSLog(@"disByteCount:%lu",(unsigned long)[PINCache sharedCache].diskByteCount);

    NSLog(@"name:%@",[PINCache sharedCache].diskCache);

    NSLog(@"name:%@",[PINCache sharedCache].memoryCache);

    //
    [[PINCache sharedCache] setObject:@"这是一个写入PINCache的内容" forKey:@"mykey"];
    [[PINDiskCache sharedCache] setObject:@"这是一个写入PINDiskCache的内容" forKey:@"mykey"];
    [[PINMemoryCache sharedCache] setObject:@"这是一个写入PINMemoryCache的内容" forKey:@"mykey"];

    NSLog(@"value:%@",[[PINCache sharedCache] objectForKey:@"mykey"]);
    NSLog(@"PINDiskCache-value:%@",[[PINDiskCache sharedCache] objectForKey:@"mykey"]);
    NSLog(@"PINMemoryCache-value:%@",[[PINMemoryCache sharedCache] objectForKey:@"mykey"]);

    [[PINCache sharedCache] objectForKey:@"---"  block:^(PINCache *cache, NSString *key, id object) {
        if (object) {

            NSLog(@"有缓存,在这里做业务逻辑处理");
            return;
        }
        //没有缓存,那么去服务器加载数据,存入缓存,做业务逻辑处理
        NSLog(@"cache miss, requesting %@", @"---");
        [[PINCache sharedCache] setObject:@"呵呵" forKey:@"---"];
    }];

   impl1 *impl= [[impl1 alloc] init];

    [statisticalManager sharedManager].manager = impl;
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"value1",@"key1",@"value2",@"key2", nil];
    [[statisticalManager sharedManager] clickBtn:@"heh" params:dic];

    UIButton *buttn = [UIButton buttonWithType:UIButtonTypeCustom];
    buttn.frame = CGRectMake(50, 100, 100, 30);
    buttn.backgroundColor = [UIColor greenColor];
    [self.view addSubview:buttn];
    [buttn addTarget:self action:@selector(openAppShenBa) forControlEvents:UIControlEventTouchUpInside];

//    [self openAppShenBa];
    self.view.backgroundColor = [UIColor yellowColor];

}

//启动另外一样应用
-(void)openAppShenBa{
    NSURL * myURL_APP_A = [NSURL URLWithString:@"myTestOpen://"];
    if ([[UIApplication sharedApplication] canOpenURL:myURL_APP_A]) {
        NSLog(@"canOpenURL");
       [[UIApplication sharedApplication] openURL:myURL_APP_A];
    }
}

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

@end


text:
from firenado.management import run_from_command_line

if __name__ == "__main__":
    run_from_command_line()


text:
..  Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

..    http://www.apache.org/licenses/LICENSE-2.0

..  Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

==========
User Guide
==========

There are basic guides shared with other languages in Programming Guides
at `the Spark documentation <https://spark.apache.org/docs/latest/index.html#where-to-go-from-here>`_ as below:

- `RDD Programming Guide <https://spark.apache.org/docs/latest/rdd-programming-guide.html>`_
- `Spark SQL, DataFrames and Datasets Guide <https://spark.apache.org/docs/latest/sql-programming-guide.html>`_
- `Structured Streaming Programming Guide <https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html>`_
- `Spark Streaming Programming Guide <https://spark.apache.org/docs/latest/streaming-programming-guide.html>`_
- `Machine Learning Library (MLlib) Guide <https://spark.apache.org/docs/latest/ml-guide.html>`_

PySpark specific user guide is as follows:

.. toctree::
    :maxdepth: 2

    python_packaging
    arrow_pandas


text:
<?php

namespace SofaChamps\Bundle\BowlPickemBundle\Event;

final class GameEvents
{
    const GAME_COMPLETE = 'game.complete';
    const GAME_UPDATED = 'game.update';
}


text: <!DOCTYPE html><style> EOF


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

    <item
        android:id="@+id/add_stop"
        app:showAsAction="ifRoom"
        android:title="@string/add_stop" />
    <item
        android:id="@+id/refresh"
        app:showAsAction="ifRoom"
        android:title="@string/refresh"/>

</menu>


text:
Issue reports and pull requests will not be attended.
There are volunteers who are now maintaining OpenNI such as listed below, so please work with them.

* Occipital: http://structure.io/openni [[Fork on Github](https://github.com/occipital/openni2)]


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

/* load the modules library */
require_once 'Modules.php';

/**
 * Modular Extensions - PHP5
 *
 * Adapted from the CodeIgniter Core Classes
 * @copyright	Copyright (c) 2006, EllisLab, Inc.
 * @link		http://codeigniter.com
 *
 * Description:
 * This library replaces the CodeIgniter Controller class
 * and adds features allowing use of the HMVC design pattern.
 *
 * Install this file as application/libraries/Controller.php
 *
 * @copyright 	Copyright (c) Wiredesignz 2008-11-20
 * @version		5.1.40
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 **/
class Controller extends CI_Base
{
	/** Constructor **/
	public function __construct()
	{
		/* set this controller name */
		$class = strtolower(get_class($this));

		/* create a new loader */
		$this->load = (class_exists('MX_Loader')) ? new MX_Loader($class) : new Loader($class);

		log_message('debug', ucfirst($class)." Controller Initialized");

		/* assign core libraries */
		$this->_assign_libraries();

		/* register this controller */
		modules::$registry[$class] = $this;

		/* autoload module items */
		$this->load->autoload();

		/* activate output profiler from config */
		if ($this->config->item('enable_profiler')) $this->output->enable_profiler();
	}

	/** PHP compatibility **/
	public function Controller()
	{
		self::__construct();
	}

	/** Return protected $autoload array **/
	public function autoload()
	{
		return (isset($this->autoload)) ? $this->autoload : FALSE;
	}

	/** Assign core libraries **/
	private function _assign_libraries()
	{
		if ($core = end(modules::$registry))
		{
			foreach (get_object_vars($core) as $key => $object)
	        {
				if (is_object($object) AND ! isset($this->$key))
					$this->$key = $object;
	        }
        }
		else /* executes only for the first controller */
		{
			/* the CI core classes */
			$classes = array(
				'config'	=> 'Config',
				'input'		=> 'Input',
				'benchmark'	=> 'Benchmark',
				'uri'		=> 'URI',
				'output'	=> 'Output',
				'lang'		=> 'Language',
				'router'	=> 'Router',
			);

			/* assign the classes */
			foreach ($classes as $key => $class)
			{
				$this->$key = load_class($class);
			}

			/* initialize CI_Base */
            parent::__construct();
//			CI_Base::__construct();
		}
	}
}

class Loader
{
	public $_ci_classes;
	protected $_class, $_module;
	protected static $models, $autoload, $loader;

	public function __construct($class)
	{
		/* the class name */
		$this->_class = $class;

		/* the module name */
		$this->_module = modules::path();

		/* the CI_Loader is a singleton */
		(isset(self::$loader)) OR self::$loader = load_class('Loader');

		/* get a reference to CI_Loader classes */
		$this->_ci_classes =& self::$loader->_ci_classes;
	}

	/** Load a module config file **/
	public function config($file = '', $use_sections = FALSE)
	{
		$ci = modules::$registry[$this->_class];

		($file == '') AND $file = 'config';

		if (in_array($file, $ci->config->is_loaded, TRUE))
			return $ci->config->item($file);

		list($path, $file) = modules::find($file, $this->_module, 'config/');

		if ($path === FALSE)
		{
			self::$loader->config($file, TRUE);
			return $ci->config->item($file);
		}

		if ($config = modules::load_file($file, $path, 'config'))
		{
			/* reference to the config object */
			$current_config =& $ci->config->config;

			if ($use_sections === TRUE)
			{
				if (isset($current_config[$file]))
				{
					$current_config[$file] = array_merge($current_config[$file], $config);
				}
				else
				{
					$current_config[$file] = $config;
				}
			}
			else
			{
				$current_config = array_merge($current_config, $config);
			}

			$ci->config->is_loaded[] = $file;
			unset($config);

			return $ci->config->item($file);
		}
	}

	/** Load the database drivers **/
	public function database($params = '', $return = FALSE, $active_record = FALSE)
	{
        $CI =& get_instance();

		if (class_exists('CI_DB', FALSE) AND $return == FALSE AND $active_record == FALSE)
			return;

		require_once BASEPATH.'database/DB'.EXT;

		if ($return === TRUE)
			return DB($params, $active_record);

		$ci = modules::$registry[$this->_class];

		$ci->db = $CI->db = DB($params, $active_record);
		$this->_ci_assign_to_models();

		return $ci->db;
	}

	/** Load dbforge **/
	public function dbforge()
	{
		$ci = modules::$registry[$this->_class];

		self::$loader->dbforge();
		$ci->dbforge = get_instance()->dbforge;

		return $ci->dbforge;
	}

	/** Load dbutil **/
	public function dbutil()
	{
		$ci = modules::$registry[$this->_class];

		self::$loader->dbutil();
		$ci->dbutil = get_instance()->dbutil;
		$ci->dbforge = get_instance()->dbforge;

		return $ci->dbutil;
	}

	/** Load files **/
	public function file($path, $return = FALSE)
	{
		return self::$loader->file($path, $return);
	}

	/** Load a module helper **/
	public function helper($helper)
	{
		if (is_array($helper))
			return self::helpers($helper);

		if (isset(self::$loader->_ci_helpers[$helper]))
			return;

		list($path, $_helper) = modules::find($helper.'_helper', $this->_module, 'helpers/');

		if ($path === FALSE)
			return self::$loader->helper($helper);

		modules::load_file($_helper, $path);
		self::$loader->_ci_helpers[$_helper] = TRUE;
	}

	/** Load an array of helpers **/
	public function helpers($helpers)
	{
		foreach ($helpers as $_helper) self::helper($_helper);
	}

	/** Load a module language file **/
	public function language($langfile, $lang = '')
	{
		$ci = modules::$registry[$this->_class];

		$deft_lang = $ci->config->item('language');
		$idiom = ($lang == '') ? $deft_lang : $lang;

		if (in_array($langfile.'_lang'.EXT, $ci->lang->is_loaded, TRUE))
			return $ci->lang;

		list($path, $_langfile) = modules::find($langfile.'_lang', $this->_module, 'language/', $idiom);

		if ($path === FALSE)
		{
			self::$loader->language($langfile, $lang);
		}
		else
		{
			if($lang = modules::load_file($_langfile, $path, 'lang'))
			{
				$ci->lang->language = array_merge($ci->lang->language, $lang);
				$ci->lang->is_loaded[] = $langfile.'_lang'.EXT;
				unset($lang);
			}
		}

		return $ci->lang;
	}

	/** Load a module library **/
	public function library($library, $params = NULL, $object_name = NULL)
    {
		$ci = modules::$registry[$this->_class];

		$class = strtolower(end(explode('/', $library)));
		/*
		if (isset($this->_ci_classes[$class]) AND $_alias = $this->_ci_classes[$class])
			return $ci->$_alias;
		*/
		if (isset($this->_ci_classes[$class]) AND $_alias = $this->_ci_classes[$class])
		{
			$ci->$_alias = $_alias;
			return $ci->$_alias;
		}

		($_alias = $object_name) OR $_alias = $class;

		list($path, $_library) = modules::find($library, $this->_module, 'libraries/');

		if ($path === FALSE)
        {
			self::$loader->_ci_load_class($library, $params, $object_name);
			$_alias = $this->_ci_classes[$class];
			$ci->$_alias = get_instance()->$_alias;
     	}
		else
		{
			/* load module config file as params */
			if ($params == NULL)
			{
				list($path2, $file) = modules::find($_alias, $this->_module, 'config/');
				($path2) AND $params = modules::load_file($file, $path2, 'config');
			}

			modules::load_file($_library, $path);

			$library = ucfirst($_library);
			$ci->$_alias = new $library($params);
			$this->_ci_classes[$class] = $_alias;
		}

		$ci->$_alias->CI = $ci;
		$this->_ci_assign_to_models();

		return $ci->$_alias;
    }

	/** Load a module model **/
	public function model($model, $object_name = NULL, $connect = FALSE)
	{
		$ci = modules::$registry[$this->_class];

		($_alias = $object_name) OR $_alias = strtolower(end(explode('/', $model)));

		if (isset(self::$models[$_alias]))
			return $ci->$_alias;

		list($path, $model) = modules::find($model, $this->_module, 'models/');

		(class_exists('Model', FALSE)) OR load_class('Model', FALSE);

		if ($connect !== FALSE)
		{
			if ($connect === TRUE) $connect = '';
			$this->database($connect, FALSE, TRUE);
		}

		modules::load_file($model, $path);

		$model = ucfirst($model);
		$ci->$_alias = new $model();
		self::$models[$_alias] = $ci->$_alias;

		$ci->$_alias->_assign_libraries();

		return $ci->$_alias;
	}

	/** Load a module controller **/
	public function module($module)
	{
		if (is_array($module))
			return self::modules($module);

		$ci = modules::$registry[$this->_class];

		/* get the controller name */
		$controller = strtolower(end(explode('/', $module)));

		(isset($ci->$controller)) OR $ci->$controller = modules::load($module);

		return $ci->$controller;
	}

	/** Load an array of controllers **/
	public function modules($modules)
	{
		foreach ($modules as $_module) self::module($_module);
	}

	/** Load a module plugin **/
	public function plugin($plugin)
	{
		if (isset(self::$loader->_ci_plugins[$plugin]))
			return;

		list($path, $_plugin) = modules::find($plugin.'_pi', $this->_module, 'plugins/');

		if ($path === FALSE)
			return self::$loader->plugin($plugin);

		modules::load_file($_plugin, $path);
		self::$loader->_ci_plugins[$plugin] = TRUE;
	}

	/** Load scripts **/
	public function script($scripts = array())
	{
		return self::$loader->script($scripts);
	}

	/** Load variables into output buffer **/
	public function vars($vars = array())
	{
		return self::$loader->vars($vars);
	}

	/** Load a module view **/
	public function view($view, $vars = array(), $return = FALSE)
	{
		list($path, $view) = modules::find($view, $this->_module, 'views/');

		self::$loader->_ci_view_path = $path;

		return self::$loader->_ci_load(array('_ci_view' => $view, '_ci_vars' => self::$loader->_ci_object_to_array($vars), '_ci_return' => $return));
	}

	/** Assign libraries to models **/
	public function _ci_assign_to_models()
	{
		if (is_array(self::$models))
		{
			foreach (self::$models as $model)
			{
				$model->_assign_libraries();
			}
		}
	}

	/** Autload items **/
	public function autoload()
	{
		$ci = modules::$registry[$this->_class];

		/* process application autoload */
		if ( ! isset(self::$autoload) AND self::$autoload = TRUE)
			self::$loader->_ci_autoloader();

		/* controller autoload array */
		($autoload = $ci->autoload()) OR $autoload = array();

		list($path, $file) = modules::find('autoload', $this->_module, 'config/');

		/* module autoload file */
		if ($path != FALSE)
			$autoload = array_merge(modules::load_file($file, $path, 'autoload'), $autoload);

		/* nothing to do? */
		if (count($autoload) == 0) return;

		/* autoload database & libraries */
		if (isset($autoload['libraries']))
		{
			if (in_array('database', $autoload['libraries']))
			{
				/* autoload database */
				if ( ! $db = $ci->config->item('database'))
				{
					$db['params'] = 'default';
					$db['active_record'] = TRUE;
				}

				$ci->db = $this->database($db['params'], TRUE, $db['active_record']);
				$autoload['libraries'] = array_diff($autoload['libraries'], array('database'));
			}

			/* autoload libraries */
			foreach ($autoload['libraries'] as $library)
			{
				$this->library($library);
			}
		}

		/* autoload config */
		if (isset($autoload['config']))
		{
			foreach ($autoload['config'] as $key => $val)
			{
				$this->config($val, TRUE);
			}
		}

		/* autoload helpers, plugins, scripts, languages */
		foreach (array('helper', 'plugin', 'script', 'language') as $type)
		{
			if (isset($autoload[$type]))
			{
				foreach ($autoload[$type] as $item)
				{
					$this->$type($item);
				}
			}
		}

		/* autoload base classes */
		if (isset($autoload['class']))
		{
			foreach ($autoload['class'] as $class)
			{
				modules::autoload($class);
			}
		}

		/* autoload models */
		if (isset($autoload['model']))
		{
			foreach ($autoload['model'] as $model => $alias)
			{
				(is_numeric($model)) ? $this->model($alias) : $this->model($model, $alias);
			}
		}

		/* autoload module controllers */
		if (isset($autoload['modules']) AND ! in_array($this->_class, $autoload['modules']))
		{
			foreach ($autoload['modules'] as $module)
			{
				$this->module($module);
			}
		}
	}
}


text:
namespace boost {
namespace asio {
namespace detail {

template <typename Time_Traits>
class timer_queue
  : public timer_queue_base
{
public:
  // The time type.
  typedef typename Time_Traits::time_type time_type;

  // The duration type.
  typedef typename Time_Traits::duration_type duration_type;

  // Constructor.
  timer_queue()
    : timers_(),
      heap_(),
      cancelled_timers_(0),
      complete_timers_(0)
  {
  }

  // Add a new timer to the queue. Returns true if this is the timer that is
  // earliest in the queue, in which case the reactor's event demultiplexing
  // function call may need to be interrupted and restarted.
  template <typename Handler>
  bool enqueue_timer(const time_type& time, Handler handler, void* token)
  {
    // Ensure that there is space for the timer in the heap. We reserve here so
    // that the push_back below will not throw due to a reallocation failure.
    heap_.reserve(heap_.size() + 1);

    // Create a new timer object.
    typedef timer<Handler> timer_type;
    typedef handler_alloc_traits<Handler, timer_type> alloc_traits;
    raw_handler_ptr<alloc_traits> raw_ptr(handler);
    handler_ptr<alloc_traits> new_timer(raw_ptr, time, handler, token);

    // Insert the new timer into the hash.
    typedef typename hash_map<void*, timer_base*>::iterator iterator;
    typedef typename hash_map<void*, timer_base*>::value_type value_type;
    std::pair<iterator, bool> result =
      timers_.insert(value_type(token, new_timer.get()));
    if (!result.second)
    {
      result.first->second->prev_ = new_timer.get();
      new_timer.get()->next_ = result.first->second;
      result.first->second = new_timer.get();
    }

    // Put the timer at the correct position in the heap.
    new_timer.get()->heap_index_ = heap_.size();
    heap_.push_back(new_timer.get());
    up_heap(heap_.size() - 1);
    bool is_first = (heap_[0] == new_timer.get());

    // Ownership of the timer is transferred to the timer queue.
    new_timer.release();

    return is_first;
  }

  // Whether there are no timers in the queue.
  virtual bool empty() const
  {
    return heap_.empty();
  }

  // Get the time for the timer that is earliest in the queue.
  virtual boost::posix_time::time_duration wait_duration() const
  {
    if (heap_.empty())
      return boost::posix_time::pos_infin;
    return Time_Traits::to_posix_duration(
        Time_Traits::subtract(heap_[0]->time_, Time_Traits::now()));
  }

  // Dispatch the timers that are earlier than the specified time.
  virtual void dispatch_timers()
  {
    const time_type now = Time_Traits::now();
    while (!heap_.empty() && !Time_Traits::less_than(now, heap_[0]->time_))
    {
      timer_base* t = heap_[0];
      remove_timer(t);
      t->result_ = boost::system::error_code();
      t->prev_ = 0;
      t->next_ = complete_timers_;
      complete_timers_ = t;
    }
  }

  // Cancel the timers with the given token. Any timers pending for the token
  // will be notified that they have been cancelled next time
  // dispatch_cancellations is called. Returns the number of timers that were
  // cancelled.
  std::size_t cancel_timer(void* timer_token)
  {
    std::size_t num_cancelled = 0;
    typedef typename hash_map<void*, timer_base*>::iterator iterator;
    iterator it = timers_.find(timer_token);
    if (it != timers_.end())
    {
      timer_base* t = it->second;
      while (t)
      {
        timer_base* next = t->next_;
        remove_timer(t);
        t->prev_ = 0;
        t->next_ = cancelled_timers_;
        cancelled_timers_ = t;
        t = next;
        ++num_cancelled;
      }
    }
    return num_cancelled;
  }

  // Dispatch any pending cancels for timers.
  virtual void dispatch_cancellations()
  {
    while (cancelled_timers_)
    {
      timer_base* this_timer = cancelled_timers_;
      this_timer->result_ = boost::asio::error::operation_aborted;
      cancelled_timers_ = this_timer->next_;
      this_timer->next_ = complete_timers_;
      complete_timers_ = this_timer;
    }
  }

  // Complete any timers that are waiting to be completed.
  virtual void complete_timers()
  {
    while (complete_timers_)
    {
      timer_base* this_timer = complete_timers_;
      complete_timers_ = this_timer->next_;
      this_timer->next_ = 0;
      this_timer->complete();
    }
  }

  // Destroy all timers.
  virtual void destroy_timers()
  {
    typename hash_map<void*, timer_base*>::iterator i = timers_.begin();
    typename hash_map<void*, timer_base*>::iterator end = timers_.end();
    while (i != end)
    {
      timer_base* t = i->second;
      typename hash_map<void*, timer_base*>::iterator old_i = i++;
      timers_.erase(old_i);
      destroy_timer_list(t);
    }
    heap_.clear();
    timers_.clear();
    destroy_timer_list(cancelled_timers_);
    destroy_timer_list(complete_timers_);
  }

private:
  // Base class for timer operations. Function pointers are used instead of
  // virtual functions to avoid the associated overhead.
  class timer_base
  {
  public:
    // Delete the timer and post the handler.
    void complete()
    {
      complete_func_(this, result_);
    }

    // Delete the timer.
    void destroy()
    {
      destroy_func_(this);
    }

  protected:
    typedef void (*complete_func_type)(timer_base*,
        const boost::system::error_code&);
    typedef void (*destroy_func_type)(timer_base*);

    // Constructor.
    timer_base(complete_func_type complete_func, destroy_func_type destroy_func,
        const time_type& time, void* token)
      : complete_func_(complete_func),
        destroy_func_(destroy_func),
        time_(time),
        token_(token),
        next_(0),
        prev_(0),
        heap_index_(
            std::numeric_limits<size_t>::max BOOST_PREVENT_MACRO_SUBSTITUTION())
    {
    }

    // Prevent deletion through this type.
    ~timer_base()
    {
    }

  private:
    friend class timer_queue<Time_Traits>;

    // The function to be called to delete the timer and post the handler.
    complete_func_type complete_func_;

    // The function to be called to delete the timer.
    destroy_func_type destroy_func_;

    // The result of the timer operation.
    boost::system::error_code result_;

    // The time when the timer should fire.
    time_type time_;

    // The token associated with the timer.
    void* token_;

    // The next timer known to the queue.
    timer_base* next_;

    // The previous timer known to the queue.
    timer_base* prev_;

    // The index of the timer in the heap.
    size_t heap_index_;
  };

  // Adaptor class template for using handlers in timers.
  template <typename Handler>
  class timer
    : public timer_base
  {
  public:
    // Constructor.
    timer(const time_type& time, Handler handler, void* token)
      : timer_base(&timer<Handler>::complete_handler,
          &timer<Handler>::destroy_handler, time, token),
        handler_(handler)
    {
    }

    // Delete the timer and post the handler.
    static void complete_handler(timer_base* base,
        const boost::system::error_code& result)
    {
      // Take ownership of the timer object.
      typedef timer<Handler> this_type;
      this_type* this_timer(static_cast<this_type*>(base));
      typedef handler_alloc_traits<Handler, this_type> alloc_traits;
      handler_ptr<alloc_traits> ptr(this_timer->handler_, this_timer);

      // Make a copy of the error_code and the handler so that the memory can
      // be deallocated before the upcall is made.
      boost::system::error_code ec(result);
      Handler handler(this_timer->handler_);

      // Free the memory associated with the handler.
      ptr.reset();

      // Make the upcall.
      handler(ec);
    }

    // Delete the timer.
    static void destroy_handler(timer_base* base)
    {
      // Take ownership of the timer object.
      typedef timer<Handler> this_type;
      this_type* this_timer(static_cast<this_type*>(base));
      typedef handler_alloc_traits<Handler, this_type> alloc_traits;
      handler_ptr<alloc_traits> ptr(this_timer->handler_, this_timer);

      // A sub-object of the handler may be the true owner of the memory
      // associated with the handler. Consequently, a local copy of the handler
      // is required to ensure that any owning sub-object remains valid until
      // after we have deallocated the memory here.
      Handler handler(this_timer->handler_);
      (void)handler;

      // Free the memory associated with the handler.
      ptr.reset();
    }

  private:
    Handler handler_;
  };

  // Move the item at the given index up the heap to its correct position.
  void up_heap(size_t index)
  {
    size_t parent = (index - 1) / 2;
    while (index > 0
        && Time_Traits::less_than(heap_[index]->time_, heap_[parent]->time_))
    {
      swap_heap(index, parent);
      index = parent;
      parent = (index - 1) / 2;
    }
  }

  // Move the item at the given index down the heap to its correct position.
  void down_heap(size_t index)
  {
    size_t child = index * 2 + 1;
    while (child < heap_.size())
    {
      size_t min_child = (child + 1 == heap_.size()
          || Time_Traits::less_than(
            heap_[child]->time_, heap_[child + 1]->time_))
        ? child : child + 1;
      if (Time_Traits::less_than(heap_[index]->time_, heap_[min_child]->time_))
        break;
      swap_heap(index, min_child);
      index = min_child;
      child = index * 2 + 1;
    }
  }

  // Swap two entries in the heap.
  void swap_heap(size_t index1, size_t index2)
  {
    timer_base* tmp = heap_[index1];
    heap_[index1] = heap_[index2];
    heap_[index2] = tmp;
    heap_[index1]->heap_index_ = index1;
    heap_[index2]->heap_index_ = index2;
  }

  // Remove a timer from the heap and list of timers.
  void remove_timer(timer_base* t)
  {
    // Remove the timer from the heap.
    size_t index = t->heap_index_;
    if (!heap_.empty() && index < heap_.size())
    {
      if (index == heap_.size() - 1)
      {
        heap_.pop_back();
      }
      else
      {
        swap_heap(index, heap_.size() - 1);
        heap_.pop_back();
        size_t parent = (index - 1) / 2;
        if (index > 0 && Time_Traits::less_than(
              heap_[index]->time_, heap_[parent]->time_))
          up_heap(index);
        else
          down_heap(index);
      }
    }

    // Remove the timer from the hash.
    typedef typename hash_map<void*, timer_base*>::iterator iterator;
    iterator it = timers_.find(t->token_);
    if (it != timers_.end())
    {
      if (it->second == t)
        it->second = t->next_;
      if (t->prev_)
        t->prev_->next_ = t->next_;
      if (t->next_)
        t->next_->prev_ = t->prev_;
      if (it->second == 0)
        timers_.erase(it);
    }
  }

  // Destroy all timers in a linked list.
  void destroy_timer_list(timer_base*& t)
  {
    while (t)
    {
      timer_base* next = t->next_;
      t->next_ = 0;
      t->destroy();
      t = next;
    }
  }

  // A hash of timer token to linked lists of timers.
  hash_map<void*, timer_base*> timers_;

  // The heap of timers, with the earliest timer at the front.
  std::vector<timer_base*> heap_;

  // The list of timers to be cancelled.
  timer_base* cancelled_timers_;

  // The list of timers waiting to be completed.
  timer_base* complete_timers_;
};

} // namespace detail
} // namespace asio
} // namespace boost

#include <boost/asio/detail/pop_options.hpp>

#endif // BOOST_ASIO_DETAIL_TIMER_QUEUE_HPP


text:
/*
 * xbLibrary.js
 * $Revision: 1.3 $ $Date: 2003/03/17 03:44:20 $
 */

/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is Bob Clary code.
 *
 * The Initial Developer of the Original Code is
 * Bob Clary.
 * Portions created by the Initial Developer are Copyright (C) 2000
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s): Bob Clary <bc@bclary.com>
 *
 * ***** END LICENSE BLOCK ***** */

if (!document.getElementById || navigator.userAgent.indexOf('Opera') != -1)
{
  // assign error handler for downlevel browsers
  // Note until Opera improves it's overall support
  // for JavaScript and the DOM, it must be considered downlevel

  window.onerror = defaultOnError;

  function defaultOnError(msg, url, line)
  {
    // handle bug in NS6.1, N6.2
    // where an Event is passed to error handlers
    if (typeof(msg) != 'string')
    {
        msg = 'unknown error';
    }
    if (typeof(url) != 'string')
    {
        url = document.location;
    }

    alert('An error has occurred at ' + url + ', line ' + line + ': ' + msg);
  }
}

function xbLibrary(path)
{
  if (path.charAt(path.length-1) == '/')
  {
    path = path.substr(0, path.length-1)
  }
  this.path = path;
}

// dynamically loaded scripts
//
// it is an error to reference anything from the dynamically loaded file inside the
// same script block.  This means that a file can not check its dependencies and
// load the files for it's own use.  someone else must do this.

xbLibrary.prototype.loadScript =
function (scriptName)
{
  document.write('<script language="javascript" src="' + this.path + '/' + scriptName + '"><\/script>');
};

// default xbLibrary

xblibrary = new xbLibrary('./');


text:
#include <net/if.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/genetlink.h>
#include <linux/if_tun.h>

#include <db/db.h>
#include <cmn/agent_cmn.h>

#include <oper/interface.h>
#include <oper/mirror_table.h>

#include <ksync/ksync_index.h>
#include <ksync/ksync_entry.h>
#include <ksync/ksync_object.h>
#include <ksync/ksync_sock.h>

#include "vr_genetlink.h"
#include "vr_interface.h"
#include "vr_types.h"
#include "nl_util.h"

#include <uve/stats_collector.h>
#include <uve/vrouter_stats.h>
#include <uve/uve_init.h>
#include <uve/uve_client.h>

bool VrouterStatsCollector::Run() {
    return true;
}


text:
An simple collector of IBM mqsi events.

See the wiki for more information, this readme is focused on how to work with development and test.

# Brief history
This project was developed during a real migration from IBM WebSphere Message Broker V7 to IBM Integration Bus V9.
Feel free to give back via pull requests or just make issues with suggestions on improvement.

# Licensing
The project is licensed under the Apache 2.0 license -  http://www.apache.org/licenses/LICENSE-2.0

# Pre requisites

## WebSphere MQ
You will need a local installation of WebSphere MQ and that the
environment variable "MQ_JAVA_LIB_DIR" is set.

## Java runtime
Java 7 installed and JAVA_HOME is set.

## Gradle
The project is built using Gradle. As long as you have a JRE on your path you can actually use the
bundled gradle wrapper instead (gradlew on Linux or gradlew.bat on Windows). It will download an embedded
gradle jar-file and run so you don't need to install anything.

## IIB10
When using IIB10, an environment varible with the name IIB10_INSTALL_PATH must be set to the installtion path of IIB10.
For example: C:\Program Files\IBM\IIB\10.0.0.X\. This will copy the new IntegrationApi.jar to the installation.

### Build
Use `gradlew installApp` or `gradlew distZip` to build.
installApp does a local install under build/install directory
distZip does a local zip distribution with all required artefacts under build/distributions

## Test using IBM Integration Bus V9
The simplest way to enable and test this using for instance IIB V9 is to start from the
Samples and Tutorials -> Monitoring -> WebSphere Business Monitor sample
Import it and then change the configured events for "Transaction Start" and "Transaction END"
Make sure they "Include bitstream data in payload" with content "All" and Encoding "base64Binary"

Follow the instructions in it for setting up subscription and activating the events.
$SYS/Broker/IB9NODE/Monitoring/test/TotalPurchaseOrderFlow
mqsichangeflowmonitoring IB9NODE -e test -f TotalPurchaseOrderFlow -c active

Note that a Developer Edition of IIB is readily available through IBM's website.

## Install as a service on Windows using NSSM
- Download NSSM https://nssm.cc/
- run nssm.exe install <serviceName>, this opens up a graphical interface where you easily can configure the rest.
- The rest is browsing to the startcollector.bat and possibly also changing the user who runs the service.


text:
#ifndef __typelist_algorithm_filter_h__
#define __typelist_algorithm_filter_h__

#include "typelist/_private.h"

namespace typelist {

/**
 * Creates the list from the provided one which only contains
 * elements that passed the provided filter.
 * The format of the filter is expected to be like this:
 *
 * template<typename T>
 * struct|class Filter {
  *   enum { value = true|false|0|non-0 };
 * };
 */
template<typename TL, template<typename>class Comp> struct filter;

/**
 * General case.
 * Filters the head and recurses into the tail.
 */
template<template<typename>class Comp, typename T, typename... Args>
struct filter <list<T, Args...>, Comp> {
private:
    using next =
        typename filter <typename list<T, Args...> :: tail, Comp> :: type;
public:
    using type =
        typename std::conditional <
            Comp<T> :: value,
            typename _private::_make_list < T, next > :: type,
            typename _private::_make_list <
                typename _private::_head<next> :: type,
                typename _private::_tail<next> :: type
            > :: type
        > :: type;
};

/**
 * Specialization to end recursion.
 */
template<template<typename>class Comp>
struct filter <_private::_sentinel, Comp> {
    using type = _private::_sentinel;
};

}

#endif//__typelist_algorithm_filter_h__


text:
--
-- PostgreSQL database dump
--

\c sr_data

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = public, pg_catalog;

----------------------------------------

--
-- Data for Name: sr_users; Type: TABLE DATA; Schema: public; Owner: sitrepadmin
--

COPY sr_users (uid, gid, username, firstname, lastname, title, titlecode, email, dn, last_login, wlayout) FROM stdin;
1001	11	sitrepadmin	SitRepFirstName	AdminLastName	The Admin	0	none@null.com	C	\N	1
1002	12	sitrepuser	SitRepFirstName	UserLastName	A Typical User	0	none@null.com	C	\N	1
\.

--
-- Data for Name: sr_groups; Type: TABLE DATA; Schema: public; Owner: sitrepadmin
--

COPY sr_groups (gid, groupname, parent_gid) FROM stdin;
11	Admin Group	0
12	Regular User Group	0
\.

--
-- Name: sr_modules_id_seq; Type: SEQUENCE SET; Schema: public; Owner: sitrepadmin
--

SELECT pg_catalog.setval('sr_modules_id_seq', 20, true);

--
-- Data for Name: sr_modules; Type: TABLE DATA; Schema: public; Owner: sitrepadmin
--

COPY sr_modules (id, name) FROM stdin;
1	*/*/*
2	srdata/*/*
3	srsearch/*/*
4	home/*/*
5	srdata/users/*
6	srdata/groups/*
7	srdata/layers/*
8	srdata/modules/*
9	srdata/permissions/*
10	srdata/features/*
11	srdata/featuresstatic/*
12	srdata/geojson/*
13	srdata/geojsonstatic/*
14	srdata/styles/*
15	srdata/stylepresets/*
16	srdata/sessions/*
17	srdata/cfs/*
18	srdata/wlayout/*
19	srdata/queries/*
20	srdata/stylerules/*
21	srdata/stylesymbolizers/*
\.

--
-- Name: sr_acl_permissions_permission_id_seq; Type: SEQUENCE SET; Schema: public; Owner: sitrepadmin
--

SELECT pg_catalog.setval('sr_acl_permissions_permission_id_seq', 20, true);

--
-- Data for Name: sr_acl_permissions; Type: TABLE DATA; Schema: public; Owner: sitrepadmin
--

COPY sr_acl_permissions (permission_id, role_type, role_id, resource_id, permission_create, permission_read, permission_update, permission_delete) FROM stdin;
1	gid	11	1	allow	allow	allow	allow
2	gid	10	2	deny	allow	deny	deny
3	gid	10	3	deny	allow	deny	deny
4	gid	10	4	deny	allow	deny	deny
5	gid	10	5	deny	allow	deny	deny
6	gid	10	6	deny	allow	deny	deny
7	gid	10	7	deny	allow	deny	deny
8	gid	10	8	deny	allow	deny	deny
9	gid	10	9	deny	allow	deny	deny
10	gid	10	10	deny	allow	deny	deny
11	gid	10	11	deny	allow	deny	deny
12	gid	10	12	deny	allow	deny	deny
13	gid	10	13	deny	allow	deny	deny
14	gid	10	14	deny	allow	deny	deny
15	gid	10	15	deny	allow	deny	deny
16	gid	10	16	deny	allow	deny	deny
17	gid	10	17	deny	allow	deny	deny
18	gid	10	18	deny	allow	deny	deny
19	gid	10	19	deny	allow	deny	deny
20	gid	10	20	deny	allow	deny	deny
21	gid	10	21	deny	allow	deny	deny
\.

--
-- Name: sr_window_layout_id_seq; Type: SEQUENCE SET; Schema: public; Owner: sitrepadmin
--

SELECT pg_catalog.setval('sr_window_layout_id_seq', 4, true);

--
-- Data for Name: sr_window_layout; Type: TABLE DATA; Schema: public; Owner: sitrepadmin
--

COPY sr_window_layout (id, name, showname, theme, view_x, view_y, view_data) FROM stdin;
1	Main Layout	0	0	2	1	[[{"type":"opstrack","id":1,"linkViewIdArr":[2],"autoRefresh":true,"mapData":true,"querysort":{"cfs_finaldisdate":"desc","cfs_timecreated":"desc"},"srd_queryid":1 }], [{"type":"map","id":2,"linkViewIdArr":[1],"start_lat":40.713,"start_lon":-73.996,"start_zoom":12,"start_base_layer":1002}] ]
2	CFS Only Layout	0	0	1	1	[[{"type":"opstrack","id":1,"autoRefresh":true,"querysort":{"cfs_finaldisdate":"desc","cfs_timecreated":"desc"},"srd_queryid":1 }] ]
3	Map Only Layout	0	0	1	1	[ [{"type":"map","id":2,"linkViewIdArr":[1],"start_lat":40.713,"start_lon":-73.996,"start_zoom":12,"start_base_layer":1002}] ]
4	Main Layout Dark	1	0	2	1	[[{"type":"opstrack","id":1,"linkViewIdArr":[2],"autoRefresh":true,"mapData":true,"querysort":{"cfs_finaldisdate":"desc","cfs_timecreated":"desc"},"srd_queryid":1 }], [{"type":"map","id":2,"linkViewIdArr":[1],"start_lat":40.713,"start_lon":-73.996,"start_zoom":12,"start_base_layer":1003}] ]
\.

--
-- Name: sr_layers_id_seq; Type: SEQUENCE SET; Schema: public; Owner: sitrepadmin
--

SELECT pg_catalog.setval('sr_layers_id_seq', 2000, true);

--
-- Data for Name: sr_layers; Type: TABLE DATA; Schema: public; Owner: sitrepadmin
--

COPY sr_layers (id, name, type, format, isbaselayer, projection, visibility, sphericalmercator, url, numzoomlevels, minzoomlevel, maxzoomlevel, attribution, defaultstyle, created_on, updated_on, created_by, updated_by) FROM stdin;
1001	SitRep	XYZ	\N	t	EPSG:900913	t	t	https://sitrep.local/sr_tiles/${z}/${x}/${y}.png	30	\N	\N		\N	\N	2012-02-22 12:39:26.877309	\N	\N
1002	SitRep BW	XYZ	\N	t	EPSG:900913	t	t	https://sitrep.local/sr_tiles_bw/${z}/${x}/${y}.png	30	\N	\N	\N	\N	\N	2012-02-22 12:39:26.92042	\N	\N
1003	SitRep BW Dark	XYZ	\N	t	EPSG:900913	t	t	https://sitrep.local/sr_tiles_bw_dark/${z}/${x}/${y}.png	30	\N	\N	\N	\N	\N	2012-02-22 12:39:26.970325	\N	\N
\.

--
-- PostgreSQL database dump complete
--


text:
package org.apache.geode.internal.memcached.commands;

import java.nio.ByteBuffer;

import org.apache.geode.cache.Cache;
import org.apache.geode.internal.memcached.Reply;
import org.apache.geode.internal.memcached.RequestReader;
import org.apache.geode.memcached.GemFireMemcachedServer.Protocol;

/**
 * This command is currently no-op.<br/>
 *
 * The command "stats" is used to query the server about statistics it maintains and other internal
 * data. It has two forms. Without arguments:
 *
 * stats\r\n it causes the server to output general-purpose statistics
 *
 *
 */
public class StatsCommand extends AbstractCommand {

  @Override
  public ByteBuffer processCommand(RequestReader request, Protocol protocol, Cache cache) {
    if (protocol == Protocol.ASCII) {
      return asciiCharset.encode(Reply.END.toString());
    }
    request.getRequest().position(HEADER_LENGTH);
    return request.getResponse();
  }

}


text:
{{auth.isAuthenticated()}}
<form #formRef="ngForm" (ngSubmit)="onSubmit(formRef)">
    <fieldset ngModelGroup="profile">
        <input type="text" name="username" [(ngModel)]="username" #usernameRef="ngModel" required minlength="3" />

This field is required.

This field must be longer than {{usernameRef.errors?.minlength.requiredLength}} characters.

        <input type="text" name="favoriteColor" [(ngModel)]="favoriteColor" #favoriteColorRef="ngModel" required />
    </fieldset>
    <fieldset ngModelGroup="contribution">

            <input [attr.id]="opportunity" name="interest" ngModel [value]="opportunity" type="radio" required />
            {{opportunity}}

    </fieldset>
    <fieldset ngModelGroup="security">
        <select name="securityMethod" [(ngModel)]="securityMethod">
            <option *ngFor="let securityMethod of securityMethods" [value]="securityMethod">{{securityMethod}}</option>
        </select>
    </fieldset>
    <button type="submit">Submit</button>
</form>
{{formRef.value | json}}
{{formRef.valid | json}}


text:
A plugin for easy to use clang-based completions::

    ╔═╗┌─┐┌─┐┬ ┬  ╔═╗┬  ┌─┐┌┐┌┌─┐  ╔═╗┌─┐┌┬┐┌─┐┬  ┌─┐┌┬┐┌─┐
    ║╣ ├─┤└─┐└┬┘  ║  │  ├─┤││││ ┬  ║  │ ││││├─┘│  ├┤  │ ├┤
    ╚═╝┴ ┴└─┘ ┴   ╚═╝┴─┘┴ ┴┘└┘└─┘  ╚═╝└─┘┴ ┴┴  ┴─┘└─┘ ┴ └─┘

Let't get started!
==================

You're just two simple steps away!

1. Install clang
----------------

- **Ubuntu**        : ``sudo apt-get install clang``
- **OSX**           : ships `clang` by default. You are all set!
- **Windows**       : install the latest release from clang website.
- **Other Systems** : use your package manager or install from clang website.
- clang website: http://llvm.org/releases/download.html

2. Configure your includes
--------------------------

Using CMake?
~~~~~~~~~~~~

Plugin will run cmake on a proper ``CMakeLists.txt`` in your project folder and
will use information from it to complete your code out of the box.

Have a compilation database?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Plugin will search for a compilation database ``compile_commands.json`` in the
project folder and will load it to complete your code. If you want to specify a
custom path to a comilation database you can do it in settings::

    "flags_sources": [
        {"file": "compile_commands.json", "search_in": "<YOUR_PATH>"},
    ]

None of the above?
~~~~~~~~~~~~~~~~~~

You will need a little bit of manual setup for now. Clang will automatically
search for headers in the folder that contains the file you are working on and
its parent. If you have a more sophisticated project you will need to help clang
just a little bit. There are three ways to do it.

Pick **ANY** of the following:

- Set include dirs in ``"common_flags"`` setting in ``User Settings``.
- Override ``"common_flags"`` setting in your project file, i.e. one that has
  extension: ``*.sublime-project``. Just define the same setting in project
  specific settings with either one of two prefixes: ``"ecc_"`` or
  ``"easy_clang_complete_"`` to override a corresponding setting in your user
  settings. See the project file in this repo for a working example. Minimal
  example for clarity::

    {
      "settings":
      {
        "ecc_common_flags": ["-Isrc", "-I/usr/include"],
        "easy_clang_complete_verbose": true
      }
    }

- It is recommended to use one of the above, but if you already have a file with
  flags, you can add ``.clang_complete`` file to the root of your project
  folder. This file adds additional flags to the ones defined with in
  ``"common_flags"``. Example::

    -Isrc
    -I/usr/include

That's it! You're ready to use the plugin!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

More info here
~~~~~~~~~~~~~~

Get more info in a readme:
https://github.com/niosus/EasyClangComplete/blob/master/README.md

Please see the default settings ``EasyClangComplete.sublime-settings``
shipped with the plugin for explanations and sane default values.

Thanks!
=======

💜 this plugin? Consider buying me a 🍵
https://github.com/niosus/EasyClangComplete#support-it


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 24: 160 (1932)

#### Original name
Puccinia boliviana H.S. Jacks. & Holw.

### Remarks
null