text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Net;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
using DSharpPlus.EventArgs;

namespace DSharpPlus.Net.WebSocket
{
    // weebsocket
    // not even sure whether emzi or I posted this. much love, naam.
    /// <summary>
    /// The default, native-based WebSocket client implementation.
    /// </summary>
    public class WebSocketClient : IWebSocketClient
    {
        private const int OutgoingChunkSize = 8192; // 8 KiB
        private const int IncomingChunkSize = 32768; // 32 KiB

        /// <inheritdoc />
        public IWebProxy Proxy { get; }

        /// <inheritdoc />
        public IReadOnlyDictionary<string, string> DefaultHeaders { get; }
        private Dictionary<string, string> _defaultHeaders;

        private Task _receiverTask;
        private CancellationTokenSource _receiverTokenSource;
        private CancellationToken _receiverToken;
        private readonly SemaphoreSlim _senderLock;

        private CancellationTokenSource _socketTokenSource;
        private CancellationToken _socketToken;
        private ClientWebSocket _ws;

        private volatile bool _isClientClose = false;
        private volatile bool _isConnected = false;
        private volatile bool _isDisposed = false;

        /// <summary>
        /// Instantiates a new WebSocket client with specified proxy settings.
        /// </summary>
        /// <param name="proxy">Proxy settings for the client.</param>
        private WebSocketClient(IWebProxy proxy)
        {
            this._connected = new AsyncEvent(this.EventErrorHandler, "WS_CONNECT");
            this._disconnected = new AsyncEvent<SocketCloseEventArgs>(this.EventErrorHandler, "WS_DISCONNECT");
            this._messageReceived = new AsyncEvent<SocketMessageEventArgs>(this.EventErrorHandler, "WS_MESSAGE");
            this._exceptionThrown = new AsyncEvent<SocketErrorEventArgs>(null, "WS_ERROR");

            this.Proxy = proxy;
            this._defaultHeaders = new Dictionary<string, string>();
            this.DefaultHeaders = new ReadOnlyDictionary<string, string>(this._defaultHeaders);

            this._receiverTokenSource = null;
            this._receiverToken = CancellationToken.None;
            this._senderLock = new SemaphoreSlim(1);

            this._socketTokenSource = null;
            this._socketToken = CancellationToken.None;
        }

        /// <inheritdoc />
        public async Task ConnectAsync(Uri uri)
        {
            // Disconnect first
            try { await this.DisconnectAsync().ConfigureAwait(false); } catch { }

            // Disallow sending messages
            await this._senderLock.WaitAsync().ConfigureAwait(false);

            try
            {
                // This can be null at this point
                this._receiverTokenSource?.Dispose();
                this._socketTokenSource?.Dispose();

                this._ws?.Dispose();
                this._ws = new ClientWebSocket();
                this._ws.Options.Proxy = this.Proxy;
                this._ws.Options.KeepAliveInterval = TimeSpan.Zero;
                if (this._defaultHeaders != null)
                    foreach (var (k, v) in this._defaultHeaders)
                        this._ws.Options.SetRequestHeader(k, v);

                this._receiverTokenSource = new CancellationTokenSource();
                this._receiverToken = this._receiverTokenSource.Token;

                this._socketTokenSource = new CancellationTokenSource();
                this._socketToken = this._socketTokenSource.Token;

                this._isClientClose = false;
                this._isDisposed = false;
                await this._ws.ConnectAsync(uri, this._socketToken).ConfigureAwait(false);
                this._receiverTask = Task.Run(this.ReceiverLoopAsync, this._receiverToken);
            }
            finally
            {
                this._senderLock.Release();
            }
        }

        /// <inheritdoc />
        public async Task DisconnectAsync(int code = 1000, string message = "")
        {
            // Ensure that messages cannot be sent
            await this._senderLock.WaitAsync().ConfigureAwait(false);

            try
            {
                this._isClientClose = true;
                if (this._ws != null && (this._ws.State == WebSocketState.Open || this._ws.State == WebSocketState.CloseReceived))
                    await this._ws.CloseOutputAsync((WebSocketCloseStatus)code, message, CancellationToken.None).ConfigureAwait(false);

                if (this._receiverTask != null)
                    await this._receiverTask.ConfigureAwait(false); // Ensure that receiving completed

                if (this._isConnected)
                    this._isConnected = false;

                if (!this._isDisposed)
                {
                    // Cancel all running tasks
                    if (this._socketToken.CanBeCanceled)
                        this._socketTokenSource?.Cancel();
                    this._socketTokenSource?.Dispose();

                    if (this._receiverToken.CanBeCanceled)
                        this._receiverTokenSource?.Cancel();
                    this._receiverTokenSource?.Dispose();

                    this._isDisposed = true;
                }
            }
            catch { }
            finally
            {
                this._senderLock.Release();
            }
        }

        /// <inheritdoc />
        public async Task SendMessageAsync(string message)
        {
            if (this._ws == null)
                return;

            var bytes = Utilities.UTF8.GetBytes(message);
            await this._senderLock.WaitAsync().ConfigureAwait(false);
            try
            {
                var len = bytes.Length;
                var segCount = len / OutgoingChunkSize;
                if (len % OutgoingChunkSize != 0)
                    segCount++;

                for (var i = 0; i < segCount; i++)
                {
                    var segStart = OutgoingChunkSize * i;
                    var segLen = Math.Min(OutgoingChunkSize, len - segStart);

                    await this._ws.SendAsync(new ArraySegment<byte>(bytes, segStart, segLen), WebSocketMessageType.Text, i == segCount - 1, CancellationToken.None).ConfigureAwait(false);
                }
            }
            finally
            {
                this._senderLock.Release();
            }
        }

        /// <inheritdoc />
        public bool AddDefaultHeader(string name, string value)
        {
            this._defaultHeaders[name] = value;
            return true;
        }

        /// <inheritdoc />
        public bool RemoveDefaultHeader(string name)
            => this._defaultHeaders.Remove(name);

        /// <summary>
        /// Disposes of resources used by this WebSocket client instance.
        /// </summary>
        public void Dispose()
        {
            if (this._isDisposed)
                return;

            this._isDisposed = true;

            this.DisconnectAsync().ConfigureAwait(false).GetAwaiter().GetResult();

            this._receiverTokenSource?.Dispose();
            this._socketTokenSource?.Dispose();
        }

