text:
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
var Infinilist = _dereq_('../lib/Infinilist');

module.exports = Infinilist;

},{"../lib/Infinilist":2}],2:[function(_dereq_,module,exports){
"use strict";

/**
 * Provides scrolling lists with large data sets that behave in a very
 * performance-optimised fashion by controlling the DOM elements currently
 * on screen to ensure that only the visible elements are rendered and
 * all other elements are simulated by variable height divs at the top
 * and bottom of the scrolling list.
 *
 * This module requires that the AutoBind module is loaded before it
 * will work.
 *
 * Infinilists work from views and those views cannot have an $orderBy
 * clause in them because that would slow down rendering. Instead if you
 * wish to have your data ordered you have to create a temporary collection
 * from which your view feeds from and pre-order the data before inserting
 * it into the temporary collection.
 * @class Infinilist
 * @requires AutoBind
 */

var Shared = window.ForerunnerDB.shared,
	View = Shared.modules.View;

/**
 * Creates an infinilist instance.
 * @param {Selector} selector A jQuery selector targeting the element that
 * will contain the list items.
 * @param {Selector} template jQuery selector of the template to use when
 * rendering an individual list item.
 * @param {Object} options The options object.
 * @param {View} view The view to read data from.
 * @constructor
 */
var Infinilist = function (selector, template, options, view) {
	var self = this;

	selector = $(selector);

	options = options || {};

	self.options = options.infinilist || {};

	delete options.infinilist;

	self.skip = 0;
	self.limit = 0;
	self.ignoreScroll = false;
	self.previousScrollTop = 0;
	self.selector = selector;
	self.template = template;
	self.view = view;
	self.itemTopMargin = $("

");
	self.itemContainer = $("

");
	self.itemBottomMargin = $("

");
	self.total = self.view.from().count(self.options.countQuery);
	self.itemHeight(self.options.itemHeight);

	selector.append(self.itemTopMargin);
	selector.append(self.itemContainer);
	selector.append(self.itemBottomMargin);

	self.resize();

	view.link(self.itemContainer, template, options);

	selector.on('scroll', function () {
		// Debounce scroll event
		if (!self.scrollDebouceTimeout) {
			self.scrollDebouceTimeout = setTimeout(function () {
				self.scroll();
				self.scrollDebouceTimeout = 0;
			}, 16);
		}
	});

	$(window).on('resize', function () {
		// Debounce resize event
		if (self.resizeDebouceTimeout) {
			clearTimeout(self.resizeDebouceTimeout);
		}

		self.resizeDebouceTimeout = setTimeout(function () {
			self.resize();
		}, 16);
	});
};

Shared.addModule('Infinilist', Infinilist);
Shared.mixin(Infinilist.prototype, 'Mixin.Events');

Shared.synthesize(Infinilist.prototype, 'itemHeight', function (val) {
	var self = this;

	if (val !== undefined) {
		self.virtualHeight = self.total * val;
		self._itemHeight = val;
		self.resize();
	}

	return this.$super.apply(this, arguments);
});

/**
 * Handle screen resizing.
 */
Infinilist.prototype.resize = function () {
	var self = this,
		newHeight = self.selector.height(),
		skipCount,
		scrollTop = self.selector.scrollTop();

	if (self.oldHeight !== newHeight) {
		self.oldHeight = newHeight;

		// Calculate number of visible items
		self.maxItemCount = Math.ceil(newHeight / self._itemHeight);
		skipCount = Math.floor(scrollTop / self._itemHeight);

		self.skip = skipCount;
		self.limit = self.maxItemCount + 1;

		self.view.queryOptions(self.currentRange());

		self.itemBottomMargin.height(self.virtualHeight - (skipCount * self._itemHeight)- (self.maxItemCount * self._itemHeight));
	}
};

Infinilist.prototype.currentRange = function () {
	return {
		$skip: this.skip,
		$limit: this.limit
	};
};

Infinilist.prototype.scroll = function () {
	var self = this,
		delta,
		skipCount,
		scrollTop = self.selector.scrollTop();

	// Get the current scroll position
	delta = scrollTop - self.previousScrollTop;
	self.previousScrollTop = scrollTop;

	// Check if a scroll change occurred
	if (delta !== 0) {
		// Determine the new item range
		skipCount = Math.floor(scrollTop / self._itemHeight);

		self.skip = skipCount;
		self.view.queryOptions(self.currentRange());

		self.itemTopMargin.height(skipCount * self._itemHeight);
		self.itemBottomMargin.height(self.virtualHeight - (skipCount * self._itemHeight)- (self.maxItemCount * self._itemHeight));
	}

	self.emit('scroll');
};

Infinilist.prototype.scrollToQuery = function (query, options, callback) {
	var self = this,
		result,
		index,
		orderOp = {
			$orderBy: self.view.queryOptions().$orderBy
		},
		tmpColl,
		scrollPos;

	if (typeof options === 'function') {
		callback = options;
		options = undefined;
	}

	// Ensure options has properties we expect
	options = options || {};
	options.$inc = options.$inc !== undefined ? options.$inc : 0;
	options.$incItem = options.$incItem !== undefined ? options.$incItem : 0;

	// Run query and get first matching record (with current sort)
	result = self.view.from().findOne(query, orderOp);

	// Find the position of the element inside the current view
	// based on the sort order
	tmpColl = self.view.db().collection('tmpSortCollection');
	tmpColl.setData(self.view.from().find(self.view.query()));
	index = tmpColl.indexOf(result, orderOp);
	tmpColl.drop();

	if (index > -1) {
		scrollPos = ((index + options.$incItem) * self._itemHeight) + options.$inc;
		scrollPos = scrollPos > 0 ? scrollPos : 0;

		if (self.selector.scrollTop() !== scrollPos) {
			if (callback) {
				self.once('scroll', function () {
					callback();
				});
			}

			// Scroll the main element to the position of the item
			self.selector.scrollTop(scrollPos);
		} else {
			if (callback) { callback(); }
		}

		return true;
	}

	return false;
};

Infinilist.prototype.drop = function (callback) {
	var self = this;

	// Unlink the view from the dom
	self.view.unlink(self.itemContainer, self.template);

	// Set state to dropped
	self._state = 'dropped';

	// Kill listeners
	self.selector.off('scroll');
	$(window).off('resize');

	// Remove references
	delete self.ignoreScroll;
	delete self.previousScrollTop;
	delete self._itemHeight;
	delete self.selector;
	delete self.template;
	delete self.view;
	delete self.itemTopMargin;
	delete self.itemContainer;
	delete self.itemBottomMargin;

	this.emit('drop', this);

	if (callback) { callback(false, true); }

	delete self._listeners;
};

View.prototype.infinilist = function (targetSelector, templateSelector, options) {
	var target = window.jQuery(targetSelector);

	if (templateSelector === undefined) {
		return target.data('infinilist');
	}

	target.data('infinilist', new Infinilist(targetSelector, templateSelector, options, this));
};

View.prototype.unInfinilist = function (targetSelector) {
	var target = window.jQuery(targetSelector);

	if (target.data('infinilist')) {
		target.data('infinilist').drop();
		target.removeData('infinilist');

		return true;
	}

	return false;
};

Shared.moduleFinished('AutoBind', function () {
	Shared.finishModule('Infinilist');
});

module.exports = Infinilist;
},{}]},{},[1]);


text:
module MessageQueue
  module Serializers
    class Plain < Serializer
      def load(string, options = {})
        string
      end

      def dump(object, options = {})
        object
      end

      def content_type
        "text/plain"
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
@implementation NeodiusUIComponents

static NeodiusUIComponents *sharedComponents = nil;

+ (NeodiusUIComponents*)sharedComponents {
    if (sharedComponents == nil) {
        sharedComponents = [[super allocWithZone:NULL] init];
    }
    return sharedComponents;
}

-(void)inputWalletInformationOnViewController:(UIViewController*)presentationView
                           withAddressAndName:(BOOL)addressAndName
                          WithCompletionBlock:(addNewWalletCompletionBlock)block {
    [UIAlertView showWithTitle:nil
                       message:NSLocalizedString(@"Pick a method",nil)
             cancelButtonTitle:NSLocalizedString(@"Cancel",nil)
             otherButtonTitles:@[NSLocalizedString(@"By QR-Code",nil),NSLocalizedString(@"By entering an address",nil)]
                      tapBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
                          if (buttonIndex == alertView.cancelButtonIndex) {
                              //cancel pressed return no
                              block(NO,@"",@"");
                          } else {

                              __block UIAlertView *av;
                              __block UITextField *name, *address;

                              //otherwise: if buttonindex == 1 or two setup the things we need
                              if (buttonIndex == 1 || buttonIndex == 2) {
                                  if (addressAndName || buttonIndex == 2) {
                                      av = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Address input",nil)
                                                                       message:NSLocalizedString(@"Enter a name and the address",nil)
                                                                      delegate:self
                                                             cancelButtonTitle:NSLocalizedString(@"Cancel",nil)
                                                             otherButtonTitles:NSLocalizedString(@"Okay",nil), nil];

                                      if (addressAndName) {
                                          //set to two fields
                                          av.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
                                          name = [av textFieldAtIndex:0];
                                          address = [av textFieldAtIndex:1];
                                      } else {
                                          //set single input
                                          av.alertViewStyle = UIAlertViewStylePlainTextInput;
                                          address = [av textFieldAtIndex:0];
                                      }
                                      //placeholders textviews etc
                                      name.placeholder = NSLocalizedString(@"Enter a name", nil);
                                      address.placeholder = NSLocalizedString(@"Enter the address", nil);
                                      address.secureTextEntry = NO;

                                      av.tapBlock = ^(UIAlertView *alertView, NSInteger buttonIndex) {
                                          if (buttonIndex == alertView.firstOtherButtonIndex) {
                                              block(YES,name.text,address.text);
                                          } else {
                                              block(NO,nil,nil);
                                          }
                                      };
                                      if (buttonIndex == 2)
                                          [av show];
                                  }

                                  //if QRCOde is pressed we need to launch the QR Scanner
                                  if (buttonIndex == 1) {
                                    QRCodeReader *reader = [QRCodeReader readerWithMetadataObjectTypes:@[AVMetadataObjectTypeQRCode]];
                                    vc = [QRCodeReaderViewController readerWithCancelButtonTitle:NSLocalizedString(@"Cancel",nil)
                                                                                codeReader:reader
                                                                             startScanningAtLoad:YES
                                                                          showSwitchCameraButton:YES
                                                                                showTorchButton:YES];

                                    vc.modalPresentationStyle = UIModalPresentationFormSheet;
                                    vc.delegate = self;
                                    [presentationView presentViewController:vc animated:YES completion:nil];
                                    [reader setCompletionWithBlock:^(NSString *resultAsString) {
                                        [vc dismissViewControllerAnimated:YES completion:^{
                                            if (addressAndName) {
                                                address.text = resultAsString;
                                                [av show];
                                            } else {
                                                block(YES,nil,resultAsString);
                                            }
                                        }];
                                    }];
                                  }
                              }
                          }
                      }
     ];
}

