text:
jquery-mobile-map-js
=================

A lightweight helper library for use with jQuery mobile and the ArcGIS API for JavaScript 3.x. This library isn't
required for ArcGIS API for JavaScript v4.x.

The library automatically recenters the map after phone orientation changes or view transitions. It also correctly reinflates the map where the
map is hidden and then made visible again. Use this with single and multiple view jQuery mapping apps.

Without this library, a JS API 3.x map may perform inconsistently.

##How to use?

		var helper = new jQueryHelper(/* esri.map */ map);

##Features

* jQueryHelper.js - This library takes over the life cycle of the map when users navigate to a child view.
* Three samples - index.html is a single page mobile app, index_twopage.html demonstrates a two page mobile app. And, index_twopage_query.html shows how to use the library with feature layers.
* Helper methods for handling more complex user interface situations that require manipulation of height and width.
* Debounces the map when the window is resized.
* Custom jQuery event "helper-map-loaded" - notifies you when map has been reinflated so that you can restart services or redraw features if required.

##Dependencies
* ArcGIS API for JavaScript
* jQuery and jQuery Mobile

## Resources

* [ArcGIS Developers](http://developers.arcgis.com)
* [ArcGIS REST Services](http://resources.arcgis.com/en/help/arcgis-rest-api/)
* [twitter@esri](http://twitter.com/esri)

## Issues

Find a bug or want to request a new feature?  Please let us know by submitting an issue.

## Contributing

Esri welcomes contributions from anyone and everyone. Your feedback can make the difference between an okay project and an amazingly awesome project. Please see our [guidelines for contributing](https://github.com/esri/contributing).

## Licensing
Copyright 2014 Esri

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

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

A copy of the license is available in the repository's [license.txt]( license.txt) file.

[](Esri Tags: ArcGIS Web Mapping jQuery Mobile)
[](Esri Language: JavaScript)


text:
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <title>simple-animation</title>

Testing setting an animation while a transition is running, in the
    case where the animation synthesizes the initial keyframe

    Start the transition, then start the animation.

    https://bugs.webkit.org/show_bug.cgi?id=41188

  <button onclick="doTransition();">Transition</button>
  <button onclick="doAnimation();">Set Animation</button>

redpajama_set_name: RedPajamaGithub


text:
//
//  CLSortView.m
//  SmallPig
//
//  Created by clei on 15/4/15.
//  Copyright (c) 2015年 chenlei. All rights reserved.
//

#import "CLSortView.h"
#import "DorpDownListView.h"

#define BUTTONBAR_HEIGHT   40.0
#define BUTTONBAR_COLOR    RGB(19.0,19.0,19.0)

@interface CLSortView ()<DorpDownListViewDelegate>
@property (nonatomic, strong) DorpDownListView *dorpView;
@end

@implementation CLSortView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame titleArray:(NSMutableArray *)array
{
    self = [super initWithFrame:frame];
    if (self)
    {
        //_titleDic = [[NSMutableDictionary alloc] init];
        self.clipsToBounds = YES;
        self.selectedIndex = 0;
        self.titleArray = array;
        [self initView];
    }
    return self;
}

#pragma mark 初始化UI
- (void)initView
{
    if (!self.titleArray || [self.titleArray count] == 0)
    {
        return;
    }

    float width = self.frame.size.width/[self.titleArray count];

    for (int i = 0; i < [self.titleArray count]; i ++)
    {
        UIButton *button = [CreateViewTool createButtonWithFrame:CGRectMake(i * width, 0, width, BUTTONBAR_HEIGHT) buttonTitle:self.titleArray[i] titleColor:WHITE_COLOR normalBackgroundColor:BUTTONBAR_COLOR highlightedBackgroundColor:BUTTONBAR_COLOR selectorName:@"buttonBarPressed:" tagDelegate:self];
        button.titleLabel.font = FONT(14.0);
        [button setTitleColor:APP_MAIN_COLOR forState:UIControlStateSelected];
        button.tag = i + 1;
        [self addSubview:button];

        UIImageView *lineView = [CreateViewTool createImageViewWithFrame:CGRectMake(i * width, 2.0, 1.0, BUTTONBAR_HEIGHT - 4.0) placeholderImage:nil];
        lineView.backgroundColor = RGB(38.0, 38.0, 38.0);
        [self addSubview:lineView];
    }
    if (self.dataArray)
    {
        [self initSortListView];
    }

}

- (void)initSortListView
{

    if (!_dorpView && self.dataArray)
    {
        _dorpView = [[DorpDownListView alloc] initWithFrame:CGRectMake(0, BUTTONBAR_HEIGHT, self.frame.size.width, SCREEN_HEIGHT - self.frame.origin.y - BUTTONBAR_HEIGHT)];
        _dorpView.delegate = self;
        [_dorpView setListViewWithColumnArray:self.dataArray];
        [self addSubview:_dorpView];
    }
    else
    {
        _dorpView.columnArray = self.dataArray;
        [_dorpView reloadTableViewDataWithIndex:0];
    }

}

#pragma mark 设置dataArray
- (void)setDataArray:(NSArray *)dataArray
{
    if (dataArray)
    {
        _dataArray = dataArray;
        [self initSortListView];
    }
}

#pragma mark 筛选按钮
- (void)buttonBarPressed:(UIButton *)sender
{
    CGRect frame = self.frame;
    for (int i = 1; i < 5; i++)
    {
        UIButton *button = (UIButton *)[self viewWithTag:i];
        button.selected = NO;
    }
    if (self.selectedIndex == sender.tag)
    {
        sender.selected = NO;
        frame.size.height = BUTTONBAR_HEIGHT;
        self.selectedIndex = 0;
    }
    else
    {
         sender.selected = YES;
        frame.size.height = SCREEN_HEIGHT - frame.origin.y;
        //if (self.delegate && [self.delegate performSelector:@selector(sortView:buttonBarPressedIndex:)])
        {
            [self.delegate sortView:self buttonBarPressedIndex:(int)sender.tag - 1];
        }
        self.selectedIndex = (int)sender.tag;
    }

    [UIView animateWithDuration:.3 animations:^
    {
        self.frame = frame;
    }];

}

#pragma mark dorpListViewDelegate

- (void)dorpDownListView:(DorpDownListView *)dorpDownListView selectedColunmItem:(int)colunm selectedRowItem:(int)row
{
    //if (self.delegate && [self.delegate performSelector:@selector(sortView:sortViewListItemPressedColumn:sortViewListItemPressedRow:)])
    {
        [self.delegate sortView:self sortViewListItemPressedColumn:colunm sortViewListItemPressedRow:row];
    }
    UIButton *button = (UIButton *)[self viewWithTag:self.selectedIndex];
    NSString *title = ([self.dorpView.showName isEqualToString:@"不限"] || !self.dorpView.showName) ? self.titleArray[self.selectedIndex - 1] : self.dorpView.showName;
    [button setTitle:title forState:UIControlStateNormal];
    [button setTitle:title forState:UIControlStateSelected];

    self.selectedIndex = 0;
    button.selected = NO;
    CGRect frame = self.frame;
    frame.size.height = BUTTONBAR_HEIGHT;
    [UIView animateWithDuration:.3 animations:^
     {
         self.frame = frame;
     }];
}

@end


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: The length property of isFinite has the attribute ReadOnly
es5id: 15.1.2.5_A2.3
description: Checking if varying the length property fails
includes: [propertyHelper.js]
---*/

//CHECK#1
var x = isFinite.length;
verifyNotWritable(isFinite, "length", null, Infinity);
if (isFinite.length !== x) {
  $ERROR('#1: x = isFinite.length; isFinite.length = Infinity; isFinite.length === x. Actual: ' + (isFinite.length));
}


text:
- MICS Reimbursement
- Wall of Debt
- New Computer

#What We Went Over:

 - Wall of Debt
     - Write note on the board

- MICS
    - Refunds to be distributed
    - Form has been acknowledged
    - ~1 week to process

- Bank Account - $302.48
    - $200 will be saved for MICS reimbursements
    - Effective balance: $102.38

- TV Stand
    - Now a summer project

 - New Computer
     - Mini computer upgraded older computer
     - Potential setups for second computer:
         - Linux / Windows Dual Boot
         - Linux only
         - Raspberry Pi setup

 - Arcade Machine
     - Switch to Rockcandy XBox 360 wired controllers ($15)

#To Accomplish By Next Meeting:
- Tuck cords away before the summer
- National Membership for EC


text:
read -p "enter file name to test: " var
# check for file
if [[ -f $var  ]]
then
   echo $var is a file
else
   echo $var is not a file
fi


text:
using content::BrowserThread;

namespace electron {

const char* ResourceTypeToString(content::ResourceType type) {
  switch (type) {
    case content::ResourceType::kMainFrame:
      return "mainFrame";
    case content::ResourceType::kSubFrame:
      return "subFrame";
    case content::ResourceType::kStylesheet:
      return "stylesheet";
    case content::ResourceType::kScript:
      return "script";
    case content::ResourceType::kImage:
      return "image";
    case content::ResourceType::kObject:
      return "object";
    case content::ResourceType::kXhr:
      return "xhr";
    default:
      return "other";
  }
}

int32_t GetWebContentsID(int process_id, int frame_id) {
  auto* webContents = content::WebContents::FromRenderFrameHost(
      content::RenderFrameHost::FromID(process_id, frame_id));
  return electron::api::WebContents::GetIDFromWrappedClass(webContents);
}

namespace {

using ResponseHeadersContainer =
    std::pair<scoped_refptr<net::HttpResponseHeaders>*, const std::string&>;

void RunSimpleListener(const AtomNetworkDelegate::SimpleListener& listener,
                       std::unique_ptr<base::DictionaryValue> details,
                       int render_process_id,
                       int render_frame_id) {
  int32_t id = GetWebContentsID(render_process_id, render_frame_id);
  // id must be greater than zero
  if (id)
    details->SetInteger("webContentsId", id);
  return listener.Run(*(details.get()));
}

void RunResponseListener(const AtomNetworkDelegate::ResponseListener& listener,
                         std::unique_ptr<base::DictionaryValue> details,
                         int render_process_id,
                         int render_frame_id,
                         AtomNetworkDelegate::ResponseCallback callback) {
  int32_t id = GetWebContentsID(render_process_id, render_frame_id);
  // id must be greater than zero
  if (id)
    details->SetInteger("webContentsId", id);
  return listener.Run(*(details.get()), std::move(callback));
}

// Test whether the URL of |request| matches |patterns|.
bool MatchesFilterCondition(net::URLRequest* request,
                            const URLPatterns& patterns) {
  if (patterns.empty())
    return true;

  for (const auto& pattern : patterns) {
    if (pattern.MatchesURL(request->url()))
      return true;
  }
  return false;
}

// Overloaded by multiple types to fill the |details| object.
void ToDictionary(base::DictionaryValue* details, net::URLRequest* request) {
  FillRequestDetails(details, request);
  details->SetInteger("id", request->identifier());
  details->SetDouble("timestamp", base::Time::Now().ToDoubleT() * 1000);
  auto* info = content::ResourceRequestInfo::ForRequest(request);
  if (info) {
    details->SetString("resourceType",
                       ResourceTypeToString(info->GetResourceType()));
  } else {
    details->SetString("resourceType", "other");
  }
}

void ToDictionary(base::DictionaryValue* details,
                  const net::HttpRequestHeaders& headers) {
  auto dict = std::make_unique<base::DictionaryValue>();
  net::HttpRequestHeaders::Iterator it(headers);
  while (it.GetNext())
    dict->SetKey(it.name(), base::Value(it.value()));
  details->Set("requestHeaders", std::move(dict));
}

void ToDictionary(base::DictionaryValue* details,
                  const net::HttpResponseHeaders* headers) {
  if (!headers)
    return;

  auto dict = std::make_unique<base::DictionaryValue>();
  size_t iter = 0;
  std::string key;
  std::string value;
  while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
    if (dict->FindKey(key)) {
      base::ListValue* values = nullptr;
      if (dict->GetList(key, &values))
        values->AppendString(value);
    } else {
      auto values = std::make_unique<base::ListValue>();
      values->AppendString(value);
      dict->Set(key, std::move(values));
    }
  }
  details->Set("responseHeaders", std::move(dict));
  details->SetString("statusLine", headers->GetStatusLine());
  details->SetInteger("statusCode", headers->response_code());
}

void ToDictionary(base::DictionaryValue* details, const GURL& location) {
  details->SetString("redirectURL", location.spec());
}

void ToDictionary(base::DictionaryValue* details,
                  const net::IPEndPoint& remote_endpoint) {
  details->SetString("ip", remote_endpoint.ToStringWithoutPort());
}

void ToDictionary(base::DictionaryValue* details, bool from_cache) {
  details->SetBoolean("fromCache", from_cache);
}

void ToDictionary(base::DictionaryValue* details,
                  const net::URLRequestStatus& status) {
  details->SetString("error", net::ErrorToString(status.error()));
}

// Helper function to fill |details| with arbitrary |args|.
template <typename Arg>
void FillDetailsObject(base::DictionaryValue* details, Arg arg) {
  ToDictionary(details, arg);
}

template <typename Arg, typename... Args>
void FillDetailsObject(base::DictionaryValue* details, Arg arg, Args... args) {
  ToDictionary(details, arg);
  FillDetailsObject(details, args...);
}

// Fill the native types with the result from the response object.
void ReadFromResponseObject(const base::DictionaryValue& response,
                            GURL* new_location) {
  std::string url;
  if (response.GetString("redirectURL", &url))
    *new_location = GURL(url);
}

void ReadFromResponseObject(const base::DictionaryValue& response,
                            net::HttpRequestHeaders* headers) {
  const base::DictionaryValue* dict;
  if (response.GetDictionary("requestHeaders", &dict)) {
    headers->Clear();
    for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd();
         it.Advance()) {
      if (it.value().is_string()) {
        std::string value = it.value().GetString();
        headers->SetHeader(it.key(), value);
      }
    }
  }
}

void ReadFromResponseObject(const base::DictionaryValue& response,
                            const ResponseHeadersContainer& container) {
  const base::DictionaryValue* dict;
  std::string status_line;
  if (!response.GetString("statusLine", &status_line))
    status_line = container.second;
  if (response.GetDictionary("responseHeaders", &dict)) {
    auto* headers = container.first;
    *headers = new net::HttpResponseHeaders("");
    (*headers)->ReplaceStatusLine(status_line);
    for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd();
         it.Advance()) {
      const base::ListValue* list;
      if (it.value().GetAsList(&list)) {
        (*headers)->RemoveHeader(it.key());
        for (size_t i = 0; i < list->GetSize(); ++i) {
          std::string value;
          if (list->GetString(i, &value))
            (*headers)->AddHeader(it.key() + " : " + value);
        }
      }
    }
  }
}

}  // namespace

AtomNetworkDelegate::SimpleListenerInfo::SimpleListenerInfo(
    URLPatterns patterns_,
    SimpleListener listener_)
    : url_patterns(patterns_), listener(listener_) {}
AtomNetworkDelegate::SimpleListenerInfo::SimpleListenerInfo() = default;
AtomNetworkDelegate::SimpleListenerInfo::~SimpleListenerInfo() = default;

AtomNetworkDelegate::ResponseListenerInfo::ResponseListenerInfo(
    URLPatterns patterns_,
    ResponseListener listener_)
    : url_patterns(patterns_), listener(listener_) {}
AtomNetworkDelegate::ResponseListenerInfo::ResponseListenerInfo() = default;
AtomNetworkDelegate::ResponseListenerInfo::~ResponseListenerInfo() = default;

AtomNetworkDelegate::AtomNetworkDelegate() {
  auto* command_line = base::CommandLine::ForCurrentProcess();
  if (command_line->HasSwitch(switches::kIgnoreConnectionsLimit)) {
    std::string value =
        command_line->GetSwitchValueASCII(switches::kIgnoreConnectionsLimit);
    ignore_connections_limit_domains_ = base::SplitString(
        value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
  }
}

AtomNetworkDelegate::~AtomNetworkDelegate() {}

void AtomNetworkDelegate::SetSimpleListenerInIO(SimpleEvent type,
                                                URLPatterns patterns,
                                                SimpleListener callback) {
  if (callback.is_null())
    simple_listeners_.erase(type);
  else
    simple_listeners_[type] = {std::move(patterns), std::move(callback)};
}

void AtomNetworkDelegate::SetResponseListenerInIO(ResponseEvent type,
                                                  URLPatterns patterns,
                                                  ResponseListener callback) {
  if (callback.is_null())
    response_listeners_.erase(type);
  else
    response_listeners_[type] = {std::move(patterns), std::move(callback)};
}

int AtomNetworkDelegate::OnBeforeURLRequest(
    net::URLRequest* request,
    net::CompletionOnceCallback callback,
    GURL* new_url) {
  if (!base::Contains(response_listeners_, kOnBeforeRequest)) {
    for (const auto& domain : ignore_connections_limit_domains_) {
      if (request->url().DomainIs(domain)) {
        // Allow unlimited concurrent connections.
        request->SetPriority(net::MAXIMUM_PRIORITY);
        request->SetLoadFlags(request->load_flags() | net::LOAD_IGNORE_LIMITS);
        break;
      }
    }
    return net::OK;
  }

  return HandleResponseEvent(kOnBeforeRequest, request, std::move(callback),
                             new_url);
}

int AtomNetworkDelegate::OnBeforeStartTransaction(
    net::URLRequest* request,
    net::CompletionOnceCallback callback,
    net::HttpRequestHeaders* headers) {
  if (!base::Contains(response_listeners_, kOnBeforeSendHeaders))
    return net::OK;

  return HandleResponseEvent(kOnBeforeSendHeaders, request, std::move(callback),
                             headers, *headers);
}

void AtomNetworkDelegate::OnStartTransaction(
    net::URLRequest* request,
    const net::HttpRequestHeaders& headers) {
  if (!base::Contains(simple_listeners_, kOnSendHeaders))
    return;

  HandleSimpleEvent(kOnSendHeaders, request, headers);
}

int AtomNetworkDelegate::OnHeadersReceived(
    net::URLRequest* request,
    net::CompletionOnceCallback callback,
    const net::HttpResponseHeaders* original,
    scoped_refptr<net::HttpResponseHeaders>* override,
    GURL* allowed) {
  if (!base::Contains(response_listeners_, kOnHeadersReceived))
    return net::OK;

  return HandleResponseEvent(
      kOnHeadersReceived, request, std::move(callback),
      std::make_pair(override, original->GetStatusLine()), original);
}

void AtomNetworkDelegate::OnBeforeRedirect(net::URLRequest* request,
                                           const GURL& new_location) {
  if (!base::Contains(simple_listeners_, kOnBeforeRedirect))
    return;

  HandleSimpleEvent(
      kOnBeforeRedirect, request, new_location, request->response_headers(),
      request->GetResponseRemoteEndpoint(), request->was_cached());
}

void AtomNetworkDelegate::OnResponseStarted(net::URLRequest* request,
                                            int net_error) {
  if (!base::Contains(simple_listeners_, kOnResponseStarted))
    return;

  if (request->status().status() != net::URLRequestStatus::SUCCESS)
    return;

  HandleSimpleEvent(kOnResponseStarted, request, request->response_headers(),
                    request->was_cached());
}

void AtomNetworkDelegate::OnCompleted(net::URLRequest* request,
                                      bool started,
                                      int net_error) {
  // OnCompleted may happen before other events.
  callbacks_.erase(request->identifier());

  if (request->status().status() == net::URLRequestStatus::FAILED ||
      request->status().status() == net::URLRequestStatus::CANCELED) {
    // Error event.
    OnErrorOccurred(request, started, net_error);
    return;
  }

  if (request->response_headers() &&
      net::HttpResponseHeaders::IsRedirectResponseCode(
          request->response_headers()->response_code())) {
    // Redirect event.
    return;
  }

  if (!base::Contains(simple_listeners_, kOnCompleted))
    return;

  HandleSimpleEvent(kOnCompleted, request, request->response_headers(),
                    request->was_cached());
}

void AtomNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) {
  const auto& it = login_handler_map_.find(request->identifier());
  if (it != login_handler_map_.end()) {
    it->second->NotifyRequestDestroyed();
    it->second = nullptr;
    login_handler_map_.erase(it);
  }
  callbacks_.erase(request->identifier());
}

net::NetworkDelegate::AuthRequiredResponse AtomNetworkDelegate::OnAuthRequired(
    net::URLRequest* request,
    const net::AuthChallengeInfo& auth_info,
    AuthCallback callback,
    net::AuthCredentials* credentials) {
  auto* resource_request_info =
      content::ResourceRequestInfo::ForRequest(request);
  if (!resource_request_info)
    return AUTH_REQUIRED_RESPONSE_NO_ACTION;
  login_handler_map_.emplace(
      request->identifier(),
      new LoginHandler(request, auth_info, std::move(callback), credentials,
                       resource_request_info));
  return AUTH_REQUIRED_RESPONSE_IO_PENDING;
}

bool AtomNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
                                          const net::CookieList& cookie_list,
                                          bool allowed_from_caller) {
  return true;
}

bool AtomNetworkDelegate::OnCanSetCookie(
    const net::URLRequest& request,
    const net::CanonicalCookie& cookie_line,
    net::CookieOptions* options,
    bool allowed_from_caller) {
  return true;
}

bool AtomNetworkDelegate::OnCanAccessFile(
    const net::URLRequest& request,
    const base::FilePath& original_path,
    const base::FilePath& absolute_path) const {
  return true;
}

bool AtomNetworkDelegate::OnForcePrivacyMode(
    const GURL& url,
    const GURL& first_party_for_cookies) const {
  return false;
}

bool AtomNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader(
    const net::URLRequest& request,
    const GURL& target_url,
    const GURL& referrer_url) const {
  return false;
}

bool AtomNetworkDelegate::OnCanQueueReportingReport(
    const url::Origin& origin) const {
  return true;
}

void AtomNetworkDelegate::OnCanSendReportingReports(
    std::set<url::Origin> origins,
    base::OnceCallback<void(std::set<url::Origin>)> result_callback) const {
  std::move(result_callback).Run(std::move(origins));
}

bool AtomNetworkDelegate::OnCanSetReportingClient(const url::Origin& origin,
                                                  const GURL& endpoint) const {
  return true;
}

bool AtomNetworkDelegate::OnCanUseReportingClient(const url::Origin& origin,
                                                  const GURL& endpoint) const {
  return true;
}

void AtomNetworkDelegate::OnErrorOccurred(net::URLRequest* request,
                                          bool started,
                                          int net_error) {
  if (!base::Contains(simple_listeners_, kOnErrorOccurred))
    return;

  HandleSimpleEvent(kOnErrorOccurred, request, request->was_cached(),
                    request->status());
}

template <typename Out, typename... Args>
int AtomNetworkDelegate::HandleResponseEvent(
    ResponseEvent type,
    net::URLRequest* request,
    net::CompletionOnceCallback callback,
    Out out,
    Args... args) {
  const auto& info = response_listeners_[type];
  if (!MatchesFilterCondition(request, info.url_patterns))
    return net::OK;

  auto details = std::make_unique<base::DictionaryValue>();
  FillDetailsObject(details.get(), request, args...);

  int render_process_id, render_frame_id;
  content::ResourceRequestInfo::GetRenderFrameForRequest(
      request, &render_process_id, &render_frame_id);

  // The |request| could be destroyed before the |callback| is called.
  callbacks_[request->identifier()] = std::move(callback);

  ResponseCallback response =
      base::BindOnce(&AtomNetworkDelegate::OnListenerResultInUI<Out>,
                     base::Unretained(this), request->identifier(), out);
  base::PostTaskWithTraits(
      FROM_HERE, {BrowserThread::UI},
      base::BindOnce(RunResponseListener, info.listener, std::move(details),
                     render_process_id, render_frame_id, std::move(response)));
  return net::ERR_IO_PENDING;
}

template <typename... Args>
void AtomNetworkDelegate::HandleSimpleEvent(SimpleEvent type,
                                            net::URLRequest* request,
                                            Args... args) {
  const auto& info = simple_listeners_[type];
  if (!MatchesFilterCondition(request, info.url_patterns))
    return;

  auto details = std::make_unique<base::DictionaryValue>();
  FillDetailsObject(details.get(), request, args...);

  int render_process_id, render_frame_id;
  content::ResourceRequestInfo::GetRenderFrameForRequest(
      request, &render_process_id, &render_frame_id);

  base::PostTaskWithTraits(
      FROM_HERE, {BrowserThread::UI},
      base::BindOnce(RunSimpleListener, info.listener, std::move(details),
                     render_process_id, render_frame_id));
}

template <typename T>
void AtomNetworkDelegate::OnListenerResultInIO(
    uint64_t id,
    T out,
    std::unique_ptr<base::DictionaryValue> response) {
  // The request has been destroyed.
  if (!base::Contains(callbacks_, id))
    return;

  ReadFromResponseObject(*response, out);

  bool cancel = false;
  response->GetBoolean("cancel", &cancel);
  std::move(callbacks_[id]).Run(cancel ? net::ERR_BLOCKED_BY_CLIENT : net::OK);
}

template <typename T>
void AtomNetworkDelegate::OnListenerResultInUI(
    uint64_t id,
    T out,
    const base::DictionaryValue& response) {
  auto copy = base::DictionaryValue::From(
      base::Value::ToUniquePtrValue(response.Clone()));
  base::PostTaskWithTraits(
      FROM_HERE, {BrowserThread::IO},
      base::BindOnce(&AtomNetworkDelegate::OnListenerResultInIO<T>,
                     base::Unretained(this), id, out, std::move(copy)));
}

}  // namespace electron