        internal async Task ReceiverLoopAsync()
        {
            await Task.Yield();

            var token = this._receiverToken;
            var buffer = new ArraySegment<byte>(new byte[IncomingChunkSize]);

            try
            {
                using (var bs = new MemoryStream())
                {
                    while (!token.IsCancellationRequested)
                    {
                        // See https://github.com/RogueException/Discord.Net/commit/ac389f5f6823e3a720aedd81b7805adbdd78b66d
                        // for explanation on the cancellation token

                        WebSocketReceiveResult result;
                        byte[] resultBytes;
                        do
                        {
                            result = await this._ws.ReceiveAsync(buffer, CancellationToken.None).ConfigureAwait(false);

                            if (result.MessageType == WebSocketMessageType.Close)
                                break;

                            bs.Write(buffer.Array, 0, result.Count);
                        }
                        while (!result.EndOfMessage);

                        resultBytes = new byte[bs.Length];
                        bs.Position = 0;
                        bs.Read(resultBytes, 0, resultBytes.Length);
                        bs.Position = 0;
                        bs.SetLength(0);

                        if (!this._isConnected)
                        {
                            this._isConnected = true;
                            await this._connected.InvokeAsync().ConfigureAwait(false);
                        }

                        if (result.MessageType == WebSocketMessageType.Binary)
                        {
                            await this._messageReceived.InvokeAsync(new SocketBinaryMessageEventArgs(resultBytes)).ConfigureAwait(false);
                        }
                        else if (result.MessageType == WebSocketMessageType.Text)
                        {
                            await this._messageReceived.InvokeAsync(new SocketTextMessageEventArgs(Utilities.UTF8.GetString(resultBytes))).ConfigureAwait(false);
                        }
                        else // close
                        {
                            if (!this._isClientClose)
                            {
                                var code = result.CloseStatus.Value;
                                code = code == WebSocketCloseStatus.NormalClosure || code == WebSocketCloseStatus.EndpointUnavailable
                                    ? (WebSocketCloseStatus)4000
                                    : code;

                                await this._ws.CloseOutputAsync(code, result.CloseStatusDescription, CancellationToken.None).ConfigureAwait(false);
                            }

                            await this._disconnected.InvokeAsync(new SocketCloseEventArgs(null) { CloseCode = (int)result.CloseStatus, CloseMessage = result.CloseStatusDescription }).ConfigureAwait(false);
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                await this._exceptionThrown.InvokeAsync(new SocketErrorEventArgs(null) { Exception = ex }).ConfigureAwait(false);
                await this._disconnected.InvokeAsync(new SocketCloseEventArgs(null) { CloseCode = -1, CloseMessage = "" }).ConfigureAwait(false);
            }

            // Don't await or you deadlock
            // DisconnectAsync waits for this method
            _ = this.DisconnectAsync().ConfigureAwait(false);
        }

        /// <summary>
        /// Creates a new instance of <see cref="WebSocketClient"/>.
        /// </summary>
        /// <param name="proxy">Proxy to use for this client instance.</param>
        /// <returns>An instance of <see cref="WebSocketClient"/>.</returns>
        public static IWebSocketClient CreateNew(IWebProxy proxy)
            => new WebSocketClient(proxy);

        #region Events
        /// <summary>
        /// Triggered when the client connects successfully.
        /// </summary>
        public event AsyncEventHandler Connected
        {
            add => this._connected.Register(value);
            remove => this._connected.Unregister(value);
        }
        private AsyncEvent _connected;

        /// <summary>
        /// Triggered when the client is disconnected.
        /// </summary>
        public event AsyncEventHandler<SocketCloseEventArgs> Disconnected
        {
            add => this._disconnected.Register(value);
            remove => this._disconnected.Unregister(value);
        }
        private AsyncEvent<SocketCloseEventArgs> _disconnected;

        /// <summary>
        /// Triggered when the client receives a message from the remote party.
        /// </summary>
        public event AsyncEventHandler<SocketMessageEventArgs> MessageReceived
        {
            add => this._messageReceived.Register(value);
            remove => this._messageReceived.Unregister(value);
        }
        private AsyncEvent<SocketMessageEventArgs> _messageReceived;

        /// <summary>
        /// Triggered when an error occurs in the client.
        /// </summary>
        public event AsyncEventHandler<SocketErrorEventArgs> ExceptionThrown
        {
            add => this._exceptionThrown.Register(value);
            remove => this._exceptionThrown.Unregister(value);
        }
        private AsyncEvent<SocketErrorEventArgs> _exceptionThrown;

        private void EventErrorHandler(string evname, Exception ex)
        {
            if (evname.ToLowerInvariant() == "ws_error")
                Console.WriteLine($"WSERROR: {ex.GetType()} in {evname}!");
            else
                this._exceptionThrown.InvokeAsync(new SocketErrorEventArgs(null) { Exception = ex }).ConfigureAwait(false).GetAwaiter().GetResult();
        }
        #endregion
    }
}


text:
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http.Filters;

namespace WebHost2.Filters
{
    public class BasicAuthenticationAttribute : Attribute, IAuthenticationFilter
    {
        public bool AllowMultiple
        {
            get
            {
                return false;
            }
        }

        public Task AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken)
        {
            throw new NotImplementedException();
        }

        public Task ChallengeAsync(HttpAuthenticationChallengeContext context, CancellationToken cancellationToken)
        {
            this.Challenge(context);
            return Task.FromResult(0);
        }

        private void Challenge(HttpAuthenticationChallengeContext context)
        {
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace ExampleApp
{
    namespace MyPins
    {
        namespace SdkModel
        {
            class MyPinVisibilityStateChangedHandler : public WorldPins::SdkModel::IWorldPinVisibilityStateChangedHandler
            {
            private:
                MyPinModel& m_myPinModel;
                MyPins::SdkModel::IMyPinBoundObjectRepository& m_myPinBoundObjectRepository;

            public:
                MyPinVisibilityStateChangedHandler(MyPinModel& myPinModel,
                                                   MyPins::SdkModel::IMyPinBoundObjectRepository& myPinBoundObjectRepository);

                ~MyPinVisibilityStateChangedHandler();

                void HandlePinBecameFullyVisible();

                void HandlePinBecameFullyInvisible();
            };
        }
    }
}


text:
using System.Collections.Generic;
using System.Linq;
using WinBlocks.Game.BlockSelection;
using WinBlocks.Game.Input;
using WinBlocks.Game.Model;
using WinBlocks.Game.Rendering;

namespace WinBlocks.Game
{
    public class Tetris
    {
        public List<IPostProcessContent> PostProcessors => _renderer.PostProcessors;

        private Tetrimino _current;
        private readonly ISelectBlocks _selector;
        private readonly TetrisTextRenderer _renderer;
        private readonly TetrisGrid _board;

        public Tetris(ISelectBlocks selector, List<string> gridRows = null, Tetrimino active = null)
        {
            _selector = selector;
            _renderer = new TetrisTextRenderer();
            _board = gridRows == null ? new TetrisGrid(10, 22) : new TetrisGrid(gridRows);
            _current = active;
        }

        public override string ToString()
        {
            return _renderer.Render(_board, _current).Trim();
        }

        public void Step()
        {
            if (_current == null)
            {
                _current = _selector.Random();
                return;
            }

            if (!CanMoveInto(_current, new Delta { Y = +1 }))
            {
                Lock();
                ClearAnyCompleteLines();
                return;
            }

            Move(Direction.Down);
        }

        private void Lock()
        {
            _current.BlockLocations.ForEach(loc => _board.SetValue(loc.X, loc.Y, loc));
            _current = null;
        }

        private void ClearAnyCompleteLines()
        {
            var rowsToClear = new List<int>();

            for (var y = _board.RawRows.Count - 1; y >= 0; y--)
            {
                var row = _board.RawRows[y];
                if (row.Any(x => x.Content == "."))
                {
                    continue;
                }

                rowsToClear.Add(y);
            }

            rowsToClear.ForEach(c => _board.RawRows.RemoveAt(c));
            rowsToClear.ForEach(c => _board.RawRows.Insert(0, _board.CreateRow()));
        }

        public void Move(Direction direction)
        {
            if (_current == null)
            {
                return;
            }

            if (!CanMoveInto(_current, direction.ToDelta()))
            {
                return;
            }

            var target = _current.BoundingBoxLocation.From(direction.ToDelta());
            _current.ShiftTo(target.X, target.Y);
        }

        public void Rotate(Direction direction)
        {
            _current?.Rotate(direction);
        }

        private bool CanMoveInto(Tetrimino t, Delta delta)
        {
            return t.BlockLocations.All(loc =>
            {
                var location = loc.From(delta);
                return _board.IsOccupied(location.X, location.Y);
            });
        }
    }
}


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

<TITLE>
Overview List (Search Engine Wrapper)
</TITLE>

<META NAME="date" CONTENT="2013-06-18">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

All Classes

Packages

sg.yeefan.searchenginewrapper

sg.yeefan.searchenginewrapper.clients


text:
/* Generated By:JJTree: Do not edit this line. Node.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=true,VISITOR=false,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
/*
 * © Copyright FOCONIS AG, 2014
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package org.openntf.formula.ast;

import org.openntf.formula.ASTNode;
import org.openntf.formula.FormulaContext;
import org.openntf.formula.FormulaReturnException;
import org.openntf.formula.ValueHolder;

/* All AST nodes must implement this interface.  It provides basic
   machinery for constructing the parent and child relationships
   between nodes. */

public interface Node extends ASTNode {

	/**
	 * This method is called after the node has been made the current node. It indicates that child nodes can now be added to it.
	 */
	public void jjtOpen();

	public void jjtClose();

	/**
	 * set a new parent to the current node
	 *
	 */
	public void jjtSetParent(Node n);

	/**
	 * Return the parent of the current node
	 */
	public Node jjtGetParent();

	/**
	 * This method tells the node to add its argument to the node's list of children.
	 */
	public void jjtAddChild(Node n, int i);

	/**
	 * This method returns a child node. The children are numbered from zero, left to right.
	 */
	public Node jjtGetChild(int i);

	/** Return the number of children the node has. */
	public int jjtGetNumChildren();

	public abstract ValueHolder evaluate(FormulaContext ctx) throws FormulaReturnException;
}
/* JavaCC - OriginalChecksum=54dec3b6b2c592c5fbe2fc5be72328d2 (do not edit this line) */


text:
@interface ViewController ()

@property (nonatomic, strong) DummyClass* dummy;

@end

@implementation ViewController

-(instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super initWithCoder:aDecoder];
	if ( self ) {
		_dummy = [[DummyClass alloc] init];
	}

	return self;
}

-(void)viewDidAppear:(BOOL)animated
{
	[super viewDidAppear:animated];

	dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
		NSLog(@"After viewDidAppear");

		// Note after we pop back to this view controller the system will have dealloc'ed the
		// second view controller leaving our unsuspecting dummy class with a deallocated
		// delegate but not a nil reference since it was unsafe_unretained.
		//
		// So without using INTUWeakForwarder this next line would cause a crash.
		[self.dummy doLogMessage:@"viewDidAppear"];
	});
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
	SecondViewController* vc = [segue destinationViewController];

	// Instead of setting dummy's delegate directly to vc (the second view controller) we will set it to
	// the weak forwarder which will create a NSProxy object that will stick around as long as "dummy"
	// does but will automatically, due to a true weak reference, nil out the forwarded to object (vc here.)
	self.dummy.delegate = [INTUWeakForwarder forwardTo:vc associatedWith:self.dummy];

	dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
		NSLog(@"After prepareForSegue");
		[self.dummy doLogMessage:@"from prepareForSegue"];
	});
}