-(void)showQrModalOnViewController:(UIViewController*)viewController withAddress:(NSString*)address withTitle:(NSString*)title andShareMessage:(NSString*)shareString {

    tmpString = address;
    tmpShareString = shareString;

    UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0,0, 280, 460)];
    v.layer.cornerRadius = 10.0f;
    v.backgroundColor = [UIColor whiteColor];
    tmpViewController = viewController;

    UILabel *lblTitle = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, v.frame.size.width-40, 40)];
    lblTitle.textAlignment = NSTextAlignmentCenter;
    lblTitle.text = ((title == nil) ? NSLocalizedString(@"Wallet address",nil) : title);
    lblTitle.adjustsFontSizeToFitWidth = YES;
    lblTitle.font = [UIFont fontWithName:FONT_LIGHT size:32];
    [v addSubview:lblTitle];

    UILabel *lbladdress = [[UILabel alloc] initWithFrame:CGRectMake(20, 60, v.frame.size.width-40, 40)];
    lbladdress.textAlignment = NSTextAlignmentCenter;
    lbladdress.text = address;
    lbladdress.adjustsFontSizeToFitWidth = YES;;
    lbladdress.font = [UIFont fontWithName:FONT_LIGHT size:16];
    lbladdress.numberOfLines = 0;
    [v addSubview:lbladdress];

    UIImage *qrImage = [UIImage coro_createQRCodeWithText:address size:200];
    tmpImage = qrImage;
    UIImageView *qrHolder = [[UIImageView alloc] initWithFrame:CGRectMake(20, 110, 240, 240)];
    qrHolder.frame = CGRectMake(qrHolder.frame.origin.x,
                                qrHolder.frame.origin.y,
                                qrHolder.frame.size.width,
                                qrHolder.frame.size.height);

    qrHolder.image = qrImage;
    [v addSubview:qrHolder];

    NEOButton *btnCopy = [[NEOButton alloc]
                          initWithFrame:CGRectMake(20,360,v.frame.size.width-40,40)
                          withTitle:NSLocalizedString(@"Copy address",nil)
                          withIcon:FAIconClone
                          isPrimary:YES
                          ];
    [btnCopy addTarget:self action:@selector(copyToClipboardWithAddress) forControlEvents:UIControlEventTouchUpInside];
    [v addSubview:btnCopy];

    NEOButton *btnShare = [[NEOButton alloc]
                          initWithFrame:CGRectMake(20,410,v.frame.size.width-40,40)
                          withTitle:NSLocalizedString(@"Share address",nil)
                          withIcon:FAIconClone
                          isPrimary:NO
                          ];
    [btnShare addTarget:self action:@selector(shareAddress) forControlEvents:UIControlEventTouchUpInside];
    [v addSubview:btnShare];

    walletPopup = [KLCPopup popupWithContentView:v
                                        showType:KLCPopupShowTypeBounceInFromBottom
                                     dismissType:KLCPopupDismissTypeShrinkOut
                                        maskType:KLCPopupMaskTypeDimmed
                        dismissOnBackgroundTouch:YES
                           dismissOnContentTouch:NO];
    [walletPopup show];
}

-(void)shareAddress {
    [walletPopup dismiss:YES];

    NSString *publishString ;
    if (tmpShareString == nil) {
        publishString = [NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"This is the NEO address. Feel free to transfer some NEO or GAS! :)", nil),tmpString];
    } else {
        publishString = tmpShareString;
    }

    NSArray *activityItems = [NSArray arrayWithObjects:publishString, tmpImage, nil];
    UIActivityViewController * activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems
                                                                                applicationActivities:nil];
    activityViewController.navigationController.navigationBar.tintColor = [UIColor whiteColor];

    [tmpViewController presentViewController:activityViewController animated:YES completion:nil];

}

-(CGRect)calculateAutoHeightForField:(UILabel*)label andMaxWidth:(CGFloat)width {
    NSAttributedString *attributedText =    [[NSAttributedString alloc]
                                             initWithString:label.text
                                             attributes:@
                                             {
                                             NSFontAttributeName: label.font
                                             }];

    CGRect rect = [attributedText boundingRectWithSize:(CGSize){width, CGFLOAT_MAX}
                                               options:NSStringDrawingUsesLineFragmentOrigin
                                               context:nil];
    CGSize size = rect.size;
    CGRect labelFrame = label.frame;
    labelFrame.size.height = size.height;
    return labelFrame;
}

-(void)copyToClipboardWithAddress {
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    pasteboard.string = tmpString;
    if ([[NeodiusDataSource sharedData] getShowMessages])  {
        CWStatusBarNotification *n = [CWStatusBarNotification new];
        n.notificationLabelBackgroundColor = neoGreenColor;
        n.notificationLabelTextColor = [UIColor whiteColor];
        [n displayNotificationWithMessage:NSLocalizedString(@"Address copied to clipboard", nil) forDuration:3];
    }
}

- (void)readerDidCancel:(QRCodeReaderViewController *)reader {
    [vc dismissViewControllerAnimated:YES completion:nil];
}

@end


text:
Project Representatives :

The project representative users are the "first-contact" users for this project.

                Their names and e-mails are displayed on the project Dashboard and will be visible by all the contributors of this project.

            <div id="projecteditrepresentative<%= id %>">

Project Managers :

The project managers are the privileged users who can modify this project by adding or removing images, contributors, etc.

                A project manager will also be able to delete this project!
Then, it must be a trusty person.

            <div id="projecteditmanager<%= id %>">

Contributors Configuration :

The project contributor are the normal users. They can't modify configurations of the current project.

                Their permissions on images, annotations etc. are defined with the project Editing mode.

            <a id="ProjectUserAdd<%= id %>" class="btn btn-primary"> Add new contributor
            <a id="UserRefresh<%= id %>" class="btn btn-primary"> Refresh
            <a id="ProjectUserExport<%= id %>" class="btn btn-primary"> Export as CSV

            For selected contributors :
            <a id="ProjectUserDelete<%= id %>" class="btn btn-danger"> Delete

            Show only online contributors
            <input type="checkbox" id="ShowOnlyOnline<%= id %>">
            Show only managers
            <input type="checkbox" id="ShowOnlyAdmin<%= id %>">

        <div id="tabs-projectUserListing<%= id %>" style="display:inline-block;width:100%;">

                <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="userProjectTable<%= id %>">

                        <input type="checkbox" id="selectAllUsers<%= id %>">

                        Username
                        Full name

                        Last Connection
                        Last Image
                        Is LDAP
                        e-mail
                        # of visit
                        Action

                    <tbody id="userProjectArray<%= id %>">

            <div class="col-md-offset-1 col-md-8" id="UsersGlobalActivities<%= id %>">

                <div id="UsersActivitiesHeatmap<%= id %>">

            <div class="col-md-offset-1 col-md-10" id="LastConnections-<%= id %>">

            <div class="col-md-offset-1 col-md-10" id="avgConnections-<%= id %>">


