text:
<html>
<body>

<form>
<select name="typeselect" rt:reference="true" multiple="true">
<option value="hoge">1</option>
<option value="moge">2</option>
<option value="doge">3</option>
</select>
</form>

<form>
<select name="typeselect" rt:reference="true" multiple>
<option value="hoge">1</option>
<option value="moge">2</option>
<option value="doge">3</option>
</select>
</form>

<form>
<select name="typeselect[]" rt:reference="true" multiple="true" >
<option value="hoge">1</option>
<option value="moge">2</option>
<option value="doge">3</option>
</select>
</form>

</body>
</html>


text:
#ifndef JUCER_COMMONHEADERS_H_INCLUDED
#define JUCER_COMMONHEADERS_H_INCLUDED

//==============================================================================
struct TargetOS
{
    enum OS
    {
        windows = 0,
        osx,
        linux,
        unknown
    };

    static OS getThisOS() noexcept
    {
       #if JUCE_WINDOWS
        return windows;
       #elif JUCE_MAC
        return osx;
       #elif JUCE_LINUX
        return linux;
       #else
        return unknown;
       #endif
    }
};

typedef TargetOS::OS DependencyPathOS;

//==============================================================================
#include "../Utility/jucer_StoredSettings.h"
#include "../Utility/jucer_Icons.h"
#include "../Utility/jucer_MiscUtilities.h"
#include "../Utility/jucer_CodeHelpers.h"
#include "../Utility/jucer_FileHelpers.h"
#include "../Utility/jucer_RelativePath.h"
#include "../Utility/jucer_ValueSourceHelpers.h"
#include "../Utility/jucer_PresetIDs.h"
#include "jucer_CommandIDs.h"

//==============================================================================
const char* const projectItemDragType   = "Project Items";
const char* const drawableItemDragType  = "Drawable Items";
const char* const componentItemDragType = "Components";

const char* const sourceFileExtensions          = "cpp;mm;m;c;cc;cxx;swift;s;asm";
const char* const headerFileExtensions          = "h;hpp;hxx;hh;inl";
const char* const cOrCppFileExtensions          = "cpp;cc;cxx;c";
const char* const cppFileExtensions             = "cpp;cc;cxx";
const char* const objCFileExtensions            = "mm;m";
const char* const asmFileExtensions             = "s;S;asm";
const char* const sourceOrHeaderFileExtensions  = "cpp;mm;m;c;cc;cxx;swift;s;S;asm;h;hpp;hxx;hh;inl";
const char* const fileTypesToCompileByDefault   = "cpp;mm;c;m;cc;cxx;swift;s;S;asm;r";

enum ColourIds
{
    mainBackgroundColourId          = 0x2340000,
};

#endif   // JUCER_COMMONHEADERS_H_INCLUDED

redpajama_set_name: RedPajamaGithub


text:
require 'stringio'
require 'psych/class_loader'
require 'psych/scalar_scanner'

module Psych
  module Nodes
    ###
    # The base class for any Node in a YAML parse tree.  This class should
    # never be instantiated.
    class Node
      include Enumerable

      # The children of this node
      attr_reader :children

      # An associated tag
      attr_reader :tag

      # Create a new Psych::Nodes::Node
      def initialize
        @children = []
      end

      ###
      # Iterate over each node in the tree. Yields each node to +block+ depth
      # first.
      def each &block
        return enum_for :each unless block_given?
        Visitors::DepthFirst.new(block).accept self
      end

      ###
      # Convert this node to Ruby.
      #
      # See also Psych::Visitors::ToRuby
      def to_ruby
        Visitors::ToRuby.create.accept(self)
      end
      alias :transform :to_ruby

      ###
      # Convert this node to YAML.
      #
      # See also Psych::Visitors::Emitter
      def yaml io = nil, options = {}
        real_io = io || StringIO.new(''.encode('utf-8'))

        Visitors::Emitter.new(real_io, options).accept self
        return real_io.string unless io
        io
      end
      alias :to_yaml :yaml
    end
  end
end


text:
{% extends "bootstrap/base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "bootstrap/fixes.html" as fixes %}

{% block title %}Inquire{% endblock %}

{% block content %}

Inquire

Question:

  {{ question }}

Answer

  {{ answer }}

{% endblock %}

{% block head %}
{{super()}}
{{fixes.ie8()}}
{% endblock %}


text:
"""
Copyright (c) 2016 Ryan Fan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
"""
import sys

from wxgigo.utils.misc import AttributeDict, get_current_user, prompt, prompt_yes_no

class DuplicateHostException(Exception):
    pass

class BaseHost(AttributeDict):
    """
    Host is a subclass of AttributeDict

    """
    def __init__(self):
        super(BaseHost, self).__init__()
        self.role_list = [self.role]
        self.hostname = 'localhost'
        self.port = '22'
        self.user = get_current_user()

    def prompts_input_config(self, cached_hosts):
        sys.stdout.write("\n")

        self.hostname = prompt("Please input %s's ip or hostname?" % self.role, default=self.hostname)

        # if we found this host has been defined before
        if self.hostname  in cached_hosts.keys():
            existed_host = cached_hosts[self.hostname]
            # For the same host role, it can only exist one host in inventory.hosts
            # e,g: existed host =
            #          host:  localhost
            #          role_list: ['agent', 'db']
            #  it should skip add the new host if new host =
            #          host = localhost
            #          role = 'agent'
            if self.role in existed_host.role_list:
                raise DuplicateHostException(
                    "Duplicate {}:[{}] found, skip it...".format(self.role, self.hostname)
                )
            else:
                # check if we need add another role for this already existed host
                answer = prompt_yes_no("Are you sure add additional role '{}' for '{}'?".format(self.role, self.hostname), default='yes')
                # only update if the answer is yes
                if answer is True:
                    self.role_list += existed_host.role_list
                    self.user = existed_host.user
                    self.port = existed_host.port
        else:
            self.user = prompt("Please input %s's SSH user" % self.role,  default=self.user)
            self.port = prompt("Please input %s's SSH port" % self.role, default=self.port, validate='[0-9].*')

class AgentHost(BaseHost):
    def __init__(self):
        self.role = HOST_ROLE.AGENT
        super(AgentHost, self).__init__()

class AppHost(BaseHost):
    def __init__(self):
        self.role = HOST_ROLE.APP
        super(AppHost, self).__init__()

class DBHost(BaseHost):
    def __init__(self):
        self.role = HOST_ROLE.DB
        super(DBHost, self).__init__()

class BrokerHost(BaseHost):
    def __init__(self):
        self.role =  HOST_ROLE.BROKER
        super(BrokerHost, self).__init__()

class HOST_ROLE:
    AGENT = "AGENT_HOST"
    APP = "APP_HOST"
    DB = "DB_HOST"
    BROKER = "BROKER_HOST"

# Available host arguments dict which will be displayed in
#  $ wxgigo-admin deploy -r
HOST_ROLE_ARGUMENTS = {
    "agent":     HOST_ROLE.AGENT,
    "app":       HOST_ROLE.APP,
    "db":        HOST_ROLE.DB,
    "broker":   HOST_ROLE.BROKER,
}

HOST_ROLE_CLASSES = {
    HOST_ROLE.AGENT: AgentHost,
    HOST_ROLE.APP: AppHost,
    HOST_ROLE.DB: DBHost,
    HOST_ROLE.BROKER: BrokerHost,
}


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// IPC messages for resource loading.

// Multiply-included message file, hence no include guard.
#include "base/shared_memory.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/resource_response.h"
#include "ipc/ipc_message_macros.h"
#include "net/base/upload_data.h"

#define IPC_MESSAGE_START ResourceMsgStart
#undef IPC_MESSAGE_EXPORT
#define IPC_MESSAGE_EXPORT CONTENT_EXPORT

IPC_STRUCT_TRAITS_BEGIN(content::ResourceResponseHead)
  IPC_STRUCT_TRAITS_PARENT(webkit_glue::ResourceResponseInfo)
  IPC_STRUCT_TRAITS_MEMBER(status)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(content::SyncLoadResult)
  IPC_STRUCT_TRAITS_PARENT(content::ResourceResponseHead)
  IPC_STRUCT_TRAITS_MEMBER(final_url)
  IPC_STRUCT_TRAITS_MEMBER(data)
IPC_STRUCT_TRAITS_END()

IPC_STRUCT_TRAITS_BEGIN(webkit_glue::ResourceResponseInfo)
  IPC_STRUCT_TRAITS_MEMBER(request_time)
  IPC_STRUCT_TRAITS_MEMBER(response_time)
  IPC_STRUCT_TRAITS_MEMBER(headers)
  IPC_STRUCT_TRAITS_MEMBER(mime_type)
  IPC_STRUCT_TRAITS_MEMBER(charset)
  IPC_STRUCT_TRAITS_MEMBER(security_info)
  IPC_STRUCT_TRAITS_MEMBER(content_length)
  IPC_STRUCT_TRAITS_MEMBER(encoded_data_length)
  IPC_STRUCT_TRAITS_MEMBER(appcache_id)
  IPC_STRUCT_TRAITS_MEMBER(appcache_manifest_url)
  IPC_STRUCT_TRAITS_MEMBER(connection_id)
  IPC_STRUCT_TRAITS_MEMBER(connection_reused)
  IPC_STRUCT_TRAITS_MEMBER(load_timing)
  IPC_STRUCT_TRAITS_MEMBER(devtools_info)
  IPC_STRUCT_TRAITS_MEMBER(download_file_path)
  IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_spdy)
  IPC_STRUCT_TRAITS_MEMBER(was_npn_negotiated)
  IPC_STRUCT_TRAITS_MEMBER(was_alternate_protocol_available)
  IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_proxy)
  IPC_STRUCT_TRAITS_MEMBER(npn_negotiated_protocol)
  IPC_STRUCT_TRAITS_MEMBER(socket_address)
IPC_STRUCT_TRAITS_END()