@end


text:
name "app_server"
description "Full IIS web and config"
run_list "recipe[application-server]"
override_attributes({

})


text:
package gang.com.screencontrol.util;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap.CompressFormat;
import android.util.Base64;
/**
 * Created by xiaogangzai on 2017/7/18.
 */

public class ImgHelper  {

    /**
     * TODO:将byte数组以Base64方式编码为字符串
     * @param bytes 待编码的byte数组
     * @return 编码后的字符串
     * */
   /* public static String encode(byte[] bytes){
        return new BASE64Encoder().encode(bytes);
    }*/

    /**
     * TODO:将以Base64方式编码的字符串解码为byte数组
     * @param encodeStr 待解码的字符串
     * @return 解码后的byte数组
     * @throws IOException
     * */
    public static byte[] decode(String encodeStr) throws IOException{
        byte[] bt = null;

        bt = Base64.decode(encodeStr, Base64.DEFAULT);;
        return bt;
    }

    /**
     * TODO:将两个byte数组连接起来后,返回连接后的Byte数组
     * @param front 拼接后在前面的数组
     * @param after 拼接后在后面的数组
     * @return 拼接后的数组
     * */
    public static byte[] connectBytes(byte[] front, byte[] after){
        byte[] result = new byte[front.length + after.length];
        System.arraycopy(front, 0, result, 0, after.length);
        System.arraycopy(after, 0, result, front.length, after.length);
        return result;
    }

    /**
     * TODO:将图片以Base64方式编码为字符串
     * @param imgUrl 图片的绝对路径(例如:D:\\jsontest\\abc.jpg)
     * @return 编码后的字符串
     * @throws IOException
     * */
    /*public static String encodeImage(String imgUrl) throws IOException{
        FileInputStream fis = new FileInputStream(imgUrl);
        byte[] rs = new byte[fis.available()];
        fis.read(rs);
        fis.close();
        return encode(rs);
    }*/

    /**
     * 将Bitmap转换成字符串
     * @param bitmap
     * @return
     */
    public static String bitmaptoString(Bitmap bitmap) {
        String string = null;
        ByteArrayOutputStream bStream = new ByteArrayOutputStream();
        bitmap.compress(CompressFormat.PNG, 100, bStream);
        byte[] bytes = bStream.toByteArray();
        string = Base64.encodeToString(bytes, Base64.DEFAULT);
        return string;
    }

    /**
     * 把byte数组转化成 bitmap对象
     * @param b
     * @return
     */
    public static Bitmap bytes2Bimap(byte[] b) {
        if (b.length != 0) {
            return BitmapFactory.decodeByteArray(b, 0, b.length);
        } else {
            return null;
        }
    }
}


text:
package org.apache.axis2.rmi.databind;

import org.apache.axis2.rmi.databind.dto.TestClass13;
import org.apache.axis2.rmi.databind.dto.TestRestrictionBean;
import org.apache.axis2.rmi.metadata.Parameter;

public class CustomTypeTest extends DataBindTest {

    public void testTestClass131() {

        TestClass13 testClass13 = new TestClass13();
        TestRestrictionBean testRestrictionBean = new TestRestrictionBean("test string");
        testClass13.setParam1(testRestrictionBean);

        Parameter parameter = new Parameter(TestClass13.class, "Param1");

        TestClass13 result = (TestClass13) getReturnObject(parameter, testClass13);
        assertEquals(result.getParam1().getParam1(), "test string");

    }

    public void testTestClass132() {

        TestClass13 testClass13 = new TestClass13();
        TestRestrictionBean[] testRestrictionBeans = new TestRestrictionBean[3];
        testRestrictionBeans[0] = new TestRestrictionBean("test string 1");
        testRestrictionBeans[1] = new TestRestrictionBean("test string 2");
        testRestrictionBeans[2] = new TestRestrictionBean("test string 3");
        testClass13.setParam2(testRestrictionBeans);

        Parameter parameter = new Parameter(TestClass13.class, "Param1");

        TestClass13 result = (TestClass13) getReturnObject(parameter, testClass13);
        assertEquals(result.getParam2()[0].getParam1(), "test string 1");
        assertEquals(result.getParam2()[1].getParam1(), "test string 2");
        assertEquals(result.getParam2()[2].getParam1(), "test string 3");

    }
}


text:
package com.hazelcast.quorum.lock;

import com.hazelcast.instance.HazelcastInstanceFactory;
import com.hazelcast.quorum.QuorumException;
import com.hazelcast.quorum.QuorumType;
import com.hazelcast.test.HazelcastSerialClassRunner;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.io.IOException;

@RunWith(HazelcastSerialClassRunner.class)
@Category(QuickTest.class)
public class LockReadQuorumTest extends AbstractLockQuorumTest {
    @BeforeClass
    public static void initialize() throws InterruptedException {
        initializeFiveMemberCluster(QuorumType.READ, 3);
        cluster.splitFiveMembersThreeAndTwo();
    }

    @AfterClass
    public static void killAllHazelcastInstances() throws IOException {
        HazelcastInstanceFactory.terminateAll();
    }

    @Test
    public void testMutationOkWhenQuorumSizeNotMet() throws Exception {
        l4.lock();
        l5.forceUnlock();

        l5.lock();
        l5.unlock();

        l4.tryLock();
        l4.unlock();

        testCondition(l4);
    }

    @Test(expected = QuorumException.class)
    public void testGetRemainingLeaseTimeFailsWhenQuorumSizeNotMet() throws Exception {
        l4.getRemainingLeaseTime();
    }

    @Test(expected = QuorumException.class)
    public void testIsLockedFailsWhenQuorumSizeNotMet() throws Exception {
        l4.isLocked();
    }