text:
/////////////////////////////////////////////////
// Approximate Neighborhood Function
// C. R. Palmer, P. B. Gibbons and C. Faloutsos,
// ANF: A Fast and Scalable Tool for Data Mining in Massive Graphs,
// KDD 2002 http://www.cs.cmu.edu/~christos/PUBLICATIONS/kdd02-anf.ps.gz

template <class PGraph>
class TGraphAnf {
private:
  typedef TVec<uint64> TAnfBitV;
  THash<TInt, uint64> NIdToBitPosH; // NId to byte(!) offset in BitV
  TInt NApprox; // maintain N parallel approximations (multiple of 8)
  TInt NBits, MoreBits, ApproxBytes; // NBits=logNodes+MoreBits;  MoreBits: additional R bits;  ApproxBytes: Approx/8;
  PGraph Graph;
  TRnd Rnd;
private:
  UndefDefaultCopyAssign(TGraphAnf);
public:
  TGraphAnf(const PGraph& GraphPt, const int& Approx=32, const int& moreBits=5, const int& RndSeed=0) :
    NApprox(Approx), MoreBits(moreBits), Graph(GraphPt), Rnd(RndSeed) { IAssert(NApprox%8==0);  IAssert(sizeof(uint)==4); }
  uint64 GetNIdOffset(const int& NId) const { return NIdToBitPosH.GetDat(NId); }
  void InitAnfBits(TAnfBitV& BitV);
  void Union(TAnfBitV& BitV1, const uint64& NId1Offset, TAnfBitV& BitV2, const uint64& NId2Offset) const;
  double AvgLstZero(const TAnfBitV& BitV, const uint64& NIdOffset) const;
  double GetCount(const TAnfBitV& BitV, const uint64& NIdOffset) const {
    return pow(2.0, AvgLstZero(BitV, NIdOffset)) / 0.77351;
  }
  void GetNodeAnf(const int& SrcNId, TIntFltKdV& DistNbhsV, const int& MxDist, const bool& IsDir);
  void GetGraphAnf(TIntFltKdV& DistNbhsV, const int& MxDist, const bool& IsDir);
};

template <class PGraph>
void TGraphAnf<PGraph>::InitAnfBits(TAnfBitV& BitV) {
  const int NNodes = Graph->GetNodes();
  const int LogNodes = int(ceil(TMath::Log2(NNodes)));
  ApproxBytes = NApprox / 8;
  NBits = LogNodes + MoreBits; // bits per node
  const int BytesPerNd = ApproxBytes * NBits; // total bytes per node
  BitV.Gen((NNodes * BytesPerNd)/sizeof(uint)+1);  IAssert(BitV.BegI() != NULL);
  BitV.PutAll(0);
  int SetBit = 0;
  uint64 NodeOff = 0;
  uchar* BitVPt = (uchar *) BitV.BegI();
  // for each node: 1st bits of all approximations are at BitV[Offset+0], 2nd bits at BitV[Offset+NApprox/32], ...
  for (typename PGraph::TObj::TNodeI NI = Graph->BegNI(); NI != Graph->EndNI(); NI++) {
    NIdToBitPosH.AddDat(NI.GetId(), NodeOff);
    // init vertex bits
    for (int approx = 0; approx < NApprox; approx++) {
      const int RndNum = Rnd.GetUniDevInt();
      for (SetBit = 0; (RndNum & (1<<SetBit))==0 && SetBit < NBits; SetBit++) { }
      if (SetBit >= NBits) SetBit = NBits-1;
      const int BitPos = ApproxBytes * SetBit + approx / 8;
      *(BitVPt + NodeOff + BitPos) |= (1<<(approx % 8)); // magically works better than code below (see anf.c)
    }
    NodeOff += BytesPerNd;
  }
}

template <class PGraph>
void TGraphAnf<PGraph>::Union(TAnfBitV& BitV1, const uint64& NId1Offset, TAnfBitV& BitV2, const uint64& NId2Offset) const {
  uchar* DstI = (uchar *) BitV1.BegI() + NId1Offset;
  uchar* SrcI = (uchar *) BitV2.BegI() + NId2Offset;
  for (int b=0; b < ApproxBytes*NBits; b++, DstI++, SrcI++) { *DstI |= *SrcI; }
}

//average least zero bit position (least significant zero)
template <class PGraph>
double TGraphAnf<PGraph>::AvgLstZero(const TAnfBitV& BitV, const uint64& NIdOffset) const { //average least zero bit position (least significant zero)
  int approx, bit, AvgBitPos = 0;
  uchar* BitVPt = (uchar *) BitV.BegI();
  for (approx = 0; approx < NApprox; approx++) {
    for (bit = 0; bit < NBits; bit++) {
      if ((*(BitVPt+NIdOffset + ApproxBytes*bit + approx/8) & (1<<(approx%8))) == 0) break; } // found zero
    if (bit > NBits) bit = NBits;
    AvgBitPos += bit;
  }
  return AvgBitPos/double(NApprox) ;
}

template <class PGraph>
void TGraphAnf<PGraph>::GetNodeAnf(const int& SrcNId, TIntFltKdV& DistNbhsV, const int& MxDist, const bool& IsDir) {
  const int NNodes = Graph->GetNodes();
  TAnfBitV CurBitsV, LastBitsV;
  InitAnfBits(CurBitsV);          IAssert(CurBitsV.BegI() != NULL);
  LastBitsV.Gen(CurBitsV.Len());  IAssert(LastBitsV.BegI() != NULL);
  DistNbhsV.Clr();
  DistNbhsV.Add(TIntFltKd(1, Graph->GetNI(SrcNId).GetOutDeg()));
  for (int dist = 1; dist < (MxDist==-1 ? TInt::Mx : MxDist); dist++) {
    memcpy(LastBitsV.BegI(), CurBitsV.BegI(), sizeof(uint)*CurBitsV.Len()); //LastBitsV = CurBitsV;
    for (typename PGraph::TObj::TNodeI NI = Graph->BegNI(); NI < Graph->EndNI(); NI++) {
      const uint64 NIdOffset = GetNIdOffset(NI.GetId());
      for (int e = 0; e < NI.GetOutDeg(); e++) {
        const uint64 NId2Offset = GetNIdOffset(NI.GetOutNId(e));
        Union(CurBitsV, NIdOffset,  LastBitsV, NId2Offset);
      }
      if (! IsDir) {
        for (int e = 0; e < NI.GetInDeg(); e++) {
          const uint64 NId2Offset = GetNIdOffset(NI.GetInNId(e));
          Union(CurBitsV, NIdOffset,  LastBitsV, NId2Offset);
        }
      }
    }
    DistNbhsV.Add(TIntFltKd(dist, GetCount(CurBitsV, GetNIdOffset(SrcNId))));
    if (DistNbhsV.Len() > 1 && DistNbhsV.Last().Dat < 1.001*DistNbhsV[DistNbhsV.Len()-2].Dat) break; // 0.1%  change
  }
}