// Parameters for a resource request.
IPC_STRUCT_BEGIN(ResourceHostMsg_Request)
  // The request method: GET, POST, etc.
  IPC_STRUCT_MEMBER(std::string, method)

  // The requested URL.
  IPC_STRUCT_MEMBER(GURL, url)

  // Usually the URL of the document in the top-level window, which may be
  // checked by the third-party cookie blocking policy. Leaving it empty may
  // lead to undesired cookie blocking. Third-party cookie blocking can be
  // bypassed by setting first_party_for_cookies = url, but this should ideally
  // only be done if there really is no way to determine the correct value.
  IPC_STRUCT_MEMBER(GURL, first_party_for_cookies)

  // The referrer to use (may be empty).
  IPC_STRUCT_MEMBER(GURL, referrer)

  // The referrer policy to use.
  IPC_STRUCT_MEMBER(WebKit::WebReferrerPolicy, referrer_policy)

  // Additional HTTP request headers.
  IPC_STRUCT_MEMBER(std::string, headers)

  // net::URLRequest load flags (0 by default).
  IPC_STRUCT_MEMBER(int, load_flags)

  // Process ID from which this request originated, or zero if it originated
  // in the renderer itself.
  IPC_STRUCT_MEMBER(int, origin_pid)

  // What this resource load is for (main frame, sub-frame, sub-resource,
  // object).
  IPC_STRUCT_MEMBER(ResourceType::Type, resource_type)

  // Used by plugin->browser requests to get the correct net::URLRequestContext.
  IPC_STRUCT_MEMBER(uint32, request_context)

  // Indicates which frame (or worker context) the request is being loaded into,
  // or kNoHostId.
  IPC_STRUCT_MEMBER(int, appcache_host_id)

  // Optional upload data (may be null).
  IPC_STRUCT_MEMBER(scoped_refptr<net::UploadData>, upload_data)

  IPC_STRUCT_MEMBER(bool, download_to_file)

  // True if the request was user initiated.
  IPC_STRUCT_MEMBER(bool, has_user_gesture)

  // True if |frame_id| is the main frame of a RenderView.
  IPC_STRUCT_MEMBER(bool, is_main_frame)

  // Identifies the frame within the RenderView that sent the request.
  // -1 if unknown / invalid.
  IPC_STRUCT_MEMBER(int64, frame_id)

  // True if |parent_frame_id| is the main frame of a RenderView.
  IPC_STRUCT_MEMBER(bool, parent_is_main_frame)

  // Identifies the parent frame of the frame that sent the request.
  // -1 if unknown / invalid.
  IPC_STRUCT_MEMBER(int64, parent_frame_id)

  IPC_STRUCT_MEMBER(content::PageTransition, transition_type)

  // The following two members identify a previous request that has been
  // created before this navigation has been transferred to a new render view.
  // This serves the purpose of recycling the old request.
  // Unless this refers to a transferred navigation, these values are -1 and -1.
  IPC_STRUCT_MEMBER(int, transferred_request_child_id)
  IPC_STRUCT_MEMBER(int, transferred_request_request_id)

  // Whether or not we should allow the URL to download.
  IPC_STRUCT_MEMBER(bool, allow_download)
IPC_STRUCT_END()

// Resource messages sent from the browser to the renderer.

// Sent when the headers are available for a resource request.
IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedResponse,
                    int /* request_id */,
                    content::ResourceResponseHead)

// Sent when cached metadata from a resource request is ready.
IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedCachedMetadata,
                    int /* request_id */,
                    std::vector<char> /* data */)

// Sent as upload progress is being made.
IPC_MESSAGE_ROUTED3(ResourceMsg_UploadProgress,
                    int /* request_id */,
                    int64 /* position */,
                    int64 /* size */)

// Sent when the request has been redirected.  The receiver is expected to
// respond with either a FollowRedirect message (if the redirect is to be
// followed) or a CancelRequest message (if it should not be followed).
IPC_MESSAGE_ROUTED3(ResourceMsg_ReceivedRedirect,
                    int /* request_id */,
                    GURL /* new_url */,
                    content::ResourceResponseHead)

// Sent when some data from a resource request is ready. The handle should
// already be mapped into the process that receives this message.
IPC_MESSAGE_ROUTED4(ResourceMsg_DataReceived,
                    int /* request_id */,
                    base::SharedMemoryHandle /* data */,
                    int /* data_len */,
                    int /* encoded_data_length */)

// Sent when some data from a resource request has been downloaded to
// file. This is only called in the 'download_to_file' case and replaces
// ResourceMsg_DataReceived in the call sequence in that case.
IPC_MESSAGE_ROUTED2(ResourceMsg_DataDownloaded,
                    int /* request_id */,
                    int /* data_len */)

// Sent when the request has been completed.
IPC_MESSAGE_ROUTED4(ResourceMsg_RequestComplete,
                    int /* request_id */,
                    net::URLRequestStatus /* status */,
                    std::string /* security info */,
                    base::TimeTicks /* completion_time */)

// Resource messages sent from the renderer to the browser.

// Makes a resource request via the browser.
IPC_MESSAGE_ROUTED2(ResourceHostMsg_RequestResource,
                    int /* request_id */,
                    ResourceHostMsg_Request)

// Cancels a resource request with the ID given as the parameter.
IPC_MESSAGE_ROUTED1(ResourceHostMsg_CancelRequest,
                    int /* request_id */)

// Sets a new routing id for the resource request with the ID given as the
// parameter. This happens when a pending request is transferred to another
// page.
IPC_MESSAGE_CONTROL2(ResourceHostMsg_TransferRequestToNewPage,
                     int /* new routing_id */,
                     int /* request_id */)

// Follows a redirect that occured for the resource request with the ID given
// as the parameter.
IPC_MESSAGE_ROUTED3(ResourceHostMsg_FollowRedirect,
                    int /* request_id */,
                    bool /* has_new_first_party_for_cookies */,
                    GURL /* new_first_party_for_cookies */)

// Makes a synchronous resource request via the browser.
IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad,
                           int /* request_id */,
                           ResourceHostMsg_Request,
                           content::SyncLoadResult)

// Sent when the renderer process is done processing a DataReceived
// message.
IPC_MESSAGE_ROUTED1(ResourceHostMsg_DataReceived_ACK,
                    int /* request_id */)

// Sent when the renderer has processed a DataDownloaded message.
IPC_MESSAGE_ROUTED1(ResourceHostMsg_DataDownloaded_ACK,
                    int /* request_id */)

// Sent by the renderer process to acknowledge receipt of a
// UploadProgress message.
IPC_MESSAGE_ROUTED1(ResourceHostMsg_UploadProgress_ACK,
                    int /* request_id */)

// Sent when the renderer process deletes a resource loader.
IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile,
                     int /* request_id */)


text:
package com.manage.base.act.vars;

import com.manage.base.database.enums.ActProcess;

import java.io.Serializable;

/**
 * Created by bert on 2017/10/8.
 */
public class ActApproveObj implements Serializable {

    private static final long serialVersionUID = 5605220837822865457L;

    private String userId;
    private ActProcess process;
    private String comment;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public ActProcess getProcess() {
        return process;
    }

    public void setProcess(ActProcess process) {
        this.process = process;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }
}


text:
colorful output and display call stack

## Example

```go
package main

import (
  log "github.com/rebill/stacklog"
)

func main() {
  log.Info("A walrus appears")
}
```

## Level logging
Log has six logging levels: Debug, Info, Warning, Error, Fatal and Panic.

```go
log.Debug("Useful debugging information.")
log.Debugf("Useful %s information.", "debugging")

log.Info("Something noteworthy happened!")
log.Infof("Something %s happened!", "noteworthy")

log.Warn("You should probably take a look at this.")
log.Warnf("You should probably take a look at %s.", "this")

log.Error("Something failed but I'm not quitting.")
log.Errorf("Something %s but I'm not quitting.", "failed")

// Calls os.Exit(1) after logging
log.Fatal("Bye.")
log.Fatal("%s Bye.", "Good")

// Calls panic() after logging
log.Panic("I'm bailing.")
log.Panicf("I'm %s.", "bailing")
```

You can set the logging level on a Logger, then it will only log entries with that severity or anything above it:

```go
// Will log anything that is info or above (warn, error, fatal, panic). Default.
log.SetLevel(log.InfoLevel)
```

It may be useful to set `log.Level = log.DebugLevel` in a debug or verbose environment if your application has that.

## Set output file path

```go
log.SetLogPath("/apps/logs/go/myapp", "application.log")
```

## Enable colorful output
```go
log.EnableColors()
```
Nicely color-coded in development (when a TTY is attached, otherwise just
plain text):