text:
<?php

namespace baibaratsky\WebMoney\Api\X\X22;

use baibaratsky\WebMoney\Api\X;
use baibaratsky\WebMoney\Exception\ApiException;
use baibaratsky\WebMoney\Signer;
use baibaratsky\WebMoney\Request\RequestValidator;

/**
 * Class Request
 *
 * @link https://wiki.wmtransfer.com/projects/webmoney/wiki/Interface_X22
 * @link https://merchant.wmtransfer.com/conf/guide.asp
 */
class Request extends X\Request
{
    /** @var string validityperiodinhours */
    protected $validityPeriodInHours;

    /** @var string sha256 */
    protected $sha256;

    /** @var string md5 */
    protected $md5;

    /** @var string secret_key */
    protected $secretKey;

    /** @var string lmi_payee_purse */
    protected $payeePurse;

    /** @var float lmi_payment_amount */
    protected $paymentAmount;

    /** @var int lmi_payment_no */
    protected $paymentNumber;

    /** @var string lmi_payment_desc */
    protected $paymentDescription;

    const SIM_MODE_SUCCESS = 0;
    const SIM_MODE_FAILURE = 1;
    const SIM_MODE_80x20 = 2;

    /** @var int lmi_sim_mode */
    protected $simMode;

    /** @var string lmi_result_url */
    protected $resultUrl;