template <class PGraph>
void TGraphAnf<PGraph>::GetGraphAnf(TIntFltKdV& DistNbhsV, const int& MxDist, const bool& IsDir) {
  TAnfBitV CurBitsV, LastBitsV;
  InitAnfBits(CurBitsV);          IAssert(CurBitsV.BegI() != NULL);
  LastBitsV.Gen(CurBitsV.Len());  IAssert(LastBitsV.BegI() != NULL);
  int v, e;
  double NPairs = 0.0;
  DistNbhsV.Clr();
  DistNbhsV.Add(TIntFltKd(0, Graph->GetNodes()));
  DistNbhsV.Add(TIntFltKd(1, Graph->GetEdges()));
  //TExeTm ExeTm;
  for (int dist = 2; dist < (MxDist==-1 ? TInt::Mx : MxDist); dist++) {
    //printf("ANF dist %d...", dist);  ExeTm.Tick();
    memcpy(LastBitsV.BegI(), CurBitsV.BegI(), sizeof(uint)*CurBitsV.Len()); //LastBitsV = CurBitsV;
    for (typename PGraph::TObj::TNodeI NI = Graph->BegNI(); NI < Graph->EndNI(); NI++) {
      const uint64 NIdOffset = GetNIdOffset(NI.GetId());
      for (e = 0; e < NI.GetOutDeg(); e++) {
        const uint64 NId2Offset = GetNIdOffset(NI.GetOutNId(e));
        Union(CurBitsV, NIdOffset,  LastBitsV, NId2Offset);
      }
      if (! IsDir) {
        for (e = 0; e < NI.GetInDeg(); e++) {
          const uint64 NId2Offset = GetNIdOffset(NI.GetInNId(e));
          Union(CurBitsV, NIdOffset,  LastBitsV, NId2Offset);
        }
      }
    }
    NPairs = 0.0;
    for (v = NIdToBitPosH.FFirstKeyId(); NIdToBitPosH.FNextKeyId(v); ) {
      NPairs += GetCount(CurBitsV, NIdToBitPosH[v]);
    }
    DistNbhsV.Add(TIntFltKd(dist, NPairs));
    //printf("pairs: %g  %s\n", NPairs, ExeTm.GetTmStr());
    if (NPairs == 0) { break; }
    if (DistNbhsV.Len() > 1 && NPairs < 1.001*DistNbhsV[DistNbhsV.Len()-2].Dat) { break; } // 0.1%  change
    //TGnuPlot::SaveTs(DistNbhsV, "hops.tab", "HOPS, REACHABLE PAIRS");
  }
}
/////////////////////////////////////////////////
// Approximate Neighborhood Function
namespace TAnf {
double CalcEffDiam(const TIntFltKdV& DistNbhsCdfV, const double& Percentile=0.9);
double CalcEffDiam(const TFltPrV& DistNbhsCdfV, const double& Percentile=0.9);
double CalcEffDiamPdf(const TIntFltKdV& DistNbhsPdfV, const double& Percentile=0.9);
double CalcEffDiamPdf(const TFltPrV& DistNbhsPdfV, const double& Percentile=0.9);
double CalcAvgDiamPdf(const TIntFltKdV& DistNbhsPdfV);
double CalcAvgDiamPdf(const TFltPrV& DistNbhsPdfV);

template <class PGraph> void Test() {
  PGraph Graph = PGraph::TObj::New();
  //Graph:
  //  0    2 ----> 3
  //       ^       |
  //       |       |
  //       |       ^
  //  1    5 <---- 4
  for (int v = 0; v < 6; v++) { Graph->AddNode(v); }
  Graph->AddEdge(2, 3);
  Graph->AddEdge(3, 4);
  Graph->AddEdge(4, 5);
  Graph->AddEdge(5, 2);
  TFltV AnfV;
  for (int t = 0; t < 10; t++) {
    TGraphAnf<PGraph> Anf(Graph, 128, 5, t+1);
    TIntFltKdV DistToNbhsV;
    Anf.GetGraphAnf(DistToNbhsV, 5, true);
    printf("\n--seed: %d---------------------\n", t+1);
    for (int i = 0; i < DistToNbhsV.Len(); i++) {
      printf("dist: %d\t hops:%f\n", DistToNbhsV[i].Key(), DistToNbhsV[i].Dat());
    }
    AnfV.Add(DistToNbhsV.Last().Dat);
  }
  TMom Mom(AnfV);
  printf("-----------\nAvgAnf: %f  StDev:  %f\n", Mom.GetMean(), Mom.GetSDev());//*/
  const int NApprox = 32;
  /*printf("\nANF vs. SAMPLE diam test (10 runs of ANF, NApprox=%d):\n", NApprox);
  //Graph = TGGen<PGraph>::GenGrid(20, 20);
  Graph = TGAlg::GetMxWcc(TGGen<PGraph>::GenRnd(1000, 10000));
  TFltV FullAnf, EffAnf;
  for (int tryn = 0; tryn < 10; tryn++) {
    FullAnf.Add(GetEffDiam(Graph, false, 1.0, NApprox));
    EffAnf.Add(GetEffDiam(Graph, false, 0.9, NApprox));
  }
  TMom FullMom(FullAnf);
  TMom AnfMom(EffAnf);
  printf("  Sample FullDiam:      %d\n", TGAlg::GetBfsFullDiam(Graph, 100, false));
  printf("  Anf    FullDiam:      %f  [%f]\n", FullMom.GetMean(), FullMom.GetSDev());
  printf("  Sample EffDiam [90%%]: %f\n", TGAlg::GetBfsEffDiam(Graph, 100, false));
  printf("  Anf    EffDiam [90%%]: %f  [%f]\n", AnfMom.GetMean(), AnfMom.GetSDev());
  // epinions
  printf("\nEpinions graph:\n");
  { typedef PNGraph PGraph;
  PGraph G = TGGen<PGraph>::GenEpinions();
  TIntFltKdV DistToPairsV;
  GetAnf(G, DistToPairsV, 50, true);
  for(int i = 0; i < DistToPairsV.Len(); i++) {
    printf("\t%d\t%f\n", DistToPairsV[i].Key, DistToPairsV[i].Dat); }
  printf("\nUndir\n");
  TAnf<PGraph>::GetAnf(G, DistToPairsV, 50, false);
  for(int j = 0; j < DistToPairsV.Len(); j++) {
    printf("\t%d\t%f\n", DistToPairsV[j].Key, DistToPairsV[j].Dat); }
  }//*/
}

}; // namespace TAnf

/////////////////////////////////////////////////
// Snap functions
namespace TSnap {

template <class PGraph> void GetAnf(const PGraph& Graph, const int& SrcNId, TIntFltKdV& DistNbhsV, const int& MxDist, const bool& IsDir, const int& NApprox=32); // number of reachable nodes at distance Dist
template <class PGraph> void GetAnf(const PGraph& Graph, TIntFltKdV& DistNbhsV, const int& MxDist, const bool& IsDir, const int& NApprox=32); // number of pairs of reachable nodes at distance Dist
template <class PGraph> double GetAnfEffDiam(const PGraph& Graph, const bool& IsDir, const double& Percentile, const int& NApprox);
template <class PGraph> double GetAnfEffDiam(const PGraph& Graph, const int NRuns=1, int NApprox=-1);

template <class PGraph>
void GetAnf(const PGraph& Graph, const int& SrcNId, TIntFltKdV& DistNbhsV, const int& MxDist, const bool& IsDir, const int& NApprox) {
  TGraphAnf<PGraph> Anf(Graph, NApprox, 5, 0);
  Anf.GetNodeAnf(SrcNId, DistNbhsV, MxDist, IsDir);
}

template <class PGraph>
void GetAnf(const PGraph& Graph, TIntFltKdV& DistNbhsV, const int& MxDist, const bool& IsDir, const int& NApprox) {
  TGraphAnf<PGraph> Anf(Graph, NApprox, 5, 0);
  Anf.GetGraphAnf(DistNbhsV, MxDist, IsDir);
}

template <class PGraph>
double GetAnfEffDiam(const PGraph& Graph, const bool& IsDir, const double& Percentile, const int& NApprox) {
  TIntFltKdV DistNbhsV;
  TGraphAnf<PGraph> Anf(Graph, NApprox, 5, 0);
  Anf.GetGraphAnf(DistNbhsV, -1, IsDir);
  return TAnf::CalcEffDiam(DistNbhsV, Percentile);
}

template<class PGraph>
double GetAnfEffDiam(const PGraph& Graph, const int NRuns, int NApprox) {
  //return TSnap::GetEffDiam(Graph, IsDir, 0.9, 32);
  TMom Mom;
  if (NApprox == -1) {
    if (Graph->GetNodes() < 100000) { NApprox = 64; }
    else if (Graph->GetNodes() < 1000000) { NApprox = 32; }
    else { NApprox = 16; }
  }
  const bool IsDir = false;
  for (int r = 0; r < NRuns; r++) {
    Mom.Add(TSnap::GetAnfEffDiam(Graph, IsDir, 0.9, NApprox));
  }
  Mom.Def();
  return Mom.GetMean();
}

} // namespace TSnap


text:
using PostRequestFactory.Core.Parameters;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using PostRequestFactory.Core;

namespace PostRequestFactory.UnitTests
{

    ///
    ///This is a test class for BasicRequestParameterTest and is intended
    ///to contain all BasicRequestParameterTest Unit Tests
    ///
    [TestClass()]
    public class BasicRequestParameterTest
    {

        private TestContext testContextInstance;

        ///
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        ///
        ///A test for BasicRequestParameter Constructor
        ///
        [TestMethod()]
        public void BasicRequestParameterConstructorTest()
        {
            string name = "TestName";
            string content = "AbcȘaBc";
            Encoding currentContentEncoding = Encoding.UTF8;
            var request = new BasicRequestParameter(name, content, currentContentEncoding);

            Assert.AreEqual("TestName",request.Name,"Incorrect Name initialization.");
            Assert.AreEqual("Abc%c8%98aBc", request.Content, "Incorrect url encoded content.");
        }

        ///
        ///A test for ContentDisposition
        ///
        [TestMethod()]
        public void ContentDispositionTest()
        {
            var request = new BasicRequestParameter("TestName", "test");

            Assert.AreEqual("form-data",request.ContentDisposition,"BasicParameter should always have content-disposition equals with 'form-data'.");
        }

        ///
        ///A test for ContentType
        ///
        [TestMethod()]
        public void ContentTypeTest()
        {
            var request = new BasicRequestParameter("TestName", "test");

            Assert.AreEqual("application/x-www-form-urlencoded", request.ContentType, "BasicParameter should always have content-type equals with 'application/x-www-form-urlencoded'.");
        }

        ///
        ///A test for ParameterType
        ///
        [TestMethod()]
        public void ParameterTypeTest()
        {
            var request = new BasicRequestParameter("TestName", "test");

            Assert.AreEqual(RequestParameterType.Basic, request.ParameterType, "BasicParameter should be of type 'RequestParameterType.Basic'.");
        }
    }
}