![Colored](http://o83oxyzd3.bkt.clouddn.com/stck_log.png)

## Output format
log format :
```
[datetime] [level] [message] [ip] [stack]
```
it will display call stack when log level above fatal and panic.

```
[2016/06/01 23:45:31] [info] [Something noteworthy happened!] [192.168.3.8] [main.go:11]
[2016/06/01 23:45:31] [warning] [You should probably take a look at this.] [192.168.3.8] [main.go:12]
[2016/06/01 23:45:31] [error] [Something failed but I'm not quitting.] [192.168.3.8] [/Users/rebill/GitHub/Demo/main.go:line 13 function main: log.Error("Something failed but I'm not quitting.")	/Users/rebill/Golang/GOROOT/src/runtime/proc.go:line 188 function main: main_main()	/Users/rebill/Golang/GOROOT/src/runtime/asm_amd64.s:line 1998 function goexit: BYTE	$0x90	// NOP	]
[2016/06/01 23:45:31] [fatal] [Bye.] [192.168.3.8] [/Users/rebill/GitHub/Demo/main.go:line 16 function main: log.Fatal("Bye.")	/Users/rebill/Golang/GOROOT/src/runtime/proc.go:line 188 function main: main_main()	/Users/rebill/Golang/GOROOT/src/runtime/asm_amd64.s:line 1998 function goexit: BYTE	$0x90	// NOP	]
```


text:
<?php

namespace Symfony\Component\Mime;

/**
 * @author Fabien Potencier <fabien@symfony.com>
 */
interface MimeTypesInterface extends MimeTypeGuesserInterface
{
    /**
     * Gets the extensions for the given MIME type in decreasing order of preference.
     *
     * @return string[]
     */
    public function getExtensions(string $mimeType): array;

    /**
     * Gets the MIME types for the given extension in decreasing order of preference.
     *
     * @return string[]
     */
    public function getMimeTypes(string $ext): array;
}


text:
using System;
using System.Linq;
using System.Net.Http;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.Azure.Graph.RBAC;

namespace Microsoft.Azure.Graph.RBAC
{
    public partial class GraphRbacManagementClient : ServiceClient<GraphRbacManagementClient>, IGraphRbacManagementClient
    {
        private string _apiVersion;

        /// <summary>
        /// Gets the API version.
        /// </summary>
        public string ApiVersion
        {
            get { return this._apiVersion; }
        }

        private Uri _baseUri;

        /// <summary>
        /// Gets the URI used as the base for all cloud service requests.
        /// </summary>
        public Uri BaseUri
        {
            get { return this._baseUri; }
        }

        private SubscriptionCloudCredentials _credentials;

        /// <summary>
        /// Gets subscription credentials which uniquely identify Microsoft
        /// Azure subscription. The subscription ID forms part of the URI for
        /// every service call.
        /// </summary>
        public SubscriptionCloudCredentials Credentials
        {
            get { return this._credentials; }
        }

        private int _longRunningOperationInitialTimeout;

        /// <summary>
        /// Gets or sets the initial timeout for Long Running Operations.
        /// </summary>
        public int LongRunningOperationInitialTimeout
        {
            get { return this._longRunningOperationInitialTimeout; }
            set { this._longRunningOperationInitialTimeout = value; }
        }

        private int _longRunningOperationRetryTimeout;

        /// <summary>
        /// Gets or sets the retry timeout for Long Running Operations.
        /// </summary>
        public int LongRunningOperationRetryTimeout
        {
            get { return this._longRunningOperationRetryTimeout; }
            set { this._longRunningOperationRetryTimeout = value; }
        }

        private string _tenantID;

        /// <summary>
        /// Gets or sets the tenant Id.
        /// </summary>
        public string TenantID
        {
            get { return this._tenantID; }
            set { this._tenantID = value; }
        }

        private IApplicationOperations _application;

        /// <summary>
        /// Operations for working with applications in Azure Active Directory
        /// Graph API.  (see
        /// http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx for
        /// more information)
        /// </summary>
        public virtual IApplicationOperations Application
        {
            get { return this._application; }
        }

        private IGroupOperations _group;

        /// <summary>
        /// Operations for working with Groups in Azure Active Directory Graph
        /// API.  (see
        /// http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx for
        /// more information)
        /// </summary>
        public virtual IGroupOperations Group
        {
            get { return this._group; }
        }

        private IObjectOperations _objects;

        /// <summary>
        /// Operations for working with Objects in Azure AD Graph API.  (see
        /// http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx for
        /// more information)
        /// </summary>
        public virtual IObjectOperations Objects
        {
            get { return this._objects; }
        }

        private IServicePrincipalOperations _servicePrincipal;

        /// <summary>
        /// Operations for working with service principal in Azure Active
        /// Directory Graph API.  (see
        /// http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx for
        /// more information)
        /// </summary>
        public virtual IServicePrincipalOperations ServicePrincipal
        {
            get { return this._servicePrincipal; }
        }

        private IUserOperations _user;

        /// <summary>
        /// Operations for working with Users in Azure Active Directory Graph
        /// API.  (see
        /// http://msdn.microsoft.com/en-us/library/azure/hh974476.aspx for
        /// more information)
        /// </summary>
        public virtual IUserOperations User
        {
            get { return this._user; }
        }

        /// <summary>
        /// Initializes a new instance of the GraphRbacManagementClient class.
        /// </summary>
        public GraphRbacManagementClient()
            : base()
        {
            this._application = new ApplicationOperations(this);
            this._group = new GroupOperations(this);
            this._objects = new ObjectOperations(this);
            this._servicePrincipal = new ServicePrincipalOperations(this);
            this._user = new UserOperations(this);
            this._apiVersion = "1.6-internal";
            this._longRunningOperationInitialTimeout = -1;
            this._longRunningOperationRetryTimeout = -1;
            this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
        }

        /// <summary>
        /// Initializes a new instance of the GraphRbacManagementClient class.
        /// </summary>
        /// <param name='tenantID'>
        /// Required. Gets or sets the tenant Id.
        /// </param>
        /// <param name='credentials'>
        /// Required. Gets subscription credentials which uniquely identify
        /// Microsoft Azure subscription. The subscription ID forms part of
        /// the URI for every service call.
        /// </param>
        /// <param name='baseUri'>
        /// Optional. Gets the URI used as the base for all cloud service
        /// requests.
        /// </param>
        public GraphRbacManagementClient(string tenantID, SubscriptionCloudCredentials credentials, Uri baseUri)
            : this()
        {
            if (tenantID == null)
            {
                throw new ArgumentNullException("tenantID");
            }
            if (credentials == null)
            {
                throw new ArgumentNullException("credentials");
            }
            if (baseUri == null)
            {
                throw new ArgumentNullException("baseUri");
            }
            this._tenantID = tenantID;
            this._credentials = credentials;
            this._baseUri = baseUri;

            this.Credentials.InitializeServiceClient(this);
        }

        /// <summary>
        /// Initializes a new instance of the GraphRbacManagementClient class.
        /// </summary>
        /// <param name='tenantID'>
        /// Required. Gets or sets the tenant Id.
        /// </param>
        /// <param name='credentials'>
        /// Required. Gets subscription credentials which uniquely identify
        /// Microsoft Azure subscription. The subscription ID forms part of
        /// the URI for every service call.
        /// </param>
        public GraphRbacManagementClient(string tenantID, SubscriptionCloudCredentials credentials)
            : this()
        {
            if (tenantID == null)
            {
                throw new ArgumentNullException("tenantID");
            }
            if (credentials == null)
            {
                throw new ArgumentNullException("credentials");
            }
            this._tenantID = tenantID;
            this._credentials = credentials;
            this._baseUri = new Uri("https://graph.windows.net/");

            this.Credentials.InitializeServiceClient(this);
        }

        /// <summary>
        /// Initializes a new instance of the GraphRbacManagementClient class.
        /// </summary>
        /// <param name='httpClient'>
        /// The Http client
        /// </param>
        public GraphRbacManagementClient(HttpClient httpClient)
            : base(httpClient)
        {
            this._application = new ApplicationOperations(this);
            this._group = new GroupOperations(this);
            this._objects = new ObjectOperations(this);
            this._servicePrincipal = new ServicePrincipalOperations(this);
            this._user = new UserOperations(this);
            this._apiVersion = "1.6-internal";
            this._longRunningOperationInitialTimeout = -1;
            this._longRunningOperationRetryTimeout = -1;
            this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
        }

        /// <summary>
        /// Initializes a new instance of the GraphRbacManagementClient class.
        /// </summary>
        /// <param name='tenantID'>
        /// Required. Gets or sets the tenant Id.
        /// </param>
        /// <param name='credentials'>
        /// Required. Gets subscription credentials which uniquely identify
        /// Microsoft Azure subscription. The subscription ID forms part of
        /// the URI for every service call.
        /// </param>
        /// <param name='baseUri'>
        /// Optional. Gets the URI used as the base for all cloud service
        /// requests.
        /// </param>
        /// <param name='httpClient'>
        /// The Http client
        /// </param>
        public GraphRbacManagementClient(string tenantID, SubscriptionCloudCredentials credentials, Uri baseUri, HttpClient httpClient)
            : this(httpClient)
        {
            if (tenantID == null)
            {
                throw new ArgumentNullException("tenantID");
            }
            if (credentials == null)
            {
                throw new ArgumentNullException("credentials");
            }
            if (baseUri == null)
            {
                throw new ArgumentNullException("baseUri");
            }
            this._tenantID = tenantID;
            this._credentials = credentials;
            this._baseUri = baseUri;

            this.Credentials.InitializeServiceClient(this);
        }

        /// <summary>
        /// Initializes a new instance of the GraphRbacManagementClient class.
        /// </summary>
        /// <param name='tenantID'>
        /// Required. Gets or sets the tenant Id.
        /// </param>
        /// <param name='credentials'>
        /// Required. Gets subscription credentials which uniquely identify
        /// Microsoft Azure subscription. The subscription ID forms part of
        /// the URI for every service call.
        /// </param>
        /// <param name='httpClient'>
        /// The Http client
        /// </param>
        public GraphRbacManagementClient(string tenantID, SubscriptionCloudCredentials credentials, HttpClient httpClient)
            : this(httpClient)
        {
            if (tenantID == null)
            {
                throw new ArgumentNullException("tenantID");
            }
            if (credentials == null)
            {
                throw new ArgumentNullException("credentials");
            }
            this._tenantID = tenantID;
            this._credentials = credentials;
            this._baseUri = new Uri("https://graph.windows.net/");

            this.Credentials.InitializeServiceClient(this);
        }

        /// <summary>
        /// Clones properties from current instance to another
        /// GraphRbacManagementClient instance
        /// </summary>
        /// <param name='client'>
        /// Instance of GraphRbacManagementClient to clone to
        /// </param>
        protected override void Clone(ServiceClient<GraphRbacManagementClient> client)
        {
            base.Clone(client);

            if (client is GraphRbacManagementClient)
            {
                GraphRbacManagementClient clonedClient = ((GraphRbacManagementClient)client);

                clonedClient._tenantID = this._tenantID;
                clonedClient._credentials = this._credentials;
                clonedClient._baseUri = this._baseUri;
                clonedClient._apiVersion = this._apiVersion;
                clonedClient._longRunningOperationInitialTimeout = this._longRunningOperationInitialTimeout;
                clonedClient._longRunningOperationRetryTimeout = this._longRunningOperationRetryTimeout;

                clonedClient.Credentials.InitializeServiceClient(clonedClient);
            }
        }
    }
}


text:
<docs-demo :meta="meta" :snippet="snippet">

		state
			<select v-model="state">
				<option v-for="option in states" v-bind:value="option.value">
			    {{ option.text }}
			  </option>
			</select>

			<vs-form-textarea
		    :model.sync="model"
		    type="text"
		    label="Example Label"
		    description="Extra textarea description."
		    :rows="2"
		    :state="state">
			</vs-form-textarea>

</docs-demo>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Muller & Arx, Beitr. Kryptfl. Schweiz 11(no. 2): 433 (1962)

#### Original name
Melanostromella inaequalis Petr.

### Remarks
null


text:
package io.agrest.encoder.converter;

import java.time.LocalDateTime;

import static io.agrest.encoder.DateTimeFormatters.isoLocalDateTime;

public class ISOLocalDateTimeConverter extends AbstractConverter {

	private static final StringConverter instance = new ISOLocalDateTimeConverter();

	public static StringConverter converter() {
		return instance;
	}

	private ISOLocalDateTimeConverter() {
	}

	@Override
	protected String asStringNonNull(Object object) {
		LocalDateTime dateTime = (LocalDateTime) object;
		return isoLocalDateTime().format(dateTime);
	}
}


text:
package tests;

import org.junit.Test;

import app.models.Entity1;
import leap.core.annotation.Inject;
import leap.orm.OrmContext;
import leap.orm.mapping.EntityMapping;
import leap.orm.mapping.RelationMapping;
import leap.webunit.WebTestBase;

public class CrossDataSourceTest extends WebTestBase{

    private @Inject(name = "db1") OrmContext oc1;
    private @Inject(name = "db2") OrmContext oc2;

    @Test
    public void testManyToOne() {
        EntityMapping em = oc1.getMetadata().getEntityMapping(Entity1.class);

        RelationMapping rm = em.getRelationMappings()[0];
        assertEquals("Entity2", rm.getTargetEntityName());
        assertTrue(rm.isRemote());

        EntityMapping target = oc1.getMetadata().getEntityMapping(rm.getTargetEntityName());
        assertEquals(true, target.isRemote());
        assertNotEmpty(target.getRemoteSettings().getDataSource());
    }

}


text:
package org.objectpocket.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 *
 * Set custom fields to be used as ID.
 *
 * @author Edmund Klaus
 *
 */
@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Id {

}


text:
<?php

declare(strict_types=1);

namespace Biplane\YandexDirect\Api\V5\Contract;

/**
 * Auto-generated code.
 */
class KeywordFieldEnum
{
    public const ID = 'Id';

    public const KEYWORD = 'Keyword';

    public const STATE = 'State';

    public const STATUS = 'Status';

    public const AD_GROUP_ID = 'AdGroupId';

    public const CAMPAIGN_ID = 'CampaignId';

    public const BID = 'Bid';

    public const CONTEXT_BID = 'ContextBid';

    public const STRATEGY_PRIORITY = 'StrategyPriority';

    public const USER_PARAM1 = 'UserParam1';

    public const USER_PARAM2 = 'UserParam2';

    public const PRODUCTIVITY = 'Productivity';

    public const STATISTICS_SEARCH = 'StatisticsSearch';

    public const STATISTICS_NETWORK = 'StatisticsNetwork';

    public const SERVING_STATUS = 'ServingStatus';

    public const AUTOTARGETING_CATEGORIES = 'AutotargetingCategories';
}


text:
<?xml version="1.0" encoding="utf-8"?>
<IoTOnboarding>
    <AllJoynOnboarding>
        <Enabled value="true"/>
        <DefaultDescription value="IoTCore Onboarding service"/>
        <DefaultManufacturer value="Microsoft"/>
        <ModelNumber value="IoTCore Onboarding"/>
    </AllJoynOnboarding>
    <SoftAP>
        <Enabled value="true"/>
        <Password value="p@ssw0rd"/>
        <Ssid value="SoftAPSsid"/>
    </SoftAP>
</IoTOnboarding>


text:
class ChainEvent:
    def __init__(self, events):
        self._events = events

    def initialize(self):
        for event in self._events:
            event.initialize()

    def run(self, stop_time):
        for event in self._events:
            event.run(stop_time)

    def update(self, stop_time):
        for event in self._events:
            event.run(stop_time)

    def finalize(self):
        for event in self._events:
            event.finalize()


text:
[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror)
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
[![Join the chat at https://gitter.im/codemirror/CodeMirror](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/codemirror/CodeMirror)
[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?again)](https://marijnhaverbeke.nl/fund/)

CodeMirror is a versatile text editor implemented in JavaScript for
the browser. It is specialized for editing code, and comes with over
100 language modes and various addons that implement more advanced
editing functionality.

A rich programming API and a CSS theming system are available for
customizing CodeMirror to fit your application, and extending it with
new functionality.

You can find more information (and the
[manual](http://codemirror.net/doc/manual.html)) on the [project
page](http://codemirror.net). For questions and discussion, use the
[discussion forum](http://discuss.codemirror.net/).

See
[CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md)
for contributing guidelines.

The CodeMirror community aims to be welcoming to everybody. We use the
[Contributor Covenant
(1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of
conduct.


text:
import qpid
import time
import zipfile
import sys
import getopt
from qpid.util import connect
from qpid.datatypes import Message, RangedSet, uuid4
from qpid.connection import Connection
from qpid.queue import Empty
from condorutils import SUCCESS, FAILURE
from condorutils.readconfig import *
from condorutils.workfetch import *

def dump_queue(queue, ses, con, to, dest, broker):

   # Read responses as they come in and print to the screen.
   message = 0
   count = 0
   expected = 2

   while True:
      try:
         message = queue.get(timeout=to)
         content = message.body
         job_data = message.get('message_properties').application_headers
         count = count + 1
         print 'Reply Message ID: ' + str(message.get('message_properties').message_id)
         print 'Correlation ID: ' + str(message.get('message_properties').correlation_id)
         print 'Headers:'
         for header in job_data.keys():
            print header + ': ' + str(job_data[header])
#         print ''
#         print 'Body: '
#         print content
         print ''
         if content != None and content != '':
            file = open('results.zip', 'wb')
            file.write(content)
            file.close()
      except Empty:
         if count < expected:
            print 'Only received %d messages but expected %d.  TEST FAILED!' % (count, expected)
         else:
            print 'Received %d messages.  Check the results.zip for verification of test.' % count
         break
      except qpid.session.Closed:
         try:
            con.close()
         except:
            pass

         # Give broker time to stablize and accept connections
         time.sleep(2)
         con = Connection(sock=connect(str(broker['ip']), int(broker['port'])))
         con.start()

         ses = con.session(str(uuid4()))

         ses.queue_declare(queue=dest, exclusive=True)
         ses.queue_declare(queue=broker['queue'], exclusive=False, durable=True)
         ses.exchange_bind(exchange='amq.direct', queue=broker['queue'], binding_key='grid')
         ses.exchange_bind(exchange='amq.direct', queue=dest, binding_key=dest)

         # Create the local queue. Use the queue name as destination name
         queue = ses.incoming(dest)

         # Subscribe the local queue to the queue on the server
         ses.message_subscribe(queue=dest, destination=dest, accept_mode=ses.accept_mode.explicit)
         ses.message_flow(dest, ses.credit_unit.message, 0xFFFFFFFFL)
         ses.message_flow(dest, ses.credit_unit.byte, 0xFFFFFFFFL)
      except:
         print 'Unexpected exception!'
         break

      if message != 0:
        ses.message_accept(RangedSet(message.id))

   return (0)

def main(argv=None):
   #----- Initialization ----------------------------
   conf_file = '/etc/condor/carod.conf'

   if argv is None:
      argv = sys.argv

   try:
      opts, args = getopt.getopt(argv[1:], 'h:t:', ['help', 'timeout='])
   except getopt.GetoptError, error:
     print str(error)
     return(FAILURE)

   tout = 20
   for option, arg in opts:
      if option in ('-h', '--help'):
         print 'usage: ' + os.path.basename(argv[0]) + ' [-h|--help] [-t|--timeout <num>]'
         return(SUCCESS)
      if option in ('-t', '--timeout'):
         tout = int(arg)

   # Retrieve the carod config for broker info
   try:
      broker_info = read_condor_config('CAROD', ['BROKER_IP', 'BROKER_PORT', 'BROKER_QUEUE'])
      broker_info['ip'] = broker_info['broker_ip']
      broker_info['port'] = broker_info['broker_port']
      broker_info['queue'] = broker_info['broker_queue']
   except ConfigError, error:
      print '%s' % error.msg
      print 'Attempting to retrieve config from %s' % conf_file
      try:
         broker_info = read_config_file(conf_file, 'Broker')
      except ConfigError, error:
         print '%s' % error.msg
         print 'Exiting'
         return(FAILURE)

   replyTo = str(uuid4())

   # Create a client and log in to it.
   connection = Connection(sock=connect(str(broker_info['ip']), int(broker_info['port'])))
   connection.start()

   session = connection.session(str(uuid4()))

   session.queue_declare(queue=replyTo, exclusive=True, auto_delete=True)
   session.queue_declare(queue=broker_info['queue'], exclusive=False, durable="true")
   session.exchange_bind(exchange='amq.direct', queue=broker_info['queue'], binding_key='grid')
   session.exchange_bind(exchange='amq.direct', queue=replyTo, binding_key=replyTo)

   # Create the local queue. Use the queue name as destination name
   dest = replyTo
   recv_queue = session.incoming(dest)
   print 'Messages queue: ' + dest

   # Subscribe the local queue to the queue on the server
   session.message_subscribe(queue=replyTo, destination=dest, accept_mode=session.accept_mode.explicit)
   session.message_flow(dest, session.credit_unit.message, 0xFFFFFFFFL)
   session.message_flow(dest, session.credit_unit.byte, 0xFFFFFFFFL)

   zip = zipfile.ZipFile('test.zip', 'w')
   zip.write('test_run.sh')
   zip.close()
   archived_file = open ('test.zip', 'rb')
   file_data = archived_file.read()
   archived_file.close()
   os.remove('test.zip')

   work_headers = {}
   work_headers['Cmd'] = '"test_run.sh"'
   work_headers['Iwd'] = '"."'
   work_headers['Owner'] = '"nobody"'
   work_headers['TransferOutput'] = '"output,output2,output3,/etc/shadow"'
   work_headers['JobUniverse'] = 5
   message_props = session.message_properties(application_headers=work_headers)
   message_props.reply_to = session.reply_to('amq.direct', replyTo)
   message_props.message_id = uuid4()
   print 'Job Request Message ID: %s' % str(message_props.message_id)

   delivery_props = session.delivery_properties(routing_key='grid', delivery_mode=2)
   delivery_props.ttl = 10000

   session.message_transfer(destination='amq.direct', message=Message(message_props, delivery_props, file_data))
   dump_queue(recv_queue, session, connection, tout, dest, broker_info)

   # Close the session before exiting so there are no open threads.
   try:
      connection.close()
   except:
      pass
   try:
      session.close(timeout=10)
   except:
      pass

   return(SUCCESS)

if __name__ == '__main__':
    sys.exit(main())


text:
[![Build Status](https://secure.travis-ci.org/zendframework/zend-math.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-math)
[![Coverage Status](https://coveralls.io/repos/zendframework/zend-math/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-math?branch=master)

`Zend\Math` provides general mathematical functions. So far the supported
functionalities are:

- `Zend\Math\Rand`, a random number generator;
- `Zend\Math\BigInteger`, a library to manage big integers.

-
- File issues at https://github.com/zendframework/zend-math/issues
- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-math


text:
"""
Test combined sampling strategy with max eval termination strategy.
"""

import random
from poap.strategy import FixedSampleStrategy
from poap.strategy import MaxEvalStrategy
from poap.strategy import SimpleMergedStrategy
from poap.controller import SerialController

def random_generator():
    "Generate a stream of [0,1) uniform random samples."
    while True:
        yield random.random()

def main():
    "Testing routine."
    controller = SerialController(lambda x: (x-0.123)*(x-0.123))
    strategies = [MaxEvalStrategy(controller, 100),
                  FixedSampleStrategy(random_generator())]
    controller.strategy = SimpleMergedStrategy(controller, strategies)
    result = controller.run()
    print("Final: {0:.3e} @ {1}".format(result.value, result.params))

if __name__ == '__main__':
    main()


text:
package it.w0rd.persistence;

import it.w0rd.persistence.db.DictionaryHash;
import org.hamcrest.MatcherAssert;
import org.junit.Test;

import java.io.IOException;
import java.util.List;
import java.util.function.Predicate;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.core.IsEqual.equalTo;

public class WordNetHelperTest {

    @Test
    public void shouldReturnAListOfAllWordDefinitions() throws Exception {
        List<DictionaryHash> words = WordNetHelper.loadDirectoryForTests("WordNet");
        MatcherAssert.assertThat(words, hasSize(21));
    }

    @Test
    public void shouldReturnAListOfAllWordsLength8() throws IOException {
        List<DictionaryHash> words = WordNetHelper.loadAllWordsMatching("WordNet", new Predicate<DictionaryHash>() {
            @Override
            public boolean test(DictionaryHash dictionaryHash) {
                String word = dictionaryHash.getHash();

                if (word.length() <= 8) return true;
                return false;
            }
        });

        assertThat(words.size(), equalTo(15));
    }

    @Test
    public void shouldParseWordNetFileAndReturnDictioary() throws Exception {
        String filePath = WordNetHelper.class.getClassLoader().getResource("WordNet/test_data.adj").getPath();
        List<DictionaryHash> dict = WordNetHelper.parseFile(filePath);
        assertThat(dict, hasSize(20));
    }

}


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libpqxx: pqxx::in_doubt_error Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css"/>

libpqxx 4.0

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Directories

Class List

Class Index

Class Hierarchy

Class Members

Public Member Functions

pqxx::in_doubt_error Class Reference
Exception classes

"Help, I don't know whether transaction was committed successfully!"
 More...

#include <except.hxx>

Inheritance diagram for pqxx::in_doubt_error:

<map name="pqxx_1_1in__doubt__error_inherit__map" id="pqxx_1_1in__doubt__error_inherit__map">
<area shape="rect" id="node2" href="a00038.html" title="Run-time failure encountered by libpqxx, similar to std::runtime_error." alt="" coords="113,160,207,189"/><area shape="rect" id="node4" href="a00074.html" title="Mixin base class to identify libpqxx-specific exception types." alt="" coords="5,83,155,112"/><area shape="rect" id="node6" title="STL class." alt="" coords="179,83,301,112"/><area shape="rect" id="node8" title="STL class." alt="" coords="188,5,292,35"/></map>
[legend]

List of all members.

Public Member Functions

 	in_doubt_error (const std::string &)

Detailed Description

"Help, I don't know whether transaction was committed successfully!"

Exception that might be thrown in rare cases where the connection to the database is lost while finishing a database transaction, and there's no way of telling whether it was actually executed by the backend. In this case the database is left in an indeterminate (but consistent) state, and only manual inspection will tell which is the case.

Constructor & Destructor Documentation

          pqxx::in_doubt_error::in_doubt_error
          (
          const std::string &
          whatarg	)
           [explicit]

The documentation for this class was generated from the following files:

except.hxx

except.cxx

pqxx

in_doubt_error

Generated on Sun Nov 27 2011 18:14:13 for libpqxx by

 1.7.4


text:
package cache

import (
	"encoding/json"
	"testing"
	"time"
)

type CacheValue struct {
	size int
}

func (cv *CacheValue) Size() int {
	return cv.size
}

func TestInitialState(t *testing.T) {
	cache := NewLRUCache(5)
	l, sz, c, _ := cache.Stats()
	if l != 0 {
		t.Errorf("length = %v, want 0", l)
	}
	if sz != 0 {
		t.Errorf("size = %v, want 0", sz)
	}
	if c != 5 {
		t.Errorf("capacity = %v, want 5", c)
	}
}

func TestSetInsertsValue(t *testing.T) {
	cache := NewLRUCache(100)
	data := &CacheValue{0}
	key := "key"
	cache.Set(key, data)

	v, ok := cache.Get(key)
	if !ok || v.(*CacheValue) != data {
		t.Errorf("Cache has incorrect value: %v != %v", data, v)
	}

	k := cache.Keys()
	if len(k) != 1 || k[0] != key {
		t.Errorf("Cache.Keys() returned incorrect values: %v", k)
	}
	values := cache.Items()
	if len(values) != 1 || values[0].Key != key {
		t.Errorf("Cache.Values() returned incorrect values: %v", values)
	}
}

func TestSetIfAbsent(t *testing.T) {
	cache := NewLRUCache(100)
	data := &CacheValue{0}
	key := "key"
	cache.SetIfAbsent(key, data)

	v, ok := cache.Get(key)
	if !ok || v.(*CacheValue) != data {
		t.Errorf("Cache has incorrect value: %v != %v", data, v)
	}

	cache.SetIfAbsent(key, &CacheValue{1})

	v, ok = cache.Get(key)
	if !ok || v.(*CacheValue) != data {
		t.Errorf("Cache has incorrect value: %v != %v", data, v)
	}
}

func TestGetValueWithMultipleTypes(t *testing.T) {
	cache := NewLRUCache(100)
	data := &CacheValue{0}
	key := "key"
	cache.Set(key, data)

	v, ok := cache.Get("key")
	if !ok || v.(*CacheValue) != data {
		t.Errorf("Cache has incorrect value for \"key\": %v != %v", data, v)
	}

	v, ok = cache.Get(string([]byte{'k', 'e', 'y'}))
	if !ok || v.(*CacheValue) != data {
		t.Errorf("Cache has incorrect value for []byte {'k','e','y'}: %v != %v", data, v)
	}
}

func TestSetUpdatesSize(t *testing.T) {
	cache := NewLRUCache(100)
	emptyValue := &CacheValue{0}
	key := "key1"
	cache.Set(key, emptyValue)
	if _, sz, _, _ := cache.Stats(); sz != 0 {
		t.Errorf("cache.Size() = %v, expected 0", sz)
	}
	someValue := &CacheValue{20}
	key = "key2"
	cache.Set(key, someValue)
	if _, sz, _, _ := cache.Stats(); sz != 20 {
		t.Errorf("cache.Size() = %v, expected 20", sz)
	}
}

func TestSetWithOldKeyUpdatesValue(t *testing.T) {
	cache := NewLRUCache(100)
	emptyValue := &CacheValue{0}
	key := "key1"
	cache.Set(key, emptyValue)
	someValue := &CacheValue{20}
	cache.Set(key, someValue)

	v, ok := cache.Get(key)
	if !ok || v.(*CacheValue) != someValue {
		t.Errorf("Cache has incorrect value: %v != %v", someValue, v)
	}
}

func TestSetWithOldKeyUpdatesSize(t *testing.T) {
	cache := NewLRUCache(100)
	emptyValue := &CacheValue{0}
	key := "key1"
	cache.Set(key, emptyValue)

	if _, sz, _, _ := cache.Stats(); sz != 0 {
		t.Errorf("cache.Size() = %v, expected %v", sz, 0)
	}

	someValue := &CacheValue{20}
	cache.Set(key, someValue)
	expected := int64(someValue.size)
	if _, sz, _, _ := cache.Stats(); sz != expected {
		t.Errorf("cache.Size() = %v, expected %v", sz, expected)
	}
}

func TestGetNonExistent(t *testing.T) {
	cache := NewLRUCache(100)

	if _, ok := cache.Get("crap"); ok {
		t.Error("Cache returned a crap value after no inserts.")
	}
}

func TestDelete(t *testing.T) {
	cache := NewLRUCache(100)
	value := &CacheValue{1}
	key := "key"

	if cache.Delete(key) {
		t.Error("Item unexpectedly already in cache.")
	}

	cache.Set(key, value)

	if !cache.Delete(key) {
		t.Error("Expected item to be in cache.")
	}

	if _, sz, _, _ := cache.Stats(); sz != 0 {
		t.Errorf("cache.Size() = %v, expected 0", sz)
	}

	if _, ok := cache.Get(key); ok {
		t.Error("Cache returned a value after deletion.")
	}
}

func TestClear(t *testing.T) {
	cache := NewLRUCache(100)
	value := &CacheValue{1}
	key := "key"

	cache.Set(key, value)
	cache.Clear()

	if _, sz, _, _ := cache.Stats(); sz != 0 {
		t.Errorf("cache.Size() = %v, expected 0 after Clear()", sz)
	}
}

func TestCapacityIsObeyed(t *testing.T) {
	size := int64(3)
	cache := NewLRUCache(100)
	cache.SetCapacity(size)
	value := &CacheValue{1}

	// Insert up to the cache's capacity.
	cache.Set("key1", value)
	cache.Set("key2", value)
	cache.Set("key3", value)
	if _, sz, _, _ := cache.Stats(); sz != size {
		t.Errorf("cache.Size() = %v, expected %v", sz, size)
	}
	// Insert one more; something should be evicted to make room.
	cache.Set("key4", value)
	if _, sz, _, _ := cache.Stats(); sz != size {
		t.Errorf("post-evict cache.Size() = %v, expected %v", sz, size)
	}

	// Check json stats
	data := cache.StatsJSON()
	m := make(map[string]interface{})
	if err := json.Unmarshal([]byte(data), &m); err != nil {
		t.Errorf("cache.StatsJSON() returned bad json data: %v %v", data, err)
	}
	if m["Size"].(float64) != float64(size) {
		t.Errorf("cache.StatsJSON() returned bad size: %v", m)
	}

	// Check various other stats
	if l := cache.Length(); l != size {
		t.Errorf("cache.StatsJSON() returned bad length: %v", l)
	}
	if s := cache.Size(); s != size {
		t.Errorf("cache.StatsJSON() returned bad size: %v", s)
	}
	if c := cache.Capacity(); c != size {
		t.Errorf("cache.StatsJSON() returned bad length: %v", c)
	}

	// checks StatsJSON on nil
	cache = nil
	if s := cache.StatsJSON(); s != "{}" {
		t.Errorf("cache.StatsJSON() on nil object returned %v", s)
	}
}

func TestLRUIsEvicted(t *testing.T) {
	size := int64(3)
	cache := NewLRUCache(size)

	cache.Set("key1", &CacheValue{1})
	cache.Set("key2", &CacheValue{1})
	cache.Set("key3", &CacheValue{1})
	// lru: [key3, key2, key1]

	// Look up the elements. This will rearrange the LRU ordering.
	cache.Get("key3")
	beforeKey2 := time.Now()
	cache.Get("key2")
	afterKey2 := time.Now()
	cache.Get("key1")
	// lru: [key1, key2, key3]

	cache.Set("key0", &CacheValue{1})
	// lru: [key0, key1, key2]

	// The least recently used one should have been evicted.
	if _, ok := cache.Get("key3"); ok {
		t.Error("Least recently used element was not evicted.")
	}

	// Check oldest
	if o := cache.Oldest(); o.Before(beforeKey2) || o.After(afterKey2) {
		t.Errorf("cache.Oldest returned an unexpected value: got %v, expected a value between %v and %v", o, beforeKey2, afterKey2)
	}
}


text:
size_t fwrite(const void* restrict buffer, size_t size, size_t count, FILE stream[restrict static 1])
{
    return stream->write(stream, buffer, size * count) / size;
}


text:
package com.consol.citrus.selenium.config.xml;

import com.consol.citrus.config.util.BeanDefinitionParserUtils;
import com.consol.citrus.selenium.actions.AbstractSeleniumAction;
import com.consol.citrus.selenium.actions.AlertAction;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;

/**
 * @author Tamer Erdogan, Christoph Deppisch
 * @since 2.7
 */
public class AlertActionParser extends AbstractBrowserActionParser {

    @Override
    protected void parseAction(BeanDefinitionBuilder beanDefinition, Element element, ParserContext parserContext) {
        BeanDefinitionParserUtils.setPropertyValue(beanDefinition, element.getAttribute("accept"), "accept");
        BeanDefinitionParserUtils.setPropertyValue(beanDefinition, element.getAttribute("text"), "text");

        Element textElement = DomUtils.getChildElementByTagName(element, "alert-text");
        if (textElement != null) {
            BeanDefinitionParserUtils.setPropertyValue(beanDefinition, DomUtils.getTextValue(textElement), "text");
        }
    }

    @Override
    protected Class<? extends AbstractSeleniumAction> getBrowserActionClass() {
        return AlertAction.class;
    }
}


text:
using System;
using System.Collections.Generic;

namespace Freya.WFEngine
{
    public interface IWorkflow
    {
        /// <summary>
        /// Gets the item state manager.
        /// </summary>
        IStateManager StateManager { get; }

        /// <summary>
        /// Gets registered workflow states.
        /// </summary>
        StateSet States { get; }

        /// <summary>
        /// Gets the activity factory.
        /// </summary>
        CompositeComponentFactory<IActivity> ActivityFactory { get; }

        /// <summary>
        /// Gets the activity guard factory.
        /// </summary>
        CompositeComponentFactory<IGuard> GuardFactory { get; }

        /// <summary>
        /// Returns all invokable activities for the specified <paramref name="item"/>.
        /// </summary>
        IEnumerable<IActivity> GetActivitiesForItem(object item);

        /// <summary>
        /// Returns all invokable activities of type <typeparamref name="TActivity"/> for the specified <paramref name="item"/>.
        /// </summary>
        /// <typeparam name="TActivity">Type of the activity. Must be an interface.</typeparam>
        IEnumerable<TActivity> GetActivitiesForItem<TActivity>(object item) where TActivity : IActivity;

        /// <summary>
        /// Occurs before an activity is invoked.
        /// </summary>
        event WorkflowInvocationDelegate PreInvoke;

        /// <summary>
        /// Occurs after an activity is invoked.
        /// </summary>
        event WorkflowInvocationDelegate PostInvoke;
    }
}


text:
using System;
using System.Collections.Generic;
using Csla;

namespace SelfLoadROSoftDelete.DataAccess.ERCLevel
{
    /// <summary>
    /// DAL Interface for H07_Country_Child type
    /// </summary>
    public partial interface IH07_Country_ChildDal
    {
        /// <summary>
        /// Loads a H07_Country_Child object from the database.
        /// </summary>
        /// <param name="country_ID1">The fetch criteria.</param>
        /// <returns>A <see cref="H07_Country_ChildDto"/> object.</returns>
        H07_Country_ChildDto Fetch(int country_ID1);
    }
}


text:
package com.gmail.Lecrayen.Platinum.MMO.Commands.Portal;

import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.gmail.Lecrayen.Platinum.API.MainCommand;
import com.gmail.Lecrayen.Platinum.API.Subcommand;
import com.gmail.Lecrayen.Platinum.MMO.MMO;
import com.gmail.Lecrayen.Platinum.MMO.Portal;

public class PortalUnhook implements Subcommand {

	private String description = "Unhook a portal";
	private MainCommand main;
	private String name = "unhook";
	private String permission = "platinum.portal.unhook";
	private boolean playeronly = true;
	private String usage = "/portal unhook <portal>";

	public PortalUnhook(MainCommand maincommand) {
		main = maincommand;
	}

	@Override
	public String getDescription() {
		return description;
	}

	@Override
	public MainCommand getMainCommand() {
		return main;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public String getPermission() {
		return permission;
	}

	@Override
	public String getUsage() {
		return usage;
	}

	@Override
	public boolean isPlayerOnly() {
		return playeronly;
	}

	@Override
	public void run(CommandSender sender, String[] args) {
		Player p = (Player) sender;
		Portal parg;
		if (args.length < 2) {
			p.sendMessage("§4[Error]:§f Enter the name of the portal");
			return;
		}
		if ((parg = MMO.portal_manager.getPortal(args[1])) == null) {
			p.sendMessage("§4[Error]:§f No portal with that name found");
			return;
		}
		parg.setHook("");
		p.sendMessage("§2[Info]:§f Portal unhooked");
	}
}


text:
  {% if widget.facebook_username.best_value != ""  %}
    Facebook
  {% endif %}

  {% if widget.twitter_username.best_value != ""  %}
    Twitter
  {% endif %}

  {% if widget.yelp_username.best_value != ""  %}
    Yelp
  {% endif %}

  {% if widget.foursquare_username.best_value != "" %}
    Foursquare
  {% endif %}

  {% if widget.pinterest_username.best_value != ""  %}
    Pinterest
  {% endif %}

  {% if widget.tumblr_username.best_value != ""  %}
    Tumblr
  {% endif %}

  {% if widget.instagram_username.best_value != ""  %}
    Instagram
  {% endif %}

  {% if widget.vimeo_username.best_value != ""  %}
    Vimeo
  {% endif %}

  {% if widget.youtube_username.best_value != ""  %}
    YouTube
  {% endif %}


text:
<?php

class Lobbyist_ApiRequestorTest extends Lobbyist_TestCase
{
  public function testEncode()
  {
    $a = array('my' => 'value', 'that' => array('your' => 'example'), 'bar' => 1, 'baz' => null);
    $enc = Lobbyist_APIRequestor::encode($a);
    $this->assertEqual($enc, 'my=value&that%5Byour%5D=example&bar=1');

    $a = array('that' => array('your' => 'example', 'foo' => null));
    $enc = Lobbyist_APIRequestor::encode($a);
    $this->assertEqual($enc, 'that%5Byour%5D=example');
  }

  public function testEncodeObjects()
  {
    // We have to do some work here because this is normally
    // private. This is just for testing! Also it only works on PHP >=
    // 5.3
    if (version_compare(PHP_VERSION, '5.3.2', '>='))
    {
      $reflector = new ReflectionClass('Lobbyist_APIRequestor');
      $method = $reflector->getMethod('_encodeObjects');
      $method->setAccessible(true);

      $a = array('contact' => new Lobbyist_Contact('abcd'));
      $enc = $method->invoke(null, $a);
      $this->assertEqual($enc, array('contact' => 'abcd'));
    }
  }

  public function testApiUrl()
  {
    $url = Lobbyist_APIRequestor::apiUrl();
    $this->assertEqual(Lobbyist::$apiBase . ".json", $url);

    $url = Lobbyist_APIRequestor::apiUrl('/contacts');
    $this->assertEqual(Lobbyist::$apiBase . "/contacts.json", $url);
  }
}


text:
extern const NSString* kXImageDefaultImageName;

@interface XImage : UIImageView

// Usage Notes:
//   * 'imageName' parameter is optional (else pass in Nil).  If Nil, loads the DefaultImage
- (XImage *)initWithFrame:(CGRect)frame imageName:(NSString *)imageName;

// Usage Notes:
//   * 'imageName' parameter is optional (else pass in Nil).  If Nil, loads the DefaultImage
- (XImage *)initWithSuperView:(UIView *)superView imageName:(NSString *)imageName;

// Usage Notes:
//   * sets image name and loads the image into the XImage control
@property(nonatomic, readwrite) NSString* imageName;

@end


text:
**********************************
Getting started with R and RStudio
**********************************

Step #1: Installing R and RStudio
###################################################

Basic Information
-----------------
Working in `R <https://cran.r-project.org/>`_ is a great way to access the cloud pilot data. We can perform Big Queries,
statistically model data, and easily visualize the results. R programming
is easier and more robust then ever before.

Installation
------------

RStudio is a freely available development environment that makes working
in R more intuitive. Always install (and update to) the most recent versions.

* First, we need to download and install R. `Download and install R <https://cran.rstudio.com/>`_.

* Next, we download and install RStudio. `RStudio <https://www.rstudio.com/products/rstudio/download/>`_.

Questions?
----------

Let us know if you're having trouble! We're here to help.

Step #2: How to prepare for the workshop
########################################

There's a few R libraries we need to install for the workshop. To do that,
start up RStudio, and click over to the "Console" window containing the
interactive R prompt. The window should be in the lower left corner.

**Necessary:**

Install `devtools <https://cran.r-project.org/web/packages/devtools/index.html>`_::

	install.packages("devtools")

Install `bigrquery <https://cran.r-project.org/web/packages/bigrquery/index.html>`_.::

	install.packages("bigrquery")

Install `httr <https://cran.r-project.org/web/packages/httr/index.html>`_.::

	install.packages("httr")

Install `ISBCGCExamples <https://github.com/isb-cgc/examples-R>`_. ::

	library(devtools)
	install_github("isb-cgc/examples-R", build_vignettes=TRUE)

To view and run the ISB-CGC R vignettes.::

	  help(package="ISBCGCExamples")

**Strongly Recommended:**

Install `ggplot2 <https://cran.r-project.org/web/packages/ggplot2/index.html>`_::

	install.packages("ggplot2")

There are vignettes for each TCGA data type, and more elaborate examples involving analyzing genomic data,
correlating gene expression and methylation, and correlating protein and mRNA levels.

The vignettes as R-markdown can be found in the examples-R/inst/doc directory, which can serve as examples of using builtin BigQuery functions like Pearson correlation,
or even how to implement more complex functions like Spearmans correlation. Queries can be simple character vectors, or standalone files.

Results are returned as data.frames using the bigrquery package to interact with the servers.
The SQL files used in the vignettes can be found at examples-R/inst/sql. These are parsed and dispatched with arguments using the DisplayAndDispatchQuery function,
found in the file of the same name in examples-R/R.

**Additional Resources:**

`ISB-CGC documentation <http://isb-cancer-genomics-cloud.readthedocs.io/en/latest/index.html>`_

What's Next?
############

Check out our github repo containing introductions to data types and ideas
for different analysis.

https://github.com/isb-cgc/examples-R

.. toctree::
   :maxdepth: 1

   workshop/Workshop_R_tut


text:
//Vertigo v2.0 board setting
#define USE_FUTABA
#define USE_IMU_MPU9250
#define USE_MAG_HMC5983
#define USE_CAN_MAGNETOMETER
#define USE_ADS1246_MPX6115A
//#define USE_CAN_ADS1246_MPX6115A
#define STM32F427X
/*choose the external device*/
#define IS_USE_MAGNETOMETER 1
#define IS_USE_BAROMETER 1
#define IS_USE_GPS 1
/*Set magnetometer*/
#if IS_USE_MAGNETOMETER

#endif
/*Set barometer*/
#if IS_USE_BAROMETER

#endif

/*Set GPS*/
#if IS_USE_GPS

#endif

// Controller define

#define CONTROL_f (4000.0f)
#define CONTROL_DT 0.00025f
#define USE_MAGNETIC_HEADING
//#define USE_GYROSCOPE_HEADING


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2018 Google LLC
  ~
  ~ 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
  ~
  ~     https://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.
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".HomeFragment">

    <Button
        android:id="@+id/content_labeling_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/fragment_content_labeling" />

    <Button
        android:id="@+id/content_grouping_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/fragment_content_grouping" />

    <Button
        android:id="@+id/live_region_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/fragment_live_region" />

    <Button
        android:id="@+id/expand_touch_area_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/fragment_expand_touch_area" />

    <Button
        android:id="@+id/insufficient_contrast_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/fragment_insufficient_contrast" />
</LinearLayout>


text:
/**
 * This function is used to mark string literals representing CSS class names
 * so that they can be transformed statically. This allows for modularization
 * and minification of CSS class names.
 *
 * In static_upstream, this function is actually implemented, but it should
 * eventually be replaced with something more descriptive, and the transform
 * that is used in the main stack should be ported for use elsewhere.
 *
 * @param string|object className to modularize, or an object of key/values.
 *                      In the object case, the values are conditions that
 *                      determine if the className keys should be included.
 * @param [string ...]  Variable list of classNames in the string case.
 * @return string       Renderable space-separated CSS className.
 */
function cx(classNames) {
  if (typeof classNames == 'object') {
    return Object.keys(classNames).filter(function(className) {
      return classNames[className];
    }).join(' ');
  } else {
    return Array.prototype.join.call(arguments, ' ');
  }
}

module.exports = cx;


text:
"""
Transfering data from Anritsu MS2601 spectrum analyzer
"""
from __future__ import division
import ConfigParser
import numpy as np
import sys
from time import strftime

## For Windows:
import matplotlib
matplotlib.rcParams['backend'] = 'wx'
import matplotlib.pylab as pl

# Own modules
sys.path.append("../../drivers/")
import anritsu

if __name__ == "__main__":

    # Load configuration
    try:
        configfile = sys.argv[1]  # first argument is configuration file name
        config = ConfigParser.ConfigParser()
        config.readfp(open(configfile))
    except:
        print "Cannot find configuration file."
        sys.exit(1)

    runparams = [None]
    if len(sys.argv) >= 2:
        try:
            runparams[0] = int(sys.argv[2])  # should be basename
        except (ValueError, IndexError):
            pass

    # Get Configuration
    GPIB = config.getint('Setup', 'GPIB')
    basename = config.get('Setup', 'Basename')

    # Connect to device
    try:
        device = anritsu.MS2601(GPIB)
    except (IOError):
        print("Couldn't find things on GPIB channel %d, exiting" %(GPIB))
        sys.exit(1)

    # Setting up the output filename
    if not runparams[0]:
        name = raw_input("Output basename? (default: %s) " %basename)
        if len(name) > 0:
            basename = name
    else:
        basename = runparams[3]
    outname = "%s_%s" %(basename, strftime("%y%m%d_%H%M%S"))

    cnf = int(device.ask("CNF?")[3:])
    spf = int(device.ask("SPF?")[3:])
    freq = np.linspace(cnf - spf/2, cnf + spf/2, 501)

    receive, unit = device.getdata(binary=True)
    if not unit:
        unit = "unknown"
    vals = np.array(zip(freq, receive))

    np.savetxt("%s.csv" %(outname),
               vals,
               delimiter=",",
               fmt=["%g", "%.2f"],
               header="Frequency(Hz), Specrum(%s)" %unit,
               )

    pl.plot(vals[:, 0]/1e6, vals[:, 1], 'b-')
    pl.xlabel("Frequency (MHz)")
    pl.ylabel("Spectrum (%s)" %unit)
    pl.title("%s" %(outname))
    pl.savefig("%s.png" %(outname))


text:
DROP TRIGGER trigger_crates_tsvector_update ON crates;
CREATE TRIGGER trigger_crates_tsvector_update BEFORE INSERT OR UPDATE
ON crates
FOR EACH ROW EXECUTE PROCEDURE trigger_crates_name_search();


text:
FROM alpine
RUN apk --update upgrade && apk add curl ca-certificates && \
    update-ca-certificates && rm -rf /var/cache/apk/*
ADD markov /markov
ADD markovbot/markovbot /markovbot


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>jcloudscale.datastorelib</artifactId>
	<name>JCloudScale Datastore Library</name>
	<description>JCloudScale Datastore Library</description>

	<parent>
		<groupId>jcloudscale</groupId>
		<artifactId>jcloudscale</artifactId>
		<version>0.4.0</version>
		<relativePath>../../pom.xml</relativePath>
	</parent>

	<properties>
		<failIfNoTests>false</failIfNoTests>
                <javaVersion>1.7</javaVersion>
                <aspectj.version>1.7.0</aspectj.version>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.1</version>
				<configuration>
					<source>${javaVersion}</source>
					<target>${javaVersion}</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>aspectj-maven-plugin</artifactId>
				<version>1.4</version>
				<configuration>
                			<source>${javaVersion}</source>
                			<target>${javaVersion}</target>
                			<complianceLevel>${javaVersion}</complianceLevel>
                			<verbose>true</verbose>
				</configuration>
				<executions>
					<execution>
						<configuration>
							<XnoInline>true</XnoInline>
							<aspectLibraries>
								<aspectLibrary>
									<groupId>jcloudscale</groupId>
									<artifactId>jcloudscale.core</artifactId>
								</aspectLibrary>
							</aspectLibraries>
						</configuration>
						<goals>
							<goal>compile</goal>
							<goal>test-compile</goal>
						</goals>
					</execution>
				</executions>
                                <dependencies>
                                        <dependency>
                                                <groupId>org.aspectj</groupId>
                                                <artifactId>aspectjrt</artifactId>
                                                <version>${aspectj.version}</version>
                                        </dependency>
                                        <dependency>
                                                <groupId>org.aspectj</groupId>
                                                <artifactId>aspectjtools</artifactId>
                                                <version>${aspectj.version}</version>
                                        </dependency>
                                </dependencies>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<archive>
						<index>true</index>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>${libraryDirectory}</classpathPrefix>
						</manifest>
					</archive>
					<goal>
					</goal>
				</configuration>
			</plugin>
						<!-- skip unit test run, tests has to be executed during integration-test -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.10</version>
				<configuration>
					<skip>true</skip>
				</configuration>
				<executions>
					<execution>
						<id>surefire-it</id>
						<phase>integration-test</phase>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<skip>false</skip>
							<workingDirectory>target/classes</workingDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
                                <plugin>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>findbugs-maven-plugin</artifactId>
                                        <version>2.3.2</version>
<configuration>
      <findbugsXmlOutput>true</findbugsXmlOutput>
      <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
      <xmlOutput>true</xmlOutput>
   </configuration>
                                </plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.codehaus.mojo
										</groupId>
										<artifactId>
											aspectj-maven-plugin
										</artifactId>
										<versionRange>
											[1.4,)
										</versionRange>
										<goals>
											<goal>test-compile</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<repositories>
		<repository>
                	<id>infosys-repository</id>
                	<url>http://www.infosys.tuwien.ac.at/mvn</url>
        	</repository>
	</repositories>

	<dependencies>

		<!-- JCloudScale -->
		<dependency>
			<groupId>jcloudscale</groupId>
			<artifactId>jcloudscale.core</artifactId>
			<version>0.4.0</version>
			<scope>compile</scope>
		</dependency>

		<!-- Datastore Dependencies -->
<dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.1</version>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.1</version>
        </dependency>

		<!--
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.2.2</version>
        </dependency>
		 -->

        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty</artifactId>
            <version>6.1H.22</version>
        </dependency>

        <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.12.1.GA</version>
        </dependency>

        <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>javaee-api</artifactId>
            <version>5.0-2</version>
            <type>jar</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.6.10.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.5.6-Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.6.10.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.2.9</version>
        </dependency>

        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase</artifactId>
            <version>0.94.5</version>
        </dependency>

		<dependency>
			<groupId>com.basho.riak</groupId>
			<artifactId>riak-client</artifactId>
			<version>1.0.5</version>
		</dependency>

        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.7</version>
        </dependency>

        <dependency>
            <groupId>org.lightcouch</groupId>
            <artifactId>lightcouch</artifactId>
            <version>0.0.5</version>
        </dependency>

			<!--  fixed version of HTTPClient as this seems to work with all required components -->
			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpclient</artifactId>
				<version>4.2.2</version>
			</dependency>

	</dependencies>

</project>


text:
package com.github.OrangeGangsters.circularbarpager;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.github.OrangeGangsters.circularbarpager.library.CircularBarPager;
import com.nineoldandroids.animation.Animator;
import com.viewpagerindicator.CirclePageIndicator;

import daniel.olivier.stoyan.circularbarpager.R;

/**
 * Created by stoyan and oliviergoutay on 12/9/14.
 */
public class MainActivity extends Activity {

    private CircularBarPager mCircularBarPager;

    /**
     * The animation time in milliseconds that we take to display the steps taken
     */
    private static final int BAR_ANIMATION_TIME = 1000;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initViews();
    }

    @Override
    protected void onResume() {
        super.onResume();
        mCircularBarPager.getCircularBar().animateProgress(0, 75, 1000);
    }

    private void initViews(){
        mCircularBarPager = (CircularBarPager) findViewById(R.id.circularBarPager);

        View[] views = new View[2];
        views[0] = new DemoView(this);
        views[1] = new DemoView(this);

        mCircularBarPager.setViewPagerAdapter(new DemoPagerAdapter(this, views));

        ViewPager viewPager = mCircularBarPager.getViewPager();
        viewPager.setClipToPadding(true);

        CirclePageIndicator circlePageIndicator = mCircularBarPager.getCirclePageIndicator();
        circlePageIndicator.setFillColor(getResources().getColor(R.color.light_grey));
        circlePageIndicator.setPageColor(getResources().getColor(R.color.very_light_grey));
        circlePageIndicator.setStrokeColor(getResources().getColor(R.color.transparent));

        //Do stuff based on animation
        mCircularBarPager.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animation) {

            }

            @Override
            public void onAnimationEnd(Animator animation) {
                //TODO do stuff
            }

            @Override
            public void onAnimationCancel(Animator animation) {

            }

            @Override
            public void onAnimationRepeat(Animator animation) {

            }
        });

        //Do stuff based on when pages change
        circlePageIndicator.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){
            @Override
            public void onPageSelected(int position) {
                if(mCircularBarPager!= null && mCircularBarPager.getCircularBar() != null){
                    switch (position){
                        case 0:
                            mCircularBarPager.getCircularBar().animateProgress(-25, 100, BAR_ANIMATION_TIME);
                            break;
                        case 1:
                            mCircularBarPager.getCircularBar().animateProgress(100, -75, BAR_ANIMATION_TIME);
                            break;
                        default:
                            mCircularBarPager.getCircularBar().animateProgress(0, 75, BAR_ANIMATION_TIME);
                            break;
                    }
                }
            }
        });
    }
}


text:
require 'gosu'
require_relative 'states/game_state'
require_relative 'states/menu_state'
require_relative 'states/play_state'
require_relative 'game_window'

module Game
  def self.media_path(file)
    File.join(File.dirname(File.dirname(
      __FILE__)), 'media', file)
  end
end

$window = GameWindow.new
GameState.switch(MenuState.instance)
$window.show


text:
package gcloud // import "github.com/docker/infrakit/pkg/provider/google/mock/gcloud"

import (
	gcloud "github.com/docker/infrakit/pkg/provider/google/plugin/gcloud"
	gomock "github.com/golang/mock/gomock"
	v1 "google.golang.org/api/compute/v1"
)

// Mock of API interface
type MockAPI struct {
	ctrl     *gomock.Controller
	recorder *_MockAPIRecorder
}

// Recorder for MockAPI (not exported)
type _MockAPIRecorder struct {
	mock *MockAPI
}

func NewMockAPI(ctrl *gomock.Controller) *MockAPI {
	mock := &MockAPI{ctrl: ctrl}
	mock.recorder = &_MockAPIRecorder{mock}
	return mock
}

func (_m *MockAPI) EXPECT() *_MockAPIRecorder {
	return _m.recorder
}

func (_m *MockAPI) AddInstanceMetadata(_param0 string, _param1 []*v1.MetadataItems) error {
	ret := _m.ctrl.Call(_m, "AddInstanceMetadata", _param0, _param1)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) AddInstanceMetadata(arg0, arg1 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "AddInstanceMetadata", arg0, arg1)
}

func (_m *MockAPI) AddInstanceToTargetPool(_param0 string, _param1 ...string) error {
	_s := []interface{}{_param0}
	for _, _x := range _param1 {
		_s = append(_s, _x)
	}
	ret := _m.ctrl.Call(_m, "AddInstanceToTargetPool", _s...)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) AddInstanceToTargetPool(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
	_s := append([]interface{}{arg0}, arg1...)
	return _mr.mock.ctrl.RecordCall(_mr.mock, "AddInstanceToTargetPool", _s...)
}

func (_m *MockAPI) CreateInstance(_param0 string, _param1 *gcloud.InstanceSettings) error {
	ret := _m.ctrl.Call(_m, "CreateInstance", _param0, _param1)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) CreateInstance(arg0, arg1 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "CreateInstance", arg0, arg1)
}

func (_m *MockAPI) CreateInstanceGroupManager(_param0 string, _param1 *gcloud.InstanceManagerSettings) error {
	ret := _m.ctrl.Call(_m, "CreateInstanceGroupManager", _param0, _param1)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) CreateInstanceGroupManager(arg0, arg1 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "CreateInstanceGroupManager", arg0, arg1)
}

func (_m *MockAPI) CreateInstanceTemplate(_param0 string, _param1 *gcloud.InstanceSettings) error {
	ret := _m.ctrl.Call(_m, "CreateInstanceTemplate", _param0, _param1)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) CreateInstanceTemplate(arg0, arg1 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "CreateInstanceTemplate", arg0, arg1)
}

func (_m *MockAPI) DeleteInstance(_param0 string) error {
	ret := _m.ctrl.Call(_m, "DeleteInstance", _param0)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) DeleteInstance(arg0 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "DeleteInstance", arg0)
}

func (_m *MockAPI) DeleteInstanceGroupManager(_param0 string) error {
	ret := _m.ctrl.Call(_m, "DeleteInstanceGroupManager", _param0)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) DeleteInstanceGroupManager(arg0 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "DeleteInstanceGroupManager", arg0)
}

func (_m *MockAPI) DeleteInstanceTemplate(_param0 string) error {
	ret := _m.ctrl.Call(_m, "DeleteInstanceTemplate", _param0)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) DeleteInstanceTemplate(arg0 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "DeleteInstanceTemplate", arg0)
}

