text:
package user

import (
	"fmt"
	"strings"

	"code.gitea.io/gitea/models/db"
	"code.gitea.io/gitea/modules/structs"
	"code.gitea.io/gitea/modules/util"

	"xorm.io/builder"
	"xorm.io/xorm"
)

// SearchUserOptions contains the options for searching
type SearchUserOptions struct {
	db.ListOptions

	Keyword       string
	Type          UserType
	UID           int64
	OrderBy       db.SearchOrderBy
	Visible       []structs.VisibleType
	Actor         *User // The user doing the search
	SearchByEmail bool  // Search by email as well as username/full name

	IsActive           util.OptionalBool
	IsAdmin            util.OptionalBool
	IsRestricted       util.OptionalBool
	IsTwoFactorEnabled util.OptionalBool
	IsProhibitLogin    util.OptionalBool

	ExtraParamStrings map[string]string
}

func (opts *SearchUserOptions) toSearchQueryBase() *xorm.Session {
	var cond builder.Cond = builder.Eq{"type": opts.Type}
	if len(opts.Keyword) > 0 {
		lowerKeyword := strings.ToLower(opts.Keyword)
		keywordCond := builder.Or(
			builder.Like{"lower_name", lowerKeyword},
			builder.Like{"LOWER(full_name)", lowerKeyword},
		)
		if opts.SearchByEmail {
			keywordCond = keywordCond.Or(builder.Like{"LOWER(email)", lowerKeyword})
		}

		cond = cond.And(keywordCond)
	}

	// If visibility filtered
	if len(opts.Visible) > 0 {
		cond = cond.And(builder.In("visibility", opts.Visible))
	}

	cond = cond.And(BuildCanSeeUserCondition(opts.Actor))

	if opts.UID > 0 {
		cond = cond.And(builder.Eq{"id": opts.UID})
	}

	if !opts.IsActive.IsNone() {
		cond = cond.And(builder.Eq{"is_active": opts.IsActive.IsTrue()})
	}

	if !opts.IsAdmin.IsNone() {
		cond = cond.And(builder.Eq{"is_admin": opts.IsAdmin.IsTrue()})
	}

	if !opts.IsRestricted.IsNone() {
		cond = cond.And(builder.Eq{"is_restricted": opts.IsRestricted.IsTrue()})
	}

	if !opts.IsProhibitLogin.IsNone() {
		cond = cond.And(builder.Eq{"prohibit_login": opts.IsProhibitLogin.IsTrue()})
	}

	e := db.GetEngine(db.DefaultContext)
	if opts.IsTwoFactorEnabled.IsNone() {
		return e.Where(cond)
	}

	// 2fa filter uses LEFT JOIN to check whether a user has a 2fa record
	// While using LEFT JOIN, sometimes the performance might not be good, but it won't be a problem now, such SQL is seldom executed.
	// There are some possible methods to refactor this SQL in future when we really need to optimize the performance (but not now):
	// (1) add a column in user table (2) add a setting value in user_setting table (3) use search engines (bleve/elasticsearch)
	if opts.IsTwoFactorEnabled.IsTrue() {
		cond = cond.And(builder.Expr("two_factor.uid IS NOT NULL"))
	} else {
		cond = cond.And(builder.Expr("two_factor.uid IS NULL"))
	}

	return e.Join("LEFT OUTER", "two_factor", "two_factor.uid = `user`.id").
		Where(cond)
}

// SearchUsers takes options i.e. keyword and part of user name to search,
// it returns results in given range and number of total results.
func SearchUsers(opts *SearchUserOptions) (users []*User, _ int64, _ error) {
	sessCount := opts.toSearchQueryBase()
	defer sessCount.Close()
	count, err := sessCount.Count(new(User))
	if err != nil {
		return nil, 0, fmt.Errorf("Count: %w", err)
	}

	if len(opts.OrderBy) == 0 {
		opts.OrderBy = db.SearchOrderByAlphabetically
	}

	sessQuery := opts.toSearchQueryBase().OrderBy(opts.OrderBy.String())
	defer sessQuery.Close()
	if opts.Page != 0 {
		sessQuery = db.SetSessionPagination(sessQuery, opts)
	}

	// the sql may contain JOIN, so we must only select User related columns
	sessQuery = sessQuery.Select("`user`.*")
	users = make([]*User, 0, opts.PageSize)
	return users, count, sessQuery.Find(&users)
}

// BuildCanSeeUserCondition creates a condition which can be used to restrict results to users/orgs the actor can see
func BuildCanSeeUserCondition(actor *User) builder.Cond {
	if actor != nil {
		// If Admin - they see all users!
		if !actor.IsAdmin {
			// Users can see an organization they are a member of
			cond := builder.In("`user`.id", builder.Select("org_id").From("org_user").Where(builder.Eq{"uid": actor.ID}))
			if !actor.IsRestricted {
				// Not-Restricted users can see public and limited users/organizations
				cond = cond.Or(builder.In("`user`.visibility", structs.VisibleTypePublic, structs.VisibleTypeLimited))
			}
			// Don't forget about self
			return cond.Or(builder.Eq{"`user`.id": actor.ID})
		}

		return nil
	}

	// Force visibility for privacy
	// Not logged in - only public users
	return builder.In("`user`.visibility", structs.VisibleTypePublic)
}


text:
{{ define "index" }}

{{ template "header" . }}

Token-based authentication for Go

Passwordless allows users to sign-in to your website without a password by sending them a secure one-time password to their chosen email or device instead. Shamelessly inspired by the original Passwordless for Node.

Try it!

{{ template "footer" . }}

{{ end }}

redpajama_set_name: RedPajamaGithub


text:
#pragma once
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/ec2/EC2Request.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ec2/model/Filter.h>
#include <utility>

namespace Aws
{
namespace EC2
{
namespace Model
{

  /**
   */
  class AWS_EC2_API DescribeHostReservationsRequest : public EC2Request
  {
  public:
    DescribeHostReservationsRequest();
    Aws::String SerializePayload() const override;

  protected:
    void DumpBodyToUrl(Aws::Http::URI& uri ) const override;

  public:
    /**
     *
One or more filters.

 instance-family - The
     * instance family (e.g., m4).

     * payment-option - The payment option (NoUpfront |
     * PartialUpfront | AllUpfront).

     * state - The state of the reservation (payment-pending
     * | payment-failed | active | retired).

     *

     */
    inline const Aws::Vector<Filter>& GetFilter() const{ return m_filter; }

    /**
     *
One or more filters.

 instance-family - The
     * instance family (e.g., m4).

     * payment-option - The payment option (NoUpfront |
     * PartialUpfront | AllUpfront).

     * state - The state of the reservation (payment-pending
     * | payment-failed | active | retired).

     *

     */
    inline void SetFilter(const Aws::Vector<Filter>& value) { m_filterHasBeenSet = true; m_filter = value; }

    /**
     *
One or more filters.

 instance-family - The
     * instance family (e.g., m4).

     * payment-option - The payment option (NoUpfront |
     * PartialUpfront | AllUpfront).

     * state - The state of the reservation (payment-pending
     * | payment-failed | active | retired).

     *

     */
    inline void SetFilter(Aws::Vector<Filter>&& value) { m_filterHasBeenSet = true; m_filter = std::move(value); }

    /**
     *
One or more filters.

 instance-family - The
     * instance family (e.g., m4).

     * payment-option - The payment option (NoUpfront |
     * PartialUpfront | AllUpfront).

     * state - The state of the reservation (payment-pending
     * | payment-failed | active | retired).

     *

     */
    inline DescribeHostReservationsRequest& WithFilter(const Aws::Vector<Filter>& value) { SetFilter(value); return *this;}

    /**
     *
One or more filters.

 instance-family - The
     * instance family (e.g., m4).

     * payment-option - The payment option (NoUpfront |
     * PartialUpfront | AllUpfront).

     * state - The state of the reservation (payment-pending
     * | payment-failed | active | retired).

     *

     */
    inline DescribeHostReservationsRequest& WithFilter(Aws::Vector<Filter>&& value) { SetFilter(std::move(value)); return *this;}

    /**
     *
One or more filters.

 instance-family - The
     * instance family (e.g., m4).

     * payment-option - The payment option (NoUpfront |
     * PartialUpfront | AllUpfront).

     * state - The state of the reservation (payment-pending
     * | payment-failed | active | retired).

     *

     */
    inline DescribeHostReservationsRequest& AddFilter(const Filter& value) { m_filterHasBeenSet = true; m_filter.push_back(value); return *this; }

