text:
package com.javachina.controller;

import com.blade.ioc.annotation.Inject;
import com.blade.jdbc.core.Take;
import com.blade.kit.DateKit;
import com.blade.kit.PatternKit;
import com.blade.kit.StringKit;
import com.blade.mvc.annotation.*;
import com.blade.mvc.http.HttpMethod;
import com.blade.mvc.http.Request;
import com.blade.mvc.http.Response;
import com.blade.mvc.view.ModelAndView;
import com.blade.mvc.view.RestResponse;
import com.blade.patchca.DefaultPatchca;
import com.blade.patchca.Patchca;
import com.javachina.constants.Actions;
import com.javachina.constants.Constant;
import com.javachina.constants.EventType;
import com.javachina.dto.LoginUser;
import com.javachina.exception.TipException;
import com.javachina.kit.SessionKit;
import com.javachina.kit.Utils;
import com.javachina.model.Codes;
import com.javachina.model.User;
import com.javachina.model.Userlog;
import com.javachina.service.*;
import lombok.extern.slf4j.Slf4j;

/**
 * 注册,登录,找回密码,激活
 */
@Controller
@Slf4j
public class AuthController extends BaseController {

    @Inject
    private OptionsService optionsService;

    @Inject
    private CodesService codesService;

    @Inject
    private UserService userService;

    @Inject
    private UserInfoService userInfoService;

    @Inject
    private CommentService commentService;

    @Inject
    private TopicService topicService;

    @Inject
    private UserlogService userlogService;

    private Patchca patchca = new DefaultPatchca();

    /**
     * 获取验证码
     */
    @Route(value = "/captcha", method = HttpMethod.GET)
    public void show_captcha(Request request, Response response) {
        try {
            patchca.render(request, response);
        } catch (Exception e) {
            log.error("获取验证码失败", e);
        }
    }

    /**
     * 登录页面
     */
    @Route(value = "/signin", method = HttpMethod.GET)
    public ModelAndView show_signin() {
        return this.getView("signin");
    }

    /**
     * 登录操作
     */
    @Route(value = "/signin", method = HttpMethod.POST)
    @JSON
    public RestResponse signin(Request request, Response response,
                               @QueryParam String username, @QueryParam String password,
                               @QueryParam String rememberMe) {

        try {
            LoginUser loginUser = userService.signin(username, password);
            SessionKit.setLoginUser(request.session(), loginUser);

            if (StringKit.isNotBlank(rememberMe) && rememberMe.equals("on")) {
                SessionKit.setCookie(response, Constant.USER_IN_COOKIE, loginUser.getUid());
            }

            userlogService.save(Userlog.builder().uid(loginUser.getUid()).action(Actions.SIGNIN).content(username).build());
            String val = SessionKit.getCookie(request, Constant.JC_REFERRER_COOKIE);
            if (StringKit.isNotBlank(val)) {
                response.redirect(val);
                return null;
            }
            return RestResponse.ok(val);
        } catch (Exception e) {
            return fail(e, "登录失败");
        }

    }

    /**
     * 注册页面
     */
    @Route(value = "/signup", method = HttpMethod.GET)
    public ModelAndView show_signup(Request request) {
        Object allow_signup = Constant.SYS_INFO.get(EventType.ALLOW_SIGNUP);
        if (null != allow_signup && allow_signup.toString().equals("false")) {
            request.attribute(this.INFO, "暂时停止注册");
        }
        return this.getView("signup");
    }

    /**
     * 注销
     */
    @Route(value = "/logout")
    public void logout(Request request, Response response) {
        SessionKit.removeUser(request.session());
        SessionKit.removeCookie(response);
        response.go("/");
    }

    /**
     * 注册操作
     */
    @Route(value = "/signup", method = HttpMethod.POST)
    public RestResponse signup(Request request, Response response) {

        String username = request.query("username");
        String email = request.query("email");
        String password = request.query("password");
        String auth_code = request.query("auth_code");

        if (StringKit.isBlank(username) || StringKit.isBlank(password)
                || StringKit.isBlank(email) || StringKit.isBlank(auth_code)) {
            return RestResponse.fail("参数不能为空");
        }

        if (username.length() > 16 || username.length() < 4) {
            return RestResponse.fail("请输入4-16位用户名");
        }

        if (!Utils.isLegalName(username)) {
            return RestResponse.fail("请输入只包含字母/数字/下划线的用户名");
        }

        if (!Utils.isSignup(username)) {
            return RestResponse.fail("您的用户名中包含禁用字符,请修改后注册");
        }

        if (!Utils.isEmail(email)) {
            return RestResponse.fail("请输入正确的邮箱");
        }

        if (password.length() > 20 || password.length() < 6) {
            request.attribute(this.ERROR, "请输入6-20位字符的密码");
            return RestResponse.fail("请输入6-20位字符的密码");
        }

        String patchca = request.session().attribute("patchca");
        if (StringKit.isNotBlank(patchca) && !patchca.equalsIgnoreCase(auth_code)) {
            return RestResponse.fail("验证码输入错误");
        }

        Take queryParam = new Take(User.class);
        queryParam.eq("username", username);
        queryParam.in("status", 0, 1);
        User user = userService.getUserByTake(queryParam);
        if (null != user) {
            request.attribute(this.ERROR, "该用户名已经被占用,请更换用户名");
            return RestResponse.fail("该用户名已经被占用,请更换用户名");
        }

        queryParam = new Take(User.class);
        queryParam.eq("email", email);
        queryParam.in("status", 0, 1);
        user = userService.getUserByTake(queryParam);
        if (null != user) {
            return RestResponse.fail("该邮箱已经被注册,请直接登录");
        }

        try {

            username = Utils.cleanXSS(username);

            User user_ = userService.signup(username, password, email);
            if (null != user_) {
                userlogService.save(Userlog.builder().uid(user_.getUid()).action(Actions.SIGNUP).content(username + ":" + email).build());
                return RestResponse.ok("注册成功,已经向您的邮箱 " + email + " 发送了一封激活申请,请注意查收!");
            } else {
                return RestResponse.fail("注册发生异常");
            }
        } catch (Exception e) {
            return fail(e, "注册失败");
        }
    }

    /**
     * 激活账户
     */
    @Route(value = "/active/:code", method = HttpMethod.GET)
    public ModelAndView activeAccount(@PathParam("code") String code, Request request, Response response) {
        Codes codes = codesService.getActivecode(code);
        if (null == codes) {
            request.attribute(this.ERROR, "无效的激活码");
            return this.getView("info");
        }

        Integer expries = codes.getExpired();
        if (expries < DateKit.getCurrentUnixTime()) {
            request.attribute(this.ERROR, "该激活码已经过期,请重新发送");
            return this.getView("info");
        }

        if (codes.getIs_use() == 1) {
            request.attribute(this.ERROR, "激活码已经被使用");
            return this.getView("info");
        }

        // 找回密码
        if (codes.getType().equals(EventType.FORGET)) {
            request.attribute("code", code);
            return this.getView("reset_pwd");
        }

        try {
            User temp = User.builder().uid(codes.getUid()).status(1).build();
            userService.update(temp);
            codesService.useCode(code);

            request.attribute(this.INFO, "激活成功,您可以凭密码登陆");
            optionsService.updateCount(EventType.USER_COUNT, +1);
            Constant.SYS_INFO = optionsService.getSystemInfo();
            Constant.VIEW_CONTEXT.set("sys_info", Constant.SYS_INFO);

        } catch (Exception e) {
            String msg = "激活失败";
            if (e instanceof TipException) {
                msg = e.getMessage();
            } else {
                log.error(msg, e);
            }
            request.attribute(this.ERROR, msg);
        }
        return this.getView("active");
    }

    /**
     * 忘记密码页面
     */
    @Route(value = "/forgot", method = HttpMethod.GET)
    public String show_forgot() {
        return "forgot";
    }

    /**
     * 忘记密码发送链接
     */
    @Route(value = "/forgot", method = HttpMethod.POST)
    public ModelAndView forgot(Request request, @QueryParam String email) {
        if (StringKit.isBlank(email)) {
            request.attribute(this.ERROR, "邮箱不能为空");
            return this.getView("forgot");
        }

        if (!PatternKit.isEmail(email)) {
            request.attribute(this.ERROR, "请输入正确的邮箱");
            request.attribute("email", email);
            return this.getView("forgot");
        }

        User user = userService.getUserByTake(new Take(User.class).eq("email", email));
        if (null == user) {
            request.attribute(this.ERROR, "该邮箱没有注册账户,请检查您的邮箱是否正确");
            request.attribute("email", email);
            return this.getView("forgot");
        }
        if (user.getStatus() == 0) {
            request.attribute(this.ERROR, "该邮箱未激活");
            request.attribute("email", email);
            return this.getView("forgot");
        }
        try {
            String code = codesService.save(user, "forgot");
            if (StringKit.isNotBlank(code)) {
                request.attribute(this.INFO, "修改密码链接已经发送到您的邮箱,请注意查收!");
            } else {
                request.attribute(this.ERROR, "找回密码失败");
            }
        } catch (Exception e) {
            String msg = "找回密码失败";
            if (e instanceof TipException) {
                msg = e.getMessage();
            } else {
                log.error(msg, e);
            }
            request.attribute(this.ERROR, msg);
        }
        return this.getView("forgot");
    }

}


text:
package com.avery.recuritcloud.entity.model;

import org.joda.time.DateTime;

public class PublisherModel {

    private String url;

    private DateTime createDate;

    public PublisherModel(String url, DateTime createDate) {
        this.url = url;
        this.createDate = createDate;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public DateTime getCreateDate() {
        return createDate;
    }

    public void setCreateDate(DateTime createDate) {
        this.createDate = createDate;
    }
}

redpajama_set_name: RedPajamaGithub


text:
import { styled } from '@linaria/react';
import { Color } from '../../constants';

const Link = styled.a`
  color: ${Color.DarkGrey};
  display: block;
  text-decoration: none;
`;

export default Link;


text:
using System;
using System.Collections;
using System.Diagnostics;
using System.Globalization;
using System.Windows;
using MS.Internal.Security.RightsManagement;
using SecurityHelper=MS.Internal.WindowsBase.SecurityHelper;

namespace System.Security.RightsManagement
{

    /// <summary>
    /// ContentGrant class represent a (ContentUser , ContentRight) pair this is
    /// a basic building block for structures that need to express information about rights granted to a document.
    /// </summary>
    /// <SecurityNote>
    ///     Critical:    This class expose access to methods that eventually do one or more of the the following
    ///             1. call into unmanaged code
    ///             2. affects state/data that will eventually cross over unmanaged code boundary
    ///             3. Return some RM related information which is considered private
    ///
    ///     TreatAsSafe: This attribute automatically applied to all public entry points. All the public entry points have
    ///     Demands for RightsManagementPermission at entry to counter the possible attacks that do
    ///     not lead to the unmanaged code directly(which is protected by another Demand there) but rather leave
    ///     some status/data behind which eventually might cross the unamanaged boundary.
    /// </SecurityNote>
    [SecurityCritical(SecurityCriticalScope.Everything)]
    public class ContentGrant
    {
        /// <summary>
        /// Constructor for the read only ContentGrant class. It takes values for user and right as parameters.
        /// </summary>
        public ContentGrant(ContentUser user, ContentRight right)
                    : this(user, right, DateTime.MinValue, DateTime.MaxValue)
        {
        }