    const URL_METHOD_GET = 0;
    const URL_METHOD_POST = 1;
    const URL_METHOD_LINK = 2;

    /** @var string lmi_success_url */
    protected $successUrl;

    /** @var int lmi_success_method */
    protected $successMethod;

    /** @var string lmi_fail_url */
    protected $failUrl;

    /** @var int lmi_fail_method */
    protected $failMethod;

    /** @var string lmi_paymer_pinnumberinside */
    protected $paymerPinNumberInside;

    /** @var string lmi_wmnote_pinnumberinside */
    protected $wmNotePinNumberInside;

    /** @var string lmi_paymer_email */
    protected $paymerEmail;

    /** @var string lmi_wmcheck_numberinside */
    protected $wmCheckNumberInside;

    /** @var string lmi_wmcheck_codeinside */
    protected $wmCheckCodeInside;

    const SDP_TYPE_MONEY_TRANSFER = 0;
    const SDP_TYPE_ALFA_CLICK = 3;
    const SDP_TYPE_RU_CARD = 4;
    const SDP_TYPE_RUSSIAN_STANDARD = 5;
    const SDP_TYPE_VTB24 = 6;
    const SDP_TYPE_SBERBANK_THANK_YOU = 7;
    const SDP_TYPE_UA_TERMINALS_AND_BANKS = 8;

    /** @var int lmi_allow_sdp */
    protected $allowSdp;

    /** @var int lmi_fast_phonenumber */
    protected $fastPhoneNumber;

    /** @var int lmi_payment_creditdays */
    protected $paymentCreditDays;

    /** @var int lmi_shop_id */
    protected $shopId;

    /** @var string[] */
    protected $userTags = array();

    const PAYMENT_METHOD_KEEPER_WEB = 'authtype_2';
    const PAYMENT_METHOD_WM_CARD = 'authtype_3';
    const PAYMENT_METHOD_KEEPER_MOBILE = 'authtype_4';
    const PAYMENT_METHOD_E_NUM = 'authtype_5';
    const PAYMENT_METHOD_PAYMER_CHECK = 'authtype_6';
    const PAYMENT_METHOD_TERMINAL = 'authtype_7';
    const PAYMENT_METHOD_KEEPER_WIN = 'authtype_8';
    const PAYMENT_METHOD_KEEPER_STD = 'authtype_9';
    const PAYMENT_METHOD_WM_NOTE = 'authtype_10';
    const PAYMENT_METHOD_RU_POST = 'authtype_11';
    const PAYMENT_METHOD_KEEPER_SOCIAL_NET = 'authtype_12';
    const PAYMENT_METHOD_WM_CHECK = 'authtype_13';
    const PAYMENT_METHOD_RU_MONEY_TRANSFER = 'authtype_14';
    const PAYMENT_METHOD_RU_CARD = 'authtype_16';
    const PAYMENT_METHOD_MOBILE_NUMBER = 'authtype_17';
    const PAYMENT_METHOD_ALPHA_CLICK = 'authtype_18';
    const PAYMENT_METHOD_SBERBANK_THANKYOU = 'authtype_19';

    /** @var string at */
    protected $paymentMethod;

    /**
     * @param string $authType
     * @param string $secretKey
     * @throws ApiException
     */
    public function __construct($authType = self::AUTH_CLASSIC, $secretKey = null)
    {
        if (
                $secretKey === null
                && in_array($authType, array(self::AUTH_SHA256, self::AUTH_MD5, self::AUTH_SECRET_KEY))
        ) {
            throw new ApiException('Secret key is required for this authentication type.');
        }

        $this->url = 'https://merchant.webmoney.ru/conf/xml/XMLTransSave.asp';
        $this->secretKey = $secretKey;

        parent::__construct($authType);
    }

    /**
     * @return array
     */
    protected function getValidationRules()
    {
        return array(
                RequestValidator::TYPE_REQUIRED => array('signerWmid', 'validityPeriodInHours', 'payeePurse',
                                                         'paymentAmount', 'paymentDescription'),
                RequestValidator::TYPE_RANGE => array(
                        'simMode' => array(
                                self::SIM_MODE_SUCCESS,
                                self::SIM_MODE_FAILURE,
                                self::SIM_MODE_80x20,
                        ),
                        'successMethod' => array(
                                self::URL_METHOD_GET,
                                self::URL_METHOD_POST,
                                self::URL_METHOD_LINK,
                        ),
                        'failMethod' => array(
                                self::URL_METHOD_GET,
                                self::URL_METHOD_POST,
                                self::URL_METHOD_LINK,
                        ),
                ),
        );
    }

    /**
     * @return string
     */
    public function getData()
    {
        $xml = '<merchant.request>';

        $xml .= '<signtags>';
        $xml .= self::xmlElement('wmid', $this->signerWmid);
        $xml .= self::xmlElement('validityperiodinhours', $this->validityPeriodInHours);
        $xml .= self::xmlElement('sign', $this->signature);
        $xml .= self::xmlElement('sha256', $this->sha256);
        $xml .= self::xmlElement('md5', $this->md5);
        if ($this->authType === self::AUTH_SECRET_KEY) {
            $xml .= self::xmlElement('secret_key', $this->secretKey);
        }
        $xml .= '</signtags>';

        $xml .= '<paymenttags>';
        $xml .= self::xmlElement('lmi_payee_purse', $this->payeePurse);
        $xml .= self::xmlElement('lmi_payment_amount', $this->paymentAmount);
        $xml .= self::xmlElement('lmi_payment_no', $this->paymentNumber);
        if (preg_match('/[\x80-\xFF]/', $this->paymentDescription)) {  // utf8 ?
            $xml .= self::xmlElement('lmi_payment_desc_base64', base64_encode($this->paymentDescription));
        } else {
            $xml .= self::xmlElement('lmi_payment_desc', $this->paymentDescription);
        }
        $xml .= self::xmlElement('lmi_sim_mode', $this->simMode);
        $xml .= self::xmlElement('lmi_result_url', htmlspecialchars($this->resultUrl));
        $xml .= self::xmlElement('lmi_success_url', htmlspecialchars($this->successUrl));
        $xml .= self::xmlElement('lmi_success_method', $this->successMethod);
        $xml .= self::xmlElement('lmi_fail_url', htmlspecialchars($this->failUrl));
        $xml .= self::xmlElement('lmi_fail_method', $this->failMethod);
        $xml .= self::xmlElement('lmi_paymer_pinnumberinside', $this->paymerPinNumberInside);
        $xml .= self::xmlElement('lmi_wmnote_pinnumberinside', $this->wmNotePinNumberInside);
        $xml .= self::xmlElement('lmi_paymer_email', $this->paymerEmail);
        $xml .= self::xmlElement('lmi_wmcheck_numberinside', $this->wmCheckNumberInside);
        $xml .= self::xmlElement('lmi_wmcheck_codeinside', $this->wmCheckCodeInside);
        $xml .= self::xmlElement('lmi_allow_sdp', $this->allowSdp);
        $xml .= self::xmlElement('lmi_fast_phonenumber', $this->fastPhoneNumber);
        $xml .= self::xmlElement('lmi_payment_creditdays', $this->paymentCreditDays);
        $xml .= self::xmlElement('lmi_shop_id', $this->shopId);
        $xml .= self::xmlElement('at', $this->paymentMethod);
        foreach ($this->userTags as $tagName => $tagValue) {
            $xml .= self::xmlElement($tagName, $tagValue);
        }
        $xml .= '</paymenttags>';

        $xml .= '</merchant.request>';

        return $xml;
    }

    /**
     * @return string
     */
    public function getResponseClassName()
    {
        return Response::className();
    }