    @Test(expected = QuorumException.class)
    public void testIsLockedByCurrentThreadFailsWhenQuorumSizeNotMet() throws Exception {
        l4.isLockedByCurrentThread();
    }

    @Test(expected = QuorumException.class)
    public void testGetLockCountFailsWhenQuorumSizeNotMet() throws Exception {
        l5.getLockCount();
    }
}


text:
require "language/node"

class BashLanguageServer < Formula
  desc "A language server for Bash"
  homepage "https://github.com/bash-lsp/bash-language-server#readme"
  url "https://registry.npmjs.org/bash-language-server/-/bash-language-server-2.0.0.tgz"
  sha256 "6e00d79e9ae95586c567c3919ee81c6e82bb7ef106e4bfaf3c84d3a94dccb20e"
  license "MIT"

  livecheck do
    url :stable
  end

  depends_on "node"

  def install
    system "npm", "install", *Language::Node.std_npm_install_args(libexec)
    bin.install_symlink Dir["#{libexec}/bin/*"]
  end

  test do
    raise "Test not implemented."
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2015 Google Inc.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
        http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- [START gae_java8_twilio_config] -->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <runtime>java8</runtime>
  <threadsafe>true</threadsafe>
  <env-variables>
    <env-var name="TWILIO_ACCOUNT_SID" value="YOUR-TWILIO-ACCOUNT-SID" />
    <env-var name="TWILIO_AUTH_TOKEN" value="YOUR-TWILIO-AUTH-TOKEN" />
    <env-var name="TWILIO_NUMBER" value="YOUR-TWILIO-NUMBER" />
  </env-variables>
</appengine-web-app>
<!-- [END gae_java8_twilio_config] -->


text:
<!DOCTYPE html>

    <title>MVVM</title>
    <meta charset="utf-8">
    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">

        Back

            TabStrip

Select a tab

                        Paris

                        New York

                        London

                        Moscow

                        Sydney

17ºC

Rainy weather in Paris.

29ºC

Sunny weather in New York.

21ºC

Sunny weather in London.

16ºC

Cloudy weather in Moscow.

17ºC

Rainy weather in Sydney.

Console

            Configuration

                <input type="checkbox" data-bind="checked: isVisible">Visible

            Information
            Kendo UI TabStrip supports the
            events and
            visible bindings.


text:
package com.google.gwt.query.linker;

import com.google.gwt.core.ext.LinkerContext;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.TreeLogger.Type;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.linker.LinkerOrder;
import com.google.gwt.core.ext.linker.Shardable;
import com.google.gwt.core.linker.IFrameLinker;

/**
 * Adds doctype to the iframe used to load the application.
 * Without this code, IE8 does not enable document.querySelectorAll feature.
 */
@LinkerOrder(LinkerOrder.Order.PRIMARY)
@Shardable
public class IFrameWithDocTypeLinker extends IFrameLinker {

  private static final String DOCTYPE = "<!doctype html>\n";

  @Deprecated
  protected String getModulePrefix(TreeLogger logger, LinkerContext context,
      String strongName) throws UnableToCompleteException {
    logger
        .log(
            Type.WARN,
            "GQuery IFrameWithDocTypeLinker is deprecated, remove <add-linker name=\"stddoctype\"/> from your module file");
    return DOCTYPE + super.getModulePrefix(logger, context, strongName);
  }

  @Override
  @Deprecated
  protected String getModulePrefix(TreeLogger logger, LinkerContext context,
      String strongName, int numFragments) throws UnableToCompleteException {
    logger
        .log(
            Type.WARN,
            "GQuery IFrameWithDocTypeLinker is deprecated, remove <add-linker name=\"stddoctype\"/> from your module file");
    return DOCTYPE
        + super.getModulePrefix(logger, context, strongName, numFragments);
  }
}


text:
$('.responsive-slider').responsiveSlider({
    autoplay: true,
    interval: 3000,
    transitionTime: 300,
  });


text:
package tm.fantom.newsviewer;

import android.app.Application;

import tm.fantom.newsviewer.deps.AppComponent;
import tm.fantom.newsviewer.deps.DBModule;
import tm.fantom.newsviewer.deps.DaggerAppComponent;
import tm.fantom.newsviewer.deps.NetModule;

/**
 * Created by fantom on 22-May-17.
 */

public class AppController extends Application {

    private static AppComponent component;

    public static AppComponent getComponent() {
        return component;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        component = buildComponent();
    }

    protected AppComponent buildComponent() {
        return DaggerAppComponent.builder()
                .netModule(new NetModule(this))
                .dBModule(new DBModule(this))
                .build();
    }

}


text:
CREATE TABLE BB_AUTOCOMPLETE_PHRASES
(
    PHRASE_KEY VARCHAR(50) PRIMARY KEY NOT NULL,
    PHRASE_PATTERN VARCHAR(350) NOT NULL
);


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../includes/main.css" type="text/css">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<title>Apache CloudStack | The Power Behind Your Cloud</title>

									Apache CloudStack v4.7.0 Root Admin API Reference

listLoadBalancerRuleInstances

List all virtual machine instances that are assigned to a load balancer rule.

Request parameters

Parameter Name	Description	Required

id	the ID of the load balancer rule	true

applied	true if listing all virtual machines currently applied to the load balancer rule; default is true	false

keyword	List by keyword	false

lbvmips	true if load balancer rule VM IP information to be included; default is false	false

page		false

pagesize		false

Response Tags

Response Name	Description

lbvmipaddresses	IP addresses of the vm set of lb rule

loadbalancerruleinstance	the user vm set for lb rule

Copyright © 2015 The Apache Software Foundation, Licensed under the
                   Apache License, Version 2.0.

                Apache, CloudStack, Apache CloudStack, the Apache CloudStack logo, the CloudMonkey logo  and the Apache feather logo are trademarks of The Apache Software Foundation.


text:
package main.persistence.mongo.converters;

import main.domain.Phone;
import main.persistence.mongo.Converter;

public class PhoneConverter implements Converter<Phone, String>{

	public String to(Phone entity) {
		return entity.toString();
	}

	public Phone fromPersisted(String document) {
		return new Phone(document);
	}

}


text:
"""Errors

This module implements a set of standard HTTP Errors.
"""
import json

try:
    from html import escape
except ImportError:
    from cgi import escape  # Deprecated since version 3.2

try:
    from urllib.parse import urljoin as _urljoin
except ImportError:
    from urlparse import urljoin as _urljoin  # NOQA

from circuits import Event

from ..six import string_types
from .constants import SERVER_URL, SERVER_VERSION, POWERED_BY
from .constants import DEFAULT_ERROR_MESSAGE, HTTP_STATUS_CODES

class httperror(Event):

    """An event for signaling an HTTP error"""

    code = 500
    description = ""

    def __init__(self, request, response, code=None, **kwargs):
        """
        The constructor creates a new instance and modifies the *response*
        argument to reflect the error.
        """
        super(httperror, self).__init__(request, response, code, **kwargs)

        # Override HTTPError subclasses
        self.name = "httperror"

        self.request = request
        self.response = response

        if code is not None:
            self.code = code

        self.error = kwargs.get("error", None)

        self.description = kwargs.get(
            "description", getattr(self.__class__, "description", "")
        )

        if self.error is not None:
            self.traceback = "ERROR: (%s) %s\n%s" % (
                self.error[0], self.error[1], "".join(self.error[2])
            )
        else:
            self.traceback = ""

        self.response.close = True
        self.response.status = self.code

        powered_by = POWERED_BY % ({
            "url": SERVER_URL,
            "version": SERVER_VERSION
        }) if getattr(request.server, 'display_banner', False) else ""

        self.data = {
            "code": self.code,
            "name": HTTP_STATUS_CODES.get(self.code, "???"),
            "description": self.description,
            "traceback": escape(self.traceback),
            "powered_by": powered_by
        }

    def sanitize(self):
        if self.code != 201 and not (299 < self.code < 400):
            if "Location" in self.response.headers:
                del self.response.headers["Location"]

    def __str__(self):
        self.sanitize()

        if "json" in self.response.headers.get("Content-Type", ""):
            index = ["code", "name", "description"]
            if self.request.print_debug:
                index.append("traceback")
            return json.dumps(dict((key, self.data[key]) for key in index))

        if not self.request.print_debug:
            self.data["traceback"] = ''

        return DEFAULT_ERROR_MESSAGE % self.data

    def __repr__(self):
        return "<%s %d %s>" % (
            self.__class__.__name__, self.code, HTTP_STATUS_CODES.get(
                self.code, "???"
            )
        )