        /// <summary>
        /// Constructor for the read only ContentGrant class. It takes values for
        ///     user, right, validFrom, and validUntil as parameters.
        /// </summary>
        public ContentGrant(ContentUser user, ContentRight right, DateTime validFrom, DateTime validUntil)
        {
            SecurityHelper.DemandRightsManagementPermission();
            // Add validation here

            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            if ((right != ContentRight.View) &&
                (right != ContentRight.Edit) &&
                (right != ContentRight.Print) &&
                (right != ContentRight.Extract) &&
                (right != ContentRight.ObjectModel) &&
                (right != ContentRight.Owner) &&
                (right != ContentRight.ViewRightsData) &&
                (right != ContentRight.Forward) &&
                (right != ContentRight.Reply) &&
                (right != ContentRight.ReplyAll) &&
                (right != ContentRight.Sign) &&
                (right != ContentRight.DocumentEdit)  &&
                (right != ContentRight.Export))
            {
                throw new ArgumentOutOfRangeException("right");
            }

            if (validFrom > validUntil)
            {
                throw new ArgumentOutOfRangeException("validFrom");
            }

            _user = user;
            _right = right;

            _validFrom = validFrom;
            _validUntil = validUntil;
        }

        /// <summary>
        /// Read only User propery.
        /// </summary>
        public ContentUser User
        {
            get
            {
                SecurityHelper.DemandRightsManagementPermission();
                return _user;
            }
        }

        /// <summary>
        /// Read only Right propery.
        /// </summary>
        public ContentRight Right
        {
            get
            {
                SecurityHelper.DemandRightsManagementPermission();
                return _right;
            }
        }

        /// <summary>
        /// The starting validity time, in UTC time, for the grant.
        /// </summary>
        public DateTime  ValidFrom
        {
            get
            {
                SecurityHelper.DemandRightsManagementPermission();

                return _validFrom;
            }
        }

        /// <summary>
        /// The ending validity time, in UTC time, for the grant.
        /// </summary>
        public DateTime  ValidUntil
        {
            get
            {
                SecurityHelper.DemandRightsManagementPermission();

                return _validUntil;
            }
        }

        private ContentUser _user;
        private ContentRight _right;
        private DateTime _validFrom;
        private DateTime _validUntil;
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.slc.sli</groupId>
    <version>1.0-SNAPSHOT</version>
    <artifactId>build-tools</artifactId>
    <name>Build Tools</name>
    <description>Configuration Files, such as eclipse, checkstyle, pmd specific</description>

    <prerequisites>
        <maven>3.0.0</maven>
    </prerequisites>

    <properties>
        <java.version>1.6</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.version>3.1</maven.compiler.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <scm>
        <connection>git@github.com:WGEN-SLI/SLI.git</connection>
        <developerConnection>git@github.com:WGEN-SLI/SLI.git</developerConnection>
        <url>https://github.com/WGEN-SLI/SLI</url>
    </scm>

    <distributionManagement>
        <repository>
            <id>sli-releases</id>
            <name>SLI Releases Repository</name>
            <url>https://nexus.dev.inbloom.org/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>sli-snapshots</id>
            <name>SLI Snapshots Repository</name>
            <url>https://nexus.dev.inbloom.org/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

</project>


text:
package demo.java.v1c04objectclass.ConstructorTest;

public class TestEmployee {

	public TestEmployee() {
		// TODO Auto-generated constructor stub
	}

	public static void main(String[] args) {
		 Employee ee = new Employee();
		 ee.getName();
	}

}


text:
module Azure::ContainerRegistry::Mgmt::V2019_05_01
  module Models
    #
    # The content trust policy for a container registry.
    #
    class TrustPolicy

      include MsRestAzure

      # @return [TrustPolicyType] The type of trust policy. Possible values
      # include: 'Notary'. Default value: 'Notary' .
      attr_accessor :type

      # @return [PolicyStatus] The value that indicates whether the policy is
      # enabled or not. Possible values include: 'enabled', 'disabled'. Default
      # value: 'disabled' .
      attr_accessor :status