    /**
     * @param Signer $requestSigner
     */
    public function sign(Signer $requestSigner = null)
    {
        if ($this->authType === self::AUTH_CLASSIC) {
            $this->signature = $requestSigner->sign($this->signerWmid . $this->payeePurse . $this->paymentNumber . $this->validityPeriodInHours);
        } elseif ($this->authType === self::AUTH_SHA256) {
            $this->sha256 = hash(
                    'sha256',
                    $this->signerWmid . $this->payeePurse . $this->paymentNumber . $this->validityPeriodInHours . $this->secretKey
            );
        } elseif ($this->authType === self::AUTH_MD5) {
            $this->md5 = md5($this->signerWmid . $this->payeePurse . $this->paymentNumber . $this->validityPeriodInHours . $this->secretKey);
        }
    }

    /**
     * @return int validityperiodinhours
     */
    public function getValidityPeriodInHours()
    {
        return $this->validityPeriodInHours;
    }

    /**
     * @param int $validityPeriodInHours validityperiodinhours
     */
    public function setValidityPeriodInHours($validityPeriodInHours)
    {
        $this->validityPeriodInHours = $validityPeriodInHours;
    }

    /**
     * @return string lmi_payee_purse
     */
    public function getPayeePurse()
    {
        return $this->payeePurse;
    }

    /**
     * @param string $payeePurse lmi_payee_purse
     */
    public function setPayeePurse($payeePurse)
    {
        $this->payeePurse = $payeePurse;
    }

    /**
     * @return float lmi_payment_amount
     */
    public function getPaymentAmount()
    {
        return $this->paymentAmount;
    }

    /**
     * @param float $paymentAmount lmi_payment_amount
     */
    public function setPaymentAmount($paymentAmount)
    {
        $this->paymentAmount = $paymentAmount;
    }

    /**
     * @return int lmi_payment_no
     */
    public function getPaymentNumber()
    {
        return $this->paymentNumber;
    }

    /**
     * @param int $paymentNumber lmi_payment_no
     */
    public function setPaymentNumber($paymentNumber)
    {
        $this->paymentNumber = $paymentNumber;
    }

    /**
     * @return string lmi_payment_desc
     */
    public function getPaymentDescription()
    {
        return $this->paymentDescription;
    }

    /**
     * @param string $paymentDescription lmi_payment_desc
     */
    public function setPaymentDescription($paymentDescription)
    {
        $this->paymentDescription = $paymentDescription;
    }

    /**
     * @return int lmi_sim_mode
     */
    public function getSimMode()
    {
        return $this->simMode;
    }

    /**
     * @param int $simMode lmi_sim_mode
     */
    public function setSimMode($simMode)
    {
        $this->simMode = $simMode;
    }

    /**
     * @return string lmi_result_url
     */
    public function getResultUrl()
    {
        return $this->resultUrl;
    }

    /**
     * @param string $resultUrl lmi_result_url
     */
    public function setResultUrl($resultUrl)
    {
        $this->resultUrl = $resultUrl;
    }

    /**
     * @return string lmi_success_url
     */
    public function getSuccessUrl()
    {
        return $this->successUrl;
    }

    /**
     * @param string $successUrl lmi_success_url
     */
    public function setSuccessUrl($successUrl)
    {
        $this->successUrl = $successUrl;
    }

    /**
     * @return string lmi_success_method
     */
    public function getSuccessMethod()
    {
        return $this->successMethod;
    }

    /**
     * @param int $successMethod lmi_success_method
     */
    public function setSuccessMethod($successMethod)
    {
        $this->successMethod = $successMethod;
    }

    /**
     * @return string lmi_fail_url
     */
    public function getFailUrl()
    {
        return $this->failUrl;
    }

    /**
     * @param string $failUrl lmi_fail_url
     */
    public function setFailUrl($failUrl)
    {
        $this->failUrl = $failUrl;
    }

    /**
     * @return int lmi_fail_method
     */
    public function getFailMethod()
    {
        return $this->failMethod;
    }

    /**
     * @param string $failMethod lmi_fail_method
     */
    public function setFailMethod($failMethod)
    {
        $this->failMethod = $failMethod;
    }

    /**
     * @return string lmi_paymer_pinnumberinside
     */
    public function getPaymerPinNumberInside()
    {
        return $this->paymerPinNumberInside;
    }

    /**
     * @param string $paymerPinNumberInside lmi_paymer_pinnumberinside
     */
    public function setPaymerPinNumberInside($paymerPinNumberInside)
    {
        $this->paymerPinNumberInside = $paymerPinNumberInside;
    }

    /**
     * @return string lmi_wmnote_pinnumberinside
     */
    public function getWmNotePinNumberInside()
    {
        return $this->wmNotePinNumberInside;
    }

    /**
     * @param string $wmNotePinNumberInside lmi_wmnote_pinnumberinside
     */
    public function setWmNotePinNumberInside($wmNotePinNumberInside)
    {
        $this->wmNotePinNumberInside = $wmNotePinNumberInside;
    }

    /**
     * @return string lmi_paymer_email
     */
    public function getPaymerEmail()
    {
        return $this->paymerEmail;
    }

    /**
     * @param string $paymerEmail lmi_paymer_email
     */
    public function setPaymerEmail($paymerEmail)
    {
        $this->paymerEmail = $paymerEmail;
    }

    /**
     * @return string lmi_wmcheck_numberinside
     */
    public function getWmCheckNumberInside()
    {
        return $this->wmCheckNumberInside;
    }

    /**
     * @param string $wmCheckNumberInside lmi_wmcheck_numberinside
     */
    public function setWmCheckNumberInside($wmCheckNumberInside)
    {
        $this->wmCheckNumberInside = $wmCheckNumberInside;
    }

    /**
     * @return string lmi_wmcheck_codeinside
     */
    public function getWmCheckCodeInside()
    {
        return $this->wmCheckCodeInside;
    }

    /**
     * @param string $wmCheckCodeInside lmi_wmcheck_codeinside
     */
    public function setWmCheckCodeInside($wmCheckCodeInside)
    {
        $this->wmCheckCodeInside = $wmCheckCodeInside;
    }

    /**
     * @return int lmi_allow_sdp
     */
    public function getAllowSdp()
    {
        return $this->allowSdp;
    }

    /**
     * @param int $allowSdp lmi_allow_sdp
     */
    public function setAllowSdp($allowSdp)
    {
        $this->allowSdp = $allowSdp;
    }

    /**
     * @return int lmi_fast_phonenumber
     */
    public function getFastPhoneNumber()
    {
        return $this->fastPhoneNumber;
    }

    /**
     * @param int $fastPhoneNumber lmi_fast_phonenumber
     */
    public function setFastPhoneNumber($fastPhoneNumber)
    {
        $this->fastPhoneNumber = $fastPhoneNumber;
    }

    /**
     * @return int lmi_payment_creditdays
     */
    public function getPaymentCreditDays()
    {
        return $this->paymentCreditDays;
    }

    /**
     * @param int $paymentCreditDays lmi_payment_creditdays
     */
    public function setPaymentCreditDays($paymentCreditDays)
    {
        $this->paymentCreditDays = $paymentCreditDays;
    }

    /**
     * @return int lmi_shop_id
     */
    public function getShopId()
    {
        return $this->shopId;
    }

    /**
     * @param int $shopId lmi_shop_id
     */
    public function setShopId($shopId)
    {
        $this->shopId = $shopId;
    }

    /**
     * @param string $tagName
     * @return string
     */
    public function getUserTag($tagName)
    {
        return isset($this->userTags[$tagName]) ? $this->userTags[$tagName] : null;
    }

    /**
     * @param string $tagName
     * @param string $tagValue
     * @throws ApiException
     */
    public function setUserTag($tagName, $tagValue)
    {
        $tagName = trim($tagName);
        if (empty($tagName)) {
            return;
        }
        if (preg_match('/^lmi_/i', $tagName)) {
            throw new ApiException('"LMI_" prefix for user tags is forbidden.');
        }
        if (preg_match('/^__/i', $tagName)) {
            throw new ApiException('"__" prefix for user tags is forbidden.');
        }
        if ($tagName == 'at') {
            throw new ApiException('Use setPaymentMethod() instead.');
        }
        $this->userTags[$tagName] = $tagValue;
    }

    /**
     * @return string
     */
    public function getPaymentMethod()
    {
        return $this->paymentMethod;
    }

    /**
     * @param string $paymentMethod
     */
    public function setPaymentMethod($paymentMethod)
    {
        $this->paymentMethod = $paymentMethod;
    }
}


text:
create table ACT_HI_TSK_LOG (
  ID_ SERIAL PRIMARY KEY,
  TYPE_ varchar(64),
  TASK_ID_ varchar(64) not null,
  TIME_STAMP_ timestamp not null,
  USER_ID_ varchar(255),
  DATA_ varchar(4000),
  EXECUTION_ID_ varchar(64),
  PROC_INST_ID_ varchar(64),
  PROC_DEF_ID_ varchar(64),
  SCOPE_ID_ varchar(255),
  SCOPE_DEFINITION_ID_ varchar(255),
  SUB_SCOPE_ID_ varchar(255),
  SCOPE_TYPE_ varchar(255),
  TENANT_ID_ varchar(255) default ''
);

create table ACT_RU_ENTITYLINK (
    ID_ varchar(64),
    REV_ integer,
    CREATE_TIME_ timestamp,
    LINK_TYPE_ varchar(255),
    SCOPE_ID_ varchar(255),
    SCOPE_TYPE_ varchar(255),
    SCOPE_DEFINITION_ID_ varchar(255),
    REF_SCOPE_ID_ varchar(255),
    REF_SCOPE_TYPE_ varchar(255),
    REF_SCOPE_DEFINITION_ID_ varchar(255),
    HIERARCHY_TYPE_ varchar(255),
    primary key (ID_)
);

create index ACT_IDX_ENT_LNK_SCOPE on ACT_RU_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_);
create index ACT_IDX_ENT_LNK_SCOPE_DEF on ACT_RU_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_);

create table ACT_HI_ENTITYLINK (
    ID_ varchar(64),
    LINK_TYPE_ varchar(255),
    CREATE_TIME_ timestamp,
    SCOPE_ID_ varchar(255),
    SCOPE_TYPE_ varchar(255),
    SCOPE_DEFINITION_ID_ varchar(255),
    REF_SCOPE_ID_ varchar(255),
    REF_SCOPE_TYPE_ varchar(255),
    REF_SCOPE_DEFINITION_ID_ varchar(255),
    HIERARCHY_TYPE_ varchar(255),
    primary key (ID_)
);

create index ACT_IDX_HI_ENT_LNK_SCOPE on ACT_HI_ENTITYLINK(SCOPE_ID_, SCOPE_TYPE_, LINK_TYPE_);
create index ACT_IDX_HI_ENT_LNK_SCOPE_DEF on ACT_HI_ENTITYLINK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_, LINK_TYPE_);

update ACT_GE_PROPERTY set VALUE_ = '6.4.1.3' where NAME_ = 'common.schema.version';

update ACT_GE_PROPERTY set VALUE_ = '6.4.1.3' where NAME_ = 'task.schema.version';

insert into ACT_GE_PROPERTY values ('entitylink.schema.version', '6.4.1.3', 1);

update ACT_GE_PROPERTY set VALUE_ = '6.4.1.3' where NAME_ = 'job.schema.version';

update ACT_GE_PROPERTY set VALUE_ = '6.4.1.3' where NAME_ = 'identitylink.schema.version';