class forbidden(httperror):

    """An event for signaling the HTTP Forbidden error"""

    code = 403

class unauthorized(httperror):

    """An event for signaling the HTTP Unauthorized error"""

    code = 401

class notfound(httperror):

    """An event for signaling the HTTP Not Fouond error"""

    code = 404

class redirect(httperror):

    """An event for signaling the HTTP Redirect response"""

    def __init__(self, request, response, urls, code=None):
        """
        The constructor creates a new instance and modifies the
        *response* argument to reflect a redirect response to the
        given *url*.
        """

        if isinstance(urls, string_types):
            urls = [urls]

        abs_urls = []
        for url in urls:
            # Note that urljoin will "do the right thing" whether url is:
            #  1. a complete URL with host (e.g. "http://www.example.com/test")
            #  2. a URL relative to root (e.g. "/dummy")
            #  3. a URL relative to the current path
            # Note that any query string in request is discarded.
            url = request.uri.relative(url).unicode()
            abs_urls.append(url)
        self.urls = urls = abs_urls

        # RFC 2616 indicates a 301 response code fits our goal; however,
        # browser support for 301 is quite messy. Do 302/303 instead. See
        # http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html
        if code is None:
            if request.protocol >= (1, 1):
                code = 303
            else:
                code = 302
        else:
            if code < 300 or code > 399:
                raise ValueError("status code must be between 300 and 399.")

        super(redirect, self).__init__(request, response, code)

        if code in (300, 301, 302, 303, 307):
            response.headers["Content-Type"] = "text/html"
            # "The ... URI SHOULD be given by the Location field
            # in the response."
            response.headers["Location"] = urls[0]

            # "Unless the request method was HEAD, the entity of the response
            # SHOULD contain a short hypertext note with a hyperlink to the
            # new URI(s)."
            msg = {300: "This resource can be found at %s.",
                   301: ("This resource has permanently moved to "
                         "%s."),
                   302: ("This resource resides temporarily at "
                         "%s."),
                   303: ("This resource can be found at "
                         "%s."),
                   307: ("This resource has moved temporarily to "
                         "%s."),
                   }[code]
            response.body = "
\n".join([msg % (u, u) for u in urls])
            # Previous code may have set C-L, so we have to reset it
            # (allow finalize to set it).
            response.headers.pop("Content-Length", None)
        elif code == 304:
            # Not Modified.
            # "The response MUST include the following header fields:
            # Date, unless its omission is required by section 14.18.1"
            # The "Date" header should have been set in Response.__init__

            # "...the response SHOULD NOT include other entity-headers."
            for key in ("Allow", "Content-Encoding", "Content-Language",
                        "Content-Length", "Content-Location", "Content-MD5",
                        "Content-Range", "Content-Type", "Expires",
                        "Last-Modified"):
                if key in response.headers:
                    del response.headers[key]

            # "The 304 response MUST NOT contain a message-body."
            response.body = None
            # Previous code may have set C-L, so we have to reset it.
            response.headers.pop("Content-Length", None)
        elif code == 305:
            # Use Proxy.
            # urls[0] should be the URI of the proxy.
            response.headers["Location"] = urls[0]
            response.body = None
            # Previous code may have set C-L, so we have to reset it.
            response.headers.pop("Content-Length", None)
        else:
            raise ValueError("The %s status code is unknown." % code)

    def __repr__(self):
        if len(self.channels) > 1:
            channels = repr(self.channels)
        elif len(self.channels) == 1:
            channels = str(self.channels[0])
        else:
            channels = ""
        return "<%s %d[%s.%s] %s>" % (
            self.__class__.__name__, self.code, channels, self.name,
            " ".join(self.urls)
        )


text:
> Escape a string for use in AppleScript

According to the AppleScript [docs](https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-DontLinkElementID_57), `\` and `"` have special meaning and should be escaped.

## Install

```
$ npm install escape-string-applescript
```

## Usage

```js
import {execFile} from 'child_process';
import escapeStringAppleScript from 'escape-string-applescript';

const string = escapeStringAppleScript('"i like unicorns"');
//=> '\"i like unicorns\"'

const script = `set unicornMessage to "${string}"`;

execFile('osascript', ['-e', script]);
```

## Related