    /**
     *
One or more filters.

 instance-family - The
     * instance family (e.g., m4).

     * payment-option - The payment option (NoUpfront |
     * PartialUpfront | AllUpfront).

     * state - The state of the reservation (payment-pending
     * | payment-failed | active | retired).

     *

     */
    inline DescribeHostReservationsRequest& AddFilter(Filter&& value) { m_filterHasBeenSet = true; m_filter.push_back(std::move(value)); return *this; }

    /**
     *
One or more host reservation IDs.

     */
    inline const Aws::Vector<Aws::String>& GetHostReservationIdSet() const{ return m_hostReservationIdSet; }

    /**
     *
One or more host reservation IDs.

     */
    inline void SetHostReservationIdSet(const Aws::Vector<Aws::String>& value) { m_hostReservationIdSetHasBeenSet = true; m_hostReservationIdSet = value; }

    /**
     *
One or more host reservation IDs.

     */
    inline void SetHostReservationIdSet(Aws::Vector<Aws::String>&& value) { m_hostReservationIdSetHasBeenSet = true; m_hostReservationIdSet = std::move(value); }

    /**
     *
One or more host reservation IDs.

     */
    inline DescribeHostReservationsRequest& WithHostReservationIdSet(const Aws::Vector<Aws::String>& value) { SetHostReservationIdSet(value); return *this;}

    /**
     *
One or more host reservation IDs.

     */
    inline DescribeHostReservationsRequest& WithHostReservationIdSet(Aws::Vector<Aws::String>&& value) { SetHostReservationIdSet(std::move(value)); return *this;}

    /**
     *
One or more host reservation IDs.

     */
    inline DescribeHostReservationsRequest& AddHostReservationIdSet(const Aws::String& value) { m_hostReservationIdSetHasBeenSet = true; m_hostReservationIdSet.push_back(value); return *this; }

    /**
     *
One or more host reservation IDs.

     */
    inline DescribeHostReservationsRequest& AddHostReservationIdSet(Aws::String&& value) { m_hostReservationIdSetHasBeenSet = true; m_hostReservationIdSet.push_back(std::move(value)); return *this; }

    /**
     *
One or more host reservation IDs.

     */
    inline DescribeHostReservationsRequest& AddHostReservationIdSet(const char* value) { m_hostReservationIdSetHasBeenSet = true; m_hostReservationIdSet.push_back(value); return *this; }

    /**
     *
The maximum number of results to return for the request in a single page. The
     * remaining results can be seen by sending another request with the returned
     * nextToken value. This value can be between 5 and 500; if
     * maxResults is given a larger value than 500, you will receive an
     * error.

     */
    inline int GetMaxResults() const{ return m_maxResults; }

    /**
     *
The maximum number of results to return for the request in a single page. The
     * remaining results can be seen by sending another request with the returned
     * nextToken value. This value can be between 5 and 500; if
     * maxResults is given a larger value than 500, you will receive an
     * error.

     */
    inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }

    /**
     *
The maximum number of results to return for the request in a single page. The
     * remaining results can be seen by sending another request with the returned
     * nextToken value. This value can be between 5 and 500; if
     * maxResults is given a larger value than 500, you will receive an
     * error.

     */
    inline DescribeHostReservationsRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}

    /**
     *
The token to use to retrieve the next page of results.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
The token to use to retrieve the next page of results.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }

    /**
     *
The token to use to retrieve the next page of results.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }

    /**
     *
The token to use to retrieve the next page of results.

     */
    inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }

    /**
     *
The token to use to retrieve the next page of results.

     */
    inline DescribeHostReservationsRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
The token to use to retrieve the next page of results.

     */
    inline DescribeHostReservationsRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
The token to use to retrieve the next page of results.

     */
    inline DescribeHostReservationsRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:
    Aws::Vector<Filter> m_filter;
    bool m_filterHasBeenSet;
    Aws::Vector<Aws::String> m_hostReservationIdSet;
    bool m_hostReservationIdSetHasBeenSet;
    int m_maxResults;
    bool m_maxResultsHasBeenSet;
    Aws::String m_nextToken;
    bool m_nextTokenHasBeenSet;
  };

} // namespace Model
} // namespace EC2
} // namespace Aws


text:
package boondoggle

import (
	"bytes"
	"testing"
)

func TestExtractTitle(t *testing.T) {
	// Create mock articles
	var article Article

	// Nothing should do nothing
	article = Article{Raw: []byte(``)}
	if err := ExtractTitle(&article); err != nil {
		t.Fatalf("ExtractTitle should not error: %s", err)
	}
	if article.Title != "" {
		t.Errorf("Unexpected title: %s", article.Title)
	}

	// TODO table tests are funky looking with multiline strings
	// TODO ExtractTitle will add a newline - it shouldn't
	md1 := `#Title
More Text
`
	article = Article{Raw: []byte(md1)}
	if err := ExtractTitle(&article); err != nil {
		t.Fatalf("ExtractTitle should not error: %s", err)
	}
	if article.Title != "Title" {
		t.Errorf("Unexpected title: Title != %s", article.Title)
	}
	remainder := `More Text
`
	if !bytes.Equal(article.Raw, []byte(remainder)) {
		t.Errorf("Unexpected raw buffer: `More Text ` != %s", article.Raw)
	}

	md2 := `# Title of Article

Body text
`
	article = Article{Raw: []byte(md2)}
	if err := ExtractTitle(&article); err != nil {
		t.Fatalf("ExtractTitle should not error: %s", err)
	}
	if article.Title != "Title of Article" {
		t.Errorf("Unexpected title: Title of Article != %s", article.Title)
	}

	md3 := `❤
=====
 More
`
	article = Article{Raw: []byte(md3)}
	if err := ExtractTitle(&article); err != nil {
		t.Fatalf("ExtractTitle should not error: %s", err)
	}
	if article.Title != "❤" {
		t.Errorf("Unexpected title: ❤ != %s", article.Title)
	}
	remainder = ` More
` // TODO Fix newlines
	if !bytes.Equal(article.Raw, []byte(remainder)) {
		t.Errorf("Unexpected raw buffer: ` More` != %s", article.Raw)
	}

	md4 := `One line
`
	article = Article{Raw: []byte(md4)}
	if err := ExtractTitle(&article); err != nil {
		t.Fatalf("ExtractTitle should not error: %s", err)
	}
	if article.Title != "" {
		t.Errorf("Unexpected title: %s", article.Title)
	}

	md5 := `Just Text
Nothing more`
	article = Article{Raw: []byte(md5)}
	if err := ExtractTitle(&article); err != nil {
		t.Fatalf("ExtractTitle should not error: %s", err)
	}
	if article.Title != "" {
		t.Errorf("Unexpected title: %s", article.Title)
	}
	if !bytes.Equal(article.Raw, []byte(md5)) {
		t.Errorf("Unexpected raw buffer: %s != %s", md5, article.Raw)
	}
}


text:
#region Copyright

#endregion

#region

using Autodesk.DesignScript.Runtime;
using Dynamo.Models;
using System.Collections.Generic;
using Dynamo.Nodes;
using Wosad.Steel.AISC.AISC360v10.Connections.AffectedMembers.ConcentratedForces;
using System;
using dcf = Wosad.Steel.AISC.AISC360v10.Connections.AffectedMembers.ConcentratedForces;

#endregion

namespace Steel.AISC.Connection
{

/// <summary>
///     Concentrated force web panel zone shear
///     Category:   Steel.AISC.Connection
/// </summary>
///

    public partial class AffectedElements
    {
            /// <summary>
            ///    Calculates Concentrated force web panel zone shear
            /// </summary>
            /// <param name="t_w">  Thickness of web  </param>
            /// <param name="t_cf">  Thickness of column flange   </param>
            /// <param name="b_cf">  Width of column flange  </param>
            /// <param name="d_b">  Nominal fastener diameter </param>
            /// <param name="d_c">  Depth of column  </param>
            /// <param name="F_y">  Specified minimum yield stress </param>
            /// <param name="P_u">  Required axial strength </param>
            /// <param name="A_g">  Gross cross-sectional area of member </param>
            /// <param name="PanelDeformationConsideredInAnalysis">  Identifies whether the effect of panel-zone deformation on frame stability is  considered in the analysis </param>
            /// <param name="Code"> Applicable version of code/standard</param>
            /// <returns name="phiR_n"> Strength of member or connection </returns>