func (_m *MockAPI) GetInstance(_param0 string) (*v1.Instance, error) {
	ret := _m.ctrl.Call(_m, "GetInstance", _param0)
	ret0, _ := ret[0].(*v1.Instance)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

func (_mr *_MockAPIRecorder) GetInstance(arg0 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "GetInstance", arg0)
}

func (_m *MockAPI) GetProject() string {
	ret := _m.ctrl.Call(_m, "GetProject")
	ret0, _ := ret[0].(string)
	return ret0
}

func (_mr *_MockAPIRecorder) GetProject() *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "GetProject")
}

func (_m *MockAPI) GetZone() string {
	ret := _m.ctrl.Call(_m, "GetZone")
	ret0, _ := ret[0].(string)
	return ret0
}

func (_mr *_MockAPIRecorder) GetZone() *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "GetZone")
}

func (_m *MockAPI) ListInstanceGroupInstances(_param0 string) ([]*v1.InstanceWithNamedPorts, error) {
	ret := _m.ctrl.Call(_m, "ListInstanceGroupInstances", _param0)
	ret0, _ := ret[0].([]*v1.InstanceWithNamedPorts)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

func (_mr *_MockAPIRecorder) ListInstanceGroupInstances(arg0 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "ListInstanceGroupInstances", arg0)
}