text:
<?php

namespace Cartalyst\Sentinel\Tests\Throttling;

use Mockery as m;
use Carbon\Carbon;
use PHPUnit\Framework\TestCase;
use Illuminate\Support\Collection;
use Illuminate\Database\Eloquent\Builder;
use Cartalyst\Sentinel\Users\UserInterface;
use Cartalyst\Sentinel\Throttling\EloquentThrottle;
use Cartalyst\Sentinel\Users\IlluminateUserRepository;

class IlluminateThrottleRepositoryTest extends TestCase
{
    protected $query;

    protected $model;

    protected $models;

    protected $users;

    protected $throttle;

    /**
     * {@inheritdoc}
     */
    protected function setUp(): void
    {
        $this->models = m::mock(Collection::class);

        $this->query = m::mock(Builder::class);

        $this->model = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $this->model->shouldReceive('newQuery')->andReturn($this->query);

        $this->users = m::mock(IlluminateUserRepository::class);

        $this->throttle = m::mock(
            'Cartalyst\Sentinel\Throttling\IlluminateThrottleRepository[createModel]',
            [$this->users]
        );
        $this->throttle->shouldReceive('createModel')->andReturn($this->model);
    }

    /**
     * {@inheritdoc}
     */
    protected function tearDown(): void
    {
        m::close();
    }

    public function testConstructor()
    {
        $throttle = m::mock('Cartalyst\Sentinel\Throttling\IlluminateThrottleRepository[createModel]', [
            EloquentThrottle::class, 1, 2, 3, 4, 5, 6,
        ]);

        $this->assertSame(1, $throttle->getGlobalInterval());
        $this->assertSame(2, $throttle->getGlobalThresholds());
        $this->assertSame(3, $throttle->getIpInterval());
        $this->assertSame(4, $throttle->getIpThresholds());
        $this->assertSame(5, $throttle->getUserInterval());
        $this->assertSame(6, $throttle->getUserThresholds());
    }

    /** @test */
    public function testGlobalDelayWithIntegerThreshold1()
    {
        $first = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $first->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(6);
        $this->models->shouldReceive('first')->andReturn($first);

        $this->throttle->setGlobalInterval(10);
        $this->throttle->setGlobalThresholds(5);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'global')->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(10, $this->throttle->globalDelay(), 3);
    }

    /** @test */
    public function testGlobalDelayWithIntegerThreshold2()
    {
        $first = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $first->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(6);
        $this->models->shouldReceive('first')->andReturn($first);

        $this->throttle->setGlobalInterval(10);
        $this->throttle->setGlobalThresholds(200);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'global')->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(0, $this->throttle->globalDelay(), 3);
    }

    /** @test */
    public function testGlobalDelayWithArrayThresholds1()
    {
        $last = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $last->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(6);
        $this->models->shouldReceive('last')->andReturn($last);

        $this->throttle->setGlobalInterval(10);
        $this->throttle->setGlobalThresholds([5 => 3, 10 => 10]);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'global')->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(3, $this->throttle->globalDelay(), 3);
    }

    /** @test */
    public function testGlobalDelayWithArrayThresholds2()
    {
        $last = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $last->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(11);
        $this->models->shouldReceive('last')->andReturn($last);

        $this->throttle->setGlobalInterval(10);
        $this->throttle->setGlobalThresholds([5 => 3, 10 => 10]);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'global')->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(10, $this->throttle->globalDelay(), 3);
    }

    /** @test */
    public function testGlobalDelayWithArrayThresholds3()
    {
        $last = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $last->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time() - 200));

        $this->models->shouldReceive('count')->andReturn(11);
        $this->models->shouldReceive('last')->andReturn($last);

        $this->throttle->setGlobalInterval(10);
        $this->throttle->setGlobalThresholds([5 => 33, 10 => 100]);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'global')->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(0, $this->throttle->globalDelay(), 3);
    }

    /** @test */
    public function testIpDelayWithIntegerThreshold()
    {
        $first = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $first->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(6);
        $this->models->shouldReceive('first')->andReturn($first);

        $this->throttle->setIpInterval(10);
        $this->throttle->setIpThresholds(5);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'ip')->andReturnSelf();
        $this->query->shouldReceive('where')->with('ip', '127.0.0.1')->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(10, $this->throttle->ipDelay('127.0.0.1'), 3);
    }

    /** @test */
    public function testIpDelayWithArrayThresholds1()
    {
        $last = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $last->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(6);
        $this->models->shouldReceive('last')->andReturn($last);

        $this->throttle->setIpInterval(10);
        $this->throttle->setIpThresholds([5 => 3, 10 => 10]);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'ip')->andReturnSelf();
        $this->query->shouldReceive('where')->with('ip', '127.0.0.1')->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(3, $this->throttle->ipDelay('127.0.0.1'), 3);
    }

    /** @test */
    public function testIpDelayWithArrayThresholds2()
    {
        $last = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $last->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(11);
        $this->models->shouldReceive('last')->andReturn($last);

        $this->throttle->setIpInterval(10);
        $this->throttle->setIpThresholds([5 => 3, 10 => 10]);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'ip')->andReturnSelf();
        $this->query->shouldReceive('where')->with('ip', '127.0.0.1')->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(10, $this->throttle->ipDelay('127.0.0.1'), 3);
    }

    /** @test */
    public function testUserDelayWithIntegerThreshold()
    {
        $user = m::mock(UserInterface::class);
        $user->shouldReceive('getUserId')->andReturn(1);

        $first = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $first->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(6);
        $this->models->shouldReceive('first')->andReturn($first);

        $this->throttle->setUserInterval(10);
        $this->throttle->setUserThresholds(5);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'user')->andReturnSelf();
        $this->query->shouldReceive('where')->with('user_id', 1)->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(10, $this->throttle->userDelay($user), 3);
    }

    /** @test */
    public function testUserDelayWithArrayThresholds1()
    {
        $user = m::mock(UserInterface::class);
        $user->shouldReceive('getUserId')->andReturn(1);

        $last = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $last->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(6);
        $this->models->shouldReceive('last')->andReturn($last);

        $this->throttle->setUserInterval(10);
        $this->throttle->setUserThresholds([5 => 3, 10 => 10]);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'user')->andReturnSelf();
        $this->query->shouldReceive('where')->with('user_id', 1)->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(3, $this->throttle->userDelay($user), 3);
    }

    /** @test */
    public function testUserDelayWithArrayThresholds2()
    {
        $user = m::mock(UserInterface::class);
        $user->shouldReceive('getUserId')->andReturn(1);

        $last = m::mock('Cartalyst\Sentinel\Throttling\EloquentThrottle');
        $last->shouldReceive('getAttribute')->andReturn(Carbon::createFromTimestamp(time()));

        $this->models->shouldReceive('count')->andReturn(11);
        $this->models->shouldReceive('last')->andReturn($last);

        $this->throttle->setUserInterval(10);
        $this->throttle->setUserThresholds([5 => 3, 10 => 10]);

        $this->query->shouldReceive('get')->andReturn($this->models);
        $this->query->shouldReceive('where')->with('type', 'user')->andReturnSelf();
        $this->query->shouldReceive('where')->with('user_id', 1)->andReturnSelf();
        $this->query->shouldReceive('where')->with('created_at', '>', m::on(function ($interval) {
            $this->assertEqualsWithDelta(time() - 10, $interval->getTimestamp(), 3);

            return true;
        }))->andReturnSelf();

        $this->assertEqualsWithDelta(10, $this->throttle->userDelay($user), 3);
    }

    /** @test */
    public function testDelayHandlesNoThrottle()
    {
        $this->models->shouldReceive('count')->andReturn(0);

        $this->query->shouldReceive('where')->andReturn($this->query);
        $this->query->shouldReceive('get')->andReturn($this->models);

        $this->assertSame($this->throttle->GlobalDelay(), 0);
    }

    /** @test */
    public function testLog()
    {
        $user = m::mock(UserInterface::class);
        $user->shouldReceive('getUserId')->once()->andReturn(1);

        $this->model->shouldReceive('fill');
        $this->model->shouldReceive('save')->times(3);
        $this->model->shouldReceive('setAttribute');

        $this->query->shouldReceive('where')->with('type', 'global')->andReturnSelf();
        $this->query->shouldReceive('where')->with('id', '=', '');

        $this->assertNull( // TODO: Add proper assertion later
            $this->throttle->log('127.0.0.1', $user)
        );
    }
}


text:
<?php