- [run-applescript](https://github.com/sindresorhus/run-applescript) - Run AppleScript and get the result


text:
<?xml version="1.0" encoding="UTF-8"?>
<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>com.gxmconsulting.fdamashup</groupId>
    <artifactId>etl</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.6</version>
        </dependency>
        <dependency>
        	<groupId>org.mongodb</groupId>
        	<artifactId>mongo-java-driver</artifactId>
        	<version>3.0.2</version>
        </dependency>

        <dependency>
        	<groupId>org.mongodb</groupId>
        	<artifactId>bson</artifactId>
        	<version>3.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>6.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
var Duplex = require('stream').Duplex;
var Writable = require('stream').Writable;
var encode = require('git-side-band-message');

module.exports = Service;

function Service (opts, backend) {
    this.info = opts.info;
    this.cmd = opts.cmd;
    this._bands = [];

    this.action = this.info ? 'info' : {
        'git-receive-pack': (opts.tag ? 'tag' : 'push'),
        'git-upload-pack': (opts.have ? 'pull' : 'clone')
    }[this.cmd];

    this.type = 'application/x-' + this.cmd + '-advertisement';
    this._backend = backend;

    this.fields = {};
    if (opts.name) this.fields.name = opts.name;
    if (opts.head) this.fields.head = opts.head;
    if (opts.last) this.fields.last = opts.last;
    if (opts.ref) this.fields.ref = opts.ref;

    if (this.action === 'tag') this.fields.tag = opts.name;
    else if (this.action === 'push') this.fields.branch = opts.name;

    this.args = [ '--stateless-rpc' ];
    if (this.info) this.args.push('--advertise-refs');
}

Service.prototype.createStream = function () {
    var self = this;
    var stream = new Duplex;
    var backend = this._backend;

    stream._write = function (buf, enc, next) {
        // dont send terminate signal
        if (buf.length !== 4 && buf.toString() !== '0000') backend.push(buf)
        else stream.needsPktFlush = true

        if (backend._ready) next()
        else stream._next = next;
    };

    stream._read = function () {
        var next = backend._next;
        var buf = backend._buffer;
        backend._next = null;
        backend._buffer = null;
        if (buf) stream.push(buf);
        if (next) next();
    };

    backend._stream = stream;
    if (backend._ready) stream._read();

    stream.on('finish', function f () {
        if (self._bands.length) {
            var s = self._bands.shift();
            s._write = function (buf, enc, next) {
                backend.push(encode(buf));
                next();
            };
            s.on('finish', f);

            var buf = s._buffer;
            var next = s._next;
            s._buffer = null;
            s._next = null;
            if (buf) backend.push(encode(buf));
            if (next) next();
        }
        else {
          if (stream.needsPktFlush) backend.push(new Buffer('0000'))
          backend.push(null)
        }
    });

    if (this.info) backend.push(infoPrelude(this.cmd));
    return stream;
};

Service.prototype.createBand = function () {
    var backend = this.backend;
    var stream = new Writable;
    stream._write = function (buf, enc, next) {
        stream._buffer = buf;
        stream._next = next;
    };
    this._bands.push(stream);
    return stream;
};

function infoPrelude (service) {
    function pack (s) {
        var n = (4 + s.length).toString(16);
        return Array(4 - n.length + 1).join('0') + n + s;
    }
    return pack('# service=' + service + '\n') + '0000';
}


text:
package java.lang.annotation;

public interface Annotation {
	public  boolean equals(Object o);
	public  int hashCode();
	public  String toString();
	public  Class annotationType();
}


text:
package com.amazonaws.services.signer.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.signer.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * SignatureValidityPeriodMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class SignatureValidityPeriodMarshaller {

    private static final MarshallingInfo<Integer> VALUE_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("value").build();
    private static final MarshallingInfo<String> TYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("type").build();

    private static final SignatureValidityPeriodMarshaller instance = new SignatureValidityPeriodMarshaller();

    public static SignatureValidityPeriodMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(SignatureValidityPeriod signatureValidityPeriod, ProtocolMarshaller protocolMarshaller) {

        if (signatureValidityPeriod == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(signatureValidityPeriod.getValue(), VALUE_BINDING);
            protocolMarshaller.marshall(signatureValidityPeriod.getType(), TYPE_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
#ifndef __PLAT_DEBUG_H__
#define __PLAT_DEBUG_H__
#include "cc_constants.h"
#include "debug.h"

typedef cc_int32_t (*ci_callback)(cc_int32_t argc, const char *argv[]);
typedef struct ci_cmd_block
{
    const char           *cmd;
    ci_callback          func;
    struct ci_cmd_block  *next;
} ci_cmd_block_t;

void debug_bind_keyword(const char *cmd, cc_int32_t *flag_ptr);
void bind_debug_func_keyword(const char *cmd, debug_callback func);
void bind_show_keyword(const char *cmd, show_callback func);
void bind_show_tech_keyword(const char *cmd, show_callback func,
                                    cc_boolean show_tech);
void bind_clear_keyword(const char *cmd, clear_callback func);
void ci_bind_cmd(const char *cmd, ci_callback func, ci_cmd_block_t *blk);

#endif


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/vision/v1/image_annotator.proto

package com.google.cloud.vision.v1;

public interface DominantColorsAnnotationOrBuilder extends
    // @@protoc_insertion_point(interface_extends:google.cloud.vision.v1.DominantColorsAnnotation)
    com.google.protobuf.MessageOrBuilder {

  /**
   *

   * RGB color values, with their score and pixel fraction.
   *

   *
   * repeated .google.cloud.vision.v1.ColorInfo colors = 1;
   */
  java.util.List<com.google.cloud.vision.v1.ColorInfo>
      getColorsList();
  /**
   *

   * RGB color values, with their score and pixel fraction.
   *

   *
   * repeated .google.cloud.vision.v1.ColorInfo colors = 1;
   */
  com.google.cloud.vision.v1.ColorInfo getColors(int index);
  /**
   *

   * RGB color values, with their score and pixel fraction.
   *

   *
   * repeated .google.cloud.vision.v1.ColorInfo colors = 1;
   */
  int getColorsCount();
  /**
   *

   * RGB color values, with their score and pixel fraction.
   *

   *
   * repeated .google.cloud.vision.v1.ColorInfo colors = 1;
   */
  java.util.List<? extends com.google.cloud.vision.v1.ColorInfoOrBuilder>
      getColorsOrBuilderList();
  /**
   *

   * RGB color values, with their score and pixel fraction.
   *

   *
   * repeated .google.cloud.vision.v1.ColorInfo colors = 1;
   */
  com.google.cloud.vision.v1.ColorInfoOrBuilder getColorsOrBuilder(
      int index);
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Ann. Acad. Sci. fenn. , Ser. A 15: 153 (1921)

#### Original name
Semigyalecta paradoxa Vain.

### Remarks
null


text:
/**
 * Interface to the database which is able to hold information about clients
 * registered to the system. The information include customer's: name, address, email and password.
 */

// bridge pattern

public interface CustomerDatabase {

    /**
     * Add customer to the database.
     * @param name customer's name
     * @param address customer's address
     * @param email customer's email address
     * @param passwd customer's password
     */
    public void addCustomer(String name, String address, String email, String passwd);

    /**
     * Remove customer based on their unique email address.
     * @param email customer's email address
     */
    public void removeCustomer(String email);

    /**
     * Check whether the customer exists in the database.
     * @param email customer's emails address
     * @return
     */
    public boolean customerExists(String email);

    /**
     * Check whether the customer's password match to their email address.
     * @param email customer's email address
     * @param passwd customer's password
     * @return true if matches, false otherwise
     */
    public boolean customerPasswdCorrect(String email, String passwd);

    /**
     * Find customer in the database. Match is performed based on customer's email.
     * @param email customer's email address
     * @return Customer object if found, null otherwise
     */
    public Customer findCustomer(String email);

    /**
     * Modify customer's properties.
     * @param email customer's email address
     * @param newName customer's new name
     * @param newAddress customer's new address
     * @param newPassword customer's new password
     */
    public void editCustomer(String email, String newName, String newAddress, String newPassword);

    /**
     * Retrieve the customer's password.
     * @param email customer's email address
     * @return customer's password as string if success, null otherwise
     */
    String getCustomerPassword(String email);
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>average (Array)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

# File lib/array_extensions.rb, line 6
  def average
    self.sum.to_f / self.size
  end


text:
    𝓿𝓲𝓶 -𝓫𝓾𝓯𝓯𝓮𝓽

  Brings you the IDE-like tabs into Vim, for easy navigation, and a nice, customizable look

  Installation •
  Usage •
  Recommendations •
  FAQ •
  Credits •
  License

**Note:** This plugin has been renamed from `vim-workspace` and thus has also
different prefix for the configuration and commands. Please revisit the README
and use the new names of the configuration parameters, highlight groups and
commands. Sorry for inconvenience.

## Introduction

Vim-buffet takes your buffers and tabs, and shows them combined in the
tabline. With this you always have your list of buffers visible, at the same
time not losing visibility into tabs. Moreover, `vim-buffet` provides handy
commands to boost navigation as well as a list of options to customize how the
tabline appears.

If you are new to the Vim world, then welcome, and start by learning Vim's
notions of [buffers, windows](http://vimdoc.sourceforge.net/htmldoc/windows.html)
and [tabpages](http://vimdoc.sourceforge.net/htmldoc/tabpage.html).

But if you are an experienced Vim user, you might have got tired of `bn/bp/ls/Ctrl-^`.

Take a look at the screenshot. The blue cuties are the tabpages. The tabpage
that has the buffers list coming next, is the current tabpage. The gray items
with names are the hidden/inactive buffers, and obviously, the green one is the
current buffer. The brighter items on both ends with the little arrows and numbers
are the truncation indicators. If all the buffers do not fit the screen,
`vim-buffet` truncates the tabline, and shows the number of truncated buffers on
both ends.

*__Note__: The instance of Vim in the screenshot is configured to use powerline
symbols and dev-icons. The default interface is only text and will work without
requiring any patched fonts. The default interface looks like in the screenshot
below.*

## Installation

Use your favourite plugin manager to install `vim-buffet`. If you do not have any
preference or have not decided yet, I would recommend [Plug](https://github.com/junegunn/vim-plug).

```vim
Plug 'bagrat/vim-buffet'
```

After installation, `vim-buffet` is enabled by default, so whenever you restart
Vim, you will see the new tabline!

## Usage
### Commands

Apart from listing the buffers in the tabline, `vim-buffet` also provides some
handy commands to manipulate the buffers:

* `Bw[!]` -  wipe the current buffer without closing the window. If is has unsaved
  changes, an error will be shown, and the buffer will stay open. To ignore any
  changes and forcibly wipe the buffer, use `Bw!`.
* `Bonly[!]` - wipe all the buffers but the current one. If there are any buffers
  in the list that has unsaved changes, those will not be wiped. To ignore any
  changes and forcibly wipe all buffers except the current one, use `Bonly!`.

### Mappings

Mappings for switching buffers are also provided. You just need to add the following
mappings to your Vimrc file:

```vim
nmap <leader>1 <Plug>BuffetSwitch(1)
nmap <leader>2 <Plug>BuffetSwitch(2)
nmap <leader>3 <Plug>BuffetSwitch(3)
nmap <leader>4 <Plug>BuffetSwitch(4)
nmap <leader>5 <Plug>BuffetSwitch(5)
nmap <leader>6 <Plug>BuffetSwitch(6)
nmap <leader>7 <Plug>BuffetSwitch(7)
nmap <leader>8 <Plug>BuffetSwitch(8)
nmap <leader>9 <Plug>BuffetSwitch(9)
nmap <leader>0 <Plug>BuffetSwitch(10)
```

This will allow you to switch between buffers 1 - 10. You can get more `<Plug>`
mappings, or disable it completely, by configuring the `g:buffet_max_plug` option.

### Configuration

There are some configuration options that make it possible to customize how the
tabline works and looks like.

#### 🔩 Options

| Options | Default | Descriptions |
| --- | --- | --- |
| `g:buffet_always_show_tabline` | `1` | Set to `0`, the tabline will only be shown if there is more than one buffer or tab open |
| `g:buffet_powerline_separators` | `0` | Set to `1`, use powerline separators in between buffers and tabs in the tabline (see the first screenshot) |
| `g:buffet_separator` | `''` | The character to be used for separating items in the tabline |
| `g:buffet_show_index` | `0` | Set to `1`, show index before each buffer name. Index is useful for switching between buffers quickly |
| `g:buffet_max_plug` | `10` | The maximum number of `<Plug>BuffetSwitch` provided. Mapping will be disabled if the option is set to `0` |
| `g:buffet_use_devicons` | `1` | If set to `1` and [`vim-devicons`](https://github.com/ryanoasis/vim-devicons) plugin is installed, show file type icons for each buffer in the tabline. If the `vim-devicons` plugin is not present, the option will automatically default to `0` (*Note: you need to have `vim-devicons` loaded before `vim-buffet` in order to make this work*) |
| `g:buffet_tab_icon` | `'#'` | The character to be used as an icon for the tab items in the tabline |
| `g:buffet_new_buffer_name` | `'*'` | The character to be shown as the name of a new buffer |
| `g:buffet_modified_icon` | `'+'` | The character to be shown by the name of a modified buffer |
| `g:buffet_left_trun_icon` | `'<'` | The character to be shown by the count of truncated buffers on the left |
| `g:buffet_right_trun_icon` | `'>'` | The character to be shown by the count of truncated buffers on the right |
| `g:buffet_hidden_buffers` | `['terminal', 'quickfix']` | The types of buffers to hide from the tabline (*Note: This has the side effect of making all matching buffers unlisted)* |

#### 🎨 Colors
Of course, you can customize the colors of your tabline, to make it awesome and
yours. To get your custom colors set, define a function with name
`g:BuffetSetCustomColors` and place your highlight group definitions inside
the function.

```vim
" Note: Make sure the function is defined before `vim-buffet` is loaded.
function! g:BuffetSetCustomColors()
  hi! BuffetCurrentBuffer cterm=NONE ctermbg=5 ctermfg=8 guibg=#00FF00 guifg=#000000
endfunction
```

The following is the list of highlight groups, with self-explanatory
names:

| Highlights | Descriptions |
| --- | --- |
| `BuffetCurrentBuffer`    |  The current buffer.
| `BuffetActiveBuffer`     |  An active buffer (a non-current buffer visible in a non-current window) |
| `BuffetBuffer`           |  A non-current and non-active buffer.
| `BuffetModCurrentBuffer` |  The current buffer when modified.
| `BuffetModActiveBuffer`  |  A modified active buffer (a non-current buffer visible in a non-current window). |
| `BuffetModBuffer`        |  A modified non-current and non-active buffer.
| `BuffetTrunc`            |  The truncation indicator (count of truncated buffers  from the left or right) |
| `BuffetTab`              |  A tab |

## Recommendations

Here are some recommended mappings to boost your navigation experience:

```vim
noremap <Tab> :bn<CR>
noremap <S-Tab> :bp<CR>
noremap <Leader><Tab> :Bw<CR>
noremap <Leader><S-Tab> :Bw!<CR>
noremap <C-t> :tabnew split<CR>
```

## FAQ
How do I get the look like in the screenshot?

First you will need a patched font, extended with `powerline` and `font-awesome`
symbols. Also, you will need the
[`vim-devicons`](https://github.com/ryanoasis/vim-devicons) installed, which
also has great guides on how to patch fonts, as well as some pre-patched fonts.
As soon as you have the patched font, setting the following options, will give
you exactly the same tabline as you see in the first demo screenshot:

```vim
let g:buffet_powerline_separators = 1
let g:buffet_tab_icon = "\uf00a"
let g:buffet_left_trunc_icon = "\uf0a8"
let g:buffet_right_trunc_icon = "\uf0a9"
```

*Note: you need to have `vim-devicons` loaded before `vim-buffet` in order to
make this work.*

How to have the current buffer open in a new tab instead of a new one?

Just add this mapping to your Vimrc:

```vim
map <C-t> :tab split<CR>
```

I can only see the current active buffer in the tabline

The reason is that you probably use some statusline plugin (e.g. lightline,
airline) that also has tabline support, which overrides vim-buffet. All you need
to do is disable the tabline of the statusline plugin.

#### For [lightline.vim](https://github.com/itchyny/lightline.vim)
It should be something like this:

```vim
let g:lightline.enable.tabline = 0
```

If that's not working, checkout this [issue](https://github.com/bagrat/vim-buffet/issues/20) especially this [comment](https://github.com/bagrat/vim-buffet/issues/20#issuecomment-706075930).

## Credits

The icon in the header is made by Freepik from www.flaticon.com

## License

See [LICENSE](https://github.com/bagrat/vim-buffet/blob/master/LICENS://github.com/bagrat/vim-buffet/blob/master/LICENSE).


text:
/*jshint node: true*/
/**
 * NOTE: Expected to be run only under nodejs.
 *
 * @module Bin:UserManager
 * @author kecso / https://github.com/kecso
 * @author ksmyth / https://github.com/ksmyth
 * @author lattmann / https://github.com/lattmann
 */

var webgme = require('../../webgme'),
    Q = require('q'),
    MongoURI = require('mongo-uri'),

    GMEAuth = require('../server/middleware/auth/gmeauth'),

    main,

    path = require('path'),
    gmeConfig = require(path.join(process.cwd(), 'config')),
    webgme = require('../../webgme');

webgme.addToRequireJsPaths(gmeConfig);

main = function (argv) {
    'use strict';
    var Command = require('commander').Command,
        program = new Command(), // we need a new program (Command) instance every time when main is called.
        auth,
        mainDeferred = Q.defer(),
        setupGMEAuth = function (databaseConnectionString, callback) {
            if (databaseConnectionString) {
                // this line throws a TypeError for invalid databaseConnectionString
                MongoURI.parse(databaseConnectionString);

                gmeConfig.mongo.uri = databaseConnectionString;
            }

            console.log(gmeConfig.mongo.uri);
            auth = new GMEAuth(null, gmeConfig);
            auth.connect(callback);
        },
        args = Array.prototype.slice.call(argv);

    if (args.length === 2) {
        args.push('--help');
    }

    program
        .version('0.1.0')
        .option('--db <database>', 'database connection string')
        .on('--help', function () {
            mainDeferred.resolve();
        });

    program
        .command('useradd <username> <email> <password>')
        .description('adds a new user')
        .option('-c, --canCreate', 'user can create a new project', false)
        .option('-s, --siteAdmin', 'user can create a new project', false)
        .action(function (username, email, password, options) {
            setupGMEAuth(options.parent.db, function (/*err*/) {
                // TODO: we may need to use a module like 'prompt' to get user password
                if (username && email && password) {
                    auth.addUser(username, email, password, options.canCreate || false,
                        {overwrite: true, siteAdmin: options.siteAdmin || false})
                            .then(mainDeferred.resolve)
                            .catch(mainDeferred.reject)
                            .finally(auth.unload);
                } else {
                    mainDeferred.reject(new SyntaxError('username, email, and password parameters are required'));
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js useradd brubble brubble@example.com Password.123');
            console.log('    $ node usermanager.js useradd --canCreate brubble brubble@example.com Password.123');
            console.log();
        });

    program
        .command('userlist [username]')
        .description('lists all users or the specified user')
        .action(function (username, options) {
            setupGMEAuth(options.parent.db, function (/*err*/) {
                if (username) {
                    auth.getUser(username)
                        .then(function (userObject) {
                            // TODO: pretty print users
                            console.log(userObject);
                            mainDeferred.resolve();
                        })
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                } else {
                    auth.listUsers(null)
                        .then(function (userObject) {
                            // TODO: pretty print users
                            console.log(userObject);
                            mainDeferred.resolve();
                        })
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js userlist');
            console.log('    $ node usermanager.js userlist user23');
            console.log();
        });

    program
        .command('passwd <username> <password>')
        .description('updates the user')
        .action(function (username, password, options) {
            setupGMEAuth(options.parent.db, function (/*err*/) {

                // TODO: we may need to use a module like 'prompt' to get user password
                if (username && password) {
                    auth.getAllUserAuthInfo(username)
                        .then(function (userObject) {
                            return auth.addUser(username,
                                userObject.email,
                                password,
                                userObject.canCreate,
                                {overwrite: true});
                        })
                        .then(mainDeferred.resolve)
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                } else {
                    mainDeferred.reject(new SyntaxError('username and password parameters are required'));
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js passwd brubble NewPass.123');
            console.log();
        });

    program
        .command('userdel <username>')
        .description('deletes a user')
        .action(function (username, options) {
            setupGMEAuth(options.parent.db, function (/*err*/) {

                if (username) {
                    auth.deleteUser(username)
                        .then(mainDeferred.resolve)
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                } else {
                    mainDeferred.reject(new SyntaxError('username parameter is missing'));
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js userdel brubble');
            console.log();
        });

    program
        .command('organizationadd <organizationname>')
        .description('adds a new organization')
        .action(function (organizationname, options) {

            setupGMEAuth(options.parent.db, function (/*err*/) {

                if (organizationname) {
                    auth.addOrganization(organizationname)
                        .then(mainDeferred.resolve)
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                } else {
                    mainDeferred.reject(new SyntaxError('organizationname parameter is missing'));
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js organizationadd neworg');
            console.log();
        });

    program
        .command('organizationdel <organizationname>')
        .description('deletes an existing organization')
        .action(function (organizationname, options) {

            setupGMEAuth(options.parent.db, function (/*err*/) {
                if (organizationname) {
                    auth.removeOrganizationByOrgId(organizationname)
                        .then(mainDeferred.resolve)
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                } else {
                    mainDeferred.reject(new SyntaxError('organizationname parameter is missing'));
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js organizationdel sample_organization');
            console.log();
        });

    var authUserOrGroup = function (id, projectname, options, fn) {
        var rights = {
            read: options.authorize.indexOf('r') !== -1,
            write: options.authorize.indexOf('w') !== -1,
            delete: options.authorize.indexOf('d') !== -1
        },
            type = 'create';

        setupGMEAuth(options.parent.db, function (/*err*/) {

            if (options.deauthorize) {
                // deauthorize
                rights = {};
                type = 'delete';
            }

            // authorize
            auth[fn].call(this, id, projectname, type, rights)
                .then(mainDeferred.resolve)
                .catch(mainDeferred.reject)
                .finally(auth.unload);
        });
    };

    program
        .command('usermod_auth <username> <projectname>')
        .description('authorizes a user for a project')
        .option('-a, --authorize <mode>', 'mode is rwd, read, write, delete', 'rwd')
        .option('-d, --deauthorize', 'deauthorizes user', false)
        .action(function (username, projectname, options) {
            if (username && projectname) {
                authUserOrGroup(username, projectname, options, 'authorizeByUserId');
            } else {
                mainDeferred.reject(new SyntaxError('username and projectname parameter are missing'));
            }
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js usermod_auth user23 project42');
            console.log('    $ node usermanager.js usermod_auth --authorize r user23 project42');
            console.log('    $ node usermanager.js usermod_auth --authorize rw user23 project42');
            console.log('    $ node usermanager.js usermod_auth -a rw user23 project42');
            console.log('    $ node usermanager.js usermod_auth --deauthorize user23 project42');
            console.log('    $ node usermanager.js usermod_auth -d user23 project42');
            console.log();
        });

    program
        .command('orgmod_auth <orgname> <projectname>')
        .description('authorizes an organization for a project')
        .option('-a, --authorize <mode>', 'mode is rwd, read, write, delete', 'rwd')
        .option('-d, --deauthorize', 'deauthorizes user', false)
        .action(function (orgname, projectname, options) {
            if (orgname && projectname) {
                authUserOrGroup(orgname, projectname, options, 'authorizeOrganization');
            } else {
                mainDeferred.reject(new SyntaxError('orgname and projectname parameter are missing'));
            }
        })
        .on('--help', function () {
            console.log('    Organizations are authorized like users are authorized. See also: usermod_auth');
        });

    program
        .command('usermod_organization_add <username> <organizationname>')
        .description('adds a user to an existing organization')
        .option('-m, --makeAdmin', 'make user admin', false)
        .action(function (username, organizationname, options) {
            setupGMEAuth(options.parent.db, function (/*err*/) {

                if (username && organizationname) {
                    auth.addUserToOrganization(username, organizationname)
                        .then(function () {
                            if (options.makeAdmin) {
                                return auth.setAdminForUserInOrganization(username, organizationname, true);
                            }
                        })
                        .then(mainDeferred.resolve)
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                } else {
                    mainDeferred.reject(new SyntaxError('username and organizationname parameter are missing'));
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js usermod_organization_add user23 organization123');
            console.log('    $ node usermanager.js usermod_organization_add --makeAdmin user23 organization123');
            console.log();
        });

    program
        .command('usermod_organization_del <username> <organizationname>')
        .description('removes a user from an existing organization')
        .action(function (username, organizationname, options) {
            setupGMEAuth(options.parent.db, function (/*err*/) {

                if (username && organizationname) {
                    auth.removeUserFromOrganization(username, organizationname)
                        .then(function () {
                            return auth.setAdminForUserInOrganization(username, organizationname, false);
                        })
                        .then(mainDeferred.resolve)
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                } else {
                    mainDeferred.reject(new SyntaxError('username and organizationname parameter are missing'));
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js usermod_organization_del user23 organization123');
            console.log();
        });

    program
        .command('organizationlist [organizationname]')
        .description('lists all organizations or the specified organization')
        .action(function (organizationname, options) {
            setupGMEAuth(options.parent.db, function (/*err*/) {
                if (organizationname) {
                    auth.getOrganization(organizationname)
                        .then(function (organObject) {
                            // TODO: pretty print organObject
                            console.log(organObject);
                            mainDeferred.resolve();
                        })
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                } else {
                    auth.listOrganizations(null)
                        .then(function (organObject) {
                            // TODO: pretty print organObject
                            console.log(organObject);
                            mainDeferred.resolve();
                        })
                        .catch(mainDeferred.reject)
                        .finally(auth.unload);
                }
            });
        })
        .on('--help', function () {
            console.log('  Examples:');
            console.log();
            console.log('    $ node usermanager.js organizationlist');
            console.log('    $ node usermanager.js organizationlist organ23');
            console.log();
        });

    program.parse(args);

    return mainDeferred.promise;
};

module.exports = {
    main: main
};

if (require.main === module) {

    main(process.argv)
        .then(function () {
            'use strict';
            console.log('Done');
        })
        .catch(function (err) {
            'use strict';
            console.error('ERROR : ' + err);
        });
}