      #
      # Mapper for TrustPolicy class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'TrustPolicy',
          type: {
            name: 'Composite',
            class_name: 'TrustPolicy',
            model_properties: {
              type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'type',
                default_value: 'Notary',
                type: {
                  name: 'String'
                }
              },
              status: {
                client_side_validation: true,
                required: false,
                serialized_name: 'status',
                default_value: 'disabled',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
namespace Observer
{
    public class BaggageInfo
    {
        public int FlightNumber { get; }

        public string From { get; }

        public int Carousel { get; }

        internal BaggageInfo(int flight, string from, int carousel)
        {
            FlightNumber = flight;
            From = from;
            Carousel = carousel;
        }
    }
}


text:
import {
    Column,
    Entity,
    PrimaryGeneratedColumn,
    ValueTransformer,
} from "../../../../../src"

const encode: ValueTransformer = {
    to: (entityValue: string) => {
        return encodeURI(entityValue)
    },
    from: (databaseValue: string) => {
        return decodeURI(databaseValue)
    },
}

export const encrypt: ValueTransformer = {
    to: (entityValue: string) => {
        return Buffer.from(entityValue).toString("base64")
    },
    from: (databaseValue: string) => {
        return Buffer.from(databaseValue, "base64").toString()
    },
}

export const lowercase: ValueTransformer = {
    to: (entityValue: string) => {
        return entityValue.toLocaleLowerCase()
    },
    from: (databaseValue: string) => {
        return databaseValue
    },
}

@Entity()
export class User {
    @PrimaryGeneratedColumn("uuid")
    id: string

    @Column({ transformer: [lowercase, encode, encrypt] })
    email: string
}


text:
<?php

namespace app\models;
use yii\di\Container;

interface CRUDInterface {
    public function index();
    public function create();
    public function update($id);
    public function delete($id);
    public function findModel($id);
}


text:
//===----------------------------------------------------------------------===//
//
//                         Peloton
//
// pattern.h
//
// Identification: src/include/optimizer/pattern.h
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//

#pragma once

#include "optimizer/operator_node.h"

#include <vector>
#include <memory>

namespace peloton {
namespace optimizer {

class Pattern {
 public:
  Pattern(OpType op);

  void AddChild(std::shared_ptr<Pattern> child);

  const std::vector<std::shared_ptr<Pattern>> &Children() const;

  OpType Type() const;

 private:
  OpType _type;
  std::vector<std::shared_ptr<Pattern>> children;
};

} /* namespace optimizer */
} /* namespace peloton */


text:
package com.google.security.zynamics.binnavi.debug.models.breakpoints.conditions;

/**
 * Class used to switch between condition tree nodes according to their concrete type.
 */
public class ConditionNodeSwitcher {
  /**
   * You are not supposed to instantiate this class.
   */
  private ConditionNodeSwitcher() {}

  /**
   * Switches a condition tree node.
   *
   * @param <T> Return type of the function.
   *
   * @param node The node to switch.
   * @param switcher The switcher callback object.
   *
   * @return The return value of the switched method.
   */
  public static <T> T process(final ConditionNode node, final NodeSwitcher<T> switcher) {
    if (node instanceof ExpressionNode) {
      return switcher.process((ExpressionNode) node);
    } else if (node instanceof FormulaNode) {
      return switcher.process((FormulaNode) node);
    } else if (node instanceof IdentifierNode) {
      return switcher.process((IdentifierNode) node);
    } else if (node instanceof MemoryNode) {
      return switcher.process((MemoryNode) node);
    } else if (node instanceof NumberNode) {
      return switcher.process((NumberNode) node);
    } else if (node instanceof RelationNode) {
      return switcher.process((RelationNode) node);
    } else if (node instanceof SubNode) {
      return switcher.process((SubNode) node);
    } else {
      throw new IllegalStateException("IE00355: Unknown node type");
    }
  }

  /**
   * Callback interface for condition node switcher objects.
   *
   * @param <T> The return values of all methods.
   */
  public interface NodeSwitcher<T> {
    /**
     * Processes an expression node.
     *
     * @param node The node to process.
     *
     * @return Can return anything.
     */
    T process(ExpressionNode node);

    /**
     * Processes a formula node.
     *
     * @param node The node to process.
     *
     * @return Can return anything.
     */
    T process(FormulaNode node);

    /**
     * Processes an identifier node.
     *
     * @param node The node to process.
     *
     * @return Can return anything.
     */
    T process(IdentifierNode node);

    /**
     * Processes a memory node.
     *
     * @param node The node to process.
     *
     * @return Can return anything.
     */
    T process(MemoryNode node);

    /**
     * Processes a number node.
     *
     * @param node The node to process.
     *
     * @return Can return anything.
     */
    T process(NumberNode node);

    /**
     * Processes a relation node.
     *
     * @param node The node to process.
     *
     * @return Can return anything.
     */
    T process(RelationNode node);

    /**
     * Processes a sub node.
     *
     * @param node The node to process.
     *
     * @return Can return anything.
     */
    T process(SubNode node);
  }
}


text:
Extensions for SwiftNIO to support Apple platforms as first-class citizens.

## About NIO Transport Services

NIO Transport Services is an extension to SwiftNIO that provides first-class support for Apple platforms by using [Network.framework](https://developer.apple.com/documentation/network) to provide network connectivity, and [Dispatch](https://developer.apple.com/documentation/dispatch) to provide concurrency. NIOTS provides an alternative [EventLoop](https://apple.github.io/swift-nio/docs/current/NIO/Protocols/EventLoop.html), [EventLoopGroup](https://apple.github.io/swift-nio/docs/current/NIO/Protocols/EventLoopGroup.html), and several alternative [Channels](https://apple.github.io/swift-nio/docs/current/NIO/Protocols/Channel.html) and Bootstraps.

In addition to providing first-class support for Apple platforms, NIO Transport Services takes advantage of the richer API of Network.framework to provide more insight into the behaviour of the network than is normally available to NIO applications. This includes the ability to wait for connectivity until a network route is available, as well as all of the extra proxy and VPN support that is built directly into Network.framework.

All regular NIO applications should work just fine with NIO Transport Services, simply by changing the event loops and bootstraps in use.

## Why Transport Services?

Network.framework is Apple's reference implementation of the [proposed post-sockets API](https://datatracker.ietf.org/wg/taps/charter/) that is currently being worked on by the Transport Services Working Group (taps) of the IETF. To indicate the proposed long-term future of interfaces like Network.framework, we decided to call this module NIOTransportServices. Also, NIONetworkFramework didn't appeal to us much as a name.

## How to Use NIO Transport Services

NIO Transport Services primarily uses SwiftPM as its build tool, so we recommend using that as well. If you want to depend on NIO Transport Services in your own project, it's as simple as adding a dependencies clause to your Package.swift:

```
dependencies: [
    .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.13.0")
]
```

and then adding the `NIOTransportServices` module to your target dependencies.

If your project is set up as an Xcode project and you're using Xcode 11+, you can add NIO Transport Services as a dependency to your Xcode project by clicking File -> Swift Packages -> Add Package Dependency. In the upcoming dialog, please enter `https://github.com/apple/swift-nio-transport-services.git` and click Next twice. Finally, make sure `NIOTransportServices` is selected and click finish. Now will be able to `import NIOTransportServices` in your project.

### Supported Platforms

NIOTransportServices is supported where Network.framework is supported: macOS
10.14+, iOS 12+, tvOS 12+, and watchOS 6+.

In order to allow dependencies to use NIOTransportServices when it's available
and fallback to NIO when it isn't, all code is behind import guards checking
the availability of Network.framework. As such NIOTransportServices may be
built on platforms where Network.framework is *not* available.
NIOTransportServices can be built on macOS 10.12+, iOS 10+, tvOS 10+, watchOS
6+ and Linux but is only functionally useful on macOS 10.14+, iOS 12+, tvOS 12+
and watchOS 6+.

## Versioning

Just like the rest of the SwiftNIO family, `swift-nio-transport-services` follows [SemVer 2.0.0](https://semver.org/#semantic-versioning-200) with a separate document
declaring [SwiftNIO's Public API](https://github.com/apple/swift-nio/blob/main/docs/public-api.md).

### NIO Transport Services 1.x

`swift-nio-transport-services` versions 1.x is part of the SwiftNIO 2 family of repositories and does not have any dependencies besides [`swift-nio`](https://github.com/apple/swift-nio), Swift 5.5.2, and an Apple OS supporting `Network.framework`. As the latest version, it lives on the [`main`](https://github.com/apple/swift-nio-transport-services) branch.

To depend on `swift-nio-transport-services `, put the following in the `dependencies` of your `Package.swift`:

    .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.0.0"),

The most recent versions of SwiftNIO Transport Services support Swift 5.5.2 and newer. The minimum Swift version supported by SwiftNIO Transport Services releases are detailed below:

SwiftNIO Extras     | Minimum Swift Version
--------------------|----------------------
`1.0.0 ..< 1.11.0`  | 5.0
`1.11.0 ..< 1.12.0` | 5.2
`1.12.0 ..< 1.14.0` | 5.4
`1.14.0 ...`        | 5.5.2

### NIO Transport Services 0.x

The legacy `swift-nio-transport-services` 0.x is part of the SwiftNIO 1 family of repositories and works with Swift 4.1 and newer. The source code can be found on the [`swift-nio-transport-services-swift-4-maintenance`](https://github.com/apple/swift-nio-transport-services/tree/swift-nio-transport-services-swift-4-maintenance) branch.

## Topics

### Event Loops and Groups

- ``NIOTSEventLoopGroup``
- ``QoSEventLoop``

### Client Connections

- ``NIOTSConnectionBootstrap``
- ``NIOTSClientTLSProvider``

### Server Connections

- ``NIOTSListenerBootstrap``

### Configuring Channels

- ``NIOTSChannelOptions``
- ``NIOTSEnablePeerToPeerOption``
- ``NIOTSWaitForActivityOption``

### Managing Channels

- ``NIOTSNetworkEvents``
- ``NIOTSNetworkEvent``

### Errors

- ``NIOTSErrors``
- ``NIOTSError``

### Channel Handlers

- ``NIOFilterEmptyWritesHandler``


text:
define([
    '../index.js',
    './demo-ctrl',
    './demo-state'
], function (mdToast, demoCtrl, demoState) {
    var demo = angular
        .module('md-toast-demo', [
            mdToast.name
        ])
        .config(demoState)
        .controller('demo-md-toast-ctrl', demoCtrl);

    return demo;
});


text:
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CountRegularExpressionGroups</title>

CountRegularExpressionGroups()

语法

结果 = CountRegularExpressionGroups(#RegularExpression)

概要

返回 #RegularExpression 中定义的分组数量. 被匹配的正则表达式分组可以通过函数例如 RegularExpressionGroup() 访问.

参数

#RegularExpression

要使用的正则表达式.

返回值

在正则表达式中定义的分组数量.

备注

在正则表达式中的分组由包围在表达式左右的括号 "(" 和 ")" 定义. 这些分组的排序由它们在正则表达式中出现的顺序决定. 第一组被分组为序列 1.

参阅

RegularExpressionGroup()

已支持操作系统
所有

正则表达式索引 - CreateRegularExpression() ->


text:
<link rel="import" href="app-runtime-list.html">
<link rel="import" href="app-template-list.html">

<dom-module id="app-new" >
    <style>
        :host {
            @apply(--layout-fit);
        }
    </style>

    <template>
        <app-runtime-list id="runtimeList"
            hidden$="[[!_runtimeList(curIndex)]]"
        ></app-runtime-list>
        <app-template-list id="templateList"
            hidden$="[[!_templateList(curIndex)]]"
            runtime-info="{{runtimeInfo}}"
        ></app-template-list>
    </template>

    <script>
        Polymer({
            is: 'app-new',

            listeners: {
                'back': '_onBack',
                'next': '_onNext',
            },

            ready: function () {
                this.curIndex = 0;
                this.runtimeInfo = null;
            },

            reset: function () {
                this.curIndex = 0;
                this.runtimeInfo = null;
                this.$.runtimeList.reset();
                this.$.templateList.reset();
            },

            _onBack: function ( event ) {
                this.curIndex = Math.max( this.curIndex - 1, 0 );
            },

            _onNext: function ( event ) {
                switch ( this.curIndex ) {
                case 0:
                    this.set('runtimeInfo', event.detail.info);
                    this.$.templateList.focusInput();
                    break;

                case 1:
                    break;
                }

                this.curIndex = Math.min( this.curIndex + 1, 1 );
            },

            _runtimeList: function ( idx ) {
                return idx === 0;
            },

            _templateList: function ( idx ) {
                return idx === 1;
            },
        });
    </script>
</dom-module>


text:
/*
 * The code of this project is a port of (or wrapper around) the Guava-libraries.
 *    See http://code.google.com/p/guava-libraries/
 *
 * @author Markus Schneider
 */
package org.feijoas.mango.common.hash

import scala.annotation.implicitNotFound

import org.feijoas.mango.common.annotations.Beta
import org.feijoas.mango.common.hash.Funnel.asGuavaFunnel

import com.google.common.hash.{ BloomFilter => GuavaBloomFilter }

/**
 * A Bloom filter for instances of `T`. A Bloom filter offers an approximate containment test
 *  with one-sided error: if it claims that an element is contained in it, this might be in error,
 *  but if it claims that an element is not contained in it, then this is definitely true.
 *
 *
From the Guava BloomFilter tutorial:
 *  {{{
 *  implicit object PersonFunnel extends Funnel[Person] {
 *     override def funnel(from: Person, into: PrimitiveSink) = ...
 *  }
 *
 *  val friends: BloomFilter[Person] = BloomFilter.create(500, 0.01)
 *  friendsList.foreach { case p: Person => friends.put(p) }
 *
 *  // much later
 *  if (friends.mightContain(dude)) {
 *     // the probability that dude reached this place if he isn't a friend is 1%
 *     // we might, for example, start asynchronously loading things for dude while we do a more expensive exact check
 *  }
 *
 *  }}}
 *
 *
The false positive probability (`FPP`) of a bloom filter is defined as the probability
 *  that `#mightContain(T)` will erroneously return `true` for an object that
 *  has not actually been put in the `BloomFilter`.
 *
 *  @author Markus Schneider
 *  @since 0.6 (copied from Guava-libraries)
 */
@Beta
@SerialVersionUID(1L)
final case class BloomFilter[T] private (private val delegate: GuavaBloomFilter[T]) extends (T => Boolean) with Serializable {

  /**
   * Creates a new {@code BloomFilter} that's a copy of this instance. The new instance is equal to
   *  this instance but shares no mutable state.
   */
  def copy() = new BloomFilter(delegate.copy())

  /**
   * Returns {@code true} if the element might have been put in this Bloom filter,
   *  {@code false} if this is definitely not the case.
   */
  def mightContain(obj: T): Boolean = delegate.mightContain(obj)

  /**
   * Puts an element into this {@code BloomFilter}. Ensures that subsequent invocations of
   *  `#mightContain(T)` with the same element will always return {@code true}.
   *
   *  @return true if the bloom filter's bits changed as a result of this operation. If the bits
   *     changed, this is definitely the first time {@code object} has been added to the
   *     filter. If the bits haven't changed, this might be the first time {@code object}
   *     has been added to the filter. Note that {@code put(t)} always returns the
   *     opposite result to what {@code mightContain(t)} would have returned at the time
   *     it is called."
   */
  def put(obj: T): Boolean = delegate.put(obj)

  /**
   * Returns the probability that `#mightContain(T)` will erroneously return
   *  {@code true} for an object that has not actually been put in the {@code BloomFilter}.
   *
   *
Ideally, this number should be close to the {@code fpp} parameter
   *  passed in `#create(Integer, Double)`, or smaller. If it is
   *  significantly higher, it is usually the case that too many elements (more than
   *  expected) have been put in the {@code BloomFilter}, degenerating it.
   */
  def expectedFpp(): Double = delegate.expectedFpp()

  /**
   * Equivalent to `#mightContain`; provided only to satisfy the {@link Predicate} interface.
   *  When using a reference of type {@code BloomFilter}, always invoke {@link #mightContain}
   *  directly instead.
   */
  override def apply(input: T): Boolean = delegate.mightContain(input)

  override def toString = "BloomFilter"
}

/**
 * Factory for BloomFilters
 *
 *  In order to be able to create a `BloomFilter[T]` an implementation of a
 *  [[Funnel]] for `T` (called type class) must be in implicit scope (recommended)
 *  or passed explicitly as a parameter.
 */
final object BloomFilter {

  /**
   * Creates a {@code Builder} of a `BloomFilter[T]`, with the expected number
   *  of insertions and expected false positive probability.
   *
   *
Note that overflowing a `BloomFilter` with significantly more elements
   *  than specified, will result in its saturation, and a sharp deterioration of its
   *  false positive probability.
   *
   *
The constructed `BloomFilter[T]` will be serializable if the provided
   *  `Funnel[T]` is.
   *
   *  @param funnel the funnel of T's that the constructed {@code BloomFilter[T]} will use
   *  @param expectedInsertions the number of expected insertions to the constructed
   *     {@code BloomFilter[T]}; must be positive
   *  @param fpp the desired false positive probability (must be positive and less than 1.0)
   *  @return a {@code BloomFilter}
   */
  @implicitNotFound(msg = "No implementation of Funnel[${T}] in implicit scope")
  def create[T](expectedInsertions: Int, fpp: Double)(implicit funnel: Funnel[T]): BloomFilter[T] = {
    new BloomFilter(GuavaBloomFilter.create[T](funnel.asJava, expectedInsertions, fpp))
  }

  /**
   * Creates a {@code Builder} of a {@link BloomFilter BloomFilter[T]}, with the expected number
   *  of insertions, and a default expected false positive probability of 3%.
   *
   *
Note that overflowing a {@code BloomFilter} with significantly more elements
   *  than specified, will result in its saturation, and a sharp deterioration of its
   *  false positive probability.
   *
   *
The constructed {@code BloomFilter[T]} will be serializable if the provided
   *  {@code Funnel[T]} is.
   *
   *  @param funnel the funnel of T's that the constructed {@code BloomFilter[T]} will use
   *  @param expectedInsertions the number of expected insertions to the constructed
   *     {@code BloomFilter<T>}; must be positive
   *  @return a {@code BloomFilter}
   */
  @implicitNotFound(msg = "No implementation of Funnel[${T}] in implicit scope")
  def create[T](expectedInsertions: Int)(implicit funnel: Funnel[T]): BloomFilter[T] = {
    new BloomFilter(GuavaBloomFilter.create[T](funnel.asJava, expectedInsertions))
  }

  /**
   * Creates a {@code Builder} of a `BloomFilter[T]`, with the expected number
   *  of insertions and expected false positive probability.
   *
   *
Note that overflowing a `BloomFilter` with significantly more elements
   *  than specified, will result in its saturation, and a sharp deterioration of its
   *  false positive probability.
   *
   *
The constructed `BloomFilter[T]` will be serializable if the provided
   *  `Funnel[T]` is.
   *
   *  @param funnel the funnel of T's that the constructed {@code BloomFilter[T]} will use
   *  @param expectedInsertions the number of expected insertions to the constructed
   *     {@code BloomFilter[T]}; must be positive
   *  @param fpp the desired false positive probability (must be positive and less than 1.0)
   *  @return a {@code BloomFilter}
   */
  @implicitNotFound(msg = "No implementation of Funnel[${T}] in implicit scope")
  def create[T](expectedInsertions: Long, fpp: Double)(implicit funnel: Funnel[T]): BloomFilter[T] = {
    new BloomFilter(GuavaBloomFilter.create[T](funnel.asJava, expectedInsertions, fpp))
  }

  /**
   * Creates a {@code Builder} of a {@link BloomFilter BloomFilter[T]}, with the expected number
   *  of insertions, and a default expected false positive probability of 3%.
   *
   *
Note that overflowing a {@code BloomFilter} with significantly more elements
   *  than specified, will result in its saturation, and a sharp deterioration of its
   *  false positive probability.
   *
   *
The constructed {@code BloomFilter[T]} will be serializable if the provided
   *  {@code Funnel[T]} is.
   *
   *  @param funnel the funnel of T's that the constructed {@code BloomFilter[T]} will use
   *  @param expectedInsertions the number of expected insertions to the constructed
   *     {@code BloomFilter<T>}; must be positive
   *  @return a {@code BloomFilter}
   */
  @implicitNotFound(msg = "No implementation of Funnel[${T}] in implicit scope")
  def create[T](expectedInsertions: Long)(implicit funnel: Funnel[T]): BloomFilter[T] = {
    new BloomFilter(GuavaBloomFilter.create[T](funnel.asJava, expectedInsertions))
  }
}


text:
My Awesome desktop conf

    git clone git@github.com:j-san/awsome-conf.git .config/awesome/

install obvious in .config/awesome/

enable avahi-daemon cups netatalk


text:
class PrefRegistrySimple;

class Library : public base::RefCountedThreadSafe<Library> {
 public:
  Library();
  ~Library();

  static void CreateInstance();
  static Library* GetInstance();
  static void DeleteInstance();

  class LibraryObserver {
   public:
    virtual void OnBeginImport(Library* library) = 0;
    virtual void OnFinishImport(Library* library) = 0;
  };

  void AddObserver(LibraryObserver* observer);
  void RemoveObserver(LibraryObserver* observer);

  void ImportFromLibraryDir();

  Track* GetTrackForPlaying(int index);
  Track* GetNextTrackForPlaying();

  Track* GetTrack(int index);
  int GetNumTracks(void);

  void PrintTracks(void);

  static void RegisterPrefs(PrefRegistrySimple* registry);

 private:
  void Import(void);
  void NotifyImportDone(void);

  ObserverList<LibraryObserver> observers_;

  static scoped_refptr<Library> instance_;

  int current_track_;

  base::FilePath root_path_;

  DISALLOW_COPY_AND_ASSIGN(Library);
};

#endif  // LIBRARY_H_


text:
using System.Threading.Tasks;
using Eshopworld.DevOps;
using Eshopworld.Tests.Core;
using EShopWorld.Tools.Common;
using Xunit;

namespace EshopWorld.Tools.Tests
{
    [Collection(nameof(AzScanCLITestsL2Collection))]
    // ReSharper disable once InconsistentNaming
    public class AzScanAllCLITests : CLIInvokingTestsBase
    {
        private readonly AzScanCLITestsL2Fixture _fixture;

        public AzScanAllCLITests(AzScanCLITestsL2Fixture fixture)
        {
            _fixture = fixture;
        }

        [InlineData("-s", "-d")]
        [Theory, IsLayer2]
        public async Task CheckAllProjectedResourcesPerResourceGroup(string subParam, string domainParam)
        {
            await _fixture.DeleteAllSecretsAcrossRegions();
            InvokeCLI("azscan", "all", subParam, AzScanCLITestsL2Fixture.SierraIntegrationSubscription, domainParam, AzScanCLITestsL2FixtureBase.TestDomain);

            foreach (var region in RegionHelper.DeploymentRegionsToList())
            {
                var secrets = await _fixture.LoadAllKeyVaultSecrets(region.ToRegionCode());

                AzScanAppInsightsCLITests.CheckSecrets(secrets);
                await new AzScanCosmosCLITests(_fixture).CheckSecrets(secrets);
                new AzScanDNSCLITests(_fixture).CheckSecrets(secrets, region);
                await new AzScanSBCLITests(_fixture).CheckSecrets(secrets);
                AzScanEnvironmentInfoCommandCLITests.CheckSecrets(secrets);
            }
        }
    }
}


text:
using namespace llvm;

static cl::opt<bool> DisableDeallocRet(
                       "disable-hexagon-dealloc-ret",
                       cl::Hidden,
                       cl::desc("Disable Dealloc Return for Hexagon target"));

/// determineFrameLayout - Determine the size of the frame and maximum call
/// frame size.
void HexagonFrameLowering::determineFrameLayout(MachineFunction &MF) const {
  MachineFrameInfo *MFI = MF.getFrameInfo();

  // Get the number of bytes to allocate from the FrameInfo.
  unsigned FrameSize = MFI->getStackSize();

  // Get the alignments provided by the target.
  unsigned TargetAlign = MF.getTarget().getFrameLowering()->getStackAlignment();
  // Get the maximum call frame size of all the calls.
  unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();

  // If we have dynamic alloca then maxCallFrameSize needs to be aligned so
  // that allocations will be aligned.
  if (MFI->hasVarSizedObjects())
    maxCallFrameSize = RoundUpToAlignment(maxCallFrameSize, TargetAlign);

  // Update maximum call frame size.
  MFI->setMaxCallFrameSize(maxCallFrameSize);

  // Include call frame size in total.
  FrameSize += maxCallFrameSize;

  // Make sure the frame is aligned.
  FrameSize = RoundUpToAlignment(FrameSize, TargetAlign);

  // Update frame info.
  MFI->setStackSize(FrameSize);
}

void HexagonFrameLowering::emitPrologue(MachineFunction &MF) const {
  MachineBasicBlock &MBB = MF.front();
  MachineFrameInfo *MFI = MF.getFrameInfo();
  MachineModuleInfo &MMI = MF.getMMI();
  MachineBasicBlock::iterator MBBI = MBB.begin();
  const HexagonRegisterInfo *QRI =
    static_cast<const HexagonRegisterInfo *>(MF.getTarget().getRegisterInfo());
  DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
  determineFrameLayout(MF);

  // Check if frame moves are needed for EH.
  bool needsFrameMoves = MMI.hasDebugInfo() ||
    !MF.getFunction()->needsUnwindTableEntry();

  // Get the number of bytes to allocate from the FrameInfo.
  int NumBytes = (int) MFI->getStackSize();

  // LLVM expects allocframe not to be the first instruction in the
  // basic block.
  MachineBasicBlock::iterator InsertPt = MBB.begin();

  //
  // ALLOCA adjust regs.  Iterate over ADJDYNALLOC nodes and change the offset.
  //
  HexagonMachineFunctionInfo *FuncInfo =
    MF.getInfo<HexagonMachineFunctionInfo>();
  const std::vector<MachineInstr*>& AdjustRegs =
    FuncInfo->getAllocaAdjustInsts();
  for (std::vector<MachineInstr*>::const_iterator i = AdjustRegs.begin(),
         e = AdjustRegs.end();
       i != e; ++i) {
    MachineInstr* MI = *i;
    assert((MI->getOpcode() == Hexagon::ADJDYNALLOC) &&
           "Expected adjust alloca node");

    MachineOperand& MO = MI->getOperand(2);
    assert(MO.isImm() && "Expected immediate");
    MO.setImm(MFI->getMaxCallFrameSize());
  }

 std::vector<MachineMove> &Moves = MMI.getFrameMoves();

 if (needsFrameMoves) {
   // Advance CFA. DW_CFA_def_cfa
   unsigned FPReg = QRI->getFrameRegister();
   unsigned RAReg = QRI->getRARegister();

   MachineLocation Dst(MachineLocation::VirtualFP);
   MachineLocation Src(FPReg, -8);
   Moves.push_back(MachineMove(0, Dst, Src));

   // R31 = (R31 - #4)
   MachineLocation LRDst(RAReg, -4);
   MachineLocation LRSrc(RAReg);
   Moves.push_back(MachineMove(0, LRDst, LRSrc));

   // R30 = (R30 - #8)
   MachineLocation SPDst(FPReg, -8);
   MachineLocation SPSrc(FPReg);
   Moves.push_back(MachineMove(0, SPDst, SPSrc));
 }

  //
  // Only insert ALLOCFRAME if we need to.
  //
  if (hasFP(MF)) {
    // Check for overflow.
    // Hexagon_TODO: Ugh! hardcoding. Is there an API that can be used?
    const int ALLOCFRAME_MAX = 16384;
    const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo();

    if (NumBytes >= ALLOCFRAME_MAX) {
      // Emit allocframe(#0).
      BuildMI(MBB, InsertPt, dl, TII.get(Hexagon::ALLOCFRAME)).addImm(0);

      // Subtract offset from frame pointer.
      BuildMI(MBB, InsertPt, dl, TII.get(Hexagon::CONST32_Int_Real),
                                      HEXAGON_RESERVED_REG_1).addImm(NumBytes);
      BuildMI(MBB, InsertPt, dl, TII.get(Hexagon::SUB_rr),
                                      QRI->getStackRegister()).
                                      addReg(QRI->getStackRegister()).
                                      addReg(HEXAGON_RESERVED_REG_1);
    } else {
      BuildMI(MBB, InsertPt, dl, TII.get(Hexagon::ALLOCFRAME)).addImm(NumBytes);
    }
  }
}
// Returns true if MBB has a machine instructions that indicates a tail call
// in the block.
bool HexagonFrameLowering::hasTailCall(MachineBasicBlock &MBB) const {
  MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
  unsigned RetOpcode = MBBI->getOpcode();

  return RetOpcode == Hexagon::TCRETURNtg || RetOpcode == Hexagon::TCRETURNtext;
}

void HexagonFrameLowering::emitEpilogue(MachineFunction &MF,
                                     MachineBasicBlock &MBB) const {
  MachineBasicBlock::iterator MBBI = prior(MBB.end());
  DebugLoc dl = MBBI->getDebugLoc();
  //
  // Only insert deallocframe if we need to.
  //
  if (hasFP(MF)) {
    MachineBasicBlock::iterator MBBI = prior(MBB.end());
    MachineBasicBlock::iterator MBBI_end = MBB.end();
    //
    // For Hexagon, we don't need the frame size.
    //
    MachineFrameInfo *MFI = MF.getFrameInfo();
    int NumBytes = (int) MFI->getStackSize();

    const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo();

    // Replace 'jumpr r31' instruction with dealloc_return for V4 and higher
    // versions.
    if (STI.hasV4TOps() && MBBI->getOpcode() == Hexagon::JMPret
                        && !DisableDeallocRet) {
      // Remove jumpr node.
      MBB.erase(MBBI);
      // Add dealloc_return.
      BuildMI(MBB, MBBI_end, dl, TII.get(Hexagon::DEALLOC_RET_V4))
        .addImm(NumBytes);
    } else { // Add deallocframe for V2 and V3.
      BuildMI(MBB, MBBI, dl, TII.get(Hexagon::DEALLOCFRAME)).addImm(NumBytes);
    }
  }
}

bool HexagonFrameLowering::hasFP(const MachineFunction &MF) const {
  const MachineFrameInfo *MFI = MF.getFrameInfo();
  const HexagonMachineFunctionInfo *FuncInfo =
    MF.getInfo<HexagonMachineFunctionInfo>();
  return (MFI->hasCalls() || (MFI->getStackSize() > 0) ||
          FuncInfo->hasClobberLR() );
}

static inline
unsigned uniqueSuperReg(unsigned Reg, const TargetRegisterInfo *TRI) {
  MCSuperRegIterator SRI(Reg, TRI);
  assert(SRI.isValid() && "Expected a superreg");
  unsigned SuperReg = *SRI;
  ++SRI;
  assert(!SRI.isValid() && "Expected exactly one superreg");
  return SuperReg;
}

bool
HexagonFrameLowering::spillCalleeSavedRegisters(
                                        MachineBasicBlock &MBB,
                                        MachineBasicBlock::iterator MI,
                                        const std::vector<CalleeSavedInfo> &CSI,
                                        const TargetRegisterInfo *TRI) const {
  MachineFunction *MF = MBB.getParent();
  const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo();

  if (CSI.empty()) {
    return false;
  }

  // We can only schedule double loads if we spill contiguous callee-saved regs
  // For instance, we cannot scheduled double-word loads if we spill r24,
  // r26, and r27.
  // Hexagon_TODO: We can try to double-word align odd registers for -O2 and
  // above.
  bool ContiguousRegs = true;

  for (unsigned i = 0; i < CSI.size(); ++i) {
    unsigned Reg = CSI[i].getReg();

    //
    // Check if we can use a double-word store.
    //
    unsigned SuperReg = uniqueSuperReg(Reg, TRI);
    bool CanUseDblStore = false;
    const TargetRegisterClass* SuperRegClass = 0;

    if (ContiguousRegs && (i < CSI.size()-1)) {
      unsigned SuperRegNext = uniqueSuperReg(CSI[i+1].getReg(), TRI);
      SuperRegClass = TRI->getMinimalPhysRegClass(SuperReg);
      CanUseDblStore = (SuperRegNext == SuperReg);
    }

    if (CanUseDblStore) {
      TII.storeRegToStackSlot(MBB, MI, SuperReg, true,
                              CSI[i+1].getFrameIdx(), SuperRegClass, TRI);
      MBB.addLiveIn(SuperReg);
      ++i;
    } else {
      // Cannot use a double-word store.
      ContiguousRegs = false;
      const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg);
      TII.storeRegToStackSlot(MBB, MI, Reg, true, CSI[i].getFrameIdx(), RC,
                              TRI);
      MBB.addLiveIn(Reg);
    }
  }
  return true;
}

bool HexagonFrameLowering::restoreCalleeSavedRegisters(
                                        MachineBasicBlock &MBB,
                                        MachineBasicBlock::iterator MI,
                                        const std::vector<CalleeSavedInfo> &CSI,
                                        const TargetRegisterInfo *TRI) const {

  MachineFunction *MF = MBB.getParent();
  const TargetInstrInfo &TII = *MF->getTarget().getInstrInfo();

  if (CSI.empty()) {
    return false;
  }

  // We can only schedule double loads if we spill contiguous callee-saved regs
  // For instance, we cannot scheduled double-word loads if we spill r24,
  // r26, and r27.
  // Hexagon_TODO: We can try to double-word align odd registers for -O2 and
  // above.
  bool ContiguousRegs = true;

  for (unsigned i = 0; i < CSI.size(); ++i) {
    unsigned Reg = CSI[i].getReg();

    //
    // Check if we can use a double-word load.
    //
    unsigned SuperReg = uniqueSuperReg(Reg, TRI);
    const TargetRegisterClass* SuperRegClass = 0;
    bool CanUseDblLoad = false;
    if (ContiguousRegs && (i < CSI.size()-1)) {
      unsigned SuperRegNext = uniqueSuperReg(CSI[i+1].getReg(), TRI);
      SuperRegClass = TRI->getMinimalPhysRegClass(SuperReg);
      CanUseDblLoad = (SuperRegNext == SuperReg);
    }

    if (CanUseDblLoad) {
      TII.loadRegFromStackSlot(MBB, MI, SuperReg, CSI[i+1].getFrameIdx(),
                               SuperRegClass, TRI);
      MBB.addLiveIn(SuperReg);
      ++i;
    } else {
      // Cannot use a double-word load.
      ContiguousRegs = false;
      const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg);
      TII.loadRegFromStackSlot(MBB, MI, Reg, CSI[i].getFrameIdx(), RC, TRI);
      MBB.addLiveIn(Reg);
    }
  }
  return true;
}

void HexagonFrameLowering::
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
                              MachineBasicBlock::iterator I) const {
  MachineInstr &MI = *I;

  if (MI.getOpcode() == Hexagon::ADJCALLSTACKDOWN) {
    // Hexagon_TODO: add code
  } else if (MI.getOpcode() == Hexagon::ADJCALLSTACKUP) {
    // Hexagon_TODO: add code
  } else {
    llvm_unreachable("Cannot handle this call frame pseudo instruction");
  }
  MBB.erase(I);
}

int HexagonFrameLowering::getFrameIndexOffset(const MachineFunction &MF,
                                              int FI) const {
  return MF.getFrameInfo()->getObjectOffset(FI);
}


text:
using Esri.ArcGISRuntime.Portal;
using Esri.ArcGISRuntime.Security;

namespace AgoApp.Model
{
    /// <summary>
    /// Represents a connection to a portal instance.
    /// </summary>
    public class PortalConnection
    {
        private readonly TokenCredential _tokenCredential;
        private readonly ArcGISPortal _portal;

        /// <summary>
        /// Creates a new connection instance using a credential.
        /// </summary>
        /// <param name="tokenCredential">The token credential.</param>
        /// <param name="portal">The portal instance.</param>
        public PortalConnection(TokenCredential tokenCredential, ArcGISPortal portal)
        {
            _tokenCredential = tokenCredential;
            _portal = portal;
        }

        /// <summary>
        /// Creates a new connection instance using anonymous access.
        /// </summary>
        /// <param name="portal">The portal instance.</param>
        public PortalConnection(ArcGISPortal portal)
        {
            _tokenCredential = null;
            _portal = portal;
        }

        public TokenCredential TokenCredential
        {
            get { return _tokenCredential; }
        }

        public ArcGISPortal Portal
        {
            get { return _portal; }
        }
    }
}


text:
package com.thinkbiganalytics.metadata.modeshape.generic;

import com.thinkbiganalytics.metadata.api.MetadataAccess;
import com.thinkbiganalytics.metadata.api.generic.GenericEntity;
import com.thinkbiganalytics.metadata.api.generic.GenericEntityProvider;
import com.thinkbiganalytics.metadata.api.generic.GenericType;
import com.thinkbiganalytics.metadata.api.generic.GenericType.PropertyType;
import com.thinkbiganalytics.metadata.modeshape.ModeShapeEngineConfig;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import static org.assertj.core.api.Assertions.assertThat;

@SpringBootTest(classes = {ModeShapeEngineConfig.class})
public class JcrGenericEntityProviderTest extends AbstractTestNGSpringContextTests {

    @Inject
    private GenericEntityProvider provider;

    @Inject
    private MetadataAccess metadata;

    @Test(enabled = false)
    public void testCreateType() {
        String typeName = metadata.commit(() -> {
            Map<String, GenericType.PropertyType> fields = new HashMap<>();
            fields.put("name", PropertyType.STRING);
            fields.put("description", PropertyType.STRING);
            fields.put("age", PropertyType.LONG);

            GenericType type = provider.createType("Person", fields);

            return type.getName();
        });

        assertThat(typeName).isNotNull().isEqualTo("Person");
    }

    @Test(enabled = false, dependsOnMethods = "testCreateType")
    public void getPersonType() {
        boolean found = metadata.commit(() -> {
            GenericType type = provider.getType("Person");

            return type != null;
        });

        assertThat(found).isTrue();
    }

    @Test(enabled = false, dependsOnMethods = "testCreateType")
    public void getAllType() {
        int size = metadata.commit(() -> {
            List<GenericType> types = provider.getTypes();

            return types.size();
        });

        assertThat(size).isEqualTo(1);
    }

    @Test(enabled = false, dependsOnMethods = "testCreateType")
    public void testCreateEntity() {
        GenericEntity.ID id = metadata.commit(() -> {
            GenericType type = provider.getType("Person");

            Map<String, Object> props = new HashMap<>();
            props.put("name", "Bob");
            props.put("description", "Silly");
            props.put("age", 50);

            GenericEntity entity = provider.createEntity(type, props);

            return entity.getId();
        });

        assertThat(id).isNotNull();
    }

    @Test(enabled = false, dependsOnMethods = "testCreateEntity")
    public void testGetEntity() {
        String typeName = metadata.commit(() -> {
            List<GenericEntity> list = provider.getEntities();

            assertThat(list).isNotNull().hasSize(1);

            GenericEntity.ID id = list.get(0).getId();
            GenericEntity entity = provider.getEntity(id);

            assertThat(entity).isNotNull();
            assertThat(entity.getProperty("name")).isEqualTo("Bob");

            return entity.getTypeName();
        });

        assertThat(typeName).isEqualTo("Person");
    }
}


text:
Runs jacobalberty/unifi image for Uniquiti controller.

## Components ##
N/A

## Pre-Requisites ##
Check host volume paths before running the script.
Check project documentation for volumes required. By default, it expects a directory called "contents/unifi" in your logged in user home directory so that data is maintained even after the container is removed. Automatic backup of settings will also be saved in this directory if enabled on the Unifi controller.

# Starting Controller #
There are 2 ways of starting the ccontroller using [docker-compose](https://docs.docker.com/compose) or docker (engine). Compose has more pre-requsites to setup but also should make it easier to manage.

Check the above pre-requisites before continuing below.

## docker-compose ##
Ensure [docker-compose](https://docs.docker.com/compose/install/) is installed. The commands below may require elevated priviledges such as sudo.

1. Go to the cloned directory where the doccker-compose.yml file is.
2. Run the cron.sh file:
   1. ./cron.sh

## docker engine ##
1. Use the start.sh script to perform a docker run command to start the container:
   1. ./start.sh

# Upgrading Controller #
## docker-compose ##
1. Go to the cloned directory where the docker-compose.yml file is.
2. Run the cron.sh file:
   1. ./cron.sh

## docker engine ##
1. Stop and remove container:
   1. docker stop unifi && docker rm unifi
3. Restart the container which should rebuild from fresh because the previous stop removes the container:
   1. ./start.sh

# Automatic Update #
Use a task scheduler like cron to run either the cron.sh or the start.sh to stop and remove existing container then rebuild and restart the container. If there is a new version of the Unifi controller available then this will pull the latest images and run them. Example cron entry to restart every week on Friday at 3am using docker-compose:
```
0 3 * * 5 cron.sh
```
or docker
```
0 3 * * 5 start.sh
```


text:
require_relative './automated_init'

context "AsyncInvocation Response" do
  test "Raises an error when used synchronously" do
    assert_raises(AsyncInvocation::Incorrect::Error) do
      AsyncInvocation::Incorrect.something
    end
  end
end


text:
require 'spec_helper_acceptance'

describe 'num2bool function' do
  describe 'success' do
    it 'bools positive numbers and numeric strings as true' do
      pp = <<-EOS
      $a = 1
      $b = "1"
      $c = "50"
      $ao = num2bool($a)
      $bo = num2bool($b)
      $co = num2bool($c)
      notice(inline_template('a is <%= @ao.inspect %>'))
      notice(inline_template('b is <%= @bo.inspect %>'))
      notice(inline_template('c is <%= @co.inspect %>'))
      EOS

      apply_manifest(pp, :catch_failures => true) do |r|
        expect(r.stdout).to match(/a is true/)
        expect(r.stdout).to match(/b is true/)
        expect(r.stdout).to match(/c is true/)
      end
    end
    it 'bools negative numbers as false' do
      pp = <<-EOS
      $a = 0
      $b = -0.1
      $c = ["-50","1"]
      $ao = num2bool($a)
      $bo = num2bool($b)
      $co = num2bool($c)
      notice(inline_template('a is <%= @ao.inspect %>'))
      notice(inline_template('b is <%= @bo.inspect %>'))
      notice(inline_template('c is <%= @co.inspect %>'))
      EOS

      apply_manifest(pp, :catch_failures => true) do |r|
        expect(r.stdout).to match(/a is false/)
        expect(r.stdout).to match(/b is false/)
        expect(r.stdout).to match(/c is false/)
      end
    end
  end
  describe 'failure' do
    it 'fails on words' do
      pp = <<-EOS
      $a = "a"
      $ao = num2bool($a)
      notice(inline_template('a is <%= @ao.inspect %>'))
      EOS
      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/not look like a number/)
    end

    it 'fails on numberwords' do
      pp = <<-EOS
      $b = "1b"
      $bo = num2bool($b)
      notice(inline_template('b is <%= @bo.inspect %>'))
      EOS
      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/not look like a number/)

    end

    it 'fails on non-numeric/strings' do
      pending "The function will call .to_s.to_i on anything not a Numeric or
      String, and results in 0. Is this intended?"
      pp = <<-EOS
      $c = {"c" => "-50"}
      $co = num2bool($c)
      notice(inline_template('c is <%= @co.inspect %>'))
      EOS
      expect(apply_manifest(ppc :expect_failures => true).stderr).to match(/Unable to parse/)
    end
  end
end


text:
module Contract

  # Returns the value of the block
  # if all verifications pass
  def contract
    catch(:contract) do
      yield
    end
  end

  # Fails unless value is true
  def verify(value)
    value || throw(:contract, false)
  end

  module_function :contract
  module_function :verify
end


text:
const create = require('./create')

/**
 * Calculates the absolute value of the give vector
 *
 * @param {vec2} [out] - receiving vector
 * @param {vec2} vec - given value
 * @returns {vec2} absolute value of the vector
 */
const abs = (...params) => {
  let out
  let vec
  if (params.length === 1) {
    out = create()
    vec = params[0]
  } else {
    out = params[0]
    vec = params[1]
  }
  out[0] = Math.abs(vec[0])
  out[1] = Math.abs(vec[1])
  return out
}

module.exports = abs


text:
using System;
using Microsoft.Extensions.DependencyInjection;
using RawRabbit.Logging;

namespace RawRabbit.vNext.Logging
{
	public class LoggingFactory : ILoggerFactory
	{
		private readonly Microsoft.Extensions.Logging.ILoggerFactory _vNextFactory;

		public static ILoggerFactory ApplicationLogger(IServiceProvider provider)
		{
			return new LoggingFactory(provider.GetService<Microsoft.Extensions.Logging.ILoggerFactory>());
		}

		public LoggingFactory(Microsoft.Extensions.Logging.ILoggerFactory vNextFactory)
		{
			_vNextFactory = vNextFactory;
		}

		public void Dispose()
		{
			_vNextFactory.Dispose();
		}

		public ILogger CreateLogger(string categoryName)
		{
			var vNextLogger =  _vNextFactory.CreateLogger(categoryName);
			return new LoggerAdapter(vNextLogger);
		}
	}
}


text:
package com.github.dreamhead.moco.websocket;

import com.github.dreamhead.moco.MutableResponse;

public interface MutableWebsocketResponse extends WebsocketResponse, MutableResponse  {
}


text:
package org.eclipse.flux.client.java;

import junit.framework.TestCase;

import org.eclipse.flux.client.FluxClient;
import org.eclipse.flux.client.MessageConnector;
import org.eclipse.flux.client.MessageConstants;
import org.eclipse.flux.client.config.UserPermissions;
import org.eclipse.flux.client.config.FluxConfig;
import org.eclipse.flux.client.config.SocketIOFluxConfig;
import org.eclipse.flux.client.impl.SimpleUserPermissions;

public class SimpleUserPermissionsTest extends TestCase {

	FluxConfig conf(final String user) {
		//Mock Flux config
		return new FluxConfig() {
			@Override
			public SocketIOFluxConfig toSocketIO() {
				return null;
			}

			@Override
			public String getUser() {
				return user;
			}

			@Override
			public MessageConnector connect(FluxClient fluxClient) throws Exception {
				throw new Error("Not impelemented");
			}

			@Override
			public UserPermissions permissions() {
				return new SimpleUserPermissions(this);
			}
		};
	}

	public void testSuperCanJoinSuper() throws Exception {
		String user = MessageConstants.SUPER_USER;
		String channel = MessageConstants.SUPER_USER;
		join(user, channel);
	}

	public void testUserCanJoinSelf() throws Exception {
		String user = "testUser";
		String channel = "testUser";
		join(user, channel);
	}

	public void testUserCanNotJoinSuper() throws Exception {
		String user = "testUser";
		String channel = MessageConstants.SUPER_USER;
		joinShouldFail(user, channel);
	}

	public void testUserCannotJoinOtherUser() throws Exception {
		joinShouldFail("bob", "john");
	}

	private void joinShouldFail(String user, String channel) {
		try {
			join(user, channel);
			fail("Should have rejected '"+user+"' to join '"+channel);
		} catch (Exception e) {
			assertEquals("'"+user+"' is not allowed to join channel '"+channel+"'", e.getMessage());
		}
	}

	private void join(String user, String channel) throws Exception {
		FluxConfig conf = conf(user);
		UserPermissions auth = conf.permissions();
		auth.checkChannelJoin(channel);
	}

}


text:
export SCRIPT_NAME="Build"
export SCRIPT_HELP="Compile with Google's Closure Compiler."
[[ "$GOGO_GOSH_SOURCE" -eq 1 ]] && return 0

# Normal script execution starts here.
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/../
source "$DIR"/env.sh || exit 1
use-gosh-contrib-or-die

assert-env-or-die BUILD
assert-env-or-die SRC
assert-env-or-die MIN_JS

mkdir -p "$BUILD" || exit 1
cd "$BUILD" || exit 1

echo -n "Getting the Closure Compiler if necessary... "
wget -qN "http://dl.google.com/closure-compiler/compiler-latest.zip"
echo "okay"

if [ "compiler-latest.zip" -nt "compiler.jar" ]; then
    echo -n "Extracting latest JAR... "
    unzip -qo "compiler-latest.zip"
    echo "okay"
    touch "compiler.jar"
fi

# --language_in: set what language spec we conform to
# --js_output_file: output filename
# --js: BELHop source JavaScript
CLOSURE_COMPILER_ARGS="--language_in ECMASCRIPT5_STRICT \
                       --js_output_file $MIN_JS \
                       --js $SRC/belhop.js"

echo -n "Executing the compiler... "
CC_OUTPUT=$(mktemp)
# shellcheck disable=SC2086
java -jar compiler.jar $CLOSURE_COMPILER_ARGS >"$CC_OUTPUT" 2>&1
if [ $? -eq 0 ]; then
    status=0
    echo "done"
else
    echo "FAILED"
    cat "$CC_OUTPUT"
    status=1
fi
rm "$CC_OUTPUT" || exit 1
exit $status


text:
const { combineReducers } = Redux;
const { Component } = React;
const { Provider } = ReactRedux;
const { createStore } = Redux;
const { connect } = ReactRedux;

const todo = (state, action) => {
  switch (action.type) {
    case 'ADD_TODO':
      return {
        id:action.id,
        text:action.text,
        completed:false
      };
    case 'TOGGLE_TODO':
      if(state.id !== action.id) {
          return state;
        }
        return {
          ...state,
          completed: !state.completed
        }
    default:
      return state;
  }
}

const todos = (state = [], action) => {
  switch(action.type){
    case 'ADD_TODO':
      return [
        ...state,
        todo(undefined, action)
      ];
    case 'TOGGLE_TODO':
      return state.map(t => todo(t, action));
    default:
      return state;

  }
};

const visibilityFilter = (
  state = 'SHOW_ALL',
  action
) => {
  switch (action.type) {
    case 'SET_VISIBILITY_FILTER':
      return action.filter;
    default:
      return state;
  }
};

const todoApp = combineReducers({
  todos,
  visibilityFilter
});

const Link = ({
  active,
  children,
  onClick
}) => {

  if(active){
    return {children};
  }

 return  {
                               e.preventDefault();
                               onClick();
                            }} >{children}
}

const mapStateToLinkProps = ( state, ownProps ) => {
  return {
    active: ownProps.filter === state.visibilityFilter
  };
};

const mapDispatchToLinkProps = ( dispatch, ownProps ) => {
  return {
    onClick: () => {
      dispatch({
        type: 'SET_VISIBILITY_FILTER',
        filter: ownProps.filter
      });
    }
  };
};

const FilterLink = connect(
  mapStateToLinkProps,
  mapDispatchToLinkProps
)(Link);

const Todo = ({
  onClick,
  completed,
  text
}) => (

    {text}

);

const TodoList = ({
  todos,
  onTodoClick
}) => (

    {todos.map(todo =>
       <Todo
         key={todo.id}
         {...todo}
         onClick={() => onTodoClick(todo.id)}
       />
     )}

);

const mapStateToTodoListProps = (state) => {
  return {
    todos: getVisibleTodos(
      state.todos,
      state.visibilityFilter )
  };
};

const mapDispatchToTodoListProps = (dispatch) => {
  return  {
    onTodoClick: (id) => {
      dispatch({ type: 'TOGGLE_TODO', id })
    }
  };
}

const VisibleTodoList = connect(
  mapStateToTodoListProps,
  mapDispatchToTodoListProps
)(TodoList);

let nextTodoId = 0;
let AddTodo = ({dispatch}) => {
  let input;
  return (

      <input ref={node => {
          input = node
        }} />
      <button onClick={() => {
                  dispatch({
                    type: 'ADD_TODO',
                    id: nextTodoId++,
                    text: input.value
                  })
                  input.value = '';
                }} >Add Todo</button>

  );
};
AddTodo = connect()(AddTodo);

const Footer = ({store}) => (

    Show:
          {' '}
          <FilterLink filter='SHOW_ALL' >
            All
          </FilterLink>
          {','}
          <FilterLink filter='SHOW_ACTIVE'>
            Active
          </FilterLink>
          {','}
          <FilterLink filter='SHOW_COMPLETED'>
            Completed
          </FilterLink>

);

const getVisibleTodos = ( todos, filter) =>{
  switch(filter){
    case 'SHOW_ALL':
      return todos;
    case 'SHOW_ACTIVE':
      return todos.filter( t => !t.completed );
    case 'SHOW_COMPLETED':
      return todos.filter( t => t.completed);
  }
}

const TodoApp = () => (

    <AddTodo />
    <VisibleTodoList />

);

ReactDOM.render(
  <Provider store={createStore(todoApp)}>
    <TodoApp/>
  </Provider>,
  document.querySelector("#root")

);


text:
class Theme
  cattr_accessor :cache_theme_lookup
  @@cache_theme_lookup = false

  attr_accessor :name, :title, :description, :preview_image

  def initialize(name)
    @name = name
    @title = name.underscore.humanize.titleize
    @description_html = nil
  end

  def description
    if @description_html.nil?
      @description_html = RedCloth.new(File.read( File.join(Theme.path_to_theme(name), "about.markdown") )).to_html(:markdown, :textile) rescue "#{title}"
    end
    @description_html
  end

  def has_preview?
    File.exists?( File.join( Theme.path_to_theme(name), 'images', 'preview.png' ) ) rescue false
  end

  def preview_image
    'preview.png'
  end

  def self.find_all
    installed_themes.inject([]) do |array, path|
      array << theme_from_path(path)
    end
  end

  def self.add_theme_ruby_paths
    self.find_all.each do |theme|
      #theme specific models
      path = File.join(path_to_theme(theme.name),'models')
      $: << path  if File.directory?(path)
      #theme specific helpers.. must be unique per theme
      path = File.join(path_to_theme(theme.name),'helpers')
      $: << path if File.directory?(path)
    end
  end

private

  def self.themes_root
    File.join(RAILS_ROOT, "themes")
  end

  def self.path_to_theme(theme)
    File.join(themes_root, theme)
  end

  def self.theme_from_path(path)
    name = path.scan(/[-\w]+$/i).flatten.first
    self.new(name)
  end

  def self.installed_themes
    cache_theme_lookup ? @theme_cache ||= search_theme_directory : search_theme_directory
  end

  def self.search_theme_directory
    Dir.glob("#{themes_root}/[-_a-zA-Z0-9]*").collect do |file|
      file if File.directory?(file)
    end.compact
  end
end


text:
package org.springframework.data.elasticsearch.core;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author Artur Konczak
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:elasticsearch-template-custom-mapper.xml")
public class ElasticsearchTemplateCustomMapperTests {

	@Autowired
	private ElasticsearchTemplate elasticsearchTemplate;

	@Autowired
	private EntityMapper entityMapper;

	@Autowired
	private ResultsMapper resultsMapper;

	@Test
	public void shouldUseCustomMapper() {
		//given
		//when
		//them
		assertThat(elasticsearchTemplate.getResultsMapper(), is(resultsMapper));
		assertThat(elasticsearchTemplate.getResultsMapper().getEntityMapper(), is(entityMapper));
	}
}


text:
package com.netflix.spectator.atlas.impl;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashSet;
import java.util.List;

/**
 * Parses an Atlas data or query expression.
 *
 * Classes in this package are only intended for use internally within spectator. They may
 * change at any time and without notice.
 */
public final class Parser {

  private Parser() {
  }

  /**
   * Parse an Atlas data
   * expression.
   */
  public static DataExpr parseDataExpr(String expr) {
    try {
      return (DataExpr) parse(expr);
    } catch (ClassCastException e) {
      throw new IllegalArgumentException("invalid data expression: " + expr, e);
    }
  }

  /**
   * Parse an Atlas query
   * expression.
   */
  public static Query parseQuery(String expr) {
    try {
      return (Query) parse(expr);
    } catch (ClassCastException e) {
      throw new IllegalArgumentException("invalid query expression: " + expr, e);
    }
  }

  @SuppressWarnings({"unchecked", "PMD"})
  private static Object parse(String expr) {
    DataExpr.AggregateFunction af;
    Query q, q1, q2;
    String k, v;
    int depth = 0;
    List<String> tmp;
    List<String> vs = null;
    String[] parts = expr.split(",");
    Deque<Object> stack = new ArrayDeque<>(parts.length);
    for (String p : parts) {
      String token = p.trim();
      if (token.isEmpty()) {
        continue;
      }
      if (vs != null && (depth > 0 || !")".equals(token))) {
        if ("(".equals(token)) {
          ++depth;
        } else if (")".equals(token)) {
          --depth;
        }
        vs.add(token);
        continue;
      }
      switch (token) {
        case "(":
          vs = new ArrayList<>();
          break;
        case ")":
          if (vs == null) {
            throw new IllegalArgumentException("unmatched closing paren: " + expr);
          }
          stack.push(vs);
          vs = null;
          depth = 0;
          break;
        case ":true":
          stack.push(Query.TRUE);
          break;
        case ":false":
          stack.push(Query.FALSE);
          break;
        case ":and":
          q2 = (Query) stack.pop();
          q1 = (Query) stack.pop();
          stack.push(q1.and(q2));
          break;
        case ":or":
          q2 = (Query) stack.pop();
          q1 = (Query) stack.pop();
          stack.push(q1.or(q2));
          break;
        case ":not":
          q = (Query) stack.pop();
          stack.push(q.not());
          break;
        case ":has":
          k = (String) stack.pop();
          stack.push(new Query.Has(k));
          break;
        case ":eq":
          v = (String) stack.pop();
          k = (String) stack.pop();
          stack.push(new Query.Equal(k, v));
          break;
        case ":in":
          tmp = (List<String>) stack.pop();
          k = (String) stack.pop();
          stack.push(new Query.In(k, new HashSet<>(tmp)));
          break;
        case ":lt":
          v = (String) stack.pop();
          k = (String) stack.pop();
          stack.push(new Query.LessThan(k, v));
          break;
        case ":le":
          v = (String) stack.pop();
          k = (String) stack.pop();
          stack.push(new Query.LessThanEqual(k, v));
          break;
        case ":gt":
          v = (String) stack.pop();
          k = (String) stack.pop();
          stack.push(new Query.GreaterThan(k, v));
          break;
        case ":ge":
          v = (String) stack.pop();
          k = (String) stack.pop();
          stack.push(new Query.GreaterThanEqual(k, v));
          break;
        case ":re":
          v = (String) stack.pop();
          k = (String) stack.pop();
          pushRegex(stack, new Query.Regex(k, v));
          break;
        case ":reic":
          v = (String) stack.pop();
          k = (String) stack.pop();
          pushRegex(stack, new Query.Regex(k, v, true, ":reic"));
          break;
        case ":all":
          q = (Query) stack.pop();
          stack.push(new DataExpr.All(q));
          break;
        case ":sum":
          q = (Query) stack.pop();
          stack.push(new DataExpr.Sum(q));
          break;
        case ":min":
          q = (Query) stack.pop();
          stack.push(new DataExpr.Min(q));
          break;
        case ":max":
          q = (Query) stack.pop();
          stack.push(new DataExpr.Max(q));
          break;
        case ":count":
          q = (Query) stack.pop();
          stack.push(new DataExpr.Count(q));
          break;
        case ":by":
          tmp = (List<String>) stack.pop();
          af = (DataExpr.AggregateFunction) stack.pop();
          stack.push(new DataExpr.GroupBy(af, tmp));
          break;
        case ":rollup-drop":
          tmp = (List<String>) stack.pop();
          af = (DataExpr.AggregateFunction) stack.pop();
          stack.push(new DataExpr.DropRollup(af, tmp));
          break;
        case ":rollup-keep":
          tmp = (List<String>) stack.pop();
          af = (DataExpr.AggregateFunction) stack.pop();
          stack.push(new DataExpr.KeepRollup(af, tmp));
          break;
        default:
          if (token.startsWith(":")) {
            throw new IllegalArgumentException("unknown word '" + token + "'");
          }
          stack.push(token);
          break;
      }
    }
    Object obj = stack.pop();
    if (!stack.isEmpty()) {
      throw new IllegalArgumentException("too many items remaining on stack: " + stack);
    }
    return obj;
  }

  private static void pushRegex(Deque<Object> stack, Query.Regex q) {
    if (q.alwaysMatches()) {
      stack.push(new Query.Has(q.key()));
    } else {
      stack.push(q);
    }
  }
}


text:
.class public final Lcom/google/android/gms/internal/zzki;
.super Lcom/google/android/gms/common/internal/zzj;

# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/google/android/gms/common/internal/zzj",
        "<",
        "Lcom/google/android/gms/internal/zzkk;",
        ">;"
    }
.end annotation

# instance fields
.field private final zzSa:Landroid/os/Bundle;

# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/os/Looper;Lcom/google/android/gms/common/internal/zzf;Lcom/google/android/gms/auth/api/Auth$zza;Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;)V
    .registers 14

    const/16 v3, 0x10

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v4, p3

    move-object v5, p5

    move-object v6, p6

    invoke-direct/range {v0 .. v6}, Lcom/google/android/gms/common/internal/zzj;-><init>(Landroid/content/Context;Landroid/os/Looper;ILcom/google/android/gms/common/internal/zzf;Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;)V

    if-nez p4, :cond_15

    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    :goto_12
    iput-object v0, p0, Lcom/google/android/gms/internal/zzki;->zzSa:Landroid/os/Bundle;

    return-void

    :cond_15
    invoke-virtual {p4}, Lcom/google/android/gms/auth/api/Auth$zza;->zzlE()Landroid/os/Bundle;

    move-result-object v0

    goto :goto_12
.end method

# virtual methods
.method protected synthetic zzW(Landroid/os/IBinder;)Landroid/os/IInterface;
    .registers 3

    invoke-virtual {p0, p1}, Lcom/google/android/gms/internal/zzki;->zzau(Landroid/os/IBinder;)Lcom/google/android/gms/internal/zzkk;

    move-result-object v0

    return-object v0
.end method

.method protected zzau(Landroid/os/IBinder;)Lcom/google/android/gms/internal/zzkk;
    .registers 3

    invoke-static {p1}, Lcom/google/android/gms/internal/zzkk$zza;->zzaw(Landroid/os/IBinder;)Lcom/google/android/gms/internal/zzkk;

    move-result-object v0

    return-object v0
.end method

.method protected zzfK()Ljava/lang/String;
    .registers 2

    const-string v0, "com.google.android.gms.auth.service.START"

    return-object v0
.end method

.method protected zzfL()Ljava/lang/String;
    .registers 2

    const-string v0, "com.google.android.gms.auth.api.internal.IAuthService"

    return-object v0
.end method

.method public zzlN()Z
    .registers 3

    invoke-virtual {p0}, Lcom/google/android/gms/internal/zzki;->zzpa()Lcom/google/android/gms/common/internal/zzf;

    move-result-object v0

    invoke-virtual {v0}, Lcom/google/android/gms/common/internal/zzf;->getAccountName()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_1c

    sget-object v1, Lcom/google/android/gms/auth/api/Auth;->PROXY_API:Lcom/google/android/gms/common/api/Api;

    invoke-virtual {v0, v1}, Lcom/google/android/gms/common/internal/zzf;->zzb(Lcom/google/android/gms/common/api/Api;)Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_1c

    const/4 v0, 0x1

    :goto_1b
    return v0

    :cond_1c
    const/4 v0, 0x0

    goto :goto_1b
.end method

.method protected zzly()Landroid/os/Bundle;
    .registers 2

    iget-object v0, p0, Lcom/google/android/gms/internal/zzki;->zzSa:Landroid/os/Bundle;

    return-object v0
.end method


text:
~https~ ://127.0.0.1   -> https://127.0.0.1-l.ocal.host

## l.ocal.domains

* l.ocal.audio
* l.ocal.build
* l.ocal.bz
* l.ocal.camera
* l.ocal.chat
* l.ocal.cloud
* l.ocal.computer
* l.ocal.directory
* l.ocal.email
* l.ocal.in
* l.ocal.link
* l.ocal.me
* l.ocal.media
* l.ocal.network
* l.ocal.ninja
* l.ocal.photo
* l.ocal.rest
* l.ocal.run
* l.ocal.sh
* l.ocal.site
* l.ocal.software
* l.ocal.us
* l.ocal.video
* l.ocal. website
* l.ocal.zone

## hyphinated tld suffuxes for all major tlds
https://www.mywebsite.com-l.ocal.site

## certificate
Certificates are cdn cached for 1 week

https://certify-l.ocal.domains/fullchain.pem
https://certify-l.ocal.domains/chain.pem

New certificates are issued from letsencrypt weekly

## chrome extenion

type `localhost` get `l.ocal.host`

You can use the [editor on GitHub](https://github.com/bpmccurdy/test-domain-site/edit/master/README.md) to maintain and preview the content for your website in Markdown files.

Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.

### Markdown

Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for

```markdown
Syntax highlighted code block

# Header 1
## Header 2
### Header 3

- Bulleted
- List

1. Numbered
2. List

**Bold** and _Italic_ and `Code` text

[Link](url) and ![Image](src)
```

For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).

### Jekyll Themes

Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/bpmccurdy/test-domain-site/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file.

### Support or Contact

Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we'll help you sort it out.


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34003
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace ApiExplorer.Properties {

    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

        public static Settings Default {
            get {
                return defaultInstance;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("False")]
        public bool PreferMinimalResponseSize {
            get {
                return ((bool)(this["PreferMinimalResponseSize"]));
            }
            set {
                this["PreferMinimalResponseSize"] = value;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("")]
        public string LastAccessedUrl {
            get {
                return ((string)(this["LastAccessedUrl"]));
            }
            set {
                this["LastAccessedUrl"] = value;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("True")]
        public bool UseMethodOverride {
            get {
                return ((bool)(this["UseMethodOverride"]));
            }
            set {
                this["UseMethodOverride"] = value;
            }
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta property="og:image" content="http://lipis.github.io/bootstrap-social/assets/img/bootstrap-social.png">
    <meta property="og:url" content="http://lipis.github.io/bootstrap-social/">
    <title>Pack's got your back</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/bootstrap-social.css" rel="stylesheet">

    <link href="css/grayscale.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">

                    Sign in with Facebook

                    Sign in with Twitter


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Medusula zamiae Corda

### Remarks
null


text:
<?php

namespace app\models;

use yii\db\ActiveRecord;

class Profile extends ActiveRecord
{
    public static function tableName()
    {
        return "{{%profile}}";
    }
}


text:
<!doctype html>

  <meta charset="utf-8">
  <link rel="canonical" href="./regular-html-version.html">
  <meta name="viewport" content="width=device-width,minimum-scale=1">

  <form method="get" action="https://httpbin.org/html" target="_blank">
    <fieldset>
      <input name="clientId" type="hidden" value="CLIENT_ID(poll)" data-amp-replace="CLIENT_ID">
      <input name="canonicalUrl" type="hidden" value="RANDOM and CANONICAL_URL" data-amp-replace="CANONICAL_URL RANDOM">

        Search for
        <input type="search" name="term" required>

      <input name="submit-button" type="submit" value="Search">
      <amp-recaptcha-input layout="nodisplay" name="recaptcha_example" data-sitekey="6LebBGoUAAAAAHbj1oeZMBU_rze_CutlbyzpH8VE" data-action="recaptcha_example">
      </amp-recaptcha-input>
    </fieldset>

  </form>

    <amp-recaptcha-input layout="nodisplay" name="recaptcha_example" data-sitekey="6LebBGoUAAAAAHbj1oeZMBU_rze_CutlbyzpH8VE" data-action="recaptcha_example">
    </amp-recaptcha-input>

  <form method="get" action="https://httpbin.org/html" target="_blank">
    <fieldset>
      <input name="clientId" type="hidden" value="CLIENT_ID(poll)" data-amp-replace="CLIENT_ID">
      <input name="canonicalUrl" type="hidden" value="RANDOM and CANONICAL_URL" data-amp-replace="CANONICAL_URL RANDOM">

        Search for
        <input type="search" name="term" required>

      <input name="submit-button" type="submit" value="Search">
      <amp-recaptcha-input layout="nodisplay" data-sitekey="6LebBGoUAAAAAHbj1oeZMBU_rze_CutlbyzpH8VE" data-action="recaptcha_example">
      </amp-recaptcha-input>
    </fieldset>

  </form>

  <form method="get" action="https://httpbin.org/html" target="_blank">
    <fieldset>
      <input name="clientId" type="hidden" value="CLIENT_ID(poll)" data-amp-replace="CLIENT_ID">
      <input name="canonicalUrl" type="hidden" value="RANDOM and CANONICAL_URL" data-amp-replace="CANONICAL_URL RANDOM">

        Search for
        <input type="search" name="term" required>

      <input name="submit-button" type="submit" value="Search">
      <amp-recaptcha-input layout="nodisplay" name="recaptcha_example" data-action="recaptcha_example">
      </amp-recaptcha-input>
    </fieldset>

  </form>

  <form method="get" action="https://httpbin.org/html" target="_blank">
    <fieldset>
      <input name="clientId" type="hidden" value="CLIENT_ID(poll)" data-amp-replace="CLIENT_ID">
      <input name="canonicalUrl" type="hidden" value="RANDOM and CANONICAL_URL" data-amp-replace="CANONICAL_URL RANDOM">

        Search for
        <input type="search" name="term" required>

      <input name="submit-button" type="submit" value="Search">
      <amp-recaptcha-input layout="nodisplay" name="recaptcha_example" data-sitekey="6LebBGoUAAAAAHbj1oeZMBU_rze_CutlbyzpH8VE">
      </amp-recaptcha-input>
    </fieldset>

  </form>

  <form method="get" action="https://httpbin.org/html" target="_blank">
    <fieldset>
      <input name="clientId" type="hidden" value="CLIENT_ID(poll)" data-amp-replace="CLIENT_ID">
      <input name="canonicalUrl" type="hidden" value="RANDOM and CANONICAL_URL" data-amp-replace="CANONICAL_URL RANDOM">

        Search for
        <input type="search" name="term" required>

      <input name="submit-button" type="submit" value="Search">
      <amp-recaptcha-input name="recaptcha_example" data-sitekey="6LebBGoUAAAAAHbj1oeZMBU_rze_CutlbyzpH8VE" data-action="recaptcha_example">
      </amp-recaptcha-input>
    </fieldset>

  </form>

  <form method="get" action="https://httpbin.org/html" target="_blank">
    <fieldset>
      <input name="clientId" type="hidden" value="CLIENT_ID(poll)" data-amp-replace="CLIENT_ID">
      <input name="canonicalUrl" type="hidden" value="RANDOM and CANONICAL_URL" data-amp-replace="CANONICAL_URL RANDOM">

        Search for
        <input type="search" name="term" required>

      <input name="submit-button" type="submit" value="Search">
      <amp-recaptcha-input layout="responsive" name="recaptcha_example" data-sitekey="6LebBGoUAAAAAHbj1oeZMBU_rze_CutlbyzpH8VE" data-action="recaptcha_example">
      </amp-recaptcha-input>
    </fieldset>

  </form>