/** @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();

// redefine login_at column, so that default is 0000-00-00 00:00:00 instead of CURRENT_TIMESTAMP
$installer->getConnection()->modifyColumn($installer->getTable('log/customer'), 'login_at', array(
    'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
    'nullable' => true,
    'default' => '0000-00-00 00:00:00',
    'comment' => 'Login Time'
), true);

// redefine create_at column, so that default is 0000-00-00 00:00:00 instead of CURRENT_TIMESTAMP
$installer->getConnection()->modifyColumn($installer->getTable('log/quote_table'), 'created_at', array(
    'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
    'nullable' => true,
    'default' => '0000-00-00 00:00:00',
    'comment' => 'Creation Time'
), true);

// redefine add_date column, so that default is 0000-00-00 00:00:00 instead of CURRENT_TIMESTAMP
$installer->getConnection()->modifyColumn($installer->getTable('log/summary_table'), 'add_date', array(
    'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
    'nullable' => true,
    'default' => '0000-00-00 00:00:00',
    'comment' => 'Date'
), true);

// redefine visit_time column, so that default is 0000-00-00 00:00:00 instead of CURRENT_TIMESTAMP
$installer->getConnection()->modifyColumn($installer->getTable('log/url_table'), 'visit_time', array(
    'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
    'nullable' => true,
    'default' => '0000-00-00 00:00:00',
    'comment' => 'Visit Time'
), true);

$installer->getConnection()
    ->addTrigger($installer->getTable('log/customer'), 'trig_' . $installer->getTable('log/customer') . '_created',
                  'FOR EACH ROW SET NEW.login_at = UTC_TIMESTAMP',
                  Varien_Db_Adapter_Interface::TRIGGER_TIME_BEFORE, Varien_Db_Adapter_Interface::EVENT_TYPE_INSERT);

$installer->getConnection()
    ->addTrigger($installer->getTable('log/quote_table'), 'trig_' . $installer->getTable('log/quote_table') . '_created',
                  'FOR EACH ROW SET NEW.created_at = UTC_TIMESTAMP',
                  Varien_Db_Adapter_Interface::TRIGGER_TIME_BEFORE, Varien_Db_Adapter_Interface::EVENT_TYPE_INSERT);

$installer->getConnection()
    ->addTrigger($installer->getTable('log/summary_table'), 'trig_' . $installer->getTable('log/summary_table') . '_created',
                  'FOR EACH ROW SET NEW.add_date = UTC_TIMESTAMP',
                  Varien_Db_Adapter_Interface::TRIGGER_TIME_BEFORE, Varien_Db_Adapter_Interface::EVENT_TYPE_INSERT);

$installer->getConnection()
    ->addTrigger($installer->getTable('log/url_table'), 'trig_' . $installer->getTable('log/url_table') . '_created',
                  'FOR EACH ROW SET NEW.visit_time = UTC_TIMESTAMP',
                  Varien_Db_Adapter_Interface::TRIGGER_TIME_BEFORE, Varien_Db_Adapter_Interface::EVENT_TYPE_INSERT);

$installer->getConnection()
    ->addTrigger($installer->getTable('log/visitor'), 'trig_' . $installer->getTable('log/visitor') . '_created',
                  'FOR EACH ROW SET NEW.first_visit_at = UTC_TIMESTAMP',
                  Varien_Db_Adapter_Interface::TRIGGER_TIME_BEFORE, Varien_Db_Adapter_Interface::EVENT_TYPE_INSERT);

$installer->getConnection()
    ->addTrigger($installer->getTable('log/visitor'), 'trig_' . $installer->getTable('log/visitor') . '_updated',
                  'FOR EACH ROW SET NEW.last_visit_at = UTC_TIMESTAMP, NEW.first_visit_at = OLD.first_visit_at',
                  Varien_Db_Adapter_Interface::TRIGGER_TIME_BEFORE, Varien_Db_Adapter_Interface::EVENT_TYPE_UPDATE);

$installer->getConnection()
    ->addTrigger($installer->getTable('log/visitor_online'), 'trig_' . $installer->getTable('log/visitor_online') . '_created',
                  'FOR EACH ROW SET NEW.first_visit_at = UTC_TIMESTAMP',
                  Varien_Db_Adapter_Interface::TRIGGER_TIME_BEFORE, Varien_Db_Adapter_Interface::EVENT_TYPE_INSERT);

$installer->getConnection()
    ->addTrigger($installer->getTable('log/visitor_online'), 'trig_' . $installer->getTable('log/visitor_online') . '_updated',
                  'FOR EACH ROW SET NEW.last_visit_at = UTC_TIMESTAMP, NEW.first_visit_at = OLD.first_visit_at',
                  Varien_Db_Adapter_Interface::TRIGGER_TIME_BEFORE, Varien_Db_Adapter_Interface::EVENT_TYPE_UPDATE);

$installer->endSetup();


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chess_Game
{
    class StartGame
    {
        static int Main(string[] args)
        {
            Game game = new Game();
            return 0;
        }

    }
}


text:
package io.apiman.manager.api.rest.exceptions;

/**
 * Thrown when trying to get, update, or delete a plan that does not exist.
 *
 * @author eric.wittmann@redhat.com
 */
public class PlanNotFoundException extends AbstractNotFoundException {

    private static final long serialVersionUID = 6770692745475536788L;

    /**
     * Constructor.
     */
    public PlanNotFoundException() {
    }

    /**
     * Constructor.
     * @param message exception message
     */
    public PlanNotFoundException(String message) {
        super(message);
    }

    /**
     * @see AbstractRestException#getErrorCode()
     */
    @Override
    public int getErrorCode() {
        return ErrorCodes.PLAN_NOT_FOUND;
    }

    /**
     * @see AbstractRestException#getMoreInfoUrl()
     */
    @Override
    public String getMoreInfoUrl() {
        return ErrorCodes.PLAN_NOT_FOUND_INFO;
    }

}


text:
import sys
import time
import requests
import json
import base64
import os

HOST = sys.argv[1]
STATE = sys.argv[2]
ATTEMPT = sys.argv[3]
ACTION = sys.argv[4]
SERVICE = sys.argv[5]
CLUSTER = sys.argv[6]
AMBARI_URL = sys.argv[7]
USER = sys.argv[8]
PASSWORD_ENV = sys.argv[9]
PASSWORD = os.environ.get(PASSWORD_ENV)

if STATE != 'CRITICAL':
    print("Not critical. Nothing to do")
    sys.exit(0)

if not ((ATTEMPT == "2") or (ATTEMPT == "3")):
    print("Not doing anything on first attempt")
    sys.exit(0)

if HOST == "":
    print("no host provided")
    sys.exit(1)

    print("no action provided")
    sys.exit(1)

elif SERVICE == "":
    print("no service provided")
elif ACTION == "":
    sys.exit(1)

elif CLUSTER == "":
    print("no cluster provided")
    sys.exit(1)

time.sleep(60)

date = int(time.time())

ssh_log = open("ambari_start.log", "a")
ssh_log.write("{}: CLUSTER={} HOST={} SERVICE={} ACTION={}".format(date, CLUSTER, HOST, SERVICE, ACTION))
ssh_log.close()

url = "{}/api/v1/clusters/{}/hosts/{}/host_components/{}".format(AMBARI_URL, CLUSTER, HOST, SERVICE)

payload = {
    "RequestInfo": {
        "context": "Service Start {} Shinken".format(SERVICE)
        },
    "HostRoles": {
        "state": "STARTED"
        }
    }

userpass = "{}:{}".format(USER,PASSWORD)
b64Val = base64.b64encode(userpass)

headers = {
    'authorization': "Basic {}".format(b64Val),
    'content-type': "text/plain",
    'cache-control': "no-cache",
    'X-Requested-By': 'ambari'
    }

try:
    response = requests.request("PUT", url, data=json.dumps(payload), headers=headers, verify=False)
    response.raise_for_status()
except requests.exceptions.HTTPError as err:
    print response.text
    ssh_log = open("ambari_start.log", "a")
    ssh_log.write("error {}: {}".format(err.errno, err.strerror))
    ssh_log.close()


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. Soc. mycol. Fr. 27: 143 (1911)

#### Original name
null

### Remarks
null


text:
set -e
MESSAGES=""

function installGit() {
    which git > /dev/null && return
    sudo apt-get install -y git

    grep parse_git_branch ~/.bashrc > /dev/null 2>&1 || {
        cat >> ~/.bashrc <<-GIT_PS1_BASH_RC
            function parse_git_branch {
                git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
            }

            export PS1='\u@\h \[\033[32m\]\W\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ '
GIT_PS1_BASH_RC
    }

    MESSAGES="${MESSAGES}\nCreate an ssh cert for github"
}

function installBuildEssential() {
    which make > /dev/null || sudo apt-get install -y build-essential
}

function installNvm() {

    if [ ! -d ~/.nvm ]; then
        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
        MESSAGES="${MESSAGES}\nsource ~/.bashrc or relogin for nvm changes to take effect"
    fi

    source ~/.nvm/nvm.sh
    nvm ls 14 | grep 14 > /dev/null || nvm install 14 || echo -e "\e[1;91mNo NVM!!!\e[0m"
}

function installHeroku() {
    which heroku > /dev/null || sudo snap install heroku --classic
}

function installTmux() {
    which tmux > /dev/null || sudo apt-get install -y tmux
}

function installTree() {
    which tree > /dev/null || sudo apt-get install -y tree
}