update ACT_GE_PROPERTY set VALUE_ = '6.4.1.3' where NAME_ = 'variable.schema.version';
create table ACT_RU_ACTINST (
    ID_ varchar(64) not null,
    REV_ integer default 1,
    PROC_DEF_ID_ varchar(64) not null,
    PROC_INST_ID_ varchar(64) not null,
    EXECUTION_ID_ varchar(64) not null,
    ACT_ID_ varchar(255) not null,
    TASK_ID_ varchar(64),
    CALL_PROC_INST_ID_ varchar(64),
    ACT_NAME_ varchar(255),
    ACT_TYPE_ varchar(255) not null,
    ASSIGNEE_ varchar(255),
    START_TIME_ timestamp not null,
    END_TIME_ timestamp,
    DURATION_ bigint,
    DELETE_REASON_ varchar(4000),
    TENANT_ID_ varchar(255) default '',
    primary key (ID_)
);

create index ACT_IDX_RU_ACTI_START on ACT_RU_ACTINST(START_TIME_);
create index ACT_IDX_RU_ACTI_END on ACT_RU_ACTINST(END_TIME_);
create index ACT_IDX_RU_ACTI_PROC on ACT_RU_ACTINST(PROC_INST_ID_);
create index ACT_IDX_RU_ACTI_PROC_ACT on ACT_RU_ACTINST(PROC_INST_ID_, ACT_ID_);
create index ACT_IDX_RU_ACTI_EXEC on ACT_RU_ACTINST(EXECUTION_ID_);
create index ACT_IDX_RU_ACTI_EXEC_ACT on ACT_RU_ACTINST(EXECUTION_ID_, ACT_ID_);

delete
from ACT_RU_VARIABLE
where TYPE_ in ('item', 'message')
  and BYTEARRAY_ID_ is null
  and DOUBLE_ is null
  and LONG_ is null
  and TEXT_ is null
  and TEXT2_ is null;

delete
from ACT_RU_VARIABLE
where TYPE_ = 'null'
  and NAME_ in ('org.activiti.engine.impl.bpmn.CURRENT_MESSAGE', 'org.flowable.engine.impl.bpmn.CURRENT_MESSAGE');

update ACT_GE_PROPERTY set VALUE_ = '6.4.1.3' where NAME_ = 'schema.version';

delete
from ACT_HI_VARINST
where VAR_TYPE_ in ('item', 'message')
  and BYTEARRAY_ID_ is null
  and DOUBLE_ is null
  and LONG_ is null
  and TEXT_ is null
  and TEXT2_ is null;

delete from ACT_HI_VARINST
where VAR_TYPE_ = 'null'
and NAME_ in ('org.activiti.engine.impl.bpmn.CURRENT_MESSAGE', 'org.flowable.engine.impl.bpmn.CURRENT_MESSAGE');

update ACT_ID_PROPERTY set VALUE_ = '6.4.1.3' where NAME_ = 'schema.version';

UPDATE act_app_databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = '192.168.1.5 (192.168.1.5)', LOCKGRANTED = '2019-03-13 21:24:44.346' WHERE ID = 1 AND LOCKED = FALSE;

CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_);

INSERT INTO act_app_databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('3', 'flowable', 'org/flowable/app/db/liquibase/flowable-app-db-changelog.xml', NOW(), 2, '7:4ef4a0a9e9cfb636c22126d540cdd38e', 'createIndex indexName=ACT_IDX_APP_DEF_UNIQ, tableName=ACT_APP_APPDEF', '', 'EXECUTED', NULL, NULL, '3.5.3', '2508684901');

UPDATE act_app_databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

UPDATE act_cmmn_databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = '192.168.1.5 (192.168.1.5)', LOCKGRANTED = '2019-03-13 21:24:45.013' WHERE ID = 1 AND LOCKED = FALSE;

CREATE UNIQUE INDEX ACT_IDX_CASE_DEF_UNIQ ON ACT_CMMN_CASEDEF(KEY_, VERSION_, TENANT_ID_);

INSERT INTO act_cmmn_databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('6', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', NOW(), 5, '7:2b33c819a1ef81d793f7ef82bed8b1ac', 'createIndex indexName=ACT_IDX_CASE_DEF_UNIQ, tableName=ACT_CMMN_CASEDEF', '', 'EXECUTED', NULL, NULL, '3.5.3', '2508685113');

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST RENAME COLUMN START_TIME_ TO CREATE_TIME_;

ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST RENAME COLUMN CREATED_TIME_ TO CREATE_TIME_;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_AVAILABLE_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_ENABLED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_DISABLED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_STARTED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD LAST_SUSPENDED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD COMPLETED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD OCCURRED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD TERMINATED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENDED_TIME_ TIMESTAMP(3) WITHOUT TIME ZONE;

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255);

ALTER TABLE ACT_CMMN_RU_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255);

ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD ENTRY_CRITERION_ID_ VARCHAR(255);

ALTER TABLE ACT_CMMN_HI_PLAN_ITEM_INST ADD EXIT_CRITERION_ID_ VARCHAR(255);

INSERT INTO act_cmmn_databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('7', 'flowable', 'org/flowable/cmmn/db/liquibase/flowable-cmmn-db-changelog.xml', NOW(), 6, '7:ff6d918908599427d849c1f3b109cf1c', 'renameColumn newColumnName=CREATE_TIME_, oldColumnName=START_TIME_, tableName=ACT_CMMN_RU_PLAN_ITEM_INST; renameColumn newColumnName=CREATE_TIME_, oldColumnName=CREATED_TIME_, tableName=ACT_CMMN_HI_PLAN_ITEM_INST; addColumn tableName=ACT_CMMN_RU_P...', '', 'EXECUTED', NULL, NULL, '3.5.3', '2508685113');

UPDATE act_cmmn_databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

UPDATE act_dmn_databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = '192.168.1.5 (192.168.1.5)', LOCKGRANTED = '2019-03-13 21:24:45.286' WHERE ID = 1 AND LOCKED = FALSE;

CREATE UNIQUE INDEX ACT_IDX_DEC_TBL_UNIQ ON ACT_DMN_DECISION_TABLE(KEY_, VERSION_, TENANT_ID_);

INSERT INTO act_dmn_databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('6', 'flowable', 'org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml', NOW(), 5, '7:c44cb06af8977c776a4e93aebe96c568', 'createIndex indexName=ACT_IDX_DEC_TBL_UNIQ, tableName=ACT_DMN_DECISION_TABLE', '', 'EXECUTED', NULL, NULL, '3.5.3', '2508685343');

UPDATE act_dmn_databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

UPDATE act_fo_databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = '192.168.1.5 (192.168.1.5)', LOCKGRANTED = '2019-03-13 21:24:45.442' WHERE ID = 1 AND LOCKED = FALSE;

CREATE UNIQUE INDEX ACT_IDX_FORM_DEF_UNIQ ON ACT_FO_FORM_DEFINITION(KEY_, VERSION_, TENANT_ID_);

INSERT INTO act_fo_databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('5', 'flowable', 'org/flowable/form/db/liquibase/flowable-form-db-changelog.xml', NOW(), 4, '7:80b47424c1d564a692fc8923633f78e4', 'createIndex indexName=ACT_IDX_FORM_DEF_UNIQ, tableName=ACT_FO_FORM_DEFINITION', '', 'EXECUTED', NULL, NULL, '3.5.3', '2508685503');

UPDATE act_fo_databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

UPDATE act_co_databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = '192.168.1.5 (192.168.1.5)', LOCKGRANTED = '2019-03-13 21:24:45.613' WHERE ID = 1 AND LOCKED = FALSE;

UPDATE act_co_databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


text:
<?php
/**
 * --------------------------------------------------------------------------
 * Cartify
 * --------------------------------------------------------------------------
 *
 * Cartify, a shopping cart bundle for use with the Laravel Framework.
 *
 * @package  Cartify
 * @version  2.1.1
 * @author   Bruno Gaspar <brunofgaspar1@gmail.com>
 * @link     https://github.com/bruno-g/cartify
 */

#############################################################
############ This file is for the examples only! ############
#############################################################

/**
 * Libraries we can use.
 */
use Cartify\Models\Products;

/**
 * The products page.
 */
class Cartify_Home_Controller extends Controller
{
	/**
	 * Flag for whether the controller is RESTful.
	 *
	 * @access   public
	 * @var      boolean
	 */
	public $restful = true;

	/**
	 * Show a list of the products on the page.
	 *
	 * @access   public
	 * @return   View
	 */
	public function get_index()
	{
		// Get the products.
		//
		$products = Products::all();

		// Show the page.
		//
		return View::make('cartify::home')->with('products', $products);
	}
}


text:
(function(sc) {
  "use strict";

  require("./lexer");

  var charlib = sc.libs.charlib;
  var Token = sc.lang.compiler.Token;
  var Lexer = sc.lang.compiler.Lexer;

  Lexer.addLexMethod("Number", function(source, index) {
    return new NumberLexer(source, index).scan();
  });

  function NumberLexer(source, index) {
    this.source = source;
    this.index  = index;
  }

  NumberLexer.prototype.scan = function() {
    return this.scanNAryNumberLiteral() ||
      this.scanHexNumberLiteral() ||
      this.scanAccidentalNumberLiteral() ||
      this.scanDecimalNumberLiteral();
  };

  NumberLexer.prototype.match = function(re) {
    return re.exec(this.source.slice(this.index));
  };

  NumberLexer.prototype.scanNAryNumberLiteral = function() {
    var items = this.match(
      /^(\d+)r((?:[\da-zA-Z](?:_(?=[\da-zA-Z]))?)+)(?:\.((?:[\da-zA-Z](?:_(?=[\da-zA-Z]))?)+))?/
    );

    if (!items) {
      return;
    }

    var base    = removeUnderscore(items[1])|0;
    var integer = removeUnderscore(items[2]);
    var frac    = removeUnderscore(items[3]) || "";
    var pi = false;

    if (!frac && base < 26 && integer.substr(-2) === "pi") {
      integer = integer.slice(0, -2);
      pi = true;
    }

    var type  = Token.IntegerLiteral;
    var value = calcNBasedInteger(integer, base);

    if (frac) {
      type = Token.FloatLiteral;
      value += calcNBasedFrac(frac, base);
    }

    if (isNaN(value)) {
      return { error: true, value: items[0], length: items[0].length };
    }

    return makeNumberToken(type, value, pi, items[0].length);
  };

  NumberLexer.prototype.scanHexNumberLiteral = function() {
    var items = this.match(/^(0x(?:[\da-fA-F](?:_(?=[\da-fA-F]))?)+)(pi)?/);

    if (!items) {
      return;
    }

    var integer = removeUnderscore(items[1]);
    var pi      = !!items[2];

    var type  = Token.IntegerLiteral;
    var value = +integer;

    return makeNumberToken(type, value, pi, items[0].length);
  };

  NumberLexer.prototype.scanAccidentalNumberLiteral = function() {
    var items = this.match(/^(\d+)([bs]+)(\d*)/);

    if (!items) {
      return;
    }

    var integer    = removeUnderscore(items[1]);
    var accidental = items[2];
    var sign = (accidental.charAt(0) === "s") ? +1 : -1;

    var cents;
    if (items[3] === "") {
      cents = Math.min(accidental.length * 0.1, 0.4);
    } else {
      cents = Math.min(items[3] * 0.001, 0.499);
    }
    var value = +integer + (sign * cents);

    return makeNumberToken(Token.FloatLiteral, value, false, items[0].length);
  };

  NumberLexer.prototype.scanDecimalNumberLiteral = function() {
    var items = this.match(
      /^((?:\d(?:_(?=\d))?)+((?:\.(?:\d(?:_(?=\d))?)+)?(?:e[-+]?(?:\d(?:_(?=\d))?)+)?))(pi)?/
    );

    var integer = +removeUnderscore(items[1]);
    var frac    = !!items[2];
    var pi      = !!items[3];

    var type  = (frac || pi) ? Token.FloatLiteral : Token.IntegerLiteral;
    var value = integer;

    return makeNumberToken(type, value, pi, items[0].length);
  };

  function removeUnderscore(str) {
    return str && str.replace(/_/g, "");
  }

  function char2num(ch, base) {
    var num = charlib.toNumber(ch);
    if (num >= base) {
      num = NaN;
    }
    return num;
  }

  function calcNBasedInteger(integer, base) {
    var value = 0;
    for (var i = 0, imax = integer.length; i < imax; ++i) {
      value *= base;
      value += char2num(integer[i], base);
    }
    return value;
  }

  function calcNBasedFrac(frac, base) {
    var value = 0;
    for (var i = 0, imax = frac.length; i < imax; ++i) {
      value += char2num(frac[i], base) * Math.pow(base, -(i + 1));
    }
    return value;
  }

  function makeNumberToken(type, value, pi, length) {
    if (pi) {
      type = Token.FloatLiteral;
      value = value * Math.PI;
    }

    if (type === Token.FloatLiteral && value === (value|0)) {
      value = value + ".0";
    }

    return { type: type, value: String(value), length: length };
  }
})(sc);


