text:
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.

Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.Recommendations.Declarations
    Public Class StructureKeywordRecommenderTests
        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureInClassDeclarationTest() As Task
            Await VerifyRecommendationsContainAsync(<ClassDeclaration>|</ClassDeclaration>, "Structure")
        End Function

        <Fact, WorkItem(530727, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530727")>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureFollowsStructureTest() As Task
            Dim code =
<File>
Structure S
End Structure
|
</File>
            Await VerifyRecommendationsContainAsync(code, "Structure")
        End Function

        <Fact, WorkItem(530727, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530727")>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureFollowsStructureWithinClassTest() As Task
            Dim code =
<File>
Class C
    Structure S
    End Structure
    |
End Class
</File>
            Await VerifyRecommendationsContainAsync(code, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotInMethodDeclarationTest() As Task
            Await VerifyRecommendationsMissingAsync(<MethodBody>|</MethodBody>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureInNamespaceTest() As Task
            Await VerifyRecommendationsContainAsync(<NamespaceDeclaration>|</NamespaceDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureInInterfaceTest() As Task
            Await VerifyRecommendationsContainAsync(<InterfaceDeclaration>|</InterfaceDeclaration>, "Structure")
        End Function

        <Fact, WorkItem(530727, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530727")>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureFollowsMismatchedEndTest() As Task
            Dim code =
<File>
Interface I1
End Class
|
End Interface
</File>
            Await VerifyRecommendationsContainAsync(code, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotInEnumTest() As Task
            Await VerifyRecommendationsMissingAsync(<EnumDeclaration>|</EnumDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureInStructureTest() As Task
            Await VerifyRecommendationsContainAsync(<StructureDeclaration>|</StructureDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureInModuleTest() As Task
            Await VerifyRecommendationsContainAsync(<ModuleDeclaration>|</ModuleDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureAfterPartialTest() As Task
            Await VerifyRecommendationsContainAsync(<File>Partial |</File>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureAfterPublicInFileTest() As Task
            Await VerifyRecommendationsContainAsync(<File>Public |</File>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureAfterPublicInClassDeclarationTest() As Task
            Await VerifyRecommendationsContainAsync(<ClassDeclaration>Public |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureMissingAfterProtectedInFileTest() As Task
            Await VerifyRecommendationsMissingAsync(<File>Protected |</File>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureExistsAfterProtectedInClassDeclarationTest() As Task
            Await VerifyRecommendationsContainAsync(<ClassDeclaration>Protected |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureAfterFriendInFileTest() As Task
            Await VerifyRecommendationsContainAsync(<File>Friend |</File>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureAfterFriendInClassDeclarationTest() As Task
            Await VerifyRecommendationsContainAsync(<ClassDeclaration>Friend |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterPrivateInFileTest() As Task
            Await VerifyRecommendationsMissingAsync(<File>Private |</File>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureAfterPrivateInNestedClassTest() As Task
            Await VerifyRecommendationsContainAsync(<ClassDeclaration>Private |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterPrivateInNamespaceTest() As Task
            Await VerifyRecommendationsMissingAsync(<File>
Namespace Goo
    Private |
End Namespace</File>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterProtectedFriendInFileTest() As Task
            Await VerifyRecommendationsMissingAsync(<File>Protected Friend |</File>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureAfterProtectedFriendInClassTest() As Task
            Await VerifyRecommendationsContainAsync(<ClassDeclaration>Protected Friend |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterOverloadsTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Overloads |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterOverridesTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Overrides |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterOverridableTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Overridable |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterNotOverridableTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>NotOverridable |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterMustOverrideTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>MustOverride |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterMustOverrideOverridesTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>MustOverride Overrides |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterNotOverridableOverridesTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>NotOverridable Overrides |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterConstTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Const |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterDefaultTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Default |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterMustInheritTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>MustInherit |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterNotInheritableTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>NotInheritable |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterNarrowingTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Narrowing |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterWideningTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Widening |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterReadOnlyTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>ReadOnly |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterWriteOnlyTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>WriteOnly |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterCustomTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Custom |</ClassDeclaration>, "Structure")
        End Function

        <Fact>
        <Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function StructureNotAfterSharedTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Shared |</ClassDeclaration>, "Structure")
        End Function

        <WorkItem(547254, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/547254")>
        <Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function NotAfterAsyncTest() As Task
            Await VerifyRecommendationsMissingAsync(<ClassDeclaration>Async |</ClassDeclaration>, "Structure")
        End Function

        <WorkItem(20837, "https://github.com/dotnet/roslyn/issues/20837")>
        <Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)>
        Public Async Function AfterAttribute() As Task
            Await VerifyRecommendationsContainAsync(<File><AttributeApplication> |</File>, "Structure")
        End Function
    End Class
End Namespace


text:
GitBunker
=========

GitBunker is a set of tools to allow you to manage access to you host's
repositories. The main purpose is to manage a database (sqlite3) with ssh-keys
and a DB for user rights on specific repository (per group of user, or
individualy).

There are 4 major products
* the library which provide you a common interface to use the product
* a CLI interface to add/create/list data bases
* the AuthorizedKeysCommand for openssh (see below)
* the gitbunker-shell for git remote requests (see below)

Library
=======

Database
--------

This is the common interfaces to manage the authorized keys to access an
account on the host.

GitCommand
----------

TODO

BINARY
======

bunkerdb
--------

The CLI interface to create database, add/get/del user.

    nicolas@gitbunker.com$ bunkerdb create nicolas
    nicolas@gitbunker.com$ bunkerdb add nicolas <nicolas' key> "nicolas"
    nicolas@gitbunker.com$ bunkerdb add nicolas <vincent's key> "vincent" "check_hituserright vincent"

So, I created a database of authorized keys for the nicolas user with two
entries:
* One for Nicolas with his given key. So he can connect through ssh to
the nicolas@gitbunker.com.
* One for Vincent with his given key and a command. This command will be used
  by the ssh daemon

check\_authorizedkeys
---------------------

This is the OpenSSH interface. It's only to read the database and returns the
authorized keys for a given host's user.

It returns the content of the appropriate database. This is the same output as
the default authorized keys flat file (.ssh/authorized\_keys).

    nicolas@gitbunker.com: check_authorizedkeys nicolas
    <nicolas' key>
    <vincent's key> command="check_hituserright vincent"

How to Install:
* create a user without login: *useradd -s /usr/sbin/nologin bunkerkeys*
* create the directory in */var/lib/bunkerDB* with authorization to read/write
  for bunkerkeys
* add the given options in */etc/ssh/sshd\_config*:
  * AuthorizedKeysCommand /usr/local/bin/check\_authorizedkeys
  * AuthorizedKeysCommandUser bunkerkeys
* reload (or restart) the ssh deamon

check\_hituserright
-------------------

This is a default command to check the user's right to a repository.
In our examples, it will be called by the ssh daemon if needed (command	value).
If this binary knows nothing about the user ssh authorization. It only knows
the user's name (given in the command line). It will only check if a user is
allowed to access a repository and how he can access it (read only,
read/write...).

redpajama_set_name: RedPajamaGithub


text:
//
//  Copyright © 2016 Zello. All rights reserved.
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace APITest
{
    class Program
    {
        static APITest apiTest;

        static void Main(string[] args)
        {
            MainAsync().Wait();
        }

        static async Task MainAsync()
        {
            // Input your host url or IP address and your API key.
            apiTest = new APITest("https://testing.zellowork.com/", "QSAEV6ZUGJ4BEJJNW49CUL6ALM70XGN7");
            // Input the administrative username/password combination.
            await apiTest.startTesting("admin", "secret");

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
    }
}


text:
    <title>Servlet with Swagger using XML DSL </title>

This example shows how to use Servlet REST to define REST endpoints in Camel routes using the Rest DSL in XML,
and using camel-swagger-java to expose the REST service APIs.

This example is implemented in XML DSL.

The XML DSL the routes are define in XML code, in the <tt>src/main/resources/camel.xml</tt> file.

There is a order REST service that supports the following operations

GET /order/{id} - to view an order with the given id

POST /order - to create an order

PUT /order - to update an order

DELETE /order/{id} - to delete an order

From a web browser you can access the first service using the following links

order/1 - to view the order with id 1

order/2 - to view the order with id 2

From the command shell you can use curl to access the service as shown below:

    curl -X GET -H "Accept: application/json" http://localhost:8080/chapter10-servlet-swagger-xml/rest/orders/1
    curl -X GET -H "Accept: application/json" http://localhost:8080/chapter10-servlet-swagger-xml/rest/orders/2
    curl -X POST -H "Content-Type: application/json" -d '{ "partName": "brake", "amount": 4, "customerName": "nissan" }' http://localhost:8080/chapter10-servlet-swagger-xml/rest/orders

The example comes with Swagger API documentation which you can access from the following url:

  http://localhost:8080/chapter10-servlet-swagger-xml/rest/api-doc/camel-1


text:
import uuid

print(uuid.uuid4())


text:
typedef unsigned int   u32int;
typedef          int   s32int;
typedef unsigned short u16int;
typedef          short s16int;
typedef unsigned char  u8int;
typedef          char  s8int;

void outb(u16int port, u8int value);
u8int inb(u16int port);
u16int inw(u16int port);

#endif


text:
package ch.smartclue.docker.validation;

import java.util.List;
import java.util.Map;
import java.util.Scanner;

import ch.smartclue.docker.exception.DockerComposeValidationException;
import ch.smartclue.docker.exception.YamlParsingException;
import ch.smartclue.docker.reader.StructureReader;
import ch.smartclue.docker.yml.generic.DockerComposeVersion;

class ValidatorFactory {

	public static Validator create(String content, ValidatorManager validatorManager) throws DockerComposeValidationException {
		Scanner scanner = null;

		try {
			scanner = new Scanner(content);
			if (scanner.hasNextLine()) {
				StructureReader structureReader = new StructureReader();
				Map<String, Object> structure = structureReader.readStructure(content);

				if (isVersion2(structure)){
					List<ValidatorInstance> instances = validatorManager.getValidatorInstancesByVersion(DockerComposeVersion.ALL,DockerComposeVersion.V2);
					return new ValidatorV2Impl(instances, new ValidationExecutor(), structure);
				} else {
					List<ValidatorInstance> instances = validatorManager.getValidatorInstancesByVersion(DockerComposeVersion.ALL,	DockerComposeVersion.V1);
					return new ValidatorV1Impl(instances, new ValidationExecutor(), structure);
				}
			}
		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}

		throw new IllegalArgumentException("No Content in YAML File found!");
	}

	private static boolean isVersion2(Map<String, Object> structure) {

		if (structure.containsKey("/version")){
			String value = structure.get("/version").toString();
			if ("2".equals(value)){
				return true;
			}else{
				throw new YamlParsingException(value + " is no valid version!");
			}
		}

		return false;
	}
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Kew Bull. 16(2): 236 (1962)

#### Original name
Entoloma chloroxanthum G. Stev., 1962

### Remarks
null


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum TrdRegTimestampType implements org.f1x.api.message.types.ByteEnum {
	EXECUTION_TIME((byte)'1'),
	TIME_IN((byte)'2'),
	TIME_OUT((byte)'3'),
	BROKER_RECEIPT((byte)'4'),
	BROKER_EXECUTION((byte)'5');

	private final byte code;

	TrdRegTimestampType (byte code) {
		this.code  = code;
	}

	public byte getCode() { return code; }

	public static TrdRegTimestampType parse(String s) {
		switch(s) {
			case "1" : return EXECUTION_TIME;
			case "2" : return TIME_IN;
			case "3" : return TIME_OUT;
			case "4" : return BROKER_RECEIPT;
			case "5" : return BROKER_EXECUTION;
		}
		return null;
	}

}


text:
/*
 * This file contains private information about the H5L module
 * for dealing with links in an HDF5 file.
 */
#ifndef _H5Lprivate_H
#define _H5Lprivate_H

/* Include package's public header */
#include "H5Lpublic.h"

/* Private headers needed by this file */
#include "H5Gprivate.h"		/* Groups				*/
#include "H5Oprivate.h"		/* Object headers			*/

/**************************/
/* Library Private Macros */
/**************************/

/* Default number of soft links to traverse */
#define H5L_NUM_LINKS   16

/* ========  Link creation property names ======== */
#define H5L_CRT_INTERMEDIATE_GROUP_NAME         "intermediate_group" /* Create intermediate groups flag */

/* ========  Link access property names ======== */
#define H5L_ACS_NLINKS_NAME        "max soft links"         /* Number of soft links to traverse */
#define H5L_ACS_ELINK_PREFIX_NAME  "external link prefix"   /* External link prefix */
#define H5L_ACS_ELINK_FAPL_NAME    "external link fapl"     /* file access property list for external link access */
#define H5L_ACS_ELINK_FLAGS_NAME   "external link flags"    /* file access flags for external link traversal */
#define H5L_ACS_ELINK_CB_NAME      "external link callback" /*  callback function for external link traversal */

/****************************/
/* Library Private Typedefs */
/****************************/

/* Structure for external link traversal callback property */
typedef struct H5L_elink_cb_t {
    H5L_elink_traverse_t      func;
    void                      *user_data;
} H5L_elink_cb_t;

/*****************************/
/* Library Private Variables */
/*****************************/

/******************************/
/* Library Private Prototypes */
/******************************/

/* General operations on links */
H5_DLL herr_t H5L_init(void);
H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name,
    H5G_loc_t *obj_loc, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name,
    H5O_obj_create_t *ocrt_info, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name,
    const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id,
    hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *cur_loc,
    const char *cur_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id);
H5_DLL hid_t H5L_get_default_lcpl(void);
H5_DLL herr_t H5L_move(H5G_loc_t *src_loc, const char *src_name,
    H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag,
    hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name,
    H5L_info_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id,
    hid_t dxpl_id);
H5_DLL herr_t H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/,
    size_t size, hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5L_register_external(void);

/* User-defined link functions */
H5_DLL herr_t H5L_register(const H5L_class_t *cls);
H5_DLL herr_t H5L_unregister(H5L_type_t id);
H5_DLL const H5L_class_t *H5L_find_class(H5L_type_t id);

#endif /* _H5Lprivate_H */


text:
import unittest

import appium
import mock
from webdriverremotemock import WebdriverRemoteMock

from AppiumLibrary import _ApplicationManagementKeywords

class ApplicationManagementKeywordsTests(unittest.TestCase):

    def test_close_application_clean_cache_sucessful(self):
        am = _ApplicationManagementKeywords()
        application = mock.Mock()
        am._debug = mock.Mock()
        self.assertFalse(am._cache.current)
        am._cache.register(application, 'alias')
        self.assertTrue(am._cache.current)

        am.close_application()
        self.assertFalse(am._cache.current)

    def test_open_application_register_sucessful(self):
        am = _ApplicationManagementKeywords()
        #appium.webdriver.Remote = mock.Mock()
        appium.webdriver.Remote = WebdriverRemoteMock
        am._debug = mock.Mock()
        self.assertFalse(am._cache.current)
        am.open_application('remote_url')
        self.assertTrue(am._cache.current)

    def test_switch_application(self):
        am = _ApplicationManagementKeywords()
        appium.webdriver.Remote = WebdriverRemoteMock
        am._debug = mock.Mock()
        self.assertFalse(am._cache.current)
        self.assertEqual(1, am.open_application('remote_url1', alias='app1'))
        self.assertEqual(2, am.open_application('remote_url1', alias='app2'))
        self.assertEqual(2, am._cache.current_index)
        am.switch_application('app1')
        self.assertEqual(1, am._cache.current_index)
        am.switch_application(2)
        self.assertEqual(2, am._cache.current_index)
        self.assertEqual(2, am.switch_application(None))


text:
<?php builddiv_start(1, $lang['login']);

// If the user is not logged in, we need to check
// first if there is an error (IE: Login does not equal 1)
if($Account->isLoggedIn() == FALSE)
{
	if(isset($Login) && $Login != 1)
	{
		if($Login == 0) # Username not found
		{
			output_message('error', $lang['username_doesnt_exist']);
		}
		elseif($Login == 2) # some params emtpy
		{
			output_message('validation', $lang['some_params_empty']);
		}
		elseif($Login == 3) # Password is wrong
		{
			output_message('validation', $lang['wrong_password']);
		}
		elseif($Login == 4) # Account Banned
		{
			output_message('error', $lang['account_banned']);
		}
		elseif($Login == 5) # Account not activated
		{
			output_message('warning', $lang['account_not_activated']);
		}
	}
?>

				<form method="post" action="<?php echo mw_url('account', 'login'); ?>">
				<input type="hidden" name="action" value="login">

						<?php echo $lang['username'] ?> <input type="text" size="26" style="font-size:11px;" name="login">

						<?php echo $lang['password'] ?> <input type="password" size="26" style="font-size:11px;" name="pass">

						<input type="submit" size="16" class="button" style="font-size:12px;" value="<?php echo $lang['login'] ?>">

				</form>

<?php
}
else
{
    echo "

Welcome ".$user['username']."
".$lang['now_logged_in']."

";
}
?>
<?php builddiv_end() ?>


text:
using ::testing::_;
using ::testing::AnyNumber;
using ::testing::DoAll;
using ::testing::Expectation;
using ::testing::InvokeWithoutArgs;
using ::testing::SaveArg;

namespace media {
class VideoFrame;
}  // namespace media

namespace content {
namespace {

const int kFrameRate = 30;

class MockDeviceClient : public media::VideoCaptureDevice::Client {
 public:
  MOCK_METHOD5(OnIncomingCapturedData,
               void(const uint8* data,
                    int length,
                    const media::VideoCaptureFormat& frame_format,
                    int rotation,
                    const base::TimeTicks& timestamp));
  MOCK_METHOD9(OnIncomingCapturedYuvData,
               void (const uint8* y_data,
                     const uint8* u_data,
                     const uint8* v_data,
                     size_t y_stride,
                     size_t u_stride,
                     size_t v_stride,
                     const media::VideoCaptureFormat& frame_format,
                     int clockwise_rotation,
                     const base::TimeTicks& timestamp));
  MOCK_METHOD2(ReserveOutputBuffer,
               scoped_refptr<Buffer>(media::VideoPixelFormat format,
                                     const gfx::Size& dimensions));
  MOCK_METHOD3(OnIncomingCapturedVideoFrame,
               void(const scoped_refptr<Buffer>& buffer,
                    const scoped_refptr<media::VideoFrame>& frame,
                    const base::TimeTicks& timestamp));
  MOCK_METHOD1(OnError, void(const std::string& reason));
};

// Test harness that sets up a minimal environment with necessary stubs.
class DesktopCaptureDeviceAuraTest : public testing::Test {
 public:
  DesktopCaptureDeviceAuraTest()
      : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {}
  ~DesktopCaptureDeviceAuraTest() override {}

 protected:
  void SetUp() override {
    // The ContextFactory must exist before any Compositors are created.
    bool enable_pixel_output = false;
    ui::ContextFactory* context_factory =
        ui::InitializeContextFactoryForTests(enable_pixel_output);
    helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
    helper_->SetUp(context_factory);
    new wm::DefaultActivationClient(helper_->root_window());

    // We need a window to cover desktop area so that DesktopCaptureDeviceAura
    // can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the
    // root window associated with the primary display.
    gfx::Rect desktop_bounds = root_window()->bounds();
    window_delegate_.reset(new aura::test::TestWindowDelegate());
    desktop_window_.reset(new aura::Window(window_delegate_.get()));
    desktop_window_->Init(ui::LAYER_TEXTURED);
    desktop_window_->SetBounds(desktop_bounds);
    aura::client::ParentWindowWithContext(
        desktop_window_.get(), root_window(), desktop_bounds);
    desktop_window_->Show();
  }

  void TearDown() override {
    helper_->RunAllPendingInMessageLoop();
    root_window()->RemoveChild(desktop_window_.get());
    desktop_window_.reset();
    window_delegate_.reset();
    helper_->TearDown();
    ui::TerminateContextFactoryForTests();
  }

  aura::Window* root_window() { return helper_->root_window(); }

 private:
  base::MessageLoopForUI message_loop_;
  BrowserThreadImpl browser_thread_for_ui_;
  scoped_ptr<aura::test::AuraTestHelper> helper_;
  scoped_ptr<aura::Window> desktop_window_;
  scoped_ptr<aura::test::TestWindowDelegate> window_delegate_;

  DISALLOW_COPY_AND_ASSIGN(DesktopCaptureDeviceAuraTest);
};

TEST_F(DesktopCaptureDeviceAuraTest, StartAndStop) {
  scoped_ptr<media::VideoCaptureDevice> capture_device(
      DesktopCaptureDeviceAura::Create(
          content::DesktopMediaID::RegisterAuraWindow(root_window())));

  scoped_ptr<MockDeviceClient> client(new MockDeviceClient());
  EXPECT_CALL(*client, OnError(_)).Times(0);

  media::VideoCaptureParams capture_params;
  capture_params.requested_format.frame_size.SetSize(640, 480);
  capture_params.requested_format.frame_rate = kFrameRate;
  capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420;
  capture_device->AllocateAndStart(capture_params, client.Pass());
  capture_device->StopAndDeAllocate();
}

}  // namespace
}  // namespace content


text:
#ifndef SHA256_H
#define SHA256_H

// Taken from http://www.zedwood.com/article/cpp-sha256-function
// Significant changes (Braedy Kuzma):
//   - removed std::string sha256(std::string input)
//   - added SHA256Hash class which is a light wrapper around a digest
//   - added SHA256Hash::ptr sha256(std::ifstream &file)
//   - added ostream overloads for printing SHA256Hash

#include <memory>
#include <set>

class SHA256
{
protected:
    typedef unsigned char uint8;
    typedef unsigned int uint32;
    typedef unsigned long long uint64;

    const static uint32 sha256_k[];
    static const unsigned int SHA224_256_BLOCK_SIZE = (512/8);
public:
    void init();
    void update(const unsigned char *message, unsigned int len);
    void final(unsigned char *digest);
    static const unsigned int DIGEST_SIZE = ( 256 / 8);

protected:
    void transform(const unsigned char *message, unsigned int block_nb);
    unsigned int m_tot_len;
    unsigned int m_len;
    unsigned char m_block[2*SHA224_256_BLOCK_SIZE];
    uint32 m_h[8];
};

// TODO Test the comparison function
//! Light wrapper around SHA256 digest.
class SHA256Hash {
  //! The actual digest bits.
  uint8_t buff[SHA256::DIGEST_SIZE];
public:
  //! Pointer to a hash.
  typedef std::shared_ptr<SHA256Hash> ptr;

  //! Default constructor.
  SHA256Hash() : buff() { }

  //! Constructor from uint8_t array
  SHA256Hash(const uint8_t * const bytes);

  //! Operator to offer convenient buffer access.
  uint8_t &operator[](const uint8_t i) { return buff[i]; }

  //! Operator to offer convenient buffer access.
  const uint8_t &operator[](const uint8_t i) const { return buff[i]; }

  //! Offers access to the underlying digest.
  uint8_t *get() { return (uint8_t *) &buff; }

  //! Compare function for SHA256hashes.
  static int compare(const SHA256Hash &hash1, const SHA256Hash &hash2);

  //! Convenience compare between two ptrs.
  static int compare(const ptr &hash1, const ptr &hash2) { return compare(*hash1, *hash2); }

public:
};

struct CompareHashPtrFtor {
  int operator()(const SHA256Hash::ptr p0, const SHA256Hash::ptr p1) const {
    return SHA256Hash::compare(p0, p1);
  }
};

//! A set of hashes.
/**
 * A set of hashes. Ensures that the underlying hashes are unique rather than the pointers.
 */
typedef std::set<SHA256Hash::ptr, CompareHashPtrFtor> HashSet;

//! Generates a pointer to SHA256Hash from a file.
SHA256Hash::ptr sha256(std::ifstream &file);

//! Prints a SHA256Hash by pointer (delegates to the reference version).
std::ostream &operator<<(std::ostream &os, const SHA256Hash::ptr &hashp);

//! Prints a SHA256Hash.
std::ostream& operator<<(std::ostream& os, const SHA256Hash &hash);

#define SHA2_SHFR(x, n)    (x >> n)
#define SHA2_ROTR(x, n)   ((x >> n) | (x << ((sizeof(x) << 3) - n)))
#define SHA2_ROTL(x, n)   ((x << n) | (x >> ((sizeof(x) << 3) - n)))
#define SHA2_CH(x, y, z)  ((x & y) ^ (~x & z))
#define SHA2_MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
#define SHA256_F1(x) (SHA2_ROTR(x,  2) ^ SHA2_ROTR(x, 13) ^ SHA2_ROTR(x, 22))
#define SHA256_F2(x) (SHA2_ROTR(x,  6) ^ SHA2_ROTR(x, 11) ^ SHA2_ROTR(x, 25))
#define SHA256_F3(x) (SHA2_ROTR(x,  7) ^ SHA2_ROTR(x, 18) ^ SHA2_SHFR(x,  3))
#define SHA256_F4(x) (SHA2_ROTR(x, 17) ^ SHA2_ROTR(x, 19) ^ SHA2_SHFR(x, 10))
#define SHA2_UNPACK32(x, str)                 \
{                                             \
    *((str) + 3) = (uint8) ((x)      );       \
    *((str) + 2) = (uint8) ((x) >>  8);       \
    *((str) + 1) = (uint8) ((x) >> 16);       \
    *((str) + 0) = (uint8) ((x) >> 24);       \
}
#define SHA2_PACK32(str, x)                   \
{                                             \
    *(x) =   ((uint32) *((str) + 3)      )    \
           | ((uint32) *((str) + 2) <<  8)    \
           | ((uint32) *((str) + 1) << 16)    \
           | ((uint32) *((str) + 0) << 24);   \
}
#endif


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable enable

using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Reflection.Metadata;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.RuntimeMembers
{
    /// <summary>
    /// Helper class to match signatures in format of
    /// MemberDescriptor.Signature to members.
    /// </summary>
    internal abstract class SignatureComparer<MethodSymbol, FieldSymbol, PropertySymbol, TypeSymbol, ParameterSymbol>
        where MethodSymbol : class
        where FieldSymbol : class
        where PropertySymbol : class
        where TypeSymbol : class
        where ParameterSymbol : class
    {
        /// <summary>
        /// Returns true if signature matches signature of the field.
        /// Signature should be in format described in MemberDescriptor.
        /// </summary>
        public bool MatchFieldSignature(FieldSymbol field, ImmutableArray<byte> signature)
        {
            int position = 0;

            // get the type
            bool result = MatchType(GetFieldType(field), signature, ref position);

            Debug.Assert(!result || position == signature.Length);
            return result;
        }

        /// <summary>
        /// Returns true if signature matches signature of the property.
        /// Signature should be in format described in MemberDescriptor.
        /// </summary>
        public bool MatchPropertySignature(PropertySymbol property, ImmutableArray<byte> signature)
        {
            int position = 0;

            // Get the parameter count
            int paramCount = signature[position++];

            // Get all of the parameters.
            ImmutableArray<ParameterSymbol> parameters = GetParameters(property);

            if (paramCount != parameters.Length)
            {
                return false;
            }

            bool isByRef = IsByRef(signature, ref position);
            if (IsByRefProperty(property) != isByRef)
            {
                return false;
            }

            // get the property type
            if (!MatchType(GetPropertyType(property), signature, ref position))
            {
                return false;
            }

            // Match parameters
            foreach (ParameterSymbol parameter in parameters)
            {
                if (!MatchParameter(parameter, signature, ref position))
                {
                    return false;
                }
            }

            Debug.Assert(position == signature.Length);
            return true;
        }

        /// <summary>
        /// Returns true if signature matches signature of the method.
        /// Signature should be in format described in MemberDescriptor.
        /// </summary>
        public bool MatchMethodSignature(MethodSymbol method, ImmutableArray<byte> signature)
        {
            int position = 0;

            // Get the parameter count
            int paramCount = signature[position++];

            // Get all of the parameters.
            ImmutableArray<ParameterSymbol> parameters = GetParameters(method);

            if (paramCount != parameters.Length)
            {
                return false;
            }

            bool isByRef = IsByRef(signature, ref position);

            if (IsByRefMethod(method) != isByRef)
            {
                return false;
            }

            // get the return type
            if (!MatchType(GetReturnType(method), signature, ref position))
            {
                return false;
            }

            // Match parameters
            foreach (ParameterSymbol parameter in parameters)
            {
                if (!MatchParameter(parameter, signature, ref position))
                {
                    return false;
                }
            }

            Debug.Assert(position == signature.Length);
            return true;
        }

        private bool MatchParameter(ParameterSymbol parameter, ImmutableArray<byte> signature, ref int position)
        {
            bool isByRef = IsByRef(signature, ref position);

            if (IsByRefParam(parameter) != isByRef)
            {
                return false;
            }

            return MatchType(GetParamType(parameter), signature, ref position);
        }

        private static bool IsByRef(ImmutableArray<byte> signature, ref int position)
        {
            SignatureTypeCode typeCode = (SignatureTypeCode)signature[position];

            if (typeCode == SignatureTypeCode.ByReference)
            {
                position++;
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// Does pretty much the same thing as MetadataDecoder.DecodeType only instead of
        /// producing a type symbol it compares encoded type to the target.
        ///
        /// Signature should be in format described in MemberDescriptor.
        /// </summary>
        private bool MatchType(TypeSymbol? type, ImmutableArray<byte> signature, ref int position)
        {
            if (type == null)
            {
                return false;
            }

            int paramPosition;

            // Get the type.
            SignatureTypeCode typeCode = (SignatureTypeCode)signature[position++];

            // Switch on the type.
            switch (typeCode)
            {
                case SignatureTypeCode.TypeHandle:
                    // Ecma-335 spec:
                    // 23.1.16 Element types used in signatures
                    // ...
                    // ELEMENT_TYPE_VALUETYPE 0x11 Followed by TypeDef or TypeRef token
                    // ELEMENT_TYPE_CLASS 0x12 Followed by TypeDef or TypeRef token
                    short expectedType = ReadTypeId(signature, ref position);
                    return MatchTypeToTypeId(type, expectedType);

                case SignatureTypeCode.Array:
                    if (!MatchType(GetMDArrayElementType(type), signature, ref position))
                    {
                        return false;
                    }

                    int countOfDimensions = signature[position++];

                    return MatchArrayRank(type, countOfDimensions);

                case SignatureTypeCode.SZArray:
                    return MatchType(GetSZArrayElementType(type), signature, ref position);

                case SignatureTypeCode.Pointer:
                    return MatchType(GetPointedToType(type), signature, ref position);

                case SignatureTypeCode.GenericTypeParameter:
                    paramPosition = signature[position++];
                    return IsGenericTypeParam(type, paramPosition);

                case SignatureTypeCode.GenericMethodParameter:
                    paramPosition = signature[position++];
                    return IsGenericMethodTypeParam(type, paramPosition);

                case SignatureTypeCode.GenericTypeInstance:
                    if (!MatchType(GetGenericTypeDefinition(type), signature, ref position))
                    {
                        return false;
                    }

                    int argumentCount = signature[position++];

                    for (int argumentIndex = 0; argumentIndex < argumentCount; argumentIndex++)
                    {
                        if (!MatchType(GetGenericTypeArgument(type, argumentIndex), signature, ref position))
                        {
                            return false;
                        }
                    }

                    return true;

                default:
                    throw ExceptionUtilities.UnexpectedValue(typeCode);
            }
        }

        /// <summary>
        /// Read a type Id from the signature.
        /// This may consume one or two bytes, and therefore increment the position correspondingly.
        /// </summary>
        private static short ReadTypeId(ImmutableArray<byte> signature, ref int position)
        {
            var firstByte = signature[position++];
            if (firstByte == (byte)WellKnownType.ExtSentinel)
            {
                return (short)(signature[position++] + WellKnownType.ExtSentinel);
            }
            else
            {
                return firstByte;
            }
        }

        /// <summary>
        /// Should return null in case of error.
        /// </summary>
        protected abstract TypeSymbol? GetGenericTypeArgument(TypeSymbol type, int argumentIndex);

        /// <summary>
        /// Should return null in case of error.
        /// </summary>
        protected abstract TypeSymbol? GetGenericTypeDefinition(TypeSymbol type);

        protected abstract bool IsGenericMethodTypeParam(TypeSymbol type, int paramPosition);

        protected abstract bool IsGenericTypeParam(TypeSymbol type, int paramPosition);

        /// <summary>
        /// Should only accept Pointer types.
        /// Should return null in case of error.
        /// </summary>
        protected abstract TypeSymbol? GetPointedToType(TypeSymbol type);

        /// <summary>
        /// Should return null in case of error.
        /// </summary>
        protected abstract TypeSymbol? GetSZArrayElementType(TypeSymbol type);

        /// <summary>
        /// Should only accept multi-dimensional arrays.
        /// </summary>
        protected abstract bool MatchArrayRank(TypeSymbol type, int countOfDimensions);

        /// <summary>
        /// Should only accept multi-dimensional arrays.
        /// Should return null in case of error.
        /// </summary>
        protected abstract TypeSymbol? GetMDArrayElementType(TypeSymbol type);

        protected abstract bool MatchTypeToTypeId(TypeSymbol type, int typeId);

        protected abstract TypeSymbol GetReturnType(MethodSymbol method);
        protected abstract ImmutableArray<ParameterSymbol> GetParameters(MethodSymbol method);

        protected abstract TypeSymbol GetPropertyType(PropertySymbol property);
        protected abstract ImmutableArray<ParameterSymbol> GetParameters(PropertySymbol property);

        protected abstract TypeSymbol GetParamType(ParameterSymbol parameter);

        protected abstract bool IsByRefParam(ParameterSymbol parameter);
        protected abstract bool IsByRefMethod(MethodSymbol method);
        protected abstract bool IsByRefProperty(PropertySymbol property);

        protected abstract TypeSymbol GetFieldType(FieldSymbol field);
    }
}


text:
@class InitLogicController, MMLoadingView, MMUIWindow, NSMutableArray, NSString, NSURL, PasswordLogic, ShowRatingAchive, UIAlertController, WCAccountBindPhoneControlLogic, WCOutWhatsNewViewController, WCUIAlertView;

@interface PreEnterWechatLogic : MMObject <IMMFacebookMgrExt, IAppViewControllerManagerExt, MessageObserverDelegate, whatsnewViewDelegateEx, initLogicControllerDelegate, UIAlertViewDelegate, MMKernelExt, WCAccountBindPhoneControlLogicDelegate, IMsgExt, WCAccountSetPasswordViewControllerDelegate, PasswordLogicDelegate>
{
    vector_a9c0768e m_vecMesssageIdToListen;
    NSURL *m_nsFeedBackUrl;
    InitLogicController *m_initLogicController;
    MMLoadingView *m_loadingView;
    _Bool m_bCalledPreEnterWechatDone;
    _Bool m_bRunning;
    ShowRatingAchive *m_oShowingRating;
    WCAccountBindPhoneControlLogic *m_bindPhoneLogic;
    WCAccountBindPhoneControlLogic *m_changePhoneLogic;
    WCOutWhatsNewViewController *m_WhatsnewViewController;
    MMUIWindow *m_window;
    NSMutableArray *m_nsArrSteps;
    PasswordLogic *m_setPasswdLogic;
    PasswordLogic *m_changePasswdLogic;
    UIAlertController *m_globalAlertController;
    WCUIAlertView *m_globalAlert;
}

- (id).cxx_construct;
- (void).cxx_destruct;
- (void)onTabBarRootViewControllerDidAppear;
- (void)showGlobalAlert;
- (void)parseGlobalAlert:(id)arg1;
- (void)startChangePassward:(id)arg1 clickedButtonAtIndex:(id)arg2;
- (void)startChangePassward;
- (void)showScan:(id)arg1 clickedButtonAtIndex:(id)arg2;
- (void)showScan;
- (void)showChangePhone:(id)arg1 clickedButtonAtIndex:(id)arg2;
- (void)showChangePhone;
- (void)showWebView:(id)arg1 clickedButtonAtIndex:(id)arg2;
- (void)showWebView:(id)arg1;
- (void)cancelAlert:(id)arg1 clickedButtonAtIndex:(id)arg2;
- (void)globalAlertReport:(id)arg1 Btn:(id)arg2;
- (void)tryShowWhatsNew;
- (void)showWhatsNewEnd;
- (void)showWhatsNewWillEnd;
- (void)showCHSWhatsNew;
- (void)handleInitAndPhoneSync;
- (void)stopIniting:(unsigned int)arg1;
- (void)handleInitOk;
- (void)percentIniting:(id)arg1;
- (void)stopLoading;
- (void)startLoading;
- (void)checkBindPhone:(id)arg1;
- (void)showBindPhoneInfoView:(id)arg1;
- (void)bindPhoneReturn;
- (void)onWCAccountBindPhoneControlLogicStop:(id)arg1;
- (void)showSyncAddrAlert;
- (void)onGetUpdateInfoOk;
- (void)MessageReturn:(unsigned int)arg1 MessageInfo:(id)arg2 Event:(unsigned int)arg3;
- (void)alertView:(id)arg1 clickedButtonAtIndex:(long long)arg2;
- (void)delayLoadAndCheck;
- (void)checkUpdateTabbarBadgeNum;
- (void)checkUpdateNewVersionTip:(_Bool)arg1;
- (void)preShowSystemPush;
- (void)preLoadContacts;
- (void)restoreContactDraft;
- (void)fixContactPlugin;
- (void)openFeedBackWapPage:(id)arg1;
- (void)tryShowPswdView:(id)arg1;
- (void)showSetPasswordView:(id)arg1;
- (void)passwordLogicPause:(id)arg1;
- (void)passwordLogicStart:(id)arg1;
- (void)passwordLogicCancel:(id)arg1;
- (void)checkHaveNotSetPassword:(id)arg1;
- (void)verifyPasswordOK:(id)arg1 logic:(id)arg2;
- (void)verifyPasswordFail:(id)arg1;
- (void)checkHaveSetPassword:(id)arg1;
- (void)unknownFail:(id)arg1;
- (void)onSetPasswordOK;
- (void)onSetPasswordBack;
- (void)OnGetNewXmlMsg:(id)arg1 Type:(id)arg2 MsgWrap:(id)arg3;
- (void)callPreEnterWechatDone;
- (void)enterForeground;
- (void)onTimeChange;
- (void)dealloc;
- (void)checkStartSteps;
- (void)startSteps:(id)arg1;
- (id)initFromReg:(_Bool)arg1;
- (void)goNext;
- (void)closeFirstView;
- (void)openFirstView;
- (void)initSeviceObject;
- (void)initMessageIdToListen;
- (void)onForFeedbackYes;
- (void)onForFeedbackNo;
- (void)onFirstAskNo;
- (void)onFirstAskYes;
- (void)onFirstAskForRatingNo;
- (void)onFirstAskForRatingYes;
- (void)onRatingReport:(unsigned int)arg1;
- (void)onShowRatingDone;
- (void)checkShowRating;
- (void)cleanSetting;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end


text:
package org.linfeng.news.listener;

import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;

public class BackGestureListener implements OnGestureListener {

	@Override
	public boolean onDown(MotionEvent e) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
			float velocityY) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onLongPress(MotionEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
			float distanceY) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onShowPress(MotionEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean onSingleTapUp(MotionEvent e) {
		// TODO Auto-generated method stub
		return false;
	}

}


text:
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using SDKTemplate;
using System;
using System.Text;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Globalization;
using Windows.Globalization.DateTimeFormatting;

namespace DateTimeFormatting
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class TimeZoneSupport: Page
    {
        // A pointer back to the main page.  This is needed if you want to call methods in MainPage such
        // as NotifyUser()
        MainPage rootPage = MainPage.Current;

        public TimeZoneSupport()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        /// <summary>
        /// This is the click handler for the 'Display' button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Display_Click(object sender, RoutedEventArgs e)
        {
            // This scenario illustrates TimeZone support in DateTimeFormatter class

            // Displayed TimeZones (other than local timezone)
            String[] timeZones = new String[] { "UTC", "America/New_York", "Asia/Kolkata" };

            // Store results here.
            StringBuilder results = new StringBuilder();

            // Create formatter object using longdate and longtime template
            DateTimeFormatter formatter = new DateTimeFormatter("longdate longtime");

            // Create date/time to format and display.
            DateTime dateTime = DateTime.Now;

            // Show current time in timezones desired to be displayed including local timezone
            results.AppendLine("Current date and time -");
            results.AppendLine("In Local timezone:   " + formatter.Format(dateTime));
            foreach (String timeZone in timeZones)
            {
                results.AppendLine("In " + timeZone + " timezone:   " + formatter.Format(dateTime, timeZone));
            }
            results.AppendLine();

            // Show a time on 14th day of second month of next year in local, and other desired Time Zones
            // This will show if there were day light savings in time
            results.AppendLine("Same time on 14th day of second month of next year -");
            dateTime = new DateTime(dateTime.Year + 1, 2, 14, dateTime.Hour, dateTime.Minute, dateTime.Second);
            results.AppendLine("In Local timezone:   " + formatter.Format(dateTime));
            foreach (String timeZone in timeZones)
            {
                results.AppendLine("In " + timeZone + " timezone:   " + formatter.Format(dateTime, timeZone));
            }
            results.AppendLine();

            // Show a time on 14th day of 10th month of next year in local, and other desired Time Zones
            // This will show if there were day light savings in time
            results.AppendLine("Same time on 14th day of tenth month of next year -");
            dateTime = dateTime.AddMonths(8);
            results.AppendLine("In Local timezone:   " + formatter.Format(dateTime));
            foreach (String timeZone in timeZones)
            {
                results.AppendLine("In " + timeZone + " timezone:   " + formatter.Format(dateTime, timeZone));
            }
            results.AppendLine();

            // Display the results
            OutputTextBlock.Text = results.ToString();
        }

    }
}


text:
#ifndef __PEER_H__
#define __PEER_H__

#include "basic_defs.h"
#include "bitc_ui.h"

struct peer_addr;
struct circlist_item;
struct peer;

const char *peer_name(const struct peer *peer);
const char *peer_name_li(struct circlist_item *li);

void peer_add(struct peer_addr *paddr, int seq);
int peer_check_liveness(struct circlist_item *li, mtime_t now);
void peer_destroy(struct circlist_item *li, int err);
int peer_getinfo(struct circlist_item *item, struct bitcui_peer *pinfo);
int peer_on_ready(struct peer *peer);
int peer_on_ready_li(struct circlist_item *li);

int peer_send_inv(struct circlist_item *item, struct buff *buf);
int peer_send_getheaders(struct peer *peer);
int peer_send_getblocks(struct peer *peer);
int peer_send_mempool(struct peer *peer);
int peer_send_getdata(struct peer *peer, enum btc_inv_type type,
                      const uint256 *hash, int numHash);

#endif /* __PEER_H__ */


text:
import os
import ctypes
import logging

# the OpenGL module loves spewing things into logs, and for some reason
# when running in maya 2012 the default log level allows info messages through.
# so we set a specific log level on the OpenGL logger to keep it quiet.
logging.getLogger( "OpenGL" ).setLevel( logging.WARNING )

import IECore

import Gaffer
import GafferUI

# import lazily to improve startup of apps which don't use GL functionality
GL = Gaffer.lazyImport( "OpenGL.GL" )
IECoreGL = Gaffer.lazyImport( "IECoreGL" )

QtCore = GafferUI._qtImport( "QtCore" )
QtGui = GafferUI._qtImport( "QtGui" )
QtOpenGL = GafferUI._qtImport( "QtOpenGL", lazy=True )

## The GLWidget is a base class for all widgets which wish to draw using OpenGL.
# Derived classes override the _draw() method to achieve this.
class GLWidget( GafferUI.Widget ) :

	## This enum defines the optional elements of the GL buffer used
	# for display.
	BufferOptions = IECore.Enum.create(
		"Alpha",
		"Depth",
		"Double"
	)

	## Note that you won't always get the buffer options you ask for - a best fit is found
	# among the available formats. In particular it appears that a depth buffer is often present
	# even when not requested.
	def __init__( self, bufferOptions = set(), **kw ) :

		format = QtOpenGL.QGLFormat()
		format.setRgba( True )

		format.setAlpha( self.BufferOptions.Alpha in bufferOptions )
		format.setDepth( self.BufferOptions.Depth in bufferOptions )
		format.setDoubleBuffer( self.BufferOptions.Double in bufferOptions )

		if hasattr( format, "setVersion" ) : # setVersion doesn't exist in qt prior to 4.7.
			format.setVersion( 2, 1 )

		graphicsView = _GLGraphicsView( format )
		self.__graphicsScene = _GLGraphicsScene( graphicsView, Gaffer.WeakMethod( self._draw ) )
		graphicsView.setScene( self.__graphicsScene )

		GafferUI.Widget.__init__( self, graphicsView, **kw )

	## Adds a Widget as an overlay.
	## \todo Support more than one overlay, and provide grid-based
	# placement options. Perhaps GLWidget should also derive from Container
	# to support auto-parenting and appropriate removeChild() behaviour.
	def addOverlay( self, overlay ) :

		assert( overlay.parent() is None )

		self.__overlay = overlay
		self.__overlay._setStyleSheet()

		item = self.__graphicsScene.addWidget( self.__overlay._qtWidget() )

	## Called whenever the widget is resized. May be reimplemented by derived
	# classes if necessary.
	def _resize( self, size ) :

		GL.glViewport( 0, 0, size.x, size.y )

	## Derived classes must override this to draw their contents using
	# OpenGL calls.
	def _draw( self ) :

		pass

	## Derived classes may call this when they wish to trigger a redraw.
	def _redraw( self ) :

		self._glWidget().update()

	## May be used by derived classes to get access to the internal
	# QGLWidget - this can be useful for making the correct context current.
	def _glWidget( self ) :

		return self._qtWidget().viewport()

class _GLGraphicsView( QtGui.QGraphicsView ) :

	def __init__( self, format ) :

		QtGui.QGraphicsView.__init__( self )

		self.setObjectName( "gafferGLWidget" )
		self.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff )
		self.setVerticalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff )

		glWidget = self.__createQGLWidget( format )

		self.setViewport( glWidget )
		self.setViewportUpdateMode( self.FullViewportUpdate )

	def resizeEvent( self, event ) :

		if self.scene() is not None :
			self.scene().setSceneRect( 0, 0, event.size().width(), event.size().height() )
			self.viewport().makeCurrent()
			GafferUI.Widget._owner( self )._resize( IECore.V2i( event.size().width(), event.size().height() ) )

	def keyPressEvent( self, event ) :

		# We have to reimplement this method to prevent QAbstractScrollArea
		# from stealing the cursor keypresses, preventing them from
		# being used by GLWidget subclasses. QAbstractScrollArea uses
		# those keypresses to move the scrollbars, but we don't want the
		# scrolling functionality at all. Our implementation of this method
		# is functionally identical to the QGraphicsView one, except it
		# passes unused events to QFrame, bypassing QAbstractScrollArea.

		if self.scene() is not None and self.isInteractive() :
			QtGui.QApplication.sendEvent( self.scene(), event )
			if event.isAccepted() :
				return

		QtGui.QFrame.keyPressEvent( self, event )

	# We keep a single hidden widget which owns the texture and display lists
	# and then share those with all the widgets we really want to make.
	__shareWidget = None
	@classmethod
	def __createQGLWidget( cls, format ) :

		# try to make a host specific widget if necessary.
		result = cls.__createMayaQGLWidget( format )
		if result is not None :
			return result

		# and if it wasn't necessary, just breathe a sigh of relief
		# and make a nice normal one.
		if cls.__shareWidget is None :
			cls.__shareWidget = QtOpenGL.QGLWidget()

		return QtOpenGL.QGLWidget( format, shareWidget = cls.__shareWidget )

	@classmethod
	def __createMayaQGLWidget( cls, format ) :

		# We want to be able to share OpenGL resources between gaffer uis
		# and maya viewport uis, because IECoreGL will be used in both.
		# So we implement our own QGLContext class which creates a context
		# which shares with maya.

		try :
			import maya.OpenMayaRender
		except ImportError :
			# we're not in maya - createQGLWidget() will just make a
			# normal widget.
			return None

		import OpenGL.GLX

		# This is our custom context class which allows us to share gl
		# resources with maya's contexts. We define it in here rather than
		# at the top level because we want to import QtOpenGL lazily and
		# don't want to trigger a full import until the last minute.
		## \todo Call glXDestroyContext appropriately, although as far as I
		# can tell this is impossible. The base class implementation calls it
		# in reset(), but that's not virtual, and we can't store it in d->cx
		# (which is what the base class destroys) because that's entirely
		# on the C++ side of things.
		class MayaGLContext( QtOpenGL.QGLContext ) :

			def __init__( self, format, paintDevice ) :

				QtOpenGL.QGLContext.__init__( self, format, paintDevice )

				self.__paintDevice = paintDevice
				self.__context = None

			def chooseContext( self, shareContext ) :

				assert( self.__context is None )

				# We have to call this to get d->vi set in the base class, because
				# QGLWidget::setContext() accesses it directly, and will crash if we don't.
				QtOpenGL.QGLContext.chooseContext( self, shareContext )

				# Get maya's global resource context - we'll create our context
				# to be sharing with this one.
				import maya.OpenMayaRender
				mayaRenderer = maya.OpenMayaRender.MHardwareRenderer.theRenderer()
				mayaRenderer.makeResourceContextCurrent( mayaRenderer.backEndString() )
				mayaResourceContext = OpenGL.GLX.glXGetCurrentContext()
				self.__display = OpenGL.GLX.glXGetCurrentDisplay()

				# Get a visual - we let the base class figure this out, but then we need
				# to convert it from the form given by the qt bindings into the ctypes form
				# needed by PyOpenGL.
				visual = self.chooseVisual()
				visual = ctypes.cast( int( visual ), ctypes.POINTER( OpenGL.raw._GLX.XVisualInfo ) )

				# Make our context.
				self.__context = OpenGL.GLX.glXCreateContext(
					OpenGL.GLX.glXGetCurrentDisplay()[0],
					visual,
					OpenGL.GLX.glXGetCurrentContext(),
					True
				)

				return True

			def makeCurrent( self ) :

				success = OpenGL.GLX.glXMakeCurrent( self.__display, self.__paintDevice.effectiveWinId(), self.__context )
				assert( success )

		result = QtOpenGL.QGLWidget()
		result.setContext( MayaGLContext( format, result ) )
		return result

class _GLGraphicsScene( QtGui.QGraphicsScene ) :

	def __init__( self, parent, backgroundDrawFunction ) :

		QtGui.QGraphicsScene.__init__( self, parent )

		self.__backgroundDrawFunction = backgroundDrawFunction
		self.sceneRectChanged.connect( self.__sceneRectChanged )

	def addWidget( self, widget ) :

		if widget.layout() is not None :
			# removing the size constraint is necessary to keep the widget the
			# size we tell it to be in __updateItemGeometry.
			widget.layout().setSizeConstraint( QtGui.QLayout.SetNoConstraint )

		item = QtGui.QGraphicsScene.addWidget( self, widget )
		self.__updateItemGeometry( item, self.sceneRect() )

		return item

	def drawBackground( self, painter, rect ) :

		# we need to call the init method after a GL context has been
		# created, and this seems like the only place that is guaranteed.
		# calling it here does mean we call init() way more than needed,
		# but it's safe.
		IECoreGL.init( True )

		self.__backgroundDrawFunction()

	def __sceneRectChanged( self, sceneRect ) :

		for item in self.items() :
			self.__updateItemGeometry( item, sceneRect )

	def __updateItemGeometry( self, item, sceneRect ) :

		geometry = item.widget().geometry()
		item.widget().setGeometry( QtCore.QRect( 0, 0, sceneRect.width(), item.widget().sizeHint().height() ) )


text:
package static

import (
	"fmt"
	"io"
	"io/fs"
	"net/http"
	"os"
	"path"
	"path/filepath"
	"strings"
	"time"

	assetfs "github.com/elazarl/go-bindata-assetfs"
	platform "github.com/influxdata/influxdb/v2"
)

const (
	// defaultFile is the default UI asset file that will be served if no other
	// static asset matches. This is particularly useful for serving content
	// related to a SPA with client-side routing.
	defaultFile = "index.html"

	// embedBaseDir is the prefix for files in the bundle with the binary.
	embedBaseDir = "data"

	// uiBaseDir is the directory in embedBaseDir where the built UI assets
	// reside.
	uiBaseDir = "build"

	// swaggerFile is the name of the swagger JSON.
	swaggerFile = "swagger.json"

	// fallbackPathSlug is the path to re-write on the request if the requested
	// path does not match a file and the default file is served. For telemetry
	// and metrics reporting purposes.
	fallbackPathSlug = "/:fallback_path"
)

// NewAssetHandler returns an http.Handler to serve files from the provided
// path. If no --assets-path flag is used when starting influxd, the path will
// be empty and files are served from the embedded filesystem.
func NewAssetHandler(assetsPath string) http.Handler {
	var fileOpener http.FileSystem

	if assetsPath == "" {
		fileOpener = &assetfs.AssetFS{
			Asset:     Asset,
			AssetDir:  AssetDir,
			AssetInfo: AssetInfo,
			Prefix:    filepath.Join(embedBaseDir, uiBaseDir),
		}
	} else {
		fileOpener = http.FS(os.DirFS(assetsPath))
	}

	return mwSetCacheControl(assetHandler(fileOpener))
}

// NewSwaggerHandler returns an http.Handler to serve the swaggerFile from the
// embedBaseDir. If the swaggerFile is not found, returns a 404.
func NewSwaggerHandler() http.Handler {
	fileOpener := &assetfs.AssetFS{
		Asset:     Asset,
		AssetDir:  AssetDir,
		AssetInfo: AssetInfo,
		Prefix:    embedBaseDir,
	}

	return mwSetCacheControl(swaggerHandler(fileOpener))
}

// mwSetCacheControl sets a default cache control header.
func mwSetCacheControl(next http.Handler) http.Handler {
	fn := func(w http.ResponseWriter, r *http.Request) {
		w.Header().Add("Cache-Control", "public, max-age=3600")
		next.ServeHTTP(w, r)
	}
	return http.HandlerFunc(fn)
}

// swaggerHandler returns a handler that serves the swaggerFile or returns a 404
// if the swaggerFile is not present.
func swaggerHandler(fileOpener http.FileSystem) http.Handler {
	fn := func(w http.ResponseWriter, r *http.Request) {
		f, err := fileOpener.Open(swaggerFile)
		if err != nil {
			http.Error(w, err.Error(), http.StatusNotFound)
			return
		}
		defer f.Close()

		staticFileHandler(f).ServeHTTP(w, r)
	}

	return http.HandlerFunc(fn)
}

// assetHandler returns a handler that either serves the file at that path, or
// the default file if a file cannot be found at that path. If the default file
// is served, the request path is re-written to the root path to simplify
// metrics reporting.
func assetHandler(fileOpener http.FileSystem) http.Handler {
	fn := func(w http.ResponseWriter, r *http.Request) {
		name := strings.TrimPrefix(path.Clean(r.URL.Path), "/")
		// If the root directory is being requested, respond with the default file.
		if name == "" {
			name = defaultFile
			r.URL.Path = "/" + defaultFile
		}

		// Try to open the file requested by name, falling back to the default file.
		// If even the default file can't be found, the binary must not have been
		// built with assets, so respond with not found.
		f, fallback, err := openAsset(fileOpener, name)
		if err != nil {
			http.Error(w, err.Error(), http.StatusNotFound)
			return
		}
		defer f.Close()

		// If the default file will be served because the requested path didn't
		// match any existing files, re-write the request path a placeholder value.
		// This is to ensure that metrics do not get collected for an arbitrarily
		// large range of incorrect paths.
		if fallback {
			r.URL.Path = fallbackPathSlug
		}

		staticFileHandler(f).ServeHTTP(w, r)
	}

	return http.HandlerFunc(fn)
}

// staticFileHandler sets the ETag header prior to calling http.ServeContent
// with the contents of the file.
func staticFileHandler(f fs.File) http.Handler {
	fn := func(w http.ResponseWriter, r *http.Request) {
		content, ok := f.(io.ReadSeeker)
		if !ok {
			err := fmt.Errorf("could not open file for reading")
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}

		i, err := f.Stat()
		if err != nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}

		modTime, err := modTimeFromInfo(i, buildTime)
		if err != nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}

		w.Header().Set("ETag", etag(i.Size(), modTime))

		// ServeContent will automatically set the content-type header for files
		// from the extension of "name", and will also set the Last-Modified header
		// from the provided time.
		http.ServeContent(w, r, i.Name(), modTime, content)
	}

	return http.HandlerFunc(fn)
}

// openAsset attempts to open the asset by name in the given directory, falling
// back to the default file if the named asset can't be found. Returns an error
// if even the default asset can't be opened.
func openAsset(fileOpener http.FileSystem, name string) (fs.File, bool, error) {
	var fallback bool

	f, err := fileOpener.Open(name)
	if err != nil {
		if os.IsNotExist(err) {
			fallback = true
			f, err = fileOpener.Open(defaultFile)
		}
		if err != nil {
			return nil, fallback, err
		}
	}

	return f, fallback, nil
}

// modTimeFromInfo gets the modification time from an fs.FileInfo. If this
// modification time is time.Time{}, it falls back to the time returned by
// timeFunc. The modification time will only be time.Time{} if using assets
// embedded with go:embed.
func modTimeFromInfo(i fs.FileInfo, timeFunc func() (time.Time, error)) (time.Time, error) {
	modTime := i.ModTime()
	if modTime.IsZero() {
		return timeFunc()
	}

	return modTime, nil
}

// etag calculates an etag string from the provided file size and modification
// time.
func etag(s int64, mt time.Time) string {
	hour, minute, second := mt.Clock()
	return fmt.Sprintf(`"%d%d%d%d%d"`, s, mt.Day(), hour, minute, second)
}

func buildTime() (time.Time, error) {
	return time.Parse(time.RFC3339, platform.GetBuildInfo().Date)
}


text:
namespace Dusk {

#define DUSK_SHADER_GLOBALS_BINDING 0

struct DUSK_CORE_API ShaderGlobals
{
public:

    alignas(8) vec2 Resolution;

    alignas(8) vec2 Mouse;

    alignas(4) int FrameCount;

    alignas(4) float TotalTime;

    alignas(4) float FrameSpeedRatio;

}; // struct ShaderGlobals

} // namespace Dusk

#endif // DUSK_SHADER_GLOBALS_HPP


text:
'use strict';

(function () {

   var searchForm = document.querySelector('.searchBooks')

   function listUsers (data) {
     var usersList = document.querySelector('.users')
     var data = JSON.parse(data)

     var userEmail = document.querySelector('.userEmail').innerHTML

     data.forEach((user)=> {
       if (user.local.email !== userEmail) {
        //  var li  = document.createElement("li")
         var a  = document.createElement("a")
         a.setAttribute('class', 'list-group-item user-a')
         a.setAttribute('href', `/users/${user.local.email}/books`)

         a.innerHTML = user.local.email
        //  li.append(a)
         usersList.append(a)

       }

     })
   }

   ajaxFunctions.ajaxRequest('GET', '/users', listUsers);

   function listBooks (data) {
     var booksList = document.querySelector('.books')
     booksList.innerHTML = ''
     var data = JSON.parse(data)
     console.log(data.items)
     data.items.forEach((book)=> {

       if (book.volumeInfo.imageLinks) {
         var li = document.createElement("li")
         li.setAttribute('class', 'bookLi')
         li.innerHTML = book.volumeInfo.title

         var img = document.createElement("img")
         img.setAttribute('src', book.volumeInfo.imageLinks.smallThumbnail)
         li.append(img)

         var addButton = document.createElement("button")
         addButton.innerHTML = 'Add Book'
         addButton.setAttribute('data-bookId', book.id)
         addButton.setAttribute('class', 'btn btn-default add-book-button')

         addButton.addEventListener('click', function (event) {
           console.log(this.getAttribute('data-bookId'))
           var bookId = this.getAttribute('data-bookId');
           ajaxFunctions.ajaxRequest('POST', `/addBook/${bookId}`, function (res) {
             console.log("book added", res)

           })
         })

         li.append(addButton)
         booksList.append(li)
       }

     })

   }

   searchForm.addEventListener('submit', function (event) {
     event.preventDefault()
     var search = document.querySelector('.searchTerm').value
     var booksUrl = `https://www.googleapis.com/books/v1/volumes?q=${search}&printType=books&key=AIzaSyABcubhr0IIhjhjYwOQGvzeAMnXy2SK-Hg`
     ajaxFunctions.ajaxRequest('GET', booksUrl, listBooks);

    });

})();