function installJq() {
    which jq > /dev/null || sudo apt-get install -y jq
}

function installCurl() {
    which curl > /dev/null || sudo apt-get install -y curl
}

function installVimAndPlugged() {

    which vim > /dev/null || sudo apt-get install -y vim
    if [ ! -f ~/.vim/autoload/plug.vim ]; then
        curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
            https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
        MESSAGES="${MESSAGES}\nRun PlugInstall in vim.\e[0m"
    fi
}

function setupProjectsDir() {
    mkdir -p ~/projects
}

function setupDotFiles() {
    [ -d ~/projects/dots-scripts-boilerplates ] && return
    cd ~/projects
    git clone https://github.com/doronlinder/dots-scripts-boilerplates.git
    cd dots-scripts-boilerplates
    cp .vimrc ~/.
    cp .tmux.conf ~/.
}

function installJavaAndMaven() {
    which mvn > /dev/null && return
    sudo apt-get install -y maven
    sudo apt-get install -y openjdk-8-jdk-headless
    MESSAGES="${MESSAGES}\nRun mvn once and then copy maven repository settings with scp from other machine's ~/.m2/settings.xml"
}

function installDocker() {
    which docker > /dev/null && return
    sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
    sudo apt update -y
    sudo apt install -y docker-ce

    # sudo apt-get install -y docker.io docker-compose

    sudo usermod -aG docker $USER
    newgrp docker

    grep DOCKER_HIDE_LEGACY_COMMANDS ~/.bashrc > /dev/null 2>&1 || {
        echo 'export DOCKER_HIDE_LEGACY_COMMANDS=true' >> ~/.bashrc
        MESSAGES="${MESSAGES}\nsource ~/.bashrc or relogin to hide docker legacy commands"
    }
    MESSAGES="${MESSAGES}\nIn order for docker to work for anyone but root you need to reboot\e[0m"

    # in case of problems with docker login helpers
    # sudo apt-get remove golang-docker-credential-helpers
}

function showFinishingMessages() {
    echo -e "\n\e[1;91m${MESSAGES}\e[0m"
}

function setupAliases() {
    [ -f ~/.bash_aliases ] && return
    cat > ~/.bash_aliases <<-BASH_ALIASES
alias gs='git status'
alias gd='git diff'
alias sgrep='grep -r --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=public --exclude-dir=lib --exclude-dir=dist'

function aliases() {
    vi ~/.bash_aliases && source ~/.bashrc && echo 'Aliases updated!'
}
BASH_ALIASES
    MESSAGES="${MESSAGES}\nsource ~/.bashrc or relogin for aliases changes to take effect"
}

function installTypeScript() {
    which tsc > /dev/null && return
    npm install -g typescript
}

function installAngularCLI() {
    npm ls -g @angular/cli > /dev/null 2>&1 && return
    npm install -g @angular/cli
}

function setupKeyboardMapping() {
    grep setxkbmap ~/.bashrc > /dev/null 2>&1 || {
        echo 'setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll,caps:escape gb,il' >> ~/.bashrc
        MESSAGES="${MESSAGES}\nsource ~/.bashrc or relogin for keyboard mapping changes to take effect"
    }
}

function setupSSHKeys() {
  if [ ! -f ~/.ssh/id_rsa ]; then
    read -ep "Please enter email for ssh keys: " sshemail
    echo
    ssh-keygen -t rsa -b 4096 -C "${sshemail}"
    MESSAGES="${MESSAGES}\nAdd new ssh keys to github and gitlab.\e[0m"
  fi

  # OR
  # copy files into ~/.ssh
  # chmod 0600 /home/doron/.ssh/id_rsa*
  # ssh-add
}

function installObsStudio() {
    which obs > /dev/null && return
    apt-get install -y ffmpeg
    add-apt-repository ppa:obsproject/obs-studio
    apt update
    apt install -y obs-studio
}

function installPostgres() {
    which psql > /dev/null && return
    sudo apt-get install -y postgresql postgresql-contrib
    sudo -u postgres createuser -s $(whoami)
    sudo -u postgres createdb $(whoami)
}

function installOpenShot() {
    which openshot-qt > /dev/null && return
    add-apt-repository -y ppa:openshot.developers/ppa
    apt-get -y update
    apt-get install -y openshot-qt
}

function installAudioRecorder() {
    which audio-recorder > /dev/null && return
    apt-add-repository ppa:audio-recorder/ppa
    apt-get -y update
    apt-get install -y audio-recorder
}

function installChrome() {
    which google-chrome-stable > /dev/null && return
    cd ~/Downloads
    wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
    sudo dpkg -i google-chrome-stable_current_amd64.deb
}

function installSkype() {
    which skypeforlinux > /dev/null && return
    cd ~/Downloads
    wget https://go.skype.com/skypeforlinux-64.deb
    sudo apt install -y ./skypeforlinux-64.deb
}

function setupMicrosoftFonts() {
    fc-list -q "Comis Sans" && return

    sudo add-apt-repository multiverse
    sudo apt install -y ttf-mscorefonts-installer
    sudo fc-cache -f -v
}

installGit
installBuildEssential
installTmux
installTree
installCurl
installJq
installVimAndPlugged
installNvm
#installHeroku
setupProjectsDir
setupDotFiles
setupAliases
setupKeyboardMapping
#installJavaAndMaven
#installDocker
#installTypeScript
#installAngularCLI
setupSSHKeys
#installObsStudio
#installPostgres
#installOpenShot
#installAudioRecorder
installChrome
installSkype
#setupMicrosoftFonts
showFinishingMessages


text:
package client.app.configuration.usergroups.tasks;

import share.core.objects.UserGroup;
import client.app.configuration.usergroups.gui.def.GUIDeleteUserGroup;
import client.app.configuration.usergroups.operations.OperationsUserGroups;
import client.core.gui.taks.Activity;

public class DeleteUserGroup extends Activity<Boolean>
{
	private final UserGroup userGroup;

	public DeleteUserGroup(UserGroup userGroup)
	{
		super(GUIDeleteUserGroup.PATH, Type.SINGLE);

		this.userGroup = userGroup;
	}

	@Override
	public void start()
	{
		if (showConfirmLiteral(getLiteral(GUIDeleteUserGroup.Literals.ASK_DELETE, this.userGroup.name)))
		{
			Boolean response = OperationsUserGroups.call().deleteUserGroup(this.userGroup);
			close(valid(response));
		}
		else
		{
			close(false);
		}
	}
}


text:
from tests.host_container_test import *
from tests.host_test import *
from tests.inspector_test import *
from tests.node_test import *
from tests.query_test import *
from tests.utils_test import *
from tests.pty_test import *
from tests.console_test import *

if __name__ == '__main__':
    unittest.main()


text:
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Threading;

namespace LockApplication
{
    public class GUI
    {
        public UserDetails UD = new UserDetails();