func (_m *MockAPI) ListInstances() ([]*v1.Instance, error) {
	ret := _m.ctrl.Call(_m, "ListInstances")
	ret0, _ := ret[0].([]*v1.Instance)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

func (_mr *_MockAPIRecorder) ListInstances() *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "ListInstances")
}

func (_m *MockAPI) ResizeInstanceGroupManager(_param0 string, _param1 int64) error {
	ret := _m.ctrl.Call(_m, "ResizeInstanceGroupManager", _param0, _param1)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) ResizeInstanceGroupManager(arg0, arg1 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "ResizeInstanceGroupManager", arg0, arg1)
}

func (_m *MockAPI) SetInstanceTemplate(_param0 string, _param1 string) error {
	ret := _m.ctrl.Call(_m, "SetInstanceTemplate", _param0, _param1)
	ret0, _ := ret[0].(error)
	return ret0
}

func (_mr *_MockAPIRecorder) SetInstanceTemplate(arg0, arg1 interface{}) *gomock.Call {
	return _mr.mock.ctrl.RecordCall(_mr.mock, "SetInstanceTemplate", arg0, arg1)
}


text:
'use strict';

const crypto = require('crypto');

exports.getShortMD5 = (str) => crypto.createHash('md5').update(str, 'ascii').digest('hex').substr(0, 7);