text:
def welcome(str)
  if str.include?("CA")
    return "Welcome to California"
  else
    return "You should move to California"
  end
end


text:
QuickIO is a very fast, very simple WebSocket server written entirely in C. Unlike other options, such as Socket.IO, that endeavor to be care-free, fun, and feature-rich, QIO is care-expensive, difficult, and not-too-featureful. The one advantage QIO has over all the others, though, is that it is fast. It's so fast even its name is fast.

## How fast are we talking?

In initial tests, running on a Large EC2 instance, QIO broke 1.5 million concurrent connections (from actual clients in the wild), used 450MB ram, and had a load average of .5.  The server never even broke a sweat.

## Why the name?

Originally, the project was called Q.IO, named after the omnipotent Q from Star Trek, implying that it gave your IO the power of Q. No one seemed to get the reference, so it just became easier to tell everyone it stood for "Quick".

## Requirements

* linux >= 2.6.30
* glib >= 2.32
* openssl >= 1.0.0
* tcmalloc >= 2.1
* doxygen + sphinx (for generating docs)

### Debian-based systems

```bash
# For compiling
sudo aptitude install build-essential libglib2.0-dev libssl-dev libgoogle-perftools-dev
```

## Testing

With check installed, run:

```bash
make test
```

## Configuring your Kernel

If you're going to have a crap-ton (yes, that is a metric) of clients connected, you're going to need to tune some kernel parameters.

```bash
sudo sysctl -w fs.epoll.max_user_watches=4194304
sudo sysctl -w fs.file-max=4197304
sudo sysctl -w fs.nr_open=4197304
sudo sysctl -w net.core.somaxconn=1024
sudo sysctl -w net.ipv4.tcp_mem="2820736 3031648 3533472"
sudo sysctl -w net.netfilter.nf_conntrack_max=4194304
```

## Coding Style

Most of the ideas are taken from: https://www.kernel.org/doc/Documentation/CodingStyle. As long as your code fits in, we're good.


text:
#ifndef MUMBLE_MUMBLE_GLOBALSHORTCUT_UNIX_H_
#define MUMBLE_MUMBLE_GLOBALSHORTCUT_UNIX_H_

#include "GlobalShortcut.h"
#include "ConfigDialog.h"
#include "Global.h"

#include <X11/X.h>
#include <X11/Xlib.h>
#ifndef NO_XINPUT2
#include <X11/extensions/XI2.h>
#include <X11/extensions/XInput2.h>
#endif
#include <X11/Xutil.h>
#ifdef Q_OS_LINUX
#include <linux/input.h>
#include <fcntl.h>
#endif

#define NUM_BUTTONS 0x2ff

class GlobalShortcutX : public GlobalShortcutEngine {
	private:
		Q_OBJECT
		Q_DISABLE_COPY(GlobalShortcutX)
	public:
		Display *display;
		QSet<Window> qsRootWindows;
		int iXIopcode;
		QSet<int> qsMasterDevices;

		volatile bool bRunning;
		QSet<QString> qsKeyboards;
		QMap<QString, QFile *> qmInputDevices;

		GlobalShortcutX();
		~GlobalShortcutX() Q_DECL_OVERRIDE;
		void run() Q_DECL_OVERRIDE;
		QString buttonName(const QVariant &) Q_DECL_OVERRIDE;

		void queryXIMasterList();
	public slots:
		void displayReadyRead(int);
		void inputReadyRead(int);
		void directoryChanged(const QString &);
};

#endif


text:
package io.jenkins.blueocean.rest.impl.pipeline;

import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import hudson.Extension;
import hudson.model.Item;
import hudson.model.Job;
import hudson.model.Result;
import hudson.model.Run;
import io.jenkins.blueocean.commons.ServiceException;
import io.jenkins.blueocean.rest.Navigable;
import io.jenkins.blueocean.rest.Reachable;
import io.jenkins.blueocean.rest.annotation.Capability;
import io.jenkins.blueocean.rest.hal.Link;
import io.jenkins.blueocean.rest.hal.LinkResolver;
import io.jenkins.blueocean.rest.model.BlueActionProxy;
import io.jenkins.blueocean.rest.model.BlueFavorite;
import io.jenkins.blueocean.rest.model.BlueFavoriteAction;
import io.jenkins.blueocean.rest.model.BlueIcon;
import io.jenkins.blueocean.rest.model.BlueMultiBranchPipeline;
import io.jenkins.blueocean.rest.model.BluePipeline;
import io.jenkins.blueocean.rest.model.BluePipelineContainer;
import io.jenkins.blueocean.rest.model.BluePipelineScm;
import io.jenkins.blueocean.rest.model.BlueQueueContainer;
import io.jenkins.blueocean.rest.model.BlueQueueItem;
import io.jenkins.blueocean.rest.model.BlueRun;
import io.jenkins.blueocean.rest.model.BlueRunContainer;
import io.jenkins.blueocean.rest.model.Container;
import io.jenkins.blueocean.rest.model.Resource;
import io.jenkins.blueocean.service.embedded.rest.AbstractPipelineImpl;
import io.jenkins.blueocean.service.embedded.rest.ActionProxiesImpl;
import io.jenkins.blueocean.service.embedded.rest.BlueFavoriteResolver;
import io.jenkins.blueocean.service.embedded.rest.BluePipelineFactory;
import io.jenkins.blueocean.service.embedded.rest.FavoriteImpl;
import io.jenkins.blueocean.service.embedded.rest.OrganizationImpl;
import io.jenkins.blueocean.service.embedded.util.FavoriteUtil;
import jenkins.branch.MultiBranchProject;

import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.json.JsonBody;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import static io.jenkins.blueocean.rest.impl.pipeline.PipelineJobFilters.isPullRequest;
import static io.jenkins.blueocean.rest.model.KnownCapabilities.JENKINS_MULTI_BRANCH_PROJECT;

/**
 * @author Vivek Pandey
 */
@Capability({JENKINS_MULTI_BRANCH_PROJECT})
public class MultiBranchPipelineImpl extends BlueMultiBranchPipeline {
    /*package*/ final MultiBranchProject mbp;

    private static final int MAX_MBP_RUNS_ROWS = Integer.getInteger("MAX_MBP_RUNS_ROWS", 250);

    private final Link self;
    public MultiBranchPipelineImpl(MultiBranchProject mbp) {
        this.mbp = mbp;
        this.self = OrganizationImpl.INSTANCE.getLink().rel("pipelines").rel(PipelineImpl.getRecursivePathFromFullName(this));
    }

    @Override
    public String getOrganization() {
        return OrganizationImpl.INSTANCE.getName();
    }

    @Override
    public BlueFavorite favorite(@JsonBody BlueFavoriteAction favoriteAction) {
        if(favoriteAction == null) {
            throw new ServiceException.BadRequestExpception("Must provide pipeline name");
        }
        Job job = PrimaryBranch.resolve(mbp);
        if (job == null) {
            throw new ServiceException.BadRequestExpception("no default branch to favorite");
        }
        FavoriteUtil.toggle(favoriteAction, job);
        return new FavoriteImpl(new BranchImpl(job,getLink().rel("branches")), getLink().rel("favorite"));
    }

    @Override
    public Map<String, Boolean> getPermissions() {
        return AbstractPipelineImpl.getPermissions(mbp);
    }

    @Navigable
    @Override
    public BluePipelineScm getScm() {
        return new ScmResourceImpl(mbp, this);
    }

    @Override
    public String getName() {
        return mbp.getName();
    }

    @Override
    public String getDisplayName() {
        return mbp.getDisplayName();
    }

    @Override
    public String getFullName() {
        return mbp.getFullName();
    }

    @Override
    public String getFullDisplayName() {
        return AbstractPipelineImpl.getFullDisplayName(mbp, null);
    }

    @Override
    public int getTotalNumberOfBranches(){
        return countJobs(false);
    }

    @Override
    public int getNumberOfFailingBranches(){
        return countRunStatus(Result.FAILURE, false);
    }

    @Override
    public int getNumberOfSuccessfulBranches(){
        return countRunStatus(Result.SUCCESS, false);
    }

    @Override
    public int getTotalNumberOfPullRequests() {
        return countJobs(true);
    }

    @Override
    public int getNumberOfFailingPullRequests() {
        return countRunStatus(Result.FAILURE, true);
    }

    @Override
    public int getNumberOfSuccessfulPullRequests() {
        return countRunStatus(Result.SUCCESS, true);
    }

    @Override
    public BluePipelineContainer getPipelines() {
        return new BranchContainerImpl(this, getLink().rel("pipelines"));
    }

    @Override
    public Integer getNumberOfFolders() {
        return 0;
    }

    @Override
    public Integer getNumberOfPipelines() {
        return getTotalNumberOfBranches();
    }

    @Override
    public Integer getWeatherScore(){
        Job j = PrimaryBranch.resolve(mbp);
        return j == null ? 100 : j.getBuildHealth().getScore();
    }

    @Override
    public BlueRun getLatestRun() {
        //For multibranch is a folder that is no run of itself.
        return null;
    }

    @Override
    public Long getEstimatedDurationInMillis() {
        return mbp.getEstimatedDuration();
    }

    @Override
    public String getLastSuccessfulRun() {
        return null;
    }

    @Override
    @Navigable
    public BluePipelineContainer getBranches() {
        return new BranchContainerImpl(this, getLink().rel("branches"));
    }

    @Override
    public Collection<String> getBranchNames() {
        Collection<Job> jobs =  mbp.getAllJobs();
        List<String> branches = new ArrayList<>();
        for(Job j : jobs){
            branches.add(j.getName());
        }
        return branches;
    }

    private int countRunStatus(Result result, boolean pullRequests){
        Collection<Job> jobs = mbp.getAllJobs();
        int count=0;
        for(Job j:jobs){
            if(pullRequests && isPullRequest(j) || !pullRequests && !isPullRequest(j)) {
                j.getBuildStatusUrl();
                Run run = j.getLastBuild();
                if (run!=null && run.getResult() == result) {
                    count++;
                }
            }
        }
        return count;
    }

    private int countJobs(boolean pullRequests) {
        Collection<Job> jobs = mbp.getAllJobs();
        int counter = 0;

        for(Job job: jobs){
            if(pullRequests && isPullRequest(job) || !pullRequests && !isPullRequest(job)) {
                counter += 1;
            }
        }

        return counter;
    }