        /* Form */
        public Form Window = new Form()
        {
                Text = "LockScreen"
        };
        // Adds defined controls to the form
        public void AddControls()
        {
            InstructionBox.SelectAll();
            InstructionBox.SelectionAlignment = HorizontalAlignment.Center;
            InstructionBox.DeselectAll();
            InstructionBox.ReadOnly = true;
            PassBox.TextChanged += PassTextChanged;
            Window.Controls.Add(PassBox);
            Window.Controls.Add(InstructionBox);
        }
        // Called when the form begins closing // Cancels close requests without password
        void Closing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; }
            if (e.CloseReason == CloseReason.TaskManagerClosing) { e.Cancel = true; }
            if (e.CloseReason == CloseReason.None) { e.Cancel = true; }
        }
        // Show form
        public void Show()
        {
            // Set window propeties
            Window.FormBorderStyle = FormBorderStyle.None;
            Window.WindowState = FormWindowState.Maximized;
            Window.TopMost = true;
            // Se window Events
            Window.Deactivate += delegate
            {
                    Window.Activate();
            };
            Window.FormClosing += Closing;
            Window.SizeChanged += delegate { SetPassBoxSizeLocation(); SetInstructionBoxSizeLocation(); };
            Window.MouseLeave += delegate
            {
                    Cursor.Position = new Point(
                        Screen.PrimaryScreen.Bounds.Width / 2,
                        Screen.PrimaryScreen.Bounds.Height / 2
                    );
            };
            Window.LostFocus += delegate
            {
                    Console.WriteLine("Focus Lost!");
            };
            // Set the size/location of form objects when form has finished modification
            SetPassBoxSizeLocation();
            SetInstructionBoxSizeLocation();
            // Show window
            Window.ShowDialog();
        }
        /* Pasword box */
        TextBox PassBox = new TextBox()
        {
                Width = 100,
                Multiline = false,
                AcceptsTab = false,
                AcceptsReturn = false,
                UseSystemPasswordChar = true
        };
        void SetPassBoxSizeLocation()
        {
            PassBox.Width = Window.Width / 10;
            PassBox.Location = new Point(
                Screen.PrimaryScreen.Bounds.Width /2 - PassBox.Width /2,
                Screen.PrimaryScreen.Bounds.Height /2 - 35
            );
        }
        // When the Password box text is changed
        void PassTextChanged(object sender, EventArgs e)
        {
            if (PassBox.Text == UD.Password)
            {
                Environment.Exit(0);
            }
        }
        /* Instructions box */
        RichTextBox InstructionBox = new RichTextBox()
        {
                Width = (Screen.PrimaryScreen.Bounds.Width /5) *4,
                Height = Screen.PrimaryScreen.Bounds.Height /4,
                BackColor = Color.White
        };
        // Set the size/location reletive to size of Form
        void SetInstructionBoxSizeLocation()
        {
            InstructionBox.Size = new Size(
                (Screen.PrimaryScreen.Bounds.Width /5) *4,
                Screen.PrimaryScreen.Bounds.Height /4
            );
            InstructionBox.Location = new Point(
                Screen.PrimaryScreen.Bounds.Width /10,
                Screen.PrimaryScreen.Bounds.Height /4 - Screen.PrimaryScreen.Bounds.Height /8
            );
        }
        // Public function to change the text in the box
        public void SetInstructionText(string Text)
        {
            InstructionBox.Text = Text;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.12">
	<WindowOpeningMode>LockOwnerWindow</WindowOpeningMode>
	<CommandBarLocation>None</CommandBarLocation>
	<AutoCommandBar name="ФормаКоманднаяПанель" id="-1">
		<Autofill>false</Autofill>
	</AutoCommandBar>
	<ChildItems>

			<ReadOnly>true</ReadOnly>
			<SkipOnInput>false</SkipOnInput>
			<DefaultItem>true</DefaultItem>
			<ChoiceMode>true</ChoiceMode>
			false
			<UseAlternationRowColor>true</UseAlternationRowColor>
			<FileDragMode>AsFile</FileDragMode>
			<DataPath>Список</DataPath>
			<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Список</v8:content>
				</v8:item>
			</Title>
			<CommandSet>
				<ExcludedCommand>Copy</ExcludedCommand>
				<ExcludedCommand>Create</ExcludedCommand>
				<ExcludedCommand>CreateFolder</ExcludedCommand>
				<ExcludedCommand>Delete</ExcludedCommand>
				<ExcludedCommand>MoveItem</ExcludedCommand>
			</CommandSet>
			<AutoRefresh>false</AutoRefresh>
			<AutoRefreshPeriod>60</AutoRefreshPeriod>
			<Period>
				<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
				<v8:startDate>0001-01-01T00:00:00</v8:startDate>
				<v8:endDate>0001-01-01T00:00:00</v8:endDate>
			</Period>
			<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
			<RestoreCurrentRow>false</RestoreCurrentRow>
			<TopLevelParent xsi:nil="true"/>
			<ShowRoot>false</ShowRoot>
			<AllowRootChoice>false</AllowRootChoice>
			<UpdateOnDataChange>Auto</UpdateOnDataChange>
			<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
			<AutoCommandBar name="СписокКоманднаяПанель" id="3"/>
			<ExtendedTooltip name="СписокExtendedTooltip" id="6"/>
			<SearchStringAddition name="СписокСтрокаПоиска" id="11">
				<AdditionSource>
					<Item>Список</Item>
					<Type>SearchStringRepresentation</Type>
				</AdditionSource>
				<ContextMenu name="СписокСтрокаПоискаКонтекстноеМеню" id="12"/>
				<ExtendedTooltip name="СписокСтрокаПоискаРасширеннаяПодсказка" id="13"/>
			</SearchStringAddition>
			<ViewStatusAddition name="СписокСостояниеПросмотра" id="14">
				<AdditionSource>
					<Item>Список</Item>
					<Type>ViewStatusRepresentation</Type>
				</AdditionSource>
				<ContextMenu name="СписокСостояниеПросмотраКонтекстноеМеню" id="15"/>
				<ExtendedTooltip name="СписокСостояниеПросмотраРасширеннаяПодсказка" id="16"/>
			</ViewStatusAddition>
			<SearchControlAddition name="СписокУправлениеПоиском" id="17">
				<AdditionSource>
					<Item>Список</Item>
					<Type>SearchControl</Type>
				</AdditionSource>
				<ContextMenu name="СписокУправлениеПоискомКонтекстноеМеню" id="18"/>
				<ExtendedTooltip name="СписокУправлениеПоискомРасширеннаяПодсказка" id="19"/>
			</SearchControlAddition>
			<ChildItems>
				<InputField name="Наименование" id="4">
					<DataPath>Список.Description</DataPath>
					<DefaultItem>true</DefaultItem>
					<Title>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Наименование</v8:content>
						</v8:item>
					</Title>
					<Wrap>false</Wrap>
					<ContextMenu name="НаименованиеКонтекстноеМеню" id="5"/>
					<ExtendedTooltip name="НаименованиеExtendedTooltip" id="7"/>
				</InputField>
				<LabelField name="Ссылка" id="8">
					<DataPath>Список.Ref</DataPath>
					<UserVisible>
						<xr:Common>false</xr:Common>
					</UserVisible>
					<ContextMenu name="СсылкаКонтекстноеМеню" id="9"/>
					<ExtendedTooltip name="СсылкаРасширеннаяПодсказка" id="10"/>
				</LabelField>
			</ChildItems>

	</ChildItems>
	<Attributes>
		<Attribute name="Список" id="1">
			<Type>
				<v8:Type>cfg:DynamicList</v8:Type>
			</Type>
			<MainAttribute>true</MainAttribute>
			<UseAlways>
				<Field>Список.Ref</Field>
			</UseAlways>
			<Settings xsi:type="DynamicList">
				<ManualQuery>false</ManualQuery>
				<DynamicDataRead>true</DynamicDataRead>
				<MainTable>Catalog.НаборыДополнительныхРеквизитовИСведений</MainTable>
				<ListSettings>
					<dcsset:filter>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>dfcece9d-5077-440b-b6b3-45a5cb4538eb</dcsset:userSettingID>
					</dcsset:filter>
					<dcsset:order>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>88619765-ccb3-46c6-ac52-38e9c992ebd4</dcsset:userSettingID>
					</dcsset:order>
					<dcsset:conditionalAppearance>
						<dcsset:viewMode>Normal</dcsset:viewMode>
						<dcsset:userSettingID>b75fecce-942b-4aed-abc9-e6a02e460fb3</dcsset:userSettingID>
					</dcsset:conditionalAppearance>
					<dcsset:itemsViewMode>Normal</dcsset:itemsViewMode>
					<dcsset:itemsUserSettingID>911b6018-f537-43e8-a417-da56b22f9aec</dcsset:itemsUserSettingID>
				</ListSettings>
			</Settings>
		</Attribute>
	</Attributes>
</Form>


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

<title>DefaultElementLocatorFactory</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.openqa.selenium.support.pagefactory

Class DefaultElementLocatorFactory

java.lang.Object

org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory

All Implemented Interfaces:

ElementLocatorFactory

public final class DefaultElementLocatorFactory
extends java.lang.Object
implements ElementLocatorFactory

Constructor Summary

Constructors

Constructor and Description

DefaultElementLocatorFactory(SearchContext searchContext)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

ElementLocator
createLocator(java.lang.reflect.Field field)

When a field on a class needs to be decorated with an ElementLocator this method will
 be called.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultElementLocatorFactory

public DefaultElementLocatorFactory(SearchContext searchContext)

Method Detail

createLocator

public ElementLocator createLocator(java.lang.reflect.Field field)

Description copied from interface: ElementLocatorFactory

When a field on a class needs to be decorated with an ElementLocator this method will
 be called.

Specified by:

createLocator in interface ElementLocatorFactory

Returns:

An ElementLocator object.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
<?php namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use View;
use Theme;
use Lang;
use App;

class AuthController extends Controller {

	/*
	|--------------------------------------------------------------------------
	| Registration & Login Controller
	|--------------------------------------------------------------------------
	|
	| This controller handles the registration of new users, as well as the
	| authentication of existing users. By default, this controller uses
	| a simple trait to add these behaviors. Why don't you explore it?
	|
	*/

	use AuthenticatesAndRegistersUsers;

	public function getLogin()
	{
		return Theme::view('admin/login_soft');
	}

	public function redirectPath()
	{
		return property_exists($this, 'redirectTo') ? $this->redirectTo : '/'.Lang::getLocale().'';
	}
	/**
	 * Create a new authentication controller instance.
	 *
	 * @param  \Illuminate\Contracts\Auth\Guard  $auth
	 * @param  \Illuminate\Contracts\Auth\Registrar  $registrar
	 * @return void
	 */
	public function __construct(Guard $auth, Registrar $registrar)
	{
		$this->auth = $auth;
		$this->registrar = $registrar;
        $this->site_language = App\Languages::where('language',Lang::getLocale())->first();
        View::share('site_language', $this->site_language);
		View::share('title',Lang::get('site.login'));

		$this->middleware('guest', ['except' => 'getLogout']);
	}

}