        [MultiReturn(new[] { "phiR_n" })]
        public static Dictionary<string, object> WebPanelZoneShear(double t_w,double t_cf,double b_cf,double d_b,double d_c,double F_y,double P_u,double A_g,
            bool PanelDeformationConsideredInAnalysis, string Code = "AISC360-10")
        {
            //Default values
            double phiR_n = 0;

            //Calculation logic:
            phiR_n = FlangeOrWebWithConcentratedForces.WebPanelZoneShear(t_w, t_cf, b_cf, d_b, d_c, F_y, P_u, A_g, PanelDeformationConsideredInAnalysis);

            return new Dictionary<string, object>
            {
                { "phiR_n", phiR_n }

            };
        }

    }
}


text:
Specific versions are requested by providing an Accept header. When
backwards-incompatible API changes are made, a new version will be released.
Backwards-compatible changes are released in the current version without the
need to change your Accept header.  See our
[reference guide](/api-documentation/docs/reference-guide#versioning)
for more on versioning.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

		<title>Object constructor</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="title" content="Samples" />
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<link rel="icon" href="../common/favicon.ico" type="image/x-icon" />
		<link rel="shortcut icon" href="../common/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="../common/css/style.css" type="text/css" media="screen" />

DHTMLX Docs & Samples Explorer

                <form action="http://docs.dhtmlx.com/doku.php" accept-charset="utf-8" id="dw__search">
<input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" title="Search" /><input class="button" type="submit" value="">

</form>

                All components

                dhtmlxTree

                Initialization, general settings

Object constructor

                View page source

            <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtree.css">

Source

<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtree.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxtree.js"></script>

            <div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"/>

<script>

tree = new dhtmlXTreeObject({
    skin: "dhx_skyblue",
    parent: "treeboxbox_tree",
    image_path: "../../codebase/imgs/csh_bluebooks/",
    checkbox: true,
    xml: "../common/tree3.xml";
});

</script>

Copyright © 1998-2012 DHTMLX LTD.
All rights reserved.


text:
<?php

namespace Google\Service\CloudIdentity;

class GoogleAppsCloudidentityDevicesV1WipeDeviceRequest extends \Google\Model
{
  /**
   * @var string
   */
  public $customer;
  /**
   * @var bool
   */
  public $removeResetLock;

  /**
   * @param string
   */
  public function setCustomer($customer)
  {
    $this->customer = $customer;
  }
  /**
   * @return string
   */
  public function getCustomer()
  {
    return $this->customer;
  }
  /**
   * @param bool
   */
  public function setRemoveResetLock($removeResetLock)
  {
    $this->removeResetLock = $removeResetLock;
  }
  /**
   * @return bool
   */
  public function getRemoveResetLock()
  {
    return $this->removeResetLock;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleAppsCloudidentityDevicesV1WipeDeviceRequest::class, 'Google_Service_CloudIdentity_GoogleAppsCloudidentityDevicesV1WipeDeviceRequest');


text:
package io.ripc.transport.netty4;

import io.netty.buffer.ByteBuf;
import io.ripc.core.io.Buffer;

import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.util.Iterator;
import java.util.List;

/**
 * Created by jbrisbin on 3/10/15.
 */
public class ByteBufBuffer implements Buffer<ByteBuf> {

	private final ByteBuf buf;
	private final boolean writable;

	public ByteBufBuffer(ByteBuf buf, boolean writable) {
		this.buf = buf;
		this.writable = writable;
	}

	@Override
	public int position() {
		return (writable ? buf.writerIndex() : buf.readerIndex());
	}

	@Override
	public Buffer<ByteBuf> position(int pos) {
		return null;
	}

	@Override
	public int limit() {
		return (writable ? buf.writableBytes() : buf.readableBytes());
	}

	@Override
	public Buffer<ByteBuf> limit(int limit) {
		return null;
	}

	@Override
	public int capacity() {
		return buf.capacity();
	}

	@Override
	public Buffer<ByteBuf> capacity(int capacity) {
		buf.capacity(capacity);
		return this;
	}

	@Override
	public int remaining() {
		return capacity() - position();
	}

	@Override
	public Buffer<ByteBuf> skip(int len) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> clear() {
		return null;
	}

	@Override
	public Buffer<ByteBuf> compact() {
		return null;
	}

	@Override
	public Buffer<ByteBuf> flip() {
		return null;
	}

	@Override
	public Buffer<ByteBuf> rewind() {
		return null;
	}

	@Override
	public Buffer<ByteBuf> rewind(int len) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> clone() {
		return null;
	}

	@Override
	public Buffer<ByteBuf> copy() {
		return new ByteBufBuffer(buf.copy(), writable);
	}

	@Override
	public Buffer<ByteBuf> slice(int start, int len) {
		return new ByteBufBuffer(buf.copy(start, len), writable);
	}

	@Override
	public Iterable<Buffer<ByteBuf>> split(byte delimiter) {
		return null;
	}

	@Override
	public Iterable<Buffer<ByteBuf>> split(byte delimiter, boolean stripDelimiter) {
		return null;
	}

	@Override
	public Iterable<Buffer<ByteBuf>> split(byte delimiter,
	                                       boolean stripDelimiter,
	                                       List<Buffer<ByteBuf>> preallocatedList) {
		return null;
	}

	@Override
	public Iterable<Buffer<ByteBuf>> split(Buffer<ByteBuf> delimiter) {
		return null;
	}

	@Override
	public Iterable<Buffer<ByteBuf>> split(Buffer<ByteBuf> delimiter, boolean stripDelimiter) {
		return null;
	}

	@Override
	public Iterable<Buffer<ByteBuf>> split(Buffer<ByteBuf> delimiter,
	                                       boolean stripDelimiter,
	                                       List<Buffer<ByteBuf>> preallocatedList) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(ByteBuf data) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(Buffer<ByteBuf> buffer) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(ByteBuffer buffer) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(CharSequence chars) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(byte[] bytes) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(byte b) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(char c) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(short s) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(int i) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> prepend(long l) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(ByteBuf data) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(Buffer<ByteBuf> buffer) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(ByteBuffer buffer) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(CharSequence chars) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(byte[] bytes) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(byte b) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(char c) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(short s) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(int i) {
		return null;
	}

	@Override
	public Buffer<ByteBuf> append(long l) {
		return null;
	}

	@Override
	public byte readByte() {
		return 0;
	}

	@Override
	public void readBytes(byte[] bytes) {

	}

	@Override
	public short readShort() {
		return 0;
	}

	@Override
	public int readInt() {
		return 0;
	}

	@Override
	public float readFloat() {
		return 0;
	}

	@Override
	public double readDouble() {
		return 0;
	}

	@Override
	public long readLong() {
		return 0;
	}

	@Override
	public char readChar() {
		return 0;
	}

	@Override
	public void readChars(char[] chars) {

	}

	@Override
	public String readString() {
		CharsetDecoder decoder = Charset.defaultCharset().newDecoder();
		try {
			CharBuffer cb = decoder.decode(buf.nioBuffer());
			return cb.toString();
		} catch (CharacterCodingException e) {
			throw new IllegalStateException(e);
		}
	}

	@Override
	public String readString(CharsetDecoder decoder) {
		return null;
	}

	@Override
	public ByteBuf get() {
		return buf;
	}

	@Override
	public void close() throws Exception {

	}

	@Override
	public int compareTo(Buffer<ByteBuf> o) {
		return 0;
	}

	@Override
	public Iterator<Buffer<ByteBuf>> iterator() {
		return null;
	}

	@Override
	public String toString() {
		return "ByteBufBuffer{" +
				"buf=" + buf +
				", writable=" + writable +
				'}';
	}

}


text:
import React, {Component} from 'react';
import {
  ScrollView,
  Text,
  View,
  Button,
  ToastAndroid,
  Platform
} from 'react-native';

import {
  Spinner
} from 'native-base'

import Item from './Item';
import log from '../../log'

class List extends Component {
  componentWillMount() {
    this.fetchData()
  }

  fetchData() {
    const {fetch} = this.props
    fetch()
  }

  renderList(list, onItemClick) {
    return list.map((item) => {
      return (
        <Item key={item.name} item={item} onItemClick={onItemClick}/>
      )
    })
  }

  render() {
    const {
      list,
      isFetching,
      error,
      onItemClick
    } = this.props
    log(this.props)

    if (isFetching && !list.length) {
      return (
        <View style={{
          flex: 1,
          justifyContent: 'center',
          alignItems: 'center',
        }}>
          <Spinner color='#FFB74D'/>
        </View>)
    }

    if (error) {
      if (!list.length) {
        return (
          <View style={{
          flex: 1,
          justifyContent: 'center',
          alignItems: 'center',
        }}>
            <Text>{'Oopss one error :/'}</Text>
            <Button
              onPress={() => this.fetchData()}
              title='Retry'
              color='#FFB74D'
            />
          </View>)
      } else {
        if (Platform.OS !== 'ios') {
          ToastAndroid.show('Oopss one error :/', ToastAndroid.SHORT)
        }
      }
    }

    return (
      <ScrollView>
        {this.renderList(list, onItemClick)}
      </ScrollView>
    )
  }
}

export default List


text:
var getMeshMixin = require('../getMeshMixin');
var registerPrimitive = require('../registerPrimitive');
var utils = require('../../../utils/');

registerPrimitive('a-cursor', utils.extendDeep({}, getMeshMixin(), {
  defaultAttributes: {
    cursor: {
      maxDistance: 1000
    },
    geometry: {
      primitive: 'ring',
      radiusOuter: 0.016,
      radiusInner: 0.01,
      segmentsTheta: 64
    },
    material: {
      shader: 'flat',
      opacity: 0.8
    },
    position: {
      x: 0,
      y: 0,
      z: -1
    }
  },

  mappings: {
    fuse: 'cursor.fuse',
    'max-distance': 'cursor.maxDistance',
    timeout: 'cursor.timeout'
  }
}));


text:
import LZString from 'lz-string';

export default (dbname, ext = 'nedb') => {
    const thisModule = LZString.decompressFromEncodedURIComponent(
        require(`./db/${dbname}.${ext === 'json' ? 'json-compressed' : ext}`)
            .default
    );

    if (ext === 'json') {
        return JSON.parse(thisModule);
    }

    return thisModule;
};


text:
Redditor
========

.. autoclass:: praw.models.Redditor
    :inherited-members:


text:
"use strict";

/* jshint maxlen: 200 */
/* global test */

var assert = require("proclaim");
var expect = assert.strictEqual;
var lib = "../../lib" + (process.env.TEST_COV && "-cov" || "") + "/";

var utils = require(lib + "index");

test("toInt should return a Number", function () {
    expect(utils.toInt("10"), 10);
});

test("isString with a string param should return true", function () {
    expect(utils.isString(""), true);
});

test("isString with a number param should return false", function () {
    expect(utils.isString(10), false);
});

test("isObject with a object param should return true", function () {
    expect(utils.isObject({}), true);
});

test("isObject with a string param should return false", function () {
    expect(utils.isObject(""), false);
});

test("isFunction with a function param should return true", function () {
    expect(utils.isFunction(function () {}), true);
});

test("isFunction with a string param should return false", function () {
    expect(utils.isFunction(""), false);
});

test("isArray with a array param should return true", function () {
    expect(utils.isArray([]), true);
});

test("isArray with a string param should return false", function () {
    expect(utils.isArray(""), false);
});

test("isNumber with a string param should return false", function () {
    expect(utils.isNumber("0"), false);
});

test("isNumber with a number param should return true", function () {
    expect(utils.isNumber(1), true);
});

test("isInteger with a integer param should return true", function () {
    expect(utils.isInteger(1), true);
});

test("isInteger with a float param should return false", function () {
    expect(utils.isInteger(0.1), false);
});

test("escape should return an escaped html string", function () {
    expect(utils.escape("
hello & \"welcome\""), "<div>hello & "welcome"");
});

test("escapeUrl should return an escaped url string", function () {
    expect(utils.escapeUrl("
hello & \"welcome\""), "
hello & \"welcome\"");
});

test("entries should work on an array", function () {
    var iterator = utils.entries([1, 2]);
    var result = iterator.next();
    assert.notOk(result.done);
    assert.deepEqual(result.value, [0, 1]);
    result = iterator.next();
    assert.notOk(result.done);
    assert.deepEqual(result.value, [1, 2]);
    result = iterator.next();
    assert.ok(result.done);
});

test("entries should work on an object", function () {
    var iterator = utils.entries({ a: 12, b: 24 });
    var result = iterator.next();
    assert.notOk(result.done);
    assert.deepEqual(result.value, ["a", 12]);
    result = iterator.next();
    assert.notOk(result.done);
    assert.deepEqual(result.value, ["b", 24]);
    result = iterator.next();
    assert.ok(!!result.done);
});

test("entries should work on an Map", function () {
    var iterator = utils.entries(new Map([["a", 12], ["b", 24]]));
    var result = iterator.next();
    assert.notOk(result.done);
    assert.deepEqual(result.value, ["a", 12]);
    result = iterator.next();
    assert.notOk(result.done);
    assert.deepEqual(result.value, ["b", 24]);
    result = iterator.next();
    assert.ok(result.done);
});

test("filter should work on an array", function () {
    var result = utils.filter([1, 2, 3, 4], function (v) {
        return v % 2;
    });
    assert.deepEqual(result, [1, 3]);
});

test("filter should work on an object", function () {
    var result = utils.filter({ a: 1, b: 2, c: 3, d: 4 }, function (v) {
        return v % 2;
    });
    assert.deepEqual(result, { a: 1, c: 3 });
});

test("find should find an element in an array", function () {
    var result = utils.find([{ v: 1, ok: false }, { v: 2, ok: true }, { v: 3, ok: true }], function (v) {
        return v.ok;
    });
    expect(result.v, 2);
});

test("find should find an element in an object", function () {
    var result = utils.find({
        a: { v: 1, ok: false },
        b: { v: 2, ok: true },
        c: { v: 3, ok: true }
    }, function (v) {
        return v.ok;
    });
    expect(result.v, 2);
});

test("findIndex should find the index of an element in an array", function () {
    var result = utils.findIndex([{ v: 1, ok: false }, { v: 2, ok: true }, { v: 3, ok: true }], function (v) {
        return v.ok;
    });
    expect(result, 1);
});

test("findIndex should find the index of an element in an object", function () {
    var result = utils.findIndex({
        a: { v: 1, ok: false },
        b: { v: 2, ok: true },
        c: { v: 3, ok: true }
    }, function (v) {
        return v.ok;
    });
    expect(result, "b");
});

test("findEach should call the callback for each elements in an array", function () {
    var results = [];
    utils.forEach([1, 2, 3], function (v, i) {
        return results.push([i, v]);
    });
    assert.deepEqual(results, [[0, 1], [1, 2], [2, 3]]);
});

test("findEach should call the callback for each elements in an object", function () {
    var results = [];
    utils.forEach({ a: 1, b: 2, c: 3 }, function (v, key) {
        return results.push([key, v]);
    });
    assert.deepEqual(results, [["a", 1], ["b", 2], ["c", 3]]);
});

test("findEach should call the callback for each elements in an Map", function () {
    var results = [];
    utils.forEach(new Map([["a", 12], ["b", 24]]), function (v, key) {
        return results.push([key, v]);
    });
    assert.deepEqual(results, [["a", 12], ["b", 24]]);
});

test("join should joins all elements of an Array into a string", function () {
    var result = utils.join([1, 2, 3], "-");
    expect(result, "1-2-3");
});

test("join should joins all elements of an Object into a string", function () {
    var result = utils.join({ a: 1, b: 2, c: 3 }, "-");
    expect(result, "1-2-3");
});

test("map should transform all elements of an Array into a new array", function () {
    var result = utils.map([1, 2, 3], function (v) {
        return v * 2;
    });
    assert.deepEqual(result, [2, 4, 6]);
});

test("map should transform all elements of an Object into a new array", function () {
    var result = utils.map({ a: 1, b: 2, c: 3 }, function (v) {
        return v * 2;
    });
    assert.deepEqual(result, { a: 2, b: 4, c: 6 });
});

test("reduce should reduce all elements of an Array into a new one", function () {
    var result = utils.reduce([1, 2, 3], function (previous, v, i) {
        return previous + v;
    }, 5);
    expect(result, 5 + 1 + 2 + 3);
    result = utils.reduce([1, 2, 3], function (previous, v, i) {
        return previous += i + "_" + v + ",";
    }, "");
    expect(result, "0_1,1_2,2_3,");
});

test("reduce should reduce all elements of an Object into a new one", function () {
    var result = utils.reduce({ a: 1, b: 2, c: 3 }, function (previous, v, key) {
        return previous + v;
    }, 5);
    expect(result, 5 + 1 + 2 + 3);
    result = utils.reduce({ a: 1, b: 2, c: 3 }, function (previous, v, i) {
        return previous += i + "_" + v + ",";
    }, "");
    expect(result, "a_1,b_2,c_3,");
});

test("reduceRight should reduce all elements from the right of an Array into a new one", function () {
    var result = utils.reduceRight([1, 2, 3], function (previous, v, i) {
        return previous + v;
    }, 5);
    expect(result, 5 + 1 + 2 + 3);
    result = utils.reduceRight([1, 2, 3], function (previous, v, i) {
        return previous += i + "_" + v + ",";
    }, "");
    expect(result, "2_3,1_2,0_1,");
});

test("reduceRight should reduce all elements from the right of an Object into a new one", function () {
    var result = utils.reduceRight({ a: 1, b: 2, c: 3 }, function (previous, v, key) {
        return previous + v;
    }, 5);
    expect(result, 5 + 1 + 2 + 3);
    result = utils.reduceRight({ a: 1, b: 2, c: 3 }, function (previous, v, i) {
        return previous += i + "_" + v + ",";
    }, "");
    expect(result, "c_3,b_2,a_1,");
});

test("some should forEach elements of an Array until the callback returns true", function () {
    var results = [];
    var result = utils.some([1, 2, 3], function (v, i) {
        results.push(v);return v === 2;
    }, 5);
    expect(result, true);
    assert.deepEqual(results, [1, 2]);
});

test("some should forEach elements of an Object until the callback returns true", function () {
    var results = {};
    var result = utils.some({ a: 1, b: 2, c: 3 }, function (v, key) {
        results[key] = v;return v === 2;
    }, 5);
    expect(result, true);
    assert.deepEqual(results, { a: 1, b: 2 });
});

test("map to array should transform a map into an array", function () {
    var map = new Map();
    map.set("a", 1);
    map.set("ab", 2);
    var result = utils.mapToArray(map, function (v, k) {
        return k + ":" + v;
    });
    assert.isArray(result);
    assert.deepEqual(result, ["a:1", "ab:2"]);
});

test("map to array should transform a object into an array", function () {
    var object = { a: 1, ab: 2 };
    var result = utils.mapToArray(object, function (v, k) {
        return k + ":" + v;
    });
    assert.isArray(result);
    assert.deepEqual(result, ["a:1", "ab:2"]);
});

test("map to array should transform an array into another array", function () {
    var object = [1, 2];
    var result = utils.mapToArray(object, function (v, k) {
        return k + ":" + v;
    });
    assert.isArray(result);
    assert.deepEqual(result, ["0:1", "1:2"]);
});

test("defineProperty should work", function () {
    var o = {};
    var res = utils.defineProperty(o, "a", 1);
    expect(res, o);
    expect(res.a, 1);
});

test("defineConstant should work", function () {
    var o = {};
    var res = utils.defineConstant(o, "a", 1);
    expect(res, o);
    expect(res.a, 1);

    assert.throws(function () {
        utils.defineConstant(o, "a", 2);
    }, "Cannot redefine property: a");
});

test("defineGetter should work", function () {
    var o = {};
    var res = utils.defineGetter(o, "a", function () {
        return 1;
    });
    expect(res, o);
    expect(res.a, 1);
});

test("defineSetter should work", function () {
    var o = {};
    var value;
    var res = utils.defineSetter(o, "a", function (v) {
        return value = v * 2;
    });
    expect(res, o);
    res.a = 2;
    expect(value, 4);
});

test("defineProperties should work", function () {
    var o = {};
    var res = utils.defineProperties(o, {
        a: 1,
        b: 2
    });
    expect(res, o);
    expect(res.a, 1);
    expect(res.b, 2);
});

test("defineProperties should work when properties are empty", function () {
    var o = {};
    var res = utils.defineProperties(o);
    expect(res, o);
});
//# sourceMappingURL=index.js.map


text:
package p03_CoffeeMachine;

public enum CoffeeSize {

	SMALL(50, 50), NORMAL(100, 75), DOUBLE (200, 100);

	private Integer dosage;
	private Integer price;

	CoffeeSize(Integer dosage, Integer price) {
		this.dosage = dosage;
		this.price = price;
	}

	public Integer getDosage() {
		return dosage;
	}

	public Integer getPrice() {
		return price;
	}

}


text:
/*
 *  This file is part of the WSF Staff project.
 *  Please, visit http://code.google.com/p/staff for more information.
 */

#ifndef _ECHO_H_
#define _ECHO_H_

#include <string>
#include <staff/common/IService.h>

  //! echo service
  // *serviceUri: http://localhost:9090/axis2/services/echo
  // *targetNamespace: http://ws.apache.org/axis2/services/echo
  // *targetNamespacePrefix: ns1
  class Echo: public staff::IService
  {
  public:
    //! echo string
    /*! \param text - input string
        \return resulting string
        */
    // *requestElement: echoString
    // *responseElement: echoString
    // *resultElement: text
    virtual void EchoString(const std::string& sEcho, staff::ICallback< const std::string& >& rCallback) = 0;
  };

#endif // _ECHO_H_


text:
using UnityEngine;
using System;
using LuaInterface;
using SLua;
using System.Collections.Generic;
public class Lua_UnityEngine_UI_AspectRatioFitter : LuaObject {
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int SetLayoutHorizontal(IntPtr l) {
		try {
			UnityEngine.UI.AspectRatioFitter self=(UnityEngine.UI.AspectRatioFitter)checkSelf(l);
			self.SetLayoutHorizontal();
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int SetLayoutVertical(IntPtr l) {
		try {
			UnityEngine.UI.AspectRatioFitter self=(UnityEngine.UI.AspectRatioFitter)checkSelf(l);
			self.SetLayoutVertical();
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_aspectMode(IntPtr l) {
		try {
			UnityEngine.UI.AspectRatioFitter self=(UnityEngine.UI.AspectRatioFitter)checkSelf(l);
			pushValue(l,true);
			pushEnum(l,(int)self.aspectMode);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_aspectMode(IntPtr l) {
		try {
			UnityEngine.UI.AspectRatioFitter self=(UnityEngine.UI.AspectRatioFitter)checkSelf(l);
			UnityEngine.UI.AspectRatioFitter.AspectMode v;
			checkEnum(l,2,out v);
			self.aspectMode=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int get_aspectRatio(IntPtr l) {
		try {
			UnityEngine.UI.AspectRatioFitter self=(UnityEngine.UI.AspectRatioFitter)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.aspectRatio);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int set_aspectRatio(IntPtr l) {
		try {
			UnityEngine.UI.AspectRatioFitter self=(UnityEngine.UI.AspectRatioFitter)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.aspectRatio=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public void reg(IntPtr l) {
		getTypeTable(l,"UnityEngine.UI.AspectRatioFitter");
		addMember(l,SetLayoutHorizontal);
		addMember(l,SetLayoutVertical);
		addMember(l,"aspectMode",get_aspectMode,set_aspectMode,true);
		addMember(l,"aspectRatio",get_aspectRatio,set_aspectRatio,true);
		createTypeMetatable(l,null, typeof(UnityEngine.UI.AspectRatioFitter),typeof(UnityEngine.EventSystems.UIBehaviour));
	}
}


text:
/**
 *    @file
 *          Utilities for interacting with multiple file partitions and maps
 *          key-value config calls to the correct partition.
 */

#include <platform/internal/CHIPDeviceLayerInternal.h>
#include <platform/internal/testing/ConfigUnitTest.h>

#include <lib/core/CHIPEncoding.h>
#include <lib/support/CodeUtils.h>
#include <platform/Linux/CHIPLinuxStorage.h>
#include <platform/Linux/PosixConfig.h>

namespace chip {
namespace DeviceLayer {
namespace Internal {

static ChipLinuxStorage gChipLinuxFactoryStorage;
static ChipLinuxStorage gChipLinuxConfigStorage;
static ChipLinuxStorage gChipLinuxCountersStorage;

// *** CAUTION ***: Changing the names or namespaces of these values will *break* existing devices.

// NVS namespaces used to store device configuration information.
const char PosixConfig::kConfigNamespace_ChipFactory[]  = "chip-factory";
const char PosixConfig::kConfigNamespace_ChipConfig[]   = "chip-config";
const char PosixConfig::kConfigNamespace_ChipCounters[] = "chip-counters";

// Keys stored in the Chip-factory namespace
const PosixConfig::Key PosixConfig::kConfigKey_SerialNum             = { kConfigNamespace_ChipFactory, "serial-num" };
const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceId           = { kConfigNamespace_ChipFactory, "device-id" };
const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceCert         = { kConfigNamespace_ChipFactory, "device-cert" };
const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceICACerts     = { kConfigNamespace_ChipFactory, "device-ca-certs" };
const PosixConfig::Key PosixConfig::kConfigKey_MfrDevicePrivateKey   = { kConfigNamespace_ChipFactory, "device-key" };
const PosixConfig::Key PosixConfig::kConfigKey_HardwareVersion       = { kConfigNamespace_ChipFactory, "hardware-ver" };
const PosixConfig::Key PosixConfig::kConfigKey_ManufacturingDate     = { kConfigNamespace_ChipFactory, "mfg-date" };
const PosixConfig::Key PosixConfig::kConfigKey_SetupPinCode          = { kConfigNamespace_ChipFactory, "pin-code" };
const PosixConfig::Key PosixConfig::kConfigKey_SetupDiscriminator    = { kConfigNamespace_ChipFactory, "discriminator" };
const PosixConfig::Key PosixConfig::kConfigKey_Spake2pIterationCount = { kConfigNamespace_ChipFactory, "iteration-count" };
const PosixConfig::Key PosixConfig::kConfigKey_Spake2pSalt           = { kConfigNamespace_ChipFactory, "salt" };
const PosixConfig::Key PosixConfig::kConfigKey_Spake2pVerifier       = { kConfigNamespace_ChipFactory, "verifier" };
const PosixConfig::Key PosixConfig::kConfigKey_VendorId              = { kConfigNamespace_ChipFactory, "vendor-id" };
const PosixConfig::Key PosixConfig::kConfigKey_ProductId             = { kConfigNamespace_ChipFactory, "product-id" };

// Keys stored in the Chip-config namespace
const PosixConfig::Key PosixConfig::kConfigKey_ServiceConfig      = { kConfigNamespace_ChipConfig, "service-config" };
const PosixConfig::Key PosixConfig::kConfigKey_PairedAccountId    = { kConfigNamespace_ChipConfig, "account-id" };
const PosixConfig::Key PosixConfig::kConfigKey_ServiceId          = { kConfigNamespace_ChipConfig, "service-id" };
const PosixConfig::Key PosixConfig::kConfigKey_LastUsedEpochKeyId = { kConfigNamespace_ChipConfig, "last-ek-id" };
const PosixConfig::Key PosixConfig::kConfigKey_FailSafeArmed      = { kConfigNamespace_ChipConfig, "fail-safe-armed" };
const PosixConfig::Key PosixConfig::kConfigKey_WiFiStationSecType = { kConfigNamespace_ChipConfig, "sta-sec-type" };
const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" };
const PosixConfig::Key PosixConfig::kConfigKey_CountryCode        = { kConfigNamespace_ChipConfig, "country-code" };
const PosixConfig::Key PosixConfig::kConfigKey_LocationCapability = { kConfigNamespace_ChipConfig, "location-capability" };
const PosixConfig::Key PosixConfig::kConfigKey_UniqueId           = { kConfigNamespace_ChipFactory, "unique-id" };

// Keys stored in the Chip-counters namespace
const PosixConfig::Key PosixConfig::kCounterKey_RebootCount           = { kConfigNamespace_ChipCounters, "reboot-count" };
const PosixConfig::Key PosixConfig::kCounterKey_UpTime                = { kConfigNamespace_ChipCounters, "up-time" };
const PosixConfig::Key PosixConfig::kCounterKey_TotalOperationalHours = { kConfigNamespace_ChipCounters,
                                                                          "total-operational-hours" };
const PosixConfig::Key PosixConfig::kCounterKey_BootReason            = { kConfigNamespace_ChipCounters, "boot-reason" };

ChipLinuxStorage * PosixConfig::GetStorageForNamespace(Key key)
{
    if (strcmp(key.Namespace, kConfigNamespace_ChipFactory) == 0)
        return &gChipLinuxFactoryStorage;

    if (strcmp(key.Namespace, kConfigNamespace_ChipConfig) == 0)
        return &gChipLinuxConfigStorage;

    if (strcmp(key.Namespace, kConfigNamespace_ChipCounters) == 0)
        return &gChipLinuxCountersStorage;

    return nullptr;
}

CHIP_ERROR PosixConfig::Init()
{
    return PersistedStorage::KeyValueStoreMgrImpl().Init(CHIP_CONFIG_KVS_PATH);
}

CHIP_ERROR PosixConfig::ReadConfigValue(Key key, bool & val)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;
    uint32_t intVal;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->ReadValue(key.Name, intVal);
    if (err == CHIP_ERROR_KEY_NOT_FOUND)
    {
        err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
    }
    SuccessOrExit(err);

    val = (intVal != 0);

exit:
    return err;
}

CHIP_ERROR PosixConfig::ReadConfigValue(Key key, uint16_t & val)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->ReadValue(key.Name, val);
    if (err == CHIP_ERROR_KEY_NOT_FOUND)
    {
        err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
    }
    SuccessOrExit(err);

exit:
    return err;
}

CHIP_ERROR PosixConfig::ReadConfigValue(Key key, uint32_t & val)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->ReadValue(key.Name, val);
    if (err == CHIP_ERROR_KEY_NOT_FOUND)
    {
        err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
    }
    SuccessOrExit(err);

exit:
    return err;
}

CHIP_ERROR PosixConfig::ReadConfigValue(Key key, uint64_t & val)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    // Special case the MfrDeviceId value, optionally allowing it to be read as a blob containing
    // a 64-bit big-endian integer, instead of a u64 value.
    if (key == kConfigKey_MfrDeviceId)
    {
        uint8_t deviceIdBytes[sizeof(uint64_t)];
        size_t deviceIdLen = sizeof(deviceIdBytes);
        size_t deviceIdOutLen;
        err = storage->ReadValueBin(key.Name, deviceIdBytes, deviceIdLen, deviceIdOutLen);
        if (err == CHIP_NO_ERROR)
        {
            VerifyOrExit(deviceIdOutLen == sizeof(deviceIdBytes), err = CHIP_ERROR_INCORRECT_STATE);
            val = Encoding::BigEndian::Get64(deviceIdBytes);
            ExitNow();
        }
    }

    err = storage->ReadValue(key.Name, val);
    if (err == CHIP_ERROR_KEY_NOT_FOUND)
    {
        err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
    }
    SuccessOrExit(err);

exit:
    return err;
}

CHIP_ERROR PosixConfig::ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->ReadValueStr(key.Name, buf, bufSize, outLen);
    if (err == CHIP_ERROR_KEY_NOT_FOUND)
    {
        outLen = 0;
        err    = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
    }
    else if (err == CHIP_ERROR_BUFFER_TOO_SMALL)
    {
        err = (buf == nullptr) ? CHIP_NO_ERROR : CHIP_ERROR_BUFFER_TOO_SMALL;
    }
    SuccessOrExit(err);

exit:
    return err;
}

CHIP_ERROR PosixConfig::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->ReadValueBin(key.Name, buf, bufSize, outLen);
    if (err == CHIP_ERROR_KEY_NOT_FOUND)
    {
        outLen = 0;
        err    = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
    }
    else if (err == CHIP_ERROR_BUFFER_TOO_SMALL)
    {
        err = (buf == nullptr) ? CHIP_NO_ERROR : CHIP_ERROR_BUFFER_TOO_SMALL;
    }
    SuccessOrExit(err);

exit:
    return err;
}

CHIP_ERROR PosixConfig::WriteConfigValue(Key key, bool val)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->WriteValue(key.Name, val);
    SuccessOrExit(err);

    // Commit the value to the persistent store.
    err = storage->Commit();
    SuccessOrExit(err);

    ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %s", key.Namespace, key.Name, val ? "true" : "false");

exit:
    return err;
}

CHIP_ERROR PosixConfig::WriteConfigValue(Key key, uint16_t val)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->WriteValue(key.Name, val);
    SuccessOrExit(err);

    // Commit the value to the persistent store.
    err = storage->Commit();
    SuccessOrExit(err);

    ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %u (0x%X)", key.Namespace, key.Name, val, val);

exit:
    return err;
}

CHIP_ERROR PosixConfig::WriteConfigValue(Key key, uint32_t val)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->WriteValue(key.Name, val);
    SuccessOrExit(err);

    // Commit the value to the persistent store.
    err = storage->Commit();
    SuccessOrExit(err);

    ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %" PRIu32 " (0x%" PRIX32 ")", key.Namespace, key.Name, val, val);

exit:
    return err;
}

CHIP_ERROR PosixConfig::WriteConfigValue(Key key, uint64_t val)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->WriteValue(key.Name, val);
    SuccessOrExit(err);

    // Commit the value to the persistent store.
    err = storage->Commit();
    SuccessOrExit(err);

    ChipLogProgress(DeviceLayer, "NVS set: %s/%s = %" PRIu64 " (0x%" PRIX64 ")", key.Namespace, key.Name, val, val);

exit:
    return err;
}

CHIP_ERROR PosixConfig::WriteConfigValueStr(Key key, const char * str)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    if (str != nullptr)
    {
        storage = GetStorageForNamespace(key);
        VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

        err = storage->WriteValueStr(key.Name, str);
        SuccessOrExit(err);

        // Commit the value to the persistent store.
        err = storage->Commit();
        SuccessOrExit(err);

        ChipLogProgress(DeviceLayer, "NVS set: %s/%s = \"%s\"", key.Namespace, key.Name, str);
    }

    else
    {
        err = ClearConfigValue(key);
        SuccessOrExit(err);
    }

exit:
    return err;
}

CHIP_ERROR PosixConfig::WriteConfigValueStr(Key key, const char * str, size_t strLen)
{
#if CHIP_CONFIG_MEMORY_MGMT_MALLOC
    CHIP_ERROR err;
    char * strCopy = nullptr;

    if (str != nullptr)
    {
        strCopy = strndup(str, strLen);
        VerifyOrExit(strCopy != nullptr, err = CHIP_ERROR_NO_MEMORY);
    }

    err = PosixConfig::WriteConfigValueStr(key, strCopy);

exit:
    if (strCopy != nullptr)
    {
        free(strCopy);
    }
    return err;
#else
#error "Unsupported CHIP_CONFIG_MEMORY_MGMT configuration"
#endif
}

CHIP_ERROR PosixConfig::WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    if (data != nullptr)
    {
        storage = GetStorageForNamespace(key);
        VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

        err = storage->WriteValueBin(key.Name, data, dataLen);
        SuccessOrExit(err);

        // Commit the value to the persistent store.
        err = storage->Commit();
        SuccessOrExit(err);

        ChipLogProgress(DeviceLayer, "NVS set: %s/%s = (blob length %u)", key.Namespace, key.Name,
                        static_cast<unsigned int>(dataLen));
    }
    else
    {
        err = ClearConfigValue(key);
        SuccessOrExit(err);
    }

exit:
    return err;
}

CHIP_ERROR PosixConfig::ClearConfigValue(Key key)
{
    CHIP_ERROR err;
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->ClearValue(key.Name);
    if (err == CHIP_ERROR_KEY_NOT_FOUND)
    {
        ExitNow(err = CHIP_NO_ERROR);
    }
    SuccessOrExit(err);

    // Commit the value to the persistent store.
    err = storage->Commit();
    SuccessOrExit(err);

    ChipLogProgress(DeviceLayer, "NVS erase: %s/%s", key.Namespace, key.Name);

exit:
    return err;
}

bool PosixConfig::ConfigValueExists(Key key)
{
    ChipLinuxStorage * storage;

    storage = GetStorageForNamespace(key);
    if (storage == nullptr)
        return false;

    return storage->HasValue(key.Name);
}

CHIP_ERROR PosixConfig::EnsureNamespace(const char * ns)
{
    CHIP_ERROR err             = CHIP_NO_ERROR;
    ChipLinuxStorage * storage = nullptr;

    if (strcmp(ns, kConfigNamespace_ChipFactory) == 0)
    {
        storage = &gChipLinuxFactoryStorage;
        err     = storage->Init(CHIP_DEFAULT_FACTORY_PATH);
    }
    else if (strcmp(ns, kConfigNamespace_ChipConfig) == 0)
    {
        storage = &gChipLinuxConfigStorage;
        err     = storage->Init(CHIP_DEFAULT_CONFIG_PATH);
    }
    else if (strcmp(ns, kConfigNamespace_ChipCounters) == 0)
    {
        storage = &gChipLinuxCountersStorage;
        err     = storage->Init(CHIP_DEFAULT_DATA_PATH);
    }

    SuccessOrExit(err);

exit:
    return err;
}

CHIP_ERROR PosixConfig::ClearNamespace(const char * ns)
{
    CHIP_ERROR err             = CHIP_NO_ERROR;
    ChipLinuxStorage * storage = nullptr;

    if (strcmp(ns, kConfigNamespace_ChipConfig) == 0)
    {
        storage = &gChipLinuxConfigStorage;
    }
    else if (strcmp(ns, kConfigNamespace_ChipCounters) == 0)
    {
        storage = &gChipLinuxCountersStorage;
    }

    VerifyOrExit(storage != nullptr, err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND);

    err = storage->ClearAll();
    if (err != CHIP_NO_ERROR)
    {
        ChipLogError(DeviceLayer, "Storage ClearAll failed: %s", ErrorStr(err));
    }
    SuccessOrExit(err);

    err = storage->Commit();
    if (err != CHIP_NO_ERROR)
    {
        ChipLogError(DeviceLayer, "Storage Commit failed: %s", ErrorStr(err));
    }

exit:
    return err;
}

CHIP_ERROR PosixConfig::FactoryResetConfig()
{
    CHIP_ERROR err = CHIP_NO_ERROR;
    ChipLinuxStorage * storage;

    ChipLogProgress(DeviceLayer, "Performing factory reset configuration");

    storage = &gChipLinuxConfigStorage;
    if (storage == nullptr)
    {
        ChipLogError(DeviceLayer, "Storage get failed");
        err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
    }
    SuccessOrExit(err);

    err = storage->ClearAll();
    if (err != CHIP_NO_ERROR)
    {
        ChipLogError(DeviceLayer, "Storage ClearAll failed: %s", ErrorStr(err));
    }
    SuccessOrExit(err);

    err = storage->Commit();
    if (err != CHIP_NO_ERROR)
    {
        ChipLogError(DeviceLayer, "Storage Commit failed: %s", ErrorStr(err));
    }

exit:
    return err;
}

CHIP_ERROR PosixConfig::FactoryResetCounters()
{
    CHIP_ERROR err = CHIP_NO_ERROR;
    ChipLinuxStorage * storage;

    ChipLogProgress(DeviceLayer, "Performing factory reset counters");

    storage = &gChipLinuxCountersStorage;
    if (storage == nullptr)
    {
        ChipLogError(DeviceLayer, "Storage get failed");
        err = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND;
    }
    SuccessOrExit(err);

    err = storage->ClearAll();
    if (err != CHIP_NO_ERROR)
    {
        ChipLogError(DeviceLayer, "Storage ClearAll failed: %s", ErrorStr(err));
    }
    SuccessOrExit(err);

    err = storage->Commit();
    if (err != CHIP_NO_ERROR)
    {
        ChipLogError(DeviceLayer, "Storage Commit failed: %s", ErrorStr(err));
    }

exit:
    return err;
}

void PosixConfig::RunConfigUnitTest()
{
    // Run common unit test.
    ::chip::DeviceLayer::Internal::RunConfigUnitTest<PosixConfig>();
}

} // namespace Internal
} // namespace DeviceLayer
} // namespace chip


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\search\ArticleSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'category_id') ?>

    <?php echo $form->field($model, 'slug') ?>

    <?php //echo $form->field($model, 'intro_text') ?>

    <?php //echo $form->field($model, 'full_text') ?>

    <?php // echo $form->field($model, 'tags') ?>

    <?php  echo $form->field($model, 'created_at') ?>

    <?php  echo $form->field($model, 'updated_at') ?>

    <?php // echo $form->field($model, 'isActive') ?>

    <?php // echo $form->field($model, 'isFavorite') ?>

        <?= Html::submitButton('Пошук', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
namespace dawn_native { namespace d3d12 {

    class Device;

    class ComputePipeline final : public ComputePipelineBase {
      public:
        static ResultOrError<ComputePipeline*> Create(Device* device,
                                                      const ComputePipelineDescriptor* descriptor);
        ComputePipeline() = delete;

        ID3D12PipelineState* GetPipelineState() const;

      private:
        ~ComputePipeline() override;
        using ComputePipelineBase::ComputePipelineBase;
        MaybeError Initialize(const ComputePipelineDescriptor* descriptor);
        ComPtr<ID3D12PipelineState> mPipelineState;
    };

}}  // namespace dawn_native::d3d12

#endif  // DAWNNATIVE_D3D12_COMPUTEPIPELINED3D12_H_


text:
sudo zypper install lsb
sudo zypper install the_silver_searcher
sudo zypper install python3-jupyter python3-jupyter_ipython
sudo zypper install yakuake
sudo zypper install kate
sudo zypper install pandoc
sudo zypper install redis
sudo zypper install -t pattern devel_python3
sudo zypper install gcc-c++
sudo zypper install -t pattern devel_basis
sudo zypper install -t pattern devel_C_C++ devel_kernel

#
# Install keys
wget https://dl.google.com/linux/linux_signing_key.pub
sudo rpm --import linux_signing_key.pub
rm linux_signing_key.pub

#
# Installs all packages I commonly use on OpenSuse
sudo zypper ar -f -n packman http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman
sudo zypper ar -f http://download.videolan.org/pub/vlc/SuSE/Tumbleweed/ vlc
sudo zypper ar -f http://download.opensuse.org/repositories/games/openSUSE_Tumbleweed/ games
sudo zypper ar -f http://download.opensuse.org/repositories/Emulators:/Wine/openSUSE_Tumbleweed/ wine

sudo zypper install vlc
sudo zypper install wine
sudo zypper install k3b-codecs ffmpeg lame gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer-plugins-ugly-orig-addon gstreamer-plugins-libav
sudo zypper install flash-player
sudo zypper dup

sudo pip3 install -r ~/environment/requirements.txt -U

sudo chmod ogu+rwx /etc/vconsole.conf
sudo echo "KEYMAP=en-latin9" > /etc/vconsole.conf


text:
package ranking

import (
	"sync"

	"github.com/mauricioklein/text-search-engine/reader"
)

// Processor defines a instance of the processor
type Processor struct {
	Files         []reader.File
	NWorkers      int
	RankAlgorithm Algorithm
}

// RankResult defines the result of a
// rank canculation for a specific file
type RankResult struct {
	File  reader.File
	Score float64
}

// NewProcessor creates a new processor instance
func NewProcessor(files []reader.File, nWorkers int, rankAlg Algorithm) Processor {
	return Processor{
		Files:         files,
		NWorkers:      nWorkers,
		RankAlgorithm: rankAlg,
	}
}

// Calculate calculates the rank for all the files hold by
// processor in comparison with a given sentence
func (p Processor) Calculate(sentence string) []RankResult {
	jobs := make(chan reader.File, len(p.Files))
	results := make(chan RankResult, len(p.Files))

	// create workers
	var wg sync.WaitGroup
	for i := 0; i < p.NWorkers; i++ {
		wg.Add(1)
		go p.worker(jobs, results, sentence, &wg)
	}

	// add jobs to the channel
	for _, file := range p.Files {
		jobs <- file
	}
	close(jobs)

	// wait for all workers to finish
	wg.Wait()

	// process the results
	close(results)

	return toSlice(results)
}

// worker performs the rank calculation for a given file
func (p Processor) worker(jobs <-chan reader.File, results chan<- RankResult, sentence string, wg *sync.WaitGroup) {
	defer wg.Done()

	for file := range jobs {
		results <- RankResult{
			File:  file,
			Score: p.RankAlgorithm.Calculate(file.Content, sentence),
		}
	}
}

// toSlice returns a slice with all the elements
// in the channel
func toSlice(c <-chan RankResult) []RankResult {
	var s []RankResult

	for r := range c {
		s = append(s, r)
	}

	return s
}


text:
using System;

namespace Exceptionless.Core.Queues.Models {
    public class SummaryNotification {
        public string Id { get; set; }
        public DateTime UtcStartTime { get; set; }
        public DateTime UtcEndTime { get; set; }
    }
}


text:
namespace blink {

TEST(ManifestUtilTest, DisplayModeConversions) {
  struct ReversibleConversion {
    blink::mojom::DisplayMode display_mode;
    std::string lowercase_display_mode_string;
  } reversible_conversions[] = {
      {blink::mojom::DisplayMode::kUndefined, ""},
      {blink::mojom::DisplayMode::kBrowser, "browser"},
      {blink::mojom::DisplayMode::kMinimalUi, "minimal-ui"},
      {blink::mojom::DisplayMode::kStandalone, "standalone"},
      {blink::mojom::DisplayMode::kFullscreen, "fullscreen"},
  };

  for (const ReversibleConversion& conversion : reversible_conversions) {
    EXPECT_EQ(conversion.display_mode,
              DisplayModeFromString(conversion.lowercase_display_mode_string));
    EXPECT_EQ(conversion.lowercase_display_mode_string,
              DisplayModeToString(conversion.display_mode));
  }

  // DisplayModeFromString() should work with non-lowercase strings.
  EXPECT_EQ(blink::mojom::DisplayMode::kFullscreen,
            DisplayModeFromString("Fullscreen"));

  // DisplayModeFromString() should return
  // DisplayMode::kUndefined if the string isn't known.
  EXPECT_EQ(blink::mojom::DisplayMode::kUndefined,
            DisplayModeFromString("random"));
}

TEST(ManifestUtilTest, WebScreenOrientationLockTypeConversions) {
  struct ReversibleConversion {
    blink::WebScreenOrientationLockType orientation;
    std::string lowercase_orientation_string;
  } reversible_conversions[] = {
      {blink::kWebScreenOrientationLockDefault, ""},
      {blink::kWebScreenOrientationLockPortraitPrimary, "portrait-primary"},
      {blink::kWebScreenOrientationLockPortraitSecondary, "portrait-secondary"},
      {blink::kWebScreenOrientationLockLandscapePrimary, "landscape-primary"},
      {blink::kWebScreenOrientationLockLandscapeSecondary,
       "landscape-secondary"},
      {blink::kWebScreenOrientationLockAny, "any"},
      {blink::kWebScreenOrientationLockLandscape, "landscape"},
      {blink::kWebScreenOrientationLockPortrait, "portrait"},
      {blink::kWebScreenOrientationLockNatural, "natural"},
  };

  for (const ReversibleConversion& conversion : reversible_conversions) {
    EXPECT_EQ(conversion.orientation,
              WebScreenOrientationLockTypeFromString(
                  conversion.lowercase_orientation_string));
    EXPECT_EQ(conversion.lowercase_orientation_string,
              WebScreenOrientationLockTypeToString(conversion.orientation));
  }

  // WebScreenOrientationLockTypeFromString() should work with non-lowercase
  // strings.
  EXPECT_EQ(blink::kWebScreenOrientationLockNatural,
            WebScreenOrientationLockTypeFromString("Natural"));

  // WebScreenOrientationLockTypeFromString() should return
  // blink::WebScreenOrientationLockDefault if the string isn't known.
  EXPECT_EQ(blink::kWebScreenOrientationLockDefault,
            WebScreenOrientationLockTypeFromString("random"));
}

}  // namespace blink


text:
G_BEGIN_DECLS

// Helper functions for the tests. This is not included in the shell library.

// Helper function to convert a hexadecimal string (e.g. "01feab") into GBytes
GBytes* hex_string_to_bytes(const gchar* hex_string);

// Helper function to convert GBytes into a hexadecimal string (e.g. "01feab")
gchar* bytes_to_hex_string(GBytes* bytes);

// Creates a mock engine that responds to platform messages.
FlEngine* make_mock_engine();

// Creates a mock engine using a specified FlDartProject that responds to
// platform messages.
FlEngine* make_mock_engine_with_project(FlDartProject* project);

// GTest printer for FlValue.
void PrintTo(FlValue* v, std::ostream* os);

G_END_DECLS

#endif  // FLUTTER_SHELL_PLATFORM_LINUX_FL_TEST_H_


text: package deref


text:
package in.xnnyygn.algorithm.leetcode;

import java.util.Arrays;
import java.util.Comparator;

public class LongestCommonPrefix {
  public String longestCommonPrefix(String[] strs) {
    if (strs.length == 0) return "";
    Arrays.sort(strs, new Comparator<String>() {

      public int compare(String string0, String string1) {
        return string0.length() - string1.length();
      }

    });
    for (int i = 0; i < strs[0].length(); i++) {
      char c = strs[0].charAt(i);
      for (int j = 1; j < strs.length; j++) {
        if (strs[j].charAt(i) != c) {
          return strs[0].substring(0, i);
        }
      }
    }
    return strs[0];
  }
}


text:
package org.apache.ibatis.submitted.javassist;

import static org.junit.Assert.assertTrue;

import java.io.Reader;
import java.sql.Connection;

import javassist.util.proxy.Proxy;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

public class JavassistTest {

  private static SqlSessionFactory sqlSessionFactory;

  @BeforeClass
  public static void setUp() throws Exception {
    // create a SqlSessionFactory
    Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/javassist/mybatis-config.xml");
    sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
    reader.close();

    // populate in-memory database
    SqlSession session = sqlSessionFactory.openSession();
    Connection conn = session.getConnection();
    reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/javassist/CreateDB.sql");
    ScriptRunner runner = new ScriptRunner(conn);
    runner.setLogWriter(null);
    runner.runScript(reader);
    reader.close();
    session.close();
  }

  @Test
  public void shouldGetAUserAndGroups() {
    SqlSession sqlSession = sqlSessionFactory.openSession();
    try {
      Mapper mapper = sqlSession.getMapper(Mapper.class);
      User user = mapper.getUser(1);
      Assert.assertEquals("User1", user.getName());
      assertTrue(user instanceof Proxy);
      Assert.assertEquals(1, user.getGroups().size());
    } finally {
      sqlSession.close();
    }
  }

}