    @Override
    public BlueRunContainer getRuns() {
        return new BlueRunContainer() {
            @Override
            public Link getLink() {
                return MultiBranchPipelineImpl.this.getLink().rel("runs");
            }

            @Override
            public BlueRun get(String name) {
                return null;
            }

            @Override
            public Iterator<BlueRun> iterator() {
                throw new ServiceException.NotImplementedException("Not implemented");
            }

            /**
             * Fetches maximum up to  MAX_MBP_RUNS_ROWS rows from each branch and does pagination on that.
             *
             * JVM property MAX_MBP_RUNS_ROWS can be used to tune this value to optimize performance for given setup
             */
            @Override
            public Iterator<BlueRun> iterator(int start, int limit) {
                List<BlueRun> c = new ArrayList<>();

                List<BluePipeline> branches;

                // Check for branch filter
                StaplerRequest req = Stapler.getCurrentRequest();
                String branchFilter = null;
                if (req != null) {
                    branchFilter = req.getParameter("branch");
                }

                if (!StringUtils.isEmpty(branchFilter)) {
                    BluePipeline pipeline = getBranches().get(branchFilter);
                    if (pipeline != null) {
                        branches = Collections.singletonList(pipeline);
                    } else {
                        branches = Collections.emptyList();
                    }
                } else {
                    branches = Lists.newArrayList(getBranches().list());
                    sortBranchesByLatestRun(branches);
                }

                for(final BluePipeline b: branches) {
                    Iterator<BlueRun> it = b.getRuns().iterator(0,MAX_MBP_RUNS_ROWS);
                    int count = 0;
                    Iterators.skip(it, start);
                    while(it.hasNext() && count++ < limit){
                        c.add(it.next());
                    }
                }

                Collections.sort(c, new Comparator<BlueRun>() {
                    @Override
                    public int compare(BlueRun o1, BlueRun o2) {
                        return o2.getStartTime().compareTo(o1.getStartTime());
                    }
                });

                return c.iterator();
            }

            private boolean retry(boolean[] retries){
                //if at least one of the branch needs retry we will retry it
                for(boolean r: retries){
                    if(r){
                        return true;
                    }
                }
                return false;
            }

            private int computeLimit(boolean[] retries, int limit){
                //if at least one of the branch needs retry we will retry it
                int count=0;
                for(boolean r: retries){
                    if(r){
                        count++;
                    }
                }
                if(count == 0){
                    return 0;
                }
                return limit/count > 0 ? limit/count : 1;
            }

            private int collectRuns(List<BluePipeline> branches, List<BlueRun> runs,
                                    boolean[] retries, int remainingCount, int[] startIndexes, int[] limits){
                int count = 0;
                for (int i=0; i < branches.size(); i++) {
                    BluePipeline b = branches.get(i);
                    if(!retries[i]){
                        continue;
                    }
                    Iterator<BlueRun> it = b.getRuns().iterator(startIndexes[i], limits[i]);
                    int lcount = 0;
                    while (it.hasNext() && count < remainingCount) {
                        lcount++;
                        count++;
                        runs.add(it.next());
                    }
                    if (lcount < limits[i]) { //if its less than l
                        retries[i] = false; //iterator already exhausted so lets not retry next time
                    }else{
                        startIndexes[i] = startIndexes[i]+lcount; //set the new start index for next time
                    }
                }
                return count;
            }

            @Override
            public BlueQueueItem create(StaplerRequest request) {
                throw new ServiceException.NotImplementedException("This action is not supported");
            }
        };
    }

    static void sortBranchesByLatestRun(List<BluePipeline> branches){
        Collections.sort(branches, new Comparator<BluePipeline>() {
            @Override
            public int compare(BluePipeline o1, BluePipeline o2) {
                Long t1 = o1.getLatestRun() != null ? o1.getLatestRun().getStartTime().getTime() : 0;
                Long t2 = o2.getLatestRun() != null ? o2.getLatestRun().getStartTime().getTime() : 0;

                return t2.compareTo(t1);
            }
        });
    }

    @Override
    public Collection<BlueActionProxy> getActions() {
        return ActionProxiesImpl.getActionProxies(mbp.getAllActions(), this);
    }

    @Override
    public BlueQueueContainer getQueue() {
        return new MultiBranchPipelineQueueContainer(this);
    }

    @Override
    public Link getLink() {
        return self;
    }

    @Extension(ordinal = 2)
    public static class PipelineFactoryImpl extends BluePipelineFactory {

        @Override
        public MultiBranchPipelineImpl getPipeline(Item item, Reachable parent) {
            if (item instanceof MultiBranchProject) {
                return new MultiBranchPipelineImpl((MultiBranchProject) item);
            }
            return null;
        }

        @Override
        public Resource resolve(Item context, Reachable parent, Item target) {
            if (context instanceof MultiBranchProject) {
                if (context==target)
                    return getPipeline(context,parent);
                if (context==target.getParent()) {
                    // target is a branch
                    return getPipeline(context,parent).getBranches().get(target.getName());
                }
            }
            return null;
        }

    }

    @Extension(ordinal = 1)
    public static class FavoriteResolverImpl extends BlueFavoriteResolver {
        @Override
        public BlueFavorite resolve(Item item, Reachable parent) {
            if(item instanceof MultiBranchProject){
                MultiBranchProject project = (MultiBranchProject) item;
                Job job = PrimaryBranch.resolve(project);
                if(job != null){
                    Resource resource = BluePipelineFactory.resolve(job);
                    Link l = LinkResolver.resolveLink(project);
                    if(l != null) {
                        return new FavoriteImpl(resource, l.rel("favorite"));
                    }
                }
            }
            return null;
        }
    }

    @Navigable
    public Container<Resource> getActivities() {
        return new Container<Resource>() {
            @Override
            public Resource get(String name) {
                return null;
            }

            @Override
            public Link getLink() {
                return MultiBranchPipelineImpl.this.getLink().rel("activities");
            }

            @Override
            public Iterator<Resource> iterator() {
                throw new ServiceException.NotImplementedException("Not implemented");
            }

            @Override
            public Iterator<Resource> iterator(int start, int limit) {
                return AbstractPipelineImpl.activityIterator(getQueue(), getRuns(), start, limit);
            }
        };

    }

    @Override
    public List<Object> getParameters() {
        return null;
    }

    @Override
    public BlueIcon getIcon() {
        return null;
    }
}


text:
package com.tiny.demo.firstlinecode.brvah.entity;

import com.chad.library.adapter.base.entity.SectionEntity;

/**
 * Desc:
 * Created by tiny on 2017/12/11.
 * Version:
 */

public class MySection extends SectionEntity<Video> {
    private boolean isMore;

    public MySection(boolean isHeader, String header, boolean isMore) {
        super(isHeader, header);
        this.isMore = isMore;
    }

    public MySection(Video video) {
        super(video);
    }

    public boolean isMore() {
        return isMore;
    }

    public void setMore(boolean more) {
        isMore = more;
    }
}


text:
package ch.heigvd.amt.amt_project.rest.dto;

import java.net.URI;

/**
 *
 * @author xajkep
 */
public class PointAwardDTO {
    private URI href;
    long numberOfPoints;
    String reason;

    public long getNumberOfPoints() {
        return numberOfPoints;
    }

    public void setNumberOfPoints(long numberOfPoints) {
        this.numberOfPoints = numberOfPoints;
    }

    public String getReason() {
        return reason;
    }

    public URI getHref() {
        return href;
    }

    public void setHref(URI href) {
        this.href = href;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

}


text:
/*
 * ListView.h
 *
 *
 */

#ifndef _ListView_H_
#define _ListView_H_

#include <string>
#include "FreeStyleProject.h"
#include <list>
#include "Object.h"

/** \defgroup Models Data Structures for API
 *  Classes containing all the Data Structures needed for calling/returned by API endpoints
 *
 */

namespace Tizen {
namespace ArtikCloud {

/*! \brief
 *
 *  \ingroup Models
 *
 */

class ListView : public Object {
public:
	/*! \brief Constructor.
	 */
	ListView();
	ListView(char* str);

	/*! \brief Destructor.
	 */
	virtual ~ListView();

	/*! \brief Retrieve a string JSON representation of this class.
	 */
	char* toJson();

	/*! \brief Fills in members of this class from JSON string representing it.
	 */
	void fromJson(char* jsonStr);

	/*! \brief Get
	 */
	std::string getClass();

	/*! \brief Set
	 */
	void setClass(std::string  _class);
	/*! \brief Get
	 */
	std::string getDescription();

	/*! \brief Set
	 */
	void setDescription(std::string  description);
	/*! \brief Get
	 */
	std::list<FreeStyleProject> getJobs();

	/*! \brief Set
	 */
	void setJobs(std::list <FreeStyleProject> jobs);
	/*! \brief Get
	 */
	std::string getName();

	/*! \brief Set
	 */
	void setName(std::string  name);
	/*! \brief Get
	 */
	std::string getUrl();

	/*! \brief Set
	 */
	void setUrl(std::string  url);

private:
	std::string _class;
	std::string description;
	std::list <FreeStyleProject>jobs;
	std::string name;
	std::string url;
	void __init();
	void __cleanup();

};
}
}

#endif /* _ListView_H_ */


text:
//------------------------------------------------------------------------------
// <copyright project="BEmu_cpp" file="headers/MarketDataRequest/MarketElementReason.h" company="Jordan Robinson">
//     Copyright (c) 2013 Jordan Robinson. All rights reserved.
//
//     The use of this software is governed by the Microsoft Public License
//     which is included with this distribution.
// </copyright>
//------------------------------------------------------------------------------

#pragma once

#include "BloombergTypes/ElementPtr.h"

namespace BEmu
{
	namespace MarketDataRequest
	{
		namespace ReasonType
		{
			enum ReasonTypeEnum { badSecurity, badField };
		};

		class MarketElementString;
		class MarketElementInt;

		class MarketElementReason : public ElementPtr
		{
			private:
				boost::shared_ptr<MarketElementString> _source, _category, _description;
				boost::shared_ptr<MarketElementInt> _errorCode;

			public:
				MarketElementReason(ReasonType::ReasonTypeEnum reasonType);
				~MarketElementReason();

				virtual Name name() const;
				virtual size_t numValues() const;
				virtual size_t numElements() const;
				virtual SchemaElementDefinition elementDefinition() const;

				virtual bool isNull() const;
				virtual bool isArray() const;
				virtual bool isComplexType() const;

				virtual int getElementAsInt32(const char* name) const;
				virtual const char* getElementAsString(const char* name) const;

				virtual boost::shared_ptr<ElementPtr> getElement(const char* name) const;

				virtual bool hasElement(const char* name, bool excludeNullElements = false) const;

				virtual std::ostream& print(std::ostream& stream, int level = 0, int spacesPerLevel = 4) const;
		};
	}
}


text:
<?php

class MWP_Progress_Download extends MWP_Progress_Abstract
{
    /**
     * @var Monolog_Psr_LoggerInterface
     */
    private $logger;

    /**
     * @var int
     */
    private $lastProgress = 0;

    public function __construct($threshold, Monolog_Psr_LoggerInterface $logger)
    {
        $this->logger = $logger;
    }

    public function callback(&$curl, $downloadSize, $downloadedSize, $uploadSize, $uploadedSize = 0)
    {
        if (!$this->yieldCallback()) {
            return;
        }

        if (func_num_args() < 5) {
            $uploadedSize   = $uploadSize;
            $uploadSize     = $downloadedSize;
            $downloadedSize = $downloadSize;
            $downloadSize   = $curl;
        }

        $currentProgress    = $downloadedSize;
        $speed              = $this->formatBytes(($currentProgress - $this->lastProgress) / $this->getThreshold());
        $this->lastProgress = $currentProgress;

        $progress = round($currentProgress / $downloadSize * 100, 2);

        $this->logger->info('Download progress: {progress}% (speed: {speed}/s)', array(
          'progress' => $progress,
          'speed'    => $speed,
        ));
    }
}


text:
package org.h2.mvstore.rtree;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import org.h2.mvstore.DataUtils;
import org.h2.mvstore.WriteBuffer;
import org.h2.mvstore.type.DataType;
import org.h2.util.New;

/**
 * A spatial data type. This class supports up to 31 dimensions. Each dimension
 * can have a minimum and a maximum value of type float. For each dimension, the
 * maximum value is only stored when it is not the same as the minimum.
 */
public class SpatialDataType implements DataType {

    private final int dimensions;

    public SpatialDataType(int dimensions) {
        // Because of how we are storing the
        // min-max-flag in the read/write method
        // the number of dimensions must be < 32.
        DataUtils.checkArgument(
                dimensions >= 1 && dimensions < 32,
                "Dimensions must be between 1 and 31, is {0}", dimensions);
        this.dimensions = dimensions;
    }

    @Override
    public int compare(Object a, Object b) {
        if (a == b) {
            return 0;
        } else if (a == null) {
            return -1;
        } else if (b == null) {
            return 1;
        }
        long la = ((SpatialKey) a).getId();
        long lb = ((SpatialKey) b).getId();
        return la < lb ? -1 : la > lb ? 1 : 0;
    }

    /**
     * Check whether two spatial values are equal.
     *
     * @param a the first value
     * @param b the second value
     * @return true if they are equal
     */
    public boolean equals(Object a, Object b) {
        if (a == b) {
            return true;
        } else if (a == null || b == null) {
            return false;
        }
        long la = ((SpatialKey) a).getId();
        long lb = ((SpatialKey) b).getId();
        return la == lb;
    }

    @Override
    public int getMemory(Object obj) {
        return 40 + dimensions * 4;
    }

    @Override
    public void read(ByteBuffer buff, Object[] obj, int len, boolean key) {
        for (int i = 0; i < len; i++) {
            obj[i] = read(buff);
        }
    }

    @Override
    public void write(WriteBuffer buff, Object[] obj, int len, boolean key) {
        for (int i = 0; i < len; i++) {
            write(buff, obj[i]);
        }
    }

    @Override
    public void write(WriteBuffer buff, Object obj) {
        SpatialKey k = (SpatialKey) obj;
        if (k.isNull()) {
            buff.putVarInt(-1);
            buff.putVarLong(k.getId());
            return;
        }
        int flags = 0;
        for (int i = 0; i < dimensions; i++) {
            if (k.min(i) == k.max(i)) {
                flags |= 1 << i;
            }
        }
        buff.putVarInt(flags);
        for (int i = 0; i < dimensions; i++) {
            buff.putFloat(k.min(i));
            if ((flags & (1 << i)) == 0) {
                buff.putFloat(k.max(i));
            }
        }
        buff.putVarLong(k.getId());
    }

    @Override
    public Object read(ByteBuffer buff) {
        int flags = DataUtils.readVarInt(buff);
        if (flags == -1) {
            long id = DataUtils.readVarLong(buff);
            return new SpatialKey(id);
        }
        float[] minMax = new float[dimensions * 2];
        for (int i = 0; i < dimensions; i++) {
            float min = buff.getFloat();
            float max;
            if ((flags & (1 << i)) != 0) {
                max = min;
            } else {
                max = buff.getFloat();
            }
            minMax[i + i] = min;
            minMax[i + i + 1] = max;
        }
        long id = DataUtils.readVarLong(buff);
        return new SpatialKey(id, minMax);
    }

    /**
     * Check whether the two objects overlap.
     *
     * @param objA the first object
     * @param objB the second object
     * @return true if they overlap
     */
    public boolean isOverlap(Object objA, Object objB) {
        SpatialKey a = (SpatialKey) objA;
        SpatialKey b = (SpatialKey) objB;
        if (a.isNull() || b.isNull()) {
            return false;
        }
        for (int i = 0; i < dimensions; i++) {
            if (a.max(i) < b.min(i) || a.min(i) > b.max(i)) {
                return false;
            }
        }
        return true;
    }

    /**
     * Increase the bounds in the given spatial object.
     *
     * @param bounds the bounds (may be modified)
     * @param add the value
     */
    public void increaseBounds(Object bounds, Object add) {
        SpatialKey a = (SpatialKey) add;
        SpatialKey b = (SpatialKey) bounds;
        if (a.isNull() || b.isNull()) {
            return;
        }
        for (int i = 0; i < dimensions; i++) {
            b.setMin(i, Math.min(b.min(i), a.min(i)));
            b.setMax(i, Math.max(b.max(i), a.max(i)));
        }
    }

    /**
     * Get the area increase by extending a to contain b.
     *
     * @param objA the bounding box
     * @param objB the object
     * @return the area
     */
    public float getAreaIncrease(Object objA, Object objB) {
        SpatialKey b = (SpatialKey) objB;
        SpatialKey a = (SpatialKey) objA;
        if (a.isNull() || b.isNull()) {
            return 0;
        }
        float min = a.min(0);
        float max = a.max(0);
        float areaOld = max - min;
        min = Math.min(min,  b.min(0));
        max = Math.max(max,  b.max(0));
        float areaNew = max - min;
        for (int i = 1; i < dimensions; i++) {
            min = a.min(i);
            max = a.max(i);
            areaOld *= max - min;
            min = Math.min(min,  b.min(i));
            max = Math.max(max,  b.max(i));
            areaNew *= max - min;
        }
        return areaNew - areaOld;
    }

    /**
     * Get the combined area of both objects.
     *
     * @param objA the first object
     * @param objB the second object
     * @return the area
     */
    float getCombinedArea(Object objA, Object objB) {
        SpatialKey a = (SpatialKey) objA;
        SpatialKey b = (SpatialKey) objB;
        if (a.isNull()) {
            return getArea(b);
        } else if (b.isNull()) {
            return getArea(a);
        }
        float area = 1;
        for (int i = 0; i < dimensions; i++) {
            float min = Math.min(a.min(i),  b.min(i));
            float max = Math.max(a.max(i),  b.max(i));
            area *= max - min;
        }
        return area;
    }

    private float getArea(SpatialKey a) {
        if (a.isNull()) {
            return 0;
        }
        float area = 1;
        for (int i = 0; i < dimensions; i++) {
            area *= a.max(i) - a.min(i);
        }
        return area;
    }

    /**
     * Check whether a contains b.
     *
     * @param objA the bounding box
     * @param objB the object
     * @return the area
     */
    public boolean contains(Object objA, Object objB) {
        SpatialKey a = (SpatialKey) objA;
        SpatialKey b = (SpatialKey) objB;
        if (a.isNull() || b.isNull()) {
            return false;
        }
        for (int i = 0; i < dimensions; i++) {
            if (a.min(i) > b.min(i) || a.max(i) < b.max(i)) {
                return false;
            }
        }
        return true;
    }

    /**
     * Check whether a is completely inside b and does not touch the
     * given bound.
     *
     * @param objA the object to check
     * @param objB the bounds
     * @return true if a is completely inside b
     */
    public boolean isInside(Object objA, Object objB) {
        SpatialKey a = (SpatialKey) objA;
        SpatialKey b = (SpatialKey) objB;
        if (a.isNull() || b.isNull()) {
            return false;
        }
        for (int i = 0; i < dimensions; i++) {
            if (a.min(i) <= b.min(i) || a.max(i) >= b.max(i)) {
                return false;
            }
        }
        return true;
    }

    /**
     * Create a bounding box starting with the given object.
     *
     * @param objA the object
     * @return the bounding box
     */
    Object createBoundingBox(Object objA) {
        SpatialKey a = (SpatialKey) objA;
        if (a.isNull()) {
            return a;
        }
        float[] minMax = new float[dimensions * 2];
        for (int i = 0; i < dimensions; i++) {
            minMax[i + i] = a.min(i);
            minMax[i + i + 1] = a.max(i);
        }
        return new SpatialKey(0, minMax);
    }

    /**
     * Get the most extreme pair (elements that are as far apart as possible).
     * This method is used to split a page (linear split). If no extreme objects
     * could be found, this method returns null.
     *
     * @param list the objects
     * @return the indexes of the extremes
     */
    public int[] getExtremes(ArrayList<Object> list) {
        list = getNotNull(list);
        if (list.size() == 0) {
            return null;
        }
        SpatialKey bounds = (SpatialKey) createBoundingBox(list.get(0));
        SpatialKey boundsInner = (SpatialKey) createBoundingBox(bounds);
        for (int i = 0; i < dimensions; i++) {
            float t = boundsInner.min(i);
            boundsInner.setMin(i, boundsInner.max(i));
            boundsInner.setMax(i, t);
        }
        for (int i = 0; i < list.size(); i++) {
            Object o = list.get(i);
            increaseBounds(bounds, o);
            increaseMaxInnerBounds(boundsInner, o);
        }
        double best = 0;
        int bestDim = 0;
        for (int i = 0; i < dimensions; i++) {
            float inner = boundsInner.max(i) - boundsInner.min(i);
            if (inner < 0) {
                continue;
            }
            float outer = bounds.max(i) - bounds.min(i);
            float d = inner / outer;
            if (d > best) {
                best = d;
                bestDim = i;
            }
        }
        if (best <= 0) {
            return null;
        }
        float min = boundsInner.min(bestDim);
        float max = boundsInner.max(bestDim);
        int firstIndex = -1, lastIndex = -1;
        for (int i = 0; i < list.size() &&
                (firstIndex < 0 || lastIndex < 0); i++) {
            SpatialKey o = (SpatialKey) list.get(i);
            if (firstIndex < 0 && o.max(bestDim) == min) {
                firstIndex = i;
            } else if (lastIndex < 0 && o.min(bestDim) == max) {
                lastIndex = i;
            }
        }
        return new int[] { firstIndex, lastIndex };
    }

    private static ArrayList<Object> getNotNull(ArrayList<Object> list) {
        ArrayList<Object> result = null;
        for (Object o : list) {
            SpatialKey a = (SpatialKey) o;
            if (a.isNull()) {
                result = New.arrayList();
                break;
            }
        }
        if (result == null) {
            return list;
        }
        for (Object o : list) {
            SpatialKey a = (SpatialKey) o;
            if (!a.isNull()) {
                result.add(a);
            }
        }
        return result;
    }

    private void increaseMaxInnerBounds(Object bounds, Object add) {
        SpatialKey b = (SpatialKey) bounds;
        SpatialKey a = (SpatialKey) add;
        for (int i = 0; i < dimensions; i++) {
            b.setMin(i, Math.min(b.min(i), a.max(i)));
            b.setMax(i, Math.max(b.max(i), a.min(i)));
        }
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- No typos -->
    <string name="s1">Dette er en test</string>
    <!-- Plain typos -->
    <string name="s2">Mer morro med Andriod</string>
    <!-- Make capitalization match typo -->
    <string name="s3"> Parallel </string>
    <!-- Markup indirection -->
    <string name="s4"><b>altid</b></string>
    <!-- Typo, match capitalized -->
    <string name="s5">Altid</string>
    <!-- random words, shouldn't flag -->
    <string name="s6">abcdefg qwerty asdf jklm</string>
    <!-- typo, but should only match when capitalized -->
    <string name="s7">Midt-Østen midt-østen</string>
    <!-- Non-ASCII UTF-8 string -->
    <string name="s7">Koding er en spennende karriære</string>
    <string name="internet">"Koble til Internett.</string>

</resources>